diff --git a/src/commands/up.rs b/src/commands/up.rs index 6eb83807..58316dff 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -1101,6 +1101,9 @@ struct CreateProjectReq { run_command: Option, paper_id: Option, clone_url: Option, + /// Fork a public GitHub repo under the authenticated account, then clone the + /// fork into the project. Takes precedence over `clone_url`. + fork_url: Option, #[serde(default)] create_folder: bool, #[serde(default)] @@ -1128,7 +1131,24 @@ async fn create_project( let create_folder = req.create_folder; let require_new_folder = req.require_new_folder; let initialize_git = req.initialize_git; + let fork_url = req.fork_url.filter(|url| !url.trim().is_empty()); let clone_url = req.clone_url.filter(|url| !url.trim().is_empty()); + // Forking a public GitHub repo takes priority: create the fork under the + // authenticated account and clone that fork, keeping the original as + // `upstream` so experiment branches push to the user's own fork. + let (clone_url, upstream_url) = match fork_url { + Some(url) => { + let (fork_owner, fork_repo) = local::github::fork_public_repo(&url) + .await + .map_err(bad_request)?; + let upstream = local::github::canonical_repo_url(&url); + ( + Some(format!("https://github.com/{fork_owner}/{fork_repo}")), + upstream, + ) + } + None => (clone_url, None), + }; let paper_id = req .paper_id .map(|paper_id| paper_id.trim().to_string()) @@ -1164,6 +1184,7 @@ async fn create_project( require_new_folder, initialize_git, clone_url, + upstream_url, shallow_clone, run_command, paper_id, diff --git a/src/local/git.rs b/src/local/git.rs index f4d97488..0ffda9b7 100644 --- a/src/local/git.rs +++ b/src/local/git.rs @@ -863,6 +863,16 @@ pub fn rename_origin_to_upstream(path: &Path) -> Result<()> { Ok(()) } +/// Set the URL of a remote, adding it if it does not yet exist. +pub fn set_remote_url(path: &Path, name: &str, url: &str) -> Result<()> { + if git(Some(path), &["remote", "get-url", name]).is_ok() { + git(Some(path), &["remote", "set-url", name, url])?; + } else { + git(Some(path), &["remote", "add", name, url])?; + } + Ok(()) +} + pub fn require_current_branch(path: &Path) -> Result { let branch = git(Some(path), &["symbolic-ref", "--quiet", "--short", "HEAD"]) .map_err(|_| anyhow!("The repository is on a detached HEAD. Check out a branch first."))?; diff --git a/src/local/github.rs b/src/local/github.rs index 6c6daddf..180b322c 100644 --- a/src/local/github.rs +++ b/src/local/github.rs @@ -153,6 +153,29 @@ pub async fn public_repo_size_kb(url: &str) -> Option { body.get("size").and_then(Value::as_u64) } +/// Fork a public GitHub repository under the currently authenticated account +/// without cloning it locally or adding a remote. Returns the fork's +/// `(owner, repo)`. +pub async fn fork_public_repo(url: &str) -> Result<(String, String)> { + let (owner, repo) = super::git::github_repository(url) + .ok_or_else(|| anyhow!("Expected a github.com URL like https://github.com/owner/repo."))?; + // `gh repo fork` is idempotent: an existing fork is reused rather than + // duplicated, so re-running against the same repo is safe. + gh( + &["repo", "fork", &format!("{owner}/{repo}")], + Duration::from_secs(120), + ) + .await?; + let login = viewer_login().await?; + Ok((login, repo)) +} + +/// Canonical `https://github.com/{owner}/{repo}` URL for an input repo URL. +pub fn canonical_repo_url(url: &str) -> Option { + let (owner, repo) = super::git::github_repository(url)?; + Some(format!("https://github.com/{owner}/{repo}")) +} + pub struct RepoMeta { pub can_push: bool, pub archived: bool, @@ -242,6 +265,23 @@ mod tests { assert!(!meta.archived); } + #[test] + fn canonical_repo_url_normalizes_github_urls() { + assert_eq!( + canonical_repo_url("https://github.com/owner/repo.git"), + Some("https://github.com/owner/repo".to_string()) + ); + assert_eq!( + canonical_repo_url("git@github.com:owner/repo.git"), + Some("https://github.com/owner/repo".to_string()) + ); + assert_eq!( + canonical_repo_url("https://github.com/owner/repo/"), + Some("https://github.com/owner/repo".to_string()) + ); + assert_eq!(canonical_repo_url("not a github url"), None); + } + #[test] fn github_api_errors_preserve_missing_and_collision_signals() { assert!(github_api_not_found("gh: Not Found (HTTP 404)")); diff --git a/src/local/projects.rs b/src/local/projects.rs index 7749613b..89d088f4 100644 --- a/src/local/projects.rs +++ b/src/local/projects.rs @@ -61,12 +61,19 @@ pub(crate) fn expand_path(path: &str) -> Result { const PAPER_PDF_NAME: &str = "paper.pdf"; +/// A repository to clone into the project, with an optional upstream to record +/// alongside it (used when the clone is a fork under the authenticated account). +struct CloneSpec<'a> { + url: &'a str, + upstream: Option<&'a str>, +} + fn prepare_path( path: &str, create_folder: bool, require_new_folder: bool, initialize_git: bool, - clone_url: Option<&str>, + clone: Option, shallow_clone: bool, paper_pdf: Option<&[u8]>, ) -> Result { @@ -84,20 +91,26 @@ fn prepare_path( } } } - if let Some(url) = clone_url.map(str::trim).filter(|url| !url.is_empty()) { + if let Some(spec) = clone.filter(|spec| !spec.url.trim().is_empty()) { if path.exists() { let mut entries = std::fs::read_dir(&path)?; if entries.next().is_some() { return Err(crate::error::anyhow!( - "{} must be empty before cloning the paper repository", + "{} must be empty before cloning the repository", path.display() )); } } else if let Some(parent) = path.parent() { std::fs::create_dir_all(parent)?; } - git::clone_public(url, &path, shallow_clone)?; - git::rename_origin_to_upstream(&path)?; + git::clone_public(spec.url, &path, shallow_clone)?; + if let Some(upstream) = spec.upstream.map(str::trim).filter(|url| !url.is_empty()) { + // Cloned a fork under the authenticated account: keep `origin` + // pointing at the fork and record the original as `upstream`. + git::set_remote_url(&path, "upstream", upstream)?; + } else { + git::rename_origin_to_upstream(&path)?; + } } else if require_new_folder && path.exists() { return Err(crate::error::anyhow!( "{} already exists; choose a new folder for a blank project", @@ -181,18 +194,23 @@ pub fn create_project( require_new_folder, initialize_git, clone_url, + upstream_url, shallow_clone, run_command, paper_id, paper_pdf, } = options; let slug = unique_project_slug(store, &slugify(name))?; + let clone = clone_url.as_deref().map(|url| CloneSpec { + url, + upstream: upstream_url.as_deref(), + }); let repo_path = prepare_path( path, create_folder, require_new_folder, initialize_git, - clone_url.as_deref(), + clone, shallow_clone, paper_pdf.as_deref(), )?; @@ -235,6 +253,7 @@ pub struct CreateProjectOptions { pub require_new_folder: bool, pub initialize_git: bool, pub clone_url: Option, + pub upstream_url: Option, pub shallow_clone: bool, pub run_command: Option, pub paper_id: Option, @@ -1058,6 +1077,41 @@ mod tests { std::fs::remove_dir_all(root).unwrap(); } + #[test] + fn fork_clone_keeps_origin_and_records_upstream() { + let root = root(); + let source = root.join("source"); + initialized(&source); + let store = Store::open_at(root.join("data")).unwrap(); + let destination = root.join("fork"); + let project = create_project( + &store, + "Fork", + destination.to_str().unwrap(), + CreateProjectOptions { + create_folder: true, + clone_url: Some(source.to_string_lossy().into_owned()), + upstream_url: Some("https://github.com/owner/original".to_string()), + ..Default::default() + }, + ) + .unwrap(); + let remotes = git::remotes(Path::new(&project.repo_path)).unwrap(); + assert_eq!(remotes.len(), 2); + let names: Vec<&str> = remotes.iter().map(|(name, _)| name.as_str()).collect(); + assert!(names.contains(&"origin")); + assert!(names.contains(&"upstream")); + assert_eq!( + remotes + .iter() + .find(|(name, _)| name == "upstream") + .unwrap() + .1, + "https://github.com/owner/original" + ); + std::fs::remove_dir_all(root).unwrap(); + } + #[test] fn ordinary_github_origin_remains_opt_in() { let root = root(); diff --git a/ui/dist/assets/index-3pBlNq7W.js b/ui/dist/assets/index-D5K0cMok.js similarity index 54% rename from ui/dist/assets/index-3pBlNq7W.js rename to ui/dist/assets/index-D5K0cMok.js index ab8ae235..51a5043c 100644 --- a/ui/dist/assets/index-3pBlNq7W.js +++ b/ui/dist/assets/index-D5K0cMok.js @@ -1,4 +1,4 @@ -var Ew=e=>{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn=(e,n,t)=>(Nw(e,n,"read from private field"),t?t.call(e):n.get(e)),Ps=(e,n,t)=>n.has(e)?Ew("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),$r=(e,n,t,r)=>(Nw(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t);var zw=(e,n,t,r)=>({set _(s){$r(e,n,s,t)},get _(){return Dn(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 a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=t(s);fetch(s.href,a)}})();function tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o1={exports:{}},Rf={};/** +var zw=e=>{throw TypeError(e)};var Aw=(e,n,t)=>n.has(e)||zw("Cannot "+t);var In=(e,n,t)=>(Aw(e,n,"read from private field"),t?t.call(e):n.get(e)),qs=(e,n,t)=>n.has(e)?zw("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ur=(e,n,t,r)=>(Aw(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t);var jw=(e,n,t,r)=>({set _(s){Ur(e,n,s,t)},get _(){return In(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 a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=t(s);fetch(s.href,a)}})();function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l1={exports:{}},Rf={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var Ew=e=>{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Aw;function rD(){if(Aw)return Rf;Aw=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:a}}return Rf.Fragment=n,Rf.jsx=t,Rf.jsxs=t,Rf}var jw;function sD(){return jw||(jw=1,o1.exports=rD()),o1.exports}var d=sD(),l1={exports:{}},kt={};/** + */var Tw;function aD(){if(Tw)return Rf;Tw=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:a}}return Rf.Fragment=n,Rf.jsx=t,Rf.jsxs=t,Rf}var Mw;function oD(){return Mw||(Mw=1,l1.exports=aD()),l1.exports}var h=oD(),c1={exports:{}},kt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var Ew=e=>{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Tw;function iD(){if(Tw)return kt;Tw=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"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),m=Symbol.iterator;function g(H){return H===null||typeof H!="object"?null:(H=m&&H[m]||H["@@iterator"],typeof H=="function"?H:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function b(H,K,G){this.props=H,this.context=K,this.refs=v,this.updater=G||S}b.prototype.isReactComponent={},b.prototype.setState=function(H,K){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,K,"setState")},b.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(H,K,G){this.props=H,this.context=K,this.refs=v,this.updater=G||S}var C=y.prototype=new w;C.constructor=y,k(C,b.prototype),C.isPureReactComponent=!0;var z=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function D(H,K,G){var ie=G.ref;return{$$typeof:e,type:H,key:K,ref:ie!==void 0?ie:null,props:G}}function I(H,K){return D(H.type,K,H.props)}function L(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function U(H){var K={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(G){return K[G]})}var q=/\/+/g;function W(H,K){return typeof H=="object"&&H!==null&&H.key!=null?U(""+H.key):K.toString(36)}function Z(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(N,N):(H.status="pending",H.then(function(K){H.status==="pending"&&(H.status="fulfilled",H.value=K)},function(K){H.status==="pending"&&(H.status="rejected",H.reason=K)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function X(H,K,G,ie,ve){var ce=typeof H;(ce==="undefined"||ce==="boolean")&&(H=null);var re=!1;if(H===null)re=!0;else switch(ce){case"bigint":case"string":case"number":re=!0;break;case"object":switch(H.$$typeof){case e:case n:re=!0;break;case _:return re=H._init,X(re(H._payload),K,G,ie,ve)}}if(re)return ve=ve(H),re=ie===""?"."+W(H,0):ie,z(ve)?(G="",re!=null&&(G=re.replace(q,"$&/")+"/"),X(ve,K,G,"",function(ue){return ue})):ve!=null&&(L(ve)&&(ve=I(ve,G+(ve.key==null||H&&H.key===ve.key?"":(""+ve.key).replace(q,"$&/")+"/")+re)),K.push(ve)),1;re=0;var P=ie===""?".":ie+":";if(z(H))for(var oe=0;oe{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Rw;function oD(){return Rw||(Rw=1,(function(e){function n(X,J){var ee=X.length;X.push(J);e:for(;0>>1,B=X[$];if(0>>1;$s(G,ee))ies(ve,G)?(X[$]=ve,X[ie]=ee,$=ie):(X[$]=G,X[K]=ee,$=K);else if(ies(ve,ee))X[$]=ve,X[ie]=ee,$=ie;else break e}}return J}function s(X,J){var ee=X.sortIndex-J.sortIndex;return ee!==0?ee:X.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],_=1,h=null,m=3,g=!1,S=!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(X){for(var J=t(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=X)r(f),J.sortIndex=J.expirationTime,n(c,J);else break;J=t(f)}}function z(X){if(k=!1,C(X),!S)if(t(c)!==null)S=!0,N||(N=!0,U());else{var J=t(f);J!==null&&Z(z,J.startTime-X)}}var N=!1,T=-1,j=5,D=-1;function I(){return v?!0:!(e.unstable_now()-DX&&I());){var $=h.callback;if(typeof $=="function"){h.callback=null,m=h.priorityLevel;var B=$(h.expirationTime<=X);if(X=e.unstable_now(),typeof B=="function"){h.callback=B,C(X),J=!0;break t}h===t(c)&&r(c),C(X)}else r(c);h=t(c)}if(h!==null)J=!0;else{var H=t(f);H!==null&&Z(z,H.startTime-X),J=!1}}break e}finally{h=null,m=ee,g=!1}J=void 0}}finally{J?U():N=!1}}}var U;if(typeof y=="function")U=function(){y(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,W=q.port2;q.port1.onmessage=L,U=function(){W.postMessage(null)}}else U=function(){b(L,0)};function Z(X,J){T=b(function(){X(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(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125$?(X.sortIndex=ee,n(f,X),t(c)===null&&X===t(f)&&(k?(w(T),T=-1):k=!0,Z(z,ee-$))):(X.sortIndex=B,n(c,X),S||g||(S=!0,N||(N=!0,U()))),X},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(X){var J=m;return function(){var ee=m;m=J;try{return X.apply(this,arguments)}finally{m=ee}}}})(f1)),f1}var Dw;function lD(){return Dw||(Dw=1,u1.exports=oD()),u1.exports}var d1={exports:{}},qr={};/** + */var Lw;function uD(){return Lw||(Lw=1,(function(e){function n(X,J){var ee=X.length;X.push(J);e:for(;0>>1,B=X[$];if(0>>1;$s(G,ee))ies(ve,G)?(X[$]=ve,X[ie]=ee,$=ie):(X[$]=G,X[K]=ee,$=K);else if(ies(ve,ee))X[$]=ve,X[ie]=ee,$=ie;else break e}}return J}function s(X,J){var ee=X.sortIndex-J.sortIndex;return ee!==0?ee:X.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],_=1,d=null,m=3,g=!1,S=!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(X){for(var J=t(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=X)r(f),J.sortIndex=J.expirationTime,n(c,J);else break;J=t(f)}}function z(X){if(k=!1,C(X),!S)if(t(c)!==null)S=!0,N||(N=!0,P());else{var J=t(f);J!==null&&Z(z,J.startTime-X)}}var N=!1,T=-1,j=5,D=-1;function I(){return v?!0:!(e.unstable_now()-DX&&I());){var $=d.callback;if(typeof $=="function"){d.callback=null,m=d.priorityLevel;var B=$(d.expirationTime<=X);if(X=e.unstable_now(),typeof B=="function"){d.callback=B,C(X),J=!0;break t}d===t(c)&&r(c),C(X)}else r(c);d=t(c)}if(d!==null)J=!0;else{var H=t(f);H!==null&&Z(z,H.startTime-X),J=!1}}break e}finally{d=null,m=ee,g=!1}J=void 0}}finally{J?P():N=!1}}}var P;if(typeof y=="function")P=function(){y(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,W=q.port2;q.port1.onmessage=L,P=function(){W.postMessage(null)}}else P=function(){b(L,0)};function Z(X,J){T=b(function(){X(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(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125$?(X.sortIndex=ee,n(f,X),t(c)===null&&X===t(f)&&(k?(w(T),T=-1):k=!0,Z(z,ee-$))):(X.sortIndex=B,n(c,X),S||g||(S=!0,N||(N=!0,P()))),X},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(X){var J=m;return function(){var ee=m;m=J;try{return X.apply(this,arguments)}finally{m=ee}}}})(h1)),h1}var Ow;function fD(){return Ow||(Ow=1,f1.exports=uD()),f1.exports}var d1={exports:{}},Xr={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var Ew=e=>{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Lw;function cD(){if(Lw)return qr;Lw=1;var e=qd();function n(c){var f="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(),d1.exports=cD(),d1.exports}/** + */var Iw;function hD(){if(Iw)return Xr;Iw=1;var e=qh();function n(c){var f="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(),d1.exports=hD(),d1.exports}/** * @license React * react-dom-client.production.js * @@ -38,432 +38,432 @@ var Ew=e=>{throw TypeError(e)};var Nw=(e,n,t)=>n.has(e)||Ew("Cannot "+t);var Dn= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Iw;function uD(){if(Iw)return Df;Iw=1;var e=lD(),n=qd(),t=QC();function r(i){var u="https://react.dev/errors/"+i;if(1B||(i.current=$[B],$[B]=null,B--)}function G(i,u){B++,$[B]=i.current,i.current=u}var ie=H(null),ve=H(null),ce=H(null),re=H(null);function P(i,u){switch(G(ce,u),G(ve,i),G(ie,null),u.nodeType){case 9:case 11:i=(i=u.documentElement)&&(i=i.namespaceURI)?X3(i):0;break;default:if(i=u.tagName,u=u.namespaceURI)u=X3(u),i=Y3(u,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(ie),G(ie,i)}function oe(){K(ie),K(ve),K(ce)}function ue(i){i.memoizedState!==null&&G(re,i);var u=ie.current,p=Y3(u,i.type);u!==p&&(G(ve,i),G(ie,p))}function de(i){ve.current===i&&(K(ie),K(ve)),re.current===i&&(K(re),Af._currentValue=ee)}var ge,Ee;function Ae(i){if(ge===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ge=u&&u[1]||"",Ee=-1B||(i.current=$[B],$[B]=null,B--)}function G(i,u){B++,$[B]=i.current,i.current=u}var ie=H(null),ve=H(null),ce=H(null),re=H(null);function F(i,u){switch(G(ce,u),G(ve,i),G(ie,null),u.nodeType){case 9:case 11:i=(i=u.documentElement)&&(i=i.namespaceURI)?Z3(i):0;break;default:if(i=u.tagName,u=u.namespaceURI)u=Z3(u),i=Q3(u,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(ie),G(ie,i)}function oe(){K(ie),K(ve),K(ce)}function ue(i){i.memoizedState!==null&&G(re,i);var u=ie.current,p=Q3(u,i.type);u!==p&&(G(ve,i),G(ie,p))}function he(i){ve.current===i&&(K(ie),K(ve)),re.current===i&&(K(re),Af._currentValue=ee)}var me,Ee;function Re(i){if(me===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);me=u&&u[1]||"",Ee=-1)":-1A||he[x]!==ke[A]){var Me=` -`+he[x].replace(" at new "," at ");return i.displayName&&Me.includes("")&&(Me=Me.replace("",i.displayName)),Me}while(1<=x&&0<=A);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=i?i.displayName||i.name:"")?Ae(p):""}function Ie(i,u){switch(i.tag){case 26:case 27:case 5:return Ae(i.type);case 16:return Ae("Lazy");case 13:return i.child!==u&&u!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return Re(i.type,!1);case 11:return Re(i.type.render,!1);case 1:return Re(i.type,!0);case 31:return Ae("Activity");default:return""}}function nt(i){try{var u="",p=null;do u+=Ie(i,p),p=i,i=i.return;while(i);return u}catch(x){return` +`);for(A=x=0;xA||de[x]!==ke[A]){var Me=` +`+de[x].replace(" at new "," at ");return i.displayName&&Me.includes("")&&(Me=Me.replace("",i.displayName)),Me}while(1<=x&&0<=A);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=i?i.displayName||i.name:"")?Re(p):""}function Ie(i,u){switch(i.tag){case 26:case 27:case 5:return Re(i.type);case 16:return Re("Lazy");case 13:return i.child!==u&&u!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Te(i.type,!1);case 11:return Te(i.type.render,!1);case 1:return Te(i.type,!0);case 31:return Re("Activity");default:return""}}function et(i){try{var u="",p=null;do u+=Ie(i,p),p=i,i=i.return;while(i);return u}catch(x){return` Error generating stack: `+x.message+` -`+x.stack}}var Rt=Object.prototype.hasOwnProperty,At=e.unstable_scheduleCallback,bt=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Ct=e.unstable_requestPaint,ut=e.unstable_now,ht=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Le=e.unstable_UserBlockingPriority,Ge=e.unstable_NormalPriority,et=e.unstable_LowPriority,st=e.unstable_IdlePriority,Dt=e.log,vt=e.unstable_setDisableYieldValue,It=null,Zt=null;function cn(i){if(typeof Dt=="function"&&vt(i),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(It,i)}catch{}}var xt=Math.clz32?Math.clz32:Xe,Sn=Math.log,un=Math.LN2;function Xe(i){return i>>>=0,i===0?32:31-(Sn(i)/un|0)|0}var lt=256,gn=262144,Cr=4194304;function Be(i){var u=i&42;if(u!==0)return u;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Qe(i,u,p){var x=i.pendingLanes;if(x===0)return 0;var A=0,M=i.suspendedLanes,V=i.pingedLanes;i=i.warmLanes;var te=x&134217727;return te!==0?(x=te&~M,x!==0?A=Be(x):(V&=te,V!==0?A=Be(V):p||(p=te&~i,p!==0&&(A=Be(p))))):(te=x&~M,te!==0?A=Be(te):V!==0?A=Be(V):p||(p=x&~i,p!==0&&(A=Be(p)))),A===0?0:u!==0&&u!==A&&(u&M)===0&&(M=A&-A,p=u&-u,M>=p||M===32&&(p&4194048)!==0)?u:A}function St(i,u){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&u)===0}function fn(i,u){switch(i){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nn(){var i=Cr;return Cr<<=1,(Cr&62914560)===0&&(Cr=4194304),i}function Ns(i){for(var u=[],p=0;31>p;p++)u.push(i);return u}function cs(i,u){i.pendingLanes|=u,u!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function us(i,u,p,x,A,M){var V=i.pendingLanes;i.pendingLanes=p,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=p,i.entangledLanes&=p,i.errorRecoveryDisabledLanes&=p,i.shellSuspendCounter=0;var te=i.entanglements,he=i.expirationTimes,ke=i.hiddenUpdates;for(p=V&~p;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Gn=/[\n"\\]/g;function sr(i){return i.replace(Gn,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Xi(i,u,p,x,A,M,V,te){i.name="",V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?i.type=V:i.removeAttribute("type"),u!=null?V==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+vr(u)):i.value!==""+vr(u)&&(i.value=""+vr(u)):V!=="submit"&&V!=="reset"||i.removeAttribute("value"),u!=null?Ei(i,V,vr(u)):p!=null?Ei(i,V,vr(p)):x!=null&&i.removeAttribute("value"),A==null&&M!=null&&(i.defaultChecked=!!M),A!=null&&(i.checked=A&&typeof A!="function"&&typeof A!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?i.name=""+vr(te):i.removeAttribute("name")}function Nr(i,u,p,x,A,M,V,te){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(i.type=M),u!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||u!=null)){ii(i);return}p=p!=null?""+vr(p):"",u=u!=null?""+vr(u):p,te||u===i.value||(i.value=u),i.defaultValue=u}x=x??A,x=typeof x!="function"&&typeof x!="symbol"&&!!x,i.checked=te?i.checked:!!x,i.defaultChecked=!!x,V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(i.name=V),ii(i)}function Ei(i,u,p){u==="number"&&Nn(i.ownerDocument)===i||i.defaultValue===""+p||(i.defaultValue=""+p)}function ai(i,u,p,x){if(i=i.options,u){u={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zi=!1;if(es)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Zi=!1}var Qn=null,Hn=null,Ai=null;function hl(){if(Ai)return Ai;var i,u=Hn,p=u.length,x,A="value"in Qn?Qn.value:Qn.textContent,M=A.length;for(i=0;i=yo),rn=" ",ra=!1;function sa(i,u){switch(i){case"keyup":return hh.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ar(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ti=!1;function yr(i,u){switch(i){case"compositionend":return ar(u);case"keypress":return u.which!==32?null:(ra=!0,rn);case"textInput":return i=u.data,i===rn&&ra?null:i;default:return null}}function hm(i,u){if(Ti)return i==="compositionend"||!bc&&sa(i,u)?(i=hl(),Ai=Hn=Qn=null,Ti=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:p,offset:u-i};i=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=h4(p)}}function p4(i,u){return i&&u?i===u?!0:i&&i.nodeType===3?!1:u&&u.nodeType===3?p4(i,u.parentNode):"contains"in i?i.contains(u):i.compareDocumentPosition?!!(i.compareDocumentPosition(u)&16):!1:!1}function m4(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var u=Nn(i.document);u instanceof i.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)i=u.contentWindow;else break;u=Nn(i.document)}return u}function mm(i){var u=i&&i.nodeName&&i.nodeName.toLowerCase();return u&&(u==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||u==="textarea"||i.contentEditable==="true")}var OM=es&&"documentMode"in document&&11>=document.documentMode,vc=null,gm=null,Ju=null,bm=!1;function g4(i,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;bm||vc==null||vc!==Nn(x)||(x=vc,"selectionStart"in x&&mm(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Ju&&Qu(Ju,x)||(Ju=x,x=r_(gm,"onSelect"),0>=V,A-=V,ia=1<<32-xt(u)+A|p<jt?(Ut=rt,rt=null):Ut=rt.sibling;var Yt=Ce(xe,rt,Se[jt],De);if(Yt===null){rt===null&&(rt=Ut);break}i&&rt&&Yt.alternate===null&&u(xe,rt),_e=M(Yt,_e,jt),Xt===null?ct=Yt:Xt.sibling=Yt,Xt=Yt,rt=Ut}if(jt===Se.length)return p(xe,rt),Gt&&Ra(xe,jt),ct;if(rt===null){for(;jtjt?(Ut=rt,rt=null):Ut=rt.sibling;var Uo=Ce(xe,rt,Yt.value,De);if(Uo===null){rt===null&&(rt=Ut);break}i&&rt&&Uo.alternate===null&&u(xe,rt),_e=M(Uo,_e,jt),Xt===null?ct=Uo:Xt.sibling=Uo,Xt=Uo,rt=Ut}if(Yt.done)return p(xe,rt),Gt&&Ra(xe,jt),ct;if(rt===null){for(;!Yt.done;jt++,Yt=Se.next())Yt=Oe(xe,Yt.value,De),Yt!==null&&(_e=M(Yt,_e,jt),Xt===null?ct=Yt:Xt.sibling=Yt,Xt=Yt);return Gt&&Ra(xe,jt),ct}for(rt=x(rt);!Yt.done;jt++,Yt=Se.next())Yt=ze(rt,xe,jt,Yt.value,De),Yt!==null&&(i&&Yt.alternate!==null&&rt.delete(Yt.key===null?jt:Yt.key),_e=M(Yt,_e,jt),Xt===null?ct=Yt:Xt.sibling=Yt,Xt=Yt);return i&&rt.forEach(function(nD){return u(xe,nD)}),Gt&&Ra(xe,jt),ct}function pn(xe,_e,Se,De){if(typeof Se=="object"&&Se!==null&&Se.type===k&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case g:e:{for(var ct=Se.key;_e!==null;){if(_e.key===ct){if(ct=Se.type,ct===k){if(_e.tag===7){p(xe,_e.sibling),De=A(_e,Se.props.children),De.return=xe,xe=De;break e}}else if(_e.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===j&&Nl(ct)===_e.type){p(xe,_e.sibling),De=A(_e,Se.props),af(De,Se),De.return=xe,xe=De;break e}p(xe,_e);break}else u(xe,_e);_e=_e.sibling}Se.type===k?(De=wl(Se.props.children,xe.mode,De,Se.key),De.return=xe,xe=De):(De=xh(Se.type,Se.key,Se.props,null,xe.mode,De),af(De,Se),De.return=xe,xe=De)}return V(xe);case S:e:{for(ct=Se.key;_e!==null;){if(_e.key===ct)if(_e.tag===4&&_e.stateNode.containerInfo===Se.containerInfo&&_e.stateNode.implementation===Se.implementation){p(xe,_e.sibling),De=A(_e,Se.children||[]),De.return=xe,xe=De;break e}else{p(xe,_e);break}else u(xe,_e);_e=_e.sibling}De=Cm(Se,xe.mode,De),De.return=xe,xe=De}return V(xe);case j:return Se=Nl(Se),pn(xe,_e,Se,De)}if(Z(Se))return tt(xe,_e,Se,De);if(U(Se)){if(ct=U(Se),typeof ct!="function")throw Error(r(150));return Se=ct.call(Se),_t(xe,_e,Se,De)}if(typeof Se.then=="function")return pn(xe,_e,Nh(Se),De);if(Se.$$typeof===y)return pn(xe,_e,Sh(xe,Se),De);zh(xe,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint"?(Se=""+Se,_e!==null&&_e.tag===6?(p(xe,_e.sibling),De=A(_e,Se),De.return=xe,xe=De):(p(xe,_e),De=km(Se,xe.mode,De),De.return=xe,xe=De),V(xe)):p(xe,_e)}return function(xe,_e,Se,De){try{sf=0;var ct=pn(xe,_e,Se,De);return jc=null,ct}catch(rt){if(rt===Ac||rt===Ch)throw rt;var Xt=Ls(29,rt,null,xe.mode);return Xt.lanes=De,Xt.return=xe,Xt}finally{}}}var Al=H4(!0),P4=H4(!1),Eo=!1;function Im(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bm(i,u){i=i.updateQueue,u.updateQueue===i&&(u.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function No(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zo(i,u,p){var x=i.updateQueue;if(x===null)return null;if(x=x.shared,(Qt&2)!==0){var A=x.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),x.pending=u,u=vh(i),k4(i,null,p),u}return bh(i,x,u,p),vh(i)}function of(i,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var x=u.lanes;x&=i.pendingLanes,p|=x,u.lanes=p,Wi(i,p)}}function $m(i,u){var p=i.updateQueue,x=i.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var A=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var V={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?A=M=V:M=M.next=V,p=p.next}while(p!==null);M===null?A=M=u:M=M.next=u}else A=M=u;p={baseState:x.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:x.shared,callbacks:x.callbacks},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=u:i.next=u,p.lastBaseUpdate=u}var Hm=!1;function lf(){if(Hm){var i=zc;if(i!==null)throw i}}function cf(i,u,p,x){Hm=!1;var A=i.updateQueue;Eo=!1;var M=A.firstBaseUpdate,V=A.lastBaseUpdate,te=A.shared.pending;if(te!==null){A.shared.pending=null;var he=te,ke=he.next;he.next=null,V===null?M=ke:V.next=ke,V=he;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,te=Me.lastBaseUpdate,te!==V&&(te===null?Me.firstBaseUpdate=ke:te.next=ke,Me.lastBaseUpdate=he))}if(M!==null){var Oe=A.baseState;V=0,Me=ke=he=null,te=M;do{var Ce=te.lane&-536870913,ze=Ce!==te.lane;if(ze?(Ft&Ce)===Ce:(x&Ce)===Ce){Ce!==0&&Ce===Nc&&(Hm=!0),Me!==null&&(Me=Me.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var tt=i,_t=te;Ce=u;var pn=p;switch(_t.tag){case 1:if(tt=_t.payload,typeof tt=="function"){Oe=tt.call(pn,Oe,Ce);break e}Oe=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=_t.payload,Ce=typeof tt=="function"?tt.call(pn,Oe,Ce):tt,Ce==null)break e;Oe=h({},Oe,Ce);break e;case 2:Eo=!0}}Ce=te.callback,Ce!==null&&(i.flags|=64,ze&&(i.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ce]:ze.push(Ce))}else ze={lane:Ce,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Me===null?(ke=Me=ze,he=Oe):Me=Me.next=ze,V|=Ce;if(te=te.next,te===null){if(te=A.shared.pending,te===null)break;ze=te,te=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);Me===null&&(he=Oe),A.baseState=he,A.firstBaseUpdate=ke,A.lastBaseUpdate=Me,M===null&&(A.shared.lanes=0),Ro|=V,i.lanes=V,i.memoizedState=Oe}}function F4(i,u){if(typeof i!="function")throw Error(r(191,i));i.call(u)}function U4(i,u){var p=i.callbacks;if(p!==null)for(i.callbacks=null,i=0;iM?M:8;var V=X.T,te={};X.T=te,ig(i,!1,u,p);try{var he=A(),ke=X.S;if(ke!==null&&ke(te,he),he!==null&&typeof he=="object"&&typeof he.then=="function"){var Me=GM(he,x);df(i,u,Me,Hs(i))}else df(i,u,x,Hs(i))}catch(Oe){df(i,u,{then:function(){},status:"rejected",reason:Oe},Hs())}finally{J.p=M,V!==null&&te.types!==null&&(V.types=te.types),X.T=V}}function ZM(){}function rg(i,u,p,x){if(i.tag!==5)throw Error(r(476));var A=y5(i).queue;x5(i,A,u,ee,p===null?ZM:function(){return w5(i),p(x)})}function y5(i){var u=i.memoizedState;if(u!==null)return u;u={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ee},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:p},next:null},i.memoizedState=u,i=i.alternate,i!==null&&(i.memoizedState=u),u}function w5(i){var u=y5(i);u.next===null&&(u=i.alternate.memoizedState),df(i,u.next.queue,{},Hs())}function sg(){return Or(Af)}function S5(){return tr().memoizedState}function k5(){return tr().memoizedState}function QM(i){for(var u=i.return;u!==null;){switch(u.tag){case 24:case 3:var p=Hs();i=No(p);var x=zo(u,i,p);x!==null&&(xs(x,u,p),of(x,u,p)),u={cache:Rm()},i.payload=u;return}u=u.return}}function JM(i,u,p){var x=Hs();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Bh(i)?E5(u,p):(p=wm(i,u,p,x),p!==null&&(xs(p,i,x),N5(p,u,x)))}function C5(i,u,p){var x=Hs();df(i,u,p,x)}function df(i,u,p,x){var A={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Bh(i))E5(u,A);else{var M=i.alternate;if(i.lanes===0&&(M===null||M.lanes===0)&&(M=u.lastRenderedReducer,M!==null))try{var V=u.lastRenderedState,te=M(V,p);if(A.hasEagerState=!0,A.eagerState=te,Ds(te,V))return bh(i,u,A,0),vn===null&&gh(),!1}catch{}finally{}if(p=wm(i,u,A,x),p!==null)return xs(p,i,x),N5(p,u,x),!0}return!1}function ig(i,u,p,x){if(x={lane:2,revertLane:Ig(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Bh(i)){if(u)throw Error(r(479))}else u=wm(i,p,x,2),u!==null&&xs(u,i,2)}function Bh(i){var u=i.alternate;return i===Nt||u!==null&&u===Nt}function E5(i,u){Mc=Th=!0;var p=i.pending;p===null?u.next=u:(u.next=p.next,p.next=u),i.pending=u}function N5(i,u,p){if((p&4194048)!==0){var x=u.lanes;x&=i.pendingLanes,p|=x,u.lanes=p,Wi(i,p)}}var hf={readContext:Or,use:Dh,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useLayoutEffect:Wn,useInsertionEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useSyncExternalStore:Wn,useId:Wn,useHostTransitionStatus:Wn,useFormState:Wn,useActionState:Wn,useOptimistic:Wn,useMemoCache:Wn,useCacheRefresh:Wn};hf.useEffectEvent=Wn;var z5={readContext:Or,use:Dh,useCallback:function(i,u){return ts().memoizedState=[i,u===void 0?null:u],i},useContext:Or,useEffect:f5,useImperativeHandle:function(i,u,p){p=p!=null?p.concat([i]):null,Oh(4194308,4,p5.bind(null,u,i),p)},useLayoutEffect:function(i,u){return Oh(4194308,4,i,u)},useInsertionEffect:function(i,u){Oh(4,2,i,u)},useMemo:function(i,u){var p=ts();u=u===void 0?null:u;var x=i();if(jl){cn(!0);try{i()}finally{cn(!1)}}return p.memoizedState=[x,u],x},useReducer:function(i,u,p){var x=ts();if(p!==void 0){var A=p(u);if(jl){cn(!0);try{p(u)}finally{cn(!1)}}}else A=u;return x.memoizedState=x.baseState=A,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:A},x.queue=i,i=i.dispatch=JM.bind(null,Nt,i),[x.memoizedState,i]},useRef:function(i){var u=ts();return i={current:i},u.memoizedState=i},useState:function(i){i=Qm(i);var u=i.queue,p=C5.bind(null,Nt,u);return u.dispatch=p,[i.memoizedState,p]},useDebugValue:tg,useDeferredValue:function(i,u){var p=ts();return ng(p,i,u)},useTransition:function(){var i=Qm(!1);return i=x5.bind(null,Nt,i.queue,!0,!1),ts().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,u,p){var x=Nt,A=ts();if(Gt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),vn===null)throw Error(r(349));(Ft&127)!==0||X4(x,u,p)}A.memoizedState=p;var M={value:p,getSnapshot:u};return A.queue=M,f5(Z4.bind(null,x,M,i),[i]),x.flags|=2048,Dc(9,{destroy:void 0},Y4.bind(null,x,M,p,u),null),p},useId:function(){var i=ts(),u=vn.identifierPrefix;if(Gt){var p=aa,x=ia;p=(x&~(1<<32-xt(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=Mh++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof x.is=="string"?V.createElement("select",{is:x.is}):V.createElement("select"),x.multiple?M.multiple=!0:x.size&&(M.size=x.size);break;default:M=typeof x.is=="string"?V.createElement(A,{is:x.is}):V.createElement(A)}}M[sn]=u,M[kn]=x;e:for(V=u.child;V!==null;){if(V.tag===5||V.tag===6)M.appendChild(V.stateNode);else if(V.tag!==4&&V.tag!==27&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===u)break e;for(;V.sibling===null;){if(V.return===null||V.return===u)break e;V=V.return}V.sibling.return=V.return,V=V.sibling}u.stateNode=M;e:switch(Br(M,A,x),A){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&$a(u)}}return jn(u),vg(u,u.type,i===null?null:i.memoizedProps,u.pendingProps,p),null;case 6:if(i&&u.stateNode!=null)i.memoizedProps!==x&&$a(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(i=ce.current,Cc(u)){if(i=u.stateNode,p=u.memoizedProps,x=null,A=Lr,A!==null)switch(A.tag){case 27:case 5:x=A.memoizedProps}i[sn]=u,i=!!(i.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||W3(i.nodeValue,p)),i||ko(u,!0)}else i=s_(i).createTextNode(x),i[sn]=u,u.stateNode=i}return jn(u),null;case 31:if(p=u.memoizedState,i===null||i.memoizedState!==null){if(x=Cc(u),p!==null){if(i===null){if(!x)throw Error(r(318));if(i=u.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[sn]=u}else Sl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;jn(u),i=!1}else p=Am(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),i=!0;if(!i)return u.flags&256?(Is(u),u):(Is(u),null);if((u.flags&128)!==0)throw Error(r(558))}return jn(u),null;case 13:if(x=u.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(A=Cc(u),x!==null&&x.dehydrated!==null){if(i===null){if(!A)throw Error(r(318));if(A=u.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[sn]=u}else Sl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;jn(u),A=!1}else A=Am(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=A),A=!0;if(!A)return u.flags&256?(Is(u),u):(Is(u),null)}return Is(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,i=i!==null&&i.memoizedState!==null,p&&(x=u.child,A=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(A=x.alternate.memoizedState.cachePool.pool),M=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(M=x.memoizedState.cachePool.pool),M!==A&&(x.flags|=2048)),p!==i&&p&&(u.child.flags|=8192),Uh(u,u.updateQueue),jn(u),null);case 4:return oe(),i===null&&Pg(u.stateNode.containerInfo),jn(u),null;case 10:return La(u.type),jn(u),null;case 19:if(K(er),x=u.memoizedState,x===null)return jn(u),null;if(A=(u.flags&128)!==0,M=x.rendering,M===null)if(A)pf(x,!1);else{if(Kn!==0||i!==null&&(i.flags&128)!==0)for(i=u.child;i!==null;){if(M=jh(i),M!==null){for(u.flags|=128,pf(x,!1),i=M.updateQueue,u.updateQueue=i,Uh(u,i),u.subtreeFlags=0,i=p,p=u.child;p!==null;)C4(p,i),p=p.sibling;return G(er,er.current&1|2),Gt&&Ra(u,x.treeForkCount),u.child}i=i.sibling}x.tail!==null&&ut()>Kh&&(u.flags|=128,A=!0,pf(x,!1),u.lanes=4194304)}else{if(!A)if(i=jh(M),i!==null){if(u.flags|=128,A=!0,i=i.updateQueue,u.updateQueue=i,Uh(u,i),pf(x,!0),x.tail===null&&x.tailMode==="hidden"&&!M.alternate&&!Gt)return jn(u),null}else 2*ut()-x.renderingStartTime>Kh&&p!==536870912&&(u.flags|=128,A=!0,pf(x,!1),u.lanes=4194304);x.isBackwards?(M.sibling=u.child,u.child=M):(i=x.last,i!==null?i.sibling=M:u.child=M,x.last=M)}return x.tail!==null?(i=x.tail,x.rendering=i,x.tail=i.sibling,x.renderingStartTime=ut(),i.sibling=null,p=er.current,G(er,A?p&1|2:p&1),Gt&&Ra(u,x.treeForkCount),i):(jn(u),null);case 22:case 23:return Is(u),Fm(),x=u.memoizedState!==null,i!==null?i.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(p&536870912)!==0&&(u.flags&128)===0&&(jn(u),u.subtreeFlags&6&&(u.flags|=8192)):jn(u),p=u.updateQueue,p!==null&&Uh(u,p.retryQueue),p=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048),i!==null&&K(El),null;case 24:return p=null,i!==null&&(p=i.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),La(or),jn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function sR(i,u){switch(Nm(u),u.tag){case 1:return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 3:return La(or),oe(),i=u.flags,(i&65536)!==0&&(i&128)===0?(u.flags=i&-65537|128,u):null;case 26:case 27:case 5:return de(u),null;case 31:if(u.memoizedState!==null){if(Is(u),u.alternate===null)throw Error(r(340));Sl()}return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 13:if(Is(u),i=u.memoizedState,i!==null&&i.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Sl()}return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 19:return K(er),null;case 4:return oe(),null;case 10:return La(u.type),null;case 22:case 23:return Is(u),Fm(),i!==null&&K(El),i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 24:return La(or),null;case 25:return null;default:return null}}function Q5(i,u){switch(Nm(u),u.tag){case 3:La(or),oe();break;case 26:case 27:case 5:de(u);break;case 4:oe();break;case 31:u.memoizedState!==null&&Is(u);break;case 13:Is(u);break;case 19:K(er);break;case 10:La(u.type);break;case 22:case 23:Is(u),Fm(),i!==null&&K(El);break;case 24:La(or)}}function mf(i,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var A=x.next;p=A;do{if((p.tag&i)===i){x=void 0;var M=p.create,V=p.inst;x=M(),V.destroy=x}p=p.next}while(p!==A)}}catch(te){ln(u,u.return,te)}}function To(i,u,p){try{var x=u.updateQueue,A=x!==null?x.lastEffect:null;if(A!==null){var M=A.next;x=M;do{if((x.tag&i)===i){var V=x.inst,te=V.destroy;if(te!==void 0){V.destroy=void 0,A=u;var he=p,ke=te;try{ke()}catch(Me){ln(A,he,Me)}}}x=x.next}while(x!==M)}}catch(Me){ln(u,u.return,Me)}}function J5(i){var u=i.updateQueue;if(u!==null){var p=i.stateNode;try{U4(u,p)}catch(x){ln(i,i.return,x)}}}function e3(i,u,p){p.props=Tl(i.type,i.memoizedProps),p.state=i.memoizedState;try{p.componentWillUnmount()}catch(x){ln(i,u,x)}}function gf(i,u){try{var p=i.ref;if(p!==null){switch(i.tag){case 26:case 27:case 5:var x=i.stateNode;break;case 30:x=i.stateNode;break;default:x=i.stateNode}typeof p=="function"?i.refCleanup=p(x):p.current=x}}catch(A){ln(i,u,A)}}function oa(i,u){var p=i.ref,x=i.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(A){ln(i,u,A)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){ln(i,u,A)}else p.current=null}function t3(i){var u=i.type,p=i.memoizedProps,x=i.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(A){ln(i,i.return,A)}}function xg(i,u,p){try{var x=i.stateNode;ER(x,i.type,p,u),x[kn]=u}catch(A){ln(i,i.return,A)}}function n3(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Bo(i.type)||i.tag===4}function yg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||n3(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Bo(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function wg(i,u,p){var x=i.tag;if(x===5||x===6)i=i.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(i,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(i),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=Jr));else if(x!==4&&(x===27&&Bo(i.type)&&(p=i.stateNode,u=null),i=i.child,i!==null))for(wg(i,u,p),i=i.sibling;i!==null;)wg(i,u,p),i=i.sibling}function qh(i,u,p){var x=i.tag;if(x===5||x===6)i=i.stateNode,u?p.insertBefore(i,u):p.appendChild(i);else if(x!==4&&(x===27&&Bo(i.type)&&(p=i.stateNode),i=i.child,i!==null))for(qh(i,u,p),i=i.sibling;i!==null;)qh(i,u,p),i=i.sibling}function r3(i){var u=i.stateNode,p=i.memoizedProps;try{for(var x=i.type,A=u.attributes;A.length;)u.removeAttributeNode(A[0]);Br(u,x,p),u[sn]=i,u[kn]=p}catch(M){ln(i,i.return,M)}}var Ha=!1,ur=!1,Sg=!1,s3=typeof WeakSet=="function"?WeakSet:Set,zr=null;function iR(i,u){if(i=i.containerInfo,qg=f_,i=m4(i),mm(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var A=x.anchorOffset,M=x.focusNode;x=x.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var V=0,te=-1,he=-1,ke=0,Me=0,Oe=i,Ce=null;t:for(;;){for(var ze;Oe!==p||A!==0&&Oe.nodeType!==3||(te=V+A),Oe!==M||x!==0&&Oe.nodeType!==3||(he=V+x),Oe.nodeType===3&&(V+=Oe.nodeValue.length),(ze=Oe.firstChild)!==null;)Ce=Oe,Oe=ze;for(;;){if(Oe===i)break t;if(Ce===p&&++ke===A&&(te=V),Ce===M&&++Me===x&&(he=V),(ze=Oe.nextSibling)!==null)break;Oe=Ce,Ce=Oe.parentNode}Oe=ze}p=te===-1||he===-1?null:{start:te,end:he}}else p=null}p=p||{start:0,end:0}}else p=null;for(Gg={focusedElem:i,selectionRange:p},f_=!1,zr=u;zr!==null;)if(u=zr,i=u.child,(u.subtreeFlags&1028)!==0&&i!==null)i.return=u,zr=i;else for(;zr!==null;){switch(u=zr,M=u.alternate,i=u.flags,u.tag){case 0:if((i&4)!==0&&(i=u.updateQueue,i=i!==null?i.events:null,i!==null))for(p=0;p title"))),Br(M,x,p),M[sn]=i,Cn(M),x=M;break e;case"link":var V=uw("link","href",A).get(x+(p.href||""));if(V){for(var te=0;tepn&&(V=pn,pn=_t,_t=V);var xe=_4(te,_t),_e=_4(te,pn);if(xe&&_e&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==_e.node||ze.focusOffset!==_e.offset)){var Se=Oe.createRange();Se.setStart(xe.node,xe.offset),ze.removeAllRanges(),_t>pn?(ze.addRange(Se),ze.extend(_e.node,_e.offset)):(Se.setEnd(_e.node,_e.offset),ze.addRange(Se))}}}}for(Oe=[],ze=te;ze=ze.parentNode;)ze.nodeType===1&&Oe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;tep?32:p,X.T=null,p=jg,jg=null;var M=Lo,V=Ga;if(wr=0,$c=Lo=null,Ga=0,(Qt&6)!==0)throw Error(r(331));var te=Qt;if(Qt|=4,p3(M.current),d3(M,M.current,V,p),Qt=te,Sf(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(It,M)}catch{}return!0}finally{J.p=A,X.T=x,R3(i,u)}}function L3(i,u,p){u=di(p,u),u=cg(i.stateNode,u,2),i=zo(i,u,2),i!==null&&(cs(i,2),la(i))}function ln(i,u,p){if(i.tag===3)L3(i,i,p);else for(;u!==null;){if(u.tag===3){L3(u,i,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Do===null||!Do.has(x))){i=di(p,i),p=O5(2),x=zo(u,p,2),x!==null&&(I5(p,x,u,i),cs(x,2),la(x));break}}u=u.return}}function Dg(i,u,p){var x=i.pingCache;if(x===null){x=i.pingCache=new lR;var A=new Set;x.set(u,A)}else A=x.get(u),A===void 0&&(A=new Set,x.set(u,A));A.has(p)||(Eg=!0,A.add(p),i=hR.bind(null,i,u,p),u.then(i,i))}function hR(i,u,p){var x=i.pingCache;x!==null&&x.delete(u),i.pingedLanes|=i.suspendedLanes&p,i.warmLanes&=~p,vn===i&&(Ft&p)===p&&(Kn===4||Kn===3&&(Ft&62914560)===Ft&&300>ut()-Wh?(Qt&2)===0&&Hc(i,0):Ng|=p,Bc===Ft&&(Bc=0)),la(i)}function O3(i,u){u===0&&(u=nn()),i=yl(i,u),i!==null&&(cs(i,u),la(i))}function _R(i){var u=i.memoizedState,p=0;u!==null&&(p=u.retryLane),O3(i,p)}function pR(i,u){var p=0;switch(i.tag){case 31:case 13:var x=i.stateNode,A=i.memoizedState;A!==null&&(p=A.retryLane);break;case 19:x=i.stateNode;break;case 22:x=i.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(u),O3(i,p)}function mR(i,u){return At(i,u)}var e_=null,Fc=null,Lg=!1,t_=!1,Og=!1,Io=0;function la(i){i!==Fc&&i.next===null&&(Fc===null?e_=Fc=i:Fc=Fc.next=i),t_=!0,Lg||(Lg=!0,bR())}function Sf(i,u){if(!Og&&t_){Og=!0;do for(var p=!1,x=e_;x!==null;){if(i!==0){var A=x.pendingLanes;if(A===0)var M=0;else{var V=x.suspendedLanes,te=x.pingedLanes;M=(1<<31-xt(42|i)+1)-1,M&=A&~(V&~te),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,H3(x,M))}else M=Ft,M=Qe(x,x===vn?M:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(M&3)===0||St(x,M)||(p=!0,H3(x,M));x=x.next}while(p);Og=!1}}function gR(){I3()}function I3(){t_=Lg=!1;var i=0;Io!==0&&zR()&&(i=Io);for(var u=ut(),p=null,x=e_;x!==null;){var A=x.next,M=B3(x,u);M===0?(x.next=null,p===null?e_=A:p.next=A,A===null&&(Fc=p)):(p=x,(i!==0||(M&3)!==0)&&(t_=!0)),x=A}wr!==0&&wr!==5||Sf(i),Io!==0&&(Io=0)}function B3(i,u){for(var p=i.suspendedLanes,x=i.pingedLanes,A=i.expirationTimes,M=i.pendingLanes&-62914561;0te)break;var Me=he.transferSize,Oe=he.initiatorType;Me&&K3(Oe)&&(he=he.responseEnd,V+=Me*(he"u"?null:document;function aw(i,u,p){var x=Uc;if(x&&typeof u=="string"&&u){var A=sr(u);A='link[rel="'+i+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),iw.has(A)||(iw.add(A),i={rel:i,crossOrigin:p,href:u},x.querySelector(A)===null&&(u=x.createElement("link"),Br(u,"link",i),Cn(u),x.head.appendChild(u)))}}function IR(i){Va.D(i),aw("dns-prefetch",i,null)}function BR(i,u){Va.C(i,u),aw("preconnect",i,u)}function $R(i,u,p){Va.L(i,u,p);var x=Uc;if(x&&i&&u){var A='link[rel="preload"][as="'+sr(u)+'"]';u==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+sr(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+sr(p.imageSizes)+'"]')):A+='[href="'+sr(i)+'"]';var M=A;switch(u){case"style":M=qc(i);break;case"script":M=Gc(i)}bi.has(M)||(i=h({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:i,as:u},p),bi.set(M,i),x.querySelector(A)!==null||u==="style"&&x.querySelector(Nf(M))||u==="script"&&x.querySelector(zf(M))||(u=x.createElement("link"),Br(u,"link",i),Cn(u),x.head.appendChild(u)))}}function HR(i,u){Va.m(i,u);var p=Uc;if(p&&i){var x=u&&typeof u.as=="string"?u.as:"script",A='link[rel="modulepreload"][as="'+sr(x)+'"][href="'+sr(i)+'"]',M=A;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Gc(i)}if(!bi.has(M)&&(i=h({rel:"modulepreload",href:i},u),bi.set(M,i),p.querySelector(A)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(zf(M)))return}x=p.createElement("link"),Br(x,"link",i),Cn(x),p.head.appendChild(x)}}}function PR(i,u,p){Va.S(i,u,p);var x=Uc;if(x&&i){var A=Mr(x).hoistableStyles,M=qc(i);u=u||"default";var V=A.get(M);if(!V){var te={loading:0,preload:null};if(V=x.querySelector(Nf(M)))te.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":u},p),(p=bi.get(M))&&Qg(i,p);var he=V=x.createElement("link");Cn(he),Br(he,"link",i),he._p=new Promise(function(ke,Me){he.onload=ke,he.onerror=Me}),he.addEventListener("load",function(){te.loading|=1}),he.addEventListener("error",function(){te.loading|=2}),te.loading|=4,a_(V,u,x)}V={type:"stylesheet",instance:V,count:1,state:te},A.set(M,V)}}}function FR(i,u){Va.X(i,u);var p=Uc;if(p&&i){var x=Mr(p).hoistableScripts,A=Gc(i),M=x.get(A);M||(M=p.querySelector(zf(A)),M||(i=h({src:i,async:!0},u),(u=bi.get(A))&&Jg(i,u),M=p.createElement("script"),Cn(M),Br(M,"link",i),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},x.set(A,M))}}function UR(i,u){Va.M(i,u);var p=Uc;if(p&&i){var x=Mr(p).hoistableScripts,A=Gc(i),M=x.get(A);M||(M=p.querySelector(zf(A)),M||(i=h({src:i,async:!0,type:"module"},u),(u=bi.get(A))&&Jg(i,u),M=p.createElement("script"),Cn(M),Br(M,"link",i),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},x.set(A,M))}}function ow(i,u,p,x){var A=(A=ce.current)?i_(A):null;if(!A)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=qc(p.href),p=Mr(A).hoistableStyles,x=p.get(u),x||(x={type:"style",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){i=qc(p.href);var M=Mr(A).hoistableStyles,V=M.get(i);if(V||(A=A.ownerDocument||A,V={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(i,V),(M=A.querySelector(Nf(i)))&&!M._p&&(V.instance=M,V.state.loading=5),bi.has(i)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},bi.set(i,p),M||qR(A,i,p,V.state))),u&&x===null)throw Error(r(528,""));return V}if(u&&x!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Gc(p),p=Mr(A).hoistableScripts,x=p.get(u),x||(x={type:"script",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function qc(i){return'href="'+sr(i)+'"'}function Nf(i){return'link[rel="stylesheet"]['+i+"]"}function lw(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function qR(i,u,p,x){i.querySelector('link[rel="preload"][as="style"]['+u+"]")?x.loading=1:(u=i.createElement("link"),x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2}),Br(u,"link",p),Cn(u),i.head.appendChild(u))}function Gc(i){return'[src="'+sr(i)+'"]'}function zf(i){return"script[async]"+i}function cw(i,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=i.querySelector('style[data-href~="'+sr(p.href)+'"]');if(x)return u.instance=x,Cn(x),x;var A=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(i.ownerDocument||i).createElement("style"),Cn(x),Br(x,"style",A),a_(x,p.precedence,i),u.instance=x;case"stylesheet":A=qc(p.href);var M=i.querySelector(Nf(A));if(M)return u.state.loading|=4,u.instance=M,Cn(M),M;x=lw(p),(A=bi.get(A))&&Qg(x,A),M=(i.ownerDocument||i).createElement("link"),Cn(M);var V=M;return V._p=new Promise(function(te,he){V.onload=te,V.onerror=he}),Br(M,"link",x),u.state.loading|=4,a_(M,p.precedence,i),u.instance=M;case"script":return M=Gc(p.src),(A=i.querySelector(zf(M)))?(u.instance=A,Cn(A),A):(x=p,(A=bi.get(M))&&(x=h({},p),Jg(x,A)),i=i.ownerDocument||i,A=i.createElement("script"),Cn(A),Br(A,"link",x),i.head.appendChild(A),u.instance=A);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,a_(x,p.precedence,i));return u.instance}function a_(i,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=x.length?x[x.length-1]:null,M=A,V=0;V title"):null)}function GR(i,u,p){if(p===1||u.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return i=u.disabled,typeof u.precedence=="string"&&i==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function dw(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function VR(i,u,p,x){if(p.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=qc(x.href),M=u.querySelector(Nf(A));if(M){u=M._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(i.count++,i=l_.bind(i),u.then(i,i)),p.state.loading|=4,p.instance=M,Cn(M);return}M=u.ownerDocument||u,x=lw(x),(A=bi.get(A))&&Qg(x,A),M=M.createElement("link"),Cn(M);var V=M;V._p=new Promise(function(te,he){V.onload=te,V.onerror=he}),Br(M,"link",x),p.instance=M}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(i.count++,p=l_.bind(i),u.addEventListener("load",p),u.addEventListener("error",p))}}var e1=0;function WR(i,u){return i.stylesheets&&i.count===0&&u_(i,i.stylesheets),0e1?50:800)+u);return i.unsuspend=p,function(){i.unsuspend=null,clearTimeout(x),clearTimeout(A)}}:null}function l_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u_(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var c_=null;function u_(i,u){i.stylesheets=null,i.unsuspend!==null&&(i.count++,c_=new Map,u.forEach(KR,i),c_=null,l_.call(i))}function KR(i,u){if(!(u.state.loading&4)){var p=c_.get(i);if(p)var x=p.get(null);else{p=new Map,c_.set(i,p);for(var A=i.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),c1.exports=uD(),c1.exports}var dD=fD();const hD={},_D="en",N2=["en","zh-CN","fa"],JC="orx:locale",z2=["localStorage","preferredLanguage","baseLocale"],$w=[],ld=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Hw=!1,E=()=>{var t;let e=z2;!ld&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=t9(window.location.href));const n=pD(e);if(n)return Hw||(Hw=!0,e9(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function pD(e,n){let t;for(const r of e){if(r==="baseLocale")t=_D;else if(r==="preferredLanguage"&&!ld)t=yD();else if(r==="localStorage"&&!ld)t=localStorage.getItem(JC)??void 0;else if(n9(r)&&m0.has(r)){const a=m0.get(r);if(a){const o=a.getLocale();if(o instanceof Promise)continue;if(o!==void 0)return vD(o)}}const s=cd(t);if(s)return s}}const mD=e=>{window.location.reload()};let e9=(e,n)=>{var l;const t={reload:!0,...n};let r;try{r=E()}catch{}const s=[];let a=z2;!ld&&typeof window<"u"&&((l=window.location)!=null&&l.href)&&(a=t9(window.location.href));for(const c of a)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(JC,e);else if(n9(c)&&m0.has(c)){const f=m0.get(c);if(f){let _=f.setLocale(e);_ instanceof Promise&&(_=_.catch(h=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:h})}),s.push(_))}}}const o=()=>{!ld&&t.reload&&window.location&&e!==r&&mD()};if(s.length)return Promise.all(s).then(()=>{o()});o()},gD=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function cd(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of N2)if(t.toLowerCase()===n)return t}function bD(e){return!!e&&N2.some(n=>n===e)}function vD(e){const n=cd(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${N2.join(", ")}`)}function xD(e,n){return e.exec(n.href)}function yD(){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=cd(t.fullTag);if(r)return r;const s=cd(t.baseTag);if(s)return s}}function wD(e){return SD(e)}function SD(e){const n=typeof e=="string"?new URL(e,gD()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&cd(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let Pw,Fw;function kD(e){if($w.length===0)return;const n=typeof e=="string"?e:e.href;if(Pw===n)return Fw;const t=new URL(n,"http://example.com"),r=wD(t),s=r.href===t.href?[t]:[t,r];let a;for(const o of s){for(const l of $w){const c=new hD(l.match,o.href);if(xD(c,o)){a=l;break}}if(a)break}return Pw=n,Fw=a,a}function t9(e){const n=kD(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:z2}const m0=new Map;function n9(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const CD=e=>`Actions for ${e==null?void 0:e.name}`,ED=e=>`${e==null?void 0:e.name} 的操作`,ND=e=>`عملیات ${e==null?void 0:e.name}`,zD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ED(e):t==="fa"?ND(e):CD(e)}),AD=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,jD=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,TD=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,MD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jD(e):t==="fa"?TD(e):AD(e)}),RD=e=>`Branch: ${e==null?void 0:e.branch}`,DD=e=>`分支:${e==null?void 0:e.branch}`,LD=e=>`شاخه: ${e==null?void 0:e.branch}`,OD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DD(e):t==="fa"?LD(e):RD(e)}),ID=e=>`Browse code on ${e==null?void 0:e.branch}`,BD=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,$D=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,r9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?BD(e):t==="fa"?$D(e):ID(e)}),HD=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,PD=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,FD=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,UD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PD(e):t==="fa"?FD(e):HD(e)}),qD=e=>`Collapse ${e==null?void 0:e.name}`,GD=e=>`折叠 ${e==null?void 0:e.name}`,VD=e=>`بستن ${e==null?void 0:e.name}`,WD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GD(e):t==="fa"?VD(e):qD(e)}),KD=e=>`Committed changes versus ${e==null?void 0:e.parent}`,XD=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,YD=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,ZD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XD(e):t==="fa"?YD(e):KD(e)}),QD=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,JD=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,eL=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,tL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JD(e):t==="fa"?eL(e):QD(e)}),nL=e=>`Copy ${e==null?void 0:e.value}`,rL=e=>`复制 ${e==null?void 0:e.value}`,sL=e=>`کپی ${e==null?void 0:e.value}`,iL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rL(e):t==="fa"?sL(e):nL(e)}),aL=e=>`Delete ${e==null?void 0:e.name}`,oL=e=>`删除 ${e==null?void 0:e.name}`,lL=e=>`حذف ${e==null?void 0:e.name}`,Gb=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oL(e):t==="fa"?lL(e):aL(e)}),cL=e=>`Download ${e==null?void 0:e.name}`,uL=e=>`下载 ${e==null?void 0:e.name}`,fL=e=>`بارگیری ${e==null?void 0:e.name}`,Uw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?uL(e):t==="fa"?fL(e):cL(e)}),dL=e=>`Expand ${e==null?void 0:e.name}`,hL=e=>`展开 ${e==null?void 0:e.name}`,_L=e=>`باز کردن ${e==null?void 0:e.name}`,pL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hL(e):t==="fa"?_L(e):dL(e)}),mL=e=>`Hide additional ${e==null?void 0:e.target}`,gL=e=>`隐藏其余${e==null?void 0:e.target}`,bL=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,vL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gL(e):t==="fa"?bL(e):mL(e)}),xL=e=>`Hide error details for ${e==null?void 0:e.activity}`,yL=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,wL=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,SL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yL(e):t==="fa"?wL(e):xL(e)}),kL=e=>`${e==null?void 0:e.count} consecutive identical calls`,CL=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,EL=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,NL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CL(e):t==="fa"?EL(e):kL(e)}),zL=e=>`Import into ${e==null?void 0:e.name}`,AL=e=>`导入到 ${e==null?void 0:e.name}`,jL=e=>`درون‌ریزی به ${e==null?void 0:e.name}`,TL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AL(e):t==="fa"?jL(e):zL(e)}),ML=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,RL=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,DL=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,LL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RL(e):t==="fa"?DL(e):ML(e)}),OL=e=>`${e==null?void 0:e.name} skills`,IL=e=>`${e==null?void 0:e.name} 的技能`,BL=e=>`مهارت‌های ${e==null?void 0:e.name}`,$L=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?IL(e):t==="fa"?BL(e):OL(e)}),HL=e=>`Open ${e==null?void 0:e.branch} on GitHub`,PL=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,FL=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,s9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PL(e):t==="fa"?FL(e):HL(e)}),UL=e=>`Open experiment ${e==null?void 0:e.name}`,qL=e=>`打开实验 ${e==null?void 0:e.name}`,GL=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,VL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qL(e):t==="fa"?GL(e):UL(e)}),WL=e=>`Open ${e==null?void 0:e.path} in the right pane`,KL=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,XL=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,YL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KL(e):t==="fa"?XL(e):WL(e)}),ZL=e=>`Open ${e==null?void 0:e.name}`,QL=e=>`打开 ${e==null?void 0:e.name}`,JL=e=>`باز کردن ${e==null?void 0:e.name}`,eO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QL(e):t==="fa"?JL(e):ZL(e)}),tO=e=>`Open logs for run ${e==null?void 0:e.run}`,nO=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,rO=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,sO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nO(e):t==="fa"?rO(e):tO(e)}),iO=e=>`Open ${e==null?void 0:e.name} on GitHub`,aO=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,oO=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,g0=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aO(e):t==="fa"?oO(e):iO(e)}),lO=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,cO=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,uO=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,fO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?cO(e):t==="fa"?uO(e):lO(e)}),dO=e=>`Overleaf — ${e==null?void 0:e.status}`,hO=e=>`Overleaf — ${e==null?void 0:e.status}`,_O=e=>`Overleaf — ${e==null?void 0:e.status}`,pO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hO(e):t==="fa"?_O(e):dO(e)}),mO=e=>`Preview /${e==null?void 0:e.name} skill`,gO=e=>`预览 /${e==null?void 0:e.name} 技能`,bO=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,vO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gO(e):t==="fa"?bO(e):mO(e)}),xO=e=>`Remove annotation ${e==null?void 0:e.number}`,yO=e=>`移除批注 ${e==null?void 0:e.number}`,wO=e=>`حذف یادداشت ${e==null?void 0:e.number}`,SO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yO(e):t==="fa"?wO(e):xO(e)}),kO=e=>`Remove ${e==null?void 0:e.name}`,CO=e=>`移除 ${e==null?void 0:e.name}`,EO=e=>`حذف ${e==null?void 0:e.name}`,NO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CO(e):t==="fa"?EO(e):kO(e)}),zO=e=>`Remove queued message: ${e==null?void 0:e.text}`,AO=e=>`移除排队消息:${e==null?void 0:e.text}`,jO=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,TO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AO(e):t==="fa"?jO(e):zO(e)}),MO=e=>`Retry queued message: ${e==null?void 0:e.text}`,RO=e=>`重试排队消息:${e==null?void 0:e.text}`,DO=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,LO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RO(e):t==="fa"?DO(e):MO(e)}),OO=e=>`Run ${e==null?void 0:e.id}`,IO=e=>`运行 ${e==null?void 0:e.id}`,BO=e=>`اجرای ${e==null?void 0:e.id}`,$O=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?IO(e):t==="fa"?BO(e):OO(e)}),HO=e=>`Show error details for ${e==null?void 0:e.activity}`,PO=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,FO=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,UO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PO(e):t==="fa"?FO(e):HO(e)}),qO=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,GO=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,VO=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,WO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GO(e):t==="fa"?VO(e):qO(e)}),KO=e=>`${e==null?void 0:e.name} skill`,XO=e=>`${e==null?void 0:e.name} 技能`,YO=e=>`مهارت ${e==null?void 0:e.name}`,ZO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XO(e):t==="fa"?YO(e):KO(e)}),QO=e=>`Value for ${e==null?void 0:e.name}`,JO=e=>`${e==null?void 0:e.name} 的值`,eI=e=>`مقدار ${e==null?void 0:e.name}`,tI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JO(e):t==="fa"?eI(e):QO(e)}),nI=()=>"Agent reported back",rI=()=>"智能体已返回结果",sI=()=>"عامل نتیجه را گزارش کرد",iI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rI():t==="fa"?sI():nI()}),aI=()=>"Browse",oI=()=>"浏览",lI=()=>"مرور",cI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oI():t==="fa"?lI():aI()}),uI=()=>"Browsing…",fI=()=>"正在浏览…",dI=()=>"در حال مرور…",hI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fI():t==="fa"?dI():uI()}),_I=()=>"Checked experiment status and updated notes",pI=()=>"已检查实验状态并更新笔记",mI=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",gI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pI():t==="fa"?mI():_I()}),bI=()=>"Closed an agent",vI=()=>"已关闭智能体",xI=()=>"عامل بسته شد",yI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vI():t==="fa"?xI():bI()}),wI=e=>`Created ${e==null?void 0:e.target}`,SI=e=>`已创建 ${e==null?void 0:e.target}`,kI=e=>`${e==null?void 0:e.target} ایجاد شد`,CI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SI(e):t==="fa"?kI(e):wI(e)}),EI=()=>"Delegate",NI=()=>"委派",zI=()=>"واگذاری",AI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NI():t==="fa"?zI():EI()}),jI=()=>"Delegating…",TI=()=>"正在委派…",MI=()=>"در حال واگذاری…",RI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TI():t==="fa"?MI():jI()}),DI=e=>`Deleted ${e==null?void 0:e.target}`,LI=e=>`已删除 ${e==null?void 0:e.target}`,OI=e=>`${e==null?void 0:e.target} حذف شد`,II=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LI(e):t==="fa"?OI(e):DI(e)}),BI=()=>"Edit",$I=()=>"编辑",HI=()=>"ویرایش",PI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$I():t==="fa"?HI():BI()}),FI=e=>`Edited ${e==null?void 0:e.target}`,UI=e=>`已编辑 ${e==null?void 0:e.target}`,qI=e=>`${e==null?void 0:e.target} ویرایش شد`,GI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UI(e):t==="fa"?qI(e):FI(e)}),VI=()=>"Editing…",WI=()=>"正在编辑…",KI=()=>"در حال ویرایش…",XI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WI():t==="fa"?KI():VI()}),YI=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,ZI=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,QI=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,JI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZI(e):t==="fa"?QI(e):YI(e)}),eB=e=>`Listed files matching ${e==null?void 0:e.pattern}`,tB=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,nB=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,rB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tB(e):t==="fa"?nB(e):eB(e)}),sB=()=>"Load",iB=()=>"加载",aB=()=>"بارگیری",oB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iB():t==="fa"?aB():sB()}),lB=()=>"Loaded a skill",cB=()=>"已加载技能",uB=()=>"یک مهارت بارگیری شد",fB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cB():t==="fa"?uB():lB()}),dB=e=>`Loaded ${e==null?void 0:e.name} skill`,hB=e=>`已加载技能 ${e==null?void 0:e.name}`,_B=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,pB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hB(e):t==="fa"?_B(e):dB(e)}),mB=()=>"Loading…",gB=()=>"正在加载…",bB=()=>"در حال بارگیری…",vB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gB():t==="fa"?bB():mB()}),xB=e=>`Opened ${e==null?void 0:e.target}`,yB=e=>`已打开 ${e==null?void 0:e.target}`,wB=e=>`${e==null?void 0:e.target} باز شد`,SB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yB(e):t==="fa"?wB(e):xB(e)}),kB=e=>`Ran ${e==null?void 0:e.command}`,CB=e=>`已运行 ${e==null?void 0:e.command}`,EB=e=>`${e==null?void 0:e.command} اجرا شد`,NB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CB(e):t==="fa"?EB(e):kB(e)}),zB=()=>"Ran a sub-agent",AB=()=>"已运行子智能体",jB=()=>"یک عامل فرعی اجرا شد",TB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AB():t==="fa"?jB():zB()}),MB=()=>"Read",RB=()=>"读取",DB=()=>"خواندن",LB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RB():t==="fa"?DB():MB()}),OB=()=>"Read experiment notes",IB=()=>"已读取实验笔记",BB=()=>"یادداشت‌های آزمایش خوانده شد",$B=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IB():t==="fa"?BB():OB()}),HB=()=>"Read a paper",PB=()=>"已读取论文",FB=()=>"یک مقاله خوانده شد",UB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PB():t==="fa"?FB():HB()}),qB=e=>`Read ${e==null?void 0:e.name} skill`,GB=e=>`已读取技能 ${e==null?void 0:e.name}`,VB=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,h1=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GB(e):t==="fa"?VB(e):qB(e)}),WB=e=>`Read ${e==null?void 0:e.target}`,KB=e=>`已读取 ${e==null?void 0:e.target}`,XB=e=>`${e==null?void 0:e.target} خوانده شد`,Lf=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KB(e):t==="fa"?XB(e):WB(e)}),YB=()=>"Read a web page",ZB=()=>"已读取网页",QB=()=>"یک صفحهٔ وب خوانده شد",JB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZB():t==="fa"?QB():YB()}),e$=()=>"Reading…",t$=()=>"正在读取…",n$=()=>"در حال خواندن…",r$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t$():t==="fa"?n$():e$()}),s$=()=>"Resumed an agent",i$=()=>"已恢复智能体",a$=()=>"عامل از سر گرفته شد",o$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i$():t==="fa"?a$():s$()}),l$=()=>"Review",c$=()=>"查看",u$=()=>"بازبینی",f$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c$():t==="fa"?u$():l$()}),d$=()=>"Reviewed run log",h$=()=>"已查看运行日志",_$=()=>"گزارش اجرا بازبینی شد",p$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h$():t==="fa"?_$():d$()}),m$=()=>"Reviewed run logs",g$=()=>"已查看运行日志",b$=()=>"گزارش‌های اجرا بازبینی شد",v$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g$():t==="fa"?b$():m$()}),x$=()=>"Reviewed experiment status and notes",y$=()=>"已查看实验状态和笔记",w$=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",S$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y$():t==="fa"?w$():x$()}),k$=()=>"Reviewing…",C$=()=>"正在查看…",E$=()=>"در حال بازبینی…",N$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C$():t==="fa"?E$():k$()}),z$=()=>"Run",A$=()=>"运行",j$=()=>"اجرا",T$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A$():t==="fa"?j$():z$()}),M$=()=>"Running…",R$=()=>"正在运行…",D$=()=>"در حال اجرا…",L$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R$():t==="fa"?D$():M$()}),O$=()=>"Search",I$=()=>"搜索",B$=()=>"جست‌وجو",$$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I$():t==="fa"?B$():O$()}),H$=()=>"Searched alphaXiv full text",P$=()=>"已搜索 alphaXiv 全文",F$=()=>"متن کامل alphaXiv جست‌وجو شد",U$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P$():t==="fa"?F$():H$()}),q$=()=>"Searched alphaXiv semantically",G$=()=>"已对 alphaXiv 进行语义搜索",V$=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",W$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G$():t==="fa"?V$():q$()}),K$=()=>"Searched bioRxiv",X$=()=>"已搜索 bioRxiv",Y$=()=>"bioRxiv جست‌وجو شد",Z$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X$():t==="fa"?Y$():K$()}),Q$=()=>"Searched code",J$=()=>"已搜索代码",eH=()=>"کد جست‌وجو شد",_1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J$():t==="fa"?eH():Q$()}),tH=e=>`Searched code for “${e==null?void 0:e.pattern}”`,nH=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,rH=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,p1=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nH(e):t==="fa"?rH(e):tH(e)}),sH=e=>`Searched images for “${e==null?void 0:e.query}”`,iH=e=>`已搜索图片“${e==null?void 0:e.query}”`,aH=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,oH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iH(e):t==="fa"?aH(e):sH(e)}),lH=()=>"Searched the literature",cH=()=>"已搜索文献",uH=()=>"منابع علمی جست‌وجو شد",qw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cH():t==="fa"?uH():lH()}),fH=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,dH=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,hH=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,_H=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dH(e):t==="fa"?hH(e):fH(e)}),pH=()=>"Searched OpenAlex",mH=()=>"已搜索 OpenAlex",gH=()=>"OpenAlex جست‌وجو شد",bH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mH():t==="fa"?gH():pH()}),vH=e=>`Searched the web for “${e==null?void 0:e.query}”`,xH=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,yH=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,Gw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xH(e):t==="fa"?yH(e):vH(e)}),wH=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,SH=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,kH=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,CH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SH(e):t==="fa"?kH(e):wH(e)}),EH=()=>"Searching…",NH=()=>"正在搜索…",zH=()=>"در حال جست‌وجو…",AH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NH():t==="fa"?zH():EH()}),jH=()=>"Sent input to an agent",TH=()=>"已向智能体发送输入",MH=()=>"ورودی به عامل فرستاده شد",RH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TH():t==="fa"?MH():jH()}),DH=()=>"Spawned an agent",LH=()=>"已创建智能体",OH=()=>"یک عامل ساخته شد",IH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LH():t==="fa"?OH():DH()}),BH=()=>"Sub-agent",$H=()=>"子智能体",HH=()=>"عامل فرعی",PH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$H():t==="fa"?HH():BH()}),FH=()=>"Sub-agent interrupted",UH=()=>"子智能体已中断",qH=()=>"عامل فرعی متوقف شد",GH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UH():t==="fa"?qH():FH()}),VH=()=>"Sub-agent started",WH=()=>"子智能体已启动",KH=()=>"عامل فرعی آغاز شد",XH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WH():t==="fa"?KH():VH()}),YH=()=>"Updated experiment notes",ZH=()=>"已更新实验笔记",QH=()=>"یادداشت‌های آزمایش به‌روز شد",JH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZH():t==="fa"?QH():YH()}),eP=()=>"Waiting on an agent",tP=()=>"正在等待智能体",nP=()=>"در انتظار عامل",rP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tP():t==="fa"?nP():eP()}),sP=e=>`Approval required: ${e==null?void 0:e.label}`,iP=e=>`需要批准:${e==null?void 0:e.label}`,aP=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,Vw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iP(e):t==="fa"?aP(e):sP(e)}),oP=()=>"The CLI is retrying the turn.",lP=()=>"CLI 正在重试本轮。",cP=()=>"CLI در حال تلاش دوباره برای این نوبت است.",uP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lP():t==="fa"?cP():oP()}),fP=()=>"Continue is available.",dP=()=>"可以继续。",hP=()=>"ادامه در دسترس است.",_P=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dP():t==="fa"?hP():fP()}),pP=()=>"Retry is available.",mP=()=>"可以重试。",gP=()=>"تلاش دوباره در دسترس است.",bP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mP():t==="fa"?gP():pP()}),vP=()=>"Running a tool",xP=()=>"正在运行工具",yP=()=>"در حال اجرای ابزار",wP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xP():t==="fa"?yP():vP()}),SP=()=>"Tool activity completed",kP=()=>"工具活动已完成",CP=()=>"فعالیت ابزار کامل شد",EP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kP():t==="fa"?CP():SP()}),NP=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,zP=e=>`工具活动失败:${e==null?void 0:e.labels}`,AP=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,jP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zP(e):t==="fa"?AP(e):NP(e)}),TP=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,MP=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,RP=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,DP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MP(e):t==="fa"?RP(e):TP(e)}),LP=()=>"Turn did not finish.",OP=()=>"本轮未完成。",IP=()=>"این نوبت کامل نشد.",BP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OP():t==="fa"?IP():LP()}),$P=()=>"Artifacts",HP=()=>"产物",PP=()=>"خروجی‌ها",FP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HP():t==="fa"?PP():$P()}),UP=()=>"Close panel",qP=()=>"关闭面板",GP=()=>"بستن پنل",Ww=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qP():t==="fa"?GP():UP()}),VP=()=>"Current task",WP=()=>"当前任务",KP=()=>"وظیفهٔ فعلی",Kw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WP():t==="fa"?KP():VP()}),XP=()=>"Drag to resize panel",YP=()=>"拖动以调整面板大小",ZP=()=>"برای تغییر اندازهٔ پنل بکشید",QP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YP():t==="fa"?ZP():XP()}),JP=()=>"Drag toward the center to restore panel",eF=()=>"向中央拖动以恢复面板",tF=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",nF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eF():t==="fa"?tF():JP()}),rF=()=>"Entire project",sF=()=>"整个项目",iF=()=>"کل پروژه",Xw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sF():t==="fa"?iF():rF()}),aF=()=>"Expand panel",oF=()=>"展开面板",lF=()=>"گسترش پنل",Yw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oF():t==="fa"?lF():aF()}),cF=e=>`Experiment filter: ${e==null?void 0:e.scope}`,uF=e=>`实验筛选:${e==null?void 0:e.scope}`,fF=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,dF=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?uF(e):t==="fa"?fF(e):cF(e)}),hF=()=>"Experiment view",_F=()=>"实验视图",pF=()=>"نمای آزمایش",mF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_F():t==="fa"?pF():hF()}),gF=()=>"Experiments",bF=()=>"实验",vF=()=>"آزمایش‌ها",xF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bF():t==="fa"?vF():gF()}),yF=()=>"Files",wF=()=>"文件",SF=()=>"فایل‌ها",kF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wF():t==="fa"?SF():yF()}),CF=()=>"Filter experiments",EF=()=>"筛选实验",NF=()=>"فیلتر آزمایش‌ها",zF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EF():t==="fa"?NF():CF()}),AF=()=>"Current task filtering is unavailable for unattributed experiments",jF=()=>"存在无法归属的实验时,不能按当前任务筛选",TF=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",MF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jF():t==="fa"?TF():AF()}),RF=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",DF=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",LF=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",OF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DF():t==="fa"?LF():RF()}),IF=()=>"Open a task to filter to its experiments",BF=()=>"请打开一个任务以筛选其实验",$F=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",HF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BF():t==="fa"?$F():IF()}),PF=()=>"projects",FF=()=>"项目",UF=()=>"پروژه‌ها",qF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FF():t==="fa"?UF():PF()}),GF=()=>"Restore panel",VF=()=>"还原面板",WF=()=>"بازگرداندن اندازهٔ پنل",Zw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VF():t==="fa"?WF():GF()}),KF=()=>"Retry",XF=()=>"重试",YF=()=>"تلاش دوباره",A2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XF():t==="fa"?YF():KF()}),ZF=()=>"Select a project to browse its files.",QF=()=>"选择一个项目以浏览其文件。",JF=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",eU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QF():t==="fa"?JF():ZF()}),tU=()=>"settings",nU=()=>"设置",rU=()=>"تنظیمات",sU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nU():t==="fa"?rU():tU()}),iU=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,aU=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,oU=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,lU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aU(e):t==="fa"?oU(e):iU(e)}),cU=()=>"Sub-agent",uU=()=>"子智能体",fU=()=>"عامل فرعی",dU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uU():t==="fa"?fU():cU()}),hU=()=>"Table",_U=()=>"表格",pU=()=>"جدول",mU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_U():t==="fa"?pU():hU()}),gU=()=>"Tree",bU=()=>"树状图",vU=()=>"درخت",xU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bU():t==="fa"?vU():gU()}),yU=e=>`Collapse ${e==null?void 0:e.name}`,wU=e=>`折叠 ${e==null?void 0:e.name}`,SU=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,kU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wU(e):t==="fa"?SU(e):yU(e)}),CU=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,EU=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,NU=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,i9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EU(e):t==="fa"?NU(e):CU(e)}),zU=e=>`Delete folder ${e==null?void 0:e.name}`,AU=e=>`删除文件夹 ${e==null?void 0:e.name}`,jU=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,TU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AU(e):t==="fa"?jU(e):zU(e)}),MU=e=>`Expand ${e==null?void 0:e.name}`,RU=e=>`展开 ${e==null?void 0:e.name}`,DU=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,LU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RU(e):t==="fa"?DU(e):MU(e)}),OU=()=>"Binary or unsupported file — no inline preview.",IU=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",BU=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",$U=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IU():t==="fa"?BU():OU()}),HU=()=>"Copy path",PU=()=>"复制路径",FU=()=>"کپی مسیر",UU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PU():t==="fa"?FU():HU()}),qU=()=>"Artifact not found",GU=()=>"找不到产物",VU=()=>"خروجی پیدا نشد",WU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GU():t==="fa"?VU():qU()}),KU=()=>"Open raw",XU=()=>"打开原始文件",YU=()=>"باز کردن فایل خام",ZU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XU():t==="fa"?YU():KU()}),QU=()=>"Click an artifact to view it",JU=()=>"点击产物即可查看",eq=()=>"برای مشاهده، یک خروجی را انتخاب کنید",tq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JU():t==="fa"?eq():QU()}),nq=()=>"Copy artifacts directory path",rq=()=>"复制产物目录路径",sq=()=>"کپی مسیر پوشهٔ خروجی‌ها",iq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rq():t==="fa"?sq():nq()}),aq=()=>"Delete artifact",oq=()=>"删除产物",lq=()=>"حذف خروجی",Qw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oq():t==="fa"?lq():aq()}),cq=()=>"Delete folder",uq=()=>"删除文件夹",fq=()=>"حذف پوشه",dq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uq():t==="fa"?fq():cq()}),hq=()=>"Failed to load:",_q=()=>"加载失败:",pq=()=>"بارگیری ناموفق بود:",mq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_q():t==="fa"?pq():hq()}),gq=()=>"File truncated — showing the first 512 KB.",bq=()=>"文件已截断——仅显示前 512 KB。",vq=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",xq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bq():t==="fa"?vq():gq()}),yq=()=>"Listing truncated — the folder has more artifacts.",wq=()=>"列表已截断——文件夹中还有更多产物。",Sq=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",kq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wq():t==="fa"?Sq():yq()}),Cq=()=>"Loading…",Eq=()=>"正在加载…",Nq=()=>"در حال بارگیری…",zq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eq():t==="fa"?Nq():Cq()}),Aq=()=>"Loading artifacts…",jq=()=>"正在加载产物…",Tq=()=>"در حال بارگیری خروجی‌ها…",Mq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jq():t==="fa"?Tq():Aq()}),Rq=()=>"Modified",Dq=()=>"修改时间",Lq=()=>"ویرایش‌شده",Oq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dq():t==="fa"?Lq():Rq()}),Iq=()=>"No artifacts yet",Bq=()=>"尚无产物",$q=()=>"هنوز خروجی‌ای وجود ندارد",Hq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bq():t==="fa"?$q():Iq()}),Pq=()=>"Open raw in new tab",Fq=()=>"在新标签页中打开原始文件",Uq=()=>"باز کردن فایل خام در زبانهٔ جدید",Jw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fq():t==="fa"?Uq():Pq()}),qq=()=>"Storage settings",Gq=()=>"存储设置",Vq=()=>"تنظیمات ذخیره‌سازی",e6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gq():t==="fa"?Vq():qq()}),Wq=()=>"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:",Kq=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件:",Xq=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید:",Yq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kq():t==="fa"?Xq():Wq()}),Zq=()=>"File too large to preview inline.",Qq=()=>"文件太大,无法内嵌预览。",Jq=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",eG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qq():t==="fa"?Jq():Zq()}),tG=()=>"This is the baseline branch, so there is no parent comparison.",nG=()=>"这是基线分支,因此没有父分支可供比较。",rG=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",sG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nG():t==="fa"?rG():tG()}),iG=()=>"Failed to load changes:",aG=()=>"加载更改失败:",oG=()=>"بارگیری تغییرات ناموفق بود:",lG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aG():t==="fa"?oG():iG()}),cG=()=>"Loading changes…",uG=()=>"正在加载更改…",fG=()=>"در حال بارگیری تغییرات…",dG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uG():t==="fa"?fG():cG()}),hG=()=>"No committed changes from the parent branch.",_G=()=>"与父分支相比没有已提交的更改。",pG=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",mG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_G():t==="fa"?pG():hG()}),gG=e=>`agent ${e==null?void 0:e.number}`,bG=e=>`智能体 ${e==null?void 0:e.number}`,vG=e=>`عامل ${e==null?void 0:e.number}`,t6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bG(e):t==="fa"?vG(e):gG(e)}),xG=()=>"agent sessions",yG=()=>"智能体会话",wG=()=>"نشست‌های عامل‌ها",SG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yG():t==="fa"?wG():xG()}),kG=()=>"All sessions",CG=()=>"所有会话",EG=()=>"همهٔ نشست‌ها",NG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CG():t==="fa"?EG():kG()}),zG=e=>`${e==null?void 0:e.count} annotations`,AG=e=>`${e==null?void 0:e.count} 条批注`,jG=e=>`${e==null?void 0:e.count} یادداشت`,TG=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AG(e):t==="fa"?jG(e):zG(e)}),MG=()=>"Archive",RG=()=>"归档",DG=()=>"بایگانی",LG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RG():t==="fa"?DG():MG()}),OG=()=>"Ask the research agent… (/ for commands and skills)",IG=()=>"询问研究智能体…(输入 / 使用命令和技能)",BG=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها)",$G=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IG():t==="fa"?BG():OG()}),HG=()=>"Asked about selected text",PG=()=>"已询问所选文本",FG=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",UG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PG():t==="fa"?FG():HG()}),qG=()=>"Attachment",GG=()=>"附件",VG=()=>"پیوست",WG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GG():t==="fa"?VG():qG()}),KG=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,XG=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,YG=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,ZG=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XG(e):t==="fa"?YG(e):KG(e)}),QG=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",JG=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",eV=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",tV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JG():t==="fa"?eV():QG()}),nV=()=>"Collapse tool activity",rV=()=>"折叠工具活动",sV=()=>"بستن فعالیت ابزارها",iV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rV():t==="fa"?sV():nV()}),aV=()=>"Continue",oV=()=>"继续",lV=()=>"ادامه",cV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oV():t==="fa"?lV():aV()}),uV=e=>`Delete “${e==null?void 0:e.title}”? +`+x.stack}}var Tt=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,Wt=e.unstable_cancelCallback,fn=e.unstable_shouldYield,ht=e.unstable_requestPaint,Qe=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Le=e.unstable_UserBlockingPriority,qe=e.unstable_NormalPriority,tt=e.unstable_LowPriority,at=e.unstable_IdlePriority,Mt=e.log,yt=e.unstable_setDisableYieldValue,Ot=null,Rt=null;function sn(i){if(typeof Mt=="function"&&yt(i),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Ot,i)}catch{}}var xt=Math.clz32?Math.clz32:Ke,hn=Math.log,dn=Math.LN2;function Ke(i){return i>>>=0,i===0?32:31-(hn(i)/dn|0)|0}var ut=256,_n=262144,Rr=4194304;function ct(i){var u=i&42;if(u!==0)return u;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ut(i,u,p){var x=i.pendingLanes;if(x===0)return 0;var A=0,M=i.suspendedLanes,V=i.pingedLanes;i=i.warmLanes;var te=x&134217727;return te!==0?(x=te&~M,x!==0?A=ct(x):(V&=te,V!==0?A=ct(V):p||(p=te&~i,p!==0&&(A=ct(p))))):(te=x&~M,te!==0?A=ct(te):V!==0?A=ct(V):p||(p=x&~i,p!==0&&(A=ct(p)))),A===0?0:u!==0&&u!==A&&(u&M)===0&&(M=A&-A,p=u&-u,M>=p||M===32&&(p&4194048)!==0)?u:A}function Qt(i,u){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&u)===0}function Gr(i,u){switch(i){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zr(){var i=Rr;return Rr<<=1,(Rr&62914560)===0&&(Rr=4194304),i}function Ts(i){for(var u=[],p=0;31>p;p++)u.push(i);return u}function Ze(i,u){i.pendingLanes|=u,u!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function mt(i,u,p,x,A,M){var V=i.pendingLanes;i.pendingLanes=p,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=p,i.entangledLanes&=p,i.errorRecoveryDisabledLanes&=p,i.shellSuspendCounter=0;var te=i.entanglements,de=i.expirationTimes,ke=i.hiddenUpdates;for(p=V&~p;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Kn=/[\n"\\]/g;function or(i){return i.replace(Kn,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Xi(i,u,p,x,A,M,V,te){i.name="",V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?i.type=V:i.removeAttribute("type"),u!=null?V==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+wr(u)):i.value!==""+wr(u)&&(i.value=""+wr(u)):V!=="submit"&&V!=="reset"||i.removeAttribute("value"),u!=null?Ni(i,V,wr(u)):p!=null?Ni(i,V,wr(p)):x!=null&&i.removeAttribute("value"),A==null&&M!=null&&(i.defaultChecked=!!M),A!=null&&(i.checked=A&&typeof A!="function"&&typeof A!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?i.name=""+wr(te):i.removeAttribute("name")}function jr(i,u,p,x,A,M,V,te){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(i.type=M),u!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||u!=null)){ai(i);return}p=p!=null?""+wr(p):"",u=u!=null?""+wr(u):p,te||u===i.value||(i.value=u),i.defaultValue=u}x=x??A,x=typeof x!="function"&&typeof x!="symbol"&&!!x,i.checked=te?i.checked:!!x,i.defaultChecked=!!x,V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(i.name=V),ai(i)}function Ni(i,u,p){u==="number"&&jn(i.ownerDocument)===i||i.defaultValue===""+p||(i.defaultValue=""+p)}function oi(i,u,p,x){if(i=i.options,u){u={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zi=!1;if(as)try{var Ai={};Object.defineProperty(Ai,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Zi=!1}var tr=null,Un=null,ji=null;function dl(){if(ji)return ji;var i,u=Un,p=u.length,x,A="value"in tr?tr.value:tr.textContent,M=A.length;for(i=0;i=yo),rn=" ",ra=!1;function sa(i,u){switch(i){case"keyup":return dd.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cr(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Mi=!1;function kr(i,u){switch(i){case"compositionend":return cr(u);case"keypress":return u.which!==32?null:(ra=!0,rn);case"textInput":return i=u.data,i===rn&&ra?null:i;default:return null}}function _m(i,u){if(Mi)return i==="compositionend"||!bc&&sa(i,u)?(i=dl(),ji=Un=tr=null,Mi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:p,offset:u-i};i=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=p4(p)}}function g4(i,u){return i&&u?i===u?!0:i&&i.nodeType===3?!1:u&&u.nodeType===3?g4(i,u.parentNode):"contains"in i?i.contains(u):i.compareDocumentPosition?!!(i.compareDocumentPosition(u)&16):!1:!1}function b4(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var u=jn(i.document);u instanceof i.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)i=u.contentWindow;else break;u=jn(i.document)}return u}function gm(i){var u=i&&i.nodeName&&i.nodeName.toLowerCase();return u&&(u==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||u==="textarea"||i.contentEditable==="true")}var $M=as&&"documentMode"in document&&11>=document.documentMode,vc=null,bm=null,Ju=null,vm=!1;function v4(i,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;vm||vc==null||vc!==jn(x)||(x=vc,"selectionStart"in x&&gm(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Ju&&Qu(Ju,x)||(Ju=x,x=r_(bm,"onSelect"),0>=V,A-=V,ia=1<<32-xt(u)+A|p<At?(Pt=rt,rt=null):Pt=rt.sibling;var Zt=Ce(xe,rt,Se[At],De);if(Zt===null){rt===null&&(rt=Pt);break}i&&rt&&Zt.alternate===null&&u(xe,rt),_e=M(Zt,_e,At),Yt===null?ft=Zt:Yt.sibling=Zt,Yt=Zt,rt=Pt}if(At===Se.length)return p(xe,rt),Gt&&Ra(xe,At),ft;if(rt===null){for(;AtAt?(Pt=rt,rt=null):Pt=rt.sibling;var Uo=Ce(xe,rt,Zt.value,De);if(Uo===null){rt===null&&(rt=Pt);break}i&&rt&&Uo.alternate===null&&u(xe,rt),_e=M(Uo,_e,At),Yt===null?ft=Uo:Yt.sibling=Uo,Yt=Uo,rt=Pt}if(Zt.done)return p(xe,rt),Gt&&Ra(xe,At),ft;if(rt===null){for(;!Zt.done;At++,Zt=Se.next())Zt=Oe(xe,Zt.value,De),Zt!==null&&(_e=M(Zt,_e,At),Yt===null?ft=Zt:Yt.sibling=Zt,Yt=Zt);return Gt&&Ra(xe,At),ft}for(rt=x(rt);!Zt.done;At++,Zt=Se.next())Zt=ze(rt,xe,At,Zt.value,De),Zt!==null&&(i&&Zt.alternate!==null&&rt.delete(Zt.key===null?At:Zt.key),_e=M(Zt,_e,At),Yt===null?ft=Zt:Yt.sibling=Zt,Yt=Zt);return i&&rt.forEach(function(iD){return u(xe,iD)}),Gt&&Ra(xe,At),ft}function bn(xe,_e,Se,De){if(typeof Se=="object"&&Se!==null&&Se.type===k&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case g:e:{for(var ft=Se.key;_e!==null;){if(_e.key===ft){if(ft=Se.type,ft===k){if(_e.tag===7){p(xe,_e.sibling),De=A(_e,Se.props.children),De.return=xe,xe=De;break e}}else if(_e.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===j&&Nl(ft)===_e.type){p(xe,_e.sibling),De=A(_e,Se.props),af(De,Se),De.return=xe,xe=De;break e}p(xe,_e);break}else u(xe,_e);_e=_e.sibling}Se.type===k?(De=wl(Se.props.children,xe.mode,De,Se.key),De.return=xe,xe=De):(De=xd(Se.type,Se.key,Se.props,null,xe.mode,De),af(De,Se),De.return=xe,xe=De)}return V(xe);case S:e:{for(ft=Se.key;_e!==null;){if(_e.key===ft)if(_e.tag===4&&_e.stateNode.containerInfo===Se.containerInfo&&_e.stateNode.implementation===Se.implementation){p(xe,_e.sibling),De=A(_e,Se.children||[]),De.return=xe,xe=De;break e}else{p(xe,_e);break}else u(xe,_e);_e=_e.sibling}De=Em(Se,xe.mode,De),De.return=xe,xe=De}return V(xe);case j:return Se=Nl(Se),bn(xe,_e,Se,De)}if(Z(Se))return nt(xe,_e,Se,De);if(P(Se)){if(ft=P(Se),typeof ft!="function")throw Error(r(150));return Se=ft.call(Se),pt(xe,_e,Se,De)}if(typeof Se.then=="function")return bn(xe,_e,Nd(Se),De);if(Se.$$typeof===y)return bn(xe,_e,Sd(xe,Se),De);zd(xe,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint"?(Se=""+Se,_e!==null&&_e.tag===6?(p(xe,_e.sibling),De=A(_e,Se),De.return=xe,xe=De):(p(xe,_e),De=Cm(Se,xe.mode,De),De.return=xe,xe=De),V(xe)):p(xe,_e)}return function(xe,_e,Se,De){try{sf=0;var ft=bn(xe,_e,Se,De);return jc=null,ft}catch(rt){if(rt===Ac||rt===Cd)throw rt;var Yt=Bs(29,rt,null,xe.mode);return Yt.lanes=De,Yt.return=xe,Yt}finally{}}}var Al=P4(!0),U4=P4(!1),Eo=!1;function Bm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $m(i,u){i=i.updateQueue,u.updateQueue===i&&(u.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function No(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zo(i,u,p){var x=i.updateQueue;if(x===null)return null;if(x=x.shared,(Jt&2)!==0){var A=x.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),x.pending=u,u=vd(i),E4(i,null,p),u}return bd(i,x,u,p),vd(i)}function of(i,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var x=u.lanes;x&=i.pendingLanes,p|=x,u.lanes=p,Cn(i,p)}}function Hm(i,u){var p=i.updateQueue,x=i.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var A=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var V={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?A=M=V:M=M.next=V,p=p.next}while(p!==null);M===null?A=M=u:M=M.next=u}else A=M=u;p={baseState:x.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:x.shared,callbacks:x.callbacks},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=u:i.next=u,p.lastBaseUpdate=u}var Fm=!1;function lf(){if(Fm){var i=zc;if(i!==null)throw i}}function cf(i,u,p,x){Fm=!1;var A=i.updateQueue;Eo=!1;var M=A.firstBaseUpdate,V=A.lastBaseUpdate,te=A.shared.pending;if(te!==null){A.shared.pending=null;var de=te,ke=de.next;de.next=null,V===null?M=ke:V.next=ke,V=de;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,te=Me.lastBaseUpdate,te!==V&&(te===null?Me.firstBaseUpdate=ke:te.next=ke,Me.lastBaseUpdate=de))}if(M!==null){var Oe=A.baseState;V=0,Me=ke=de=null,te=M;do{var Ce=te.lane&-536870913,ze=Ce!==te.lane;if(ze?(Ft&Ce)===Ce:(x&Ce)===Ce){Ce!==0&&Ce===Nc&&(Fm=!0),Me!==null&&(Me=Me.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var nt=i,pt=te;Ce=u;var bn=p;switch(pt.tag){case 1:if(nt=pt.payload,typeof nt=="function"){Oe=nt.call(bn,Oe,Ce);break e}Oe=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=pt.payload,Ce=typeof nt=="function"?nt.call(bn,Oe,Ce):nt,Ce==null)break e;Oe=d({},Oe,Ce);break e;case 2:Eo=!0}}Ce=te.callback,Ce!==null&&(i.flags|=64,ze&&(i.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ce]:ze.push(Ce))}else ze={lane:Ce,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Me===null?(ke=Me=ze,de=Oe):Me=Me.next=ze,V|=Ce;if(te=te.next,te===null){if(te=A.shared.pending,te===null)break;ze=te,te=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);Me===null&&(de=Oe),A.baseState=de,A.firstBaseUpdate=ke,A.lastBaseUpdate=Me,M===null&&(A.shared.lanes=0),Ro|=V,i.lanes=V,i.memoizedState=Oe}}function q4(i,u){if(typeof i!="function")throw Error(r(191,i));i.call(u)}function G4(i,u){var p=i.callbacks;if(p!==null)for(i.callbacks=null,i=0;iM?M:8;var V=X.T,te={};X.T=te,ag(i,!1,u,p);try{var de=A(),ke=X.S;if(ke!==null&&ke(te,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Me=KM(de,x);hf(i,u,Me,Us(i))}else hf(i,u,x,Us(i))}catch(Oe){hf(i,u,{then:function(){},status:"rejected",reason:Oe},Us())}finally{J.p=M,V!==null&&te.types!==null&&(V.types=te.types),X.T=V}}function eR(){}function sg(i,u,p,x){if(i.tag!==5)throw Error(r(476));var A=S5(i).queue;w5(i,A,u,ee,p===null?eR:function(){return k5(i),p(x)})}function S5(i){var u=i.memoizedState;if(u!==null)return u;u={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ee},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:p},next:null},i.memoizedState=u,i=i.alternate,i!==null&&(i.memoizedState=u),u}function k5(i){var u=S5(i);u.next===null&&(u=i.alternate.memoizedState),hf(i,u.next.queue,{},Us())}function ig(){return Hr(Af)}function C5(){return sr().memoizedState}function E5(){return sr().memoizedState}function tR(i){for(var u=i.return;u!==null;){switch(u.tag){case 24:case 3:var p=Us();i=No(p);var x=zo(u,i,p);x!==null&&(ks(x,u,p),of(x,u,p)),u={cache:Dm()},i.payload=u;return}u=u.return}}function nR(i,u,p){var x=Us();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Bd(i)?z5(u,p):(p=Sm(i,u,p,x),p!==null&&(ks(p,i,x),A5(p,u,x)))}function N5(i,u,p){var x=Us();hf(i,u,p,x)}function hf(i,u,p,x){var A={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Bd(i))z5(u,A);else{var M=i.alternate;if(i.lanes===0&&(M===null||M.lanes===0)&&(M=u.lastRenderedReducer,M!==null))try{var V=u.lastRenderedState,te=M(V,p);if(A.hasEagerState=!0,A.eagerState=te,Is(te,V))return bd(i,u,A,0),yn===null&&gd(),!1}catch{}finally{}if(p=Sm(i,u,A,x),p!==null)return ks(p,i,x),A5(p,u,x),!0}return!1}function ag(i,u,p,x){if(x={lane:2,revertLane:Bg(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Bd(i)){if(u)throw Error(r(479))}else u=Sm(i,p,x,2),u!==null&&ks(u,i,2)}function Bd(i){var u=i.alternate;return i===Et||u!==null&&u===Et}function z5(i,u){Mc=Td=!0;var p=i.pending;p===null?u.next=u:(u.next=p.next,p.next=u),i.pending=u}function A5(i,u,p){if((p&4194048)!==0){var x=u.lanes;x&=i.pendingLanes,p|=x,u.lanes=p,Cn(i,p)}}var df={readContext:Hr,use:Dd,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useLayoutEffect:Yn,useInsertionEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useSyncExternalStore:Yn,useId:Yn,useHostTransitionStatus:Yn,useFormState:Yn,useActionState:Yn,useOptimistic:Yn,useMemoCache:Yn,useCacheRefresh:Yn};df.useEffectEvent=Yn;var j5={readContext:Hr,use:Dd,useCallback:function(i,u){return os().memoizedState=[i,u===void 0?null:u],i},useContext:Hr,useEffect:d5,useImperativeHandle:function(i,u,p){p=p!=null?p.concat([i]):null,Od(4194308,4,g5.bind(null,u,i),p)},useLayoutEffect:function(i,u){return Od(4194308,4,i,u)},useInsertionEffect:function(i,u){Od(4,2,i,u)},useMemo:function(i,u){var p=os();u=u===void 0?null:u;var x=i();if(jl){sn(!0);try{i()}finally{sn(!1)}}return p.memoizedState=[x,u],x},useReducer:function(i,u,p){var x=os();if(p!==void 0){var A=p(u);if(jl){sn(!0);try{p(u)}finally{sn(!1)}}}else A=u;return x.memoizedState=x.baseState=A,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:A},x.queue=i,i=i.dispatch=nR.bind(null,Et,i),[x.memoizedState,i]},useRef:function(i){var u=os();return i={current:i},u.memoizedState=i},useState:function(i){i=Jm(i);var u=i.queue,p=N5.bind(null,Et,u);return u.dispatch=p,[i.memoizedState,p]},useDebugValue:ng,useDeferredValue:function(i,u){var p=os();return rg(p,i,u)},useTransition:function(){var i=Jm(!1);return i=w5.bind(null,Et,i.queue,!0,!1),os().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,u,p){var x=Et,A=os();if(Gt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),yn===null)throw Error(r(349));(Ft&127)!==0||Z4(x,u,p)}A.memoizedState=p;var M={value:p,getSnapshot:u};return A.queue=M,d5(J4.bind(null,x,M,i),[i]),x.flags|=2048,Dc(9,{destroy:void 0},Q4.bind(null,x,M,p,u),null),p},useId:function(){var i=os(),u=yn.identifierPrefix;if(Gt){var p=aa,x=ia;p=(x&~(1<<32-xt(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=Md++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof x.is=="string"?V.createElement("select",{is:x.is}):V.createElement("select"),x.multiple?M.multiple=!0:x.size&&(M.size=x.size);break;default:M=typeof x.is=="string"?V.createElement(A,{is:x.is}):V.createElement(A)}}M[on]=u,M[Nn]=x;e:for(V=u.child;V!==null;){if(V.tag===5||V.tag===6)M.appendChild(V.stateNode);else if(V.tag!==4&&V.tag!==27&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===u)break e;for(;V.sibling===null;){if(V.return===null||V.return===u)break e;V=V.return}V.sibling.return=V.return,V=V.sibling}u.stateNode=M;e:switch(Pr(M,A,x),A){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&$a(u)}}return Rn(u),xg(u,u.type,i===null?null:i.memoizedProps,u.pendingProps,p),null;case 6:if(i&&u.stateNode!=null)i.memoizedProps!==x&&$a(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(i=ce.current,Cc(u)){if(i=u.stateNode,p=u.memoizedProps,x=null,A=$r,A!==null)switch(A.tag){case 27:case 5:x=A.memoizedProps}i[on]=u,i=!!(i.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||X3(i.nodeValue,p)),i||ko(u,!0)}else i=s_(i).createTextNode(x),i[on]=u,u.stateNode=i}return Rn(u),null;case 31:if(p=u.memoizedState,i===null||i.memoizedState!==null){if(x=Cc(u),p!==null){if(i===null){if(!x)throw Error(r(318));if(i=u.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[on]=u}else Sl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Rn(u),i=!1}else p=jm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),i=!0;if(!i)return u.flags&256?(Hs(u),u):(Hs(u),null);if((u.flags&128)!==0)throw Error(r(558))}return Rn(u),null;case 13:if(x=u.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(A=Cc(u),x!==null&&x.dehydrated!==null){if(i===null){if(!A)throw Error(r(318));if(A=u.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[on]=u}else Sl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Rn(u),A=!1}else A=jm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=A),A=!0;if(!A)return u.flags&256?(Hs(u),u):(Hs(u),null)}return Hs(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,i=i!==null&&i.memoizedState!==null,p&&(x=u.child,A=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(A=x.alternate.memoizedState.cachePool.pool),M=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(M=x.memoizedState.cachePool.pool),M!==A&&(x.flags|=2048)),p!==i&&p&&(u.child.flags|=8192),Ud(u,u.updateQueue),Rn(u),null);case 4:return oe(),i===null&&Pg(u.stateNode.containerInfo),Rn(u),null;case 10:return La(u.type),Rn(u),null;case 19:if(K(rr),x=u.memoizedState,x===null)return Rn(u),null;if(A=(u.flags&128)!==0,M=x.rendering,M===null)if(A)pf(x,!1);else{if(Zn!==0||i!==null&&(i.flags&128)!==0)for(i=u.child;i!==null;){if(M=jd(i),M!==null){for(u.flags|=128,pf(x,!1),i=M.updateQueue,u.updateQueue=i,Ud(u,i),u.subtreeFlags=0,i=p,p=u.child;p!==null;)N4(p,i),p=p.sibling;return G(rr,rr.current&1|2),Gt&&Ra(u,x.treeForkCount),u.child}i=i.sibling}x.tail!==null&&Qe()>Kd&&(u.flags|=128,A=!0,pf(x,!1),u.lanes=4194304)}else{if(!A)if(i=jd(M),i!==null){if(u.flags|=128,A=!0,i=i.updateQueue,u.updateQueue=i,Ud(u,i),pf(x,!0),x.tail===null&&x.tailMode==="hidden"&&!M.alternate&&!Gt)return Rn(u),null}else 2*Qe()-x.renderingStartTime>Kd&&p!==536870912&&(u.flags|=128,A=!0,pf(x,!1),u.lanes=4194304);x.isBackwards?(M.sibling=u.child,u.child=M):(i=x.last,i!==null?i.sibling=M:u.child=M,x.last=M)}return x.tail!==null?(i=x.tail,x.rendering=i,x.tail=i.sibling,x.renderingStartTime=Qe(),i.sibling=null,p=rr.current,G(rr,A?p&1|2:p&1),Gt&&Ra(u,x.treeForkCount),i):(Rn(u),null);case 22:case 23:return Hs(u),Um(),x=u.memoizedState!==null,i!==null?i.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(p&536870912)!==0&&(u.flags&128)===0&&(Rn(u),u.subtreeFlags&6&&(u.flags|=8192)):Rn(u),p=u.updateQueue,p!==null&&Ud(u,p.retryQueue),p=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048),i!==null&&K(El),null;case 24:return p=null,i!==null&&(p=i.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),La(ur),Rn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function oR(i,u){switch(zm(u),u.tag){case 1:return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 3:return La(ur),oe(),i=u.flags,(i&65536)!==0&&(i&128)===0?(u.flags=i&-65537|128,u):null;case 26:case 27:case 5:return he(u),null;case 31:if(u.memoizedState!==null){if(Hs(u),u.alternate===null)throw Error(r(340));Sl()}return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 13:if(Hs(u),i=u.memoizedState,i!==null&&i.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Sl()}return i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 19:return K(rr),null;case 4:return oe(),null;case 10:return La(u.type),null;case 22:case 23:return Hs(u),Um(),i!==null&&K(El),i=u.flags,i&65536?(u.flags=i&-65537|128,u):null;case 24:return La(ur),null;case 25:return null;default:return null}}function e3(i,u){switch(zm(u),u.tag){case 3:La(ur),oe();break;case 26:case 27:case 5:he(u);break;case 4:oe();break;case 31:u.memoizedState!==null&&Hs(u);break;case 13:Hs(u);break;case 19:K(rr);break;case 10:La(u.type);break;case 22:case 23:Hs(u),Um(),i!==null&&K(El);break;case 24:La(ur)}}function mf(i,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var A=x.next;p=A;do{if((p.tag&i)===i){x=void 0;var M=p.create,V=p.inst;x=M(),V.destroy=x}p=p.next}while(p!==A)}}catch(te){un(u,u.return,te)}}function To(i,u,p){try{var x=u.updateQueue,A=x!==null?x.lastEffect:null;if(A!==null){var M=A.next;x=M;do{if((x.tag&i)===i){var V=x.inst,te=V.destroy;if(te!==void 0){V.destroy=void 0,A=u;var de=p,ke=te;try{ke()}catch(Me){un(A,de,Me)}}}x=x.next}while(x!==M)}}catch(Me){un(u,u.return,Me)}}function t3(i){var u=i.updateQueue;if(u!==null){var p=i.stateNode;try{G4(u,p)}catch(x){un(i,i.return,x)}}}function n3(i,u,p){p.props=Tl(i.type,i.memoizedProps),p.state=i.memoizedState;try{p.componentWillUnmount()}catch(x){un(i,u,x)}}function gf(i,u){try{var p=i.ref;if(p!==null){switch(i.tag){case 26:case 27:case 5:var x=i.stateNode;break;case 30:x=i.stateNode;break;default:x=i.stateNode}typeof p=="function"?i.refCleanup=p(x):p.current=x}}catch(A){un(i,u,A)}}function oa(i,u){var p=i.ref,x=i.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(A){un(i,u,A)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){un(i,u,A)}else p.current=null}function r3(i){var u=i.type,p=i.memoizedProps,x=i.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(A){un(i,i.return,A)}}function yg(i,u,p){try{var x=i.stateNode;AR(x,i.type,p,u),x[Nn]=u}catch(A){un(i,i.return,A)}}function s3(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Bo(i.type)||i.tag===4}function wg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||s3(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Bo(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Sg(i,u,p){var x=i.tag;if(x===5||x===6)i=i.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(i,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(i),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=is));else if(x!==4&&(x===27&&Bo(i.type)&&(p=i.stateNode,u=null),i=i.child,i!==null))for(Sg(i,u,p),i=i.sibling;i!==null;)Sg(i,u,p),i=i.sibling}function qd(i,u,p){var x=i.tag;if(x===5||x===6)i=i.stateNode,u?p.insertBefore(i,u):p.appendChild(i);else if(x!==4&&(x===27&&Bo(i.type)&&(p=i.stateNode),i=i.child,i!==null))for(qd(i,u,p),i=i.sibling;i!==null;)qd(i,u,p),i=i.sibling}function i3(i){var u=i.stateNode,p=i.memoizedProps;try{for(var x=i.type,A=u.attributes;A.length;)u.removeAttributeNode(A[0]);Pr(u,x,p),u[on]=i,u[Nn]=p}catch(M){un(i,i.return,M)}}var Ha=!1,dr=!1,kg=!1,a3=typeof WeakSet=="function"?WeakSet:Set,Tr=null;function lR(i,u){if(i=i.containerInfo,Gg=f_,i=b4(i),gm(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var A=x.anchorOffset,M=x.focusNode;x=x.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var V=0,te=-1,de=-1,ke=0,Me=0,Oe=i,Ce=null;t:for(;;){for(var ze;Oe!==p||A!==0&&Oe.nodeType!==3||(te=V+A),Oe!==M||x!==0&&Oe.nodeType!==3||(de=V+x),Oe.nodeType===3&&(V+=Oe.nodeValue.length),(ze=Oe.firstChild)!==null;)Ce=Oe,Oe=ze;for(;;){if(Oe===i)break t;if(Ce===p&&++ke===A&&(te=V),Ce===M&&++Me===x&&(de=V),(ze=Oe.nextSibling)!==null)break;Oe=Ce,Ce=Oe.parentNode}Oe=ze}p=te===-1||de===-1?null:{start:te,end:de}}else p=null}p=p||{start:0,end:0}}else p=null;for(Vg={focusedElem:i,selectionRange:p},f_=!1,Tr=u;Tr!==null;)if(u=Tr,i=u.child,(u.subtreeFlags&1028)!==0&&i!==null)i.return=u,Tr=i;else for(;Tr!==null;){switch(u=Tr,M=u.alternate,i=u.flags,u.tag){case 0:if((i&4)!==0&&(i=u.updateQueue,i=i!==null?i.events:null,i!==null))for(p=0;p title"))),Pr(M,x,p),M[on]=i,zn(M),x=M;break e;case"link":var V=hw("link","href",A).get(x+(p.href||""));if(V){for(var te=0;tebn&&(V=bn,bn=pt,pt=V);var xe=m4(te,pt),_e=m4(te,bn);if(xe&&_e&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==_e.node||ze.focusOffset!==_e.offset)){var Se=Oe.createRange();Se.setStart(xe.node,xe.offset),ze.removeAllRanges(),pt>bn?(ze.addRange(Se),ze.extend(_e.node,_e.offset)):(Se.setEnd(_e.node,_e.offset),ze.addRange(Se))}}}}for(Oe=[],ze=te;ze=ze.parentNode;)ze.nodeType===1&&Oe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;tep?32:p,X.T=null,p=Tg,Tg=null;var M=Lo,V=Ga;if(Cr=0,$c=Lo=null,Ga=0,(Jt&6)!==0)throw Error(r(331));var te=Jt;if(Jt|=4,g3(M.current),_3(M,M.current,V,p),Jt=te,Sf(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Ot,M)}catch{}return!0}finally{J.p=A,X.T=x,L3(i,u)}}function I3(i,u,p){u=di(p,u),u=ug(i.stateNode,u,2),i=zo(i,u,2),i!==null&&(Ze(i,2),la(i))}function un(i,u,p){if(i.tag===3)I3(i,i,p);else for(;u!==null;){if(u.tag===3){I3(u,i,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Do===null||!Do.has(x))){i=di(p,i),p=B5(2),x=zo(u,p,2),x!==null&&($5(p,x,u,i),Ze(x,2),la(x));break}}u=u.return}}function Lg(i,u,p){var x=i.pingCache;if(x===null){x=i.pingCache=new fR;var A=new Set;x.set(u,A)}else A=x.get(u),A===void 0&&(A=new Set,x.set(u,A));A.has(p)||(Ng=!0,A.add(p),i=mR.bind(null,i,u,p),u.then(i,i))}function mR(i,u,p){var x=i.pingCache;x!==null&&x.delete(u),i.pingedLanes|=i.suspendedLanes&p,i.warmLanes&=~p,yn===i&&(Ft&p)===p&&(Zn===4||Zn===3&&(Ft&62914560)===Ft&&300>Qe()-Wd?(Jt&2)===0&&Hc(i,0):zg|=p,Bc===Ft&&(Bc=0)),la(i)}function B3(i,u){u===0&&(u=zr()),i=yl(i,u),i!==null&&(Ze(i,u),la(i))}function gR(i){var u=i.memoizedState,p=0;u!==null&&(p=u.retryLane),B3(i,p)}function bR(i,u){var p=0;switch(i.tag){case 31:case 13:var x=i.stateNode,A=i.memoizedState;A!==null&&(p=A.retryLane);break;case 19:x=i.stateNode;break;case 22:x=i.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(u),B3(i,p)}function vR(i,u){return zt(i,u)}var e_=null,Pc=null,Og=!1,t_=!1,Ig=!1,Io=0;function la(i){i!==Pc&&i.next===null&&(Pc===null?e_=Pc=i:Pc=Pc.next=i),t_=!0,Og||(Og=!0,yR())}function Sf(i,u){if(!Ig&&t_){Ig=!0;do for(var p=!1,x=e_;x!==null;){if(i!==0){var A=x.pendingLanes;if(A===0)var M=0;else{var V=x.suspendedLanes,te=x.pingedLanes;M=(1<<31-xt(42|i)+1)-1,M&=A&~(V&~te),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,P3(x,M))}else M=Ft,M=Ut(x,x===yn?M:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(M&3)===0||Qt(x,M)||(p=!0,P3(x,M));x=x.next}while(p);Ig=!1}}function xR(){$3()}function $3(){t_=Og=!1;var i=0;Io!==0&&TR()&&(i=Io);for(var u=Qe(),p=null,x=e_;x!==null;){var A=x.next,M=H3(x,u);M===0?(x.next=null,p===null?e_=A:p.next=A,A===null&&(Pc=p)):(p=x,(i!==0||(M&3)!==0)&&(t_=!0)),x=A}Cr!==0&&Cr!==5||Sf(i),Io!==0&&(Io=0)}function H3(i,u){for(var p=i.suspendedLanes,x=i.pingedLanes,A=i.expirationTimes,M=i.pendingLanes&-62914561;0te)break;var Me=de.transferSize,Oe=de.initiatorType;Me&&Y3(Oe)&&(de=de.responseEnd,V+=Me*(de"u"?null:document;function lw(i,u,p){var x=Uc;if(x&&typeof u=="string"&&u){var A=or(u);A='link[rel="'+i+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),ow.has(A)||(ow.add(A),i={rel:i,crossOrigin:p,href:u},x.querySelector(A)===null&&(u=x.createElement("link"),Pr(u,"link",i),zn(u),x.head.appendChild(u)))}}function HR(i){Va.D(i),lw("dns-prefetch",i,null)}function FR(i,u){Va.C(i,u),lw("preconnect",i,u)}function PR(i,u,p){Va.L(i,u,p);var x=Uc;if(x&&i&&u){var A='link[rel="preload"][as="'+or(u)+'"]';u==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+or(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+or(p.imageSizes)+'"]')):A+='[href="'+or(i)+'"]';var M=A;switch(u){case"style":M=qc(i);break;case"script":M=Gc(i)}vi.has(M)||(i=d({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:i,as:u},p),vi.set(M,i),x.querySelector(A)!==null||u==="style"&&x.querySelector(Nf(M))||u==="script"&&x.querySelector(zf(M))||(u=x.createElement("link"),Pr(u,"link",i),zn(u),x.head.appendChild(u)))}}function UR(i,u){Va.m(i,u);var p=Uc;if(p&&i){var x=u&&typeof u.as=="string"?u.as:"script",A='link[rel="modulepreload"][as="'+or(x)+'"][href="'+or(i)+'"]',M=A;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Gc(i)}if(!vi.has(M)&&(i=d({rel:"modulepreload",href:i},u),vi.set(M,i),p.querySelector(A)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(zf(M)))return}x=p.createElement("link"),Pr(x,"link",i),zn(x),p.head.appendChild(x)}}}function qR(i,u,p){Va.S(i,u,p);var x=Uc;if(x&&i){var A=Or(x).hoistableStyles,M=qc(i);u=u||"default";var V=A.get(M);if(!V){var te={loading:0,preload:null};if(V=x.querySelector(Nf(M)))te.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":u},p),(p=vi.get(M))&&Jg(i,p);var de=V=x.createElement("link");zn(de),Pr(de,"link",i),de._p=new Promise(function(ke,Me){de.onload=ke,de.onerror=Me}),de.addEventListener("load",function(){te.loading|=1}),de.addEventListener("error",function(){te.loading|=2}),te.loading|=4,a_(V,u,x)}V={type:"stylesheet",instance:V,count:1,state:te},A.set(M,V)}}}function GR(i,u){Va.X(i,u);var p=Uc;if(p&&i){var x=Or(p).hoistableScripts,A=Gc(i),M=x.get(A);M||(M=p.querySelector(zf(A)),M||(i=d({src:i,async:!0},u),(u=vi.get(A))&&e1(i,u),M=p.createElement("script"),zn(M),Pr(M,"link",i),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},x.set(A,M))}}function VR(i,u){Va.M(i,u);var p=Uc;if(p&&i){var x=Or(p).hoistableScripts,A=Gc(i),M=x.get(A);M||(M=p.querySelector(zf(A)),M||(i=d({src:i,async:!0,type:"module"},u),(u=vi.get(A))&&e1(i,u),M=p.createElement("script"),zn(M),Pr(M,"link",i),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},x.set(A,M))}}function cw(i,u,p,x){var A=(A=ce.current)?i_(A):null;if(!A)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=qc(p.href),p=Or(A).hoistableStyles,x=p.get(u),x||(x={type:"style",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){i=qc(p.href);var M=Or(A).hoistableStyles,V=M.get(i);if(V||(A=A.ownerDocument||A,V={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(i,V),(M=A.querySelector(Nf(i)))&&!M._p&&(V.instance=M,V.state.loading=5),vi.has(i)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},vi.set(i,p),M||WR(A,i,p,V.state))),u&&x===null)throw Error(r(528,""));return V}if(u&&x!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Gc(p),p=Or(A).hoistableScripts,x=p.get(u),x||(x={type:"script",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function qc(i){return'href="'+or(i)+'"'}function Nf(i){return'link[rel="stylesheet"]['+i+"]"}function uw(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function WR(i,u,p,x){i.querySelector('link[rel="preload"][as="style"]['+u+"]")?x.loading=1:(u=i.createElement("link"),x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2}),Pr(u,"link",p),zn(u),i.head.appendChild(u))}function Gc(i){return'[src="'+or(i)+'"]'}function zf(i){return"script[async]"+i}function fw(i,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=i.querySelector('style[data-href~="'+or(p.href)+'"]');if(x)return u.instance=x,zn(x),x;var A=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(i.ownerDocument||i).createElement("style"),zn(x),Pr(x,"style",A),a_(x,p.precedence,i),u.instance=x;case"stylesheet":A=qc(p.href);var M=i.querySelector(Nf(A));if(M)return u.state.loading|=4,u.instance=M,zn(M),M;x=uw(p),(A=vi.get(A))&&Jg(x,A),M=(i.ownerDocument||i).createElement("link"),zn(M);var V=M;return V._p=new Promise(function(te,de){V.onload=te,V.onerror=de}),Pr(M,"link",x),u.state.loading|=4,a_(M,p.precedence,i),u.instance=M;case"script":return M=Gc(p.src),(A=i.querySelector(zf(M)))?(u.instance=A,zn(A),A):(x=p,(A=vi.get(M))&&(x=d({},p),e1(x,A)),i=i.ownerDocument||i,A=i.createElement("script"),zn(A),Pr(A,"link",x),i.head.appendChild(A),u.instance=A);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,a_(x,p.precedence,i));return u.instance}function a_(i,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=x.length?x[x.length-1]:null,M=A,V=0;V title"):null)}function KR(i,u,p){if(p===1||u.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return i=u.disabled,typeof u.precedence=="string"&&i==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function _w(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function XR(i,u,p,x){if(p.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=qc(x.href),M=u.querySelector(Nf(A));if(M){u=M._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(i.count++,i=l_.bind(i),u.then(i,i)),p.state.loading|=4,p.instance=M,zn(M);return}M=u.ownerDocument||u,x=uw(x),(A=vi.get(A))&&Jg(x,A),M=M.createElement("link"),zn(M);var V=M;V._p=new Promise(function(te,de){V.onload=te,V.onerror=de}),Pr(M,"link",x),p.instance=M}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(i.count++,p=l_.bind(i),u.addEventListener("load",p),u.addEventListener("error",p))}}var t1=0;function YR(i,u){return i.stylesheets&&i.count===0&&u_(i,i.stylesheets),0t1?50:800)+u);return i.unsuspend=p,function(){i.unsuspend=null,clearTimeout(x),clearTimeout(A)}}:null}function l_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u_(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var c_=null;function u_(i,u){i.stylesheets=null,i.unsuspend!==null&&(i.count++,c_=new Map,u.forEach(ZR,i),c_=null,l_.call(i))}function ZR(i,u){if(!(u.state.loading&4)){var p=c_.get(i);if(p)var x=p.get(null);else{p=new Map,c_.set(i,p);for(var A=i.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),u1.exports=dD(),u1.exports}var pD=_D();const mD={},gD="en",A2=["en","zh-CN","fa"],n9="orx:locale",j2=["localStorage","preferredLanguage","baseLocale"],Fw=[],lh=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Pw=!1,E=()=>{var t;let e=j2;!lh&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=s9(window.location.href));const n=bD(e);if(n)return Pw||(Pw=!0,r9(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function bD(e,n){let t;for(const r of e){if(r==="baseLocale")t=gD;else if(r==="preferredLanguage"&&!lh)t=kD();else if(r==="localStorage"&&!lh)t=localStorage.getItem(n9)??void 0;else if(i9(r)&&g0.has(r)){const a=g0.get(r);if(a){const o=a.getLocale();if(o instanceof Promise)continue;if(o!==void 0)return wD(o)}}const s=ch(t);if(s)return s}}const vD=e=>{window.location.reload()};let r9=(e,n)=>{var l;const t={reload:!0,...n};let r;try{r=E()}catch{}const s=[];let a=j2;!lh&&typeof window<"u"&&((l=window.location)!=null&&l.href)&&(a=s9(window.location.href));for(const c of a)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(n9,e);else if(i9(c)&&g0.has(c)){const f=g0.get(c);if(f){let _=f.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:d})}),s.push(_))}}}const o=()=>{!lh&&t.reload&&window.location&&e!==r&&vD()};if(s.length)return Promise.all(s).then(()=>{o()});o()},xD=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ch(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of A2)if(t.toLowerCase()===n)return t}function yD(e){return!!e&&A2.some(n=>n===e)}function wD(e){const n=ch(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${A2.join(", ")}`)}function SD(e,n){return e.exec(n.href)}function kD(){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=ch(t.fullTag);if(r)return r;const s=ch(t.baseTag);if(s)return s}}function CD(e){return ED(e)}function ED(e){const n=typeof e=="string"?new URL(e,xD()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ch(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let Uw,qw;function ND(e){if(Fw.length===0)return;const n=typeof e=="string"?e:e.href;if(Uw===n)return qw;const t=new URL(n,"http://example.com"),r=CD(t),s=r.href===t.href?[t]:[t,r];let a;for(const o of s){for(const l of Fw){const c=new mD(l.match,o.href);if(SD(c,o)){a=l;break}}if(a)break}return Uw=n,qw=a,a}function s9(e){const n=ND(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:j2}const g0=new Map;function i9(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const zD=e=>`Actions for ${e==null?void 0:e.name}`,AD=e=>`${e==null?void 0:e.name} 的操作`,jD=e=>`عملیات ${e==null?void 0:e.name}`,TD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AD(e):t==="fa"?jD(e):zD(e)}),MD=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,RD=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,DD=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,LD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RD(e):t==="fa"?DD(e):MD(e)}),OD=e=>`Branch: ${e==null?void 0:e.branch}`,ID=e=>`分支:${e==null?void 0:e.branch}`,BD=e=>`شاخه: ${e==null?void 0:e.branch}`,$D=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ID(e):t==="fa"?BD(e):OD(e)}),HD=e=>`Browse code on ${e==null?void 0:e.branch}`,FD=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,PD=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,a9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FD(e):t==="fa"?PD(e):HD(e)}),UD=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,qD=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,GD=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,VD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qD(e):t==="fa"?GD(e):UD(e)}),WD=e=>`Collapse ${e==null?void 0:e.name}`,KD=e=>`折叠 ${e==null?void 0:e.name}`,XD=e=>`بستن ${e==null?void 0:e.name}`,YD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KD(e):t==="fa"?XD(e):WD(e)}),ZD=e=>`Committed changes versus ${e==null?void 0:e.parent}`,QD=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,JD=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,eL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QD(e):t==="fa"?JD(e):ZD(e)}),tL=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,nL=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,rL=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,sL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nL(e):t==="fa"?rL(e):tL(e)}),iL=e=>`Copy ${e==null?void 0:e.value}`,aL=e=>`复制 ${e==null?void 0:e.value}`,oL=e=>`کپی ${e==null?void 0:e.value}`,lL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aL(e):t==="fa"?oL(e):iL(e)}),cL=e=>`Delete ${e==null?void 0:e.name}`,uL=e=>`删除 ${e==null?void 0:e.name}`,fL=e=>`حذف ${e==null?void 0:e.name}`,Wb=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?uL(e):t==="fa"?fL(e):cL(e)}),hL=e=>`Download ${e==null?void 0:e.name}`,dL=e=>`下载 ${e==null?void 0:e.name}`,_L=e=>`بارگیری ${e==null?void 0:e.name}`,Gw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dL(e):t==="fa"?_L(e):hL(e)}),pL=e=>`Expand ${e==null?void 0:e.name}`,mL=e=>`展开 ${e==null?void 0:e.name}`,gL=e=>`باز کردن ${e==null?void 0:e.name}`,bL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mL(e):t==="fa"?gL(e):pL(e)}),vL=e=>`Hide additional ${e==null?void 0:e.target}`,xL=e=>`隐藏其余${e==null?void 0:e.target}`,yL=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,wL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xL(e):t==="fa"?yL(e):vL(e)}),SL=e=>`Hide error details for ${e==null?void 0:e.activity}`,kL=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,CL=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,EL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kL(e):t==="fa"?CL(e):SL(e)}),NL=e=>`${e==null?void 0:e.count} consecutive identical calls`,zL=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,AL=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,jL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zL(e):t==="fa"?AL(e):NL(e)}),TL=e=>`Import into ${e==null?void 0:e.name}`,ML=e=>`导入到 ${e==null?void 0:e.name}`,RL=e=>`درون‌ریزی به ${e==null?void 0:e.name}`,DL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ML(e):t==="fa"?RL(e):TL(e)}),LL=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,OL=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,IL=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,BL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OL(e):t==="fa"?IL(e):LL(e)}),$L=e=>`${e==null?void 0:e.name} skills`,HL=e=>`${e==null?void 0:e.name} 的技能`,FL=e=>`مهارت‌های ${e==null?void 0:e.name}`,PL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HL(e):t==="fa"?FL(e):$L(e)}),UL=e=>`Open ${e==null?void 0:e.branch} on GitHub`,qL=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,GL=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,o9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qL(e):t==="fa"?GL(e):UL(e)}),VL=e=>`Open experiment ${e==null?void 0:e.name}`,WL=e=>`打开实验 ${e==null?void 0:e.name}`,KL=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,XL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WL(e):t==="fa"?KL(e):VL(e)}),YL=e=>`Open ${e==null?void 0:e.path} in the right pane`,ZL=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,QL=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,JL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZL(e):t==="fa"?QL(e):YL(e)}),eO=e=>`Open ${e==null?void 0:e.name}`,tO=e=>`打开 ${e==null?void 0:e.name}`,nO=e=>`باز کردن ${e==null?void 0:e.name}`,rO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tO(e):t==="fa"?nO(e):eO(e)}),sO=e=>`Open logs for run ${e==null?void 0:e.run}`,iO=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,aO=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,oO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iO(e):t==="fa"?aO(e):sO(e)}),lO=e=>`Open ${e==null?void 0:e.name} on GitHub`,cO=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,uO=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,b0=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?cO(e):t==="fa"?uO(e):lO(e)}),fO=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,hO=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,dO=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,_O=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hO(e):t==="fa"?dO(e):fO(e)}),pO=e=>`Overleaf — ${e==null?void 0:e.status}`,mO=e=>`Overleaf — ${e==null?void 0:e.status}`,gO=e=>`Overleaf — ${e==null?void 0:e.status}`,bO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mO(e):t==="fa"?gO(e):pO(e)}),vO=e=>`Preview /${e==null?void 0:e.name} skill`,xO=e=>`预览 /${e==null?void 0:e.name} 技能`,yO=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,wO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xO(e):t==="fa"?yO(e):vO(e)}),SO=e=>`Remove annotation ${e==null?void 0:e.number}`,kO=e=>`移除批注 ${e==null?void 0:e.number}`,CO=e=>`حذف یادداشت ${e==null?void 0:e.number}`,EO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kO(e):t==="fa"?CO(e):SO(e)}),NO=e=>`Remove ${e==null?void 0:e.name}`,zO=e=>`移除 ${e==null?void 0:e.name}`,AO=e=>`حذف ${e==null?void 0:e.name}`,jO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zO(e):t==="fa"?AO(e):NO(e)}),TO=e=>`Remove queued message: ${e==null?void 0:e.text}`,MO=e=>`移除排队消息:${e==null?void 0:e.text}`,RO=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,DO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MO(e):t==="fa"?RO(e):TO(e)}),LO=e=>`Retry queued message: ${e==null?void 0:e.text}`,OO=e=>`重试排队消息:${e==null?void 0:e.text}`,IO=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,BO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OO(e):t==="fa"?IO(e):LO(e)}),$O=e=>`Run ${e==null?void 0:e.id}`,HO=e=>`运行 ${e==null?void 0:e.id}`,FO=e=>`اجرای ${e==null?void 0:e.id}`,PO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HO(e):t==="fa"?FO(e):$O(e)}),UO=e=>`Show error details for ${e==null?void 0:e.activity}`,qO=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,GO=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,VO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qO(e):t==="fa"?GO(e):UO(e)}),WO=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,KO=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,XO=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,YO=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KO(e):t==="fa"?XO(e):WO(e)}),ZO=e=>`${e==null?void 0:e.name} skill`,QO=e=>`${e==null?void 0:e.name} 技能`,JO=e=>`مهارت ${e==null?void 0:e.name}`,eI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QO(e):t==="fa"?JO(e):ZO(e)}),tI=e=>`Value for ${e==null?void 0:e.name}`,nI=e=>`${e==null?void 0:e.name} 的值`,rI=e=>`مقدار ${e==null?void 0:e.name}`,sI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nI(e):t==="fa"?rI(e):tI(e)}),iI=()=>"Agent reported back",aI=()=>"智能体已返回结果",oI=()=>"عامل نتیجه را گزارش کرد",lI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aI():t==="fa"?oI():iI()}),cI=()=>"Browse",uI=()=>"浏览",fI=()=>"مرور",hI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uI():t==="fa"?fI():cI()}),dI=()=>"Browsing…",_I=()=>"正在浏览…",pI=()=>"در حال مرور…",mI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_I():t==="fa"?pI():dI()}),gI=()=>"Checked experiment status and updated notes",bI=()=>"已检查实验状态并更新笔记",vI=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",xI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bI():t==="fa"?vI():gI()}),yI=()=>"Closed an agent",wI=()=>"已关闭智能体",SI=()=>"عامل بسته شد",kI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wI():t==="fa"?SI():yI()}),CI=e=>`Created ${e==null?void 0:e.target}`,EI=e=>`已创建 ${e==null?void 0:e.target}`,NI=e=>`${e==null?void 0:e.target} ایجاد شد`,zI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EI(e):t==="fa"?NI(e):CI(e)}),AI=()=>"Delegate",jI=()=>"委派",TI=()=>"واگذاری",MI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jI():t==="fa"?TI():AI()}),RI=()=>"Delegating…",DI=()=>"正在委派…",LI=()=>"در حال واگذاری…",OI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DI():t==="fa"?LI():RI()}),II=e=>`Deleted ${e==null?void 0:e.target}`,BI=e=>`已删除 ${e==null?void 0:e.target}`,$I=e=>`${e==null?void 0:e.target} حذف شد`,HI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?BI(e):t==="fa"?$I(e):II(e)}),FI=()=>"Edit",PI=()=>"编辑",UI=()=>"ویرایش",qI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PI():t==="fa"?UI():FI()}),GI=e=>`Edited ${e==null?void 0:e.target}`,VI=e=>`已编辑 ${e==null?void 0:e.target}`,WI=e=>`${e==null?void 0:e.target} ویرایش شد`,KI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?VI(e):t==="fa"?WI(e):GI(e)}),XI=()=>"Editing…",YI=()=>"正在编辑…",ZI=()=>"در حال ویرایش…",QI=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YI():t==="fa"?ZI():XI()}),JI=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,eB=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,tB=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,nB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?eB(e):t==="fa"?tB(e):JI(e)}),rB=e=>`Listed files matching ${e==null?void 0:e.pattern}`,sB=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,iB=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,aB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sB(e):t==="fa"?iB(e):rB(e)}),oB=()=>"Load",lB=()=>"加载",cB=()=>"بارگیری",uB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lB():t==="fa"?cB():oB()}),fB=()=>"Loaded a skill",hB=()=>"已加载技能",dB=()=>"یک مهارت بارگیری شد",_B=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hB():t==="fa"?dB():fB()}),pB=e=>`Loaded ${e==null?void 0:e.name} skill`,mB=e=>`已加载技能 ${e==null?void 0:e.name}`,gB=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,bB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mB(e):t==="fa"?gB(e):pB(e)}),vB=()=>"Loading…",xB=()=>"正在加载…",yB=()=>"در حال بارگیری…",wB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xB():t==="fa"?yB():vB()}),SB=e=>`Opened ${e==null?void 0:e.target}`,kB=e=>`已打开 ${e==null?void 0:e.target}`,CB=e=>`${e==null?void 0:e.target} باز شد`,EB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kB(e):t==="fa"?CB(e):SB(e)}),NB=e=>`Ran ${e==null?void 0:e.command}`,zB=e=>`已运行 ${e==null?void 0:e.command}`,AB=e=>`${e==null?void 0:e.command} اجرا شد`,jB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zB(e):t==="fa"?AB(e):NB(e)}),TB=()=>"Ran a sub-agent",MB=()=>"已运行子智能体",RB=()=>"یک عامل فرعی اجرا شد",DB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MB():t==="fa"?RB():TB()}),LB=()=>"Read",OB=()=>"读取",IB=()=>"خواندن",BB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OB():t==="fa"?IB():LB()}),$B=()=>"Read experiment notes",HB=()=>"已读取实验笔记",FB=()=>"یادداشت‌های آزمایش خوانده شد",PB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HB():t==="fa"?FB():$B()}),UB=()=>"Read a paper",qB=()=>"已读取论文",GB=()=>"یک مقاله خوانده شد",VB=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qB():t==="fa"?GB():UB()}),WB=e=>`Read ${e==null?void 0:e.name} skill`,KB=e=>`已读取技能 ${e==null?void 0:e.name}`,XB=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,_1=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KB(e):t==="fa"?XB(e):WB(e)}),YB=e=>`Read ${e==null?void 0:e.target}`,ZB=e=>`已读取 ${e==null?void 0:e.target}`,QB=e=>`${e==null?void 0:e.target} خوانده شد`,Lf=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZB(e):t==="fa"?QB(e):YB(e)}),JB=()=>"Read a web page",e$=()=>"已读取网页",t$=()=>"یک صفحهٔ وب خوانده شد",n$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e$():t==="fa"?t$():JB()}),r$=()=>"Reading…",s$=()=>"正在读取…",i$=()=>"در حال خواندن…",a$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s$():t==="fa"?i$():r$()}),o$=()=>"Resumed an agent",l$=()=>"已恢复智能体",c$=()=>"عامل از سر گرفته شد",u$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l$():t==="fa"?c$():o$()}),f$=()=>"Review",h$=()=>"查看",d$=()=>"بازبینی",_$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h$():t==="fa"?d$():f$()}),p$=()=>"Reviewed run log",m$=()=>"已查看运行日志",g$=()=>"گزارش اجرا بازبینی شد",b$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m$():t==="fa"?g$():p$()}),v$=()=>"Reviewed run logs",x$=()=>"已查看运行日志",y$=()=>"گزارش‌های اجرا بازبینی شد",w$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x$():t==="fa"?y$():v$()}),S$=()=>"Reviewed experiment status and notes",k$=()=>"已查看实验状态和笔记",C$=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",E$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k$():t==="fa"?C$():S$()}),N$=()=>"Reviewing…",z$=()=>"正在查看…",A$=()=>"در حال بازبینی…",j$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z$():t==="fa"?A$():N$()}),T$=()=>"Run",M$=()=>"运行",R$=()=>"اجرا",D$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M$():t==="fa"?R$():T$()}),L$=()=>"Running…",O$=()=>"正在运行…",I$=()=>"در حال اجرا…",B$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O$():t==="fa"?I$():L$()}),$$=()=>"Search",H$=()=>"搜索",F$=()=>"جست‌وجو",P$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H$():t==="fa"?F$():$$()}),U$=()=>"Searched alphaXiv full text",q$=()=>"已搜索 alphaXiv 全文",G$=()=>"متن کامل alphaXiv جست‌وجو شد",V$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q$():t==="fa"?G$():U$()}),W$=()=>"Searched alphaXiv semantically",K$=()=>"已对 alphaXiv 进行语义搜索",X$=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",Y$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K$():t==="fa"?X$():W$()}),Z$=()=>"Searched bioRxiv",Q$=()=>"已搜索 bioRxiv",J$=()=>"bioRxiv جست‌وجو شد",eH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q$():t==="fa"?J$():Z$()}),tH=()=>"Searched code",nH=()=>"已搜索代码",rH=()=>"کد جست‌وجو شد",p1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nH():t==="fa"?rH():tH()}),sH=e=>`Searched code for “${e==null?void 0:e.pattern}”`,iH=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,aH=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,m1=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iH(e):t==="fa"?aH(e):sH(e)}),oH=e=>`Searched images for “${e==null?void 0:e.query}”`,lH=e=>`已搜索图片“${e==null?void 0:e.query}”`,cH=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,uH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lH(e):t==="fa"?cH(e):oH(e)}),fH=()=>"Searched the literature",hH=()=>"已搜索文献",dH=()=>"منابع علمی جست‌وجو شد",Vw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hH():t==="fa"?dH():fH()}),_H=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,pH=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,mH=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,gH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pH(e):t==="fa"?mH(e):_H(e)}),bH=()=>"Searched OpenAlex",vH=()=>"已搜索 OpenAlex",xH=()=>"OpenAlex جست‌وجو شد",yH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vH():t==="fa"?xH():bH()}),wH=e=>`Searched the web for “${e==null?void 0:e.query}”`,SH=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,kH=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,Ww=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SH(e):t==="fa"?kH(e):wH(e)}),CH=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,EH=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,NH=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,zH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EH(e):t==="fa"?NH(e):CH(e)}),AH=()=>"Searching…",jH=()=>"正在搜索…",TH=()=>"در حال جست‌وجو…",MH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jH():t==="fa"?TH():AH()}),RH=()=>"Sent input to an agent",DH=()=>"已向智能体发送输入",LH=()=>"ورودی به عامل فرستاده شد",OH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DH():t==="fa"?LH():RH()}),IH=()=>"Spawned an agent",BH=()=>"已创建智能体",$H=()=>"یک عامل ساخته شد",HH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BH():t==="fa"?$H():IH()}),FH=()=>"Sub-agent",PH=()=>"子智能体",UH=()=>"عامل فرعی",qH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PH():t==="fa"?UH():FH()}),GH=()=>"Sub-agent interrupted",VH=()=>"子智能体已中断",WH=()=>"عامل فرعی متوقف شد",KH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VH():t==="fa"?WH():GH()}),XH=()=>"Sub-agent started",YH=()=>"子智能体已启动",ZH=()=>"عامل فرعی آغاز شد",QH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YH():t==="fa"?ZH():XH()}),JH=()=>"Updated experiment notes",eF=()=>"已更新实验笔记",tF=()=>"یادداشت‌های آزمایش به‌روز شد",nF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eF():t==="fa"?tF():JH()}),rF=()=>"Waiting on an agent",sF=()=>"正在等待智能体",iF=()=>"در انتظار عامل",aF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sF():t==="fa"?iF():rF()}),oF=e=>`Approval required: ${e==null?void 0:e.label}`,lF=e=>`需要批准:${e==null?void 0:e.label}`,cF=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,Kw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lF(e):t==="fa"?cF(e):oF(e)}),uF=()=>"The CLI is retrying the turn.",fF=()=>"CLI 正在重试本轮。",hF=()=>"CLI در حال تلاش دوباره برای این نوبت است.",dF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fF():t==="fa"?hF():uF()}),_F=()=>"Continue is available.",pF=()=>"可以继续。",mF=()=>"ادامه در دسترس است.",gF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pF():t==="fa"?mF():_F()}),bF=()=>"Retry is available.",vF=()=>"可以重试。",xF=()=>"تلاش دوباره در دسترس است.",yF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vF():t==="fa"?xF():bF()}),wF=()=>"Running a tool",SF=()=>"正在运行工具",kF=()=>"در حال اجرای ابزار",CF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SF():t==="fa"?kF():wF()}),EF=()=>"Tool activity completed",NF=()=>"工具活动已完成",zF=()=>"فعالیت ابزار کامل شد",AF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NF():t==="fa"?zF():EF()}),jF=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,TF=e=>`工具活动失败:${e==null?void 0:e.labels}`,MF=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,RF=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TF(e):t==="fa"?MF(e):jF(e)}),DF=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,LF=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,OF=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,IF=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LF(e):t==="fa"?OF(e):DF(e)}),BF=()=>"Turn did not finish.",$F=()=>"本轮未完成。",HF=()=>"این نوبت کامل نشد.",FF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$F():t==="fa"?HF():BF()}),PF=()=>"Artifacts",UF=()=>"产物",qF=()=>"خروجی‌ها",GF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UF():t==="fa"?qF():PF()}),VF=()=>"Close panel",WF=()=>"关闭面板",KF=()=>"بستن پنل",Xw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WF():t==="fa"?KF():VF()}),XF=()=>"Current task",YF=()=>"当前任务",ZF=()=>"وظیفهٔ فعلی",Yw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YF():t==="fa"?ZF():XF()}),QF=()=>"Drag to resize panel",JF=()=>"拖动以调整面板大小",eP=()=>"برای تغییر اندازهٔ پنل بکشید",tP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JF():t==="fa"?eP():QF()}),nP=()=>"Drag toward the center to restore panel",rP=()=>"向中央拖动以恢复面板",sP=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",iP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rP():t==="fa"?sP():nP()}),aP=()=>"Entire project",oP=()=>"整个项目",lP=()=>"کل پروژه",Zw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oP():t==="fa"?lP():aP()}),cP=()=>"Expand panel",uP=()=>"展开面板",fP=()=>"گسترش پنل",Qw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uP():t==="fa"?fP():cP()}),hP=e=>`Experiment filter: ${e==null?void 0:e.scope}`,dP=e=>`实验筛选:${e==null?void 0:e.scope}`,_P=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,pP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dP(e):t==="fa"?_P(e):hP(e)}),mP=()=>"Experiment view",gP=()=>"实验视图",bP=()=>"نمای آزمایش",vP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gP():t==="fa"?bP():mP()}),xP=()=>"Experiments",yP=()=>"实验",wP=()=>"آزمایش‌ها",SP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yP():t==="fa"?wP():xP()}),kP=()=>"Files",CP=()=>"文件",EP=()=>"فایل‌ها",NP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CP():t==="fa"?EP():kP()}),zP=()=>"Filter experiments",AP=()=>"筛选实验",jP=()=>"فیلتر آزمایش‌ها",TP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AP():t==="fa"?jP():zP()}),MP=()=>"Current task filtering is unavailable for unattributed experiments",RP=()=>"存在无法归属的实验时,不能按当前任务筛选",DP=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",LP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RP():t==="fa"?DP():MP()}),OP=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",IP=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",BP=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",$P=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IP():t==="fa"?BP():OP()}),HP=()=>"Open a task to filter to its experiments",FP=()=>"请打开一个任务以筛选其实验",PP=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",UP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FP():t==="fa"?PP():HP()}),qP=()=>"projects",GP=()=>"项目",VP=()=>"پروژه‌ها",WP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GP():t==="fa"?VP():qP()}),KP=()=>"Restore panel",XP=()=>"还原面板",YP=()=>"بازگرداندن اندازهٔ پنل",Jw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XP():t==="fa"?YP():KP()}),ZP=()=>"Retry",QP=()=>"重试",JP=()=>"تلاش دوباره",T2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QP():t==="fa"?JP():ZP()}),eU=()=>"Select a project to browse its files.",tU=()=>"选择一个项目以浏览其文件。",nU=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",rU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tU():t==="fa"?nU():eU()}),sU=()=>"settings",iU=()=>"设置",aU=()=>"تنظیمات",oU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iU():t==="fa"?aU():sU()}),lU=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,cU=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,uU=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,fU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?cU(e):t==="fa"?uU(e):lU(e)}),hU=()=>"Sub-agent",dU=()=>"子智能体",_U=()=>"عامل فرعی",pU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dU():t==="fa"?_U():hU()}),mU=()=>"Table",gU=()=>"表格",bU=()=>"جدول",vU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gU():t==="fa"?bU():mU()}),xU=()=>"Tree",yU=()=>"树状图",wU=()=>"درخت",SU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yU():t==="fa"?wU():xU()}),kU=e=>`Collapse ${e==null?void 0:e.name}`,CU=e=>`折叠 ${e==null?void 0:e.name}`,EU=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,NU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CU(e):t==="fa"?EU(e):kU(e)}),zU=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,AU=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,jU=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,l9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AU(e):t==="fa"?jU(e):zU(e)}),TU=e=>`Delete folder ${e==null?void 0:e.name}`,MU=e=>`删除文件夹 ${e==null?void 0:e.name}`,RU=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,DU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MU(e):t==="fa"?RU(e):TU(e)}),LU=e=>`Expand ${e==null?void 0:e.name}`,OU=e=>`展开 ${e==null?void 0:e.name}`,IU=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,BU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OU(e):t==="fa"?IU(e):LU(e)}),$U=()=>"Binary or unsupported file — no inline preview.",HU=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",FU=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",PU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HU():t==="fa"?FU():$U()}),UU=()=>"Copy path",qU=()=>"复制路径",GU=()=>"کپی مسیر",VU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qU():t==="fa"?GU():UU()}),WU=()=>"Artifact not found",KU=()=>"找不到产物",XU=()=>"خروجی پیدا نشد",YU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KU():t==="fa"?XU():WU()}),ZU=()=>"Open raw",QU=()=>"打开原始文件",JU=()=>"باز کردن فایل خام",eq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QU():t==="fa"?JU():ZU()}),tq=()=>"Click an artifact to view it",nq=()=>"点击产物即可查看",rq=()=>"برای مشاهده، یک خروجی را انتخاب کنید",sq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nq():t==="fa"?rq():tq()}),iq=()=>"Copy artifacts directory path",aq=()=>"复制产物目录路径",oq=()=>"کپی مسیر پوشهٔ خروجی‌ها",lq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aq():t==="fa"?oq():iq()}),cq=()=>"Delete artifact",uq=()=>"删除产物",fq=()=>"حذف خروجی",e6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uq():t==="fa"?fq():cq()}),hq=()=>"Delete folder",dq=()=>"删除文件夹",_q=()=>"حذف پوشه",pq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dq():t==="fa"?_q():hq()}),mq=()=>"Failed to load:",gq=()=>"加载失败:",bq=()=>"بارگیری ناموفق بود:",vq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gq():t==="fa"?bq():mq()}),xq=()=>"File truncated — showing the first 512 KB.",yq=()=>"文件已截断——仅显示前 512 KB。",wq=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Sq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yq():t==="fa"?wq():xq()}),kq=()=>"Listing truncated — the folder has more artifacts.",Cq=()=>"列表已截断——文件夹中还有更多产物。",Eq=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",Nq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cq():t==="fa"?Eq():kq()}),zq=()=>"Loading…",Aq=()=>"正在加载…",jq=()=>"در حال بارگیری…",Tq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aq():t==="fa"?jq():zq()}),Mq=()=>"Loading artifacts…",Rq=()=>"正在加载产物…",Dq=()=>"در حال بارگیری خروجی‌ها…",Lq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rq():t==="fa"?Dq():Mq()}),Oq=()=>"Modified",Iq=()=>"修改时间",Bq=()=>"ویرایش‌شده",$q=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iq():t==="fa"?Bq():Oq()}),Hq=()=>"No artifacts yet",Fq=()=>"尚无产物",Pq=()=>"هنوز خروجی‌ای وجود ندارد",Uq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fq():t==="fa"?Pq():Hq()}),qq=()=>"Open raw in new tab",Gq=()=>"在新标签页中打开原始文件",Vq=()=>"باز کردن فایل خام در زبانهٔ جدید",t6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gq():t==="fa"?Vq():qq()}),Wq=()=>"Storage settings",Kq=()=>"存储设置",Xq=()=>"تنظیمات ذخیره‌سازی",n6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kq():t==="fa"?Xq():Wq()}),Yq=()=>"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:",Zq=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件:",Qq=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید:",Jq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zq():t==="fa"?Qq():Yq()}),eG=()=>"File too large to preview inline.",tG=()=>"文件太大,无法内嵌预览。",nG=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",rG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tG():t==="fa"?nG():eG()}),sG=()=>"This is the baseline branch, so there is no parent comparison.",iG=()=>"这是基线分支,因此没有父分支可供比较。",aG=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",oG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iG():t==="fa"?aG():sG()}),lG=()=>"Failed to load changes:",cG=()=>"加载更改失败:",uG=()=>"بارگیری تغییرات ناموفق بود:",fG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cG():t==="fa"?uG():lG()}),hG=()=>"Loading changes…",dG=()=>"正在加载更改…",_G=()=>"در حال بارگیری تغییرات…",pG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dG():t==="fa"?_G():hG()}),mG=()=>"No committed changes from the parent branch.",gG=()=>"与父分支相比没有已提交的更改。",bG=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",vG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gG():t==="fa"?bG():mG()}),xG=e=>`agent ${e==null?void 0:e.number}`,yG=e=>`智能体 ${e==null?void 0:e.number}`,wG=e=>`عامل ${e==null?void 0:e.number}`,r6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yG(e):t==="fa"?wG(e):xG(e)}),SG=()=>"agent sessions",kG=()=>"智能体会话",CG=()=>"نشست‌های عامل‌ها",EG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kG():t==="fa"?CG():SG()}),NG=()=>"All sessions",zG=()=>"所有会话",AG=()=>"همهٔ نشست‌ها",jG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zG():t==="fa"?AG():NG()}),TG=e=>`${e==null?void 0:e.count} annotations`,MG=e=>`${e==null?void 0:e.count} 条批注`,RG=e=>`${e==null?void 0:e.count} یادداشت`,DG=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MG(e):t==="fa"?RG(e):TG(e)}),LG=()=>"Archive",OG=()=>"归档",IG=()=>"بایگانی",BG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OG():t==="fa"?IG():LG()}),$G=()=>"Ask the research agent… (/ for commands and skills)",HG=()=>"询问研究智能体…(输入 / 使用命令和技能)",FG=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها)",PG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HG():t==="fa"?FG():$G()}),UG=()=>"Asked about selected text",qG=()=>"已询问所选文本",GG=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",VG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qG():t==="fa"?GG():UG()}),WG=()=>"Attachment",KG=()=>"附件",XG=()=>"پیوست",YG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KG():t==="fa"?XG():WG()}),ZG=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,QG=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,JG=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,eV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QG(e):t==="fa"?JG(e):ZG(e)}),tV=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",nV=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",rV=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",sV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nV():t==="fa"?rV():tV()}),iV=()=>"Collapse tool activity",aV=()=>"折叠工具活动",oV=()=>"بستن فعالیت ابزارها",lV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aV():t==="fa"?oV():iV()}),cV=()=>"Continue",uV=()=>"继续",fV=()=>"ادامه",hV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uV():t==="fa"?fV():cV()}),dV=e=>`Delete “${e==null?void 0:e.title}”? -Its transcript will be permanently removed.`,fV=e=>`删除“${e==null?void 0:e.title}”? +Its transcript will be permanently removed.`,_V=e=>`删除“${e==null?void 0:e.title}”? -其对话记录将被永久移除。`,dV=e=>`«${e==null?void 0:e.title}» حذف شود؟ +其对话记录将被永久移除。`,pV=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,hV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fV(e):t==="fa"?dV(e):uV(e)}),_V=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,pV=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,mV=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,gV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pV(e):t==="fa"?mV(e):_V(e)}),bV=()=>"Could not exit Plan mode. Try again.",vV=()=>"无法退出计划模式。请重试。",xV=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",yV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vV():t==="fa"?xV():bV()}),wV=()=>"Expand tool activity",SV=()=>"展开工具活动",kV=()=>"باز کردن فعالیت ابزارها",CV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SV():t==="fa"?kV():wV()}),EV=()=>"experiments",NV=()=>"实验",zV=()=>"آزمایش‌ها",AV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NV():t==="fa"?zV():EV()}),jV=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,TV=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,MV=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,RV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TV(e):t==="fa"?MV(e):jV(e)}),DV=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills)`,LV=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能)`,OV=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها)`,IV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LV(e):t==="fa"?OV(e):DV(e)}),BV=e=>`Message not sent: ${e==null?void 0:e.error}`,$V=e=>`消息未发送:${e==null?void 0:e.error}`,HV=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,PV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$V(e):t==="fa"?HV(e):BV(e)}),FV=()=>"New session",UV=()=>"新会话",qV=()=>"نشست جدید",n6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UV():t==="fa"?qV():FV()}),GV=()=>"No active sessions",VV=()=>"没有活跃会话",WV=()=>"نشست فعالی وجود ندارد",KV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VV():t==="fa"?WV():GV()}),XV=()=>"No activity",YV=()=>"无活动",ZV=()=>"بدون فعالیت",QV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YV():t==="fa"?ZV():XV()}),JV=()=>"No archived sessions",eW=()=>"没有已归档的会话",tW=()=>"نشست بایگانی‌شده‌ای وجود ندارد",nW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eW():t==="fa"?tW():JV()}),rW=()=>"No sessions yet",sW=()=>"还没有会话",iW=()=>"هنوز نشستی وجود ندارد",aW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sW():t==="fa"?iW():rW()}),oW=()=>"1 annotation",lW=()=>"1 条批注",cW=()=>"۱ یادداشت",uW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lW():t==="fa"?cW():oW()}),fW=()=>"Open sub-agent transcript",dW=()=>"打开子智能体记录",hW=()=>"باز کردن متن گفت‌وگوی عامل فرعی",_W=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dW():t==="fa"?hW():fW()}),pW=()=>"About this demo",mW=()=>"关于此演示",gW=()=>"دربارهٔ این نسخهٔ نمایشی",r6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mW():t==="fa"?gW():pW()}),bW=()=>"Accept and auto mode",vW=()=>"接受并使用自动模式",xW=()=>"پذیرش و حالت خودکار",yW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vW():t==="fa"?xW():bW()}),wW=()=>"Accept and bypass all",SW=()=>"接受并跳过所有审批",kW=()=>"پذیرش و عبور از همهٔ تأییدها",CW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SW():t==="fa"?kW():wW()}),EW=()=>"Active",NW=()=>"活跃",zW=()=>"فعال",AW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NW():t==="fa"?zW():EW()}),jW=()=>"All",TW=()=>"全部",MW=()=>"همه",RW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TW():t==="fa"?MW():jW()}),DW=()=>"Allow",LW=()=>"允许",OW=()=>"اجازه دادن",IW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LW():t==="fa"?OW():DW()}),BW=()=>"Approval required",$W=()=>"需要批准",HW=()=>"نیازمند تأیید",PW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$W():t==="fa"?HW():BW()}),FW=()=>"Archived",UW=()=>"已归档",qW=()=>"بایگانی‌شده",s6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UW():t==="fa"?qW():FW()}),GW=()=>"Artifacts",VW=()=>"产物",WW=()=>"خروجی‌ها",KW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VW():t==="fa"?WW():GW()}),XW=()=>"Ask about this",YW=()=>"询问此内容",ZW=()=>"دربارهٔ این بپرسید",QW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YW():t==="fa"?ZW():XW()}),JW=()=>"Attach a PDF or image",eK=()=>"附加 PDF 或图片",tK=()=>"پیوست PDF یا تصویر",i6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eK():t==="fa"?tK():JW()}),nK=()=>"Browsed the web",rK=()=>"已浏览网页",sK=()=>"وب مرور شد",a6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rK():t==="fa"?sK():nK()}),iK=()=>"Built the project",aK=()=>"已构建项目",oK=()=>"پروژه ساخته شد",lK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aK():t==="fa"?oK():iK()}),cK=()=>"Cancel",uK=()=>"取消",fK=()=>"لغو",dK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uK():t==="fa"?fK():cK()}),hK=()=>"Cancelled an experiment run",_K=()=>"已取消实验运行",pK=()=>"اجرای آزمایش لغو شد",mK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_K():t==="fa"?pK():hK()}),gK=()=>"Checked code style",bK=()=>"已检查代码风格",vK=()=>"سبک کد بررسی شد",xK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bK():t==="fa"?vK():gK()}),yK=()=>"Checked compute options",wK=()=>"已检查算力选项",SK=()=>"گزینه‌های رایانشی بررسی شد",kK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wK():t==="fa"?SK():yK()}),CK=()=>"Checked experiment status",EK=()=>"已检查实验状态",NK=()=>"وضعیت آزمایش بررسی شد",o6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EK():t==="fa"?NK():CK()}),zK=()=>"Checked Git status",AK=()=>"已检查 Git 状态",jK=()=>"وضعیت Git بررسی شد",TK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AK():t==="fa"?jK():zK()}),MK=()=>"Checked local times",RK=()=>"已查询当地时间",DK=()=>"زمان‌های محلی بررسی شد",LK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RK():t==="fa"?DK():MK()}),OK=()=>"Checked market data",IK=()=>"已查询市场数据",BK=()=>"داده‌های بازار بررسی شد",$K=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IK():t==="fa"?BK():OK()}),HK=()=>"Checked sports data",PK=()=>"已查询体育数据",FK=()=>"داده‌های ورزشی بررسی شد",UK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PK():t==="fa"?FK():HK()}),qK=()=>"Checked the weather",GK=()=>"已查询天气",VK=()=>"آب‌وهوا بررسی شد",WK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GK():t==="fa"?VK():qK()}),KK=()=>"Checked types",XK=()=>"已检查类型",YK=()=>"نوع‌ها بررسی شد",ZK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XK():t==="fa"?YK():KK()}),QK=()=>"Clear annotations",JK=()=>"清除批注",eX=()=>"پاک کردن یادداشت‌ها",l6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JK():t==="fa"?eX():QK()}),tX=()=>"Customize",nX=()=>"自定义",rX=()=>"سفارشی‌سازی",sX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nX():t==="fa"?rX():tX()}),iX=()=>"Data sources",aX=()=>"数据源",oX=()=>"منابع داده",m1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aX():t==="fa"?oX():iX()}),lX=()=>"Delegated a task to a new agent",cX=()=>"已将任务委派给新智能体",uX=()=>"وظیفه به عامل جدید واگذار شد",fX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cX():t==="fa"?uX():lX()}),dX=()=>"Delete",hX=()=>"删除",_X=()=>"حذف",pX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hX():t==="fa"?_X():dX()}),mX=()=>"Deny",gX=()=>"拒绝",bX=()=>"رد کردن",vX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gX():t==="fa"?bX():mX()}),xX=()=>"Edit and re-send",yX=()=>"编辑并重新发送",wX=()=>"ویرایش و ارسال دوباره",c6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yX():t==="fa"?wX():xX()}),SX=()=>"Edit message",kX=()=>"编辑消息",CX=()=>"ویرایش پیام",EX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=()=>"Edited a file",zX=()=>"已编辑文件",AX=()=>"فایل ویرایش شد",u6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zX():t==="fa"?AX():NX()}),jX=()=>"Exit Plan mode",TX=()=>"退出计划模式",MX=()=>"خروج از حالت طرح",f6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TX():t==="fa"?MX():jX()}),RX=()=>"Experiments",DX=()=>"实验",LX=()=>"آزمایش‌ها",OX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DX():t==="fa"?LX():RX()}),IX=()=>"Failed:",BX=()=>"失败:",$X=()=>"ناموفق:",j2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BX():t==="fa"?$X():IX()}),HX=()=>"Files",PX=()=>"文件",FX=()=>"فایل‌ها",UX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PX():t==="fa"?FX():HX()}),qX=()=>"Filter sessions",GX=()=>"筛选会话",VX=()=>"فیلتر نشست‌ها",d6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GX():t==="fa"?VX():qX()}),WX=()=>"is unavailable.",KX=()=>"不可用。",XX=()=>"در دسترس نیست.",YX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KX():t==="fa"?XX():WX()}),ZX=()=>"Later queued messages will wait until this is retried or removed.",QX=()=>"后续排队的消息会等待此消息重试或移除。",JX=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",eY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QX():t==="fa"?JX():ZX()}),tY=()=>"Listed files",nY=()=>"已列出文件",rY=()=>"فایل‌ها فهرست شد",h6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nY():t==="fa"?rY():tY()}),sY=()=>"Listed project runs",iY=()=>"已列出项目运行",aY=()=>"اجراهای پروژه فهرست شد",oY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iY():t==="fa"?aY():sY()}),lY=()=>"Listed projects",cY=()=>"已列出项目",uY=()=>"پروژه‌ها فهرست شد",fY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cY():t==="fa"?uY():lY()}),dY=()=>"Loading conversation…",hY=()=>"正在加载对话…",_Y=()=>"در حال بارگیری گفتگو…",pY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hY():t==="fa"?_Y():dY()}),mY=()=>"Next version",gY=()=>"下一版本",bY=()=>"نسخهٔ بعدی",_6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gY():t==="fa"?bY():mY()}),vY=()=>"Open the session this agent spawned",xY=()=>"打开此智能体创建的会话",yY=()=>"باز کردن نشست ساخته‌شده توسط این عامل",wY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xY():t==="fa"?yY():vY()}),SY=()=>"Opened web pages",kY=()=>"已打开网页",CY=()=>"صفحه‌های وب باز شد",EY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kY():t==="fa"?CY():SY()}),NY=()=>"Plan",zY=()=>"计划",AY=()=>"طرح",jY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zY():t==="fa"?AY():NY()}),TY=()=>"Plan approved",MY=()=>"计划已批准",RY=()=>"طرح تأیید شد",DY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MY():t==="fa"?RY():TY()}),LY=()=>"Plan rejected",OY=()=>"计划已拒绝",IY=()=>"طرح رد شد",BY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OY():t==="fa"?IY():LY()}),$Y=()=>"Plan resolved",HY=()=>"计划已处理",PY=()=>"طرح تعیین تکلیف شد",FY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HY():t==="fa"?PY():$Y()}),UY=()=>"Plan revision requested",qY=()=>"已请求修改计划",GY=()=>"درخواست بازنگری طرح ثبت شد",VY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qY():t==="fa"?GY():UY()}),WY=()=>"Previous version",KY=()=>"上一版本",XY=()=>"نسخهٔ قبلی",p6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KY():t==="fa"?XY():WY()}),YY=()=>"Ran a command",ZY=()=>"已运行命令",QY=()=>"فرمان اجرا شد",JY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZY():t==="fa"?QY():YY()}),eZ=()=>"Ran tests",tZ=()=>"已运行测试",nZ=()=>"آزمون‌ها اجرا شد",rZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tZ():t==="fa"?nZ():eZ()}),sZ=()=>"Read a file",iZ=()=>"已读取文件",aZ=()=>"فایل خوانده شد",oZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iZ():t==="fa"?aZ():sZ()}),lZ=()=>"Read Git history",cZ=()=>"已读取 Git 历史",uZ=()=>"تاریخچهٔ Git خوانده شد",fZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cZ():t==="fa"?uZ():lZ()}),dZ=()=>"Read project details",hZ=()=>"已读取项目详情",_Z=()=>"جزئیات پروژه خوانده شد",pZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hZ():t==="fa"?_Z():dZ()}),mZ=()=>"Reject",gZ=()=>"拒绝",bZ=()=>"رد کردن",vZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gZ():t==="fa"?bZ():mZ()}),xZ=()=>"Remove",yZ=()=>"移除",wZ=()=>"حذف",SZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yZ():t==="fa"?wZ():xZ()}),kZ=()=>"Remove annotation",CZ=()=>"移除批注",EZ=()=>"حذف یادداشت",NZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CZ():t==="fa"?EZ():kZ()}),zZ=()=>"Remove file",AZ=()=>"移除文件",jZ=()=>"حذف فایل",m6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AZ():t==="fa"?jZ():zZ()}),TZ=()=>"Remove image",MZ=()=>"移除图片",RZ=()=>"حذف تصویر",g6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MZ():t==="fa"?RZ():TZ()}),DZ=()=>"Remove queued message",LZ=()=>"移除排队消息",OZ=()=>"حذف پیام صف",b6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LZ():t==="fa"?OZ():DZ()}),IZ=()=>"Rename",BZ=()=>"重命名",$Z=()=>"تغییر نام",HZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BZ():t==="fa"?$Z():IZ()}),PZ=()=>"Reviewed code changes",FZ=()=>"已审查代码更改",UZ=()=>"تغییرات کد بازبینی شد",qZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FZ():t==="fa"?UZ():PZ()}),GZ=()=>"Selected chat text",VZ=()=>"已选聊天文本",WZ=()=>"متن انتخاب‌شدهٔ گفتگو",KZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VZ():t==="fa"?WZ():GZ()}),XZ=()=>"Selected text:",YZ=()=>"已选文本:",ZZ=()=>"متن انتخاب‌شده:",QZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YZ():t==="fa"?ZZ():XZ()}),JZ=()=>"Send",eQ=()=>"发送",tQ=()=>"ارسال",Vb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eQ():t==="fa"?tQ():JZ()}),nQ=()=>"Session options",rQ=()=>"会话选项",sQ=()=>"گزینه‌های نشست",v6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rQ():t==="fa"?sQ():nQ()}),iQ=()=>"Session title",aQ=()=>"会话标题",oQ=()=>"عنوان نشست",lQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aQ():t==="fa"?oQ():iQ()}),cQ=()=>"Show sidebar",uQ=()=>"显示侧边栏",fQ=()=>"نمایش نوار کناری",x6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uQ():t==="fa"?fQ():cQ()}),dQ=()=>"Started an experiment run",hQ=()=>"已启动实验运行",_Q=()=>"اجرای آزمایش آغاز شد",pQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hQ():t==="fa"?_Q():dQ()}),mQ=()=>"Stop",gQ=()=>"停止",bQ=()=>"توقف",y6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gQ():t==="fa"?bQ():mQ()}),vQ=()=>"Submit",xQ=()=>"提交",yQ=()=>"ارسال",wQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xQ():t==="fa"?yQ():vQ()}),SQ=()=>"Task",kQ=()=>"任务",CQ=()=>"وظیفه",EQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kQ():t==="fa"?CQ():SQ()}),NQ=()=>"Tool failed",zQ=()=>"工具失败",AQ=()=>"ابزار ناموفق بود",jQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zQ():t==="fa"?AQ():NQ()}),TQ=()=>"Tool was interrupted",MQ=()=>"工具已中断",RQ=()=>"ابزار متوقف شد",DQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MQ():t==="fa"?RQ():TQ()}),LQ=()=>"Used tools",OQ=()=>"已使用工具",IQ=()=>"ابزارها استفاده شد",a9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OQ():t==="fa"?IQ():LQ()}),BQ=()=>"View full plan",$Q=()=>"查看完整计划",HQ=()=>"مشاهدهٔ طرح کامل",PQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Q():t==="fa"?HQ():BQ()}),FQ=()=>"Waited for an experiment run",UQ=()=>"已等待实验运行",qQ=()=>"برای اجرای آزمایش صبر شد",GQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UQ():t==="fa"?qQ():FQ()}),VQ=()=>"Waiting for your input…",WQ=()=>"正在等待你的输入…",KQ=()=>"منتظر ورودی شما…",XQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WQ():t==="fa"?KQ():VQ()}),YQ=()=>"What should we research?",ZQ=()=>"我们应该研究什么?",QQ=()=>"چه چیزی را پژوهش کنیم؟",JQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZQ():t==="fa"?QQ():YQ()}),eJ=()=>"You, mid-task",tJ=()=>"你(任务进行中)",nJ=()=>"شما، هنگام انجام وظیفه",rJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tJ():t==="fa"?nJ():eJ()}),sJ=()=>"Pasted image",iJ=()=>"粘贴的图片",aJ=()=>"تصویر جای‌گذاری‌شده",oJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iJ():t==="fa"?aJ():sJ()}),lJ=()=>"Plan",cJ=()=>"计划",uJ=()=>"طرح",o9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cJ():t==="fa"?uJ():lJ()}),fJ=()=>"Plan mode — ready to proceed?",dJ=()=>"计划模式 — 准备好继续了吗?",hJ=()=>"حالت طرح — آماده‌اید ادامه دهید؟",_J=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dJ():t==="fa"?hJ():fJ()}),pJ=()=>"Proposed plan",mJ=()=>"提议的计划",gJ=()=>"طرح پیشنهادی",w6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mJ():t==="fa"?gJ():pJ()}),bJ=()=>"Question",vJ=()=>"问题",xJ=()=>"پرسش",yJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vJ():t==="fa"?xJ():bJ()}),wJ=()=>"Queued",SJ=()=>"已排队",kJ=()=>"در صف",CJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SJ():t==="fa"?kJ():wJ()}),EJ=()=>"Recents",NJ=()=>"最近",zJ=()=>"اخیر",l9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NJ():t==="fa"?zJ():EJ()}),AJ=()=>"Re-check its setup.",jJ=()=>"请重新检查其设置。",TJ=()=>"راه‌اندازی آن را دوباره بررسی کنید.",MJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jJ():t==="fa"?TJ():AJ()}),RJ=()=>"Could not recover this turn. Try again.",DJ=()=>"无法恢复本轮。请重试。",LJ=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",OJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DJ():t==="fa"?LJ():RJ()}),IJ=()=>"Could not remove the queued message. Try again.",BJ=()=>"无法移除排队消息。请重试。",$J=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",HJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BJ():t==="fa"?$J():IJ()}),PJ=e=>`Could not re-send: ${e==null?void 0:e.error}`,FJ=e=>`无法重新发送:${e==null?void 0:e.error}`,UJ=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,qJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FJ(e):t==="fa"?UJ(e):PJ(e)}),GJ=()=>"Resolved",VJ=()=>"已处理",WJ=()=>"رسیدگی شد",KJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VJ():t==="fa"?WJ():GJ()}),XJ=()=>"Could not retry the queued message. Try again.",YJ=()=>"无法重试排队消息。请重试。",ZJ=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",QJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YJ():t==="fa"?ZJ():XJ()}),JJ=()=>"run logs",eee=()=>"运行日志",tee=()=>"گزارش‌های اجرا",nee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=()=>"The selected harness is unavailable",see=()=>"所选智能体工具不可用",iee=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",S6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?see():t==="fa"?iee():ree()}),aee=()=>"The chat session was not created",oee=()=>"未能创建聊天会话",lee=()=>"نشست گفت‌وگو ایجاد نشد",cee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oee():t==="fa"?lee():aee()}),uee=()=>" · Spawned by another agent",fee=()=>" · 由另一个智能体创建",dee=()=>" · ساخته‌شده به‌دست عامل دیگر",hee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fee():t==="fa"?dee():uee()}),_ee=()=>"Starting…",pee=()=>"正在启动…",mee=()=>"در حال شروع…",gee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),bee=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,vee=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,xee=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,yee=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vee(e):t==="fa"?xee(e):bee(e)}),wee=()=>"Could not stop the turn. Try again.",See=()=>"无法停止本轮。请重试。",kee=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",Cee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=e=>`Could not switch fork: ${e==null?void 0:e.error}`,Nee=e=>`无法切换分支:${e==null?void 0:e.error}`,zee=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,Aee=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Nee(e):t==="fa"?zee(e):Eee(e)}),jee=()=>"The agent",Tee=()=>"智能体",Mee=()=>"عامل",Ree=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tee():t==="fa"?Mee():jee()}),Dee=()=>"Thinking…",Lee=()=>"正在思考…",Oee=()=>"در حال فکر کردن…",Iee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Could not toggle Plan mode. Try again.",$ee=()=>"无法切换计划模式。请重试。",Hee=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",k6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ee():t==="fa"?Hee():Bee()}),Pee=()=>"This turn did not finish.",Fee=()=>"本轮未完成。",Uee=()=>"این نوبت کامل نشد.",qee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fee():t==="fa"?Uee():Pee()}),Gee=()=>"Type a custom answer…",Vee=()=>"输入自定义回答…",Wee=()=>"پاسخ دلخواه را بنویسید…",Kee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vee():t==="fa"?Wee():Gee()}),Xee=()=>"Unarchive",Yee=()=>"取消归档",Zee=()=>"خارج کردن از بایگانی",Qee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yee():t==="fa"?Zee():Xee()}),Jee=()=>"Untitled",ete=()=>"未命名",tte=()=>"بدون عنوان",g1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),nte=()=>"Could not update permissions. Try again.",rte=()=>"无法更新权限。请重试。",ste=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",ite=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rte():t==="fa"?ste():nte()}),ate=()=>"Working…",ote=()=>"正在工作…",lte=()=>"در حال کار…",np=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ote():t==="fa"?lte():ate()}),cte=()=>"Close tab",ute=()=>"关闭标签页",fte=()=>"بستن زبانه",dte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ute():t==="fa"?fte():cte()}),hte=()=>"Changes",_te=()=>"更改",pte=()=>"تغییرات",mte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_te():t==="fa"?pte():hte()}),gte=()=>"Code browser view",bte=()=>"代码浏览器视图",vte=()=>"نمای مرورگر کد",xte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bte():t==="fa"?vte():gte()}),yte=()=>"Files",wte=()=>"文件",Ste=()=>"فایل‌ها",kte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wte():t==="fa"?Ste():yte()}),Cte=()=>"Refresh",Ete=()=>"刷新",Nte=()=>"تازه‌سازی",C6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ete():t==="fa"?Nte():Cte()}),zte=()=>"listing truncated",Ate=()=>"列表已截断",jte=()=>"فهرست کوتاه شده است",Tte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ate():t==="fa"?jte():zte()}),Mte=()=>"No files.",Rte=()=>"没有文件。",Dte=()=>"فایلی وجود ندارد.",Lte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rte():t==="fa"?Dte():Mte()}),Ote=()=>"Refresh failed:",Ite=()=>"刷新失败:",Bte=()=>"تازه‌سازی ناموفق بود:",$te=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Hte=()=>"Cancelling…",Pte=()=>"正在取消…",Fte=()=>"در حال لغو…",Ute=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pte():t==="fa"?Fte():Hte()}),qte=()=>"Checking…",Gte=()=>"正在检查…",Vte=()=>"در حال بررسی…",rp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gte():t==="fa"?Vte():qte()}),Wte=()=>"Copied",Kte=()=>"已复制",Xte=()=>"کپی شد",b0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kte():t==="fa"?Xte():Wte()}),Yte=e=>`Failed to load: ${e==null?void 0:e.error}`,Zte=e=>`加载失败:${e==null?void 0:e.error}`,Qte=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,c9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Zte(e):t==="fa"?Qte(e):Yte(e)}),Jte=()=>"Loading…",ene=()=>"正在加载…",tne=()=>"در حال بارگیری…",u9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ene():t==="fa"?tne():Jte()}),nne=e=>`+ ${e==null?void 0:e.count} more`,rne=e=>`另有 ${e==null?void 0:e.count} 项`,sne=e=>`${e==null?void 0:e.count}+ مورد دیگر`,ine=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rne(e):t==="fa"?sne(e):nne(e)}),ane=()=>"Rendered view",one=()=>"渲染视图",lne=()=>"نمای رندرشده",v0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?one():t==="fa"?lne():ane()}),cne=()=>"Save",une=()=>"保存",fne=()=>"ذخیره",ac=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?une():t==="fa"?fne():cne()}),dne=()=>"Saving…",hne=()=>"正在保存…",_ne=()=>"در حال ذخیره…",xa=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hne():t==="fa"?_ne():dne()}),pne=()=>"Show less",mne=()=>"收起",gne=()=>"نمایش کمتر",f9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mne():t==="fa"?gne():pne()}),bne=()=>"Show more",vne=()=>"展开",xne=()=>"نمایش بیشتر",yne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vne():t==="fa"?xne():bne()}),wne=()=>"Stop",Sne=()=>"停止",kne=()=>"توقف",d9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Stopping…",Ene=()=>"正在停止…",Nne=()=>"در حال توقف…",zne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),Ane=()=>"View source",jne=()=>"查看源代码",Tne=()=>"نمایش متن منبع",iu=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jne():t==="fa"?Tne():Ane()}),Mne=e=>`Hugging Face token — ${e==null?void 0:e.summary}`,Rne=e=>`Hugging Face 令牌 — ${e==null?void 0:e.summary}`,Dne=e=>`توکن Hugging Face — ${e==null?void 0:e.summary}`,Lne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rne(e):t==="fa"?Dne(e):Mne(e)}),One=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,Ine=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,Bne=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,$ne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ine(e):t==="fa"?Bne(e):One(e)}),Hne=()=>"No credentials required; this computer is always available.",Pne=()=>"无需凭据;此计算机始终可用。",Fne=()=>"نیازی به اطلاعات ورود نیست؛ این رایانه همیشه در دسترس است.",Une=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pne():t==="fa"?Fne():Hne()}),qne=e=>`Modal token — ${e==null?void 0:e.summary}`,Gne=e=>`Modal 令牌 — ${e==null?void 0:e.summary}`,Vne=e=>`توکن Modal — ${e==null?void 0:e.summary}`,Wne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gne(e):t==="fa"?Vne(e):qne(e)}),Kne=e=>`OpenResearch login and SSH key — ${e==null?void 0:e.summary}`,Xne=e=>`OpenResearch 登录信息和 SSH 密钥 — ${e==null?void 0:e.summary}`,Yne=e=>`ورود OpenResearch و کلید SSH — ${e==null?void 0:e.summary}`,Zne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xne(e):t==="fa"?Yne(e):Kne(e)}),Qne=e=>`Ray Jobs endpoint — ${e==null?void 0:e.summary}`,Jne=e=>`Ray Jobs 端点 — ${e==null?void 0:e.summary}`,ere=e=>`endpoint مربوط به Ray Jobs — ${e==null?void 0:e.summary}`,tre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jne(e):t==="fa"?ere(e):Qne(e)}),nre=e=>`SSH config — ${e==null?void 0:e.summary}`,rre=e=>`SSH 配置 — ${e==null?void 0:e.summary}`,sre=e=>`پیکربندی SSH — ${e==null?void 0:e.summary}`,ire=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rre(e):t==="fa"?sre(e):nre(e)}),are=e=>`SSH config and keys — ${e==null?void 0:e.summary}`,ore=e=>`SSH 配置和密钥 — ${e==null?void 0:e.summary}`,lre=e=>`پیکربندی و کلیدهای SSH — ${e==null?void 0:e.summary}`,cre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ore(e):t==="fa"?lre(e):are(e)}),ure=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,fre=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,dre=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,hre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fre(e):t==="fa"?dre(e):ure(e)}),_re=()=>"Runs as a remote Hugging Face Job",pre=()=>"作为远程 Hugging Face Job 运行",mre=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",gre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pre():t==="fa"?mre():_re()}),bre=()=>"Runs as a Job on your Kubernetes cluster",vre=()=>"作为 Kubernetes 集群上的 Job 运行",xre=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",yre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vre():t==="fa"?xre():bre()}),wre=()=>"Runs directly on this computer",Sre=()=>"直接在此计算机上运行",kre=()=>"مستقیماً روی این رایانه اجرا می‌شود",Cre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sre():t==="fa"?kre():wre()}),Ere=()=>"Runs in a remote Modal sandbox",Nre=()=>"在远程 Modal 沙箱中运行",zre=()=>"در sandbox دوردست Modal اجرا می‌شود",Are=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nre():t==="fa"?zre():Ere()}),jre=()=>"Runs on an ephemeral OpenResearch box",Tre=()=>"在临时 OpenResearch 主机上运行",Mre=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",Rre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tre():t==="fa"?Mre():jre()}),Dre=()=>"Runs on the connected Ray cluster",Lre=()=>"在已连接的 Ray 集群上运行",Ore=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",Ire=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lre():t==="fa"?Ore():Dre()}),Bre=()=>"Runs as a scheduled job on your Slurm cluster",$re=()=>"作为 Slurm 集群上的调度作业运行",Hre=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",Pre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$re():t==="fa"?Hre():Bre()}),Fre=()=>"Runs on a host from your SSH config",Ure=()=>"在 SSH 配置中的主机上运行",qre=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",Gre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ure():t==="fa"?qre():Fre()}),Vre=()=>"Runs through Tinker’s remote compute",Wre=()=>"通过 Tinker 远程算力运行",Kre=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",Xre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wre():t==="fa"?Kre():Vre()}),Yre=()=>"HF Jobs",Zre=()=>"HF Jobs",Qre=()=>"HF Jobs",Jre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zre():t==="fa"?Qre():Yre()}),ese=()=>"Kubernetes",tse=()=>"Kubernetes",nse=()=>"Kubernetes",rse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tse():t==="fa"?nse():ese()}),sse=()=>"This machine",ise=()=>"此计算机",ase=()=>"این رایانه",h9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),ose=()=>"Modal",lse=()=>"Modal",cse=()=>"Modal",use=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lse():t==="fa"?cse():ose()}),fse=()=>"OpenResearch",dse=()=>"OpenResearch",hse=()=>"OpenResearch",_se=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dse():t==="fa"?hse():fse()}),pse=()=>"Ray",mse=()=>"Ray",gse=()=>"Ray",bse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mse():t==="fa"?gse():pse()}),vse=()=>"Slurm",xse=()=>"Slurm",yse=()=>"Slurm",wse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xse():t==="fa"?yse():vse()}),Sse=()=>"SSH",kse=()=>"SSH",Cse=()=>"SSH",Ese=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"Tinker",zse=()=>"Tinker",Ase=()=>"Tinker",jse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zse():t==="fa"?Ase():Nse()}),Tse=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",Mse=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",Rse=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",Dse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mse():t==="fa"?Rse():Tse()}),Lse=()=>"A Kubernetes Job is created in the selected context and namespace from the project’s .orx/k8s.yaml manifest.",Ose=()=>"系统根据项目的 .orx/k8s.yaml 清单,在所选上下文和命名空间中创建 Kubernetes Job。",Ise=()=>"بر پایهٔ مانیفست .orx/k8s.yaml پروژه، یک Kubernetes Job در زمینه و فضای نام انتخاب‌شده ساخته می‌شود.",Bse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"The experiment runs as a supervised process on this computer and uses its CPU, memory, and GPUs.",Hse=()=>"实验作为受监管进程在此计算机上运行,并使用其 CPU、内存和 GPU。",Pse=()=>"آزمایش به‌صورت فرایندی تحت نظارت روی این رایانه اجرا می‌شود و از CPU، حافظه و GPUهای آن استفاده می‌کند.",Fse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hse():t==="fa"?Pse():$se()}),Use=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",qse=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",Gse=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",Vse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qse():t==="fa"?Gse():Use()}),Wse=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",Kse=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",Xse=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",Yse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kse():t==="fa"?Xse():Wse()}),Zse=()=>"The run is submitted to the Ray Jobs endpoint, and the connected Ray cluster executes it.",Qse=()=>"运行会提交到 Ray Jobs 端点,并由已连接的 Ray 集群执行。",Jse=()=>"اجرا به endpoint مربوط به Ray Jobs فرستاده و توسط خوشهٔ متصل Ray اجرا می‌شود.",eie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qse():t==="fa"?Jse():Zse()}),tie=()=>"The login node receives an sbatch job using the saved partition, account, and time limit; the cluster schedules the work.",nie=()=>"登录节点使用已保存的分区、账户和时间限制接收 sbatch 作业;集群负责调度。",rie=()=>"گرهٔ ورود یک کار sbatch با پارتیشن، حساب و محدودیت زمانی ذخیره‌شده دریافت می‌کند و خوشه آن را زمان‌بندی می‌کند.",sie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nie():t==="fa"?rie():tie()}),iie=()=>"The project is copied to the selected SSH host and runs there. Logs and status return to this dashboard.",aie=()=>"项目会复制到所选 SSH 主机并在那里运行。日志和状态会返回此控制台。",oie=()=>"پروژه به میزبان SSH انتخاب‌شده کپی و همان‌جا اجرا می‌شود. گزارش‌ها و وضعیت به این داشبورد برمی‌گردند.",lie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aie():t==="fa"?oie():iie()}),cie=()=>"A controller runs here while the Tinker SDK sends model operations to remote compute. This computer must stay awake and online.",uie=()=>"控制器在此计算机上运行,Tinker SDK 将模型操作发送到远程算力。此计算机必须保持唤醒和联网。",fie=()=>"کنترل‌گر روی این رایانه اجرا می‌شود و Tinker SDK عملیات مدل را به رایانش دوردست می‌فرستد. این رایانه باید روشن و آنلاین بماند.",die=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uie():t==="fa"?fie():cie()}),hie=()=>"Context window",_ie=()=>"上下文窗口",pie=()=>"پنجرهٔ زمینه",mie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ie():t==="fa"?pie():hie()}),gie=()=>"Context window used",bie=()=>"已使用的上下文窗口",vie=()=>"پنجرهٔ زمینهٔ استفاده‌شده",xie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bie():t==="fa"?vie():gie()}),yie=e=>`${e==null?void 0:e.value} tokens`,wie=e=>`${e==null?void 0:e.value} 个 token`,Sie=e=>`${e==null?void 0:e.value} توکن`,kie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wie(e):t==="fa"?Sie(e):yie(e)}),Cie=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Eie=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Nie=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,zie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Eie(e):t==="fa"?Nie(e):Cie(e)}),Aie=()=>"No runs yet — ask the agent to launch one.",jie=()=>"尚无运行——让智能体启动一个。",Tie=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Mie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jie():t==="fa"?Tie():Aie()}),Rie=()=>"Run",Die=()=>"运行",Lie=()=>"اجرا",E6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Die():t==="fa"?Lie():Rie()}),Oie=()=>"Switch run",Iie=()=>"切换运行",Bie=()=>"تغییر اجرا",$ie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iie():t==="fa"?Bie():Oie()}),Hie=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Pie=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Fie=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Uie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Pie(e):t==="fa"?Fie(e):Hie(e)}),qie=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Gie=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Vie=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Wie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gie(e):t==="fa"?Vie(e):qie(e)}),Kie=e=>`${e==null?void 0:e.value}m`,Xie=e=>`${e==null?void 0:e.value} 分钟`,Yie=e=>`${e==null?void 0:e.value} دقیقه`,Zie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xie(e):t==="fa"?Yie(e):Kie(e)}),Qie=e=>`${e==null?void 0:e.value}s`,Jie=e=>`${e==null?void 0:e.value} 秒`,eae=e=>`${e==null?void 0:e.value} ثانیه`,tae=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jie(e):t==="fa"?eae(e):Qie(e)}),nae=()=>"Code",rae=()=>"代码",sae=()=>"کد",iae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rae():t==="fa"?sae():nae()}),aae=()=>"created",oae=()=>"创建于",lae=()=>"ایجادشده",cae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oae():t==="fa"?lae():aae()}),uae=()=>"from",fae=()=>"来自",dae=()=>"از",hae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fae():t==="fa"?dae():uae()}),_ae=()=>"Logs",pae=()=>"日志",mae=()=>"گزارش‌ها",gae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pae():t==="fa"?mae():_ae()}),bae=()=>"Latest run",vae=()=>"最新运行",xae=()=>"آخرین اجرا",yae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vae():t==="fa"?xae():bae()}),wae=()=>"Code",Sae=()=>"代码",kae=()=>"کد",Cae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sae():t==="fa"?kae():wae()}),Eae=()=>"Commit",Nae=()=>"提交",zae=()=>"کامیت",Aae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nae():t==="fa"?zae():Eae()}),jae=()=>"created",Tae=()=>"创建于",Mae=()=>"ایجادشده",Rae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tae():t==="fa"?Mae():jae()}),Dae=()=>"Description",Lae=()=>"说明",Oae=()=>"توضیحات",Iae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lae():t==="fa"?Oae():Dae()}),Bae=()=>"Duration",$ae=()=>"时长",Hae=()=>"مدت",Pae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ae():t==="fa"?Hae():Bae()}),Fae=()=>"exit",Uae=()=>"退出码",qae=()=>"خروج",Gae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uae():t==="fa"?qae():Fae()}),Vae=()=>"from",Wae=()=>"来自",Kae=()=>"از",Xae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wae():t==="fa"?Kae():Vae()}),Yae=()=>"Logs",Zae=()=>"日志",Qae=()=>"گزارش‌ها",Jae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zae():t==="fa"?Qae():Yae()}),eoe=()=>"Run",toe=()=>"运行",noe=()=>"اجرا",roe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?toe():t==="fa"?noe():eoe()}),soe=()=>"Run history",ioe=()=>"运行历史",aoe=()=>"تاریخچهٔ اجرا",ooe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Started",coe=()=>"开始时间",uoe=()=>"آغاز",foe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),doe=()=>"Runs",hoe=()=>"运行",_oe=()=>"اجراها",poe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hoe():t==="fa"?_oe():doe()}),moe=()=>"No runs yet",goe=()=>"还没有运行",boe=()=>"هنوز اجرایی وجود ندارد",voe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?goe():t==="fa"?boe():moe()}),xoe=()=>"No experiments yet.",yoe=()=>"还没有实验。",woe=()=>"هنوز آزمایشی وجود ندارد.",Soe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yoe():t==="fa"?woe():xoe()}),koe=()=>"Not run yet",Coe=()=>"尚未运行",Eoe=()=>"هنوز اجرا نشده",Noe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"1 run",Aoe=()=>"1 次运行",joe=()=>"۱ اجرا",Toe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aoe():t==="fa"?joe():zoe()}),Moe=()=>"Open logs",Roe=()=>"打开日志",Doe=()=>"باز کردن گزارش‌ها",Loe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Roe():t==="fa"?Doe():Moe()}),Ooe=e=>`${e==null?void 0:e.count} runs`,Ioe=e=>`${e==null?void 0:e.count} 次运行`,Boe=e=>`${e==null?void 0:e.count} اجرا`,$oe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ioe(e):t==="fa"?Boe(e):Ooe(e)}),Hoe=()=>"Stop requested",Poe=()=>"已请求停止",Foe=()=>"درخواست توقف ثبت شد",Uoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Poe():t==="fa"?Foe():Hoe()}),qoe=()=>"Stop run",Goe=()=>"停止运行",Voe=()=>"توقف اجرا",Woe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Goe():t==="fa"?Voe():qoe()}),Koe=()=>"Code",Xoe=()=>"代码",Yoe=()=>"کد",Zoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xoe():t==="fa"?Yoe():Koe()}),Qoe=()=>"Experiments",Joe=()=>"实验",ele=()=>"آزمایش‌ها",tle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Joe():t==="fa"?ele():Qoe()}),nle=()=>"Logs",rle=()=>"日志",sle=()=>"گزارش‌ها",ile=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Stop failed:",ole=()=>"停止失败:",lle=()=>"توقف ناموفق بود:",cle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,fle=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,dle=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,hle=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fle(e):t==="fa"?dle(e):ule(e)}),_le=()=>"Binary file — no inline preview.",ple=()=>"二进制文件——无法内嵌预览。",mle=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",gle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ple():t==="fa"?mle():_le()}),ble=()=>"Compile failed",vle=()=>"编译失败",xle=()=>"کامپایل ناموفق بود",yle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vle():t==="fa"?xle():ble()}),wle=()=>"Compile PDF",Sle=()=>"编译 PDF",kle=()=>"کامپایل PDF",N6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sle():t==="fa"?kle():wle()}),Cle=()=>"Compiled, but the engine reported errors — check the output below.",Ele=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",Nle=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",zle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),Ale=()=>"Copy command",jle=()=>"复制命令",Tle=()=>"کپی فرمان",Mle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jle():t==="fa"?Tle():Ale()}),Rle=()=>"Copy install command",Dle=()=>"复制安装命令",Lle=()=>"کپی فرمان نصب",Ole=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dle():t==="fa"?Lle():Rle()}),Ile=()=>"Discard my edits and reload",Ble=()=>"放弃我的编辑并重新加载",$le=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Hle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Dismiss",Fle=()=>"关闭",Ule=()=>"بستن",z6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fle():t==="fa"?Ule():Ple()}),qle=()=>"Dismiss compile message",Gle=()=>"关闭编译消息",Vle=()=>"بستن پیام کامپایل",Wle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gle():t==="fa"?Vle():qle()}),Kle=()=>"Dismiss Overleaf message",Xle=()=>"关闭 Overleaf 消息",Yle=()=>"بستن پیام Overleaf",Zle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xle():t==="fa"?Yle():Kle()}),Qle=()=>"Download",Jle=()=>"下载",ece=()=>"بارگیری",_9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jle():t==="fa"?ece():Qle()}),tce=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,nce=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,rce=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,sce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nce(e):t==="fa"?rce(e):tce(e)}),ice=()=>"Failed to load file:",ace=()=>"加载文件失败:",oce=()=>"بارگیری فایل ناموفق بود:",lce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ace():t==="fa"?oce():ice()}),cce=()=>"File truncated — showing the first 512 KB.",uce=()=>"文件已截断——仅显示前 512 KB。",fce=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",dce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uce():t==="fa"?fce():cce()}),hce=()=>"Loading…",_ce=()=>"正在加载…",pce=()=>"در حال بارگیری…",mce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ce():t==="fa"?pce():hce()}),gce=()=>"File not found.",bce=()=>"找不到文件。",vce=()=>"فایل پیدا نشد.",xce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bce():t==="fa"?vce():gce()}),yce=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,wce=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,Sce=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,kce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wce(e):t==="fa"?Sce(e):yce(e)}),Cce=e=>`File not found on branch ${e==null?void 0:e.branch}.`,Ece=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,Nce=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,zce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ece(e):t==="fa"?Nce(e):Cce(e)}),Ace=()=>"File not found on disk.",jce=()=>"磁盘上找不到此文件。",Tce=()=>"فایل روی دیسک پیدا نشد.",Mce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jce():t==="fa"?Tce():Ace()}),Rce=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Dce=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,Lce=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,Oce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dce(e):t==="fa"?Lce(e):Rce(e)}),Ice=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Bce=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,$ce=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Hce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Bce(e):t==="fa"?$ce(e):Ice(e)}),Pce=()=>"Open in default editor",Fce=()=>"在默认编辑器中打开",Uce=()=>"باز کردن در ویرایشگر پیش‌فرض",A6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fce():t==="fa"?Uce():Pce()}),qce=()=>"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.",Gce=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",Vce=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Wce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gce():t==="fa"?Vce():qce()}),Kce=()=>"Compiled PDF is out of date",Xce=()=>"已编译的 PDF 不是最新版本",Yce=()=>"PDF کامپایل‌شده به‌روز نیست",Zce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xce():t==="fa"?Yce():Kce()}),Qce=()=>"project clone",Jce=()=>"项目克隆",eue=()=>"کلون پروژه",b_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jce():t==="fa"?eue():Qce()}),tue=()=>"Recompile PDF",nue=()=>"重新编译 PDF",rue=()=>"کامپایل دوبارهٔ PDF",j6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nue():t==="fa"?rue():tue()}),sue=()=>"Reload file",iue=()=>"重新加载文件",aue=()=>"بارگیری دوبارهٔ فایل",T6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iue():t==="fa"?aue():sue()}),oue=()=>"Save failed",lue=()=>"保存失败",cue=()=>"ذخیره ناموفق بود",uue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lue():t==="fa"?cue():oue()}),fue=()=>"Saving…",due=()=>"正在保存…",hue=()=>"در حال ذخیره…",_ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?due():t==="fa"?hue():fue()}),pue=()=>"Selected — press ⌘C",mue=()=>"已选中 — 按 ⌘C 复制",gue=()=>"انتخاب شد — برای کپی ⌘C را بزنید",bue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mue():t==="fa"?gue():pue()}),vue=()=>"session’s worktree",xue=()=>"会话工作树",yue=()=>"درخت کاری نشست",v_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xue():t==="fa"?yue():vue()}),wue=()=>"Show compiled PDF",Sue=()=>"显示已编译的 PDF",kue=()=>"نمایش PDF کامپایل‌شده",M6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Cue=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",Eue=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",Nue=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",zue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eue():t==="fa"?Nue():Cue()}),Aue=()=>"This session's worktree isn't available — showing the project clone's copy.",jue=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",Tue=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",Mue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jue():t==="fa"?Tue():Aue()}),Rue=()=>"Unsaved",Due=()=>"未保存",Lue=()=>"ذخیره نشده",Oue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Due():t==="fa"?Lue():Rue()}),Iue=()=>"Unsaved — ⌘S or click away to save",Bue=()=>"未保存 — 按 ⌘S 或点击其他位置保存",$ue=()=>"ذخیره نشده — ⌘S را بزنید یا برای ذخیره بیرون کلیک کنید",Hue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Pue=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",Fue=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",Uue=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",que=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fue():t==="fa"?Uue():Pue()}),Gue=()=>"Back to preview",Vue=()=>"返回预览",Wue=()=>"بازگشت به پیش‌نمایش",Kue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vue():t==="fa"?Wue():Gue()}),Xue=e=>`${e==null?void 0:e.count} changed files`,Yue=e=>`${e==null?void 0:e.count} 个已更改文件`,Zue=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,Que=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Yue(e):t==="fa"?Zue(e):Xue(e)}),Jue=()=>"Changed files",efe=()=>"已更改文件",tfe=()=>"فایل‌های تغییرکرده",nfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?efe():t==="fa"?tfe():Jue()}),rfe=()=>"Diff preview truncated",sfe=()=>"差异预览已截断",ife=()=>"پیش‌نمایش تفاوت کوتاه شده است",afe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sfe():t==="fa"?ife():rfe()}),ofe=e=>`${e==null?void 0:e.count} files shown (partial)`,lfe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,cfe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,ufe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lfe(e):t==="fa"?cfe(e):ofe(e)}),ffe=()=>"No changes.",dfe=()=>"没有更改。",hfe=()=>"تغییری وجود ندارد.",_fe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dfe():t==="fa"?hfe():ffe()}),pfe=()=>"No complete file preview was available before the cutoff.",mfe=()=>"在截断位置之前没有完整的文件预览。",gfe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",bfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mfe():t==="fa"?gfe():pfe()}),vfe=()=>"No textual diff for this file.",xfe=()=>"此文件没有文本差异。",yfe=()=>"برای این فایل تفاوت متنی وجود ندارد.",wfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xfe():t==="fa"?yfe():vfe()}),Sfe=()=>"1 changed file",kfe=()=>"1 个已更改文件",Cfe=()=>"۱ فایل تغییرکرده",Efe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"1 file shown (partial)",zfe=()=>"显示 1 个文件(部分)",Afe=()=>"۱ فایل نمایش داده شده (ناقص)",jfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zfe():t==="fa"?Afe():Nfe()}),Tfe=()=>"Unable to parse this diff.",Mfe=()=>"无法解析此差异。",Rfe=()=>"خواندن این تفاوت ممکن نبود.",Dfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mfe():t==="fa"?Rfe():Tfe()}),Lfe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,Ofe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Ife=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Bfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ofe(e):t==="fa"?Ife(e):Lfe(e)}),$fe=()=>"View full diff",Hfe=()=>"查看完整差异",Pfe=()=>"نمایش تفاوت کامل",Ffe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hfe():t==="fa"?Pfe():$fe()}),Ufe=()=>"Create a token ↗",qfe=()=>"创建令牌 ↗",Gfe=()=>"ساخت توکن ↗",Vfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qfe():t==="fa"?Gfe():Ufe()}),Wfe=()=>"All projects",Kfe=()=>"所有项目",Xfe=()=>"همهٔ پروژه‌ها",R6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kfe():t==="fa"?Xfe():Wfe()}),Yfe=()=>"Configure Repository",Zfe=()=>"配置仓库",Qfe=()=>"پیکربندی مخزن",Jfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zfe():t==="fa"?Qfe():Yfe()}),ede=()=>"Create a new project",tde=()=>"新建项目",nde=()=>"ایجاد پروژهٔ جدید",rde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tde():t==="fa"?nde():ede()}),sde=()=>"Hide sidebar",ide=()=>"隐藏侧边栏",ade=()=>"پنهان کردن نوار کناری",D6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ide():t==="fa"?ade():sde()}),ode=()=>"Project",lde=()=>"项目",cde=()=>"پروژه",ude=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),fde=e=>`${e==null?void 0:e.count} cancelled`,dde=e=>`${e==null?void 0:e.count} 次取消`,hde=e=>`${e==null?void 0:e.count} لغوشده`,_de=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dde(e):t==="fa"?hde(e):fde(e)}),pde=e=>`${e==null?void 0:e.count} done`,mde=e=>`${e==null?void 0:e.count} 次完成`,gde=e=>`${e==null?void 0:e.count} تمام‌شده`,bde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mde(e):t==="fa"?gde(e):pde(e)}),vde=e=>`${e==null?void 0:e.count} failed`,xde=e=>`${e==null?void 0:e.count} 次失败`,yde=e=>`${e==null?void 0:e.count} ناموفق`,wde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xde(e):t==="fa"?yde(e):vde(e)}),Sde=e=>`${e==null?void 0:e.count} files`,kde=e=>`${e==null?void 0:e.count} 个文件`,Cde=e=>`${e==null?void 0:e.count} فایل`,Ede=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kde(e):t==="fa"?Cde(e):Sde(e)}),Nde=e=>`${e==null?void 0:e.count}+ files`,zde=e=>`至少 ${e==null?void 0:e.count} 个文件`,Ade=e=>`بیش از ${e==null?void 0:e.count} فایل`,jde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zde(e):t==="fa"?Ade(e):Nde(e)}),Tde=e=>`${e==null?void 0:e.count} live`,Mde=e=>`${e==null?void 0:e.count} 次进行中`,Rde=e=>`${e==null?void 0:e.count} فعال`,Dde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Mde(e):t==="fa"?Rde(e):Tde(e)}),Lde=()=>"1 file",Ode=()=>"1 个文件",Ide=()=>"۱ فایل",Bde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ode():t==="fa"?Ide():Lde()}),$de=()=>"1 run",Hde=()=>"1 次运行",Pde=()=>"۱ اجرا",Fde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hde():t==="fa"?Pde():$de()}),Ude=e=>`${e==null?void 0:e.count} runs`,qde=e=>`${e==null?void 0:e.count} 次运行`,Gde=e=>`${e==null?void 0:e.count} اجرا`,Vde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qde(e):t==="fa"?Gde(e):Ude(e)}),Wde=()=>"No instances yet.",Kde=()=>"还没有实例。",Xde=()=>"هنوز نمونه‌ای وجود ندارد.",Yde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kde():t==="fa"?Xde():Wde()}),Zde=()=>"Nothing running right now.",Qde=()=>"当前没有运行中的实例。",Jde=()=>"اکنون چیزی در حال اجرا نیست.",ehe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qde():t==="fa"?Jde():Zde()}),the=()=>"Select a project to see its history.",nhe=()=>"请选择一个项目以查看其历史记录。",rhe=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",she=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nhe():t==="fa"?rhe():the()}),ihe=()=>"Select a project to see its runs.",ahe=()=>"请选择一个项目以查看其运行。",ohe=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",lhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ahe():t==="fa"?ohe():ihe()}),che=()=>"View history",uhe=()=>"查看历史记录",fhe=()=>"مشاهدهٔ تاریخچه",dhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uhe():t==="fa"?fhe():che()}),hhe=e=>`View history (${e==null?void 0:e.count})`,_he=e=>`查看历史记录(${e==null?void 0:e.count})`,phe=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,mhe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_he(e):t==="fa"?phe(e):hhe(e)}),ghe=()=>"The engine exited without producing a PDF or a log.",bhe=()=>"引擎已退出,但没有生成 PDF 或日志。",vhe=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",xhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bhe():t==="fa"?vhe():ghe()}),yhe=()=>"Loading…",whe=()=>"正在加载…",She=()=>"در حال بارگیری…",khe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?whe():t==="fa"?She():yhe()}),Che=()=>"Copy",Ehe=()=>"复制",Nhe=()=>"کپی",p9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ehe():t==="fa"?Nhe():Che()}),zhe=()=>"Copy code",Ahe=()=>"复制代码",jhe=()=>"کپی کد",The=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ahe():t==="fa"?jhe():zhe()}),Mhe=()=>"Download",Rhe=()=>"下载",Dhe=()=>"بارگیری",m9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rhe():t==="fa"?Dhe():Mhe()}),Lhe=()=>"This browser can’t preview this media format.",Ohe=()=>"此浏览器无法预览该媒体格式。",Ihe=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Bhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ohe():t==="fa"?Ihe():Lhe()}),$he=()=>" · CLI configuration",Hhe=()=>" · CLI 配置",Phe=()=>" · پیکربندی CLI",g9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hhe():t==="fa"?Phe():$he()}),Fhe=()=>"· Default",Uhe=()=>"· 默认",qhe=()=>"· پیش‌فرض",b9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uhe():t==="fa"?qhe():Fhe()}),Ghe=()=>"Default model",Vhe=()=>"默认模型",Whe=()=>"مدل پیش‌فرض",L6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vhe():t==="fa"?Whe():Ghe()}),Khe=()=>"Detecting harnesses…",Xhe=()=>"正在检测智能体工具…",Yhe=()=>"در حال شناسایی ابزارهای عامل…",Zhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xhe():t==="fa"?Yhe():Khe()}),Qhe=()=>"Effort",Jhe=()=>"推理强度",e_e=()=>"میزان استدلال",t_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jhe():t==="fa"?e_e():Qhe()}),n_e=()=>"Fast speed ·",r_e=()=>"快速 ·",s_e=()=>"سرعت بالا ·",i_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>"Mode",o_e=()=>"模式",l_e=()=>"حالت",O6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),c_e=()=>"Model",u_e=()=>"模型",f_e=()=>"مدل",b1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u_e():t==="fa"?f_e():c_e()}),d_e=e=>`${e==null?void 0:e.count} more — search to find`,h_e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,__e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,p_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?h_e(e):t==="fa"?__e(e):d_e(e)}),m_e=()=>"Not available",g_e=()=>"不可用",b_e=()=>"در دسترس نیست",v_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g_e():t==="fa"?b_e():m_e()}),x_e=()=>"Search models…",y_e=()=>"搜索模型…",w_e=()=>"جست‌وجوی مدل‌ها…",S_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y_e():t==="fa"?w_e():x_e()}),k_e=()=>"Sessions keep their harness — new chat to switch",C_e=()=>"会话会保留其智能体工具——新建聊天即可切换",E_e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند — برای تغییر، گفتگوی جدیدی بسازید",N_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C_e():t==="fa"?E_e():k_e()}),z_e=()=>"Speed",A_e=()=>"速度",j_e=()=>"سرعت",I6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A_e():t==="fa"?j_e():z_e()}),T_e=()=>"Unavailable",M_e=()=>"不可用",R_e=()=>"در دسترس نیست",v9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M_e():t==="fa"?R_e():T_e()}),D_e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,L_e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,O_e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,I_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L_e(e):t==="fa"?O_e(e):D_e(e)}),B_e=()=>"Variant",$_e=()=>"变体",H_e=()=>"گونه",P_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$_e():t==="fa"?H_e():B_e()}),F_e=()=>"Advanced",U_e=()=>"高级",q_e=()=>"پیشرفته",G_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U_e():t==="fa"?q_e():F_e()}),V_e=()=>"Advanced · Connect GitHub",W_e=()=>"高级 · 连接 GitHub",K_e=()=>"پیشرفته · اتصال GitHub",X_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W_e():t==="fa"?K_e():V_e()}),Y_e=()=>"Advanced · GitHub sync on",Z_e=()=>"高级 · GitHub 同步已开启",Q_e=()=>"پیشرفته · همگام‌سازی GitHub روشن است",J_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z_e():t==="fa"?Q_e():Y_e()}),e0e=()=>"Choose a different destination. A paper project needs a new or empty folder of its own, outside any Git repository.",t0e=()=>"请选择其他位置。论文项目需要位于任何 Git 仓库之外,并拥有独立的新文件夹或空文件夹。",n0e=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید بیرون از هر مخزن Git، پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",r0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t0e():t==="fa"?n0e():e0e()}),s0e=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,i0e=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,a0e=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,o0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?i0e(e):t==="fa"?a0e(e):s0e(e)}),l0e=()=>"Choose an existing project folder",c0e=()=>"选择现有项目文件夹",u0e=()=>"انتخاب پوشهٔ موجود پروژه",B6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c0e():t==="fa"?u0e():l0e()}),f0e=()=>"Choosing…",d0e=()=>"正在选择…",h0e=()=>"در حال انتخاب…",_0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d0e():t==="fa"?h0e():f0e()}),p0e=()=>"Clone destination",m0e=()=>"克隆位置",g0e=()=>"مقصد کلون",b0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m0e():t==="fa"?g0e():p0e()}),v0e=()=>"Clone paper project",x0e=()=>"克隆论文项目",y0e=()=>"کلون پروژهٔ مقاله",w0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x0e():t==="fa"?y0e():v0e()}),S0e=()=>"Create project",k0e=()=>"创建项目",C0e=()=>"ایجاد پروژه",$6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),E0e=()=>"Creating…",N0e=()=>"正在创建…",z0e=()=>"در حال ایجاد…",A0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N0e():t==="fa"?z0e():E0e()}),j0e=()=>"Choose a different destination. This path is a file, not a folder.",T0e=()=>"请选择其他位置。此路径是文件,不是文件夹。",M0e=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",H6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T0e():t==="fa"?M0e():j0e()}),R0e=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",D0e=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",L0e=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",O0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D0e():t==="fa"?L0e():R0e()}),I0e=()=>"Blank project",B0e=()=>"空白项目",$0e=()=>"پروژهٔ خالی",H0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B0e():t==="fa"?$0e():I0e()}),P0e=()=>"Cancel",F0e=()=>"取消",U0e=()=>"لغو",q0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F0e():t==="fa"?U0e():P0e()}),G0e=()=>"Change",V0e=()=>"更改",W0e=()=>"تغییر",K0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V0e():t==="fa"?W0e():G0e()}),X0e=()=>"Change selected paper",Y0e=()=>"更改所选论文",Z0e=()=>"تغییر مقالهٔ انتخاب‌شده",Q0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y0e():t==="fa"?Z0e():X0e()}),J0e=()=>"Check out a Git branch before using this folder.",epe=()=>"使用此文件夹前,请先检出一个 Git 分支。",tpe=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",npe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),rpe=()=>"Checking project location.",spe=()=>"正在检查项目位置。",ipe=()=>"در حال بررسی محل پروژه.",P6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?spe():t==="fa"?ipe():rpe()}),ape=()=>"Existing folder",ope=()=>"现有文件夹",lpe=()=>"پوشهٔ موجود",cpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ope():t==="fa"?lpe():ape()}),upe=()=>"Experiment branches will be pushed to the remote GitHub repository.",fpe=()=>"实验分支将推送到远程 GitHub 仓库。",dpe=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",hpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fpe():t==="fa"?dpe():upe()}),_pe=()=>"From a paper",ppe=()=>"从论文创建",mpe=()=>"از یک مقاله",gpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ppe():t==="fa"?mpe():_pe()}),bpe=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",vpe=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",xpe=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",ype=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vpe():t==="fa"?xpe():bpe()}),wpe=()=>"my-research",Spe=()=>"my-research",kpe=()=>"my-research",F6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Spe():t==="fa"?kpe():wpe()}),Cpe=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Epe=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Npe=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",zpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Epe():t==="fa"?Npe():Cpe()}),Ape=()=>"No public repository found on alphaXiv",jpe=()=>"在 alphaXiv 上未找到公开仓库",Tpe=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",Mpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jpe():t==="fa"?Tpe():Ape()}),Rpe=()=>"OpenResearch will start a blank project with this paper's PDF.",Dpe=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",Lpe=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",Ope=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dpe():t==="fa"?Lpe():Rpe()}),Ipe=()=>"Paper",Bpe=()=>"论文",$pe=()=>"مقاله",Hpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bpe():t==="fa"?$pe():Ipe()}),Ppe=()=>"Project location",Fpe=()=>"项目位置",Upe=()=>"محل پروژه",U6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fpe():t==="fa"?Upe():Ppe()}),qpe=()=>"Project name",Gpe=()=>"项目名称",Vpe=()=>"نام پروژه",q6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gpe():t==="fa"?Vpe():qpe()}),Wpe=()=>"Search for a paper by arXiv ID, URL, or title",Kpe=()=>"按 arXiv ID、网址或标题搜索论文",Xpe=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",Ype=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kpe():t==="fa"?Xpe():Wpe()}),Zpe=()=>"Sync experiments to GitHub",Qpe=()=>"将实验同步到 GitHub",Jpe=()=>"همگام‌سازی آزمایش‌ها با GitHub",eme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qpe():t==="fa"?Jpe():Zpe()}),tme=()=>"That folder no longer exists. Choose it again.",nme=()=>"该文件夹已不存在。请重新选择。",rme=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",sme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nme():t==="fa"?rme():tme()}),ime=()=>"The selected folder contains an invalid Git repository.",ame=()=>"所选文件夹包含无效的 Git 仓库。",ome=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",lme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ame():t==="fa"?ome():ime()}),cme=()=>"The selected path is not a folder.",ume=()=>"所选路径不是文件夹。",fme=()=>"مسیر انتخاب‌شده پوشه نیست.",dme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ume():t==="fa"?fme():cme()}),hme=e=>`Checking ${e==null?void 0:e.repository}.`,_me=e=>`正在检查 ${e==null?void 0:e.repository}。`,pme=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,mme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_me(e):t==="fa"?pme(e):hme(e)}),gme=e=>`Creates ${e==null?void 0:e.repository}.`,bme=e=>`将创建 ${e==null?void 0:e.repository}。`,vme=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,xme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bme(e):t==="fa"?vme(e):gme(e)}),yme=e=>`Pushes to ${e==null?void 0:e.repository}.`,wme=e=>`将推送到 ${e==null?void 0:e.repository}。`,Sme=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,kme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wme(e):t==="fa"?Sme(e):yme(e)}),Cme=()=>"Project location is required.",Eme=()=>"必须填写项目位置。",Nme=()=>"محل پروژه الزامی است.",G6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eme():t==="fa"?Nme():Cme()}),zme=()=>"Choose a different destination. The paper repository needs a new or empty folder.",Ame=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",jme=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",Tme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ame():t==="fa"?jme():zme()}),Mme=()=>"A linked public code repository is cloned without credentials.",Rme=()=>"关联的公开代码仓库无需凭据即可克隆。",Dme=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",Lme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rme():t==="fa"?Dme():Mme()}),Ome=e=>`Run ${e==null?void 0:e.command} before creating the project.`,Ime=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,Bme=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,$me=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ime(e):t==="fa"?Bme(e):Ome(e)}),Hme=()=>"Searching alphaXiv…",Pme=()=>"正在搜索 alphaXiv…",Fme=()=>"در حال جست‌وجوی alphaXiv…",Ume=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pme():t==="fa"?Fme():Hme()}),qme=()=>"Use folder",Gme=()=>"使用文件夹",Vme=()=>"استفاده از پوشه",Wme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gme():t==="fa"?Vme():qme()}),Kme=()=>"A workspace for your research agents",Xme=()=>"面向研究智能体的工作空间",Yme=()=>"فضای کاری برای عامل‌های پژوهشی شما",Zme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xme():t==="fa"?Yme():Kme()}),Qme=()=>"Add papers that represent your research interests, including papers by other authors.",Jme=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",ege=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",tge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jme():t==="fa"?ege():Qme()}),nge=()=>"API key",rge=()=>"API 密钥",sge=()=>"کلید API",x9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rge():t==="fa"?sge():nge()}),ige=()=>"AI/ML",age=()=>"人工智能与机器学习",oge=()=>"هوش مصنوعی و یادگیری ماشین",lge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"Biology",uge=()=>"生物学",fge=()=>"زیست‌شناسی",dge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uge():t==="fa"?fge():cge()}),hge=()=>"Other",_ge=()=>"其他",pge=()=>"سایر",mge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Physics",bge=()=>"物理学",vge=()=>"فیزیک",xge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bge():t==="fa"?vge():gge()}),yge=()=>"Back",wge=()=>"返回",Sge=()=>"بازگشت",V6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wge():t==="fa"?Sge():yge()}),kge=()=>"Check failed",Cge=()=>"检查失败",Ege=()=>"بررسی ناموفق بود",Nge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cge():t==="fa"?Ege():kge()}),zge=()=>"Checking",Age=()=>"正在检查",jge=()=>"در حال بررسی",Tge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Age():t==="fa"?jge():zge()}),Mge=()=>"Checking Git…",Rge=()=>"正在检查 Git…",Dge=()=>"در حال بررسی Git…",Lge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rge():t==="fa"?Dge():Mge()}),Oge=()=>"Choose a coding agent",Ige=()=>"选择编程智能体",Bge=()=>"یک عامل کدنویسی انتخاب کنید",$ge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ige():t==="fa"?Bge():Oge()}),Hge=()=>"Choose a coding agent to continue.",Pge=()=>"选择一个编程智能体以继续。",Fge=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",Uge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pge():t==="fa"?Fge():Hge()}),qge=()=>"Choose at least one research area to continue.",Gge=()=>"请至少选择一个研究领域后再继续。",Vge=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",Wge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gge():t==="fa"?Vge():qge()}),Kge=()=>"Choose one or more.",Xge=()=>"请选择一项或多项。",Yge=()=>"یک یا چند مورد را انتخاب کنید.",Zge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xge():t==="fa"?Yge():Kge()}),Qge=()=>"Choose your preferred coding agent",Jge=()=>"请选择首选编程智能体",e1e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",t1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jge():t==="fa"?e1e():Qge()}),n1e=()=>"Consolidate your research",r1e=()=>"集中管理研究",s1e=()=>"پژوهش خود را یکپارچه کنید",i1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r1e():t==="fa"?s1e():n1e()}),a1e=()=>"Continue",o1e=()=>"继续",l1e=()=>"ادامه",W6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),c1e=()=>"Describe your research area to continue.",u1e=()=>"请描述你的研究领域后再继续。",f1e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",d1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u1e():t==="fa"?f1e():c1e()}),h1e=()=>"Detecting Claude Code, Codex, OpenCode…",_1e=()=>"正在检测 Claude Code、Codex、OpenCode…",p1e=()=>"در حال شناسایی Claude Code، Codex و OpenCode…",m1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_1e():t==="fa"?p1e():h1e()}),g1e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",b1e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",v1e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",x1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b1e():t==="fa"?v1e():g1e()}),y1e=()=>"Everything stays local",w1e=()=>"一切都保留在本地",S1e=()=>"همه‌چیز محلی می‌ماند",k1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w1e():t==="fa"?S1e():y1e()}),C1e=()=>"Get started",E1e=()=>"开始使用",N1e=()=>"شروع",z1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E1e():t==="fa"?N1e():C1e()}),A1e=()=>"Git is required for local experiments. Install Git, then re-check.",j1e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",T1e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",M1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j1e():t==="fa"?T1e():A1e()}),R1e=()=>"Ground your agents",D1e=()=>"为智能体提供可靠依据",L1e=()=>"عامل‌هایتان را به منابع متصل کنید",O1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D1e():t==="fa"?L1e():R1e()}),I1e=()=>"Install broken",B1e=()=>"安装损坏",$1e=()=>"نصب خراب است",H1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B1e():t==="fa"?$1e():I1e()}),P1e=()=>"Install Git to continue",F1e=()=>"请安装 Git 后再继续",U1e=()=>"برای ادامه Git را نصب کنید",q1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F1e():t==="fa"?U1e():P1e()}),G1e=()=>"Local Git",V1e=()=>"本地 Git",W1e=()=>"Git محلی",K1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V1e():t==="fa"?W1e():G1e()}),X1e=()=>"Not detected",Y1e=()=>"未检测到",Z1e=()=>"شناسایی نشد",K6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y1e():t==="fa"?Z1e():X1e()}),Q1e=()=>"Not found",J1e=()=>"未找到",ebe=()=>"پیدا نشد",y9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J1e():t==="fa"?ebe():Q1e()}),tbe=()=>"Not signed in",nbe=()=>"未登录",rbe=()=>"وارد نشده",sbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nbe():t==="fa"?rbe():tbe()}),ibe=()=>"OpenResearch uses a coding agent already installed on this machine.",abe=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",obe=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",lbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?abe():t==="fa"?obe():ibe()}),cbe=()=>"Other research area",ube=()=>"其他研究领域",fbe=()=>"حوزهٔ پژوهشی دیگر",dbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ube():t==="fa"?fbe():cbe()}),hbe=()=>"Re-check",_be=()=>"重新检查",pbe=()=>"بررسی دوباره",mbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_be():t==="fa"?pbe():hbe()}),gbe=()=>"Ready",bbe=()=>"已就绪",vbe=()=>"آماده",xbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bbe():t==="fa"?vbe():gbe()}),ybe=()=>"Re-check Git before continuing",wbe=()=>"请重新检查 Git 后再继续",Sbe=()=>"پیش از ادامه Git را دوباره بررسی کنید",kbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wbe():t==="fa"?Sbe():ybe()}),Cbe=()=>"Representative papers",Ebe=()=>"代表性论文",Nbe=()=>"مقاله‌های شاخص",zbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),Abe=()=>"Research background",jbe=()=>"研究背景",Tbe=()=>"پیشینهٔ پژوهشی",Mbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jbe():t==="fa"?Tbe():Abe()}),Rbe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",Dbe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",Lbe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",X6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Rbe()}),Obe=()=>"Search alphaXiv by title to link a paper…",Ibe=()=>"按标题搜索 alphaXiv 以关联论文…",Bbe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",$be=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ibe():t==="fa"?Bbe():Obe()}),Hbe=()=>"Searching alphaXiv…",Pbe=()=>"正在搜索 alphaXiv…",Fbe=()=>"در حال جست‌وجوی alphaXiv…",Ube=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pbe():t==="fa"?Fbe():Hbe()}),qbe=()=>"Selected",Gbe=()=>"已选择",Vbe=()=>"انتخاب‌شده",Wbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gbe():t==="fa"?Vbe():qbe()}),Kbe=()=>"Setting things up…",Xbe=()=>"正在设置…",Ybe=()=>"در حال راه‌اندازی…",Zbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xbe():t==="fa"?Ybe():Kbe()}),Qbe=()=>"Sign in to at least one coding agent to continue",Jbe=()=>"请至少登录一个编程智能体后再继续",eve=()=>"برای ادامه، وارد دست‌کم یک عامل برنامه‌نویسی شوید",tve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jbe():t==="fa"?eve():Qbe()}),nve=()=>"Sign in to at least one agent to continue.",rve=()=>"请登录至少一个智能体以继续。",sve=()=>"برای ادامه دست‌کم به یک عامل وارد شوید.",ive=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rve():t==="fa"?sve():nve()}),ave=()=>"Signed in",ove=()=>"已登录",lve=()=>"وارد شده",cve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ove():t==="fa"?lve():ave()}),uve=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",fve=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",dve=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",hve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fve():t==="fa"?dve():uve()}),_ve=()=>"· Step 1 of 2",pve=()=>"· 第 1 步,共 2 步",mve=()=>"· مرحلهٔ ۱ از ۲",gve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pve():t==="fa"?mve():_ve()}),bve=()=>"· Step 2 of 2",vve=()=>"· 第 2 步,共 2 步",xve=()=>"· مرحلهٔ ۲ از ۲",yve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vve():t==="fa"?xve():bve()}),wve=()=>"Tell us about your research",Sve=()=>"介绍一下你的研究",kve=()=>"از پژوهش خود بگویید",Cve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sve():t==="fa"?kve():wve()}),Eve=()=>"Tell us your other research area",Nve=()=>"告诉我们你的其他研究领域",zve=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",Ave=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nve():t==="fa"?zve():Eve()}),jve=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",Tve=()=>"在一处跟踪实验、产物、算力、技能和代码。",Mve=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",Rve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tve():t==="fa"?Mve():jve()}),Dve=()=>"Unable to verify",Lve=()=>"无法验证",Ove=()=>"تأیید ممکن نیست",Ive=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lve():t==="fa"?Ove():Dve()}),Bve=()=>"Update required",$ve=()=>"需要更新",Hve=()=>"نیازمند به‌روزرسانی",Pve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ve():t==="fa"?Hve():Bve()}),Fve=()=>"Waiting for the Git check",Uve=()=>"正在等待 Git 检查",qve=()=>"در انتظار بررسی Git",Gve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uve():t==="fa"?qve():Fve()}),Vve=()=>"Waiting for the local tool checks",Wve=()=>"正在等待本地工具检查",Kve=()=>"در انتظار بررسی ابزارهای محلی",Xve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wve():t==="fa"?Kve():Vve()}),Yve=()=>"What areas are you interested in?",Zve=()=>"你对哪些领域感兴趣?",Qve=()=>"به چه حوزه‌هایی علاقه دارید؟",Jve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zve():t==="fa"?Qve():Yve()}),e2e=()=>"Your code, data, and experiment history stay on your machine.",t2e=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",n2e=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",r2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t2e():t==="fa"?n2e():e2e()}),s2e=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",i2e=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",a2e=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",o2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i2e():t==="fa"?a2e():s2e()}),l2e=()=>"Changed here and on Overleaf — choose which copy to keep",c2e=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",u2e=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",f2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c2e():t==="fa"?u2e():l2e()}),d2e=()=>"Create a token ↗",h2e=()=>"创建令牌 ↗",_2e=()=>"ساخت توکن ↗",p2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h2e():t==="fa"?_2e():d2e()}),m2e=()=>"Overleaf Git token",g2e=()=>"Overleaf Git 令牌",b2e=()=>"توکن Git در Overleaf",v2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g2e():t==="fa"?b2e():m2e()}),x2e=()=>"In step with Overleaf",y2e=()=>"已与 Overleaf 同步",w2e=()=>"با Overleaf همگام است",w9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y2e():t==="fa"?w2e():x2e()}),S2e=()=>"The last sync did not finish.",k2e=()=>"上次同步未完成。",C2e=()=>"آخرین همگام‌سازی کامل نشد.",E2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"Link and sync",z2e=()=>"关联并同步",A2e=()=>"پیوند و همگام‌سازی",j2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z2e():t==="fa"?A2e():N2e()}),T2e=()=>"My projects ↗",M2e=()=>"我的项目 ↗",R2e=()=>"پروژه‌های من ↗",D2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M2e():t==="fa"?R2e():T2e()}),L2e=()=>"Nothing could be synced.",O2e=()=>"没有内容可以同步。",I2e=()=>"هیچ موردی قابل همگام‌سازی نبود.",B2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O2e():t==="fa"?I2e():L2e()}),$2e=()=>"Cancel",H2e=()=>"取消",P2e=()=>"لغو",F2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H2e():t==="fa"?P2e():$2e()}),U2e=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",q2e=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",G2e=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",V2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q2e():t==="fa"?G2e():U2e()}),W2e=()=>"Keep this copy",K2e=()=>"保留此副本",X2e=()=>"نگه داشتن این نسخه",Y2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K2e():t==="fa"?X2e():W2e()}),Z2e=()=>"Open in Overleaf",Q2e=()=>"在 Overleaf 中打开",J2e=()=>"باز کردن در Overleaf",exe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q2e():t==="fa"?J2e():Z2e()}),txe=()=>"Replace the Overleaf token",nxe=()=>"替换 Overleaf 令牌",rxe=()=>"جایگزینی توکن Overleaf",Y6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nxe():t==="fa"?rxe():txe()}),sxe=()=>"Sync now",ixe=()=>"立即同步",axe=()=>"همگام‌سازی اکنون",oxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ixe():t==="fa"?axe():sxe()}),lxe=()=>"Unlink",cxe=()=>"取消关联",uxe=()=>"قطع پیوند",fxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cxe():t==="fa"?uxe():lxe()}),dxe=()=>"Upload a copy as a new project ↗",hxe=()=>"上传副本作为新项目 ↗",_xe=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",pxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hxe():t==="fa"?_xe():dxe()}),mxe=()=>"Use Overleaf's",gxe=()=>"使用 Overleaf 的副本",bxe=()=>"استفاده از نسخهٔ Overleaf",vxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gxe():t==="fa"?bxe():mxe()}),xxe=()=>"This paper stays in step with Overleaf.",yxe=()=>"此论文将与 Overleaf 保持同步。",wxe=()=>"این مقاله با Overleaf همگام می‌ماند.",Sxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yxe():t==="fa"?wxe():xxe()}),kxe=e=>`Pulled ${e==null?void 0:e.paths}.`,Cxe=e=>`已拉取 ${e==null?void 0:e.paths}。`,Exe=e=>`${e==null?void 0:e.paths} دریافت شد.`,Nxe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Cxe(e):t==="fa"?Exe(e):kxe(e)}),zxe=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Axe=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,jxe=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Txe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Axe(e):t==="fa"?jxe(e):zxe(e)}),Mxe=e=>`Pushed ${e==null?void 0:e.paths}.`,Rxe=e=>`已推送 ${e==null?void 0:e.paths}。`,Dxe=e=>`${e==null?void 0:e.paths} ارسال شد.`,Lxe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rxe(e):t==="fa"?Dxe(e):Mxe(e)}),Oxe=()=>"Save the file first",Ixe=()=>"请先保存文件",Bxe=()=>"ابتدا فایل را ذخیره کنید",$xe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ixe():t==="fa"?Bxe():Oxe()}),Hxe=()=>"Save this file to sync it with Overleaf",Pxe=()=>"保存此文件以与 Overleaf 同步",Fxe=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",S9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pxe():t==="fa"?Fxe():Hxe()}),Uxe=()=>"Save token",qxe=()=>"保存令牌",Gxe=()=>"ذخیرهٔ توکن",Vxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qxe():t==="fa"?Gxe():Uxe()}),Wxe=()=>"Send this paper to Overleaf",Kxe=()=>"将此论文发送到 Overleaf",Xxe=()=>"ارسال مقاله به Overleaf",Yxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kxe():t==="fa"?Xxe():Wxe()}),Zxe=()=>"Overleaf sync failed",Qxe=()=>"Overleaf 同步失败",Jxe=()=>"همگام‌سازی با Overleaf ناموفق بود",eye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qxe():t==="fa"?Jxe():Zxe()}),tye=()=>"Syncing with Overleaf…",nye=()=>"正在与 Overleaf 同步…",rye=()=>"در حال همگام‌سازی با Overleaf…",sye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nye():t==="fa"?rye():tye()}),iye=()=>"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.",aye=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",oye=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",lye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"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.",uye=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",fye=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",dye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uye():t==="fa"?fye():cye()}),hye=()=>"Toggle Plan mode for this chat",_ye=()=>"切换此聊天的计划模式",pye=()=>"تغییر حالت طرح این گفت‌وگو",mye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"Accept and auto mode",bye=()=>"接受并使用自动模式",vye=()=>"پذیرش و حالت خودکار",xye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bye():t==="fa"?vye():gye()}),yye=()=>"Accept and bypass all",wye=()=>"接受并跳过所有审批",Sye=()=>"پذیرش و عبور از همهٔ تأییدها",kye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wye():t==="fa"?Sye():yye()}),Cye=()=>"Accept plan",Eye=()=>"接受计划",Nye=()=>"پذیرش طرح",zye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eye():t==="fa"?Nye():Cye()}),Aye=e=>`${e==null?void 0:e.agent} proposed a plan`,jye=e=>`${e==null?void 0:e.agent} 提出了一个计划`,Tye=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,Mye=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jye(e):t==="fa"?Tye(e):Aye(e)}),Rye=e=>`${e==null?void 0:e.agent} is ready to proceed`,Dye=e=>`${e==null?void 0:e.agent} 已准备好继续`,Lye=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,Oye=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dye(e):t==="fa"?Lye(e):Rye(e)}),Iye=()=>"Back",Bye=()=>"返回",$ye=()=>"بازگشت",Hye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bye():t==="fa"?$ye():Iye()}),Pye=()=>"More approval options",Fye=()=>"更多批准选项",Uye=()=>"گزینه‌های تأیید بیشتر",qye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fye():t==="fa"?Uye():Pye()}),Gye=()=>"Open plan",Vye=()=>"打开计划",Wye=()=>"باز کردن طرح",Kye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vye():t==="fa"?Wye():Gye()}),Xye=()=>"Reject",Yye=()=>"拒绝",Zye=()=>"رد کردن",Qye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yye():t==="fa"?Zye():Xye()}),Jye=()=>"Revise",e4e=()=>"修改",t4e=()=>"بازنگری",n4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e4e():t==="fa"?t4e():Jye()}),r4e=()=>"Revise…",s4e=()=>"修改…",i4e=()=>"بازنگری…",a4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"What should change? (optional)",l4e=()=>"需要更改什么?(可选)",c4e=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",u4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),f4e=e=>`${e==null?void 0:e.count} active`,d4e=e=>`${e==null?void 0:e.count} 个活跃`,h4e=e=>`${e==null?void 0:e.count} فعال`,_4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?d4e(e):t==="fa"?h4e(e):f4e(e)}),p4e=e=>`${e==null?void 0:e.count} total agents`,m4e=e=>`共 ${e==null?void 0:e.count} 个智能体`,g4e=e=>`در مجموع ${e==null?void 0:e.count} عامل`,b4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m4e(e):t==="fa"?g4e(e):p4e(e)}),v4e=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,x4e=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,y4e=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,w4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?x4e(e):t==="fa"?y4e(e):v4e(e)}),S4e=()=>"Agents",k4e=()=>"智能体",C4e=()=>"عامل‌ها",Z6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k4e():t==="fa"?C4e():S4e()}),E4e=()=>"arXiv paper ID:",N4e=()=>"arXiv 论文 ID:",z4e=()=>"شناسهٔ مقالهٔ arXiv:",A4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N4e():t==="fa"?z4e():E4e()}),j4e=()=>"Cancel",T4e=()=>"取消",M4e=()=>"لغو",R4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T4e():t==="fa"?M4e():j4e()}),D4e=()=>"Created",L4e=()=>"创建时间",O4e=()=>"ایجادشده",I4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?L4e():t==="fa"?O4e():D4e()}),B4e=()=>"Delete project?",$4e=()=>"删除项目?",H4e=()=>"پروژه حذف شود؟",P4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$4e():t==="fa"?H4e():B4e()}),F4e=()=>"Delete project",U4e=()=>"删除项目",q4e=()=>"حذف پروژه",G4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U4e():t==="fa"?q4e():F4e()}),V4e=()=>"Deleting…",W4e=()=>"正在删除…",K4e=()=>"در حال حذف…",X4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W4e():t==="fa"?K4e():V4e()}),Y4e=()=>"Experiments",Z4e=()=>"实验",Q4e=()=>"آزمایش‌ها",Q6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z4e():t==="fa"?Q4e():Y4e()}),J4e=()=>"The local folder and linked GitHub repository are kept.",e5e=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",t5e=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",n5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e5e():t==="fa"?t5e():J4e()}),r5e=()=>"The local folder is kept.",s5e=()=>"本地文件夹会保留。",i5e=()=>"پوشهٔ محلی نگه داشته می‌شود.",a5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s5e():t==="fa"?i5e():r5e()}),o5e=()=>"New project",l5e=()=>"新建项目",c5e=()=>"پروژهٔ جدید",k9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l5e():t==="fa"?c5e():o5e()}),u5e=()=>"No projects yet — create one to get started.",f5e=()=>"尚无项目——新建一个即可开始。",d5e=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",h5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f5e():t==="fa"?d5e():u5e()}),_5e=()=>"Project",p5e=()=>"项目",m5e=()=>"پروژه",g5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p5e():t==="fa"?m5e():_5e()}),b5e=()=>"Projects",v5e=()=>"项目",x5e=()=>"پروژه‌ها",y5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v5e():t==="fa"?x5e():b5e()}),w5e=()=>"Repository",S5e=()=>"仓库",k5e=()=>"مخزن",J6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S5e():t==="fa"?k5e():w5e()}),C5e=()=>"Idle",E5e=()=>"空闲",N5e=()=>"بیکار",z5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E5e():t==="fa"?N5e():C5e()}),A5e=()=>"Local",j5e=()=>"本地",T5e=()=>"محلی",M5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j5e():t==="fa"?T5e():A5e()}),R5e=()=>"1 total agent",D5e=()=>"共 1 个智能体",L5e=()=>"در مجموع ۱ عامل",O5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D5e():t==="fa"?L5e():R5e()}),I5e=e=>`${e==null?void 0:e.count} running`,B5e=e=>`${e==null?void 0:e.count} 个运行中`,$5e=e=>`${e==null?void 0:e.count} در حال اجرا`,H5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B5e(e):t==="fa"?$5e(e):I5e(e)}),P5e=e=>`${e==null?void 0:e.count} total`,F5e=e=>`共 ${e==null?void 0:e.count} 个`,U5e=e=>`در مجموع ${e==null?void 0:e.count}`,e7=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?F5e(e):t==="fa"?U5e(e):P5e(e)}),q5e=e=>`${e==null?void 0:e.value}d`,G5e=e=>`${e==null?void 0:e.value} 天`,V5e=e=>`${e==null?void 0:e.value}ر`,W5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?G5e(e):t==="fa"?V5e(e):q5e(e)}),K5e=e=>`${e==null?void 0:e.value}h`,X5e=e=>`${e==null?void 0:e.value} 小时`,Y5e=e=>`${e==null?void 0:e.value}س`,Z5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?X5e(e):t==="fa"?Y5e(e):K5e(e)}),Q5e=e=>`${e==null?void 0:e.value}m`,J5e=e=>`${e==null?void 0:e.value} 分钟`,e3e=e=>`${e==null?void 0:e.value}د`,t3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?J5e(e):t==="fa"?e3e(e):Q5e(e)}),n3e=()=>"now",r3e=()=>"现在",s3e=()=>"اکنون",i3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r3e():t==="fa"?s3e():n3e()}),a3e=()=>"Disable syncing",o3e=()=>"关闭同步",l3e=()=>"غیرفعال کردن همگام‌سازی",c3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o3e():t==="fa"?l3e():a3e()}),u3e=()=>"Enable GitHub syncing",f3e=()=>"启用 GitHub 同步",d3e=()=>"فعال‌سازی همگام‌سازی GitHub",h3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f3e():t==="fa"?d3e():u3e()}),_3e=()=>"Enabling…",p3e=()=>"正在启用…",m3e=()=>"در حال فعال‌سازی…",g3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p3e():t==="fa"?m3e():_3e()}),b3e=()=>"Updating…",v3e=()=>"正在更新…",x3e=()=>"در حال به‌روزرسانی…",y3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v3e():t==="fa"?x3e():b3e()}),w3e=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,S3e=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,k3e=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,C3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?S3e(e):t==="fa"?k3e(e):w3e(e)}),E3e=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,N3e=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,z3e=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,A3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?N3e(e):t==="fa"?z3e(e):E3e(e)}),j3e=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`,T3e=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,M3e=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,R3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?T3e(e):t==="fa"?M3e(e):j3e(e)}),D3e=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,L3e=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,O3e=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,I3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L3e(e):t==="fa"?O3e(e):D3e(e)}),B3e=()=>"CLI is retrying…",$3e=()=>"CLI 正在重试…",H3e=()=>"CLI در حال تلاش دوباره است…",P3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$3e():t==="fa"?H3e():B3e()}),F3e=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,U3e=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,q3e=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,G3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U3e(e):t==="fa"?q3e(e):F3e(e)}),V3e=()=>"Sending again…",W3e=()=>"正在重新发送…",K3e=()=>"در حال ارسال دوباره…",X3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W3e():t==="fa"?K3e():V3e()}),Y3e=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,Z3e=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,Q3e=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,J3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Z3e(e):t==="fa"?Q3e(e):Y3e(e)}),ewe=()=>"Retrying…",twe=()=>"正在重试…",nwe=()=>"در حال تلاش دوباره…",C9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?twe():t==="fa"?nwe():ewe()}),rwe=()=>"Default speed",swe=()=>"默认速度",iwe=()=>"سرعت پیش‌فرض",awe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Standard",lwe=()=>"标准",cwe=()=>"استاندارد",uwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),fwe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,dwe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,hwe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,_we=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dwe(e):t==="fa"?hwe(e):fwe(e)}),pwe=()=>"How the interface looks on this device.",mwe=()=>"设置此设备上的界面外观。",gwe=()=>"ظاهر رابط کاربری را در این دستگاه تنظیم کنید.",bwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),vwe=()=>"Appearance",xwe=()=>"外观",ywe=()=>"ظاهر",wwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xwe():t==="fa"?ywe():vwe()}),Swe=()=>"Check",kwe=()=>"检查",Cwe=()=>"بررسی",Ewe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"Check again",zwe=()=>"再次检查",Awe=()=>"بررسی دوباره",jwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zwe():t==="fa"?Awe():Nwe()}),Twe=()=>"Check for updates",Mwe=()=>"检查更新",Rwe=()=>"بررسی به‌روزرسانی",Dwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mwe():t==="fa"?Rwe():Twe()}),Lwe=()=>"Check now",Owe=()=>"立即检查",Iwe=()=>"اکنون بررسی کن",Bwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Owe():t==="fa"?Iwe():Lwe()}),$we=()=>"Check setup",Hwe=()=>"检查设置",Pwe=()=>"بررسی راه‌اندازی",Fwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hwe():t==="fa"?Pwe():$we()}),Uwe=()=>"orx checks a few times a day on its own.",qwe=()=>"orx 每天会自动检查几次。",Gwe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",Vwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qwe():t==="fa"?Gwe():Uwe()}),Wwe=()=>"Choose a flavor",Kwe=()=>"选择配置",Xwe=()=>"انتخاب پیکربندی",Ywe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kwe():t==="fa"?Xwe():Wwe()}),Zwe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,Qwe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,Jwe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Qwe(e):t==="fa"?Jwe(e):Zwe(e)}),t6e=()=>"clean",n6e=()=>"无更改",r6e=()=>"بدون تغییر",s6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),i6e=e=>`Already linked at ${e==null?void 0:e.link}.`,a6e=e=>`已链接到 ${e==null?void 0:e.link}。`,o6e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?a6e(e):t==="fa"?o6e(e):i6e(e)}),c6e=e=>`Linked ${e==null?void 0:e.link}.`,u6e=e=>`已链接 ${e==null?void 0:e.link}。`,f6e=e=>`${e==null?void 0:e.link} پیوند شد.`,d6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?u6e(e):t==="fa"?f6e(e):c6e(e)}),h6e=()=>"Connect",_6e=()=>"连接",p6e=()=>"اتصال",m6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_6e():t==="fa"?p6e():h6e()}),g6e=()=>"Connected via GitHub CLI",b6e=()=>"已通过 GitHub CLI 连接",v6e=()=>"از طریق GitHub CLI متصل است",E9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b6e():t==="fa"?v6e():g6e()}),x6e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",y6e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",w6e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",S6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y6e():t==="fa"?w6e():x6e()}),k6e=()=>"the current project",C6e=()=>"当前项目",E6e=()=>"پروژهٔ فعلی",N6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C6e():t==="fa"?E6e():k6e()}),z6e=e=>`${e==null?void 0:e.value} (custom)`,A6e=e=>`${e==null?void 0:e.value}(自定义)`,j6e=e=>`${e==null?void 0:e.value} (سفارشی)`,T6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?A6e(e):t==="fa"?j6e(e):z6e(e)}),M6e=e=>`The data directory is pinned by the ${e==null?void 0:e.variable} environment variable, which overrides this setting. Unset it to choose a location here.`,R6e=e=>`数据目录由环境变量 ${e==null?void 0:e.variable} 固定,该变量会覆盖此设置。取消设置后即可在此选择位置。`,D6e=e=>`پوشهٔ داده توسط متغیر محیطی ${e==null?void 0:e.variable} ثابت شده است و این تنظیم را بازنویسی می‌کند. برای انتخاب محل در اینجا، آن متغیر را unset کنید.`,L6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?R6e(e):t==="fa"?D6e(e):M6e(e)}),O6e=()=>"detached",I6e=()=>"分离头指针",B6e=()=>"جدا از شاخه",N9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Environment broken",H6e=()=>"环境损坏",P6e=()=>"محیط خراب است",F6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H6e():t==="fa"?P6e():$6e()}),U6e=()=>"Environment not built",q6e=()=>"环境尚未构建",G6e=()=>"محیط ساخته نشده است",V6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q6e():t==="fa"?G6e():U6e()}),W6e=e=>`Stored in ${e==null?void 0:e.path} and passed to runs and the research agent. ${e==null?void 0:e.tinker}, ${e==null?void 0:e.hf}, and ${e==null?void 0:e.wandb} are always listed because runs typically need them. Variables in orx’s own environment win on conflicts.`,K6e=e=>`变量存储在 ${e==null?void 0:e.path} 中,并传递给运行和研究智能体。${e==null?void 0:e.tinker}、${e==null?void 0:e.hf} 和 ${e==null?void 0:e.wandb} 始终列出,因为运行通常需要它们。发生冲突时,orx 自身环境中的变量优先。`,X6e=e=>`متغیرها در ${e==null?void 0:e.path} ذخیره و در اختیار اجراها و عامل پژوهشی قرار می‌گیرند. ${e==null?void 0:e.tinker}، ${e==null?void 0:e.hf} و ${e==null?void 0:e.wandb} همیشه فهرست می‌شوند، چون اجراها معمولاً به آن‌ها نیاز دارند. هنگام تداخل، متغیرهای محیط خود orx اولویت دارند.`,Y6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?K6e(e):t==="fa"?X6e(e):W6e(e)}),Z6e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q6e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,J6e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,e7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Q6e(e):t==="fa"?J6e(e):Z6e(e)}),t7e=()=>"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.",n7e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",r7e=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",s7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n7e():t==="fa"?r7e():t7e()}),i7e=()=>"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.",a7e=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",o7e=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",l7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a7e():t==="fa"?o7e():i7e()}),c7e=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",u7e=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",f7e=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",d7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u7e():t==="fa"?f7e():c7e()}),h7e=()=>"has changes",_7e=()=>"有更改",p7e=()=>"دارای تغییر",m7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_7e():t==="fa"?p7e():h7e()}),g7e=()=>"~/.cache/huggingface/token (hf auth login)",b7e=()=>"~/.cache/huggingface/token(hf auth login)",v7e=()=>"~/.cache/huggingface/token (hf auth login)",x7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b7e():t==="fa"?v7e():g7e()}),y7e=()=>"HF_TOKEN environment variable",w7e=()=>"HF_TOKEN 环境变量",S7e=()=>"متغیر محیطی HF_TOKEN",k7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w7e():t==="fa"?S7e():y7e()}),C7e=()=>"~/.openresearch/env",E7e=()=>"~/.openresearch/env",N7e=()=>"~/.openresearch/env",z7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E7e():t==="fa"?N7e():C7e()}),A7e=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}.`,j7e=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,T7e=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,M7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?j7e(e):t==="fa"?T7e(e):A7e(e)}),R7e=()=>"Install",D7e=()=>"安装",L7e=()=>"نصب",O7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D7e():t==="fa"?L7e():R7e()}),I7e=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.`,B7e=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,$7e=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,H7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B7e(e):t==="fa"?$7e(e):I7e(e)}),P7e=e=>`Install the ${e==null?void 0:e.command} command`,F7e=e=>`安装 ${e==null?void 0:e.command} 命令`,U7e=e=>`نصب فرمان ${e==null?void 0:e.command}`,q7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?F7e(e):t==="fa"?U7e(e):P7e(e)}),G7e=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",V7e=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",W7e=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",K7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V7e():t==="fa"?W7e():G7e()}),X7e=()=>"Install the new release now instead of waiting for the background update.",Y7e=()=>"立即安装新版本,无需等待后台更新。",Z7e=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",Q7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y7e():t==="fa"?Z7e():X7e()}),J7e=()=>"kubectl default",eSe=()=>"kubectl 默认值",tSe=()=>"پیش‌فرض kubectl",nSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eSe():t==="fa"?tSe():J7e()}),rSe=e=>`kubectl default (${e==null?void 0:e.context})`,sSe=e=>`kubectl 默认值(${e==null?void 0:e.context})`,iSe=e=>`پیش‌فرض kubectl (${e==null?void 0:e.context})`,aSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sSe(e):t==="fa"?iSe(e):rSe(e)}),oSe=()=>"Choose the language for the interface on this device.",lSe=()=>"选择此设备上的界面语言。",cSe=()=>"زبان رابط کاربری را در این دستگاه انتخاب کنید.",uSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),fSe=()=>"Language",dSe=()=>"语言",hSe=()=>"زبان",_Se=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dSe():t==="fa"?hSe():fSe()}),pSe=e=>`Not signed in. Run ${e==null?void 0:e.command} in a terminal to connect your OpenResearch account.`,mSe=e=>`尚未登录。请在终端中运行 ${e==null?void 0:e.command} 以连接你的 OpenResearch 账户。`,gSe=e=>`وارد نشده‌اید. برای اتصال حساب OpenResearch خود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,bSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mSe(e):t==="fa"?gSe(e):pSe(e)}),vSe=()=>"Make default",xSe=()=>"设为默认值",ySe=()=>"پیش‌فرض شود",wSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xSe():t==="fa"?ySe():vSe()}),SSe=e=>`The manifest must define one Job. orx injects the run script, environment, labels, and timeout. Use ${e==null?void 0:e.placeholder} in resource names, or override the default path with ${e==null?void 0:e.command}.`,kSe=e=>`清单必须定义一个 Job。orx 会注入运行脚本、环境、标签和超时设置。请在资源名称中使用 ${e==null?void 0:e.placeholder},或通过 ${e==null?void 0:e.command} 覆盖默认路径。`,CSe=e=>`مانیفست باید یک Job تعریف کند. orx اسکریپت اجرا، محیط، برچسب‌ها و مهلت زمانی را تزریق می‌کند. از ${e==null?void 0:e.placeholder} در نام منابع استفاده کنید، یا مسیر پیش‌فرض را با ${e==null?void 0:e.command} تغییر دهید.`,ESe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kSe(e):t==="fa"?CSe(e):SSe(e)}),NSe=()=>"Provisioned (Modal import failing)",zSe=()=>"已预配(Modal 导入失败)",ASe=()=>"آماده شده (درون‌ریزی Modal ناموفق است)",jSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zSe():t==="fa"?ASe():NSe()}),TSe=()=>"MODAL_TOKEN_ID environment variable",MSe=()=>"MODAL_TOKEN_ID 环境变量",RSe=()=>"متغیر محیطی MODAL_TOKEN_ID",DSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MSe():t==="fa"?RSe():TSe()}),LSe=()=>"~/.modal.toml (modal token new)",OSe=()=>"~/.modal.toml(modal token new)",ISe=()=>"~/.modal.toml (modal token new)",BSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OSe():t==="fa"?ISe():LSe()}),$Se=e=>`No Modal token found. Run ${e==null?void 0:e.command}, or add ${e==null?void 0:e.id} and ${e==null?void 0:e.secret} in the Environment tab.`,HSe=e=>`未找到 Modal 令牌。请运行 ${e==null?void 0:e.command},或在“环境”标签页中添加 ${e==null?void 0:e.id} 和 ${e==null?void 0:e.secret}。`,PSe=e=>`توکن Modal پیدا نشد. ${e==null?void 0:e.command} را اجرا کنید، یا ${e==null?void 0:e.id} و ${e==null?void 0:e.secret} را در زبانهٔ محیط اضافه کنید.`,FSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HSe(e):t==="fa"?PSe(e):$Se(e)}),USe=()=>"~/.openresearch/env",qSe=()=>"~/.openresearch/env",GSe=()=>"~/.openresearch/env",VSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qSe():t==="fa"?GSe():USe()}),WSe=e=>`${e==null?void 0:e.count} available — ${e==null?void 0:e.models}`,KSe=e=>`${e==null?void 0:e.count} 个可用 — ${e==null?void 0:e.models}`,XSe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,YSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KSe(e):t==="fa"?XSe(e):WSe(e)}),ZSe=e=>`Needs ${e==null?void 0:e.tool}`,QSe=e=>`需要 ${e==null?void 0:e.tool}`,JSe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,e8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QSe(e):t==="fa"?JSe(e):ZSe(e)}),t8e=()=>"Needs tools",n8e=()=>"缺少工具",r8e=()=>"به ابزارها نیاز دارد",s8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,a8e=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,o8e=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,l8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?a8e(e):t==="fa"?o8e(e):i8e(e)}),c8e=()=>"New runs use SSH; choose a host when launching.",u8e=()=>"新运行将使用 SSH;启动时请选择主机。",f8e=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",d8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u8e():t==="fa"?f8e():c8e()}),h8e=()=>"New token",_8e=()=>"新令牌",p8e=()=>"توکن جدید",m8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"No default flavor",b8e=()=>"不设默认配置",v8e=()=>"بدون پیکربندی پیش‌فرض",x8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b8e():t==="fa"?v8e():g8e()}),y8e=()=>"none",w8e=()=>"无",S8e=()=>"هیچ‌کدام",T2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w8e():t==="fa"?S8e():y8e()}),k8e=()=>"Not built yet",C8e=()=>"尚未构建",E8e=()=>"هنوز ساخته نشده",N8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C8e():t==="fa"?E8e():k8e()}),z8e=()=>"Not connected",A8e=()=>"未连接",j8e=()=>"متصل نیست",z9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A8e():t==="fa"?j8e():z8e()}),T8e=()=>"not found on PATH",M8e=()=>"在 PATH 中未找到",R8e=()=>"در PATH پیدا نشد",D8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M8e():t==="fa"?R8e():T8e()}),L8e=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,O8e=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,I8e=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,B8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?O8e(e):t==="fa"?I8e(e):L8e(e)}),$8e=()=>"not initialized",H8e=()=>"尚未初始化",P8e=()=>"راه‌اندازی نشده",F8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H8e():t==="fa"?P8e():$8e()}),U8e=()=>"Not set",q8e=()=>"未设置",G8e=()=>"تنظیم نشده",V8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q8e():t==="fa"?G8e():U8e()}),W8e=()=>"OAuth (subscription login)",K8e=()=>"OAuth(订阅登录)",X8e=()=>"OAuth (ورود با اشتراک)",Y8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K8e():t==="fa"?X8e():W8e()}),Z8e=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.`,Q8e=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,J8e=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,eke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Q8e(e):t==="fa"?J8e(e):Z8e(e)}),tke=()=>"Account",nke=()=>"账户",rke=()=>"حساب",M2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ske=()=>"Add one with",ike=()=>"使用以下命令添加:",ake=()=>"یکی با این فرمان اضافه کنید:",oke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ike():t==="fa"?ake():ske()}),lke=()=>"Add variable",cke=()=>"添加变量",uke=()=>"افزودن متغیر",fke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cke():t==="fa"?uke():lke()}),dke=()=>"Agent models",hke=()=>"智能体模型",_ke=()=>"مدل‌های عامل",pke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hke():t==="fa"?_ke():dke()}),mke=()=>"Anonymous usage analytics",gke=()=>"匿名使用情况分析",bke=()=>"تحلیل ناشناس استفاده",t7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gke():t==="fa"?bke():mke()}),vke=()=>"Auth",xke=()=>"身份验证",yke=()=>"احراز هویت",wke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xke():t==="fa"?yke():vke()}),Ske=()=>"Authentication",kke=()=>"身份验证",Cke=()=>"احراز هویت",Eke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kke():t==="fa"?Cke():Ske()}),Nke=()=>"Back to Compute",zke=()=>"返回算力设置",Ake=()=>"بازگشت به رایانش",A9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zke():t==="fa"?Ake():Nke()}),jke=()=>"Backend",Tke=()=>"后端",Mke=()=>"بک‌اند",Rke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tke():t==="fa"?Mke():jke()}),Dke=()=>"Baseline",Lke=()=>"基线",Oke=()=>"خط مبنا",Ike=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lke():t==="fa"?Oke():Dke()}),Bke=()=>"Binary",$ke=()=>"可执行文件",Hke=()=>"فایل اجرایی",Pke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ke():t==="fa"?Hke():Bke()}),Fke=()=>"Cancel",Uke=()=>"取消",qke=()=>"لغو",Gke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uke():t==="fa"?qke():Fke()}),Vke=()=>"Cancel new variable",Wke=()=>"取消新变量",Kke=()=>"لغو متغیر جدید",Xke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wke():t==="fa"?Kke():Vke()}),Yke=()=>"Checking compute targets…",Zke=()=>"正在检查算力目标…",Qke=()=>"در حال بررسی مقصدهای رایانشی…",Jke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zke():t==="fa"?Qke():Yke()}),eCe=()=>"Checking credentials…",tCe=()=>"正在检查凭据…",nCe=()=>"در حال بررسی اطلاعات ورود…",rCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tCe():t==="fa"?nCe():eCe()}),sCe=()=>"Checking kubectl…",iCe=()=>"正在检查 kubectl…",aCe=()=>"در حال بررسی kubectl…",oCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iCe():t==="fa"?aCe():sCe()}),lCe=()=>"Checking Modal…",cCe=()=>"正在检查 Modal…",uCe=()=>"در حال بررسی Modal…",fCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cCe():t==="fa"?uCe():lCe()}),dCe=()=>"Choose a preset flavor",hCe=()=>"选择预设规格",_Ce=()=>"یک پیکربندی آماده انتخاب کنید",n7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hCe():t==="fa"?_Ce():dCe()}),pCe=()=>"Cluster",mCe=()=>"集群",gCe=()=>"خوشه",bCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mCe():t==="fa"?gCe():pCe()}),vCe=()=>"cluster default",xCe=()=>"集群默认值",yCe=()=>"پیش‌فرض خوشه",r7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xCe():t==="fa"?yCe():vCe()}),wCe=()=>"cluster default (e.g. 4h, 30m)",SCe=()=>"集群默认值(例如 4h、30m)",kCe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",CCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SCe():t==="fa"?kCe():wCe()}),ECe=()=>"Cluster unreachable",NCe=()=>"无法连接集群",zCe=()=>"خوشه در دسترس نیست",ACe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NCe():t==="fa"?zCe():ECe()}),jCe=()=>"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker.",TCe=()=>"这台计算机上检测到的编程智能体设置。研究智能体聊天由 OpenCode 提供;Claude Code 和 Codex 账户中的模型会显示在编辑器的模型选择器中。",MCe=()=>"راه‌اندازی‌های عامل کدنویسی شناسایی‌شده روی این دستگاه. گفتگوی عامل پژوهشی را OpenCode ارائه می‌کند؛ مدل‌های حساب‌های Claude Code و Codex در انتخابگر مدلِ کادر پیام دیده می‌شوند.",RCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TCe():t==="fa"?MCe():jCe()}),DCe=()=>"Compute",LCe=()=>"算力",OCe=()=>"رایانش",j9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LCe():t==="fa"?OCe():DCe()}),ICe=()=>"Connect compute backends and choose where new runs execute.",BCe=()=>"连接算力后端,并选择新运行的执行位置。",$Ce=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",HCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BCe():t==="fa"?$Ce():ICe()}),PCe=()=>"Connected",FCe=()=>"已连接",UCe=()=>"متصل",R2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FCe():t==="fa"?UCe():PCe()}),qCe=()=>"Context",GCe=()=>"上下文",VCe=()=>"زمینه",WCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GCe():t==="fa"?VCe():qCe()}),KCe=()=>"Current",XCe=()=>"当前",YCe=()=>"فعلی",ZCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XCe():t==="fa"?YCe():KCe()}),QCe=()=>"Currently off:",JCe=()=>"当前已关闭:",e9e=()=>"اکنون خاموش است:",t9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JCe():t==="fa"?e9e():QCe()}),n9e=()=>"Custom flavor",r9e=()=>"自定义规格",s9e=()=>"پیکربندی سفارشی",i9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Custom flavor…",o9e=()=>"自定义规格…",l9e=()=>"پیکربندی سفارشی…",T9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),c9e=()=>"Data directory",u9e=()=>"数据目录",f9e=()=>"پوشهٔ داده",d9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u9e():t==="fa"?f9e():c9e()}),h9e=()=>"default",_9e=()=>"默认",p9e=()=>"پیش‌فرض",m9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_9e():t==="fa"?p9e():h9e()}),g9e=()=>"Default",b9e=()=>"默认",v9e=()=>"پیش‌فرض",x0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b9e():t==="fa"?v9e():g9e()}),x9e=()=>"Default destination",y9e=()=>"默认目标",w9e=()=>"مقصد پیش‌فرض",S9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y9e():t==="fa"?w9e():x9e()}),k9e=()=>"Defaults applied when you create a project.",C9e=()=>"创建项目时应用的默认值。",E9e=()=>"پیش‌فرض‌هایی که هنگام ساخت پروژه اعمال می‌شوند.",N9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C9e():t==="fa"?E9e():k9e()}),z9e=()=>"Detecting hardware…",A9e=()=>"正在检测硬件…",j9e=()=>"در حال شناسایی سخت‌افزار…",T9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A9e():t==="fa"?j9e():z9e()}),M9e=()=>"Detecting harnesses…",R9e=()=>"正在检测智能体工具…",D9e=()=>"در حال شناسایی ابزارهای عامل…",L9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R9e():t==="fa"?D9e():M9e()}),O9e=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",I9e=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",B9e=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",$9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I9e():t==="fa"?B9e():O9e()}),H9e=()=>"Effective URL",P9e=()=>"实际使用的网址",F9e=()=>"نشانی مؤثر",U9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P9e():t==="fa"?F9e():H9e()}),q9e=()=>"Enable GitHub syncing for new projects",G9e=()=>"为新项目启用 GitHub 同步",V9e=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",s7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G9e():t==="fa"?V9e():q9e()}),W9e=()=>"Environment",K9e=()=>"环境",X9e=()=>"محیط",D2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K9e():t==="fa"?X9e():W9e()}),Y9e=()=>"Environment variables",Z9e=()=>"环境变量",Q9e=()=>"متغیرهای محیطی",J9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z9e():t==="fa"?Q9e():Y9e()}),eEe=()=>"Failed",tEe=()=>"失败",nEe=()=>"ناموفق",L2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tEe():t==="fa"?nEe():eEe()}),rEe=()=>"General",sEe=()=>"常规",iEe=()=>"عمومی",aEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sEe():t==="fa"?iEe():rEe()}),oEe=()=>"GitHub publishing",lEe=()=>"GitHub 发布",cEe=()=>"انتشار در GitHub",uEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lEe():t==="fa"?cEe():oEe()}),fEe=()=>"Git token",dEe=()=>"Git 令牌",hEe=()=>"توکن Git",_Ee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dEe():t==="fa"?hEe():fEe()}),pEe=()=>"Harnesses",mEe=()=>"智能体工具",gEe=()=>"ابزارهای عامل",bEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mEe():t==="fa"?gEe():pEe()}),vEe=()=>"hf_…",xEe=()=>"hf_…",yEe=()=>"hf_…",wEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xEe():t==="fa"?yEe():vEe()}),SEe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",kEe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",CEe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",EEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Hostname",zEe=()=>"主机名",AEe=()=>"نام میزبان",jEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zEe():t==="fa"?AEe():NEe()}),TEe=()=>"How it connects",MEe=()=>"连接方式",REe=()=>"نحوهٔ اتصال",DEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MEe():t==="fa"?REe():TEe()}),LEe=()=>"Identity",OEe=()=>"身份",IEe=()=>"هویت",BEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OEe():t==="fa"?IEe():LEe()}),$Ee=()=>"Initialize Git",HEe=()=>"初始化 Git",PEe=()=>"راه‌اندازی Git",FEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HEe():t==="fa"?PEe():$Ee()}),UEe=()=>"Install",qEe=()=>"安装",GEe=()=>"نصب",VEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qEe():t==="fa"?GEe():UEe()}),WEe=()=>"Install broken",KEe=()=>"安装损坏",XEe=()=>"نصب خراب است",YEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KEe():t==="fa"?XEe():WEe()}),ZEe=()=>"Install GitHub CLI",QEe=()=>"安装 GitHub CLI",JEe=()=>"نصب GitHub CLI",eNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QEe():t==="fa"?JEe():ZEe()}),tNe=()=>"Install updates automatically",nNe=()=>"自动安装更新",rNe=()=>"نصب خودکار به‌روزرسانی‌ها",i7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nNe():t==="fa"?rNe():tNe()}),sNe=()=>"Instance history",iNe=()=>"实例历史",aNe=()=>"تاریخچهٔ نمونه‌ها",oNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Invalid token",cNe=()=>"令牌无效",uNe=()=>"توکن نامعتبر",fNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),dNe=()=>"Jobs",hNe=()=>"Jobs",_Ne=()=>"Jobs",pNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hNe():t==="fa"?_Ne():dNe()}),mNe=()=>"Jobs / Dashboard URL",gNe=()=>"Jobs / 控制台网址",bNe=()=>"نشانی Jobs / داشبورد",vNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gNe():t==="fa"?bNe():mNe()}),xNe=()=>"Jobs permission unknown",yNe=()=>"Jobs 权限未知",wNe=()=>"مجوز Jobs نامشخص است",SNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yNe():t==="fa"?wNe():xNe()}),kNe=()=>"Jobs: write OK",CNe=()=>"Jobs:写入正常",ENe=()=>"Jobs: نوشتن مجاز است",NNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Keeping this copy of orx on the latest release.",ANe=()=>"让此 orx 保持最新版本。",jNe=()=>"به‌روز نگه داشتن این نسخهٔ orx.",TNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ANe():t==="fa"?jNe():zNe()}),MNe=()=>"kubectl not found",RNe=()=>"未找到 kubectl",DNe=()=>"kubectl پیدا نشد",LNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RNe():t==="fa"?DNe():MNe()}),ONe=()=>"Last error",INe=()=>"最近错误",BNe=()=>"آخرین خطا",$Ne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),HNe=()=>"Latest",PNe=()=>"最新版本",FNe=()=>"جدیدترین",UNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PNe():t==="fa"?FNe():HNe()}),qNe=()=>"Loading…",GNe=()=>"正在加载…",VNe=()=>"در حال بارگیری…",cl=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GNe():t==="fa"?VNe():qNe()}),WNe=()=>"Loading Ray settings…",KNe=()=>"正在加载 Ray 设置…",XNe=()=>"در حال بارگیری تنظیمات Ray…",YNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KNe():t==="fa"?XNe():WNe()}),ZNe=()=>"Loading slurm settings…",QNe=()=>"正在加载 Slurm 设置…",JNe=()=>"در حال بارگیری تنظیمات Slurm…",eze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QNe():t==="fa"?JNe():ZNe()}),tze=()=>"Loading status…",nze=()=>"正在加载状态…",rze=()=>"در حال بارگیری وضعیت…",sze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nze():t==="fa"?rze():tze()}),ize=()=>"Local only",aze=()=>"仅本地",oze=()=>"فقط محلی",lze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aze():t==="fa"?oze():ize()}),cze=()=>"Local repository",uze=()=>"本地仓库",fze=()=>"مخزن محلی",dze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uze():t==="fa"?fze():cze()}),hze=()=>"Login node",_ze=()=>"登录节点",pze=()=>"گرهٔ ورود",mze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"Make GitHub syncing the default?",bze=()=>"将 GitHub 同步设为默认值?",vze=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",xze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bze():t==="fa"?vze():gze()}),yze=()=>"Missing bash/tar",wze=()=>"缺少 bash/tar",Sze=()=>"bash/tar موجود نیست",kze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wze():t==="fa"?Sze():yze()}),Cze=()=>"More compute options",Eze=()=>"更多算力选项",Nze=()=>"گزینه‌های رایانشی بیشتر",zze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eze():t==="fa"?Nze():Cze()}),Aze=()=>"Move failed:",jze=()=>"移动失败:",Tze=()=>"انتقال ناموفق بود:",Mze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jze():t==="fa"?Tze():Aze()}),Rze=()=>"Moved. orx is now using the new location.",Dze=()=>"已移动。orx 现在使用新位置。",Lze=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",Oze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dze():t==="fa"?Lze():Rze()}),Ize=()=>"Namespace",Bze=()=>"命名空间",$ze=()=>"فضای نام",Hze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bze():t==="fa"?$ze():Ize()}),Pze=()=>"New location",Fze=()=>"新位置",Uze=()=>"محل جدید",qze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fze():t==="fa"?Uze():Pze()}),Gze=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",Vze=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",Wze=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",Kze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vze():t==="fa"?Wze():Gze()}),Xze=()=>"New variable key",Yze=()=>"新变量键名",Zze=()=>"کلید متغیر جدید",Qze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yze():t==="fa"?Zze():Xze()}),Jze=()=>"New variable value",eAe=()=>"新变量值",tAe=()=>"مقدار متغیر جدید",nAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eAe():t==="fa"?tAe():Jze()}),rAe=()=>"No code, prompts, file contents, or account identifiers are sent.",sAe=()=>"不会发送代码、提示词、文件内容或账户标识符。",iAe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",aAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sAe():t==="fa"?iAe():rAe()}),oAe=()=>"No hosts found in ~/.ssh/config.",lAe=()=>"在 ~/.ssh/config 中未找到主机。",cAe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",uAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lAe():t==="fa"?cAe():oAe()}),fAe=()=>"No job-create permission",dAe=()=>"没有创建 Job 的权限",hAe=()=>"مجوز ساخت Job وجود ندارد",_Ae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dAe():t==="fa"?hAe():fAe()}),pAe=()=>"No job.write permission",mAe=()=>"没有 job.write 权限",gAe=()=>"مجوز job.write وجود ندارد",bAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mAe():t==="fa"?gAe():pAe()}),vAe=()=>"No key on this computer to register — load a registered key with",xAe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",yAe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",wAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xAe():t==="fa"?yAe():vAe()}),SAe=()=>"No key on this computer yet — create one with",kAe=()=>"此计算机上还没有密钥——使用以下命令创建:",CAe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",EAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kAe():t==="fa"?CAe():SAe()}),NAe=()=>"No Slurm CLI",zAe=()=>"无 Slurm CLI",AAe=()=>"بدون CLI اسلورم",jAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zAe():t==="fa"?AAe():NAe()}),TAe=()=>"No token",MAe=()=>"无令牌",RAe=()=>"بدون توکن",DAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MAe():t==="fa"?RAe():TAe()}),LAe=()=>"None registered",OAe=()=>"未注册任何密钥",IAe=()=>"هیچ‌کدام ثبت نشده",BAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OAe():t==="fa"?IAe():LAe()}),$Ae=()=>"Not checked",HAe=()=>"未检查",PAe=()=>"بررسی نشده",FAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HAe():t==="fa"?PAe():$Ae()}),UAe=()=>"Not configured",qAe=()=>"未配置",GAe=()=>"پیکربندی نشده",sp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qAe():t==="fa"?GAe():UAe()}),VAe=()=>"Not installed",WAe=()=>"未安装",KAe=()=>"نصب نیست",XAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WAe():t==="fa"?KAe():VAe()}),YAe=()=>"Not now",ZAe=()=>"暂不",QAe=()=>"اکنون نه",JAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZAe():t==="fa"?QAe():YAe()}),eje=()=>"Not on this computer",tje=()=>"不在此计算机上",nje=()=>"روی این رایانه نیست",rje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tje():t==="fa"?nje():eje()}),sje=()=>"Not set (pass --host per launch)",ije=()=>"未设置(每次启动时传入 --host)",aje=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",oje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ije():t==="fa"?aje():sje()}),lje=()=>"Not set up",cje=()=>"未设置",uje=()=>"راه‌اندازی نشده",fje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),dje=()=>"Not signed in",hje=()=>"未登录",_je=()=>"وارد نشده",pje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hje():t==="fa"?_je():dje()}),mje=()=>"On this computer",gje=()=>"在此计算机上",bje=()=>"روی این رایانه",vje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gje():t==="fa"?bje():mje()}),xje=()=>"Open a project to inspect its repository and GitHub publication state.",yje=()=>"打开项目以查看其仓库和 GitHub 发布状态。",wje=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",Sje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yje():t==="fa"?wje():xje()}),kje=()=>"Open job page",Cje=()=>"打开作业页面",Eje=()=>"باز کردن صفحهٔ کار",a7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cje():t==="fa"?Eje():kje()}),Nje=()=>"Open on GitHub",zje=()=>"在 GitHub 上打开",Aje=()=>"باز کردن در GitHub",o7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zje():t==="fa"?Aje():Nje()}),jje=()=>", or create one with",Tje=()=>",或使用以下命令创建:",Mje=()=>"، یا با این فرمان یکی بسازید:",Rje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tje():t==="fa"?Mje():jje()}),Dje=()=>"Org",Lje=()=>"组织",Oje=()=>"سازمان",Ije=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"Orgs",$je=()=>"组织",Hje=()=>"سازمان‌ها",Pje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$je():t==="fa"?Hje():Bje()}),Fje=()=>"orx can't update this install",Uje=()=>"orx 无法更新此安装",qje=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",Gje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uje():t==="fa"?qje():Fje()}),Vje=()=>"Overleaf",Wje=()=>"Overleaf",Kje=()=>"Overleaf",Xje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wje():t==="fa"?Kje():Vje()}),Yje=()=>"Overleaf Git authentication token",Zje=()=>"Overleaf Git 身份验证令牌",Qje=()=>"توکن احراز هویت Git در Overleaf",Jje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zje():t==="fa"?Qje():Yje()}),eTe=()=>"Overridden by env",tTe=()=>"已被环境变量覆盖",nTe=()=>"بازنویسی‌شده توسط محیط",rTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tTe():t==="fa"?nTe():eTe()}),sTe=()=>"Partition",iTe=()=>"分区",aTe=()=>"پارتیشن",oTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Partitions",cTe=()=>"分区",uTe=()=>"پارتیشن‌ها",fTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),dTe=()=>"Path",hTe=()=>"路径",_Te=()=>"مسیر",pTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hTe():t==="fa"?_Te():dTe()}),mTe=()=>"Plan",gTe=()=>"方案",bTe=()=>"سطح اشتراک",vTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gTe():t==="fa"?bTe():mTe()}),xTe=()=>"Project",yTe=()=>"项目",wTe=()=>"پروژه",STe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yTe():t==="fa"?wTe():xTe()}),kTe=()=>"Ray version",CTe=()=>"Ray 版本",ETe=()=>"نسخهٔ Ray",NTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CTe():t==="fa"?ETe():kTe()}),zTe=()=>"Reachable",ATe=()=>"可访问",jTe=()=>"در دسترس",TTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ATe():t==="fa"?jTe():zTe()}),MTe=()=>"Reading ~/.ssh/config…",RTe=()=>"正在读取 ~/.ssh/config…",DTe=()=>"در حال خواندن ‎~/.ssh/config…",LTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RTe():t==="fa"?DTe():MTe()}),OTe=()=>"Ready",ITe=()=>"就绪",BTe=()=>"آماده",O2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ITe():t==="fa"?BTe():OTe()}),$Te=()=>"Ready to move",HTe=()=>"可以移动",PTe=()=>"آمادهٔ انتقال",FTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HTe():t==="fa"?PTe():$Te()}),UTe=()=>"Ready to use",qTe=()=>"可用",GTe=()=>"آمادهٔ استفاده",VTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qTe():t==="fa"?GTe():UTe()}),WTe=()=>"Refresh",KTe=()=>"刷新",XTe=()=>"تازه‌سازی",I2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KTe():t==="fa"?XTe():WTe()}),YTe=()=>"Remotes",ZTe=()=>"远程仓库",QTe=()=>"مخزن‌های دوردست",JTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZTe():t==="fa"?QTe():YTe()}),eMe=()=>"Repository",tMe=()=>"仓库",nMe=()=>"مخزن",rMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tMe():t==="fa"?nMe():eMe()}),sMe=()=>"Restart to finish updating",iMe=()=>"重新启动以完成更新",aMe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",oMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iMe():t==="fa"?aMe():sMe()}),lMe=()=>"Run manifest",cMe=()=>"运行清单",uMe=()=>"مانیفست اجرا",fMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cMe():t==="fa"?uMe():lMe()}),dMe=()=>"Running instances",hMe=()=>"正在运行的实例",_Me=()=>"نمونه‌های در حال اجرا",pMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hMe():t==="fa"?_Me():dMe()}),mMe=()=>"Runtime",gMe=()=>"运行时间",bMe=()=>"زمان اجرا",vMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gMe():t==="fa"?bMe():mMe()}),xMe=()=>". Save it under that key if it's meant for HF Jobs.",yMe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",wMe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",SMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yMe():t==="fa"?wMe():xMe()}),kMe=()=>"Settings",CMe=()=>"设置",EMe=()=>"تنظیمات",M9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),NMe=()=>"Share anonymous product usage linked only to a random installation ID.",zMe=()=>"共享匿名的产品使用数据,仅与随机安装 ID 关联。",AMe=()=>"داده‌های ناشناس استفاده از محصول را که فقط به یک شناسهٔ تصادفی نصب پیوند دارد، به اشتراک بگذارید.",jMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zMe():t==="fa"?AMe():NMe()}),TMe=()=>"Signed in",MMe=()=>"已登录",RMe=()=>"وارد شده",R9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MMe():t==="fa"?RMe():TMe()}),DMe=()=>"Source",LMe=()=>"来源",OMe=()=>"منبع",B2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LMe():t==="fa"?OMe():DMe()}),IMe=()=>"SSH key",BMe=()=>"SSH 密钥",$Me=()=>"کلید SSH",HMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BMe():t==="fa"?$Me():IMe()}),PMe=()=>"Started",FMe=()=>"开始时间",UMe=()=>"آغاز",qMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FMe():t==="fa"?UMe():PMe()}),GMe=()=>"State",VMe=()=>"状态",WMe=()=>"وضعیت",KMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VMe():t==="fa"?WMe():GMe()}),XMe=()=>"Status",YMe=()=>"状态",ZMe=()=>"وضعیت",ip=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YMe():t==="fa"?ZMe():XMe()}),QMe=()=>"Storage",JMe=()=>"存储",eRe=()=>"ذخیره‌سازی",tRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JMe():t==="fa"?eRe():QMe()}),nRe=()=>"Sync",rRe=()=>"同步",sRe=()=>"همگام‌سازی",iRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rRe():t==="fa"?sRe():nRe()}),aRe=()=>"Syncing off",oRe=()=>"同步已关闭",lRe=()=>"همگام‌سازی خاموش",cRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oRe():t==="fa"?lRe():aRe()}),uRe=()=>"System",fRe=()=>"系统",dRe=()=>"سامانه",hRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fRe():t==="fa"?dRe():uRe()}),_Re=()=>"Test connection",pRe=()=>"测试连接",mRe=()=>"آزمایش اتصال",D9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pRe():t==="fa"?mRe():_Re()}),gRe=()=>"Testing…",bRe=()=>"正在测试…",vRe=()=>"در حال آزمایش…",$2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bRe():t==="fa"?vRe():gRe()}),xRe=()=>", then add it with",yRe=()=>",然后使用以下命令添加:",wRe=()=>"، سپس با این فرمان اضافه‌اش کنید:",SRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yRe():t==="fa"?wRe():xRe()}),kRe=()=>"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.",CRe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",ERe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",NRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CRe():t==="fa"?ERe():kRe()}),zRe=()=>"This saved destination is not configured. Set it up below or choose another backend.",ARe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",jRe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",TRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ARe():t==="fa"?jRe():zRe()}),MRe=()=>"This value looks like a Hugging Face token — compute runs only read it from",RRe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",DRe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",LRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RRe():t==="fa"?DRe():MRe()}),ORe=()=>"Time limit",IRe=()=>"时间限制",BRe=()=>"محدودیت زمانی",$Re=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IRe():t==="fa"?BRe():ORe()}),HRe=()=>"Token",PRe=()=>"令牌",FRe=()=>"توکن",L9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PRe():t==="fa"?FRe():HRe()}),URe=()=>"Unable to verify",qRe=()=>"无法验证",GRe=()=>"تأیید ممکن نیست",VRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qRe():t==="fa"?GRe():URe()}),WRe=()=>"Unknown",KRe=()=>"未知",XRe=()=>"نامشخص",O9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KRe():t==="fa"?XRe():WRe()}),YRe=()=>"Update required",ZRe=()=>"需要更新",QRe=()=>"نیازمند به‌روزرسانی",JRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZRe():t==="fa"?QRe():YRe()}),eDe=()=>"Updates",tDe=()=>"更新",nDe=()=>"به‌روزرسانی‌ها",l7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tDe():t==="fa"?nDe():eDe()}),rDe=()=>"Usage analytics",sDe=()=>"使用情况分析",iDe=()=>"تحلیل استفاده",aDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sDe():t==="fa"?iDe():rDe()}),oDe=()=>"value",lDe=()=>"值",cDe=()=>"مقدار",I9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lDe():t==="fa"?cDe():oDe()}),uDe=()=>"Variables available to runs and the research agent (API keys, tokens).",fDe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",dDe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API و توکن‌ها).",hDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fDe():t==="fa"?dDe():uDe()}),_De=()=>"Version",pDe=()=>"版本",mDe=()=>"نسخه",B9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pDe():t==="fa"?mDe():_De()}),gDe=()=>"What happens",bDe=()=>"执行内容",vDe=()=>"چه اتفاقی می‌افتد",xDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bDe():t==="fa"?vDe():gDe()}),yDe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",wDe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",SDe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",kDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wDe():t==="fa"?SDe():yDe()}),CDe=()=>"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.",EDe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",NDe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",zDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EDe():t==="fa"?NDe():CDe()}),ADe=()=>"Pick a login node first",jDe=()=>"请先选择登录节点",TDe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",MDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jDe():t==="fa"?TDe():ADe()}),RDe=()=>"Providers",DDe=()=>"提供商",LDe=()=>"ارائه‌دهندگان",ODe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DDe():t==="fa"?LDe():RDe()}),IDe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,BDe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,$De=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,HDe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?BDe(e):t==="fa"?$De(e):IDe(e)}),PDe=()=>"Reinstall with the orx installer to get automatic updates.",FDe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",UDe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",qDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FDe():t==="fa"?UDe():PDe()}),GDe=()=>"Re-link",VDe=()=>"重新链接",WDe=()=>"پیوند دوباره",KDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VDe():t==="fa"?WDe():GDe()}),XDe=()=>"Remove token",YDe=()=>"移除令牌",ZDe=()=>"حذف توکن",QDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YDe():t==="fa"?ZDe():XDe()}),JDe=()=>"Removing…",eLe=()=>"正在移除…",tLe=()=>"در حال حذف…",nLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eLe():t==="fa"?tLe():JDe()}),rLe=()=>"Replace anyway",sLe=()=>"仍要替换",iLe=()=>"به‌هرحال جایگزین کن",aLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sLe():t==="fa"?iLe():rLe()}),oLe=()=>"Replace token",lLe=()=>"替换令牌",cLe=()=>"جایگزینی توکن",uLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lLe():t==="fa"?cLe():oLe()}),fLe=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,dLe=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,hLe=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,_Le=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dLe(e):t==="fa"?hLe(e):fLe(e)}),pLe=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,mLe=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,gLe=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,bLe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mLe(e):t==="fa"?gLe(e):pLe(e)}),vLe=()=>"Retest",xLe=()=>"重新测试",yLe=()=>"آزمون دوباره",wLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xLe():t==="fa"?yLe():vLe()}),SLe=()=>"Run `gh auth login` in your terminal.",kLe=()=>"请在终端中运行 `gh auth login`。",CLe=()=>"در پایانه `gh auth login` را اجرا کنید.",ELe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kLe():t==="fa"?CLe():SLe()}),NLe=()=>"Saved",zLe=()=>"已保存",ALe=()=>"ذخیره شده",jLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zLe():t==="fa"?ALe():NLe()}),TLe=()=>"Set up",MLe=()=>"设置",RLe=()=>"راه‌اندازی",DLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MLe():t==="fa"?RLe():TLe()}),LLe=()=>"Set up environment",OLe=()=>"设置环境",ILe=()=>"راه‌اندازی محیط",BLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),$Le=()=>"Setting up… (~30–60s)",HLe=()=>"正在设置…(约 30–60 秒)",PLe=()=>"در حال راه‌اندازی… (حدود ۳۰ تا ۶۰ ثانیه)",FLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HLe():t==="fa"?PLe():$Le()}),ULe=()=>"Sign in",qLe=()=>"登录",GLe=()=>"ورود",VLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qLe():t==="fa"?GLe():ULe()}),WLe=()=>"SSH defaults",KLe=()=>"SSH 默认值",XLe=()=>"پیش‌فرض‌های SSH",YLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KLe():t==="fa"?XLe():WLe()}),ZLe=()=>"Where orx keeps everything on this machine: the local database, run logs, artifacts, and chat attachments for all projects. Moving it copies the whole store to the new location and activates it there.",QLe=()=>"orx 在此计算机上存放所有内容的位置:所有项目的本地数据库、运行日志、产物和聊天附件。移动会将整个存储复制到新位置并在那里启用。",JLe=()=>"محلی که orx همه‌چیز را روی این دستگاه نگه می‌دارد: پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگوی همهٔ پروژه‌ها. انتقال، کل مخزن داده را به محل جدید کپی و همان‌جا فعال می‌کند.",eOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QLe():t==="fa"?JLe():ZLe()}),tOe=()=>"Test",nOe=()=>"测试",rOe=()=>"آزمون",sOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nOe():t==="fa"?rOe():tOe()}),iOe=()=>"Testing…",aOe=()=>"正在测试…",oOe=()=>"در حال آزمون…",lOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aOe():t==="fa"?oOe():iOe()}),cOe=()=>"Dark",uOe=()=>"深色",fOe=()=>"تیره",dOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uOe():t==="fa"?fOe():cOe()}),hOe=()=>"System follows your operating system's light or dark setting.",_Oe=()=>"“系统”会跟随操作系统的浅色或深色设置。",pOe=()=>"حالت «سیستم» از تنظیم روشن یا تیرهٔ سیستم‌عامل پیروی می‌کند.",mOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Oe():t==="fa"?pOe():hOe()}),gOe=()=>"Theme",bOe=()=>"主题",vOe=()=>"پوسته",c7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bOe():t==="fa"?vOe():gOe()}),xOe=()=>"Light",yOe=()=>"浅色",wOe=()=>"روشن",SOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yOe():t==="fa"?wOe():xOe()}),kOe=()=>"System",COe=()=>"系统",EOe=()=>"سیستم",NOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?COe():t==="fa"?EOe():kOe()}),zOe=()=>"Update now",AOe=()=>"立即更新",jOe=()=>"اکنون به‌روزرسانی کن",TOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AOe():t==="fa"?jOe():zOe()}),MOe=e=>`Update to ${e==null?void 0:e.version}`,ROe=e=>`更新到 ${e==null?void 0:e.version}`,DOe=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,LOe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ROe(e):t==="fa"?DOe(e):MOe(e)}),OOe=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",IOe=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",BOe=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",$Oe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IOe():t==="fa"?BOe():OOe()}),HOe=()=>"Updating default destination…",POe=()=>"正在更新默认运行位置…",FOe=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",UOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?POe():t==="fa"?FOe():HOe()}),qOe=()=>"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.",GOe=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",VOe=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",WOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GOe():t==="fa"?VOe():qOe()}),KOe=()=>"Validating…",XOe=()=>"正在验证…",YOe=()=>"در حال اعتبارسنجی…",ZOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XOe():t==="fa"?YOe():KOe()}),QOe=()=>"View settings",JOe=()=>"查看设置",eIe=()=>"مشاهدهٔ تنظیمات",tIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JOe():t==="fa"?eIe():QOe()}),nIe=()=>"Skill",rIe=()=>"技能",sIe=()=>"مهارت",iIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rIe():t==="fa"?sIe():nIe()}),aIe=()=>"Loading skill…",oIe=()=>"正在加载技能…",lIe=()=>"در حال بارگیری مهارت…",cIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oIe():t==="fa"?lIe():aIe()}),uIe=e=>`Delete the “${e==null?void 0:e.name}” skill?`,fIe=e=>`删除技能“${e==null?void 0:e.name}”?`,dIe=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,hIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fIe(e):t==="fa"?dIe(e):uIe(e)}),_Ie=e=>`Delete skill ${e==null?void 0:e.name}`,pIe=e=>`删除技能 ${e==null?void 0:e.name}`,mIe=e=>`حذف مهارت ${e==null?void 0:e.name}`,gIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pIe(e):t==="fa"?mIe(e):_Ie(e)}),bIe=e=>`Delete the “${e==null?void 0:e.name}” template?`,vIe=e=>`删除模板“${e==null?void 0:e.name}”?`,xIe=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,yIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vIe(e):t==="fa"?xIe(e):bIe(e)}),wIe=e=>`Delete template ${e==null?void 0:e.name}`,SIe=e=>`删除模板 ${e==null?void 0:e.name}`,kIe=e=>`حذف قالب ${e==null?void 0:e.name}`,CIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SIe(e):t==="fa"?kIe(e):wIe(e)}),EIe=()=>"Drop a SKILL.md or .zip here, or click to choose",NIe=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",zIe=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",AIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NIe():t==="fa"?zIe():EIe()}),jIe=()=>"Drop a .tex or .zip here, or click to choose",TIe=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",MIe=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",RIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TIe():t==="fa"?MIe():jIe()}),DIe=()=>"File too large (max 20 MB).",LIe=()=>"文件过大(最大 20 MB)。",OIe=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",$9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LIe():t==="fa"?OIe():DIe()}),IIe=()=>"Global",BIe=()=>"全局",$Ie=()=>"سراسری",H9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BIe():t==="fa"?$Ie():IIe()}),HIe=()=>"Available to the agent in every project.",PIe=()=>"智能体可在每个项目中使用。",FIe=()=>"عامل در همهٔ پروژه‌ها به آن دسترسی دارد.",UIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PIe():t==="fa"?FIe():HIe()}),qIe=()=>"Import",GIe=()=>"导入",VIe=()=>"درون‌ریزی",WIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GIe():t==="fa"?VIe():qIe()}),KIe=()=>"No project open",XIe=()=>"未打开项目",YIe=()=>"پروژه‌ای باز نیست",ZIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XIe():t==="fa"?YIe():KIe()}),QIe=()=>" + 1 file",JIe=()=>" + 1 个文件",eBe=()=>" + ۱ فایل",tBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JIe():t==="fa"?eBe():QIe()}),nBe=()=>"Open a project to scope this to one project",rBe=()=>"请先打开一个项目,才能限定到单个项目",sBe=()=>"برای محدود کردن به یک پروژه، ابتدا پروژه‌ای را باز کنید",iBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rBe():t==="fa"?sBe():nBe()}),aBe=()=>"What the agent brings to every session: LaTeX templates it writes papers into, and SKILL.md skills it discovers automatically and you invoke with /name in chat. Both apply everywhere, or only to this project.",oBe=()=>"智能体在每个会话中都会携带用于撰写论文的 LaTeX 模板,以及自动发现、可在聊天中通过 /name 调用的 SKILL.md 技能。两者都可以应用于所有位置,也可以仅应用于此项目。",lBe=()=>"عامل در هر نشست قالب‌های LaTeX برای نوشتن مقاله‌ها و مهارت‌های SKILL.md را همراه دارد؛ مهارت‌ها را خودکار پیدا می‌کند و شما با ‎/name در گفتگو فراخوانی می‌کنید. هر دو می‌توانند همه‌جا یا فقط در این پروژه اعمال شوند.",cBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oBe():t==="fa"?lBe():aBe()}),uBe=()=>"Available only in this project’s sessions. Shadows a global skill of the same name.",fBe=()=>"仅供此项目的会话使用;同名的全局技能将被覆盖。",dBe=()=>"فقط در نشست‌های این پروژه در دسترس است و مهارت سراسری هم‌نام را می‌پوشاند.",hBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fBe():t==="fa"?dBe():uBe()}),_Be=()=>"Re-import",pBe=()=>"重新导入",mBe=()=>"درون‌ریزی دوباره",gBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pBe():t==="fa"?mBe():_Be()}),bBe=()=>"Skill scope",vBe=()=>"技能范围",xBe=()=>"دامنهٔ مهارت",yBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vBe():t==="fa"?xBe():bBe()}),wBe=e=>` + ${e==null?void 0:e.count} files`,SBe=e=>` + ${e==null?void 0:e.count} 个文件`,kBe=e=>` + ${e==null?void 0:e.count} فایل`,CBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SBe(e):t==="fa"?kBe(e):wBe(e)}),EBe=()=>"Add a skill",NBe=()=>"添加技能",zBe=()=>"افزودن مهارت",ABe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NBe():t==="fa"?zBe():EBe()}),jBe=()=>"Adding to",TBe=()=>"正在添加到",MBe=()=>"در حال افزودن به",RBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TBe():t==="fa"?MBe():jBe()}),DBe=()=>"Could not load templates:",LBe=()=>"无法加载模板:",OBe=()=>"بارگیری قالب‌ها ممکن نشد:",IBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LBe():t==="fa"?OBe():DBe()}),BBe=()=>"Customize",$Be=()=>"自定义",HBe=()=>"سفارشی‌سازی",PBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Be():t==="fa"?HBe():BBe()}),FBe=()=>"Delete skill",UBe=()=>"删除技能",qBe=()=>"حذف مهارت",GBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UBe():t==="fa"?qBe():FBe()}),VBe=()=>"Delete template",WBe=()=>"删除模板",KBe=()=>"حذف قالب",XBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WBe():t==="fa"?KBe():VBe()}),YBe=()=>"Every project",ZBe=()=>"每个项目",QBe=()=>"همهٔ پروژه‌ها",JBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZBe():t==="fa"?QBe():YBe()}),e$e=()=>"Global",t$e=()=>"全局",n$e=()=>"سراسری",H2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t$e():t==="fa"?n$e():e$e()}),r$e=()=>"Global skills",s$e=()=>"全局技能",i$e=()=>"مهارت‌های سراسری",a$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s$e():t==="fa"?i$e():r$e()}),o$e=()=>"Import from your agent",l$e=()=>"从智能体导入",c$e=()=>"درون‌ریزی از عامل شما",u$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l$e():t==="fa"?c$e():o$e()}),f$e=()=>"LaTeX templates",d$e=()=>"LaTeX 模板",h$e=()=>"قالب‌های LaTeX",_$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d$e():t==="fa"?h$e():f$e()}),p$e=()=>"Loading skills…",m$e=()=>"正在加载技能…",g$e=()=>"در حال بارگیری مهارت‌ها…",b$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m$e():t==="fa"?g$e():p$e()}),v$e=()=>"Loading templates…",x$e=()=>"正在加载模板…",y$e=()=>"در حال بارگیری قالب‌ها…",w$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x$e():t==="fa"?y$e():v$e()}),S$e=()=>"No skills yet.",k$e=()=>"尚无技能。",C$e=()=>"هنوز مهارتی وجود ندارد.",E$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k$e():t==="fa"?C$e():S$e()}),N$e=()=>"No templates yet.",z$e=()=>"尚无模板。",A$e=()=>"هنوز قالبی وجود ندارد.",j$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z$e():t==="fa"?A$e():N$e()}),T$e=()=>"Skills already installed in your coding agents. Import a copy into",M$e=()=>"编程智能体中已安装的技能。将副本导入",R$e=()=>"مهارت‌های ازپیش نصب‌شده در عامل‌های کدنویسی شما. یک کپی را به",D$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M$e():t==="fa"?R$e():T$e()}),L$e=()=>"so it's managed here and invocable with",O$e=()=>",即可在此管理,并通过",I$e=()=>"درون‌ریزی کنید تا اینجا مدیریت شود و با",B$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O$e():t==="fa"?I$e():L$e()}),$$e=()=>"This project",H$e=()=>"此项目",P$e=()=>"این پروژه",P2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H$e():t==="fa"?P$e():$$e()}),F$e=()=>"Uploading…",U$e=()=>"正在上传…",q$e=()=>"در حال بارگذاری…",G$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U$e():t==="fa"?q$e():F$e()}),V$e=()=>"Template scope",W$e=()=>"模板范围",K$e=()=>"دامنهٔ قالب",X$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W$e():t==="fa"?K$e():V$e()}),Y$e=()=>"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. With exactly one template available, the agent uses it without asking.",Z$e=()=>"智能体会使用会议文档类或内部样式来撰写论文,而不是使用默认导言。请上传 .tex 文件,或包含 .cls 和 .sty 文件的 .zip 压缩包。当恰好只有一个模板可用时,智能体会直接使用,无需询问。",Q$e=()=>"عامل به‌جای مقدمهٔ پیش‌فرض، مقاله‌ها را با کلاس همایش یا سبک سازمانی می‌نویسد. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید. وقتی دقیقاً یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",J$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z$e():t==="fa"?Q$e():Y$e()}),eHe=()=>"Upload a SKILL.md file or a .zip of a skill folder.",tHe=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",nHe=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",rHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tHe():t==="fa"?nHe():eHe()}),sHe=()=>"Upload a .tex file or a .zip of a template folder.",iHe=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",aHe=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",oHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iHe():t==="fa"?aHe():sHe()}),lHe=()=>"Cancelled",cHe=()=>"已取消",uHe=()=>"لغوشده",fHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cHe():t==="fa"?uHe():lHe()}),dHe=()=>"Cancelling",hHe=()=>"正在取消",_He=()=>"در حال لغو",pHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hHe():t==="fa"?_He():dHe()}),mHe=()=>"Done",gHe=()=>"已完成",bHe=()=>"انجام‌شده",vHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gHe():t==="fa"?bHe():mHe()}),xHe=()=>"Editing",yHe=()=>"正在编辑",wHe=()=>"در حال ویرایش",SHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yHe():t==="fa"?wHe():xHe()}),kHe=()=>"Failed",CHe=()=>"失败",EHe=()=>"ناموفق",NHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CHe():t==="fa"?EHe():kHe()}),zHe=()=>"Idle",AHe=()=>"空闲",jHe=()=>"بی‌کار",THe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AHe():t==="fa"?jHe():zHe()}),MHe=()=>"Running",RHe=()=>"运行中",DHe=()=>"در حال اجرا",LHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RHe():t==="fa"?DHe():MHe()}),OHe=()=>"Starting",IHe=()=>"正在启动",BHe=()=>"در حال آغاز",$He=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IHe():t==="fa"?BHe():OHe()}),HHe=()=>"Copying…",PHe=()=>"正在复制…",FHe=()=>"در حال کپی…",UHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PHe():t==="fa"?FHe():HHe()}),qHe=()=>"Finalizing…",GHe=()=>"正在完成…",VHe=()=>"در حال نهایی‌سازی…",WHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GHe():t==="fa"?VHe():qHe()}),KHe=e=>`${e==null?void 0:e.size} free at target`,XHe=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,YHe=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,ZHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XHe(e):t==="fa"?YHe(e):KHe(e)}),QHe=e=>`Move all orx data to: +رونوشت آن برای همیشه حذف خواهد شد.`,mV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_V(e):t==="fa"?pV(e):dV(e)}),gV=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,bV=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,vV=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,xV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bV(e):t==="fa"?vV(e):gV(e)}),yV=()=>"Could not exit Plan mode. Try again.",wV=()=>"无法退出计划模式。请重试。",SV=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",kV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wV():t==="fa"?SV():yV()}),CV=()=>"Expand tool activity",EV=()=>"展开工具活动",NV=()=>"باز کردن فعالیت ابزارها",zV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EV():t==="fa"?NV():CV()}),AV=()=>"experiments",jV=()=>"实验",TV=()=>"آزمایش‌ها",MV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jV():t==="fa"?TV():AV()}),RV=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,DV=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,LV=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,OV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DV(e):t==="fa"?LV(e):RV(e)}),IV=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills)`,BV=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能)`,$V=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها)`,HV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?BV(e):t==="fa"?$V(e):IV(e)}),FV=e=>`Message not sent: ${e==null?void 0:e.error}`,PV=e=>`消息未发送:${e==null?void 0:e.error}`,UV=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,qV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PV(e):t==="fa"?UV(e):FV(e)}),GV=()=>"New session",VV=()=>"新会话",WV=()=>"نشست جدید",s6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VV():t==="fa"?WV():GV()}),KV=()=>"No active sessions",XV=()=>"没有活跃会话",YV=()=>"نشست فعالی وجود ندارد",ZV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XV():t==="fa"?YV():KV()}),QV=()=>"No activity",JV=()=>"无活动",eW=()=>"بدون فعالیت",tW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JV():t==="fa"?eW():QV()}),nW=()=>"No archived sessions",rW=()=>"没有已归档的会话",sW=()=>"نشست بایگانی‌شده‌ای وجود ندارد",iW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rW():t==="fa"?sW():nW()}),aW=()=>"No sessions yet",oW=()=>"还没有会话",lW=()=>"هنوز نشستی وجود ندارد",cW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oW():t==="fa"?lW():aW()}),uW=()=>"1 annotation",fW=()=>"1 条批注",hW=()=>"۱ یادداشت",dW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fW():t==="fa"?hW():uW()}),_W=()=>"Open sub-agent transcript",pW=()=>"打开子智能体记录",mW=()=>"باز کردن متن گفت‌وگوی عامل فرعی",gW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pW():t==="fa"?mW():_W()}),bW=()=>"About this demo",vW=()=>"关于此演示",xW=()=>"دربارهٔ این نسخهٔ نمایشی",i6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vW():t==="fa"?xW():bW()}),yW=()=>"Accept and auto mode",wW=()=>"接受并使用自动模式",SW=()=>"پذیرش و حالت خودکار",kW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wW():t==="fa"?SW():yW()}),CW=()=>"Accept and bypass all",EW=()=>"接受并跳过所有审批",NW=()=>"پذیرش و عبور از همهٔ تأییدها",zW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EW():t==="fa"?NW():CW()}),AW=()=>"Active",jW=()=>"活跃",TW=()=>"فعال",MW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jW():t==="fa"?TW():AW()}),RW=()=>"All",DW=()=>"全部",LW=()=>"همه",OW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DW():t==="fa"?LW():RW()}),IW=()=>"Allow",BW=()=>"允许",$W=()=>"اجازه دادن",HW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BW():t==="fa"?$W():IW()}),FW=()=>"Approval required",PW=()=>"需要批准",UW=()=>"نیازمند تأیید",qW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PW():t==="fa"?UW():FW()}),GW=()=>"Archived",VW=()=>"已归档",WW=()=>"بایگانی‌شده",a6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VW():t==="fa"?WW():GW()}),KW=()=>"Artifacts",XW=()=>"产物",YW=()=>"خروجی‌ها",ZW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XW():t==="fa"?YW():KW()}),QW=()=>"Ask about this",JW=()=>"询问此内容",eK=()=>"دربارهٔ این بپرسید",tK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JW():t==="fa"?eK():QW()}),nK=()=>"Attach a PDF or image",rK=()=>"附加 PDF 或图片",sK=()=>"پیوست PDF یا تصویر",o6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rK():t==="fa"?sK():nK()}),iK=()=>"Browsed the web",aK=()=>"已浏览网页",oK=()=>"وب مرور شد",l6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aK():t==="fa"?oK():iK()}),lK=()=>"Built the project",cK=()=>"已构建项目",uK=()=>"پروژه ساخته شد",fK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cK():t==="fa"?uK():lK()}),hK=()=>"Cancel",dK=()=>"取消",_K=()=>"لغو",pK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dK():t==="fa"?_K():hK()}),mK=()=>"Cancelled an experiment run",gK=()=>"已取消实验运行",bK=()=>"اجرای آزمایش لغو شد",vK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gK():t==="fa"?bK():mK()}),xK=()=>"Checked code style",yK=()=>"已检查代码风格",wK=()=>"سبک کد بررسی شد",SK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yK():t==="fa"?wK():xK()}),kK=()=>"Checked compute options",CK=()=>"已检查算力选项",EK=()=>"گزینه‌های رایانشی بررسی شد",NK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CK():t==="fa"?EK():kK()}),zK=()=>"Checked experiment status",AK=()=>"已检查实验状态",jK=()=>"وضعیت آزمایش بررسی شد",c6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AK():t==="fa"?jK():zK()}),TK=()=>"Checked Git status",MK=()=>"已检查 Git 状态",RK=()=>"وضعیت Git بررسی شد",DK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MK():t==="fa"?RK():TK()}),LK=()=>"Checked local times",OK=()=>"已查询当地时间",IK=()=>"زمان‌های محلی بررسی شد",BK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OK():t==="fa"?IK():LK()}),$K=()=>"Checked market data",HK=()=>"已查询市场数据",FK=()=>"داده‌های بازار بررسی شد",PK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HK():t==="fa"?FK():$K()}),UK=()=>"Checked sports data",qK=()=>"已查询体育数据",GK=()=>"داده‌های ورزشی بررسی شد",VK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qK():t==="fa"?GK():UK()}),WK=()=>"Checked the weather",KK=()=>"已查询天气",XK=()=>"آب‌وهوا بررسی شد",YK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KK():t==="fa"?XK():WK()}),ZK=()=>"Checked types",QK=()=>"已检查类型",JK=()=>"نوع‌ها بررسی شد",eX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QK():t==="fa"?JK():ZK()}),tX=()=>"Clear annotations",nX=()=>"清除批注",rX=()=>"پاک کردن یادداشت‌ها",u6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nX():t==="fa"?rX():tX()}),sX=()=>"Customize",iX=()=>"自定义",aX=()=>"سفارشی‌سازی",oX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iX():t==="fa"?aX():sX()}),lX=()=>"Data sources",cX=()=>"数据源",uX=()=>"منابع داده",g1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cX():t==="fa"?uX():lX()}),fX=()=>"Delegated a task to a new agent",hX=()=>"已将任务委派给新智能体",dX=()=>"وظیفه به عامل جدید واگذار شد",_X=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hX():t==="fa"?dX():fX()}),pX=()=>"Delete",mX=()=>"删除",gX=()=>"حذف",bX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),vX=()=>"Deny",xX=()=>"拒绝",yX=()=>"رد کردن",wX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xX():t==="fa"?yX():vX()}),SX=()=>"Edit and re-send",kX=()=>"编辑并重新发送",CX=()=>"ویرایش و ارسال دوباره",f6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),EX=()=>"Edit message",NX=()=>"编辑消息",zX=()=>"ویرایش پیام",AX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NX():t==="fa"?zX():EX()}),jX=()=>"Edited a file",TX=()=>"已编辑文件",MX=()=>"فایل ویرایش شد",h6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TX():t==="fa"?MX():jX()}),RX=()=>"Exit Plan mode",DX=()=>"退出计划模式",LX=()=>"خروج از حالت طرح",d6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DX():t==="fa"?LX():RX()}),OX=()=>"Experiments",IX=()=>"实验",BX=()=>"آزمایش‌ها",$X=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IX():t==="fa"?BX():OX()}),HX=()=>"Failed:",FX=()=>"失败:",PX=()=>"ناموفق:",M2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FX():t==="fa"?PX():HX()}),UX=()=>"Files",qX=()=>"文件",GX=()=>"فایل‌ها",VX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qX():t==="fa"?GX():UX()}),WX=()=>"Filter sessions",KX=()=>"筛选会话",XX=()=>"فیلتر نشست‌ها",_6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KX():t==="fa"?XX():WX()}),YX=()=>"is unavailable.",ZX=()=>"不可用。",QX=()=>"در دسترس نیست.",JX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZX():t==="fa"?QX():YX()}),eY=()=>"Later queued messages will wait until this is retried or removed.",tY=()=>"后续排队的消息会等待此消息重试或移除。",nY=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",rY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tY():t==="fa"?nY():eY()}),sY=()=>"Listed files",iY=()=>"已列出文件",aY=()=>"فایل‌ها فهرست شد",p6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iY():t==="fa"?aY():sY()}),oY=()=>"Listed project runs",lY=()=>"已列出项目运行",cY=()=>"اجراهای پروژه فهرست شد",uY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lY():t==="fa"?cY():oY()}),fY=()=>"Listed projects",hY=()=>"已列出项目",dY=()=>"پروژه‌ها فهرست شد",_Y=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hY():t==="fa"?dY():fY()}),pY=()=>"Loading conversation…",mY=()=>"正在加载对话…",gY=()=>"در حال بارگیری گفتگو…",bY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mY():t==="fa"?gY():pY()}),vY=()=>"Next version",xY=()=>"下一版本",yY=()=>"نسخهٔ بعدی",m6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xY():t==="fa"?yY():vY()}),wY=()=>"Open the session this agent spawned",SY=()=>"打开此智能体创建的会话",kY=()=>"باز کردن نشست ساخته‌شده توسط این عامل",CY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SY():t==="fa"?kY():wY()}),EY=()=>"Opened web pages",NY=()=>"已打开网页",zY=()=>"صفحه‌های وب باز شد",AY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NY():t==="fa"?zY():EY()}),jY=()=>"Plan",TY=()=>"计划",MY=()=>"طرح",RY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TY():t==="fa"?MY():jY()}),DY=()=>"Plan approved",LY=()=>"计划已批准",OY=()=>"طرح تأیید شد",IY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LY():t==="fa"?OY():DY()}),BY=()=>"Plan rejected",$Y=()=>"计划已拒绝",HY=()=>"طرح رد شد",FY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Y():t==="fa"?HY():BY()}),PY=()=>"Plan resolved",UY=()=>"计划已处理",qY=()=>"طرح تعیین تکلیف شد",GY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UY():t==="fa"?qY():PY()}),VY=()=>"Plan revision requested",WY=()=>"已请求修改计划",KY=()=>"درخواست بازنگری طرح ثبت شد",XY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WY():t==="fa"?KY():VY()}),YY=()=>"Previous version",ZY=()=>"上一版本",QY=()=>"نسخهٔ قبلی",g6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZY():t==="fa"?QY():YY()}),JY=()=>"Ran a command",eZ=()=>"已运行命令",tZ=()=>"فرمان اجرا شد",nZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eZ():t==="fa"?tZ():JY()}),rZ=()=>"Ran tests",sZ=()=>"已运行测试",iZ=()=>"آزمون‌ها اجرا شد",aZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sZ():t==="fa"?iZ():rZ()}),oZ=()=>"Read a file",lZ=()=>"已读取文件",cZ=()=>"فایل خوانده شد",uZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lZ():t==="fa"?cZ():oZ()}),fZ=()=>"Read Git history",hZ=()=>"已读取 Git 历史",dZ=()=>"تاریخچهٔ Git خوانده شد",_Z=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hZ():t==="fa"?dZ():fZ()}),pZ=()=>"Read project details",mZ=()=>"已读取项目详情",gZ=()=>"جزئیات پروژه خوانده شد",bZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mZ():t==="fa"?gZ():pZ()}),vZ=()=>"Reject",xZ=()=>"拒绝",yZ=()=>"رد کردن",wZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xZ():t==="fa"?yZ():vZ()}),SZ=()=>"Remove",kZ=()=>"移除",CZ=()=>"حذف",EZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kZ():t==="fa"?CZ():SZ()}),NZ=()=>"Remove annotation",zZ=()=>"移除批注",AZ=()=>"حذف یادداشت",jZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zZ():t==="fa"?AZ():NZ()}),TZ=()=>"Remove file",MZ=()=>"移除文件",RZ=()=>"حذف فایل",b6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MZ():t==="fa"?RZ():TZ()}),DZ=()=>"Remove image",LZ=()=>"移除图片",OZ=()=>"حذف تصویر",v6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LZ():t==="fa"?OZ():DZ()}),IZ=()=>"Remove queued message",BZ=()=>"移除排队消息",$Z=()=>"حذف پیام صف",x6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BZ():t==="fa"?$Z():IZ()}),HZ=()=>"Rename",FZ=()=>"重命名",PZ=()=>"تغییر نام",UZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FZ():t==="fa"?PZ():HZ()}),qZ=()=>"Reviewed code changes",GZ=()=>"已审查代码更改",VZ=()=>"تغییرات کد بازبینی شد",WZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GZ():t==="fa"?VZ():qZ()}),KZ=()=>"Selected chat text",XZ=()=>"已选聊天文本",YZ=()=>"متن انتخاب‌شدهٔ گفتگو",ZZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XZ():t==="fa"?YZ():KZ()}),QZ=()=>"Selected text:",JZ=()=>"已选文本:",eQ=()=>"متن انتخاب‌شده:",tQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JZ():t==="fa"?eQ():QZ()}),nQ=()=>"Send",rQ=()=>"发送",sQ=()=>"ارسال",Kb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rQ():t==="fa"?sQ():nQ()}),iQ=()=>"Session options",aQ=()=>"会话选项",oQ=()=>"گزینه‌های نشست",y6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aQ():t==="fa"?oQ():iQ()}),lQ=()=>"Session title",cQ=()=>"会话标题",uQ=()=>"عنوان نشست",fQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cQ():t==="fa"?uQ():lQ()}),hQ=()=>"Show sidebar",dQ=()=>"显示侧边栏",_Q=()=>"نمایش نوار کناری",w6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dQ():t==="fa"?_Q():hQ()}),pQ=()=>"Started an experiment run",mQ=()=>"已启动实验运行",gQ=()=>"اجرای آزمایش آغاز شد",bQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mQ():t==="fa"?gQ():pQ()}),vQ=()=>"Stop",xQ=()=>"停止",yQ=()=>"توقف",S6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xQ():t==="fa"?yQ():vQ()}),wQ=()=>"Submit",SQ=()=>"提交",kQ=()=>"ارسال",CQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SQ():t==="fa"?kQ():wQ()}),EQ=()=>"Task",NQ=()=>"任务",zQ=()=>"وظیفه",AQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NQ():t==="fa"?zQ():EQ()}),jQ=()=>"Tool failed",TQ=()=>"工具失败",MQ=()=>"ابزار ناموفق بود",RQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TQ():t==="fa"?MQ():jQ()}),DQ=()=>"Tool was interrupted",LQ=()=>"工具已中断",OQ=()=>"ابزار متوقف شد",IQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LQ():t==="fa"?OQ():DQ()}),BQ=()=>"Used tools",$Q=()=>"已使用工具",HQ=()=>"ابزارها استفاده شد",c9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Q():t==="fa"?HQ():BQ()}),FQ=()=>"View full plan",PQ=()=>"查看完整计划",UQ=()=>"مشاهدهٔ طرح کامل",qQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PQ():t==="fa"?UQ():FQ()}),GQ=()=>"Waited for an experiment run",VQ=()=>"已等待实验运行",WQ=()=>"برای اجرای آزمایش صبر شد",KQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VQ():t==="fa"?WQ():GQ()}),XQ=()=>"Waiting for your input…",YQ=()=>"正在等待你的输入…",ZQ=()=>"منتظر ورودی شما…",QQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YQ():t==="fa"?ZQ():XQ()}),JQ=()=>"What should we research?",eJ=()=>"我们应该研究什么?",tJ=()=>"چه چیزی را پژوهش کنیم؟",nJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eJ():t==="fa"?tJ():JQ()}),rJ=()=>"You, mid-task",sJ=()=>"你(任务进行中)",iJ=()=>"شما، هنگام انجام وظیفه",aJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sJ():t==="fa"?iJ():rJ()}),oJ=()=>"Pasted image",lJ=()=>"粘贴的图片",cJ=()=>"تصویر جای‌گذاری‌شده",uJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lJ():t==="fa"?cJ():oJ()}),fJ=()=>"Plan",hJ=()=>"计划",dJ=()=>"طرح",u9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hJ():t==="fa"?dJ():fJ()}),_J=()=>"Plan mode — ready to proceed?",pJ=()=>"计划模式 — 准备好继续了吗?",mJ=()=>"حالت طرح — آماده‌اید ادامه دهید؟",gJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pJ():t==="fa"?mJ():_J()}),bJ=()=>"Proposed plan",vJ=()=>"提议的计划",xJ=()=>"طرح پیشنهادی",k6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vJ():t==="fa"?xJ():bJ()}),yJ=()=>"Question",wJ=()=>"问题",SJ=()=>"پرسش",kJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wJ():t==="fa"?SJ():yJ()}),CJ=()=>"Queued",EJ=()=>"已排队",NJ=()=>"در صف",zJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EJ():t==="fa"?NJ():CJ()}),AJ=()=>"Recents",jJ=()=>"最近",TJ=()=>"اخیر",f9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jJ():t==="fa"?TJ():AJ()}),MJ=()=>"Re-check its setup.",RJ=()=>"请重新检查其设置。",DJ=()=>"راه‌اندازی آن را دوباره بررسی کنید.",LJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RJ():t==="fa"?DJ():MJ()}),OJ=()=>"Could not recover this turn. Try again.",IJ=()=>"无法恢复本轮。请重试。",BJ=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",$J=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),HJ=()=>"Could not remove the queued message. Try again.",FJ=()=>"无法移除排队消息。请重试。",PJ=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",UJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FJ():t==="fa"?PJ():HJ()}),qJ=e=>`Could not re-send: ${e==null?void 0:e.error}`,GJ=e=>`无法重新发送:${e==null?void 0:e.error}`,VJ=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,WJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GJ(e):t==="fa"?VJ(e):qJ(e)}),KJ=()=>"Resolved",XJ=()=>"已处理",YJ=()=>"رسیدگی شد",ZJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XJ():t==="fa"?YJ():KJ()}),QJ=()=>"Could not retry the queued message. Try again.",JJ=()=>"无法重试排队消息。请重试。",eee=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",tee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JJ():t==="fa"?eee():QJ()}),nee=()=>"run logs",ree=()=>"运行日志",see=()=>"گزارش‌های اجرا",iee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ree():t==="fa"?see():nee()}),aee=()=>"The selected harness is unavailable",oee=()=>"所选智能体工具不可用",lee=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",C6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oee():t==="fa"?lee():aee()}),cee=()=>"The chat session was not created",uee=()=>"未能创建聊天会话",fee=()=>"نشست گفت‌وگو ایجاد نشد",hee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uee():t==="fa"?fee():cee()}),dee=()=>" · Spawned by another agent",_ee=()=>" · 由另一个智能体创建",pee=()=>" · ساخته‌شده به‌دست عامل دیگر",mee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ee():t==="fa"?pee():dee()}),gee=()=>"Starting…",bee=()=>"正在启动…",vee=()=>"در حال شروع…",xee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bee():t==="fa"?vee():gee()}),yee=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,wee=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,See=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,kee=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wee(e):t==="fa"?See(e):yee(e)}),Cee=()=>"Could not stop the turn. Try again.",Eee=()=>"无法停止本轮。请重试。",Nee=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",zee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eee():t==="fa"?Nee():Cee()}),Aee=e=>`Could not switch fork: ${e==null?void 0:e.error}`,jee=e=>`无法切换分支:${e==null?void 0:e.error}`,Tee=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,Mee=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jee(e):t==="fa"?Tee(e):Aee(e)}),Ree=()=>"The agent",Dee=()=>"智能体",Lee=()=>"عامل",Oee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dee():t==="fa"?Lee():Ree()}),Iee=()=>"Thinking…",Bee=()=>"正在思考…",$ee=()=>"در حال فکر کردن…",Hee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bee():t==="fa"?$ee():Iee()}),Fee=()=>"Could not toggle Plan mode. Try again.",Pee=()=>"无法切换计划模式。请重试。",Uee=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",E6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pee():t==="fa"?Uee():Fee()}),qee=()=>"This turn did not finish.",Gee=()=>"本轮未完成。",Vee=()=>"این نوبت کامل نشد.",Wee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gee():t==="fa"?Vee():qee()}),Kee=()=>"Type a custom answer…",Xee=()=>"输入自定义回答…",Yee=()=>"پاسخ دلخواه را بنویسید…",Zee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xee():t==="fa"?Yee():Kee()}),Qee=()=>"Unarchive",Jee=()=>"取消归档",ete=()=>"خارج کردن از بایگانی",tte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jee():t==="fa"?ete():Qee()}),nte=()=>"Untitled",rte=()=>"未命名",ste=()=>"بدون عنوان",b1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rte():t==="fa"?ste():nte()}),ite=()=>"Could not update permissions. Try again.",ate=()=>"无法更新权限。请重试。",ote=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",lte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ate():t==="fa"?ote():ite()}),cte=()=>"Working…",ute=()=>"正在工作…",fte=()=>"در حال کار…",rp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ute():t==="fa"?fte():cte()}),hte=()=>"Close tab",dte=()=>"关闭标签页",_te=()=>"بستن زبانه",pte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dte():t==="fa"?_te():hte()}),mte=()=>"Changes",gte=()=>"更改",bte=()=>"تغییرات",vte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gte():t==="fa"?bte():mte()}),xte=()=>"Code browser view",yte=()=>"代码浏览器视图",wte=()=>"نمای مرورگر کد",Ste=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yte():t==="fa"?wte():xte()}),kte=()=>"Files",Cte=()=>"文件",Ete=()=>"فایل‌ها",Nte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cte():t==="fa"?Ete():kte()}),zte=()=>"Refresh",Ate=()=>"刷新",jte=()=>"تازه‌سازی",N6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ate():t==="fa"?jte():zte()}),Tte=()=>"listing truncated",Mte=()=>"列表已截断",Rte=()=>"فهرست کوتاه شده است",Dte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mte():t==="fa"?Rte():Tte()}),Lte=()=>"No files.",Ote=()=>"没有文件。",Ite=()=>"فایلی وجود ندارد.",Bte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ote():t==="fa"?Ite():Lte()}),$te=()=>"Refresh failed:",Hte=()=>"刷新失败:",Fte=()=>"تازه‌سازی ناموفق بود:",Pte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hte():t==="fa"?Fte():$te()}),Ute=()=>"Cancelling…",qte=()=>"正在取消…",Gte=()=>"در حال لغو…",Vte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qte():t==="fa"?Gte():Ute()}),Wte=()=>"Checking…",Kte=()=>"正在检查…",Xte=()=>"در حال بررسی…",sp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kte():t==="fa"?Xte():Wte()}),Yte=()=>"Copied",Zte=()=>"已复制",Qte=()=>"کپی شد",v0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zte():t==="fa"?Qte():Yte()}),Jte=e=>`Failed to load: ${e==null?void 0:e.error}`,ene=e=>`加载失败:${e==null?void 0:e.error}`,tne=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,h9=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ene(e):t==="fa"?tne(e):Jte(e)}),nne=()=>"Loading…",rne=()=>"正在加载…",sne=()=>"در حال بارگیری…",d9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rne():t==="fa"?sne():nne()}),ine=e=>`+ ${e==null?void 0:e.count} more`,ane=e=>`另有 ${e==null?void 0:e.count} 项`,one=e=>`${e==null?void 0:e.count}+ مورد دیگر`,lne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ane(e):t==="fa"?one(e):ine(e)}),cne=()=>"Rendered view",une=()=>"渲染视图",fne=()=>"نمای رندرشده",x0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?une():t==="fa"?fne():cne()}),hne=()=>"Save",dne=()=>"保存",_ne=()=>"ذخیره",ac=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dne():t==="fa"?_ne():hne()}),pne=()=>"Saving…",mne=()=>"正在保存…",gne=()=>"در حال ذخیره…",xa=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mne():t==="fa"?gne():pne()}),bne=()=>"Show less",vne=()=>"收起",xne=()=>"نمایش کمتر",_9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vne():t==="fa"?xne():bne()}),yne=()=>"Show more",wne=()=>"展开",Sne=()=>"نمایش بیشتر",kne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wne():t==="fa"?Sne():yne()}),Cne=()=>"Stop",Ene=()=>"停止",Nne=()=>"توقف",p9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Stopping…",Ane=()=>"正在停止…",jne=()=>"در حال توقف…",Tne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ane():t==="fa"?jne():zne()}),Mne=()=>"View source",Rne=()=>"查看源代码",Dne=()=>"نمایش متن منبع",iu=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rne():t==="fa"?Dne():Mne()}),Lne=e=>`Hugging Face token — ${e==null?void 0:e.summary}`,One=e=>`Hugging Face 令牌 — ${e==null?void 0:e.summary}`,Ine=e=>`توکن Hugging Face — ${e==null?void 0:e.summary}`,Bne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?One(e):t==="fa"?Ine(e):Lne(e)}),$ne=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,Hne=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,Fne=e=>`Kubeconfig — ${e==null?void 0:e.summary}`,Pne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Hne(e):t==="fa"?Fne(e):$ne(e)}),Une=()=>"No credentials required; this computer is always available.",qne=()=>"无需凭据;此计算机始终可用。",Gne=()=>"نیازی به اطلاعات ورود نیست؛ این رایانه همیشه در دسترس است.",Vne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qne():t==="fa"?Gne():Une()}),Wne=e=>`Modal token — ${e==null?void 0:e.summary}`,Kne=e=>`Modal 令牌 — ${e==null?void 0:e.summary}`,Xne=e=>`توکن Modal — ${e==null?void 0:e.summary}`,Yne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kne(e):t==="fa"?Xne(e):Wne(e)}),Zne=e=>`OpenResearch login and SSH key — ${e==null?void 0:e.summary}`,Qne=e=>`OpenResearch 登录信息和 SSH 密钥 — ${e==null?void 0:e.summary}`,Jne=e=>`ورود OpenResearch و کلید SSH — ${e==null?void 0:e.summary}`,ere=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Qne(e):t==="fa"?Jne(e):Zne(e)}),tre=e=>`Ray Jobs endpoint — ${e==null?void 0:e.summary}`,nre=e=>`Ray Jobs 端点 — ${e==null?void 0:e.summary}`,rre=e=>`endpoint مربوط به Ray Jobs — ${e==null?void 0:e.summary}`,sre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`SSH config — ${e==null?void 0:e.summary}`,are=e=>`SSH 配置 — ${e==null?void 0:e.summary}`,ore=e=>`پیکربندی SSH — ${e==null?void 0:e.summary}`,lre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),cre=e=>`SSH config and keys — ${e==null?void 0:e.summary}`,ure=e=>`SSH 配置和密钥 — ${e==null?void 0:e.summary}`,fre=e=>`پیکربندی و کلیدهای SSH — ${e==null?void 0:e.summary}`,hre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ure(e):t==="fa"?fre(e):cre(e)}),dre=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,_re=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,pre=e=>`TINKER_API_KEY — ${e==null?void 0:e.summary}`,mre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_re(e):t==="fa"?pre(e):dre(e)}),gre=()=>"Runs as a remote Hugging Face Job",bre=()=>"作为远程 Hugging Face Job 运行",vre=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",xre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bre():t==="fa"?vre():gre()}),yre=()=>"Runs as a Job on your Kubernetes cluster",wre=()=>"作为 Kubernetes 集群上的 Job 运行",Sre=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",kre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wre():t==="fa"?Sre():yre()}),Cre=()=>"Runs directly on this computer",Ere=()=>"直接在此计算机上运行",Nre=()=>"مستقیماً روی این رایانه اجرا می‌شود",zre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ere():t==="fa"?Nre():Cre()}),Are=()=>"Runs in a remote Modal sandbox",jre=()=>"在远程 Modal 沙箱中运行",Tre=()=>"در sandbox دوردست Modal اجرا می‌شود",Mre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jre():t==="fa"?Tre():Are()}),Rre=()=>"Runs on an ephemeral OpenResearch box",Dre=()=>"在临时 OpenResearch 主机上运行",Lre=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",Ore=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dre():t==="fa"?Lre():Rre()}),Ire=()=>"Runs on the connected Ray cluster",Bre=()=>"在已连接的 Ray 集群上运行",$re=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",Hre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bre():t==="fa"?$re():Ire()}),Fre=()=>"Runs as a scheduled job on your Slurm cluster",Pre=()=>"作为 Slurm 集群上的调度作业运行",Ure=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",qre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pre():t==="fa"?Ure():Fre()}),Gre=()=>"Runs on a host from your SSH config",Vre=()=>"在 SSH 配置中的主机上运行",Wre=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",Kre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vre():t==="fa"?Wre():Gre()}),Xre=()=>"Runs through Tinker’s remote compute",Yre=()=>"通过 Tinker 远程算力运行",Zre=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",Qre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yre():t==="fa"?Zre():Xre()}),Jre=()=>"HF Jobs",ese=()=>"HF Jobs",tse=()=>"HF Jobs",nse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ese():t==="fa"?tse():Jre()}),rse=()=>"Kubernetes",sse=()=>"Kubernetes",ise=()=>"Kubernetes",ase=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sse():t==="fa"?ise():rse()}),ose=()=>"This machine",lse=()=>"此计算机",cse=()=>"این رایانه",m9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lse():t==="fa"?cse():ose()}),use=()=>"Modal",fse=()=>"Modal",hse=()=>"Modal",dse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fse():t==="fa"?hse():use()}),_se=()=>"OpenResearch",pse=()=>"OpenResearch",mse=()=>"OpenResearch",gse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pse():t==="fa"?mse():_se()}),bse=()=>"Ray",vse=()=>"Ray",xse=()=>"Ray",yse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vse():t==="fa"?xse():bse()}),wse=()=>"Slurm",Sse=()=>"Slurm",kse=()=>"Slurm",Cse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sse():t==="fa"?kse():wse()}),Ese=()=>"SSH",Nse=()=>"SSH",zse=()=>"SSH",Ase=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nse():t==="fa"?zse():Ese()}),jse=()=>"Tinker",Tse=()=>"Tinker",Mse=()=>"Tinker",Rse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tse():t==="fa"?Mse():jse()}),Dse=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",Lse=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",Ose=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",Ise=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lse():t==="fa"?Ose():Dse()}),Bse=()=>"A Kubernetes Job is created in the selected context and namespace from the project’s .orx/k8s.yaml manifest.",$se=()=>"系统根据项目的 .orx/k8s.yaml 清单,在所选上下文和命名空间中创建 Kubernetes Job。",Hse=()=>"بر پایهٔ مانیفست .orx/k8s.yaml پروژه، یک Kubernetes Job در زمینه و فضای نام انتخاب‌شده ساخته می‌شود.",Fse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$se():t==="fa"?Hse():Bse()}),Pse=()=>"The experiment runs as a supervised process on this computer and uses its CPU, memory, and GPUs.",Use=()=>"实验作为受监管进程在此计算机上运行,并使用其 CPU、内存和 GPU。",qse=()=>"آزمایش به‌صورت فرایندی تحت نظارت روی این رایانه اجرا می‌شود و از CPU، حافظه و GPUهای آن استفاده می‌کند.",Gse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Use():t==="fa"?qse():Pse()}),Vse=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",Wse=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",Kse=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",Xse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wse():t==="fa"?Kse():Vse()}),Yse=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",Zse=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",Qse=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",Jse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zse():t==="fa"?Qse():Yse()}),eie=()=>"The run is submitted to the Ray Jobs endpoint, and the connected Ray cluster executes it.",tie=()=>"运行会提交到 Ray Jobs 端点,并由已连接的 Ray 集群执行。",nie=()=>"اجرا به endpoint مربوط به Ray Jobs فرستاده و توسط خوشهٔ متصل Ray اجرا می‌شود.",rie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tie():t==="fa"?nie():eie()}),sie=()=>"The login node receives an sbatch job using the saved partition, account, and time limit; the cluster schedules the work.",iie=()=>"登录节点使用已保存的分区、账户和时间限制接收 sbatch 作业;集群负责调度。",aie=()=>"گرهٔ ورود یک کار sbatch با پارتیشن، حساب و محدودیت زمانی ذخیره‌شده دریافت می‌کند و خوشه آن را زمان‌بندی می‌کند.",oie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iie():t==="fa"?aie():sie()}),lie=()=>"The project is copied to the selected SSH host and runs there. Logs and status return to this dashboard.",cie=()=>"项目会复制到所选 SSH 主机并在那里运行。日志和状态会返回此控制台。",uie=()=>"پروژه به میزبان SSH انتخاب‌شده کپی و همان‌جا اجرا می‌شود. گزارش‌ها و وضعیت به این داشبورد برمی‌گردند.",fie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cie():t==="fa"?uie():lie()}),hie=()=>"A controller runs here while the Tinker SDK sends model operations to remote compute. This computer must stay awake and online.",die=()=>"控制器在此计算机上运行,Tinker SDK 将模型操作发送到远程算力。此计算机必须保持唤醒和联网。",_ie=()=>"کنترل‌گر روی این رایانه اجرا می‌شود و Tinker SDK عملیات مدل را به رایانش دوردست می‌فرستد. این رایانه باید روشن و آنلاین بماند.",pie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?die():t==="fa"?_ie():hie()}),mie=()=>"Context window",gie=()=>"上下文窗口",bie=()=>"پنجرهٔ زمینه",vie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gie():t==="fa"?bie():mie()}),xie=()=>"Context window used",yie=()=>"已使用的上下文窗口",wie=()=>"پنجرهٔ زمینهٔ استفاده‌شده",Sie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yie():t==="fa"?wie():xie()}),kie=e=>`${e==null?void 0:e.value} tokens`,Cie=e=>`${e==null?void 0:e.value} 个 token`,Eie=e=>`${e==null?void 0:e.value} توکن`,Nie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Cie(e):t==="fa"?Eie(e):kie(e)}),zie=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Aie=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,jie=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Aie(e):t==="fa"?jie(e):zie(e)}),Mie=()=>"No runs yet — ask the agent to launch one.",Rie=()=>"尚无运行——让智能体启动一个。",Die=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Lie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rie():t==="fa"?Die():Mie()}),Oie=()=>"Run",Iie=()=>"运行",Bie=()=>"اجرا",z6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iie():t==="fa"?Bie():Oie()}),$ie=()=>"Switch run",Hie=()=>"切换运行",Fie=()=>"تغییر اجرا",Pie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hie():t==="fa"?Fie():$ie()}),Uie=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,qie=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Gie=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qie(e):t==="fa"?Gie(e):Uie(e)}),Wie=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Kie=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Xie=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Yie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kie(e):t==="fa"?Xie(e):Wie(e)}),Zie=e=>`${e==null?void 0:e.value}m`,Qie=e=>`${e==null?void 0:e.value} 分钟`,Jie=e=>`${e==null?void 0:e.value} دقیقه`,eae=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Qie(e):t==="fa"?Jie(e):Zie(e)}),tae=e=>`${e==null?void 0:e.value}s`,nae=e=>`${e==null?void 0:e.value} 秒`,rae=e=>`${e==null?void 0:e.value} ثانیه`,sae=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nae(e):t==="fa"?rae(e):tae(e)}),iae=()=>"Code",aae=()=>"代码",oae=()=>"کد",lae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aae():t==="fa"?oae():iae()}),cae=()=>"created",uae=()=>"创建于",fae=()=>"ایجادشده",hae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uae():t==="fa"?fae():cae()}),dae=()=>"from",_ae=()=>"来自",pae=()=>"از",mae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ae():t==="fa"?pae():dae()}),gae=()=>"Logs",bae=()=>"日志",vae=()=>"گزارش‌ها",xae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bae():t==="fa"?vae():gae()}),yae=()=>"Latest run",wae=()=>"最新运行",Sae=()=>"آخرین اجرا",kae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wae():t==="fa"?Sae():yae()}),Cae=()=>"Code",Eae=()=>"代码",Nae=()=>"کد",zae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eae():t==="fa"?Nae():Cae()}),Aae=()=>"Commit",jae=()=>"提交",Tae=()=>"کامیت",Mae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jae():t==="fa"?Tae():Aae()}),Rae=()=>"created",Dae=()=>"创建于",Lae=()=>"ایجادشده",Oae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dae():t==="fa"?Lae():Rae()}),Iae=()=>"Description",Bae=()=>"说明",$ae=()=>"توضیحات",Hae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bae():t==="fa"?$ae():Iae()}),Fae=()=>"Duration",Pae=()=>"时长",Uae=()=>"مدت",qae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pae():t==="fa"?Uae():Fae()}),Gae=()=>"exit",Vae=()=>"退出码",Wae=()=>"خروج",Kae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vae():t==="fa"?Wae():Gae()}),Xae=()=>"from",Yae=()=>"来自",Zae=()=>"از",Qae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yae():t==="fa"?Zae():Xae()}),Jae=()=>"Logs",eoe=()=>"日志",toe=()=>"گزارش‌ها",noe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eoe():t==="fa"?toe():Jae()}),roe=()=>"Run",soe=()=>"运行",ioe=()=>"اجرا",aoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?soe():t==="fa"?ioe():roe()}),ooe=()=>"Run history",loe=()=>"运行历史",coe=()=>"تاریخچهٔ اجرا",uoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?loe():t==="fa"?coe():ooe()}),foe=()=>"Started",hoe=()=>"开始时间",doe=()=>"آغاز",_oe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hoe():t==="fa"?doe():foe()}),poe=()=>"Runs",moe=()=>"运行",goe=()=>"اجراها",boe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?moe():t==="fa"?goe():poe()}),voe=()=>"No runs yet",xoe=()=>"还没有运行",yoe=()=>"هنوز اجرایی وجود ندارد",woe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xoe():t==="fa"?yoe():voe()}),Soe=()=>"No experiments yet.",koe=()=>"还没有实验。",Coe=()=>"هنوز آزمایشی وجود ندارد.",Eoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?koe():t==="fa"?Coe():Soe()}),Noe=()=>"Not run yet",zoe=()=>"尚未运行",Aoe=()=>"هنوز اجرا نشده",joe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zoe():t==="fa"?Aoe():Noe()}),Toe=()=>"1 run",Moe=()=>"1 次运行",Roe=()=>"۱ اجرا",Doe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Moe():t==="fa"?Roe():Toe()}),Loe=()=>"Open logs",Ooe=()=>"打开日志",Ioe=()=>"باز کردن گزارش‌ها",Boe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),$oe=e=>`${e==null?void 0:e.count} runs`,Hoe=e=>`${e==null?void 0:e.count} 次运行`,Foe=e=>`${e==null?void 0:e.count} اجرا`,Poe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Hoe(e):t==="fa"?Foe(e):$oe(e)}),Uoe=()=>"Stop requested",qoe=()=>"已请求停止",Goe=()=>"درخواست توقف ثبت شد",Voe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qoe():t==="fa"?Goe():Uoe()}),Woe=()=>"Stop run",Koe=()=>"停止运行",Xoe=()=>"توقف اجرا",Yoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Koe():t==="fa"?Xoe():Woe()}),Zoe=()=>"Code",Qoe=()=>"代码",Joe=()=>"کد",ele=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qoe():t==="fa"?Joe():Zoe()}),tle=()=>"Experiments",nle=()=>"实验",rle=()=>"آزمایش‌ها",sle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nle():t==="fa"?rle():tle()}),ile=()=>"Logs",ale=()=>"日志",ole=()=>"گزارش‌ها",lle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ale():t==="fa"?ole():ile()}),cle=()=>"Stop failed:",ule=()=>"停止失败:",fle=()=>"توقف ناموفق بود:",hle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ule():t==="fa"?fle():cle()}),dle=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,_le=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,ple=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,mle=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_le(e):t==="fa"?ple(e):dle(e)}),gle=()=>"Binary file — no inline preview.",ble=()=>"二进制文件——无法内嵌预览。",vle=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",xle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ble():t==="fa"?vle():gle()}),yle=()=>"Compile failed",wle=()=>"编译失败",Sle=()=>"کامپایل ناموفق بود",kle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wle():t==="fa"?Sle():yle()}),Cle=()=>"Compile PDF",Ele=()=>"编译 PDF",Nle=()=>"کامپایل PDF",A6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),zle=()=>"Compiled, but the engine reported errors — check the output below.",Ale=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",jle=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",Tle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ale():t==="fa"?jle():zle()}),Mle=()=>"Copy command",Rle=()=>"复制命令",Dle=()=>"کپی فرمان",Lle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rle():t==="fa"?Dle():Mle()}),Ole=()=>"Copy install command",Ile=()=>"复制安装命令",Ble=()=>"کپی فرمان نصب",$le=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ile():t==="fa"?Ble():Ole()}),Hle=()=>"Discard my edits and reload",Fle=()=>"放弃我的编辑并重新加载",Ple=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Ule=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fle():t==="fa"?Ple():Hle()}),qle=()=>"Dismiss",Gle=()=>"关闭",Vle=()=>"بستن",j6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gle():t==="fa"?Vle():qle()}),Wle=()=>"Dismiss compile message",Kle=()=>"关闭编译消息",Xle=()=>"بستن پیام کامپایل",Yle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kle():t==="fa"?Xle():Wle()}),Zle=()=>"Dismiss Overleaf message",Qle=()=>"关闭 Overleaf 消息",Jle=()=>"بستن پیام Overleaf",ece=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qle():t==="fa"?Jle():Zle()}),tce=()=>"Download",nce=()=>"下载",rce=()=>"بارگیری",g9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nce():t==="fa"?rce():tce()}),sce=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,ice=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,ace=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,oce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ice(e):t==="fa"?ace(e):sce(e)}),lce=()=>"Failed to load file:",cce=()=>"加载文件失败:",uce=()=>"بارگیری فایل ناموفق بود:",fce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cce():t==="fa"?uce():lce()}),hce=()=>"File truncated — showing the first 512 KB.",dce=()=>"文件已截断——仅显示前 512 KB。",_ce=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",pce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dce():t==="fa"?_ce():hce()}),mce=()=>"Loading…",gce=()=>"正在加载…",bce=()=>"در حال بارگیری…",vce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gce():t==="fa"?bce():mce()}),xce=()=>"File not found.",yce=()=>"找不到文件。",wce=()=>"فایل پیدا نشد.",Sce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yce():t==="fa"?wce():xce()}),kce=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,Cce=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,Ece=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,Nce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Cce(e):t==="fa"?Ece(e):kce(e)}),zce=e=>`File not found on branch ${e==null?void 0:e.branch}.`,Ace=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,jce=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,Tce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ace(e):t==="fa"?jce(e):zce(e)}),Mce=()=>"File not found on disk.",Rce=()=>"磁盘上找不到此文件。",Dce=()=>"فایل روی دیسک پیدا نشد.",Lce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rce():t==="fa"?Dce():Mce()}),Oce=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Ice=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,Bce=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,$ce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ice(e):t==="fa"?Bce(e):Oce(e)}),Hce=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Fce=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Pce=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Uce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fce(e):t==="fa"?Pce(e):Hce(e)}),qce=()=>"Open in default editor",Gce=()=>"在默认编辑器中打开",Vce=()=>"باز کردن در ویرایشگر پیش‌فرض",T6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gce():t==="fa"?Vce():qce()}),Wce=()=>"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.",Kce=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",Xce=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Yce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kce():t==="fa"?Xce():Wce()}),Zce=()=>"Compiled PDF is out of date",Qce=()=>"已编译的 PDF 不是最新版本",Jce=()=>"PDF کامپایل‌شده به‌روز نیست",eue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qce():t==="fa"?Jce():Zce()}),tue=()=>"project clone",nue=()=>"项目克隆",rue=()=>"کلون پروژه",b_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nue():t==="fa"?rue():tue()}),sue=()=>"Recompile PDF",iue=()=>"重新编译 PDF",aue=()=>"کامپایل دوبارهٔ PDF",M6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iue():t==="fa"?aue():sue()}),oue=()=>"Reload file",lue=()=>"重新加载文件",cue=()=>"بارگیری دوبارهٔ فایل",R6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lue():t==="fa"?cue():oue()}),uue=()=>"Save failed",fue=()=>"保存失败",hue=()=>"ذخیره ناموفق بود",due=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fue():t==="fa"?hue():uue()}),_ue=()=>"Saving…",pue=()=>"正在保存…",mue=()=>"در حال ذخیره…",gue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),bue=()=>"Selected — press ⌘C",vue=()=>"已选中 — 按 ⌘C 复制",xue=()=>"انتخاب شد — برای کپی ⌘C را بزنید",yue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vue():t==="fa"?xue():bue()}),wue=()=>"session’s worktree",Sue=()=>"会话工作树",kue=()=>"درخت کاری نشست",v_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Cue=()=>"Show compiled PDF",Eue=()=>"显示已编译的 PDF",Nue=()=>"نمایش PDF کامپایل‌شده",D6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eue():t==="fa"?Nue():Cue()}),zue=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",Aue=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",jue=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",Tue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aue():t==="fa"?jue():zue()}),Mue=()=>"This session's worktree isn't available — showing the project clone's copy.",Rue=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",Due=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",Lue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rue():t==="fa"?Due():Mue()}),Oue=()=>"Unsaved",Iue=()=>"未保存",Bue=()=>"ذخیره نشده",$ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iue():t==="fa"?Bue():Oue()}),Hue=()=>"Unsaved — ⌘S or click away to save",Fue=()=>"未保存 — 按 ⌘S 或点击其他位置保存",Pue=()=>"ذخیره نشده — ⌘S را بزنید یا برای ذخیره بیرون کلیک کنید",Uue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fue():t==="fa"?Pue():Hue()}),que=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",Gue=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",Vue=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",Wue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gue():t==="fa"?Vue():que()}),Kue=()=>"Back to preview",Xue=()=>"返回预览",Yue=()=>"بازگشت به پیش‌نمایش",Zue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xue():t==="fa"?Yue():Kue()}),Que=e=>`${e==null?void 0:e.count} changed files`,Jue=e=>`${e==null?void 0:e.count} 个已更改文件`,efe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,tfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jue(e):t==="fa"?efe(e):Que(e)}),nfe=()=>"Changed files",rfe=()=>"已更改文件",sfe=()=>"فایل‌های تغییرکرده",ife=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rfe():t==="fa"?sfe():nfe()}),afe=()=>"Diff preview truncated",ofe=()=>"差异预览已截断",lfe=()=>"پیش‌نمایش تفاوت کوتاه شده است",cfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ofe():t==="fa"?lfe():afe()}),ufe=e=>`${e==null?void 0:e.count} files shown (partial)`,ffe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hfe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,dfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ffe(e):t==="fa"?hfe(e):ufe(e)}),_fe=()=>"No changes.",pfe=()=>"没有更改。",mfe=()=>"تغییری وجود ندارد.",gfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pfe():t==="fa"?mfe():_fe()}),bfe=()=>"No complete file preview was available before the cutoff.",vfe=()=>"在截断位置之前没有完整的文件预览。",xfe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",yfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vfe():t==="fa"?xfe():bfe()}),wfe=()=>"No textual diff for this file.",Sfe=()=>"此文件没有文本差异。",kfe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Cfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sfe():t==="fa"?kfe():wfe()}),Efe=()=>"1 changed file",Nfe=()=>"1 个已更改文件",zfe=()=>"۱ فایل تغییرکرده",Afe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nfe():t==="fa"?zfe():Efe()}),jfe=()=>"1 file shown (partial)",Tfe=()=>"显示 1 个文件(部分)",Mfe=()=>"۱ فایل نمایش داده شده (ناقص)",Rfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tfe():t==="fa"?Mfe():jfe()}),Dfe=()=>"Unable to parse this diff.",Lfe=()=>"无法解析此差异。",Ofe=()=>"خواندن این تفاوت ممکن نبود.",Ife=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lfe():t==="fa"?Ofe():Dfe()}),Bfe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$fe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Hfe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Ffe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$fe(e):t==="fa"?Hfe(e):Bfe(e)}),Pfe=()=>"View full diff",Ufe=()=>"查看完整差异",qfe=()=>"نمایش تفاوت کامل",Gfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ufe():t==="fa"?qfe():Pfe()}),Vfe=()=>"Create a token ↗",Wfe=()=>"创建令牌 ↗",Kfe=()=>"ساخت توکن ↗",Xfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wfe():t==="fa"?Kfe():Vfe()}),Yfe=()=>"All projects",Zfe=()=>"所有项目",Qfe=()=>"همهٔ پروژه‌ها",L6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zfe():t==="fa"?Qfe():Yfe()}),Jfe=()=>"Configure Repository",ehe=()=>"配置仓库",the=()=>"پیکربندی مخزن",nhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ehe():t==="fa"?the():Jfe()}),rhe=()=>"Create a new project",she=()=>"新建项目",ihe=()=>"ایجاد پروژهٔ جدید",ahe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Hide sidebar",lhe=()=>"隐藏侧边栏",che=()=>"پنهان کردن نوار کناری",O6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),uhe=()=>"Project",fhe=()=>"项目",hhe=()=>"پروژه",dhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fhe():t==="fa"?hhe():uhe()}),_he=e=>`${e==null?void 0:e.count} cancelled`,phe=e=>`${e==null?void 0:e.count} 次取消`,mhe=e=>`${e==null?void 0:e.count} لغوشده`,ghe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?phe(e):t==="fa"?mhe(e):_he(e)}),bhe=e=>`${e==null?void 0:e.count} done`,vhe=e=>`${e==null?void 0:e.count} 次完成`,xhe=e=>`${e==null?void 0:e.count} تمام‌شده`,yhe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vhe(e):t==="fa"?xhe(e):bhe(e)}),whe=e=>`${e==null?void 0:e.count} failed`,She=e=>`${e==null?void 0:e.count} 次失败`,khe=e=>`${e==null?void 0:e.count} ناموفق`,Che=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?She(e):t==="fa"?khe(e):whe(e)}),Ehe=e=>`${e==null?void 0:e.count} files`,Nhe=e=>`${e==null?void 0:e.count} 个文件`,zhe=e=>`${e==null?void 0:e.count} فایل`,Ahe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),jhe=e=>`${e==null?void 0:e.count}+ files`,The=e=>`至少 ${e==null?void 0:e.count} 个文件`,Mhe=e=>`بیش از ${e==null?void 0:e.count} فایل`,Rhe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?The(e):t==="fa"?Mhe(e):jhe(e)}),Dhe=e=>`${e==null?void 0:e.count} live`,Lhe=e=>`${e==null?void 0:e.count} 次进行中`,Ohe=e=>`${e==null?void 0:e.count} فعال`,Ihe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Lhe(e):t==="fa"?Ohe(e):Dhe(e)}),Bhe=()=>"1 file",$he=()=>"1 个文件",Hhe=()=>"۱ فایل",Fhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$he():t==="fa"?Hhe():Bhe()}),Phe=()=>"1 run",Uhe=()=>"1 次运行",qhe=()=>"۱ اجرا",Ghe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uhe():t==="fa"?qhe():Phe()}),Vhe=e=>`${e==null?void 0:e.count} runs`,Whe=e=>`${e==null?void 0:e.count} 次运行`,Khe=e=>`${e==null?void 0:e.count} اجرا`,Xhe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Whe(e):t==="fa"?Khe(e):Vhe(e)}),Yhe=()=>"No instances yet.",Zhe=()=>"还没有实例。",Qhe=()=>"هنوز نمونه‌ای وجود ندارد.",Jhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zhe():t==="fa"?Qhe():Yhe()}),ede=()=>"Nothing running right now.",tde=()=>"当前没有运行中的实例。",nde=()=>"اکنون چیزی در حال اجرا نیست.",rde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tde():t==="fa"?nde():ede()}),sde=()=>"Select a project to see its history.",ide=()=>"请选择一个项目以查看其历史记录。",ade=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",ode=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ide():t==="fa"?ade():sde()}),lde=()=>"Select a project to see its runs.",cde=()=>"请选择一个项目以查看其运行。",ude=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",fde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cde():t==="fa"?ude():lde()}),hde=()=>"View history",dde=()=>"查看历史记录",_de=()=>"مشاهدهٔ تاریخچه",pde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dde():t==="fa"?_de():hde()}),mde=e=>`View history (${e==null?void 0:e.count})`,gde=e=>`查看历史记录(${e==null?void 0:e.count})`,bde=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,vde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gde(e):t==="fa"?bde(e):mde(e)}),xde=()=>"The engine exited without producing a PDF or a log.",yde=()=>"引擎已退出,但没有生成 PDF 或日志。",wde=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",Sde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yde():t==="fa"?wde():xde()}),kde=()=>"Loading…",Cde=()=>"正在加载…",Ede=()=>"در حال بارگیری…",Nde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cde():t==="fa"?Ede():kde()}),zde=()=>"Copy",Ade=()=>"复制",jde=()=>"کپی",b9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ade():t==="fa"?jde():zde()}),Tde=()=>"Copy code",Mde=()=>"复制代码",Rde=()=>"کپی کد",Dde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mde():t==="fa"?Rde():Tde()}),Lde=()=>"Download",Ode=()=>"下载",Ide=()=>"بارگیری",v9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ode():t==="fa"?Ide():Lde()}),Bde=()=>"This browser can’t preview this media format.",$de=()=>"此浏览器无法预览该媒体格式。",Hde=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Fde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$de():t==="fa"?Hde():Bde()}),Pde=()=>" · CLI configuration",Ude=()=>" · CLI 配置",qde=()=>" · پیکربندی CLI",x9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ude():t==="fa"?qde():Pde()}),Gde=()=>"· Default",Vde=()=>"· 默认",Wde=()=>"· پیش‌فرض",y9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vde():t==="fa"?Wde():Gde()}),Kde=()=>"Default model",Xde=()=>"默认模型",Yde=()=>"مدل پیش‌فرض",I6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xde():t==="fa"?Yde():Kde()}),Zde=()=>"Detecting harnesses…",Qde=()=>"正在检测智能体工具…",Jde=()=>"در حال شناسایی ابزارهای عامل…",e_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qde():t==="fa"?Jde():Zde()}),t_e=()=>"Effort",n_e=()=>"推理强度",r_e=()=>"میزان استدلال",s_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n_e():t==="fa"?r_e():t_e()}),i_e=()=>"Fast speed ·",a_e=()=>"快速 ·",o_e=()=>"سرعت بالا ·",l_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a_e():t==="fa"?o_e():i_e()}),c_e=()=>"Mode",u_e=()=>"模式",f_e=()=>"حالت",B6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u_e():t==="fa"?f_e():c_e()}),h_e=()=>"Model",d_e=()=>"模型",__e=()=>"مدل",v1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d_e():t==="fa"?__e():h_e()}),p_e=e=>`${e==null?void 0:e.count} more — search to find`,m_e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,g_e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,b_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m_e(e):t==="fa"?g_e(e):p_e(e)}),v_e=()=>"Not available",x_e=()=>"不可用",y_e=()=>"در دسترس نیست",w_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x_e():t==="fa"?y_e():v_e()}),S_e=()=>"Search models…",k_e=()=>"搜索模型…",C_e=()=>"جست‌وجوی مدل‌ها…",E_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k_e():t==="fa"?C_e():S_e()}),N_e=()=>"Sessions keep their harness — new chat to switch",z_e=()=>"会话会保留其智能体工具——新建聊天即可切换",A_e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند — برای تغییر، گفتگوی جدیدی بسازید",j_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z_e():t==="fa"?A_e():N_e()}),T_e=()=>"Speed",M_e=()=>"速度",R_e=()=>"سرعت",$6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M_e():t==="fa"?R_e():T_e()}),D_e=()=>"Unavailable",L_e=()=>"不可用",O_e=()=>"در دسترس نیست",w9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,B_e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,$_e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,H_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B_e(e):t==="fa"?$_e(e):I_e(e)}),F_e=()=>"Variant",P_e=()=>"变体",U_e=()=>"گونه",q_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P_e():t==="fa"?U_e():F_e()}),G_e=()=>"Advanced",V_e=()=>"高级",W_e=()=>"پیشرفته",K_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V_e():t==="fa"?W_e():G_e()}),X_e=()=>"Advanced · Connect GitHub",Y_e=()=>"高级 · 连接 GitHub",Z_e=()=>"پیشرفته · اتصال GitHub",Q_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y_e():t==="fa"?Z_e():X_e()}),J_e=()=>"Advanced · GitHub sync on",e0e=()=>"高级 · GitHub 同步已开启",t0e=()=>"پیشرفته · همگام‌سازی GitHub روشن است",n0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e0e():t==="fa"?t0e():J_e()}),r0e=()=>"Choose a different destination. A paper project needs a new or empty folder of its own, outside any Git repository.",s0e=()=>"请选择其他位置。论文项目需要位于任何 Git 仓库之外,并拥有独立的新文件夹或空文件夹。",i0e=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید بیرون از هر مخزن Git، پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",a0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s0e():t==="fa"?i0e():r0e()}),o0e=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,l0e=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,c0e=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,u0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?l0e(e):t==="fa"?c0e(e):o0e(e)}),f0e=()=>"Choose an existing project folder",h0e=()=>"选择现有项目文件夹",d0e=()=>"انتخاب پوشهٔ موجود پروژه",H6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h0e():t==="fa"?d0e():f0e()}),_0e=()=>"Choosing…",p0e=()=>"正在选择…",m0e=()=>"در حال انتخاب…",g0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p0e():t==="fa"?m0e():_0e()}),b0e=()=>"Clone destination",v0e=()=>"克隆位置",x0e=()=>"مقصد کلون",y0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v0e():t==="fa"?x0e():b0e()}),w0e=()=>"Clone paper project",S0e=()=>"克隆论文项目",k0e=()=>"کلون پروژهٔ مقاله",C0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S0e():t==="fa"?k0e():w0e()}),E0e=()=>"Create project",N0e=()=>"创建项目",z0e=()=>"ایجاد پروژه",F6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N0e():t==="fa"?z0e():E0e()}),A0e=()=>"Creating…",j0e=()=>"正在创建…",T0e=()=>"در حال ایجاد…",M0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j0e():t==="fa"?T0e():A0e()}),R0e=()=>"Choose a different destination. This path is a file, not a folder.",D0e=()=>"请选择其他位置。此路径是文件,不是文件夹。",L0e=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",x1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D0e():t==="fa"?L0e():R0e()}),O0e=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",I0e=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",B0e=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",$0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I0e():t==="fa"?B0e():O0e()}),H0e=()=>"Fork project",F0e=()=>"创建复刻项目",P0e=()=>"ایجاد شاخه (فورک)",U0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F0e():t==="fa"?P0e():H0e()}),q0e=()=>"Fork destination",G0e=()=>"复刻位置",V0e=()=>"مقصد فورک",W0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G0e():t==="fa"?V0e():q0e()}),K0e=()=>"Blank project",X0e=()=>"空白项目",Y0e=()=>"پروژهٔ خالی",Z0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X0e():t==="fa"?Y0e():K0e()}),Q0e=()=>"Cancel",J0e=()=>"取消",epe=()=>"لغو",tpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J0e():t==="fa"?epe():Q0e()}),npe=()=>"Change",rpe=()=>"更改",spe=()=>"تغییر",ipe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rpe():t==="fa"?spe():npe()}),ape=()=>"Change selected paper",ope=()=>"更改所选论文",lpe=()=>"تغییر مقالهٔ انتخاب‌شده",cpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ope():t==="fa"?lpe():ape()}),upe=()=>"Check out a Git branch before using this folder.",fpe=()=>"使用此文件夹前,请先检出一个 Git 分支。",hpe=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",dpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fpe():t==="fa"?hpe():upe()}),_pe=()=>"Checking project location.",ppe=()=>"正在检查项目位置。",mpe=()=>"در حال بررسی محل پروژه.",P6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ppe():t==="fa"?mpe():_pe()}),gpe=()=>"Enter a public GitHub repository URL.",bpe=()=>"请输入公开的 GitHub 仓库 URL。",vpe=()=>"نشانی مخزن عمومی GitHub را وارد کنید.",xpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bpe():t==="fa"?vpe():gpe()}),ype=()=>"Enter a valid GitHub repository URL.",wpe=()=>"请输入有效的 GitHub 仓库 URL。",Spe=()=>"یک نشانی مخزن GitHub معتبر وارد کنید.",kpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wpe():t==="fa"?Spe():ype()}),Cpe=()=>"Existing folder",Epe=()=>"现有文件夹",Npe=()=>"پوشهٔ موجود",zpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Epe():t==="fa"?Npe():Cpe()}),Ape=()=>"Experiment branches will be pushed to the remote GitHub repository.",jpe=()=>"实验分支将推送到远程 GitHub 仓库。",Tpe=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Mpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jpe():t==="fa"?Tpe():Ape()}),Rpe=()=>"From a paper",Dpe=()=>"从论文创建",Lpe=()=>"از یک مقاله",Ope=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dpe():t==="fa"?Lpe():Rpe()}),Ipe=()=>"From GitHub",Bpe=()=>"从 GitHub 创建",$pe=()=>"از GitHub",Hpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bpe():t==="fa"?$pe():Ipe()}),Fpe=()=>"GitHub repository",Ppe=()=>"GitHub 仓库",Upe=()=>"مخزن GitHub",qpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ppe():t==="fa"?Upe():Fpe()}),Gpe=()=>"https://github.com/owner/repo",Vpe=()=>"https://github.com/owner/repo",Wpe=()=>"https://github.com/owner/repo",Kpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vpe():t==="fa"?Wpe():Gpe()}),Xpe=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Ype=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Zpe=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Qpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ype():t==="fa"?Zpe():Xpe()}),Jpe=()=>"my-research",eme=()=>"my-research",tme=()=>"my-research",U6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eme():t==="fa"?tme():Jpe()}),nme=()=>"No papers found. Try an arXiv ID, URL, or a different title.",rme=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",sme=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",ime=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rme():t==="fa"?sme():nme()}),ame=()=>"No public repository found on alphaXiv",ome=()=>"在 alphaXiv 上未找到公开仓库",lme=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",cme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ome():t==="fa"?lme():ame()}),ume=()=>"OpenResearch will start a blank project with this paper's PDF.",fme=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",hme=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",dme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fme():t==="fa"?hme():ume()}),_me=()=>"Paper",pme=()=>"论文",mme=()=>"مقاله",gme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pme():t==="fa"?mme():_me()}),bme=()=>"Project location",vme=()=>"项目位置",xme=()=>"محل پروژه",q6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vme():t==="fa"?xme():bme()}),yme=()=>"Project name",wme=()=>"项目名称",Sme=()=>"نام پروژه",G6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wme():t==="fa"?Sme():yme()}),kme=()=>"The public repository is forked under your GitHub account and cloned locally.",Cme=()=>"该公开仓库会复刻到你的 GitHub 账户下并克隆到本地。",Eme=()=>"مخزن عمومی زیر حساب GitHub شما فورک و بهصورت محلی کلون میشود.",Nme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"Search for a paper by arXiv ID, URL, or title",Ame=()=>"按 arXiv ID、网址或标题搜索论文",jme=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",Tme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ame():t==="fa"?jme():zme()}),Mme=()=>"Sync experiments to GitHub",Rme=()=>"将实验同步到 GitHub",Dme=()=>"همگام‌سازی آزمایش‌ها با GitHub",Lme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rme():t==="fa"?Dme():Mme()}),Ome=()=>"That folder no longer exists. Choose it again.",Ime=()=>"该文件夹已不存在。请重新选择。",Bme=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",$me=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ime():t==="fa"?Bme():Ome()}),Hme=()=>"The selected folder contains an invalid Git repository.",Fme=()=>"所选文件夹包含无效的 Git 仓库。",Pme=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",Ume=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fme():t==="fa"?Pme():Hme()}),qme=()=>"The selected path is not a folder.",Gme=()=>"所选路径不是文件夹。",Vme=()=>"مسیر انتخاب‌شده پوشه نیست.",Wme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gme():t==="fa"?Vme():qme()}),Kme=e=>`Will be forked under ${e==null?void 0:e.account}.`,Xme=e=>`将复刻到 ${e==null?void 0:e.account} 下。`,Yme=e=>`زیر ${e==null?void 0:e.account} فورک خواهد شد.`,Zme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xme(e):t==="fa"?Yme(e):Kme(e)}),Qme=e=>`Checking ${e==null?void 0:e.repository}.`,Jme=e=>`正在检查 ${e==null?void 0:e.repository}。`,ege=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,tge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jme(e):t==="fa"?ege(e):Qme(e)}),nge=e=>`Creates ${e==null?void 0:e.repository}.`,rge=e=>`将创建 ${e==null?void 0:e.repository}。`,sge=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,ige=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rge(e):t==="fa"?sge(e):nge(e)}),age=e=>`Pushes to ${e==null?void 0:e.repository}.`,oge=e=>`将推送到 ${e==null?void 0:e.repository}。`,lge=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,cge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oge(e):t==="fa"?lge(e):age(e)}),uge=()=>"Project location is required.",fge=()=>"必须填写项目位置。",hge=()=>"محل پروژه الزامی است.",y1=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fge():t==="fa"?hge():uge()}),dge=()=>"Choose a different destination. The paper repository needs a new or empty folder.",_ge=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",pge=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",V6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ge():t==="fa"?pge():dge()}),mge=()=>"A linked public code repository is cloned without credentials.",gge=()=>"关联的公开代码仓库无需凭据即可克隆。",bge=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",vge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gge():t==="fa"?bge():mge()}),xge=e=>`Run ${e==null?void 0:e.command} before creating the project.`,yge=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,wge=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,W6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yge(e):t==="fa"?wge(e):xge(e)}),Sge=()=>"Searching alphaXiv…",kge=()=>"正在搜索 alphaXiv…",Cge=()=>"در حال جست‌وجوی alphaXiv…",Ege=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kge():t==="fa"?Cge():Sge()}),Nge=()=>"Use folder",zge=()=>"使用文件夹",Age=()=>"استفاده از پوشه",jge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zge():t==="fa"?Age():Nge()}),Tge=()=>"A workspace for your research agents",Mge=()=>"面向研究智能体的工作空间",Rge=()=>"فضای کاری برای عامل‌های پژوهشی شما",Dge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mge():t==="fa"?Rge():Tge()}),Lge=()=>"Add papers that represent your research interests, including papers by other authors.",Oge=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",Ige=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",Bge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Oge():t==="fa"?Ige():Lge()}),$ge=()=>"API key",Hge=()=>"API 密钥",Fge=()=>"کلید API",S9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hge():t==="fa"?Fge():$ge()}),Pge=()=>"AI/ML",Uge=()=>"人工智能与机器学习",qge=()=>"هوش مصنوعی و یادگیری ماشین",Gge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uge():t==="fa"?qge():Pge()}),Vge=()=>"Biology",Wge=()=>"生物学",Kge=()=>"زیست‌شناسی",Xge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wge():t==="fa"?Kge():Vge()}),Yge=()=>"Other",Zge=()=>"其他",Qge=()=>"سایر",Jge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zge():t==="fa"?Qge():Yge()}),e1e=()=>"Physics",t1e=()=>"物理学",n1e=()=>"فیزیک",r1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t1e():t==="fa"?n1e():e1e()}),s1e=()=>"Back",i1e=()=>"返回",a1e=()=>"بازگشت",K6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i1e():t==="fa"?a1e():s1e()}),o1e=()=>"Check failed",l1e=()=>"检查失败",c1e=()=>"بررسی ناموفق بود",u1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l1e():t==="fa"?c1e():o1e()}),f1e=()=>"Checking",h1e=()=>"正在检查",d1e=()=>"در حال بررسی",_1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h1e():t==="fa"?d1e():f1e()}),p1e=()=>"Checking Git…",m1e=()=>"正在检查 Git…",g1e=()=>"در حال بررسی Git…",b1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m1e():t==="fa"?g1e():p1e()}),v1e=()=>"Choose a coding agent",x1e=()=>"选择编程智能体",y1e=()=>"یک عامل کدنویسی انتخاب کنید",w1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x1e():t==="fa"?y1e():v1e()}),S1e=()=>"Choose a coding agent to continue.",k1e=()=>"选择一个编程智能体以继续。",C1e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",E1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k1e():t==="fa"?C1e():S1e()}),N1e=()=>"Choose at least one research area to continue.",z1e=()=>"请至少选择一个研究领域后再继续。",A1e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",j1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z1e():t==="fa"?A1e():N1e()}),T1e=()=>"Choose one or more.",M1e=()=>"请选择一项或多项。",R1e=()=>"یک یا چند مورد را انتخاب کنید.",D1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M1e():t==="fa"?R1e():T1e()}),L1e=()=>"Choose your preferred coding agent",O1e=()=>"请选择首选编程智能体",I1e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",B1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O1e():t==="fa"?I1e():L1e()}),$1e=()=>"Consolidate your research",H1e=()=>"集中管理研究",F1e=()=>"پژوهش خود را یکپارچه کنید",P1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H1e():t==="fa"?F1e():$1e()}),U1e=()=>"Continue",q1e=()=>"继续",G1e=()=>"ادامه",X6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q1e():t==="fa"?G1e():U1e()}),V1e=()=>"Describe your research area to continue.",W1e=()=>"请描述你的研究领域后再继续。",K1e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",X1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W1e():t==="fa"?K1e():V1e()}),Y1e=()=>"Detecting Claude Code, Codex, OpenCode…",Z1e=()=>"正在检测 Claude Code、Codex、OpenCode…",Q1e=()=>"در حال شناسایی Claude Code، Codex و OpenCode…",J1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z1e():t==="fa"?Q1e():Y1e()}),ebe=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",tbe=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",nbe=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",rbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tbe():t==="fa"?nbe():ebe()}),sbe=()=>"Everything stays local",ibe=()=>"一切都保留在本地",abe=()=>"همه‌چیز محلی می‌ماند",obe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ibe():t==="fa"?abe():sbe()}),lbe=()=>"Get started",cbe=()=>"开始使用",ube=()=>"شروع",fbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cbe():t==="fa"?ube():lbe()}),hbe=()=>"Git is required for local experiments. Install Git, then re-check.",dbe=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",_be=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",pbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dbe():t==="fa"?_be():hbe()}),mbe=()=>"Ground your agents",gbe=()=>"为智能体提供可靠依据",bbe=()=>"عامل‌هایتان را به منابع متصل کنید",vbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gbe():t==="fa"?bbe():mbe()}),xbe=()=>"Install broken",ybe=()=>"安装损坏",wbe=()=>"نصب خراب است",Sbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ybe():t==="fa"?wbe():xbe()}),kbe=()=>"Install Git to continue",Cbe=()=>"请安装 Git 后再继续",Ebe=()=>"برای ادامه Git را نصب کنید",Nbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cbe():t==="fa"?Ebe():kbe()}),zbe=()=>"Local Git",Abe=()=>"本地 Git",jbe=()=>"Git محلی",Tbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Abe():t==="fa"?jbe():zbe()}),Mbe=()=>"Not detected",Rbe=()=>"未检测到",Dbe=()=>"شناسایی نشد",Y6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rbe():t==="fa"?Dbe():Mbe()}),Lbe=()=>"Not found",Obe=()=>"未找到",Ibe=()=>"پیدا نشد",k9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Obe():t==="fa"?Ibe():Lbe()}),Bbe=()=>"Not signed in",$be=()=>"未登录",Hbe=()=>"وارد نشده",Fbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$be():t==="fa"?Hbe():Bbe()}),Pbe=()=>"OpenResearch uses a coding agent already installed on this machine.",Ube=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",qbe=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",Gbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ube():t==="fa"?qbe():Pbe()}),Vbe=()=>"Other research area",Wbe=()=>"其他研究领域",Kbe=()=>"حوزهٔ پژوهشی دیگر",Xbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wbe():t==="fa"?Kbe():Vbe()}),Ybe=()=>"Re-check",Zbe=()=>"重新检查",Qbe=()=>"بررسی دوباره",Jbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zbe():t==="fa"?Qbe():Ybe()}),eve=()=>"Ready",tve=()=>"已就绪",nve=()=>"آماده",rve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Re-check Git before continuing",ive=()=>"请重新检查 Git 后再继续",ave=()=>"پیش از ادامه Git را دوباره بررسی کنید",ove=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Representative papers",cve=()=>"代表性论文",uve=()=>"مقاله‌های شاخص",fve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),hve=()=>"Research background",dve=()=>"研究背景",_ve=()=>"پیشینهٔ پژوهشی",pve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dve():t==="fa"?_ve():hve()}),mve=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gve=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",bve=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",Z6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gve():t==="fa"?bve():mve()}),vve=()=>"Search alphaXiv by title to link a paper…",xve=()=>"按标题搜索 alphaXiv 以关联论文…",yve=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xve():t==="fa"?yve():vve()}),Sve=()=>"Searching alphaXiv…",kve=()=>"正在搜索 alphaXiv…",Cve=()=>"در حال جست‌وجوی alphaXiv…",Eve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kve():t==="fa"?Cve():Sve()}),Nve=()=>"Selected",zve=()=>"已选择",Ave=()=>"انتخاب‌شده",jve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zve():t==="fa"?Ave():Nve()}),Tve=()=>"Setting things up…",Mve=()=>"正在设置…",Rve=()=>"در حال راه‌اندازی…",Dve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mve():t==="fa"?Rve():Tve()}),Lve=()=>"Sign in to at least one coding agent to continue",Ove=()=>"请至少登录一个编程智能体后再继续",Ive=()=>"برای ادامه، وارد دست‌کم یک عامل برنامه‌نویسی شوید",Bve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ove():t==="fa"?Ive():Lve()}),$ve=()=>"Sign in to at least one agent to continue.",Hve=()=>"请登录至少一个智能体以继续。",Fve=()=>"برای ادامه دست‌کم به یک عامل وارد شوید.",Pve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hve():t==="fa"?Fve():$ve()}),Uve=()=>"Signed in",qve=()=>"已登录",Gve=()=>"وارد شده",Vve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qve():t==="fa"?Gve():Uve()}),Wve=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",Kve=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",Xve=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",Yve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kve():t==="fa"?Xve():Wve()}),Zve=()=>"· Step 1 of 2",Qve=()=>"· 第 1 步,共 2 步",Jve=()=>"· مرحلهٔ ۱ از ۲",e2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qve():t==="fa"?Jve():Zve()}),t2e=()=>"· Step 2 of 2",n2e=()=>"· 第 2 步,共 2 步",r2e=()=>"· مرحلهٔ ۲ از ۲",s2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Tell us about your research",a2e=()=>"介绍一下你的研究",o2e=()=>"از پژوهش خود بگویید",l2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Tell us your other research area",u2e=()=>"告诉我们你的其他研究领域",f2e=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",h2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u2e():t==="fa"?f2e():c2e()}),d2e=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",_2e=()=>"在一处跟踪实验、产物、算力、技能和代码。",p2e=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",m2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_2e():t==="fa"?p2e():d2e()}),g2e=()=>"Unable to verify",b2e=()=>"无法验证",v2e=()=>"تأیید ممکن نیست",x2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b2e():t==="fa"?v2e():g2e()}),y2e=()=>"Update required",w2e=()=>"需要更新",S2e=()=>"نیازمند به‌روزرسانی",k2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w2e():t==="fa"?S2e():y2e()}),C2e=()=>"Waiting for the Git check",E2e=()=>"正在等待 Git 检查",N2e=()=>"در انتظار بررسی Git",z2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E2e():t==="fa"?N2e():C2e()}),A2e=()=>"Waiting for the local tool checks",j2e=()=>"正在等待本地工具检查",T2e=()=>"در انتظار بررسی ابزارهای محلی",M2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j2e():t==="fa"?T2e():A2e()}),R2e=()=>"What areas are you interested in?",D2e=()=>"你对哪些领域感兴趣?",L2e=()=>"به چه حوزه‌هایی علاقه دارید؟",O2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D2e():t==="fa"?L2e():R2e()}),I2e=()=>"Your code, data, and experiment history stay on your machine.",B2e=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",$2e=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",H2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B2e():t==="fa"?$2e():I2e()}),F2e=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",P2e=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",U2e=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",q2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P2e():t==="fa"?U2e():F2e()}),G2e=()=>"Changed here and on Overleaf — choose which copy to keep",V2e=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",W2e=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",K2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V2e():t==="fa"?W2e():G2e()}),X2e=()=>"Create a token ↗",Y2e=()=>"创建令牌 ↗",Z2e=()=>"ساخت توکن ↗",Q2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y2e():t==="fa"?Z2e():X2e()}),J2e=()=>"Overleaf Git token",exe=()=>"Overleaf Git 令牌",txe=()=>"توکن Git در Overleaf",nxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?exe():t==="fa"?txe():J2e()}),rxe=()=>"In step with Overleaf",sxe=()=>"已与 Overleaf 同步",ixe=()=>"با Overleaf همگام است",C9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sxe():t==="fa"?ixe():rxe()}),axe=()=>"The last sync did not finish.",oxe=()=>"上次同步未完成。",lxe=()=>"آخرین همگام‌سازی کامل نشد.",cxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oxe():t==="fa"?lxe():axe()}),uxe=()=>"Link and sync",fxe=()=>"关联并同步",hxe=()=>"پیوند و همگام‌سازی",dxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fxe():t==="fa"?hxe():uxe()}),_xe=()=>"My projects ↗",pxe=()=>"我的项目 ↗",mxe=()=>"پروژه‌های من ↗",gxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pxe():t==="fa"?mxe():_xe()}),bxe=()=>"Nothing could be synced.",vxe=()=>"没有内容可以同步。",xxe=()=>"هیچ موردی قابل همگام‌سازی نبود.",yxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vxe():t==="fa"?xxe():bxe()}),wxe=()=>"Cancel",Sxe=()=>"取消",kxe=()=>"لغو",Cxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",Nxe=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",zxe=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",Axe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nxe():t==="fa"?zxe():Exe()}),jxe=()=>"Keep this copy",Txe=()=>"保留此副本",Mxe=()=>"نگه داشتن این نسخه",Rxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Txe():t==="fa"?Mxe():jxe()}),Dxe=()=>"Open in Overleaf",Lxe=()=>"在 Overleaf 中打开",Oxe=()=>"باز کردن در Overleaf",Ixe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Bxe=()=>"Replace the Overleaf token",$xe=()=>"替换 Overleaf 令牌",Hxe=()=>"جایگزینی توکن Overleaf",Q6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$xe():t==="fa"?Hxe():Bxe()}),Fxe=()=>"Sync now",Pxe=()=>"立即同步",Uxe=()=>"همگام‌سازی اکنون",qxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pxe():t==="fa"?Uxe():Fxe()}),Gxe=()=>"Unlink",Vxe=()=>"取消关联",Wxe=()=>"قطع پیوند",Kxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vxe():t==="fa"?Wxe():Gxe()}),Xxe=()=>"Upload a copy as a new project ↗",Yxe=()=>"上传副本作为新项目 ↗",Zxe=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",Qxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yxe():t==="fa"?Zxe():Xxe()}),Jxe=()=>"Use Overleaf's",eye=()=>"使用 Overleaf 的副本",tye=()=>"استفاده از نسخهٔ Overleaf",nye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eye():t==="fa"?tye():Jxe()}),rye=()=>"This paper stays in step with Overleaf.",sye=()=>"此论文将与 Overleaf 保持同步。",iye=()=>"این مقاله با Overleaf همگام می‌ماند.",aye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sye():t==="fa"?iye():rye()}),oye=e=>`Pulled ${e==null?void 0:e.paths}.`,lye=e=>`已拉取 ${e==null?void 0:e.paths}。`,cye=e=>`${e==null?void 0:e.paths} دریافت شد.`,uye=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lye(e):t==="fa"?cye(e):oye(e)}),fye=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,hye=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,dye=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,_ye=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hye(e):t==="fa"?dye(e):fye(e)}),pye=e=>`Pushed ${e==null?void 0:e.paths}.`,mye=e=>`已推送 ${e==null?void 0:e.paths}。`,gye=e=>`${e==null?void 0:e.paths} ارسال شد.`,bye=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mye(e):t==="fa"?gye(e):pye(e)}),vye=()=>"Save the file first",xye=()=>"请先保存文件",yye=()=>"ابتدا فایل را ذخیره کنید",wye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xye():t==="fa"?yye():vye()}),Sye=()=>"Save this file to sync it with Overleaf",kye=()=>"保存此文件以与 Overleaf 同步",Cye=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",E9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kye():t==="fa"?Cye():Sye()}),Eye=()=>"Save token",Nye=()=>"保存令牌",zye=()=>"ذخیرهٔ توکن",Aye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nye():t==="fa"?zye():Eye()}),jye=()=>"Send this paper to Overleaf",Tye=()=>"将此论文发送到 Overleaf",Mye=()=>"ارسال مقاله به Overleaf",Rye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tye():t==="fa"?Mye():jye()}),Dye=()=>"Overleaf sync failed",Lye=()=>"Overleaf 同步失败",Oye=()=>"همگام‌سازی با Overleaf ناموفق بود",Iye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lye():t==="fa"?Oye():Dye()}),Bye=()=>"Syncing with Overleaf…",$ye=()=>"正在与 Overleaf 同步…",Hye=()=>"در حال همگام‌سازی با Overleaf…",Fye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ye():t==="fa"?Hye():Bye()}),Pye=()=>"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.",Uye=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",qye=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",Gye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uye():t==="fa"?qye():Pye()}),Vye=()=>"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.",Wye=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",Kye=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",Xye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wye():t==="fa"?Kye():Vye()}),Yye=()=>"Toggle Plan mode for this chat",Zye=()=>"切换此聊天的计划模式",Qye=()=>"تغییر حالت طرح این گفت‌وگو",Jye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zye():t==="fa"?Qye():Yye()}),e4e=()=>"Accept and auto mode",t4e=()=>"接受并使用自动模式",n4e=()=>"پذیرش و حالت خودکار",r4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t4e():t==="fa"?n4e():e4e()}),s4e=()=>"Accept and bypass all",i4e=()=>"接受并跳过所有审批",a4e=()=>"پذیرش و عبور از همهٔ تأییدها",o4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i4e():t==="fa"?a4e():s4e()}),l4e=()=>"Accept plan",c4e=()=>"接受计划",u4e=()=>"پذیرش طرح",f4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c4e():t==="fa"?u4e():l4e()}),h4e=e=>`${e==null?void 0:e.agent} proposed a plan`,d4e=e=>`${e==null?void 0:e.agent} 提出了一个计划`,_4e=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,p4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?d4e(e):t==="fa"?_4e(e):h4e(e)}),m4e=e=>`${e==null?void 0:e.agent} is ready to proceed`,g4e=e=>`${e==null?void 0:e.agent} 已准备好继续`,b4e=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,v4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?g4e(e):t==="fa"?b4e(e):m4e(e)}),x4e=()=>"Back",y4e=()=>"返回",w4e=()=>"بازگشت",S4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y4e():t==="fa"?w4e():x4e()}),k4e=()=>"More approval options",C4e=()=>"更多批准选项",E4e=()=>"گزینه‌های تأیید بیشتر",N4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C4e():t==="fa"?E4e():k4e()}),z4e=()=>"Open plan",A4e=()=>"打开计划",j4e=()=>"باز کردن طرح",T4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A4e():t==="fa"?j4e():z4e()}),M4e=()=>"Reject",R4e=()=>"拒绝",D4e=()=>"رد کردن",L4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R4e():t==="fa"?D4e():M4e()}),O4e=()=>"Revise",I4e=()=>"修改",B4e=()=>"بازنگری",$4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I4e():t==="fa"?B4e():O4e()}),H4e=()=>"Revise…",F4e=()=>"修改…",P4e=()=>"بازنگری…",U4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F4e():t==="fa"?P4e():H4e()}),q4e=()=>"What should change? (optional)",G4e=()=>"需要更改什么?(可选)",V4e=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",W4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G4e():t==="fa"?V4e():q4e()}),K4e=e=>`${e==null?void 0:e.count} active`,X4e=e=>`${e==null?void 0:e.count} 个活跃`,Y4e=e=>`${e==null?void 0:e.count} فعال`,Z4e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?X4e(e):t==="fa"?Y4e(e):K4e(e)}),Q4e=e=>`${e==null?void 0:e.count} total agents`,J4e=e=>`共 ${e==null?void 0:e.count} 个智能体`,e5e=e=>`در مجموع ${e==null?void 0:e.count} عامل`,t5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?J4e(e):t==="fa"?e5e(e):Q4e(e)}),n5e=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,r5e=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,s5e=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,i5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?r5e(e):t==="fa"?s5e(e):n5e(e)}),a5e=()=>"Agents",o5e=()=>"智能体",l5e=()=>"عامل‌ها",J6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o5e():t==="fa"?l5e():a5e()}),c5e=()=>"arXiv paper ID:",u5e=()=>"arXiv 论文 ID:",f5e=()=>"شناسهٔ مقالهٔ arXiv:",h5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u5e():t==="fa"?f5e():c5e()}),d5e=()=>"Cancel",_5e=()=>"取消",p5e=()=>"لغو",m5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_5e():t==="fa"?p5e():d5e()}),g5e=()=>"Created",b5e=()=>"创建时间",v5e=()=>"ایجادشده",x5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b5e():t==="fa"?v5e():g5e()}),y5e=()=>"Delete project?",w5e=()=>"删除项目?",S5e=()=>"پروژه حذف شود؟",k5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w5e():t==="fa"?S5e():y5e()}),C5e=()=>"Delete project",E5e=()=>"删除项目",N5e=()=>"حذف پروژه",z5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E5e():t==="fa"?N5e():C5e()}),A5e=()=>"Deleting…",j5e=()=>"正在删除…",T5e=()=>"در حال حذف…",M5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j5e():t==="fa"?T5e():A5e()}),R5e=()=>"Experiments",D5e=()=>"实验",L5e=()=>"آزمایش‌ها",e7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D5e():t==="fa"?L5e():R5e()}),O5e=()=>"The local folder and linked GitHub repository are kept.",I5e=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",B5e=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",$5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I5e():t==="fa"?B5e():O5e()}),H5e=()=>"The local folder is kept.",F5e=()=>"本地文件夹会保留。",P5e=()=>"پوشهٔ محلی نگه داشته می‌شود.",U5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F5e():t==="fa"?P5e():H5e()}),q5e=()=>"New project",G5e=()=>"新建项目",V5e=()=>"پروژهٔ جدید",N9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G5e():t==="fa"?V5e():q5e()}),W5e=()=>"No projects yet — create one to get started.",K5e=()=>"尚无项目——新建一个即可开始。",X5e=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",Y5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K5e():t==="fa"?X5e():W5e()}),Z5e=()=>"Project",Q5e=()=>"项目",J5e=()=>"پروژه",e3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q5e():t==="fa"?J5e():Z5e()}),t3e=()=>"Projects",n3e=()=>"项目",r3e=()=>"پروژه‌ها",s3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n3e():t==="fa"?r3e():t3e()}),i3e=()=>"Repository",a3e=()=>"仓库",o3e=()=>"مخزن",t7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a3e():t==="fa"?o3e():i3e()}),l3e=()=>"Idle",c3e=()=>"空闲",u3e=()=>"بیکار",f3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),h3e=()=>"Local",d3e=()=>"本地",_3e=()=>"محلی",p3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d3e():t==="fa"?_3e():h3e()}),m3e=()=>"1 total agent",g3e=()=>"共 1 个智能体",b3e=()=>"در مجموع ۱ عامل",v3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g3e():t==="fa"?b3e():m3e()}),x3e=e=>`${e==null?void 0:e.count} running`,y3e=e=>`${e==null?void 0:e.count} 个运行中`,w3e=e=>`${e==null?void 0:e.count} در حال اجرا`,S3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?y3e(e):t==="fa"?w3e(e):x3e(e)}),k3e=e=>`${e==null?void 0:e.count} total`,C3e=e=>`共 ${e==null?void 0:e.count} 个`,E3e=e=>`در مجموع ${e==null?void 0:e.count}`,n7=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?C3e(e):t==="fa"?E3e(e):k3e(e)}),N3e=e=>`${e==null?void 0:e.value}d`,z3e=e=>`${e==null?void 0:e.value} 天`,A3e=e=>`${e==null?void 0:e.value}ر`,j3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?z3e(e):t==="fa"?A3e(e):N3e(e)}),T3e=e=>`${e==null?void 0:e.value}h`,M3e=e=>`${e==null?void 0:e.value} 小时`,R3e=e=>`${e==null?void 0:e.value}س`,D3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?M3e(e):t==="fa"?R3e(e):T3e(e)}),L3e=e=>`${e==null?void 0:e.value}m`,O3e=e=>`${e==null?void 0:e.value} 分钟`,I3e=e=>`${e==null?void 0:e.value}د`,B3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?O3e(e):t==="fa"?I3e(e):L3e(e)}),$3e=()=>"now",H3e=()=>"现在",F3e=()=>"اکنون",P3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H3e():t==="fa"?F3e():$3e()}),U3e=()=>"Disable syncing",q3e=()=>"关闭同步",G3e=()=>"غیرفعال کردن همگام‌سازی",V3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q3e():t==="fa"?G3e():U3e()}),W3e=()=>"Enable GitHub syncing",K3e=()=>"启用 GitHub 同步",X3e=()=>"فعال‌سازی همگام‌سازی GitHub",Y3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K3e():t==="fa"?X3e():W3e()}),Z3e=()=>"Enabling…",Q3e=()=>"正在启用…",J3e=()=>"در حال فعال‌سازی…",ewe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q3e():t==="fa"?J3e():Z3e()}),twe=()=>"Updating…",nwe=()=>"正在更新…",rwe=()=>"در حال به‌روزرسانی…",swe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nwe():t==="fa"?rwe():twe()}),iwe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,awe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,owe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,lwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?awe(e):t==="fa"?owe(e):iwe(e)}),cwe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,uwe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,fwe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,hwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?uwe(e):t==="fa"?fwe(e):cwe(e)}),dwe=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`,_we=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,pwe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,mwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_we(e):t==="fa"?pwe(e):dwe(e)}),gwe=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,bwe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,vwe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,xwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bwe(e):t==="fa"?vwe(e):gwe(e)}),ywe=()=>"CLI is retrying…",wwe=()=>"CLI 正在重试…",Swe=()=>"CLI در حال تلاش دوباره است…",kwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wwe():t==="fa"?Swe():ywe()}),Cwe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,Ewe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,Nwe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,zwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ewe(e):t==="fa"?Nwe(e):Cwe(e)}),Awe=()=>"Sending again…",jwe=()=>"正在重新发送…",Twe=()=>"در حال ارسال دوباره…",Mwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jwe():t==="fa"?Twe():Awe()}),Rwe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,Dwe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,Lwe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,Owe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dwe(e):t==="fa"?Lwe(e):Rwe(e)}),Iwe=()=>"Retrying…",Bwe=()=>"正在重试…",$we=()=>"در حال تلاش دوباره…",z9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bwe():t==="fa"?$we():Iwe()}),Hwe=()=>"Default speed",Fwe=()=>"默认速度",Pwe=()=>"سرعت پیش‌فرض",Uwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fwe():t==="fa"?Pwe():Hwe()}),qwe=()=>"Standard",Gwe=()=>"标准",Vwe=()=>"استاندارد",Wwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gwe():t==="fa"?Vwe():qwe()}),Kwe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,Xwe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,Ywe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,Zwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xwe(e):t==="fa"?Ywe(e):Kwe(e)}),Qwe=()=>"How the interface looks on this device.",Jwe=()=>"设置此设备上的界面外观。",e6e=()=>"ظاهر رابط کاربری را در این دستگاه تنظیم کنید.",t6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jwe():t==="fa"?e6e():Qwe()}),n6e=()=>"Appearance",r6e=()=>"外观",s6e=()=>"ظاهر",i6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r6e():t==="fa"?s6e():n6e()}),a6e=()=>"Check",o6e=()=>"检查",l6e=()=>"بررسی",c6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o6e():t==="fa"?l6e():a6e()}),u6e=()=>"Check again",f6e=()=>"再次检查",h6e=()=>"بررسی دوباره",d6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f6e():t==="fa"?h6e():u6e()}),_6e=()=>"Check for updates",p6e=()=>"检查更新",m6e=()=>"بررسی به‌روزرسانی",g6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),b6e=()=>"Check now",v6e=()=>"立即检查",x6e=()=>"اکنون بررسی کن",y6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v6e():t==="fa"?x6e():b6e()}),w6e=()=>"Check setup",S6e=()=>"检查设置",k6e=()=>"بررسی راه‌اندازی",C6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),E6e=()=>"orx checks a few times a day on its own.",N6e=()=>"orx 每天会自动检查几次。",z6e=()=>"orx روزی چند بار خودکار بررسی می‌کند.",A6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N6e():t==="fa"?z6e():E6e()}),j6e=()=>"Choose a flavor",T6e=()=>"选择配置",M6e=()=>"انتخاب پیکربندی",R6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T6e():t==="fa"?M6e():j6e()}),D6e=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,L6e=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,O6e=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,I6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L6e(e):t==="fa"?O6e(e):D6e(e)}),B6e=()=>"clean",$6e=()=>"无更改",H6e=()=>"بدون تغییر",F6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$6e():t==="fa"?H6e():B6e()}),P6e=e=>`Already linked at ${e==null?void 0:e.link}.`,U6e=e=>`已链接到 ${e==null?void 0:e.link}。`,q6e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,G6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U6e(e):t==="fa"?q6e(e):P6e(e)}),V6e=e=>`Linked ${e==null?void 0:e.link}.`,W6e=e=>`已链接 ${e==null?void 0:e.link}。`,K6e=e=>`${e==null?void 0:e.link} پیوند شد.`,X6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?W6e(e):t==="fa"?K6e(e):V6e(e)}),Y6e=()=>"Connect",Z6e=()=>"连接",Q6e=()=>"اتصال",J6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z6e():t==="fa"?Q6e():Y6e()}),e7e=()=>"Connected via GitHub CLI",t7e=()=>"已通过 GitHub CLI 连接",n7e=()=>"از طریق GitHub CLI متصل است",A9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),r7e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",s7e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",i7e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",a7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s7e():t==="fa"?i7e():r7e()}),o7e=()=>"the current project",l7e=()=>"当前项目",c7e=()=>"پروژهٔ فعلی",u7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l7e():t==="fa"?c7e():o7e()}),f7e=e=>`${e==null?void 0:e.value} (custom)`,h7e=e=>`${e==null?void 0:e.value}(自定义)`,d7e=e=>`${e==null?void 0:e.value} (سفارشی)`,_7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?h7e(e):t==="fa"?d7e(e):f7e(e)}),p7e=e=>`The data directory is pinned by the ${e==null?void 0:e.variable} environment variable, which overrides this setting. Unset it to choose a location here.`,m7e=e=>`数据目录由环境变量 ${e==null?void 0:e.variable} 固定,该变量会覆盖此设置。取消设置后即可在此选择位置。`,g7e=e=>`پوشهٔ داده توسط متغیر محیطی ${e==null?void 0:e.variable} ثابت شده است و این تنظیم را بازنویسی می‌کند. برای انتخاب محل در اینجا، آن متغیر را unset کنید.`,b7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m7e(e):t==="fa"?g7e(e):p7e(e)}),v7e=()=>"detached",x7e=()=>"分离头指针",y7e=()=>"جدا از شاخه",j9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x7e():t==="fa"?y7e():v7e()}),w7e=()=>"Environment broken",S7e=()=>"环境损坏",k7e=()=>"محیط خراب است",C7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"Environment not built",N7e=()=>"环境尚未构建",z7e=()=>"محیط ساخته نشده است",A7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),j7e=e=>`Stored in ${e==null?void 0:e.path} and passed to runs and the research agent. ${e==null?void 0:e.tinker}, ${e==null?void 0:e.hf}, and ${e==null?void 0:e.wandb} are always listed because runs typically need them. Variables in orx’s own environment win on conflicts.`,T7e=e=>`变量存储在 ${e==null?void 0:e.path} 中,并传递给运行和研究智能体。${e==null?void 0:e.tinker}、${e==null?void 0:e.hf} 和 ${e==null?void 0:e.wandb} 始终列出,因为运行通常需要它们。发生冲突时,orx 自身环境中的变量优先。`,M7e=e=>`متغیرها در ${e==null?void 0:e.path} ذخیره و در اختیار اجراها و عامل پژوهشی قرار می‌گیرند. ${e==null?void 0:e.tinker}، ${e==null?void 0:e.hf} و ${e==null?void 0:e.wandb} همیشه فهرست می‌شوند، چون اجراها معمولاً به آن‌ها نیاز دارند. هنگام تداخل، متغیرهای محیط خود orx اولویت دارند.`,R7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?T7e(e):t==="fa"?M7e(e):j7e(e)}),D7e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,L7e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,O7e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,I7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L7e(e):t==="fa"?O7e(e):D7e(e)}),B7e=()=>"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.",$7e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",H7e=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",F7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$7e():t==="fa"?H7e():B7e()}),P7e=()=>"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.",U7e=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",q7e=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",G7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U7e():t==="fa"?q7e():P7e()}),V7e=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",W7e=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",K7e=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",X7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W7e():t==="fa"?K7e():V7e()}),Y7e=()=>"has changes",Z7e=()=>"有更改",Q7e=()=>"دارای تغییر",J7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z7e():t==="fa"?Q7e():Y7e()}),eSe=()=>"~/.cache/huggingface/token (hf auth login)",tSe=()=>"~/.cache/huggingface/token(hf auth login)",nSe=()=>"~/.cache/huggingface/token (hf auth login)",rSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tSe():t==="fa"?nSe():eSe()}),sSe=()=>"HF_TOKEN environment variable",iSe=()=>"HF_TOKEN 环境变量",aSe=()=>"متغیر محیطی HF_TOKEN",oSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iSe():t==="fa"?aSe():sSe()}),lSe=()=>"~/.openresearch/env",cSe=()=>"~/.openresearch/env",uSe=()=>"~/.openresearch/env",fSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cSe():t==="fa"?uSe():lSe()}),hSe=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}.`,dSe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,_Se=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,pSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dSe(e):t==="fa"?_Se(e):hSe(e)}),mSe=()=>"Install",gSe=()=>"安装",bSe=()=>"نصب",vSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gSe():t==="fa"?bSe():mSe()}),xSe=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.`,ySe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,wSe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,SSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ySe(e):t==="fa"?wSe(e):xSe(e)}),kSe=e=>`Install the ${e==null?void 0:e.command} command`,CSe=e=>`安装 ${e==null?void 0:e.command} 命令`,ESe=e=>`نصب فرمان ${e==null?void 0:e.command}`,NSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CSe(e):t==="fa"?ESe(e):kSe(e)}),zSe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",ASe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",jSe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",TSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ASe():t==="fa"?jSe():zSe()}),MSe=()=>"Install the new release now instead of waiting for the background update.",RSe=()=>"立即安装新版本,无需等待后台更新。",DSe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",LSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RSe():t==="fa"?DSe():MSe()}),OSe=()=>"kubectl default",ISe=()=>"kubectl 默认值",BSe=()=>"پیش‌فرض kubectl",$Se=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ISe():t==="fa"?BSe():OSe()}),HSe=e=>`kubectl default (${e==null?void 0:e.context})`,FSe=e=>`kubectl 默认值(${e==null?void 0:e.context})`,PSe=e=>`پیش‌فرض kubectl (${e==null?void 0:e.context})`,USe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FSe(e):t==="fa"?PSe(e):HSe(e)}),qSe=()=>"Choose the language for the interface on this device.",GSe=()=>"选择此设备上的界面语言。",VSe=()=>"زبان رابط کاربری را در این دستگاه انتخاب کنید.",WSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GSe():t==="fa"?VSe():qSe()}),KSe=()=>"Language",XSe=()=>"语言",YSe=()=>"زبان",ZSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XSe():t==="fa"?YSe():KSe()}),QSe=e=>`Not signed in. Run ${e==null?void 0:e.command} in a terminal to connect your OpenResearch account.`,JSe=e=>`尚未登录。请在终端中运行 ${e==null?void 0:e.command} 以连接你的 OpenResearch 账户。`,e8e=e=>`وارد نشده‌اید. برای اتصال حساب OpenResearch خود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,t8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JSe(e):t==="fa"?e8e(e):QSe(e)}),n8e=()=>"Make default",r8e=()=>"设为默认值",s8e=()=>"پیش‌فرض شود",i8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r8e():t==="fa"?s8e():n8e()}),a8e=e=>`The manifest must define one Job. orx injects the run script, environment, labels, and timeout. Use ${e==null?void 0:e.placeholder} in resource names, or override the default path with ${e==null?void 0:e.command}.`,o8e=e=>`清单必须定义一个 Job。orx 会注入运行脚本、环境、标签和超时设置。请在资源名称中使用 ${e==null?void 0:e.placeholder},或通过 ${e==null?void 0:e.command} 覆盖默认路径。`,l8e=e=>`مانیفست باید یک Job تعریف کند. orx اسکریپت اجرا، محیط، برچسب‌ها و مهلت زمانی را تزریق می‌کند. از ${e==null?void 0:e.placeholder} در نام منابع استفاده کنید، یا مسیر پیش‌فرض را با ${e==null?void 0:e.command} تغییر دهید.`,c8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?o8e(e):t==="fa"?l8e(e):a8e(e)}),u8e=()=>"Provisioned (Modal import failing)",f8e=()=>"已预配(Modal 导入失败)",h8e=()=>"آماده شده (درون‌ریزی Modal ناموفق است)",d8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f8e():t==="fa"?h8e():u8e()}),_8e=()=>"MODAL_TOKEN_ID environment variable",p8e=()=>"MODAL_TOKEN_ID 环境变量",m8e=()=>"متغیر محیطی MODAL_TOKEN_ID",g8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p8e():t==="fa"?m8e():_8e()}),b8e=()=>"~/.modal.toml (modal token new)",v8e=()=>"~/.modal.toml(modal token new)",x8e=()=>"~/.modal.toml (modal token new)",y8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v8e():t==="fa"?x8e():b8e()}),w8e=e=>`No Modal token found. Run ${e==null?void 0:e.command}, or add ${e==null?void 0:e.id} and ${e==null?void 0:e.secret} in the Environment tab.`,S8e=e=>`未找到 Modal 令牌。请运行 ${e==null?void 0:e.command},或在“环境”标签页中添加 ${e==null?void 0:e.id} 和 ${e==null?void 0:e.secret}。`,k8e=e=>`توکن Modal پیدا نشد. ${e==null?void 0:e.command} را اجرا کنید، یا ${e==null?void 0:e.id} و ${e==null?void 0:e.secret} را در زبانهٔ محیط اضافه کنید.`,C8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?S8e(e):t==="fa"?k8e(e):w8e(e)}),E8e=()=>"~/.openresearch/env",N8e=()=>"~/.openresearch/env",z8e=()=>"~/.openresearch/env",A8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N8e():t==="fa"?z8e():E8e()}),j8e=e=>`${e==null?void 0:e.count} available — ${e==null?void 0:e.models}`,T8e=e=>`${e==null?void 0:e.count} 个可用 — ${e==null?void 0:e.models}`,M8e=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,R8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?T8e(e):t==="fa"?M8e(e):j8e(e)}),D8e=e=>`Needs ${e==null?void 0:e.tool}`,L8e=e=>`需要 ${e==null?void 0:e.tool}`,O8e=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,I8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L8e(e):t==="fa"?O8e(e):D8e(e)}),B8e=()=>"Needs tools",$8e=()=>"缺少工具",H8e=()=>"به ابزارها نیاز دارد",F8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$8e():t==="fa"?H8e():B8e()}),P8e=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,U8e=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,q8e=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,G8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U8e(e):t==="fa"?q8e(e):P8e(e)}),V8e=()=>"New runs use SSH; choose a host when launching.",W8e=()=>"新运行将使用 SSH;启动时请选择主机。",K8e=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",X8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W8e():t==="fa"?K8e():V8e()}),Y8e=()=>"New token",Z8e=()=>"新令牌",Q8e=()=>"توکن جدید",J8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z8e():t==="fa"?Q8e():Y8e()}),eke=()=>"No default flavor",tke=()=>"不设默认配置",nke=()=>"بدون پیکربندی پیش‌فرض",rke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tke():t==="fa"?nke():eke()}),ske=()=>"none",ike=()=>"无",ake=()=>"هیچ‌کدام",R2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ike():t==="fa"?ake():ske()}),oke=()=>"Not built yet",lke=()=>"尚未构建",cke=()=>"هنوز ساخته نشده",uke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lke():t==="fa"?cke():oke()}),fke=()=>"Not connected",hke=()=>"未连接",dke=()=>"متصل نیست",T9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hke():t==="fa"?dke():fke()}),_ke=()=>"not found on PATH",pke=()=>"在 PATH 中未找到",mke=()=>"در PATH پیدا نشد",gke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pke():t==="fa"?mke():_ke()}),bke=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,vke=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,xke=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,yke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vke(e):t==="fa"?xke(e):bke(e)}),wke=()=>"not initialized",Ske=()=>"尚未初始化",kke=()=>"راه‌اندازی نشده",Cke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ske():t==="fa"?kke():wke()}),Eke=()=>"Not set",Nke=()=>"未设置",zke=()=>"تنظیم نشده",Ake=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nke():t==="fa"?zke():Eke()}),jke=()=>"OAuth (subscription login)",Tke=()=>"OAuth(订阅登录)",Mke=()=>"OAuth (ورود با اشتراک)",Rke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tke():t==="fa"?Mke():jke()}),Dke=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.`,Lke=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,Oke=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,Ike=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Lke(e):t==="fa"?Oke(e):Dke(e)}),Bke=()=>"Account",$ke=()=>"账户",Hke=()=>"حساب",D2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ke():t==="fa"?Hke():Bke()}),Fke=()=>"Add one with",Pke=()=>"使用以下命令添加:",Uke=()=>"یکی با این فرمان اضافه کنید:",qke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pke():t==="fa"?Uke():Fke()}),Gke=()=>"Add variable",Vke=()=>"添加变量",Wke=()=>"افزودن متغیر",Kke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vke():t==="fa"?Wke():Gke()}),Xke=()=>"Agent models",Yke=()=>"智能体模型",Zke=()=>"مدل‌های عامل",Qke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yke():t==="fa"?Zke():Xke()}),Jke=()=>"Anonymous usage analytics",eCe=()=>"匿名使用情况分析",tCe=()=>"تحلیل ناشناس استفاده",r7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eCe():t==="fa"?tCe():Jke()}),nCe=()=>"Auth",rCe=()=>"身份验证",sCe=()=>"احراز هویت",iCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=()=>"Authentication",oCe=()=>"身份验证",lCe=()=>"احراز هویت",cCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oCe():t==="fa"?lCe():aCe()}),uCe=()=>"Back to Compute",fCe=()=>"返回算力设置",hCe=()=>"بازگشت به رایانش",M9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fCe():t==="fa"?hCe():uCe()}),dCe=()=>"Backend",_Ce=()=>"后端",pCe=()=>"بک‌اند",mCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ce():t==="fa"?pCe():dCe()}),gCe=()=>"Baseline",bCe=()=>"基线",vCe=()=>"خط مبنا",xCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bCe():t==="fa"?vCe():gCe()}),yCe=()=>"Binary",wCe=()=>"可执行文件",SCe=()=>"فایل اجرایی",kCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wCe():t==="fa"?SCe():yCe()}),CCe=()=>"Cancel",ECe=()=>"取消",NCe=()=>"لغو",zCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),ACe=()=>"Cancel new variable",jCe=()=>"取消新变量",TCe=()=>"لغو متغیر جدید",MCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jCe():t==="fa"?TCe():ACe()}),RCe=()=>"Checking compute targets…",DCe=()=>"正在检查算力目标…",LCe=()=>"در حال بررسی مقصدهای رایانشی…",OCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DCe():t==="fa"?LCe():RCe()}),ICe=()=>"Checking credentials…",BCe=()=>"正在检查凭据…",$Ce=()=>"در حال بررسی اطلاعات ورود…",HCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BCe():t==="fa"?$Ce():ICe()}),FCe=()=>"Checking kubectl…",PCe=()=>"正在检查 kubectl…",UCe=()=>"در حال بررسی kubectl…",qCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PCe():t==="fa"?UCe():FCe()}),GCe=()=>"Checking Modal…",VCe=()=>"正在检查 Modal…",WCe=()=>"در حال بررسی Modal…",KCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VCe():t==="fa"?WCe():GCe()}),XCe=()=>"Choose a preset flavor",YCe=()=>"选择预设规格",ZCe=()=>"یک پیکربندی آماده انتخاب کنید",s7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YCe():t==="fa"?ZCe():XCe()}),QCe=()=>"Cluster",JCe=()=>"集群",e9e=()=>"خوشه",t9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JCe():t==="fa"?e9e():QCe()}),n9e=()=>"cluster default",r9e=()=>"集群默认值",s9e=()=>"پیش‌فرض خوشه",i7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),i9e=()=>"cluster default (e.g. 4h, 30m)",a9e=()=>"集群默认值(例如 4h、30m)",o9e=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",l9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a9e():t==="fa"?o9e():i9e()}),c9e=()=>"Cluster unreachable",u9e=()=>"无法连接集群",f9e=()=>"خوشه در دسترس نیست",h9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u9e():t==="fa"?f9e():c9e()}),d9e=()=>"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker.",_9e=()=>"这台计算机上检测到的编程智能体设置。研究智能体聊天由 OpenCode 提供;Claude Code 和 Codex 账户中的模型会显示在编辑器的模型选择器中。",p9e=()=>"راه‌اندازی‌های عامل کدنویسی شناسایی‌شده روی این دستگاه. گفتگوی عامل پژوهشی را OpenCode ارائه می‌کند؛ مدل‌های حساب‌های Claude Code و Codex در انتخابگر مدلِ کادر پیام دیده می‌شوند.",m9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_9e():t==="fa"?p9e():d9e()}),g9e=()=>"Compute",b9e=()=>"算力",v9e=()=>"رایانش",R9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b9e():t==="fa"?v9e():g9e()}),x9e=()=>"Connect compute backends and choose where new runs execute.",y9e=()=>"连接算力后端,并选择新运行的执行位置。",w9e=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",S9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y9e():t==="fa"?w9e():x9e()}),k9e=()=>"Connected",C9e=()=>"已连接",E9e=()=>"متصل",L2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C9e():t==="fa"?E9e():k9e()}),N9e=()=>"Context",z9e=()=>"上下文",A9e=()=>"زمینه",j9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z9e():t==="fa"?A9e():N9e()}),T9e=()=>"Current",M9e=()=>"当前",R9e=()=>"فعلی",D9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M9e():t==="fa"?R9e():T9e()}),L9e=()=>"Currently off:",O9e=()=>"当前已关闭:",I9e=()=>"اکنون خاموش است:",B9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O9e():t==="fa"?I9e():L9e()}),$9e=()=>"Custom flavor",H9e=()=>"自定义规格",F9e=()=>"پیکربندی سفارشی",P9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H9e():t==="fa"?F9e():$9e()}),U9e=()=>"Custom flavor…",q9e=()=>"自定义规格…",G9e=()=>"پیکربندی سفارشی…",D9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q9e():t==="fa"?G9e():U9e()}),V9e=()=>"Data directory",W9e=()=>"数据目录",K9e=()=>"پوشهٔ داده",X9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W9e():t==="fa"?K9e():V9e()}),Y9e=()=>"default",Z9e=()=>"默认",Q9e=()=>"پیش‌فرض",J9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z9e():t==="fa"?Q9e():Y9e()}),eEe=()=>"Default",tEe=()=>"默认",nEe=()=>"پیش‌فرض",y0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tEe():t==="fa"?nEe():eEe()}),rEe=()=>"Default destination",sEe=()=>"默认目标",iEe=()=>"مقصد پیش‌فرض",aEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sEe():t==="fa"?iEe():rEe()}),oEe=()=>"Defaults applied when you create a project.",lEe=()=>"创建项目时应用的默认值。",cEe=()=>"پیش‌فرض‌هایی که هنگام ساخت پروژه اعمال می‌شوند.",uEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lEe():t==="fa"?cEe():oEe()}),fEe=()=>"Detecting hardware…",hEe=()=>"正在检测硬件…",dEe=()=>"در حال شناسایی سخت‌افزار…",_Ee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hEe():t==="fa"?dEe():fEe()}),pEe=()=>"Detecting harnesses…",mEe=()=>"正在检测智能体工具…",gEe=()=>"در حال شناسایی ابزارهای عامل…",bEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mEe():t==="fa"?gEe():pEe()}),vEe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",xEe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",yEe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",wEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xEe():t==="fa"?yEe():vEe()}),SEe=()=>"Effective URL",kEe=()=>"实际使用的网址",CEe=()=>"نشانی مؤثر",EEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Enable GitHub syncing for new projects",zEe=()=>"为新项目启用 GitHub 同步",AEe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",a7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zEe():t==="fa"?AEe():NEe()}),jEe=()=>"Environment",TEe=()=>"环境",MEe=()=>"محیط",O2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TEe():t==="fa"?MEe():jEe()}),REe=()=>"Environment variables",DEe=()=>"环境变量",LEe=()=>"متغیرهای محیطی",OEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DEe():t==="fa"?LEe():REe()}),IEe=()=>"Failed",BEe=()=>"失败",$Ee=()=>"ناموفق",I2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BEe():t==="fa"?$Ee():IEe()}),HEe=()=>"General",FEe=()=>"常规",PEe=()=>"عمومی",UEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FEe():t==="fa"?PEe():HEe()}),qEe=()=>"GitHub publishing",GEe=()=>"GitHub 发布",VEe=()=>"انتشار در GitHub",WEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GEe():t==="fa"?VEe():qEe()}),KEe=()=>"Git token",XEe=()=>"Git 令牌",YEe=()=>"توکن Git",ZEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XEe():t==="fa"?YEe():KEe()}),QEe=()=>"Harnesses",JEe=()=>"智能体工具",eNe=()=>"ابزارهای عامل",tNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JEe():t==="fa"?eNe():QEe()}),nNe=()=>"hf_…",rNe=()=>"hf_…",sNe=()=>"hf_…",iNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rNe():t==="fa"?sNe():nNe()}),aNe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",oNe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",lNe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",cNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oNe():t==="fa"?lNe():aNe()}),uNe=()=>"Hostname",fNe=()=>"主机名",hNe=()=>"نام میزبان",dNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fNe():t==="fa"?hNe():uNe()}),_Ne=()=>"How it connects",pNe=()=>"连接方式",mNe=()=>"نحوهٔ اتصال",gNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pNe():t==="fa"?mNe():_Ne()}),bNe=()=>"Identity",vNe=()=>"身份",xNe=()=>"هویت",yNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vNe():t==="fa"?xNe():bNe()}),wNe=()=>"Initialize Git",SNe=()=>"初始化 Git",kNe=()=>"راه‌اندازی Git",CNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SNe():t==="fa"?kNe():wNe()}),ENe=()=>"Install",NNe=()=>"安装",zNe=()=>"نصب",ANe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NNe():t==="fa"?zNe():ENe()}),jNe=()=>"Install broken",TNe=()=>"安装损坏",MNe=()=>"نصب خراب است",RNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TNe():t==="fa"?MNe():jNe()}),DNe=()=>"Install GitHub CLI",LNe=()=>"安装 GitHub CLI",ONe=()=>"نصب GitHub CLI",INe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LNe():t==="fa"?ONe():DNe()}),BNe=()=>"Install updates automatically",$Ne=()=>"自动安装更新",HNe=()=>"نصب خودکار به‌روزرسانی‌ها",o7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ne():t==="fa"?HNe():BNe()}),FNe=()=>"Instance history",PNe=()=>"实例历史",UNe=()=>"تاریخچهٔ نمونه‌ها",qNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PNe():t==="fa"?UNe():FNe()}),GNe=()=>"Invalid token",VNe=()=>"令牌无效",WNe=()=>"توکن نامعتبر",KNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VNe():t==="fa"?WNe():GNe()}),XNe=()=>"Jobs",YNe=()=>"Jobs",ZNe=()=>"Jobs",QNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YNe():t==="fa"?ZNe():XNe()}),JNe=()=>"Jobs / Dashboard URL",eze=()=>"Jobs / 控制台网址",tze=()=>"نشانی Jobs / داشبورد",nze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eze():t==="fa"?tze():JNe()}),rze=()=>"Jobs permission unknown",sze=()=>"Jobs 权限未知",ize=()=>"مجوز Jobs نامشخص است",aze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sze():t==="fa"?ize():rze()}),oze=()=>"Jobs: write OK",lze=()=>"Jobs:写入正常",cze=()=>"Jobs: نوشتن مجاز است",uze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lze():t==="fa"?cze():oze()}),fze=()=>"Keeping this copy of orx on the latest release.",hze=()=>"让此 orx 保持最新版本。",dze=()=>"به‌روز نگه داشتن این نسخهٔ orx.",_ze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hze():t==="fa"?dze():fze()}),pze=()=>"kubectl not found",mze=()=>"未找到 kubectl",gze=()=>"kubectl پیدا نشد",bze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mze():t==="fa"?gze():pze()}),vze=()=>"Last error",xze=()=>"最近错误",yze=()=>"آخرین خطا",wze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xze():t==="fa"?yze():vze()}),Sze=()=>"Latest",kze=()=>"最新版本",Cze=()=>"جدیدترین",Eze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kze():t==="fa"?Cze():Sze()}),Nze=()=>"Loading…",zze=()=>"正在加载…",Aze=()=>"در حال بارگیری…",cl=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zze():t==="fa"?Aze():Nze()}),jze=()=>"Loading Ray settings…",Tze=()=>"正在加载 Ray 设置…",Mze=()=>"در حال بارگیری تنظیمات Ray…",Rze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tze():t==="fa"?Mze():jze()}),Dze=()=>"Loading slurm settings…",Lze=()=>"正在加载 Slurm 设置…",Oze=()=>"در حال بارگیری تنظیمات Slurm…",Ize=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lze():t==="fa"?Oze():Dze()}),Bze=()=>"Loading status…",$ze=()=>"正在加载状态…",Hze=()=>"در حال بارگیری وضعیت…",Fze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ze():t==="fa"?Hze():Bze()}),Pze=()=>"Local only",Uze=()=>"仅本地",qze=()=>"فقط محلی",Gze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uze():t==="fa"?qze():Pze()}),Vze=()=>"Local repository",Wze=()=>"本地仓库",Kze=()=>"مخزن محلی",Xze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wze():t==="fa"?Kze():Vze()}),Yze=()=>"Login node",Zze=()=>"登录节点",Qze=()=>"گرهٔ ورود",Jze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zze():t==="fa"?Qze():Yze()}),eAe=()=>"Make GitHub syncing the default?",tAe=()=>"将 GitHub 同步设为默认值?",nAe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",rAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tAe():t==="fa"?nAe():eAe()}),sAe=()=>"Missing bash/tar",iAe=()=>"缺少 bash/tar",aAe=()=>"bash/tar موجود نیست",oAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iAe():t==="fa"?aAe():sAe()}),lAe=()=>"More compute options",cAe=()=>"更多算力选项",uAe=()=>"گزینه‌های رایانشی بیشتر",fAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cAe():t==="fa"?uAe():lAe()}),hAe=()=>"Move failed:",dAe=()=>"移动失败:",_Ae=()=>"انتقال ناموفق بود:",pAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dAe():t==="fa"?_Ae():hAe()}),mAe=()=>"Moved. orx is now using the new location.",gAe=()=>"已移动。orx 现在使用新位置。",bAe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",vAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gAe():t==="fa"?bAe():mAe()}),xAe=()=>"Namespace",yAe=()=>"命名空间",wAe=()=>"فضای نام",SAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yAe():t==="fa"?wAe():xAe()}),kAe=()=>"New location",CAe=()=>"新位置",EAe=()=>"محل جدید",NAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CAe():t==="fa"?EAe():kAe()}),zAe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",AAe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",jAe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",TAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AAe():t==="fa"?jAe():zAe()}),MAe=()=>"New variable key",RAe=()=>"新变量键名",DAe=()=>"کلید متغیر جدید",LAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RAe():t==="fa"?DAe():MAe()}),OAe=()=>"New variable value",IAe=()=>"新变量值",BAe=()=>"مقدار متغیر جدید",$Ae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IAe():t==="fa"?BAe():OAe()}),HAe=()=>"No code, prompts, file contents, or account identifiers are sent.",FAe=()=>"不会发送代码、提示词、文件内容或账户标识符。",PAe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",UAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FAe():t==="fa"?PAe():HAe()}),qAe=()=>"No hosts found in ~/.ssh/config.",GAe=()=>"在 ~/.ssh/config 中未找到主机。",VAe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",WAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GAe():t==="fa"?VAe():qAe()}),KAe=()=>"No job-create permission",XAe=()=>"没有创建 Job 的权限",YAe=()=>"مجوز ساخت Job وجود ندارد",ZAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XAe():t==="fa"?YAe():KAe()}),QAe=()=>"No job.write permission",JAe=()=>"没有 job.write 权限",eje=()=>"مجوز job.write وجود ندارد",tje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JAe():t==="fa"?eje():QAe()}),nje=()=>"No key on this computer to register — load a registered key with",rje=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",sje=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",ije=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rje():t==="fa"?sje():nje()}),aje=()=>"No key on this computer yet — create one with",oje=()=>"此计算机上还没有密钥——使用以下命令创建:",lje=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",cje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oje():t==="fa"?lje():aje()}),uje=()=>"No Slurm CLI",fje=()=>"无 Slurm CLI",hje=()=>"بدون CLI اسلورم",dje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fje():t==="fa"?hje():uje()}),_je=()=>"No token",pje=()=>"无令牌",mje=()=>"بدون توکن",gje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pje():t==="fa"?mje():_je()}),bje=()=>"None registered",vje=()=>"未注册任何密钥",xje=()=>"هیچ‌کدام ثبت نشده",yje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vje():t==="fa"?xje():bje()}),wje=()=>"Not checked",Sje=()=>"未检查",kje=()=>"بررسی نشده",Cje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sje():t==="fa"?kje():wje()}),Eje=()=>"Not configured",Nje=()=>"未配置",zje=()=>"پیکربندی نشده",ip=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nje():t==="fa"?zje():Eje()}),Aje=()=>"Not installed",jje=()=>"未安装",Tje=()=>"نصب نیست",Mje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jje():t==="fa"?Tje():Aje()}),Rje=()=>"Not now",Dje=()=>"暂不",Lje=()=>"اکنون نه",Oje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dje():t==="fa"?Lje():Rje()}),Ije=()=>"Not on this computer",Bje=()=>"不在此计算机上",$je=()=>"روی این رایانه نیست",Hje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bje():t==="fa"?$je():Ije()}),Fje=()=>"Not set (pass --host per launch)",Pje=()=>"未设置(每次启动时传入 --host)",Uje=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",qje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pje():t==="fa"?Uje():Fje()}),Gje=()=>"Not set up",Vje=()=>"未设置",Wje=()=>"راه‌اندازی نشده",Kje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vje():t==="fa"?Wje():Gje()}),Xje=()=>"Not signed in",Yje=()=>"未登录",Zje=()=>"وارد نشده",Qje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yje():t==="fa"?Zje():Xje()}),Jje=()=>"On this computer",eTe=()=>"在此计算机上",tTe=()=>"روی این رایانه",nTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eTe():t==="fa"?tTe():Jje()}),rTe=()=>"Open a project to inspect its repository and GitHub publication state.",sTe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",iTe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",aTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sTe():t==="fa"?iTe():rTe()}),oTe=()=>"Open job page",lTe=()=>"打开作业页面",cTe=()=>"باز کردن صفحهٔ کار",l7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lTe():t==="fa"?cTe():oTe()}),uTe=()=>"Open on GitHub",fTe=()=>"在 GitHub 上打开",hTe=()=>"باز کردن در GitHub",c7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fTe():t==="fa"?hTe():uTe()}),dTe=()=>", or create one with",_Te=()=>",或使用以下命令创建:",pTe=()=>"، یا با این فرمان یکی بسازید:",mTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Te():t==="fa"?pTe():dTe()}),gTe=()=>"Org",bTe=()=>"组织",vTe=()=>"سازمان",xTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bTe():t==="fa"?vTe():gTe()}),yTe=()=>"Orgs",wTe=()=>"组织",STe=()=>"سازمان‌ها",kTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wTe():t==="fa"?STe():yTe()}),CTe=()=>"orx can't update this install",ETe=()=>"orx 无法更新此安装",NTe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",zTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ETe():t==="fa"?NTe():CTe()}),ATe=()=>"Overleaf",jTe=()=>"Overleaf",TTe=()=>"Overleaf",MTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jTe():t==="fa"?TTe():ATe()}),RTe=()=>"Overleaf Git authentication token",DTe=()=>"Overleaf Git 身份验证令牌",LTe=()=>"توکن احراز هویت Git در Overleaf",OTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DTe():t==="fa"?LTe():RTe()}),ITe=()=>"Overridden by env",BTe=()=>"已被环境变量覆盖",$Te=()=>"بازنویسی‌شده توسط محیط",HTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),FTe=()=>"Partition",PTe=()=>"分区",UTe=()=>"پارتیشن",qTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PTe():t==="fa"?UTe():FTe()}),GTe=()=>"Partitions",VTe=()=>"分区",WTe=()=>"پارتیشن‌ها",KTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VTe():t==="fa"?WTe():GTe()}),XTe=()=>"Path",YTe=()=>"路径",ZTe=()=>"مسیر",QTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YTe():t==="fa"?ZTe():XTe()}),JTe=()=>"Plan",eMe=()=>"方案",tMe=()=>"سطح اشتراک",nMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eMe():t==="fa"?tMe():JTe()}),rMe=()=>"Project",sMe=()=>"项目",iMe=()=>"پروژه",aMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),oMe=()=>"Ray version",lMe=()=>"Ray 版本",cMe=()=>"نسخهٔ Ray",uMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lMe():t==="fa"?cMe():oMe()}),fMe=()=>"Reachable",hMe=()=>"可访问",dMe=()=>"در دسترس",_Me=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hMe():t==="fa"?dMe():fMe()}),pMe=()=>"Reading ~/.ssh/config…",mMe=()=>"正在读取 ~/.ssh/config…",gMe=()=>"در حال خواندن ‎~/.ssh/config…",bMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mMe():t==="fa"?gMe():pMe()}),vMe=()=>"Ready",xMe=()=>"就绪",yMe=()=>"آماده",B2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xMe():t==="fa"?yMe():vMe()}),wMe=()=>"Ready to move",SMe=()=>"可以移动",kMe=()=>"آمادهٔ انتقال",CMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SMe():t==="fa"?kMe():wMe()}),EMe=()=>"Ready to use",NMe=()=>"可用",zMe=()=>"آمادهٔ استفاده",AMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NMe():t==="fa"?zMe():EMe()}),jMe=()=>"Refresh",TMe=()=>"刷新",MMe=()=>"تازه‌سازی",$2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TMe():t==="fa"?MMe():jMe()}),RMe=()=>"Remotes",DMe=()=>"远程仓库",LMe=()=>"مخزن‌های دوردست",OMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DMe():t==="fa"?LMe():RMe()}),IMe=()=>"Repository",BMe=()=>"仓库",$Me=()=>"مخزن",HMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BMe():t==="fa"?$Me():IMe()}),FMe=()=>"Restart to finish updating",PMe=()=>"重新启动以完成更新",UMe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",qMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PMe():t==="fa"?UMe():FMe()}),GMe=()=>"Run manifest",VMe=()=>"运行清单",WMe=()=>"مانیفست اجرا",KMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VMe():t==="fa"?WMe():GMe()}),XMe=()=>"Running instances",YMe=()=>"正在运行的实例",ZMe=()=>"نمونه‌های در حال اجرا",QMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YMe():t==="fa"?ZMe():XMe()}),JMe=()=>"Runtime",eRe=()=>"运行时间",tRe=()=>"زمان اجرا",nRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eRe():t==="fa"?tRe():JMe()}),rRe=()=>". Save it under that key if it's meant for HF Jobs.",sRe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",iRe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",aRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sRe():t==="fa"?iRe():rRe()}),oRe=()=>"Settings",lRe=()=>"设置",cRe=()=>"تنظیمات",L9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),uRe=()=>"Share anonymous product usage linked only to a random installation ID.",fRe=()=>"共享匿名的产品使用数据,仅与随机安装 ID 关联。",hRe=()=>"داده‌های ناشناس استفاده از محصول را که فقط به یک شناسهٔ تصادفی نصب پیوند دارد، به اشتراک بگذارید.",dRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fRe():t==="fa"?hRe():uRe()}),_Re=()=>"Signed in",pRe=()=>"已登录",mRe=()=>"وارد شده",O9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pRe():t==="fa"?mRe():_Re()}),gRe=()=>"Source",bRe=()=>"来源",vRe=()=>"منبع",H2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bRe():t==="fa"?vRe():gRe()}),xRe=()=>"SSH key",yRe=()=>"SSH 密钥",wRe=()=>"کلید SSH",SRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yRe():t==="fa"?wRe():xRe()}),kRe=()=>"Started",CRe=()=>"开始时间",ERe=()=>"آغاز",NRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CRe():t==="fa"?ERe():kRe()}),zRe=()=>"State",ARe=()=>"状态",jRe=()=>"وضعیت",TRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ARe():t==="fa"?jRe():zRe()}),MRe=()=>"Status",RRe=()=>"状态",DRe=()=>"وضعیت",ap=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RRe():t==="fa"?DRe():MRe()}),LRe=()=>"Storage",ORe=()=>"存储",IRe=()=>"ذخیره‌سازی",BRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ORe():t==="fa"?IRe():LRe()}),$Re=()=>"Sync",HRe=()=>"同步",FRe=()=>"همگام‌سازی",PRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HRe():t==="fa"?FRe():$Re()}),URe=()=>"Syncing off",qRe=()=>"同步已关闭",GRe=()=>"همگام‌سازی خاموش",VRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qRe():t==="fa"?GRe():URe()}),WRe=()=>"System",KRe=()=>"系统",XRe=()=>"سامانه",YRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KRe():t==="fa"?XRe():WRe()}),ZRe=()=>"Test connection",QRe=()=>"测试连接",JRe=()=>"آزمایش اتصال",I9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QRe():t==="fa"?JRe():ZRe()}),eDe=()=>"Testing…",tDe=()=>"正在测试…",nDe=()=>"در حال آزمایش…",F2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tDe():t==="fa"?nDe():eDe()}),rDe=()=>", then add it with",sDe=()=>",然后使用以下命令添加:",iDe=()=>"، سپس با این فرمان اضافه‌اش کنید:",aDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sDe():t==="fa"?iDe():rDe()}),oDe=()=>"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.",lDe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",cDe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",uDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lDe():t==="fa"?cDe():oDe()}),fDe=()=>"This saved destination is not configured. Set it up below or choose another backend.",hDe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",dDe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",_De=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hDe():t==="fa"?dDe():fDe()}),pDe=()=>"This value looks like a Hugging Face token — compute runs only read it from",mDe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",gDe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",bDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mDe():t==="fa"?gDe():pDe()}),vDe=()=>"Time limit",xDe=()=>"时间限制",yDe=()=>"محدودیت زمانی",wDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xDe():t==="fa"?yDe():vDe()}),SDe=()=>"Token",kDe=()=>"令牌",CDe=()=>"توکن",B9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kDe():t==="fa"?CDe():SDe()}),EDe=()=>"Unable to verify",NDe=()=>"无法验证",zDe=()=>"تأیید ممکن نیست",ADe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),jDe=()=>"Unknown",TDe=()=>"未知",MDe=()=>"نامشخص",$9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TDe():t==="fa"?MDe():jDe()}),RDe=()=>"Update required",DDe=()=>"需要更新",LDe=()=>"نیازمند به‌روزرسانی",ODe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DDe():t==="fa"?LDe():RDe()}),IDe=()=>"Updates",BDe=()=>"更新",$De=()=>"به‌روزرسانی‌ها",u7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BDe():t==="fa"?$De():IDe()}),HDe=()=>"Usage analytics",FDe=()=>"使用情况分析",PDe=()=>"تحلیل استفاده",UDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FDe():t==="fa"?PDe():HDe()}),qDe=()=>"value",GDe=()=>"值",VDe=()=>"مقدار",H9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GDe():t==="fa"?VDe():qDe()}),WDe=()=>"Variables available to runs and the research agent (API keys, tokens).",KDe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",XDe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API و توکن‌ها).",YDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KDe():t==="fa"?XDe():WDe()}),ZDe=()=>"Version",QDe=()=>"版本",JDe=()=>"نسخه",F9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QDe():t==="fa"?JDe():ZDe()}),eLe=()=>"What happens",tLe=()=>"执行内容",nLe=()=>"چه اتفاقی می‌افتد",rLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",iLe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",aLe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",oLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iLe():t==="fa"?aLe():sLe()}),lLe=()=>"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.",cLe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",uLe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",fLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),hLe=()=>"Pick a login node first",dLe=()=>"请先选择登录节点",_Le=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",pLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dLe():t==="fa"?_Le():hLe()}),mLe=()=>"Providers",gLe=()=>"提供商",bLe=()=>"ارائه‌دهندگان",vLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gLe():t==="fa"?bLe():mLe()}),xLe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yLe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,wLe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,SLe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yLe(e):t==="fa"?wLe(e):xLe(e)}),kLe=()=>"Reinstall with the orx installer to get automatic updates.",CLe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",ELe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",NLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),zLe=()=>"Re-link",ALe=()=>"重新链接",jLe=()=>"پیوند دوباره",TLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ALe():t==="fa"?jLe():zLe()}),MLe=()=>"Remove token",RLe=()=>"移除令牌",DLe=()=>"حذف توکن",LLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RLe():t==="fa"?DLe():MLe()}),OLe=()=>"Removing…",ILe=()=>"正在移除…",BLe=()=>"در حال حذف…",$Le=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ILe():t==="fa"?BLe():OLe()}),HLe=()=>"Replace anyway",FLe=()=>"仍要替换",PLe=()=>"به‌هرحال جایگزین کن",ULe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FLe():t==="fa"?PLe():HLe()}),qLe=()=>"Replace token",GLe=()=>"替换令牌",VLe=()=>"جایگزینی توکن",WLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GLe():t==="fa"?VLe():qLe()}),KLe=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,XLe=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,YLe=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ZLe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XLe(e):t==="fa"?YLe(e):KLe(e)}),QLe=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,JLe=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,eOe=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,tOe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JLe(e):t==="fa"?eOe(e):QLe(e)}),nOe=()=>"Retest",rOe=()=>"重新测试",sOe=()=>"آزمون دوباره",iOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rOe():t==="fa"?sOe():nOe()}),aOe=()=>"Run `gh auth login` in your terminal.",oOe=()=>"请在终端中运行 `gh auth login`。",lOe=()=>"در پایانه `gh auth login` را اجرا کنید.",cOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oOe():t==="fa"?lOe():aOe()}),uOe=()=>"Saved",fOe=()=>"已保存",hOe=()=>"ذخیره شده",dOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fOe():t==="fa"?hOe():uOe()}),_Oe=()=>"Set up",pOe=()=>"设置",mOe=()=>"راه‌اندازی",gOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),bOe=()=>"Set up environment",vOe=()=>"设置环境",xOe=()=>"راه‌اندازی محیط",yOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vOe():t==="fa"?xOe():bOe()}),wOe=()=>"Setting up… (~30–60s)",SOe=()=>"正在设置…(约 30–60 秒)",kOe=()=>"در حال راه‌اندازی… (حدود ۳۰ تا ۶۰ ثانیه)",COe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Sign in",NOe=()=>"登录",zOe=()=>"ورود",AOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),jOe=()=>"SSH defaults",TOe=()=>"SSH 默认值",MOe=()=>"پیش‌فرض‌های SSH",ROe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TOe():t==="fa"?MOe():jOe()}),DOe=()=>"Where orx keeps everything on this machine: the local database, run logs, artifacts, and chat attachments for all projects. Moving it copies the whole store to the new location and activates it there.",LOe=()=>"orx 在此计算机上存放所有内容的位置:所有项目的本地数据库、运行日志、产物和聊天附件。移动会将整个存储复制到新位置并在那里启用。",OOe=()=>"محلی که orx همه‌چیز را روی این دستگاه نگه می‌دارد: پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگوی همهٔ پروژه‌ها. انتقال، کل مخزن داده را به محل جدید کپی و همان‌جا فعال می‌کند.",IOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LOe():t==="fa"?OOe():DOe()}),BOe=()=>"Test",$Oe=()=>"测试",HOe=()=>"آزمون",FOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Oe():t==="fa"?HOe():BOe()}),POe=()=>"Testing…",UOe=()=>"正在测试…",qOe=()=>"در حال آزمون…",GOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UOe():t==="fa"?qOe():POe()}),VOe=()=>"Dark",WOe=()=>"深色",KOe=()=>"تیره",XOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WOe():t==="fa"?KOe():VOe()}),YOe=()=>"System follows your operating system's light or dark setting.",ZOe=()=>"“系统”会跟随操作系统的浅色或深色设置。",QOe=()=>"حالت «سیستم» از تنظیم روشن یا تیرهٔ سیستم‌عامل پیروی می‌کند.",JOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZOe():t==="fa"?QOe():YOe()}),eIe=()=>"Theme",tIe=()=>"主题",nIe=()=>"پوسته",f7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tIe():t==="fa"?nIe():eIe()}),rIe=()=>"Light",sIe=()=>"浅色",iIe=()=>"روشن",aIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"System",lIe=()=>"系统",cIe=()=>"سیستم",uIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),fIe=()=>"Update now",hIe=()=>"立即更新",dIe=()=>"اکنون به‌روزرسانی کن",_Ie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hIe():t==="fa"?dIe():fIe()}),pIe=e=>`Update to ${e==null?void 0:e.version}`,mIe=e=>`更新到 ${e==null?void 0:e.version}`,gIe=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,bIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mIe(e):t==="fa"?gIe(e):pIe(e)}),vIe=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",xIe=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",yIe=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",wIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xIe():t==="fa"?yIe():vIe()}),SIe=()=>"Updating default destination…",kIe=()=>"正在更新默认运行位置…",CIe=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",EIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=()=>"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.",zIe=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",AIe=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",jIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zIe():t==="fa"?AIe():NIe()}),TIe=()=>"Validating…",MIe=()=>"正在验证…",RIe=()=>"در حال اعتبارسنجی…",DIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MIe():t==="fa"?RIe():TIe()}),LIe=()=>"View settings",OIe=()=>"查看设置",IIe=()=>"مشاهدهٔ تنظیمات",BIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OIe():t==="fa"?IIe():LIe()}),$Ie=()=>"Skill",HIe=()=>"技能",FIe=()=>"مهارت",PIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HIe():t==="fa"?FIe():$Ie()}),UIe=()=>"Loading skill…",qIe=()=>"正在加载技能…",GIe=()=>"در حال بارگیری مهارت…",VIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qIe():t==="fa"?GIe():UIe()}),WIe=e=>`Delete the “${e==null?void 0:e.name}” skill?`,KIe=e=>`删除技能“${e==null?void 0:e.name}”?`,XIe=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,YIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KIe(e):t==="fa"?XIe(e):WIe(e)}),ZIe=e=>`Delete skill ${e==null?void 0:e.name}`,QIe=e=>`删除技能 ${e==null?void 0:e.name}`,JIe=e=>`حذف مهارت ${e==null?void 0:e.name}`,eBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QIe(e):t==="fa"?JIe(e):ZIe(e)}),tBe=e=>`Delete the “${e==null?void 0:e.name}” template?`,nBe=e=>`删除模板“${e==null?void 0:e.name}”?`,rBe=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,sBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=e=>`Delete template ${e==null?void 0:e.name}`,aBe=e=>`删除模板 ${e==null?void 0:e.name}`,oBe=e=>`حذف قالب ${e==null?void 0:e.name}`,lBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aBe(e):t==="fa"?oBe(e):iBe(e)}),cBe=()=>"Drop a SKILL.md or .zip here, or click to choose",uBe=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",fBe=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",hBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uBe():t==="fa"?fBe():cBe()}),dBe=()=>"Drop a .tex or .zip here, or click to choose",_Be=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",pBe=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",mBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Be():t==="fa"?pBe():dBe()}),gBe=()=>"File too large (max 20 MB).",bBe=()=>"文件过大(最大 20 MB)。",vBe=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",P9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bBe():t==="fa"?vBe():gBe()}),xBe=()=>"Global",yBe=()=>"全局",wBe=()=>"سراسری",U9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yBe():t==="fa"?wBe():xBe()}),SBe=()=>"Available to the agent in every project.",kBe=()=>"智能体可在每个项目中使用。",CBe=()=>"عامل در همهٔ پروژه‌ها به آن دسترسی دارد.",EBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kBe():t==="fa"?CBe():SBe()}),NBe=()=>"Import",zBe=()=>"导入",ABe=()=>"درون‌ریزی",jBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zBe():t==="fa"?ABe():NBe()}),TBe=()=>"No project open",MBe=()=>"未打开项目",RBe=()=>"پروژه‌ای باز نیست",DBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MBe():t==="fa"?RBe():TBe()}),LBe=()=>" + 1 file",OBe=()=>" + 1 个文件",IBe=()=>" + ۱ فایل",BBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Open a project to scope this to one project",HBe=()=>"请先打开一个项目,才能限定到单个项目",FBe=()=>"برای محدود کردن به یک پروژه، ابتدا پروژه‌ای را باز کنید",PBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HBe():t==="fa"?FBe():$Be()}),UBe=()=>"What the agent brings to every session: LaTeX templates it writes papers into, and SKILL.md skills it discovers automatically and you invoke with /name in chat. Both apply everywhere, or only to this project.",qBe=()=>"智能体在每个会话中都会携带用于撰写论文的 LaTeX 模板,以及自动发现、可在聊天中通过 /name 调用的 SKILL.md 技能。两者都可以应用于所有位置,也可以仅应用于此项目。",GBe=()=>"عامل در هر نشست قالب‌های LaTeX برای نوشتن مقاله‌ها و مهارت‌های SKILL.md را همراه دارد؛ مهارت‌ها را خودکار پیدا می‌کند و شما با ‎/name در گفتگو فراخوانی می‌کنید. هر دو می‌توانند همه‌جا یا فقط در این پروژه اعمال شوند.",VBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qBe():t==="fa"?GBe():UBe()}),WBe=()=>"Available only in this project’s sessions. Shadows a global skill of the same name.",KBe=()=>"仅供此项目的会话使用;同名的全局技能将被覆盖。",XBe=()=>"فقط در نشست‌های این پروژه در دسترس است و مهارت سراسری هم‌نام را می‌پوشاند.",YBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KBe():t==="fa"?XBe():WBe()}),ZBe=()=>"Re-import",QBe=()=>"重新导入",JBe=()=>"درون‌ریزی دوباره",e$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QBe():t==="fa"?JBe():ZBe()}),t$e=()=>"Skill scope",n$e=()=>"技能范围",r$e=()=>"دامنهٔ مهارت",s$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>` + ${e==null?void 0:e.count} files`,a$e=e=>` + ${e==null?void 0:e.count} 个文件`,o$e=e=>` + ${e==null?void 0:e.count} فایل`,l$e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=()=>"Add a skill",u$e=()=>"添加技能",f$e=()=>"افزودن مهارت",h$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u$e():t==="fa"?f$e():c$e()}),d$e=()=>"Adding to",_$e=()=>"正在添加到",p$e=()=>"در حال افزودن به",m$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_$e():t==="fa"?p$e():d$e()}),g$e=()=>"Could not load templates:",b$e=()=>"无法加载模板:",v$e=()=>"بارگیری قالب‌ها ممکن نشد:",x$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b$e():t==="fa"?v$e():g$e()}),y$e=()=>"Customize",w$e=()=>"自定义",S$e=()=>"سفارشی‌سازی",k$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w$e():t==="fa"?S$e():y$e()}),C$e=()=>"Delete skill",E$e=()=>"删除技能",N$e=()=>"حذف مهارت",z$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E$e():t==="fa"?N$e():C$e()}),A$e=()=>"Delete template",j$e=()=>"删除模板",T$e=()=>"حذف قالب",M$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j$e():t==="fa"?T$e():A$e()}),R$e=()=>"Every project",D$e=()=>"每个项目",L$e=()=>"همهٔ پروژه‌ها",O$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D$e():t==="fa"?L$e():R$e()}),I$e=()=>"Global",B$e=()=>"全局",$$e=()=>"سراسری",P2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B$e():t==="fa"?$$e():I$e()}),H$e=()=>"Global skills",F$e=()=>"全局技能",P$e=()=>"مهارت‌های سراسری",U$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F$e():t==="fa"?P$e():H$e()}),q$e=()=>"Import from your agent",G$e=()=>"从智能体导入",V$e=()=>"درون‌ریزی از عامل شما",W$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G$e():t==="fa"?V$e():q$e()}),K$e=()=>"LaTeX templates",X$e=()=>"LaTeX 模板",Y$e=()=>"قالب‌های LaTeX",Z$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X$e():t==="fa"?Y$e():K$e()}),Q$e=()=>"Loading skills…",J$e=()=>"正在加载技能…",eHe=()=>"در حال بارگیری مهارت‌ها…",tHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J$e():t==="fa"?eHe():Q$e()}),nHe=()=>"Loading templates…",rHe=()=>"正在加载模板…",sHe=()=>"در حال بارگیری قالب‌ها…",iHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rHe():t==="fa"?sHe():nHe()}),aHe=()=>"No skills yet.",oHe=()=>"尚无技能。",lHe=()=>"هنوز مهارتی وجود ندارد.",cHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oHe():t==="fa"?lHe():aHe()}),uHe=()=>"No templates yet.",fHe=()=>"尚无模板。",hHe=()=>"هنوز قالبی وجود ندارد.",dHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fHe():t==="fa"?hHe():uHe()}),_He=()=>"Skills already installed in your coding agents. Import a copy into",pHe=()=>"编程智能体中已安装的技能。将副本导入",mHe=()=>"مهارت‌های ازپیش نصب‌شده در عامل‌های کدنویسی شما. یک کپی را به",gHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pHe():t==="fa"?mHe():_He()}),bHe=()=>"so it's managed here and invocable with",vHe=()=>",即可在此管理,并通过",xHe=()=>"درون‌ریزی کنید تا اینجا مدیریت شود و با",yHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vHe():t==="fa"?xHe():bHe()}),wHe=()=>"This project",SHe=()=>"此项目",kHe=()=>"این پروژه",U2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SHe():t==="fa"?kHe():wHe()}),CHe=()=>"Uploading…",EHe=()=>"正在上传…",NHe=()=>"در حال بارگذاری…",zHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EHe():t==="fa"?NHe():CHe()}),AHe=()=>"Template scope",jHe=()=>"模板范围",THe=()=>"دامنهٔ قالب",MHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jHe():t==="fa"?THe():AHe()}),RHe=()=>"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. With exactly one template available, the agent uses it without asking.",DHe=()=>"智能体会使用会议文档类或内部样式来撰写论文,而不是使用默认导言。请上传 .tex 文件,或包含 .cls 和 .sty 文件的 .zip 压缩包。当恰好只有一个模板可用时,智能体会直接使用,无需询问。",LHe=()=>"عامل به‌جای مقدمهٔ پیش‌فرض، مقاله‌ها را با کلاس همایش یا سبک سازمانی می‌نویسد. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید. وقتی دقیقاً یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",OHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DHe():t==="fa"?LHe():RHe()}),IHe=()=>"Upload a SKILL.md file or a .zip of a skill folder.",BHe=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",$He=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",HHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BHe():t==="fa"?$He():IHe()}),FHe=()=>"Upload a .tex file or a .zip of a template folder.",PHe=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",UHe=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",qHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PHe():t==="fa"?UHe():FHe()}),GHe=()=>"Cancelled",VHe=()=>"已取消",WHe=()=>"لغوشده",KHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VHe():t==="fa"?WHe():GHe()}),XHe=()=>"Cancelling",YHe=()=>"正在取消",ZHe=()=>"در حال لغو",QHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YHe():t==="fa"?ZHe():XHe()}),JHe=()=>"Done",eFe=()=>"已完成",tFe=()=>"انجام‌شده",nFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eFe():t==="fa"?tFe():JHe()}),rFe=()=>"Editing",sFe=()=>"正在编辑",iFe=()=>"در حال ویرایش",aFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sFe():t==="fa"?iFe():rFe()}),oFe=()=>"Failed",lFe=()=>"失败",cFe=()=>"ناموفق",uFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lFe():t==="fa"?cFe():oFe()}),fFe=()=>"Idle",hFe=()=>"空闲",dFe=()=>"بی‌کار",_Fe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hFe():t==="fa"?dFe():fFe()}),pFe=()=>"Running",mFe=()=>"运行中",gFe=()=>"در حال اجرا",bFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mFe():t==="fa"?gFe():pFe()}),vFe=()=>"Starting",xFe=()=>"正在启动",yFe=()=>"در حال آغاز",wFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xFe():t==="fa"?yFe():vFe()}),SFe=()=>"Copying…",kFe=()=>"正在复制…",CFe=()=>"در حال کپی…",EFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kFe():t==="fa"?CFe():SFe()}),NFe=()=>"Finalizing…",zFe=()=>"正在完成…",AFe=()=>"در حال نهایی‌سازی…",jFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zFe():t==="fa"?AFe():NFe()}),TFe=e=>`${e==null?void 0:e.size} free at target`,MFe=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,RFe=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,DFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MFe(e):t==="fa"?RFe(e):TFe(e)}),LFe=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.`,JHe=e=>`将所有 orx 数据移动到: +The store is copied to the new location and activated there. Active runs or chats will block the move.`,OFe=e=>`将所有 orx 数据移动到: ${e==null?void 0:e.path} -存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,ePe=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ +存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,IFe=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,tPe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JHe(e):t==="fa"?ePe(e):QHe(e)}),nPe=()=>"Move data here",rPe=()=>"将数据移动到此处",sPe=()=>"انتقال داده به اینجا",iPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"Moving…",oPe=()=>"正在移动…",lPe=()=>"در حال جابه‌جایی…",cPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=()=>"Preparing…",fPe=()=>"正在准备…",dPe=()=>"در حال آماده‌سازی…",hPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fPe():t==="fa"?dPe():uPe()}),_Pe=()=>" (same disk, instant)",pPe=()=>"(同一磁盘,可立即完成)",mPe=()=>" (روی همان دیسک، فوری)",gPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),bPe=()=>"default location",vPe=()=>"默认位置",xPe=()=>"محل پیش‌فرض",yPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vPe():t==="fa"?xPe():bPe()}),wPe=()=>"ORX_DATA_DIR environment variable",SPe=()=>"ORX_DATA_DIR 环境变量",kPe=()=>"متغیر محیطی ORX_DATA_DIR",CPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"your saved setting",NPe=()=>"已保存的设置",zPe=()=>"تنظیم ذخیره‌شدهٔ شما",APe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),jPe=()=>"XDG_DATA_HOME",TPe=()=>"XDG_DATA_HOME",MPe=()=>"XDG_DATA_HOME",RPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TPe():t==="fa"?MPe():jPe()}),DPe=()=>"Verifying…",LPe=()=>"正在验证…",OPe=()=>"در حال بررسی…",IPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LPe():t==="fa"?OPe():DPe()}),BPe=()=>"Loading…",$Pe=()=>"正在加载…",HPe=()=>"در حال بارگیری…",PPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Pe():t==="fa"?HPe():BPe()}),FPe=()=>"This sub-agent is no longer available.",UPe=()=>"此子智能体已不可用。",qPe=()=>"این عامل فرعی دیگر در دسترس نیست.",GPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UPe():t==="fa"?qPe():FPe()}),VPe=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,WPe=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,KPe=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,XPe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WPe(e):t==="fa"?KPe(e):VPe(e)}),YPe=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,ZPe=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,QPe=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,JPe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZPe(e):t==="fa"?QPe(e):YPe(e)}),eFe=()=>", a repo for training a mini-GPT from scratch.",tFe=()=>",一个从零训练迷你 GPT 的仓库。",nFe=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",rFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=()=>"Close",iFe=()=>"关闭",aFe=()=>"بستن",oFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iFe():t==="fa"?aFe():sFe()}),lFe=()=>"Create a new project",cFe=()=>"新建项目",uFe=()=>"ایجاد پروژهٔ جدید",fFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),dFe=()=>"Demo project",hFe=()=>"演示项目",_Fe=()=>"پروژهٔ نمایشی",pFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hFe():t==="fa"?_Fe():dFe()}),mFe=()=>"Explore the demo",gFe=()=>"探索演示项目",bFe=()=>"دیدن پروژهٔ نمایشی",vFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gFe():t==="fa"?bFe():mFe()}),xFe=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",yFe=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",wFe=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",SFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yFe():t==="fa"?wFe():xFe()}),kFe=()=>"nanochat",CFe=()=>"nanochat",EFe=()=>"nanochat",NFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Couldn’t save your progress. Try again.",AFe=()=>"无法保存进度。请重试。",jFe=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",TFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AFe():t==="fa"?jFe():zFe()}),MFe=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",RFe=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",DFe=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",LFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RFe():t==="fa"?DFe():MFe()}),OFe=()=>"Welcome to OpenResearch",IFe=()=>"欢迎使用 OpenResearch",BFe=()=>"به OpenResearch خوش آمدید",$Fe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),HFe=()=>"Baseline",PFe=()=>"基线",FFe=()=>"مبنا",UFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PFe():t==="fa"?FFe():HFe()}),qFe=()=>"Experiment",GFe=()=>"实验",VFe=()=>"آزمایش",Ya=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GFe():t==="fa"?VFe():qFe()}),WFe=e=>`${e==null?void 0:e.count} experiments`,KFe=e=>`${e==null?void 0:e.count} 个实验`,XFe=e=>`${e==null?void 0:e.count} آزمایش`,YFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KFe(e):t==="fa"?XFe(e):WFe(e)}),ZFe=()=>"1 experiment",QFe=()=>"1 个实验",JFe=()=>"۱ آزمایش",eUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QFe():t==="fa"?JFe():ZFe()}),tUe=()=>"Running",nUe=()=>"运行中",rUe=()=>"در حال اجرا",sUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nUe():t==="fa"?rUe():tUe()}),iUe=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",aUe=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",oUe=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",lUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aUe():t==="fa"?oUe():iUe()}),cUe=()=>"Ask the agent in chat to create and run your first experiment.",uUe=()=>"在聊天中让智能体创建并运行你的第一个实验。",fUe=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",dUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uUe():t==="fa"?fUe():cUe()}),hUe=()=>"Code",_Ue=()=>"代码",pUe=()=>"کد",mUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Logs",bUe=()=>"日志",vUe=()=>"گزارش‌ها",P9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bUe():t==="fa"?vUe():gUe()}),xUe=()=>"No experiments from the current task yet",yUe=()=>"当前任务尚无实验",wUe=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",SUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yUe():t==="fa"?wUe():xUe()}),kUe=()=>"No experiments yet",CUe=()=>"尚无实验",EUe=()=>"هنوز آزمایشی وجود ندارد",NUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"no runs",AUe=()=>"无运行",jUe=()=>"بدون اجرا",TUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AUe():t==="fa"?jUe():zUe()}),MUe=()=>"Open logs",RUe=()=>"打开日志",DUe=()=>"باز کردن گزارش‌ها",LUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RUe():t==="fa"?DUe():MUe()}),OUe=()=>"other tasks",IUe=()=>"其他任务",BUe=()=>"وظایف دیگر",$Ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),HUe=()=>"Runs",PUe=()=>"运行",FUe=()=>"اجراها",UUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PUe():t==="fa"?FUe():HUe()}),qUe=()=>"Switch to Entire project to see all experiments",GUe=()=>"切换到“整个项目”以查看所有实验",VUe=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",WUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GUe():t==="fa"?VUe():qUe()}),KUe=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,XUe=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,YUe=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,ZUe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XUe(e):t==="fa"?YUe(e):KUe(e)}),QUe=()=>"Dismiss",JUe=()=>"关闭",eqe=()=>"بستن",tqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JUe():t==="fa"?eqe():QUe()}),nqe=()=>"macOS app",rqe=()=>"macOS 应用",sqe=()=>"برنامهٔ macOS",iqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rqe():t==="fa"?sqe():nqe()}),aqe=()=>"Installed with cargo",oqe=()=>"通过 cargo 安装",lqe=()=>"نصب‌شده با cargo",cqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oqe():t==="fa"?lqe():aqe()}),uqe=()=>"Installed with Homebrew",fqe=()=>"通过 Homebrew 安装",dqe=()=>"نصب‌شده با Homebrew",hqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fqe():t==="fa"?dqe():uqe()}),_qe=()=>"Installed with the orx installer",pqe=()=>"通过 orx 安装程序安装",mqe=()=>"نصب‌شده با نصب‌کنندهٔ orx",gqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),bqe=()=>"Managed by Nix",vqe=()=>"由 Nix 管理",xqe=()=>"مدیریت‌شده با Nix",yqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vqe():t==="fa"?xqe():bqe()}),wqe=()=>"Unknown install",Sqe=()=>"未知安装方式",kqe=()=>"روش نصب نامشخص",Cqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sqe():t==="fa"?kqe():wqe()}),Eqe=()=>"Re-run your cargo install to update.",Nqe=()=>"重新运行 cargo 安装命令以更新。",zqe=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Aqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nqe():t==="fa"?zqe():Eqe()}),jqe=()=>"Run brew upgrade to update.",Tqe=()=>"运行 brew upgrade 以更新。",Mqe=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Rqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tqe():t==="fa"?Mqe():jqe()}),Dqe=()=>"Update it through your Nix configuration.",Lqe=()=>"通过 Nix 配置进行更新。",Oqe=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Iqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=e=>`Current worktree · ${e==null?void 0:e.branch}`,$qe=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Hqe=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Pqe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$qe(e):t==="fa"?Hqe(e):Bqe(e)}),Fqe=e=>`Default branch · ${e==null?void 0:e.branch}`,Uqe=e=>`默认分支 · ${e==null?void 0:e.branch}`,qqe=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,Gqe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Uqe(e):t==="fa"?qqe(e):Fqe(e)}),Vqe=e=>`detached at ${e==null?void 0:e.branch}`,Wqe=e=>`分离于 ${e==null?void 0:e.branch}`,Kqe=e=>`جدا در ${e==null?void 0:e.branch}`,Xqe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Wqe(e):t==="fa"?Kqe(e):Vqe(e)}),Yqe=()=>"Listing truncated.",Zqe=()=>"列表已截断。",Qqe=()=>"فهرست کوتاه شده است.",Jqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zqe():t==="fa"?Qqe():Yqe()}),eGe=()=>"Loading…",tGe=()=>"正在加载…",nGe=()=>"در حال بارگیری…",rGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tGe():t==="fa"?nGe():eGe()}),sGe=()=>"No changes yet.",iGe=()=>"尚无更改。",aGe=()=>"هنوز تغییری وجود ندارد.",oGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iGe():t==="fa"?aGe():sGe()}),lGe=()=>"No files.",cGe=()=>"没有文件。",uGe=()=>"فایلی وجود ندارد.",fGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cGe():t==="fa"?uGe():lGe()}),dGe=()=>"Refresh failed:",hGe=()=>"刷新失败:",_Ge=()=>"تازه‌سازی ناموفق بود:",pGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hGe():t==="fa"?_Ge():dGe()});/** +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,BFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OFe(e):t==="fa"?IFe(e):LFe(e)}),$Fe=()=>"Move data here",HFe=()=>"将数据移动到此处",FFe=()=>"انتقال داده به اینجا",PFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HFe():t==="fa"?FFe():$Fe()}),UFe=()=>"Moving…",qFe=()=>"正在移动…",GFe=()=>"در حال جابه‌جایی…",VFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qFe():t==="fa"?GFe():UFe()}),WFe=()=>"Preparing…",KFe=()=>"正在准备…",XFe=()=>"در حال آماده‌سازی…",YFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KFe():t==="fa"?XFe():WFe()}),ZFe=()=>" (same disk, instant)",QFe=()=>"(同一磁盘,可立即完成)",JFe=()=>" (روی همان دیسک، فوری)",ePe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QFe():t==="fa"?JFe():ZFe()}),tPe=()=>"default location",nPe=()=>"默认位置",rPe=()=>"محل پیش‌فرض",sPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nPe():t==="fa"?rPe():tPe()}),iPe=()=>"ORX_DATA_DIR environment variable",aPe=()=>"ORX_DATA_DIR 环境变量",oPe=()=>"متغیر محیطی ORX_DATA_DIR",lPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aPe():t==="fa"?oPe():iPe()}),cPe=()=>"your saved setting",uPe=()=>"已保存的设置",fPe=()=>"تنظیم ذخیره‌شدهٔ شما",hPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uPe():t==="fa"?fPe():cPe()}),dPe=()=>"XDG_DATA_HOME",_Pe=()=>"XDG_DATA_HOME",pPe=()=>"XDG_DATA_HOME",mPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Pe():t==="fa"?pPe():dPe()}),gPe=()=>"Verifying…",bPe=()=>"正在验证…",vPe=()=>"در حال بررسی…",xPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bPe():t==="fa"?vPe():gPe()}),yPe=()=>"Loading…",wPe=()=>"正在加载…",SPe=()=>"در حال بارگیری…",kPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wPe():t==="fa"?SPe():yPe()}),CPe=()=>"This sub-agent is no longer available.",EPe=()=>"此子智能体已不可用。",NPe=()=>"این عامل فرعی دیگر در دسترس نیست.",zPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EPe():t==="fa"?NPe():CPe()}),APe=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,jPe=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,TPe=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,MPe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jPe(e):t==="fa"?TPe(e):APe(e)}),RPe=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,DPe=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,LPe=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,OPe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DPe(e):t==="fa"?LPe(e):RPe(e)}),IPe=()=>", a repo for training a mini-GPT from scratch.",BPe=()=>",一个从零训练迷你 GPT 的仓库。",$Pe=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",HPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BPe():t==="fa"?$Pe():IPe()}),FPe=()=>"Close",PPe=()=>"关闭",UPe=()=>"بستن",qPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PPe():t==="fa"?UPe():FPe()}),GPe=()=>"Create a new project",VPe=()=>"新建项目",WPe=()=>"ایجاد پروژهٔ جدید",KPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VPe():t==="fa"?WPe():GPe()}),XPe=()=>"Demo project",YPe=()=>"演示项目",ZPe=()=>"پروژهٔ نمایشی",QPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YPe():t==="fa"?ZPe():XPe()}),JPe=()=>"Explore the demo",eUe=()=>"探索演示项目",tUe=()=>"دیدن پروژهٔ نمایشی",nUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eUe():t==="fa"?tUe():JPe()}),rUe=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",sUe=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",iUe=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",aUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"nanochat",lUe=()=>"nanochat",cUe=()=>"nanochat",uUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),fUe=()=>"Couldn’t save your progress. Try again.",hUe=()=>"无法保存进度。请重试。",dUe=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",_Ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hUe():t==="fa"?dUe():fUe()}),pUe=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",mUe=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",gUe=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",bUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mUe():t==="fa"?gUe():pUe()}),vUe=()=>"Welcome to OpenResearch",xUe=()=>"欢迎使用 OpenResearch",yUe=()=>"به OpenResearch خوش آمدید",wUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xUe():t==="fa"?yUe():vUe()}),SUe=()=>"Baseline",kUe=()=>"基线",CUe=()=>"مبنا",EUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kUe():t==="fa"?CUe():SUe()}),NUe=()=>"Experiment",zUe=()=>"实验",AUe=()=>"آزمایش",Ya=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zUe():t==="fa"?AUe():NUe()}),jUe=e=>`${e==null?void 0:e.count} experiments`,TUe=e=>`${e==null?void 0:e.count} 个实验`,MUe=e=>`${e==null?void 0:e.count} آزمایش`,RUe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TUe(e):t==="fa"?MUe(e):jUe(e)}),DUe=()=>"1 experiment",LUe=()=>"1 个实验",OUe=()=>"۱ آزمایش",IUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LUe():t==="fa"?OUe():DUe()}),BUe=()=>"Running",$Ue=()=>"运行中",HUe=()=>"در حال اجرا",FUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ue():t==="fa"?HUe():BUe()}),PUe=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",UUe=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",qUe=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",GUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UUe():t==="fa"?qUe():PUe()}),VUe=()=>"Ask the agent in chat to create and run your first experiment.",WUe=()=>"在聊天中让智能体创建并运行你的第一个实验。",KUe=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",XUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WUe():t==="fa"?KUe():VUe()}),YUe=()=>"Code",ZUe=()=>"代码",QUe=()=>"کد",JUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZUe():t==="fa"?QUe():YUe()}),eqe=()=>"Logs",tqe=()=>"日志",nqe=()=>"گزارش‌ها",q9=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tqe():t==="fa"?nqe():eqe()}),rqe=()=>"No experiments from the current task yet",sqe=()=>"当前任务尚无实验",iqe=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",aqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"No experiments yet",lqe=()=>"尚无实验",cqe=()=>"هنوز آزمایشی وجود ندارد",uqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),fqe=()=>"no runs",hqe=()=>"无运行",dqe=()=>"بدون اجرا",_qe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hqe():t==="fa"?dqe():fqe()}),pqe=()=>"Open logs",mqe=()=>"打开日志",gqe=()=>"باز کردن گزارش‌ها",bqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mqe():t==="fa"?gqe():pqe()}),vqe=()=>"other tasks",xqe=()=>"其他任务",yqe=()=>"وظایف دیگر",wqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xqe():t==="fa"?yqe():vqe()}),Sqe=()=>"Runs",kqe=()=>"运行",Cqe=()=>"اجراها",Eqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kqe():t==="fa"?Cqe():Sqe()}),Nqe=()=>"Switch to Entire project to see all experiments",zqe=()=>"切换到“整个项目”以查看所有实验",Aqe=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",jqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zqe():t==="fa"?Aqe():Nqe()}),Tqe=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,Mqe=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Rqe=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Dqe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Mqe(e):t==="fa"?Rqe(e):Tqe(e)}),Lqe=()=>"Dismiss",Oqe=()=>"关闭",Iqe=()=>"بستن",Bqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Oqe():t==="fa"?Iqe():Lqe()}),$qe=()=>"macOS app",Hqe=()=>"macOS 应用",Fqe=()=>"برنامهٔ macOS",Pqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hqe():t==="fa"?Fqe():$qe()}),Uqe=()=>"Installed with cargo",qqe=()=>"通过 cargo 安装",Gqe=()=>"نصب‌شده با cargo",Vqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qqe():t==="fa"?Gqe():Uqe()}),Wqe=()=>"Installed with Homebrew",Kqe=()=>"通过 Homebrew 安装",Xqe=()=>"نصب‌شده با Homebrew",Yqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kqe():t==="fa"?Xqe():Wqe()}),Zqe=()=>"Installed with the orx installer",Qqe=()=>"通过 orx 安装程序安装",Jqe=()=>"نصب‌شده با نصب‌کنندهٔ orx",eGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qqe():t==="fa"?Jqe():Zqe()}),tGe=()=>"Managed by Nix",nGe=()=>"由 Nix 管理",rGe=()=>"مدیریت‌شده با Nix",sGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nGe():t==="fa"?rGe():tGe()}),iGe=()=>"Unknown install",aGe=()=>"未知安装方式",oGe=()=>"روش نصب نامشخص",lGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aGe():t==="fa"?oGe():iGe()}),cGe=()=>"Re-run your cargo install to update.",uGe=()=>"重新运行 cargo 安装命令以更新。",fGe=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",hGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uGe():t==="fa"?fGe():cGe()}),dGe=()=>"Run brew upgrade to update.",_Ge=()=>"运行 brew upgrade 以更新。",pGe=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",mGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ge():t==="fa"?pGe():dGe()}),gGe=()=>"Update it through your Nix configuration.",bGe=()=>"通过 Nix 配置进行更新。",vGe=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",xGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bGe():t==="fa"?vGe():gGe()}),yGe=e=>`Current worktree · ${e==null?void 0:e.branch}`,wGe=e=>`当前工作树 · ${e==null?void 0:e.branch}`,SGe=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,kGe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wGe(e):t==="fa"?SGe(e):yGe(e)}),CGe=e=>`Default branch · ${e==null?void 0:e.branch}`,EGe=e=>`默认分支 · ${e==null?void 0:e.branch}`,NGe=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,zGe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EGe(e):t==="fa"?NGe(e):CGe(e)}),AGe=e=>`detached at ${e==null?void 0:e.branch}`,jGe=e=>`分离于 ${e==null?void 0:e.branch}`,TGe=e=>`جدا در ${e==null?void 0:e.branch}`,MGe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jGe(e):t==="fa"?TGe(e):AGe(e)}),RGe=()=>"Listing truncated.",DGe=()=>"列表已截断。",LGe=()=>"فهرست کوتاه شده است.",OGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DGe():t==="fa"?LGe():RGe()}),IGe=()=>"Loading…",BGe=()=>"正在加载…",$Ge=()=>"در حال بارگیری…",HGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BGe():t==="fa"?$Ge():IGe()}),FGe=()=>"No changes yet.",PGe=()=>"尚无更改。",UGe=()=>"هنوز تغییری وجود ندارد.",qGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PGe():t==="fa"?UGe():FGe()}),GGe=()=>"No files.",VGe=()=>"没有文件。",WGe=()=>"فایلی وجود ندارد.",KGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VGe():t==="fa"?WGe():GGe()}),XGe=()=>"Refresh failed:",YGe=()=>"刷新失败:",ZGe=()=>"تازه‌سازی ناموفق بود:",QGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YGe():t==="fa"?ZGe():XGe()});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const F9=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** + */const G9=(...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 mGe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const JGe=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 gGe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** + */const eVe=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 u7=e=>{const n=gGe(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** + */const h7=e=>{const n=eVe(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 v1={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 w1={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 bGe=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},vGe=R.createContext({}),xGe=()=>R.useContext(vGe),yGe=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>{const{size:f=24,strokeWidth:_=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:g=""}=xGe()??{},S=r??h?Number(t??_)*24/Number(n??f):t??_;return R.createElement("svg",{ref:c,...v1,width:n??f??v1.width,height:n??f??v1.height,stroke:e??m,strokeWidth:S,className:F9("lucide",g,s),...!a&&!bGe(l)&&{"aria-hidden":"true"},...l},[...o.map(([k,v])=>R.createElement(k,v)),...Array.isArray(a)?a:[a]])});/** + */const tVe=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},nVe=R.createContext({}),rVe=()=>R.useContext(nVe),sVe=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>{const{size:f=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:m="currentColor",className:g=""}=rVe()??{},S=r??d?Number(t??_)*24/Number(n??f):t??_;return R.createElement("svg",{ref:c,...w1,width:n??f??w1.width,height:n??f??w1.height,stroke:e??m,strokeWidth:S,className:G9("lucide",g,s),...!a&&!tVe(l)&&{"aria-hidden":"true"},...l},[...o.map(([k,v])=>R.createElement(k,v)),...Array.isArray(a)?a:[a]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ye=(e,n)=>{const t=R.forwardRef(({className:r,...s},a)=>R.createElement(yGe,{ref:a,iconNode:n,className:F9(`lucide-${mGe(u7(e))}`,`lucide-${e}`,r),...s}));return t.displayName=u7(e),t};/** + */const Xe=(e,n)=>{const t=R.forwardRef(({className:r,...s},a)=>R.createElement(sVe,{ref:a,iconNode:n,className:G9(`lucide-${JGe(h7(e))}`,`lucide-${e}`,r),...s}));return t.displayName=h7(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 wGe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ud=Ye("arrow-left",wGe);/** + */const iVe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],uh=Xe("arrow-left",iVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SGe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Q_=Ye("arrow-right",SGe);/** + */const aVe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],J_=Xe("arrow-right",aVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kGe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],CGe=Ye("arrow-up-right",kGe);/** + */const oVe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],lVe=Xe("arrow-up-right",oVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EGe=[["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"}]],U9=Ye("blocks",EGe);/** + */const cVe=[["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"}]],V9=Xe("blocks",cVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NGe=[["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"}]],zGe=Ye("book-open",NGe);/** + */const uVe=[["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"}]],fVe=Xe("book-open",uVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AGe=[["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"}]],jGe=Ye("calendar-days",AGe);/** + */const hVe=[["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"}]],dVe=Xe("calendar-days",hVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TGe=[["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"}]],MGe=Ye("chart-spline",TGe);/** + */const _Ve=[["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"}]],pVe=Xe("chart-spline",_Ve);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RGe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],os=Ye("check",RGe);/** + */const mVe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ds=Xe("check",mVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DGe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ya=Ye("chevron-down",DGe);/** + */const gVe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ya=Xe("chevron-down",gVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LGe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],q9=Ye("chevron-left",LGe);/** + */const bVe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],W9=Xe("chevron-left",bVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OGe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wa=Ye("chevron-right",OGe);/** + */const vVe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wa=Xe("chevron-right",vVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IGe=[["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"}]],BGe=Ye("circle-alert",IGe);/** + */const xVe=[["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"}]],yVe=Xe("circle-alert",xVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $Ge=[["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"}]],HGe=Ye("circle-question-mark",$Ge);/** + */const wVe=[["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"}]],SVe=Xe("circle-question-mark",wVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PGe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],G9=Ye("circle-stop",PGe);/** + */const kVe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],K9=Xe("circle-stop",kVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FGe=[["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"}]],V9=Ye("circle-x",FGe);/** + */const CVe=[["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"}]],X9=Xe("circle-x",CVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UGe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qGe=Ye("clock-3",UGe);/** + */const EVe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],NVe=Xe("clock-3",EVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GGe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],VGe=Ye("clock",GGe);/** + */const zVe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],AVe=Xe("clock",zVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WGe=[["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"}]],KGe=Ye("cloud-upload",WGe);/** + */const jVe=[["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"}]],TVe=Xe("cloud-upload",jVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XGe=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Wb=Ye("code",XGe);/** + */const MVe=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Xb=Xe("code",MVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YGe=[["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"}]],ap=Ye("copy",YGe);/** + */const RVe=[["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"}]],op=Xe("copy",RVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZGe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],W9=Ye("corner-down-left",ZGe);/** + */const DVe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Y9=Xe("corner-down-left",DVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QGe=[["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"}]],JGe=Ye("cpu",QGe);/** + */const LVe=[["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"}]],OVe=Xe("cpu",LVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eVe=[["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"}]],K9=Ye("download",eVe);/** + */const IVe=[["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"}]],Z9=Xe("download",IVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tVe=[["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"}]],X9=Ye("ellipsis",tVe);/** + */const BVe=[["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"}]],Q9=Xe("ellipsis",BVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nVe=[["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"}]],Jl=Ye("external-link",nVe);/** + */const $Ve=[["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"}]],Jl=Xe("external-link",$Ve);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rVe=[["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"}]],Y9=Ye("file-code",rVe);/** + */const HVe=[["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"}]],J9=Xe("file-code",HVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sVe=[["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"}]],iVe=Ye("file-output",sVe);/** + */const FVe=[["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"}]],PVe=Xe("file-output",FVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aVe=[["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"}]],wu=Ye("file-text",aVe);/** + */const UVe=[["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"}]],wu=Xe("file-text",UVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oVe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],lVe=Ye("file-up",oVe);/** + */const qVe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],GVe=Xe("file-up",qVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cVe=[["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"}]],Z9=Ye("flask-conical",cVe);/** + */const VVe=[["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"}]],eE=Xe("flask-conical",VVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uVe=[["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"}]],Q9=Ye("folder-git-2",uVe);/** + */const WVe=[["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"}]],tE=Xe("folder-git-2",WVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fVe=[["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"}]],fd=Ye("folder-open",fVe);/** + */const KVe=[["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"}]],fh=Xe("folder-open",KVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dVe=[["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"}]],hVe=Ye("folder-plus",dVe);/** + */const XVe=[["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"}]],YVe=Xe("folder-plus",XVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _Ve=[["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"}]],op=Ye("folder-tree",_Ve);/** + */const ZVe=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],lp=Xe("folder-tree",ZVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pVe=[["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"}]],mVe=Ye("funnel",pVe);/** + */const QVe=[["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"}]],JVe=Xe("funnel",QVe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gVe=[["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"}]],lp=Ye("git-branch",gVe);/** + */const eWe=[["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"}]],cp=Xe("git-branch",eWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bVe=[["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"}]],vVe=Ye("git-commit-horizontal",bVe);/** + */const tWe=[["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"}]],nWe=Xe("git-commit-horizontal",tWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xVe=[["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"}]],yVe=Ye("globe",xVe);/** + */const rWe=[["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"}]],sWe=Xe("globe",rWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wVe=[["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"}]],SVe=Ye("history",wVe);/** + */const iWe=[["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"}]],aWe=Xe("history",iWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kVe=[["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"}]],CVe=Ye("laptop",kVe);/** + */const oWe=[["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"}]],lWe=Xe("laptop",oWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EVe=[["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"}]],NVe=Ye("lightbulb",EVe);/** + */const cWe=[["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"}]],uWe=Xe("lightbulb",cWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zVe=[["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"}]],f7=Ye("lock",zVe);/** + */const fWe=[["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"}]],d7=Xe("lock",fWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AVe=[["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"}]],jVe=Ye("maximize-2",AVe);/** + */const hWe=[["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"}]],dWe=Xe("maximize-2",hWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TVe=[["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"}]],J9=Ye("message-square-quote",TVe);/** + */const _We=[["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"}]],nE=Xe("message-square-quote",_We);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MVe=[["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"}]],RVe=Ye("minimize-2",MVe);/** + */const pWe=[["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"}]],mWe=Xe("minimize-2",pWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DVe=[["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"}]],LVe=Ye("monitor",DVe);/** + */const gWe=[["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"}]],bWe=Xe("monitor",gWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OVe=[["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"}]],IVe=Ye("moon",OVe);/** + */const vWe=[["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"}]],xWe=Xe("moon",vWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BVe=[["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"}]],$Ve=Ye("mouse-pointer-click",BVe);/** + */const yWe=[["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"}]],wWe=Xe("mouse-pointer-click",yWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HVe=[["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"}]],F2=Ye("package",HVe);/** + */const SWe=[["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"}]],q2=Xe("package",SWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PVe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],eE=Ye("panel-left",PVe);/** + */const kWe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],rE=Xe("panel-left",kWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FVe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],tE=Ye("panel-right",FVe);/** + */const CWe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],sE=Xe("panel-right",CWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UVe=[["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"}]],qVe=Ye("paperclip",UVe);/** + */const EWe=[["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"}]],NWe=Xe("paperclip",EWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GVe=[["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"}]],U2=Ye("pencil",GVe);/** + */const zWe=[["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"}]],G2=Xe("pencil",zWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VVe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],q2=Ye("plus",VVe);/** + */const AWe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],V2=Xe("plus",AWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WVe=[["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"}]],Gd=Ye("refresh-cw",WVe);/** + */const jWe=[["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"}]],Gh=Xe("refresh-cw",jWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KVe=[["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"}]],nE=Ye("rotate-cw",KVe);/** + */const TWe=[["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"}]],iE=Xe("rotate-cw",TWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XVe=[["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"}]],G2=Ye("scroll-text",XVe);/** + */const MWe=[["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"}]],W2=Xe("scroll-text",MWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YVe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ZVe=Ye("search",YVe);/** + */const RWe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],DWe=Xe("search",RWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QVe=[["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"}]],d7=Ye("server",QVe);/** + */const LWe=[["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"}]],_7=Xe("server",LWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JVe=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],eWe=Ye("settings-2",JVe);/** + */const OWe=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],IWe=Xe("settings-2",OWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tWe=[["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"}]],nWe=Ye("settings",tWe);/** + */const BWe=[["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"}]],$We=Xe("settings",BWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rWe=[["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"}]],sWe=Ye("sliders-horizontal",rWe);/** + */const HWe=[["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"}]],FWe=Xe("sliders-horizontal",HWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iWe=[["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"}]],rE=Ye("square-terminal",iWe);/** + */const PWe=[["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"}]],aE=Xe("square-terminal",PWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aWe=[["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"}]],oWe=Ye("sun",aWe);/** + */const UWe=[["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"}]],qWe=Xe("sun",UWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lWe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Su=Ye("terminal",lWe);/** + */const GWe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Su=Xe("terminal",GWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cWe=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],uWe=Ye("toggle-right",cWe);/** + */const VWe=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],WWe=Xe("toggle-right",VWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fWe=[["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"}]],Bu=Ye("trash-2",fWe);/** + */const KWe=[["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"}]],Bu=Xe("trash-2",KWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dWe=[["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"}]],sE=Ye("triangle-alert",dWe);/** + */const XWe=[["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"}]],oE=Xe("triangle-alert",XWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hWe=[["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"}]],_We=Ye("upload",hWe);/** + */const YWe=[["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"}]],ZWe=Xe("upload",YWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pWe=[["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"}]],V2=Ye("users",pWe);/** + */const QWe=[["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"}]],K2=Xe("users",QWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mWe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=Ye("x",mWe);/** + */const JWe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yr=Xe("x",JWe);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gWe=[["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"}]],bWe=Ye("zap",gWe),je=e=>`⁦${e}⁩`,eo=e=>`⁨${e}⁩`,Ht=e=>new Intl.NumberFormat(E()).format(e),x1="demo_nanochat_v1",y1=e=>e.startsWith("demo_"),Jf="chat_demo_nanochat_v1",iE="chat_demo_nanochat_figures_v1",aE="chat_demo_nanochat_literature_v1",Kb="cpu-apple-silicon-pipeline-results.md";function wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function ki(e){if(!e.ok){const n=await e.text().catch(()=>"");let t=n;try{const r=JSON.parse(n);r.error&&(t=r.error)}catch{}throw new Error(t||`HTTP ${e.status}`)}return await e.json()}const gt=e=>fetch(e).then(n=>ki(n)),Et=(e,n)=>fetch(e,{method:"POST",headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(t=>ki(t)),cp=(e,n)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ki(t)),vWe=(e,n)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ki(t)),xWe=()=>gt("/api/projects").then(e=>e.projects),yWe=()=>gt("/api/projects/activity").then(e=>e.activity),wWe=()=>gt("/api/settings/ui-state"),h7=e=>Et("/api/settings/ui-state",e),SWe=(e,n)=>Et("/api/onboarding/complete",{...e,...n}),oE=(e="")=>{const n=e?`?path=${encodeURIComponent(e)}`:"";return gt(`/api/project-path/status${n}`)},kWe=()=>Et("/api/project-path/pick").then(e=>e.path),CWe=e=>Et("/api/projects",e),lE=e=>gt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(n=>n.papers),EWe=()=>gt("/api/github/account"),NWe=e=>gt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),zWe=(e,n)=>gt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`),Xb=e=>gt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(n=>n.paper),AWe=e=>Et(`/api/projects/${e}/open`).then(n=>n.project),jWe=e=>fetch(`/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})`)}}),TWe=e=>gt(`/api/projects/${e}/experiments`).then(n=>n.experiments),W2=e=>gt(`/api/projects/${e}/runs`).then(n=>n.runs),cE=e=>Et(`/api/runs/${e}/cancel`).then(()=>{}),MWe=(e,n)=>gt(`/api/runs/${e}/log?offset=${n}`),RWe=e=>gt(`/api/runs/${e}/diff`),DWe=e=>gt(`/api/experiments/${e}/diff`),oc=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),_7=(e,n,t={})=>gt(`/api/projects/${e}/file?${oc(t,new URLSearchParams({path:n}))}`),w1=(e,n,t={})=>`/api/projects/${e}/file/raw?${oc(t,new URLSearchParams({path:n}))}`,LWe=e=>gt(`/api/files/abs?path=${encodeURIComponent(e)}`),p7=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,OWe=(e,n,t,r={})=>vWe(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId}),IWe=(e,n,t={})=>Et(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),BWe=()=>gt("/api/latex/engine"),$We=(e,n,t={})=>Et(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),HWe=()=>gt("/api/overleaf/settings"),uE=e=>Et("/api/overleaf/token",{token:e}),PWe=()=>fetch("/api/overleaf/token",{method:"DELETE"}).then(e=>ki(e)),FWe=(e,n,t={})=>gt(`/api/projects/${e}/file/overleaf?${oc(t,new URLSearchParams({path:n}))}`),UWe=(e,n,t)=>Et(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),qWe=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf?${oc(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ki(r)),GWe=(e,n,t={})=>Et(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),VWe=(e,n,t={})=>gt(`/api/projects/${e}/file/overleaf/status?${oc(t,new URLSearchParams({path:n}))}`),WWe=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${oc(t,new URLSearchParams({path:n}))}`,Yb=(e,n={})=>{const t=oc(n).toString();return gt(`/api/projects/${e}/code-tree${t?`?${t}`:""}`)},fE=e=>gt(`/api/chat/sessions/${e}/worktree`),up=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,KWe=()=>gt("/api/settings/hf"),XWe=e=>Et("/api/settings/hf",{token:e}),YWe=()=>gt("/api/update"),ZWe=()=>Et("/api/update/apply"),QWe=e=>Et("/api/update/auto",{enabled:e}),JWe=(e=!1)=>Et("/api/update/install-cli",{force:e}),eKe=()=>gt("/api/settings/k8s"),tKe=e=>Et("/api/settings/k8s",e),nKe=()=>gt("/api/settings/modal"),rKe=()=>Et("/api/settings/modal/provision"),sKe=()=>gt("/api/settings/env").then(e=>e.vars),dE=(e,n)=>Et("/api/settings/env",{key:e,value:n}).then(t=>t.vars),iKe=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ki(n)).then(n=>n.vars),aKe=()=>gt("/api/settings/data-dir"),oKe=e=>Et("/api/settings/data-dir/validate",{path:e}),lKe=e=>Et("/api/settings/data-dir/move",{path:e}),cKe=()=>gt("/api/settings/ssh").then(e=>e.hosts),uKe=e=>Et("/api/settings/ssh/preflight",{host:e}),fKe=()=>gt("/api/settings/slurm"),dKe=e=>Et("/api/settings/slurm",e),hKe=e=>Et("/api/settings/slurm/preflight",{host:e}),_Ke=()=>gt("/api/settings/ray"),pKe=e=>Et("/api/settings/ray",e),mKe=e=>Et("/api/settings/ray/preflight",{address:e??null}),gKe=e=>gt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),bKe=e=>Et("/api/settings/compute/default",e),vKe=()=>gt("/api/settings/local"),xKe=()=>gt("/api/settings/openresearch"),m7=e=>gt(`/api/projects/${e}/files`),yKe=(e,n)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ki(t)),Vd=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,hE=512e3,wKe=(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}}},_E=(e,n)=>fetch(Vd(e,n),{headers:{Range:`bytes=0-${hE-1}`}}).then(t=>{var s;if(t.status===404)return null;if(t.status===416&&t.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=Number((s=t.headers.get("content-range"))==null?void 0:s.split("/").pop());return t.arrayBuffer().then(a=>wKe(a,Number.isFinite(r)&&r>a.byteLength))}),SKe=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",kKe=(e,n)=>fetch(Vd(e,n),{method:"HEAD"}).then(t=>{if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=t.headers.get("x-openresearch-presentation");return{size:Number(t.headers.get("content-length"))||0,presentation:SKe(r)?r:"download"}}),CKe=()=>gt("/api/settings/profile"),EKe=()=>gt("/api/settings/lit-sources"),NKe=e=>Et("/api/settings/lit-sources",e),K2=()=>gt("/api/settings/projects"),pE=(e,n)=>Et("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:n}),zKe=e=>gt(`/api/projects/${e}/git`),AKe=e=>Et(`/api/projects/${e}/git/init`),jKe=e=>Et(`/api/projects/${e}/github`),TKe=e=>Et(`/api/projects/${e}/github/disable`),MKe=()=>gt("/api/settings/telemetry"),RKe=e=>Et("/api/settings/telemetry",{enabled:e}),y0=e=>e.displayName??bE(e.id),w0="default";function fp(e,n){var o,l,c;const t=e==null?void 0:e.models.find(f=>f.id===n),r=(t==null?void 0:t.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,a=s&&r.some(f=>f.id===s)?s:r.some(f=>f.id===w0)?w0:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:a}}const Zb="default";function mE(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:Zb,label:uwe(),description:awe()},...t]:[]}function S0(e,n,t){var a;if(!e)return t??null;if(e.id!=="codex"||((a=e.models.find(o=>o.id===n))==null?void 0:a.serviceTiers)===void 0)return null;const s=mE(e,n);return s.length===0?Zb:t!=null&&s.some(o=>o.id===t)?t:Zb}function gE(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=fp(e,n);return r.length===0?w0:t&&r.some(a=>a.id===t)?t:s}const k0=(e=!1,n=!1)=>{const t=new URLSearchParams;e&&t.set("refresh","1"),n&&t.set("retry","1");const r=t.size>0?`?${t.toString()}`:"";return gt(`/api/harnesses${r}`).then(s=>s.harnesses)},DKe=e=>gt(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.skills),LKe=(e,n)=>gt(`/api/skills/${encodeURIComponent(e)}${n?`?project=${encodeURIComponent(n)}`:""}`).then(t=>t.content),OKe=e=>gt(`/api/latex-templates${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.templates),IKe=e=>Et("/api/latex-templates",e).then(n=>n.template),BKe=e=>{const n=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&n.set("project",e.projectId),fetch(`/api/latex-templates?${n.toString()}`,{method:"DELETE"}).then(t=>ki(t))},$Ke=e=>gt(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.skills),HKe=e=>Et("/api/user-skills",e).then(n=>n.skill),PKe=e=>{const n=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&n.set("project",e.projectId),fetch(`/api/user-skills?${n.toString()}`,{method:"DELETE"}).then(t=>ki(t))},FKe=()=>gt("/api/harness-skills").then(e=>e.skills),UKe=e=>Et("/api/user-skills/import",e).then(n=>n.skill);function bE(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 J_=e=>gt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(n=>n.sessions),qKe=(e,n,t={})=>Et("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),GKe=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ki(n)),VKe=(e,n)=>cp(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),WKe=(e,n)=>cp(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),KKe=(e,n)=>cp(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),XKe=(e,n)=>cp(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),au=e=>gt(`/api/chat/sessions/${e}/messages`).then(n=>({messages:n.messages,queued:n.queued??[],activeLeafId:n.activeLeafId??null})),YKe=(e,n)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ki(t)),ZKe=(e,n)=>Et(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),QKe=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,g7=(e,n,t={},r,s,a,o)=>Et(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:a,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:o}),JKe=(e,n,t,r={})=>Et(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),eXe=(e,n,t)=>Et(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),tXe=(e,n)=>Et(`/api/chat/sessions/${e}/branch`,{leafId:n}),nXe=e=>Et(`/api/chat/sessions/${e}/interrupt`),rXe=(e,n)=>Et(`/api/chat/sessions/${e}/respond`,n);function qi(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 C0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return tae({value:Ht(n)});const t=Math.floor(n/60);if(t<60)return Zie({value:Ht(t)});const r=Math.floor(t/60);return r<24?Wie({hours:Ht(r),minutes:Ht(t%60)}):Uie({days:Ht(Math.floor(r/24)),hours:Ht(r%24)})}function Bi(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&r[a.id,a]));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 aXe(e,n,t){var o;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,a=(o=t.get(s))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function oXe(e,n,t,r){const s=e.filter(f=>!r(f.id)),a=new Map(s.map(f=>[f.id,f])),o=new Map;for(const f of s){const _=f.parentId??null,h=o.get(_);h?h.push(f):o.set(_,[f])}const l=new Set(n.map(f=>f.id)),c=new Map;for(const f of t){const _=aXe(f,a,o),h=_.findIndex(m=>l.has(m.id));c.set(f.id,{count:_.length,index:h,prevId:h>0?_[h-1].id:void 0,nextId:h<_.length-1?_[h+1].id:void 0})}return c}const e0=new Map;function lXe(e,n){let t=e0.get(e);return t||(t=new Set,e0.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&e0.delete(e)}}function cXe(e){var n;(n=e0.get(e.runId))==null||n.forEach(t=>t(e))}const Qb=new Set;function dd(e){return Qb.add(e),()=>{Qb.delete(e)}}function qo(e){Qb.forEach(n=>n(e))}const Jb=new Set;function uXe(e){return Jb.add(e),()=>{Jb.delete(e)}}function Go(){Jb.forEach(e=>e())}const ev=new Set;function Z2(e){return ev.add(e),()=>{ev.delete(e)}}function b7(e){ev.forEach(n=>n(e))}const tv=new Set;function fXe(e){return tv.add(e),()=>{tv.delete(e)}}function k1(e){tv.forEach(n=>n(e))}const nv=new Set;function dXe(e){return nv.add(e),()=>{nv.delete(e)}}function hXe(e){nv.forEach(n=>n(e))}function _Xe(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t=new EventSource("/api/events");let r=!1;t.onerror=()=>{r=!0},t.onopen=()=>{var a,o;r&&(qo({type:"reconnected"}),Go(),b7({harness:"*",authState:"unknown"}),(o=(a=n.current).onReconnect)==null||o.call(a)),r=!0};const s=a=>{try{return JSON.parse(a.data)}catch{return null}};return t.addEventListener("run.updated",a=>{const o=s(a);o!=null&&o.run&&(Go(),n.current.onRun(o.run))}),t.addEventListener("experiment.updated",a=>{const o=s(a);o!=null&&o.experiment&&(Go(),n.current.onExperiment(o.experiment))}),t.addEventListener("project.updated",a=>{const o=s(a);o!=null&&o.project&&(Go(),n.current.onProject(o.project))}),t.addEventListener("files.updated",a=>{var l,c;const o=s(a);o!=null&&o.projectId&&((c=(l=n.current).onArtifacts)==null||c.call(l,o.projectId))}),t.addEventListener("run.log",a=>{const o=s(a);o!=null&&o.runId&&cXe(o)}),t.addEventListener("chat.session",a=>{const o=s(a);o!=null&&o.session&&(Go(),qo({type:"session",session:o.session}))}),t.addEventListener("chat.session.deleted",a=>{const o=s(a);o!=null&&o.sessionId&&(Go(),qo({type:"sessionDeleted",sessionId:o.sessionId}))}),t.addEventListener("chat.message",a=>{const o=s(a);o!=null&&o.message&&(Go(),qo({type:"message",sessionId:o.sessionId,message:o.message}))}),t.addEventListener("chat.busy",a=>{const o=s(a);o!=null&&o.sessionId&&(Go(),qo({type:"busy",sessionId:o.sessionId,busy:o.busy}))}),t.addEventListener("chat.usage",a=>{const o=s(a);o!=null&&o.sessionId&&o.usage&&qo({type:"usage",sessionId:o.sessionId,usage:o.usage})}),t.addEventListener("chat.queued",a=>{const o=s(a);o!=null&&o.sessionId&&qo({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),t.addEventListener("chat.branch",a=>{const o=s(a);o!=null&&o.sessionId&&qo({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),t.addEventListener("harness.auth",a=>{const o=s(a);o!=null&&o.harness&&o.authState&&b7(o)}),t.addEventListener("datadir.move.progress",a=>{const o=s(a);o&&k1({type:"progress",...o})}),t.addEventListener("datadir.move.done",a=>{const o=s(a);o&&k1({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),t.addEventListener("datadir.move.error",a=>{const o=s(a);o&&k1({type:"error",error:o.error})}),t.addEventListener("update.status",a=>{const o=s(a);o&&hXe(o)}),()=>t.close()},[])}const ua=e=>new Intl.NumberFormat(E()).format(e);function pXe(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?P3e():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?R3e({attempt:ua(e.attempt),maximum:ua(e.maximum),seconds:ua(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?A3e({attempt:ua(e.attempt),maximum:ua(e.maximum)}):typeof e.attempt=="number"&&t!=null?I3e({attempt:ua(e.attempt),seconds:ua(t)}):typeof e.attempt=="number"?C3e({attempt:ua(e.attempt)}):t!=null?G3e({seconds:ua(t)}):C9()}function mXe(e,n){if(typeof e!="number")return X3e();const t=Math.max(0,Math.ceil((e-n)/1e3));return J3e({seconds:ua(t)})}function vE(e){return e==="retry"||e==="continue"?e:null}function gXe(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}function bXe(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function v7(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function vXe(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";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":"alphaxiv"}function Q2(e){const n=[];let t="",r=!1,s=null;const a=()=>{r&&n.push(t),t="",r=!1};for(let o=0;o`⁦${e}⁩`,eo=e=>`⁨${e}⁩`,$t=e=>new Intl.NumberFormat(E()).format(e),S1="demo_nanochat_v1",k1=e=>e.startsWith("demo_"),Jf="chat_demo_nanochat_v1",lE="chat_demo_nanochat_figures_v1",cE="chat_demo_nanochat_literature_v1",Yb="cpu-apple-silicon-pipeline-results.md";function Si(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Ci(e){if(!e.ok){const n=await e.text().catch(()=>"");let t=n;try{const r=JSON.parse(n);r.error&&(t=r.error)}catch{}throw new Error(t||`HTTP ${e.status}`)}return await e.json()}const vt=e=>fetch(e).then(n=>Ci(n)),Ct=(e,n)=>fetch(e,{method:"POST",headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(t=>Ci(t)),up=(e,n)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>Ci(t)),nKe=(e,n)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>Ci(t)),rKe=()=>vt("/api/projects").then(e=>e.projects),sKe=()=>vt("/api/projects/activity").then(e=>e.activity),iKe=()=>vt("/api/settings/ui-state"),p7=e=>Ct("/api/settings/ui-state",e),aKe=(e,n)=>Ct("/api/onboarding/complete",{...e,...n}),uE=(e="")=>{const n=e?`?path=${encodeURIComponent(e)}`:"";return vt(`/api/project-path/status${n}`)},oKe=()=>Ct("/api/project-path/pick").then(e=>e.path),lKe=e=>Ct("/api/projects",e),fE=e=>vt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(n=>n.papers),cKe=()=>vt("/api/github/account"),uKe=e=>vt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),fKe=(e,n)=>vt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`),Zb=e=>vt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(n=>n.paper),hKe=e=>Ct(`/api/projects/${e}/open`).then(n=>n.project),dKe=e=>fetch(`/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})`)}}),_Ke=e=>vt(`/api/projects/${e}/experiments`).then(n=>n.experiments),X2=e=>vt(`/api/projects/${e}/runs`).then(n=>n.runs),hE=e=>Ct(`/api/runs/${e}/cancel`).then(()=>{}),pKe=(e,n)=>vt(`/api/runs/${e}/log?offset=${n}`),mKe=e=>vt(`/api/runs/${e}/diff`),gKe=e=>vt(`/api/experiments/${e}/diff`),oc=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),m7=(e,n,t={})=>vt(`/api/projects/${e}/file?${oc(t,new URLSearchParams({path:n}))}`),C1=(e,n,t={})=>`/api/projects/${e}/file/raw?${oc(t,new URLSearchParams({path:n}))}`,bKe=e=>vt(`/api/files/abs?path=${encodeURIComponent(e)}`),g7=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,vKe=(e,n,t,r={})=>nKe(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId}),xKe=(e,n,t={})=>Ct(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),yKe=()=>vt("/api/latex/engine"),wKe=(e,n,t={})=>Ct(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),SKe=()=>vt("/api/overleaf/settings"),dE=e=>Ct("/api/overleaf/token",{token:e}),kKe=()=>fetch("/api/overleaf/token",{method:"DELETE"}).then(e=>Ci(e)),CKe=(e,n,t={})=>vt(`/api/projects/${e}/file/overleaf?${oc(t,new URLSearchParams({path:n}))}`),EKe=(e,n,t)=>Ct(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),NKe=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf?${oc(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>Ci(r)),zKe=(e,n,t={})=>Ct(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),AKe=(e,n,t={})=>vt(`/api/projects/${e}/file/overleaf/status?${oc(t,new URLSearchParams({path:n}))}`),jKe=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${oc(t,new URLSearchParams({path:n}))}`,Qb=(e,n={})=>{const t=oc(n).toString();return vt(`/api/projects/${e}/code-tree${t?`?${t}`:""}`)},_E=e=>vt(`/api/chat/sessions/${e}/worktree`),fp=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,TKe=()=>vt("/api/settings/hf"),MKe=e=>Ct("/api/settings/hf",{token:e}),RKe=()=>vt("/api/update"),DKe=()=>Ct("/api/update/apply"),LKe=e=>Ct("/api/update/auto",{enabled:e}),OKe=(e=!1)=>Ct("/api/update/install-cli",{force:e}),IKe=()=>vt("/api/settings/k8s"),BKe=e=>Ct("/api/settings/k8s",e),$Ke=()=>vt("/api/settings/modal"),HKe=()=>Ct("/api/settings/modal/provision"),FKe=()=>vt("/api/settings/env").then(e=>e.vars),pE=(e,n)=>Ct("/api/settings/env",{key:e,value:n}).then(t=>t.vars),PKe=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>Ci(n)).then(n=>n.vars),UKe=()=>vt("/api/settings/data-dir"),qKe=e=>Ct("/api/settings/data-dir/validate",{path:e}),GKe=e=>Ct("/api/settings/data-dir/move",{path:e}),VKe=()=>vt("/api/settings/ssh").then(e=>e.hosts),WKe=e=>Ct("/api/settings/ssh/preflight",{host:e}),KKe=()=>vt("/api/settings/slurm"),XKe=e=>Ct("/api/settings/slurm",e),YKe=e=>Ct("/api/settings/slurm/preflight",{host:e}),ZKe=()=>vt("/api/settings/ray"),QKe=e=>Ct("/api/settings/ray",e),JKe=e=>Ct("/api/settings/ray/preflight",{address:e??null}),eXe=e=>vt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),tXe=e=>Ct("/api/settings/compute/default",e),nXe=()=>vt("/api/settings/local"),rXe=()=>vt("/api/settings/openresearch"),b7=e=>vt(`/api/projects/${e}/files`),sXe=(e,n)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>Ci(t)),Vh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,mE=512e3,iXe=(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}}},gE=(e,n)=>fetch(Vh(e,n),{headers:{Range:`bytes=0-${mE-1}`}}).then(t=>{var s;if(t.status===404)return null;if(t.status===416&&t.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=Number((s=t.headers.get("content-range"))==null?void 0:s.split("/").pop());return t.arrayBuffer().then(a=>iXe(a,Number.isFinite(r)&&r>a.byteLength))}),aXe=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",oXe=(e,n)=>fetch(Vh(e,n),{method:"HEAD"}).then(t=>{if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=t.headers.get("x-openresearch-presentation");return{size:Number(t.headers.get("content-length"))||0,presentation:aXe(r)?r:"download"}}),lXe=()=>vt("/api/settings/profile"),cXe=()=>vt("/api/settings/lit-sources"),uXe=e=>Ct("/api/settings/lit-sources",e),Y2=()=>vt("/api/settings/projects"),bE=(e,n)=>Ct("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:n}),fXe=e=>vt(`/api/projects/${e}/git`),hXe=e=>Ct(`/api/projects/${e}/git/init`),dXe=e=>Ct(`/api/projects/${e}/github`),_Xe=e=>Ct(`/api/projects/${e}/github/disable`),pXe=()=>vt("/api/settings/telemetry"),mXe=e=>Ct("/api/settings/telemetry",{enabled:e}),w0=e=>e.displayName??yE(e.id),S0="default";function hp(e,n){var o,l,c;const t=e==null?void 0:e.models.find(f=>f.id===n),r=(t==null?void 0:t.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,a=s&&r.some(f=>f.id===s)?s:r.some(f=>f.id===S0)?S0:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:a}}const Jb="default";function vE(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:Jb,label:Wwe(),description:Uwe()},...t]:[]}function k0(e,n,t){var a;if(!e)return t??null;if(e.id!=="codex"||((a=e.models.find(o=>o.id===n))==null?void 0:a.serviceTiers)===void 0)return null;const s=vE(e,n);return s.length===0?Jb:t!=null&&s.some(o=>o.id===t)?t:Jb}function xE(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=hp(e,n);return r.length===0?S0:t&&r.some(a=>a.id===t)?t:s}const C0=(e=!1,n=!1)=>{const t=new URLSearchParams;e&&t.set("refresh","1"),n&&t.set("retry","1");const r=t.size>0?`?${t.toString()}`:"";return vt(`/api/harnesses${r}`).then(s=>s.harnesses)},gXe=e=>vt(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.skills),bXe=(e,n)=>vt(`/api/skills/${encodeURIComponent(e)}${n?`?project=${encodeURIComponent(n)}`:""}`).then(t=>t.content),vXe=e=>vt(`/api/latex-templates${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.templates),xXe=e=>Ct("/api/latex-templates",e).then(n=>n.template),yXe=e=>{const n=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&n.set("project",e.projectId),fetch(`/api/latex-templates?${n.toString()}`,{method:"DELETE"}).then(t=>Ci(t))},wXe=e=>vt(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(n=>n.skills),SXe=e=>Ct("/api/user-skills",e).then(n=>n.skill),kXe=e=>{const n=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&n.set("project",e.projectId),fetch(`/api/user-skills?${n.toString()}`,{method:"DELETE"}).then(t=>Ci(t))},CXe=()=>vt("/api/harness-skills").then(e=>e.skills),EXe=e=>Ct("/api/user-skills/import",e).then(n=>n.skill);function yE(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 e0=e=>vt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(n=>n.sessions),NXe=(e,n,t={})=>Ct("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),zXe=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>Ci(n)),AXe=(e,n)=>up(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),jXe=(e,n)=>up(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),TXe=(e,n)=>up(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),MXe=(e,n)=>up(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),au=e=>vt(`/api/chat/sessions/${e}/messages`).then(n=>({messages:n.messages,queued:n.queued??[],activeLeafId:n.activeLeafId??null})),RXe=(e,n)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>Ci(t)),DXe=(e,n)=>Ct(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),LXe=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,v7=(e,n,t={},r,s,a,o)=>Ct(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:a,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:o}),OXe=(e,n,t,r={})=>Ct(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),IXe=(e,n,t)=>Ct(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),BXe=(e,n)=>Ct(`/api/chat/sessions/${e}/branch`,{leafId:n}),$Xe=e=>Ct(`/api/chat/sessions/${e}/interrupt`),HXe=(e,n)=>Ct(`/api/chat/sessions/${e}/respond`,n);function Gi(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 E0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return sae({value:$t(n)});const t=Math.floor(n/60);if(t<60)return eae({value:$t(t)});const r=Math.floor(t/60);return r<24?Yie({hours:$t(r),minutes:$t(t%60)}):Vie({days:$t(Math.floor(r/24)),hours:$t(r%24)})}function $i(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&r[a.id,a]));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 UXe(e,n,t){var o;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,a=(o=t.get(s))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function qXe(e,n,t,r){const s=e.filter(f=>!r(f.id)),a=new Map(s.map(f=>[f.id,f])),o=new Map;for(const f of s){const _=f.parentId??null,d=o.get(_);d?d.push(f):o.set(_,[f])}const l=new Set(n.map(f=>f.id)),c=new Map;for(const f of t){const _=UXe(f,a,o),d=_.findIndex(m=>l.has(m.id));c.set(f.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return c}const t0=new Map;function GXe(e,n){let t=t0.get(e);return t||(t=new Set,t0.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&t0.delete(e)}}function VXe(e){var n;(n=t0.get(e.runId))==null||n.forEach(t=>t(e))}const ev=new Set;function hh(e){return ev.add(e),()=>{ev.delete(e)}}function qo(e){ev.forEach(n=>n(e))}const tv=new Set;function WXe(e){return tv.add(e),()=>{tv.delete(e)}}function Go(){tv.forEach(e=>e())}const nv=new Set;function J2(e){return nv.add(e),()=>{nv.delete(e)}}function x7(e){nv.forEach(n=>n(e))}const rv=new Set;function KXe(e){return rv.add(e),()=>{rv.delete(e)}}function N1(e){rv.forEach(n=>n(e))}const sv=new Set;function XXe(e){return sv.add(e),()=>{sv.delete(e)}}function YXe(e){sv.forEach(n=>n(e))}function ZXe(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t=new EventSource("/api/events");let r=!1;t.onerror=()=>{r=!0},t.onopen=()=>{var a,o;r&&(qo({type:"reconnected"}),Go(),x7({harness:"*",authState:"unknown"}),(o=(a=n.current).onReconnect)==null||o.call(a)),r=!0};const s=a=>{try{return JSON.parse(a.data)}catch{return null}};return t.addEventListener("run.updated",a=>{const o=s(a);o!=null&&o.run&&(Go(),n.current.onRun(o.run))}),t.addEventListener("experiment.updated",a=>{const o=s(a);o!=null&&o.experiment&&(Go(),n.current.onExperiment(o.experiment))}),t.addEventListener("project.updated",a=>{const o=s(a);o!=null&&o.project&&(Go(),n.current.onProject(o.project))}),t.addEventListener("files.updated",a=>{var l,c;const o=s(a);o!=null&&o.projectId&&((c=(l=n.current).onArtifacts)==null||c.call(l,o.projectId))}),t.addEventListener("run.log",a=>{const o=s(a);o!=null&&o.runId&&VXe(o)}),t.addEventListener("chat.session",a=>{const o=s(a);o!=null&&o.session&&(Go(),qo({type:"session",session:o.session}))}),t.addEventListener("chat.session.deleted",a=>{const o=s(a);o!=null&&o.sessionId&&(Go(),qo({type:"sessionDeleted",sessionId:o.sessionId}))}),t.addEventListener("chat.message",a=>{const o=s(a);o!=null&&o.message&&(Go(),qo({type:"message",sessionId:o.sessionId,message:o.message}))}),t.addEventListener("chat.busy",a=>{const o=s(a);o!=null&&o.sessionId&&(Go(),qo({type:"busy",sessionId:o.sessionId,busy:o.busy}))}),t.addEventListener("chat.usage",a=>{const o=s(a);o!=null&&o.sessionId&&o.usage&&qo({type:"usage",sessionId:o.sessionId,usage:o.usage})}),t.addEventListener("chat.queued",a=>{const o=s(a);o!=null&&o.sessionId&&qo({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),t.addEventListener("chat.branch",a=>{const o=s(a);o!=null&&o.sessionId&&qo({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),t.addEventListener("harness.auth",a=>{const o=s(a);o!=null&&o.harness&&o.authState&&x7(o)}),t.addEventListener("datadir.move.progress",a=>{const o=s(a);o&&N1({type:"progress",...o})}),t.addEventListener("datadir.move.done",a=>{const o=s(a);o&&N1({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),t.addEventListener("datadir.move.error",a=>{const o=s(a);o&&N1({type:"error",error:o.error})}),t.addEventListener("update.status",a=>{const o=s(a);o&&YXe(o)}),()=>t.close()},[])}const ua=e=>new Intl.NumberFormat(E()).format(e);function QXe(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?kwe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?mwe({attempt:ua(e.attempt),maximum:ua(e.maximum),seconds:ua(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?hwe({attempt:ua(e.attempt),maximum:ua(e.maximum)}):typeof e.attempt=="number"&&t!=null?xwe({attempt:ua(e.attempt),seconds:ua(t)}):typeof e.attempt=="number"?lwe({attempt:ua(e.attempt)}):t!=null?zwe({seconds:ua(t)}):z9()}function JXe(e,n){if(typeof e!="number")return Mwe();const t=Math.max(0,Math.ceil((e-n)/1e3));return Owe({seconds:ua(t)})}function wE(e){return e==="retry"||e==="continue"?e:null}function eYe(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}function tYe(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function y7(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function nYe(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";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":"alphaxiv"}function ex(e){const n=[];let t="",r=!1,s=null;const a=()=>{r&&n.push(t),t="",r=!1};for(let o=0;o"||l==="&")break;/\s/.test(l)?a():(t+=l,r=!0)}return a(),n}function xXe(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=Q2(e);if(t.length===1)return t[0]}return e}function yXe(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 ku(e){return yXe(typeof e=="string"?Q2(e):e)}function wXe(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 SXe(e,n){const t=ku(e);return t===null?!1:n.split("\\s+").every((s,a)=>t[a]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[a]))}function kXe(e){var c;const n=ku(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],a=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let f=1;f +`&&(t+=c,r=!0);continue}if(s){l===s?s=null:t+=l,r=!0;continue}if(l==='"'||l==="'"){s=l,r=!0;continue}if(l==="|"||l===";"||l===">"||l==="&")break;/\s/.test(l)?a():(t+=l,r=!0)}return a(),n}function rYe(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=ex(e);if(t.length===1)return t[0]}return e}function sYe(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 ku(e){return sYe(typeof e=="string"?ex(e):e)}function iYe(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 aYe(e,n){const t=ku(e);return t===null?!1:n.split("\\s+").every((s,a)=>t[a]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[a]))}function oYe(e){var c;const n=ku(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],a=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let f=1;f -`,EXe='',NXe=` +`,cYe='',uYe=` -`,xE={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},zXe={alphaxiv:CXe,openalex:NXe,biorxiv:EXe};function yE({source:e,size:n=16,decorative:t=!1,className:r=""}){return d.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-[0_0_0_1px_rgba(0,_0,_0,_0.08)] [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":xE[e]},dangerouslySetInnerHTML:{__html:zXe[e]}})}function AXe(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 jXe(e,n){const t=n.trim();if(e==="alphaxiv"){const a=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(a)}`}const r=AXe(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 rv="shadow-[0_6px_24px_color-mix(in_oklab,_var(--text)_5%,_transparent),_0_1px_4px_color-mix(in_oklab,_var(--text)_4%,_transparent)]",Wd=["icon-btn relative inline-flex items-center justify-center","text-subtext [&:hover]:text-text [&:hover]:bg-surface","[.chat-header.rail-hidden_>_&:first-child]:me-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),mn=[Wd,"w-7 h-7"].join(" "),Kd=["inline-flex h-8 items-center rounded-md","transition-[background,color] duration-150 ease-standard hover:bg-surface"].join(" "),sv=[Kd,"w-8 shrink-0 justify-center text-text"].join(" "),Vr=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-start py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),pr=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),Lt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),Wr="mono font-mono text-sm",Xa="tab-body flex-1 min-h-0 relative flex flex-col",fu="code-tab-body flex-1 min-h-0 overflow-auto bg-background",Oi=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),hd=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),qn=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),Ks=`${qn} sm`,Xr=`${qn} primary`,Ul=`${qn} ghost`,_r=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Cs=`${_r} err`,so=`${_r} ok`,TXe=`${_r} warn`,J2=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),dp=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:start-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),MXe=["alphaxiv","openalex","biorxiv"];let x7=null;function RXe(){const[e,n]=R.useState(x7),[t,r]=R.useState(!1),s=o=>{x7=o,n(o)};R.useEffect(()=>{EKe().then(s).catch(()=>{})},[]);const a=o=>{!e||t||(r(!0),NKe({...e,[o]:!e[o]}).then(s).catch(()=>{}).finally(()=>r(!1)))};return e?d.jsx("div",{className:"flex flex-col",children:MXe.map(o=>{const l=e[o];return d.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:Vr,disabled:t,onClick:()=>a(o),children:[d.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[d.jsx(yE,{source:o,size:16,decorative:!0}),xE[o]]}),d.jsx("span",{className:`${dp} ${l?"on":""}`,"aria-hidden":"true",children:d.jsx("span",{})})]},o)})}):d.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:khe()})}function C1(e,n){if(!e)throw new Error("Assertion Error")}function Dl(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function DXe(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 LXe(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` -`}]}function OXe(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 a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(a.data={meta:n.meta}),e.patch(n,a),a=e.applyData(n,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(n,a),a}function IXe(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function BXe(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const is=ul(/[A-Za-z]/),Kr=ul(/[\dA-Za-z]/),$Xe=ul(/[#-'*+\--9=?A-Z^-~]/);function E0(e){return e!==null&&(e<32||e===127)}const iv=ul(/\d/),HXe=ul(/[\dA-Fa-f]/),PXe=ul(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function yn(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const hp=ul(new RegExp("\\p{P}|\\p{S}","u")),ec=ul(/\s/);function ul(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function $u(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&a<57344){const l=e.charCodeAt(t+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+s+1,o=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function FXe(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=$u(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,f),e.applyData(n,f)}function UXe(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 qXe(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function wE(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),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function GXe(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return wE(e,n);const s={src:$u(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,a),e.applyData(n,a)}function VXe(e,n){const t={src:$u(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 WXe(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 KXe(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return wE(e,n);const s={href:$u(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function XXe(e,n){const t={href:$u(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 YXe(e,n,t){const r=e.all(n),s=t?ZXe(t):SE(n),a={},o=[];if(typeof n.checked=="boolean"){const _=r[0];let h;_&&_.type==="element"&&_.tagName==="p"?h=_:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l_&:first-child]:me-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),vn=[Wh,"w-7 h-7"].join(" "),Kh=["inline-flex h-8 items-center rounded-md","transition-[background,color] duration-150 ease-standard hover:bg-surface"].join(" "),av=[Kh,"w-8 shrink-0 justify-center text-text"].join(" "),Zr=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-start py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),br=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),Dt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),Qr="mono font-mono text-sm",Xa="tab-body flex-1 min-h-0 relative flex flex-col",fu="code-tab-body flex-1 min-h-0 overflow-auto bg-background",Ii=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),dh=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),Wn=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),Zs=`${Wn} sm`,es=`${Wn} primary`,Ul=`${Wn} ghost`,gr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),As=`${gr} err`,so=`${gr} ok`,_Ye=`${gr} warn`,tx=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),dp=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:start-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),pYe=["alphaxiv","openalex","biorxiv"];let w7=null;function mYe(){const[e,n]=R.useState(w7),[t,r]=R.useState(!1),s=o=>{w7=o,n(o)};R.useEffect(()=>{cXe().then(s).catch(()=>{})},[]);const a=o=>{!e||t||(r(!0),uXe({...e,[o]:!e[o]}).then(s).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:pYe.map(o=>{const l=e[o];return h.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:Zr,disabled:t,onClick:()=>a(o),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(kE,{source:o,size:16,decorative:!0}),SE[o]]}),h.jsx("span",{className:`${dp} ${l?"on":""}`,"aria-hidden":"true",children:h.jsx("span",{})})]},o)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:Nde()})}function z1(e,n){if(!e)throw new Error("Assertion Error")}function Dl(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function gYe(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 bYe(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`}]}function vYe(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 a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(a.data={meta:n.meta}),e.patch(n,a),a=e.applyData(n,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(n,a),a}function xYe(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function yYe(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const fs=ul(/[A-Za-z]/),Jr=ul(/[\dA-Za-z]/),wYe=ul(/[#-'*+\--9=?A-Z^-~]/);function N0(e){return e!==null&&(e<32||e===127)}const ov=ul(/\d/),SYe=ul(/[\dA-Fa-f]/),kYe=ul(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Ht(e){return e===-2||e===-1||e===32}const _p=ul(new RegExp("\\p{P}|\\p{S}","u")),ec=ul(/\s/);function ul(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function $u(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&a<57344){const l=e.charCodeAt(t+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+s+1,o=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function CYe(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=$u(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,f),e.applyData(n,f)}function EYe(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 NYe(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function CE(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),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function zYe(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return CE(e,n);const s={src:$u(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,a),e.applyData(n,a)}function AYe(e,n){const t={src:$u(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 jYe(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 TYe(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return CE(e,n);const s={href:$u(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function MYe(e,n){const t={href:$u(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 RYe(e,n,t){const r=e.all(n),s=t?DYe(t):EE(n),a={},o=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function QXe(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 nYe(e){const n=ex(e),t=kE(e);if(n&&t)return{start:n,end:t}}function rYe(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),s.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},l=ex(n.children[1]),c=kE(n.children[n.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,a),e.applyData(n,a)}function sYe(e,n,t){const r=t?t.children:void 0,a=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,l=o?o.length:n.children.length;let c=-1;const f=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return a.push(S7(n.slice(s),s>0,!1)),a.join("")}function S7(e,n,t){let r=0,s=e.length;if(n){let a=e.codePointAt(r);for(;a===y7||a===w7;)r++,a=e.codePointAt(r)}if(t){let a=e.codePointAt(s-1);for(;a===y7||a===w7;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function oYe(e,n){const t={type:"text",value:aYe(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function lYe(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const cYe={blockquote:DXe,break:LXe,code:OXe,delete:IXe,emphasis:BXe,footnoteReference:FXe,heading:UXe,html:qXe,imageReference:GXe,image:VXe,inlineCode:WXe,linkReference:KXe,link:XXe,listItem:YXe,list:QXe,paragraph:JXe,root:eYe,strong:tYe,table:rYe,tableCell:iYe,tableRow:sYe,text:oYe,thematicBreak:lYe,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const EE=-1,_p=0,ed=1,N0=2,tx=3,nx=4,rx=5,sx=6,NE=7,zE=8,uYe=typeof self=="object"?self:globalThis,k7=(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 uYe[e](n)},fYe=(e,n)=>{const t=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=n[s];switch(a){case _p:case EE:return t(o,s);case ed:{const l=t([],s);for(const c of o)l.push(r(c));return l}case N0:{const l=t({},s);for(const[c,f]of o)l[r(c)]=r(f);return l}case tx:return t(new Date(o),s);case nx:{const{source:l,flags:c}=o;return t(new RegExp(l,c),s)}case rx:{const l=t(new Map,s);for(const[c,f]of o)l.set(r(c),r(f));return l}case sx:{const l=t(new Set,s);for(const c of o)l.add(r(c));return l}case NE:{const{name:l,message:c}=o;return t(k7(l,c),s)}case zE:return t(BigInt(o),s);case"BigInt":return t(Object(BigInt(o)),s);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return t(new DataView(l),o)}}return t(k7(a,o),s)};return r},C7=e=>fYe(new Map,e)(0),Bl="",{toString:dYe}={},{keys:hYe}=Object,Of=e=>{const n=typeof e;if(n!=="object"||!e)return[_p,n];const t=dYe.call(e).slice(8,-1);switch(t){case"Array":return[ed,Bl];case"Object":return[N0,Bl];case"Date":return[tx,Bl];case"RegExp":return[nx,Bl];case"Map":return[rx,Bl];case"Set":return[sx,Bl];case"DataView":return[ed,t]}return t.includes("Array")?[ed,t]:t.includes("Error")?[NE,t]:[N0,t]},w_=([e,n])=>e===_p&&(n==="function"||n==="symbol"),_Ye=(e,n,t,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return t.set(l,c),c},a=o=>{if(t.has(o))return t.get(o);let[l,c]=Of(o);switch(l){case _p:{let _=o;switch(c){case"bigint":l=zE,_=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);_=null;break;case"undefined":return s([EE],o)}return s([l,_],o)}case ed:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),s([c,[...m]],o)}const _=[],h=s([l,_],o);for(const m of o)_.push(a(m));return h}case N0:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(n&&"toJSON"in o)return a(o.toJSON());const _=[],h=s([l,_],o);for(const m of hYe(o))(e||!w_(Of(o[m])))&&_.push([a(m),a(o[m])]);return h}case tx:return s([l,isNaN(o.getTime())?Bl:o.toISOString()],o);case nx:{const{source:_,flags:h}=o;return s([l,{source:_,flags:h}],o)}case rx:{const _=[],h=s([l,_],o);for(const[m,g]of o)(e||!(w_(Of(m))||w_(Of(g))))&&_.push([a(m),a(g)]);return h}case sx:{const _=[],h=s([l,_],o);for(const m of o)(e||!w_(Of(m)))&&_.push(a(m));return h}}const{message:f}=o;return s([l,{name:c,message:f}],o)};return a},E7=(e,{json:n,lossy:t}={})=>{const r=[];return _Ye(!(n||t),!!n,new Map,r)(e),r},z0=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?C7(E7(e,n)):structuredClone(e):(e,n)=>C7(E7(e,n));function pYe(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 mYe(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function gYe(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||pYe,r=e.options.footnoteBackLabel||mYe,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&S.push({type:"text",value:" "});let w=typeof t=="string"?t:t(c,g);typeof w=="string"&&(w={type:"text",value:w}),S.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,g),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.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(...S)}else _.push(...S);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+m},children:e.wrap(_,!0)};e.patch(f,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...z0(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(n,f),e.applyData(n,f)}function DYe(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function LYe(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 $Ye(e){const n=nx(e),t=NE(e);if(n&&t)return{start:n,end:t}}function HYe(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),s.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},l=nx(n.children[1]),c=NE(n.children[n.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,a),e.applyData(n,a)}function FYe(e,n,t){const r=t?t.children:void 0,a=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,l=o?o.length:n.children.length;let c=-1;const f=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return a.push(C7(n.slice(s),s>0,!1)),a.join("")}function C7(e,n,t){let r=0,s=e.length;if(n){let a=e.codePointAt(r);for(;a===S7||a===k7;)r++,a=e.codePointAt(r)}if(t){let a=e.codePointAt(s-1);for(;a===S7||a===k7;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function qYe(e,n){const t={type:"text",value:UYe(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function GYe(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const VYe={blockquote:gYe,break:bYe,code:vYe,delete:xYe,emphasis:yYe,footnoteReference:CYe,heading:EYe,html:NYe,imageReference:zYe,image:AYe,inlineCode:jYe,linkReference:TYe,link:MYe,listItem:RYe,list:LYe,paragraph:OYe,root:IYe,strong:BYe,table:HYe,tableCell:PYe,tableRow:FYe,text:qYe,thematicBreak:GYe,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const AE=-1,pp=0,eh=1,z0=2,rx=3,sx=4,ix=5,ax=6,jE=7,TE=8,WYe=typeof self=="object"?self:globalThis,E7=(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 WYe[e](n)},KYe=(e,n)=>{const t=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=n[s];switch(a){case pp:case AE:return t(o,s);case eh:{const l=t([],s);for(const c of o)l.push(r(c));return l}case z0:{const l=t({},s);for(const[c,f]of o)l[r(c)]=r(f);return l}case rx:return t(new Date(o),s);case sx:{const{source:l,flags:c}=o;return t(new RegExp(l,c),s)}case ix:{const l=t(new Map,s);for(const[c,f]of o)l.set(r(c),r(f));return l}case ax:{const l=t(new Set,s);for(const c of o)l.add(r(c));return l}case jE:{const{name:l,message:c}=o;return t(E7(l,c),s)}case TE:return t(BigInt(o),s);case"BigInt":return t(Object(BigInt(o)),s);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return t(new DataView(l),o)}}return t(E7(a,o),s)};return r},N7=e=>KYe(new Map,e)(0),Bl="",{toString:XYe}={},{keys:YYe}=Object,Of=e=>{const n=typeof e;if(n!=="object"||!e)return[pp,n];const t=XYe.call(e).slice(8,-1);switch(t){case"Array":return[eh,Bl];case"Object":return[z0,Bl];case"Date":return[rx,Bl];case"RegExp":return[sx,Bl];case"Map":return[ix,Bl];case"Set":return[ax,Bl];case"DataView":return[eh,t]}return t.includes("Array")?[eh,t]:t.includes("Error")?[jE,t]:[z0,t]},w_=([e,n])=>e===pp&&(n==="function"||n==="symbol"),ZYe=(e,n,t,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return t.set(l,c),c},a=o=>{if(t.has(o))return t.get(o);let[l,c]=Of(o);switch(l){case pp:{let _=o;switch(c){case"bigint":l=TE,_=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);_=null;break;case"undefined":return s([AE],o)}return s([l,_],o)}case eh:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),s([c,[...m]],o)}const _=[],d=s([l,_],o);for(const m of o)_.push(a(m));return d}case z0:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(n&&"toJSON"in o)return a(o.toJSON());const _=[],d=s([l,_],o);for(const m of YYe(o))(e||!w_(Of(o[m])))&&_.push([a(m),a(o[m])]);return d}case rx:return s([l,isNaN(o.getTime())?Bl:o.toISOString()],o);case sx:{const{source:_,flags:d}=o;return s([l,{source:_,flags:d}],o)}case ix:{const _=[],d=s([l,_],o);for(const[m,g]of o)(e||!(w_(Of(m))||w_(Of(g))))&&_.push([a(m),a(g)]);return d}case ax:{const _=[],d=s([l,_],o);for(const m of o)(e||!w_(Of(m)))&&_.push(a(m));return d}}const{message:f}=o;return s([l,{name:c,message:f}],o)};return a},z7=(e,{json:n,lossy:t}={})=>{const r=[];return ZYe(!(n||t),!!n,new Map,r)(e),r},A0=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?N7(z7(e,n)):structuredClone(e):(e,n)=>N7(z7(e,n));function QYe(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 JYe(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function eZe(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||QYe,r=e.options.footnoteBackLabel||JYe,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&S.push({type:"text",value:" "});let w=typeof t=="string"?t:t(c,g);typeof w=="string"&&(w={type:"text",value:w}),S.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,g),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.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(...S)}else _.push(...S);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+m},children:e.wrap(_,!0)};e.patch(f,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...A0(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const Xd=(function(e){if(e==null)return yYe;if(typeof e=="function")return pp(e);if(typeof e=="object")return Array.isArray(e)?bYe(e):vYe(e);if(typeof e=="string")return xYe(e);throw new Error("Expected function, string, or object as test")});function bYe(e){const n=[];let t=-1;for(;++t":""))+")"})}return m;function m(){let g=AE,S,k,v;if((!n||a(c,f,_[_.length-1]||void 0))&&(g=kYe(t(c,_)),g[0]===av))return g;if("children"in c&&c.children){const b=c;if(b.children&&g[0]!==jE)for(k=(r?b.children.length:-1)+o,v=_.concat(b);k>-1&&k":""))+")"})}return m;function m(){let g=ME,S,k,v;if((!n||a(c,f,_[_.length-1]||void 0))&&(g=oZe(t(c,_)),g[0]===lv))return g;if("children"in c&&c.children){const b=c;if(b.children&&g[0]!==RE)for(k=(r?b.children.length:-1)+o,v=_.concat(b);k>-1&&k0&&t.push({type:"text",value:` -`}),t}function N7(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function z7(e,n){const t=EYe(e,n),r=t.one(e,void 0),s=gYe(t),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` -`},s),a}function A0(e,n){return e&&"run"in e?async function(t,r){const s=z7(t,{file:r,...n});await e.run(s,r)}:function(t,r){return z7(t,{file:r,...e||n})}}function A7(e){if(e)throw e}var E1,j7;function TYe(){if(j7)return E1;j7=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):n.call(f)==="[object Array]"},a=function(f){if(!f||n.call(f)!=="[object Object]")return!1;var _=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!_&&!h)return!1;var m;for(m in f);return typeof m>"u"||e.call(f,m)},o=function(f,_){t&&_.name==="__proto__"?t(f,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):f[_.name]=_.newValue},l=function(f,_){if(_==="__proto__")if(e.call(f,_)){if(r)return r(f,_).value}else return;return f[_]};return E1=function c(){var f,_,h,m,g,S,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={});vo.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(f){const _=f;if(l&&t)throw _;return s(_)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){t||(t=!0,n(o,...l))}function a(o){s(null,o)}}function td(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T7(e.position):"start"in e||"end"in e?T7(e):"line"in e||"column"in e?cv(e):""}function cv(e){return M7(e&&e.line)+":"+M7(e&&e.column)}function T7(e){return cv(e&&e.start)+"-"+cv(e&&e.end)}function M7(e){return e&&typeof e=="number"?e:1}class Zr extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",a={},o=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof n=="string"?s=n:!a.cause&&n&&(o=!0,s=n.message,a.cause=n),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=td(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zr.prototype.file="";Zr.prototype.name="";Zr.prototype.reason="";Zr.prototype.message="";Zr.prototype.stack="";Zr.prototype.column=void 0;Zr.prototype.line=void 0;Zr.prototype.ancestors=void 0;Zr.prototype.cause=void 0;Zr.prototype.fatal=void 0;Zr.prototype.place=void 0;Zr.prototype.ruleId=void 0;Zr.prototype.source=void 0;const fa={basename:LYe,dirname:OYe,extname:IYe,join:BYe,sep:"/"};function LYe(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Yd(e);let t=0,r=-1,s=e.length,a;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){t=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,l=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){t=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===n.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function OYe(e){if(Yd(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 IYe(e){Yd(e);let n=e.length,t=-1,r=0,s=-1,a=0,o;for(;n--;){const l=e.codePointAt(n);if(l===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),l===46?s<0?s=n:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||t<0||a===0||a===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function BYe(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function HYe(e,n){let t="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){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=o,a=0;continue}}else if(t.length>0){t="",r=0,s=o,a=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,o):t=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return t}function Yd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const PYe={cwd:FYe};function FYe(){return"/"}function uv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function UYe(e){if(typeof e=="string")e=new URL(e);else if(!uv(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 qYe(e)}function qYe(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[g,...S]=_;const k=r[m][1];lv(k)&&lv(g)&&(g=N1(!0,k,g)),r[m]=[f,g,...S]}}}}const lx=new ox().freeze();function T1(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function M1(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function R1(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 D7(e){if(!lv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L7(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function S_(e){return KYe(e)?e:new TE(e)}function KYe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XYe(e){return typeof e=="string"||YYe(e)}function YYe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var O7=Object.prototype.hasOwnProperty;function I7(e,n,t){for(t of e.keys())if(nd(t,n))return t}function nd(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--&&nd(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=I7(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=I7(n,s),!s)||!nd(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(O7.call(e,t)&&++r&&!O7.call(n,t)||!(t in n)||!nd(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}function B7(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=t.length,a=!0);const o=t.slice(s,r).trim();(o||!a)&&n.push(o),s=r+1,r=t.indexOf(",",s)}return n}function ZYe(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const QYe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JYe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eZe={};function $7(e,n){return(eZe.jsx?JYe:QYe).test(e)}const tZe=/[ \t\n\f\r]/g;function nZe(e){return typeof e=="object"?e.type==="text"?H7(e.value):!1:H7(e)}function H7(e){return e.replace(tZe,"")===""}class Zd{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zd.prototype.normal={};Zd.prototype.property={};Zd.prototype.space=void 0;function ME(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Zd(t,r,n)}function _d(e){return e.toLowerCase()}class Es{constructor(n,t){this.attribute=t,this.property=n}}Es.prototype.attribute="";Es.prototype.booleanish=!1;Es.prototype.boolean=!1;Es.prototype.commaOrSpaceSeparated=!1;Es.prototype.commaSeparated=!1;Es.prototype.defined=!1;Es.prototype.mustUseProperty=!1;Es.prototype.number=!1;Es.prototype.overloadedBoolean=!1;Es.prototype.property="";Es.prototype.spaceSeparated=!1;Es.prototype.space=void 0;let rZe=0;const yt=lc(),fr=lc(),fv=lc(),Fe=lc(),xn=lc(),Xl=lc(),Fs=lc();function lc(){return 2**++rZe}const dv=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:fr,commaOrSpaceSeparated:Fs,commaSeparated:Xl,number:Fe,overloadedBoolean:fv,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),D1=Object.keys(dv);class cx extends Es{constructor(n,t,r,s){let a=-1;if(super(n,t),P7(this,"space",s),typeof r=="number")for(;++a4&&t.slice(0,4)==="data"&&lZe.test(n)){if(n.charAt(4)==="-"){const a=n.slice(5).replace(F7,uZe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=n.slice(4);if(!F7.test(a)){let o=a.replace(oZe,cZe);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}s=cx}return new s(r,n)}function cZe(e){return"-"+e.toLowerCase()}function uZe(e){return e.charAt(1).toUpperCase()}const HE=ME([RE,sZe,OE,IE,BE],"html"),mp=ME([RE,iZe,OE,IE,BE],"svg");function U7(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function fZe(e){return e.join(" ").trim()}var Wc={},L1,q7;function dZe(){if(q7)return L1;q7=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=` -`,f="/",_="*",h="",m="comment",g="declaration";function S(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(W){var Z=W.match(n);Z&&(w+=Z.length);var X=W.lastIndexOf(c);y=~X?W.length-X:y+W.length}function z(){var W={line:w,column:y};return function(Z){return Z.position=new N(W),D(),Z}}function N(W){this.start=W,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(W){var Z=new Error(b.source+":"+w+":"+y+": "+W);if(Z.reason=W,Z.filename=b.source,Z.line=w,Z.column=y,Z.source=v,!b.silent)throw Z}function j(W){var Z=W.exec(v);if(Z){var X=Z[0];return C(X),v=v.slice(X.length),Z}}function D(){j(t)}function I(W){var Z;for(W=W||[];Z=L();)Z!==!1&&W.push(Z);return W}function L(){var W=z();if(!(f!=v.charAt(0)||_!=v.charAt(1))){for(var Z=2;h!=v.charAt(Z)&&(_!=v.charAt(Z)||f!=v.charAt(Z+1));)++Z;if(Z+=2,h===v.charAt(Z-1))return T("End of comment missing");var X=v.slice(2,Z-2);return y+=2,C(X),v=v.slice(Z),y+=2,W({type:m,comment:X})}}function U(){var W=z(),Z=j(r);if(Z){if(L(),!j(s))return T("property missing ':'");var X=j(a),J=W({type:g,property:k(Z[0].replace(e,h)),value:X?k(X[0].replace(e,h)):h});return j(o),J}}function q(){var W=[];I(W);for(var Z;Z=U();)Z!==!1&&(W.push(Z),I(W));return W}return D(),q()}function k(v){return v?v.replace(l,h):h}return L1=S,L1}var G7;function hZe(){if(G7)return Wc;G7=1;var e=Wc&&Wc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.default=t;const n=e(dZe());function t(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,n.default)(r),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:_}=c;l?s(f,_,c):_&&(a=a||{},a[f]=_)}),a}return Wc}var If={},V7;function _Ze(){if(V7)return If;V7=1,Object.defineProperty(If,"__esModule",{value:!0}),If.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||t.test(f)||e.test(f)},o=function(f,_){return _.toUpperCase()},l=function(f,_){return"".concat(_,"-")},c=function(f,_){return _===void 0&&(_={}),a(f)?f:(f=f.toLowerCase(),_.reactCompat?f=f.replace(s,l):f=f.replace(r,l),f.replace(n,o))};return If.camelCase=c,If}var Bf,W7;function pZe(){if(W7)return Bf;W7=1;var e=Bf&&Bf.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(hZe()),t=_Ze();function r(s,a){var o={};return!s||typeof s!="string"||(0,n.default)(s,function(l,c){l&&c&&(o[(0,t.camelCase)(l,a)]=c)}),o}return r.default=r,Bf=r,Bf}var mZe=pZe();const gZe=tp(mZe),ux={}.hasOwnProperty,bZe=new Map,vZe=/[A-Z]/g,xZe=new Set(["table","tbody","thead","tfoot","tr"]),yZe=new Set(["td","th"]),PE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FE(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=AZe(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=zZe(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"?mp:HE,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},a=UE(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function UE(e,n,t){if(n.type==="element")return wZe(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return SZe(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return CZe(e,n,t);if(n.type==="mdxjsEsm")return kZe(e,n);if(n.type==="root")return EZe(e,n,t);if(n.type==="text")return NZe(e,n)}function wZe(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=mp,e.schema=s),e.ancestors.push(n);const a=GE(e,n.tagName,!1),o=jZe(e,n);let l=dx(e,n);return xZe.has(n.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!nZe(c):!0})),qE(e,o,a,n),fx(o,l),e.ancestors.pop(),e.schema=r,e.create(n,a,o,t)}function SZe(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)}pd(e,n.position)}function kZe(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);pd(e,n.position)}function CZe(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=mp,e.schema=s),e.ancestors.push(n);const a=n.name===null?e.Fragment:GE(e,n.name,!0),o=TZe(e,n),l=dx(e,n);return qE(e,o,a,n),fx(o,l),e.ancestors.pop(),e.schema=r,e.create(n,a,o,t)}function EZe(e,n,t){const r={};return fx(r,dx(e,n)),e.create(n,e.Fragment,r,t)}function NZe(e,n){return n.value}function qE(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function fx(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function zZe(e,n,t){return r;function r(s,a,o,l){const f=Array.isArray(o.children)?t:n;return l?f(a,o,l):f(a,o)}}function AZe(e,n){return t;function t(r,s,a,o){const l=Array.isArray(a.children),c=ex(r);return n(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function jZe(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&ux.call(n.properties,s)){const a=MZe(e,s,n.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&yZe.has(n.tagName)?r=l:t[o]=l}}if(r){const a=t.style||(t.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function TZe(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(t,e.evaluater.evaluateExpression(l.argument))}else pd(e,n.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else pd(e,n.position);else a=r.value===null?!0:r.value;t[s]=a}return t}function dx(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:bZe;for(;++ry.key).filter(y=>y!==void 0));let f=0;for(;f=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(z=((b=s[N])==null?void 0:b.key)??z);z&&c.has(z)&&((w=s[N])==null?void 0:w.key)!==z;)z=`${z}+`;z&&c.add(z);const T=VE(C,s[N]??null,t,z);a.push(T),T.react!==void 0&&o.push(T.react)}const h=n!==null&&HZe(e,n.node);if(n&&n.key===r&&h&&s.length===a.length&&a.every((y,C)=>y===s[C]))return n;const m=e.type==="element"&&IZe.has(e.tagName)?o.filter(y=>typeof y!="string"||!BZe.test(y)):o,g=m.length>0?m.length===1?m[0]:m:null;let S=h?n==null?void 0:n.shell:null;if(!S){const y=FE({...e,children:[]},t);S={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:d.jsx(S.type,{...S.props,children:g},r),shell:S}}function HZe(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:a,position:o,...l}=n;return nd(s,l)}function du(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 o=0;os?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);a0?(Gs(e,e.length,0,n),e):n}const Y7={}.hasOwnProperty;function KE(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 Pi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Ot(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Pt(c)?(e.enter(t),l(c)):n(c)}function l(c){return Pt(c)&&a++o))return;const T=n.events.length;let j=T,D,I;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(D){I=n.events[j][1].end;break}D=!0}for(b(r),N=T;Ny;){const z=t[C];n.containerState=z[1],z[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),a=void 0,s=void 0,n.containerState._closeFlow=void 0}}function XZe(e,n,t){return Ot(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cu(e){if(e===null||yn(e)||ec(e))return 1;if(hp(e))return 2}function gp(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[t][1].start};Q7(h,-c),Q7(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:m},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[t][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=xi(f,[["enter",e[r][1],n],["exit",e[r][1],n]])),f=xi(f,[["enter",s,n],["enter",o,n],["exit",o,n],["enter",a,n]]),f=xi(f,gp(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),f=xi(f,[["exit",a,n],["enter",l,n],["exit",l,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,f=xi(f,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Gs(e,r-1,t-r+3,f),t=r+f.length-_-2;break}}for(t=-1;++t0&&Pt(N)?Ot(e,w,"linePrefix",a+1)(N):w(N)}function w(N){return N===null||it(N)?e.check(J7,k,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||it(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function z(N,T,j){let D=0;return I;function I(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),L}function L(Z){return N.enter("codeFencedFence"),Pt(Z)?Ot(N,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):U(Z)}function U(Z){return Z===l?(N.enter("codeFencedFenceSequence"),q(Z)):j(Z)}function q(Z){return Z===l?(D++,N.consume(Z),q):D>=o?(N.exit("codeFencedFenceSequence"),Pt(Z)?Ot(N,W,"whitespace")(Z):W(Z)):j(Z)}function W(Z){return Z===null||it(Z)?(N.exit("codeFencedFence"),T(Z)):j(Z)}}}function oQe(e,n,t){const r=this;return s;function s(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const O1={name:"codeIndented",tokenize:cQe},lQe={partial:!0,tokenize:uQe};function cQe(e,n,t){const r=this;return s;function s(f){return e.enter("codeIndented"),Ot(e,a,"linePrefix",5)(f)}function a(f){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?o(f):t(f)}function o(f){return f===null?c(f):it(f)?e.attempt(lQe,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||it(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),n(f)}}function uQe(e,n,t){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?t(o):it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Ot(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(o):it(o)?s(o):t(o)}}const fQe={name:"codeText",previous:hQe,resolve:dQe,tokenize:_Qe};function dQe(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 a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&$f(this.left,r),a.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),$f(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$f(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(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function eN(e,n,t,r,s,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let _=0;return h;function h(b){return b===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||E0(b)?t(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(b))}function m(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),e.exit(r),n):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===62?(e.exit("chunkString"),e.exit(l),m(b)):b===null||b===60||it(b)?t(b):(e.consume(b),b===92?S:g)}function S(b){return b===60||b===62||b===92?(e.consume(b),g):g(b)}function k(b){return!_&&(b===null||b===41||yn(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),n(b)):_999||g===null||g===91||g===93&&!c||g===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?t(g):g===93?(e.exit(a),e.enter(s),e.consume(g),e.exit(s),e.exit(r),n):it(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||it(g)||l++>999?(e.exit("chunkString"),_(g)):(e.consume(g),c||(c=!Pt(g)),g===92?m:h)}function m(g){return g===91||g===92||g===93?(e.consume(g),l++,h):h(g)}}function nN(e,n,t,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,c):t(m)}function c(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):(e.enter(a),f(m))}function f(m){return m===o?(e.exit(a),c(o)):m===null?t(m):it(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ot(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(m))}function _(m){return m===o||m===null||it(m)?(e.exit("chunkString"),f(m)):(e.consume(m),m===92?h:_)}function h(m){return m===o||m===92?(e.consume(m),_):_(m)}}function rd(e,n){let t;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):Pt(s)?Ot(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const wQe={name:"definition",tokenize:kQe},SQe={partial:!0,tokenize:CQe};function kQe(e,n,t){const r=this;let s;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return tN.call(r,e,l,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return s=Pi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):t(g)}function c(g){return yn(g)?rd(e,f)(g):f(g)}function f(g){return eN(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function _(g){return e.attempt(SQe,h,h)(g)}function h(g){return Pt(g)?Ot(e,m,"whitespace")(g):m(g)}function m(g){return g===null||it(g)?(e.exit("definition"),r.parser.defined.push(s),n(g)):t(g)}}function CQe(e,n,t){return r;function r(l){return yn(l)?rd(e,s)(l):t(l)}function s(l){return nN(e,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Pt(l)?Ot(e,o,"whitespace")(l):o(l)}function o(l){return l===null||it(l)?n(l):t(l)}}const EQe={name:"hardBreakEscape",tokenize:NQe};function NQe(e,n,t){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return it(a)?(e.exit("hardBreakEscape"),n(a)):t(a)}}const zQe={name:"headingAtx",resolve:AQe,tokenize:jQe};function AQe(e,n){let t=e.length-2,r=3,s,a;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},a={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Gs(e,r,t-r+1,[["enter",s,n],["enter",a,n],["exit",a,n],["exit",s,n]])),e}function jQe(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),a(_)}function a(_){return e.enter("atxHeadingSequence"),o(_)}function o(_){return _===35&&r++<6?(e.consume(_),o):_===null||yn(_)?(e.exit("atxHeadingSequence"),l(_)):t(_)}function l(_){return _===35?(e.enter("atxHeadingSequence"),c(_)):_===null||it(_)?(e.exit("atxHeading"),n(_)):Pt(_)?Ot(e,l,"whitespace")(_):(e.enter("atxHeadingText"),f(_))}function c(_){return _===35?(e.consume(_),c):(e.exit("atxHeadingSequence"),l(_))}function f(_){return _===null||_===35||yn(_)?(e.exit("atxHeadingText"),l(_)):(e.consume(_),f)}}const TQe=["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"],tS=["pre","script","style","textarea"],MQe={concrete:!0,name:"htmlFlow",resolveTo:LQe,tokenize:OQe},RQe={partial:!0,tokenize:BQe},DQe={partial:!0,tokenize:IQe};function LQe(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 OQe(e,n,t){const r=this;let s,a,o,l,c;return f;function f(G){return _(G)}function _(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),h}function h(G){return G===33?(e.consume(G),m):G===47?(e.consume(G),a=!0,k):G===63?(e.consume(G),s=3,r.interrupt?n:B):is(G)?(e.consume(G),o=String.fromCharCode(G),v):t(G)}function m(G){return G===45?(e.consume(G),s=2,g):G===91?(e.consume(G),s=5,l=0,S):is(G)?(e.consume(G),s=4,r.interrupt?n:B):t(G)}function g(G){return G===45?(e.consume(G),r.interrupt?n:B):t(G)}function S(G){const ie="CDATA[";return G===ie.charCodeAt(l++)?(e.consume(G),l===ie.length?r.interrupt?n:U:S):t(G)}function k(G){return is(G)?(e.consume(G),o=String.fromCharCode(G),v):t(G)}function v(G){if(G===null||G===47||G===62||yn(G)){const ie=G===47,ve=o.toLowerCase();return!ie&&!a&&tS.includes(ve)?(s=1,r.interrupt?n(G):U(G)):TQe.includes(o.toLowerCase())?(s=6,ie?(e.consume(G),b):r.interrupt?n(G):U(G)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(G):a?w(G):y(G))}return G===45||Kr(G)?(e.consume(G),o+=String.fromCharCode(G),v):t(G)}function b(G){return G===62?(e.consume(G),r.interrupt?n:U):t(G)}function w(G){return Pt(G)?(e.consume(G),w):I(G)}function y(G){return G===47?(e.consume(G),I):G===58||G===95||is(G)?(e.consume(G),C):Pt(G)?(e.consume(G),y):I(G)}function C(G){return G===45||G===46||G===58||G===95||Kr(G)?(e.consume(G),C):z(G)}function z(G){return G===61?(e.consume(G),N):Pt(G)?(e.consume(G),z):y(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?t(G):G===34||G===39?(e.consume(G),c=G,T):Pt(G)?(e.consume(G),N):j(G)}function T(G){return G===c?(e.consume(G),c=null,D):G===null||it(G)?t(G):(e.consume(G),T)}function j(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||yn(G)?z(G):(e.consume(G),j)}function D(G){return G===47||G===62||Pt(G)?y(G):t(G)}function I(G){return G===62?(e.consume(G),L):t(G)}function L(G){return G===null||it(G)?U(G):Pt(G)?(e.consume(G),L):t(G)}function U(G){return G===45&&s===2?(e.consume(G),X):G===60&&s===1?(e.consume(G),J):G===62&&s===4?(e.consume(G),H):G===63&&s===3?(e.consume(G),B):G===93&&s===5?(e.consume(G),$):it(G)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(RQe,K,q)(G)):G===null||it(G)?(e.exit("htmlFlowData"),q(G)):(e.consume(G),U)}function q(G){return e.check(DQe,W,K)(G)}function W(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),Z}function Z(G){return G===null||it(G)?q(G):(e.enter("htmlFlowData"),U(G))}function X(G){return G===45?(e.consume(G),B):U(G)}function J(G){return G===47?(e.consume(G),o="",ee):U(G)}function ee(G){if(G===62){const ie=o.toLowerCase();return tS.includes(ie)?(e.consume(G),H):U(G)}return is(G)&&o.length<8?(e.consume(G),o+=String.fromCharCode(G),ee):U(G)}function $(G){return G===93?(e.consume(G),B):U(G)}function B(G){return G===62?(e.consume(G),H):G===45&&s===2?(e.consume(G),B):U(G)}function H(G){return G===null||it(G)?(e.exit("htmlFlowData"),K(G)):(e.consume(G),H)}function K(G){return e.exit("htmlFlow"),n(G)}}function IQe(e,n,t){const r=this;return s;function s(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):t(o)}function a(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function BQe(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Qd,n,t)}}const $Qe={name:"htmlText",tokenize:HQe};function HQe(e,n,t){const r=this;let s,a,o;return l;function l(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),c}function c(B){return B===33?(e.consume(B),f):B===47?(e.consume(B),z):B===63?(e.consume(B),y):is(B)?(e.consume(B),j):t(B)}function f(B){return B===45?(e.consume(B),_):B===91?(e.consume(B),a=0,S):is(B)?(e.consume(B),w):t(B)}function _(B){return B===45?(e.consume(B),g):t(B)}function h(B){return B===null?t(B):B===45?(e.consume(B),m):it(B)?(o=h,J(B)):(e.consume(B),h)}function m(B){return B===45?(e.consume(B),g):h(B)}function g(B){return B===62?X(B):B===45?m(B):h(B)}function S(B){const H="CDATA[";return B===H.charCodeAt(a++)?(e.consume(B),a===H.length?k:S):t(B)}function k(B){return B===null?t(B):B===93?(e.consume(B),v):it(B)?(o=k,J(B)):(e.consume(B),k)}function v(B){return B===93?(e.consume(B),b):k(B)}function b(B){return B===62?X(B):B===93?(e.consume(B),b):k(B)}function w(B){return B===null||B===62?X(B):it(B)?(o=w,J(B)):(e.consume(B),w)}function y(B){return B===null?t(B):B===63?(e.consume(B),C):it(B)?(o=y,J(B)):(e.consume(B),y)}function C(B){return B===62?X(B):y(B)}function z(B){return is(B)?(e.consume(B),N):t(B)}function N(B){return B===45||Kr(B)?(e.consume(B),N):T(B)}function T(B){return it(B)?(o=T,J(B)):Pt(B)?(e.consume(B),T):X(B)}function j(B){return B===45||Kr(B)?(e.consume(B),j):B===47||B===62||yn(B)?D(B):t(B)}function D(B){return B===47?(e.consume(B),X):B===58||B===95||is(B)?(e.consume(B),I):it(B)?(o=D,J(B)):Pt(B)?(e.consume(B),D):X(B)}function I(B){return B===45||B===46||B===58||B===95||Kr(B)?(e.consume(B),I):L(B)}function L(B){return B===61?(e.consume(B),U):it(B)?(o=L,J(B)):Pt(B)?(e.consume(B),L):D(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?t(B):B===34||B===39?(e.consume(B),s=B,q):it(B)?(o=U,J(B)):Pt(B)?(e.consume(B),U):(e.consume(B),W)}function q(B){return B===s?(e.consume(B),s=void 0,Z):B===null?t(B):it(B)?(o=q,J(B)):(e.consume(B),q)}function W(B){return B===null||B===34||B===39||B===60||B===61||B===96?t(B):B===47||B===62||yn(B)?D(B):(e.consume(B),W)}function Z(B){return B===47||B===62||yn(B)?D(B):t(B)}function X(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),n):t(B)}function J(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),ee}function ee(B){return Pt(B)?Ot(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):$(B)}function $(B){return e.enter("htmlTextData"),o(B)}}const _x={name:"labelEnd",resolveAll:qQe,resolveTo:GQe,tokenize:VQe},PQe={tokenize:WQe},FQe={tokenize:KQe},UQe={tokenize:XQe};function qQe(e){let n=-1;const t=[];for(;++n=3&&(f===null||it(f))?(e.exit("thematicBreak"),n(f)):t(f)}function c(f){return f===s?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Pt(f)?Ot(e,l,"whitespace")(f):l(f))}}const ys={continuation:{tokenize:iJe},exit:oJe,name:"list",tokenize:sJe},nJe={partial:!0,tokenize:lJe},rJe={partial:!0,tokenize:aJe};function sJe(e,n,t){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(g){const S=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:iv(g)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(t0,t,f)(g):f(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return t(g)}function c(g){return iv(g)&&++o<10?(e.consume(g),c):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):t(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Qd,r.interrupt?t:_,e.attempt(nJe,m,h))}function _(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function h(g){return Pt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):t(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(g)}}function iJe(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Qd,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ot(e,n,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Pt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rJe,n,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ot(e,e.attempt(ys,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function aJe(e,n,t){const r=this;return Ot(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(a):t(a)}}function oJe(e){e.exit(this.containerState.type)}function lJe(e,n,t){const r=this;return Ot(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!Pt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?n(a):t(a)}}const nS={name:"setextUnderline",resolveTo:cJe,tokenize:uJe};function cJe(e,n){let t=e.length,r,s,a;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),!a&&e[t][1].type==="definition"&&(a=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,n]),e.splice(a+1,0,["exit",e[r][1],n]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function uJe(e,n,t){const r=this;let s;return a;function a(f){let _=r.events.length,h;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){h=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),s=f,o(f)):t(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===s?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Pt(f)?Ot(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||it(f)?(e.exit("setextHeadingLine"),n(f)):t(f)}}const fJe={tokenize:dJe};function dJe(e){const n=this,t=e.attempt(Qd,r,e.attempt(this.parser.constructs.flowInitial,s,Ot(e,e.attempt(this.parser.constructs.flow,s,e.attempt(gQe,s)),"linePrefix")));return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const hJe={resolveAll:sN()},_Je=rN("string"),pJe=rN("text");function rN(e){return{resolveAll:sN(e==="text"?mJe:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],a=t.attempt(s,o,l);return o;function o(_){return f(_)?a(_):l(_)}function l(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),c}function c(_){return f(_)?(t.exit("data"),a(_)):(t.consume(_),c)}function f(_){if(_===null)return!0;const h=s[_];let m=-1;if(h)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function AJe(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(f,m)},o=function(f,_){t&&_.name==="__proto__"?t(f,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):f[_.name]=_.newValue},l=function(f,_){if(_==="__proto__")if(e.call(f,_)){if(r)return r(f,_).value}else return;return f[_]};return A1=function c(){var f,_,d,m,g,S,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={});vo.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(f){const _=f;if(l&&t)throw _;return s(_)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){t||(t=!0,n(o,...l))}function a(o){s(null,o)}}function th(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?R7(e.position):"start"in e||"end"in e?R7(e):"line"in e||"column"in e?fv(e):""}function fv(e){return D7(e&&e.line)+":"+D7(e&&e.column)}function R7(e){return fv(e&&e.start)+"-"+fv(e&&e.end)}function D7(e){return e&&typeof e=="number"?e:1}class ns extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",a={},o=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof n=="string"?s=n:!a.cause&&n&&(o=!0,s=n.message,a.cause=n),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=th(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ns.prototype.file="";ns.prototype.name="";ns.prototype.reason="";ns.prototype.message="";ns.prototype.stack="";ns.prototype.column=void 0;ns.prototype.line=void 0;ns.prototype.ancestors=void 0;ns.prototype.cause=void 0;ns.prototype.fatal=void 0;ns.prototype.place=void 0;ns.prototype.ruleId=void 0;ns.prototype.source=void 0;const fa={basename:bZe,dirname:vZe,extname:xZe,join:yZe,sep:"/"};function bZe(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Yh(e);let t=0,r=-1,s=e.length,a;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){t=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,l=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){t=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===n.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function vZe(e){if(Yh(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 xZe(e){Yh(e);let n=e.length,t=-1,r=0,s=-1,a=0,o;for(;n--;){const l=e.codePointAt(n);if(l===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),l===46?s<0?s=n:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||t<0||a===0||a===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function yZe(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function SZe(e,n){let t="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){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=o,a=0;continue}}else if(t.length>0){t="",r=0,s=o,a=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,o):t=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return t}function Yh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kZe={cwd:CZe};function CZe(){return"/"}function hv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EZe(e){if(typeof e=="string")e=new URL(e);else if(!hv(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 NZe(e)}function NZe(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[g,...S]=_;const k=r[m][1];uv(k)&&uv(g)&&(g=j1(!0,k,g)),r[m]=[f,g,...S]}}}}const ux=new cx().freeze();function D1(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function L1(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function O1(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 O7(e){if(!uv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function I7(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function S_(e){return TZe(e)?e:new DE(e)}function TZe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MZe(e){return typeof e=="string"||RZe(e)}function RZe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var B7=Object.prototype.hasOwnProperty;function $7(e,n,t){for(t of e.keys())if(nh(t,n))return t}function nh(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--&&nh(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=$7(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=$7(n,s),!s)||!nh(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(B7.call(e,t)&&++r&&!B7.call(n,t)||!(t in n)||!nh(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}function H7(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=t.length,a=!0);const o=t.slice(s,r).trim();(o||!a)&&n.push(o),s=r+1,r=t.indexOf(",",s)}return n}function DZe(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const LZe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OZe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IZe={};function F7(e,n){return(IZe.jsx?OZe:LZe).test(e)}const BZe=/[ \t\n\f\r]/g;function $Ze(e){return typeof e=="object"?e.type==="text"?P7(e.value):!1:P7(e)}function P7(e){return e.replace(BZe,"")===""}class Zh{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zh.prototype.normal={};Zh.prototype.property={};Zh.prototype.space=void 0;function LE(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Zh(t,r,n)}function _h(e){return e.toLowerCase()}class js{constructor(n,t){this.attribute=t,this.property=n}}js.prototype.attribute="";js.prototype.booleanish=!1;js.prototype.boolean=!1;js.prototype.commaOrSpaceSeparated=!1;js.prototype.commaSeparated=!1;js.prototype.defined=!1;js.prototype.mustUseProperty=!1;js.prototype.number=!1;js.prototype.overloadedBoolean=!1;js.prototype.property="";js.prototype.spaceSeparated=!1;js.prototype.space=void 0;let HZe=0;const wt=lc(),_r=lc(),dv=lc(),Fe=lc(),wn=lc(),Xl=lc(),Gs=lc();function lc(){return 2**++HZe}const _v=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:_r,commaOrSpaceSeparated:Gs,commaSeparated:Xl,number:Fe,overloadedBoolean:dv,spaceSeparated:wn},Symbol.toStringTag,{value:"Module"})),I1=Object.keys(_v);class fx extends js{constructor(n,t,r,s){let a=-1;if(super(n,t),U7(this,"space",s),typeof r=="number")for(;++a4&&t.slice(0,4)==="data"&&GZe.test(n)){if(n.charAt(4)==="-"){const a=n.slice(5).replace(q7,WZe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=n.slice(4);if(!q7.test(a)){let o=a.replace(qZe,VZe);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}s=fx}return new s(r,n)}function VZe(e){return"-"+e.toLowerCase()}function WZe(e){return e.charAt(1).toUpperCase()}const UE=LE([OE,FZe,$E,HE,FE],"html"),gp=LE([OE,PZe,$E,HE,FE],"svg");function G7(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function KZe(e){return e.join(" ").trim()}var Wc={},B1,V7;function XZe(){if(V7)return B1;V7=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=` +`,f="/",_="*",d="",m="comment",g="declaration";function S(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(W){var Z=W.match(n);Z&&(w+=Z.length);var X=W.lastIndexOf(c);y=~X?W.length-X:y+W.length}function z(){var W={line:w,column:y};return function(Z){return Z.position=new N(W),D(),Z}}function N(W){this.start=W,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(W){var Z=new Error(b.source+":"+w+":"+y+": "+W);if(Z.reason=W,Z.filename=b.source,Z.line=w,Z.column=y,Z.source=v,!b.silent)throw Z}function j(W){var Z=W.exec(v);if(Z){var X=Z[0];return C(X),v=v.slice(X.length),Z}}function D(){j(t)}function I(W){var Z;for(W=W||[];Z=L();)Z!==!1&&W.push(Z);return W}function L(){var W=z();if(!(f!=v.charAt(0)||_!=v.charAt(1))){for(var Z=2;d!=v.charAt(Z)&&(_!=v.charAt(Z)||f!=v.charAt(Z+1));)++Z;if(Z+=2,d===v.charAt(Z-1))return T("End of comment missing");var X=v.slice(2,Z-2);return y+=2,C(X),v=v.slice(Z),y+=2,W({type:m,comment:X})}}function P(){var W=z(),Z=j(r);if(Z){if(L(),!j(s))return T("property missing ':'");var X=j(a),J=W({type:g,property:k(Z[0].replace(e,d)),value:X?k(X[0].replace(e,d)):d});return j(o),J}}function q(){var W=[];I(W);for(var Z;Z=P();)Z!==!1&&(W.push(Z),I(W));return W}return D(),q()}function k(v){return v?v.replace(l,d):d}return B1=S,B1}var W7;function YZe(){if(W7)return Wc;W7=1;var e=Wc&&Wc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.default=t;const n=e(XZe());function t(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,n.default)(r),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:_}=c;l?s(f,_,c):_&&(a=a||{},a[f]=_)}),a}return Wc}var If={},K7;function ZZe(){if(K7)return If;K7=1,Object.defineProperty(If,"__esModule",{value:!0}),If.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||t.test(f)||e.test(f)},o=function(f,_){return _.toUpperCase()},l=function(f,_){return"".concat(_,"-")},c=function(f,_){return _===void 0&&(_={}),a(f)?f:(f=f.toLowerCase(),_.reactCompat?f=f.replace(s,l):f=f.replace(r,l),f.replace(n,o))};return If.camelCase=c,If}var Bf,X7;function QZe(){if(X7)return Bf;X7=1;var e=Bf&&Bf.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(YZe()),t=ZZe();function r(s,a){var o={};return!s||typeof s!="string"||(0,n.default)(s,function(l,c){l&&c&&(o[(0,t.camelCase)(l,a)]=c)}),o}return r.default=r,Bf=r,Bf}var JZe=QZe();const eQe=np(JZe),hx={}.hasOwnProperty,tQe=new Map,nQe=/[A-Z]/g,rQe=new Set(["table","tbody","thead","tfoot","tr"]),sQe=new Set(["td","th"]),qE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GE(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=hQe(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=fQe(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"?gp:UE,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},a=VE(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function VE(e,n,t){if(n.type==="element")return iQe(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return aQe(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return lQe(e,n,t);if(n.type==="mdxjsEsm")return oQe(e,n);if(n.type==="root")return cQe(e,n,t);if(n.type==="text")return uQe(e,n)}function iQe(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=gp,e.schema=s),e.ancestors.push(n);const a=KE(e,n.tagName,!1),o=dQe(e,n);let l=_x(e,n);return rQe.has(n.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!$Ze(c):!0})),WE(e,o,a,n),dx(o,l),e.ancestors.pop(),e.schema=r,e.create(n,a,o,t)}function aQe(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)}ph(e,n.position)}function oQe(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ph(e,n.position)}function lQe(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=gp,e.schema=s),e.ancestors.push(n);const a=n.name===null?e.Fragment:KE(e,n.name,!0),o=_Qe(e,n),l=_x(e,n);return WE(e,o,a,n),dx(o,l),e.ancestors.pop(),e.schema=r,e.create(n,a,o,t)}function cQe(e,n,t){const r={};return dx(r,_x(e,n)),e.create(n,e.Fragment,r,t)}function uQe(e,n){return n.value}function WE(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function dx(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function fQe(e,n,t){return r;function r(s,a,o,l){const f=Array.isArray(o.children)?t:n;return l?f(a,o,l):f(a,o)}}function hQe(e,n){return t;function t(r,s,a,o){const l=Array.isArray(a.children),c=nx(r);return n(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function dQe(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&hx.call(n.properties,s)){const a=pQe(e,s,n.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&sQe.has(n.tagName)?r=l:t[o]=l}}if(r){const a=t.style||(t.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function _Qe(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(t,e.evaluater.evaluateExpression(l.argument))}else ph(e,n.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else ph(e,n.position);else a=r.value===null?!0:r.value;t[s]=a}return t}function _x(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:tQe;for(;++ry.key).filter(y=>y!==void 0));let f=0;for(;f=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(z=((b=s[N])==null?void 0:b.key)??z);z&&c.has(z)&&((w=s[N])==null?void 0:w.key)!==z;)z=`${z}+`;z&&c.add(z);const T=XE(C,s[N]??null,t,z);a.push(T),T.react!==void 0&&o.push(T.react)}const d=n!==null&&SQe(e,n.node);if(n&&n.key===r&&d&&s.length===a.length&&a.every((y,C)=>y===s[C]))return n;const m=e.type==="element"&&xQe.has(e.tagName)?o.filter(y=>typeof y!="string"||!yQe.test(y)):o,g=m.length>0?m.length===1?m[0]:m:null;let S=d?n==null?void 0:n.shell:null;if(!S){const y=GE({...e,children:[]},t);S={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:h.jsx(S.type,{...S.props,children:g},r),shell:S}}function SQe(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:a,position:o,...l}=n;return nh(s,l)}function hu(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 o=0;os?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);a0?(Ks(e,e.length,0,n),e):n}const Q7={}.hasOwnProperty;function ZE(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 Pi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Lt(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Ht(c)?(e.enter(t),l(c)):n(c)}function l(c){return Ht(c)&&a++o))return;const T=n.events.length;let j=T,D,I;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(D){I=n.events[j][1].end;break}D=!0}for(b(r),N=T;Ny;){const z=t[C];n.containerState=z[1],z[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),a=void 0,s=void 0,n.containerState._closeFlow=void 0}}function MQe(e,n,t){return Lt(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cu(e){if(e===null||Sn(e)||ec(e))return 1;if(_p(e))return 2}function bp(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},m={...e[t][1].start};eS(d,-c),eS(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:m},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[t][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=yi(f,[["enter",e[r][1],n],["exit",e[r][1],n]])),f=yi(f,[["enter",s,n],["enter",o,n],["exit",o,n],["enter",a,n]]),f=yi(f,bp(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),f=yi(f,[["exit",a,n],["enter",l,n],["exit",l,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,f=yi(f,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Ks(e,r-1,t-r+3,f),t=r+f.length-_-2;break}}for(t=-1;++t0&&Ht(N)?Lt(e,w,"linePrefix",a+1)(N):w(N)}function w(N){return N===null||it(N)?e.check(tS,k,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||it(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function z(N,T,j){let D=0;return I;function I(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),L}function L(Z){return N.enter("codeFencedFence"),Ht(Z)?Lt(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):P(Z)}function P(Z){return Z===l?(N.enter("codeFencedFenceSequence"),q(Z)):j(Z)}function q(Z){return Z===l?(D++,N.consume(Z),q):D>=o?(N.exit("codeFencedFenceSequence"),Ht(Z)?Lt(N,W,"whitespace")(Z):W(Z)):j(Z)}function W(Z){return Z===null||it(Z)?(N.exit("codeFencedFence"),T(Z)):j(Z)}}}function qQe(e,n,t){const r=this;return s;function s(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const $1={name:"codeIndented",tokenize:VQe},GQe={partial:!0,tokenize:WQe};function VQe(e,n,t){const r=this;return s;function s(f){return e.enter("codeIndented"),Lt(e,a,"linePrefix",5)(f)}function a(f){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?o(f):t(f)}function o(f){return f===null?c(f):it(f)?e.attempt(GQe,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||it(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),n(f)}}function WQe(e,n,t){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?t(o):it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Lt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(o):it(o)?s(o):t(o)}}const KQe={name:"codeText",previous:YQe,resolve:XQe,tokenize:ZQe};function XQe(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 a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&$f(this.left,r),a.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),$f(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$f(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(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function rN(e,n,t,r,s,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||N0(b)?t(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(b))}function m(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),e.exit(r),n):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===62?(e.exit("chunkString"),e.exit(l),m(b)):b===null||b===60||it(b)?t(b):(e.consume(b),b===92?S:g)}function S(b){return b===60||b===62||b===92?(e.consume(b),g):g(b)}function k(b){return!_&&(b===null||b===41||Sn(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),n(b)):_999||g===null||g===91||g===93&&!c||g===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?t(g):g===93?(e.exit(a),e.enter(s),e.consume(g),e.exit(s),e.exit(r),n):it(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||it(g)||l++>999?(e.exit("chunkString"),_(g)):(e.consume(g),c||(c=!Ht(g)),g===92?m:d)}function m(g){return g===91||g===92||g===93?(e.consume(g),l++,d):d(g)}}function iN(e,n,t,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,c):t(m)}function c(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):(e.enter(a),f(m))}function f(m){return m===o?(e.exit(a),c(o)):m===null?t(m):it(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Lt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(m))}function _(m){return m===o||m===null||it(m)?(e.exit("chunkString"),f(m)):(e.consume(m),m===92?d:_)}function d(m){return m===o||m===92?(e.consume(m),_):_(m)}}function rh(e,n){let t;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):Ht(s)?Lt(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const iJe={name:"definition",tokenize:oJe},aJe={partial:!0,tokenize:lJe};function oJe(e,n,t){const r=this;let s;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return sN.call(r,e,l,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return s=Pi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):t(g)}function c(g){return Sn(g)?rh(e,f)(g):f(g)}function f(g){return rN(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function _(g){return e.attempt(aJe,d,d)(g)}function d(g){return Ht(g)?Lt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||it(g)?(e.exit("definition"),r.parser.defined.push(s),n(g)):t(g)}}function lJe(e,n,t){return r;function r(l){return Sn(l)?rh(e,s)(l):t(l)}function s(l){return iN(e,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Ht(l)?Lt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||it(l)?n(l):t(l)}}const cJe={name:"hardBreakEscape",tokenize:uJe};function uJe(e,n,t){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return it(a)?(e.exit("hardBreakEscape"),n(a)):t(a)}}const fJe={name:"headingAtx",resolve:hJe,tokenize:dJe};function hJe(e,n){let t=e.length-2,r=3,s,a;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},a={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Ks(e,r,t-r+1,[["enter",s,n],["enter",a,n],["exit",a,n],["exit",s,n]])),e}function dJe(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),a(_)}function a(_){return e.enter("atxHeadingSequence"),o(_)}function o(_){return _===35&&r++<6?(e.consume(_),o):_===null||Sn(_)?(e.exit("atxHeadingSequence"),l(_)):t(_)}function l(_){return _===35?(e.enter("atxHeadingSequence"),c(_)):_===null||it(_)?(e.exit("atxHeading"),n(_)):Ht(_)?Lt(e,l,"whitespace")(_):(e.enter("atxHeadingText"),f(_))}function c(_){return _===35?(e.consume(_),c):(e.exit("atxHeadingSequence"),l(_))}function f(_){return _===null||_===35||Sn(_)?(e.exit("atxHeadingText"),l(_)):(e.consume(_),f)}}const _Je=["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"],rS=["pre","script","style","textarea"],pJe={concrete:!0,name:"htmlFlow",resolveTo:bJe,tokenize:vJe},mJe={partial:!0,tokenize:yJe},gJe={partial:!0,tokenize:xJe};function bJe(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 vJe(e,n,t){const r=this;let s,a,o,l,c;return f;function f(G){return _(G)}function _(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),m):G===47?(e.consume(G),a=!0,k):G===63?(e.consume(G),s=3,r.interrupt?n:B):fs(G)?(e.consume(G),o=String.fromCharCode(G),v):t(G)}function m(G){return G===45?(e.consume(G),s=2,g):G===91?(e.consume(G),s=5,l=0,S):fs(G)?(e.consume(G),s=4,r.interrupt?n:B):t(G)}function g(G){return G===45?(e.consume(G),r.interrupt?n:B):t(G)}function S(G){const ie="CDATA[";return G===ie.charCodeAt(l++)?(e.consume(G),l===ie.length?r.interrupt?n:P:S):t(G)}function k(G){return fs(G)?(e.consume(G),o=String.fromCharCode(G),v):t(G)}function v(G){if(G===null||G===47||G===62||Sn(G)){const ie=G===47,ve=o.toLowerCase();return!ie&&!a&&rS.includes(ve)?(s=1,r.interrupt?n(G):P(G)):_Je.includes(o.toLowerCase())?(s=6,ie?(e.consume(G),b):r.interrupt?n(G):P(G)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(G):a?w(G):y(G))}return G===45||Jr(G)?(e.consume(G),o+=String.fromCharCode(G),v):t(G)}function b(G){return G===62?(e.consume(G),r.interrupt?n:P):t(G)}function w(G){return Ht(G)?(e.consume(G),w):I(G)}function y(G){return G===47?(e.consume(G),I):G===58||G===95||fs(G)?(e.consume(G),C):Ht(G)?(e.consume(G),y):I(G)}function C(G){return G===45||G===46||G===58||G===95||Jr(G)?(e.consume(G),C):z(G)}function z(G){return G===61?(e.consume(G),N):Ht(G)?(e.consume(G),z):y(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?t(G):G===34||G===39?(e.consume(G),c=G,T):Ht(G)?(e.consume(G),N):j(G)}function T(G){return G===c?(e.consume(G),c=null,D):G===null||it(G)?t(G):(e.consume(G),T)}function j(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Sn(G)?z(G):(e.consume(G),j)}function D(G){return G===47||G===62||Ht(G)?y(G):t(G)}function I(G){return G===62?(e.consume(G),L):t(G)}function L(G){return G===null||it(G)?P(G):Ht(G)?(e.consume(G),L):t(G)}function P(G){return G===45&&s===2?(e.consume(G),X):G===60&&s===1?(e.consume(G),J):G===62&&s===4?(e.consume(G),H):G===63&&s===3?(e.consume(G),B):G===93&&s===5?(e.consume(G),$):it(G)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(mJe,K,q)(G)):G===null||it(G)?(e.exit("htmlFlowData"),q(G)):(e.consume(G),P)}function q(G){return e.check(gJe,W,K)(G)}function W(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),Z}function Z(G){return G===null||it(G)?q(G):(e.enter("htmlFlowData"),P(G))}function X(G){return G===45?(e.consume(G),B):P(G)}function J(G){return G===47?(e.consume(G),o="",ee):P(G)}function ee(G){if(G===62){const ie=o.toLowerCase();return rS.includes(ie)?(e.consume(G),H):P(G)}return fs(G)&&o.length<8?(e.consume(G),o+=String.fromCharCode(G),ee):P(G)}function $(G){return G===93?(e.consume(G),B):P(G)}function B(G){return G===62?(e.consume(G),H):G===45&&s===2?(e.consume(G),B):P(G)}function H(G){return G===null||it(G)?(e.exit("htmlFlowData"),K(G)):(e.consume(G),H)}function K(G){return e.exit("htmlFlow"),n(G)}}function xJe(e,n,t){const r=this;return s;function s(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):t(o)}function a(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function yJe(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Qh,n,t)}}const wJe={name:"htmlText",tokenize:SJe};function SJe(e,n,t){const r=this;let s,a,o;return l;function l(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),c}function c(B){return B===33?(e.consume(B),f):B===47?(e.consume(B),z):B===63?(e.consume(B),y):fs(B)?(e.consume(B),j):t(B)}function f(B){return B===45?(e.consume(B),_):B===91?(e.consume(B),a=0,S):fs(B)?(e.consume(B),w):t(B)}function _(B){return B===45?(e.consume(B),g):t(B)}function d(B){return B===null?t(B):B===45?(e.consume(B),m):it(B)?(o=d,J(B)):(e.consume(B),d)}function m(B){return B===45?(e.consume(B),g):d(B)}function g(B){return B===62?X(B):B===45?m(B):d(B)}function S(B){const H="CDATA[";return B===H.charCodeAt(a++)?(e.consume(B),a===H.length?k:S):t(B)}function k(B){return B===null?t(B):B===93?(e.consume(B),v):it(B)?(o=k,J(B)):(e.consume(B),k)}function v(B){return B===93?(e.consume(B),b):k(B)}function b(B){return B===62?X(B):B===93?(e.consume(B),b):k(B)}function w(B){return B===null||B===62?X(B):it(B)?(o=w,J(B)):(e.consume(B),w)}function y(B){return B===null?t(B):B===63?(e.consume(B),C):it(B)?(o=y,J(B)):(e.consume(B),y)}function C(B){return B===62?X(B):y(B)}function z(B){return fs(B)?(e.consume(B),N):t(B)}function N(B){return B===45||Jr(B)?(e.consume(B),N):T(B)}function T(B){return it(B)?(o=T,J(B)):Ht(B)?(e.consume(B),T):X(B)}function j(B){return B===45||Jr(B)?(e.consume(B),j):B===47||B===62||Sn(B)?D(B):t(B)}function D(B){return B===47?(e.consume(B),X):B===58||B===95||fs(B)?(e.consume(B),I):it(B)?(o=D,J(B)):Ht(B)?(e.consume(B),D):X(B)}function I(B){return B===45||B===46||B===58||B===95||Jr(B)?(e.consume(B),I):L(B)}function L(B){return B===61?(e.consume(B),P):it(B)?(o=L,J(B)):Ht(B)?(e.consume(B),L):D(B)}function P(B){return B===null||B===60||B===61||B===62||B===96?t(B):B===34||B===39?(e.consume(B),s=B,q):it(B)?(o=P,J(B)):Ht(B)?(e.consume(B),P):(e.consume(B),W)}function q(B){return B===s?(e.consume(B),s=void 0,Z):B===null?t(B):it(B)?(o=q,J(B)):(e.consume(B),q)}function W(B){return B===null||B===34||B===39||B===60||B===61||B===96?t(B):B===47||B===62||Sn(B)?D(B):(e.consume(B),W)}function Z(B){return B===47||B===62||Sn(B)?D(B):t(B)}function X(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),n):t(B)}function J(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),ee}function ee(B){return Ht(B)?Lt(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):$(B)}function $(B){return e.enter("htmlTextData"),o(B)}}const mx={name:"labelEnd",resolveAll:NJe,resolveTo:zJe,tokenize:AJe},kJe={tokenize:jJe},CJe={tokenize:TJe},EJe={tokenize:MJe};function NJe(e){let n=-1;const t=[];for(;++n=3&&(f===null||it(f))?(e.exit("thematicBreak"),n(f)):t(f)}function c(f){return f===s?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Ht(f)?Lt(e,l,"whitespace")(f):l(f))}}const Cs={continuation:{tokenize:PJe},exit:qJe,name:"list",tokenize:FJe},$Je={partial:!0,tokenize:GJe},HJe={partial:!0,tokenize:UJe};function FJe(e,n,t){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(g){const S=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ov(g)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(n0,t,f)(g):f(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return t(g)}function c(g){return ov(g)&&++o<10?(e.consume(g),c):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):t(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Qh,r.interrupt?t:_,e.attempt($Je,m,d))}function _(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function d(g){return Ht(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):t(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(g)}}function PJe(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Qh,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Lt(e,n,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Ht(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(HJe,n,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Lt(e,e.attempt(Cs,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function UJe(e,n,t){const r=this;return Lt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(a):t(a)}}function qJe(e){e.exit(this.containerState.type)}function GJe(e,n,t){const r=this;return Lt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!Ht(a)&&o&&o[1].type==="listItemPrefixWhitespace"?n(a):t(a)}}const sS={name:"setextUnderline",resolveTo:VJe,tokenize:WJe};function VJe(e,n){let t=e.length,r,s,a;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),!a&&e[t][1].type==="definition"&&(a=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,n]),e.splice(a+1,0,["exit",e[r][1],n]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function WJe(e,n,t){const r=this;let s;return a;function a(f){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=f,o(f)):t(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===s?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Ht(f)?Lt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||it(f)?(e.exit("setextHeadingLine"),n(f)):t(f)}}const KJe={tokenize:XJe};function XJe(e){const n=this,t=e.attempt(Qh,r,e.attempt(this.parser.constructs.flowInitial,s,Lt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(eJe,s)),"linePrefix")));return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const YJe={resolveAll:oN()},ZJe=aN("string"),QJe=aN("text");function aN(e){return{resolveAll:oN(e==="text"?JJe:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],a=t.attempt(s,o,l);return o;function o(_){return f(_)?a(_):l(_)}function l(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),c}function c(_){return f(_)?(t.exit("data"),a(_)):(t.consume(_),c)}function f(_){if(_===null)return!0;const d=s[_];let m=-1;if(d)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function det(e,n){let t=-1;const r=[];let s;for(;++t0){const Dt=Ge.tokenStack[Ge.tokenStack.length-1];(Dt[1]||sS).call(Ge,void 0,Dt[0])}for(Le.position={start:Vo(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Vo(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st0&&($r(this,Jo,Dn(this,Jo)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=iS(t)),Dn(this,Jo)+ZJe(t,r)}}Jo=new WeakMap;const HJe=new Set(["*","**","_","__"]);function iS(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const Mt=qe.tokenStack[qe.tokenStack.length-1];(Mt[1]||aS).call(qe,void 0,Mt[0])}for(Le.position={start:Vo(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Vo(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at0&&(Ur(this,Jo,In(this,Jo)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=oS(t)),In(this,Jo)+Oet(t,r)}}Jo=new WeakMap;const Cet=new Set(["*","**","_","__"]);function oS(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(YJe(n)){aS(n,t,r);continue}const a=GJe(n,e,t);if(a>t){t=a-1;continue}const o=VJe(n,e,t);if(o>t){t=o-1;continue}Fi(e,t)||aS(n,t,r)}return n}function PJe(e,n,t){const r=n[t];return r==="`"?FJe(e,n,t):r==="$"?UJe(e,n,t):r==="~"?qJe(e,n,t):t}function FJe(e,n,t){const r=mx(n,t),s="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&j0(n,t)&&!Fi(n,t)&&r>=a.token.length&&(e.exclusive=null),t+r):(a==null?void 0:a.kind)==="code"?(!Fi(n,t)&&r>=a.token.length&&(e.exclusive=null),t+r):a||Fi(n,t)?t+r:r>=3&&j0(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function UJe(e,n,t){const r=mx(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!Fi(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||Fi(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function qJe(e,n,t){const r=mx(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(j0(n,t)&&!Fi(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!j0(n,t)||Fi(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function GJe(e,n,t){if(n[t]!=="<"||Fi(n,t))return t;const r=n[t+1];if(r!==void 0&&!cN(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function VJe(e,n,t){const r=WJe(n,t);if(!r)return t;if(Fi(n,t))return t+r.length;const s=e.delims.findLastIndex(a=>a.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):(KJe(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function WJe(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 KJe(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!cS(s)||!cS(r)}function aS(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 XJe(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 YJe(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function ZJe(e,n){n.pendingHtml!==null&&(e=e.slice(0,eet(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return ca(QJe(e,t));const r=JJe(n);if(r)return ca(ou(e,r));const s=ret(n);return s?s.kind==="delim"?ca(_v(e,s.start,s.token.length)?oN(e,s.token):e.slice(0,s.start)):_v(e,s.start,s.token.length)?s.kind==="fence"?ca(e):s.kind==="code"?ca(ou(e,s.token)):s.token==="$$"?ca(ou(e,(e.endsWith(` +`){Det(n),n.exclusive||(n.commitIndex=t+1);continue}const s=Eet(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(Let(n)){lS(n,t,r);continue}const a=jet(n,e,t);if(a>t){t=a-1;continue}const o=Tet(n,e,t);if(o>t){t=o-1;continue}Ui(e,t)||lS(n,t,r)}return n}function Eet(e,n,t){const r=n[t];return r==="`"?Net(e,n,t):r==="$"?zet(e,n,t):r==="~"?Aet(e,n,t):t}function Net(e,n,t){const r=bx(n,t),s="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&T0(n,t)&&!Ui(n,t)&&r>=a.token.length&&(e.exclusive=null),t+r):(a==null?void 0:a.kind)==="code"?(!Ui(n,t)&&r>=a.token.length&&(e.exclusive=null),t+r):a||Ui(n,t)?t+r:r>=3&&T0(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function zet(e,n,t){const r=bx(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!Ui(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||Ui(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function Aet(e,n,t){const r=bx(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(T0(n,t)&&!Ui(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!T0(n,t)||Ui(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function jet(e,n,t){if(n[t]!=="<"||Ui(n,t))return t;const r=n[t+1];if(r!==void 0&&!hN(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function Tet(e,n,t){const r=Met(n,t);if(!r)return t;if(Ui(n,t))return t+r.length;const s=e.delims.findLastIndex(a=>a.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):(Ret(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Met(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 Ret(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!fS(s)||!fS(r)}function lS(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 Det(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 Let(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function Oet(e,n){n.pendingHtml!==null&&(e=e.slice(0,$et(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return ca(Iet(e,t));const r=Bet(n);if(r)return ca(ou(e,r));const s=Pet(n);return s?s.kind==="delim"?ca(mv(e,s.start,s.token.length)?uN(e,s.token):e.slice(0,s.start)):mv(e,s.start,s.token.length)?s.kind==="fence"?ca(e):s.kind==="code"?ca(ou(e,s.token)):s.token==="$$"?ca(ou(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?ca(e):ca(ou(e,"$")):ca(s.kind==="fence"?e:e.slice(0,s.start)):ca(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function QJe(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return _v(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 JJe(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(!HJe.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function eet(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!tet(e,s,r))break;t=s,r=s}return t}function tet(e,n,t){if(e[t-1]!==">"||Fi(e,n))return!1;const r=e[n+1];if(r!==void 0&&!cN(r))return!1;for(let s=n+1;s"||a===` +`)+"$$")):/\s/.test(e[e.length-1]??"")?ca(e):ca(ou(e,"$")):ca(s.kind==="fence"?e:e.slice(0,s.start)):ca(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function Iet(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return mv(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 Bet(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(!Cet.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function $et(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!Het(e,s,r))break;t=s,r=s}return t}function Het(e,n,t){if(e[t-1]!==">"||Ui(e,n))return!1;const r=e[n+1];if(r!==void 0&&!hN(r))return!1;for(let s=n+1;s"||a===` `)return!1}return!0}function ca(e){var v;const n=e.lastIndexOf(` `),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),a=s.indexOf(` -`),o=a===-1?s:s.slice(0,a),l=(v=o.match(/^( *)\|/))==null?void 0:v[1];if(l===void 0)return e;if(oS(o)<2&&!set(o,l))return r;const c=o.trimEnd().endsWith("|")?o:oN(o," |"),f=oS(c),_=f<2?0:c.trimEnd().endsWith("|")?f-1:f;if(_===0)return e;const h=a===-1?"":s.slice(a+1),m=lS(l,Array.from({length:_},()=>"-"));if(h.length===0)return r+c+` -`+m;const g=h.indexOf(` -`),S=g===-1?h:h.slice(0,g),k=g===-1?"":h.slice(g);if(iet(S,l,_))return e;if(S.startsWith(l+"|")&&/^[ |:\-\t]*$/.test(S.slice(l.length))){const b=lN(S,l).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let z=0;z1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+c+` -`+lS(l,b)+k}return r+c+` +`),o=a===-1?s:s.slice(0,a),l=(v=o.match(/^( *)\|/))==null?void 0:v[1];if(l===void 0)return e;if(cS(o)<2&&!Uet(o,l))return r;const c=o.trimEnd().endsWith("|")?o:uN(o," |"),f=cS(c),_=f<2?0:c.trimEnd().endsWith("|")?f-1:f;if(_===0)return e;const d=a===-1?"":s.slice(a+1),m=uS(l,Array.from({length:_},()=>"-"));if(d.length===0)return r+c+` +`+m;const g=d.indexOf(` +`),S=g===-1?d:d.slice(0,g),k=g===-1?"":d.slice(g);if(qet(S,l,_))return e;if(S.startsWith(l+"|")&&/^[ |:\-\t]*$/.test(S.slice(l.length))){const b=fN(S,l).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let z=0;z1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+c+` +`+uS(l,b)+k}return r+c+` `+m+` -`+h}function ou(e,n){return e+n.slice(net(e,n))}function oN(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ou(e,n);const r=e.slice(0,-t.length);return ou(r,n)+t}function net(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 ret(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 oS(e){let n=0;for(let t=0;t0}function lS(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function lN(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function iet(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=lN(r,"").map(a=>a.trim());return s.length===t&&s.every(a=>/^:?-+:?$/.test(a))}function mx(e,n){let t=n+1;for(;tn+t}function j0(e,n){return n===0||e[n-1]===` -`}function Fi(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function cS(e){return!!e&&/[A-Za-z0-9]/.test(e)}function cN(e){return!!e&&/[A-Za-z]/.test(e)}const uN=lx().use(px);var $d,vu,xu,Vl,yu,Hd,Pd,Fd,Wl,Ud,Kl;class aet{constructor(){Ps(this,$d,uN);Ps(this,vu,null);Ps(this,xu,{});Ps(this,Vl,null);Ps(this,yu,"");Ps(this,Hd,[]);Ps(this,Pd,[]);Ps(this,Fd,[]);Ps(this,Wl,0);Ps(this,Ud,[]);Ps(this,Kl,[])}reconfigure(n,t,r){Dn(this,vu)!==null&&Dn(this,$d)===n&&fN(Dn(this,xu),r)&&!!Dn(this,Vl)===t||($r(this,$d,n),n.attachers.some(s=>s[0]===A0)||(n=n(),n.use(A0),n.freeze()),$r(this,vu,n),$r(this,xu,r),$r(this,yu,""),$r(this,Hd,[]),$r(this,Pd,[]),$r(this,Fd,[]),$r(this,Wl,0),$r(this,Ud,[]),$r(this,Vl,t?new $Je:null))}update(n){Dn(this,Vl)&&(n=Dn(this,Vl).update(n));let t=Dn(this,yu);if(n===t)return Dn(this,Kl);const r=Dn(this,Hd),s=oet(n,t);let a=r.length-1;for(;a>=0&&!(s>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=Dl(Dn(this,vu)),c=Dn(this,Pd),f=c.slice(a).some(N=>N.some(pv));let _=l.parse(n.slice(o)),h=_.children.map(N=>Dl(Dl(N.position).start.offset)+o);$r(this,yu,n),C1(r.length===c.length),r.splice(a,r.length-a,...h);{const N=B1(_,h,o);C1(N.length===h.length),c.splice(a,c.length-a,...N)}if(f||pv(_)){a=0,o=0,_=l.parse(n),h=_.children.map(T=>Dl(Dl(T.position).start.offset)+o),r.splice(0,r.length,...h);const N=B1(_,h,o);C1(N.length===h.length),c.splice(0,c.length,...N)}const m=B1(l.runSync(_),h,o),g=Dn(this,Fd),S=Dn(this,Ud),k=Dn(this,Kl),v=S.length;let b=null,w=0;for(;wv&&(g.length=S.length=r.length);for(let N=r.length=C?D=v-(r.length-T):T=v){g[T]=String(Dn(this,Wl)),$r(this,Wl,Dn(this,Wl)+1),S[T]=null,b&&(b[T]=void 0);continue}g[T]=g[D]??String(zw(this,Wl)._++),S[T]=S[D]??null,b&&(b[T]=k[D])}r.length[]);let s=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||pet.test(e.slice(0,n))?e:""}const hS=/[#.]/g;function yet(e,n){const t=e||"",r={};let s=0,a,o;for(;sf&&(f=_):_&&(f!==void 0&&f>-1&&c.push(` -`.repeat(f)||" "),f=-1,c.push(_))}return c.join("")}function bN(e,n,t){return e.type==="element"?qet(e,n,t):e.type==="text"?t.whitespace==="normal"?vN(e,t):Get(e):[]}function qet(e,n,t){const r=xN(e,t),s=e.children||[];let a=-1,o=[];if(Fet(e))return o;let l,c;for(gv(e)||xS(e)&&mS(n,e,xS)?c=` -`:Pet(e)?(l=2,c=2):gN(e)&&(l=1,c=1);++a15?f="…"+l.slice(s-15,s):f=l.slice(0,s);var _;a+15e.replace(Yet,"-$1").toLowerCase(),Qet={"&":"&",">":">","<":"<",'"':""","'":"'"},Jet=/[&><"']/g,Yr=e=>String(e).replace(Jet,n=>Qet[n]),n0=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?n0(e.body[0]):e:e.type==="font"?n0(e.body):e,ett=new Set(["mathord","textord","atom"]),co=e=>ett.has(n0(e).type),ttt=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"},bv={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 ntt(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 rtt(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return ntt(n)}function stt(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:rtt(r)}class bx{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(bv)){var r=bv[t];r&&stt(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 Ue("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=ttt(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class Wo{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 ha[itt[this.id]]}sub(){return ha[att[this.id]]}fracNum(){return ha[ott[this.id]]}fracDen(){return ha[ltt[this.id]]}cramp(){return ha[ctt[this.id]]}text(){return ha[utt[this.id]]}isTight(){return this.size>=2}}var vx=0,T0=1,hu=2,to=3,gd=4,yi=5,Eu=6,as=7,ha=[new Wo(vx,0,!1),new Wo(T0,0,!0),new Wo(hu,1,!1),new Wo(to,1,!0),new Wo(gd,2,!1),new Wo(yi,2,!0),new Wo(Eu,3,!1),new Wo(as,3,!0)],itt=[gd,yi,gd,yi,Eu,as,Eu,as],att=[yi,yi,yi,yi,as,as,as,as],ott=[hu,to,gd,yi,Eu,as,Eu,as],ltt=[to,to,yi,yi,as,as,as,as],ctt=[T0,T0,to,to,yi,yi,as,as],utt=[vx,T0,hu,to,hu,to,hu,to],wt={DISPLAY:ha[vx],TEXT:ha[hu],SCRIPT:ha[gd],SCRIPTSCRIPT:ha[Eu]},vv=[{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 ftt(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var r0=[];vv.forEach(e=>e.blocks.forEach(n=>r0.push(...n)));function yN(e){for(var n=0;n=r0[n]&&e<=r0[n+1])return!0;return!1}var Sr=e=>e+" "+e,Kc=80,dtt=function(n,t){return"M95,"+(622+n+t)+` +`+d}function ou(e,n){return e+n.slice(Fet(e,n))}function uN(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ou(e,n);const r=e.slice(0,-t.length);return ou(r,n)+t}function Fet(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 Pet(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 cS(e){let n=0;for(let t=0;t0}function uS(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function fN(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function qet(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=fN(r,"").map(a=>a.trim());return s.length===t&&s.every(a=>/^:?-+:?$/.test(a))}function bx(e,n){let t=n+1;for(;tn+t}function T0(e,n){return n===0||e[n-1]===` +`}function Ui(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function fS(e){return!!e&&/[A-Za-z0-9]/.test(e)}function hN(e){return!!e&&/[A-Za-z]/.test(e)}const dN=ux().use(gx);var $h,vu,xu,Vl,yu,Hh,Fh,Ph,Wl,Uh,Kl;class Get{constructor(){qs(this,$h,dN);qs(this,vu,null);qs(this,xu,{});qs(this,Vl,null);qs(this,yu,"");qs(this,Hh,[]);qs(this,Fh,[]);qs(this,Ph,[]);qs(this,Wl,0);qs(this,Uh,[]);qs(this,Kl,[])}reconfigure(n,t,r){In(this,vu)!==null&&In(this,$h)===n&&_N(In(this,xu),r)&&!!In(this,Vl)===t||(Ur(this,$h,n),n.attachers.some(s=>s[0]===j0)||(n=n(),n.use(j0),n.freeze()),Ur(this,vu,n),Ur(this,xu,r),Ur(this,yu,""),Ur(this,Hh,[]),Ur(this,Fh,[]),Ur(this,Ph,[]),Ur(this,Wl,0),Ur(this,Uh,[]),Ur(this,Vl,t?new ket:null))}update(n){In(this,Vl)&&(n=In(this,Vl).update(n));let t=In(this,yu);if(n===t)return In(this,Kl);const r=In(this,Hh),s=Vet(n,t);let a=r.length-1;for(;a>=0&&!(s>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=Dl(In(this,vu)),c=In(this,Fh),f=c.slice(a).some(N=>N.some(gv));let _=l.parse(n.slice(o)),d=_.children.map(N=>Dl(Dl(N.position).start.offset)+o);Ur(this,yu,n),z1(r.length===c.length),r.splice(a,r.length-a,...d);{const N=F1(_,d,o);z1(N.length===d.length),c.splice(a,c.length-a,...N)}if(f||gv(_)){a=0,o=0,_=l.parse(n),d=_.children.map(T=>Dl(Dl(T.position).start.offset)+o),r.splice(0,r.length,...d);const N=F1(_,d,o);z1(N.length===d.length),c.splice(0,c.length,...N)}const m=F1(l.runSync(_),d,o),g=In(this,Ph),S=In(this,Uh),k=In(this,Kl),v=S.length;let b=null,w=0;for(;wv&&(g.length=S.length=r.length);for(let N=r.length=C?D=v-(r.length-T):T=v){g[T]=String(In(this,Wl)),Ur(this,Wl,In(this,Wl)+1),S[T]=null,b&&(b[T]=void 0);continue}g[T]=g[D]??String(jw(this,Wl)._++),S[T]=S[D]??null,b&&(b[T]=k[D])}r.length[]);let s=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||Jet.test(e.slice(0,n))?e:""}const pS=/[#.]/g;function itt(e,n){const t=e||"",r={};let s=0,a,o;for(;sf&&(f=_):_&&(f!==void 0&&f>-1&&c.push(` +`.repeat(f)||" "),f=-1,c.push(_))}return c.join("")}function yN(e,n,t){return e.type==="element"?Ntt(e,n,t):e.type==="text"?t.whitespace==="normal"?wN(e,t):ztt(e):[]}function Ntt(e,n,t){const r=SN(e,t),s=e.children||[];let a=-1,o=[];if(Ctt(e))return o;let l,c;for(vv(e)||wS(e)&&bS(n,e,wS)?c=` +`:ktt(e)?(l=2,c=2):xN(e)&&(l=1,c=1);++a15?f="…"+l.slice(s-15,s):f=l.slice(0,s);var _;a+15e.replace(Rtt,"-$1").toLowerCase(),Ltt={"&":"&",">":">","<":"<",'"':""","'":"'"},Ott=/[&><"']/g,ts=e=>String(e).replace(Ott,n=>Ltt[n]),r0=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?r0(e.body[0]):e:e.type==="font"?r0(e.body):e,Itt=new Set(["mathord","textord","atom"]),co=e=>Itt.has(r0(e).type),Btt=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"},xv={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 $tt(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 Htt(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return $tt(n)}function Ftt(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Htt(r)}class xx{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(xv)){var r=xv[t];r&&Ftt(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 Pe("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=Btt(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class Wo{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 da[Ptt[this.id]]}sub(){return da[Utt[this.id]]}fracNum(){return da[qtt[this.id]]}fracDen(){return da[Gtt[this.id]]}cramp(){return da[Vtt[this.id]]}text(){return da[Wtt[this.id]]}isTight(){return this.size>=2}}var yx=0,M0=1,du=2,to=3,gh=4,wi=5,Eu=6,hs=7,da=[new Wo(yx,0,!1),new Wo(M0,0,!0),new Wo(du,1,!1),new Wo(to,1,!0),new Wo(gh,2,!1),new Wo(wi,2,!0),new Wo(Eu,3,!1),new Wo(hs,3,!0)],Ptt=[gh,wi,gh,wi,Eu,hs,Eu,hs],Utt=[wi,wi,wi,wi,hs,hs,hs,hs],qtt=[du,to,gh,wi,Eu,hs,Eu,hs],Gtt=[to,to,wi,wi,hs,hs,hs,hs],Vtt=[M0,M0,to,to,wi,wi,hs,hs],Wtt=[yx,M0,du,to,du,to,du,to],St={DISPLAY:da[yx],TEXT:da[du],SCRIPT:da[gh],SCRIPTSCRIPT:da[Eu]},yv=[{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 Ktt(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var s0=[];yv.forEach(e=>e.blocks.forEach(n=>s0.push(...n)));function kN(e){for(var n=0;n=s0[n]&&e<=s0[n+1])return!0;return!1}var Er=e=>e+" "+e,Kc=80,Xtt=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 @@ -646,7 +646,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"},htt=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"},Ytt=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+` @@ -656,7 +656,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"},_tt=function(n,t){return"M983 "+(10+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},Ztt=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 @@ -665,7 +665,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"},ptt=function(n,t){return"M424,"+(2398+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},Qtt=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 @@ -675,18 +675,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"},mtt=function(n,t){return"M473,"+(2713+n+t)+` +h400000v`+(40+n)+"h-400000z"},Jtt=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"},gtt=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},btt=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"},ent=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},tnt=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"},vtt=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=dtt(t,Kc);break;case"sqrtSize1":s=htt(t,Kc);break;case"sqrtSize2":s=_tt(t,Kc);break;case"sqrtSize3":s=ptt(t,Kc);break;case"sqrtSize4":s=mtt(t,Kc);break;case"sqrtTall":s=btt(t,Kc,r)}return s},xtt=function(n,t){switch(n){case"⎜":return Sr("M291 0 H417 V"+t+" H291z");case"∣":return Sr("M145 0 H188 V"+t+" H145z");case"∥":return Sr("M145 0 H188 V"+t+" H145z")+Sr("M367 0 H410 V"+t+" H367z");case"⎟":return Sr("M457 0 H583 V"+t+" H457z");case"⎢":return Sr("M319 0 H403 V"+t+" H319z");case"⎥":return Sr("M263 0 H347 V"+t+" H263z");case"⎪":return Sr("M384 0 H504 V"+t+" H384z");case"⏐":return Sr("M312 0 H355 V"+t+" H312z");case"‖":return Sr("M257 0 H300 V"+t+" H257z")+Sr("M478 0 H521 V"+t+" H478z");default:return""}},yS={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},nnt=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=Xtt(t,Kc);break;case"sqrtSize1":s=Ytt(t,Kc);break;case"sqrtSize2":s=Ztt(t,Kc);break;case"sqrtSize3":s=Qtt(t,Kc);break;case"sqrtSize4":s=Jtt(t,Kc);break;case"sqrtTall":s=tnt(t,Kc,r)}return s},rnt=function(n,t){switch(n){case"⎜":return Er("M291 0 H417 V"+t+" H291z");case"∣":return Er("M145 0 H188 V"+t+" H145z");case"∥":return Er("M145 0 H188 V"+t+" H145z")+Er("M367 0 H410 V"+t+" H367z");case"⎟":return Er("M457 0 H583 V"+t+" H457z");case"⎢":return Er("M319 0 H403 V"+t+" H319z");case"⎥":return Er("M263 0 H347 V"+t+" H263z");case"⎪":return Er("M384 0 H504 V"+t+" H384z");case"⏐":return Er("M312 0 H355 V"+t+" H312z");case"‖":return Er("M257 0 H300 V"+t+" H257z")+Er("M478 0 H521 V"+t+" H478z");default:return""}},SS={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 @@ -732,10 +732,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:Sr("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Sr("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Sr("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Sr("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Er("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Er("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Er("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Er("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:Sr("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Er("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 @@ -784,7 +784,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:Sr("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Sr("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Sr("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:Er("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Er("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Er("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 @@ -857,7 +857,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`},ytt=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`},snt=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 @@ -885,74 +885,74 @@ 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 wtt(e){return"toText"in e}class Pu{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(wtt(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var xv={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},Stt={ex:!0,em:!0,mu:!0},wN=function(n){return typeof n!="string"&&(n=n.unit),n in xv||n in Stt||n==="ex"},Un=function(n,t){var r;if(n.unit in xv)r=xv[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 Ue("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},Ve=function(n){return+n.toFixed(4)+"em"},nl=function(n){return n.filter(t=>t).join(" ")},xx=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=Zet(r)+":"+s+";")}return t},SN=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)}},kN=function(n){var t=document.createElement(n);t.className=nl(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]/,CN=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Yr(nl(this.classes))+'"');var r=xx(this.style);r&&(t+=' style="'+Yr(r)+'"');for(var s of Object.keys(this.attributes)){if(ktt.test(s))throw new Ue("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Yr(this.attributes[s])+'"'}t+=">";for(var a=0;a",t};class Fu{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,SN.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return kN.call(this,"span")}toMarkup(){return CN.call(this,"span")}}class bp{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,SN.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 kN.call(this,"a")}toMarkup(){return CN.call(this,"a")}}class Ctt{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=''+Yr(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=Ve(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=nl(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:"+Ve(this.italic)+";"),r+=xx(this.style),r&&(n=!0,t+=' style="'+Yr(r)+'"');var s=Yr(this.text);return n?(t+=">",t+=s,t+="",t):s}}class io{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 yv{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 Att=e=>e instanceof Fu||e instanceof bp||e instanceof Pu,pa={"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]}},k_={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]},wS={Å:"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 jtt(e,n){pa[e]=n}function yx(e,n,t){if(!pa[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=pa[n][r];if(!s&&e[0]in wS&&(r=wS[e[0]].charCodeAt(0),s=pa[n][r]),!s&&t==="text"&&yN(r)&&(s=pa[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var P1={};function Ttt(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!P1[n]){var t=P1[n]={cssEmPerMu:k_.quad[n]/18};for(var r in k_)k_.hasOwnProperty(r)&&(t[r]=k_[r][n])}return P1[n]}var Ln={math:{},text:{}};function O(e,n,t,r,s,a){Ln[e][s]={font:n,group:t,replace:r},a&&r&&(Ln[e][r]=Ln[e][s])}var F="math",$e="text",Q="main",le="ams",In="accent-token",Je="bin",ls="close",Uu="inner",dt="mathord",mr="op-token",Qs="open",Jd="punct",fe="rel",uo="spacing",pe="textord";O(F,Q,fe,"≡","\\equiv",!0);O(F,Q,fe,"≺","\\prec",!0);O(F,Q,fe,"≻","\\succ",!0);O(F,Q,fe,"∼","\\sim",!0);O(F,Q,fe,"⊥","\\perp");O(F,Q,fe,"⪯","\\preceq",!0);O(F,Q,fe,"⪰","\\succeq",!0);O(F,Q,fe,"≃","\\simeq",!0);O(F,Q,fe,"∣","\\mid",!0);O(F,Q,fe,"≪","\\ll",!0);O(F,Q,fe,"≫","\\gg",!0);O(F,Q,fe,"≍","\\asymp",!0);O(F,Q,fe,"∥","\\parallel");O(F,Q,fe,"⋈","\\bowtie",!0);O(F,Q,fe,"⌣","\\smile",!0);O(F,Q,fe,"⊑","\\sqsubseteq",!0);O(F,Q,fe,"⊒","\\sqsupseteq",!0);O(F,Q,fe,"≐","\\doteq",!0);O(F,Q,fe,"⌢","\\frown",!0);O(F,Q,fe,"∋","\\ni",!0);O(F,Q,fe,"∝","\\propto",!0);O(F,Q,fe,"⊢","\\vdash",!0);O(F,Q,fe,"⊣","\\dashv",!0);O(F,Q,fe,"∋","\\owns");O(F,Q,Jd,".","\\ldotp");O(F,Q,Jd,"⋅","\\cdotp");O(F,Q,Jd,"⋅","·");O($e,Q,pe,"⋅","·");O(F,Q,pe,"#","\\#");O($e,Q,pe,"#","\\#");O(F,Q,pe,"&","\\&");O($e,Q,pe,"&","\\&");O(F,Q,pe,"ℵ","\\aleph",!0);O(F,Q,pe,"∀","\\forall",!0);O(F,Q,pe,"ℏ","\\hbar",!0);O(F,Q,pe,"∃","\\exists",!0);O(F,Q,pe,"∇","\\nabla",!0);O(F,Q,pe,"♭","\\flat",!0);O(F,Q,pe,"ℓ","\\ell",!0);O(F,Q,pe,"♮","\\natural",!0);O(F,Q,pe,"♣","\\clubsuit",!0);O(F,Q,pe,"℘","\\wp",!0);O(F,Q,pe,"♯","\\sharp",!0);O(F,Q,pe,"♢","\\diamondsuit",!0);O(F,Q,pe,"ℜ","\\Re",!0);O(F,Q,pe,"♡","\\heartsuit",!0);O(F,Q,pe,"ℑ","\\Im",!0);O(F,Q,pe,"♠","\\spadesuit",!0);O(F,Q,pe,"§","\\S",!0);O($e,Q,pe,"§","\\S");O(F,Q,pe,"¶","\\P",!0);O($e,Q,pe,"¶","\\P");O(F,Q,pe,"†","\\dag");O($e,Q,pe,"†","\\dag");O($e,Q,pe,"†","\\textdagger");O(F,Q,pe,"‡","\\ddag");O($e,Q,pe,"‡","\\ddag");O($e,Q,pe,"‡","\\textdaggerdbl");O(F,Q,ls,"⎱","\\rmoustache",!0);O(F,Q,Qs,"⎰","\\lmoustache",!0);O(F,Q,ls,"⟯","\\rgroup",!0);O(F,Q,Qs,"⟮","\\lgroup",!0);O(F,Q,Je,"∓","\\mp",!0);O(F,Q,Je,"⊖","\\ominus",!0);O(F,Q,Je,"⊎","\\uplus",!0);O(F,Q,Je,"⊓","\\sqcap",!0);O(F,Q,Je,"∗","\\ast");O(F,Q,Je,"⊔","\\sqcup",!0);O(F,Q,Je,"◯","\\bigcirc",!0);O(F,Q,Je,"∙","\\bullet",!0);O(F,Q,Je,"‡","\\ddagger");O(F,Q,Je,"≀","\\wr",!0);O(F,Q,Je,"⨿","\\amalg");O(F,Q,Je,"&","\\And");O(F,Q,fe,"⟵","\\longleftarrow",!0);O(F,Q,fe,"⇐","\\Leftarrow",!0);O(F,Q,fe,"⟸","\\Longleftarrow",!0);O(F,Q,fe,"⟶","\\longrightarrow",!0);O(F,Q,fe,"⇒","\\Rightarrow",!0);O(F,Q,fe,"⟹","\\Longrightarrow",!0);O(F,Q,fe,"↔","\\leftrightarrow",!0);O(F,Q,fe,"⟷","\\longleftrightarrow",!0);O(F,Q,fe,"⇔","\\Leftrightarrow",!0);O(F,Q,fe,"⟺","\\Longleftrightarrow",!0);O(F,Q,fe,"↦","\\mapsto",!0);O(F,Q,fe,"⟼","\\longmapsto",!0);O(F,Q,fe,"↗","\\nearrow",!0);O(F,Q,fe,"↩","\\hookleftarrow",!0);O(F,Q,fe,"↪","\\hookrightarrow",!0);O(F,Q,fe,"↘","\\searrow",!0);O(F,Q,fe,"↼","\\leftharpoonup",!0);O(F,Q,fe,"⇀","\\rightharpoonup",!0);O(F,Q,fe,"↙","\\swarrow",!0);O(F,Q,fe,"↽","\\leftharpoondown",!0);O(F,Q,fe,"⇁","\\rightharpoondown",!0);O(F,Q,fe,"↖","\\nwarrow",!0);O(F,Q,fe,"⇌","\\rightleftharpoons",!0);O(F,le,fe,"≮","\\nless",!0);O(F,le,fe,"","\\@nleqslant");O(F,le,fe,"","\\@nleqq");O(F,le,fe,"⪇","\\lneq",!0);O(F,le,fe,"≨","\\lneqq",!0);O(F,le,fe,"","\\@lvertneqq");O(F,le,fe,"⋦","\\lnsim",!0);O(F,le,fe,"⪉","\\lnapprox",!0);O(F,le,fe,"⊀","\\nprec",!0);O(F,le,fe,"⋠","\\npreceq",!0);O(F,le,fe,"⋨","\\precnsim",!0);O(F,le,fe,"⪹","\\precnapprox",!0);O(F,le,fe,"≁","\\nsim",!0);O(F,le,fe,"","\\@nshortmid");O(F,le,fe,"∤","\\nmid",!0);O(F,le,fe,"⊬","\\nvdash",!0);O(F,le,fe,"⊭","\\nvDash",!0);O(F,le,fe,"⋪","\\ntriangleleft");O(F,le,fe,"⋬","\\ntrianglelefteq",!0);O(F,le,fe,"⊊","\\subsetneq",!0);O(F,le,fe,"","\\@varsubsetneq");O(F,le,fe,"⫋","\\subsetneqq",!0);O(F,le,fe,"","\\@varsubsetneqq");O(F,le,fe,"≯","\\ngtr",!0);O(F,le,fe,"","\\@ngeqslant");O(F,le,fe,"","\\@ngeqq");O(F,le,fe,"⪈","\\gneq",!0);O(F,le,fe,"≩","\\gneqq",!0);O(F,le,fe,"","\\@gvertneqq");O(F,le,fe,"⋧","\\gnsim",!0);O(F,le,fe,"⪊","\\gnapprox",!0);O(F,le,fe,"⊁","\\nsucc",!0);O(F,le,fe,"⋡","\\nsucceq",!0);O(F,le,fe,"⋩","\\succnsim",!0);O(F,le,fe,"⪺","\\succnapprox",!0);O(F,le,fe,"≆","\\ncong",!0);O(F,le,fe,"","\\@nshortparallel");O(F,le,fe,"∦","\\nparallel",!0);O(F,le,fe,"⊯","\\nVDash",!0);O(F,le,fe,"⋫","\\ntriangleright");O(F,le,fe,"⋭","\\ntrianglerighteq",!0);O(F,le,fe,"","\\@nsupseteqq");O(F,le,fe,"⊋","\\supsetneq",!0);O(F,le,fe,"","\\@varsupsetneq");O(F,le,fe,"⫌","\\supsetneqq",!0);O(F,le,fe,"","\\@varsupsetneqq");O(F,le,fe,"⊮","\\nVdash",!0);O(F,le,fe,"⪵","\\precneqq",!0);O(F,le,fe,"⪶","\\succneqq",!0);O(F,le,fe,"","\\@nsubseteqq");O(F,le,Je,"⊴","\\unlhd");O(F,le,Je,"⊵","\\unrhd");O(F,le,fe,"↚","\\nleftarrow",!0);O(F,le,fe,"↛","\\nrightarrow",!0);O(F,le,fe,"⇍","\\nLeftarrow",!0);O(F,le,fe,"⇏","\\nRightarrow",!0);O(F,le,fe,"↮","\\nleftrightarrow",!0);O(F,le,fe,"⇎","\\nLeftrightarrow",!0);O(F,le,fe,"△","\\vartriangle");O(F,le,pe,"ℏ","\\hslash");O(F,le,pe,"▽","\\triangledown");O(F,le,pe,"◊","\\lozenge");O(F,le,pe,"Ⓢ","\\circledS");O(F,le,pe,"®","\\circledR");O($e,le,pe,"®","\\circledR");O(F,le,pe,"∡","\\measuredangle",!0);O(F,le,pe,"∄","\\nexists");O(F,le,pe,"℧","\\mho");O(F,le,pe,"Ⅎ","\\Finv",!0);O(F,le,pe,"⅁","\\Game",!0);O(F,le,pe,"‵","\\backprime");O(F,le,pe,"▲","\\blacktriangle");O(F,le,pe,"▼","\\blacktriangledown");O(F,le,pe,"■","\\blacksquare");O(F,le,pe,"⧫","\\blacklozenge");O(F,le,pe,"★","\\bigstar");O(F,le,pe,"∢","\\sphericalangle",!0);O(F,le,pe,"∁","\\complement",!0);O(F,le,pe,"ð","\\eth",!0);O($e,Q,pe,"ð","ð");O(F,le,pe,"╱","\\diagup");O(F,le,pe,"╲","\\diagdown");O(F,le,pe,"□","\\square");O(F,le,pe,"□","\\Box");O(F,le,pe,"◊","\\Diamond");O(F,le,pe,"¥","\\yen",!0);O($e,le,pe,"¥","\\yen",!0);O(F,le,pe,"✓","\\checkmark",!0);O($e,le,pe,"✓","\\checkmark");O(F,le,pe,"ℶ","\\beth",!0);O(F,le,pe,"ℸ","\\daleth",!0);O(F,le,pe,"ℷ","\\gimel",!0);O(F,le,pe,"ϝ","\\digamma",!0);O(F,le,pe,"ϰ","\\varkappa");O(F,le,Qs,"┌","\\@ulcorner",!0);O(F,le,ls,"┐","\\@urcorner",!0);O(F,le,Qs,"└","\\@llcorner",!0);O(F,le,ls,"┘","\\@lrcorner",!0);O(F,le,fe,"≦","\\leqq",!0);O(F,le,fe,"⩽","\\leqslant",!0);O(F,le,fe,"⪕","\\eqslantless",!0);O(F,le,fe,"≲","\\lesssim",!0);O(F,le,fe,"⪅","\\lessapprox",!0);O(F,le,fe,"≊","\\approxeq",!0);O(F,le,Je,"⋖","\\lessdot");O(F,le,fe,"⋘","\\lll",!0);O(F,le,fe,"≶","\\lessgtr",!0);O(F,le,fe,"⋚","\\lesseqgtr",!0);O(F,le,fe,"⪋","\\lesseqqgtr",!0);O(F,le,fe,"≑","\\doteqdot");O(F,le,fe,"≓","\\risingdotseq",!0);O(F,le,fe,"≒","\\fallingdotseq",!0);O(F,le,fe,"∽","\\backsim",!0);O(F,le,fe,"⋍","\\backsimeq",!0);O(F,le,fe,"⫅","\\subseteqq",!0);O(F,le,fe,"⋐","\\Subset",!0);O(F,le,fe,"⊏","\\sqsubset",!0);O(F,le,fe,"≼","\\preccurlyeq",!0);O(F,le,fe,"⋞","\\curlyeqprec",!0);O(F,le,fe,"≾","\\precsim",!0);O(F,le,fe,"⪷","\\precapprox",!0);O(F,le,fe,"⊲","\\vartriangleleft");O(F,le,fe,"⊴","\\trianglelefteq");O(F,le,fe,"⊨","\\vDash",!0);O(F,le,fe,"⊪","\\Vvdash",!0);O(F,le,fe,"⌣","\\smallsmile");O(F,le,fe,"⌢","\\smallfrown");O(F,le,fe,"≏","\\bumpeq",!0);O(F,le,fe,"≎","\\Bumpeq",!0);O(F,le,fe,"≧","\\geqq",!0);O(F,le,fe,"⩾","\\geqslant",!0);O(F,le,fe,"⪖","\\eqslantgtr",!0);O(F,le,fe,"≳","\\gtrsim",!0);O(F,le,fe,"⪆","\\gtrapprox",!0);O(F,le,Je,"⋗","\\gtrdot");O(F,le,fe,"⋙","\\ggg",!0);O(F,le,fe,"≷","\\gtrless",!0);O(F,le,fe,"⋛","\\gtreqless",!0);O(F,le,fe,"⪌","\\gtreqqless",!0);O(F,le,fe,"≖","\\eqcirc",!0);O(F,le,fe,"≗","\\circeq",!0);O(F,le,fe,"≜","\\triangleq",!0);O(F,le,fe,"∼","\\thicksim");O(F,le,fe,"≈","\\thickapprox");O(F,le,fe,"⫆","\\supseteqq",!0);O(F,le,fe,"⋑","\\Supset",!0);O(F,le,fe,"⊐","\\sqsupset",!0);O(F,le,fe,"≽","\\succcurlyeq",!0);O(F,le,fe,"⋟","\\curlyeqsucc",!0);O(F,le,fe,"≿","\\succsim",!0);O(F,le,fe,"⪸","\\succapprox",!0);O(F,le,fe,"⊳","\\vartriangleright");O(F,le,fe,"⊵","\\trianglerighteq");O(F,le,fe,"⊩","\\Vdash",!0);O(F,le,fe,"∣","\\shortmid");O(F,le,fe,"∥","\\shortparallel");O(F,le,fe,"≬","\\between",!0);O(F,le,fe,"⋔","\\pitchfork",!0);O(F,le,fe,"∝","\\varpropto");O(F,le,fe,"◀","\\blacktriangleleft");O(F,le,fe,"∴","\\therefore",!0);O(F,le,fe,"∍","\\backepsilon");O(F,le,fe,"▶","\\blacktriangleright");O(F,le,fe,"∵","\\because",!0);O(F,le,fe,"⋘","\\llless");O(F,le,fe,"⋙","\\gggtr");O(F,le,Je,"⊲","\\lhd");O(F,le,Je,"⊳","\\rhd");O(F,le,fe,"≂","\\eqsim",!0);O(F,Q,fe,"⋈","\\Join");O(F,le,fe,"≑","\\Doteq",!0);O(F,le,Je,"∔","\\dotplus",!0);O(F,le,Je,"∖","\\smallsetminus");O(F,le,Je,"⋒","\\Cap",!0);O(F,le,Je,"⋓","\\Cup",!0);O(F,le,Je,"⩞","\\doublebarwedge",!0);O(F,le,Je,"⊟","\\boxminus",!0);O(F,le,Je,"⊞","\\boxplus",!0);O(F,le,Je,"⋇","\\divideontimes",!0);O(F,le,Je,"⋉","\\ltimes",!0);O(F,le,Je,"⋊","\\rtimes",!0);O(F,le,Je,"⋋","\\leftthreetimes",!0);O(F,le,Je,"⋌","\\rightthreetimes",!0);O(F,le,Je,"⋏","\\curlywedge",!0);O(F,le,Je,"⋎","\\curlyvee",!0);O(F,le,Je,"⊝","\\circleddash",!0);O(F,le,Je,"⊛","\\circledast",!0);O(F,le,Je,"⋅","\\centerdot");O(F,le,Je,"⊺","\\intercal",!0);O(F,le,Je,"⋒","\\doublecap");O(F,le,Je,"⋓","\\doublecup");O(F,le,Je,"⊠","\\boxtimes",!0);O(F,le,fe,"⇢","\\dashrightarrow",!0);O(F,le,fe,"⇠","\\dashleftarrow",!0);O(F,le,fe,"⇇","\\leftleftarrows",!0);O(F,le,fe,"⇆","\\leftrightarrows",!0);O(F,le,fe,"⇚","\\Lleftarrow",!0);O(F,le,fe,"↞","\\twoheadleftarrow",!0);O(F,le,fe,"↢","\\leftarrowtail",!0);O(F,le,fe,"↫","\\looparrowleft",!0);O(F,le,fe,"⇋","\\leftrightharpoons",!0);O(F,le,fe,"↶","\\curvearrowleft",!0);O(F,le,fe,"↺","\\circlearrowleft",!0);O(F,le,fe,"↰","\\Lsh",!0);O(F,le,fe,"⇈","\\upuparrows",!0);O(F,le,fe,"↿","\\upharpoonleft",!0);O(F,le,fe,"⇃","\\downharpoonleft",!0);O(F,Q,fe,"⊶","\\origof",!0);O(F,Q,fe,"⊷","\\imageof",!0);O(F,le,fe,"⊸","\\multimap",!0);O(F,le,fe,"↭","\\leftrightsquigarrow",!0);O(F,le,fe,"⇉","\\rightrightarrows",!0);O(F,le,fe,"⇄","\\rightleftarrows",!0);O(F,le,fe,"↠","\\twoheadrightarrow",!0);O(F,le,fe,"↣","\\rightarrowtail",!0);O(F,le,fe,"↬","\\looparrowright",!0);O(F,le,fe,"↷","\\curvearrowright",!0);O(F,le,fe,"↻","\\circlearrowright",!0);O(F,le,fe,"↱","\\Rsh",!0);O(F,le,fe,"⇊","\\downdownarrows",!0);O(F,le,fe,"↾","\\upharpoonright",!0);O(F,le,fe,"⇂","\\downharpoonright",!0);O(F,le,fe,"⇝","\\rightsquigarrow",!0);O(F,le,fe,"⇝","\\leadsto");O(F,le,fe,"⇛","\\Rrightarrow",!0);O(F,le,fe,"↾","\\restriction");O(F,Q,pe,"‘","`");O(F,Q,pe,"$","\\$");O($e,Q,pe,"$","\\$");O($e,Q,pe,"$","\\textdollar");O(F,Q,pe,"%","\\%");O($e,Q,pe,"%","\\%");O(F,Q,pe,"_","\\_");O($e,Q,pe,"_","\\_");O($e,Q,pe,"_","\\textunderscore");O(F,Q,pe,"∠","\\angle",!0);O(F,Q,pe,"∞","\\infty",!0);O(F,Q,pe,"′","\\prime");O(F,Q,pe,"△","\\triangle");O(F,Q,pe,"Γ","\\Gamma",!0);O(F,Q,pe,"Δ","\\Delta",!0);O(F,Q,pe,"Θ","\\Theta",!0);O(F,Q,pe,"Λ","\\Lambda",!0);O(F,Q,pe,"Ξ","\\Xi",!0);O(F,Q,pe,"Π","\\Pi",!0);O(F,Q,pe,"Σ","\\Sigma",!0);O(F,Q,pe,"Υ","\\Upsilon",!0);O(F,Q,pe,"Φ","\\Phi",!0);O(F,Q,pe,"Ψ","\\Psi",!0);O(F,Q,pe,"Ω","\\Omega",!0);O(F,Q,pe,"A","Α");O(F,Q,pe,"B","Β");O(F,Q,pe,"E","Ε");O(F,Q,pe,"Z","Ζ");O(F,Q,pe,"H","Η");O(F,Q,pe,"I","Ι");O(F,Q,pe,"K","Κ");O(F,Q,pe,"M","Μ");O(F,Q,pe,"N","Ν");O(F,Q,pe,"O","Ο");O(F,Q,pe,"P","Ρ");O(F,Q,pe,"T","Τ");O(F,Q,pe,"X","Χ");O(F,Q,pe,"¬","\\neg",!0);O(F,Q,pe,"¬","\\lnot");O(F,Q,pe,"⊤","\\top");O(F,Q,pe,"⊥","\\bot");O(F,Q,pe,"∅","\\emptyset");O(F,le,pe,"∅","\\varnothing");O(F,Q,dt,"α","\\alpha",!0);O(F,Q,dt,"β","\\beta",!0);O(F,Q,dt,"γ","\\gamma",!0);O(F,Q,dt,"δ","\\delta",!0);O(F,Q,dt,"ϵ","\\epsilon",!0);O(F,Q,dt,"ζ","\\zeta",!0);O(F,Q,dt,"η","\\eta",!0);O(F,Q,dt,"θ","\\theta",!0);O(F,Q,dt,"ι","\\iota",!0);O(F,Q,dt,"κ","\\kappa",!0);O(F,Q,dt,"λ","\\lambda",!0);O(F,Q,dt,"μ","\\mu",!0);O(F,Q,dt,"ν","\\nu",!0);O(F,Q,dt,"ξ","\\xi",!0);O(F,Q,dt,"ο","\\omicron",!0);O(F,Q,dt,"π","\\pi",!0);O(F,Q,dt,"ρ","\\rho",!0);O(F,Q,dt,"σ","\\sigma",!0);O(F,Q,dt,"τ","\\tau",!0);O(F,Q,dt,"υ","\\upsilon",!0);O(F,Q,dt,"ϕ","\\phi",!0);O(F,Q,dt,"χ","\\chi",!0);O(F,Q,dt,"ψ","\\psi",!0);O(F,Q,dt,"ω","\\omega",!0);O(F,Q,dt,"ε","\\varepsilon",!0);O(F,Q,dt,"ϑ","\\vartheta",!0);O(F,Q,dt,"ϖ","\\varpi",!0);O(F,Q,dt,"ϱ","\\varrho",!0);O(F,Q,dt,"ς","\\varsigma",!0);O(F,Q,dt,"φ","\\varphi",!0);O(F,Q,Je,"∗","*",!0);O(F,Q,Je,"+","+");O(F,Q,Je,"−","-",!0);O(F,Q,Je,"⋅","\\cdot",!0);O(F,Q,Je,"∘","\\circ",!0);O(F,Q,Je,"÷","\\div",!0);O(F,Q,Je,"±","\\pm",!0);O(F,Q,Je,"×","\\times",!0);O(F,Q,Je,"∩","\\cap",!0);O(F,Q,Je,"∪","\\cup",!0);O(F,Q,Je,"∖","\\setminus",!0);O(F,Q,Je,"∧","\\land");O(F,Q,Je,"∨","\\lor");O(F,Q,Je,"∧","\\wedge",!0);O(F,Q,Je,"∨","\\vee",!0);O(F,Q,pe,"√","\\surd");O(F,Q,Qs,"⟨","\\langle",!0);O(F,Q,Qs,"∣","\\lvert");O(F,Q,Qs,"∥","\\lVert");O(F,Q,ls,"?","?");O(F,Q,ls,"!","!");O(F,Q,ls,"⟩","\\rangle",!0);O(F,Q,ls,"∣","\\rvert");O(F,Q,ls,"∥","\\rVert");O(F,Q,fe,"=","=");O(F,Q,fe,":",":");O(F,Q,fe,"≈","\\approx",!0);O(F,Q,fe,"≅","\\cong",!0);O(F,Q,fe,"≥","\\ge");O(F,Q,fe,"≥","\\geq",!0);O(F,Q,fe,"←","\\gets");O(F,Q,fe,">","\\gt",!0);O(F,Q,fe,"∈","\\in",!0);O(F,Q,fe,"","\\@not");O(F,Q,fe,"⊂","\\subset",!0);O(F,Q,fe,"⊃","\\supset",!0);O(F,Q,fe,"⊆","\\subseteq",!0);O(F,Q,fe,"⊇","\\supseteq",!0);O(F,le,fe,"⊈","\\nsubseteq",!0);O(F,le,fe,"⊉","\\nsupseteq",!0);O(F,Q,fe,"⊨","\\models");O(F,Q,fe,"←","\\leftarrow",!0);O(F,Q,fe,"≤","\\le");O(F,Q,fe,"≤","\\leq",!0);O(F,Q,fe,"<","\\lt",!0);O(F,Q,fe,"→","\\rightarrow",!0);O(F,Q,fe,"→","\\to");O(F,le,fe,"≱","\\ngeq",!0);O(F,le,fe,"≰","\\nleq",!0);O(F,Q,uo," ","\\ ");O(F,Q,uo," ","\\space");O(F,Q,uo," ","\\nobreakspace");O($e,Q,uo," ","\\ ");O($e,Q,uo," "," ");O($e,Q,uo," ","\\space");O($e,Q,uo," ","\\nobreakspace");O(F,Q,uo,"","\\nobreak");O(F,Q,uo,"","\\allowbreak");O(F,Q,Jd,",",",");O(F,Q,Jd,";",";");O(F,le,Je,"⊼","\\barwedge",!0);O(F,le,Je,"⊻","\\veebar",!0);O(F,Q,Je,"⊙","\\odot",!0);O(F,Q,Je,"⊕","\\oplus",!0);O(F,Q,Je,"⊗","\\otimes",!0);O(F,Q,pe,"∂","\\partial",!0);O(F,Q,Je,"⊘","\\oslash",!0);O(F,le,Je,"⊚","\\circledcirc",!0);O(F,le,Je,"⊡","\\boxdot",!0);O(F,Q,Je,"△","\\bigtriangleup");O(F,Q,Je,"▽","\\bigtriangledown");O(F,Q,Je,"†","\\dagger");O(F,Q,Je,"⋄","\\diamond");O(F,Q,Je,"⋆","\\star");O(F,Q,Je,"◃","\\triangleleft");O(F,Q,Je,"▹","\\triangleright");O(F,Q,Qs,"{","\\{");O($e,Q,pe,"{","\\{");O($e,Q,pe,"{","\\textbraceleft");O(F,Q,ls,"}","\\}");O($e,Q,pe,"}","\\}");O($e,Q,pe,"}","\\textbraceright");O(F,Q,Qs,"{","\\lbrace");O(F,Q,ls,"}","\\rbrace");O(F,Q,Qs,"[","\\lbrack",!0);O($e,Q,pe,"[","\\lbrack",!0);O(F,Q,ls,"]","\\rbrack",!0);O($e,Q,pe,"]","\\rbrack",!0);O(F,Q,Qs,"(","\\lparen",!0);O(F,Q,ls,")","\\rparen",!0);O($e,Q,pe,"<","\\textless",!0);O($e,Q,pe,">","\\textgreater",!0);O(F,Q,Qs,"⌊","\\lfloor",!0);O(F,Q,ls,"⌋","\\rfloor",!0);O(F,Q,Qs,"⌈","\\lceil",!0);O(F,Q,ls,"⌉","\\rceil",!0);O(F,Q,pe,"\\","\\backslash");O(F,Q,pe,"∣","|");O(F,Q,pe,"∣","\\vert");O($e,Q,pe,"|","\\textbar",!0);O(F,Q,pe,"∥","\\|");O(F,Q,pe,"∥","\\Vert");O($e,Q,pe,"∥","\\textbardbl");O($e,Q,pe,"~","\\textasciitilde");O($e,Q,pe,"\\","\\textbackslash");O($e,Q,pe,"^","\\textasciicircum");O(F,Q,fe,"↑","\\uparrow",!0);O(F,Q,fe,"⇑","\\Uparrow",!0);O(F,Q,fe,"↓","\\downarrow",!0);O(F,Q,fe,"⇓","\\Downarrow",!0);O(F,Q,fe,"↕","\\updownarrow",!0);O(F,Q,fe,"⇕","\\Updownarrow",!0);O(F,Q,mr,"∐","\\coprod");O(F,Q,mr,"⋁","\\bigvee");O(F,Q,mr,"⋀","\\bigwedge");O(F,Q,mr,"⨄","\\biguplus");O(F,Q,mr,"⋂","\\bigcap");O(F,Q,mr,"⋃","\\bigcup");O(F,Q,mr,"∫","\\int");O(F,Q,mr,"∫","\\intop");O(F,Q,mr,"∬","\\iint");O(F,Q,mr,"∭","\\iiint");O(F,Q,mr,"∏","\\prod");O(F,Q,mr,"∑","\\sum");O(F,Q,mr,"⨂","\\bigotimes");O(F,Q,mr,"⨁","\\bigoplus");O(F,Q,mr,"⨀","\\bigodot");O(F,Q,mr,"∮","\\oint");O(F,Q,mr,"∯","\\oiint");O(F,Q,mr,"∰","\\oiiint");O(F,Q,mr,"⨆","\\bigsqcup");O(F,Q,mr,"∫","\\smallint");O($e,Q,Uu,"…","\\textellipsis");O(F,Q,Uu,"…","\\mathellipsis");O($e,Q,Uu,"…","\\ldots",!0);O(F,Q,Uu,"…","\\ldots",!0);O(F,Q,Uu,"⋯","\\@cdots",!0);O(F,Q,Uu,"⋱","\\ddots",!0);O(F,Q,pe,"⋮","\\varvdots");O($e,Q,pe,"⋮","\\varvdots");O(F,Q,In,"ˊ","\\acute");O(F,Q,In,"ˋ","\\grave");O(F,Q,In,"¨","\\ddot");O(F,Q,In,"~","\\tilde");O(F,Q,In,"ˉ","\\bar");O(F,Q,In,"˘","\\breve");O(F,Q,In,"ˇ","\\check");O(F,Q,In,"^","\\hat");O(F,Q,In,"⃗","\\vec");O(F,Q,In,"˙","\\dot");O(F,Q,In,"˚","\\mathring");O(F,Q,dt,"","\\@imath");O(F,Q,dt,"","\\@jmath");O(F,Q,pe,"ı","ı");O(F,Q,pe,"ȷ","ȷ");O($e,Q,pe,"ı","\\i",!0);O($e,Q,pe,"ȷ","\\j",!0);O($e,Q,pe,"ß","\\ss",!0);O($e,Q,pe,"æ","\\ae",!0);O($e,Q,pe,"œ","\\oe",!0);O($e,Q,pe,"ø","\\o",!0);O($e,Q,pe,"Æ","\\AE",!0);O($e,Q,pe,"Œ","\\OE",!0);O($e,Q,pe,"Ø","\\O",!0);O($e,Q,In,"ˊ","\\'");O($e,Q,In,"ˋ","\\`");O($e,Q,In,"ˆ","\\^");O($e,Q,In,"˜","\\~");O($e,Q,In,"ˉ","\\=");O($e,Q,In,"˘","\\u");O($e,Q,In,"˙","\\.");O($e,Q,In,"¸","\\c");O($e,Q,In,"˚","\\r");O($e,Q,In,"ˇ","\\v");O($e,Q,In,"¨",'\\"');O($e,Q,In,"˝","\\H");O($e,Q,In,"◯","\\textcircled");var EN={"--":!0,"---":!0,"``":!0,"''":!0};O($e,Q,pe,"–","--",!0);O($e,Q,pe,"–","\\textendash");O($e,Q,pe,"—","---",!0);O($e,Q,pe,"—","\\textemdash");O($e,Q,pe,"‘","`",!0);O($e,Q,pe,"‘","\\textquoteleft");O($e,Q,pe,"’","'",!0);O($e,Q,pe,"’","\\textquoteright");O($e,Q,pe,"“","``",!0);O($e,Q,pe,"“","\\textquotedblleft");O($e,Q,pe,"”","''",!0);O($e,Q,pe,"”","\\textquotedblright");O(F,Q,pe,"°","\\degree",!0);O($e,Q,pe,"°","\\degree");O($e,Q,pe,"°","\\textdegree",!0);O(F,Q,pe,"£","\\pounds");O(F,Q,pe,"£","\\mathsterling",!0);O($e,Q,pe,"£","\\pounds");O($e,Q,pe,"£","\\textsterling",!0);O(F,le,pe,"✠","\\maltese");O($e,le,pe,"✠","\\maltese");var SS='0123456789/@."';for(var F1=0;F1{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 RS[s]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return Rtt[a]}else{if(r===120485||r===120486)return RS[0];if(120486{if(nl(e.classes)!==nl(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},NN=e=>{for(var n=0;nt&&(t=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>s&&(s=o.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Pe=function(n,t,r,s){var a=new Fu(n,t,r,s);return Sx(a),a},sl=(e,n,t,r)=>new Fu(e,n,t,r),Nu=function(n,t,r){var s=Pe([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=Ve(s.height),s.maxFontSize=1,s},Itt=function(n,t,r,s){var a=new bp(n,t,r,s);return Sx(a),a},fo=function(n){var t=new Pu(n);return Sx(t),t},zu=function(n,t){return n instanceof Pu?Pe([],[n],t):n},Btt=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,a=s,o=1;o{var t=Pe(["mspace"],[],n),r=Un(e,n);return t.style.marginRight=Ve(r),t},N_=(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},Nv={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},AN={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},jN=function(n,t){var[r,s,a]=AN[n],o=new rl(r),l=new io([o],{width:Ve(s),height:Ve(a),style:"width:"+Ve(s),viewBox:"0 0 "+1e3*s+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),c=sl(["overlay"],[l],t);return c.height=a,c.style.height=Ve(a),c.style.width=Ve(s),c},Fn={number:3,unit:"mu"},Ol={number:4,unit:"mu"},Wa={number:5,unit:"mu"},$tt={mord:{mop:Fn,mbin:Ol,mrel:Wa,minner:Fn},mop:{mord:Fn,mop:Fn,mrel:Wa,minner:Fn},mbin:{mord:Ol,mop:Ol,mopen:Ol,minner:Ol},mrel:{mord:Wa,mop:Wa,mopen:Wa,minner:Wa},mopen:{},mclose:{mop:Fn,mbin:Ol,mrel:Wa,minner:Fn},mpunct:{mord:Fn,mop:Fn,mrel:Wa,mopen:Fn,mclose:Fn,mpunct:Fn,minner:Fn},minner:{mord:Fn,mop:Fn,mbin:Ol,mrel:Wa,mopen:Fn,mpunct:Fn,minner:Fn}},Htt={mord:{mop:Fn},mop:{mord:Fn,mop:Fn},mbin:{},mrel:{},mopen:{},mclose:{mop:Fn},mpunct:{},minner:{mop:Fn}},TN={},R0={},D0={};function Ze(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:a,mathmlBuilder:o}=e,l={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=S.classes[0];v==="mbin"&&Ftt.has(b)?k.classes[0]="mord":b==="mbin"&&Ptt.has(v)&&(S.classes[0]="mord")},{node:h},m,g),zv(a,(S,k)=>{var v,b,w=jv(k),y=jv(S),C=w&&y?S.hasClass("mtight")?(v=Htt[w])==null?void 0:v[y]:(b=$tt[w])==null?void 0:b[y]:null;if(C)return zN(C,f)},{node:h},m,g),a},zv=function(n,t,r,s,a){s&&n.push(s);for(var o=0;om=>{n.splice(h+1,0,m),o++})(o)}s&&n.pop()},MN=function(n){return n instanceof Pu||n instanceof bp||n instanceof Fu&&n.hasClass("enclosing")?n:null},Av=function(n,t){var r=MN(n);if(r){var s=r.children;if(s.length){if(t==="right")return Av(s[s.length-1],"right");if(t==="left")return Av(s[0],"left")}}return n},jv=function(n,t){if(!n)return null;t&&(n=Av(n,t));var r=n.classes[0];return qtt[r]||null},bd=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Pe(t.concat(r))},tn=function(n,t,r){if(!n)return Pe();if(R0[n.type]){var s=R0[n.type](n,t);if(r&&t.size!==r.size){s=Pe(t.sizingClasses(r),[s],t);var a=t.sizeMultiplier/r.sizeMultiplier;s.height*=a,s.depth*=a}return s}else throw new Ue("Got group of unknown type: '"+n.type+"'")};function z_(e,n){var t=Pe(["base"],e,n),r=Pe(["strut"]);return r.style.height=Ve(t.height+t.depth),t.depth&&(r.style.verticalAlign=Ve(-t.depth)),t.children.unshift(r),t}function Tv(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=kr(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var a=[],o=[],l=0;l0&&(a.push(z_(o,n)),o=[]),a.push(r[l]));o.length>0&&a.push(z_(o,n));var f;t?(f=z_(kr(t,n,!0),n),f.classes=["tag"],a.push(f)):s&&a.push(s);var _=Pe(["katex-html"],a);if(_.setAttribute("aria-hidden","true"),f){var h=f.children[0];h.style.height=Ve(_.height+_.depth),_.depth&&(h.style.verticalAlign=Ve(-_.depth))}return _}function RN(e){return new Pu(e)}class qe{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=nl(this.classes));for(var r=0;r0&&(n+=' class ="'+Yr(nl(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class hr{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Yr(this.toText())}toText(){return this.text}}class DN{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",Ve(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Gtt=new Set(["\\imath","\\jmath"]),Vtt=new Set(["mrow","mtable"]),Si=function(n,t,r){return Ln[t][n]&&Ln[t][n].replace&&n.charCodeAt(0)!==55349&&!(EN.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Ln[t][n].replace),new hr(n)},kx=function(n){return n.length===1?n[0]:new qe("mrow",n)},Wtt={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"},Cx=(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=Wtt[t];if(s)return typeof s=="function"?s(e):s;var a=e.text;if(Gtt.has(a))return null;if(Ln[r][a]){var o=Ln[r][a].replace;o&&(a=o)}var l=Nv[t].fontName;return yx(a,l,r)?Nv[t].variant:null};function V1(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof hr&&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 hr&&t.text===","}else return!1}var Js=function(n,t,r){if(n.length===1){var s=wn(n[0],t);return r&&s instanceof qe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||V1(o))){var f=c.children[0];f instanceof qe&&f.type==="mn"&&(f.children=[...o.children,...f.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var _=o.children[0];if(_ instanceof hr&&_.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var h=c.children[0];h instanceof hr&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(c),o=c}return a},il=function(n,t,r){return kx(Js(n,t,r))},wn=function(n,t){if(!n)return new qe("mrow");if(D0[n.type])return D0[n.type](n,t);throw new Ue("Got group of unknown type: '"+n.type+"'")};function DS(e,n,t,r,s){var a=Js(e,t),o;a.length===1&&a[0]instanceof qe&&Vtt.has(a[0].type)?o=a[0]:o=new qe("mrow",a);var l=new qe("annotation",[new hr(n)]);l.setAttribute("encoding","application/x-tex");var c=new qe("semantics",[o,l]),f=new qe("math",[c]);f.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&f.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Pe([_],[f])}var Ktt=[[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]],LS=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],OS=function(n,t){return t.size<2?n:Ktt[n-1][t.size-1]};class Za{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||Za.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=LS[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 Za(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:OS(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:LS[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=OS(Za.BASESIZE,n);return this.size===t&&this.textSize===Za.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!==Za.BASESIZE?["sizing","reset-size"+this.size,"size"+Za.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Ttt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Za.BASESIZE=6;var LN=function(n){return new Za({style:n.displayMode?wt.DISPLAY:wt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},ON=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Pe(r,[n])}return n},Xtt=function(n,t,r){var s=LN(r),a;if(r.output==="mathml")return DS(n,t,s,r.displayMode,!0);if(r.output==="html"){var o=Tv(n,s);a=Pe(["katex"],[o])}else{var l=DS(n,t,s,r.displayMode,!1),c=Tv(n,s);a=Pe(["katex"],[l,c])}return ON(a,r)},Ytt=function(n,t,r){var s=LN(r),a=Tv(n,s),o=Pe(["katex"],[a]);return ON(o,r)},Ztt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},yp=function(n){var t=new qe("mo",[new hr(Ztt[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Qtt={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]},Jtt=new Set(["widehat","widecheck","widetilde","utilde"]),wp=function(n,t){function r(){var l=4e5,c=n.label.slice(1);if(Jtt.has(c)&&"base"in n){var f=n.base.type==="ordgroup"?n.base.body.length:1,_,h,m;if(f>5)c==="widehat"||c==="widecheck"?(_=420,l=2364,m=.42,h=c+"4"):(_=312,l=2340,m=.34,h="tilde4");else{var g=[1,1,2,2,3,3][f];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][g],_=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],h=c+g):(l=[0,600,1033,2339,2340][g],_=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],h="tilde"+g)}var S=new rl(h),k=new io([S],{width:"100%",height:Ve(m),viewBox:"0 0 "+l+" "+_,preserveAspectRatio:"none"});return{span:sl([],[k],t),minWidth:0,height:m}}else{var v=[],b=Qtt[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[w,y,C]=b,z=C/1e3,N=w.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 D=0;D0&&(s.style.minWidth=Ve(a)),s},ent=function(n,t,r,s,a){var o,l=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(o=Pe(["stretchy",t],[],a),t==="fbox"){var c=a.color&&a.getColor();c&&(o.style.borderColor=c)}}else{var f=[];/^[bx]cancel$/.test(t)&&f.push(new yv({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&f.push(new yv({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new io(f,{width:"100%",height:Ve(l)});o=sl([],[_],a)}return o.height=l,o.style.height=Ve(l),o},tnt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},nnt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function rnt(e){return e in tnt}function Tt(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 Sp(e){var n=kp(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 kp(e){return e&&(e.type==="atom"||nnt.hasOwnProperty(e.type))?e:null}var IN=e=>{if(e instanceof Xs)return e;if(Att(e)&&e.children.length===1)return IN(e.children[0])},Ex=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=Tt(e.base,"accent"),t=r.base,e.base=t,s=ztt(tn(e,n)),e.base=r):(r=Tt(e,"accent"),t=r.base);var a=tn(t,n.havingCrampedStyle()),o=r.isShifty&&co(t),l=0;if(o){var c,f;l=(c=(f=IN(a))==null?void 0:f.skew)!=null?c:0}var _=r.label==="\\c",h=_?a.height+a.depth:Math.min(a.height,n.fontMetrics().xHeight),m;if(r.isStretchy)m=wp(r,n),m=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Ve(2*l)+")",marginLeft:Ve(2*l)}:void 0}]});else{var g,S;r.label==="\\vec"?(g=jN("vec",n),S=AN.vec[1]):(g=xp({mode:r.mode,text:r.label},n,"textord"),g=Ntt(g),g.italic=0,S=g.width,_&&(h+=g.depth)),m=Pe(["accent-body"],[g]);var k=r.label==="\\textcircled";k&&(m.classes.push("accent-full"),h=a.height);var v=l;k||(v-=S/2),m.style.left=Ve(v),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:m}]})}var b=Pe(["mord","accent"],[m],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},BN=(e,n)=>{var t=e.isStretchy?yp(e.label):new qe("mo",[Si(e.label,e.mode)]),r=new qe("mover",[wn(e.base,n),t]);return r.setAttribute("accent","true"),r},snt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ze({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=L0(n[0]),r=!snt.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:Ex,mathmlBuilder:BN});Ze({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:Ex,mathmlBuilder:BN});Ze({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=tn(e.base,n),r=wp(e,n),s=e.label==="\\utilde"?.12:0,a=Jt({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Pe(["mord","accentunder"],[a],n)},mathmlBuilder:(e,n)=>{var t=yp(e.label),r=new qe("munder",[wn(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var A_=e=>{var n=new qe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};Ze({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=zu(tn(e.body,r,n),n),a=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(a+"-arrow-pad");var o;e.below&&(r=n.havingStyle(t.sub()),o=zu(tn(e.below,r,n),n),o.classes.push(a+"-arrow-pad"));var l=wp(e,n),c=-n.fontMetrics().axisHeight+.5*l.height,f=-n.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(f-=s.depth);var _;if(o){var h=-n.fontMetrics().axisHeight+o.height+.5*l.height+.111;_=Jt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:f},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:h}]})}else _=Jt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:f},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return Pe(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=yp(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=A_(wn(e.body,n));if(e.below){var a=A_(wn(e.below,n));r=new qe("munderover",[t,a,s])}else r=new qe("mover",[t,s])}else if(e.below){var o=A_(wn(e.below,n));r=new qe("munder",[t,o])}else r=A_(),r=new qe("mover",[t,r]);return r}});function $N(e,n){var t=kr(e.body,n,!0);return Pe([e.mclass],t,n)}function HN(e,n){var t,r=Js(e.body,n);return e.mclass==="minner"?t=new qe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new qe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new qe("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}Ze({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:dr(s),isCharacterBox:co(s)}},htmlBuilder:$N,mathmlBuilder:HN});var Cp=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"};Ze({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Cp(n[0]),body:dr(n[1]),isCharacterBox:co(n[1])}}});Ze({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],a=n[0],o;r!=="\\stackrel"?o=Cp(s):o="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:dr(s)},c={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:t.mode,mclass:o,body:[c],isCharacterBox:co(c)}},htmlBuilder:$N,mathmlBuilder:HN});Ze({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Cp(n[0]),body:dr(n[0])}},htmlBuilder(e,n){var t=kr(e.body,n,!0),r=Pe([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=Js(e.body,n),r=new qe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var int={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},IS=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),BS=e=>e.type==="textord"&&e.text==="@",ant=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function ont(e,n,t){var r=int[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]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=t.callFunction("\\Big",[a],[]),l=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,o,l]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var f={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[f],[])}default:return{type:"textord",text:" ",mode:"math"}}}function lnt(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 Ue("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],a=0;aAV".includes(f))for(var h=0;h<2;h++){for(var m=!0,g=c+1;gAV=|." after @',o[c]);var S=ont(f,_,e),k={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};r.push(k),l=IS()}a%2===0?r.push(l):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([])}}Ze({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=zu(tn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=Ve(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new qe("mrow",[wn(e.label,n)]);return t=new qe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new qe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});Ze({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=zu(tn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new qe("mrow",[wn(e.fragment,n)])}});Ze({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=Tt(n[0],"ordgroup"),s=r.body,a="",o=0;o=1114111)throw new Ue("\\@char with invalid code point "+a);return c<=65535?f=String.fromCharCode(c):(c-=65536,f=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:f}}});var PN=(e,n)=>{var t=kr(e.body,n.withColor(e.color),!1);return fo(t)},FN=(e,n)=>{var t=Js(e.body,n.withColor(e.color)),r=new qe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};Ze({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=Tt(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:dr(s)}},htmlBuilder:PN,mathmlBuilder:FN});Ze({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=Tt(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var a=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:a}},htmlBuilder:PN,mathmlBuilder:FN});Ze({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,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:s&&Tt(s,"size").value}},htmlBuilder(e,n){var t=Pe(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=Ve(Un(e.size,n)))),t},mathmlBuilder(e,n){var t=new qe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",Ve(Un(e.size,n)))),t}});var Mv={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},UN=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ue("Expected a control sequence",e);return n},cnt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},qN=(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)};Ze({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(Mv[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=Mv[r.text]),Tt(n.parseFunction(),"internal");throw new Ue("Invalid token after macro prefix",r)}});Ze({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 Ue("Expected a control sequence",r);for(var a=0,o,l=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){o=n.gullet.future(),l[a].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ue('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Ue('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new Ue("Expected a macro definition");l[a].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return o&&c.unshift(o),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:a,delimiters:l},t===Mv[t]),{type:"internal",mode:n.mode}}});Ze({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=UN(n.gullet.popToken());n.gullet.consumeSpaces();var s=cnt(n);return qN(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});Ze({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=UN(n.gullet.popToken()),s=n.gullet.popToken(),a=n.gullet.popToken();return qN(n,r,a,t==="\\\\globalfuture"),n.gullet.pushToken(a),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var Xf=function(n,t,r){var s=Ln.math[n]&&Ln.math[n].replace,a=yx(s||n,t,r);if(!a)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return a},Nx=function(n,t,r,s){var a=r.havingBaseStyle(t),o=Pe(s.concat(a.sizingClasses(r)),[n],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},GN=function(n,t,r){var s=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=Ve(a),n.height-=a,n.depth+=a},unt=function(n,t,r,s,a,o){var l=ss(n,"Main-Regular",a,s),c=Nx(l,t,s,o);return GN(c,s,t),c},fnt=function(n,t,r,s){return ss(n,"Size"+t+"-Regular",r,s)},VN=function(n,t,r,s,a,o){var l=fnt(n,t,a,s),c=Nx(Pe(["delimsizing","size"+t],[l],s),wt.TEXT,s,o);return r&&GN(c,s,wt.TEXT),c},W1=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var a=Pe(["delimsizinginner",s],[Pe([],[ss(n,t,r)])]);return{type:"elem",elem:a}},K1=function(n,t,r){var s=pa["Size4-Regular"][n.charCodeAt(0)]?pa["Size4-Regular"][n.charCodeAt(0)][4]:pa["Size1-Regular"][n.charCodeAt(0)][4],a=new rl("inner",xtt(n,Math.round(1e3*t))),o=new io([a],{width:Ve(s),height:Ve(t),style:"width:"+Ve(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),l=sl([],[o],r);return l.height=t,l.style.height=Ve(t),l.style.width=Ve(s),{type:"elem",elem:l}},Rv=.008,j_={type:"kern",size:-1*Rv},dnt=new Set(["|","\\lvert","\\rvert","\\vert"]),hnt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),WN=function(n,t,r,s,a,o){var l,c,f,_,h="",m=0;l=f=_=n,c=null;var g="Size1-Regular";n==="\\uparrow"?f=_="⏐":n==="\\Uparrow"?f=_="‖":n==="\\downarrow"?l=f="⏐":n==="\\Downarrow"?l=f="‖":n==="\\updownarrow"?(l="\\uparrow",f="⏐",_="\\downarrow"):n==="\\Updownarrow"?(l="\\Uparrow",f="‖",_="\\Downarrow"):dnt.has(n)?(f="∣",h="vert",m=333):hnt.has(n)?(f="∥",h="doublevert",m=556):n==="["||n==="\\lbrack"?(l="⎡",f="⎢",_="⎣",g="Size4-Regular",h="lbrack",m=667):n==="]"||n==="\\rbrack"?(l="⎤",f="⎥",_="⎦",g="Size4-Regular",h="rbrack",m=667):n==="\\lfloor"||n==="⌊"?(f=l="⎢",_="⎣",g="Size4-Regular",h="lfloor",m=667):n==="\\lceil"||n==="⌈"?(l="⎡",f=_="⎢",g="Size4-Regular",h="lceil",m=667):n==="\\rfloor"||n==="⌋"?(f=l="⎥",_="⎦",g="Size4-Regular",h="rfloor",m=667):n==="\\rceil"||n==="⌉"?(l="⎤",f=_="⎥",g="Size4-Regular",h="rceil",m=667):n==="("||n==="\\lparen"?(l="⎛",f="⎜",_="⎝",g="Size4-Regular",h="lparen",m=875):n===")"||n==="\\rparen"?(l="⎞",f="⎟",_="⎠",g="Size4-Regular",h="rparen",m=875):n==="\\{"||n==="\\lbrace"?(l="⎧",c="⎨",_="⎩",f="⎪",g="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(l="⎫",c="⎬",_="⎭",f="⎪",g="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(l="⎧",_="⎩",f="⎪",g="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(l="⎫",_="⎭",f="⎪",g="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(l="⎧",_="⎭",f="⎪",g="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(l="⎫",_="⎩",f="⎪",g="Size4-Regular");var S=Xf(l,g,a),k=S.height+S.depth,v=Xf(f,g,a),b=v.height+v.depth,w=Xf(_,g,a),y=w.height+w.depth,C=0,z=1;if(c!==null){var N=Xf(c,g,a);C=N.height+N.depth,z=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(z*b))),D=T+j*z*b,I=s.fontMetrics().axisHeight;r&&(I*=s.sizeMultiplier);var L=D/2-I,U=[];if(h.length>0){var q=D-k-y,W=Math.round(D*1e3),Z=ytt(h,Math.round(q*1e3)),X=new rl(h,Z),J=Ve(m/1e3),ee=Ve(W/1e3),$=new io([X],{width:J,height:ee,viewBox:"0 0 "+m+" "+W}),B=sl([],[$],s);B.height=W/1e3,B.style.width=J,B.style.height=ee,U.push({type:"elem",elem:B})}else{if(U.push(W1(_,g,a)),U.push(j_),c===null){var H=D-k-y+2*Rv;U.push(K1(f,H,s))}else{var K=(D-k-y-C)/2+2*Rv;U.push(K1(f,K,s)),U.push(j_),U.push(W1(c,g,a)),U.push(j_),U.push(K1(f,K,s))}U.push(j_),U.push(W1(l,g,a))}var G=s.havingBaseStyle(wt.TEXT),ie=Jt({positionType:"bottom",positionData:L,children:U});return Nx(Pe(["delimsizing","mult"],[ie],G),wt.TEXT,s,o)},X1=80,Y1=.08,Z1=function(n,t,r,s,a){var o=vtt(n,s,r),l=new rl(n,o),c=new io([l],{width:"400em",height:Ve(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return sl(["hide-tail"],[c],a)},_nt=function(n,t){var r=t.havingBaseSizing(),s=QN("\\surd",n*r.sizeMultiplier,ZN,r),a=r.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l,c,f,_,h;return s.type==="small"?(_=1e3+1e3*o+X1,n<1?a=1:n<1.4&&(a=.7),c=(1+o+Y1)/a,f=(1+o)/a,l=Z1("sqrtMain",c,_,o,t),l.style.minWidth="0.853em",h=.833/a):s.type==="large"?(_=(1e3+X1)*sd[s.size],f=(sd[s.size]+o)/a,c=(sd[s.size]+o+Y1)/a,l=Z1("sqrtSize"+s.size,c,_,o,t),l.style.minWidth="1.02em",h=1/a):(c=n+o+Y1,f=n+o,_=Math.floor(1e3*n+o)+X1,l=Z1("sqrtTall",c,_,o,t),l.style.minWidth="0.742em",h=1.056),l.height=f,l.style.height=Ve(c),{span:l,advanceWidth:h,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*a}},KN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),pnt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),XN=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),sd=[0,1.2,1.8,2.4,3],YN=function(n,t,r,s,a){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),KN.has(n)||XN.has(n))return VN(n,t,!1,r,s,a);if(pnt.has(n))return WN(n,sd[t],!1,r,s,a);throw new Ue("Illegal delimiter: '"+n+"'")},mnt=[{type:"small",style:wt.SCRIPTSCRIPT},{type:"small",style:wt.SCRIPT},{type:"small",style:wt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],gnt=[{type:"small",style:wt.SCRIPTSCRIPT},{type:"small",style:wt.SCRIPT},{type:"small",style:wt.TEXT},{type:"stack"}],ZN=[{type:"small",style:wt.SCRIPTSCRIPT},{type:"small",style:wt.SCRIPT},{type:"small",style:wt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],bnt=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.")},QN=function(n,t,r,s){for(var a=Math.min(2,3-s.style.size),o=a;ot)return l}return r[r.length-1]},Dv=function(n,t,r,s,a,o){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var l;XN.has(n)?l=mnt:KN.has(n)?l=ZN:l=gnt;var c=QN(n,t,l,s);return c.type==="small"?unt(n,c.style,r,s,a,o):c.type==="large"?VN(n,c.size,r,s,a,o):WN(n,t,r,s,a,o)},Q1=function(n,t,r,s,a,o){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,f=5/s.fontMetrics().ptPerEm,_=Math.max(t-l,r+l),h=Math.max(_/500*c,2*_-f);return Dv(n,h,!0,s,a,o)},$S={"\\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}},vnt=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 HS(e){return"isMiddle"in e}function Ep(e,n){var t=kp(e);if(t&&vnt.has(t.text))return t;throw t?new Ue("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ue("Invalid delimiter type '"+e.type+"'",e)}Ze({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=Ep(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:$S[e.funcName].size,mclass:$S[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Pe([e.mclass]):YN(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(Si(e.delim,e.mode));var t=new qe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=Ve(sd[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function PS(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ze({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 Ue("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ep(n[0],e).text,color:t}}});Ze({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ep(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Tt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,n)=>{PS(e);for(var t=kr(e.body,n,!0,["mopen","mclose"]),r=0,s=0,a=!1,o=0;o{PS(e);var t=Js(e.body,n);if(e.left!=="."){var r=new qe("mo",[Si(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new qe("mo",[Si(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return kx(t)}});Ze({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ep(n[0],e);if(!e.parser.leftrightDepth)throw new Ue("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=bd(n,[]):(t=YN(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?Si("|","text"):Si(e.delim,e.mode),r=new qe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Np=(e,n)=>{var t=zu(tn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,a,o,l=co(e.body);if(r==="sout")a=Pe(["stretchy","sout"]),a.height=n.fontMetrics().defaultRuleThickness/s,o=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Un({number:.6,unit:"pt"},n),f=Un({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var h=t.height+t.depth+c+f;t.style.paddingLeft=Ve(h/2+c);var m=Math.floor(1e3*h*s),g=gtt(m),S=new io([new rl("phase",g)],{width:"400em",height:Ve(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});a=sl(["hide-tail"],[S],n),a.style.height=Ve(h),o=t.depth+c+f}else{/cancel/.test(r)?l||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=l?.2:0,v=k),a=ent(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Ve(b)):r==="angl"&&b!==.049&&(a.style.borderTopWidth=Ve(b),a.style.borderRightWidth=Ve(b)),o=t.depth+v,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Jt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Jt({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!l?Pe(["mord","cancel-lap"],[w],n):Pe(["mord"],[w],n)},zp=(e,n)=>{var t,r=new qe(e.label.includes("colorbox")?"mpadded":"menclose",[wn(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: "+Ve(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ze({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,a=Tt(n[0],"color-token").color,o=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,body:o}},htmlBuilder:Np,mathmlBuilder:zp});Ze({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,a=Tt(n[0],"color-token").color,o=Tt(n[1],"color-token").color,l=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:Np,mathmlBuilder:zp});Ze({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]}}});Ze({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:Np,mathmlBuilder:zp});Ze({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:Np,mathmlBuilder:zp});Ze({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 JN={};function Sa(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:a,mathmlBuilder:o}=e,l={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 Ue("{"+e.envName+"} can be used only in display mode.")},xnt=new Set(["gather","gather*"]);function zx(e){if(!e.includes("ed"))return!e.includes("*")}function fl(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:a,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:f,emptySingleRow:_,maxNumCols:h,leqno:m}=n;if(e.gullet.beginGroup(),f||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var g=e.gullet.expandMacroAsText("\\arraystretch");if(g==null)o=1;else if(o=parseFloat(g),!o||o<0)throw new Ue("Invalid \\arraystretch: "+g)}e.gullet.beginGroup();var S=[],k=[S],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 Ui("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(FS(e));;){var z=e.parseExpression(!1,f?"\\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]}),S.push(N);var T=e.fetch().text;if(T==="&"){if(h&&S.length===h){if(f||l)throw new Ue("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(),S.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(k.length>1||!_)&&k.pop(),b.length0&&(y+=.25),f.push({pos:y,isDashed:Ge[et]})}for(C(o[0]),r=0;r0&&(L+=w,TGe))for(r=0;r=l)){var oe=void 0;if(s>0||n.hskipBeforeAndAfter){var ue,de;oe=(ue=(de=G)==null?void 0:de.pregap)!=null?ue:m,oe!==0&&(Z=Pe(["arraycolsep"],[]),Z.style.width=Ve(oe),W.push(Z))}var ge=[];for(r=0;r0){for(var bt=Nu("hline",t,_),Mt=Nu("hdashline",t,_),Ct=[{type:"elem",elem:At,shift:0}];f.length>0;){var ut=f.pop(),ht=ut.pos-U;ut.isDashed?Ct.push({type:"elem",elem:Mt,shift:ht}):Ct.push({type:"elem",elem:bt,shift:ht})}At=Jt({positionType:"individualShift",children:Ct})}if(J.length===0)return Pe(["mord"],[At],t);var we=Jt({positionType:"individualShift",children:J}),Le=Pe(["tag"],[we],t);return fo([At,Le])},ynt={c:"center ",l:"left ",r:"right "},Ca=function(n,t){for(var r=[],s=new qe("mtd",[],["mtr-glue"]),a=new qe("mtd",[],["mml-eqn-num"]),o=0;o0){var S=n.cols,k="",v=!1,b=0,w=S.length;S[0].type==="separator"&&(m+="top ",b=1),S[S.length-1].type==="separator"&&(m+="bottom ",w-=1);for(var y=b;y0?"left ":"",m+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&g&&(v=1),r[S]={type:"align",align:k,pregap:v,postgap:0}}return o.colSeparationType=g?"align":"alignat",o};Sa({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=kp(n[0]),r=t?[n[0]]:Tt(n[0],"ordgroup").body,s=r.map(function(o){var l=Sp(o),c=l.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Ue("Unknown column alignment: "+c,o)}),a={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return fl(e.parser,a,Ax(e.envName))},htmlBuilder:ka,mathmlBuilder:Ca});Sa({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 Ue("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var a=fl(e.parser,r,Ax(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[a],left:n[0],right:n[1],rightColor:void 0}:a},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=fl(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=kp(n[0]),r=t?[n[0]]:Tt(n[0],"ordgroup").body,s=r.map(function(l){var c=Sp(l),f=c.text;if("lc".includes(f))return{type:"align",align:f};throw new Ue("Unknown column alignment: "+f,l)});if(s.length>1)throw new Ue("{subarray} can contain only one column");var a={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},o=fl(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Ue("{subarray} can contain only one column");return o},htmlBuilder:ka,mathmlBuilder:Ca});Sa({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=fl(e.parser,n,Ax(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:nz,htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){xnt.has(e.envName)&&Ap(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:zx(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return fl(e.parser,n,"display")},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:nz,htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ap(e);var n={autoTag:zx(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return fl(e.parser,n,"display")},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Ap(e),lnt(e.parser)},htmlBuilder:ka,mathmlBuilder:Ca});ne("\\nonumber","\\gdef\\@eqnsw{0}");ne("\\notag","\\nonumber");Ze({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ue(e.funcName+" valid only within array environment")}});var US=JN;Ze({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 Ue("Invalid environment name",s);for(var a="",o=0;o{var t=e.font,r=n.withFont(t);return tn(e.body,r)},sz=(e,n)=>{var t=e.font,r=n.withFont(t);return wn(e.body,r)},qS={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ze({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=L0(n[0]),a=r;return a in qS&&(a=qS[a]),{type:"font",mode:t.mode,font:a.slice(1),body:s}},htmlBuilder:rz,mathmlBuilder:sz});Ze({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:Cp(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:co(r)}}});Ze({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:a}=t,o=t.parseExpression(!0,s);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:rz,mathmlBuilder:sz});var wnt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),a;a=n.havingStyle(r);var o=tn(e.numer,a,n);if(e.continued){var l=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;o.height=o.height0?S=3*m:S=7*m,k=n.fontMetrics().denom1):(h>0?(g=n.fontMetrics().num2,S=m):(g=n.fontMetrics().num3,S=3*m),k=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;g-o.depth-(w+.5*h){var t=new qe("mfrac",[wn(e.numer,n),wn(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Un(e.barSize,n);t.setAttribute("linethickness",Ve(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var a=new qe("mo",[new hr(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}if(s.push(t),e.rightDelim!=null){var o=new qe("mo",[new hr(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}return kx(s)}return t},iz=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};Ze({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],a=n[1],o,l=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",c=")";break;case"\\\\bracefrac":o=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var f=r==="\\cfrac",_=null;return f||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),iz({type:"genfrac",mode:t.mode,numer:s,denom:a,continued:f,hasBarLine:o,leftDelim:l,rightDelim:c,barSize:null},_)},htmlBuilder:wnt,mathmlBuilder:Snt});Ze({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 GS=["display","text","script","scriptscript"],VS=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};Ze({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],a=L0(n[0]),o=a.type==="atom"&&a.family==="open"?VS(a.text):null,l=L0(n[1]),c=l.type==="atom"&&l.family==="close"?VS(l.text):null,f=Tt(n[2],"size"),_,h=null;f.isBlank?_=!0:(h=f.value,_=h.number>0);var m=null,g=n[3];if(g.type==="ordgroup"){if(g.body.length>0){var S=Tt(g.body[0],"textord");m=GS[Number(S.text)]}}else g=Tt(g,"textord"),m=GS[Number(g.text)];return iz({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:h,leftDelim:o,rightDelim:c},m)}});Ze({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:Tt(n[0],"size").value,token:s}}});Ze({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],a=Tt(n[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=n[2],l=a.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var az=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?tn(e.sup,n.havingStyle(t.sup()),n):tn(e.sub,n.havingStyle(t.sub()),n),s=Tt(e.base,"horizBrace")):s=Tt(e,"horizBrace");var a=tn(s.base,n.havingBaseStyle(wt.DISPLAY)),o=wp(s,n),l;if(s.isOver?l=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=Jt({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var c=Pe(["minner",s.isOver?"mover":"munder"],[l],n);s.isOver?l=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Jt({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Pe(["minner",s.isOver?"mover":"munder"],[l],n)},knt=(e,n)=>{var t=yp(e.label);return new qe(e.isOver?"mover":"munder",[wn(e.base,n),t])};Ze({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:az,mathmlBuilder:knt});Ze({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=Tt(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:dr(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=kr(e.body,n,!1);return Itt(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=il(e.body,n);return t instanceof qe||(t=new qe("mrow",[t])),t.setAttribute("href",e.href),t}});Ze({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=Tt(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],a=0;a{var{parser:t,funcName:r,token:s}=e,a=Tt(n[0],"raw").string,o=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":c.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":c.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var f=a.split(","),_=0;_{var t=kr(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Pe(r,t,n);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&s.setAttribute(a,e.attributes[a]);return s},mathmlBuilder:(e,n)=>il(e.body,n)});Ze({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:dr(n[0]),mathml:dr(n[1])}},htmlBuilder:(e,n)=>{var t=kr(e.html,n,!1);return fo(t)},mathmlBuilder:(e,n)=>il(e.mathml,n)});var J1=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 Ue("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!wN(r))throw new Ue("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ze({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"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(t[0])for(var c=Tt(t[0],"raw").string,f=c.split(","),_=0;_{var t=Un(e.height,n),r=0;e.totalheight.number>0&&(r=Un(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Un(e.width,n));var a={height:Ve(t+r)};s>0&&(a.width=Ve(s)),r>0&&(a.verticalAlign=Ve(-r));var o=new Ctt(e.src,e.alt,a);return o.height=t,o.depth=r,o},mathmlBuilder:(e,n)=>{var t=new qe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Un(e.height,n),s=0;if(e.totalheight.number>0&&(s=Un(e.totalheight,n)-r,t.setAttribute("valign",Ve(-s))),t.setAttribute("height",Ve(r+s)),e.width.number>0){var a=Un(e.width,n);t.setAttribute("width",Ve(a))}return t.setAttribute("src",e.src),t}});Ze({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=Tt(n[0],"size");if(t.settings.strict){var a=r[1]==="m",o=s.value.unit==="mu";a?(o||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")):o&&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 zN(e.dimension,n)},mathmlBuilder(e,n){var t=Un(e.dimension,n);return new DN(t)}});Ze({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=Pe([],[tn(e.body,n)]),t=Pe(["inner"],[t],n)):t=Pe(["inner"],[tn(e.body,n)]);var r=Pe(["fix"],[]),s=Pe([e.alignment],[t,r],n),a=Pe(["strut"]);return a.style.height=Ve(s.height+s.depth),s.depth&&(a.style.verticalAlign=Ve(-s.depth)),s.children.unshift(a),s=Pe(["thinbox"],[s],n),Pe(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new qe("mpadded",[wn(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}});Ze({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 a=t==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});Ze({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ue("Mismatched "+e.funcName)}});var WS=(e,n)=>{switch(n.style.size){case wt.DISPLAY.size:return e.display;case wt.TEXT.size:return e.text;case wt.SCRIPT.size:return e.script;case wt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ze({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:dr(n[0]),text:dr(n[1]),script:dr(n[2]),scriptscript:dr(n[3])}},htmlBuilder:(e,n)=>{var t=WS(e,n),r=kr(t,n,!1);return fo(r)},mathmlBuilder:(e,n)=>{var t=WS(e,n);return il(t,n)}});var oz=(e,n,t,r,s,a,o)=>{e=Pe([],[e]);var l=t&&co(t),c,f;if(n){var _=tn(n,r.havingStyle(s.sup()),r);f={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var h=tn(t,r.havingStyle(s.sub()),r);c={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}var m;if(f&&c){var g=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;m=Jt({positionType:"bottom",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ve(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Ve(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var S=e.height-o;m=Jt({positionType:"top",positionData:S,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ve(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(f){var k=e.depth+o;m=Jt({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Ve(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[m];if(c&&a!==0&&!l){var b=Pe(["mspace"],[],r);b.style.marginRight=Ve(a),v.unshift(b)}return Pe(["mop","op-limits"],v,r)},lz=new Set(["\\smallint"]),qu=(e,n)=>{var t,r,s=!1,a;e.type==="supsub"?(t=e.sup,r=e.sub,a=Tt(e.base,"op"),s=!0):a=Tt(e,"op");var o=n.style,l=!1;o.size===wt.DISPLAY.size&&a.symbol&&!lz.has(a.name)&&(l=!0);var c,f;if(a.symbol){var _=l?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),c=ss(a.name,_,"math",n,["mop","op-symbol",l?"large-op":"small-op"]),f=c.italic,h.length>0){var m=jN(h+"Size"+(l?"2":"1"),n);c=Jt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:m,shift:l?.08:0}]}),a.name="\\"+h,c.classes.unshift("mop"),c.italic=f}}else if(a.body){var g=kr(a.body,n,!0);g.length===1&&g[0]instanceof Xs?(c=g[0],c.classes[0]="mop"):c=Pe(["mop"],g,n)}else{for(var S=[],k=1;k{var t;if(e.symbol)t=new qe("mo",[Si(e.name,e.mode)]),lz.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new qe("mo",Js(e.body,n));else{t=new qe("mi",[new hr(e.name.slice(1))]);var r=new qe("mo",[Si("⁡","text")]);e.parentIsSupSub?t=new qe("mrow",[t,r]):t=RN([t,r])}return t},Cnt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ze({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=Cnt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:qu,mathmlBuilder:eh});Ze({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:dr(r)}},htmlBuilder:qu,mathmlBuilder:eh});var Ent={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ze({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:qu,mathmlBuilder:eh});Ze({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:qu,mathmlBuilder:eh});Ze({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=Ent[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:qu,mathmlBuilder:eh});var cz=(e,n)=>{var t,r,s=!1,a;e.type==="supsub"?(t=e.sup,r=e.sub,a=Tt(e.base,"operatorname"),s=!0):a=Tt(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(h=>{var m="text"in h?h.text:void 0;return typeof m=="string"?{type:"textord",mode:h.mode,text:m}:h}),c=kr(l,n.withFont("mathrm"),!0),f=0;f{for(var t=Js(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new hr(l)]}var c=new qe("mi",t);c.setAttribute("mathvariant","normal");var f=new qe("mo",[Si("⁡","text")]);return e.parentIsSupSub?new qe("mrow",[c,f]):RN([c,f])};Ze({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:dr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:cz,mathmlBuilder:Nnt});ne("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");uc({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?fo(kr(e.body,n,!1)):Pe(["mord"],kr(e.body,n,!0),n)},mathmlBuilder(e,n){return il(e.body,n,!0)}});Ze({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=tn(e.body,n.havingCrampedStyle()),r=Nu("overline-line",n),s=n.fontMetrics().defaultRuleThickness,a=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Pe(["mord","overline"],[a],n)},mathmlBuilder(e,n){var t=new qe("mo",[new hr("‾")]);t.setAttribute("stretchy","true");var r=new qe("mover",[wn(e.body,n),t]);return r.setAttribute("accent","true"),r}});Ze({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:dr(r)}},htmlBuilder:(e,n)=>{var t=kr(e.body,n.withPhantom(),!1);return fo(t)},mathmlBuilder:(e,n)=>{var t=Js(e.body,n);return new qe("mphantom",t)}});ne("\\hphantom","\\smash{\\phantom{#1}}");Ze({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=Pe(["inner"],[tn(e.body,n.withPhantom())]),r=Pe(["fix"],[]);return Pe(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=Js(dr(e.body),n),r=new qe("mphantom",t),s=new qe("mpadded",[r]);return s.setAttribute("width","0px"),s}});Ze({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=Tt(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=tn(e.body,n),r=Un(e.dy,n);return Jt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new qe("mpadded",[wn(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});Ze({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});Ze({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],a=Tt(n[0],"size"),o=Tt(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&Tt(s,"size").value,width:a.value,height:o.value}},htmlBuilder(e,n){var t=Pe(["mord","rule"],[],n),r=Un(e.width,n),s=Un(e.height,n),a=e.shift?Un(e.shift,n):0;return t.style.borderRightWidth=Ve(r),t.style.borderTopWidth=Ve(s),t.style.bottom=Ve(a),t.width=r,t.height=s+a,t.depth=-a,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Un(e.width,n),r=Un(e.height,n),s=e.shift?Un(e.shift,n):0,a=n.color&&n.getColor()||"black",o=new qe("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",Ve(t)),o.setAttribute("height",Ve(r));var l=new qe("mpadded",[o]);return s>=0?l.setAttribute("height",Ve(s)):(l.setAttribute("height",Ve(s)),l.setAttribute("depth",Ve(-s))),l.setAttribute("voffset",Ve(s)),l}});function uz(e,n,t){for(var r=kr(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,a=0;a{var t=n.havingSize(e.size);return uz(e.body,t,n)};Ze({type:"sizing",names:KS,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,a=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:KS.indexOf(r)+1,body:a}},htmlBuilder:znt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=Js(e.body,t),s=new qe("mstyle",r);return s.setAttribute("mathsize",Ve(t.sizeMultiplier)),s}});Ze({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,a=!1,o=t[0]&&Tt(t[0],"ordgroup");if(o)for(var l,c=0;c{var t=Pe([],[tn(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 Pe(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new qe("mpadded",[wn(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});Ze({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],a=n[0];return{type:"sqrt",mode:r.mode,body:a,index:s}},htmlBuilder(e,n){var t=tn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=zu(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,a=s;n.style.idt.height+t.depth+o&&(o=(o+h-t.height-t.depth)/2);var m=c.height-t.height-o-f;t.style.paddingLeft=Ve(_);var g=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+m)},{type:"elem",elem:c},{type:"kern",size:f}]});if(e.index){var S=n.havingStyle(wt.SCRIPTSCRIPT),k=tn(e.index,S,n),v=.6*(g.height-g.depth),b=Jt({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),w=Pe(["root"],[b]);return Pe(["mord","sqrt"],[w,g],n)}else return Pe(["mord","sqrt"],[g],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new qe("mroot",[wn(t,n),wn(r,n)]):new qe("msqrt",[wn(t,n)])}});var Lv={display:wt.DISPLAY,text:wt.TEXT,script:wt.SCRIPT,scriptscript:wt.SCRIPTSCRIPT};function Ant(e){return e in Lv}Ze({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,a=s.parseExpression(!0,t),o=r.slice(1,r.length-5);if(!Ant(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:s.mode,style:o,body:a}},htmlBuilder(e,n){var t=Lv[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),uz(e.body,r,n)},mathmlBuilder(e,n){var t=Lv[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=Js(e.body,r),a=new qe("mstyle",s),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var jnt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===wt.DISPLAY.size||r.alwaysHandleSupSub);return s?qu:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(t.style.size===wt.DISPLAY.size||r.limits);return a?cz:null}else{if(r.type==="accent")return co(r.base)?Ex:null;if(r.type==="horizBrace"){var o=!n.sub;return o===r.isOver?az:null}else return null}else return null};uc({type:"supsub",htmlBuilder(e,n){var t=jnt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:a}=e,o=tn(r,n),l,c,f=n.fontMetrics(),_=0,h=0,m=r&&co(r);if(s){var g=n.havingStyle(n.style.sup());l=tn(s,g,n),m||(_=o.height-g.fontMetrics().supDrop*g.sizeMultiplier/n.sizeMultiplier)}if(a){var S=n.havingStyle(n.style.sub());c=tn(a,S,n),m||(h=o.depth+S.fontMetrics().subDrop*S.sizeMultiplier/n.sizeMultiplier)}var k;n.style===wt.DISPLAY?k=f.sup1:n.style.cramped?k=f.sup3:k=f.sup2;var v=n.sizeMultiplier,b=Ve(.5/f.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(o instanceof Xs||y){var C;w=Ve(-((C=o.italic)!=null?C:0))}}var z;if(l&&c){_=Math.max(_,k,l.depth+.25*f.xHeight),h=Math.max(h,f.sub2);var N=f.defaultRuleThickness,T=4*N;if(_-l.depth-(c.height-h)0&&(_+=j,h-=j)}var D=[{type:"elem",elem:c,shift:h,marginRight:b,marginLeft:w},{type:"elem",elem:l,shift:-_,marginRight:b}];z=Jt({positionType:"individualShift",children:D})}else if(c){h=Math.max(h,f.sub1,c.height-.8*f.xHeight);var I=[{type:"elem",elem:c,marginLeft:w,marginRight:b}];z=Jt({positionType:"shift",positionData:h,children:I})}else if(l)_=Math.max(_,k,l.depth+.25*f.xHeight),z=Jt({positionType:"shift",positionData:-_,children:[{type:"elem",elem:l,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var L=jv(o,"right")||"mord";return Pe([L],[o,Pe(["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 a=[wn(e.base,n)];e.sub&&a.push(wn(e.sub,n)),e.sup&&a.push(wn(e.sup,n));var o;if(t)o=r?"mover":"munder";else if(e.sub)if(e.sup){var f=e.base;f&&f.type==="op"&&f.limits&&n.style===wt.DISPLAY||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(n.style===wt.DISPLAY||f.limits)?o="munderover":o="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===wt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===wt.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===wt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===wt.DISPLAY)?o="mover":o="msup"}return new qe(o,a)}});uc({type:"atom",htmlBuilder(e,n){return wx(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new qe("mo",[Si(e.text,e.mode)]);if(e.family==="bin"){var r=Cx(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 fz={mi:"italic",mn:"normal",mtext:"normal"};uc({type:"mathord",htmlBuilder(e,n){return xp(e,n,"mathord")},mathmlBuilder(e,n){var t=new qe("mi",[Si(e.text,e.mode,n)]),r=Cx(e,n)||"italic";return r!==fz[t.type]&&t.setAttribute("mathvariant",r),t}});uc({type:"textord",htmlBuilder(e,n){return xp(e,n,"textord")},mathmlBuilder(e,n){var t=Si(e.text,e.mode,n),r=Cx(e,n)||"normal",s;return e.mode==="text"?s=new qe("mtext",[t]):/[0-9]/.test(e.text)?s=new qe("mn",[t]):e.text==="\\prime"?s=new qe("mo",[t]):s=new qe("mi",[t]),r!==fz[s.type]&&s.setAttribute("mathvariant",r),s}});var eb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},tb={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};uc({type:"spacing",htmlBuilder(e,n){if(tb.hasOwnProperty(e.text)){var t=tb[e.text].className||"";if(e.mode==="text"){var r=xp(e,n,"textord");return r.classes.push(t),r}else return Pe(["mspace",t],[wx(e.text,e.mode,n)],n)}else{if(eb.hasOwnProperty(e.text))return Pe(["mspace",eb[e.text]],[],n);throw new Ue('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(tb.hasOwnProperty(e.text))t=new qe("mtext",[new hr(" ")]);else{if(eb.hasOwnProperty(e.text))return new qe("mspace");throw new Ue('Unknown type of space "'+e.text+'"')}return t}});var XS=()=>{var e=new qe("mtd",[]);return e.setAttribute("width","50%"),e};uc({type:"tag",mathmlBuilder(e,n){var t=new qe("mtable",[new qe("mtr",[XS(),new qe("mtd",[il(e.body,n)]),XS(),new qe("mtd",[il(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var YS={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ZS={"\\textbf":"textbf","\\textmd":"textmd"},Tnt={"\\textit":"textit","\\textup":"textup"},QS=(e,n)=>{var t=e.font;if(t){if(YS[t])return n.withTextFontFamily(YS[t]);if(ZS[t])return n.withTextFontWeight(ZS[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(Tnt[t])};Ze({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:dr(s),font:r}},htmlBuilder(e,n){var t=QS(e,n),r=kr(e.body,t,!0);return Pe(["mord","text"],r,t)},mathmlBuilder(e,n){var t=QS(e,n);return il(e.body,t)}});Ze({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=tn(e.body,n),r=Nu("underline-line",n),s=n.fontMetrics().defaultRuleThickness,a=Jt({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Pe(["mord","underline"],[a],n)},mathmlBuilder(e,n){var t=new qe("mo",[new hr("‾")]);t.setAttribute("stretchy","true");var r=new qe("munder",[wn(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});Ze({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=tn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Jt({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new qe("mpadded",[wn(e.body,n)],["vcenter"]);return new qe("mrow",[t])}});Ze({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ue("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=JS(e),r=[],s=n.havingStyle(n.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),el=TN,dz=`[ \r - ]`,Mnt="\\\\[a-zA-Z@]+",Rnt="\\\\[^\uD800-\uDFFF]",Dnt="("+Mnt+")"+dz+"*",Lnt=`\\\\( +-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 int(e){return"toText"in e}class Fu{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(int(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var wv={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},ant={ex:!0,em:!0,mu:!0},CN=function(n){return typeof n!="string"&&(n=n.unit),n in wv||n in ant||n==="ex"},Vn=function(n,t){var r;if(n.unit in wv)r=wv[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 Pe("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},Ge=function(n){return+n.toFixed(4)+"em"},nl=function(n){return n.filter(t=>t).join(" ")},wx=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=Dtt(r)+":"+s+";")}return t},EN=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)}},NN=function(n){var t=document.createElement(n);t.className=nl(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]/,zN=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+ts(nl(this.classes))+'"');var r=wx(this.style);r&&(t+=' style="'+ts(r)+'"');for(var s of Object.keys(this.attributes)){if(ont.test(s))throw new Pe("Invalid attribute name '"+s+"'");t+=" "+s+'="'+ts(this.attributes[s])+'"'}t+=">";for(var a=0;a",t};class Pu{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,EN.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return NN.call(this,"span")}toMarkup(){return zN.call(this,"span")}}class vp{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,EN.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 NN.call(this,"a")}toMarkup(){return zN.call(this,"a")}}class lnt{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=''+ts(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=Ge(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=nl(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:"+Ge(this.italic)+";"),r+=wx(this.style),r&&(n=!0,t+=' style="'+ts(r)+'"');var s=ts(this.text);return n?(t+=">",t+=s,t+="",t):s}}class io{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 Sv{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 hnt=e=>e instanceof Pu||e instanceof vp||e instanceof Fu,pa={"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]}},k_={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]},kS={Å:"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 dnt(e,n){pa[e]=n}function Sx(e,n,t){if(!pa[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=pa[n][r];if(!s&&e[0]in kS&&(r=kS[e[0]].charCodeAt(0),s=pa[n][r]),!s&&t==="text"&&kN(r)&&(s=pa[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var q1={};function _nt(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!q1[n]){var t=q1[n]={cssEmPerMu:k_.quad[n]/18};for(var r in k_)k_.hasOwnProperty(r)&&(t[r]=k_[r][n])}return q1[n]}var Bn={math:{},text:{}};function O(e,n,t,r,s,a){Bn[e][s]={font:n,group:t,replace:r},a&&r&&(Bn[e][r]=Bn[e][s])}var U="math",Be="text",Q="main",le="ams",Hn="accent-token",Je="bin",_s="close",Uu="inner",_t="mathord",vr="op-token",ti="open",Jh="punct",fe="rel",uo="spacing",pe="textord";O(U,Q,fe,"≡","\\equiv",!0);O(U,Q,fe,"≺","\\prec",!0);O(U,Q,fe,"≻","\\succ",!0);O(U,Q,fe,"∼","\\sim",!0);O(U,Q,fe,"⊥","\\perp");O(U,Q,fe,"⪯","\\preceq",!0);O(U,Q,fe,"⪰","\\succeq",!0);O(U,Q,fe,"≃","\\simeq",!0);O(U,Q,fe,"∣","\\mid",!0);O(U,Q,fe,"≪","\\ll",!0);O(U,Q,fe,"≫","\\gg",!0);O(U,Q,fe,"≍","\\asymp",!0);O(U,Q,fe,"∥","\\parallel");O(U,Q,fe,"⋈","\\bowtie",!0);O(U,Q,fe,"⌣","\\smile",!0);O(U,Q,fe,"⊑","\\sqsubseteq",!0);O(U,Q,fe,"⊒","\\sqsupseteq",!0);O(U,Q,fe,"≐","\\doteq",!0);O(U,Q,fe,"⌢","\\frown",!0);O(U,Q,fe,"∋","\\ni",!0);O(U,Q,fe,"∝","\\propto",!0);O(U,Q,fe,"⊢","\\vdash",!0);O(U,Q,fe,"⊣","\\dashv",!0);O(U,Q,fe,"∋","\\owns");O(U,Q,Jh,".","\\ldotp");O(U,Q,Jh,"⋅","\\cdotp");O(U,Q,Jh,"⋅","·");O(Be,Q,pe,"⋅","·");O(U,Q,pe,"#","\\#");O(Be,Q,pe,"#","\\#");O(U,Q,pe,"&","\\&");O(Be,Q,pe,"&","\\&");O(U,Q,pe,"ℵ","\\aleph",!0);O(U,Q,pe,"∀","\\forall",!0);O(U,Q,pe,"ℏ","\\hbar",!0);O(U,Q,pe,"∃","\\exists",!0);O(U,Q,pe,"∇","\\nabla",!0);O(U,Q,pe,"♭","\\flat",!0);O(U,Q,pe,"ℓ","\\ell",!0);O(U,Q,pe,"♮","\\natural",!0);O(U,Q,pe,"♣","\\clubsuit",!0);O(U,Q,pe,"℘","\\wp",!0);O(U,Q,pe,"♯","\\sharp",!0);O(U,Q,pe,"♢","\\diamondsuit",!0);O(U,Q,pe,"ℜ","\\Re",!0);O(U,Q,pe,"♡","\\heartsuit",!0);O(U,Q,pe,"ℑ","\\Im",!0);O(U,Q,pe,"♠","\\spadesuit",!0);O(U,Q,pe,"§","\\S",!0);O(Be,Q,pe,"§","\\S");O(U,Q,pe,"¶","\\P",!0);O(Be,Q,pe,"¶","\\P");O(U,Q,pe,"†","\\dag");O(Be,Q,pe,"†","\\dag");O(Be,Q,pe,"†","\\textdagger");O(U,Q,pe,"‡","\\ddag");O(Be,Q,pe,"‡","\\ddag");O(Be,Q,pe,"‡","\\textdaggerdbl");O(U,Q,_s,"⎱","\\rmoustache",!0);O(U,Q,ti,"⎰","\\lmoustache",!0);O(U,Q,_s,"⟯","\\rgroup",!0);O(U,Q,ti,"⟮","\\lgroup",!0);O(U,Q,Je,"∓","\\mp",!0);O(U,Q,Je,"⊖","\\ominus",!0);O(U,Q,Je,"⊎","\\uplus",!0);O(U,Q,Je,"⊓","\\sqcap",!0);O(U,Q,Je,"∗","\\ast");O(U,Q,Je,"⊔","\\sqcup",!0);O(U,Q,Je,"◯","\\bigcirc",!0);O(U,Q,Je,"∙","\\bullet",!0);O(U,Q,Je,"‡","\\ddagger");O(U,Q,Je,"≀","\\wr",!0);O(U,Q,Je,"⨿","\\amalg");O(U,Q,Je,"&","\\And");O(U,Q,fe,"⟵","\\longleftarrow",!0);O(U,Q,fe,"⇐","\\Leftarrow",!0);O(U,Q,fe,"⟸","\\Longleftarrow",!0);O(U,Q,fe,"⟶","\\longrightarrow",!0);O(U,Q,fe,"⇒","\\Rightarrow",!0);O(U,Q,fe,"⟹","\\Longrightarrow",!0);O(U,Q,fe,"↔","\\leftrightarrow",!0);O(U,Q,fe,"⟷","\\longleftrightarrow",!0);O(U,Q,fe,"⇔","\\Leftrightarrow",!0);O(U,Q,fe,"⟺","\\Longleftrightarrow",!0);O(U,Q,fe,"↦","\\mapsto",!0);O(U,Q,fe,"⟼","\\longmapsto",!0);O(U,Q,fe,"↗","\\nearrow",!0);O(U,Q,fe,"↩","\\hookleftarrow",!0);O(U,Q,fe,"↪","\\hookrightarrow",!0);O(U,Q,fe,"↘","\\searrow",!0);O(U,Q,fe,"↼","\\leftharpoonup",!0);O(U,Q,fe,"⇀","\\rightharpoonup",!0);O(U,Q,fe,"↙","\\swarrow",!0);O(U,Q,fe,"↽","\\leftharpoondown",!0);O(U,Q,fe,"⇁","\\rightharpoondown",!0);O(U,Q,fe,"↖","\\nwarrow",!0);O(U,Q,fe,"⇌","\\rightleftharpoons",!0);O(U,le,fe,"≮","\\nless",!0);O(U,le,fe,"","\\@nleqslant");O(U,le,fe,"","\\@nleqq");O(U,le,fe,"⪇","\\lneq",!0);O(U,le,fe,"≨","\\lneqq",!0);O(U,le,fe,"","\\@lvertneqq");O(U,le,fe,"⋦","\\lnsim",!0);O(U,le,fe,"⪉","\\lnapprox",!0);O(U,le,fe,"⊀","\\nprec",!0);O(U,le,fe,"⋠","\\npreceq",!0);O(U,le,fe,"⋨","\\precnsim",!0);O(U,le,fe,"⪹","\\precnapprox",!0);O(U,le,fe,"≁","\\nsim",!0);O(U,le,fe,"","\\@nshortmid");O(U,le,fe,"∤","\\nmid",!0);O(U,le,fe,"⊬","\\nvdash",!0);O(U,le,fe,"⊭","\\nvDash",!0);O(U,le,fe,"⋪","\\ntriangleleft");O(U,le,fe,"⋬","\\ntrianglelefteq",!0);O(U,le,fe,"⊊","\\subsetneq",!0);O(U,le,fe,"","\\@varsubsetneq");O(U,le,fe,"⫋","\\subsetneqq",!0);O(U,le,fe,"","\\@varsubsetneqq");O(U,le,fe,"≯","\\ngtr",!0);O(U,le,fe,"","\\@ngeqslant");O(U,le,fe,"","\\@ngeqq");O(U,le,fe,"⪈","\\gneq",!0);O(U,le,fe,"≩","\\gneqq",!0);O(U,le,fe,"","\\@gvertneqq");O(U,le,fe,"⋧","\\gnsim",!0);O(U,le,fe,"⪊","\\gnapprox",!0);O(U,le,fe,"⊁","\\nsucc",!0);O(U,le,fe,"⋡","\\nsucceq",!0);O(U,le,fe,"⋩","\\succnsim",!0);O(U,le,fe,"⪺","\\succnapprox",!0);O(U,le,fe,"≆","\\ncong",!0);O(U,le,fe,"","\\@nshortparallel");O(U,le,fe,"∦","\\nparallel",!0);O(U,le,fe,"⊯","\\nVDash",!0);O(U,le,fe,"⋫","\\ntriangleright");O(U,le,fe,"⋭","\\ntrianglerighteq",!0);O(U,le,fe,"","\\@nsupseteqq");O(U,le,fe,"⊋","\\supsetneq",!0);O(U,le,fe,"","\\@varsupsetneq");O(U,le,fe,"⫌","\\supsetneqq",!0);O(U,le,fe,"","\\@varsupsetneqq");O(U,le,fe,"⊮","\\nVdash",!0);O(U,le,fe,"⪵","\\precneqq",!0);O(U,le,fe,"⪶","\\succneqq",!0);O(U,le,fe,"","\\@nsubseteqq");O(U,le,Je,"⊴","\\unlhd");O(U,le,Je,"⊵","\\unrhd");O(U,le,fe,"↚","\\nleftarrow",!0);O(U,le,fe,"↛","\\nrightarrow",!0);O(U,le,fe,"⇍","\\nLeftarrow",!0);O(U,le,fe,"⇏","\\nRightarrow",!0);O(U,le,fe,"↮","\\nleftrightarrow",!0);O(U,le,fe,"⇎","\\nLeftrightarrow",!0);O(U,le,fe,"△","\\vartriangle");O(U,le,pe,"ℏ","\\hslash");O(U,le,pe,"▽","\\triangledown");O(U,le,pe,"◊","\\lozenge");O(U,le,pe,"Ⓢ","\\circledS");O(U,le,pe,"®","\\circledR");O(Be,le,pe,"®","\\circledR");O(U,le,pe,"∡","\\measuredangle",!0);O(U,le,pe,"∄","\\nexists");O(U,le,pe,"℧","\\mho");O(U,le,pe,"Ⅎ","\\Finv",!0);O(U,le,pe,"⅁","\\Game",!0);O(U,le,pe,"‵","\\backprime");O(U,le,pe,"▲","\\blacktriangle");O(U,le,pe,"▼","\\blacktriangledown");O(U,le,pe,"■","\\blacksquare");O(U,le,pe,"⧫","\\blacklozenge");O(U,le,pe,"★","\\bigstar");O(U,le,pe,"∢","\\sphericalangle",!0);O(U,le,pe,"∁","\\complement",!0);O(U,le,pe,"ð","\\eth",!0);O(Be,Q,pe,"ð","ð");O(U,le,pe,"╱","\\diagup");O(U,le,pe,"╲","\\diagdown");O(U,le,pe,"□","\\square");O(U,le,pe,"□","\\Box");O(U,le,pe,"◊","\\Diamond");O(U,le,pe,"¥","\\yen",!0);O(Be,le,pe,"¥","\\yen",!0);O(U,le,pe,"✓","\\checkmark",!0);O(Be,le,pe,"✓","\\checkmark");O(U,le,pe,"ℶ","\\beth",!0);O(U,le,pe,"ℸ","\\daleth",!0);O(U,le,pe,"ℷ","\\gimel",!0);O(U,le,pe,"ϝ","\\digamma",!0);O(U,le,pe,"ϰ","\\varkappa");O(U,le,ti,"┌","\\@ulcorner",!0);O(U,le,_s,"┐","\\@urcorner",!0);O(U,le,ti,"└","\\@llcorner",!0);O(U,le,_s,"┘","\\@lrcorner",!0);O(U,le,fe,"≦","\\leqq",!0);O(U,le,fe,"⩽","\\leqslant",!0);O(U,le,fe,"⪕","\\eqslantless",!0);O(U,le,fe,"≲","\\lesssim",!0);O(U,le,fe,"⪅","\\lessapprox",!0);O(U,le,fe,"≊","\\approxeq",!0);O(U,le,Je,"⋖","\\lessdot");O(U,le,fe,"⋘","\\lll",!0);O(U,le,fe,"≶","\\lessgtr",!0);O(U,le,fe,"⋚","\\lesseqgtr",!0);O(U,le,fe,"⪋","\\lesseqqgtr",!0);O(U,le,fe,"≑","\\doteqdot");O(U,le,fe,"≓","\\risingdotseq",!0);O(U,le,fe,"≒","\\fallingdotseq",!0);O(U,le,fe,"∽","\\backsim",!0);O(U,le,fe,"⋍","\\backsimeq",!0);O(U,le,fe,"⫅","\\subseteqq",!0);O(U,le,fe,"⋐","\\Subset",!0);O(U,le,fe,"⊏","\\sqsubset",!0);O(U,le,fe,"≼","\\preccurlyeq",!0);O(U,le,fe,"⋞","\\curlyeqprec",!0);O(U,le,fe,"≾","\\precsim",!0);O(U,le,fe,"⪷","\\precapprox",!0);O(U,le,fe,"⊲","\\vartriangleleft");O(U,le,fe,"⊴","\\trianglelefteq");O(U,le,fe,"⊨","\\vDash",!0);O(U,le,fe,"⊪","\\Vvdash",!0);O(U,le,fe,"⌣","\\smallsmile");O(U,le,fe,"⌢","\\smallfrown");O(U,le,fe,"≏","\\bumpeq",!0);O(U,le,fe,"≎","\\Bumpeq",!0);O(U,le,fe,"≧","\\geqq",!0);O(U,le,fe,"⩾","\\geqslant",!0);O(U,le,fe,"⪖","\\eqslantgtr",!0);O(U,le,fe,"≳","\\gtrsim",!0);O(U,le,fe,"⪆","\\gtrapprox",!0);O(U,le,Je,"⋗","\\gtrdot");O(U,le,fe,"⋙","\\ggg",!0);O(U,le,fe,"≷","\\gtrless",!0);O(U,le,fe,"⋛","\\gtreqless",!0);O(U,le,fe,"⪌","\\gtreqqless",!0);O(U,le,fe,"≖","\\eqcirc",!0);O(U,le,fe,"≗","\\circeq",!0);O(U,le,fe,"≜","\\triangleq",!0);O(U,le,fe,"∼","\\thicksim");O(U,le,fe,"≈","\\thickapprox");O(U,le,fe,"⫆","\\supseteqq",!0);O(U,le,fe,"⋑","\\Supset",!0);O(U,le,fe,"⊐","\\sqsupset",!0);O(U,le,fe,"≽","\\succcurlyeq",!0);O(U,le,fe,"⋟","\\curlyeqsucc",!0);O(U,le,fe,"≿","\\succsim",!0);O(U,le,fe,"⪸","\\succapprox",!0);O(U,le,fe,"⊳","\\vartriangleright");O(U,le,fe,"⊵","\\trianglerighteq");O(U,le,fe,"⊩","\\Vdash",!0);O(U,le,fe,"∣","\\shortmid");O(U,le,fe,"∥","\\shortparallel");O(U,le,fe,"≬","\\between",!0);O(U,le,fe,"⋔","\\pitchfork",!0);O(U,le,fe,"∝","\\varpropto");O(U,le,fe,"◀","\\blacktriangleleft");O(U,le,fe,"∴","\\therefore",!0);O(U,le,fe,"∍","\\backepsilon");O(U,le,fe,"▶","\\blacktriangleright");O(U,le,fe,"∵","\\because",!0);O(U,le,fe,"⋘","\\llless");O(U,le,fe,"⋙","\\gggtr");O(U,le,Je,"⊲","\\lhd");O(U,le,Je,"⊳","\\rhd");O(U,le,fe,"≂","\\eqsim",!0);O(U,Q,fe,"⋈","\\Join");O(U,le,fe,"≑","\\Doteq",!0);O(U,le,Je,"∔","\\dotplus",!0);O(U,le,Je,"∖","\\smallsetminus");O(U,le,Je,"⋒","\\Cap",!0);O(U,le,Je,"⋓","\\Cup",!0);O(U,le,Je,"⩞","\\doublebarwedge",!0);O(U,le,Je,"⊟","\\boxminus",!0);O(U,le,Je,"⊞","\\boxplus",!0);O(U,le,Je,"⋇","\\divideontimes",!0);O(U,le,Je,"⋉","\\ltimes",!0);O(U,le,Je,"⋊","\\rtimes",!0);O(U,le,Je,"⋋","\\leftthreetimes",!0);O(U,le,Je,"⋌","\\rightthreetimes",!0);O(U,le,Je,"⋏","\\curlywedge",!0);O(U,le,Je,"⋎","\\curlyvee",!0);O(U,le,Je,"⊝","\\circleddash",!0);O(U,le,Je,"⊛","\\circledast",!0);O(U,le,Je,"⋅","\\centerdot");O(U,le,Je,"⊺","\\intercal",!0);O(U,le,Je,"⋒","\\doublecap");O(U,le,Je,"⋓","\\doublecup");O(U,le,Je,"⊠","\\boxtimes",!0);O(U,le,fe,"⇢","\\dashrightarrow",!0);O(U,le,fe,"⇠","\\dashleftarrow",!0);O(U,le,fe,"⇇","\\leftleftarrows",!0);O(U,le,fe,"⇆","\\leftrightarrows",!0);O(U,le,fe,"⇚","\\Lleftarrow",!0);O(U,le,fe,"↞","\\twoheadleftarrow",!0);O(U,le,fe,"↢","\\leftarrowtail",!0);O(U,le,fe,"↫","\\looparrowleft",!0);O(U,le,fe,"⇋","\\leftrightharpoons",!0);O(U,le,fe,"↶","\\curvearrowleft",!0);O(U,le,fe,"↺","\\circlearrowleft",!0);O(U,le,fe,"↰","\\Lsh",!0);O(U,le,fe,"⇈","\\upuparrows",!0);O(U,le,fe,"↿","\\upharpoonleft",!0);O(U,le,fe,"⇃","\\downharpoonleft",!0);O(U,Q,fe,"⊶","\\origof",!0);O(U,Q,fe,"⊷","\\imageof",!0);O(U,le,fe,"⊸","\\multimap",!0);O(U,le,fe,"↭","\\leftrightsquigarrow",!0);O(U,le,fe,"⇉","\\rightrightarrows",!0);O(U,le,fe,"⇄","\\rightleftarrows",!0);O(U,le,fe,"↠","\\twoheadrightarrow",!0);O(U,le,fe,"↣","\\rightarrowtail",!0);O(U,le,fe,"↬","\\looparrowright",!0);O(U,le,fe,"↷","\\curvearrowright",!0);O(U,le,fe,"↻","\\circlearrowright",!0);O(U,le,fe,"↱","\\Rsh",!0);O(U,le,fe,"⇊","\\downdownarrows",!0);O(U,le,fe,"↾","\\upharpoonright",!0);O(U,le,fe,"⇂","\\downharpoonright",!0);O(U,le,fe,"⇝","\\rightsquigarrow",!0);O(U,le,fe,"⇝","\\leadsto");O(U,le,fe,"⇛","\\Rrightarrow",!0);O(U,le,fe,"↾","\\restriction");O(U,Q,pe,"‘","`");O(U,Q,pe,"$","\\$");O(Be,Q,pe,"$","\\$");O(Be,Q,pe,"$","\\textdollar");O(U,Q,pe,"%","\\%");O(Be,Q,pe,"%","\\%");O(U,Q,pe,"_","\\_");O(Be,Q,pe,"_","\\_");O(Be,Q,pe,"_","\\textunderscore");O(U,Q,pe,"∠","\\angle",!0);O(U,Q,pe,"∞","\\infty",!0);O(U,Q,pe,"′","\\prime");O(U,Q,pe,"△","\\triangle");O(U,Q,pe,"Γ","\\Gamma",!0);O(U,Q,pe,"Δ","\\Delta",!0);O(U,Q,pe,"Θ","\\Theta",!0);O(U,Q,pe,"Λ","\\Lambda",!0);O(U,Q,pe,"Ξ","\\Xi",!0);O(U,Q,pe,"Π","\\Pi",!0);O(U,Q,pe,"Σ","\\Sigma",!0);O(U,Q,pe,"Υ","\\Upsilon",!0);O(U,Q,pe,"Φ","\\Phi",!0);O(U,Q,pe,"Ψ","\\Psi",!0);O(U,Q,pe,"Ω","\\Omega",!0);O(U,Q,pe,"A","Α");O(U,Q,pe,"B","Β");O(U,Q,pe,"E","Ε");O(U,Q,pe,"Z","Ζ");O(U,Q,pe,"H","Η");O(U,Q,pe,"I","Ι");O(U,Q,pe,"K","Κ");O(U,Q,pe,"M","Μ");O(U,Q,pe,"N","Ν");O(U,Q,pe,"O","Ο");O(U,Q,pe,"P","Ρ");O(U,Q,pe,"T","Τ");O(U,Q,pe,"X","Χ");O(U,Q,pe,"¬","\\neg",!0);O(U,Q,pe,"¬","\\lnot");O(U,Q,pe,"⊤","\\top");O(U,Q,pe,"⊥","\\bot");O(U,Q,pe,"∅","\\emptyset");O(U,le,pe,"∅","\\varnothing");O(U,Q,_t,"α","\\alpha",!0);O(U,Q,_t,"β","\\beta",!0);O(U,Q,_t,"γ","\\gamma",!0);O(U,Q,_t,"δ","\\delta",!0);O(U,Q,_t,"ϵ","\\epsilon",!0);O(U,Q,_t,"ζ","\\zeta",!0);O(U,Q,_t,"η","\\eta",!0);O(U,Q,_t,"θ","\\theta",!0);O(U,Q,_t,"ι","\\iota",!0);O(U,Q,_t,"κ","\\kappa",!0);O(U,Q,_t,"λ","\\lambda",!0);O(U,Q,_t,"μ","\\mu",!0);O(U,Q,_t,"ν","\\nu",!0);O(U,Q,_t,"ξ","\\xi",!0);O(U,Q,_t,"ο","\\omicron",!0);O(U,Q,_t,"π","\\pi",!0);O(U,Q,_t,"ρ","\\rho",!0);O(U,Q,_t,"σ","\\sigma",!0);O(U,Q,_t,"τ","\\tau",!0);O(U,Q,_t,"υ","\\upsilon",!0);O(U,Q,_t,"ϕ","\\phi",!0);O(U,Q,_t,"χ","\\chi",!0);O(U,Q,_t,"ψ","\\psi",!0);O(U,Q,_t,"ω","\\omega",!0);O(U,Q,_t,"ε","\\varepsilon",!0);O(U,Q,_t,"ϑ","\\vartheta",!0);O(U,Q,_t,"ϖ","\\varpi",!0);O(U,Q,_t,"ϱ","\\varrho",!0);O(U,Q,_t,"ς","\\varsigma",!0);O(U,Q,_t,"φ","\\varphi",!0);O(U,Q,Je,"∗","*",!0);O(U,Q,Je,"+","+");O(U,Q,Je,"−","-",!0);O(U,Q,Je,"⋅","\\cdot",!0);O(U,Q,Je,"∘","\\circ",!0);O(U,Q,Je,"÷","\\div",!0);O(U,Q,Je,"±","\\pm",!0);O(U,Q,Je,"×","\\times",!0);O(U,Q,Je,"∩","\\cap",!0);O(U,Q,Je,"∪","\\cup",!0);O(U,Q,Je,"∖","\\setminus",!0);O(U,Q,Je,"∧","\\land");O(U,Q,Je,"∨","\\lor");O(U,Q,Je,"∧","\\wedge",!0);O(U,Q,Je,"∨","\\vee",!0);O(U,Q,pe,"√","\\surd");O(U,Q,ti,"⟨","\\langle",!0);O(U,Q,ti,"∣","\\lvert");O(U,Q,ti,"∥","\\lVert");O(U,Q,_s,"?","?");O(U,Q,_s,"!","!");O(U,Q,_s,"⟩","\\rangle",!0);O(U,Q,_s,"∣","\\rvert");O(U,Q,_s,"∥","\\rVert");O(U,Q,fe,"=","=");O(U,Q,fe,":",":");O(U,Q,fe,"≈","\\approx",!0);O(U,Q,fe,"≅","\\cong",!0);O(U,Q,fe,"≥","\\ge");O(U,Q,fe,"≥","\\geq",!0);O(U,Q,fe,"←","\\gets");O(U,Q,fe,">","\\gt",!0);O(U,Q,fe,"∈","\\in",!0);O(U,Q,fe,"","\\@not");O(U,Q,fe,"⊂","\\subset",!0);O(U,Q,fe,"⊃","\\supset",!0);O(U,Q,fe,"⊆","\\subseteq",!0);O(U,Q,fe,"⊇","\\supseteq",!0);O(U,le,fe,"⊈","\\nsubseteq",!0);O(U,le,fe,"⊉","\\nsupseteq",!0);O(U,Q,fe,"⊨","\\models");O(U,Q,fe,"←","\\leftarrow",!0);O(U,Q,fe,"≤","\\le");O(U,Q,fe,"≤","\\leq",!0);O(U,Q,fe,"<","\\lt",!0);O(U,Q,fe,"→","\\rightarrow",!0);O(U,Q,fe,"→","\\to");O(U,le,fe,"≱","\\ngeq",!0);O(U,le,fe,"≰","\\nleq",!0);O(U,Q,uo," ","\\ ");O(U,Q,uo," ","\\space");O(U,Q,uo," ","\\nobreakspace");O(Be,Q,uo," ","\\ ");O(Be,Q,uo," "," ");O(Be,Q,uo," ","\\space");O(Be,Q,uo," ","\\nobreakspace");O(U,Q,uo,"","\\nobreak");O(U,Q,uo,"","\\allowbreak");O(U,Q,Jh,",",",");O(U,Q,Jh,";",";");O(U,le,Je,"⊼","\\barwedge",!0);O(U,le,Je,"⊻","\\veebar",!0);O(U,Q,Je,"⊙","\\odot",!0);O(U,Q,Je,"⊕","\\oplus",!0);O(U,Q,Je,"⊗","\\otimes",!0);O(U,Q,pe,"∂","\\partial",!0);O(U,Q,Je,"⊘","\\oslash",!0);O(U,le,Je,"⊚","\\circledcirc",!0);O(U,le,Je,"⊡","\\boxdot",!0);O(U,Q,Je,"△","\\bigtriangleup");O(U,Q,Je,"▽","\\bigtriangledown");O(U,Q,Je,"†","\\dagger");O(U,Q,Je,"⋄","\\diamond");O(U,Q,Je,"⋆","\\star");O(U,Q,Je,"◃","\\triangleleft");O(U,Q,Je,"▹","\\triangleright");O(U,Q,ti,"{","\\{");O(Be,Q,pe,"{","\\{");O(Be,Q,pe,"{","\\textbraceleft");O(U,Q,_s,"}","\\}");O(Be,Q,pe,"}","\\}");O(Be,Q,pe,"}","\\textbraceright");O(U,Q,ti,"{","\\lbrace");O(U,Q,_s,"}","\\rbrace");O(U,Q,ti,"[","\\lbrack",!0);O(Be,Q,pe,"[","\\lbrack",!0);O(U,Q,_s,"]","\\rbrack",!0);O(Be,Q,pe,"]","\\rbrack",!0);O(U,Q,ti,"(","\\lparen",!0);O(U,Q,_s,")","\\rparen",!0);O(Be,Q,pe,"<","\\textless",!0);O(Be,Q,pe,">","\\textgreater",!0);O(U,Q,ti,"⌊","\\lfloor",!0);O(U,Q,_s,"⌋","\\rfloor",!0);O(U,Q,ti,"⌈","\\lceil",!0);O(U,Q,_s,"⌉","\\rceil",!0);O(U,Q,pe,"\\","\\backslash");O(U,Q,pe,"∣","|");O(U,Q,pe,"∣","\\vert");O(Be,Q,pe,"|","\\textbar",!0);O(U,Q,pe,"∥","\\|");O(U,Q,pe,"∥","\\Vert");O(Be,Q,pe,"∥","\\textbardbl");O(Be,Q,pe,"~","\\textasciitilde");O(Be,Q,pe,"\\","\\textbackslash");O(Be,Q,pe,"^","\\textasciicircum");O(U,Q,fe,"↑","\\uparrow",!0);O(U,Q,fe,"⇑","\\Uparrow",!0);O(U,Q,fe,"↓","\\downarrow",!0);O(U,Q,fe,"⇓","\\Downarrow",!0);O(U,Q,fe,"↕","\\updownarrow",!0);O(U,Q,fe,"⇕","\\Updownarrow",!0);O(U,Q,vr,"∐","\\coprod");O(U,Q,vr,"⋁","\\bigvee");O(U,Q,vr,"⋀","\\bigwedge");O(U,Q,vr,"⨄","\\biguplus");O(U,Q,vr,"⋂","\\bigcap");O(U,Q,vr,"⋃","\\bigcup");O(U,Q,vr,"∫","\\int");O(U,Q,vr,"∫","\\intop");O(U,Q,vr,"∬","\\iint");O(U,Q,vr,"∭","\\iiint");O(U,Q,vr,"∏","\\prod");O(U,Q,vr,"∑","\\sum");O(U,Q,vr,"⨂","\\bigotimes");O(U,Q,vr,"⨁","\\bigoplus");O(U,Q,vr,"⨀","\\bigodot");O(U,Q,vr,"∮","\\oint");O(U,Q,vr,"∯","\\oiint");O(U,Q,vr,"∰","\\oiiint");O(U,Q,vr,"⨆","\\bigsqcup");O(U,Q,vr,"∫","\\smallint");O(Be,Q,Uu,"…","\\textellipsis");O(U,Q,Uu,"…","\\mathellipsis");O(Be,Q,Uu,"…","\\ldots",!0);O(U,Q,Uu,"…","\\ldots",!0);O(U,Q,Uu,"⋯","\\@cdots",!0);O(U,Q,Uu,"⋱","\\ddots",!0);O(U,Q,pe,"⋮","\\varvdots");O(Be,Q,pe,"⋮","\\varvdots");O(U,Q,Hn,"ˊ","\\acute");O(U,Q,Hn,"ˋ","\\grave");O(U,Q,Hn,"¨","\\ddot");O(U,Q,Hn,"~","\\tilde");O(U,Q,Hn,"ˉ","\\bar");O(U,Q,Hn,"˘","\\breve");O(U,Q,Hn,"ˇ","\\check");O(U,Q,Hn,"^","\\hat");O(U,Q,Hn,"⃗","\\vec");O(U,Q,Hn,"˙","\\dot");O(U,Q,Hn,"˚","\\mathring");O(U,Q,_t,"","\\@imath");O(U,Q,_t,"","\\@jmath");O(U,Q,pe,"ı","ı");O(U,Q,pe,"ȷ","ȷ");O(Be,Q,pe,"ı","\\i",!0);O(Be,Q,pe,"ȷ","\\j",!0);O(Be,Q,pe,"ß","\\ss",!0);O(Be,Q,pe,"æ","\\ae",!0);O(Be,Q,pe,"œ","\\oe",!0);O(Be,Q,pe,"ø","\\o",!0);O(Be,Q,pe,"Æ","\\AE",!0);O(Be,Q,pe,"Œ","\\OE",!0);O(Be,Q,pe,"Ø","\\O",!0);O(Be,Q,Hn,"ˊ","\\'");O(Be,Q,Hn,"ˋ","\\`");O(Be,Q,Hn,"ˆ","\\^");O(Be,Q,Hn,"˜","\\~");O(Be,Q,Hn,"ˉ","\\=");O(Be,Q,Hn,"˘","\\u");O(Be,Q,Hn,"˙","\\.");O(Be,Q,Hn,"¸","\\c");O(Be,Q,Hn,"˚","\\r");O(Be,Q,Hn,"ˇ","\\v");O(Be,Q,Hn,"¨",'\\"');O(Be,Q,Hn,"˝","\\H");O(Be,Q,Hn,"◯","\\textcircled");var AN={"--":!0,"---":!0,"``":!0,"''":!0};O(Be,Q,pe,"–","--",!0);O(Be,Q,pe,"–","\\textendash");O(Be,Q,pe,"—","---",!0);O(Be,Q,pe,"—","\\textemdash");O(Be,Q,pe,"‘","`",!0);O(Be,Q,pe,"‘","\\textquoteleft");O(Be,Q,pe,"’","'",!0);O(Be,Q,pe,"’","\\textquoteright");O(Be,Q,pe,"“","``",!0);O(Be,Q,pe,"“","\\textquotedblleft");O(Be,Q,pe,"”","''",!0);O(Be,Q,pe,"”","\\textquotedblright");O(U,Q,pe,"°","\\degree",!0);O(Be,Q,pe,"°","\\degree");O(Be,Q,pe,"°","\\textdegree",!0);O(U,Q,pe,"£","\\pounds");O(U,Q,pe,"£","\\mathsterling",!0);O(Be,Q,pe,"£","\\pounds");O(Be,Q,pe,"£","\\textsterling",!0);O(U,le,pe,"✠","\\maltese");O(Be,le,pe,"✠","\\maltese");var CS='0123456789/@."';for(var G1=0;G1{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 LS[s]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return mnt[a]}else{if(r===120485||r===120486)return LS[0];if(120486{if(nl(e.classes)!==nl(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},jN=e=>{for(var n=0;nt&&(t=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>s&&(s=o.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},$e=function(n,t,r,s){var a=new Pu(n,t,r,s);return Cx(a),a},sl=(e,n,t,r)=>new Pu(e,n,t,r),Nu=function(n,t,r){var s=$e([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=Ge(s.height),s.maxFontSize=1,s},xnt=function(n,t,r,s){var a=new vp(n,t,r,s);return Cx(a),a},fo=function(n){var t=new Fu(n);return Cx(t),t},zu=function(n,t){return n instanceof Fu?$e([],[n],t):n},ynt=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,a=s,o=1;o{var t=$e(["mspace"],[],n),r=Vn(e,n);return t.style.marginRight=Ge(r),t},N_=(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},Av={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"}},MN={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},RN=function(n,t){var[r,s,a]=MN[n],o=new rl(r),l=new io([o],{width:Ge(s),height:Ge(a),style:"width:"+Ge(s),viewBox:"0 0 "+1e3*s+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),c=sl(["overlay"],[l],t);return c.height=a,c.style.height=Ge(a),c.style.width=Ge(s),c},Gn={number:3,unit:"mu"},Ol={number:4,unit:"mu"},Wa={number:5,unit:"mu"},wnt={mord:{mop:Gn,mbin:Ol,mrel:Wa,minner:Gn},mop:{mord:Gn,mop:Gn,mrel:Wa,minner:Gn},mbin:{mord:Ol,mop:Ol,mopen:Ol,minner:Ol},mrel:{mord:Wa,mop:Wa,mopen:Wa,minner:Wa},mopen:{},mclose:{mop:Gn,mbin:Ol,mrel:Wa,minner:Gn},mpunct:{mord:Gn,mop:Gn,mrel:Wa,mopen:Gn,mclose:Gn,mpunct:Gn,minner:Gn},minner:{mord:Gn,mop:Gn,mbin:Ol,mrel:Wa,mopen:Gn,mpunct:Gn,minner:Gn}},Snt={mord:{mop:Gn},mop:{mord:Gn,mop:Gn},mbin:{},mrel:{},mopen:{},mclose:{mop:Gn},mpunct:{},minner:{mop:Gn}},DN={},D0={},L0={};function Ye(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:a,mathmlBuilder:o}=e,l={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=S.classes[0];v==="mbin"&&Cnt.has(b)?k.classes[0]="mord":b==="mbin"&&knt.has(v)&&(S.classes[0]="mord")},{node:d},m,g),jv(a,(S,k)=>{var v,b,w=Mv(k),y=Mv(S),C=w&&y?S.hasClass("mtight")?(v=Snt[w])==null?void 0:v[y]:(b=wnt[w])==null?void 0:b[y]:null;if(C)return TN(C,f)},{node:d},m,g),a},jv=function(n,t,r,s,a){s&&n.push(s);for(var o=0;om=>{n.splice(d+1,0,m),o++})(o)}s&&n.pop()},LN=function(n){return n instanceof Fu||n instanceof vp||n instanceof Pu&&n.hasClass("enclosing")?n:null},Tv=function(n,t){var r=LN(n);if(r){var s=r.children;if(s.length){if(t==="right")return Tv(s[s.length-1],"right");if(t==="left")return Tv(s[0],"left")}}return n},Mv=function(n,t){if(!n)return null;t&&(n=Tv(n,t));var r=n.classes[0];return Nnt[r]||null},bh=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return $e(t.concat(r))},nn=function(n,t,r){if(!n)return $e();if(D0[n.type]){var s=D0[n.type](n,t);if(r&&t.size!==r.size){s=$e(t.sizingClasses(r),[s],t);var a=t.sizeMultiplier/r.sizeMultiplier;s.height*=a,s.depth*=a}return s}else throw new Pe("Got group of unknown type: '"+n.type+"'")};function z_(e,n){var t=$e(["base"],e,n),r=$e(["strut"]);return r.style.height=Ge(t.height+t.depth),t.depth&&(r.style.verticalAlign=Ge(-t.depth)),t.children.unshift(r),t}function Rv(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=Nr(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var a=[],o=[],l=0;l0&&(a.push(z_(o,n)),o=[]),a.push(r[l]));o.length>0&&a.push(z_(o,n));var f;t?(f=z_(Nr(t,n,!0),n),f.classes=["tag"],a.push(f)):s&&a.push(s);var _=$e(["katex-html"],a);if(_.setAttribute("aria-hidden","true"),f){var d=f.children[0];d.style.height=Ge(_.height+_.depth),_.depth&&(d.style.verticalAlign=Ge(-_.depth))}return _}function ON(e){return new Fu(e)}class Ue{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=nl(this.classes));for(var r=0;r0&&(n+=' class ="'+ts(nl(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class mr{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return ts(this.toText())}toText(){return this.text}}class IN{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",Ge(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var znt=new Set(["\\imath","\\jmath"]),Ant=new Set(["mrow","mtable"]),ki=function(n,t,r){return Bn[t][n]&&Bn[t][n].replace&&n.charCodeAt(0)!==55349&&!(AN.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Bn[t][n].replace),new mr(n)},Ex=function(n){return n.length===1?n[0]:new Ue("mrow",n)},jnt={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"},Nx=(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=jnt[t];if(s)return typeof s=="function"?s(e):s;var a=e.text;if(znt.has(a))return null;if(Bn[r][a]){var o=Bn[r][a].replace;o&&(a=o)}var l=Av[t].fontName;return Sx(a,l,r)?Av[t].variant:null};function X1(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof mr&&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 mr&&t.text===","}else return!1}var ni=function(n,t,r){if(n.length===1){var s=kn(n[0],t);return r&&s instanceof Ue&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||X1(o))){var f=c.children[0];f instanceof Ue&&f.type==="mn"&&(f.children=[...o.children,...f.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var _=o.children[0];if(_ instanceof mr&&_.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var d=c.children[0];d instanceof mr&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(c),o=c}return a},il=function(n,t,r){return Ex(ni(n,t,r))},kn=function(n,t){if(!n)return new Ue("mrow");if(L0[n.type])return L0[n.type](n,t);throw new Pe("Got group of unknown type: '"+n.type+"'")};function OS(e,n,t,r,s){var a=ni(e,t),o;a.length===1&&a[0]instanceof Ue&&Ant.has(a[0].type)?o=a[0]:o=new Ue("mrow",a);var l=new Ue("annotation",[new mr(n)]);l.setAttribute("encoding","application/x-tex");var c=new Ue("semantics",[o,l]),f=new Ue("math",[c]);f.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&f.setAttribute("display","block");var _=s?"katex":"katex-mathml";return $e([_],[f])}var Tnt=[[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]],IS=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],BS=function(n,t){return t.size<2?n:Tnt[n-1][t.size-1]};class Za{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||Za.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=IS[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 Za(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:BS(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:IS[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=BS(Za.BASESIZE,n);return this.size===t&&this.textSize===Za.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!==Za.BASESIZE?["sizing","reset-size"+this.size,"size"+Za.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=_nt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Za.BASESIZE=6;var BN=function(n){return new Za({style:n.displayMode?St.DISPLAY:St.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},$N=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=$e(r,[n])}return n},Mnt=function(n,t,r){var s=BN(r),a;if(r.output==="mathml")return OS(n,t,s,r.displayMode,!0);if(r.output==="html"){var o=Rv(n,s);a=$e(["katex"],[o])}else{var l=OS(n,t,s,r.displayMode,!1),c=Rv(n,s);a=$e(["katex"],[l,c])}return $N(a,r)},Rnt=function(n,t,r){var s=BN(r),a=Rv(n,s),o=$e(["katex"],[a]);return $N(o,r)},Dnt={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":"="},wp=function(n){var t=new Ue("mo",[new mr(Dnt[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Lnt={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]},Ont=new Set(["widehat","widecheck","widetilde","utilde"]),Sp=function(n,t){function r(){var l=4e5,c=n.label.slice(1);if(Ont.has(c)&&"base"in n){var f=n.base.type==="ordgroup"?n.base.body.length:1,_,d,m;if(f>5)c==="widehat"||c==="widecheck"?(_=420,l=2364,m=.42,d=c+"4"):(_=312,l=2340,m=.34,d="tilde4");else{var g=[1,1,2,2,3,3][f];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][g],_=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],d=c+g):(l=[0,600,1033,2339,2340][g],_=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],d="tilde"+g)}var S=new rl(d),k=new io([S],{width:"100%",height:Ge(m),viewBox:"0 0 "+l+" "+_,preserveAspectRatio:"none"});return{span:sl([],[k],t),minWidth:0,height:m}}else{var v=[],b=Lnt[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[w,y,C]=b,z=C/1e3,N=w.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 D=0;D0&&(s.style.minWidth=Ge(a)),s},Int=function(n,t,r,s,a){var o,l=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(o=$e(["stretchy",t],[],a),t==="fbox"){var c=a.color&&a.getColor();c&&(o.style.borderColor=c)}}else{var f=[];/^[bx]cancel$/.test(t)&&f.push(new Sv({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&f.push(new Sv({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new io(f,{width:"100%",height:Ge(l)});o=sl([],[_],a)}return o.height=l,o.style.height=Ge(l),o},Bnt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$nt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Hnt(e){return e in Bnt}function jt(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 kp(e){var n=Cp(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 Cp(e){return e&&(e.type==="atom"||$nt.hasOwnProperty(e.type))?e:null}var HN=e=>{if(e instanceof Qs)return e;if(hnt(e)&&e.children.length===1)return HN(e.children[0])},zx=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=jt(e.base,"accent"),t=r.base,e.base=t,s=fnt(nn(e,n)),e.base=r):(r=jt(e,"accent"),t=r.base);var a=nn(t,n.havingCrampedStyle()),o=r.isShifty&&co(t),l=0;if(o){var c,f;l=(c=(f=HN(a))==null?void 0:f.skew)!=null?c:0}var _=r.label==="\\c",d=_?a.height+a.depth:Math.min(a.height,n.fontMetrics().xHeight),m;if(r.isStretchy)m=Sp(r,n),m=en({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Ge(2*l)+")",marginLeft:Ge(2*l)}:void 0}]});else{var g,S;r.label==="\\vec"?(g=RN("vec",n),S=MN.vec[1]):(g=yp({mode:r.mode,text:r.label},n,"textord"),g=unt(g),g.italic=0,S=g.width,_&&(d+=g.depth)),m=$e(["accent-body"],[g]);var k=r.label==="\\textcircled";k&&(m.classes.push("accent-full"),d=a.height);var v=l;k||(v-=S/2),m.style.left=Ge(v),r.label==="\\textcircled"&&(m.style.top=".2em"),m=en({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:m}]})}var b=$e(["mord","accent"],[m],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},FN=(e,n)=>{var t=e.isStretchy?wp(e.label):new Ue("mo",[ki(e.label,e.mode)]),r=new Ue("mover",[kn(e.base,n),t]);return r.setAttribute("accent","true"),r},Fnt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ye({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=O0(n[0]),r=!Fnt.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:zx,mathmlBuilder:FN});Ye({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:zx,mathmlBuilder:FN});Ye({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=nn(e.base,n),r=Sp(e,n),s=e.label==="\\utilde"?.12:0,a=en({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return $e(["mord","accentunder"],[a],n)},mathmlBuilder:(e,n)=>{var t=wp(e.label),r=new Ue("munder",[kn(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var A_=e=>{var n=new Ue("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};Ye({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,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=zu(nn(e.body,r,n),n),a=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(a+"-arrow-pad");var o;e.below&&(r=n.havingStyle(t.sub()),o=zu(nn(e.below,r,n),n),o.classes.push(a+"-arrow-pad"));var l=Sp(e,n),c=-n.fontMetrics().axisHeight+.5*l.height,f=-n.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(f-=s.depth);var _;if(o){var d=-n.fontMetrics().axisHeight+o.height+.5*l.height+.111;_=en({positionType:"individualShift",children:[{type:"elem",elem:s,shift:f},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:d}]})}else _=en({positionType:"individualShift",children:[{type:"elem",elem:s,shift:f},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return $e(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=wp(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=A_(kn(e.body,n));if(e.below){var a=A_(kn(e.below,n));r=new Ue("munderover",[t,a,s])}else r=new Ue("mover",[t,s])}else if(e.below){var o=A_(kn(e.below,n));r=new Ue("munder",[t,o])}else r=A_(),r=new Ue("mover",[t,r]);return r}});function PN(e,n){var t=Nr(e.body,n,!0);return $e([e.mclass],t,n)}function UN(e,n){var t,r=ni(e.body,n);return e.mclass==="minner"?t=new Ue("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ue("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ue("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}Ye({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:pr(s),isCharacterBox:co(s)}},htmlBuilder:PN,mathmlBuilder:UN});var Ep=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"};Ye({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Ep(n[0]),body:pr(n[1]),isCharacterBox:co(n[1])}}});Ye({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],a=n[0],o;r!=="\\stackrel"?o=Ep(s):o="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:pr(s)},c={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:t.mode,mclass:o,body:[c],isCharacterBox:co(c)}},htmlBuilder:PN,mathmlBuilder:UN});Ye({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Ep(n[0]),body:pr(n[0])}},htmlBuilder(e,n){var t=Nr(e.body,n,!0),r=$e([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ni(e.body,n),r=new Ue("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Pnt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},$S=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),HS=e=>e.type==="textord"&&e.text==="@",Unt=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function qnt(e,n,t){var r=Pnt[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]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=t.callFunction("\\Big",[a],[]),l=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,o,l]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var f={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[f],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Gnt(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 Pe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],a=0;aAV".includes(f))for(var d=0;d<2;d++){for(var m=!0,g=c+1;gAV=|." after @',o[c]);var S=qnt(f,_,e),k={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};r.push(k),l=$S()}a%2===0?r.push(l):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([])}}Ye({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=zu(nn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=Ge(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ue("mrow",[kn(e.label,n)]);return t=new Ue("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ue("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});Ye({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=zu(nn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ue("mrow",[kn(e.fragment,n)])}});Ye({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=jt(n[0],"ordgroup"),s=r.body,a="",o=0;o=1114111)throw new Pe("\\@char with invalid code point "+a);return c<=65535?f=String.fromCharCode(c):(c-=65536,f=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:f}}});var qN=(e,n)=>{var t=Nr(e.body,n.withColor(e.color),!1);return fo(t)},GN=(e,n)=>{var t=ni(e.body,n.withColor(e.color)),r=new Ue("mstyle",t);return r.setAttribute("mathcolor",e.color),r};Ye({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=jt(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:pr(s)}},htmlBuilder:qN,mathmlBuilder:GN});Ye({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=jt(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var a=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:a}},htmlBuilder:qN,mathmlBuilder:GN});Ye({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,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:s&&jt(s,"size").value}},htmlBuilder(e,n){var t=$e(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=Ge(Vn(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ue("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",Ge(Vn(e.size,n)))),t}});var Dv={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},VN=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Pe("Expected a control sequence",e);return n},Vnt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},WN=(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)};Ye({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(Dv[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=Dv[r.text]),jt(n.parseFunction(),"internal");throw new Pe("Invalid token after macro prefix",r)}});Ye({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Pe("Expected a control sequence",r);for(var a=0,o,l=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){o=n.gullet.future(),l[a].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Pe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Pe('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new Pe("Expected a macro definition");l[a].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return o&&c.unshift(o),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:a,delimiters:l},t===Dv[t]),{type:"internal",mode:n.mode}}});Ye({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=VN(n.gullet.popToken());n.gullet.consumeSpaces();var s=Vnt(n);return WN(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});Ye({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=VN(n.gullet.popToken()),s=n.gullet.popToken(),a=n.gullet.popToken();return WN(n,r,a,t==="\\\\globalfuture"),n.gullet.pushToken(a),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var Xf=function(n,t,r){var s=Bn.math[n]&&Bn.math[n].replace,a=Sx(s||n,t,r);if(!a)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return a},Ax=function(n,t,r,s){var a=r.havingBaseStyle(t),o=$e(s.concat(a.sizingClasses(r)),[n],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},KN=function(n,t,r){var s=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=Ge(a),n.height-=a,n.depth+=a},Wnt=function(n,t,r,s,a,o){var l=us(n,"Main-Regular",a,s),c=Ax(l,t,s,o);return KN(c,s,t),c},Knt=function(n,t,r,s){return us(n,"Size"+t+"-Regular",r,s)},XN=function(n,t,r,s,a,o){var l=Knt(n,t,a,s),c=Ax($e(["delimsizing","size"+t],[l],s),St.TEXT,s,o);return r&&KN(c,s,St.TEXT),c},Y1=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var a=$e(["delimsizinginner",s],[$e([],[us(n,t,r)])]);return{type:"elem",elem:a}},Z1=function(n,t,r){var s=pa["Size4-Regular"][n.charCodeAt(0)]?pa["Size4-Regular"][n.charCodeAt(0)][4]:pa["Size1-Regular"][n.charCodeAt(0)][4],a=new rl("inner",rnt(n,Math.round(1e3*t))),o=new io([a],{width:Ge(s),height:Ge(t),style:"width:"+Ge(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),l=sl([],[o],r);return l.height=t,l.style.height=Ge(t),l.style.width=Ge(s),{type:"elem",elem:l}},Lv=.008,j_={type:"kern",size:-1*Lv},Xnt=new Set(["|","\\lvert","\\rvert","\\vert"]),Ynt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),YN=function(n,t,r,s,a,o){var l,c,f,_,d="",m=0;l=f=_=n,c=null;var g="Size1-Regular";n==="\\uparrow"?f=_="⏐":n==="\\Uparrow"?f=_="‖":n==="\\downarrow"?l=f="⏐":n==="\\Downarrow"?l=f="‖":n==="\\updownarrow"?(l="\\uparrow",f="⏐",_="\\downarrow"):n==="\\Updownarrow"?(l="\\Uparrow",f="‖",_="\\Downarrow"):Xnt.has(n)?(f="∣",d="vert",m=333):Ynt.has(n)?(f="∥",d="doublevert",m=556):n==="["||n==="\\lbrack"?(l="⎡",f="⎢",_="⎣",g="Size4-Regular",d="lbrack",m=667):n==="]"||n==="\\rbrack"?(l="⎤",f="⎥",_="⎦",g="Size4-Regular",d="rbrack",m=667):n==="\\lfloor"||n==="⌊"?(f=l="⎢",_="⎣",g="Size4-Regular",d="lfloor",m=667):n==="\\lceil"||n==="⌈"?(l="⎡",f=_="⎢",g="Size4-Regular",d="lceil",m=667):n==="\\rfloor"||n==="⌋"?(f=l="⎥",_="⎦",g="Size4-Regular",d="rfloor",m=667):n==="\\rceil"||n==="⌉"?(l="⎤",f=_="⎥",g="Size4-Regular",d="rceil",m=667):n==="("||n==="\\lparen"?(l="⎛",f="⎜",_="⎝",g="Size4-Regular",d="lparen",m=875):n===")"||n==="\\rparen"?(l="⎞",f="⎟",_="⎠",g="Size4-Regular",d="rparen",m=875):n==="\\{"||n==="\\lbrace"?(l="⎧",c="⎨",_="⎩",f="⎪",g="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(l="⎫",c="⎬",_="⎭",f="⎪",g="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(l="⎧",_="⎩",f="⎪",g="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(l="⎫",_="⎭",f="⎪",g="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(l="⎧",_="⎭",f="⎪",g="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(l="⎫",_="⎩",f="⎪",g="Size4-Regular");var S=Xf(l,g,a),k=S.height+S.depth,v=Xf(f,g,a),b=v.height+v.depth,w=Xf(_,g,a),y=w.height+w.depth,C=0,z=1;if(c!==null){var N=Xf(c,g,a);C=N.height+N.depth,z=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(z*b))),D=T+j*z*b,I=s.fontMetrics().axisHeight;r&&(I*=s.sizeMultiplier);var L=D/2-I,P=[];if(d.length>0){var q=D-k-y,W=Math.round(D*1e3),Z=snt(d,Math.round(q*1e3)),X=new rl(d,Z),J=Ge(m/1e3),ee=Ge(W/1e3),$=new io([X],{width:J,height:ee,viewBox:"0 0 "+m+" "+W}),B=sl([],[$],s);B.height=W/1e3,B.style.width=J,B.style.height=ee,P.push({type:"elem",elem:B})}else{if(P.push(Y1(_,g,a)),P.push(j_),c===null){var H=D-k-y+2*Lv;P.push(Z1(f,H,s))}else{var K=(D-k-y-C)/2+2*Lv;P.push(Z1(f,K,s)),P.push(j_),P.push(Y1(c,g,a)),P.push(j_),P.push(Z1(f,K,s))}P.push(j_),P.push(Y1(l,g,a))}var G=s.havingBaseStyle(St.TEXT),ie=en({positionType:"bottom",positionData:L,children:P});return Ax($e(["delimsizing","mult"],[ie],G),St.TEXT,s,o)},Q1=80,J1=.08,eb=function(n,t,r,s,a){var o=nnt(n,s,r),l=new rl(n,o),c=new io([l],{width:"400em",height:Ge(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return sl(["hide-tail"],[c],a)},Znt=function(n,t){var r=t.havingBaseSizing(),s=tz("\\surd",n*r.sizeMultiplier,ez,r),a=r.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l,c,f,_,d;return s.type==="small"?(_=1e3+1e3*o+Q1,n<1?a=1:n<1.4&&(a=.7),c=(1+o+J1)/a,f=(1+o)/a,l=eb("sqrtMain",c,_,o,t),l.style.minWidth="0.853em",d=.833/a):s.type==="large"?(_=(1e3+Q1)*sh[s.size],f=(sh[s.size]+o)/a,c=(sh[s.size]+o+J1)/a,l=eb("sqrtSize"+s.size,c,_,o,t),l.style.minWidth="1.02em",d=1/a):(c=n+o+J1,f=n+o,_=Math.floor(1e3*n+o)+Q1,l=eb("sqrtTall",c,_,o,t),l.style.minWidth="0.742em",d=1.056),l.height=f,l.style.height=Ge(c),{span:l,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*a}},ZN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Qnt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),QN=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),sh=[0,1.2,1.8,2.4,3],JN=function(n,t,r,s,a){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),ZN.has(n)||QN.has(n))return XN(n,t,!1,r,s,a);if(Qnt.has(n))return YN(n,sh[t],!1,r,s,a);throw new Pe("Illegal delimiter: '"+n+"'")},Jnt=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ert=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"stack"}],ez=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],trt=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.")},tz=function(n,t,r,s){for(var a=Math.min(2,3-s.style.size),o=a;ot)return l}return r[r.length-1]},Ov=function(n,t,r,s,a,o){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var l;QN.has(n)?l=Jnt:ZN.has(n)?l=ez:l=ert;var c=tz(n,t,l,s);return c.type==="small"?Wnt(n,c.style,r,s,a,o):c.type==="large"?XN(n,c.size,r,s,a,o):YN(n,t,r,s,a,o)},tb=function(n,t,r,s,a,o){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,f=5/s.fontMetrics().ptPerEm,_=Math.max(t-l,r+l),d=Math.max(_/500*c,2*_-f);return Ov(n,d,!0,s,a,o)},FS={"\\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}},nrt=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 PS(e){return"isMiddle"in e}function Np(e,n){var t=Cp(e);if(t&&nrt.has(t.text))return t;throw t?new Pe("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Pe("Invalid delimiter type '"+e.type+"'",e)}Ye({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Np(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:FS[e.funcName].size,mclass:FS[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?$e([e.mclass]):JN(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ki(e.delim,e.mode));var t=new Ue("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=Ge(sh[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function US(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ye({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Pe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Np(n[0],e).text,color:t}}});Ye({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Np(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=jt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,n)=>{US(e);for(var t=Nr(e.body,n,!0,["mopen","mclose"]),r=0,s=0,a=!1,o=0;o{US(e);var t=ni(e.body,n);if(e.left!=="."){var r=new Ue("mo",[ki(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ue("mo",[ki(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return Ex(t)}});Ye({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Np(n[0],e);if(!e.parser.leftrightDepth)throw new Pe("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=bh(n,[]):(t=JN(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ki("|","text"):ki(e.delim,e.mode),r=new Ue("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var zp=(e,n)=>{var t=zu(nn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,a,o,l=co(e.body);if(r==="sout")a=$e(["stretchy","sout"]),a.height=n.fontMetrics().defaultRuleThickness/s,o=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Vn({number:.6,unit:"pt"},n),f=Vn({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+c+f;t.style.paddingLeft=Ge(d/2+c);var m=Math.floor(1e3*d*s),g=ent(m),S=new io([new rl("phase",g)],{width:"400em",height:Ge(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});a=sl(["hide-tail"],[S],n),a.style.height=Ge(d),o=t.depth+c+f}else{/cancel/.test(r)?l||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=l?.2:0,v=k),a=Int(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Ge(b)):r==="angl"&&b!==.049&&(a.style.borderTopWidth=Ge(b),a.style.borderRightWidth=Ge(b)),o=t.depth+v,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=en({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=en({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!l?$e(["mord","cancel-lap"],[w],n):$e(["mord"],[w],n)},Ap=(e,n)=>{var t,r=new Ue(e.label.includes("colorbox")?"mpadded":"menclose",[kn(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: "+Ge(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ye({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,a=jt(n[0],"color-token").color,o=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,body:o}},htmlBuilder:zp,mathmlBuilder:Ap});Ye({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,a=jt(n[0],"color-token").color,o=jt(n[1],"color-token").color,l=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:zp,mathmlBuilder:Ap});Ye({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]}}});Ye({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:zp,mathmlBuilder:Ap});Ye({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:zp,mathmlBuilder:Ap});Ye({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 nz={};function Sa(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:a,mathmlBuilder:o}=e,l={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 Pe("{"+e.envName+"} can be used only in display mode.")},rrt=new Set(["gather","gather*"]);function jx(e){if(!e.includes("ed"))return!e.includes("*")}function fl(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:a,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:f,emptySingleRow:_,maxNumCols:d,leqno:m}=n;if(e.gullet.beginGroup(),f||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var g=e.gullet.expandMacroAsText("\\arraystretch");if(g==null)o=1;else if(o=parseFloat(g),!o||o<0)throw new Pe("Invalid \\arraystretch: "+g)}e.gullet.beginGroup();var S=[],k=[S],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 qi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(qS(e));;){var z=e.parseExpression(!1,f?"\\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]}),S.push(N);var T=e.fetch().text;if(T==="&"){if(d&&S.length===d){if(f||l)throw new Pe("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(),S.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(k.length>1||!_)&&k.pop(),b.length0&&(y+=.25),f.push({pos:y,isDashed:qe[tt]})}for(C(o[0]),r=0;r0&&(L+=w,Tqe))for(r=0;r=l)){var oe=void 0;if(s>0||n.hskipBeforeAndAfter){var ue,he;oe=(ue=(he=G)==null?void 0:he.pregap)!=null?ue:m,oe!==0&&(Z=$e(["arraycolsep"],[]),Z.style.width=Ge(oe),W.push(Z))}var me=[];for(r=0;r0){for(var Wt=Nu("hline",t,_),fn=Nu("hdashline",t,_),ht=[{type:"elem",elem:zt,shift:0}];f.length>0;){var Qe=f.pop(),st=Qe.pos-P;Qe.isDashed?ht.push({type:"elem",elem:fn,shift:st}):ht.push({type:"elem",elem:Wt,shift:st})}zt=en({positionType:"individualShift",children:ht})}if(J.length===0)return $e(["mord"],[zt],t);var we=en({positionType:"individualShift",children:J}),Le=$e(["tag"],[we],t);return fo([zt,Le])},srt={c:"center ",l:"left ",r:"right "},Ca=function(n,t){for(var r=[],s=new Ue("mtd",[],["mtr-glue"]),a=new Ue("mtd",[],["mml-eqn-num"]),o=0;o0){var S=n.cols,k="",v=!1,b=0,w=S.length;S[0].type==="separator"&&(m+="top ",b=1),S[S.length-1].type==="separator"&&(m+="bottom ",w-=1);for(var y=b;y0?"left ":"",m+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&g&&(v=1),r[S]={type:"align",align:k,pregap:v,postgap:0}}return o.colSeparationType=g?"align":"alignat",o};Sa({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Cp(n[0]),r=t?[n[0]]:jt(n[0],"ordgroup").body,s=r.map(function(o){var l=kp(o),c=l.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Pe("Unknown column alignment: "+c,o)}),a={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return fl(e.parser,a,Tx(e.envName))},htmlBuilder:ka,mathmlBuilder:Ca});Sa({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 Pe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var a=fl(e.parser,r,Tx(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[a],left:n[0],right:n[1],rightColor:void 0}:a},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=fl(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Cp(n[0]),r=t?[n[0]]:jt(n[0],"ordgroup").body,s=r.map(function(l){var c=kp(l),f=c.text;if("lc".includes(f))return{type:"align",align:f};throw new Pe("Unknown column alignment: "+f,l)});if(s.length>1)throw new Pe("{subarray} can contain only one column");var a={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},o=fl(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Pe("{subarray} can contain only one column");return o},htmlBuilder:ka,mathmlBuilder:Ca});Sa({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=fl(e.parser,n,Tx(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:iz,htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){rrt.has(e.envName)&&jp(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:jx(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return fl(e.parser,n,"display")},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:iz,htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jp(e);var n={autoTag:jx(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return fl(e.parser,n,"display")},htmlBuilder:ka,mathmlBuilder:Ca});Sa({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jp(e),Gnt(e.parser)},htmlBuilder:ka,mathmlBuilder:Ca});ne("\\nonumber","\\gdef\\@eqnsw{0}");ne("\\notag","\\nonumber");Ye({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Pe(e.funcName+" valid only within array environment")}});var GS=nz;Ye({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 Pe("Invalid environment name",s);for(var a="",o=0;o{var t=e.font,r=n.withFont(t);return nn(e.body,r)},oz=(e,n)=>{var t=e.font,r=n.withFont(t);return kn(e.body,r)},VS={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ye({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=O0(n[0]),a=r;return a in VS&&(a=VS[a]),{type:"font",mode:t.mode,font:a.slice(1),body:s}},htmlBuilder:az,mathmlBuilder:oz});Ye({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:Ep(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:co(r)}}});Ye({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:a}=t,o=t.parseExpression(!0,s);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:az,mathmlBuilder:oz});var irt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),a;a=n.havingStyle(r);var o=nn(e.numer,a,n);if(e.continued){var l=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;o.height=o.height0?S=3*m:S=7*m,k=n.fontMetrics().denom1):(d>0?(g=n.fontMetrics().num2,S=m):(g=n.fontMetrics().num3,S=3*m),k=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;g-o.depth-(w+.5*d){var t=new Ue("mfrac",[kn(e.numer,n),kn(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Vn(e.barSize,n);t.setAttribute("linethickness",Ge(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var a=new Ue("mo",[new mr(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}if(s.push(t),e.rightDelim!=null){var o=new Ue("mo",[new mr(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}return Ex(s)}return t},lz=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};Ye({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],a=n[1],o,l=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",c=")";break;case"\\\\bracefrac":o=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var f=r==="\\cfrac",_=null;return f||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),lz({type:"genfrac",mode:t.mode,numer:s,denom:a,continued:f,hasBarLine:o,leftDelim:l,rightDelim:c,barSize:null},_)},htmlBuilder:irt,mathmlBuilder:art});Ye({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 WS=["display","text","script","scriptscript"],KS=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};Ye({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],a=O0(n[0]),o=a.type==="atom"&&a.family==="open"?KS(a.text):null,l=O0(n[1]),c=l.type==="atom"&&l.family==="close"?KS(l.text):null,f=jt(n[2],"size"),_,d=null;f.isBlank?_=!0:(d=f.value,_=d.number>0);var m=null,g=n[3];if(g.type==="ordgroup"){if(g.body.length>0){var S=jt(g.body[0],"textord");m=WS[Number(S.text)]}}else g=jt(g,"textord"),m=WS[Number(g.text)];return lz({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:o,rightDelim:c},m)}});Ye({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:jt(n[0],"size").value,token:s}}});Ye({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],a=jt(n[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=n[2],l=a.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var cz=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?nn(e.sup,n.havingStyle(t.sup()),n):nn(e.sub,n.havingStyle(t.sub()),n),s=jt(e.base,"horizBrace")):s=jt(e,"horizBrace");var a=nn(s.base,n.havingBaseStyle(St.DISPLAY)),o=Sp(s,n),l;if(s.isOver?l=en({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=en({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var c=$e(["minner",s.isOver?"mover":"munder"],[l],n);s.isOver?l=en({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=en({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return $e(["minner",s.isOver?"mover":"munder"],[l],n)},ort=(e,n)=>{var t=wp(e.label);return new Ue(e.isOver?"mover":"munder",[kn(e.base,n),t])};Ye({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:cz,mathmlBuilder:ort});Ye({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=jt(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:pr(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=Nr(e.body,n,!1);return xnt(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=il(e.body,n);return t instanceof Ue||(t=new Ue("mrow",[t])),t.setAttribute("href",e.href),t}});Ye({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=jt(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],a=0;a{var{parser:t,funcName:r,token:s}=e,a=jt(n[0],"raw").string,o=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":c.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":c.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var f=a.split(","),_=0;_{var t=Nr(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=$e(r,t,n);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&s.setAttribute(a,e.attributes[a]);return s},mathmlBuilder:(e,n)=>il(e.body,n)});Ye({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:pr(n[0]),mathml:pr(n[1])}},htmlBuilder:(e,n)=>{var t=Nr(e.html,n,!1);return fo(t)},mathmlBuilder:(e,n)=>il(e.mathml,n)});var nb=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 Pe("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!CN(r))throw new Pe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ye({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(t[0])for(var c=jt(t[0],"raw").string,f=c.split(","),_=0;_{var t=Vn(e.height,n),r=0;e.totalheight.number>0&&(r=Vn(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Vn(e.width,n));var a={height:Ge(t+r)};s>0&&(a.width=Ge(s)),r>0&&(a.verticalAlign=Ge(-r));var o=new lnt(e.src,e.alt,a);return o.height=t,o.depth=r,o},mathmlBuilder:(e,n)=>{var t=new Ue("mglyph",[]);t.setAttribute("alt",e.alt);var r=Vn(e.height,n),s=0;if(e.totalheight.number>0&&(s=Vn(e.totalheight,n)-r,t.setAttribute("valign",Ge(-s))),t.setAttribute("height",Ge(r+s)),e.width.number>0){var a=Vn(e.width,n);t.setAttribute("width",Ge(a))}return t.setAttribute("src",e.src),t}});Ye({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=jt(n[0],"size");if(t.settings.strict){var a=r[1]==="m",o=s.value.unit==="mu";a?(o||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")):o&&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 TN(e.dimension,n)},mathmlBuilder(e,n){var t=Vn(e.dimension,n);return new IN(t)}});Ye({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=$e([],[nn(e.body,n)]),t=$e(["inner"],[t],n)):t=$e(["inner"],[nn(e.body,n)]);var r=$e(["fix"],[]),s=$e([e.alignment],[t,r],n),a=$e(["strut"]);return a.style.height=Ge(s.height+s.depth),s.depth&&(a.style.verticalAlign=Ge(-s.depth)),s.children.unshift(a),s=$e(["thinbox"],[s],n),$e(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ue("mpadded",[kn(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}});Ye({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 a=t==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});Ye({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Pe("Mismatched "+e.funcName)}});var XS=(e,n)=>{switch(n.style.size){case St.DISPLAY.size:return e.display;case St.TEXT.size:return e.text;case St.SCRIPT.size:return e.script;case St.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ye({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:pr(n[0]),text:pr(n[1]),script:pr(n[2]),scriptscript:pr(n[3])}},htmlBuilder:(e,n)=>{var t=XS(e,n),r=Nr(t,n,!1);return fo(r)},mathmlBuilder:(e,n)=>{var t=XS(e,n);return il(t,n)}});var uz=(e,n,t,r,s,a,o)=>{e=$e([],[e]);var l=t&&co(t),c,f;if(n){var _=nn(n,r.havingStyle(s.sup()),r);f={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=nn(t,r.havingStyle(s.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var m;if(f&&c){var g=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;m=en({positionType:"bottom",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ge(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Ge(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var S=e.height-o;m=en({positionType:"top",positionData:S,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ge(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(f){var k=e.depth+o;m=en({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Ge(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[m];if(c&&a!==0&&!l){var b=$e(["mspace"],[],r);b.style.marginRight=Ge(a),v.unshift(b)}return $e(["mop","op-limits"],v,r)},fz=new Set(["\\smallint"]),qu=(e,n)=>{var t,r,s=!1,a;e.type==="supsub"?(t=e.sup,r=e.sub,a=jt(e.base,"op"),s=!0):a=jt(e,"op");var o=n.style,l=!1;o.size===St.DISPLAY.size&&a.symbol&&!fz.has(a.name)&&(l=!0);var c,f;if(a.symbol){var _=l?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),c=us(a.name,_,"math",n,["mop","op-symbol",l?"large-op":"small-op"]),f=c.italic,d.length>0){var m=RN(d+"Size"+(l?"2":"1"),n);c=en({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:m,shift:l?.08:0}]}),a.name="\\"+d,c.classes.unshift("mop"),c.italic=f}}else if(a.body){var g=Nr(a.body,n,!0);g.length===1&&g[0]instanceof Qs?(c=g[0],c.classes[0]="mop"):c=$e(["mop"],g,n)}else{for(var S=[],k=1;k{var t;if(e.symbol)t=new Ue("mo",[ki(e.name,e.mode)]),fz.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ue("mo",ni(e.body,n));else{t=new Ue("mi",[new mr(e.name.slice(1))]);var r=new Ue("mo",[ki("⁡","text")]);e.parentIsSupSub?t=new Ue("mrow",[t,r]):t=ON([t,r])}return t},lrt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ye({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=lrt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:qu,mathmlBuilder:ed});Ye({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:pr(r)}},htmlBuilder:qu,mathmlBuilder:ed});var crt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ye({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:qu,mathmlBuilder:ed});Ye({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:qu,mathmlBuilder:ed});Ye({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=crt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:qu,mathmlBuilder:ed});var hz=(e,n)=>{var t,r,s=!1,a;e.type==="supsub"?(t=e.sup,r=e.sub,a=jt(e.base,"operatorname"),s=!0):a=jt(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(d=>{var m="text"in d?d.text:void 0;return typeof m=="string"?{type:"textord",mode:d.mode,text:m}:d}),c=Nr(l,n.withFont("mathrm"),!0),f=0;f{for(var t=ni(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new mr(l)]}var c=new Ue("mi",t);c.setAttribute("mathvariant","normal");var f=new Ue("mo",[ki("⁡","text")]);return e.parentIsSupSub?new Ue("mrow",[c,f]):ON([c,f])};Ye({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:pr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:hz,mathmlBuilder:urt});ne("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");uc({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?fo(Nr(e.body,n,!1)):$e(["mord"],Nr(e.body,n,!0),n)},mathmlBuilder(e,n){return il(e.body,n,!0)}});Ye({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=nn(e.body,n.havingCrampedStyle()),r=Nu("overline-line",n),s=n.fontMetrics().defaultRuleThickness,a=en({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return $e(["mord","overline"],[a],n)},mathmlBuilder(e,n){var t=new Ue("mo",[new mr("‾")]);t.setAttribute("stretchy","true");var r=new Ue("mover",[kn(e.body,n),t]);return r.setAttribute("accent","true"),r}});Ye({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:pr(r)}},htmlBuilder:(e,n)=>{var t=Nr(e.body,n.withPhantom(),!1);return fo(t)},mathmlBuilder:(e,n)=>{var t=ni(e.body,n);return new Ue("mphantom",t)}});ne("\\hphantom","\\smash{\\phantom{#1}}");Ye({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=$e(["inner"],[nn(e.body,n.withPhantom())]),r=$e(["fix"],[]);return $e(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ni(pr(e.body),n),r=new Ue("mphantom",t),s=new Ue("mpadded",[r]);return s.setAttribute("width","0px"),s}});Ye({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=jt(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=nn(e.body,n),r=Vn(e.dy,n);return en({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ue("mpadded",[kn(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});Ye({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});Ye({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],a=jt(n[0],"size"),o=jt(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&jt(s,"size").value,width:a.value,height:o.value}},htmlBuilder(e,n){var t=$e(["mord","rule"],[],n),r=Vn(e.width,n),s=Vn(e.height,n),a=e.shift?Vn(e.shift,n):0;return t.style.borderRightWidth=Ge(r),t.style.borderTopWidth=Ge(s),t.style.bottom=Ge(a),t.width=r,t.height=s+a,t.depth=-a,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Vn(e.width,n),r=Vn(e.height,n),s=e.shift?Vn(e.shift,n):0,a=n.color&&n.getColor()||"black",o=new Ue("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",Ge(t)),o.setAttribute("height",Ge(r));var l=new Ue("mpadded",[o]);return s>=0?l.setAttribute("height",Ge(s)):(l.setAttribute("height",Ge(s)),l.setAttribute("depth",Ge(-s))),l.setAttribute("voffset",Ge(s)),l}});function dz(e,n,t){for(var r=Nr(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,a=0;a{var t=n.havingSize(e.size);return dz(e.body,t,n)};Ye({type:"sizing",names:YS,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,a=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:YS.indexOf(r)+1,body:a}},htmlBuilder:frt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ni(e.body,t),s=new Ue("mstyle",r);return s.setAttribute("mathsize",Ge(t.sizeMultiplier)),s}});Ye({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,a=!1,o=t[0]&&jt(t[0],"ordgroup");if(o)for(var l,c=0;c{var t=$e([],[nn(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 $e(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ue("mpadded",[kn(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});Ye({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],a=n[0];return{type:"sqrt",mode:r.mode,body:a,index:s}},htmlBuilder(e,n){var t=nn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=zu(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,a=s;n.style.idt.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var m=c.height-t.height-o-f;t.style.paddingLeft=Ge(_);var g=en({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+m)},{type:"elem",elem:c},{type:"kern",size:f}]});if(e.index){var S=n.havingStyle(St.SCRIPTSCRIPT),k=nn(e.index,S,n),v=.6*(g.height-g.depth),b=en({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),w=$e(["root"],[b]);return $e(["mord","sqrt"],[w,g],n)}else return $e(["mord","sqrt"],[g],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ue("mroot",[kn(t,n),kn(r,n)]):new Ue("msqrt",[kn(t,n)])}});var Iv={display:St.DISPLAY,text:St.TEXT,script:St.SCRIPT,scriptscript:St.SCRIPTSCRIPT};function hrt(e){return e in Iv}Ye({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,a=s.parseExpression(!0,t),o=r.slice(1,r.length-5);if(!hrt(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:s.mode,style:o,body:a}},htmlBuilder(e,n){var t=Iv[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),dz(e.body,r,n)},mathmlBuilder(e,n){var t=Iv[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ni(e.body,r),a=new Ue("mstyle",s),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var drt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===St.DISPLAY.size||r.alwaysHandleSupSub);return s?qu:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(t.style.size===St.DISPLAY.size||r.limits);return a?hz:null}else{if(r.type==="accent")return co(r.base)?zx:null;if(r.type==="horizBrace"){var o=!n.sub;return o===r.isOver?cz:null}else return null}else return null};uc({type:"supsub",htmlBuilder(e,n){var t=drt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:a}=e,o=nn(r,n),l,c,f=n.fontMetrics(),_=0,d=0,m=r&&co(r);if(s){var g=n.havingStyle(n.style.sup());l=nn(s,g,n),m||(_=o.height-g.fontMetrics().supDrop*g.sizeMultiplier/n.sizeMultiplier)}if(a){var S=n.havingStyle(n.style.sub());c=nn(a,S,n),m||(d=o.depth+S.fontMetrics().subDrop*S.sizeMultiplier/n.sizeMultiplier)}var k;n.style===St.DISPLAY?k=f.sup1:n.style.cramped?k=f.sup3:k=f.sup2;var v=n.sizeMultiplier,b=Ge(.5/f.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(o instanceof Qs||y){var C;w=Ge(-((C=o.italic)!=null?C:0))}}var z;if(l&&c){_=Math.max(_,k,l.depth+.25*f.xHeight),d=Math.max(d,f.sub2);var N=f.defaultRuleThickness,T=4*N;if(_-l.depth-(c.height-d)0&&(_+=j,d-=j)}var D=[{type:"elem",elem:c,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:l,shift:-_,marginRight:b}];z=en({positionType:"individualShift",children:D})}else if(c){d=Math.max(d,f.sub1,c.height-.8*f.xHeight);var I=[{type:"elem",elem:c,marginLeft:w,marginRight:b}];z=en({positionType:"shift",positionData:d,children:I})}else if(l)_=Math.max(_,k,l.depth+.25*f.xHeight),z=en({positionType:"shift",positionData:-_,children:[{type:"elem",elem:l,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var L=Mv(o,"right")||"mord";return $e([L],[o,$e(["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 a=[kn(e.base,n)];e.sub&&a.push(kn(e.sub,n)),e.sup&&a.push(kn(e.sup,n));var o;if(t)o=r?"mover":"munder";else if(e.sub)if(e.sup){var f=e.base;f&&f.type==="op"&&f.limits&&n.style===St.DISPLAY||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(n.style===St.DISPLAY||f.limits)?o="munderover":o="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===St.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===St.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===St.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===St.DISPLAY)?o="mover":o="msup"}return new Ue(o,a)}});uc({type:"atom",htmlBuilder(e,n){return kx(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ue("mo",[ki(e.text,e.mode)]);if(e.family==="bin"){var r=Nx(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 _z={mi:"italic",mn:"normal",mtext:"normal"};uc({type:"mathord",htmlBuilder(e,n){return yp(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ue("mi",[ki(e.text,e.mode,n)]),r=Nx(e,n)||"italic";return r!==_z[t.type]&&t.setAttribute("mathvariant",r),t}});uc({type:"textord",htmlBuilder(e,n){return yp(e,n,"textord")},mathmlBuilder(e,n){var t=ki(e.text,e.mode,n),r=Nx(e,n)||"normal",s;return e.mode==="text"?s=new Ue("mtext",[t]):/[0-9]/.test(e.text)?s=new Ue("mn",[t]):e.text==="\\prime"?s=new Ue("mo",[t]):s=new Ue("mi",[t]),r!==_z[s.type]&&s.setAttribute("mathvariant",r),s}});var rb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},sb={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};uc({type:"spacing",htmlBuilder(e,n){if(sb.hasOwnProperty(e.text)){var t=sb[e.text].className||"";if(e.mode==="text"){var r=yp(e,n,"textord");return r.classes.push(t),r}else return $e(["mspace",t],[kx(e.text,e.mode,n)],n)}else{if(rb.hasOwnProperty(e.text))return $e(["mspace",rb[e.text]],[],n);throw new Pe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(sb.hasOwnProperty(e.text))t=new Ue("mtext",[new mr(" ")]);else{if(rb.hasOwnProperty(e.text))return new Ue("mspace");throw new Pe('Unknown type of space "'+e.text+'"')}return t}});var ZS=()=>{var e=new Ue("mtd",[]);return e.setAttribute("width","50%"),e};uc({type:"tag",mathmlBuilder(e,n){var t=new Ue("mtable",[new Ue("mtr",[ZS(),new Ue("mtd",[il(e.body,n)]),ZS(),new Ue("mtd",[il(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var QS={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},JS={"\\textbf":"textbf","\\textmd":"textmd"},_rt={"\\textit":"textit","\\textup":"textup"},e8=(e,n)=>{var t=e.font;if(t){if(QS[t])return n.withTextFontFamily(QS[t]);if(JS[t])return n.withTextFontWeight(JS[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(_rt[t])};Ye({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:pr(s),font:r}},htmlBuilder(e,n){var t=e8(e,n),r=Nr(e.body,t,!0);return $e(["mord","text"],r,t)},mathmlBuilder(e,n){var t=e8(e,n);return il(e.body,t)}});Ye({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=nn(e.body,n),r=Nu("underline-line",n),s=n.fontMetrics().defaultRuleThickness,a=en({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return $e(["mord","underline"],[a],n)},mathmlBuilder(e,n){var t=new Ue("mo",[new mr("‾")]);t.setAttribute("stretchy","true");var r=new Ue("munder",[kn(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});Ye({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=nn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return en({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ue("mpadded",[kn(e.body,n)],["vcenter"]);return new Ue("mrow",[t])}});Ye({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Pe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=t8(e),r=[],s=n.havingStyle(n.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),el=DN,pz=`[ \r + ]`,prt="\\\\[a-zA-Z@]+",mrt="\\\\[^\uD800-\uDFFF]",grt="("+prt+")"+pz+"*",brt=`\\\\( |[ \r ]+ -?)[ \r ]*`,Ov="[̀-ͯ]",Ont=new RegExp(Ov+"+$"),Int="("+dz+"+)|"+(Lnt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Ov+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Ov+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Dnt)+("|"+Rnt+")");class e8{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(Int,"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 Ui("EOF",new Ss(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ue("Unexpected character: '"+n[t]+"'",new Ui(n[t],new Ss(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var a=n.indexOf(` -`,this.tokenRegex.lastIndex);return a===-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=a+1,this.lex()}return new Ui(s,new Ss(this,t,this.tokenRegex.lastIndex))}}class Bnt{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 Ue("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 a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(n)&&(a[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var $nt=ez;ne("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ne("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ne("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ne("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ne("\\@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}});ne("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ne("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var t8={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};ne("\\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 Ue("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=t8[n.text],r==null||r>=t)throw new Ue("Invalid base-"+t+" digit "+n.text);for(var s;(s=t8[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ue("\\newcommand's first argument must be a macro name");var a=s[0].text,o=e.isDefined(a);if(o&&!n)throw new Ue("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!t)throw new Ue("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",f=e.expandNextToken();f.text!=="]"&&f.text!=="EOF";)c+=f.text,f=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Ue("Invalid number of arguments: "+c);l=parseInt(c),s=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:s,numArgs:l}),""};ne("\\newcommand",e=>jx(e,!1,!0,!1));ne("\\renewcommand",e=>jx(e,!0,!1,!1));ne("\\providecommand",e=>jx(e,!0,!0,!0));ne("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ne("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ne("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),el[t],Ln.math[t],Ln.text[t]),""});ne("\\bgroup","{");ne("\\egroup","}");ne("~","\\nobreakspace");ne("\\lq","`");ne("\\rq","'");ne("\\aa","\\r a");ne("\\AA","\\r A");ne("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ne("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ne("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ne("ℬ","\\mathscr{B}");ne("ℰ","\\mathscr{E}");ne("ℱ","\\mathscr{F}");ne("ℋ","\\mathscr{H}");ne("ℐ","\\mathscr{I}");ne("ℒ","\\mathscr{L}");ne("ℳ","\\mathscr{M}");ne("ℛ","\\mathscr{R}");ne("ℭ","\\mathfrak{C}");ne("ℌ","\\mathfrak{H}");ne("ℨ","\\mathfrak{Z}");ne("\\Bbbk","\\Bbb{k}");ne("\\llap","\\mathllap{\\textrm{#1}}");ne("\\rlap","\\mathrlap{\\textrm{#1}}");ne("\\clap","\\mathclap{\\textrm{#1}}");ne("\\mathstrut","\\vphantom{(}");ne("\\underbar","\\underline{\\text{#1}}");ne("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ne("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ne("\\ne","\\neq");ne("≠","\\neq");ne("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ne("∉","\\notin");ne("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ne("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ne("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ne("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ne("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ne("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ne("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ne("⟂","\\perp");ne("‼","\\mathclose{!\\mkern-0.8mu!}");ne("∌","\\notni");ne("⌜","\\ulcorner");ne("⌝","\\urcorner");ne("⌞","\\llcorner");ne("⌟","\\lrcorner");ne("©","\\copyright");ne("®","\\textregistered");ne("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ne("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ne("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ne("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ne("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ne("⋮","\\vdots");ne("\\varGamma","\\mathit{\\Gamma}");ne("\\varDelta","\\mathit{\\Delta}");ne("\\varTheta","\\mathit{\\Theta}");ne("\\varLambda","\\mathit{\\Lambda}");ne("\\varXi","\\mathit{\\Xi}");ne("\\varPi","\\mathit{\\Pi}");ne("\\varSigma","\\mathit{\\Sigma}");ne("\\varUpsilon","\\mathit{\\Upsilon}");ne("\\varPhi","\\mathit{\\Phi}");ne("\\varPsi","\\mathit{\\Psi}");ne("\\varOmega","\\mathit{\\Omega}");ne("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ne("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ne("\\boxed","\\fbox{$\\displaystyle{#1}$}");ne("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ne("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ne("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ne("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ne("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var n8={",":"\\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"},Hnt=new Set(["bin","rel"]);ne("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in n8?n=n8[t]:(t.slice(0,4)==="\\not"||t in Ln.math&&Hnt.has(Ln.math[t].group))&&(n="\\dotsb"),n});var Tx={")":!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};ne("\\dotso",function(e){var n=e.future().text;return n in Tx?"\\ldots\\,":"\\ldots"});ne("\\dotsc",function(e){var n=e.future().text;return n in Tx&&n!==","?"\\ldots\\,":"\\ldots"});ne("\\cdots",function(e){var n=e.future().text;return n in Tx?"\\@cdots\\,":"\\@cdots"});ne("\\dotsb","\\cdots");ne("\\dotsm","\\cdots");ne("\\dotsi","\\!\\cdots");ne("\\dotsx","\\ldots\\,");ne("\\DOTSI","\\relax");ne("\\DOTSB","\\relax");ne("\\DOTSX","\\relax");ne("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ne("\\,","\\tmspace+{3mu}{.1667em}");ne("\\thinspace","\\,");ne("\\>","\\mskip{4mu}");ne("\\:","\\tmspace+{4mu}{.2222em}");ne("\\medspace","\\:");ne("\\;","\\tmspace+{5mu}{.2777em}");ne("\\thickspace","\\;");ne("\\!","\\tmspace-{3mu}{.1667em}");ne("\\negthinspace","\\!");ne("\\negmedspace","\\tmspace-{4mu}{.2222em}");ne("\\negthickspace","\\tmspace-{5mu}{.277em}");ne("\\enspace","\\kern.5em ");ne("\\enskip","\\hskip.5em\\relax");ne("\\quad","\\hskip1em\\relax");ne("\\qquad","\\hskip2em\\relax");ne("\\tag","\\@ifstar\\tag@literal\\tag@paren");ne("\\tag@paren","\\tag@literal{({#1})}");ne("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ue("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ne("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ne("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ne("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ne("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ne("\\newline","\\\\\\relax");ne("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var hz=Ve(pa["Main-Regular"][84][1]-.7*pa["Main-Regular"][65][1]);ne("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+hz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ne("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+hz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ne("\\hspace","\\@ifstar\\@hspacer\\@hspace");ne("\\@hspace","\\hskip #1\\relax");ne("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ne("\\ordinarycolon",":");ne("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ne("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ne("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ne("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ne("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ne("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ne("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ne("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ne("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ne("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ne("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ne("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ne("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ne("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ne("∷","\\dblcolon");ne("∹","\\eqcolon");ne("≔","\\coloneqq");ne("≕","\\eqqcolon");ne("⩴","\\Coloneqq");ne("\\ratio","\\vcentcolon");ne("\\coloncolon","\\dblcolon");ne("\\colonequals","\\coloneqq");ne("\\coloncolonequals","\\Coloneqq");ne("\\equalscolon","\\eqqcolon");ne("\\equalscoloncolon","\\Eqqcolon");ne("\\colonminus","\\coloneq");ne("\\coloncolonminus","\\Coloneq");ne("\\minuscolon","\\eqcolon");ne("\\minuscoloncolon","\\Eqcolon");ne("\\coloncolonapprox","\\Colonapprox");ne("\\coloncolonsim","\\Colonsim");ne("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ne("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ne("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ne("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ne("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ne("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ne("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ne("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ne("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ne("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ne("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ne("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ne("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ne("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ne("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ne("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ne("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ne("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ne("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ne("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ne("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ne("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ne("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ne("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ne("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ne("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ne("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ne("\\imath","\\html@mathml{\\@imath}{ı}");ne("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ne("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ne("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ne("⟦","\\llbracket");ne("⟧","\\rrbracket");ne("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ne("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ne("⦃","\\lBrace");ne("⦄","\\rBrace");ne("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ne("⦵","\\minuso");ne("\\darr","\\downarrow");ne("\\dArr","\\Downarrow");ne("\\Darr","\\Downarrow");ne("\\lang","\\langle");ne("\\rang","\\rangle");ne("\\uarr","\\uparrow");ne("\\uArr","\\Uparrow");ne("\\Uarr","\\Uparrow");ne("\\N","\\mathbb{N}");ne("\\R","\\mathbb{R}");ne("\\Z","\\mathbb{Z}");ne("\\alef","\\aleph");ne("\\alefsym","\\aleph");ne("\\Alpha","\\mathrm{A}");ne("\\Beta","\\mathrm{B}");ne("\\bull","\\bullet");ne("\\Chi","\\mathrm{X}");ne("\\clubs","\\clubsuit");ne("\\cnums","\\mathbb{C}");ne("\\Complex","\\mathbb{C}");ne("\\Dagger","\\ddagger");ne("\\diamonds","\\diamondsuit");ne("\\empty","\\emptyset");ne("\\Epsilon","\\mathrm{E}");ne("\\Eta","\\mathrm{H}");ne("\\exist","\\exists");ne("\\harr","\\leftrightarrow");ne("\\hArr","\\Leftrightarrow");ne("\\Harr","\\Leftrightarrow");ne("\\hearts","\\heartsuit");ne("\\image","\\Im");ne("\\infin","\\infty");ne("\\Iota","\\mathrm{I}");ne("\\isin","\\in");ne("\\Kappa","\\mathrm{K}");ne("\\larr","\\leftarrow");ne("\\lArr","\\Leftarrow");ne("\\Larr","\\Leftarrow");ne("\\lrarr","\\leftrightarrow");ne("\\lrArr","\\Leftrightarrow");ne("\\Lrarr","\\Leftrightarrow");ne("\\Mu","\\mathrm{M}");ne("\\natnums","\\mathbb{N}");ne("\\Nu","\\mathrm{N}");ne("\\Omicron","\\mathrm{O}");ne("\\plusmn","\\pm");ne("\\rarr","\\rightarrow");ne("\\rArr","\\Rightarrow");ne("\\Rarr","\\Rightarrow");ne("\\real","\\Re");ne("\\reals","\\mathbb{R}");ne("\\Reals","\\mathbb{R}");ne("\\Rho","\\mathrm{P}");ne("\\sdot","\\cdot");ne("\\sect","\\S");ne("\\spades","\\spadesuit");ne("\\sub","\\subset");ne("\\sube","\\subseteq");ne("\\supe","\\supseteq");ne("\\Tau","\\mathrm{T}");ne("\\thetasym","\\vartheta");ne("\\weierp","\\wp");ne("\\Zeta","\\mathrm{Z}");ne("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ne("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ne("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ne("\\bra","\\mathinner{\\langle{#1}|}");ne("\\ket","\\mathinner{|{#1}\\rangle}");ne("\\braket","\\mathinner{\\langle{#1}\\rangle}");ne("\\Bra","\\left\\langle#1\\right|");ne("\\Ket","\\left|#1\\right\\rangle");var _z=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,a=n.consumeArg().tokens,o=n.macros.get("|"),l=n.macros.get("\\|");n.macros.beginGroup();var c=h=>m=>{e&&(m.macros.set("|",o),s.length&&m.macros.set("\\|",l));var g=h;if(!h&&s.length){var S=m.future();S.text==="|"&&(m.popToken(),g=!0)}return{tokens:g?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var f=n.consumeArg().tokens,_=n.expandTokens([...a,...f,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ne("\\bra@ket",_z(!1));ne("\\bra@set",_z(!0));ne("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ne("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ne("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ne("\\angln","{\\angl n}");ne("\\blue","\\textcolor{##6495ed}{#1}");ne("\\orange","\\textcolor{##ffa500}{#1}");ne("\\pink","\\textcolor{##ff00af}{#1}");ne("\\red","\\textcolor{##df0030}{#1}");ne("\\green","\\textcolor{##28ae7b}{#1}");ne("\\gray","\\textcolor{gray}{#1}");ne("\\purple","\\textcolor{##9d38bd}{#1}");ne("\\blueA","\\textcolor{##ccfaff}{#1}");ne("\\blueB","\\textcolor{##80f6ff}{#1}");ne("\\blueC","\\textcolor{##63d9ea}{#1}");ne("\\blueD","\\textcolor{##11accd}{#1}");ne("\\blueE","\\textcolor{##0c7f99}{#1}");ne("\\tealA","\\textcolor{##94fff5}{#1}");ne("\\tealB","\\textcolor{##26edd5}{#1}");ne("\\tealC","\\textcolor{##01d1c1}{#1}");ne("\\tealD","\\textcolor{##01a995}{#1}");ne("\\tealE","\\textcolor{##208170}{#1}");ne("\\greenA","\\textcolor{##b6ffb0}{#1}");ne("\\greenB","\\textcolor{##8af281}{#1}");ne("\\greenC","\\textcolor{##74cf70}{#1}");ne("\\greenD","\\textcolor{##1fab54}{#1}");ne("\\greenE","\\textcolor{##0d923f}{#1}");ne("\\goldA","\\textcolor{##ffd0a9}{#1}");ne("\\goldB","\\textcolor{##ffbb71}{#1}");ne("\\goldC","\\textcolor{##ff9c39}{#1}");ne("\\goldD","\\textcolor{##e07d10}{#1}");ne("\\goldE","\\textcolor{##a75a05}{#1}");ne("\\redA","\\textcolor{##fca9a9}{#1}");ne("\\redB","\\textcolor{##ff8482}{#1}");ne("\\redC","\\textcolor{##f9685d}{#1}");ne("\\redD","\\textcolor{##e84d39}{#1}");ne("\\redE","\\textcolor{##bc2612}{#1}");ne("\\maroonA","\\textcolor{##ffbde0}{#1}");ne("\\maroonB","\\textcolor{##ff92c6}{#1}");ne("\\maroonC","\\textcolor{##ed5fa6}{#1}");ne("\\maroonD","\\textcolor{##ca337c}{#1}");ne("\\maroonE","\\textcolor{##9e034e}{#1}");ne("\\purpleA","\\textcolor{##ddd7ff}{#1}");ne("\\purpleB","\\textcolor{##c6b9fc}{#1}");ne("\\purpleC","\\textcolor{##aa87ff}{#1}");ne("\\purpleD","\\textcolor{##7854ab}{#1}");ne("\\purpleE","\\textcolor{##543b78}{#1}");ne("\\mintA","\\textcolor{##f5f9e8}{#1}");ne("\\mintB","\\textcolor{##edf2df}{#1}");ne("\\mintC","\\textcolor{##e0e5cc}{#1}");ne("\\grayA","\\textcolor{##f6f7f7}{#1}");ne("\\grayB","\\textcolor{##f0f1f2}{#1}");ne("\\grayC","\\textcolor{##e3e5e6}{#1}");ne("\\grayD","\\textcolor{##d6d8da}{#1}");ne("\\grayE","\\textcolor{##babec2}{#1}");ne("\\grayF","\\textcolor{##888d93}{#1}");ne("\\grayG","\\textcolor{##626569}{#1}");ne("\\grayH","\\textcolor{##3b3e40}{#1}");ne("\\grayI","\\textcolor{##21242c}{#1}");ne("\\kaBlue","\\textcolor{##314453}{#1}");ne("\\kaGreen","\\textcolor{##71B307}{#1}");var pz={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Pnt{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 Bnt($nt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new e8(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 Ui("EOF",r.loc)),this.pushTokens(s),new Ui("",Ss.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(),a,o=0,l=0;do{if(a=this.popToken(),t.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Ue("Extra }",a)}else if(a.text==="EOF")throw new Ue("Unexpected end of input in a macro argument, expected '"+(n&&r?n[l]:"}")+"'",a);if(n&&r)if((o===0||o===1&&n[l]==="{")&&a.text===n[l]){if(++l,l===n.length){t.splice(-l,l);break}}else l=0}while(o!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:a}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ue("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ue("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 Ue("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var a=s.tokens,o=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var c=a[l];if(c.text==="#"){if(l===0)throw new Ue("Incomplete placeholder at end of macro body",c);if(c=a[--l],c.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(c.text))a.splice(l,2,...o[+c.text-1]);else throw new Ue("Not a valid argument number",c)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Ui(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 a=0;if(s.includes("#"))for(var o=s.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new e8(s,this.settings),c=[],f=l.lex();f.text!=="EOF";)c.push(f),f=l.lex();c.reverse();var _={tokens:c,numArgs:a};return _}return s}isDefined(n){return this.macros.has(n)||el.hasOwnProperty(n)||Ln.math.hasOwnProperty(n)||Ln.text.hasOwnProperty(n)||pz.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:el.hasOwnProperty(n)&&!el[n].primitive}}var r8=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,T_=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),nb={"́":{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"}},s8={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class jp{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 Pnt(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 Ue("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 Ui("}")),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(jp.endOfExpression.has(s.text)||t&&s.text===t||n&&el[s.text]&&el[s.text].infix)break;var a=this.parseAtom(t);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(yN(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)),o={type:"textord",mode:"text",loc:Ss.range(n),text:t};else return null;if(this.consume(),a)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=C+1:(S!==C&&w.push({type:"text",value:f.value.slice(S,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),S=C+y[0].length,b=!0),!m.global)break;y=m.exec(f.value)}return b?(S?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=a8(e,"(");let a=a8(e,")");for(;r!==-1&&s>a;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),a++;return[e,t]}function vz(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||ec(t)||hp(t))&&(!n||t!==47)}xz.peek=xrt;function drt(){this.buffer()}function hrt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _rt(){this.buffer()}function prt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mrt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Pi(this.sliceSerialize(e)).toLowerCase(),t.label=n}function grt(e){this.exit(e)}function brt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Pi(this.sliceSerialize(e)).toLowerCase(),t.label=n}function vrt(e){this.exit(e)}function xrt(){return"["}function xz(e,n,t,r){const s=t.createTracker(r);let a=s.move("[^");const o=t.enter("footnoteReference"),l=t.enter("reference");return a+=s.move(t.safe(t.associationId(e),{after:"]",before:a})),l(),o(),a+=s.move("]"),a}function yrt(){return{enter:{gfmFootnoteCallString:drt,gfmFootnoteCall:hrt,gfmFootnoteDefinitionLabelString:_rt,gfmFootnoteDefinition:prt},exit:{gfmFootnoteCallString:mrt,gfmFootnoteCall:grt,gfmFootnoteDefinitionLabelString:brt,gfmFootnoteDefinition:vrt}}}function wrt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:xz},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,a,o){const l=a.createTracker(o);let c=l.move("[^");const f=a.enter("footnoteDefinition"),_=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),_(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((n?` -`:" ")+a.indentLines(a.containerFlow(r,l.current()),n?yz:Srt))),f(),c}}function Srt(e,n,t){return n===0?e:yz(e,n,t)}function yz(e,n,t){return(t?"":" ")+e}const krt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wz.peek=Art;function Crt(){return{canContainEols:["delete"],enter:{strikethrough:Nrt},exit:{strikethrough:zrt}}}function Ert(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:krt}],handlers:{delete:wz}}}function Nrt(e){this.enter({type:"delete",children:[]},e)}function zrt(e){this.exit(e)}function wz(e,n,t,r){const s=t.createTracker(r),a=t.enter("strikethrough");let o=s.move("~~");return o+=t.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),a(),o}function Art(){return"~"}function jrt(e){return e.length}function Trt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||jrt,a=[],o=[],l=[],c=[];let f=0,_=-1;for(;++_f&&(f=e[_].length);++bc[b])&&(c[b]=y)}k.push(w)}o[_]=k,l[_]=v}let h=-1;if(typeof r=="object"&&"length"in r)for(;++hc[h]&&(c[h]=w),g[h]=w),m[h]=y}o.splice(1,0,m),l.splice(1,0,g),_=-1;const S=[];for(;++_ "),a.shift(2);const o=t.indentLines(t.containerFlow(e,a.current()),Drt);return s(),o}function Drt(e,n,t){return">"+(t?"":" ")+e}function Lrt(e,n){return l8(e,n.inConstruct,!0)&&!l8(e,n.notInConstruct,!1)}function l8(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ro&&(o=a):a=1,s=r+n.length,r=t.indexOf(n,s);return o}function Ort(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 Irt(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 Brt(e,n,t,r){const s=Irt(t),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(Ort(e,t)){const h=t.enter("codeIndented"),m=t.indentLines(a,$rt);return h(),m}const l=t.createTracker(r),c=s.repeat(Math.max(Sz(a,s)+1,3)),f=t.enter("codeFenced");let _=l.move(c);if(e.lang){const h=t.enter(`codeFencedLang${o}`);_+=l.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=t.enter(`codeFencedMeta${o}`);_+=l.move(" "),_+=l.move(t.safe(e.meta,{before:_,after:` -`,encode:["`"],...l.current()})),h()}return _+=l.move(` +?)[ \r ]*`,Bv="[̀-ͯ]",vrt=new RegExp(Bv+"+$"),xrt="("+pz+"+)|"+(brt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Bv+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Bv+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+grt)+("|"+mrt+")");class n8{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(xrt,"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 qi("EOF",new Ns(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Pe("Unexpected character: '"+n[t]+"'",new qi(n[t],new Ns(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var a=n.indexOf(` +`,this.tokenRegex.lastIndex);return a===-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=a+1,this.lex()}return new qi(s,new Ns(this,t,this.tokenRegex.lastIndex))}}class yrt{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 Pe("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 a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(n)&&(a[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var wrt=rz;ne("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ne("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ne("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ne("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ne("\\@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}});ne("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ne("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var r8={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};ne("\\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 Pe("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=r8[n.text],r==null||r>=t)throw new Pe("Invalid base-"+t+" digit "+n.text);for(var s;(s=r8[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Pe("\\newcommand's first argument must be a macro name");var a=s[0].text,o=e.isDefined(a);if(o&&!n)throw new Pe("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!t)throw new Pe("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",f=e.expandNextToken();f.text!=="]"&&f.text!=="EOF";)c+=f.text,f=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Pe("Invalid number of arguments: "+c);l=parseInt(c),s=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:s,numArgs:l}),""};ne("\\newcommand",e=>Mx(e,!1,!0,!1));ne("\\renewcommand",e=>Mx(e,!0,!1,!1));ne("\\providecommand",e=>Mx(e,!0,!0,!0));ne("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ne("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ne("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),el[t],Bn.math[t],Bn.text[t]),""});ne("\\bgroup","{");ne("\\egroup","}");ne("~","\\nobreakspace");ne("\\lq","`");ne("\\rq","'");ne("\\aa","\\r a");ne("\\AA","\\r A");ne("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ne("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ne("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ne("ℬ","\\mathscr{B}");ne("ℰ","\\mathscr{E}");ne("ℱ","\\mathscr{F}");ne("ℋ","\\mathscr{H}");ne("ℐ","\\mathscr{I}");ne("ℒ","\\mathscr{L}");ne("ℳ","\\mathscr{M}");ne("ℛ","\\mathscr{R}");ne("ℭ","\\mathfrak{C}");ne("ℌ","\\mathfrak{H}");ne("ℨ","\\mathfrak{Z}");ne("\\Bbbk","\\Bbb{k}");ne("\\llap","\\mathllap{\\textrm{#1}}");ne("\\rlap","\\mathrlap{\\textrm{#1}}");ne("\\clap","\\mathclap{\\textrm{#1}}");ne("\\mathstrut","\\vphantom{(}");ne("\\underbar","\\underline{\\text{#1}}");ne("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ne("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ne("\\ne","\\neq");ne("≠","\\neq");ne("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ne("∉","\\notin");ne("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ne("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ne("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ne("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ne("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ne("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ne("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ne("⟂","\\perp");ne("‼","\\mathclose{!\\mkern-0.8mu!}");ne("∌","\\notni");ne("⌜","\\ulcorner");ne("⌝","\\urcorner");ne("⌞","\\llcorner");ne("⌟","\\lrcorner");ne("©","\\copyright");ne("®","\\textregistered");ne("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ne("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ne("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ne("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ne("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ne("⋮","\\vdots");ne("\\varGamma","\\mathit{\\Gamma}");ne("\\varDelta","\\mathit{\\Delta}");ne("\\varTheta","\\mathit{\\Theta}");ne("\\varLambda","\\mathit{\\Lambda}");ne("\\varXi","\\mathit{\\Xi}");ne("\\varPi","\\mathit{\\Pi}");ne("\\varSigma","\\mathit{\\Sigma}");ne("\\varUpsilon","\\mathit{\\Upsilon}");ne("\\varPhi","\\mathit{\\Phi}");ne("\\varPsi","\\mathit{\\Psi}");ne("\\varOmega","\\mathit{\\Omega}");ne("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ne("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ne("\\boxed","\\fbox{$\\displaystyle{#1}$}");ne("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ne("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ne("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ne("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ne("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var s8={",":"\\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"},Srt=new Set(["bin","rel"]);ne("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in s8?n=s8[t]:(t.slice(0,4)==="\\not"||t in Bn.math&&Srt.has(Bn.math[t].group))&&(n="\\dotsb"),n});var Rx={")":!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};ne("\\dotso",function(e){var n=e.future().text;return n in Rx?"\\ldots\\,":"\\ldots"});ne("\\dotsc",function(e){var n=e.future().text;return n in Rx&&n!==","?"\\ldots\\,":"\\ldots"});ne("\\cdots",function(e){var n=e.future().text;return n in Rx?"\\@cdots\\,":"\\@cdots"});ne("\\dotsb","\\cdots");ne("\\dotsm","\\cdots");ne("\\dotsi","\\!\\cdots");ne("\\dotsx","\\ldots\\,");ne("\\DOTSI","\\relax");ne("\\DOTSB","\\relax");ne("\\DOTSX","\\relax");ne("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ne("\\,","\\tmspace+{3mu}{.1667em}");ne("\\thinspace","\\,");ne("\\>","\\mskip{4mu}");ne("\\:","\\tmspace+{4mu}{.2222em}");ne("\\medspace","\\:");ne("\\;","\\tmspace+{5mu}{.2777em}");ne("\\thickspace","\\;");ne("\\!","\\tmspace-{3mu}{.1667em}");ne("\\negthinspace","\\!");ne("\\negmedspace","\\tmspace-{4mu}{.2222em}");ne("\\negthickspace","\\tmspace-{5mu}{.277em}");ne("\\enspace","\\kern.5em ");ne("\\enskip","\\hskip.5em\\relax");ne("\\quad","\\hskip1em\\relax");ne("\\qquad","\\hskip2em\\relax");ne("\\tag","\\@ifstar\\tag@literal\\tag@paren");ne("\\tag@paren","\\tag@literal{({#1})}");ne("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Pe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ne("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ne("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ne("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ne("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ne("\\newline","\\\\\\relax");ne("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var mz=Ge(pa["Main-Regular"][84][1]-.7*pa["Main-Regular"][65][1]);ne("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+mz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ne("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+mz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ne("\\hspace","\\@ifstar\\@hspacer\\@hspace");ne("\\@hspace","\\hskip #1\\relax");ne("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ne("\\ordinarycolon",":");ne("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ne("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ne("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ne("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ne("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ne("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ne("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ne("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ne("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ne("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ne("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ne("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ne("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ne("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ne("∷","\\dblcolon");ne("∹","\\eqcolon");ne("≔","\\coloneqq");ne("≕","\\eqqcolon");ne("⩴","\\Coloneqq");ne("\\ratio","\\vcentcolon");ne("\\coloncolon","\\dblcolon");ne("\\colonequals","\\coloneqq");ne("\\coloncolonequals","\\Coloneqq");ne("\\equalscolon","\\eqqcolon");ne("\\equalscoloncolon","\\Eqqcolon");ne("\\colonminus","\\coloneq");ne("\\coloncolonminus","\\Coloneq");ne("\\minuscolon","\\eqcolon");ne("\\minuscoloncolon","\\Eqcolon");ne("\\coloncolonapprox","\\Colonapprox");ne("\\coloncolonsim","\\Colonsim");ne("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ne("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ne("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ne("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ne("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ne("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ne("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ne("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ne("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ne("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ne("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ne("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ne("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ne("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ne("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ne("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ne("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ne("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ne("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ne("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ne("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ne("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ne("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ne("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ne("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ne("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ne("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ne("\\imath","\\html@mathml{\\@imath}{ı}");ne("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ne("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ne("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ne("⟦","\\llbracket");ne("⟧","\\rrbracket");ne("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ne("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ne("⦃","\\lBrace");ne("⦄","\\rBrace");ne("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ne("⦵","\\minuso");ne("\\darr","\\downarrow");ne("\\dArr","\\Downarrow");ne("\\Darr","\\Downarrow");ne("\\lang","\\langle");ne("\\rang","\\rangle");ne("\\uarr","\\uparrow");ne("\\uArr","\\Uparrow");ne("\\Uarr","\\Uparrow");ne("\\N","\\mathbb{N}");ne("\\R","\\mathbb{R}");ne("\\Z","\\mathbb{Z}");ne("\\alef","\\aleph");ne("\\alefsym","\\aleph");ne("\\Alpha","\\mathrm{A}");ne("\\Beta","\\mathrm{B}");ne("\\bull","\\bullet");ne("\\Chi","\\mathrm{X}");ne("\\clubs","\\clubsuit");ne("\\cnums","\\mathbb{C}");ne("\\Complex","\\mathbb{C}");ne("\\Dagger","\\ddagger");ne("\\diamonds","\\diamondsuit");ne("\\empty","\\emptyset");ne("\\Epsilon","\\mathrm{E}");ne("\\Eta","\\mathrm{H}");ne("\\exist","\\exists");ne("\\harr","\\leftrightarrow");ne("\\hArr","\\Leftrightarrow");ne("\\Harr","\\Leftrightarrow");ne("\\hearts","\\heartsuit");ne("\\image","\\Im");ne("\\infin","\\infty");ne("\\Iota","\\mathrm{I}");ne("\\isin","\\in");ne("\\Kappa","\\mathrm{K}");ne("\\larr","\\leftarrow");ne("\\lArr","\\Leftarrow");ne("\\Larr","\\Leftarrow");ne("\\lrarr","\\leftrightarrow");ne("\\lrArr","\\Leftrightarrow");ne("\\Lrarr","\\Leftrightarrow");ne("\\Mu","\\mathrm{M}");ne("\\natnums","\\mathbb{N}");ne("\\Nu","\\mathrm{N}");ne("\\Omicron","\\mathrm{O}");ne("\\plusmn","\\pm");ne("\\rarr","\\rightarrow");ne("\\rArr","\\Rightarrow");ne("\\Rarr","\\Rightarrow");ne("\\real","\\Re");ne("\\reals","\\mathbb{R}");ne("\\Reals","\\mathbb{R}");ne("\\Rho","\\mathrm{P}");ne("\\sdot","\\cdot");ne("\\sect","\\S");ne("\\spades","\\spadesuit");ne("\\sub","\\subset");ne("\\sube","\\subseteq");ne("\\supe","\\supseteq");ne("\\Tau","\\mathrm{T}");ne("\\thetasym","\\vartheta");ne("\\weierp","\\wp");ne("\\Zeta","\\mathrm{Z}");ne("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ne("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ne("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ne("\\bra","\\mathinner{\\langle{#1}|}");ne("\\ket","\\mathinner{|{#1}\\rangle}");ne("\\braket","\\mathinner{\\langle{#1}\\rangle}");ne("\\Bra","\\left\\langle#1\\right|");ne("\\Ket","\\left|#1\\right\\rangle");var gz=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,a=n.consumeArg().tokens,o=n.macros.get("|"),l=n.macros.get("\\|");n.macros.beginGroup();var c=d=>m=>{e&&(m.macros.set("|",o),s.length&&m.macros.set("\\|",l));var g=d;if(!d&&s.length){var S=m.future();S.text==="|"&&(m.popToken(),g=!0)}return{tokens:g?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var f=n.consumeArg().tokens,_=n.expandTokens([...a,...f,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ne("\\bra@ket",gz(!1));ne("\\bra@set",gz(!0));ne("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ne("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ne("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ne("\\angln","{\\angl n}");ne("\\blue","\\textcolor{##6495ed}{#1}");ne("\\orange","\\textcolor{##ffa500}{#1}");ne("\\pink","\\textcolor{##ff00af}{#1}");ne("\\red","\\textcolor{##df0030}{#1}");ne("\\green","\\textcolor{##28ae7b}{#1}");ne("\\gray","\\textcolor{gray}{#1}");ne("\\purple","\\textcolor{##9d38bd}{#1}");ne("\\blueA","\\textcolor{##ccfaff}{#1}");ne("\\blueB","\\textcolor{##80f6ff}{#1}");ne("\\blueC","\\textcolor{##63d9ea}{#1}");ne("\\blueD","\\textcolor{##11accd}{#1}");ne("\\blueE","\\textcolor{##0c7f99}{#1}");ne("\\tealA","\\textcolor{##94fff5}{#1}");ne("\\tealB","\\textcolor{##26edd5}{#1}");ne("\\tealC","\\textcolor{##01d1c1}{#1}");ne("\\tealD","\\textcolor{##01a995}{#1}");ne("\\tealE","\\textcolor{##208170}{#1}");ne("\\greenA","\\textcolor{##b6ffb0}{#1}");ne("\\greenB","\\textcolor{##8af281}{#1}");ne("\\greenC","\\textcolor{##74cf70}{#1}");ne("\\greenD","\\textcolor{##1fab54}{#1}");ne("\\greenE","\\textcolor{##0d923f}{#1}");ne("\\goldA","\\textcolor{##ffd0a9}{#1}");ne("\\goldB","\\textcolor{##ffbb71}{#1}");ne("\\goldC","\\textcolor{##ff9c39}{#1}");ne("\\goldD","\\textcolor{##e07d10}{#1}");ne("\\goldE","\\textcolor{##a75a05}{#1}");ne("\\redA","\\textcolor{##fca9a9}{#1}");ne("\\redB","\\textcolor{##ff8482}{#1}");ne("\\redC","\\textcolor{##f9685d}{#1}");ne("\\redD","\\textcolor{##e84d39}{#1}");ne("\\redE","\\textcolor{##bc2612}{#1}");ne("\\maroonA","\\textcolor{##ffbde0}{#1}");ne("\\maroonB","\\textcolor{##ff92c6}{#1}");ne("\\maroonC","\\textcolor{##ed5fa6}{#1}");ne("\\maroonD","\\textcolor{##ca337c}{#1}");ne("\\maroonE","\\textcolor{##9e034e}{#1}");ne("\\purpleA","\\textcolor{##ddd7ff}{#1}");ne("\\purpleB","\\textcolor{##c6b9fc}{#1}");ne("\\purpleC","\\textcolor{##aa87ff}{#1}");ne("\\purpleD","\\textcolor{##7854ab}{#1}");ne("\\purpleE","\\textcolor{##543b78}{#1}");ne("\\mintA","\\textcolor{##f5f9e8}{#1}");ne("\\mintB","\\textcolor{##edf2df}{#1}");ne("\\mintC","\\textcolor{##e0e5cc}{#1}");ne("\\grayA","\\textcolor{##f6f7f7}{#1}");ne("\\grayB","\\textcolor{##f0f1f2}{#1}");ne("\\grayC","\\textcolor{##e3e5e6}{#1}");ne("\\grayD","\\textcolor{##d6d8da}{#1}");ne("\\grayE","\\textcolor{##babec2}{#1}");ne("\\grayF","\\textcolor{##888d93}{#1}");ne("\\grayG","\\textcolor{##626569}{#1}");ne("\\grayH","\\textcolor{##3b3e40}{#1}");ne("\\grayI","\\textcolor{##21242c}{#1}");ne("\\kaBlue","\\textcolor{##314453}{#1}");ne("\\kaGreen","\\textcolor{##71B307}{#1}");var bz={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class krt{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 yrt(wrt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new n8(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 qi("EOF",r.loc)),this.pushTokens(s),new qi("",Ns.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(),a,o=0,l=0;do{if(a=this.popToken(),t.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Pe("Extra }",a)}else if(a.text==="EOF")throw new Pe("Unexpected end of input in a macro argument, expected '"+(n&&r?n[l]:"}")+"'",a);if(n&&r)if((o===0||o===1&&n[l]==="{")&&a.text===n[l]){if(++l,l===n.length){t.splice(-l,l);break}}else l=0}while(o!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:a}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Pe("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Pe("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 Pe("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var a=s.tokens,o=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var c=a[l];if(c.text==="#"){if(l===0)throw new Pe("Incomplete placeholder at end of macro body",c);if(c=a[--l],c.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(c.text))a.splice(l,2,...o[+c.text-1]);else throw new Pe("Not a valid argument number",c)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new qi(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 a=0;if(s.includes("#"))for(var o=s.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new n8(s,this.settings),c=[],f=l.lex();f.text!=="EOF";)c.push(f),f=l.lex();c.reverse();var _={tokens:c,numArgs:a};return _}return s}isDefined(n){return this.macros.has(n)||el.hasOwnProperty(n)||Bn.math.hasOwnProperty(n)||Bn.text.hasOwnProperty(n)||bz.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:el.hasOwnProperty(n)&&!el[n].primitive}}var i8=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,T_=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ib={"́":{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"}},a8={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Tp{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 krt(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 Pe("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 qi("}")),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(Tp.endOfExpression.has(s.text)||t&&s.text===t||n&&el[s.text]&&el[s.text].infix)break;var a=this.parseAtom(t);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(kN(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)),o={type:"textord",mode:"text",loc:Ns.range(n),text:t};else return null;if(this.consume(),a)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=C+1:(S!==C&&w.push({type:"text",value:f.value.slice(S,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),S=C+y[0].length,b=!0),!m.global)break;y=m.exec(f.value)}return b?(S?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=l8(e,"(");let a=l8(e,")");for(;r!==-1&&s>a;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),a++;return[e,t]}function wz(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||ec(t)||_p(t))&&(!n||t!==47)}Sz.peek=rst;function Xrt(){this.buffer()}function Yrt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zrt(){this.buffer()}function Qrt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Jrt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Pi(this.sliceSerialize(e)).toLowerCase(),t.label=n}function est(e){this.exit(e)}function tst(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Pi(this.sliceSerialize(e)).toLowerCase(),t.label=n}function nst(e){this.exit(e)}function rst(){return"["}function Sz(e,n,t,r){const s=t.createTracker(r);let a=s.move("[^");const o=t.enter("footnoteReference"),l=t.enter("reference");return a+=s.move(t.safe(t.associationId(e),{after:"]",before:a})),l(),o(),a+=s.move("]"),a}function sst(){return{enter:{gfmFootnoteCallString:Xrt,gfmFootnoteCall:Yrt,gfmFootnoteDefinitionLabelString:Zrt,gfmFootnoteDefinition:Qrt},exit:{gfmFootnoteCallString:Jrt,gfmFootnoteCall:est,gfmFootnoteDefinitionLabelString:tst,gfmFootnoteDefinition:nst}}}function ist(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Sz},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,a,o){const l=a.createTracker(o);let c=l.move("[^");const f=a.enter("footnoteDefinition"),_=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),_(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((n?` +`:" ")+a.indentLines(a.containerFlow(r,l.current()),n?kz:ast))),f(),c}}function ast(e,n,t){return n===0?e:kz(e,n,t)}function kz(e,n,t){return(t?"":" ")+e}const ost=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cz.peek=hst;function lst(){return{canContainEols:["delete"],enter:{strikethrough:ust},exit:{strikethrough:fst}}}function cst(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ost}],handlers:{delete:Cz}}}function ust(e){this.enter({type:"delete",children:[]},e)}function fst(e){this.exit(e)}function Cz(e,n,t,r){const s=t.createTracker(r),a=t.enter("strikethrough");let o=s.move("~~");return o+=t.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),a(),o}function hst(){return"~"}function dst(e){return e.length}function _st(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||dst,a=[],o=[],l=[],c=[];let f=0,_=-1;for(;++_f&&(f=e[_].length);++bc[b])&&(c[b]=y)}k.push(w)}o[_]=k,l[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dc[d]&&(c[d]=w),g[d]=w),m[d]=y}o.splice(1,0,m),l.splice(1,0,g),_=-1;const S=[];for(;++_ "),a.shift(2);const o=t.indentLines(t.containerFlow(e,a.current()),gst);return s(),o}function gst(e,n,t){return">"+(t?"":" ")+e}function bst(e,n){return u8(e,n.inConstruct,!0)&&!u8(e,n.notInConstruct,!1)}function u8(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ro&&(o=a):a=1,s=r+n.length,r=t.indexOf(n,s);return o}function vst(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 xst(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 yst(e,n,t,r){const s=xst(t),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(vst(e,t)){const d=t.enter("codeIndented"),m=t.indentLines(a,wst);return d(),m}const l=t.createTracker(r),c=s.repeat(Math.max(Ez(a,s)+1,3)),f=t.enter("codeFenced");let _=l.move(c);if(e.lang){const d=t.enter(`codeFencedLang${o}`);_+=l.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${o}`);_+=l.move(" "),_+=l.move(t.safe(e.meta,{before:_,after:` +`,encode:["`"],...l.current()})),d()}return _+=l.move(` `),a&&(_+=l.move(a+` -`)),_+=l.move(c),f(),_}function $rt(e,n,t){return(t?"":" ")+e}function Dx(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 Hrt(e,n,t,r){const s=Dx(t),a=s==='"'?"Quote":"Apostrophe",o=t.enter("definition");let l=t.enter("label");const c=t.createTracker(r);let f=c.move("[");return f+=c.move(t.safe(t.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+s),f+=c.move(t.safe(e.title,{before:f,after:s,...c.current()})),f+=c.move(s),l()),o(),f}function Prt(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 vd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function O0(e,n,t){const r=Cu(e),s=Cu(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}}kz.peek=Frt;function kz(e,n,t,r){const s=Prt(t),a=t.enter("emphasis"),o=t.createTracker(r),l=o.move(s);let c=o.move(t.containerPhrasing(e,{after:s,before:l,...o.current()}));const f=c.charCodeAt(0),_=O0(r.before.charCodeAt(r.before.length-1),f,s);_.inside&&(c=vd(f)+c.slice(1));const h=c.charCodeAt(c.length-1),m=O0(r.after.charCodeAt(0),h,s);m.inside&&(c=c.slice(0,-1)+vd(h));const g=o.move(s);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},l+c+g}function Frt(e,n,t){return t.options.emphasis||"*"}function Urt(e,n){let t=!1;return ax(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,av}),!!((!e.depth||e.depth<3)&&hx(e)&&(n.options.setext||t))}function qrt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),a=t.createTracker(r);if(Urt(e,t)){const _=t.enter("headingSetext"),h=t.enter("phrasing"),m=t.containerPhrasing(e,{...a.current(),before:` +`)),_+=l.move(c),f(),_}function wst(e,n,t){return(t?"":" ")+e}function Ox(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 Sst(e,n,t,r){const s=Ox(t),a=s==='"'?"Quote":"Apostrophe",o=t.enter("definition");let l=t.enter("label");const c=t.createTracker(r);let f=c.move("[");return f+=c.move(t.safe(t.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+s),f+=c.move(t.safe(e.title,{before:f,after:s,...c.current()})),f+=c.move(s),l()),o(),f}function kst(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 vh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function I0(e,n,t){const r=Cu(e),s=Cu(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}}Nz.peek=Cst;function Nz(e,n,t,r){const s=kst(t),a=t.enter("emphasis"),o=t.createTracker(r),l=o.move(s);let c=o.move(t.containerPhrasing(e,{after:s,before:l,...o.current()}));const f=c.charCodeAt(0),_=I0(r.before.charCodeAt(r.before.length-1),f,s);_.inside&&(c=vh(f)+c.slice(1));const d=c.charCodeAt(c.length-1),m=I0(r.after.charCodeAt(0),d,s);m.inside&&(c=c.slice(0,-1)+vh(d));const g=o.move(s);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},l+c+g}function Cst(e,n,t){return t.options.emphasis||"*"}function Est(e,n){let t=!1;return lx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,lv}),!!((!e.depth||e.depth<3)&&px(e)&&(n.options.setext||t))}function Nst(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),a=t.createTracker(r);if(Est(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),m=t.containerPhrasing(e,{...a.current(),before:` `,after:` -`});return h(),_(),m+` +`});return d(),_(),m+` `+(s===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` `))+1))}const o="#".repeat(s),l=t.enter("headingAtx"),c=t.enter("phrasing");a.move(o+" ");let f=t.containerPhrasing(e,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(f)&&(f=vd(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,t.options.closeAtx&&(f+=" "+o),c(),l(),f}Cz.peek=Grt;function Cz(e){return e.value||""}function Grt(){return"<"}Ez.peek=Vrt;function Ez(e,n,t,r){const s=Dx(t),a=s==='"'?"Quote":"Apostrophe",o=t.enter("image");let l=t.enter("label");const c=t.createTracker(r);let f=c.move("![");return f+=c.move(t.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+s),f+=c.move(t.safe(e.title,{before:f,after:s,...c.current()})),f+=c.move(s),l()),f+=c.move(")"),o(),f}function Vrt(){return"!"}Nz.peek=Wrt;function Nz(e,n,t,r){const s=e.referenceType,a=t.enter("imageReference");let o=t.enter("label");const l=t.createTracker(r);let c=l.move("![");const f=t.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const _=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=_,a(),s==="full"||!f||f!==h?c+=l.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Wrt(){return"!"}zz.peek=Krt;function zz(e,n,t){let r=e.value||"",s="`",a=-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+" ");++a\u007F]/.test(e.url))}jz.peek=Xrt;function jz(e,n,t,r){const s=Dx(t),a=s==='"'?"Quote":"Apostrophe",o=t.createTracker(r);let l,c;if(Az(e,t)){const _=t.stack;t.stack=[],l=t.enter("autolink");let h=o.move("<");return h+=o.move(t.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">"),l(),t.stack=_,h}l=t.enter("link"),c=t.enter("label");let f=o.move("[");return f+=o.move(t.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(t.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(c=t.enter("destinationRaw"),f+=o.move(t.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=t.enter(`title${a}`),f+=o.move(" "+s),f+=o.move(t.safe(e.title,{before:f,after:s,...o.current()})),f+=o.move(s),c()),f+=o.move(")"),l(),f}function Xrt(e,n,t){return Az(e,t)?"<":"["}Tz.peek=Yrt;function Tz(e,n,t,r){const s=e.referenceType,a=t.enter("linkReference");let o=t.enter("label");const l=t.createTracker(r);let c=l.move("[");const f=t.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const _=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=_,a(),s==="full"||!f||f!==h?c+=l.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Yrt(){return"["}function Lx(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 Zrt(e){const n=Lx(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 Qrt(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 Mz(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 Jrt(e,n,t,r){const s=t.enter("list"),a=t.bulletCurrent;let o=e.ordered?Qrt(t):Lx(t);const l=e.ordered?o==="."?")":".":Zrt(t);let c=n&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&_&&(!_.children||!_.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),Mz(t)===o&&_){let h=-1;for(;++h-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+a);let o=a.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=t.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=t.enter("listItem"),f=t.indentLines(t.containerFlow(e,l.current()),_);return c(),f;function _(h,m,g){return m?(g?"":" ".repeat(o))+h:(g?a:a+" ".repeat(o-a.length))+h}}function nst(e,n,t,r){const s=t.enter("paragraph"),a=t.enter("phrasing"),o=t.containerPhrasing(e,r);return a(),s(),o}const rst=Xd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sst(e,n,t,r){return(e.children.some(function(o){return rst(o)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function ist(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Rz.peek=ast;function Rz(e,n,t,r){const s=ist(t),a=t.enter("strong"),o=t.createTracker(r),l=o.move(s+s);let c=o.move(t.containerPhrasing(e,{after:s,before:l,...o.current()}));const f=c.charCodeAt(0),_=O0(r.before.charCodeAt(r.before.length-1),f,s);_.inside&&(c=vd(f)+c.slice(1));const h=c.charCodeAt(c.length-1),m=O0(r.after.charCodeAt(0),h,s);m.inside&&(c=c.slice(0,-1)+vd(h));const g=o.move(s+s);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},l+c+g}function ast(e,n,t){return t.options.strong||"*"}function ost(e,n,t,r){return t.safe(e.value,r)}function lst(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 cst(e,n,t){const r=(Mz(t)+(t.options.ruleSpaces?" ":"")).repeat(lst(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Dz={blockquote:Rrt,break:c8,code:Brt,definition:Hrt,emphasis:kz,hardBreak:c8,heading:qrt,html:Cz,image:Ez,imageReference:Nz,inlineCode:zz,link:jz,linkReference:Tz,list:Jrt,listItem:tst,paragraph:nst,root:sst,strong:Rz,text:ost,thematicBreak:cst};function ust(){return{enter:{table:fst,tableData:u8,tableHeader:u8,tableRow:hst},exit:{codeText:_st,table:dst,tableData:ab,tableHeader:ab,tableRow:ab}}}function fst(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 dst(e){this.exit(e),this.data.inTable=void 0}function hst(e){this.enter({type:"tableRow",children:[]},e)}function ab(e){this.exit(e)}function u8(e){this.enter({type:"tableCell",children:[]},e)}function _st(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,pst));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function pst(e,n){return n==="|"?n:e}function mst(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,a=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:m,table:o,tableCell:c,tableRow:l}};function o(g,S,k,v){return f(_(g,k,v),g.align)}function l(g,S,k,v){const b=h(g,k,v),w=f([b]);return w.slice(0,w.indexOf(` -`))}function c(g,S,k,v){const b=k.enter("tableCell"),w=k.enter("phrasing"),y=k.containerPhrasing(g,{...v,before:a,after:a});return w(),b(),y}function f(g,S){return Trt(g,{align:S,alignDelimiters:r,padding:t,stringLength:s})}function _(g,S,k){const v=g.children;let b=-1;const w=[],y=S.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Dst={tokenize:Fst,partial:!0};function Lst(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$st,continuation:{tokenize:Hst},exit:Pst}},text:{91:{name:"gfmFootnoteCall",tokenize:Bst},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ost,resolveTo:Ist}}}}function Ost(e,n,t){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return t(c);const f=Pi(r.sliceSerialize({start:o.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function Ist(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 a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",a,n],["enter",o,n],["exit",o,n],["exit",a,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...l),e}function Bst(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?t(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(h){if(a>999||h===93&&!o||h===null||h===91||yn(h))return t(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(Pi(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(h)}return yn(h)||(o=!0),a++,e.consume(h),h===92?_:f}function _(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function $st(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(S)}function _(S){if(o>999||S===93&&!l||S===null||S===91||yn(S))return t(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=Pi(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return yn(S)||(l=!0),o++,e.consume(S),S===92?h:_}function h(S){return S===91||S===92||S===93?(e.consume(S),o++,_):_(S)}function m(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),Ot(e,g,"gfmFootnoteDefinitionWhitespace")):t(S)}function g(S){return n(S)}}function Hst(e,n,t){return e.check(Qd,n,e.attempt(Dst,n,t))}function Pst(e){e.exit("gfmFootnoteDefinition")}function Fst(e,n,t){const r=this;return Ot(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?n(a):t(a)}}function Ust(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c1?c(S):(o.consume(S),h++,g);if(h<2&&!t)return c(S);const v=o.exit("strikethroughSequenceTemporary"),b=Cu(S);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,l(S)}}}class qst{constructor(){this.map=[]}add(n,t,r){Gst(this,n,t,r)}consume(n){if(this.map.sort(function(a,o){return a[0]-o[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 a of s)n.push(a);s=r.pop()}this.map.length=0}}function Gst(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const W=r.events[L][1].type;if(W==="lineEnding"||W==="linePrefix")L--;else break}const U=L>-1?r.events[L][1].type:null,q=U==="tableHead"||U==="tableRow"?N:c;return q===N&&r.parser.lazy[r.now().line]?t(I):q(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(o=!0,a+=1),_(I)}function _(I){return I===null?t(I):it(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),g):t(I):Pt(I)?Ot(e,_,"whitespace")(I):(a+=1,o&&(o=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,_):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||yn(I)?(e.exit("data"),_(I)):(e.consume(I),I===92?m:h)}function m(I){return I===92||I===124?(e.consume(I),h):h(I)}function g(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(I):(e.enter("tableDelimiterRow"),o=!1,Pt(I)?Ot(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?v(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):z(I)}function k(I){return Pt(I)?Ot(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):I===45?(a+=1,b(I)):I===null||it(I)?C(I):z(I)}function b(I){return I===45?(e.enter("tableDelimiterFiller"),w(I)):z(I)}function w(I){return I===45?(e.consume(I),w):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return Pt(I)?Ot(e,C,"whitespace")(I):C(I)}function C(I){return I===124?S(I):I===null||it(I)?!o||s!==a?z(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(I)):z(I)}function z(I){return t(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||it(I)?(e.exit("tableRow"),n(I)):Pt(I)?Ot(e,T,"whitespace")(I):(e.enter("data"),j(I))}function j(I){return I===null||I===124||yn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?D:j)}function D(I){return I===92||I===124?(e.consume(I),j):j(I)}}function Xst(e,n){let t=-1,r=!0,s=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,_,h;const m=new qst;for(;++tt[2]+1){const S=t[2]+1,k=t[3]-t[2]-1;e.add(S,k,[])}}e.add(t[3]+1,0,[["exit",h,n]])}return s!==void 0&&(a.end=Object.assign({},eu(n.events,s)),e.add(s,0,[["exit",a,n]]),a=void 0),a}function d8(e,n,t,r,s){const a=[],o=eu(n.events,t);s&&(s.end=Object.assign({},o),a.push(["exit",s,n])),r.end=Object.assign({},o),a.push(["exit",r,n]),e.add(t+1,0,a)}function eu(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Yst={name:"tasklistCheck",tokenize:Qst};function Zst(){return{text:{91:Yst}}}function Qst(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"),a)}function a(c){return yn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):t(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):t(c)}function l(c){return it(c)?n(c):Pt(c)?e.check({tokenize:Jst},n,t)(c):t(c)}}function Jst(e,n,t){return Ot(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function eit(e){return KE([Cst(),Lst(),Ust(e),Wst(),Zst()])}const tit={};function Uz(e){const n=this,t=e||tit,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(eit(t)),a.push(yst()),o.push(wst(t))}function nit(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:a},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:l,mathText:o,mathTextData:l}};function e(c){const f={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[f]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),f=this.stack[this.stack.length-1];f.type,f.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const f=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=f;const h=_.data.hChildren[0];h.type,h.tagName,h.children.push({type:"text",value:f}),this.data.mathFlowInside=void 0}function a(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function o(c){const f=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=f,_.data.hChildren.push({type:"text",value:f})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function rit(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(a,o,l,c){const f=a.value||"",_=l.createTracker(c),h="$".repeat(Math.max(Sz(f,"$")+1,2)),m=l.enter("mathFlow");let g=_.move(h);if(a.meta){const S=l.enter("mathFlowMeta");g+=_.move(l.safe(a.meta,{after:` +`,...a.current()});return/^[\t ]/.test(f)&&(f=vh(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,t.options.closeAtx&&(f+=" "+o),c(),l(),f}zz.peek=zst;function zz(e){return e.value||""}function zst(){return"<"}Az.peek=Ast;function Az(e,n,t,r){const s=Ox(t),a=s==='"'?"Quote":"Apostrophe",o=t.enter("image");let l=t.enter("label");const c=t.createTracker(r);let f=c.move("![");return f+=c.move(t.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+s),f+=c.move(t.safe(e.title,{before:f,after:s,...c.current()})),f+=c.move(s),l()),f+=c.move(")"),o(),f}function Ast(){return"!"}jz.peek=jst;function jz(e,n,t,r){const s=e.referenceType,a=t.enter("imageReference");let o=t.enter("label");const l=t.createTracker(r);let c=l.move("![");const f=t.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const _=t.stack;t.stack=[],o=t.enter("reference");const d=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=_,a(),s==="full"||!f||f!==d?c+=l.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function jst(){return"!"}Tz.peek=Tst;function Tz(e,n,t){let r=e.value||"",s="`",a=-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+" ");++a\u007F]/.test(e.url))}Rz.peek=Mst;function Rz(e,n,t,r){const s=Ox(t),a=s==='"'?"Quote":"Apostrophe",o=t.createTracker(r);let l,c;if(Mz(e,t)){const _=t.stack;t.stack=[],l=t.enter("autolink");let d=o.move("<");return d+=o.move(t.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),t.stack=_,d}l=t.enter("link"),c=t.enter("label");let f=o.move("[");return f+=o.move(t.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(t.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(c=t.enter("destinationRaw"),f+=o.move(t.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=t.enter(`title${a}`),f+=o.move(" "+s),f+=o.move(t.safe(e.title,{before:f,after:s,...o.current()})),f+=o.move(s),c()),f+=o.move(")"),l(),f}function Mst(e,n,t){return Mz(e,t)?"<":"["}Dz.peek=Rst;function Dz(e,n,t,r){const s=e.referenceType,a=t.enter("linkReference");let o=t.enter("label");const l=t.createTracker(r);let c=l.move("[");const f=t.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const _=t.stack;t.stack=[],o=t.enter("reference");const d=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=_,a(),s==="full"||!f||f!==d?c+=l.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Rst(){return"["}function Ix(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 Dst(e){const n=Ix(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 Lst(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 Lz(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 Ost(e,n,t,r){const s=t.enter("list"),a=t.bulletCurrent;let o=e.ordered?Lst(t):Ix(t);const l=e.ordered?o==="."?")":".":Dst(t);let c=n&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&_&&(!_.children||!_.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),Lz(t)===o&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+a);let o=a.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=t.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=t.enter("listItem"),f=t.indentLines(t.containerFlow(e,l.current()),_);return c(),f;function _(d,m,g){return m?(g?"":" ".repeat(o))+d:(g?a:a+" ".repeat(o-a.length))+d}}function $st(e,n,t,r){const s=t.enter("paragraph"),a=t.enter("phrasing"),o=t.containerPhrasing(e,r);return a(),s(),o}const Hst=Xh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Fst(e,n,t,r){return(e.children.some(function(o){return Hst(o)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Pst(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Oz.peek=Ust;function Oz(e,n,t,r){const s=Pst(t),a=t.enter("strong"),o=t.createTracker(r),l=o.move(s+s);let c=o.move(t.containerPhrasing(e,{after:s,before:l,...o.current()}));const f=c.charCodeAt(0),_=I0(r.before.charCodeAt(r.before.length-1),f,s);_.inside&&(c=vh(f)+c.slice(1));const d=c.charCodeAt(c.length-1),m=I0(r.after.charCodeAt(0),d,s);m.inside&&(c=c.slice(0,-1)+vh(d));const g=o.move(s+s);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},l+c+g}function Ust(e,n,t){return t.options.strong||"*"}function qst(e,n,t,r){return t.safe(e.value,r)}function Gst(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 Vst(e,n,t){const r=(Lz(t)+(t.options.ruleSpaces?" ":"")).repeat(Gst(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Iz={blockquote:mst,break:f8,code:yst,definition:Sst,emphasis:Nz,hardBreak:f8,heading:Nst,html:zz,image:Az,imageReference:jz,inlineCode:Tz,link:Rz,linkReference:Dz,list:Ost,listItem:Bst,paragraph:$st,root:Fst,strong:Oz,text:qst,thematicBreak:Vst};function Wst(){return{enter:{table:Kst,tableData:h8,tableHeader:h8,tableRow:Yst},exit:{codeText:Zst,table:Xst,tableData:cb,tableHeader:cb,tableRow:cb}}}function Kst(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 Xst(e){this.exit(e),this.data.inTable=void 0}function Yst(e){this.enter({type:"tableRow",children:[]},e)}function cb(e){this.exit(e)}function h8(e){this.enter({type:"tableCell",children:[]},e)}function Zst(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Qst));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Qst(e,n){return n==="|"?n:e}function Jst(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,a=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:m,table:o,tableCell:c,tableRow:l}};function o(g,S,k,v){return f(_(g,k,v),g.align)}function l(g,S,k,v){const b=d(g,k,v),w=f([b]);return w.slice(0,w.indexOf(` +`))}function c(g,S,k,v){const b=k.enter("tableCell"),w=k.enter("phrasing"),y=k.containerPhrasing(g,{...v,before:a,after:a});return w(),b(),y}function f(g,S){return _st(g,{align:S,alignDelimiters:r,padding:t,stringLength:s})}function _(g,S,k){const v=g.children;let b=-1;const w=[],y=S.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const git={tokenize:Cit,partial:!0};function bit(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wit,continuation:{tokenize:Sit},exit:kit}},text:{91:{name:"gfmFootnoteCall",tokenize:yit},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vit,resolveTo:xit}}}}function vit(e,n,t){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return t(c);const f=Pi(r.sliceSerialize({start:o.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function xit(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 a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",a,n],["enter",o,n],["exit",o,n],["exit",a,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...l),e}function yit(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(a>999||d===93&&!o||d===null||d===91||Sn(d))return t(d);if(d===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(Pi(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return Sn(d)||(o=!0),a++,e.consume(d),d===92?_:f}function _(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function wit(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(S)}function _(S){if(o>999||S===93&&!l||S===null||S===91||Sn(S))return t(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=Pi(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Sn(S)||(l=!0),o++,e.consume(S),S===92?d:_}function d(S){return S===91||S===92||S===93?(e.consume(S),o++,_):_(S)}function m(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),Lt(e,g,"gfmFootnoteDefinitionWhitespace")):t(S)}function g(S){return n(S)}}function Sit(e,n,t){return e.check(Qh,n,e.attempt(git,n,t))}function kit(e){e.exit("gfmFootnoteDefinition")}function Cit(e,n,t){const r=this;return Lt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?n(a):t(a)}}function Eit(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c1?c(S):(o.consume(S),d++,g);if(d<2&&!t)return c(S);const v=o.exit("strikethroughSequenceTemporary"),b=Cu(S);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,l(S)}}}class Nit{constructor(){this.map=[]}add(n,t,r){zit(this,n,t,r)}consume(n){if(this.map.sort(function(a,o){return a[0]-o[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 a of s)n.push(a);s=r.pop()}this.map.length=0}}function zit(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const W=r.events[L][1].type;if(W==="lineEnding"||W==="linePrefix")L--;else break}const P=L>-1?r.events[L][1].type:null,q=P==="tableHead"||P==="tableRow"?N:c;return q===N&&r.parser.lazy[r.now().line]?t(I):q(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(o=!0,a+=1),_(I)}function _(I){return I===null?t(I):it(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),g):t(I):Ht(I)?Lt(e,_,"whitespace")(I):(a+=1,o&&(o=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,_):(e.enter("data"),d(I)))}function d(I){return I===null||I===124||Sn(I)?(e.exit("data"),_(I)):(e.consume(I),I===92?m:d)}function m(I){return I===92||I===124?(e.consume(I),d):d(I)}function g(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(I):(e.enter("tableDelimiterRow"),o=!1,Ht(I)?Lt(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?v(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):z(I)}function k(I){return Ht(I)?Lt(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):I===45?(a+=1,b(I)):I===null||it(I)?C(I):z(I)}function b(I){return I===45?(e.enter("tableDelimiterFiller"),w(I)):z(I)}function w(I){return I===45?(e.consume(I),w):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return Ht(I)?Lt(e,C,"whitespace")(I):C(I)}function C(I){return I===124?S(I):I===null||it(I)?!o||s!==a?z(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(I)):z(I)}function z(I){return t(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||it(I)?(e.exit("tableRow"),n(I)):Ht(I)?Lt(e,T,"whitespace")(I):(e.enter("data"),j(I))}function j(I){return I===null||I===124||Sn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?D:j)}function D(I){return I===92||I===124?(e.consume(I),j):j(I)}}function Mit(e,n){let t=-1,r=!0,s=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,_,d;const m=new Nit;for(;++tt[2]+1){const S=t[2]+1,k=t[3]-t[2]-1;e.add(S,k,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(a.end=Object.assign({},eu(n.events,s)),e.add(s,0,[["exit",a,n]]),a=void 0),a}function _8(e,n,t,r,s){const a=[],o=eu(n.events,t);s&&(s.end=Object.assign({},o),a.push(["exit",s,n])),r.end=Object.assign({},o),a.push(["exit",r,n]),e.add(t+1,0,a)}function eu(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Rit={name:"tasklistCheck",tokenize:Lit};function Dit(){return{text:{91:Rit}}}function Lit(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"),a)}function a(c){return Sn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):t(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):t(c)}function l(c){return it(c)?n(c):Ht(c)?e.check({tokenize:Oit},n,t)(c):t(c)}}function Oit(e,n,t){return Lt(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function Iit(e){return ZE([lit(),bit(),Eit(e),jit(),Dit()])}const Bit={};function Vz(e){const n=this,t=e||Bit,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Iit(t)),a.push(sit()),o.push(iit(t))}function $it(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:a},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:l,mathText:o,mathTextData:l}};function e(c){const f={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[f]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),f=this.stack[this.stack.length-1];f.type,f.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const f=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=f;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:f}),this.data.mathFlowInside=void 0}function a(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function o(c){const f=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=f,_.data.hChildren.push({type:"text",value:f})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function Hit(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(a,o,l,c){const f=a.value||"",_=l.createTracker(c),d="$".repeat(Math.max(Ez(f,"$")+1,2)),m=l.enter("mathFlow");let g=_.move(d);if(a.meta){const S=l.enter("mathFlowMeta");g+=_.move(l.safe(a.meta,{after:` `,before:g,encode:["$"],..._.current()})),S()}return g+=_.move(` `),f&&(g+=_.move(f+` -`)),g+=_.move(h),m(),g}function r(a,o,l){let c=a.value||"",f=1;for(n||f++;new RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(c);)f++;const _="$".repeat(f);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let h=-1;for(;++h]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}th.displayName="c";th.aliases=[];function th(e){e.register(Na),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}Tp.displayName="cpp";Tp.aliases=[];function Tp(e){e.register(th),(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)}Bx.displayName="arduino";Bx.aliases=["ino"];function Bx(e){e.register(Tp),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}$x.displayName="bash";$x.aliases=["sh","shell"];function $x(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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=s.variable[1].inside,l=0;l>/g,function(K,G){return"(?:"+H[+G]+")"})}function r(B,H,K){return RegExp(t(B,H),"")}function s(B,H){for(var K=0;K>/g,function(){return"(?:"+B+")"});return B.replace(/<>/g,"[^\\s\\S]")}var a={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(B){return"\\b(?:"+B.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),c=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),f=o(a.typeDeclaration+" "+a.contextual+" "+a.other),_=o(a.type+" "+a.typeDeclaration+" "+a.other),h=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),m=s(/\((?:[^()]|<>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,S=t(/<<0>>(?:\s*<<1>>)?/.source,[g,h]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,S]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,m,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),z={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\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,[g,C]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,S]),lookbehind:!0,inside:z},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:z},{pattern:r(/(\bwhere\s+)<<0>>/.source,[g]),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,_,g]),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,[g]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[m]),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,[g,h]),inside:{function:r(/^<<0>>/.source,[g]),generic:{pattern:RegExp(h),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,[l,S,g,C,c.source,m,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[S,m]),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 D=T+"|"+N,I=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),L=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),U=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,L]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[U,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[U]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[L]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var W=/:[^}\r\n]+/.source,Z=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),X=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,W]),J=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),ee=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[J,W]);function $(B,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[B]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,W]),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,[X]),lookbehind:!0,greedy:!0,inside:$(X,Z)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:$(ee,J)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}nh.displayName="markup";nh.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function nh(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 a={"included-cdata":{pattern://i,inside:s}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}Gu.displayName="css";Gu.aliases=[];function Gu(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)}Px.displayName="diff";Px.aliases=[];function Px(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],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`)),g+=_.move(d),m(),g}function r(a,o,l){let c=a.value||"",f=1;for(n||f++;new RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(c);)f++;const _="$".repeat(f);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let d=-1;for(;++d]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}td.displayName="c";td.aliases=[];function td(e){e.register(Na),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Mp.displayName="cpp";Mp.aliases=[];function Mp(e){e.register(td),(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)}Hx.displayName="arduino";Hx.aliases=["ino"];function Hx(e){e.register(Mp),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Fx.displayName="bash";Fx.aliases=["sh","shell"];function Fx(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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=s.variable[1].inside,l=0;l>/g,function(K,G){return"(?:"+H[+G]+")"})}function r(B,H,K){return RegExp(t(B,H),"")}function s(B,H){for(var K=0;K>/g,function(){return"(?:"+B+")"});return B.replace(/<>/g,"[^\\s\\S]")}var a={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(B){return"\\b(?:"+B.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),c=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),f=o(a.typeDeclaration+" "+a.contextual+" "+a.other),_=o(a.type+" "+a.typeDeclaration+" "+a.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),m=s(/\((?:[^()]|<>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,S=t(/<<0>>(?:\s*<<1>>)?/.source,[g,d]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,S]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,m,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),z={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\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,[g,C]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,S]),lookbehind:!0,inside:z},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:z},{pattern:r(/(\bwhere\s+)<<0>>/.source,[g]),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,_,g]),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,[g]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[m]),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,[g,d]),inside:{function:r(/^<<0>>/.source,[g]),generic:{pattern:RegExp(d),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,[l,S,g,C,c.source,m,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[S,m]),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 D=T+"|"+N,I=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),L=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),P=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,L]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[P,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[P]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[L]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var W=/:[^}\r\n]+/.source,Z=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),X=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,W]),J=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),ee=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[J,W]);function $(B,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[B]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,W]),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,[X]),lookbehind:!0,greedy:!0,inside:$(X,Z)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:$(ee,J)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}nd.displayName="markup";nd.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function nd(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 a={"included-cdata":{pattern://i,inside:s}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}Gu.displayName="css";Gu.aliases=[];function Gu(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)}Ux.displayName="diff";Ux.aliases=[];function Ux(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],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}Fx.displayName="go";Fx.aliases=[];function Fx(e){e.register(Na),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"]}Ux.displayName="ini";Ux.aliases=[];function Ux(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:/=/}}qx.displayName="java";qx.aliases=[];function qx(e){e.register(Na),(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)}Gx.displayName="regex";Gx.aliases=[];function Gx(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"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":a,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}Vx.displayName="json";Vx.aliases=["webmanifest"];function Vx(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}Wx.displayName="kotlin";Wx.aliases=["kt","kts"];function Wx(e){e.register(Na),(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)}Kx.displayName="less";Kx.aliases=[];function Kx(e){e.register(Gu),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"}})}Xx.displayName="lua";Xx.aliases=[];function Xx(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:/[\[\](){},;]|\.+|:+/}}Yx.displayName="makefile";Yx.aliases=[];function Yx(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:/[:;(){}]/}}Zx.displayName="yaml";Zx.aliases=["yml"];function Zx(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,f){f=(f||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(_,f)}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"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}Qx.displayName="markdown";Qx.aliases=["md"];function Qx(e){e.register(nh),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(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(l){["url","bold","italic","strike","code-snippet"].forEach(function(c){l!==c&&(n.languages.markdown[l].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var _=0,h=f.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}ey.displayName="perl";ey.aliases=[];function ey(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)}Rp.displayName="markup-templating";Rp.aliases=[];function Rp(e){e.register(nh),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,a,o){if(r.language===s){var l=r.tokenStack=[];r.code=r.code.replace(a,function(c){if(typeof o=="function"&&!o(c))return c;for(var f=l.length,_;r.code.indexOf(_=t(s,f))!==-1;)++f;return l[f]=c,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var a=0,o=Object.keys(r.tokenStack);function l(c){for(var f=0;f=o.length);f++){var _=c[f];if(typeof _=="string"||_.content&&typeof _.content=="string"){var h=o[a],m=r.tokenStack[h],g=typeof _=="string"?_:_.content,S=t(s,h),k=g.indexOf(S);if(k>-1){++a;var v=g.substring(0,k),b=new n.Token(s,n.tokenize(m,r.grammar),"language-"+s,m),w=g.substring(k+S.length),y=[];v&&y.push.apply(y,l([v])),y.push(b),w&&y.push.apply(y,l([w])),typeof _=="string"?c.splice.apply(c,[f,1].concat(y)):_.content=y}}else _.content&&l(_.content)}return c}l(r.tokens)}}})})(e)}ty.displayName="php";ty.aliases=[];function ty(e){e.register(Rp),(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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:a,punctuation:o};var l={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:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];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:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(f,"php",_)}}),n.hooks.add("after-tokenize",function(f){n.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}ny.displayName="python";ny.aliases=["py"];function ny(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}ry.displayName="r";ry.aliases=[];function ry(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:/[(){}\[\],;]/}}sy.displayName="ruby";sy.aliases=["rb"];function sy(e){e.register(Na),(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)}iy.displayName="rust";iy.aliases=[];function iy(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)}ay.displayName="sass";ay.aliases=[];function ay(e){e.register(Gu),(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)}oy.displayName="scss";oy.aliases=[];function oy(e){e.register(Gu),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}ly.displayName="sql";ly.aliases=[];function ly(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:/[;[\]()`,.]/}}cy.displayName="swift";cy.aliases=[];function cy(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})}uy.displayName="typescript";uy.aliases=["ts"];function uy(e){e.register(Mp),(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)}Dp.displayName="basic";Dp.aliases=[];function Dp(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:/[,;:()]/}}fy.displayName="vbnet";fy.aliases=[];function fy(e){e.register(Dp),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const _it=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],_8={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function Gz(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}function pit(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function mit(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function p8(e){return mit(e)||Gz(e)}const git=["","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 bit(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let a=0,o=-1,l="",c,f;t.position&&("start"in t.position||"indent"in t.position?(f=t.position.indent,c=t.position.start):c=t.position);let _=(c?c.line:0)||1,h=(c?c.column:0)||1,m=S(),g;for(a--;++a<=e.length;)if(g===10&&(h=(f?f[o]:0)||1),g=e.charCodeAt(a),g===38){const b=e.charCodeAt(a+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){l+=String.fromCharCode(g),h++;continue}const w=a+1;let y=w,C=w,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 N="",T="",j="";const D=z==="named"?p8:z==="decimal"?Gz:pit;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!D(q))break;j+=String.fromCharCode(q),z==="named"&&_it.includes(j)&&(N=j,T=md(j))}let I=e.charCodeAt(C)===59;if(I){C++;const q=z==="named"?md(j):!1;q&&(N=j,T=q)}let L=1+C-w,U="";if(!(!I&&t.nonTerminated===!1))if(!j)z!=="named"&&k(4,L);else if(z==="named"){if(I&&!T)k(5,1);else if(N!==j&&(C=y+N.length,L=1+C-y,I=!1),!I){const q=N?1:3;if(t.attribute){const W=e.charCodeAt(C);W===61?(k(q,L),T=""):p8(W)?T="":k(q,L)}else k(q,L)}U=T}else{I||k(2,L);let q=Number.parseInt(j,z==="hexadecimal"?16:10);if(vit(q))k(7,L),U="�";else if(q in _8)k(6,L),U=_8[q];else{let W="";xit(q)&&k(6,L),q>65535&&(q-=65536,W+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),U=W+String.fromCharCode(q)}}if(U){v(),m=S(),a=C-1,h+=C-w+1,s.push(U);const q=S();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,U,{start:m,end:q},e.slice(w-1,C)),m=q}else j=e.slice(w-1,C),l+=j,h+=j.length,a=C-1}else g===10&&(_++,o++,h=0),Number.isNaN(g)?v():(l+=String.fromCharCode(g),h++);return s.join("");function S(){return{line:_,column:h,offset:a+((c?c.offset:0)||0)}}function k(b,w){let y;t.warning&&(y=S(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,git[b],y,b))}function v(){l&&(s.push(l),t.text&&t.text.call(t.textContext||void 0,l,{start:m,end:S()}),l="")}}function vit(e){return e>=55296&&e<=57343||e>1114111}function xit(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 yit=0,R_={},Ar={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++yit}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ar.util.type(n)){case"Object":if(s=Ar.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var a in n)n.hasOwnProperty(a)&&(r[a]=e(n[a],t));return r;case"Array":return s=Ar.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(o,l){r[l]=e(o,t)}),r);default:return n}}},languages:{plain:R_,plaintext:R_,text:R_,txt:R_,extend:function(e,n){var t=Ar.util.clone(Ar.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ar.languages;var s=r[e],a={};for(var o in s)if(s.hasOwnProperty(o)){if(o==n)for(var l in t)t.hasOwnProperty(l)&&(a[l]=t[l]);t.hasOwnProperty(o)||(a[o]=s[o])}var c=r[e];return r[e]=a,Ar.languages.DFS(Ar.languages,function(f,_){_===c&&f!=e&&(this[f]=a)}),a},DFS:function e(n,t,r,s){s=s||{};var a=Ar.util.objId;for(var o in n)if(n.hasOwnProperty(o)){t.call(n,o,n[o],r||o);var l=n[o],c=Ar.util.type(l);c==="Object"&&!s[a(l)]?(s[a(l)]=!0,e(l,t,null,s)):c==="Array"&&!s[a(l)]&&(s[a(l)]=!0,e(l,t,o,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ar.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ar.tokenize(r.code,r.grammar),Ar.hooks.run("after-tokenize",r),id.stringify(Ar.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 wit;return s0(s,s.head,e),Vz(e,s,n,s.head,0),kit(s)},hooks:{all:{},add:function(e,n){var t=Ar.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ar.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:id};function id(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function m8(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var a=s[1].length;s.index+=a,s[0]=s[0].slice(a)}return s}function Vz(e,n,t,r,s,a){for(var o in t)if(!(!t.hasOwnProperty(o)||!t[o])){var l=t[o];l=Array.isArray(l)?l:[l];for(var c=0;c=a.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof id)){var y=1,C;if(m){if(C=m8(k,b,e,h),!C||C.index>=e.length)break;var j=C.index,z=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof id)continue;for(var T=v;T!==n.tail&&(Na.reach&&(a.reach=U);var q=v.prev;I&&(q=s0(n,q,I),b+=I.length),Sit(n,q,y);var W=new id(o,_?Ar.tokenize(D,_):D,g,D);if(v=s0(n,q,W),L&&s0(n,v,L),y>1){var Z={cause:o+","+c,reach:U};Vz(e,n,t,v.prev,b,Z),a&&Z.reach>a.reach&&(a.reach=Z.reach)}}}}}}function wit(){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 s0(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 Sit(e,n,t){for(var r=n.next,s=0;st)return null;try{return ot.highlight(e,n).children}catch{return null}}function Yz(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:d.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(Yz)},n)}function Mit(e,n,t=3e5){var r;return((r=Xz(e,n,t))==null?void 0:r.map(Yz))??e}function Zz(e,n,t=3e5){const r=Xz(e,n,t);if(!r)return e.split(` -`);const s=[];let a=[];const o=[];let l=0;const c=_=>{let h=_;for(let m=o.length-1;m>=0;m--)h=d.jsx("span",{className:o[m],children:h},l++);a.push(h)},f=_=>{var h;if(_.type==="text"){(_.value??"").split(` -`).forEach((m,g)=>{g>0&&(s.push(a),a=[]),m&&c(m)});return}_.type==="element"&&(o.push((((h=_.properties)==null?void 0:h.className)??[]).join(" ")),(_.children??[]).forEach(f),o.pop())};return r.forEach(f),s.push(a),s}function Qz(e){return Array.isArray(e)?e.length===0:e===""}const g8=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Au(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function xd(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Hv(e){var o;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[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 a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:n,indentation:a,listIndent:t,offset:r+a,quoteDepth:s}}function Rit(e,n){const t=e[n];if(t!=="`"&&t!=="~"||xd(e,n)||Au(e,n,t)<3)return!1;const r=e.lastIndexOf(` +|(?![\\s\\S])))+`,"m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}qx.displayName="go";qx.aliases=[];function qx(e){e.register(Na),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"]}Gx.displayName="ini";Gx.aliases=[];function Gx(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:/=/}}Vx.displayName="java";Vx.aliases=[];function Vx(e){e.register(Na),(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)}Wx.displayName="regex";Wx.aliases=[];function Wx(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"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":a,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}Kx.displayName="json";Kx.aliases=["webmanifest"];function Kx(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}Xx.displayName="kotlin";Xx.aliases=["kt","kts"];function Xx(e){e.register(Na),(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)}Yx.displayName="less";Yx.aliases=[];function Yx(e){e.register(Gu),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"}})}Zx.displayName="lua";Zx.aliases=[];function Zx(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:/[\[\](){},;]|\.+|:+/}}Qx.displayName="makefile";Qx.aliases=[];function Qx(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:/[:;(){}]/}}Jx.displayName="yaml";Jx.aliases=["yml"];function Jx(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,f){f=(f||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(_,f)}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"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}ey.displayName="markdown";ey.aliases=["md"];function ey(e){e.register(nd),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(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(l){["url","bold","italic","strike","code-snippet"].forEach(function(c){l!==c&&(n.languages.markdown[l].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var _=0,d=f.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}ny.displayName="perl";ny.aliases=[];function ny(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)}Dp.displayName="markup-templating";Dp.aliases=[];function Dp(e){e.register(nd),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,a,o){if(r.language===s){var l=r.tokenStack=[];r.code=r.code.replace(a,function(c){if(typeof o=="function"&&!o(c))return c;for(var f=l.length,_;r.code.indexOf(_=t(s,f))!==-1;)++f;return l[f]=c,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var a=0,o=Object.keys(r.tokenStack);function l(c){for(var f=0;f=o.length);f++){var _=c[f];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=o[a],m=r.tokenStack[d],g=typeof _=="string"?_:_.content,S=t(s,d),k=g.indexOf(S);if(k>-1){++a;var v=g.substring(0,k),b=new n.Token(s,n.tokenize(m,r.grammar),"language-"+s,m),w=g.substring(k+S.length),y=[];v&&y.push.apply(y,l([v])),y.push(b),w&&y.push.apply(y,l([w])),typeof _=="string"?c.splice.apply(c,[f,1].concat(y)):_.content=y}}else _.content&&l(_.content)}return c}l(r.tokens)}}})})(e)}ry.displayName="php";ry.aliases=[];function ry(e){e.register(Dp),(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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:a,punctuation:o};var l={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:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];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:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(f,"php",_)}}),n.hooks.add("after-tokenize",function(f){n.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}sy.displayName="python";sy.aliases=["py"];function sy(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}iy.displayName="r";iy.aliases=[];function iy(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:/[(){}\[\],;]/}}ay.displayName="ruby";ay.aliases=["rb"];function ay(e){e.register(Na),(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)}oy.displayName="rust";oy.aliases=[];function oy(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)}ly.displayName="sass";ly.aliases=[];function ly(e){e.register(Gu),(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)}cy.displayName="scss";cy.aliases=[];function cy(e){e.register(Gu),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}uy.displayName="sql";uy.aliases=[];function uy(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:/[;[\]()`,.]/}}fy.displayName="swift";fy.aliases=[];function fy(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})}hy.displayName="typescript";hy.aliases=["ts"];function hy(e){e.register(Rp),(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)}Lp.displayName="basic";Lp.aliases=[];function Lp(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}dy.displayName="vbnet";dy.aliases=[];function dy(e){e.register(Lp),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const Zit=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],m8={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function Kz(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}function Qit(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Jit(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function g8(e){return Jit(e)||Kz(e)}const eat=["","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 tat(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let a=0,o=-1,l="",c,f;t.position&&("start"in t.position||"indent"in t.position?(f=t.position.indent,c=t.position.start):c=t.position);let _=(c?c.line:0)||1,d=(c?c.column:0)||1,m=S(),g;for(a--;++a<=e.length;)if(g===10&&(d=(f?f[o]:0)||1),g=e.charCodeAt(a),g===38){const b=e.charCodeAt(a+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){l+=String.fromCharCode(g),d++;continue}const w=a+1;let y=w,C=w,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 N="",T="",j="";const D=z==="named"?g8:z==="decimal"?Kz:Qit;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!D(q))break;j+=String.fromCharCode(q),z==="named"&&Zit.includes(j)&&(N=j,T=mh(j))}let I=e.charCodeAt(C)===59;if(I){C++;const q=z==="named"?mh(j):!1;q&&(N=j,T=q)}let L=1+C-w,P="";if(!(!I&&t.nonTerminated===!1))if(!j)z!=="named"&&k(4,L);else if(z==="named"){if(I&&!T)k(5,1);else if(N!==j&&(C=y+N.length,L=1+C-y,I=!1),!I){const q=N?1:3;if(t.attribute){const W=e.charCodeAt(C);W===61?(k(q,L),T=""):g8(W)?T="":k(q,L)}else k(q,L)}P=T}else{I||k(2,L);let q=Number.parseInt(j,z==="hexadecimal"?16:10);if(nat(q))k(7,L),P="�";else if(q in m8)k(6,L),P=m8[q];else{let W="";rat(q)&&k(6,L),q>65535&&(q-=65536,W+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),P=W+String.fromCharCode(q)}}if(P){v(),m=S(),a=C-1,d+=C-w+1,s.push(P);const q=S();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,P,{start:m,end:q},e.slice(w-1,C)),m=q}else j=e.slice(w-1,C),l+=j,d+=j.length,a=C-1}else g===10&&(_++,o++,d=0),Number.isNaN(g)?v():(l+=String.fromCharCode(g),d++);return s.join("");function S(){return{line:_,column:d,offset:a+((c?c.offset:0)||0)}}function k(b,w){let y;t.warning&&(y=S(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,eat[b],y,b))}function v(){l&&(s.push(l),t.text&&t.text.call(t.textContext||void 0,l,{start:m,end:S()}),l="")}}function nat(e){return e>=55296&&e<=57343||e>1114111}function rat(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 sat=0,R_={},Mr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++sat}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Mr.util.type(n)){case"Object":if(s=Mr.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var a in n)n.hasOwnProperty(a)&&(r[a]=e(n[a],t));return r;case"Array":return s=Mr.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(o,l){r[l]=e(o,t)}),r);default:return n}}},languages:{plain:R_,plaintext:R_,text:R_,txt:R_,extend:function(e,n){var t=Mr.util.clone(Mr.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Mr.languages;var s=r[e],a={};for(var o in s)if(s.hasOwnProperty(o)){if(o==n)for(var l in t)t.hasOwnProperty(l)&&(a[l]=t[l]);t.hasOwnProperty(o)||(a[o]=s[o])}var c=r[e];return r[e]=a,Mr.languages.DFS(Mr.languages,function(f,_){_===c&&f!=e&&(this[f]=a)}),a},DFS:function e(n,t,r,s){s=s||{};var a=Mr.util.objId;for(var o in n)if(n.hasOwnProperty(o)){t.call(n,o,n[o],r||o);var l=n[o],c=Mr.util.type(l);c==="Object"&&!s[a(l)]?(s[a(l)]=!0,e(l,t,null,s)):c==="Array"&&!s[a(l)]&&(s[a(l)]=!0,e(l,t,o,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Mr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Mr.tokenize(r.code,r.grammar),Mr.hooks.run("after-tokenize",r),ih.stringify(Mr.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 iat;return i0(s,s.head,e),Xz(e,s,n,s.head,0),oat(s)},hooks:{all:{},add:function(e,n){var t=Mr.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Mr.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:ih};function ih(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function b8(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var a=s[1].length;s.index+=a,s[0]=s[0].slice(a)}return s}function Xz(e,n,t,r,s,a){for(var o in t)if(!(!t.hasOwnProperty(o)||!t[o])){var l=t[o];l=Array.isArray(l)?l:[l];for(var c=0;c=a.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof ih)){var y=1,C;if(m){if(C=b8(k,b,e,d),!C||C.index>=e.length)break;var j=C.index,z=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof ih)continue;for(var T=v;T!==n.tail&&(Na.reach&&(a.reach=P);var q=v.prev;I&&(q=i0(n,q,I),b+=I.length),aat(n,q,y);var W=new ih(o,_?Mr.tokenize(D,_):D,g,D);if(v=i0(n,q,W),L&&i0(n,v,L),y>1){var Z={cause:o+","+c,reach:P};Xz(e,n,t,v.prev,b,Z),a&&Z.reach>a.reach&&(a.reach=Z.reach)}}}}}}function iat(){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 i0(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 aat(e,n,t){for(var r=n.next,s=0;st)return null;try{return lt.highlight(e,n).children}catch{return null}}function Jz(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:h.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(Jz)},n)}function pat(e,n,t=3e5){var r;return((r=Qz(e,n,t))==null?void 0:r.map(Jz))??e}function eA(e,n,t=3e5){const r=Qz(e,n,t);if(!r)return e.split(` +`);const s=[];let a=[];const o=[];let l=0;const c=_=>{let d=_;for(let m=o.length-1;m>=0;m--)d=h.jsx("span",{className:o[m],children:d},l++);a.push(d)},f=_=>{var d;if(_.type==="text"){(_.value??"").split(` +`).forEach((m,g)=>{g>0&&(s.push(a),a=[]),m&&c(m)});return}_.type==="element"&&(o.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(f),o.pop())};return r.forEach(f),s.push(a),s}function tA(e){return Array.isArray(e)?e.length===0:e===""}const v8=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Au(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function xh(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Pv(e){var o;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[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 a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:n,indentation:a,listIndent:t,offset:r+a,quoteDepth:s}}function mat(e,n){const t=e[n];if(t!=="`"&&t!=="~"||xh(e,n)||Au(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` -`,n),a=e.slice(r,s===-1?e.length:s),o=Hv(a);return o.indentation<=3&&r+o.offset===n}function Dit(e,n){const t=e[n],r=Au(e,n,t),s=e.lastIndexOf(` +`,n),a=e.slice(r,s===-1?e.length:s),o=Pv(a);return o.indentation<=3&&r+o.offset===n}function gat(e,n){const t=e[n],r=Au(e,n,t),s=e.lastIndexOf(` `,n-1)+1,a=e.indexOf(` -`,n),o=Hv(e.slice(s,a===-1?e.length:a));let l=e.indexOf(` +`,n),o=Pv(e.slice(s,a===-1?e.length:a));let l=e.indexOf(` `,n+r);if(l===-1)return e.length;for(l+=1;l=o.listIndent&&h.indentation<=o.listIndent+3&&g>=r&&/^[ \t\r]*$/.test(e.slice(m+g,f)))return c===-1?e.length:c+1;if(c===-1)return e.length;l=c+1}return e.length}function Lit(e,n,t){const r=Au(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function Iit(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 $it(e,{predictMath:n=!1}={}){const t=Iit(e),r=new Set,s=new Set;for(let f=0;f`$$${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}`)),$it(t,n)}function Jz(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 Fit(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function nr(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=Fit(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const Uit=1e5;function qit({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return d.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[d.jsx("button",{className:"md-code-copy absolute top-1.5 end-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:p9(),"aria-label":The(),onClick:s,children:t?d.jsx(os,{size:13}):d.jsx(ap,{size:13})}),d.jsx("pre",{children:d.jsx("code",{children:Mit(e,n,Uit)})})]})}function Git(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 v8(e,n,t){let r=n.line,s=n.column;for(let a=0;a]*?)\/?>/gi,r=[];let s=0,a=!1;for(const o of n.matchAll(t)){const l=(o[1]??"").toLowerCase(),c=Git(o[2]??"");if(!c[l==="run"?"id":"path"])continue;a=!0,o.index>s&&r.push({type:"text",value:n.slice(s,o.index),position:ob(e,s,o.index)});const _=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:c},position:ob(e,o.index,_),type:l==="run"?"runMention":"fileMention"}),s=_}return a?(seA(e)}function Wit(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=dN(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function y8({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,a=n&&Number.parseInt(n,10)||void 0,o=a!=null?`${s}:${a}`:s;return d.jsxs("button",{className:"file-chip",title:r?YL({path:je(e)}):e,...nr(l=>r==null?void 0:r(e,a,t,void 0,l)),disabled:!r,children:[d.jsx(Y9,{size:12}),d.jsx("span",{className:"file-chip-label",children:o}),d.jsx(tE,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function Kit({id:e,label:n,onOpenRun:t}){return d.jsxs("button",{className:"file-chip run-chip",title:t?fO({id:je(e)}):$O({id:je(e)}),...nr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[d.jsx(G2,{size:12}),d.jsx("span",{className:"file-chip-label",children:n||P9()}),d.jsx(tE,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const tA={singleDollarTextMath:!0},Xit=lx().use(px).use(Uz).use(qz,tA).use(Vit).use(A0).use(Wit).use(bz);function Yit(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const nA={code:({node:e,className:n,children:t,...r})=>{const s=n??"",a=/language-(\w+)/.exec(s),o=String(t??"").replace(/\n$/,"");if(!(a!=null||o.includes(` -`)))return d.jsx("code",{className:s,...r,children:t});const c=a?Bv(a[1]):null;return d.jsx(qit,{code:o,lang:c})},pre:({children:e})=>d.jsx(d.Fragment,{children:e})},ga=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:a,predict:o=!1}){const l=R.useMemo(()=>({"file-mention":c=>d.jsx(y8,{path:c.path,lines:c.lines,exp:c.exp,onOpenFile:t}),"run-mention":c=>d.jsx(Kit,{id:c.id,label:c.label,onOpenRun:r}),a:({node:c,href:f,children:_,...h})=>{if(f&&Yit(f)&&t){let m;try{m=decodeURI(f)}catch{return d.jsx("span",{children:_})}const g=s?s(m):m;return g?d.jsx(y8,{path:g,onOpenFile:t}):d.jsx("span",{children:_})}return d.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",...h,children:_})},th:({node:c,...f})=>d.jsx("th",{dir:"auto",...f}),td:({node:c,...f})=>d.jsx("td",{dir:"auto",...f}),img:({node:c,src:f,alt:_,className:h,...m})=>{if(!f||typeof f!="string")return null;const g=a?a(f):f;return g?d.jsx("img",{...m,src:g,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${h??""}`}):null},...nA}),[t,r,s,a]);return d.jsx("div",{dir:"auto","data-streaming":o||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]: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-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-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:d.jsx(uet,{content:Jz(n,{predictMath:o}),processor:Xit,components:l,predict:o})})}),w8=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-ss-none [&_.plan-strip-caret]:rounded-es-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-s [&_.plan-strip-caret]:border-s-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function Zit({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:a,onRevise:o}){const[l,c]=R.useState(!1),f=R.useRef(null),[_,h]=R.useState(!1),[m,g]=R.useState(""),S=R.useRef(null);R.useEffect(()=>{if(!l)return;const v=b=>{f.current&&!f.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[l]),R.useEffect(()=>{var v;_&&((v=S.current)==null||v.focus())},[_]);const k=()=>{o(m.trim()||"no specific feedback — use your judgment"),g(""),h(!1)};return d.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-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[d.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[d.jsx(G2,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),d.jsx("span",{dir:"auto",className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?Oye({agent:je(n)}):Mye({agent:je(n)})}),d.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...nr(t),children:Kye()})]}),_?d.jsxs(d.Fragment,{children:[d.jsx("textarea",{dir:"auto",ref:S,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:u4e(),rows:2,value:m,onChange:v=>g(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),g(""),h(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),d.jsxs("div",{className:w8,children:[d.jsx("button",{className:"btn-ghost",onClick:()=>{g(""),h(!1)},children:Hye()}),d.jsx("span",{className:"plan-strip-spacer flex-1"}),d.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:k,children:[n4e(),d.jsx(W9,{size:13})]})]})]}):d.jsxs("div",{className:w8,children:[d.jsx("button",{className:"btn-ghost",onClick:a,children:Qye()}),d.jsx("button",{className:"btn-ghost",onClick:()=>h(!0),children:a4e()}),d.jsx("span",{className:"plan-strip-spacer flex-1"}),s?d.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:f,children:[d.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:xye()}),d.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":qye(),onClick:()=>c(v=>!v),children:d.jsx(ya,{size:13})}),l&&d.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-start [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:d.jsx("button",{onClick:()=>{c(!1),r("bypassPermissions")},children:kye()})})]}):d.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:zye()})]})]})}function rA(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{let s=!1;const a=dXe(o=>{s=!0,n(o)});return YWe().then(o=>!s&&n(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:t,apply:n}}function Qit(){const{status:e}=rA(),[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||n===r?null:d.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[d.jsx(Gd,{size:13,className:"shrink-0 text-subtext"}),d.jsx("span",{className:"min-w-0",children:ZUe({version:je(r)})}),d.jsx("button",{type:"button",className:"ms-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":tqe(),onClick:()=>t(r),children:d.jsx(Gr,{size:13})})]})}const sA="orx:theme";function Jit(){try{const e=localStorage.getItem(sA);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let yd=Jit();const Pv=new Set;function eat(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hy(){document.documentElement.dataset.theme=eat(yd)}function tat(e){yd=e;try{localStorage.setItem(sA,e)}catch{}hy();for(const n of Pv)n()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{yd==="system"&&hy()});hy();function nat(e){return Pv.add(e),()=>Pv.delete(e)}function rat(){return[R.useSyncExternalStore(nat,()=>yd,()=>yd),tat]}function sat({save:e,onSaved:n,placeholder:t,createHref:r}){const[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null);async function _(h){if(h.preventDefault(),!(o||!s.trim())){l(!0),f(null);try{n(await e(s.trim())),a("")}catch(m){f(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return d.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[d.jsx("input",{type:"password",value:s,onChange:h=>a(h.target.value),placeholder:t,autoComplete:"off"}),d.jsx("button",{type:"submit",className:qn,disabled:o||!s.trim(),children:o?xa():ac()}),d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:Vfe()}),c&&d.jsx("div",{className:"error",children:c})]})}function iat({cmd:e}){const[n,t]=R.useState(!1);return d.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[d.jsx("code",{className:Wr,children:e}),d.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?b0():iL({value:je(e)}),title:n?b0():p9(),children:n?d.jsx(os,{size:11,strokeWidth:3}):d.jsx(ap,{size:11})})]})}function Lp(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?d.jsx(iat,{cmd:n},t):n):null}const aat="/assets/slurm-logo-aGSXVZcE.svg",oat="/assets/thinking-machines-BOdslTfm.png";function lat(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 h9();case"tinker_job":return"Tinker";default:return e||"—"}}function cat({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[d.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"}),d.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"}),d.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"}),d.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"}),d.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"}),d.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"}),d.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 uat({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[d.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"}),d.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)"}),d.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)"}),d.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"}),d.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"}),d.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)"}),d.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)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#BFF9B4"}),d.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),d.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#80EE64"}),d.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),d.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),d.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),d.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),d.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),d.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),d.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#BFF9B4"}),d.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),d.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#80EE64"}),d.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),d.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),d.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),d.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),d.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),d.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function fat({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:d.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 dat({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:d.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 hat({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[d.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),d.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 _at({size:e=16}){return d.jsx("img",{className:"tinker-logo block flex-none object-contain",src:oat,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 pat({size:e=16}){return d.jsx("img",{className:"block flex-none object-contain",src:aat,width:e,height:e,alt:"","aria-hidden":"true"})}function Op({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.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 Ip({kind:e,size:n=16}){switch(e){case"modal_job":return d.jsx(uat,{size:n});case"hf_job":return d.jsx(cat,{size:n});case"k8s_job":return d.jsx(fat,{size:n});case"ssh_job":return d.jsx(d7,{size:n,strokeWidth:1.5});case"slurm_job":return d.jsx(pat,{size:n});case"ray_job":return d.jsx(dat,{size:n});case"openresearch_job":return d.jsx(hat,{size:n});case"tinker_job":return d.jsx(_at,{size:n});case"local_job":return d.jsx(CVe,{size:n,strokeWidth:1.5});default:return d.jsx(d7,{size:n})}}function _y({backend:e}){const n=X2(e),t=sXe(e);return n?d.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:[d.jsx(Ip,{kind:n}),d.jsx("span",{className:"backend-name",children:lat(n)}),t&&d.jsx("span",{className:`backend-detail ${Wr}`,children:t})]}):d.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 iA({value:e,max:n,label:t,caption:r,fillColor:s}){const a=n>0?Math.min(100,Math.round(e/n*100)):0;return d.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[d.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:d.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:s}})}),(t!==void 0||r!==void 0)&&d.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[d.jsx("span",{children:t??`${a}%`}),r]})]})}function Fv({harness:e,size:n=16}){const t=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?d.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.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"?d.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):d.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const aA=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),S8=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),Yf={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function mat(e){var r,s;const n=e.find(a=>a.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:S0(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:fp(n,t).defaultId}}function _o(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||t(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",a,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function gat({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:c,lockHarness:f=!1}){var ve,ce,re,P,oe,ue;const[_,h]=R.useState([]),m=R.useRef(null),g=R.useRef(null),{open:S,setOpen:k,ref:v}=_o(m),[b,w]=R.useState(""),[y,C]=R.useState("root"),z=()=>{k(!1),C("root"),w("")};R.useEffect(()=>{var de;S&&(y==="reasoning"||y==="speed"||y==="permissions")&&((de=g.current)==null||de.focus())},[S,y]),R.useEffect(()=>{let de=!0;const ge=(Ae=!1)=>k0(Ae).then(He=>{de&&(h(He),c==null||c(He))}).catch(()=>{});ge();const Ee=Z2(()=>void ge(!0));return()=>{de=!1,Ee()}},[]);const N=R.useMemo(()=>{const de=b.trim().toLowerCase();return(f&&e?_.filter(Ee=>Ee.id===e.harness):_).map(Ee=>{let Ae=Ee.models;return de?Ae=Ae.filter(He=>He.id.toLowerCase().includes(de)):Ee.id==="opencode"&&(Ae=Ae.slice(0,6)),{harness:Ee,models:Ae,hidden:de?0:Ee.models.length-Ae.length}})},[_,b,f,e]),T=(de,ge)=>{var Ae;const Ee=(e==null?void 0:e.harness)===de.id;n({harness:de.id,model:ge,serviceTier:S0(de,ge,Ee?e==null?void 0:e.serviceTier:null),permissionMode:Ee?e.permissionMode:((Ae=de.options)==null?void 0:Ae.defaultPermissionMode)??null,reasoningLevel:gE(de,ge,Ee?e.reasoningLevel:null)}),z()},j=(e==null?void 0:e.model)!=null?(ve=_.find(de=>de.id===e.harness))==null?void 0:ve.models.find(de=>de.id===e.model):void 0,D=e?e.model?j?y0(j):bE(e.model):L6():b1(),I=(e==null?void 0:e.reasoningLevel)??o??((ce=a[0])==null?void 0:ce.id),L=(re=a.find(de=>de.id===I))==null?void 0:re.label,U=(e==null?void 0:e.permissionMode)??r??((P=t[0])==null?void 0:P.id),q=(oe=t.find(de=>de.id===U))==null?void 0:oe.label,W=(e==null?void 0:e.harness)==="opencode"?P_e():t_e(),Z=_.find(de=>de.id===(e==null?void 0:e.harness)),X=mE(Z,e==null?void 0:e.model),J=S0(Z,e==null?void 0:e.model,e==null?void 0:e.serviceTier),ee=(ue=X.find(de=>de.id===J))==null?void 0:ue.label,$=de=>{l==null||l(de),z()},B=de=>{s==null||s(de),z()},H=de=>{e&&n({...e,serviceTier:de}),z()},K=(de,ge,Ee)=>d.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-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(Ee),children:[d.jsx("span",{className:"flex-1",children:de}),ge&&d.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:ge}),d.jsx(wa,{size:14,className:"shrink-0 text-muted"})]}),G=de=>d.jsxs("button",{ref:g,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[d.jsx(q9,{size:15}),de]}),ie=(de,ge,Ee,Ae)=>d.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:de.map(He=>d.jsxs("button",{className:Vr,onClick:()=>Ae(He.id),children:[d.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[d.jsxs("span",{children:[He.label,He.id===Ee&&d.jsxs("span",{className:"font-normal text-muted",children:[" ",b9()]})]}),He.description&&d.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:He.description})]}),He.id===ge&&d.jsx(os,{size:13})]},He.id))});return d.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:v,children:[d.jsxs("button",{ref:m,type:"button",className:`${Kd} composer-pill min-w-0 max-w-full gap-[5px] px-2 text-md text-text whitespace-nowrap`,title:UD({label:`${D}${L?` · ${L}`:""}${ee?` · ${ee}`:""}`}),"aria-haspopup":"menu","aria-expanded":S,onClick:()=>{S?z():(C("root"),k(!0))},children:[J==="priority"?d.jsx(bWe,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?d.jsx(Fv,{harness:e.harness,size:14}):null,J==="priority"&&d.jsxs("span",{className:"sr-only",children:[i_e()," "]}),d.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,L&&d.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:L})]}),d.jsx(ya,{size:14,className:"shrink-0 text-muted"})]}),S&&d.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-[0_10px_26px_rgba(0,_0,_0,_0.16)] 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:[y==="root"&&d.jsxs("div",{className:"model-root-menu p-1",children:[K(b1(),D,"models"),a.length>0&&K(W,L,"reasoning"),X.length>0&&K(I6(),ee,"speed"),t.length>0&&K(O6(),q,"permissions")]}),y==="models"&&d.jsxs(d.Fragment,{children:[G(b1()),d.jsx("input",{autoFocus:!0,type:"text",placeholder:S_e(),value:b,onChange:de=>w(de.target.value)}),d.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[N.map(({harness:de,models:ge,hidden:Ee})=>d.jsxs("div",{className:"[&_.model-item]:ps-6",children:[d.jsxs("div",{className:aA,children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Fv,{harness:de.id,size:14}),de.name]}),!de.agentReady&&d.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[d.jsx(f7,{size:10})," ",v9()]})]}),de.agentReady?d.jsxs(d.Fragment,{children:[de.models.length===0&&d.jsxs("button",{className:Vr,onClick:()=>T(de,null),children:[d.jsxs("span",{children:[L6(),d.jsx("span",{className:"model-id",children:g9()})]}),(e==null?void 0:e.harness)===de.id&&(e==null?void 0:e.model)===null&&d.jsx(os,{size:13})]}),ge.map(Ae=>d.jsxs("button",{className:Vr,title:Ae.id,onClick:()=>T(de,Ae.id),children:[d.jsx("span",{children:y0(Ae)}),(e==null?void 0:e.harness)===de.id&&(e==null?void 0:e.model)===Ae.id&&d.jsx(os,{size:13})]},Ae.id)),Ee>0&&d.jsx("div",{className:S8,children:p_e({count:Ht(Ee)})}),b.trim().length>0&&!de.models.some(Ae=>Ae.id===b.trim())&&d.jsx("button",{className:Vr,onClick:()=>T(de,b.trim()),children:d.jsx("span",{children:I_e({id:je(b.trim())})})})]}):d.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:de.agentNote?Lp(de.agentNote):v_e()})]},de.id)),_.length===0&&d.jsx("div",{className:S8,children:Zhe()})]}),f&&e&&_.length>1&&d.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[d.jsx(f7,{size:11}),N_e()]})]}),y==="reasoning"&&d.jsxs(d.Fragment,{children:[G(W),ie(a,I,o,$)]}),y==="permissions"&&d.jsxs(d.Fragment,{children:[G(O6()),ie(t,U,r,B)]}),y==="speed"&&d.jsxs(d.Fragment,{children:[G(I6()),ie(X,J??void 0,"default",H)]})]})]})}function wd({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:a=!1,disabled:o=!1,variant:l="pill",title:c,numbered:f=!1,renderIcon:_,onSelect:h}){var N,T;const{open:m,setOpen:g,ref:S}=_o();if(e.length===0)return null;const k=n??t??((N=e[0])==null?void 0:N.id)??null,v=e.find(j=>j.id===k),b=e.find(j=>j.id===t),w=l==="bare"&&(b==null?void 0:b.id)===w0?b:void 0,y=w?e.filter(j=>j.id!==w.id):e,C=(v==null?void 0:v.label)??((T=e[0])==null?void 0:T.label)??"",z=j=>{h(j),g(!1)};return d.jsxs("div",{className:`option-picker relative inline-flex${l==="field"?" w-full":""}`,ref:S,children:[d.jsxs("button",{type:"button",className:l==="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":`${Kd} ${l==="pill"?"composer-pill gap-[5px] px-2 text-md text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-md text-text"}`,title:c,"aria-haspopup":"menu","aria-expanded":m,disabled:o,onClick:()=>g(j=>!j),children:[d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[v&&(_==null?void 0:_(v)),d.jsx("span",{className:"truncate",children:C})]}),d.jsx(ya,{size:12})]}),m&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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":""} ${l==="field"?"min-w-full":""} ${s==="right"?"align-right":""} ${a?"drop-down":""}`,children:[r&&d.jsx("div",{className:aA,children:r}),w&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",className:Vr,onClick:()=>z(w.id),children:[d.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(w),d.jsxs("span",{children:[w.label,d.jsx("span",{className:"option-default text-muted font-normal",children:g9()})]})]}),k===w.id&&d.jsx(os,{size:13})]}),d.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),y.map((j,D)=>d.jsxs("button",{type:"button",className:Vr,onClick:()=>z(j.id),children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(j),d.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[d.jsxs("span",{children:[j.label,!w&&j.id===t&&d.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",b9()]})]}),j.description&&d.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:j.description})]})]}),k===j.id?d.jsx(os,{size:13}):f&&d.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:D+1})]},j.id))]})]})}const k8={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function bat(e){return k8[e]??k8.idle}const vat={done:vHe,failed:NHe,running:LHe,starting:$He,cancelling:pHe,cancelled:fHe,editing:SHe,idle:THe};function oA(e){const n=vat[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function no({status:e,label:n}){const t=bat(e);return d.jsxs("span",{className:`${J2} ${t.className}${t.live?" live":""}`,children:[d.jsx("span",{className:"dot"}),n??oA(e)]})}const ao=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),ju=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),fc=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-md text-text","[&_.k]:font-medium [&_.k]:text-md [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-md [&_.v]:text-text [&_.v]:break-words"].join(" "),py="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-md leading-relaxed text-text whitespace-pre-wrap",Hr=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),rh=["form font-sans text-md text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-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-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]: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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-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-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-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 [&_.new-project-actions_.primary]:ms-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Qa=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),Uv=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),i0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Xc=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function lb(e){return e.agentReady?{cls:"ok",label:R9()}:e.installed?e.installBroken?{cls:"warn",label:YEe()}:e.authState==="unknown"?{cls:"warn",label:VRe()}:e.authState==="unsupported"?{cls:"warn",label:JRe()}:{cls:"warn",label:pje()}:{cls:"warn",label:XAe()}}function xat({h:e}){return e.authMethod?d.jsx(d.Fragment,{children:e.authMethod==="oauth"?Y8e():x9()}):d.jsx(d.Fragment,{children:"—"})}function yat(){const[e,n]=R.useState(null),[t,r]=R.useState("claude-code"),[s,a]=R.useState(!1),o=(c,f=!1)=>{a(!0),k0(c,f).then(n).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>Z2(()=>o(!0)),[]);const l=e==null?void 0:e.find(c=>c.id===t);return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:bEe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:RCe()}),d.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(c=>d.jsxs("button",{className:c.id===t?"active":"",onClick:()=>r(c.id),children:[c.name,d.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${lb(c).cls}`})]},c.id))}),e?l?d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("span",{className:`${_r} ${lb(l).cls}`,children:lb(l).label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:Ks,onClick:()=>o(!0,!0),disabled:s,children:[d.jsx(Gd,{size:12,className:s?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",I2()]})]}),d.jsxs("div",{className:ju,children:[d.jsx("span",{className:"k",children:Pke()}),d.jsx("span",{className:"v",children:l.binPath??D8e()}),d.jsx("span",{className:"k",children:B9()}),d.jsx("span",{className:"v",children:l.version??"—"}),d.jsx("span",{className:"k",children:wke()}),d.jsx("span",{className:"v",children:d.jsx(xat,{h:l})}),l.account&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:l.id==="opencode"?ODe():M2()}),d.jsx("span",{className:"v",children:l.account})]}),l.org&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:Ije()}),d.jsx("span",{className:"v",children:l.org})]}),l.plan&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:vTe()}),d.jsx("span",{className:"v",children:l.plan})]}),d.jsx("span",{className:"k",children:pke()}),d.jsx("span",{className:"v",children:l.models.length>0?YSe({count:Ht(l.models.length),models:new Intl.ListFormat(E()).format(l.models.slice(0,4).map(c=>je(y0(c))))}):T2()})]}),!l.agentReady&&l.agentNote&&d.jsx("p",{className:Hr,children:l.agentNote})]}):null:d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",L9e()]})]})}function wat({s:e}){if(!e.configured)return d.jsx("span",{className:_r,children:sp()});const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?d.jsx("span",{className:so,children:R2()}):d.jsx("span",{className:Cs,children:_Ae()}):d.jsx("span",{className:Cs,children:ACe()}):d.jsx("span",{className:Cs,children:LNe()})}function Sat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(""),[c,f]=R.useState(!1),[_,h]=R.useState(null),m=k=>{n(k),a(k.context??""),l(k.namespace)};R.useEffect(()=>{eKe().then(m).catch(k=>r(k instanceof Error?k.message:String(k)))},[]);const g=e!==null&&s===(e.context??"")&&o.trim()===e.namespace;async function S(k){if(k.preventDefault(),!c){f(!0),h(null);try{m(await tKe({context:s,namespace:o.trim()}))}catch(v){h(v instanceof Error?v.message:String(v))}finally{f(!1)}}}return d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:bCe()}),d.jsx("span",{className:"v",children:d.jsx(wat,{s:e})})]}),e.preflight.error&&d.jsx("p",{className:py,children:e.preflight.error}),d.jsxs("form",{className:rh,onSubmit:S,children:[d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:[WCe(),d.jsx(wd,{choices:[{id:"",label:e.currentContext?aSe({context:je(e.currentContext)}):nSe()},...s&&!e.contexts.includes(s)?[{id:s,label:B8e({context:je(s)})}]:[],...e.contexts.map(k=>({id:k,label:k}))],value:s,variant:"field",dropDown:!0,disabled:c,onSelect:a})]}),d.jsxs("label",{children:[Hze(),d.jsx("input",{type:"text",value:o,onChange:k=>l(k.target.value),placeholder:m9e(),autoComplete:"off",spellCheck:!1})]})]}),_&&d.jsx("div",{className:"error",children:_}),d.jsx("div",{className:"actions",children:d.jsx("button",{type:"submit",className:Xr,disabled:c||g,children:c?xa():ac()})})]}),d.jsxs("section",{className:"mt-7",children:[d.jsx("h3",{className:"mt-0 mx-0 mb-1.5 text-md font-semibold text-text",children:fMe()}),d.jsx("p",{className:"m-0 font-sans text-md leading-relaxed text-text",children:ESe({placeholder:je("{{ORX_RUN}}"),command:je("--manifest ")})})]})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",oCe()]})})}const kat={env:DSe,syncedEnv:VSe,modalToml:BSe};function Cat({s:e}){return e.ready?d.jsx("span",{className:so,children:R2()}):!e.tokenConfigured&&!e.modalImportable?d.jsx("span",{className:_r,children:fje()}):e.modalImportable?e.tokenConfigured?d.jsx("span",{className:_r,children:O9()}):d.jsx("span",{className:Cs,children:DAe()}):d.jsx("span",{className:Cs,children:e.envProvisioned?F6e():V6e()})}function Eat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{nKe().then(n).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!s){a(!0),l(null);try{n(await rKe())}catch(f){l(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:ip()}),d.jsx("span",{className:"v",children:d.jsx(Cat,{s:e})}),d.jsx("span",{className:"k",children:D2()}),d.jsx("span",{className:"v",children:e.modalImportable?O2():e.envProvisioned?jSe():N8e()}),d.jsx("span",{className:"k",children:L9()}),d.jsx("span",{className:"v",children:e.tokenSource?kat[e.tokenSource]():sp()})]}),!e.tokenConfigured&&d.jsx("p",{className:Hr,children:FSe({command:je("modal token new"),id:je("MODAL_TOKEN_ID"),secret:je("MODAL_TOKEN_SECRET")})}),e.error&&e.envProvisioned&&!e.modalImportable&&d.jsx("p",{className:Hr,children:e.error}),o&&d.jsx("div",{className:"error",children:o}),!e.modalImportable&&d.jsx("div",{className:"mt-6 flex justify-end",children:d.jsx("button",{className:Xr,onClick:()=>void c(),disabled:s,children:s?FLe():BLe()})})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",fCe()]})})}function Nat({test:e}){if(e===void 0)return d.jsx("span",{className:"block text-start text-[12px] text-text",children:FAe()});if(e==="testing")return d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-text text-xs",role:"status",children:[d.jsx("span",{className:Lt,"aria-hidden":"true"})," ",$2()]});const n=e.missingTools??[],t=e.reachable?e.toolsFound?d.jsx("span",{className:so,children:O2()}):d.jsx("span",{className:Cs,children:n.length===1?e8e({tool:je(n[0])}):s8e()}):d.jsx("span",{className:Cs,children:L2()});return d.jsxs("div",{role:"status",children:[t,d.jsx("span",{className:"ssh-tested-at block mt-2 text-[12px] text-text",children:qi(e.testedAt)})]})}function zat(){const[e,n]=R.useState(null),[t,r]=R.useState({}),[s,a]=R.useState({});R.useEffect(()=>{cKe().then(n).catch(()=>n([]))},[]);async function o(c){r(f=>({...f,[c]:"testing"}));try{const f=await uKe(c);r(_=>({..._,[c]:f})),f.error&&a(_=>({..._,[c]:!0}))}catch(f){r(_=>({..._,[c]:{reachable:!1,toolsFound:!1,missingTools:[],error:f instanceof Error?f.message:String(f),testedAt:Date.now()}})),a(_=>({..._,[c]:!0}))}}function l(c,f){a(_=>({..._,[c]:!f}))}return d.jsx(d.Fragment,{children:e===null?d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",LTe()]}):e.length===0?d.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:uAe()}):d.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:e.map(c=>{const f=t[c.host]??c.lastTest,_=f==="testing",h=s[c.host]??!1,m=`${c.user?`${c.user}@`:""}${c.hostname??c.host}${c.port?`:${c.port}`:""}`;return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 py-3 px-2 cursor-pointer transition-colors duration-120 ease-standard [&:hover]:bg-surface",onClick:()=>l(c.host,h),children:[d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[d.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":h,"aria-label":h?WD({name:je(c.host)}):pL({name:je(c.host)}),onClick:g=>{g.stopPropagation(),l(c.host,h)},children:d.jsx(ya,{size:15,className:`text-muted transition-transform duration-120 ease-standard${h?" rotate-180":""}`})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"truncate text-base font-medium text-text",title:c.host,children:c.host}),d.jsx("div",{className:"mt-1 truncate font-mono text-sm text-muted",title:m,children:m})]})]}),d.jsxs("div",{className:"grid flex-none grid-cols-[6rem_5rem] items-center gap-x-[clamp(1rem,2vw,2.5rem)]",children:[d.jsx("div",{className:"text-start",children:d.jsx(Nat,{test:f})}),d.jsx("button",{type:"button",className:`${Ks} justify-self-end`,onClick:g=>{g.stopPropagation(),o(c.host)},disabled:_,children:_?lOe():f?wLe():sOe()})]})]}),h&&d.jsx("div",{className:"border-t border-t-border-variant py-3 pe-2 ps-10",children:d.jsxs("dl",{className:"m-0 grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2",children:[d.jsx("dt",{className:"text-sm font-medium text-subtext",children:BEe()}),d.jsx("dd",{className:`m-0 text-sm text-text wrap-anywhere${c.identityFile?" font-mono":""}`,children:c.identityFile??YLe()}),f!=="testing"&&(f==null?void 0:f.error)&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{className:"text-sm font-medium text-subtext",children:$Ne()}),d.jsx("dd",{className:"m-0 text-sm leading-relaxed text-text whitespace-pre-wrap wrap-anywhere",children:f.error})]})]})})]},c.host)})})})}function Aat({test:e}){return e===null?null:e==="testing"?d.jsx("span",{className:_r,children:$2()}):e.reachable?e.slurmFound?e.toolsFound?d.jsx("span",{className:so,children:O2()}):d.jsx("span",{className:Cs,children:kze()}):d.jsx("span",{className:Cs,children:jAe()}):d.jsx("span",{className:Cs,children:L2()})}function jat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(""),[c,f]=R.useState(""),[_,h]=R.useState(""),[m,g]=R.useState(!1),[S,k]=R.useState(null),[v,b]=R.useState(null),w=v!==null&&v!=="testing"?v:null,y=T=>{n(T),a(T.host??""),l(T.partition??""),f(T.account??""),h(T.timeLimit??"")};R.useEffect(()=>{fKe().then(y).catch(T=>r(T instanceof Error?T.message:String(T)))},[]);const C=e!==null&&s===(e.host??"")&&o.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&_.trim()===(e.timeLimit??"");async function z(T){if(T.preventDefault(),!m){g(!0),k(null);try{y(await dKe({host:s,partition:o.trim(),account:c.trim(),timeLimit:_.trim()}))}catch(j){k(j instanceof Error?j.message:String(j))}finally{g(!1)}}}async function N(T){b("testing");try{b(await hKe(T))}catch(j){b({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:j instanceof Error?j.message:String(j)})}}return d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?d.jsxs(d.Fragment,{children:[(w==null?void 0:w.error)&&d.jsx("p",{className:py,children:w.error}),w&&w.partitions.length>0&&d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:fTe()}),d.jsx("span",{className:"v",children:w.partitions.join(", ")})]}),d.jsxs("form",{className:rh,onSubmit:z,children:[d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:[mze(),d.jsx(wd,{choices:[{id:"",label:oje()},...s&&!e.hosts.some(T=>T.host===s)?[{id:s,label:`${s} (not in ~/.ssh/config)`}]:[],...e.hosts.map(T=>({id:T.host,label:T.host}))],value:s,variant:"field",dropDown:!0,disabled:m,onSelect:T=>{a(T),b(null)}})]}),d.jsxs("label",{children:[oTe(),d.jsx("input",{type:"text",list:"slurm-partitions",value:o,onChange:T=>l(T.target.value),placeholder:r7(),autoComplete:"off",spellCheck:!1}),d.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(T=>d.jsx("option",{value:T},T))})]})]}),d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:[M2(),d.jsx("input",{type:"text",value:c,onChange:T=>f(T.target.value),placeholder:r7(),autoComplete:"off",spellCheck:!1})]}),d.jsxs("label",{children:[$Re(),d.jsx("input",{type:"text",value:_,onChange:T=>h(T.target.value),placeholder:CCe(),autoComplete:"off",spellCheck:!1})]})]}),S&&d.jsx("div",{className:"error",children:S}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"submit",className:Xr,disabled:m||C,children:m?xa():ac()}),d.jsx("button",{type:"button",className:qn,onClick:()=>void N(s),disabled:!s||v==="testing",title:s?void 0:MDe(),children:D9()}),d.jsx(Aat,{test:v})]})]})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",eze()]})})}function Tat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),[_,h]=R.useState(null),m=_!==null&&_!=="testing"?_:null,g=b=>{n(b),a(b.address??"")};R.useEffect(()=>{_Ke().then(g).catch(b=>r(b instanceof Error?b.message:String(b)))},[]);const S=e!==null&&s===(e.address??"");async function k(b){if(b.preventDefault(),!o){l(!0),f(null);try{g(await pKe({address:s}))}catch(w){f(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function v(){h("testing");try{h(await mKe(s.trim()||void 0))}catch(b){h({reachable:!1,address:s.trim()||"(unknown)",rayVersion:null,error:b instanceof Error?b.message:String(b)})}}return d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:U9e()}),d.jsx("span",{className:"v",children:e.resolvedAddress}),d.jsx("span",{className:"k",children:B2()}),d.jsx("span",{className:"v",children:e.source}),(m==null?void 0:m.reachable)&&m.rayVersion&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:NTe()}),d.jsx("span",{className:"v",children:m.rayVersion})]})]}),(m==null?void 0:m.error)&&d.jsx("p",{className:py,children:m.error}),d.jsxs("form",{className:rh,onSubmit:k,children:[d.jsxs("label",{children:[vNe(),d.jsx("input",{type:"text",value:s,onChange:b=>{a(b.target.value),h(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),c&&d.jsx("div",{className:"error",children:c}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"submit",className:Xr,disabled:o||S,children:o?xa():ac()}),d.jsx("button",{type:"button",className:qn,onClick:()=>void v(),disabled:_==="testing",children:D9()}),d.jsx(Mat,{test:_})]})]})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",YNe()]})})}function Mat({test:e}){return e===null?null:e==="testing"?d.jsx("span",{className:_r,children:$2()}):e.reachable?d.jsx("span",{className:so,children:TTe()}):d.jsx("span",{className:Cs,children:L2()})}function Rat(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{vKe().then(n).catch(s=>r(s instanceof Error?s.message:String(s)))},[]),d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:jEe()}),d.jsx("span",{className:"v",children:e.hostname}),d.jsx("span",{className:"k",children:hRe()}),d.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),d.jsx("span",{className:"k",children:"CPU"}),d.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),d.jsx("span",{className:"k",children:"RAM"}),d.jsx("span",{className:"v",children:e.memBytes!==null?Bi(e.memBytes):"—"}),d.jsx("span",{className:"k",children:"GPUs"}),d.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(s=>`${s.name}${s.memMib!==null?` — ${Bi(s.memMib*1024*1024)}`:""}`).join(", ")})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",T9e()]})})}function Dat(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{xKe().then(n).catch(s=>r(s instanceof Error?s.message:String(s)))},[]),d.jsx(d.Fragment,{children:t?d.jsx("div",{className:"error",children:t}):e?e.loggedIn?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:ip()}),d.jsx("span",{className:"v",children:d.jsx("span",{className:so,children:R9()})}),d.jsx("span",{className:"k",children:Pje()}),d.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),d.jsx("span",{className:"k",children:HMe()}),d.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?d.jsx("span",{className:so,children:vje()}):e.sshKeyStatus==="no_local_match"?d.jsx("span",{className:TXe,children:rje()}):e.sshKeyStatus==="none_registered"?d.jsx("span",{className:Cs,children:BAe()}):d.jsx("span",{className:_r,children:O9()})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?d.jsxs("p",{dir:"auto",className:Hr,children:[oke()," ",d.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):d.jsxs("p",{dir:"auto",className:Hr,children:[EAe()," ",d.jsx("code",{children:"ssh-keygen -t ed25519"}),SRe()," ",d.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?d.jsx("p",{dir:"auto",className:Hr,children:HDe({register:je(`orx ssh-key add ${e.sshKeyPath}`),load:je("ssh-add")})}):d.jsxs("p",{dir:"auto",className:Hr,children:[wAe()," ",d.jsx("code",{children:"ssh-add"}),Rje()," ",d.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&d.jsx("p",{dir:"auto",className:Hr,children:e.error})]}):d.jsx("p",{className:Hr,children:bSe({command:je("orx login")})}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",rCe()]})})}const I0={local:h9,tinker:jse,hf:Jre,modal:use,k8s:rse,ssh:Ese,slurm:wse,ray:bse,openresearch:_se},Lat={local:Cre,ssh:Gre,tinker:Xre,hf:gre,modal:Are,k8s:yre,slurm:Pre,ray:Ire,openresearch:Rre},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"},Oat={local:Fse,ssh:lie,tinker:die,hf:Dse,modal:Vse,k8s:Bse,slurm:sie,ray:eie,openresearch:Yse};function Iat(e){switch(e.id){case"local":return Une();case"ssh":return cre({summary:je(e.summary)});case"tinker":return hre({summary:je(e.summary)});case"hf":return Lne({summary:je(e.summary)});case"modal":return Wne({summary:je(e.summary)});case"k8s":return $ne({summary:je(e.summary)});case"slurm":return ire({summary:je(e.summary)});case"ray":return tre({summary:je(e.summary)});case"openresearch":return Zne({summary:je(e.summary)})}}function Bat({target:e}){return d.jsxs("dl",{className:"m-0 mt-8 grid grid-cols-[9rem_minmax(0,1fr)] gap-x-5 gap-y-4 font-sans",children:[d.jsx("dt",{className:"text-md font-medium text-subtext",children:DEe()}),d.jsx("dd",{className:"m-0 text-md leading-relaxed text-text",children:Iat(e)}),d.jsx("dt",{className:"text-md font-medium text-subtext",children:xDe()}),d.jsx("dd",{className:"m-0 text-md leading-relaxed text-text",children:Oat[e.id]()})]})}const C8=["hf","modal","slurm","ray","openresearch"],cb=["hf","modal","openresearch"],lA={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"]},E8="__custom__";function Hf(e,n){return!!(n&&!(lA[e]??[]).includes(n))}function $at({settings:e,projectId:n,onSaved:t}){const r=e.configuredDefaultBackend??e.defaultBackend??"local",s=e.defaultFlavor??"",[a,o]=R.useState(r),[l,c]=R.useState(s),[f,_]=R.useState(Hf(r,s)),[h,m]=R.useState(!1),[g,S]=R.useState(null),k=e.targets.find(I=>I.id===a),v=e.targets.filter(I=>I.configured||I.id===r),b=C8.includes(a),w=cb.includes(a),y=lA[a]??[],C=a===r&&(!b||l.trim()===s),z=I0[a](),N=h?UOe():w&&!l.trim()?e6e({destination:z}):a==="ssh"?d8e():l8e({destination:z});R.useEffect(()=>{o(r),c(s),_(Hf(r,s))},[r,s]);async function T(I,L){const U=C8.includes(I);if(!(h||cb.includes(I)&&!L.trim())){m(!0),S(null);try{t(await bKe({backend:I,flavor:U&&L.trim()||null,projectId:n}))}catch(q){S(q instanceof Error?q.message:String(q)),o(r),c(s),_(Hf(r,s))}finally{m(!1)}}}function j(I){const L=e.targets.find(q=>q.id===I);if(!L)return;o(L.id);const U=L.id===r?s:"";c(U),_(Hf(L.id,U)),cb.includes(L.id)||T(L.id,U)}function D(I){if(I===E8){_(!0);return}_(!1),c(I),(!w||I)&&T(a,I)}return d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:S9e()}),d.jsxs("div",{children:[d.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:I=>{I.preventDefault(),C||T(a,l)},children:[d.jsx(wd,{choices:v.map(I=>({id:I.id,label:I0[I.id]()})),value:a,variant:"field",dropDown:!0,disabled:h,renderIcon:I=>{const L=e.targets.find(U=>U.id===I.id);return L?d.jsx(Ip,{kind:my[L.id],size:16}):null},onSelect:j}),b&&d.jsx("div",{children:f?d.jsxs("div",{className:"relative",children:[d.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:l,onChange:I=>c(I.target.value),onBlur:()=>{if(w&&!l.trim()){a===r&&(c(s),_(Hf(r,s)));return}C||T(a,l)},placeholder:i9e(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:h}),d.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":n7(),title:n7(),onMouseDown:I=>I.preventDefault(),onClick:()=>_(!1),children:d.jsx(ya,{size:12})})]}):d.jsx(wd,{choices:[{id:"",label:w?Ywe():x8e()},...l&&!y.includes(l)?[{id:l,label:T6e({value:je(l)})}]:[],...y.map(I=>({id:I,label:I})),{id:E8,label:T9()}],value:l,variant:"field",dropDown:!0,disabled:h,onSelect:D})})]}),g&&d.jsx("div",{className:"error mt-2.5",children:g}),k&&!k.configured&&d.jsx("p",{className:Hr,children:TRe()})]}),d.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:N})]})}function Hat({target:e,isDefault:n,onOpen:t}){const r=e.unverified?Fwe():e.id==="openresearch"?VLe():e.id==="ray"?m6e():DLe();return d.jsxs("button",{type:"button",className:"group flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans transition-colors duration-120 ease-standard hover:border-text hover:bg-surface disabled:cursor-default disabled:opacity-52",onClick:t,disabled:!e.enabled,children:[d.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:d.jsx(Ip,{kind:my[e.id],size:48})}),d.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:I0[e.id]()}),d.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-subtext",children:Lat[e.id]()}),d.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-md",children:[d.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?x0():e.configured?tIe():r}),d.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:d.jsx(Q_,{size:16})})]})]})}function Pat({target:e,isDefault:n,onBack:t}){return d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",className:"settings-back mb-10 inline-flex items-center gap-2 text-md font-medium text-subtext hover:text-text",onClick:t,children:[d.jsx(ud,{size:16})," ",A9()]}),d.jsxs("div",{className:"flex items-center justify-between gap-6",children:[d.jsxs("div",{className:`flex min-w-0 items-center ${e.id==="tinker"?"gap-8":"gap-5"}`,children:[d.jsx("span",{className:"flex h-20 w-24 flex-none items-center justify-start",children:d.jsx(Ip,{kind:my[e.id],size:72})}),d.jsx("h1",{className:"m-0 min-w-0",children:I0[e.id]()})]}),n&&d.jsx("span",{className:"inline-flex flex-none items-center rounded-sm border border-primary bg-primary-subtle py-px px-2 text-xs font-medium text-primary",children:x0()})]}),d.jsx(Bat,{target:e}),e.id!=="tinker"&&d.jsxs("div",{className:"mt-8 font-sans text-md 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==="local"&&d.jsx(Rat,{}),e.id==="hf"&&d.jsx(Vat,{}),e.id==="modal"&&d.jsx(Eat,{}),e.id==="k8s"&&d.jsx(Sat,{}),e.id==="ssh"&&d.jsx(zat,{}),e.id==="slurm"&&d.jsx(jat,{}),e.id==="ray"&&d.jsx(Tat,{}),e.id==="openresearch"&&d.jsx(Dat,{})]})]})}function Fat({project:e,onViewHistory:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(null),[c,f]=R.useState(null),_=R.useRef(0);R.useEffect(()=>{_.current++,r(null),l(null),a(null),f(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const y=++_.current;gKe(e==null?void 0:e.id).then(C=>{y===_.current&&(r(C),a(null))}).catch(C=>{if(y!==_.current)return;const z=C instanceof Error?C.message:String(C);r(N=>(N===null?a(z):f(z),N))})},[o,e==null?void 0:e.id]);const h=y=>{_.current++,r(y),f(null)},m=t?t.targets:null,g=(t==null?void 0:t.configuredDefaultBackend)??(t==null?void 0:t.defaultBackend),S=m?[...m].sort((y,C)=>+(C.id===g)-+(y.id===g)):null,k=(S==null?void 0:S.filter(y=>y.configured))??[],v=(S==null?void 0:S.filter(y=>!y.configured))??[],b=y=>d.jsx(Hat,{target:y,isDefault:g===y.id,onOpen:()=>l(y.id)},`${(e==null?void 0:e.id)??"none"}:${y.id}`),w=o?t==null?void 0:t.targets.find(y=>y.id===o):null;return w?d.jsx(Pat,{target:w,isDefault:g===w.id,onBack:()=>l(null)}):d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:j9()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:HCe()}),d.jsx(cot,{projectId:e==null?void 0:e.id,onViewHistory:n}),s?d.jsx("div",{className:"error",children:s}):t?d.jsxs(d.Fragment,{children:[c&&d.jsx("div",{className:"error",children:c}),d.jsx($at,{settings:t,projectId:e==null?void 0:e.id,onSaved:h}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:VTe()}),d.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:k.map(b)})]}),v.length>0&&d.jsxs("section",{className:"mb-3.5",children:[d.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:zze()}),d.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:v.map(b)})]})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",Jke()]})]})}const Uat={env:k7e,openresearchEnv:z7e,hfCache:x7e};function qat({settings:e}){return e.configured?e.valid?d.jsx("span",{className:so,children:R2()}):d.jsx("span",{className:Cs,children:fNe()}):d.jsx("span",{className:_r,children:sp()})}function Gat({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?d.jsx("span",{className:so,children:NNe()}):e.jobsWrite===!1?d.jsx("span",{className:Cs,children:bAe()}):d.jsx("span",{className:_r,children:SNe()})}function Vat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),_=R.useRef(!1);R.useEffect(()=>{KWe().then(m=>{_.current||n(m)}).catch(m=>{_.current||r(m instanceof Error?m.message:String(m))})},[]);async function h(m){if(m.preventDefault(),!(!s.trim()||o)){l(!0),f(null);try{const g=await XWe(s.trim());_.current=!0,n(g),r(null),a("")}catch(g){f(g instanceof Error?g.message:String(g))}finally{l(!1)}}}return d.jsxs(d.Fragment,{children:[t?d.jsx("div",{className:"error",children:t}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:fc,children:[d.jsx("span",{className:"k",children:ip()}),d.jsx("span",{className:"v",children:d.jsx(qat,{settings:e})}),d.jsx("span",{className:"k",children:M2()}),d.jsx("span",{className:"v",children:e.username??"—"}),d.jsx("span",{className:"k",children:L9()}),d.jsx("span",{className:"v",children:e.maskedToken??"—"}),d.jsx("span",{className:"k",children:B2()}),d.jsx("span",{className:"v",children:e.source?Uat[e.source]():sp()}),d.jsx("span",{className:"k",children:pNe()}),d.jsxs("span",{className:"v",children:[d.jsx(Gat,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&d.jsx("p",{className:Hr,children:EEe()}),e.valid&&e.jobsWrite===null&&d.jsx("p",{className:Hr,children:M7e({login:je("hf auth login"),url:je("huggingface.co/settings/tokens")})})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",sze()]}),d.jsxs("form",{className:rh,onSubmit:h,children:[d.jsxs("label",{children:[e!=null&&e.configured?uLe():m8e(),d.jsx("input",{type:"password",value:s,onChange:m=>a(m.target.value),placeholder:wEe(),autoComplete:"off"})]}),c&&d.jsx("div",{className:"error",children:c}),d.jsx("div",{className:"actions",children:d.jsx("button",{type:"submit",className:Xr,disabled:!s.trim()||o,children:o?ZOe():ac()})})]})]})}const cA=/^hf_[A-Za-z0-9]{10,}$/;function uA(){return d.jsx("tr",{children:d.jsx("td",{colSpan:3,children:d.jsxs("p",{dir:"auto",className:Hr,children:[LRe()," ",d.jsx("code",{children:"HF_TOKEN"}),SMe()]})})})}const N8=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function Wat({name:e,entry:n,onVars:t,onError:r}){const[s,a]=R.useState(""),[o,l]=R.useState(!1),c=h=>r(`${e}: ${h instanceof Error?h.message:String(h)}`);async function f(){if(!(!s.trim()||o)){l(!0);try{t(await dE(e,s.trim())),a("")}catch(h){c(h)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await iKe(e))}catch(h){c(h)}finally{l(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{children:[d.jsx("td",{className:Wr,children:e}),d.jsx("td",{className:`${Wr} muted text-muted`,children:n?d.jsxs(d.Fragment,{children:[n.maskedValue,n.inProcessEnv&&d.jsx("span",{className:_r,children:rTe()})]}):d.jsx("input",{className:Wr,type:"password",value:s,onChange:h=>a(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),f()),h.key==="Escape"&&!o&&a("")},placeholder:I9(),"aria-label":tI({name:je(e)}),autoComplete:"new-password",disabled:o})}),d.jsx("td",{children:n?d.jsx("button",{className:mn,title:Gb({name:je(e)}),"aria-label":Gb({name:je(e)}),onClick:()=>void _(),disabled:o,children:d.jsx(Bu,{size:13})}):s.trim()&&d.jsx("button",{className:Ks,onClick:()=>void f(),disabled:o,children:o?xa():ac()})})]}),!n&&e!=="HF_TOKEN"&&cA.test(s.trim())&&d.jsx(uA,{})]})}function Kat({onVars:e,onError:n,onDone:t}){const[r,s]=R.useState(""),[a,o]=R.useState(""),[l,c]=R.useState(!1);async function f(){if(!(!r.trim()||!a.trim()||l)){c(!0);try{e(await dE(r.trim(),a.trim())),t()}catch(h){n(`${r.trim()}: ${h instanceof Error?h.message:String(h)}`)}finally{c(!1)}}}const _=h=>{h.key==="Enter"&&(h.preventDefault(),f()),h.key==="Escape"&&!l&&t()};return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("input",{autoFocus:!0,className:Wr,type:"text",value:r,onChange:h=>s(h.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":Qze(),autoComplete:"off",spellCheck:!1,disabled:l})}),d.jsx("td",{children:d.jsx("input",{className:Wr,type:"password",value:a,onChange:h=>o(h.target.value),onKeyDown:_,placeholder:I9(),"aria-label":nAe(),autoComplete:"new-password",disabled:l})}),d.jsxs("td",{children:[d.jsx("button",{className:Ks,onClick:()=>void f(),disabled:l||!r.trim()||!a.trim(),children:l?xa():ac()}),d.jsx("button",{className:mn,title:Gke(),"aria-label":Xke(),onClick:t,disabled:l,children:d.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&cA.test(a.trim())&&d.jsx(uA,{})]})}function Xat(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{sKe().then(n).catch(h=>r(h instanceof Error?h.message:String(h)))},[]);const c=h=>{n(h),l(null)},f=e===null?[]:e.map(h=>h.key).filter(h=>!N8.includes(h)),_=[...N8,...f];return d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("h3",{children:J9e()}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:Ks,onClick:()=>a(!0),disabled:s||e===null,children:[d.jsx(q2,{size:12})," ",fke()]})]}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:Y6e({path:je("~/.openresearch/env"),tinker:je("TINKER_API_KEY"),hf:je("HF_TOKEN"),wandb:je("WANDB_API_KEY")})}),t?d.jsx("div",{className:"error",children:t}):e===null?d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]}):d.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]: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 [&_.icon-btn:hover]:text-accent-red",children:d.jsxs("tbody",{children:[_.map(h=>d.jsx(Wat,{name:h,entry:e.find(m=>m.key===h),onVars:c,onError:l},h)),s&&d.jsx(Kat,{onVars:c,onError:l,onDone:()=>a(!1)})]})}),o&&d.jsx("div",{className:"error",children:o})]})}const Pf=[{value:"system",label:NOe,icon:LVe},{value:"light",label:SOe,icon:oWe},{value:"dark",label:dOe,icon:IVe}],Yat=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function Zat(){const[e,n]=rat(),t=r=>{var f;const s=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!s)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),c=((o===-1?Pf.findIndex(_=>_.value===e):o)+s+Pf.length)%Pf.length;n(Pf[c].value),(f=a[c])==null||f.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:wwe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:bwe()}),d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:`${Qa} pb-3.5`,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:c7()}),d.jsx("p",{children:mOe()})]}),d.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":c7(),onKeyDown:t,children:Pf.map(({value:r,label:s,icon:a})=>d.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>n(r),children:[d.jsx(a,{size:14}),s()]},r))})]}),d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:_Se()}),d.jsx("p",{children:uSe()})]}),d.jsx("div",{className:"w-52 flex-none",children:d.jsx(wd,{choices:Yat,value:E(),variant:"field",dropDown:!0,onSelect:r=>{bD(r)&&e9(r)}})})]})]})]})}const Qat={installer:gqe,"app-bundle":iqe,cargo:cqe,homebrew:hqe,nix:yqe,unknown:Cqe},ub={cargo:Aqe,homebrew:Rqe,nix:Iqe};function Jat(){var c;const{status:e,error:n,apply:t}=rA(),[r,s]=R.useState(null),[a,o]=R.useState(null);if(!e)return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:l7()}),n?d.jsx("div",{className:ao,children:d.jsx("div",{className:"error",children:n})}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]})]});const l=async(f,_)=>{s(f),o(null);try{await _()}catch(h){o(h instanceof Error?h.message:String(h))}finally{s(null)}};return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:l7()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:TNe()}),d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:ju,children:[d.jsx("div",{className:"k",children:B9()}),d.jsx("div",{className:"v",children:e.current}),d.jsx("div",{className:"k",children:UNe()}),d.jsx("div",{className:"v",children:e.latest??"—"}),d.jsx("div",{className:"k",children:VEe()}),d.jsx("div",{className:"v",children:Qat[e.channel]()})]}),e.restartRequired&&d.jsx("div",{className:Qa,children:d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:oMe()}),d.jsx("p",{children:bLe({installed:je(e.installedVersion??"—"),current:je(e.current??e.installedVersion??"—")})})]})}),e.selfUpdates?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:i7()}),d.jsxs("p",{children:[Kze(),e.envDisabled&&$Oe()]})]}),d.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":i7(),className:`${dp} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>QWe(!e.autoUpdate).then(t)),children:d.jsx("span",{})})]}),d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?LOe({version:je(e.latest??"—")}):Dwe()}),d.jsx("p",{children:e.updateAvailable?Q7e():Vwe()})]}),d.jsx("button",{type:"button",className:Ks,disabled:r!==null,onClick:()=>void l("apply",()=>ZWe().then(t)),children:r==="apply"?np():e.updateAvailable?TOe():Bwe()})]})]}):d.jsx("div",{className:Qa,children:d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:Gje()}),d.jsx("p",{children:((c=ub[e.channel])==null?void 0:c.call(ub))??qDe()})]})}),e.channel==="app-bundle"&&d.jsx(tot,{busy:r,run:l}),a&&d.jsx("div",{className:"error",children:a})]})]})}function eot(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null);R.useEffect(()=>{MKe().then(n).catch(l=>a(l instanceof Error?l.message:String(l)))},[]);const o=()=>{!e||t||(r(!0),a(null),RKe(!e.preferenceEnabled).then(n).catch(l=>a(l instanceof Error?l.message:String(l))).finally(()=>r(!1)))};return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:aDe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:jMe()}),e?d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:t7()}),d.jsx("p",{children:aAe()}),!e.enabled&&e.reason&&d.jsxs("p",{children:[t9e()," ",e.reason,"."]})]}),d.jsx("button",{type:"button",role:"switch","aria-checked":e.preferenceEnabled,"aria-label":t7(),className:`${dp} ${e.preferenceEnabled?"on":""}`,disabled:t,onClick:o,children:d.jsx("span",{})})]}),s&&d.jsx("div",{className:"error",children:s})]}):s?d.jsx("div",{className:"error",children:s}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]})]})}function tot({busy:e,run:n}){const[t,r]=R.useState(null),[s,a]=R.useState(!1),o=l=>void n("cli",()=>JWe(l).then(c=>{r(c),a(!1)}).catch(c=>{throw a(!l&&String((c==null?void 0:c.message)??c).includes("--force")),c}));return d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:q7e({command:je("orx")})}),t?d.jsxs("p",{children:[t.alreadyCurrent?l6e({link:je(t.link)}):d6e({link:je(t.link)}),!t.onPath&&_we({directory:je(t.dir)})]}):d.jsx("p",{children:H7e({command:je("orx")})})]}),d.jsx("button",{type:"button",className:Ks,disabled:e!==null,onClick:()=>o(s),children:e==="cli"?np():s?aLe():t?KDe():O7e()})]})}function not(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null),o=()=>(a(null),K2().then(n).catch(c=>a(c instanceof Error?c.message:String(c))));R.useEffect(()=>void o(),[]);const l=()=>{if(!e||t)return;const c=!e.githubForNewProjects;r(!0),a(null),pE(c,!0).then(n).catch(f=>a(f instanceof Error?f.message:String(f))).finally(()=>r(!1))};return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:aEe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:N9e()}),e?d.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("h3",{children:uEe()}),d.jsx("span",{className:`${_r} ${e.githubAuthenticated?"ok":e.ghInstalled?"warn":"err"}`,children:e.githubAuthenticated?E9():z9()})]}),d.jsxs("div",{className:Qa,children:[d.jsxs("div",{children:[d.jsx("div",{className:"project-default-title text-md font-semibold",children:s7()}),d.jsx("p",{children:kDe()})]}),d.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":s7(),className:`${dp} ${e.githubForNewProjects?"on":""}`,disabled:t||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:d.jsx("span",{})})]}),!e.githubAuthenticated&&d.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:d.jsx(fA,{ghInstalled:e.ghInstalled,onCheck:o})}),s&&d.jsx("div",{className:"error",children:s})]}):s?d.jsx("div",{className:"error",children:s}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]})]})}function fA({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"git-card-helper text-subtext text-sm m-0",children:Lp(e?ELe():K7e())}),d.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&d.jsxs("a",{className:Xr,href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[eNe()," ",d.jsx(Jl,{size:12})]}),d.jsx("button",{type:"button",className:`${qn} ${e?"text-accent-amber border-accent-amber":""}`,disabled:t,onClick:s,children:t?rp():jwe()})]})]})}function rot(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null);return R.useEffect(()=>{HWe().then(o=>n(o.hasToken)).catch(o=>a(o instanceof Error?o.message:String(o)))},[]),d.jsxs("div",{className:Uv,children:[d.jsx("h3",{children:Xje()}),d.jsxs("div",{className:ju,children:[d.jsx("span",{className:"k",children:_Ee()}),d.jsx("span",{className:"v",children:d.jsx("span",{className:`${_r} ${e?"ok":""}`,children:e===null?s?v9():rp():e?jLe():V8e()})})]}),d.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:zDe()}),e?d.jsx("div",{className:i0,children:d.jsx("button",{className:qn,disabled:t,onClick:()=>{r(!0),a(null),PWe().then(o=>n(o.hasToken)).catch(o=>a(o instanceof Error?o.message:String(o))).finally(()=>r(!1))},children:t?nLe():QDe()})}):d.jsx(sat,{save:uE,onSaved:o=>n(o.hasToken),placeholder:Jje(),createHref:"https://www.overleaf.com/user/settings"}),s&&d.jsx("div",{className:"error",children:s})]})}function sot({project:e,publicationError:n,onProjectUpdate:t}){const[r,s]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(null),[f,_]=R.useState(!1),[h,m]=R.useState(!1),[g,S]=R.useState(null),k=R.useRef(0),v=!!(r!=null&&r.github.owner&&r.github.repo),b=(z=!0)=>{const N=++k.current;return z&&s(null),c(null),e?zKe(e.id).then(T=>{N===k.current&&s(T)}).catch(T=>{N===k.current&&c(T instanceof Error?T.message:String(T))}):Promise.resolve()};R.useEffect(()=>void b(),[e==null?void 0:e.id]);const w=z=>{const N=z instanceof Error?z.message:String(z);return N.toLowerCase().includes("archived")?s7e():N.includes("(fetch first)")||N.includes("non-fast-forward")?l7e():N.includes("403")||N.toLowerCase().includes("permission denied")?d7e():N},y=()=>{e&&(o(!0),c(null),jKe(e.id).then(z=>{s(z.git),t(z.project),K2().then(N=>{!N.githubForNewProjects&&!N.githubDefaultPromptSeen&&_(!0)}).catch(()=>{})}).catch(z=>c(w(z))).finally(()=>o(!1)))},C=z=>{m(!0),S(null),pE(z,!0).then(()=>_(!1)).catch(N=>S(N instanceof Error?N.message:String(N))).finally(()=>m(!1))};return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:rMe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:_Le({project:(e==null?void 0:e.name)??N6e()})}),e?l&&!r?d.jsx("div",{className:"error",children:l}):r?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Uv,children:[d.jsx("h3",{children:dze()}),d.jsxs("div",{className:ju,children:[d.jsx("span",{className:"k",children:pTe()}),d.jsx("span",{className:`v ${Wr}`,children:r.path}),d.jsx("span",{className:"k",children:"Git"}),d.jsx("span",{className:"v",children:r.gitVersion??y9()}),d.jsx("span",{className:"k",children:KMe()}),d.jsx("span",{className:"v",children:r.initialized?e7e({branch:je(r.currentBranch??N9()),state:r.clean?s6e():m7e()}):F8e()}),d.jsx("span",{className:"k",children:Ike()}),d.jsx("span",{className:`v ${Wr}`,children:r.baselineBranch}),d.jsx("span",{className:"k",children:JTe()}),d.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(z=>`${z.name}: ${z.url}`).join(" · "):T2()})]}),!r.initialized&&d.jsx("div",{className:i0,children:d.jsx("button",{className:Xr,onClick:()=>void AKe(e.id).then(s).catch(z=>c(String(z))),children:FEe()})})]}),d.jsxs("div",{className:Uv,children:[d.jsx("h3",{children:"GitHub"}),d.jsxs("div",{className:ju,children:[d.jsx("span",{className:"k",children:Eke()}),d.jsx("span",{className:"v",children:d.jsx("span",{className:`${_r} ${r.github.authenticated?"ok":r.github.ghInstalled?"warn":"err"}`,children:r.github.authenticated?E9():z9()})}),d.jsx("span",{className:"k",children:STe()}),d.jsx("span",{className:"v",children:v?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:Wr,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&d.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:cRe()})]}):d.jsx("span",{className:_r,children:lze()})}),r.github.enabled&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:iRe()}),d.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&d.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:d.jsx(fA,{ghInstalled:r.github.ghInstalled,onCheck:()=>b(!1)})}),r.github.authenticated&&!r.github.enabled&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:v?WOe():S6e()}),d.jsxs("div",{className:i0,children:[v&&r.github.url&&d.jsxs("a",{className:qn,href:r.github.url,target:"_blank",rel:"noreferrer",children:[o7()," ",d.jsx(Jl,{size:12})]}),d.jsx("button",{className:Xr,disabled:a,onClick:y,children:a?g3e():h3e()})]})]}),r.github.enabled&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:$9e()}),d.jsxs("div",{className:i0,children:[r.github.url&&d.jsxs("a",{className:qn,href:r.github.url,target:"_blank",rel:"noreferrer",children:[o7()," ",d.jsx(Jl,{size:12})]}),d.jsx("button",{className:qn,disabled:a,onClick:()=>{o(!0),TKe(e.id).then(z=>{s(z.git),t(z.project)}).catch(z=>c(z instanceof Error?z.message:String(z))).finally(()=>o(!1))},children:a?y3e():c3e()})]})]})]}),d.jsx(rot,{}),n&&d.jsx("div",{className:"error",children:w(n)}),l&&d.jsx("div",{className:"error",children:w(l)})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]}):d.jsx("div",{className:ao,children:d.jsx("p",{className:Hr,children:Sje()})}),f&&d.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:d.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:z=>z.stopPropagation(),children:[d.jsx("h2",{id:"github-default-title",children:xze()}),d.jsx("p",{children:NRe()}),g&&d.jsx("div",{className:"error",children:g}),d.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[d.jsx("button",{className:qn,disabled:h,onClick:()=>C(!1),children:JAe()}),d.jsx("button",{className:Xr,disabled:h,onClick:()=>C(!0),children:h?xa():wSe()})]})]})})]})}const iot={env:CPe,config:APe,xdg:RPe,default:yPe},fb={preparing:hPe,copying:UHe,verifying:IPe,finalizing:WHe},aot=e=>{var n;return((n=fb[e])==null?void 0:n.call(fb))??e};function oot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),[_,h]=R.useState({kind:"idle"}),[m,g]=R.useState(null),S=()=>aKe().then(C=>{n(C),a(z=>z||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{S()},[]),R.useEffect(()=>fXe(C=>{C.type==="progress"?h(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"?(h({kind:"done",oldPathLeft:C.oldPathLeft}),f(null),a(""),S()):C.type==="error"&&h({kind:"error",message:C.error})}),[]);const k=(e==null?void 0:e.source)==="env",v=s.trim(),b=e!==null&&v===e.current;async function w(){if(!(o||!v)){l(!0),g(null),f(null);try{f(await oKe(v))}catch(C){g(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(_.kind==="moving"||!v||b)&&(g(null),!!window.confirm(tPe({path:je(v)})))){h({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await lKe(v)}catch(z){h({kind:"idle"}),g(z instanceof Error?z.message:String(z))}}}return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:tRe()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:eOe()}),t?d.jsx("div",{className:ao,children:d.jsx("div",{className:"error",children:t})}):e?d.jsxs("div",{className:ao,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("h3",{children:d9e()}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsx("span",{className:_r,children:e.isDefault?x0():T9()})]}),d.jsxs("div",{className:ju,children:[d.jsx("span",{className:"k",children:ZCe()}),d.jsx("span",{className:`v ${Wr}`,children:e.current}),d.jsx("span",{className:"k",children:B2()}),d.jsx("span",{className:"v",children:iot[e.source]()}),!e.isDefault&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:x0()}),d.jsx("span",{className:`v ${Wr}`,children:e.defaultPath})]})]}),k?d.jsx("p",{className:Hr,children:L6e({variable:je("ORX_DATA_DIR")})}):d.jsxs("form",{className:rh,onSubmit:y,children:[d.jsxs("label",{children:[qze(),d.jsx("input",{className:Wr,type:"text",value:s,onChange:C=>{a(C.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),c&&!c.error&&c.ok&&d.jsxs("p",{className:Hr,children:[FTe()," ",Bi(c.treeBytes??0),c.freeBytes!=null&&` — ${ZHe({size:je(Bi(c.freeBytes))})}`,c.sameFilesystem?gPe():"","."]}),c&&c.ok===!1&&c.error&&d.jsx("div",{className:"error",children:c.error}),m&&d.jsx("div",{className:"error",children:m}),_.kind==="moving"&&d.jsx(iA,{value:_.copied,max:_.total,label:aot(_.phase),caption:_.total>0?d.jsxs("span",{className:Wr,children:[Bi(_.copied)," / ",Bi(_.total)]}):void 0}),_.kind==="done"&&d.jsxs("p",{className:Hr,children:[Oze(),_.oldPathLeft&&d.jsxs(d.Fragment,{children:[" ",eke({path:je(_.oldPathLeft)})]})]}),_.kind==="error"&&d.jsxs("div",{className:"error",children:[Mze()," ",_.message]}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"button",className:qn,onClick:w,disabled:o||!v||b||_.kind==="moving",children:o?rp():Ewe()}),d.jsx("button",{type:"submit",className:Xr,disabled:!v||b||_.kind==="moving",children:_.kind==="moving"?cPe():iPe()})]})]})]}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]})]})}const qv=e=>e==="running"||e==="starting";function lot(e){return qv(e.status)?C0(Date.now()-e.createdAt):e.endedAt?C0(e.endedAt-e.createdAt):"—"}function dA({instances:e,emptyLabel:n}){return e.length===0?d.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:n}):d.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:d.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-start [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:Rke()}),d.jsx("th",{children:ip()}),d.jsx("th",{children:qMe()}),d.jsx("th",{children:vMe()})]})}),d.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 d.jsxs("tr",{children:[d.jsx("td",{children:d.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[d.jsx(_y,{backend:t.backend}),r&&d.jsx("a",{className:mn,href:r,target:"_blank",rel:"noreferrer",title:a7(),"aria-label":a7(),onClick:a=>a.stopPropagation(),children:d.jsx(Jl,{size:12})})]})}),d.jsx("td",{children:d.jsx(no,{status:wi(t)})}),d.jsx("td",{children:qi(t.createdAt)}),d.jsx("td",{children:lot(t)})]},t.id)})})]})})}function cot({projectId:e,onViewHistory:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(!1),[,c]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>c(S=>S+1),3e4);return()=>clearInterval(g)},[]);const f=()=>{if(!e){r([]);return}l(!0),W2(e).then(g=>{r(g),a(null)}).catch(g=>{a(g instanceof Error?g.message:String(g)),r(S=>S??[])}).finally(()=>l(!1))};R.useEffect(()=>f(),[e]);const _=(g,S)=>S.createdAt-g.createdAt,h=t==null?void 0:t.filter(g=>qv(g.status)).sort(_),m=t==null?void 0:t.filter(g=>!qv(g.status)).sort(_);return d.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:[d.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:[d.jsx("div",{children:d.jsxs("h2",{children:[pMe(),h&&h.length>0&&d.jsx("span",{className:"count-badge",children:h.length})]})}),d.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[d.jsxs("button",{className:Ks,onClick:f,disabled:o,children:[d.jsx(Gd,{size:12,className:o?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",I2()]}),d.jsx("button",{className:Ks,onClick:n,children:m!=null&&m.length?mhe({count:Ht(m.length)}):dhe()})]})]}),s&&d.jsx("div",{className:"error",children:s}),!h||!m?d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]}):d.jsx(dA,{instances:h,emptyLabel:e?ehe():lhe()})]})}function uot({projectId:e,onBack:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(!1),[,c]=R.useState(0);R.useEffect(()=>{const _=setInterval(()=>c(h=>h+1),3e4);return()=>clearInterval(_)},[]);const f=()=>{if(!e){r([]);return}l(!0),W2(e).then(_=>{r(_.sort((h,m)=>m.createdAt-h.createdAt)),a(null)}).catch(_=>{a(_ instanceof Error?_.message:String(_)),r(h=>h??[])}).finally(()=>l(!1))};return R.useEffect(f,[e]),d.jsxs(d.Fragment,{children:[d.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:[d.jsx(ud,{size:14})," ",A9()]}),d.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[d.jsx("h1",{children:oNe()}),d.jsxs("button",{className:Ks,onClick:f,disabled:o,children:[d.jsx(Gd,{size:12,className:o?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",I2()]})]}),s&&d.jsx("div",{className:"error",children:s}),t?d.jsx(dA,{instances:t,emptyLabel:e?Yde():she()}):d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",cl()]})]})}const hA=["projects","harnesses","storage"],fot=[{id:"compute",label:j9(),icon:d.jsx(JGe,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:D2(),icon:d.jsx(rE,{size:15}),activeTabs:["environment"]},{id:"settings",label:M9(),icon:d.jsx(nWe,{size:15}),activeTabs:["settings",...hA]}];function dot(e){return hA.includes(e)}function hot({tab:e,project:n,githubPublicationError:t,onProjectUpdate:r,onSelectTab:s}){const a=e==="settings"||dot(e);return d.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:M9()}),d.jsxs("div",{className:"settings-stack mt-4.5",children:[d.jsx("section",{className:Xc,children:d.jsx(Zat,{})}),d.jsx("section",{className:Xc,children:d.jsx(not,{})}),d.jsx("section",{className:Xc,children:d.jsx(yat,{})}),d.jsx("section",{className:Xc,children:d.jsx(oot,{})}),d.jsx("section",{className:Xc,children:d.jsx(eot,{})}),d.jsx("section",{className:Xc,children:d.jsx(Jat,{})})]})]}),e==="compute"&&d.jsx(Fat,{project:n,onViewHistory:()=>s("instances")}),e==="instances"&&d.jsx(uot,{projectId:n==null?void 0:n.id,onBack:()=>s("compute")}),e==="environment"&&d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:D2()}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:hDe()}),d.jsx(Xat,{})]}),e==="git"&&d.jsx(sot,{project:n,publicationError:t,onProjectUpdate:r})]})}function _ot({skills:e,activeIndex:n,onPick:t,onHover:r}){return d.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((s,a)=>d.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-start py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(s)},onMouseEnter:()=>r(a),children:[d.jsxs("span",{className:"skill-name flex items-center gap-1.5",children:["/",s.name,s.source!=="command"&&d.jsx("span",{className:"inline-flex h-4 items-center rounded-full border border-border-variant bg-canvas px-1.5 text-2xs font-semibold tracking-[0.05em] text-muted",children:"SKILL"})]}),d.jsx("span",{className:"skill-desc",children:s.description})]},s.name))})}var gy=QC();const z8={name:"plan",description:mye(),source:"command"};function db(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(;r1&&/[ \t]$/.test(a)&&(a=a.replace(/[ \t]+$/,_=>_.includes(" ")||_.length>=r?_:s));let o=e.slice(n.end);if(!o)o=s;else if(!o.startsWith(` -`)){const _=(c=/^[ \t]+/.exec(o))==null?void 0:c[0];o=_?`${_.length>=r?_:s}${o.slice(_.length)}`:s+o}const l=((f=/^[ \t]+/.exec(o))==null?void 0:f[0].length)??0;return{text:`${a}/${t}${o}`,cursor:a.length+t.length+1+l}}function j8(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 mot(e,n){const t=e.filter(r=>r.name.toLowerCase()!==z8.name);return n?[z8,...t]:t}function got(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function bot(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const vot=["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"],hb=new Map;function xot(e,n){const t=`${n}\0${e}`,r=hb.get(t);if(r)return r;const s=LKe(e,n).catch(a=>{throw hb.delete(t),a});return hb.set(t,s),s}function _A(e,n,t,r,s,a=!1){let o=0;return pot(e,n).map((l,c)=>{const f=o+l.text.length;o=f;const _=l.text.slice(1).toLowerCase();return l.command&&s?s(l.text,_,f,c):l.command?d.jsxs("span",{className:t,onMouseDown:void 0,children:[d.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),l.text.slice(1)]},c):a?d.jsx("span",{"aria-hidden":"true",children:l.text},c):d.jsx(R.Fragment,{children:l.text},c)})}function yot({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:a}){const o=R.useRef(null),l=R.useRef(null),c=R.useRef(null),f=R.useId(),[_,h]=R.useState(!1),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState({}),w=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},y=()=>{const N=o.current;if(!N)return;const T=N.getBoundingClientRect(),j=Math.min(420,window.innerWidth-32),D=Math.max(16,Math.min(T.left-4,window.innerWidth-j-16));b(T.top>300?{bottom:window.innerHeight-T.top+12,left:D,width:j}:{left:D,top:T.bottom+12,width:j})},C=()=>{w(),y(),h(!0),!(m!==null||S)&&(k(!0),xot(n,s).then(g).catch(()=>g(null)).finally(()=>k(!1)))},z=()=>{w(),c.current=window.setTimeout(()=>h(!1),120)};return R.useEffect(()=>()=>w(),[]),R.useEffect(()=>{if(!_)return;const N=()=>y();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[_]),d.jsxs(R.Fragment,{children:[d.jsxs("span",{ref:o,role:"button",tabIndex:0,"aria-controls":f,"aria-expanded":_,"aria-label":vO({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 cursor-text rounded-md bg-background text-[var(--skill-blue)]",onMouseEnter:C,onMouseLeave:z,onFocus:C,onBlur:z,onKeyDown:N=>{var T,j;if(N.key==="Escape"){h(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),C();return}_&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(T=l.current)==null||T.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),_&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(j=l.current)==null||j.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var T,j;N.preventDefault(),(T=a.current)==null||T.focus(),(j=a.current)==null||j.setSelectionRange(t,t),w()},children:[d.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-[var(--skill-blue-subtle)] opacity-0 transition-opacity group-hover/skill:opacity-100"}),d.jsxs("span",{className:"relative z-1",children:[d.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),e.slice(1)]})]}),_&&gy.createPortal(d.jsxs("div",{id:f,ref:l,role:"dialog","aria-label":ZO({name:n}),style:{...v,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-[0_8px_24px_rgba(0,_0,_0,_0.14)]",onMouseEnter:w,onMouseLeave:z,onFocus:w,onBlur:z,onMouseDown:N=>N.stopPropagation(),children:[d.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:[d.jsxs("span",{className:"text-md font-medium text-muted",children:["/",n]}),d.jsx("span",{className:"inline-flex h-4 items-center rounded-full border border-border-variant bg-canvas px-1.5 text-2xs font-semibold tracking-[0.05em] text-muted",children:iIe()})]}),d.jsx("div",{className:"p-4 text-sm text-text",children:S&&m===null?d.jsx("span",{className:"text-muted",children:cIe()}):d.jsx(ga,{text:m??r.description})})]}),document.body)]})}function wot({text:e,isCommand:n}){return d.jsx(d.Fragment,{children:_A(e,n,"skill-chip mx-1 inline-flex items-center rounded-md px-2 py-1 font-medium text-[var(--skill-blue)] transition-colors hover:bg-[var(--skill-blue-subtle)]")})}function Sot({text:e,isCommand:n,skills:t,projectId:r,textareaRef:s}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=s.current,l=a.current;if(!o||!l)return;const c=()=>{const _=getComputedStyle(o);for(const h of vot)l.style.setProperty(h,_.getPropertyValue(h));l.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};c();const f=new ResizeObserver(c);return f.observe(o),()=>f.disconnect()},[e,s]),R.useLayoutEffect(()=>{const o=s.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[s,e]),d.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:[_A(e,n,"",void 0,(o,l,c,f)=>{const _=t.find(h=>h.name===l);return _&&_.source!=="command"?d.jsx(yot,{label:o,name:l,end:c,skill:_,projectId:r,textareaRef:s},`${f}:${c}`):d.jsxs("span",{"aria-hidden":"true",className:"bg-background text-[var(--skill-blue)]",children:[d.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),o.slice(1)]},`${f}:${c}`)},!0),"​"]})}function kot(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Gv=6.5,T8=2*Math.PI*Gv;function Cot({usage:e}){return!e||e.usedTokens<=0?null:d.jsx(Eot,{usage:e})}function Eot({usage:e}){const{open:n,setOpen:t,ref:r}=_o(),{usedTokens:s,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(s/a*100)):null,l=o===null?"var(--accent)":kot(o),c=o===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(o/100);return d.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[d.jsx("button",{type:"button",className:`${o===null?`${Kd} px-1`:sv} composer-bare context-ring text-md text-text`,title:xie(),onClick:()=>t(f=>!f),children:o===null?x_(s):d.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"8",r:Gv,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),d.jsx("circle",{cx:"8",cy:"8",r:Gv,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${T8*Math.max(o,2)/100} ${T8}`,transform:"rotate(-90 8 8)"})]})}),n&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[d.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[d.jsx("span",{children:mie()}),d.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?kie({value:je(x_(s))}):zie({used:je(x_(s)),total:je(x_(a)),percent:je(c)})})]}),o!==null&&d.jsx(iA,{value:s,max:a,fillColor:l})]})]})}const by="orx:demo-read-sessions";function pA(){try{const e=JSON.parse(sessionStorage.getItem(by)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function Not(e){try{const n=pA();n.add(e),sessionStorage.setItem(by,JSON.stringify([...n]))}catch{}}function zot(){try{sessionStorage.removeItem(by)}catch{}}function Aot(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 jot(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 Tot(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,l),f=c===-1?e.length:c,_=e.slice(l,f),d=Pv(_),m=l+d.offset,g=Au(e,m,t);if(d.quoteDepth===o.quoteDepth&&!d.hasListMarker&&d.indentation>=o.listIndent&&d.indentation<=o.listIndent+3&&g>=r&&/^[ \t\r]*$/.test(e.slice(m+g,f)))return c===-1?e.length:c+1;if(c===-1)return e.length;l=c+1}return e.length}function bat(e,n,t){const r=Au(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function xat(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 wat(e,{predictMath:n=!1}={}){const t=xat(e),r=new Set,s=new Set;for(let f=0;f`$$${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}`)),wat(t,n)}function nA(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 Cat(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function ir(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=Cat(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const Eat=1e5;function Nat({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx("button",{className:"md-code-copy absolute top-1.5 end-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:b9(),"aria-label":Dde(),onClick:s,children:t?h.jsx(ds,{size:13}):h.jsx(op,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:pat(e,n,Eat)})})]})}function zat(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 y8(e,n,t){let r=n.line,s=n.column;for(let a=0;a]*?)\/?>/gi,r=[];let s=0,a=!1;for(const o of n.matchAll(t)){const l=(o[1]??"").toLowerCase(),c=zat(o[2]??"");if(!c[l==="run"?"id":"path"])continue;a=!0,o.index>s&&r.push({type:"text",value:n.slice(s,o.index),position:ub(e,s,o.index)});const _=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:c},position:ub(e,o.index,_),type:l==="run"?"runMention":"fileMention"}),s=_}return a?(srA(e)}function jat(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=pN(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function S8({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,a=n&&Number.parseInt(n,10)||void 0,o=a!=null?`${s}:${a}`:s;return h.jsxs("button",{className:"file-chip",title:r?JL({path:Ae(e)}):e,...ir(l=>r==null?void 0:r(e,a,t,void 0,l)),disabled:!r,children:[h.jsx(J9,{size:12}),h.jsx("span",{className:"file-chip-label",children:o}),h.jsx(sE,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function Tat({id:e,label:n,onOpenRun:t}){return h.jsxs("button",{className:"file-chip run-chip",title:t?_O({id:Ae(e)}):PO({id:Ae(e)}),...ir(r=>t==null?void 0:t(e,r)),disabled:!t,children:[h.jsx(W2,{size:12}),h.jsx("span",{className:"file-chip-label",children:n||q9()}),h.jsx(sE,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const sA={singleDollarTextMath:!0},Mat=ux().use(gx).use(Vz).use(Wz,sA).use(Aat).use(j0).use(jat).use(yz);function Rat(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const iA={code:({node:e,className:n,children:t,...r})=>{const s=n??"",a=/language-(\w+)/.exec(s),o=String(t??"").replace(/\n$/,"");if(!(a!=null||o.includes(` +`)))return h.jsx("code",{className:s,...r,children:t});const c=a?Hv(a[1]):null;return h.jsx(Nat,{code:o,lang:c})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},ga=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:a,predict:o=!1}){const l=R.useMemo(()=>({"file-mention":c=>h.jsx(S8,{path:c.path,lines:c.lines,exp:c.exp,onOpenFile:t}),"run-mention":c=>h.jsx(Tat,{id:c.id,label:c.label,onOpenRun:r}),a:({node:c,href:f,children:_,...d})=>{if(f&&Rat(f)&&t){let m;try{m=decodeURI(f)}catch{return h.jsx("span",{children:_})}const g=s?s(m):m;return g?h.jsx(S8,{path:g,onOpenFile:t}):h.jsx("span",{children:_})}return h.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:c,...f})=>h.jsx("th",{dir:"auto",...f}),td:({node:c,...f})=>h.jsx("td",{dir:"auto",...f}),img:({node:c,src:f,alt:_,className:d,...m})=>{if(!f||typeof f!="string")return null;const g=a?a(f):f;return g?h.jsx("img",{...m,src:g,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...iA}),[t,r,s,a]);return h.jsx("div",{dir:"auto","data-streaming":o||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]: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-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-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:h.jsx(Ket,{content:nA(n,{predictMath:o}),processor:Mat,components:l,predict:o})})}),k8=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-ss-none [&_.plan-strip-caret]:rounded-es-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-s [&_.plan-strip-caret]:border-s-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function Dat({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:a,onRevise:o}){const[l,c]=R.useState(!1),f=R.useRef(null),[_,d]=R.useState(!1),[m,g]=R.useState(""),S=R.useRef(null);R.useEffect(()=>{if(!l)return;const v=b=>{f.current&&!f.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[l]),R.useEffect(()=>{var v;_&&((v=S.current)==null||v.focus())},[_]);const k=()=>{o(m.trim()||"no specific feedback — use your judgment"),g(""),d(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(W2,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{dir:"auto",className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?v4e({agent:Ae(n)}):p4e({agent:Ae(n)})}),h.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...ir(t),children:T4e()})]}),_?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{dir:"auto",ref:S,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:W4e(),rows:2,value:m,onChange:v=>g(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),g(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),h.jsxs("div",{className:k8,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>{g(""),d(!1)},children:S4e()}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:k,children:[$4e(),h.jsx(Y9,{size:13})]})]})]}):h.jsxs("div",{className:k8,children:[h.jsx("button",{className:"btn-ghost",onClick:a,children:L4e()}),h.jsx("button",{className:"btn-ghost",onClick:()=>d(!0),children:U4e()}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),s?h.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:f,children:[h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:r4e()}),h.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":N4e(),onClick:()=>c(v=>!v),children:h.jsx(ya,{size:13})}),l&&h.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-start [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:h.jsx("button",{onClick:()=>{c(!1),r("bypassPermissions")},children:o4e()})})]}):h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:f4e()})]})]})}function aA(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{let s=!1;const a=XXe(o=>{s=!0,n(o)});return RKe().then(o=>!s&&n(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:t,apply:n}}function Lat(){const{status:e}=aA(),[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||n===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(Gh,{size:13,className:"shrink-0 text-subtext"}),h.jsx("span",{className:"min-w-0",children:Dqe({version:Ae(r)})}),h.jsx("button",{type:"button",className:"ms-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":Bqe(),onClick:()=>t(r),children:h.jsx(Yr,{size:13})})]})}const oA="orx:theme";function Oat(){try{const e=localStorage.getItem(oA);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let yh=Oat();const Uv=new Set;function Iat(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function py(){document.documentElement.dataset.theme=Iat(yh)}function Bat(e){yh=e;try{localStorage.setItem(oA,e)}catch{}py();for(const n of Uv)n()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{yh==="system"&&py()});py();function $at(e){return Uv.add(e),()=>Uv.delete(e)}function Hat(){return[R.useSyncExternalStore($at,()=>yh,()=>yh),Bat]}function Fat({save:e,onSaved:n,placeholder:t,createHref:r}){const[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null);async function _(d){if(d.preventDefault(),!(o||!s.trim())){l(!0),f(null);try{n(await e(s.trim())),a("")}catch(m){f(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[h.jsx("input",{type:"password",value:s,onChange:d=>a(d.target.value),placeholder:t,autoComplete:"off"}),h.jsx("button",{type:"submit",className:Wn,disabled:o||!s.trim(),children:o?xa():ac()}),h.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:Xfe()}),c&&h.jsx("div",{className:"error",children:c})]})}function Pat({cmd:e}){const[n,t]=R.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:Qr,children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?v0():lL({value:Ae(e)}),title:n?v0():b9(),children:n?h.jsx(ds,{size:11,strokeWidth:3}):h.jsx(op,{size:11})})]})}function Op(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?h.jsx(Pat,{cmd:n},t):n):null}const Uat="/assets/slurm-logo-aGSXVZcE.svg",qat="/assets/thinking-machines-BOdslTfm.png";function Gat(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 m9();case"tinker_job":return"Tinker";default:return e||"—"}}function Vat({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),h.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),h.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),h.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Wat({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),h.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),h.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),h.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),h.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),h.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),h.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Kat({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Xat({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Yat({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Zat({size:e=16}){return h.jsx("img",{className:"tinker-logo block flex-none object-contain",src:qat,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 Qat({size:e=16}){return h.jsx("img",{className:"block flex-none object-contain",src:Uat,width:e,height:e,alt:"","aria-hidden":"true"})}function Ip({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Bp({kind:e,size:n=16}){switch(e){case"modal_job":return h.jsx(Wat,{size:n});case"hf_job":return h.jsx(Vat,{size:n});case"k8s_job":return h.jsx(Kat,{size:n});case"ssh_job":return h.jsx(_7,{size:n,strokeWidth:1.5});case"slurm_job":return h.jsx(Qat,{size:n});case"ray_job":return h.jsx(Xat,{size:n});case"openresearch_job":return h.jsx(Yat,{size:n});case"tinker_job":return h.jsx(Zat,{size:n});case"local_job":return h.jsx(lWe,{size:n,strokeWidth:1.5});default:return h.jsx(_7,{size:n})}}function my({backend:e}){const n=Z2(e),t=FXe(e);return n?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(Bp,{kind:n}),h.jsx("span",{className:"backend-name",children:Gat(n)}),t&&h.jsx("span",{className:`backend-detail ${Qr}`,children:t})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function lA({value:e,max:n,label:t,caption:r,fillColor:s}){const a=n>0?Math.min(100,Math.round(e/n*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:s}})}),(t!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:t??`${a}%`}),r]})]})}function qv({harness:e,size:n=16}){const t=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?h.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const cA=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),C8=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),Yf={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function Jat(e){var r,s;const n=e.find(a=>a.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:k0(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:hp(n,t).defaultId}}function _o(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||t(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",a,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function eot({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:c,lockHarness:f=!1}){var ve,ce,re,F,oe,ue;const[_,d]=R.useState([]),m=R.useRef(null),g=R.useRef(null),{open:S,setOpen:k,ref:v}=_o(m),[b,w]=R.useState(""),[y,C]=R.useState("root"),z=()=>{k(!1),C("root"),w("")};R.useEffect(()=>{var he;S&&(y==="reasoning"||y==="speed"||y==="permissions")&&((he=g.current)==null||he.focus())},[S,y]),R.useEffect(()=>{let he=!0;const me=(Re=!1)=>C0(Re).then(He=>{he&&(d(He),c==null||c(He))}).catch(()=>{});me();const Ee=J2(()=>void me(!0));return()=>{he=!1,Ee()}},[]);const N=R.useMemo(()=>{const he=b.trim().toLowerCase();return(f&&e?_.filter(Ee=>Ee.id===e.harness):_).map(Ee=>{let Re=Ee.models;return he?Re=Re.filter(He=>He.id.toLowerCase().includes(he)):Ee.id==="opencode"&&(Re=Re.slice(0,6)),{harness:Ee,models:Re,hidden:he?0:Ee.models.length-Re.length}})},[_,b,f,e]),T=(he,me)=>{var Re;const Ee=(e==null?void 0:e.harness)===he.id;n({harness:he.id,model:me,serviceTier:k0(he,me,Ee?e==null?void 0:e.serviceTier:null),permissionMode:Ee?e.permissionMode:((Re=he.options)==null?void 0:Re.defaultPermissionMode)??null,reasoningLevel:xE(he,me,Ee?e.reasoningLevel:null)}),z()},j=(e==null?void 0:e.model)!=null?(ve=_.find(he=>he.id===e.harness))==null?void 0:ve.models.find(he=>he.id===e.model):void 0,D=e?e.model?j?w0(j):yE(e.model):I6():v1(),I=(e==null?void 0:e.reasoningLevel)??o??((ce=a[0])==null?void 0:ce.id),L=(re=a.find(he=>he.id===I))==null?void 0:re.label,P=(e==null?void 0:e.permissionMode)??r??((F=t[0])==null?void 0:F.id),q=(oe=t.find(he=>he.id===P))==null?void 0:oe.label,W=(e==null?void 0:e.harness)==="opencode"?q_e():s_e(),Z=_.find(he=>he.id===(e==null?void 0:e.harness)),X=vE(Z,e==null?void 0:e.model),J=k0(Z,e==null?void 0:e.model,e==null?void 0:e.serviceTier),ee=(ue=X.find(he=>he.id===J))==null?void 0:ue.label,$=he=>{l==null||l(he),z()},B=he=>{s==null||s(he),z()},H=he=>{e&&n({...e,serviceTier:he}),z()},K=(he,me,Ee)=>h.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-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(Ee),children:[h.jsx("span",{className:"flex-1",children:he}),me&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:me}),h.jsx(wa,{size:14,className:"shrink-0 text-muted"})]}),G=he=>h.jsxs("button",{ref:g,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[h.jsx(W9,{size:15}),he]}),ie=(he,me,Ee,Re)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:he.map(He=>h.jsxs("button",{className:Zr,onClick:()=>Re(He.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[He.label,He.id===Ee&&h.jsxs("span",{className:"font-normal text-muted",children:[" ",y9()]})]}),He.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:He.description})]}),He.id===me&&h.jsx(ds,{size:13})]},He.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:v,children:[h.jsxs("button",{ref:m,type:"button",className:`${Kh} composer-pill min-w-0 max-w-full gap-[5px] px-2 text-md text-text whitespace-nowrap`,title:VD({label:`${D}${L?` · ${L}`:""}${ee?` · ${ee}`:""}`}),"aria-haspopup":"menu","aria-expanded":S,onClick:()=>{S?z():(C("root"),k(!0))},children:[J==="priority"?h.jsx(tKe,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?h.jsx(qv,{harness:e.harness,size:14}):null,J==="priority"&&h.jsxs("span",{className:"sr-only",children:[l_e()," "]}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,L&&h.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:L})]}),h.jsx(ya,{size:14,className:"shrink-0 text-muted"})]}),S&&h.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-[0_10px_26px_rgba(0,_0,_0,_0.16)] 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:[y==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[K(v1(),D,"models"),a.length>0&&K(W,L,"reasoning"),X.length>0&&K($6(),ee,"speed"),t.length>0&&K(B6(),q,"permissions")]}),y==="models"&&h.jsxs(h.Fragment,{children:[G(v1()),h.jsx("input",{autoFocus:!0,type:"text",placeholder:E_e(),value:b,onChange:he=>w(he.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[N.map(({harness:he,models:me,hidden:Ee})=>h.jsxs("div",{className:"[&_.model-item]:ps-6",children:[h.jsxs("div",{className:cA,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(qv,{harness:he.id,size:14}),he.name]}),!he.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(d7,{size:10})," ",w9()]})]}),he.agentReady?h.jsxs(h.Fragment,{children:[he.models.length===0&&h.jsxs("button",{className:Zr,onClick:()=>T(he,null),children:[h.jsxs("span",{children:[I6(),h.jsx("span",{className:"model-id",children:x9()})]}),(e==null?void 0:e.harness)===he.id&&(e==null?void 0:e.model)===null&&h.jsx(ds,{size:13})]}),me.map(Re=>h.jsxs("button",{className:Zr,title:Re.id,onClick:()=>T(he,Re.id),children:[h.jsx("span",{children:w0(Re)}),(e==null?void 0:e.harness)===he.id&&(e==null?void 0:e.model)===Re.id&&h.jsx(ds,{size:13})]},Re.id)),Ee>0&&h.jsx("div",{className:C8,children:b_e({count:$t(Ee)})}),b.trim().length>0&&!he.models.some(Re=>Re.id===b.trim())&&h.jsx("button",{className:Zr,onClick:()=>T(he,b.trim()),children:h.jsx("span",{children:H_e({id:Ae(b.trim())})})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:he.agentNote?Op(he.agentNote):w_e()})]},he.id)),_.length===0&&h.jsx("div",{className:C8,children:e_e()})]}),f&&e&&_.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(d7,{size:11}),j_e()]})]}),y==="reasoning"&&h.jsxs(h.Fragment,{children:[G(W),ie(a,I,o,$)]}),y==="permissions"&&h.jsxs(h.Fragment,{children:[G(B6()),ie(t,P,r,B)]}),y==="speed"&&h.jsxs(h.Fragment,{children:[G($6()),ie(X,J??void 0,"default",H)]})]})]})}function wh({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:a=!1,disabled:o=!1,variant:l="pill",title:c,numbered:f=!1,renderIcon:_,onSelect:d}){var N,T;const{open:m,setOpen:g,ref:S}=_o();if(e.length===0)return null;const k=n??t??((N=e[0])==null?void 0:N.id)??null,v=e.find(j=>j.id===k),b=e.find(j=>j.id===t),w=l==="bare"&&(b==null?void 0:b.id)===S0?b:void 0,y=w?e.filter(j=>j.id!==w.id):e,C=(v==null?void 0:v.label)??((T=e[0])==null?void 0:T.label)??"",z=j=>{d(j),g(!1)};return h.jsxs("div",{className:`option-picker relative inline-flex${l==="field"?" w-full":""}`,ref:S,children:[h.jsxs("button",{type:"button",className:l==="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":`${Kh} ${l==="pill"?"composer-pill gap-[5px] px-2 text-md text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-md text-text"}`,title:c,"aria-haspopup":"menu","aria-expanded":m,disabled:o,onClick:()=>g(j=>!j),children:[h.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[v&&(_==null?void 0:_(v)),h.jsx("span",{className:"truncate",children:C})]}),h.jsx(ya,{size:12})]}),m&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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":""} ${l==="field"?"min-w-full":""} ${s==="right"?"align-right":""} ${a?"drop-down":""}`,children:[r&&h.jsx("div",{className:cA,children:r}),w&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:Zr,onClick:()=>z(w.id),children:[h.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(w),h.jsxs("span",{children:[w.label,h.jsx("span",{className:"option-default text-muted font-normal",children:x9()})]})]}),k===w.id&&h.jsx(ds,{size:13})]}),h.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),y.map((j,D)=>h.jsxs("button",{type:"button",className:Zr,onClick:()=>z(j.id),children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(j),h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[j.label,!w&&j.id===t&&h.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",y9()]})]}),j.description&&h.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:j.description})]})]}),k===j.id?h.jsx(ds,{size:13}):f&&h.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:D+1})]},j.id))]})]})}const E8={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function tot(e){return E8[e]??E8.idle}const not={done:nFe,failed:uFe,running:bFe,starting:wFe,cancelling:QHe,cancelled:KHe,editing:aFe,idle:_Fe};function uA(e){const n=not[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function no({status:e,label:n}){const t=tot(e);return h.jsxs("span",{className:`${tx} ${t.className}${t.live?" live":""}`,children:[h.jsx("span",{className:"dot"}),n??uA(e)]})}const ao=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),ju=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),fc=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-md text-text","[&_.k]:font-medium [&_.k]:text-md [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-md [&_.v]:text-text [&_.v]:break-words"].join(" "),gy="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-md leading-relaxed text-text whitespace-pre-wrap",qr=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),rd=["form font-sans text-md text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-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-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]: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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-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-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-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 [&_.new-project-actions_.primary]:ms-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Qa=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),Gv=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),a0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Xc=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function fb(e){return e.agentReady?{cls:"ok",label:O9()}:e.installed?e.installBroken?{cls:"warn",label:RNe()}:e.authState==="unknown"?{cls:"warn",label:ADe()}:e.authState==="unsupported"?{cls:"warn",label:ODe()}:{cls:"warn",label:Qje()}:{cls:"warn",label:Mje()}}function rot({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?Rke():S9()}):h.jsx(h.Fragment,{children:"—"})}function sot(){const[e,n]=R.useState(null),[t,r]=R.useState("claude-code"),[s,a]=R.useState(!1),o=(c,f=!1)=>{a(!0),C0(c,f).then(n).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>J2(()=>o(!0)),[]);const l=e==null?void 0:e.find(c=>c.id===t);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:tNe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:m9e()}),h.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(c=>h.jsxs("button",{className:c.id===t?"active":"",onClick:()=>r(c.id),children:[c.name,h.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${fb(c).cls}`})]},c.id))}),e?l?h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:`${gr} ${fb(l).cls}`,children:fb(l).label}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Zs,onClick:()=>o(!0,!0),disabled:s,children:[h.jsx(Gh,{size:12,className:s?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",$2()]})]}),h.jsxs("div",{className:ju,children:[h.jsx("span",{className:"k",children:kCe()}),h.jsx("span",{className:"v",children:l.binPath??gke()}),h.jsx("span",{className:"k",children:F9()}),h.jsx("span",{className:"v",children:l.version??"—"}),h.jsx("span",{className:"k",children:iCe()}),h.jsx("span",{className:"v",children:h.jsx(rot,{h:l})}),l.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:l.id==="opencode"?vLe():D2()}),h.jsx("span",{className:"v",children:l.account})]}),l.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:xTe()}),h.jsx("span",{className:"v",children:l.org})]}),l.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:nMe()}),h.jsx("span",{className:"v",children:l.plan})]}),h.jsx("span",{className:"k",children:Qke()}),h.jsx("span",{className:"v",children:l.models.length>0?R8e({count:$t(l.models.length),models:new Intl.ListFormat(E()).format(l.models.slice(0,4).map(c=>Ae(w0(c))))}):R2()})]}),!l.agentReady&&l.agentNote&&h.jsx("p",{className:qr,children:l.agentNote})]}):null:h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",bEe()]})]})}function iot({s:e}){if(!e.configured)return h.jsx("span",{className:gr,children:ip()});const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?h.jsx("span",{className:so,children:L2()}):h.jsx("span",{className:As,children:ZAe()}):h.jsx("span",{className:As,children:h9e()}):h.jsx("span",{className:As,children:bze()})}function aot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(""),[c,f]=R.useState(!1),[_,d]=R.useState(null),m=k=>{n(k),a(k.context??""),l(k.namespace)};R.useEffect(()=>{IKe().then(m).catch(k=>r(k instanceof Error?k.message:String(k)))},[]);const g=e!==null&&s===(e.context??"")&&o.trim()===e.namespace;async function S(k){if(k.preventDefault(),!c){f(!0),d(null);try{m(await BKe({context:s,namespace:o.trim()}))}catch(v){d(v instanceof Error?v.message:String(v))}finally{f(!1)}}}return h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:t9e()}),h.jsx("span",{className:"v",children:h.jsx(iot,{s:e})})]}),e.preflight.error&&h.jsx("p",{className:gy,children:e.preflight.error}),h.jsxs("form",{className:rd,onSubmit:S,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:[j9e(),h.jsx(wh,{choices:[{id:"",label:e.currentContext?USe({context:Ae(e.currentContext)}):$Se()},...s&&!e.contexts.includes(s)?[{id:s,label:yke({context:Ae(s)})}]:[],...e.contexts.map(k=>({id:k,label:k}))],value:s,variant:"field",dropDown:!0,disabled:c,onSelect:a})]}),h.jsxs("label",{children:[SAe(),h.jsx("input",{type:"text",value:o,onChange:k=>l(k.target.value),placeholder:J9e(),autoComplete:"off",spellCheck:!1})]})]}),_&&h.jsx("div",{className:"error",children:_}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:es,disabled:c||g,children:c?xa():ac()})})]}),h.jsxs("section",{className:"mt-7",children:[h.jsx("h3",{className:"mt-0 mx-0 mb-1.5 text-md font-semibold text-text",children:KMe()}),h.jsx("p",{className:"m-0 font-sans text-md leading-relaxed text-text",children:c8e({placeholder:Ae("{{ORX_RUN}}"),command:Ae("--manifest ")})})]})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",qCe()]})})}const oot={env:g8e,syncedEnv:A8e,modalToml:y8e};function lot({s:e}){return e.ready?h.jsx("span",{className:so,children:L2()}):!e.tokenConfigured&&!e.modalImportable?h.jsx("span",{className:gr,children:Kje()}):e.modalImportable?e.tokenConfigured?h.jsx("span",{className:gr,children:$9()}):h.jsx("span",{className:As,children:gje()}):h.jsx("span",{className:As,children:e.envProvisioned?C7e():A7e()})}function cot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{$Ke().then(n).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!s){a(!0),l(null);try{n(await HKe())}catch(f){l(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:ap()}),h.jsx("span",{className:"v",children:h.jsx(lot,{s:e})}),h.jsx("span",{className:"k",children:O2()}),h.jsx("span",{className:"v",children:e.modalImportable?B2():e.envProvisioned?d8e():uke()}),h.jsx("span",{className:"k",children:B9()}),h.jsx("span",{className:"v",children:e.tokenSource?oot[e.tokenSource]():ip()})]}),!e.tokenConfigured&&h.jsx("p",{className:qr,children:C8e({command:Ae("modal token new"),id:Ae("MODAL_TOKEN_ID"),secret:Ae("MODAL_TOKEN_SECRET")})}),e.error&&e.envProvisioned&&!e.modalImportable&&h.jsx("p",{className:qr,children:e.error}),o&&h.jsx("div",{className:"error",children:o}),!e.modalImportable&&h.jsx("div",{className:"mt-6 flex justify-end",children:h.jsx("button",{className:es,onClick:()=>void c(),disabled:s,children:s?COe():yOe()})})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",KCe()]})})}function uot({test:e}){if(e===void 0)return h.jsx("span",{className:"block text-start text-[12px] text-text",children:Cje()});if(e==="testing")return h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-text text-xs",role:"status",children:[h.jsx("span",{className:Dt,"aria-hidden":"true"})," ",F2()]});const n=e.missingTools??[],t=e.reachable?e.toolsFound?h.jsx("span",{className:so,children:B2()}):h.jsx("span",{className:As,children:n.length===1?I8e({tool:Ae(n[0])}):F8e()}):h.jsx("span",{className:As,children:I2()});return h.jsxs("div",{role:"status",children:[t,h.jsx("span",{className:"ssh-tested-at block mt-2 text-[12px] text-text",children:Gi(e.testedAt)})]})}function fot(){const[e,n]=R.useState(null),[t,r]=R.useState({}),[s,a]=R.useState({});R.useEffect(()=>{VKe().then(n).catch(()=>n([]))},[]);async function o(c){r(f=>({...f,[c]:"testing"}));try{const f=await WKe(c);r(_=>({..._,[c]:f})),f.error&&a(_=>({..._,[c]:!0}))}catch(f){r(_=>({..._,[c]:{reachable:!1,toolsFound:!1,missingTools:[],error:f instanceof Error?f.message:String(f),testedAt:Date.now()}})),a(_=>({..._,[c]:!0}))}}function l(c,f){a(_=>({..._,[c]:!f}))}return h.jsx(h.Fragment,{children:e===null?h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",bMe()]}):e.length===0?h.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:WAe()}):h.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:e.map(c=>{const f=t[c.host]??c.lastTest,_=f==="testing",d=s[c.host]??!1,m=`${c.user?`${c.user}@`:""}${c.hostname??c.host}${c.port?`:${c.port}`:""}`;return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-3 py-3 px-2 cursor-pointer transition-colors duration-120 ease-standard [&:hover]:bg-surface",onClick:()=>l(c.host,d),children:[h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[h.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":d,"aria-label":d?YD({name:Ae(c.host)}):bL({name:Ae(c.host)}),onClick:g=>{g.stopPropagation(),l(c.host,d)},children:h.jsx(ya,{size:15,className:`text-muted transition-transform duration-120 ease-standard${d?" rotate-180":""}`})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"truncate text-base font-medium text-text",title:c.host,children:c.host}),h.jsx("div",{className:"mt-1 truncate font-mono text-sm text-muted",title:m,children:m})]})]}),h.jsxs("div",{className:"grid flex-none grid-cols-[6rem_5rem] items-center gap-x-[clamp(1rem,2vw,2.5rem)]",children:[h.jsx("div",{className:"text-start",children:h.jsx(uot,{test:f})}),h.jsx("button",{type:"button",className:`${Zs} justify-self-end`,onClick:g=>{g.stopPropagation(),o(c.host)},disabled:_,children:_?GOe():f?iOe():FOe()})]})]}),d&&h.jsx("div",{className:"border-t border-t-border-variant py-3 pe-2 ps-10",children:h.jsxs("dl",{className:"m-0 grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2",children:[h.jsx("dt",{className:"text-sm font-medium text-subtext",children:yNe()}),h.jsx("dd",{className:`m-0 text-sm text-text wrap-anywhere${c.identityFile?" font-mono":""}`,children:c.identityFile??ROe()}),f!=="testing"&&(f==null?void 0:f.error)&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{className:"text-sm font-medium text-subtext",children:wze()}),h.jsx("dd",{className:"m-0 text-sm leading-relaxed text-text whitespace-pre-wrap wrap-anywhere",children:f.error})]})]})})]},c.host)})})})}function hot({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:gr,children:F2()}):e.reachable?e.slurmFound?e.toolsFound?h.jsx("span",{className:so,children:B2()}):h.jsx("span",{className:As,children:oAe()}):h.jsx("span",{className:As,children:dje()}):h.jsx("span",{className:As,children:I2()})}function dot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(""),[c,f]=R.useState(""),[_,d]=R.useState(""),[m,g]=R.useState(!1),[S,k]=R.useState(null),[v,b]=R.useState(null),w=v!==null&&v!=="testing"?v:null,y=T=>{n(T),a(T.host??""),l(T.partition??""),f(T.account??""),d(T.timeLimit??"")};R.useEffect(()=>{KKe().then(y).catch(T=>r(T instanceof Error?T.message:String(T)))},[]);const C=e!==null&&s===(e.host??"")&&o.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&_.trim()===(e.timeLimit??"");async function z(T){if(T.preventDefault(),!m){g(!0),k(null);try{y(await XKe({host:s,partition:o.trim(),account:c.trim(),timeLimit:_.trim()}))}catch(j){k(j instanceof Error?j.message:String(j))}finally{g(!1)}}}async function N(T){b("testing");try{b(await YKe(T))}catch(j){b({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:j instanceof Error?j.message:String(j)})}}return h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[(w==null?void 0:w.error)&&h.jsx("p",{className:gy,children:w.error}),w&&w.partitions.length>0&&h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:KTe()}),h.jsx("span",{className:"v",children:w.partitions.join(", ")})]}),h.jsxs("form",{className:rd,onSubmit:z,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:[Jze(),h.jsx(wh,{choices:[{id:"",label:qje()},...s&&!e.hosts.some(T=>T.host===s)?[{id:s,label:`${s} (not in ~/.ssh/config)`}]:[],...e.hosts.map(T=>({id:T.host,label:T.host}))],value:s,variant:"field",dropDown:!0,disabled:m,onSelect:T=>{a(T),b(null)}})]}),h.jsxs("label",{children:[qTe(),h.jsx("input",{type:"text",list:"slurm-partitions",value:o,onChange:T=>l(T.target.value),placeholder:i7(),autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(T=>h.jsx("option",{value:T},T))})]})]}),h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:[D2(),h.jsx("input",{type:"text",value:c,onChange:T=>f(T.target.value),placeholder:i7(),autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{children:[wDe(),h.jsx("input",{type:"text",value:_,onChange:T=>d(T.target.value),placeholder:l9e(),autoComplete:"off",spellCheck:!1})]})]}),S&&h.jsx("div",{className:"error",children:S}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:es,disabled:m||C,children:m?xa():ac()}),h.jsx("button",{type:"button",className:Wn,onClick:()=>void N(s),disabled:!s||v==="testing",title:s?void 0:pLe(),children:I9()}),h.jsx(hot,{test:v})]})]})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",Ize()]})})}function _ot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),[_,d]=R.useState(null),m=_!==null&&_!=="testing"?_:null,g=b=>{n(b),a(b.address??"")};R.useEffect(()=>{ZKe().then(g).catch(b=>r(b instanceof Error?b.message:String(b)))},[]);const S=e!==null&&s===(e.address??"");async function k(b){if(b.preventDefault(),!o){l(!0),f(null);try{g(await QKe({address:s}))}catch(w){f(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function v(){d("testing");try{d(await JKe(s.trim()||void 0))}catch(b){d({reachable:!1,address:s.trim()||"(unknown)",rayVersion:null,error:b instanceof Error?b.message:String(b)})}}return h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:EEe()}),h.jsx("span",{className:"v",children:e.resolvedAddress}),h.jsx("span",{className:"k",children:H2()}),h.jsx("span",{className:"v",children:e.source}),(m==null?void 0:m.reachable)&&m.rayVersion&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:uMe()}),h.jsx("span",{className:"v",children:m.rayVersion})]})]}),(m==null?void 0:m.error)&&h.jsx("p",{className:gy,children:m.error}),h.jsxs("form",{className:rd,onSubmit:k,children:[h.jsxs("label",{children:[nze(),h.jsx("input",{type:"text",value:s,onChange:b=>{a(b.target.value),d(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),c&&h.jsx("div",{className:"error",children:c}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:es,disabled:o||S,children:o?xa():ac()}),h.jsx("button",{type:"button",className:Wn,onClick:()=>void v(),disabled:_==="testing",children:I9()}),h.jsx(pot,{test:_})]})]})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",Rze()]})})}function pot({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:gr,children:F2()}):e.reachable?h.jsx("span",{className:so,children:_Me()}):h.jsx("span",{className:As,children:I2()})}function mot(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{nXe().then(n).catch(s=>r(s instanceof Error?s.message:String(s)))},[]),h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:dNe()}),h.jsx("span",{className:"v",children:e.hostname}),h.jsx("span",{className:"k",children:YRe()}),h.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),h.jsx("span",{className:"k",children:"CPU"}),h.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),h.jsx("span",{className:"k",children:"RAM"}),h.jsx("span",{className:"v",children:e.memBytes!==null?$i(e.memBytes):"—"}),h.jsx("span",{className:"k",children:"GPUs"}),h.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(s=>`${s.name}${s.memMib!==null?` — ${$i(s.memMib*1024*1024)}`:""}`).join(", ")})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",_Ee()]})})}function got(){const[e,n]=R.useState(null),[t,r]=R.useState(null);return R.useEffect(()=>{rXe().then(n).catch(s=>r(s instanceof Error?s.message:String(s)))},[]),h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?e.loggedIn?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:ap()}),h.jsx("span",{className:"v",children:h.jsx("span",{className:so,children:O9()})}),h.jsx("span",{className:"k",children:kTe()}),h.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:SRe()}),h.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?h.jsx("span",{className:so,children:nTe()}):e.sshKeyStatus==="no_local_match"?h.jsx("span",{className:_Ye,children:Hje()}):e.sshKeyStatus==="none_registered"?h.jsx("span",{className:As,children:yje()}):h.jsx("span",{className:gr,children:$9()})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?h.jsxs("p",{dir:"auto",className:qr,children:[qke()," ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):h.jsxs("p",{dir:"auto",className:qr,children:[cje()," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),aDe()," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?h.jsx("p",{dir:"auto",className:qr,children:SLe({register:Ae(`orx ssh-key add ${e.sshKeyPath}`),load:Ae("ssh-add")})}):h.jsxs("p",{dir:"auto",className:qr,children:[ije()," ",h.jsx("code",{children:"ssh-add"}),mTe()," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&h.jsx("p",{dir:"auto",className:qr,children:e.error})]}):h.jsx("p",{className:qr,children:t8e({command:Ae("orx login")})}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",HCe()]})})}const B0={local:m9,tinker:Rse,hf:nse,modal:dse,k8s:ase,ssh:Ase,slurm:Cse,ray:yse,openresearch:gse},bot={local:zre,ssh:Kre,tinker:Qre,hf:xre,modal:Mre,k8s:kre,slurm:qre,ray:Hre,openresearch:Ore},by={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"},vot={local:Gse,ssh:fie,tinker:pie,hf:Ise,modal:Xse,k8s:Fse,slurm:oie,ray:rie,openresearch:Jse};function xot(e){switch(e.id){case"local":return Vne();case"ssh":return hre({summary:Ae(e.summary)});case"tinker":return mre({summary:Ae(e.summary)});case"hf":return Bne({summary:Ae(e.summary)});case"modal":return Yne({summary:Ae(e.summary)});case"k8s":return Pne({summary:Ae(e.summary)});case"slurm":return lre({summary:Ae(e.summary)});case"ray":return sre({summary:Ae(e.summary)});case"openresearch":return ere({summary:Ae(e.summary)})}}function yot({target:e}){return h.jsxs("dl",{className:"m-0 mt-8 grid grid-cols-[9rem_minmax(0,1fr)] gap-x-5 gap-y-4 font-sans",children:[h.jsx("dt",{className:"text-md font-medium text-subtext",children:gNe()}),h.jsx("dd",{className:"m-0 text-md leading-relaxed text-text",children:xot(e)}),h.jsx("dt",{className:"text-md font-medium text-subtext",children:rLe()}),h.jsx("dd",{className:"m-0 text-md leading-relaxed text-text",children:vot[e.id]()})]})}const N8=["hf","modal","slurm","ray","openresearch"],hb=["hf","modal","openresearch"],fA={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"]},z8="__custom__";function Hf(e,n){return!!(n&&!(fA[e]??[]).includes(n))}function wot({settings:e,projectId:n,onSaved:t}){const r=e.configuredDefaultBackend??e.defaultBackend??"local",s=e.defaultFlavor??"",[a,o]=R.useState(r),[l,c]=R.useState(s),[f,_]=R.useState(Hf(r,s)),[d,m]=R.useState(!1),[g,S]=R.useState(null),k=e.targets.find(I=>I.id===a),v=e.targets.filter(I=>I.configured||I.id===r),b=N8.includes(a),w=hb.includes(a),y=fA[a]??[],C=a===r&&(!b||l.trim()===s),z=B0[a](),N=d?EIe():w&&!l.trim()?I6e({destination:z}):a==="ssh"?X8e():G8e({destination:z});R.useEffect(()=>{o(r),c(s),_(Hf(r,s))},[r,s]);async function T(I,L){const P=N8.includes(I);if(!(d||hb.includes(I)&&!L.trim())){m(!0),S(null);try{t(await tXe({backend:I,flavor:P&&L.trim()||null,projectId:n}))}catch(q){S(q instanceof Error?q.message:String(q)),o(r),c(s),_(Hf(r,s))}finally{m(!1)}}}function j(I){const L=e.targets.find(q=>q.id===I);if(!L)return;o(L.id);const P=L.id===r?s:"";c(P),_(Hf(L.id,P)),hb.includes(L.id)||T(L.id,P)}function D(I){if(I===z8){_(!0);return}_(!1),c(I),(!w||I)&&T(a,I)}return h.jsxs("section",{className:"mb-8",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:aEe()}),h.jsxs("div",{children:[h.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:I=>{I.preventDefault(),C||T(a,l)},children:[h.jsx(wh,{choices:v.map(I=>({id:I.id,label:B0[I.id]()})),value:a,variant:"field",dropDown:!0,disabled:d,renderIcon:I=>{const L=e.targets.find(P=>P.id===I.id);return L?h.jsx(Bp,{kind:by[L.id],size:16}):null},onSelect:j}),b&&h.jsx("div",{children:f?h.jsxs("div",{className:"relative",children:[h.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:l,onChange:I=>c(I.target.value),onBlur:()=>{if(w&&!l.trim()){a===r&&(c(s),_(Hf(r,s)));return}C||T(a,l)},placeholder:P9e(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:d}),h.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":s7(),title:s7(),onMouseDown:I=>I.preventDefault(),onClick:()=>_(!1),children:h.jsx(ya,{size:12})})]}):h.jsx(wh,{choices:[{id:"",label:w?R6e():rke()},...l&&!y.includes(l)?[{id:l,label:_7e({value:Ae(l)})}]:[],...y.map(I=>({id:I,label:I})),{id:z8,label:D9()}],value:l,variant:"field",dropDown:!0,disabled:d,onSelect:D})})]}),g&&h.jsx("div",{className:"error mt-2.5",children:g}),k&&!k.configured&&h.jsx("p",{className:qr,children:_De()})]}),h.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:N})]})}function Sot({target:e,isDefault:n,onOpen:t}){const r=e.unverified?C6e():e.id==="openresearch"?AOe():e.id==="ray"?J6e():gOe();return h.jsxs("button",{type:"button",className:"group flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans transition-colors duration-120 ease-standard hover:border-text hover:bg-surface disabled:cursor-default disabled:opacity-52",onClick:t,disabled:!e.enabled,children:[h.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:h.jsx(Bp,{kind:by[e.id],size:48})}),h.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:B0[e.id]()}),h.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-subtext",children:bot[e.id]()}),h.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-md",children:[h.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?y0():e.configured?BIe():r}),h.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:h.jsx(J_,{size:16})})]})]})}function kot({target:e,isDefault:n,onBack:t}){return h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back mb-10 inline-flex items-center gap-2 text-md font-medium text-subtext hover:text-text",onClick:t,children:[h.jsx(uh,{size:16})," ",M9()]}),h.jsxs("div",{className:"flex items-center justify-between gap-6",children:[h.jsxs("div",{className:`flex min-w-0 items-center ${e.id==="tinker"?"gap-8":"gap-5"}`,children:[h.jsx("span",{className:"flex h-20 w-24 flex-none items-center justify-start",children:h.jsx(Bp,{kind:by[e.id],size:72})}),h.jsx("h1",{className:"m-0 min-w-0",children:B0[e.id]()})]}),n&&h.jsx("span",{className:"inline-flex flex-none items-center rounded-sm border border-primary bg-primary-subtle py-px px-2 text-xs font-medium text-primary",children:y0()})]}),h.jsx(yot,{target:e}),e.id!=="tinker"&&h.jsxs("div",{className:"mt-8 font-sans text-md 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==="local"&&h.jsx(mot,{}),e.id==="hf"&&h.jsx(Aot,{}),e.id==="modal"&&h.jsx(cot,{}),e.id==="k8s"&&h.jsx(aot,{}),e.id==="ssh"&&h.jsx(fot,{}),e.id==="slurm"&&h.jsx(dot,{}),e.id==="ray"&&h.jsx(_ot,{}),e.id==="openresearch"&&h.jsx(got,{})]})]})}function Cot({project:e,onViewHistory:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(null),[c,f]=R.useState(null),_=R.useRef(0);R.useEffect(()=>{_.current++,r(null),l(null),a(null),f(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const y=++_.current;eXe(e==null?void 0:e.id).then(C=>{y===_.current&&(r(C),a(null))}).catch(C=>{if(y!==_.current)return;const z=C instanceof Error?C.message:String(C);r(N=>(N===null?a(z):f(z),N))})},[o,e==null?void 0:e.id]);const d=y=>{_.current++,r(y),f(null)},m=t?t.targets:null,g=(t==null?void 0:t.configuredDefaultBackend)??(t==null?void 0:t.defaultBackend),S=m?[...m].sort((y,C)=>+(C.id===g)-+(y.id===g)):null,k=(S==null?void 0:S.filter(y=>y.configured))??[],v=(S==null?void 0:S.filter(y=>!y.configured))??[],b=y=>h.jsx(Sot,{target:y,isDefault:g===y.id,onOpen:()=>l(y.id)},`${(e==null?void 0:e.id)??"none"}:${y.id}`),w=o?t==null?void 0:t.targets.find(y=>y.id===o):null;return w?h.jsx(kot,{target:w,isDefault:g===w.id,onBack:()=>l(null)}):h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:R9()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:S9e()}),h.jsx(Vot,{projectId:e==null?void 0:e.id,onViewHistory:n}),s?h.jsx("div",{className:"error",children:s}):t?h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:"error",children:c}),h.jsx(wot,{settings:t,projectId:e==null?void 0:e.id,onSaved:d}),h.jsxs("section",{className:"mb-8",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:AMe()}),h.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:k.map(b)})]}),v.length>0&&h.jsxs("section",{className:"mb-3.5",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fAe()}),h.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:v.map(b)})]})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",OCe()]})]})}const Eot={env:oSe,openresearchEnv:fSe,hfCache:rSe};function Not({settings:e}){return e.configured?e.valid?h.jsx("span",{className:so,children:L2()}):h.jsx("span",{className:As,children:KNe()}):h.jsx("span",{className:gr,children:ip()})}function zot({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?h.jsx("span",{className:so,children:uze()}):e.jobsWrite===!1?h.jsx("span",{className:As,children:tje()}):h.jsx("span",{className:gr,children:aze()})}function Aot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),_=R.useRef(!1);R.useEffect(()=>{TKe().then(m=>{_.current||n(m)}).catch(m=>{_.current||r(m instanceof Error?m.message:String(m))})},[]);async function d(m){if(m.preventDefault(),!(!s.trim()||o)){l(!0),f(null);try{const g=await MKe(s.trim());_.current=!0,n(g),r(null),a("")}catch(g){f(g instanceof Error?g.message:String(g))}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fc,children:[h.jsx("span",{className:"k",children:ap()}),h.jsx("span",{className:"v",children:h.jsx(Not,{settings:e})}),h.jsx("span",{className:"k",children:D2()}),h.jsx("span",{className:"v",children:e.username??"—"}),h.jsx("span",{className:"k",children:B9()}),h.jsx("span",{className:"v",children:e.maskedToken??"—"}),h.jsx("span",{className:"k",children:H2()}),h.jsx("span",{className:"v",children:e.source?Eot[e.source]():ip()}),h.jsx("span",{className:"k",children:QNe()}),h.jsxs("span",{className:"v",children:[h.jsx(zot,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&h.jsx("p",{className:qr,children:cNe()}),e.valid&&e.jobsWrite===null&&h.jsx("p",{className:qr,children:pSe({login:Ae("hf auth login"),url:Ae("huggingface.co/settings/tokens")})})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",Fze()]}),h.jsxs("form",{className:rd,onSubmit:d,children:[h.jsxs("label",{children:[e!=null&&e.configured?WLe():J8e(),h.jsx("input",{type:"password",value:s,onChange:m=>a(m.target.value),placeholder:iNe(),autoComplete:"off"})]}),c&&h.jsx("div",{className:"error",children:c}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:es,disabled:!s.trim()||o,children:o?DIe():ac()})})]})]})}const hA=/^hf_[A-Za-z0-9]{10,}$/;function dA(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{dir:"auto",className:qr,children:[bDe()," ",h.jsx("code",{children:"HF_TOKEN"}),aRe()]})})})}const A8=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function jot({name:e,entry:n,onVars:t,onError:r}){const[s,a]=R.useState(""),[o,l]=R.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!s.trim()||o)){l(!0);try{t(await pE(e,s.trim())),a("")}catch(d){c(d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await PKe(e))}catch(d){c(d)}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:Qr,children:e}),h.jsx("td",{className:`${Qr} muted text-muted`,children:n?h.jsxs(h.Fragment,{children:[n.maskedValue,n.inProcessEnv&&h.jsx("span",{className:gr,children:HTe()})]}):h.jsx("input",{className:Qr,type:"password",value:s,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&a("")},placeholder:H9(),"aria-label":sI({name:Ae(e)}),autoComplete:"new-password",disabled:o})}),h.jsx("td",{children:n?h.jsx("button",{className:vn,title:Wb({name:Ae(e)}),"aria-label":Wb({name:Ae(e)}),onClick:()=>void _(),disabled:o,children:h.jsx(Bu,{size:13})}):s.trim()&&h.jsx("button",{className:Zs,onClick:()=>void f(),disabled:o,children:o?xa():ac()})})]}),!n&&e!=="HF_TOKEN"&&hA.test(s.trim())&&h.jsx(dA,{})]})}function Tot({onVars:e,onError:n,onDone:t}){const[r,s]=R.useState(""),[a,o]=R.useState(""),[l,c]=R.useState(!1);async function f(){if(!(!r.trim()||!a.trim()||l)){c(!0);try{e(await pE(r.trim(),a.trim())),t()}catch(d){n(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!l&&t()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("input",{autoFocus:!0,className:Qr,type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":LAe(),autoComplete:"off",spellCheck:!1,disabled:l})}),h.jsx("td",{children:h.jsx("input",{className:Qr,type:"password",value:a,onChange:d=>o(d.target.value),onKeyDown:_,placeholder:H9(),"aria-label":$Ae(),autoComplete:"new-password",disabled:l})}),h.jsxs("td",{children:[h.jsx("button",{className:Zs,onClick:()=>void f(),disabled:l||!r.trim()||!a.trim(),children:l?xa():ac()}),h.jsx("button",{className:vn,title:zCe(),"aria-label":MCe(),onClick:t,disabled:l,children:h.jsx(Yr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&hA.test(a.trim())&&h.jsx(dA,{})]})}function Mot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{FKe().then(n).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{n(d),l(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!A8.includes(d)),_=[...A8,...f];return h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:OEe()}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Zs,onClick:()=>a(!0),disabled:s||e===null,children:[h.jsx(V2,{size:12})," ",Kke()]})]}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:R7e({path:Ae("~/.openresearch/env"),tinker:Ae("TINKER_API_KEY"),hf:Ae("HF_TOKEN"),wandb:Ae("WANDB_API_KEY")})}),t?h.jsx("div",{className:"error",children:t}):e===null?h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]}):h.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]: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 [&_.icon-btn:hover]:text-accent-red",children:h.jsxs("tbody",{children:[_.map(d=>h.jsx(jot,{name:d,entry:e.find(m=>m.key===d),onVars:c,onError:l},d)),s&&h.jsx(Tot,{onVars:c,onError:l,onDone:()=>a(!1)})]})}),o&&h.jsx("div",{className:"error",children:o})]})}const Ff=[{value:"system",label:uIe,icon:bWe},{value:"light",label:aIe,icon:qWe},{value:"dark",label:XOe,icon:xWe}],Rot=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function Dot(){const[e,n]=Hat(),t=r=>{var f;const s=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!s)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),c=((o===-1?Ff.findIndex(_=>_.value===e):o)+s+Ff.length)%Ff.length;n(Ff[c].value),(f=a[c])==null||f.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:i6e()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:t6e()}),h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:`${Qa} pb-3.5`,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:f7()}),h.jsx("p",{children:JOe()})]}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":f7(),onKeyDown:t,children:Ff.map(({value:r,label:s,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>n(r),children:[h.jsx(a,{size:14}),s()]},r))})]}),h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:ZSe()}),h.jsx("p",{children:WSe()})]}),h.jsx("div",{className:"w-52 flex-none",children:h.jsx(wh,{choices:Rot,value:E(),variant:"field",dropDown:!0,onSelect:r=>{yD(r)&&r9(r)}})})]})]})]})}const Lot={installer:eGe,"app-bundle":Pqe,cargo:Vqe,homebrew:Yqe,nix:sGe,unknown:lGe},db={cargo:hGe,homebrew:mGe,nix:xGe};function Oot(){var c;const{status:e,error:n,apply:t}=aA(),[r,s]=R.useState(null),[a,o]=R.useState(null);if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:u7()}),n?h.jsx("div",{className:ao,children:h.jsx("div",{className:"error",children:n})}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]})]});const l=async(f,_)=>{s(f),o(null);try{await _()}catch(d){o(d instanceof Error?d.message:String(d))}finally{s(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:u7()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:_ze()}),h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:ju,children:[h.jsx("div",{className:"k",children:F9()}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:Eze()}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:ANe()}),h.jsx("div",{className:"v",children:Lot[e.channel]()})]}),e.restartRequired&&h.jsx("div",{className:Qa,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:qMe()}),h.jsx("p",{children:tOe({installed:Ae(e.installedVersion??"—"),current:Ae(e.current??e.installedVersion??"—")})})]})}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:o7()}),h.jsxs("p",{children:[TAe(),e.envDisabled&&wIe()]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":o7(),className:`${dp} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>LKe(!e.autoUpdate).then(t)),children:h.jsx("span",{})})]}),h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?bIe({version:Ae(e.latest??"—")}):g6e()}),h.jsx("p",{children:e.updateAvailable?LSe():A6e()})]}),h.jsx("button",{type:"button",className:Zs,disabled:r!==null,onClick:()=>void l("apply",()=>DKe().then(t)),children:r==="apply"?rp():e.updateAvailable?_Ie():y6e()})]})]}):h.jsx("div",{className:Qa,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:zTe()}),h.jsx("p",{children:((c=db[e.channel])==null?void 0:c.call(db))??NLe()})]})}),e.channel==="app-bundle"&&h.jsx(Bot,{busy:r,run:l}),a&&h.jsx("div",{className:"error",children:a})]})]})}function Iot(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null);R.useEffect(()=>{pXe().then(n).catch(l=>a(l instanceof Error?l.message:String(l)))},[]);const o=()=>{!e||t||(r(!0),a(null),mXe(!e.preferenceEnabled).then(n).catch(l=>a(l instanceof Error?l.message:String(l))).finally(()=>r(!1)))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:UDe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:dRe()}),e?h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:r7()}),h.jsx("p",{children:UAe()}),!e.enabled&&e.reason&&h.jsxs("p",{children:[B9e()," ",e.reason,"."]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.preferenceEnabled,"aria-label":r7(),className:`${dp} ${e.preferenceEnabled?"on":""}`,disabled:t,onClick:o,children:h.jsx("span",{})})]}),s&&h.jsx("div",{className:"error",children:s})]}):s?h.jsx("div",{className:"error",children:s}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]})]})}function Bot({busy:e,run:n}){const[t,r]=R.useState(null),[s,a]=R.useState(!1),o=l=>void n("cli",()=>OKe(l).then(c=>{r(c),a(!1)}).catch(c=>{throw a(!l&&String((c==null?void 0:c.message)??c).includes("--force")),c}));return h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:NSe({command:Ae("orx")})}),t?h.jsxs("p",{children:[t.alreadyCurrent?G6e({link:Ae(t.link)}):X6e({link:Ae(t.link)}),!t.onPath&&Zwe({directory:Ae(t.dir)})]}):h.jsx("p",{children:SSe({command:Ae("orx")})})]}),h.jsx("button",{type:"button",className:Zs,disabled:e!==null,onClick:()=>o(s),children:e==="cli"?rp():s?ULe():t?TLe():vSe()})]})}function $ot(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null),o=()=>(a(null),Y2().then(n).catch(c=>a(c instanceof Error?c.message:String(c))));R.useEffect(()=>void o(),[]);const l=()=>{if(!e||t)return;const c=!e.githubForNewProjects;r(!0),a(null),bE(c,!0).then(n).catch(f=>a(f instanceof Error?f.message:String(f))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:UEe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:uEe()}),e?h.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:WEe()}),h.jsx("span",{className:`${gr} ${e.githubAuthenticated?"ok":e.ghInstalled?"warn":"err"}`,children:e.githubAuthenticated?A9():T9()})]}),h.jsxs("div",{className:Qa,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:a7()}),h.jsx("p",{children:oLe()})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":a7(),className:`${dp} ${e.githubForNewProjects?"on":""}`,disabled:t||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:h.jsx("span",{})})]}),!e.githubAuthenticated&&h.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:h.jsx(_A,{ghInstalled:e.ghInstalled,onCheck:o})}),s&&h.jsx("div",{className:"error",children:s})]}):s?h.jsx("div",{className:"error",children:s}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]})]})}function _A({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-subtext text-sm m-0",children:Op(e?cOe():TSe())}),h.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&h.jsxs("a",{className:es,href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[INe()," ",h.jsx(Jl,{size:12})]}),h.jsx("button",{type:"button",className:`${Wn} ${e?"text-accent-amber border-accent-amber":""}`,disabled:t,onClick:s,children:t?sp():d6e()})]})]})}function Hot(){const[e,n]=R.useState(null),[t,r]=R.useState(!1),[s,a]=R.useState(null);return R.useEffect(()=>{SKe().then(o=>n(o.hasToken)).catch(o=>a(o instanceof Error?o.message:String(o)))},[]),h.jsxs("div",{className:Gv,children:[h.jsx("h3",{children:MTe()}),h.jsxs("div",{className:ju,children:[h.jsx("span",{className:"k",children:ZEe()}),h.jsx("span",{className:"v",children:h.jsx("span",{className:`${gr} ${e?"ok":""}`,children:e===null?s?w9():sp():e?dOe():Ake()})})]}),h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:fLe()}),e?h.jsx("div",{className:a0,children:h.jsx("button",{className:Wn,disabled:t,onClick:()=>{r(!0),a(null),kKe().then(o=>n(o.hasToken)).catch(o=>a(o instanceof Error?o.message:String(o))).finally(()=>r(!1))},children:t?$Le():LLe()})}):h.jsx(Fat,{save:dE,onSaved:o=>n(o.hasToken),placeholder:OTe(),createHref:"https://www.overleaf.com/user/settings"}),s&&h.jsx("div",{className:"error",children:s})]})}function Fot({project:e,publicationError:n,onProjectUpdate:t}){const[r,s]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(null),[f,_]=R.useState(!1),[d,m]=R.useState(!1),[g,S]=R.useState(null),k=R.useRef(0),v=!!(r!=null&&r.github.owner&&r.github.repo),b=(z=!0)=>{const N=++k.current;return z&&s(null),c(null),e?fXe(e.id).then(T=>{N===k.current&&s(T)}).catch(T=>{N===k.current&&c(T instanceof Error?T.message:String(T))}):Promise.resolve()};R.useEffect(()=>void b(),[e==null?void 0:e.id]);const w=z=>{const N=z instanceof Error?z.message:String(z);return N.toLowerCase().includes("archived")?F7e():N.includes("(fetch first)")||N.includes("non-fast-forward")?G7e():N.includes("403")||N.toLowerCase().includes("permission denied")?X7e():N},y=()=>{e&&(o(!0),c(null),dXe(e.id).then(z=>{s(z.git),t(z.project),Y2().then(N=>{!N.githubForNewProjects&&!N.githubDefaultPromptSeen&&_(!0)}).catch(()=>{})}).catch(z=>c(w(z))).finally(()=>o(!1)))},C=z=>{m(!0),S(null),bE(z,!0).then(()=>_(!1)).catch(N=>S(N instanceof Error?N.message:String(N))).finally(()=>m(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:HMe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:ZLe({project:(e==null?void 0:e.name)??u7e()})}),e?l&&!r?h.jsx("div",{className:"error",children:l}):r?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Gv,children:[h.jsx("h3",{children:Xze()}),h.jsxs("div",{className:ju,children:[h.jsx("span",{className:"k",children:QTe()}),h.jsx("span",{className:`v ${Qr}`,children:r.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:r.gitVersion??k9()}),h.jsx("span",{className:"k",children:TRe()}),h.jsx("span",{className:"v",children:r.initialized?I7e({branch:Ae(r.currentBranch??j9()),state:r.clean?F6e():J7e()}):Cke()}),h.jsx("span",{className:"k",children:xCe()}),h.jsx("span",{className:`v ${Qr}`,children:r.baselineBranch}),h.jsx("span",{className:"k",children:OMe()}),h.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(z=>`${z.name}: ${z.url}`).join(" · "):R2()})]}),!r.initialized&&h.jsx("div",{className:a0,children:h.jsx("button",{className:es,onClick:()=>void hXe(e.id).then(s).catch(z=>c(String(z))),children:CNe()})})]}),h.jsxs("div",{className:Gv,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:ju,children:[h.jsx("span",{className:"k",children:cCe()}),h.jsx("span",{className:"v",children:h.jsx("span",{className:`${gr} ${r.github.authenticated?"ok":r.github.ghInstalled?"warn":"err"}`,children:r.github.authenticated?A9():T9()})}),h.jsx("span",{className:"k",children:aMe()}),h.jsx("span",{className:"v",children:v?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:Qr,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&h.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:VRe()})]}):h.jsx("span",{className:gr,children:Gze()})}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:PRe()}),h.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&h.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:h.jsx(_A,{ghInstalled:r.github.ghInstalled,onCheck:()=>b(!1)})}),r.github.authenticated&&!r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:v?jIe():a7e()}),h.jsxs("div",{className:a0,children:[v&&r.github.url&&h.jsxs("a",{className:Wn,href:r.github.url,target:"_blank",rel:"noreferrer",children:[c7()," ",h.jsx(Jl,{size:12})]}),h.jsx("button",{className:es,disabled:a,onClick:y,children:a?ewe():Y3e()})]})]}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:wEe()}),h.jsxs("div",{className:a0,children:[r.github.url&&h.jsxs("a",{className:Wn,href:r.github.url,target:"_blank",rel:"noreferrer",children:[c7()," ",h.jsx(Jl,{size:12})]}),h.jsx("button",{className:Wn,disabled:a,onClick:()=>{o(!0),_Xe(e.id).then(z=>{s(z.git),t(z.project)}).catch(z=>c(z instanceof Error?z.message:String(z))).finally(()=>o(!1))},children:a?swe():V3e()})]})]})]}),h.jsx(Hot,{}),n&&h.jsx("div",{className:"error",children:w(n)}),l&&h.jsx("div",{className:"error",children:w(l)})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]}):h.jsx("div",{className:ao,children:h.jsx("p",{className:qr,children:aTe()})}),f&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:z=>z.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:rAe()}),h.jsx("p",{children:uDe()}),g&&h.jsx("div",{className:"error",children:g}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx("button",{className:Wn,disabled:d,onClick:()=>C(!1),children:Oje()}),h.jsx("button",{className:es,disabled:d,onClick:()=>C(!0),children:d?xa():i8e()})]})]})})]})}const Pot={env:lPe,config:hPe,xdg:mPe,default:sPe},_b={preparing:YFe,copying:EFe,verifying:xPe,finalizing:jFe},Uot=e=>{var n;return((n=_b[e])==null?void 0:n.call(_b))??e};function qot(){const[e,n]=R.useState(null),[t,r]=R.useState(null),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[m,g]=R.useState(null),S=()=>UKe().then(C=>{n(C),a(z=>z||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{S()},[]),R.useEffect(()=>KXe(C=>{C.type==="progress"?d(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"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),f(null),a(""),S()):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const k=(e==null?void 0:e.source)==="env",v=s.trim(),b=e!==null&&v===e.current;async function w(){if(!(o||!v)){l(!0),g(null),f(null);try{f(await qKe(v))}catch(C){g(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(_.kind==="moving"||!v||b)&&(g(null),!!window.confirm(BFe({path:Ae(v)})))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await GKe(v)}catch(z){d({kind:"idle"}),g(z instanceof Error?z.message:String(z))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:BRe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:IOe()}),t?h.jsx("div",{className:ao,children:h.jsx("div",{className:"error",children:t})}):e?h.jsxs("div",{className:ao,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:X9e()}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsx("span",{className:gr,children:e.isDefault?y0():D9()})]}),h.jsxs("div",{className:ju,children:[h.jsx("span",{className:"k",children:D9e()}),h.jsx("span",{className:`v ${Qr}`,children:e.current}),h.jsx("span",{className:"k",children:H2()}),h.jsx("span",{className:"v",children:Pot[e.source]()}),!e.isDefault&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:y0()}),h.jsx("span",{className:`v ${Qr}`,children:e.defaultPath})]})]}),k?h.jsx("p",{className:qr,children:b7e({variable:Ae("ORX_DATA_DIR")})}):h.jsxs("form",{className:rd,onSubmit:y,children:[h.jsxs("label",{children:[NAe(),h.jsx("input",{className:Qr,type:"text",value:s,onChange:C=>{a(C.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),c&&!c.error&&c.ok&&h.jsxs("p",{className:qr,children:[CMe()," ",$i(c.treeBytes??0),c.freeBytes!=null&&` — ${DFe({size:Ae($i(c.freeBytes))})}`,c.sameFilesystem?ePe():"","."]}),c&&c.ok===!1&&c.error&&h.jsx("div",{className:"error",children:c.error}),m&&h.jsx("div",{className:"error",children:m}),_.kind==="moving"&&h.jsx(lA,{value:_.copied,max:_.total,label:Uot(_.phase),caption:_.total>0?h.jsxs("span",{className:Qr,children:[$i(_.copied)," / ",$i(_.total)]}):void 0}),_.kind==="done"&&h.jsxs("p",{className:qr,children:[vAe(),_.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ",Ike({path:Ae(_.oldPathLeft)})]})]}),_.kind==="error"&&h.jsxs("div",{className:"error",children:[pAe()," ",_.message]}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"button",className:Wn,onClick:w,disabled:o||!v||b||_.kind==="moving",children:o?sp():c6e()}),h.jsx("button",{type:"submit",className:es,disabled:!v||b||_.kind==="moving",children:_.kind==="moving"?VFe():PFe()})]})]})]}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]})]})}const Vv=e=>e==="running"||e==="starting";function Got(e){return Vv(e.status)?E0(Date.now()-e.createdAt):e.endedAt?E0(e.endedAt-e.createdAt):"—"}function pA({instances:e,emptyLabel:n}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:n}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-start [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:mCe()}),h.jsx("th",{children:ap()}),h.jsx("th",{children:NRe()}),h.jsx("th",{children:nRe()})]})}),h.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 h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[h.jsx(my,{backend:t.backend}),r&&h.jsx("a",{className:vn,href:r,target:"_blank",rel:"noreferrer",title:l7(),"aria-label":l7(),onClick:a=>a.stopPropagation(),children:h.jsx(Jl,{size:12})})]})}),h.jsx("td",{children:h.jsx(no,{status:Si(t)})}),h.jsx("td",{children:Gi(t.createdAt)}),h.jsx("td",{children:Got(t)})]},t.id)})})]})})}function Vot({projectId:e,onViewHistory:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(!1),[,c]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>c(S=>S+1),3e4);return()=>clearInterval(g)},[]);const f=()=>{if(!e){r([]);return}l(!0),X2(e).then(g=>{r(g),a(null)}).catch(g=>{a(g instanceof Error?g.message:String(g)),r(S=>S??[])}).finally(()=>l(!1))};R.useEffect(()=>f(),[e]);const _=(g,S)=>S.createdAt-g.createdAt,d=t==null?void 0:t.filter(g=>Vv(g.status)).sort(_),m=t==null?void 0:t.filter(g=>!Vv(g.status)).sort(_);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsx("div",{children:h.jsxs("h2",{children:[QMe(),d&&d.length>0&&h.jsx("span",{className:"count-badge",children:d.length})]})}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs("button",{className:Zs,onClick:f,disabled:o,children:[h.jsx(Gh,{size:12,className:o?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",$2()]}),h.jsx("button",{className:Zs,onClick:n,children:m!=null&&m.length?vde({count:$t(m.length)}):pde()})]})]}),s&&h.jsx("div",{className:"error",children:s}),!d||!m?h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]}):h.jsx(pA,{instances:d,emptyLabel:e?rde():fde()})]})}function Wot({projectId:e,onBack:n}){const[t,r]=R.useState(null),[s,a]=R.useState(null),[o,l]=R.useState(!1),[,c]=R.useState(0);R.useEffect(()=>{const _=setInterval(()=>c(d=>d+1),3e4);return()=>clearInterval(_)},[]);const f=()=>{if(!e){r([]);return}l(!0),X2(e).then(_=>{r(_.sort((d,m)=>m.createdAt-d.createdAt)),a(null)}).catch(_=>{a(_ instanceof Error?_.message:String(_)),r(d=>d??[])}).finally(()=>l(!1))};return R.useEffect(f,[e]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[h.jsx(uh,{size:14})," ",M9()]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:qNe()}),h.jsxs("button",{className:Zs,onClick:f,disabled:o,children:[h.jsx(Gh,{size:12,className:o?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",$2()]})]}),s&&h.jsx("div",{className:"error",children:s}),t?h.jsx(pA,{instances:t,emptyLabel:e?Jhe():ode()}):h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",cl()]})]})}const mA=["projects","harnesses","storage"],Kot=[{id:"compute",label:R9(),icon:h.jsx(OVe,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:O2(),icon:h.jsx(aE,{size:15}),activeTabs:["environment"]},{id:"settings",label:L9(),icon:h.jsx($We,{size:15}),activeTabs:["settings",...mA]}];function Xot(e){return mA.includes(e)}function Yot({tab:e,project:n,githubPublicationError:t,onProjectUpdate:r,onSelectTab:s}){const a=e==="settings"||Xot(e);return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:L9()}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:Xc,children:h.jsx(Dot,{})}),h.jsx("section",{className:Xc,children:h.jsx($ot,{})}),h.jsx("section",{className:Xc,children:h.jsx(sot,{})}),h.jsx("section",{className:Xc,children:h.jsx(qot,{})}),h.jsx("section",{className:Xc,children:h.jsx(Iot,{})}),h.jsx("section",{className:Xc,children:h.jsx(Oot,{})})]})]}),e==="compute"&&h.jsx(Cot,{project:n,onViewHistory:()=>s("instances")}),e==="instances"&&h.jsx(Wot,{projectId:n==null?void 0:n.id,onBack:()=>s("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:O2()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:YDe()}),h.jsx(Mot,{})]}),e==="git"&&h.jsx(Fot,{project:n,publicationError:t,onProjectUpdate:r})]})}function Zot({skills:e,activeIndex:n,onPick:t,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((s,a)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-start py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(s)},onMouseEnter:()=>r(a),children:[h.jsxs("span",{className:"skill-name flex items-center gap-1.5",children:["/",s.name,s.source!=="command"&&h.jsx("span",{className:"inline-flex h-4 items-center rounded-full border border-border-variant bg-canvas px-1.5 text-2xs font-semibold tracking-[0.05em] text-muted",children:"SKILL"})]}),h.jsx("span",{className:"skill-desc",children:s.description})]},s.name))})}var vy=t9();const j8={name:"plan",description:Jye(),source:"command"};function pb(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(;r1&&/[ \t]$/.test(a)&&(a=a.replace(/[ \t]+$/,_=>_.includes(" ")||_.length>=r?_:s));let o=e.slice(n.end);if(!o)o=s;else if(!o.startsWith(` +`)){const _=(c=/^[ \t]+/.exec(o))==null?void 0:c[0];o=_?`${_.length>=r?_:s}${o.slice(_.length)}`:s+o}const l=((f=/^[ \t]+/.exec(o))==null?void 0:f[0].length)??0;return{text:`${a}/${t}${o}`,cursor:a.length+t.length+1+l}}function M8(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 Jot(e,n){const t=e.filter(r=>r.name.toLowerCase()!==j8.name);return n?[j8,...t]:t}function elt(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function tlt(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const nlt=["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"],mb=new Map;function rlt(e,n){const t=`${n}\0${e}`,r=mb.get(t);if(r)return r;const s=bXe(e,n).catch(a=>{throw mb.delete(t),a});return mb.set(t,s),s}function gA(e,n,t,r,s,a=!1){let o=0;return Qot(e,n).map((l,c)=>{const f=o+l.text.length;o=f;const _=l.text.slice(1).toLowerCase();return l.command&&s?s(l.text,_,f,c):l.command?h.jsxs("span",{className:t,onMouseDown:void 0,children:[h.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),l.text.slice(1)]},c):a?h.jsx("span",{"aria-hidden":"true",children:l.text},c):h.jsx(R.Fragment,{children:l.text},c)})}function slt({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:a}){const o=R.useRef(null),l=R.useRef(null),c=R.useRef(null),f=R.useId(),[_,d]=R.useState(!1),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState({}),w=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},y=()=>{const N=o.current;if(!N)return;const T=N.getBoundingClientRect(),j=Math.min(420,window.innerWidth-32),D=Math.max(16,Math.min(T.left-4,window.innerWidth-j-16));b(T.top>300?{bottom:window.innerHeight-T.top+12,left:D,width:j}:{left:D,top:T.bottom+12,width:j})},C=()=>{w(),y(),d(!0),!(m!==null||S)&&(k(!0),rlt(n,s).then(g).catch(()=>g(null)).finally(()=>k(!1)))},z=()=>{w(),c.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>w(),[]),R.useEffect(()=>{if(!_)return;const N=()=>y();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[_]),h.jsxs(R.Fragment,{children:[h.jsxs("span",{ref:o,role:"button",tabIndex:0,"aria-controls":f,"aria-expanded":_,"aria-label":wO({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 cursor-text rounded-md bg-background text-[var(--skill-blue)]",onMouseEnter:C,onMouseLeave:z,onFocus:C,onBlur:z,onKeyDown:N=>{var T,j;if(N.key==="Escape"){d(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),C();return}_&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(T=l.current)==null||T.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),_&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(j=l.current)==null||j.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var T,j;N.preventDefault(),(T=a.current)==null||T.focus(),(j=a.current)==null||j.setSelectionRange(t,t),w()},children:[h.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-[var(--skill-blue-subtle)] opacity-0 transition-opacity group-hover/skill:opacity-100"}),h.jsxs("span",{className:"relative z-1",children:[h.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),e.slice(1)]})]}),_&&vy.createPortal(h.jsxs("div",{id:f,ref:l,role:"dialog","aria-label":eI({name:n}),style:{...v,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-[0_8px_24px_rgba(0,_0,_0,_0.14)]",onMouseEnter:w,onMouseLeave:z,onFocus:w,onBlur:z,onMouseDown:N=>N.stopPropagation(),children:[h.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:[h.jsxs("span",{className:"text-md font-medium text-muted",children:["/",n]}),h.jsx("span",{className:"inline-flex h-4 items-center rounded-full border border-border-variant bg-canvas px-1.5 text-2xs font-semibold tracking-[0.05em] text-muted",children:PIe()})]}),h.jsx("div",{className:"p-4 text-sm text-text",children:S&&m===null?h.jsx("span",{className:"text-muted",children:VIe()}):h.jsx(ga,{text:m??r.description})})]}),document.body)]})}function ilt({text:e,isCommand:n}){return h.jsx(h.Fragment,{children:gA(e,n,"skill-chip mx-1 inline-flex items-center rounded-md px-2 py-1 font-medium text-[var(--skill-blue)] transition-colors hover:bg-[var(--skill-blue-subtle)]")})}function alt({text:e,isCommand:n,skills:t,projectId:r,textareaRef:s}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=s.current,l=a.current;if(!o||!l)return;const c=()=>{const _=getComputedStyle(o);for(const d of nlt)l.style.setProperty(d,_.getPropertyValue(d));l.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};c();const f=new ResizeObserver(c);return f.observe(o),()=>f.disconnect()},[e,s]),R.useLayoutEffect(()=>{const o=s.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[s,e]),h.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:[gA(e,n,"",void 0,(o,l,c,f)=>{const _=t.find(d=>d.name===l);return _&&_.source!=="command"?h.jsx(slt,{label:o,name:l,end:c,skill:_,projectId:r,textareaRef:s},`${f}:${c}`):h.jsxs("span",{"aria-hidden":"true",className:"bg-background text-[var(--skill-blue)]",children:[h.jsx("span",{className:"text-[var(--skill-blue-slash)]",children:"/"}),o.slice(1)]},`${f}:${c}`)},!0),"​"]})}function olt(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Wv=6.5,R8=2*Math.PI*Wv;function llt({usage:e}){return!e||e.usedTokens<=0?null:h.jsx(clt,{usage:e})}function clt({usage:e}){const{open:n,setOpen:t,ref:r}=_o(),{usedTokens:s,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(s/a*100)):null,l=o===null?"var(--accent)":olt(o),c=o===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(o/100);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:`${o===null?`${Kh} px-1`:av} composer-bare context-ring text-md text-text`,title:Sie(),onClick:()=>t(f=>!f),children:o===null?x_(s):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:Wv,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:Wv,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${R8*Math.max(o,2)/100} ${R8}`,transform:"rotate(-90 8 8)"})]})}),n&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:vie()}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?Nie({value:Ae(x_(s))}):Tie({used:Ae(x_(s)),total:Ae(x_(a)),percent:Ae(c)})})]}),o!==null&&h.jsx(lA,{value:s,max:a,fillColor:l})]})]})}const xy="orx:demo-read-sessions";function bA(){try{const e=JSON.parse(sessionStorage.getItem(xy)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function ult(e){try{const n=bA();n.add(e),sessionStorage.setItem(xy,JSON.stringify([...n]))}catch{}}function flt(){try{sessionStorage.removeItem(xy)}catch{}}function hlt(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 dlt(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 _lt(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 Vv(e,n){return n?` +`}function Kv(e,n){return n?` \\[ ${e} \\] -`:`\\(${e}\\)`}function Mot(e,n){const t=n.trim().split(` +`:`\\(${e}\\)`}function plt(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 Rot(e,n){if(e.length===0)return"";const t=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:t},(l,c)=>o[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),a=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...a.map(r)].join(` -`)}function Dot(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function Lot(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function Oot(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const Iot=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),al=256,mA=1024,gA=2e4,_b=8,D_="chat-annotations";function ql(e){return e instanceof Element?e:e.parentElement}function M8(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function pb(e,n){return M8(e).compareBoundaryPoints(Range.START_TO_START,M8(n))<0}function R8(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const Bot=new Set(["A","B","CODE","EM","I","STRONG"]);function $ot(e,n){var s,a;const t=ql(e.endContainer);if(Array.from(n.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=ql(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(t);){if(Bot.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(l))}o=o.parentElement}}const r=(s=ql(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),l.replaceChildren(o),n.replaceChildren(l))}}function Hot(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 Pot(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const a=Array.from(n.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,c=document.createRange();c.selectNode(l);const f={container:c.startContainer,offset:c.startOffset},_={container:c.endContainer,offset:c.endOffset};if(pb(s,f)&&t.append(R8(s,f)),t.append(l.cloneNode(!0)),s=_,!pb(s,r))break}return a.length===0?t.append(e.cloneContents()):pb(s,r)&&t.append(R8(s,r)),$ot(e,t),Hot(t),t}function Fot(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>Sd(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function mlt(e,n){if(e.length===0)return"";const t=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:t},(l,c)=>o[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),a=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...a.map(r)].join(` +`)}function glt(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function blt(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function vlt(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const xlt=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),al=256,vA=1024,xA=2e4,gb=8,D_="chat-annotations";function ql(e){return e instanceof Element?e:e.parentElement}function D8(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function bb(e,n){return D8(e).compareBoundaryPoints(Range.START_TO_START,D8(n))<0}function L8(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const ylt=new Set(["A","B","CODE","EM","I","STRONG"]);function wlt(e,n){var s,a;const t=ql(e.endContainer);if(Array.from(n.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=ql(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(t);){if(ylt.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(l))}o=o.parentElement}}const r=(s=ql(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),l.replaceChildren(o),n.replaceChildren(l))}}function Slt(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 klt(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const a=Array.from(n.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,c=document.createRange();c.selectNode(l);const f={container:c.startContainer,offset:c.startOffset},_={container:c.endContainer,offset:c.endOffset};if(bb(s,f)&&t.append(L8(s,f)),t.append(l.cloneNode(!0)),s=_,!bb(s,r))break}return a.length===0?t.append(e.cloneContents()):bb(s,r)&&t.append(L8(s,r)),wlt(e,t),Slt(t),t}function Clt(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>Sh(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` -${Rot(n,!!e.querySelector("tr:first-child th"))} +${mlt(n,!!e.querySelector("tr:first-child th"))} -`:""}function bA(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),c=l===null?s:Number(l),f=Number.isFinite(c)?c:s;s=f+1;const _=Array.from(o.childNodes).map(h=>h instanceof HTMLElement&&h.matches("UL, OL")?` -${bA(h).trim()} -`:Sd(h)).join("").trim();a.push(Mot(n?`${f}.`:"-",_))}return` +`:""}function yA(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),c=l===null?s:Number(l),f=Number.isFinite(c)?c:s;s=f+1;const _=Array.from(o.childNodes).map(d=>d instanceof HTMLElement&&d.matches("UL, OL")?` +${yA(d).trim()} +`:Sh(d)).join("").trim();a.push(plt(n?`${f}.`:"-",_))}return` ${a.join(` `)} -`}function Sd(e){var r,s,a,o,l;if(e.nodeType===Node.TEXT_NODE)return Aot(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(Sd).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?Vv(c,!0):""}if(e.matches(".katex")){const c=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return c?Vv(c,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return Fot(e);if(e.matches("UL, OL"))return bA(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return jot(e.textContent??"");if(e.tagName==="PRE")return Tot(e.textContent??"");const n=Array.from(e.childNodes).map(Sd).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 Sh(e){var r,s,a,o,l;if(e.nodeType===Node.TEXT_NODE)return hlt(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(Sh).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?Kv(c,!0):""}if(e.matches(".katex")){const c=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return c?Kv(c,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return Clt(e);if(e.matches("UL, OL"))return yA(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return dlt(e.textContent??"");if(e.tagName==="PRE")return _lt(e.textContent??"");const n=Array.from(e.childNodes).map(Sh).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` @@ -960,7 +960,7 @@ ${n.trim().split(` `).map(c=>`> ${c}`).join(` `)} -`;const t=Dot(e.tagName,n);return t?` +`;const t=glt(e.tagName,n);return t?` ${t} @@ -968,63 +968,63 @@ ${t} ${n.trim()} -`:n}function Uot(e,n){return Sd(e).replace(/\r\n?/g,` +`:n}function Elt(e,n){return Sh(e).replace(/\r\n?/g,` `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||n}function D8(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function qot(e,n){var s,a,o,l;if(!Lot(e))return;const t=D8(e);if(t.length<8)return;let r;for(const c of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(a=c.querySelector(".katex-html"))==null?void 0:a.textContent,c.textContent].filter(S=>!!S).map(D8).find(S=>Oot(S,t));if(!_)continue;const h=(l=(o=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!h)continue;const m=!!c.closest(".katex-display"),g={markdown:Vv(h,m).trim(),delta:Math.abs(_.length-t.length)};(!r||g.delta .md .katex")){const _=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(a=c.querySelector(".katex-html"))==null?void 0:a.textContent,c.textContent].filter(S=>!!S).map(O8).find(S=>vlt(S,t));if(!_)continue;const d=(l=(o=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!d)continue;const m=!!c.closest(".katex-display"),g={markdown:Kv(d,m).trim(),delta:Math.abs(_.length-t.length)};(!r||g.deltaj.width>0&&j.height>0),S=g[0]??t.getBoundingClientRect(),k=g.filter(j=>j.topS.top),v=k.length>0?k:[S],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)),z=34,N=74,T=y>=z+_b?y-z-_b:C+_b;return{text:Uot(m,h),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function Vot(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),a=R.useCallback(()=>{const c=e.current;r(c?Got(c):null)},[e]);R.useEffect(()=>{let c=null;const f=()=>{s.current||a()},_=m=>{const g=e.current,S=m.target;!m.isPrimary||m.button!==0||!g||!(S instanceof Node)||!g.contains(S)||(s.current=!0,r(null))},h=m=>{!m.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",f),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("pointercancel",h,!0),()=>{document.removeEventListener("selectionchange",f),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("pointercancel",h,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[a]),R.useEffect(()=>{if(!t)return;const c=f=>{const _=f.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",a)}},[t,a]);const o=R.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),l=R.useCallback(()=>r(null),[]);return{action:t,add:o,dismiss:l}}function Wot(e){R.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(D_);return}const t=new Highlight(...n);return CSS.highlights.set(D_,t),()=>{CSS.highlights.get(D_)===t&&CSS.highlights.delete(D_)}},[e])}function Kot({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var a;const s=(a=n.current)==null?void 0:a.closest(".chat-thread-inner");r(s?qot(e.text,s):void 0)},[e.id,e.text]),d.jsx("div",{ref:n,children:d.jsx(ga,{text:t??e.text})})}function Xot({annotations:e,onRemove:n}){return e.map((t,r)=>d.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[d.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-sm text-muted mb-1",children:QZ()}),d.jsx(Kot,{annotation:t})]}),n&&d.jsx("button",{type:"button","data-annotation-remove":!0,className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:NZ(),"aria-label":SO({number:Ht(r+1)}),onClick:()=>n(t.id),children:d.jsx(Gr,{size:13})})]},t.id))}function vy({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),a=R.useRef(null),o=R.useId(),l=_o(s),c=n==="sent",f=R.useRef(null),_=()=>{f.current!==null&&window.clearTimeout(f.current),f.current=null,l.setOpen(!0)},h=()=>{f.current=window.setTimeout(()=>{var S;(S=a.current)!=null&&S.contains(document.activeElement)||l.setOpen(!1)},160)},m=()=>{const S=c||!l.open;l.setOpen(S),S&&window.requestAnimationFrame(()=>{var k;return(k=a.current)==null?void 0:k.focus()})},g=S=>{r==null||r(S),window.requestAnimationFrame(()=>{var v,b;(b=((v=a.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??a.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]),d.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:c?_:void 0,onMouseLeave:c?h:void 0,children:[d.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[d.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":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:m,children:[d.jsx(J9,{size:c?13:14,className:"text-muted"}),e.length===1?uW():TG({count:Ht(e.length)})]}),t&&d.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:l6(),"aria-label":l6(),onClick:t,children:d.jsx(Gr,{size:13})})]}),l.open&&d.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-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":KZ(),children:d.jsx(Xot,{annotations:e,onRemove:r?g:void 0})})]})}function Yot(e){return d.jsx(vy,{...e,variant:"composer"})}const Zot=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),L8=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-md text-subtext"].join(" "),Qot=["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(" "),Jot=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Wv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),_u="local-",O8=[];function elt(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(_u)),n]}function tlt(e,n){switch(n.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return n.onlyIfAbsent&&n.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:n.messages},queuedBySession:{...e.queuedBySession,[n.sessionId]:n.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.activeLeafId??null}};case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(l=>l.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,a=n.message.role==="user"&&s!==null&&s.startsWith(_u),o=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:elt(t,n.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${_u}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"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((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),n.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const s={id:`${_u}${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"busy":{const t=new Set(e.busySessions);return n.busy?t.add(n.sessionId):t.delete(n.sessionId),{...e,busySessions:t}}case"seedBusy":{const t=new Set(n.sessions),r=new Set(n.known);for(const s of e.busySessions)r.has(s)||t.add(s);return{...e,busySessions:t}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}};case"forget":{const t={...e.messagesBySession};delete t[n.sessionId];const r=new Set(e.busySessions);r.delete(n.sessionId);const s={...e.queuedBySession};delete s[n.sessionId];const a={...e.activeLeafBySession};return delete a[n.sessionId],{messagesBySession:t,busySessions:r,queuedBySession:s,activeLeafBySession:a}}}}function nlt(e){if(!e)return"";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return i3e();const t=Math.floor(n/60);if(t<60)return t3e({value:Ht(t)});const r=Math.floor(t/60);return r<24?Z5e({value:Ht(r)}):W5e({value:Ht(Math.floor(r/24))})}function $l(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function mb(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 rlt(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 rs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function gb(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 a=s[t];if(typeof a=="string"&&a)return a}return null}function bb(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=al));s++);return r}function slt(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 pu(...e){const n=new Set,t=new RegExp(`^${Yl}$`,"i");let r=0;for(const s of e)for(const a of s){if(n.size>=al||r++>=mA)return[...n];t.test(a)&&n.add(a.toLowerCase())}return[...n]}function Bp(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!d)return null;const m=klt(t,e),g=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),S=g[0]??t.getBoundingClientRect(),k=g.filter(j=>j.topS.top),v=k.length>0?k:[S],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)),z=34,N=74,T=y>=z+gb?y-z-gb:C+gb;return{text:Elt(m,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function Alt(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),a=R.useCallback(()=>{const c=e.current;r(c?zlt(c):null)},[e]);R.useEffect(()=>{let c=null;const f=()=>{s.current||a()},_=m=>{const g=e.current,S=m.target;!m.isPrimary||m.button!==0||!g||!(S instanceof Node)||!g.contains(S)||(s.current=!0,r(null))},d=m=>{!m.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",f),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",f),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[a]),R.useEffect(()=>{if(!t)return;const c=f=>{const _=f.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",a)}},[t,a]);const o=R.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),l=R.useCallback(()=>r(null),[]);return{action:t,add:o,dismiss:l}}function jlt(e){R.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(D_);return}const t=new Highlight(...n);return CSS.highlights.set(D_,t),()=>{CSS.highlights.get(D_)===t&&CSS.highlights.delete(D_)}},[e])}function Tlt({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var a;const s=(a=n.current)==null?void 0:a.closest(".chat-thread-inner");r(s?Nlt(e.text,s):void 0)},[e.id,e.text]),h.jsx("div",{ref:n,children:h.jsx(ga,{text:t??e.text})})}function Mlt({annotations:e,onRemove:n}){return e.map((t,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:tQ()}),h.jsx(Tlt,{annotation:t})]}),n&&h.jsx("button",{type:"button","data-annotation-remove":!0,className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:jZ(),"aria-label":EO({number:$t(r+1)}),onClick:()=>n(t.id),children:h.jsx(Yr,{size:13})})]},t.id))}function yy({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),a=R.useRef(null),o=R.useId(),l=_o(s),c=n==="sent",f=R.useRef(null),_=()=>{f.current!==null&&window.clearTimeout(f.current),f.current=null,l.setOpen(!0)},d=()=>{f.current=window.setTimeout(()=>{var S;(S=a.current)!=null&&S.contains(document.activeElement)||l.setOpen(!1)},160)},m=()=>{const S=c||!l.open;l.setOpen(S),S&&window.requestAnimationFrame(()=>{var k;return(k=a.current)==null?void 0:k.focus()})},g=S=>{r==null||r(S),window.requestAnimationFrame(()=>{var v,b;(b=((v=a.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??a.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]),h.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:c?_:void 0,onMouseLeave:c?d:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref: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":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:m,children:[h.jsx(nE,{size:c?13:14,className:"text-muted"}),e.length===1?dW():DG({count:$t(e.length)})]}),t&&h.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:u6(),"aria-label":u6(),onClick:t,children:h.jsx(Yr,{size:13})})]}),l.open&&h.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-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":ZZ(),children:h.jsx(Mlt,{annotations:e,onRemove:r?g:void 0})})]})}function Rlt(e){return h.jsx(yy,{...e,variant:"composer"})}const Dlt=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),I8=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-md text-subtext"].join(" "),Llt=["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(" "),Olt=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Xv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),_u="local-",B8=[];function Ilt(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(_u)),n]}function Blt(e,n){switch(n.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return n.onlyIfAbsent&&n.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:n.messages},queuedBySession:{...e.queuedBySession,[n.sessionId]:n.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.activeLeafId??null}};case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(l=>l.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,a=n.message.role==="user"&&s!==null&&s.startsWith(_u),o=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:Ilt(t,n.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${_u}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"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((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),n.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const s={id:`${_u}${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"busy":{const t=new Set(e.busySessions);return n.busy?t.add(n.sessionId):t.delete(n.sessionId),{...e,busySessions:t}}case"seedBusy":{const t=new Set(n.sessions),r=new Set(n.known);for(const s of e.busySessions)r.has(s)||t.add(s);return{...e,busySessions:t}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}};case"forget":{const t={...e.messagesBySession};delete t[n.sessionId];const r=new Set(e.busySessions);r.delete(n.sessionId);const s={...e.queuedBySession};delete s[n.sessionId];const a={...e.activeLeafBySession};return delete a[n.sessionId],{messagesBySession:t,busySessions:r,queuedBySession:s,activeLeafBySession:a}}}}function $lt(e){if(!e)return"";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return P3e();const t=Math.floor(n/60);if(t<60)return B3e({value:$t(t)});const r=Math.floor(t/60);return r<24?D3e({value:$t(r)}):j3e({value:$t(Math.floor(r/24))})}function $l(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function vb(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 Hlt(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 cs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function xb(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 a=s[t];if(typeof a=="string"&&a)return a}return null}function yb(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=al));s++);return r}function Flt(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 pu(...e){const n=new Set,t=new RegExp(`^${Yl}$`,"i");let r=0;for(const s of e)for(const a of s){if(n.size>=al||r++>=vA)return[...n];t.test(a)&&n.add(a.toLowerCase())}return[...n]}function $p(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` -`).trim()}function ilt(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 alt(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=xXe(r),vA(r)}function vA(e){return llt(e).replace(/[\t\r ]+/g," ").trim()}function olt(e){let n=null,t=!1;for(let r=0;r!a.startsWith("-")&&a.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&yA(s)?{ref:r,path:s}:null}function flt(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 I8(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 a of n.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(a);continue}r.push(a)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function dlt(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let a=0;a!f.startsWith("-"));if(!l)return null;const c=I8(s,l);if(!c)return null;s=c}return s?I8(s,e):e}const da="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",hlt=new RegExp(`\\bchat_(${da})\\b`,"gi"),Yl=`(?:${da}|[0-9a-f]{8})`;function mu(e){const n=[];let t="",r="",s=null,a=!1;const o=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},l=f=>{let _=1,h=null,m=!1;for(let g=f;g{let _=!1;for(let h=f;hSXe(t.raw,n))}function vi(e,n){return $p(e,n).length>0}function _lt(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,gA).matchAll(hlt))if(n.add(t[0].toLowerCase()),n.size>=al)break;return[...n]}function Kv(e,n){if(!e)return[];const t=new Set,r=e.slice(0,gA),s=n==="runs"?[new RegExp(`/runs/(${da})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${da})`,"gi"),new RegExp(`^\\s*RUN\\s+(${da})\\b`,"gim"),new RegExp(`={3,}\\s*(${da})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${da})`,"gi"),new RegExp(`^\\s*id:\\s*(${da})`,"gim"),new RegExp(`={3,}\\s*(${da})\\s*={3,}`,"gi")];for(const o of s)for(const l of r.matchAll(o))if(t.add(l[1]),t.size>=al)return[...t];const a=new RegExp(`^\\s*(${da})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=al)break;return[...t]}function SA(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),a=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function kA(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(s)){if((o.index??0)>=t)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function CA(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(s)){const l=o.index??0;if(l>=t)break;const c=l+o[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function plt(e,n,t=[],r=[]){const s=$p(e,"logs"),a=new Set;if(s.length===0){if(!vi(e,"logs"))return[];const l=t.length>0?[]:Kv(n,"runs");for(const c of t.length>0?t:l.length>0?l:r)if(a.add(c),a.size>=al)break;return pu([...a])}let o=!1;for(const{invocation:l,offset:c}of SA(e,s)){const f=ku(l.raw);if((f==null?void 0:f[0])!=="logs")continue;const _=f.slice(1);let h=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){h=b;break}}}if(!h){o=!0;continue}if(new RegExp(`^${Yl}$`,"i").test(h)){a.add(h);continue}const m=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h);if(!m){o=!0;continue}const g=m[1],S=kA(e,g,c,Yl);for(const v of S)a.add(v);const k=CA(e,g,c,Yl);for(const v of k)a.add(v);S.length===0&&k.length===0&&(o=!0)}if(a.size===0||o){const l=t.length>0?[]:Kv(n,"runs"),c=t.length>0?t:l.length>0?l:r;for(const f of c)if(a.add(f),a.size>=al)break}return pu([...a])}function Yc(e,n,t=[],r=[]){const s=$p(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:c}of SA(e,s)){const f=ku(l.raw),_=(f==null?void 0:f[0])==="exp"&&(f[1]==="status"||f[1]==="desc")?f[2]:null;let h=!1;_&&new RegExp(`^${Yl}$`,"i").test(_)&&(a.add(_),h=!0);const m=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(m){const g=m[1],S=kA(e,g,c,Yl);if(S.length>0){for(const v of S)a.add(v);h=!0}const k=CA(e,g,c,Yl);for(const v of k)a.add(v);k.length>0&&(h=!0)}h||(o=!0)}if(a.size===0||o){const l=t.length>0?[]:Kv(n,"experiments"),c=t.length>0?t:l.length>0?l:r;for(const f of c)if(a.add(f),a.size>=al)break}return pu([...a])}function ba(e){var b,w,y,C;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)):{},a={...t,...s},o=rs(a,"command","cmd"),l=slt(a,"commandArgv"),c=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),f=pu(bb(a,"targetIds")),_=pu(bb(a,"runTargetIds")),h=pu(bb(a,"experimentTargetIds")),m=rs(a,"filePath","file_path","notebookPath","notebook_path","path"),g=rs(a,"description"),S=n.toLowerCase().split(/(?::|\.|__)+/),k=S.at(-1)??n.toLowerCase();if(k==="run"&&S.includes("web")){const z=gb(a,"search_query","q"),N=gb(a,"image_query","q"),T=gb(a,"find","pattern");return z?{kind:"web",label:Gw({query:z})}:N?{kind:"web",label:oH({query:N})}:T?{kind:"web",label:CH({pattern:T})}:Array.isArray(a.open)?{kind:"web",label:EY()}:Array.isArray(a.weather)?{kind:"web",label:WK()}:Array.isArray(a.finance)?{kind:"web",label:$K()}:Array.isArray(a.sports)?{kind:"web",label:UK()}:Array.isArray(a.time)?{kind:"web",label:LK()}:{kind:"web",label:a6()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!o&&!(l!=null&&l.length))return{kind:"command",label:JY()};const z=alt(o??(l==null?void 0:l.join(" "))??""),N=mu(z);let T=N.map(ce=>ce.raw);if(l!=null&&l.length){const ce=wXe(l);T=ce===null?[l]:mu(vA(ce)).map(re=>re.raw)}let j=null;for(const ce of T)if(j=kXe(ce),j)break;const D=T.some(ce=>{const re=ku(ce);return re!==null&&re[0]!=="discover"&&re[0]!=="paper"});if(j&&!D){const ce=j.kind==="discover"?{keyword:U$(),embedding:W$(),openalex:bH(),biorxiv:Z$()}[j.strategy]:null,re=j.kind==="discover"?j.query?JI({activity:ce??qw(),query:j.query}):ce??qw():j.id?Lf({target:je(j.id)}):UB();return{kind:j.kind==="paper"?"read":"search",label:re,litCall:j}}if(vi(z,"agent\\s+spawn"))return{kind:"agent",label:fX(),spawnedSessionIds:_lt(c),litCall:j??void 0};const I=N.map(ce=>wA(ce.raw)),L=vi(z,"exp\\s+status"),U=vi(z,"exp\\s+desc"),q=$p(z,"exp\\s+desc").some(ce=>(ku(ce.raw)??[]).some(P=>P==="--set"||P.startsWith("--set=")||P==="--stdin")),W=q?JH():$B(),Z=q?gI():S$();if(vi(z,"logs")){const ce=plt(z,c,_,f);return{kind:"project",label:ce.length===1?p$():v$(),runIds:ce,litCall:j??void 0}}if(vi(z,"exp\\s+run"))return{kind:"project",label:pQ(),litCall:j??void 0};if(vi(z,"exp\\s+wait"))return{kind:"project",label:GQ(),litCall:j??void 0};if(vi(z,"exp\\s+cancel"))return{kind:"project",label:mK(),litCall:j??void 0};const X=vi(z,"project\\s+view");if(X&&L&&U)return{kind:"project",label:Z,experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(X&&U)return{kind:"project",label:W,experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(X&&L)return{kind:"project",label:o6(),experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(X)return{kind:"project",label:pZ(),litCall:j??void 0};if(L&&U)return{kind:"project",label:Z,experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(L)return{kind:"project",label:o6(),experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(U)return{kind:"project",label:W,experimentIds:Yc(z,c,h,f),litCall:j??void 0};if(vi(z,"runs?"))return{kind:"project",label:oY(),litCall:j??void 0};if(vi(z,"projects"))return{kind:"project",label:fY(),litCall:j??void 0};if(vi(z,"compute"))return{kind:"project",label:kK(),litCall:j??void 0};const J=I.map(ult).find(ce=>ce!=null);if(J){const ce=mb(J.path);return{kind:ce?"skill":"read",label:ce?h1({name:je(ce)}):Lf({target:je($l(J.path))}),filePath:J.path,fileRef:J.ref,labelTarget:ce?`${ce} skill`:$l(J.path)}}const ee=I.findIndex(ce=>ce!=null&&["sed","cat","head","tail"].includes(ce.name)),$=ee>=0?I[ee]:null,B=$?clt($):null,H=B?dlt(B,N,ee,rs(a,"cwd","workdir")):null;if(B&&H){const ce=mb(H);return{kind:ce?"skill":"read",label:ce?h1({name:je(ce)}):Lf({target:je($l(B))}),filePath:H,labelTarget:ce?`${ce} skill`:$l(B)}}if(I.some(ce=>(ce==null?void 0:ce.name)==="find"||(ce==null?void 0:ce.name)==="ls"||(ce==null?void 0:ce.name)==="rg"&&ce.args.includes("--files")))return{kind:"search",label:h6()};const K=I.findIndex(ce=>(ce==null?void 0:ce.name)==="rg"||(ce==null?void 0:ce.name)==="grep");if(K>=0){const ce=flt(N[K].raw);return{kind:"search",label:ce?p1({pattern:je(ce)}):_1(),searchPattern:ce??void 0}}const G=I.find(ce=>(ce==null?void 0:ce.name)==="git"),ie=G==null?void 0:G.args[0];if(ie==="grep"){const ce=G==null?void 0:G.args.slice(1).find(re=>!re.startsWith("-"));return{kind:"search",label:ce?p1({pattern:je(ce)}):_1(),searchPattern:ce}}if(ie==="status")return{kind:"command",label:TK()};if(ie==="diff")return{kind:"command",label:qZ()};if(ie==="log")return{kind:"command",label:fZ()};const ve=ce=>I.some(re=>!re||!["cargo","pnpm","npm","yarn"].includes(re.name)?!1:re.args[0]===ce||re.args[0]==="run"&&re.args[1]===ce);return ve("test")?{kind:"command",label:rZ()}:I.some(ce=>(ce==null?void 0:ce.name)==="tsc")||ve("typecheck")?{kind:"command",label:ZK()}:ve("lint")?{kind:"command",label:xK()}:ve("build")?{kind:"command",label:lK()}:{kind:"command",label:NB({command:je(z)})}}case"skill":{const z=rs(a,"skill","name"),N=z?rlt(n,z):null;return{kind:"skill",label:z?pB({name:je(z)}):fB(),filePath:N??void 0,labelTarget:N&&z?`${z} skill`:void 0}}case"read":{const z=m?$l(m):null,N=m?mb(m):null;return N?{kind:"skill",label:h1({name:je(N)}),filePath:m??void 0,labelTarget:`${N} skill`}:z?{kind:"read",label:Lf({target:je(z)}),filePath:m??void 0,labelTarget:z}:{kind:"read",label:oZ()}}case"edit":case"write":case"notebookedit":{const z=ilt(a),N=m??(z==null?void 0:z.path)??null,T=N?$l(N):null,j=T?(z==null?void 0:z.type)==="add"?CI({target:je(T)}):(z==null?void 0:z.type)==="delete"?II({target:je(T)}):GI({target:je(T)}):null;return T?{kind:"edit",label:j??u6(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:u6()}}case"grep":{const z=rs(a,"pattern");return{kind:"search",label:z?p1({pattern:je(z)}):_1(),searchPattern:z??void 0}}case"glob":{const z=rs(a,"pattern");return{kind:"search",label:z?rB({pattern:je(z)}):h6()}}case"websearch":{const z=rs(a,"query"),N=rs(a,"url"),T=rs(a,"pattern");return z?{kind:"web",label:Gw({query:z})}:T&&N?{kind:"web",label:_H({pattern:T})}:N?{kind:"web",label:SB({target:je(N)})}:{kind:"web",label:g??a6()}}case"webfetch":{const z=rs(a,"url");return{kind:"web",label:z?Lf({target:je(z)}):g??JB()}}case"task":return{kind:"agent",label:g??TB()};case"subagent":return{kind:"agent",label:mlt(a)};case"error":return{kind:"command",label:jQ()};case"interrupted":return{kind:"command",label:DQ()};default:{const z=g??m??o??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:z?`${n}: ${z}`:n}}}}function mlt(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 IH();case"sendInput":return RH();case"resumeAgent":return o$();case"wait":return rP();case"closeAgent":return yI()}switch(typeof e.kind=="string"?e.kind:""){case"started":return XH();case"interacted":return iI();case"interrupted":return GH()}return PH()}function B0({activity:e,className:n=""}){if(e.litCall)return d.jsx(yE,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${n}`});const t={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${n}`};switch(e.kind){case"skill":return d.jsx(U9,{...t});case"read":case"project":return d.jsx(zGe,{...t});case"search":return d.jsx(ZVe,{...t});case"edit":return d.jsx(U2,{...t});case"web":return d.jsx(yVe,{...t});case"agent":return d.jsx(V2,{...t});case"command":return d.jsx(rE,{...t})}}function vb({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,a]=R.useState(!1),o=R.useRef(null),l=R.useRef(!1);return R.useEffect(()=>{var c,f;!s||!l.current||(l.current=!1,(f=(c=o.current)==null?void 0:c.querySelector("button"))==null||f.focus())},[s]),d.jsxs("span",{className:"tool-target-overflow inline",children:[s&&d.jsx("span",{className:"tool-target-reveal",ref:o,children:e.map((c,f)=>d.jsxs("span",{children:[f>0&&", ",n||t?d.jsx("button",{className:"tool-target",...n?nr(_=>n(c.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(c.id)}},children:c.label}):d.jsx("span",{children:c.label})]},c.id))}),s&&", ",d.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?vL({target:r}):WO({count:Ht(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),l.current=!s&&c.detail===0,a(f=>!f)},children:s?f9():ine({count:Ht(e.length)})})]})}function Xv({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:a,experimentName:o}){var l,c,f,_;if(e.searchPattern)return e.label;if(((l=e.litCall)==null?void 0:l.kind)==="paper"&&e.litCall.id)return d.jsxs("a",{className:"tool-target",href:jXe(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,d.jsx(CGe,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const h=e.filePath;return d.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...nr(m=>n(h,void 0,void 0,e.fileRef,m),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const h=e.spawnedSessionIds,m=h.slice(0,3),g=h.slice(m.length).map((S,k)=>({id:S,label:t6({number:Ht(m.length+k+1)})}));return d.jsxs(d.Fragment,{children:[e.label," — ",m.map((S,k)=>d.jsxs("span",{children:[k>0&&", ",d.jsx("button",{className:"tool-target",title:wY(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(S)},children:t6({number:Ht(k+1)})})]},S)),g.length>0&&d.jsxs(d.Fragment,{children:[", ",d.jsx(vb,{items:g,onSelect:r,targetType:SG()})]})]})}if((f=e.runIds)!=null&&f.length){const h=s?e.runIds.filter(S=>!!s(S)):e.runIds;if(h.length===0)return e.label;const m=h.slice(0,3),g=h.slice(m.length).map(S=>({id:S,label:(s==null?void 0:s(S))||Ya()}));return d.jsxs(d.Fragment,{children:[e.label," — ",m.map((S,k)=>d.jsxs("span",{children:[k>0&&", ",t?d.jsx("button",{className:"tool-target",title:sO({run:je(S)}),...nr(v=>t(S,v),{stopPropagation:!0}),children:(s==null?void 0:s(S))||Ya()}):d.jsx("span",{children:(s==null?void 0:s(S))||Ya()})]},S)),g.length>0&&d.jsxs(d.Fragment,{children:[", ",d.jsx(vb,{items:g,onOpen:t,targetType:nee()})]})]})}if((_=e.experimentIds)!=null&&_.length){const h=o?e.experimentIds.filter(S=>!!o(S)):e.experimentIds;if(h.length===0)return e.label;const m=h.slice(0,3),g=h.slice(m.length).map(S=>({id:S,label:(o==null?void 0:o(S))||Ya()}));return d.jsxs(d.Fragment,{children:[e.label," — ",m.map((S,k)=>d.jsxs("span",{children:[k>0&&", ",a?d.jsx("button",{className:"tool-target",title:VL({name:(o==null?void 0:o(S))||je(S)}),...nr(v=>a(S,v),{stopPropagation:!0}),children:(o==null?void 0:o(S))||Ya()}):d.jsx("span",{children:(o==null?void 0:o(S))||Ya()})]},S)),g.length>0&&d.jsxs(d.Fragment,{children:[", ",d.jsx(vb,{items:g,onOpen:a,targetType:AV()})]})]})}return e.label}function glt(e){return a9()}function xy(e){const n={skill:vB(),read:r$(),search:AH(),edit:XI(),project:N$(),web:hI(),agent:RI(),command:L$()}[e.kind];return{...e,label:n}}function EA(e,n){const t=ba({tool:e,state:{status:"running",input:n}});return{skill:oB(),read:LB(),search:$$(),edit:PI(),project:f$(),web:cI(),agent:AI(),command:T$()}[t.kind]}function blt(e,n,t){return e.label}function vlt(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const xlt=250;function ylt(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.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 o=xlt-(Date.now()-s.current);if(o<=0){s.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{s.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const wlt=160;function NA(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),wlt);return()=>window.clearTimeout(r)},[e]),e&&n}function Slt(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:a9()}}function B8(e){var t,r;if(((t=e.state)==null?void 0:t.status)!=="completed")return null;const n=ba(e);return 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 klt(e){const n=[];for(const t of e){const r=B8(t),s=n[n.length-1];r&&s&&B8(s.part)===r?s.count++:n.push({part:t,count:1})}return n}function Clt({part:e,busy:n,recovering:t,onRecover:r}){var m,g;const s=(m=e.state)==null?void 0:m.input,a=(s==null?void 0:s.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const S=window.setInterval(()=>{const k=Date.now();l(k),k>=a&&window.clearInterval(S)},1e3);return()=>window.clearInterval(S)},[a]),e.id==="turn-retry"){const S=pXe(s??{},o);return d.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[d.jsx("span",{className:Lt}),d.jsx("span",{children:S})]})}const c=vE(s==null?void 0:s.recoveryAction),f=s==null?void 0:s.turnId;if(c!=="retry"&&c!=="continue"||!f)return null;const _=c==="retry"?A2():cV(),h=Bp(((g=e.state)==null?void 0:g.error)||qee());return d.jsxs("div",{className:"turn-recovery-row flex items-center justify-between gap-2 py-1.5 px-2.5 border border-border rounded-md bg-background",children:[d.jsx("span",{className:"min-w-0 truncate text-sm text-accent-red",title:h,children:h}),d.jsx("button",{type:"button",className:"shrink-0 h-7 px-2.5 rounded-sm border border-border bg-background text-xs font-medium text-text disabled:opacity-50 [&:hover:not(:disabled)]:bg-surface",disabled:n||t,onClick:()=>r==null?void 0:r(f,c),children:t?gee():_})]})}function $8({part:e,repeatCount:n=1,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const c=e.state,f=ba(e),_=(c==null?void 0:c.status)==="error",h=Bp((c==null?void 0:c.error)||(c==null?void 0:c.output)||""),m=_&&!!h,[g,S]=R.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,v=d.jsxs(d.Fragment,{children:[_&&d.jsxs("span",{className:"sr-only",children:[j2()," "]}),_?d.jsx(V9,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):d.jsx(B0,{activity:f,className:"text-muted self-start mt-[5px]"}),d.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${_?"text-accent-red":"text-subtext"}`,children:[d.jsx(Xv,{activity:f,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}),n>1&&d.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:NL({count:Ht(n)}),children:["×",n]})]})]});return m?d.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,d.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":k,"aria-label":g?SL({activity:f.label}):UO({activity:f.label}),onClick:()=>S(b=>!b),children:d.jsx(wa,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&d.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:d.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:h.slice(0,2e4)})})]}):d.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:v})}function Elt({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}){var z,N,T,j;const[c,f]=R.useState(!1),_=klt(e),h=_.map(({part:D})=>ba(D)),m=n?e.at(-1):void 0,g=((z=m==null?void 0:m.state)==null?void 0:z.status)!=="error"?(m&&xy(ba(m)))??null:null,S=!!m&&((N=m.state)==null?void 0:N.status)==="running"&&(vlt((T=m.state)==null?void 0:T.input)||(g==null?void 0:g.kind)==="command"&&!rs(((j=m.state)==null?void 0:j.input)??{},"command","cmd")),k=ylt(g,S),v=NA(k!=null),b=glt(),w=k??Slt(h),y=k?blt(k):b;if(e.length===1)return k?d.jsx("div",{className:"tool-group my-3.5 mx-0",children:d.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[d.jsx(B0,{activity:k,className:`${v?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),d.jsx("span",{className:`${v?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:y,children:d.jsx(Xv,{activity:k,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})})]})}):d.jsx("div",{className:"tool-group my-3.5 mx-0",children:d.jsx($8,{part:e[0],onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})});const C=c;return d.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[d.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-start",children:[d.jsx(B0,{activity:w,className:`${v?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),k?d.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${v?"tool-running-shimmer":""}`,title:y,children:d.jsx(Xv,{activity:k,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})}):d.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:()=>f(D=>!D),"aria-expanded":C,children:y}),d.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>f(D=>!D),"aria-expanded":C,"aria-label":C?iV():CV(),children:d.jsx(wa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${C?"open":""}`})})]}),d.jsx("div",{className:`tool-group-disclosure ${C?"open":""}`,"aria-hidden":!C,inert:!C,children:d.jsx("div",{className:"tool-group-disclosure-inner",children:d.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_.map(({part:D,count:I})=>d.jsx($8,{part:D,repeatCount:I,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l},D.id))})})})]})}function Nlt({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[a,o]=R.useState([]),l=!n,c=h=>n==null?void 0:n({promptId:e.id,...h});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const g=s.approved===!0?{label:DY(),icon:os,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:VY(),icon:U2,iconClass:"text-accent-amber"}:s.approved===!1?{label:BY(),icon:Gr,iconClass:"text-accent-red"}:{label:FY(),icon:wu,iconClass:"text-muted"},S=g.icon;return d.jsxs("details",{className:Qot,children:[d.jsxs("summary",{children:[d.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:s.synthesized?o9():w6()}),d.jsx(S,{size:17,strokeWidth:1.8,className:`shrink-0 ${g.iconClass}`}),d.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:g.label}),d.jsx(wa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),d.jsxs("div",{className:`${L8} ms-6`,children:[d.jsx(ga,{text:s.plan??"",onOpenFile:t}),s.note&&d.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const h=(s.answers??[]).join(", ")||s.note||"",m=(s.annotations??[]).map((g,S)=>({id:`${e.id}-annotation-${S}`,text:g.text}));return d.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[m.length>0&&d.jsx(vy,{annotations:m,variant:"sent"}),d.jsxs("details",{className:Zot,children:[d.jsxs("summary",{children:[d.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||yJ()}),d.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 ${h?"chosen":""}`,children:h||KJ()})]}),d.jsxs("div",{className:L8,children:[s.header&&s.question&&d.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&d.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(s.options??[]).map(g=>{var S;return d.jsx("li",{className:(S=s.answers)!=null&&S.includes(g.label)?"sel":"",children:g.label},g.label)})}),s.note&&s.note!==h&&d.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const h=!!r;return d.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 ${l?"readonly":""}`,children:[d.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:s.synthesized?_J():w6()}),d.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 ${h?"clamped":""}`,children:d.jsx(ga,{text:s.plan??"",onOpenFile:t})}),h&&d.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...nr(m=>r(s.plan??"",e.id,m)),children:PQ()}),!l&&!h&&d.jsxs("div",{className:Wv,children:[d.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:yW()}),d.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:CW()}),d.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:vZ()})]})]})}if(s.kind==="permission"){const h=s.toolInput??{},m=rs(h,"command","cmd","filePath","file_path","path")||"",g=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",S=rs(h,"description")||"",k=g||S||EA(s.tool,h),v=`permission-heading-${e.id}`;return d.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":v,children:[d.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[d.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:d.jsx(sE,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),d.jsx("span",{id:v,className:"text-base font-semibold text-text",children:PW()})]}),d.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[d.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),m&&d.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:m}),!l&&d.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[d.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>c({approve:!1}),children:vX()}),d.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>c({approve:!0}),children:IW()})]})]})]})}const f=h=>o(m=>s.multiSelect?m.includes(h)?m.filter(g=>g!==h):[...m,h]:[h]);return d.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 ${l?"readonly":""}`,children:[s.header&&d.jsx("div",{className:Jot,children:s.header}),s.question&&d.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),d.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(h=>{const m=a.includes(h.label);return d.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 ${m?"sel":""}`,disabled:l,onClick:()=>l?void 0:s.multiSelect?f(h.label):c({answers:[h.label]}),children:[d.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:h.label}),h.description&&d.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:h.description})]},h.label)})}),s.multiSelect&&!l&&d.jsx("div",{className:Wv,children:d.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>c({answers:a}),children:wQ()})})]})}function $0(e,n){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 Hp(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function zlt(e,n){return e.role==="user"?!0:e.parts.some(t=>$0(t,n))}function Alt(e){const n=e.text??"",t=n.startsWith("data:")?n:QKe(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",a=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:a,name:s}}const xb=[Wd,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function jlt({count:e,index:n,prevId:t,nextId:r,onSelect:s,pagerDisabled:a,onEdit:o,editDisabled:l}){const c=e>1;return d.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${c?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[c&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:xb,title:p6(),"aria-label":p6(),disabled:a||!t,onClick:()=>t&&s(t),children:d.jsx(q9,{size:14})}),d.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[n+1,"/",e]}),d.jsx("button",{className:xb,title:_6(),"aria-label":_6(),disabled:a||!r,onClick:()=>r&&s(r),children:d.jsx(wa,{size:14})})]}),d.jsx("button",{className:xb,title:c6(),"aria-label":c6(),disabled:l,onClick:o,children:d.jsx(U2,{size:13})})]})}const Tlt=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:h,onOpenSubagent:m,busy:g=!1,recoveringTurnId:S,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:z,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:D}){var W,Z;const[I,L]=R.useState(null);if(n.role==="user"){const X=n.parts.filter(K=>K.type==="text").map(K=>K.text??"").join(` -`),J=K=>!!(v!=null&&v.some(G=>G.name===K)),ee=n.parts.filter(K=>K.type==="image"&&K.text).map(Alt),$=ee.filter(K=>!K.isPdf),B=ee.filter(K=>K.isPdf),H=n.parts.filter(K=>K.type==="annotation"&&K.text).map(K=>({id:K.id,text:K.text??""}));if(I!==null){const K=()=>{const G=I.trim();!G||N||(L(null),j(n.id,G))};return d.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:d.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[d.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":EX(),value:I,autoFocus:!0,onChange:G=>L(G.target.value),onKeyDown:G=>{G.key==="Escape"?(G.preventDefault(),L(null)):G.key==="Enter"&&!G.shiftKey&&!G.nativeEvent.isComposing&&(G.preventDefault(),K())}}),d.jsxs("div",{className:`${Wv} justify-end`,children:[d.jsx("button",{className:"btn-ghost",onClick:()=>L(null),children:dK()}),d.jsx("button",{className:"btn-primary",onClick:K,disabled:N||!I.trim(),children:Vb()})]})]})})}return d.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[H.length>0&&d.jsx(vy,{annotations:H,variant:"sent"}),d.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]:me-0.5 [&_.skill-chip]:align-baseline",children:[d.jsx(wot,{text:X,isCommand:J}),$.length>0&&d.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:$.map((K,G)=>d.jsx("a",{href:K.src,target:"_blank",rel:"noreferrer",children:d.jsx("img",{src:K.src,alt:WG()})},G))}),B.length>0&&d.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:B.map((K,G)=>d.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:K.src,target:"_blank",rel:"noreferrer",children:[d.jsx(wu,{size:15}),d.jsx("span",{children:K.name})]},G))})]}),w!==void 0&&d.jsx(jlt,{count:w,index:y,prevId:C,nextId:z,onSelect:D,pagerDisabled:T,onEdit:()=>L(X),editDisabled:N})]})}const U=n.parts.find(Hp),q=U?n.parts.filter(X=>X!==U):n.parts;return d.jsxs("div",{className:"msg-assistant group/turn text-lg leading-[1.62] text-text min-w-0",children:[zA(q,{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:h,onOpenSubagent:m,predictTextTail:b}),U&&d.jsx(Clt,{part:U,busy:g,recovering:S===((Z=(W=U.state)==null?void 0:W.input)==null?void 0:Z.turnId),onRecover:k})]})});function zA(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:h,onOpenSubagent:m,predictTextTail:g=!1}=n,S=e.filter(C=>C.type!=="steer"&&$0(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(d.jsx(Elt,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f},`tg-${v[0].id}`)),v=[])};for(const C of e)if($0(C,t)){if(C.type==="tool"&&(Rlt(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),k.push(d.jsx(Llt,{part:C,pendingTail:g&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:m},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(d.jsx(ga,{text:C.text,onOpenFile:s,onOpenRun:a,predict:g&&C.id===(S==null?void 0:S.id)},C.id)):C.type==="steer"?k.push(d.jsx("div",{dir:"auto",role:"note","aria-label":rJ(),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(d.jsx(Nlt,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:h},C.id))}return b(),k}function Mlt(e){return ba(e).label}function Rlt(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function AA(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 yy(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&yy(t.children,n);if(r)return r}return null}function Dlt({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:a,onOpenSubagent:o}){var S,k,v,b;const l=e.children??[],c=((S=e.state)==null?void 0:S.status)==="running",f=((k=e.state)==null?void 0:k.status)==="error",_=f?Bp(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",h=zA(l,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:a,onOpenSubagent:o,predictTextTail:c,pendingTailToolId:c?jA(l):null}),g=l.some(w=>w.type==="text"&&!!w.text)?"":AA(e);return d.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[f&&d.jsxs("span",{className:"sr-only",children:[j2()," "]}),_&&d.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:_.slice(0,2e4)}),h.length===0&&!g&&!_?d.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:c?np():QV()}):d.jsxs(d.Fragment,{children:[h,g&&d.jsx(ga,{text:g,onOpenFile:n,onOpenRun:t})]})]})}function Llt({part:e,pendingTail:n,onOpenSubagent:t}){var f,_,h,m;const r=((f=e.state)==null?void 0:f.status)==="error",s=Bp(((_=e.state)==null?void 0:_.error)||((h=e.state)==null?void 0:h.output)||""),a=n&&!r?xy(ba(e)):ba(e),o=NA(!!(n&&!r)),l=(((m=e.children)==null?void 0:m.length)??0)===0&&!r&&!AA(e),c=d.jsxs(d.Fragment,{children:[r&&d.jsxs("span",{className:"sr-only",children:[j2()," "]}),r?d.jsx(V9,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):d.jsx(B0,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),d.jsx("span",{className:`${Iot} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?d.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-start rounded-sm [&_.tool-line]:text-lg",children:c}):d.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&s?s:_W(),...nr(g=>t==null?void 0:t(e.id,a.label,g)),disabled:!t,children:[c,d.jsx(wa,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function Olt(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,a)=>{var o,l;for(const c of s){const f=`${a}/${c.id}`;c.type==="tool"&&((o=c.state)!=null&&o.status)&&n.set(f,{status:c.state.status,part:c}),(l=c.children)!=null&&l.length&&r(c.children,f)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function wy(e){const n=(t,r)=>{var s;for(const a of t){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},f=rs(l,"reason","description")||EA(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:f}}if((s=a.children)!=null&&s.length){const l=n(a.children,`${r}/${a.id}`);if(l)return l}}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 Ilt(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var S,k,v,b,w;const s=((S=e[0])==null?void 0:S.id)??"",{messageId:a,states:o}=Olt(e),l=wy(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},t(y=>({text:l?Vw({label:eo(l.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===a?r.current.states:new Map,f=r.current.permissionPath,_=[...o].filter(([y,C])=>{var z;return((z=c.get(y))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==f){t(y=>({text:Vw({label:eo(l.label)}),sequence:y.sequence+1}));return}const h=(k=_.find(([,y])=>Hp(y.part)))==null?void 0:k[1].part;if((h==null?void 0:h.id)==="turn-recovery"){const y=vE((b=(v=h.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${BP()}${y?` ${y==="retry"?bP():_P()}`:""}`,sequence:C.sequence+1}));return}if((h==null?void 0:h.id)==="turn-retry"){t(y=>({text:uP(),sequence:y.sequence+1}));return}const m=_.filter(([,y])=>y.status==="error");if(m.length>0){const y=m.slice(0,2).map(([,C])=>ba(C.part).label).join(", ");t(C=>({text:m.length===1?jP({labels:y}):DP({count:Ht(m.length),labels:y}),sequence:C.sequence+1}));return}const g=_.filter(([,y])=>y.status==="running");if(g.length>0){const y=(w=g.at(-1))==null?void 0:w[1].part;t(C=>({text:y?xy(ba(y)).label:wP(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:EP(),sequence:y.sequence+1}))},[e]),n}function jA(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||Hp(r)||!$0(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function TA(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=jA(n.parts);return t?{messageId:n.id,toolId:t}:null}const Blt=R.memo(function({messages:n,allMessages:t,canFork:r,onFork:s,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:f,runExperimentName:_,onOpenExperiment:h,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,recoveringTurnId:v,onRecover:b,skills:w}){var D;const y=((D=wy(n))==null?void 0:D.id)??null,C=R.useMemo(()=>n.filter(I=>zlt(I,y)),[n,y]),z=R.useMemo(()=>{const I=C.filter(L=>L.role==="user"&&!L.id.startsWith(_u));return oXe(t,n,I,L=>L.startsWith(_u))},[n,C,t]),N=C.at(-1),T=Ilt(n),j=o?TA(n):null;return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:d.jsx("span",{children:T.text},T.sequence)}),C.map(I=>{var W,Z,X,J,ee,$;const L=I.parts.find(Hp),U=(Z=(W=L==null?void 0:L.state)==null?void 0:W.input)==null?void 0:Z.turnId,q=L?o||v!==null:!1;return d.jsx(Tlt,{message:I,forkCount:(X=z.get(I.id))==null?void 0:X.count,forkIndex:(J=z.get(I.id))==null?void 0:J.index,forkPrevId:(ee=z.get(I.id))==null?void 0:ee.prevId,forkNextId:($=z.get(I.id))==null?void 0:$.nextId,forkDisabled:!r,branchDisabled:o,onFork:s,onSelectFork:a,activePermissionId:y,pendingTailToolId:(j==null?void 0:j.messageId)===I.id?j.toolId:null,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:f,runExperimentName:_,onOpenExperiment:h,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,busy:q,recoveringTurnId:U===v?v:null,onRecover:b,skills:w,predictTextTail:o&&I===N&&I.role==="assistant"},I.id)})]})}),H8=(e,n)=>e==="all"?!0:e==="archived"?n:!n,MA=[{id:"active",label:AW,railLabel:l9},{id:"archived",label:s6,railLabel:s6},{id:"all",label:RW,railLabel:NG}];function $lt({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=_o();return d.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[d.jsx("button",{className:`${Wd} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:d6(),"aria-label":d6(),onClick:()=>r(a=>!a),children:d.jsx(sWe,{size:13})}),t&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:MA.map(a=>d.jsxs("button",{className:Vr,onClick:()=>{n(a.id),r(!1)},children:[d.jsx("span",{children:a.label()}),e===a.id&&d.jsx(os,{size:13})]},a.id))})]})}const Hlt=14,Plt=500,Flt=1200;function RA({title:e,animate:n}){return n?d.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?d.jsx("span",{"aria-hidden":!0,children:t},r):d.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*Hlt,Plt)}ms`},children:t},r))}):d.jsx(d.Fragment,{children:e})}function Ult({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:a,onOpen:o,onRename:l,onSetArchived:c,onDelete:f}){var z;const{open:_,setOpen:h,ref:m}=_o(),g=((z=e.title)==null?void 0:z.trim())||"Untitled",[S,k]=R.useState(!1),[v,b]=R.useState(""),w=R.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())||"")&&l(N)}return R.useEffect(()=>{var N,T;S&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[S]),d.jsxs("div",{ref:m,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-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${S?"editing":""}`,title:`${Yf[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?hee():""}`,onClick:()=>{S||(_?h(!1):o())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?h(!1):o())},children:[d.jsx("span",{className:"session-dot",children:r?d.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&d.jsx("span",{className:"unread-dot"})}),e.parentSessionId&&!S&&d.jsx(V2,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),S?d.jsx("input",{ref:w,className:"session-title-input","aria-label":lQ(),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))}}):d.jsx("span",{className:"session-title",children:d.jsx(RA,{title:g,animate:a!==void 0},a??"static")}),d.jsx("span",{className:"session-time",children:nlt(e.updatedAt)}),d.jsx("button",{className:"session-menu-btn",title:v6(),"aria-label":v6(),onClick:N=>{N.stopPropagation(),h(T=>!T)},children:d.jsx(X9,{size:14})}),_&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[d.jsx("button",{className:Vr,onClick:N=>{N.stopPropagation(),h(!1),y()},children:d.jsx("span",{children:HZ()})}),d.jsx("button",{className:Vr,onClick:N=>{N.stopPropagation(),h(!1),c(!e.archived)},children:d.jsx("span",{children:e.archived?Qee():LG()})}),d.jsx("button",{className:`${Vr} danger`,onClick:N=>{N.stopPropagation(),h(!1),f()},children:d.jsx("span",{children:pX()})})]})]})}function qlt({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:a,onSelectMainView:o,experimentsActive:l,filesActive:c,artifactsActive:f,onOpenExperiments:_,onOpenArtifacts:h,onOpenFile:m,onOpenRun:g,runExperimentName:S,onOpenExperiment:k,experimentName:v,onOpenPlan:b,onOpenSubagent:w,onOpenWorktree:y,onOpenDemoWelcome:C,onActiveSessionChange:z,preferredAgent:N,onPreferredAgentChange:T,children:j}){var se,ye,Ne;const[D,I]=R.useState([]),[L,U]=R.useState(null),[q,W]=R.useState(new Set),[Z,X]=R.useState("active"),[J,ee]=R.useState(""),[$,B]=R.useState([]),H=R.useRef(0),K=R.useRef({projectId:e,activeId:L});K.current={projectId:e,activeId:L};const[G,ie]=R.useState([]),[ve,ce]=R.useState(null),[re,P]=R.useState(null),oe=R.useRef(Promise.resolve()),ue=R.useRef(0),de=R.useRef(0),[ge,Ee]=R.useState(null),Ae=R.useRef(null),He=R.useRef(!1),Re=R.useRef(null),[Ie,nt]=R.useReducer(tlt,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[Rt,At]=R.useState([]),[bt,Mt]=R.useState(N);R.useEffect(()=>Mt(N),[N]);const[Ct,ut]=R.useState({}),[ht,we]=R.useState({}),[Le,Ge]=R.useState(null),et=R.useRef(!1),st=R.useRef(null),[Dt,vt]=R.useState(null),It=R.useRef(null),[Zt,cn]=R.useState(new Map),xt=R.useRef(new Map),Sn=R.useRef(new Set),un=R.useRef(new Set),Xe=R.useRef(0),lt=R.useRef([]),gn=R.useRef(null),Cr=R.useRef(null),Be=R.useRef(!0),Qe=R.useRef(null),St=_o(),fn=R.useCallback(Y=>{var ae;H.current+=1,B(be=>[...be,{id:`annotation-${H.current}`,...Y}]),(ae=Qe.current)==null||ae.focus()},[]),nn=Vot(Cr,fn);Wot($),R.useEffect(()=>{B([]),nn.dismiss()},[L,e,nn.dismiss]);const[Ns,cs]=R.useState([]),[us,zs]=R.useState(0),[Wi,ei]=R.useState(!1),[ti,jr]=R.useState(0),Pr=R.useRef(!1);R.useEffect(()=>{DKe(e).then(cs).catch(()=>{})},[e,a]);function Tr(Y){if(!dn)return;if(Y.source==="command"&&Y.name==="plan"){vr(J,dn);return}const ae=A8(J,dn,Y.name,2);ee(ae.text),window.requestAnimationFrame(()=>{var be,me;(be=Qe.current)==null||be.focus(),(me=Qe.current)==null||me.setSelectionRange(ae.cursor,ae.cursor),jr(ae.cursor)})}function En(Y){const ae=Y.selectionStart;if(Pr.current||ae!==Y.selectionEnd)return!1;const be=db(J,ae);if(!be||be.end!==ae||!Jr(be.query))return!1;const me=j8(J,be);return ee(me.text),jr(me.cursor),window.requestAnimationFrame(()=>Y.setSelectionRange(me.cursor,me.cursor)),!0}function sn(Y){ce(null);let me=G.reduce((Te,We)=>Te+We.size,0);for(const Te of Y){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Te.type))continue;if(Te.size>31457280){ce(ZG({name:je(Te.name)}));continue}if(me+Te.size>41943040){ce(tV());continue}me+=Te.size;const We=new FileReader;We.onload=()=>{const bn=We.result;ie(zn=>[...zn,{dataUrl:bn,mediaType:Te.type,name:Te.name,size:Te.size}])},We.readAsDataURL(Te)}}function kn(Y){const ae=Array.from(Y.clipboardData.items).filter(be=>be.kind==="file"&&(be.type.startsWith("image/")||be.type==="application/pdf")).map(be=>be.getAsFile()).filter(be=>be!==null);ae.length>0&&(Y.preventDefault(),sn(ae))}const pt=D.find(Y=>Y.id===L),Yn=bt??mat(Rt),Fr=pt?{harness:pt.harness,model:Ct.model??pt.model,serviceTier:Ct.serviceTier!==void 0?Ct.serviceTier:pt.serviceTier,permissionMode:Ct.permissionMode??pt.permissionMode,reasoningLevel:Ct.reasoningLevel??pt.reasoningLevel}:Yn?{...Yn,...Ct}:null,Ke=Fr?Rt.find(Y=>Y.id===Fr.harness):void 0,ft=Ke==null?void 0:Ke.options,Mn=R.useMemo(()=>mot(Ns,ft==null?void 0:ft.planActivation),[Ns,ft==null?void 0:ft.planActivation]),dn=db(J,ti),rr=(dn==null?void 0:dn.query)??null,As=rr===null?[]:Mn.filter(Y=>Y.name.startsWith(rr)),Mr=rr!==null&&(dn==null?void 0:dn.end)===ti&&As.some(Y=>Y.name!==rr)&&!Wi?As:[],Cn=Mr.length>0,ni=Math.min(us,Math.max(0,Mr.length-1));R.useEffect(()=>zs(0),[rr]);const qt=Fr&&{...Fr,serviceTier:S0(Ke,Fr.model,Fr.serviceTier),reasoningLevel:gE(Ke,Fr.model,Fr.reasoningLevel)},fs=fp(Ke,qt==null?void 0:qt.model),Zn=Y=>{if(!qt)return;const ae={...qt,...Y},be={};Y.model!==void 0&&Y.model!==qt.model&&(be.model=Y.model),Y.serviceTier!==void 0&&Y.serviceTier!==qt.serviceTier&&(be.serviceTier=Y.serviceTier),Y.permissionMode!==void 0&&Y.permissionMode!==qt.permissionMode&&(be.permissionMode=Y.permissionMode),Y.reasoningLevel!==void 0&&Y.reasoningLevel!==qt.reasoningLevel&&(be.reasoningLevel=Y.reasoningLevel),we(me=>({...me,...be})),Mt(ae),T(ae).catch(()=>{}),pt?ut(me=>({...me,...Y})):Y.harness&&Y.harness!==qt.harness&&ut({})},br=R.useCallback(Y=>{const ae=oe.current.catch(()=>{}).then(Y);return oe.current=ae.then(()=>{},()=>{}),ae},[]),ds=Y=>{if(Y==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(we(me=>({...me,permissionMode:Y})),ut(me=>({...me,permissionMode:Y}))):(ut(me=>{const Te={...me};return delete Te.permissionMode,Te}),Zn({permissionMode:Y})),!pt)return;const ae=pt.id,be=++ue.current;P(null),br(()=>XKe(ae,Y)).then(me=>{I(Te=>Te.map(We=>We.id===me.id?me:We)),ue.current===be&&ut(Te=>{const We={...Te};return delete We.permissionMode,We})}).catch(()=>{ue.current===be&&(ut(me=>{const Te={...me};return delete Te.permissionMode,Te}),P(ite()))})},Ki=Y=>Zn({reasoningLevel:Y}),Ci=(qt==null?void 0:qt.harness)==="claude-code"?qt.permissionMode==="plan":(ft==null?void 0:ft.planActivation)==="command"?ge??(pt==null?void 0:pt.planMode)??!1:!1;R.useEffect(()=>{ge===null||(pt==null?void 0:pt.planMode)!==ge||(Ae.current=null,Ee(null))},[pt==null?void 0:pt.planMode,ge]);async function ri(Y){if(we(me=>({...me,planMode:Y})),Ae.current=Y,Ee(Y),!pt)return;const ae=pt.id,be=++de.current;P(null);try{const me=await br(()=>KKe(ae,Y));I(Te=>Te.map(We=>We.id===me.id?me:We)),de.current===be&&(Ae.current=null,Ee(null),P(null))}catch(me){throw de.current===be&&(Ae.current=null,Ee(null)),me}}async function si(){if((qt==null?void 0:qt.harness)==="claude-code"){ds("auto");return}if(pt)try{await ri(!1)}catch{P(yV())}}async function Er(){const Y=!Ci;try{if((qt==null?void 0:qt.harness)==="claude-code")ds(Y?"plan":"auto");else if((ft==null?void 0:ft.planActivation)==="command")await ri(Y);else throw new Error(S6())}catch{P(k6())}}function vr(Y,ae){const be=j8(Y,ae);ee(be.text),ei(!0),Er(),window.requestAnimationFrame(()=>{var me,Te;(me=Qe.current)==null||me.focus(),(Te=Qe.current)==null||Te.setSelectionRange(be.cursor,be.cursor),jr(be.cursor)})}lt.current=D;const Ts=R.useCallback(async()=>{const Y=lt.current.map(ae=>ae.id);try{const ae=(await J_(e)).filter(me=>!un.current.has(me.id)),be=new Set(ae.map(me=>me.id));for(const me of Y)be.has(me)||Jn(me);return I(me=>{const Te=new Map(me.map(We=>[We.id,We.contextUsage]));return ae.map(We=>({...We,contextUsage:We.contextUsage??Te.get(We.id)}))}),xt.current=new Map(ae.map(me=>[me.id,me.title])),nt({type:"seedBusy",sessions:ae.filter(me=>me.busy).map(me=>me.id),known:ae.map(me=>me.id)}),ae}catch{return null}},[e]),xr=R.useCallback(async Y=>{const ae=K.current.activeId===Y?st.current:void 0,[{messages:be,queued:me,activeLeafId:Te}]=await Promise.all([au(Y),Ts()]),We=ae!==void 0&&K.current.activeId===Y&&st.current!==ae;nt({type:"seed",sessionId:Y,messages:be,queued:me,activeLeafId:We?st.current:Te})},[Ts,nt]);R.useEffect(()=>{I([]),lt.current=[],U(null);const Y=pA();W(e===x1?new Set([iE,aE].filter(ae=>!Y.has(ae))):new Set),ee(""),ie([]),nt({type:"reset"}),Sn.current=new Set,cn(new Map),xt.current=new Map,Ts().then(ae=>{ae&&U(be=>{var me,Te;return be??(e===x1?(me=ae.find(We=>We.id===Jf))==null?void 0:me.id:void 0)??((Te=ae.find(We=>!We.archived))==null?void 0:Te.id)??null})})},[e,Ts]),R.useEffect(()=>{we({}),It.current=null},[L]),R.useEffect(()=>{!L||Sn.current.has(L)||(Sn.current.add(L),au(L).then(({messages:Y,queued:ae,activeLeafId:be})=>nt({type:"seed",sessionId:L,messages:Y,queued:ae,activeLeafId:be})).catch(()=>{nt({type:"seed",sessionId:L,messages:[],onlyIfAbsent:!0}),Sn.current.delete(L)}))},[L]),R.useEffect(()=>dd(Y=>{switch(Y.type){case"session":{if(Y.session.projectId!==e||un.current.has(Y.session.id))return;const ae=xt.current.has(Y.session.id),be=xt.current.get(Y.session.id)!==Y.session.title;xt.current.set(Y.session.id,Y.session.title),ae&&be&&Y.session.titleSource==="generated"&&(cn(me=>{const Te=new Map(me);return Te.set(Y.session.id,(me.get(Y.session.id)??0)+1),Te}),window.setTimeout(()=>{cn(me=>{if(!me.has(Y.session.id))return me;const Te=new Map(me);return Te.delete(Y.session.id),Te})},Flt)),I(me=>{const Te=me.findIndex(bn=>bn.id===Y.session.id);if(Te<0)return[Y.session,...me];const We=me.slice();return We[Te]={...Y.session,contextUsage:Y.session.contextUsage??me[Te].contextUsage},We});break}case"sessionDeleted":Jn(Y.sessionId);break;case"message":Xe.current++,nt({type:"upsertMessage",sessionId:Y.sessionId,message:Y.message});break;case"busy":nt({type:"busy",sessionId:Y.sessionId,busy:Y.busy});break;case"queued":nt({type:"setQueued",sessionId:Y.sessionId,items:Y.items});break;case"branch":nt({type:"activeLeaf",sessionId:Y.sessionId,leafId:Y.activeLeafId});break;case"usage":I(ae=>ae.map(be=>be.id===Y.sessionId?{...be,contextUsage:Y.usage}:be));break}}),[e]),R.useEffect(()=>dd(Y=>{if(Y.type!=="reconnected"||(Ts(),!L||!Sn.current.has(L)))return;const ae=be=>{const me=Xe.current;au(L).then(({messages:Te,queued:We,activeLeafId:bn})=>{nt({type:"seed",sessionId:L,messages:Te,queued:We,activeLeafId:bn}),be&&Xe.current!==me&&ae(!1)}).catch(()=>{})};ae(!0)}),[L,Ts]);const ii=L?Ie.messagesBySession[L]??O8:O8,Ms=L?Ie.activeLeafBySession[L]??null:null;st.current=Ms;const Nn=R.useMemo(()=>iXe(ii,Ms),[ii,Ms]),Gn=L?Ie.busySessions.has(L):!1,sr=!Gn&&!!(Ke!=null&&Ke.agentReady),Xi=Gn&&TA(Nn)!=null,Nr=L?Ie.queuedBySession[L]??[]:[],Ei=Nr.some(Y=>Y.dispatchState==="retrying"),ai=Nr.findIndex(Y=>Y.dispatchState==="blocked"),Rr=Nr.reduce((Y,ae)=>ae.dispatchState!=="retrying"||typeof ae.nextRetryAt!="number"?Y:Y===null?ae.nextRetryAt:Math.min(Y,ae.nextRetryAt),null),[Aa,hs]=R.useState(()=>Date.now());R.useEffect(()=>{if(!Ei||Rr===null||(hs(Date.now()),Rr<=Date.now()))return;const Y=window.setInterval(()=>{const ae=Date.now();hs(ae),ae>=Rr&&window.clearInterval(Y)},1e3);return()=>window.clearInterval(Y)},[Ei,Rr]),R.useEffect(()=>{const Y=Nr.reduce((ae,be)=>be.planMode??ae,void 0);Y!==void 0?(He.current=!0,Ae.current=Y,Ee(Y)):He.current&&(He.current=!1,Ae.current=null,Ee(null))},[Nr]);const Wu=!!L&&!(L in Ie.messagesBySession),go=R.useMemo(()=>{const Y=new Set;for(const ae of Ie.busySessions)(Ie.messagesBySession[ae]??[]).some(be=>be.parts.some(me=>me.type==="prompt"&&me.prompt&&!me.prompt.resolved&&me.prompt.nativeId))&&Y.add(ae);return Y},[Ie.busySessions,Ie.messagesBySession]),_s=L?go.has(L):!1,$n=pt,_c=$n?Zt.get($n.id):void 0,Dr=R.useMemo(()=>{var Y;for(let ae=Nn.length-1;ae>=0;ae--)for(const be of Nn[ae].parts)if(be.type==="prompt"&&((Y=be.prompt)==null?void 0:Y.kind)==="plan"&&!be.prompt.resolved)return{promptId:be.id,plan:be.prompt.plan??"",synthesized:!!be.prompt.synthesized};return null},[Nn]),Qr=R.useMemo(()=>{const Y=$n==null?void 0:$n.harness;if(!L||Y!=="claude-code"&&Y!=="codex")return null;for(let ae=Nn.length-1;ae>=0;ae--)for(const be of Nn[ae].parts)if(!(be.type!=="prompt"||!be.prompt||be.prompt.resolved)&&be.prompt.kind==="question")return be.prompt.nativeId&&!Ie.busySessions.has(L)?null:be.id;return null},[Nn,$n==null?void 0:$n.harness,L,Ie.busySessions]),Jr=Y=>!Qr&&Mn.some(ae=>ae.name===Y),[ps,ja]=R.useState(null),oi=ps&&ps.sessionId===L?ps:null;R.useEffect(()=>{if(!ps)return;const Y=Ie.busySessions.has(ps.sessionId),ae=ps.sessionId===L&&Dr&&Dr.promptId!==ps.promptId;(!Y||ae)&&ja(null)},[ps,Dr,Ie.busySessions,L]);const li=R.useMemo(()=>wy(Nn),[Nn]),bo=Gn&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Dr&&!Qr&&!li&&G.length===0&&$.length===0,Yi=R.useMemo(()=>b&&L?(Y,ae,be)=>b(Y,L,ae,be):void 0,[b,L]),pc=R.useMemo(()=>w&&L?(Y,ae,be)=>w(L,Y,ae,be):void 0,[w,L]),Ni=R.useMemo(()=>m&&((Y,ae,be,me,Te)=>m(Y,L??void 0,ae,be,me,Te)),[m,L]);R.useEffect(()=>{ue.current+=1,de.current+=1;const Y=(L?Ie.queuedBySession[L]??[]:[]).reduce((ae,be)=>be.planMode??ae,void 0);He.current=Y!==void 0,Ae.current=Y??null,Ee(Y??null),ut({}),P(null)},[L]),R.useEffect(()=>{z==null||z(L)},[L,z]);const es=a==="chat"&&(Nn.length>0||Gn);R.useLayoutEffect(()=>{Be.current=!0;const Y=gn.current;Y&&(Y.scrollTop=Y.scrollHeight)},[L,es]),R.useLayoutEffect(()=>{const Y=gn.current;Y&&Be.current&&(Y.scrollTop=Y.scrollHeight)},[Nn,Gn]),R.useEffect(()=>{const Y=gn.current,ae=Cr.current;if(!Y||!ae)return;const be=new ResizeObserver(()=>{Be.current&&(Y.scrollTop=Y.scrollHeight)});return be.observe(ae),be.observe(Y),()=>be.disconnect()},[es]);async function Zi({queue:Y=!1}={}){var hh,bc,yo,_h,Xu;const ae=J.trim(),be=Qr?null:got(ae,ft==null?void 0:ft.planActivation),me=!!be,Te=!Ci,We=bot(ft==null?void 0:ft.planActivation,me?Te:void 0,Ae.current),bn=me&&(Ke==null?void 0:Ke.id)==="claude-code"?Te?"plan":"auto":void 0,zn=be?be.prompt:ae,Vn=G,ir=$,ta=ir.map(rn=>({text:rn.text})),na=e;let xo=L;const Ta=()=>{const rn=K.current;return rn.projectId===na&&rn.activeId===xo},gc=()=>{Ta()&&(ee(rn=>rn||ae),ie(rn=>rn.length?rn:Vn),B(rn=>rn.length?rn:ir))};if(me&&!zn&&Vn.length===0&&ir.length===0){ee(""),ei(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ds(Te?"plan":"auto");else if((ft==null?void 0:ft.planActivation)==="command")await ri(Te);else throw new Error(S6())}catch{P(k6()),gc()}return}const Pn=qt?{...qt,...bn?{permissionMode:bn}:{}}:null;bn&&ds(bn);let Ku=null;const fh=Ae.current;me&&(ft==null?void 0:ft.planActivation)==="command"&&(Ku=++de.current,Ae.current=Te,Ee(Te));const gl=()=>{Ku===null||de.current!==Ku||(Ae.current=fh,Ee(fh))};if(!zn&&Vn.length===0&&ir.length===0)return;if((zn||ir.length>0)&&Qr&&Vn.length===0){ee(""),B([]),ui({promptId:Qr,answers:[],note:zn||void 0,annotations:ta}).then(rn=>{rn||gc()});return}const dh=JSON.stringify({text:zn,images:Vn.map(rn=>({mediaType:rn.mediaType,name:rn.name,dataUrl:rn.dataUrl})),annotations:ta,settings:Pn?{model:Pn.model,serviceTier:Pn.serviceTier,permissionMode:Pn.permissionMode,planMode:We,reasoningLevel:Pn.reasoningLevel}:null}),bl=((hh=It.current)==null?void 0:hh.signature)===dh?It.current.id:`ct_${crypto.randomUUID()}`;if(It.current={signature:dh,id:bl},Gn){if(!L||!(Ke!=null&&Ke.agentReady)){gl();return}const rn=L;ee(""),ie([]),B([]),ce(null);const ra=Pn?{model:Pn.model,serviceTier:Pn.serviceTier,permissionMode:Pn.permissionMode,planMode:(ft==null?void 0:ft.planActivation)==="command"?We??(pt==null?void 0:pt.planMode):We,reasoningLevel:Pn.reasoningLevel}:{};ut({});const sa=Vn.map(ar=>({mediaType:ar.mediaType,dataBase64:ar.dataUrl.slice(ar.dataUrl.indexOf(",")+1),name:ar.name}));try{(bc=(await br(()=>g7(rn,zn,ra,sa.length?sa:void 0,ta,bl,bo&&!Y&&!me?"steer":void 0))).turn)!=null&&bc.existing&&await xr(rn),we({}),((yo=It.current)==null?void 0:yo.id)===bl&&(It.current=null)}catch{gl(),gc()}return}if(!(Ke!=null&&Ke.agentReady)){gl();return}if(!Pn){gl();return}ee(""),ie([]),B([]),ce(null);let ji=L;try{if(!ji){const yr=await qKe(e,Pn.harness,{model:Pn.model,serviceTier:Pn.serviceTier,permissionMode:Pn.permissionMode,planMode:We,reasoningLevel:Pn.reasoningLevel});Sn.current.add(yr.id),I(hm=>[yr,...hm]),U(yr.id),ji=yr.id,xo=yr.id,K.current={projectId:e,activeId:yr.id}}nt({type:"optimisticUser",sessionId:ji,text:zn||UG(),attachments:Vn.map(yr=>({url:yr.dataUrl,mediaType:yr.mediaType,name:yr.name})),annotations:ir}),nt({type:"busy",sessionId:ji,busy:!0}),Be.current=!0,Z==="archived"&&X("active");const rn=Pn?{model:Pn.model,serviceTier:Pn.serviceTier,permissionMode:Pn.permissionMode,planMode:We,reasoningLevel:Pn.reasoningLevel}:{};ut({});const ra=Vn.map(yr=>({mediaType:yr.mediaType,dataBase64:yr.dataUrl.slice(yr.dataUrl.indexOf(",")+1),name:yr.name})),sa=ji;if(!sa)throw new Error(cee());(_h=(await br(()=>g7(sa,zn,rn,ra.length?ra:void 0,ta,bl))).turn)!=null&&_h.existing&&await xr(sa),we({}),((Xu=It.current)==null?void 0:Xu.id)===bl&&(It.current=null)}catch(rn){if(gc(),gl(),!ji)return;const ra=rn instanceof Error?rn.message:String(rn);if(!/session is busy/i.test(ra)&&await J_(e).then(ar=>{var Ti;return!!((Ti=ar.find(yr=>yr.id===ji))!=null&&Ti.busy)}).catch(()=>!1)){Ta()&&(ee(ar=>ar===zn?"":ar),ie(ar=>ar===Vn?[]:ar),B(ar=>ar===ir?[]:ar));return}nt({type:"busy",sessionId:ji,busy:!1}),nt({type:"localError",sessionId:ji,text:PV({error:je(ra)})})}}function zi(){L&&nXe(L).catch(()=>{P(Cee())})}const Qn=R.useCallback(async(Y,ae)=>{if(!(!L||et.current)){et.current=!0,P(null),Ge(Y);try{const be=gXe({model:ht.model,serviceTier:ht.serviceTier,permissionMode:ht.permissionMode,planMode:ht.planMode,reasoningLevel:ht.reasoningLevel}),me=L;(await JKe(me,Y,ae,be)).turn.existing&&await xr(me),we({})}catch{P(OJ())}finally{et.current=!1,Ge(null)}}},[L,ht,xr]),Hn=R.useCallback((Y,ae)=>{if(!L||Gn||!(Ke!=null&&Ke.agentReady))return;const be=L;nt({type:"busy",sessionId:be,busy:!0}),Be.current=!0,br(()=>eXe(be,Y,ae)).catch(me=>{nt({type:"busy",sessionId:be,busy:!1});const Te=me instanceof Error?me.message:String(me);nt({type:"localError",sessionId:be,text:qJ({error:je(Te)})})})},[L,Gn,Ke==null?void 0:Ke.agentReady,br]),Ai=R.useCallback(Y=>{if(!L||Gn)return;const ae=L,be=st.current;nt({type:"activeLeaf",sessionId:ae,leafId:Y}),br(()=>tXe(ae,Y)).catch(me=>{nt({type:"activeLeaf",sessionId:ae,leafId:be});const Te=me instanceof Error?me.message:String(me);nt({type:"localError",sessionId:ae,text:Aee({error:je(Te)})})})},[L,Gn,br]);function hl(Y){if(!L)return;const ae=L;YKe(ae,Y).then(({removed:be})=>{if(be)return xr(ae)}).catch(()=>P(HJ()))}async function Rs(Y){if(!L||Dt)return;const ae=L;P(null),vt(Y);try{await ZKe(ae,Y),await xr(ae)}catch{P(QJ())}finally{vt(null)}}R.useEffect(()=>{if(!Gn||a!=="chat")return;function Y(ae){var be;ae.key!=="Escape"||ae.defaultPrevented||(ae.preventDefault(),zi(),(be=Qe.current)==null||be.focus())}return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[Gn,L,a]);function Jn(Y){un.current.add(Y),I(ae=>ae.filter(be=>be.id!==Y)),U(ae=>ae===Y?null:ae),W(ae=>{if(!ae.has(Y))return ae;const be=new Set(ae);return be.delete(Y),be}),Sn.current.delete(Y),xt.current.delete(Y),nt({type:"forget",sessionId:Y})}function _l(Y,ae){const be=Y.archived;I(me=>me.map(Te=>Te.id===Y.id?{...Te,archived:ae}:Te)),H8(Z,ae)||U(me=>me===Y.id?null:me),VKe(Y.id,ae).catch(()=>{I(me=>me.map(Te=>Te.id===Y.id?{...Te,archived:be}:Te))})}function an(Y,ae){const be=Y.title;I(me=>me.map(Te=>Te.id===Y.id?{...Te,title:ae}:Te)),WKe(Y.id,ae).catch(()=>{I(me=>me.map(Te=>Te.id===Y.id?{...Te,title:be}:Te))})}async function ci(Y){var be;const ae=((be=Y.title)==null?void 0:be.trim())||g1();if(window.confirm(hV({title:eo(ae)}))){try{await GKe(Y.id)}catch(me){window.alert(gV({title:eo(ae),error:je(me instanceof Error?me.message:String(me))}));return}Jn(Y.id)}}const ui=R.useCallback(Y=>{if(!L)return Promise.resolve(!1);const ae=L;return nt({type:"busy",sessionId:ae,busy:!0}),br(()=>rXe(ae,Y)).then(()=>!0).catch(()=>!1).finally(()=>{au(ae).then(({messages:be,queued:me,activeLeafId:Te})=>nt({type:"seed",sessionId:ae,messages:be,queued:me,activeLeafId:Te})).catch(()=>{}),J_(e).then(be=>{var me;return nt({type:"busy",sessionId:ae,busy:!!((me=be.find(Te=>Te.id===ae))!=null&&me.busy)})}).catch(()=>{})})},[L,e,br]),Qi=D.filter(Y=>H8(Z,Y.archived)),Ji=/Mac|iPhone|iPad/.test(navigator.platform),vo=Ji?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",Kt=Ji?"⌘ Enter":"Ctrl + Enter",Ur=R.useCallback(()=>{X("active"),U(null),o("chat")},[o]),ea=R.useCallback(Y=>{X("all"),U(Y),o("chat")},[o]);R.useEffect(()=>{const Y=ae=>{ae.repeat||ae.key!=="Enter"||!ae.metaKey&&!ae.ctrlKey||ae.altKey||!ae.shiftKey||(ae.preventDefault(),Ur())};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[Ur]);const pl=d.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]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg overflow-visible ${rv}`,children:[t,d.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[d.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 [&.active]:bg-panel [&.active]:font-semibold ${c?"active":""}`,onClick:y,children:[d.jsx(fd,{size:15}),UX()]}),d.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 [&.active]:bg-panel [&.active]:font-semibold ${f?"active":""}`,"data-onboarding":"nav-artifacts",onClick:h,children:[d.jsx(F2,{size:15}),KW()]}),d.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 [&.active]:bg-panel [&.active]:font-semibold ${l?"active":""}`,onClick:_,children:[d.jsx(Z9,{size:15}),OX()]}),d.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 [&.active]:bg-panel [&.active]:font-semibold ${a==="skills"?"active":""}`,onClick:()=>o("skills"),children:[d.jsx(U9,{size:15}),sX()]}),fot.map(Y=>d.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 [&.active]:bg-panel [&.active]:font-semibold ${a!=="chat"&&a!=="skills"&&Y.activeTabs.includes(a)?"active":""}`,"data-onboarding":Y.id==="compute"?"nav-compute":void 0,onClick:()=>o(Y.id),children:[Y.icon,Y.label]},Y.id))]}),d.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-1.5 ps-4.5",children:[d.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((se=MA.find(Y=>Y.id===Z))==null?void 0:se.railLabel())??l9()}),d.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[d.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":vo,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Ur,children:[d.jsx(q2,{size:13}),EQ()]}),d.jsx($lt,{value:Z,onChange:X})]})]}),d.jsxs("div",{className:"rail-body",children:[Qi.map(Y=>d.jsx(Ult,{session:Y,active:Y.id===L&&a==="chat",unread:q.has(Y.id),busy:Ie.busySessions.has(Y.id),waiting:go.has(Y.id),revealTitle:Zt.get(Y.id),onOpen:()=>{U(Y.id),e===x1&&Not(Y.id),W(ae=>{if(!ae.has(Y.id))return ae;const be=new Set(ae);return be.delete(Y.id),be}),o("chat")},onRename:ae=>an(Y,ae),onSetArchived:ae=>_l(Y,ae),onDelete:()=>void ci(Y)},Y.id)),Qi.length===0&&d.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Z==="archived"?nW():D.length>0?KV():aW()})]})]}),mc=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${r?"":" rail-hidden"}`,ml=!r&&d.jsx("button",{className:mn,title:x6(),"aria-label":x6(),onClick:s,children:d.jsx(eE,{size:15})});return a!=="chat"?d.jsxs(d.Fragment,{children:[r&&pl,d.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&d.jsx("div",{className:mc,children:ml}),d.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:j})]})]}):d.jsxs(d.Fragment,{children:[r&&pl,d.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[d.jsxs("div",{className:mc,children:[ml,d.jsx("div",{className:hd,title:$n?((ye=$n.title)==null?void 0:ye.trim())||g1():n6(),children:$n?d.jsx(RA,{title:((Ne=$n.title)==null?void 0:Ne.trim())||g1(),animate:_c!==void 0},_c??"static"):n6()}),C&&d.jsx("button",{className:mn,"data-tip":r6(),"aria-label":r6(),onClick:C,children:d.jsx(HGe,{size:15})})]}),Wu?d.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:[d.jsx("span",{className:Lt}),d.jsx("span",{children:pY()})]}):es?d.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:gn,onScroll:Y=>{const ae=Y.currentTarget;Be.current=ae.scrollHeight-ae.scrollTop-ae.clientHeight<60,nn.dismiss()},children:d.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:Cr,children:[d.jsx(Blt,{messages:Nn,allMessages:ii,canFork:sr,onFork:Hn,onSelectFork:Ai,busy:Gn,onOpenFile:Ni,onOpenRun:g,onOpenSpawnedSession:ea,runExperimentName:S,onOpenExperiment:k,experimentName:v,onRespond:ui,onOpenPlan:Yi,onOpenSubagent:pc,recoveringTurnId:Le,onRecover:Qn,skills:Mn}),Gn&&(_s?d.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:XQ()}):d.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[d.jsx("span",{className:Lt})," ",Xi?np():Iee()]}))]})}):d.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:[d.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:d.jsx(Y2,{})}),d.jsx("h2",{children:JQ()}),d.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[d.jsx(fd,{size:19}),d.jsx("span",{children:n})]})]}),nn.action&&d.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:nn.action.x,top:nn.action.top,transform:"translateX(-50%)"},onMouseDown:Y=>Y.preventDefault(),onClick:nn.add,children:[d.jsx(J9,{size:14}),QW()]}),d.jsxs("div",{className:"composer py-5 px-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:start-0 [&::before]:end-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Dr&&!(oi&&Dr.promptId===oi.promptId)&&d.jsx(Zit,{synthesized:Dr.synthesized,agentLabel:$n?Yf[$n.harness]:Ree(),showResumeModes:($n==null?void 0:$n.harness)==="claude-code",onView:Y=>Yi==null?void 0:Yi(Dr.plan,Dr.promptId,Y),onApprove:Y=>ui({promptId:Dr.promptId,approve:!0,...Y?{resumeMode:Y}:{}}),onReject:()=>ui({promptId:Dr.promptId,approve:!1}),onRevise:Y=>{L&&ja({sessionId:L,promptId:Dr.promptId}),ui({promptId:Dr.promptId,approve:!1,note:Y})}}),Nr.length>0&&d.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Nr.map((Y,ae)=>d.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:Y.error?`${Y.text} +`).trim()}function Plt(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 Ult(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=rYe(r),wA(r)}function wA(e){return Glt(e).replace(/[\t\r ]+/g," ").trim()}function qlt(e){let n=null,t=!1;for(let r=0;r!a.startsWith("-")&&a.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&kA(s)?{ref:r,path:s}:null}function Klt(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 $8(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 a of n.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(a);continue}r.push(a)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function Xlt(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let a=0;a!f.startsWith("-"));if(!l)return null;const c=$8(s,l);if(!c)return null;s=c}return s?$8(s,e):e}const ha="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Ylt=new RegExp(`\\bchat_(${ha})\\b`,"gi"),Yl=`(?:${ha}|[0-9a-f]{8})`;function mu(e){const n=[];let t="",r="",s=null,a=!1;const o=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},l=f=>{let _=1,d=null,m=!1;for(let g=f;g{let _=!1;for(let d=f;daYe(t.raw,n))}function xi(e,n){return Hp(e,n).length>0}function Zlt(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,xA).matchAll(Ylt))if(n.add(t[0].toLowerCase()),n.size>=al)break;return[...n]}function Yv(e,n){if(!e)return[];const t=new Set,r=e.slice(0,xA),s=n==="runs"?[new RegExp(`/runs/(${ha})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ha})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ha})\\b`,"gim"),new RegExp(`={3,}\\s*(${ha})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ha})`,"gi"),new RegExp(`^\\s*id:\\s*(${ha})`,"gim"),new RegExp(`={3,}\\s*(${ha})\\s*={3,}`,"gi")];for(const o of s)for(const l of r.matchAll(o))if(t.add(l[1]),t.size>=al)return[...t];const a=new RegExp(`^\\s*(${ha})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=al)break;return[...t]}function EA(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),a=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function NA(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(s)){if((o.index??0)>=t)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function zA(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(s)){const l=o.index??0;if(l>=t)break;const c=l+o[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function Qlt(e,n,t=[],r=[]){const s=Hp(e,"logs"),a=new Set;if(s.length===0){if(!xi(e,"logs"))return[];const l=t.length>0?[]:Yv(n,"runs");for(const c of t.length>0?t:l.length>0?l:r)if(a.add(c),a.size>=al)break;return pu([...a])}let o=!1;for(const{invocation:l,offset:c}of EA(e,s)){const f=ku(l.raw);if((f==null?void 0:f[0])!=="logs")continue;const _=f.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){o=!0;continue}if(new RegExp(`^${Yl}$`,"i").test(d)){a.add(d);continue}const m=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!m){o=!0;continue}const g=m[1],S=NA(e,g,c,Yl);for(const v of S)a.add(v);const k=zA(e,g,c,Yl);for(const v of k)a.add(v);S.length===0&&k.length===0&&(o=!0)}if(a.size===0||o){const l=t.length>0?[]:Yv(n,"runs"),c=t.length>0?t:l.length>0?l:r;for(const f of c)if(a.add(f),a.size>=al)break}return pu([...a])}function Yc(e,n,t=[],r=[]){const s=Hp(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:c}of EA(e,s)){const f=ku(l.raw),_=(f==null?void 0:f[0])==="exp"&&(f[1]==="status"||f[1]==="desc")?f[2]:null;let d=!1;_&&new RegExp(`^${Yl}$`,"i").test(_)&&(a.add(_),d=!0);const m=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(m){const g=m[1],S=NA(e,g,c,Yl);if(S.length>0){for(const v of S)a.add(v);d=!0}const k=zA(e,g,c,Yl);for(const v of k)a.add(v);k.length>0&&(d=!0)}d||(o=!0)}if(a.size===0||o){const l=t.length>0?[]:Yv(n,"experiments"),c=t.length>0?t:l.length>0?l:r;for(const f of c)if(a.add(f),a.size>=al)break}return pu([...a])}function ba(e){var b,w,y,C;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)):{},a={...t,...s},o=cs(a,"command","cmd"),l=Flt(a,"commandArgv"),c=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),f=pu(yb(a,"targetIds")),_=pu(yb(a,"runTargetIds")),d=pu(yb(a,"experimentTargetIds")),m=cs(a,"filePath","file_path","notebookPath","notebook_path","path"),g=cs(a,"description"),S=n.toLowerCase().split(/(?::|\.|__)+/),k=S.at(-1)??n.toLowerCase();if(k==="run"&&S.includes("web")){const z=xb(a,"search_query","q"),N=xb(a,"image_query","q"),T=xb(a,"find","pattern");return z?{kind:"web",label:Ww({query:z})}:N?{kind:"web",label:uH({query:N})}:T?{kind:"web",label:zH({pattern:T})}:Array.isArray(a.open)?{kind:"web",label:AY()}:Array.isArray(a.weather)?{kind:"web",label:YK()}:Array.isArray(a.finance)?{kind:"web",label:PK()}:Array.isArray(a.sports)?{kind:"web",label:VK()}:Array.isArray(a.time)?{kind:"web",label:BK()}:{kind:"web",label:l6()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!o&&!(l!=null&&l.length))return{kind:"command",label:nZ()};const z=Ult(o??(l==null?void 0:l.join(" "))??""),N=mu(z);let T=N.map(ce=>ce.raw);if(l!=null&&l.length){const ce=iYe(l);T=ce===null?[l]:mu(wA(ce)).map(re=>re.raw)}let j=null;for(const ce of T)if(j=oYe(ce),j)break;const D=T.some(ce=>{const re=ku(ce);return re!==null&&re[0]!=="discover"&&re[0]!=="paper"});if(j&&!D){const ce=j.kind==="discover"?{keyword:V$(),embedding:Y$(),openalex:yH(),biorxiv:eH()}[j.strategy]:null,re=j.kind==="discover"?j.query?nB({activity:ce??Vw(),query:j.query}):ce??Vw():j.id?Lf({target:Ae(j.id)}):VB();return{kind:j.kind==="paper"?"read":"search",label:re,litCall:j}}if(xi(z,"agent\\s+spawn"))return{kind:"agent",label:_X(),spawnedSessionIds:Zlt(c),litCall:j??void 0};const I=N.map(ce=>CA(ce.raw)),L=xi(z,"exp\\s+status"),P=xi(z,"exp\\s+desc"),q=Hp(z,"exp\\s+desc").some(ce=>(ku(ce.raw)??[]).some(F=>F==="--set"||F.startsWith("--set=")||F==="--stdin")),W=q?nF():PB(),Z=q?xI():E$();if(xi(z,"logs")){const ce=Qlt(z,c,_,f);return{kind:"project",label:ce.length===1?b$():w$(),runIds:ce,litCall:j??void 0}}if(xi(z,"exp\\s+run"))return{kind:"project",label:bQ(),litCall:j??void 0};if(xi(z,"exp\\s+wait"))return{kind:"project",label:KQ(),litCall:j??void 0};if(xi(z,"exp\\s+cancel"))return{kind:"project",label:vK(),litCall:j??void 0};const X=xi(z,"project\\s+view");if(X&&L&&P)return{kind:"project",label:Z,experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(X&&P)return{kind:"project",label:W,experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(X&&L)return{kind:"project",label:c6(),experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(X)return{kind:"project",label:bZ(),litCall:j??void 0};if(L&&P)return{kind:"project",label:Z,experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(L)return{kind:"project",label:c6(),experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(P)return{kind:"project",label:W,experimentIds:Yc(z,c,d,f),litCall:j??void 0};if(xi(z,"runs?"))return{kind:"project",label:uY(),litCall:j??void 0};if(xi(z,"projects"))return{kind:"project",label:_Y(),litCall:j??void 0};if(xi(z,"compute"))return{kind:"project",label:NK(),litCall:j??void 0};const J=I.map(Wlt).find(ce=>ce!=null);if(J){const ce=vb(J.path);return{kind:ce?"skill":"read",label:ce?_1({name:Ae(ce)}):Lf({target:Ae($l(J.path))}),filePath:J.path,fileRef:J.ref,labelTarget:ce?`${ce} skill`:$l(J.path)}}const ee=I.findIndex(ce=>ce!=null&&["sed","cat","head","tail"].includes(ce.name)),$=ee>=0?I[ee]:null,B=$?Vlt($):null,H=B?Xlt(B,N,ee,cs(a,"cwd","workdir")):null;if(B&&H){const ce=vb(H);return{kind:ce?"skill":"read",label:ce?_1({name:Ae(ce)}):Lf({target:Ae($l(B))}),filePath:H,labelTarget:ce?`${ce} skill`:$l(B)}}if(I.some(ce=>(ce==null?void 0:ce.name)==="find"||(ce==null?void 0:ce.name)==="ls"||(ce==null?void 0:ce.name)==="rg"&&ce.args.includes("--files")))return{kind:"search",label:p6()};const K=I.findIndex(ce=>(ce==null?void 0:ce.name)==="rg"||(ce==null?void 0:ce.name)==="grep");if(K>=0){const ce=Klt(N[K].raw);return{kind:"search",label:ce?m1({pattern:Ae(ce)}):p1(),searchPattern:ce??void 0}}const G=I.find(ce=>(ce==null?void 0:ce.name)==="git"),ie=G==null?void 0:G.args[0];if(ie==="grep"){const ce=G==null?void 0:G.args.slice(1).find(re=>!re.startsWith("-"));return{kind:"search",label:ce?m1({pattern:Ae(ce)}):p1(),searchPattern:ce}}if(ie==="status")return{kind:"command",label:DK()};if(ie==="diff")return{kind:"command",label:WZ()};if(ie==="log")return{kind:"command",label:_Z()};const ve=ce=>I.some(re=>!re||!["cargo","pnpm","npm","yarn"].includes(re.name)?!1:re.args[0]===ce||re.args[0]==="run"&&re.args[1]===ce);return ve("test")?{kind:"command",label:aZ()}:I.some(ce=>(ce==null?void 0:ce.name)==="tsc")||ve("typecheck")?{kind:"command",label:eX()}:ve("lint")?{kind:"command",label:SK()}:ve("build")?{kind:"command",label:fK()}:{kind:"command",label:jB({command:Ae(z)})}}case"skill":{const z=cs(a,"skill","name"),N=z?Hlt(n,z):null;return{kind:"skill",label:z?bB({name:Ae(z)}):_B(),filePath:N??void 0,labelTarget:N&&z?`${z} skill`:void 0}}case"read":{const z=m?$l(m):null,N=m?vb(m):null;return N?{kind:"skill",label:_1({name:Ae(N)}),filePath:m??void 0,labelTarget:`${N} skill`}:z?{kind:"read",label:Lf({target:Ae(z)}),filePath:m??void 0,labelTarget:z}:{kind:"read",label:uZ()}}case"edit":case"write":case"notebookedit":{const z=Plt(a),N=m??(z==null?void 0:z.path)??null,T=N?$l(N):null,j=T?(z==null?void 0:z.type)==="add"?zI({target:Ae(T)}):(z==null?void 0:z.type)==="delete"?HI({target:Ae(T)}):KI({target:Ae(T)}):null;return T?{kind:"edit",label:j??h6(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:h6()}}case"grep":{const z=cs(a,"pattern");return{kind:"search",label:z?m1({pattern:Ae(z)}):p1(),searchPattern:z??void 0}}case"glob":{const z=cs(a,"pattern");return{kind:"search",label:z?aB({pattern:Ae(z)}):p6()}}case"websearch":{const z=cs(a,"query"),N=cs(a,"url"),T=cs(a,"pattern");return z?{kind:"web",label:Ww({query:z})}:T&&N?{kind:"web",label:gH({pattern:T})}:N?{kind:"web",label:EB({target:Ae(N)})}:{kind:"web",label:g??l6()}}case"webfetch":{const z=cs(a,"url");return{kind:"web",label:z?Lf({target:Ae(z)}):g??n$()}}case"task":return{kind:"agent",label:g??DB()};case"subagent":return{kind:"agent",label:Jlt(a)};case"error":return{kind:"command",label:RQ()};case"interrupted":return{kind:"command",label:IQ()};default:{const z=g??m??o??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:z?`${n}: ${z}`:n}}}}function Jlt(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 HH();case"sendInput":return OH();case"resumeAgent":return u$();case"wait":return aF();case"closeAgent":return kI()}switch(typeof e.kind=="string"?e.kind:""){case"started":return QH();case"interacted":return lI();case"interrupted":return KH()}return qH()}function $0({activity:e,className:n=""}){if(e.litCall)return h.jsx(kE,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${n}`});const t={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${n}`};switch(e.kind){case"skill":return h.jsx(V9,{...t});case"read":case"project":return h.jsx(fVe,{...t});case"search":return h.jsx(DWe,{...t});case"edit":return h.jsx(G2,{...t});case"web":return h.jsx(sWe,{...t});case"agent":return h.jsx(K2,{...t});case"command":return h.jsx(aE,{...t})}}function wb({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,a]=R.useState(!1),o=R.useRef(null),l=R.useRef(!1);return R.useEffect(()=>{var c,f;!s||!l.current||(l.current=!1,(f=(c=o.current)==null?void 0:c.querySelector("button"))==null||f.focus())},[s]),h.jsxs("span",{className:"tool-target-overflow inline",children:[s&&h.jsx("span",{className:"tool-target-reveal",ref:o,children:e.map((c,f)=>h.jsxs("span",{children:[f>0&&", ",n||t?h.jsx("button",{className:"tool-target",...n?ir(_=>n(c.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(c.id)}},children:c.label}):h.jsx("span",{children:c.label})]},c.id))}),s&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?wL({target:r}):YO({count:$t(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),l.current=!s&&c.detail===0,a(f=>!f)},children:s?_9():lne({count:$t(e.length)})})]})}function Zv({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:a,experimentName:o}){var l,c,f,_;if(e.searchPattern)return e.label;if(((l=e.litCall)==null?void 0:l.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:dYe(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(lVe,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return h.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...ir(m=>n(d,void 0,void 0,e.fileRef,m),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const d=e.spawnedSessionIds,m=d.slice(0,3),g=d.slice(m.length).map((S,k)=>({id:S,label:r6({number:$t(m.length+k+1)})}));return h.jsxs(h.Fragment,{children:[e.label," — ",m.map((S,k)=>h.jsxs("span",{children:[k>0&&", ",h.jsx("button",{className:"tool-target",title:CY(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(S)},children:r6({number:$t(k+1)})})]},S)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(wb,{items:g,onSelect:r,targetType:EG()})]})]})}if((f=e.runIds)!=null&&f.length){const d=s?e.runIds.filter(S=>!!s(S)):e.runIds;if(d.length===0)return e.label;const m=d.slice(0,3),g=d.slice(m.length).map(S=>({id:S,label:(s==null?void 0:s(S))||Ya()}));return h.jsxs(h.Fragment,{children:[e.label," — ",m.map((S,k)=>h.jsxs("span",{children:[k>0&&", ",t?h.jsx("button",{className:"tool-target",title:oO({run:Ae(S)}),...ir(v=>t(S,v),{stopPropagation:!0}),children:(s==null?void 0:s(S))||Ya()}):h.jsx("span",{children:(s==null?void 0:s(S))||Ya()})]},S)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(wb,{items:g,onOpen:t,targetType:iee()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=o?e.experimentIds.filter(S=>!!o(S)):e.experimentIds;if(d.length===0)return e.label;const m=d.slice(0,3),g=d.slice(m.length).map(S=>({id:S,label:(o==null?void 0:o(S))||Ya()}));return h.jsxs(h.Fragment,{children:[e.label," — ",m.map((S,k)=>h.jsxs("span",{children:[k>0&&", ",a?h.jsx("button",{className:"tool-target",title:XL({name:(o==null?void 0:o(S))||Ae(S)}),...ir(v=>a(S,v),{stopPropagation:!0}),children:(o==null?void 0:o(S))||Ya()}):h.jsx("span",{children:(o==null?void 0:o(S))||Ya()})]},S)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(wb,{items:g,onOpen:a,targetType:MV()})]})]})}return e.label}function ect(e){return c9()}function wy(e){const n={skill:wB(),read:a$(),search:MH(),edit:QI(),project:j$(),web:mI(),agent:OI(),command:B$()}[e.kind];return{...e,label:n}}function AA(e,n){const t=ba({tool:e,state:{status:"running",input:n}});return{skill:uB(),read:BB(),search:P$(),edit:qI(),project:_$(),web:hI(),agent:MI(),command:D$()}[t.kind]}function tct(e,n,t){return e.label}function nct(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const rct=250;function sct(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.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 o=rct-(Date.now()-s.current);if(o<=0){s.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{s.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const ict=160;function jA(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),ict);return()=>window.clearTimeout(r)},[e]),e&&n}function act(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:c9()}}function H8(e){var t,r;if(((t=e.state)==null?void 0:t.status)!=="completed")return null;const n=ba(e);return 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 oct(e){const n=[];for(const t of e){const r=H8(t),s=n[n.length-1];r&&s&&H8(s.part)===r?s.count++:n.push({part:t,count:1})}return n}function lct({part:e,busy:n,recovering:t,onRecover:r}){var m,g;const s=(m=e.state)==null?void 0:m.input,a=(s==null?void 0:s.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const S=window.setInterval(()=>{const k=Date.now();l(k),k>=a&&window.clearInterval(S)},1e3);return()=>window.clearInterval(S)},[a]),e.id==="turn-retry"){const S=QXe(s??{},o);return h.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[h.jsx("span",{className:Dt}),h.jsx("span",{children:S})]})}const c=wE(s==null?void 0:s.recoveryAction),f=s==null?void 0:s.turnId;if(c!=="retry"&&c!=="continue"||!f)return null;const _=c==="retry"?T2():hV(),d=$p(((g=e.state)==null?void 0:g.error)||Wee());return h.jsxs("div",{className:"turn-recovery-row flex items-center justify-between gap-2 py-1.5 px-2.5 border border-border rounded-md bg-background",children:[h.jsx("span",{className:"min-w-0 truncate text-sm text-accent-red",title:d,children:d}),h.jsx("button",{type:"button",className:"shrink-0 h-7 px-2.5 rounded-sm border border-border bg-background text-xs font-medium text-text disabled:opacity-50 [&:hover:not(:disabled)]:bg-surface",disabled:n||t,onClick:()=>r==null?void 0:r(f,c),children:t?xee():_})]})}function F8({part:e,repeatCount:n=1,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const c=e.state,f=ba(e),_=(c==null?void 0:c.status)==="error",d=$p((c==null?void 0:c.error)||(c==null?void 0:c.output)||""),m=_&&!!d,[g,S]=R.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,v=h.jsxs(h.Fragment,{children:[_&&h.jsxs("span",{className:"sr-only",children:[M2()," "]}),_?h.jsx(X9,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):h.jsx($0,{activity:f,className:"text-muted self-start mt-[5px]"}),h.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${_?"text-accent-red":"text-subtext"}`,children:[h.jsx(Zv,{activity:f,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}),n>1&&h.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:jL({count:$t(n)}),children:["×",n]})]})]});return m?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,h.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":k,"aria-label":g?EL({activity:f.label}):VO({activity:f.label}),onClick:()=>S(b=>!b),children:h.jsx(wa,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&h.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:d.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:v})}function cct({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l}){var z,N,T,j;const[c,f]=R.useState(!1),_=oct(e),d=_.map(({part:D})=>ba(D)),m=n?e.at(-1):void 0,g=((z=m==null?void 0:m.state)==null?void 0:z.status)!=="error"?(m&&wy(ba(m)))??null:null,S=!!m&&((N=m.state)==null?void 0:N.status)==="running"&&(nct((T=m.state)==null?void 0:T.input)||(g==null?void 0:g.kind)==="command"&&!cs(((j=m.state)==null?void 0:j.input)??{},"command","cmd")),k=sct(g,S),v=jA(k!=null),b=ect(),w=k??act(d),y=k?tct(k):b;if(e.length===1)return k?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[h.jsx($0,{activity:k,className:`${v?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),h.jsx("span",{className:`${v?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:y,children:h.jsx(Zv,{activity:k,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(F8,{part:e[0],onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})});const C=c;return h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-start",children:[h.jsx($0,{activity:w,className:`${v?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),k?h.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${v?"tool-running-shimmer":""}`,title:y,children:h.jsx(Zv,{activity:k,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:()=>f(D=>!D),"aria-expanded":C,children:y}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>f(D=>!D),"aria-expanded":C,"aria-label":C?lV():zV(),children:h.jsx(wa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${C?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${C?"open":""}`,"aria-hidden":!C,inert:!C,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_.map(({part:D,count:I})=>h.jsx(F8,{part:D,repeatCount:I,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:a,onOpenExperiment:o,experimentName:l},D.id))})})})]})}function uct({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[a,o]=R.useState([]),l=!n,c=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const g=s.approved===!0?{label:IY(),icon:ds,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:XY(),icon:G2,iconClass:"text-accent-amber"}:s.approved===!1?{label:FY(),icon:Yr,iconClass:"text-accent-red"}:{label:GY(),icon:wu,iconClass:"text-muted"},S=g.icon;return h.jsxs("details",{className:Llt,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:s.synthesized?u9():k6()}),h.jsx(S,{size:17,strokeWidth:1.8,className:`shrink-0 ${g.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:g.label}),h.jsx(wa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${I8} ms-6`,children:[h.jsx(ga,{text:s.plan??"",onOpenFile:t}),s.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",m=(s.annotations??[]).map((g,S)=>({id:`${e.id}-annotation-${S}`,text:g.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[m.length>0&&h.jsx(yy,{annotations:m,variant:"sent"}),h.jsxs("details",{className:Dlt,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||kJ()}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||ZJ()})]}),h.jsxs("div",{className:I8,children:[s.header&&s.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(s.options??[]).map(g=>{var S;return h.jsx("li",{className:(S=s.answers)!=null&&S.includes(g.label)?"sel":"",children:g.label},g.label)})}),s.note&&s.note!==d&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return h.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 ${l?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:s.synthesized?gJ():k6()}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:h.jsx(ga,{text:s.plan??"",onOpenFile:t})}),d&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...ir(m=>r(s.plan??"",e.id,m)),children:qQ()}),!l&&!d&&h.jsxs("div",{className:Xv,children:[h.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:kW()}),h.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:zW()}),h.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:wZ()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},m=cs(d,"command","cmd","filePath","file_path","path")||"",g=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",S=cs(d,"description")||"",k=g||S||AA(s.tool,d),v=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":v,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(oE,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:v,className:"text-base font-semibold text-text",children:qW()})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),m&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:m}),!l&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>c({approve:!1}),children:wX()}),h.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>c({approve:!0}),children:HW()})]})]})]})}const f=d=>o(m=>s.multiSelect?m.includes(d)?m.filter(g=>g!==d):[...m,d]:[d]);return h.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 ${l?"readonly":""}`,children:[s.header&&h.jsx("div",{className:Olt,children:s.header}),s.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const m=a.includes(d.label);return h.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 ${m?"sel":""}`,disabled:l,onClick:()=>l?void 0:s.multiSelect?f(d.label):c({answers:[d.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:d.label}),d.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!l&&h.jsx("div",{className:Xv,children:h.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>c({answers:a}),children:CQ()})})]})}function H0(e,n){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 Fp(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function fct(e,n){return e.role==="user"?!0:e.parts.some(t=>H0(t,n))}function hct(e){const n=e.text??"",t=n.startsWith("data:")?n:LXe(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",a=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:a,name:s}}const Sb=[Wh,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function dct({count:e,index:n,prevId:t,nextId:r,onSelect:s,pagerDisabled:a,onEdit:o,editDisabled:l}){const c=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${c?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[c&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:Sb,title:g6(),"aria-label":g6(),disabled:a||!t,onClick:()=>t&&s(t),children:h.jsx(W9,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[n+1,"/",e]}),h.jsx("button",{className:Sb,title:m6(),"aria-label":m6(),disabled:a||!r,onClick:()=>r&&s(r),children:h.jsx(wa,{size:14})})]}),h.jsx("button",{className:Sb,title:f6(),"aria-label":f6(),disabled:l,onClick:o,children:h.jsx(G2,{size:13})})]})}const _ct=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:d,onOpenSubagent:m,busy:g=!1,recoveringTurnId:S,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:z,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:D}){var W,Z;const[I,L]=R.useState(null);if(n.role==="user"){const X=n.parts.filter(K=>K.type==="text").map(K=>K.text??"").join(` +`),J=K=>!!(v!=null&&v.some(G=>G.name===K)),ee=n.parts.filter(K=>K.type==="image"&&K.text).map(hct),$=ee.filter(K=>!K.isPdf),B=ee.filter(K=>K.isPdf),H=n.parts.filter(K=>K.type==="annotation"&&K.text).map(K=>({id:K.id,text:K.text??""}));if(I!==null){const K=()=>{const G=I.trim();!G||N||(L(null),j(n.id,G))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":AX(),value:I,autoFocus:!0,onChange:G=>L(G.target.value),onKeyDown:G=>{G.key==="Escape"?(G.preventDefault(),L(null)):G.key==="Enter"&&!G.shiftKey&&!G.nativeEvent.isComposing&&(G.preventDefault(),K())}}),h.jsxs("div",{className:`${Xv} justify-end`,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>L(null),children:pK()}),h.jsx("button",{className:"btn-primary",onClick:K,disabled:N||!I.trim(),children:Kb()})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[H.length>0&&h.jsx(yy,{annotations:H,variant:"sent"}),h.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]:me-0.5 [&_.skill-chip]:align-baseline",children:[h.jsx(ilt,{text:X,isCommand:J}),$.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:$.map((K,G)=>h.jsx("a",{href:K.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:K.src,alt:YG()})},G))}),B.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:B.map((K,G)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:K.src,target:"_blank",rel:"noreferrer",children:[h.jsx(wu,{size:15}),h.jsx("span",{children:K.name})]},G))})]}),w!==void 0&&h.jsx(dct,{count:w,index:y,prevId:C,nextId:z,onSelect:D,pagerDisabled:T,onEdit:()=>L(X),editDisabled:N})]})}const P=n.parts.find(Fp),q=P?n.parts.filter(X=>X!==P):n.parts;return h.jsxs("div",{className:"msg-assistant group/turn text-lg leading-[1.62] text-text min-w-0",children:[TA(q,{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:d,onOpenSubagent:m,predictTextTail:b}),P&&h.jsx(lct,{part:P,busy:g,recovering:S===((Z=(W=P.state)==null?void 0:W.input)==null?void 0:Z.turnId),onRecover:k})]})});function TA(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f,onRespond:_,onOpenPlan:d,onOpenSubagent:m,predictTextTail:g=!1}=n,S=e.filter(C=>C.type!=="steer"&&H0(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(h.jsx(cct,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:f},`tg-${v[0].id}`)),v=[])};for(const C of e)if(H0(C,t)){if(C.type==="tool"&&(mct(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),k.push(h.jsx(bct,{part:C,pendingTail:g&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:m},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(h.jsx(ga,{text:C.text,onOpenFile:s,onOpenRun:a,predict:g&&C.id===(S==null?void 0:S.id)},C.id)):C.type==="steer"?k.push(h.jsx("div",{dir:"auto",role:"note","aria-label":aJ(),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(h.jsx(uct,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),k}function pct(e){return ba(e).label}function mct(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function MA(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 Sy(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Sy(t.children,n);if(r)return r}return null}function gct({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:a,onOpenSubagent:o}){var S,k,v,b;const l=e.children??[],c=((S=e.state)==null?void 0:S.status)==="running",f=((k=e.state)==null?void 0:k.status)==="error",_=f?$p(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=TA(l,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:a,onOpenSubagent:o,predictTextTail:c,pendingTailToolId:c?RA(l):null}),g=l.some(w=>w.type==="text"&&!!w.text)?"":MA(e);return h.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[f&&h.jsxs("span",{className:"sr-only",children:[M2()," "]}),_&&h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:_.slice(0,2e4)}),d.length===0&&!g&&!_?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:c?rp():tW()}):h.jsxs(h.Fragment,{children:[d,g&&h.jsx(ga,{text:g,onOpenFile:n,onOpenRun:t})]})]})}function bct({part:e,pendingTail:n,onOpenSubagent:t}){var f,_,d,m;const r=((f=e.state)==null?void 0:f.status)==="error",s=$p(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),a=n&&!r?wy(ba(e)):ba(e),o=jA(!!(n&&!r)),l=(((m=e.children)==null?void 0:m.length)??0)===0&&!r&&!MA(e),c=h.jsxs(h.Fragment,{children:[r&&h.jsxs("span",{className:"sr-only",children:[M2()," "]}),r?h.jsx(X9,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):h.jsx($0,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${xlt} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?h.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-start rounded-sm [&_.tool-line]:text-lg",children:c}):h.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&s?s:gW(),...ir(g=>t==null?void 0:t(e.id,a.label,g)),disabled:!t,children:[c,h.jsx(wa,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function vct(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,a)=>{var o,l;for(const c of s){const f=`${a}/${c.id}`;c.type==="tool"&&((o=c.state)!=null&&o.status)&&n.set(f,{status:c.state.status,part:c}),(l=c.children)!=null&&l.length&&r(c.children,f)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function ky(e){const n=(t,r)=>{var s;for(const a of t){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},f=cs(l,"reason","description")||AA(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:f}}if((s=a.children)!=null&&s.length){const l=n(a.children,`${r}/${a.id}`);if(l)return l}}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 xct(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var S,k,v,b,w;const s=((S=e[0])==null?void 0:S.id)??"",{messageId:a,states:o}=vct(e),l=ky(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},t(y=>({text:l?Kw({label:eo(l.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===a?r.current.states:new Map,f=r.current.permissionPath,_=[...o].filter(([y,C])=>{var z;return((z=c.get(y))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==f){t(y=>({text:Kw({label:eo(l.label)}),sequence:y.sequence+1}));return}const d=(k=_.find(([,y])=>Fp(y.part)))==null?void 0:k[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=wE((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${FF()}${y?` ${y==="retry"?yF():gF()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:dF(),sequence:y.sequence+1}));return}const m=_.filter(([,y])=>y.status==="error");if(m.length>0){const y=m.slice(0,2).map(([,C])=>ba(C.part).label).join(", ");t(C=>({text:m.length===1?RF({labels:y}):IF({count:$t(m.length),labels:y}),sequence:C.sequence+1}));return}const g=_.filter(([,y])=>y.status==="running");if(g.length>0){const y=(w=g.at(-1))==null?void 0:w[1].part;t(C=>({text:y?wy(ba(y)).label:CF(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:AF(),sequence:y.sequence+1}))},[e]),n}function RA(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||Fp(r)||!H0(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function DA(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=RA(n.parts);return t?{messageId:n.id,toolId:t}:null}const yct=R.memo(function({messages:n,allMessages:t,canFork:r,onFork:s,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:f,runExperimentName:_,onOpenExperiment:d,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,recoveringTurnId:v,onRecover:b,skills:w}){var D;const y=((D=ky(n))==null?void 0:D.id)??null,C=R.useMemo(()=>n.filter(I=>fct(I,y)),[n,y]),z=R.useMemo(()=>{const I=C.filter(L=>L.role==="user"&&!L.id.startsWith(_u));return qXe(t,n,I,L=>L.startsWith(_u))},[n,C,t]),N=C.at(-1),T=xct(n),j=o?DA(n):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:T.text},T.sequence)}),C.map(I=>{var W,Z,X,J,ee,$;const L=I.parts.find(Fp),P=(Z=(W=L==null?void 0:L.state)==null?void 0:W.input)==null?void 0:Z.turnId,q=L?o||v!==null:!1;return h.jsx(_ct,{message:I,forkCount:(X=z.get(I.id))==null?void 0:X.count,forkIndex:(J=z.get(I.id))==null?void 0:J.index,forkPrevId:(ee=z.get(I.id))==null?void 0:ee.prevId,forkNextId:($=z.get(I.id))==null?void 0:$.nextId,forkDisabled:!r,branchDisabled:o,onFork:s,onSelectFork:a,activePermissionId:y,pendingTailToolId:(j==null?void 0:j.messageId)===I.id?j.toolId:null,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:f,runExperimentName:_,onOpenExperiment:d,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,busy:q,recoveringTurnId:P===v?v:null,onRecover:b,skills:w,predictTextTail:o&&I===N&&I.role==="assistant"},I.id)})]})}),P8=(e,n)=>e==="all"?!0:e==="archived"?n:!n,LA=[{id:"active",label:MW,railLabel:f9},{id:"archived",label:a6,railLabel:a6},{id:"all",label:OW,railLabel:jG}];function wct({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=_o();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[h.jsx("button",{className:`${Wh} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:_6(),"aria-label":_6(),onClick:()=>r(a=>!a),children:h.jsx(FWe,{size:13})}),t&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:LA.map(a=>h.jsxs("button",{className:Zr,onClick:()=>{n(a.id),r(!1)},children:[h.jsx("span",{children:a.label()}),e===a.id&&h.jsx(ds,{size:13})]},a.id))})]})}const Sct=14,kct=500,Cct=1200;function OA({title:e,animate:n}){return n?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?h.jsx("span",{"aria-hidden":!0,children:t},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*Sct,kct)}ms`},children:t},r))}):h.jsx(h.Fragment,{children:e})}function Ect({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:a,onOpen:o,onRename:l,onSetArchived:c,onDelete:f}){var z;const{open:_,setOpen:d,ref:m}=_o(),g=((z=e.title)==null?void 0:z.trim())||"Untitled",[S,k]=R.useState(!1),[v,b]=R.useState(""),w=R.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())||"")&&l(N)}return R.useEffect(()=>{var N,T;S&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[S]),h.jsxs("div",{ref:m,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-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${S?"editing":""}`,title:`${Yf[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?mee():""}`,onClick:()=>{S||(_?d(!1):o())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):o())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&h.jsx("span",{className:"unread-dot"})}),e.parentSessionId&&!S&&h.jsx(K2,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),S?h.jsx("input",{ref:w,className:"session-title-input","aria-label":fQ(),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))}}):h.jsx("span",{className:"session-title",children:h.jsx(OA,{title:g,animate:a!==void 0},a??"static")}),h.jsx("span",{className:"session-time",children:$lt(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:y6(),"aria-label":y6(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:h.jsx(Q9,{size:14})}),_&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[h.jsx("button",{className:Zr,onClick:N=>{N.stopPropagation(),d(!1),y()},children:h.jsx("span",{children:UZ()})}),h.jsx("button",{className:Zr,onClick:N=>{N.stopPropagation(),d(!1),c(!e.archived)},children:h.jsx("span",{children:e.archived?tte():BG()})}),h.jsx("button",{className:`${Zr} danger`,onClick:N=>{N.stopPropagation(),d(!1),f()},children:h.jsx("span",{children:bX()})})]})]})}function Nct({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:a,onSelectMainView:o,experimentsActive:l,filesActive:c,artifactsActive:f,onOpenExperiments:_,onOpenArtifacts:d,onOpenFile:m,onOpenRun:g,runExperimentName:S,onOpenExperiment:k,experimentName:v,onOpenPlan:b,onOpenSubagent:w,onOpenWorktree:y,onOpenDemoWelcome:C,onActiveSessionChange:z,preferredAgent:N,onPreferredAgentChange:T,children:j}){var se,ye,Ne;const[D,I]=R.useState([]),[L,P]=R.useState(null),[q,W]=R.useState(new Set),[Z,X]=R.useState("active"),[J,ee]=R.useState(""),[$,B]=R.useState([]),H=R.useRef(0),K=R.useRef({projectId:e,activeId:L});K.current={projectId:e,activeId:L};const[G,ie]=R.useState([]),[ve,ce]=R.useState(null),[re,F]=R.useState(null),oe=R.useRef(Promise.resolve()),ue=R.useRef(0),he=R.useRef(0),[me,Ee]=R.useState(null),Re=R.useRef(null),He=R.useRef(!1),Te=R.useRef(null),[Ie,et]=R.useReducer(Blt,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[Tt,zt]=R.useState([]),[Wt,fn]=R.useState(N);R.useEffect(()=>fn(N),[N]);const[ht,Qe]=R.useState({}),[st,we]=R.useState({}),[Le,qe]=R.useState(null),tt=R.useRef(!1),at=R.useRef(null),[Mt,yt]=R.useState(null),Ot=R.useRef(null),[Rt,sn]=R.useState(new Map),xt=R.useRef(new Map),hn=R.useRef(new Set),dn=R.useRef(new Set),Ke=R.useRef(0),ut=R.useRef([]),_n=R.useRef(null),Rr=R.useRef(null),ct=R.useRef(!0),Ut=R.useRef(null),Qt=_o(),Gr=R.useCallback(Y=>{var ae;H.current+=1,B(be=>[...be,{id:`annotation-${H.current}`,...Y}]),(ae=Ut.current)==null||ae.focus()},[]),zr=Alt(Rr,Gr);jlt($),R.useEffect(()=>{B([]),zr.dismiss()},[L,e,zr.dismiss]);const[Ts,Ze]=R.useState([]),[mt,an]=R.useState(0),[Cn,En]=R.useState(!1),[rs,Dr]=R.useState(0),Vr=R.useRef(!1);R.useEffect(()=>{gXe(e).then(Ze).catch(()=>{})},[e,a]);function Lr(Y){if(!pn)return;if(Y.source==="command"&&Y.name==="plan"){wr(J,pn);return}const ae=T8(J,pn,Y.name,2);ee(ae.text),window.requestAnimationFrame(()=>{var be,ge;(be=Ut.current)==null||be.focus(),(ge=Ut.current)==null||ge.setSelectionRange(ae.cursor,ae.cursor),Dr(ae.cursor)})}function An(Y){const ae=Y.selectionStart;if(Vr.current||ae!==Y.selectionEnd)return!1;const be=pb(J,ae);if(!be||be.end!==ae||!is(be.query))return!1;const ge=M8(J,be);return ee(ge.text),Dr(ge.cursor),window.requestAnimationFrame(()=>Y.setSelectionRange(ge.cursor,ge.cursor)),!0}function on(Y){ce(null);let ge=G.reduce((je,Ve)=>je+Ve.size,0);for(const je of Y){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(je.type))continue;if(je.size>31457280){ce(eV({name:Ae(je.name)}));continue}if(ge+je.size>41943040){ce(sV());continue}ge+=je.size;const Ve=new FileReader;Ve.onload=()=>{const xn=Ve.result;ie(Tn=>[...Tn,{dataUrl:xn,mediaType:je.type,name:je.name,size:je.size}])},Ve.readAsDataURL(je)}}function Nn(Y){const ae=Array.from(Y.clipboardData.items).filter(be=>be.kind==="file"&&(be.type.startsWith("image/")||be.type==="application/pdf")).map(be=>be.getAsFile()).filter(be=>be!==null);ae.length>0&&(Y.preventDefault(),on(ae))}const gt=D.find(Y=>Y.id===L),Jn=Wt??Jat(Tt),Wr=gt?{harness:gt.harness,model:ht.model??gt.model,serviceTier:ht.serviceTier!==void 0?ht.serviceTier:gt.serviceTier,permissionMode:ht.permissionMode??gt.permissionMode,reasoningLevel:ht.reasoningLevel??gt.reasoningLevel}:Jn?{...Jn,...ht}:null,We=Wr?Tt.find(Y=>Y.id===Wr.harness):void 0,dt=We==null?void 0:We.options,Ln=R.useMemo(()=>Jot(Ts,dt==null?void 0:dt.planActivation),[Ts,dt==null?void 0:dt.planActivation]),pn=pb(J,rs),ar=(pn==null?void 0:pn.query)??null,Ms=ar===null?[]:Ln.filter(Y=>Y.name.startsWith(ar)),Or=ar!==null&&(pn==null?void 0:pn.end)===rs&&Ms.some(Y=>Y.name!==ar)&&!Cn?Ms:[],zn=Or.length>0,ri=Math.min(mt,Math.max(0,Or.length-1));R.useEffect(()=>an(0),[ar]);const qt=Wr&&{...Wr,serviceTier:k0(We,Wr.model,Wr.serviceTier),reasoningLevel:xE(We,Wr.model,Wr.reasoningLevel)},ps=hp(We,qt==null?void 0:qt.model),er=Y=>{if(!qt)return;const ae={...qt,...Y},be={};Y.model!==void 0&&Y.model!==qt.model&&(be.model=Y.model),Y.serviceTier!==void 0&&Y.serviceTier!==qt.serviceTier&&(be.serviceTier=Y.serviceTier),Y.permissionMode!==void 0&&Y.permissionMode!==qt.permissionMode&&(be.permissionMode=Y.permissionMode),Y.reasoningLevel!==void 0&&Y.reasoningLevel!==qt.reasoningLevel&&(be.reasoningLevel=Y.reasoningLevel),we(ge=>({...ge,...be})),fn(ae),T(ae).catch(()=>{}),gt?Qe(ge=>({...ge,...Y})):Y.harness&&Y.harness!==qt.harness&&Qe({})},yr=R.useCallback(Y=>{const ae=oe.current.catch(()=>{}).then(Y);return oe.current=ae.then(()=>{},()=>{}),ae},[]),ms=Y=>{if(Y==="plan"&&(We==null?void 0:We.id)==="claude-code"?(we(ge=>({...ge,permissionMode:Y})),Qe(ge=>({...ge,permissionMode:Y}))):(Qe(ge=>{const je={...ge};return delete je.permissionMode,je}),er({permissionMode:Y})),!gt)return;const ae=gt.id,be=++ue.current;F(null),yr(()=>MXe(ae,Y)).then(ge=>{I(je=>je.map(Ve=>Ve.id===ge.id?ge:Ve)),ue.current===be&&Qe(je=>{const Ve={...je};return delete Ve.permissionMode,Ve})}).catch(()=>{ue.current===be&&(Qe(ge=>{const je={...ge};return delete je.permissionMode,je}),F(lte()))})},Ki=Y=>er({reasoningLevel:Y}),Ei=(qt==null?void 0:qt.harness)==="claude-code"?qt.permissionMode==="plan":(dt==null?void 0:dt.planActivation)==="command"?me??(gt==null?void 0:gt.planMode)??!1:!1;R.useEffect(()=>{me===null||(gt==null?void 0:gt.planMode)!==me||(Re.current=null,Ee(null))},[gt==null?void 0:gt.planMode,me]);async function si(Y){if(we(ge=>({...ge,planMode:Y})),Re.current=Y,Ee(Y),!gt)return;const ae=gt.id,be=++he.current;F(null);try{const ge=await yr(()=>TXe(ae,Y));I(je=>je.map(Ve=>Ve.id===ge.id?ge:Ve)),he.current===be&&(Re.current=null,Ee(null),F(null))}catch(ge){throw he.current===be&&(Re.current=null,Ee(null)),ge}}async function ii(){if((qt==null?void 0:qt.harness)==="claude-code"){ms("auto");return}if(gt)try{await si(!1)}catch{F(kV())}}async function Ar(){const Y=!Ei;try{if((qt==null?void 0:qt.harness)==="claude-code")ms(Y?"plan":"auto");else if((dt==null?void 0:dt.planActivation)==="command")await si(Y);else throw new Error(C6())}catch{F(E6())}}function wr(Y,ae){const be=M8(Y,ae);ee(be.text),En(!0),Ar(),window.requestAnimationFrame(()=>{var ge,je;(ge=Ut.current)==null||ge.focus(),(je=Ut.current)==null||je.setSelectionRange(be.cursor,be.cursor),Dr(be.cursor)})}ut.current=D;const Ds=R.useCallback(async()=>{const Y=ut.current.map(ae=>ae.id);try{const ae=(await e0(e)).filter(ge=>!dn.current.has(ge.id)),be=new Set(ae.map(ge=>ge.id));for(const ge of Y)be.has(ge)||nr(ge);return I(ge=>{const je=new Map(ge.map(Ve=>[Ve.id,Ve.contextUsage]));return ae.map(Ve=>({...Ve,contextUsage:Ve.contextUsage??je.get(Ve.id)}))}),xt.current=new Map(ae.map(ge=>[ge.id,ge.title])),et({type:"seedBusy",sessions:ae.filter(ge=>ge.busy).map(ge=>ge.id),known:ae.map(ge=>ge.id)}),ae}catch{return null}},[e]),Sr=R.useCallback(async Y=>{const ae=K.current.activeId===Y?at.current:void 0,[{messages:be,queued:ge,activeLeafId:je}]=await Promise.all([au(Y),Ds()]),Ve=ae!==void 0&&K.current.activeId===Y&&at.current!==ae;et({type:"seed",sessionId:Y,messages:be,queued:ge,activeLeafId:Ve?at.current:je})},[Ds,et]);R.useEffect(()=>{I([]),ut.current=[],P(null);const Y=bA();W(e===S1?new Set([lE,cE].filter(ae=>!Y.has(ae))):new Set),ee(""),ie([]),et({type:"reset"}),hn.current=new Set,sn(new Map),xt.current=new Map,Ds().then(ae=>{ae&&P(be=>{var ge,je;return be??(e===S1?(ge=ae.find(Ve=>Ve.id===Jf))==null?void 0:ge.id:void 0)??((je=ae.find(Ve=>!Ve.archived))==null?void 0:je.id)??null})})},[e,Ds]),R.useEffect(()=>{we({}),Ot.current=null},[L]),R.useEffect(()=>{!L||hn.current.has(L)||(hn.current.add(L),au(L).then(({messages:Y,queued:ae,activeLeafId:be})=>et({type:"seed",sessionId:L,messages:Y,queued:ae,activeLeafId:be})).catch(()=>{et({type:"seed",sessionId:L,messages:[],onlyIfAbsent:!0}),hn.current.delete(L)}))},[L]),R.useEffect(()=>hh(Y=>{switch(Y.type){case"session":{if(Y.session.projectId!==e||dn.current.has(Y.session.id))return;const ae=xt.current.has(Y.session.id),be=xt.current.get(Y.session.id)!==Y.session.title;xt.current.set(Y.session.id,Y.session.title),ae&&be&&Y.session.titleSource==="generated"&&(sn(ge=>{const je=new Map(ge);return je.set(Y.session.id,(ge.get(Y.session.id)??0)+1),je}),window.setTimeout(()=>{sn(ge=>{if(!ge.has(Y.session.id))return ge;const je=new Map(ge);return je.delete(Y.session.id),je})},Cct)),I(ge=>{const je=ge.findIndex(xn=>xn.id===Y.session.id);if(je<0)return[Y.session,...ge];const Ve=ge.slice();return Ve[je]={...Y.session,contextUsage:Y.session.contextUsage??ge[je].contextUsage},Ve});break}case"sessionDeleted":nr(Y.sessionId);break;case"message":Ke.current++,et({type:"upsertMessage",sessionId:Y.sessionId,message:Y.message});break;case"busy":et({type:"busy",sessionId:Y.sessionId,busy:Y.busy});break;case"queued":et({type:"setQueued",sessionId:Y.sessionId,items:Y.items});break;case"branch":et({type:"activeLeaf",sessionId:Y.sessionId,leafId:Y.activeLeafId});break;case"usage":I(ae=>ae.map(be=>be.id===Y.sessionId?{...be,contextUsage:Y.usage}:be));break}}),[e]),R.useEffect(()=>hh(Y=>{if(Y.type!=="reconnected"||(Ds(),!L||!hn.current.has(L)))return;const ae=be=>{const ge=Ke.current;au(L).then(({messages:je,queued:Ve,activeLeafId:xn})=>{et({type:"seed",sessionId:L,messages:je,queued:Ve,activeLeafId:xn}),be&&Ke.current!==ge&&ae(!1)}).catch(()=>{})};ae(!0)}),[L,Ds]);const ai=L?Ie.messagesBySession[L]??B8:B8,Ls=L?Ie.activeLeafBySession[L]??null:null;at.current=Ls;const jn=R.useMemo(()=>PXe(ai,Ls),[ai,Ls]),Kn=L?Ie.busySessions.has(L):!1,or=!Kn&&!!(We!=null&&We.agentReady),Xi=Kn&&DA(jn)!=null,jr=L?Ie.queuedBySession[L]??[]:[],Ni=jr.some(Y=>Y.dispatchState==="retrying"),oi=jr.findIndex(Y=>Y.dispatchState==="blocked"),Ir=jr.reduce((Y,ae)=>ae.dispatchState!=="retrying"||typeof ae.nextRetryAt!="number"?Y:Y===null?ae.nextRetryAt:Math.min(Y,ae.nextRetryAt),null),[Aa,gs]=R.useState(()=>Date.now());R.useEffect(()=>{if(!Ni||Ir===null||(gs(Date.now()),Ir<=Date.now()))return;const Y=window.setInterval(()=>{const ae=Date.now();gs(ae),ae>=Ir&&window.clearInterval(Y)},1e3);return()=>window.clearInterval(Y)},[Ni,Ir]),R.useEffect(()=>{const Y=jr.reduce((ae,be)=>be.planMode??ae,void 0);Y!==void 0?(He.current=!0,Re.current=Y,Ee(Y)):He.current&&(He.current=!1,Re.current=null,Ee(null))},[jr]);const Wu=!!L&&!(L in Ie.messagesBySession),go=R.useMemo(()=>{const Y=new Set;for(const ae of Ie.busySessions)(Ie.messagesBySession[ae]??[]).some(be=>be.parts.some(ge=>ge.type==="prompt"&&ge.prompt&&!ge.prompt.resolved&&ge.prompt.nativeId))&&Y.add(ae);return Y},[Ie.busySessions,Ie.messagesBySession]),bs=L?go.has(L):!1,Pn=gt,_c=Pn?Rt.get(Pn.id):void 0,Br=R.useMemo(()=>{var Y;for(let ae=jn.length-1;ae>=0;ae--)for(const be of jn[ae].parts)if(be.type==="prompt"&&((Y=be.prompt)==null?void 0:Y.kind)==="plan"&&!be.prompt.resolved)return{promptId:be.id,plan:be.prompt.plan??"",synthesized:!!be.prompt.synthesized};return null},[jn]),ss=R.useMemo(()=>{const Y=Pn==null?void 0:Pn.harness;if(!L||Y!=="claude-code"&&Y!=="codex")return null;for(let ae=jn.length-1;ae>=0;ae--)for(const be of jn[ae].parts)if(!(be.type!=="prompt"||!be.prompt||be.prompt.resolved)&&be.prompt.kind==="question")return be.prompt.nativeId&&!Ie.busySessions.has(L)?null:be.id;return null},[jn,Pn==null?void 0:Pn.harness,L,Ie.busySessions]),is=Y=>!ss&&Ln.some(ae=>ae.name===Y),[vs,ja]=R.useState(null),li=vs&&vs.sessionId===L?vs:null;R.useEffect(()=>{if(!vs)return;const Y=Ie.busySessions.has(vs.sessionId),ae=vs.sessionId===L&&Br&&Br.promptId!==vs.promptId;(!Y||ae)&&ja(null)},[vs,Br,Ie.busySessions,L]);const ci=R.useMemo(()=>ky(jn),[jn]),bo=Kn&&!!(We!=null&&We.supportsSteering)&&!!(We!=null&&We.agentReady)&&!Br&&!ss&&!ci&&G.length===0&&$.length===0,Yi=R.useMemo(()=>b&&L?(Y,ae,be)=>b(Y,L,ae,be):void 0,[b,L]),pc=R.useMemo(()=>w&&L?(Y,ae,be)=>w(L,Y,ae,be):void 0,[w,L]),zi=R.useMemo(()=>m&&((Y,ae,be,ge,je)=>m(Y,L??void 0,ae,be,ge,je)),[m,L]);R.useEffect(()=>{ue.current+=1,he.current+=1;const Y=(L?Ie.queuedBySession[L]??[]:[]).reduce((ae,be)=>be.planMode??ae,void 0);He.current=Y!==void 0,Re.current=Y??null,Ee(Y??null),Qe({}),F(null)},[L]),R.useEffect(()=>{z==null||z(L)},[L,z]);const as=a==="chat"&&(jn.length>0||Kn);R.useLayoutEffect(()=>{ct.current=!0;const Y=_n.current;Y&&(Y.scrollTop=Y.scrollHeight)},[L,as]),R.useLayoutEffect(()=>{const Y=_n.current;Y&&ct.current&&(Y.scrollTop=Y.scrollHeight)},[jn,Kn]),R.useEffect(()=>{const Y=_n.current,ae=Rr.current;if(!Y||!ae)return;const be=new ResizeObserver(()=>{ct.current&&(Y.scrollTop=Y.scrollHeight)});return be.observe(ae),be.observe(Y),()=>be.disconnect()},[as]);async function Zi({queue:Y=!1}={}){var dd,bc,yo,_d,Xu;const ae=J.trim(),be=ss?null:elt(ae,dt==null?void 0:dt.planActivation),ge=!!be,je=!Ei,Ve=tlt(dt==null?void 0:dt.planActivation,ge?je:void 0,Re.current),xn=ge&&(We==null?void 0:We.id)==="claude-code"?je?"plan":"auto":void 0,Tn=be?be.prompt:ae,Xn=G,lr=$,ta=lr.map(rn=>({text:rn.text})),na=e;let xo=L;const Ta=()=>{const rn=K.current;return rn.projectId===na&&rn.activeId===xo},gc=()=>{Ta()&&(ee(rn=>rn||ae),ie(rn=>rn.length?rn:Xn),B(rn=>rn.length?rn:lr))};if(ge&&!Tn&&Xn.length===0&&lr.length===0){ee(""),En(!1);try{if((We==null?void 0:We.id)==="claude-code")ms(je?"plan":"auto");else if((dt==null?void 0:dt.planActivation)==="command")await si(je);else throw new Error(C6())}catch{F(E6()),gc()}return}const qn=qt?{...qt,...xn?{permissionMode:xn}:{}}:null;xn&&ms(xn);let Ku=null;const fd=Re.current;ge&&(dt==null?void 0:dt.planActivation)==="command"&&(Ku=++he.current,Re.current=je,Ee(je));const gl=()=>{Ku===null||he.current!==Ku||(Re.current=fd,Ee(fd))};if(!Tn&&Xn.length===0&&lr.length===0)return;if((Tn||lr.length>0)&&ss&&Xn.length===0){ee(""),B([]),fi({promptId:ss,answers:[],note:Tn||void 0,annotations:ta}).then(rn=>{rn||gc()});return}const hd=JSON.stringify({text:Tn,images:Xn.map(rn=>({mediaType:rn.mediaType,name:rn.name,dataUrl:rn.dataUrl})),annotations:ta,settings:qn?{model:qn.model,serviceTier:qn.serviceTier,permissionMode:qn.permissionMode,planMode:Ve,reasoningLevel:qn.reasoningLevel}:null}),bl=((dd=Ot.current)==null?void 0:dd.signature)===hd?Ot.current.id:`ct_${crypto.randomUUID()}`;if(Ot.current={signature:hd,id:bl},Kn){if(!L||!(We!=null&&We.agentReady)){gl();return}const rn=L;ee(""),ie([]),B([]),ce(null);const ra=qn?{model:qn.model,serviceTier:qn.serviceTier,permissionMode:qn.permissionMode,planMode:(dt==null?void 0:dt.planActivation)==="command"?Ve??(gt==null?void 0:gt.planMode):Ve,reasoningLevel:qn.reasoningLevel}:{};Qe({});const sa=Xn.map(cr=>({mediaType:cr.mediaType,dataBase64:cr.dataUrl.slice(cr.dataUrl.indexOf(",")+1),name:cr.name}));try{(bc=(await yr(()=>v7(rn,Tn,ra,sa.length?sa:void 0,ta,bl,bo&&!Y&&!ge?"steer":void 0))).turn)!=null&&bc.existing&&await Sr(rn),we({}),((yo=Ot.current)==null?void 0:yo.id)===bl&&(Ot.current=null)}catch{gl(),gc()}return}if(!(We!=null&&We.agentReady)){gl();return}if(!qn){gl();return}ee(""),ie([]),B([]),ce(null);let Ti=L;try{if(!Ti){const kr=await NXe(e,qn.harness,{model:qn.model,serviceTier:qn.serviceTier,permissionMode:qn.permissionMode,planMode:Ve,reasoningLevel:qn.reasoningLevel});hn.current.add(kr.id),I(_m=>[kr,..._m]),P(kr.id),Ti=kr.id,xo=kr.id,K.current={projectId:e,activeId:kr.id}}et({type:"optimisticUser",sessionId:Ti,text:Tn||VG(),attachments:Xn.map(kr=>({url:kr.dataUrl,mediaType:kr.mediaType,name:kr.name})),annotations:lr}),et({type:"busy",sessionId:Ti,busy:!0}),ct.current=!0,Z==="archived"&&X("active");const rn=qn?{model:qn.model,serviceTier:qn.serviceTier,permissionMode:qn.permissionMode,planMode:Ve,reasoningLevel:qn.reasoningLevel}:{};Qe({});const ra=Xn.map(kr=>({mediaType:kr.mediaType,dataBase64:kr.dataUrl.slice(kr.dataUrl.indexOf(",")+1),name:kr.name})),sa=Ti;if(!sa)throw new Error(hee());(_d=(await yr(()=>v7(sa,Tn,rn,ra.length?ra:void 0,ta,bl))).turn)!=null&&_d.existing&&await Sr(sa),we({}),((Xu=Ot.current)==null?void 0:Xu.id)===bl&&(Ot.current=null)}catch(rn){if(gc(),gl(),!Ti)return;const ra=rn instanceof Error?rn.message:String(rn);if(!/session is busy/i.test(ra)&&await e0(e).then(cr=>{var Mi;return!!((Mi=cr.find(kr=>kr.id===Ti))!=null&&Mi.busy)}).catch(()=>!1)){Ta()&&(ee(cr=>cr===Tn?"":cr),ie(cr=>cr===Xn?[]:cr),B(cr=>cr===lr?[]:cr));return}et({type:"busy",sessionId:Ti,busy:!1}),et({type:"localError",sessionId:Ti,text:qV({error:Ae(ra)})})}}function Ai(){L&&$Xe(L).catch(()=>{F(zee())})}const tr=R.useCallback(async(Y,ae)=>{if(!(!L||tt.current)){tt.current=!0,F(null),qe(Y);try{const be=eYe({model:st.model,serviceTier:st.serviceTier,permissionMode:st.permissionMode,planMode:st.planMode,reasoningLevel:st.reasoningLevel}),ge=L;(await OXe(ge,Y,ae,be)).turn.existing&&await Sr(ge),we({})}catch{F($J())}finally{tt.current=!1,qe(null)}}},[L,st,Sr]),Un=R.useCallback((Y,ae)=>{if(!L||Kn||!(We!=null&&We.agentReady))return;const be=L;et({type:"busy",sessionId:be,busy:!0}),ct.current=!0,yr(()=>IXe(be,Y,ae)).catch(ge=>{et({type:"busy",sessionId:be,busy:!1});const je=ge instanceof Error?ge.message:String(ge);et({type:"localError",sessionId:be,text:WJ({error:Ae(je)})})})},[L,Kn,We==null?void 0:We.agentReady,yr]),ji=R.useCallback(Y=>{if(!L||Kn)return;const ae=L,be=at.current;et({type:"activeLeaf",sessionId:ae,leafId:Y}),yr(()=>BXe(ae,Y)).catch(ge=>{et({type:"activeLeaf",sessionId:ae,leafId:be});const je=ge instanceof Error?ge.message:String(ge);et({type:"localError",sessionId:ae,text:Mee({error:Ae(je)})})})},[L,Kn,yr]);function dl(Y){if(!L)return;const ae=L;RXe(ae,Y).then(({removed:be})=>{if(be)return Sr(ae)}).catch(()=>F(UJ()))}async function Os(Y){if(!L||Mt)return;const ae=L;F(null),yt(Y);try{await DXe(ae,Y),await Sr(ae)}catch{F(tee())}finally{yt(null)}}R.useEffect(()=>{if(!Kn||a!=="chat")return;function Y(ae){var be;ae.key!=="Escape"||ae.defaultPrevented||(ae.preventDefault(),Ai(),(be=Ut.current)==null||be.focus())}return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[Kn,L,a]);function nr(Y){dn.current.add(Y),I(ae=>ae.filter(be=>be.id!==Y)),P(ae=>ae===Y?null:ae),W(ae=>{if(!ae.has(Y))return ae;const be=new Set(ae);return be.delete(Y),be}),hn.current.delete(Y),xt.current.delete(Y),et({type:"forget",sessionId:Y})}function _l(Y,ae){const be=Y.archived;I(ge=>ge.map(je=>je.id===Y.id?{...je,archived:ae}:je)),P8(Z,ae)||P(ge=>ge===Y.id?null:ge),AXe(Y.id,ae).catch(()=>{I(ge=>ge.map(je=>je.id===Y.id?{...je,archived:be}:je))})}function ln(Y,ae){const be=Y.title;I(ge=>ge.map(je=>je.id===Y.id?{...je,title:ae}:je)),jXe(Y.id,ae).catch(()=>{I(ge=>ge.map(je=>je.id===Y.id?{...je,title:be}:je))})}async function ui(Y){var be;const ae=((be=Y.title)==null?void 0:be.trim())||b1();if(window.confirm(mV({title:eo(ae)}))){try{await zXe(Y.id)}catch(ge){window.alert(xV({title:eo(ae),error:Ae(ge instanceof Error?ge.message:String(ge))}));return}nr(Y.id)}}const fi=R.useCallback(Y=>{if(!L)return Promise.resolve(!1);const ae=L;return et({type:"busy",sessionId:ae,busy:!0}),yr(()=>HXe(ae,Y)).then(()=>!0).catch(()=>!1).finally(()=>{au(ae).then(({messages:be,queued:ge,activeLeafId:je})=>et({type:"seed",sessionId:ae,messages:be,queued:ge,activeLeafId:je})).catch(()=>{}),e0(e).then(be=>{var ge;return et({type:"busy",sessionId:ae,busy:!!((ge=be.find(je=>je.id===ae))!=null&&ge.busy)})}).catch(()=>{})})},[L,e,yr]),Qi=D.filter(Y=>P8(Z,Y.archived)),Ji=/Mac|iPhone|iPad/.test(navigator.platform),vo=Ji?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",Xt=Ji?"⌘ Enter":"Ctrl + Enter",Kr=R.useCallback(()=>{X("active"),P(null),o("chat")},[o]),ea=R.useCallback(Y=>{X("all"),P(Y),o("chat")},[o]);R.useEffect(()=>{const Y=ae=>{ae.repeat||ae.key!=="Enter"||!ae.metaKey&&!ae.ctrlKey||ae.altKey||!ae.shiftKey||(ae.preventDefault(),Kr())};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[Kr]);const pl=h.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]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg overflow-visible ${iv}`,children:[t,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${c?"active":""}`,onClick:y,children:[h.jsx(fh,{size:15}),VX()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${f?"active":""}`,"data-onboarding":"nav-artifacts",onClick:d,children:[h.jsx(q2,{size:15}),ZW()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${l?"active":""}`,onClick:_,children:[h.jsx(eE,{size:15}),$X()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${a==="skills"?"active":""}`,onClick:()=>o("skills"),children:[h.jsx(V9,{size:15}),oX()]}),Kot.map(Y=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${a!=="chat"&&a!=="skills"&&Y.activeTabs.includes(a)?"active":""}`,"data-onboarding":Y.id==="compute"?"nav-compute":void 0,onClick:()=>o(Y.id),children:[Y.icon,Y.label]},Y.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-1.5 ps-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((se=LA.find(Y=>Y.id===Z))==null?void 0:se.railLabel())??f9()}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":vo,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Kr,children:[h.jsx(V2,{size:13}),AQ()]}),h.jsx(wct,{value:Z,onChange:X})]})]}),h.jsxs("div",{className:"rail-body",children:[Qi.map(Y=>h.jsx(Ect,{session:Y,active:Y.id===L&&a==="chat",unread:q.has(Y.id),busy:Ie.busySessions.has(Y.id),waiting:go.has(Y.id),revealTitle:Rt.get(Y.id),onOpen:()=>{P(Y.id),e===S1&&ult(Y.id),W(ae=>{if(!ae.has(Y.id))return ae;const be=new Set(ae);return be.delete(Y.id),be}),o("chat")},onRename:ae=>ln(Y,ae),onSetArchived:ae=>_l(Y,ae),onDelete:()=>void ui(Y)},Y.id)),Qi.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Z==="archived"?iW():D.length>0?ZV():cW()})]})]}),mc=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${r?"":" rail-hidden"}`,ml=!r&&h.jsx("button",{className:vn,title:w6(),"aria-label":w6(),onClick:s,children:h.jsx(rE,{size:15})});return a!=="chat"?h.jsxs(h.Fragment,{children:[r&&pl,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&h.jsx("div",{className:mc,children:ml}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:j})]})]}):h.jsxs(h.Fragment,{children:[r&&pl,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:mc,children:[ml,h.jsx("div",{className:dh,title:Pn?((ye=Pn.title)==null?void 0:ye.trim())||b1():s6(),children:Pn?h.jsx(OA,{title:((Ne=Pn.title)==null?void 0:Ne.trim())||b1(),animate:_c!==void 0},_c??"static"):s6()}),C&&h.jsx("button",{className:vn,"data-tip":i6(),"aria-label":i6(),onClick:C,children:h.jsx(SVe,{size:15})})]}),Wu?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx("span",{className:Dt}),h.jsx("span",{children:bY()})]}):as?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:_n,onScroll:Y=>{const ae=Y.currentTarget;ct.current=ae.scrollHeight-ae.scrollTop-ae.clientHeight<60,zr.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Rr,children:[h.jsx(yct,{messages:jn,allMessages:ai,canFork:or,onFork:Un,onSelectFork:ji,busy:Kn,onOpenFile:zi,onOpenRun:g,onOpenSpawnedSession:ea,runExperimentName:S,onOpenExperiment:k,experimentName:v,onRespond:fi,onOpenPlan:Yi,onOpenSubagent:pc,recoveringTurnId:Le,onRecover:tr,skills:Ln}),Kn&&(bs?h.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:QQ()}):h.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[h.jsx("span",{className:Dt})," ",Xi?rp():Hee()]}))]})}):h.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:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(Q2,{})}),h.jsx("h2",{children:nJ()}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[h.jsx(fh,{size:19}),h.jsx("span",{children:n})]})]}),zr.action&&h.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:zr.action.x,top:zr.action.top,transform:"translateX(-50%)"},onMouseDown:Y=>Y.preventDefault(),onClick:zr.add,children:[h.jsx(nE,{size:14}),tK()]}),h.jsxs("div",{className:"composer py-5 px-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:start-0 [&::before]:end-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Br&&!(li&&Br.promptId===li.promptId)&&h.jsx(Dat,{synthesized:Br.synthesized,agentLabel:Pn?Yf[Pn.harness]:Oee(),showResumeModes:(Pn==null?void 0:Pn.harness)==="claude-code",onView:Y=>Yi==null?void 0:Yi(Br.plan,Br.promptId,Y),onApprove:Y=>fi({promptId:Br.promptId,approve:!0,...Y?{resumeMode:Y}:{}}),onReject:()=>fi({promptId:Br.promptId,approve:!1}),onRevise:Y=>{L&&ja({sessionId:L,promptId:Br.promptId}),fi({promptId:Br.promptId,approve:!1,note:Y})}}),jr.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:jr.map((Y,ae)=>h.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:Y.error?`${Y.text} -${Y.error}`:Y.text,children:[Y.dispatchState==="blocked"?d.jsx(sE,{size:13,className:"shrink-0 text-accent-amber"}):d.jsx(VGe,{size:13,className:"shrink-0 text-muted"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:Y.text}),Y.dispatchState!=="blocked"&&d.jsx("span",{className:"shrink-0 text-xs text-muted",children:Y.dispatchState==="retrying"?mXe(Y.nextRetryAt,Aa):CJ()}),Y.dispatchState==="blocked"?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>void Rs(Y.id),"aria-label":LO({text:Y.text}),disabled:Dt!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-xs text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:Dt===Y.id?C9():A2()}),d.jsx("button",{onClick:()=>hl(Y.id),"aria-label":TO({text:Y.text}),disabled:Dt!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-xs text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:SZ()}),ae===ai&&aehl(Y.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:d.jsx(Gr,{size:11})})]},Y.id))}),d.jsxs("div",{className:`composer-box relative flex flex-col border border-border rounded-lg bg-background ${rv}`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&d.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[d.jsxs("strong",{children:[Ke.name," ",YX()]})," ",Ke.agentNote?Lp(Ke.agentNote):MJ()]}),Cn&&d.jsx(_ot,{skills:Mr,activeIndex:ni,onPick:Tr,onHover:zs}),$.length>0&&d.jsx(Yot,{annotations:$,onClear:()=>{B([]),window.requestAnimationFrame(()=>{var Y;return(Y=Qe.current)==null?void 0:Y.focus()})},onRemove:Y=>{const ae=$.filter(be=>be.id!==Y);B(ae),ae.length===0&&window.requestAnimationFrame(()=>{var be;return(be=Qe.current)==null?void 0:be.focus()})}}),G.length>0&&d.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:G.map((Y,ae)=>{const be=()=>ie(me=>me.filter((Te,We)=>We!==ae));return Y.mediaType==="application/pdf"?d.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:Y.name,children:[d.jsx(wu,{size:22}),d.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:Y.name??"document.pdf"}),d.jsx("button",{title:m6(),"aria-label":m6(),onClick:be,children:d.jsx(Gr,{size:11})})]},ae):d.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:[d.jsx("img",{src:Y.dataUrl,alt:oJ()}),d.jsx("button",{title:g6(),"aria-label":g6(),onClick:be,children:d.jsx(Gr,{size:11})})]},ae)})}),ve&&d.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ve}),re&&d.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:re}),d.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[d.jsx("textarea",{dir:"auto",ref:Qe,className:"relative z-1 bg-transparent",value:J,placeholder:Qr?Kee():bo&&Ke?yee({harness:je(Yf[Ke.id]),shortcut:je(Kt)}):qt?Ke!=null&&Ke.agentReady?IV({harness:je(Yf[qt.harness])}):RV({harness:je(Yf[qt.harness])}):$G(),rows:2,onPaste:kn,onDragOver:Y=>{Y.dataTransfer.types.includes("Files")&&Y.preventDefault()},onDrop:Y=>{Y.dataTransfer.files.length!==0&&(Y.preventDefault(),sn(Array.from(Y.dataTransfer.files)))},onChange:Y=>{const ae=Y.target.value,be=Y.target.selectionStart;jr(be);const me=be>0&&/\s/.test(ae[be-1])&&!Qr&&!Pr.current?db(ae,be-1):null;if((me==null?void 0:me.query)==="plan"&&(ft!=null&&ft.planActivation)){vr(ae,me);return}const Te=me?Mn.find(We=>We.source!=="command"&&We.name===me.query):void 0;if(Te&&me){const We=A8(ae,me,Te.name,2);ee(We.text),window.requestAnimationFrame(()=>{var bn;(bn=Qe.current)==null||bn.setSelectionRange(We.cursor,We.cursor),jr(We.cursor)});return}ee(ae),ei(!1)},onSelect:Y=>jr(Y.currentTarget.selectionStart),onCompositionStart:()=>{Pr.current=!0},onCompositionEnd:()=>{Pr.current=!1},onKeyDown:Y=>{if(Cn){if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const ae=Y.key==="ArrowDown"?1:-1;zs((ni+ae+Mr.length)%Mr.length);return}if(Y.key==="Tab"||Y.key==="Enter"){Y.preventDefault(),Tr(Mr[ni]);return}if(Y.key==="Escape"){Y.preventDefault(),ei(!0);return}}if(Y.key==="Backspace"&&En(Y.currentTarget)){Y.preventDefault();return}Y.key==="Enter"&&!Y.shiftKey&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),Zi({queue:Y.metaKey||Y.ctrlKey}))}}),d.jsx(Sot,{text:J,isCommand:Jr,skills:Mn,projectId:e,textareaRef:Qe})]}),d.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[d.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:St.ref,children:[d.jsx("button",{type:"button",className:`${sv} composer-bare`,title:m1(),"aria-label":m1(),"aria-haspopup":"dialog","aria-expanded":St.open,onClick:()=>St.setOpen(Y=>!Y),children:d.jsx(uWe,{size:16})}),St.open&&d.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-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[d.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:m1()}),d.jsx(RXe,{})]})]}),d.jsx("input",{ref:Re,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:Y=>{sn(Array.from(Y.target.files??[])),Y.target.value=""}}),d.jsx("button",{type:"button",className:`${sv} composer-attach`,title:i6(),"aria-label":i6(),onClick:()=>{var Y;return(Y=Re.current)==null?void 0:Y.click()},children:d.jsx(qVe,{size:16})}),Ci&&d.jsxs("button",{type:"button",className:`${Kd} plan-indicator group shrink-0 gap-1.5 bg-surface px-2 text-sm text-muted hover:text-text focus-visible:text-text`,title:f6(),"aria-label":f6(),onClick:()=>void si(),children:[d.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[d.jsx(NVe,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),d.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),d.jsx("span",{children:jY()})]}),d.jsx("div",{className:"min-w-0 flex-1"}),d.jsxs("div",{className:"flex min-w-0 items-center",children:[d.jsx(gat,{value:qt,onSelect:Zn,permissionChoices:Ke!=null&&Ke.agentReady?(ft==null?void 0:ft.permissionModes)??[]:[],defaultPermissionId:(ft==null?void 0:ft.defaultPermissionMode)??null,onSelectPermission:ds,reasoningChoices:Ke!=null&&Ke.agentReady?fs.choices:[],defaultReasoningId:fs.defaultId,onSelectReasoning:Ki,onHarnesses:At,lockHarness:!!pt}),d.jsx(Cot,{usage:pt==null?void 0:pt.contextUsage})]}),Gn&&!Qr?d.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:y6(),"aria-label":y6(),onClick:zi,children:d.jsx(Gr,{size:16})}):d.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:Vb(),"aria-label":Vb(),onClick:()=>void Zi(),disabled:!(Ke!=null&&Ke.agentReady)||!J.trim()&&G.length===0&&$.length===0,children:d.jsx(W9,{size:16})})]})]})]})]})]})}const P8=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Glt({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[c,f]=R.useState(null),_=R.useRef(null),h=R.useRef(null),m=R.useRef(!0);if(R.useLayoutEffect(()=>{m.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&m.current&&(S.scrollTop=S.scrollHeight)},[c]),R.useEffect(()=>{const S=_.current,k=h.current;if(!S||!k)return;const v=new ResizeObserver(()=>{m.current&&(S.scrollTop=S.scrollHeight)});return v.observe(k),v.observe(S),()=>v.disconnect()},[c===null]),R.useEffect(()=>{let S=!0;const k=new Set;let v=0;const b=()=>{const y=++v;au(e).then(({messages:C})=>{!S||y!==v||f(z=>{if(!z)return C;const N=C.map(j=>k.has(j.id)?z.find(D=>D.id===j.id)??j:j),T=new Set(C.map(j=>j.id));return[...N,...z.filter(j=>!T.has(j.id))]})}).catch(()=>S&&f(C=>C??[]))};b();const w=dd(y=>{if(y.type==="reconnected"){k.clear(),b();return}y.type!=="message"||y.sessionId!==e||(k.add(y.message.id),f(C=>{const z=C?C.slice():[],N=z.findIndex(T=>T.id===y.message.id);return N===-1?z.push(y.message):z[N]=y.message,z}))});return()=>{S=!1,w()}},[e]),c===null)return d.jsx("div",{className:Xa,children:d.jsx("div",{className:P8,children:d.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:PPe()})})});let g=null;for(const S of c)if(g=yy(S.parts,n),g)break;return d.jsx("div",{className:Xa,children:d.jsx("div",{className:P8,ref:_,onScroll:S=>{const k=S.currentTarget;m.current=k.scrollHeight-k.scrollTop-k.clientHeight<60},children:d.jsx("div",{ref:h,children:g?d.jsx(Dlt,{spawn:g,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):d.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:GPe()})})})})}function F8(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 en(e){for(var n=1;n=0||(_[c]=o[c]);return _})(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function Vt(e,n){return LA(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var a,o,l,c,f=[],_=!0,h=!1;try{if(l=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(a=l.call(s)).done)&&(f.push(a.value),f.length!==r);_=!0);}catch(m){h=!0,o=m}finally{try{if(!_&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(h)throw o}}return f}})(e,n)||Pp(e,n)||IA()}function DA(e){return LA(e)||OA(e)||Pp(e)||IA()}function Vs(e){return(function(n){if(Array.isArray(n))return Zv(n)})(e)||OA(e)||Pp(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 LA(e){if(Array.isArray(e))return e}function OA(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pp(e,n){if(e){if(typeof e=="string")return Zv(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)?Zv(e,n):void 0}}function Zv(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 a,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return o=c.done,c},e:function(c){l=!0,a=c},f:function(){try{o||t.return==null||t.return()}finally{if(l)throw a}}}}var L_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sh(e,n){return e(n={exports:{}},n.exports),n.exports}var qs=sh((function(e){/*! +${Y.error}`:Y.text,children:[Y.dispatchState==="blocked"?h.jsx(oE,{size:13,className:"shrink-0 text-accent-amber"}):h.jsx(AVe,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:Y.text}),Y.dispatchState!=="blocked"&&h.jsx("span",{className:"shrink-0 text-xs text-muted",children:Y.dispatchState==="retrying"?JXe(Y.nextRetryAt,Aa):zJ()}),Y.dispatchState==="blocked"?h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>void Os(Y.id),"aria-label":BO({text:Y.text}),disabled:Mt!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-xs text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:Mt===Y.id?z9():T2()}),h.jsx("button",{onClick:()=>dl(Y.id),"aria-label":DO({text:Y.text}),disabled:Mt!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-xs text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:EZ()}),ae===oi&&aedl(Y.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(Yr,{size:11})})]},Y.id))}),h.jsxs("div",{className:`composer-box relative flex flex-col border border-border rounded-lg bg-background ${iv}`,"data-onboarding":"composer",children:[We&&!We.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[We.name," ",JX()]})," ",We.agentNote?Op(We.agentNote):LJ()]}),zn&&h.jsx(Zot,{skills:Or,activeIndex:ri,onPick:Lr,onHover:an}),$.length>0&&h.jsx(Rlt,{annotations:$,onClear:()=>{B([]),window.requestAnimationFrame(()=>{var Y;return(Y=Ut.current)==null?void 0:Y.focus()})},onRemove:Y=>{const ae=$.filter(be=>be.id!==Y);B(ae),ae.length===0&&window.requestAnimationFrame(()=>{var be;return(be=Ut.current)==null?void 0:be.focus()})}}),G.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:G.map((Y,ae)=>{const be=()=>ie(ge=>ge.filter((je,Ve)=>Ve!==ae));return Y.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:Y.name,children:[h.jsx(wu,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:Y.name??"document.pdf"}),h.jsx("button",{title:b6(),"aria-label":b6(),onClick:be,children:h.jsx(Yr,{size:11})})]},ae):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:Y.dataUrl,alt:uJ()}),h.jsx("button",{title:v6(),"aria-label":v6(),onClick:be,children:h.jsx(Yr,{size:11})})]},ae)})}),ve&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ve}),re&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:re}),h.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[h.jsx("textarea",{dir:"auto",ref:Ut,className:"relative z-1 bg-transparent",value:J,placeholder:ss?Zee():bo&&We?kee({harness:Ae(Yf[We.id]),shortcut:Ae(Xt)}):qt?We!=null&&We.agentReady?HV({harness:Ae(Yf[qt.harness])}):OV({harness:Ae(Yf[qt.harness])}):PG(),rows:2,onPaste:Nn,onDragOver:Y=>{Y.dataTransfer.types.includes("Files")&&Y.preventDefault()},onDrop:Y=>{Y.dataTransfer.files.length!==0&&(Y.preventDefault(),on(Array.from(Y.dataTransfer.files)))},onChange:Y=>{const ae=Y.target.value,be=Y.target.selectionStart;Dr(be);const ge=be>0&&/\s/.test(ae[be-1])&&!ss&&!Vr.current?pb(ae,be-1):null;if((ge==null?void 0:ge.query)==="plan"&&(dt!=null&&dt.planActivation)){wr(ae,ge);return}const je=ge?Ln.find(Ve=>Ve.source!=="command"&&Ve.name===ge.query):void 0;if(je&&ge){const Ve=T8(ae,ge,je.name,2);ee(Ve.text),window.requestAnimationFrame(()=>{var xn;(xn=Ut.current)==null||xn.setSelectionRange(Ve.cursor,Ve.cursor),Dr(Ve.cursor)});return}ee(ae),En(!1)},onSelect:Y=>Dr(Y.currentTarget.selectionStart),onCompositionStart:()=>{Vr.current=!0},onCompositionEnd:()=>{Vr.current=!1},onKeyDown:Y=>{if(zn){if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const ae=Y.key==="ArrowDown"?1:-1;an((ri+ae+Or.length)%Or.length);return}if(Y.key==="Tab"||Y.key==="Enter"){Y.preventDefault(),Lr(Or[ri]);return}if(Y.key==="Escape"){Y.preventDefault(),En(!0);return}}if(Y.key==="Backspace"&&An(Y.currentTarget)){Y.preventDefault();return}Y.key==="Enter"&&!Y.shiftKey&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),Zi({queue:Y.metaKey||Y.ctrlKey}))}}),h.jsx(alt,{text:J,isCommand:is,skills:Ln,projectId:e,textareaRef:Ut})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:Qt.ref,children:[h.jsx("button",{type:"button",className:`${av} composer-bare`,title:g1(),"aria-label":g1(),"aria-haspopup":"dialog","aria-expanded":Qt.open,onClick:()=>Qt.setOpen(Y=>!Y),children:h.jsx(WWe,{size:16})}),Qt.open&&h.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-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:g1()}),h.jsx(mYe,{})]})]}),h.jsx("input",{ref:Te,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:Y=>{on(Array.from(Y.target.files??[])),Y.target.value=""}}),h.jsx("button",{type:"button",className:`${av} composer-attach`,title:o6(),"aria-label":o6(),onClick:()=>{var Y;return(Y=Te.current)==null?void 0:Y.click()},children:h.jsx(NWe,{size:16})}),Ei&&h.jsxs("button",{type:"button",className:`${Kh} plan-indicator group shrink-0 gap-1.5 bg-surface px-2 text-sm text-muted hover:text-text focus-visible:text-text`,title:d6(),"aria-label":d6(),onClick:()=>void ii(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(uWe,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(Yr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:RY()})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsxs("div",{className:"flex min-w-0 items-center",children:[h.jsx(eot,{value:qt,onSelect:er,permissionChoices:We!=null&&We.agentReady?(dt==null?void 0:dt.permissionModes)??[]:[],defaultPermissionId:(dt==null?void 0:dt.defaultPermissionMode)??null,onSelectPermission:ms,reasoningChoices:We!=null&&We.agentReady?ps.choices:[],defaultReasoningId:ps.defaultId,onSelectReasoning:Ki,onHarnesses:zt,lockHarness:!!gt}),h.jsx(llt,{usage:gt==null?void 0:gt.contextUsage})]}),Kn&&!ss?h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:S6(),"aria-label":S6(),onClick:Ai,children:h.jsx(Yr,{size:16})}):h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:Kb(),"aria-label":Kb(),onClick:()=>void Zi(),disabled:!(We!=null&&We.agentReady)||!J.trim()&&G.length===0&&$.length===0,children:h.jsx(Y9,{size:16})})]})]})]})]})]})}const U8=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function zct({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[c,f]=R.useState(null),_=R.useRef(null),d=R.useRef(null),m=R.useRef(!0);if(R.useLayoutEffect(()=>{m.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&m.current&&(S.scrollTop=S.scrollHeight)},[c]),R.useEffect(()=>{const S=_.current,k=d.current;if(!S||!k)return;const v=new ResizeObserver(()=>{m.current&&(S.scrollTop=S.scrollHeight)});return v.observe(k),v.observe(S),()=>v.disconnect()},[c===null]),R.useEffect(()=>{let S=!0;const k=new Set;let v=0;const b=()=>{const y=++v;au(e).then(({messages:C})=>{!S||y!==v||f(z=>{if(!z)return C;const N=C.map(j=>k.has(j.id)?z.find(D=>D.id===j.id)??j:j),T=new Set(C.map(j=>j.id));return[...N,...z.filter(j=>!T.has(j.id))]})}).catch(()=>S&&f(C=>C??[]))};b();const w=hh(y=>{if(y.type==="reconnected"){k.clear(),b();return}y.type!=="message"||y.sessionId!==e||(k.add(y.message.id),f(C=>{const z=C?C.slice():[],N=z.findIndex(T=>T.id===y.message.id);return N===-1?z.push(y.message):z[N]=y.message,z}))});return()=>{S=!1,w()}},[e]),c===null)return h.jsx("div",{className:Xa,children:h.jsx("div",{className:U8,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:kPe()})})});let g=null;for(const S of c)if(g=Sy(S.parts,n),g)break;return h.jsx("div",{className:Xa,children:h.jsx("div",{className:U8,ref:_,onScroll:S=>{const k=S.currentTarget;m.current=k.scrollHeight-k.scrollTop-k.clientHeight<60},children:h.jsx("div",{ref:d,children:g?h.jsx(gct,{spawn:g,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:zPe()})})})})}function q8(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 tn(e){for(var n=1;n=0||(_[c]=o[c]);return _})(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function Vt(e,n){return BA(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var a,o,l,c,f=[],_=!0,d=!1;try{if(l=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(a=l.call(s)).done)&&(f.push(a.value),f.length!==r);_=!0);}catch(m){d=!0,o=m}finally{try{if(!_&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(d)throw o}}return f}})(e,n)||Pp(e,n)||HA()}function IA(e){return BA(e)||$A(e)||Pp(e)||HA()}function Xs(e){return(function(n){if(Array.isArray(n))return Jv(n)})(e)||$A(e)||Pp(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 BA(e){if(Array.isArray(e))return e}function $A(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pp(e,n){if(e){if(typeof e=="string")return Jv(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)?Jv(e,n):void 0}}function Jv(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 a,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return o=c.done,c},e:function(c){l=!0,a=c},f:function(){try{o||t.return==null||t.return()}finally{if(l)throw a}}}}var L_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sd(e,n){return e(n={exports:{}},n.exports),n.exports}var Ws=sd((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 z=b.slice(y+1);z.indexOf("file mode")===0&&(o[C==="new"?"newMode":"oldMode"]=z.slice(10));break;case"similarity":o.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");o.oldRevision=T[0],o.newRevision=T[1],N[1]&&(o.oldMode=o.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?o.oldPath=j.slice(5):o.newPath=j.slice(3),w=C;break;case"---":var D=b.slice(y+1),I=g[++k].slice(4);D==="/dev/null"?(I=I.slice(2),w="add"):I==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),I=I.slice(2)),D&&(o.oldPath=D),I&&(o.newPath=I),m=5;break e}}o.type=w||"modify"}else if(v.indexOf("Binary")===0)o.isBinary=!0,o.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",m=2,o=null;else if(m===5)if(v.indexOf("@@")===0){var L=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);l={content:v,oldStart:L[1]-0,newStart:L[4]-0,oldLines:L[3]-0||1,newLines:L[6]-0||1,changes:[]},o.hunks.push(l),c=l.oldStart,f=l.newStart}else{var U=v.slice(0,1),q={content:v.slice(1)};switch(U){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=f,f++;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=f,c++,f++;break;case"\\":var W=l.changes[l.changes.length-1];W.isDelete||(o.newEndingNewLine=!1),W.isInsert||(o.oldEndingNewLine=!1)}q.type&&l.changes.push(q)}k++}return h}};e.exports=s})()}));function dl(e){return e.type==="insert"}function Ws(e){return e.type==="delete"}function oo(e){return e.type==="normal"}function Xlt(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(a,o,l){var c=Vt(a,3),f=c[0],_=c[1],h=c[2];return _?dl(o)&&h>=0?(f.splice(h+1,0,o),[f,o,h+2]):(f.push(o),[f,o,Ws(o)&&Ws(_)?h:l]):(f.push(o),[f,o,Ws(o)?l:-1])}),[[],null,-1]);return Vt(s,1)[0]})(e.changes):e.changes;return en(en({},e),{},{isPlain:!1,changes:t})}function Qv(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&&(o[C==="new"?"newMode":"oldMode"]=z.slice(10));break;case"similarity":o.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");o.oldRevision=T[0],o.newRevision=T[1],N[1]&&(o.oldMode=o.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?o.oldPath=j.slice(5):o.newPath=j.slice(3),w=C;break;case"---":var D=b.slice(y+1),I=g[++k].slice(4);D==="/dev/null"?(I=I.slice(2),w="add"):I==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),I=I.slice(2)),D&&(o.oldPath=D),I&&(o.newPath=I),m=5;break e}}o.type=w||"modify"}else if(v.indexOf("Binary")===0)o.isBinary=!0,o.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",m=2,o=null;else if(m===5)if(v.indexOf("@@")===0){var L=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);l={content:v,oldStart:L[1]-0,newStart:L[4]-0,oldLines:L[3]-0||1,newLines:L[6]-0||1,changes:[]},o.hunks.push(l),c=l.oldStart,f=l.newStart}else{var P=v.slice(0,1),q={content:v.slice(1)};switch(P){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=f,f++;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=f,c++,f++;break;case"\\":var W=l.changes[l.changes.length-1];W.isDelete||(o.newEndingNewLine=!1),W.isInsert||(o.oldEndingNewLine=!1)}q.type&&l.changes.push(q)}k++}return d}};e.exports=s})()}));function hl(e){return e.type==="insert"}function Ys(e){return e.type==="delete"}function oo(e){return e.type==="normal"}function Mct(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(a,o,l){var c=Vt(a,3),f=c[0],_=c[1],d=c[2];return _?hl(o)&&d>=0?(f.splice(d+1,0,o),[f,o,d+2]):(f.push(o),[f,o,Ys(o)&&Ys(_)?d:l]):(f.push(o),[f,o,Ys(o)?l:-1])}),[[],null,-1]);return Vt(s,1)[0]})(e.changes):e.changes;return tn(tn({},e),{},{isPlain:!1,changes:t})}function e2(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(` `),a=r.indexOf(` `,s+1),o=r.slice(0,s),l=r.slice(s+1,a),c=o.split(" ").slice(1,-3).join(" "),f=l.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(f),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(f),r.slice(a+1)].join(` -`)})(e.trimStart());return Klt.parse(t).map((function(r){return(function(s,a){var o=s.hunks.map((function(l){return Xlt(l,a)}));return en(en({},s),{},{hunks:o})})(r,n)}))}function Ylt(e){return e[0]}function Zlt(e){return e[e.length-1]}function Jv(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function kd(e){return e==="old"?function(n){return dl(n)?-1:oo(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ws(n)?-1:oo(n)?n.newLineNumber:n.lineNumber}}function $A(e,n){return function(t,r){var s=t[e],a=s+t[n];return r>=s&&r=a&&s-1},ict=function(e,n){var t=this.__data__,r=Fp(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function tu(e){var n=-1,t=e==null?0:e.length;for(this.clear();++nl))return!1;var f=a.get(e),_=a.get(n);if(f&&_)return f==n&&_==e;var h=-1,m=!0,g=2&t?new Fct:void 0;for(a.set(e,n),a.set(n,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Tn={};Tn["[object Float32Array]"]=Tn["[object Float64Array]"]=Tn["[object Int8Array]"]=Tn["[object Int16Array]"]=Tn["[object Int32Array]"]=Tn["[object Uint8Array]"]=Tn["[object Uint8ClampedArray]"]=Tn["[object Uint16Array]"]=Tn["[object Uint32Array]"]=!0,Tn["[object Arguments]"]=Tn["[object Array]"]=Tn["[object ArrayBuffer]"]=Tn["[object Boolean]"]=Tn["[object DataView]"]=Tn["[object Date]"]=Tn["[object Error]"]=Tn["[object Function]"]=Tn["[object Map]"]=Tn["[object Number]"]=Tn["[object Object]"]=Tn["[object RegExp]"]=Tn["[object Set]"]=Tn["[object String]"]=Tn["[object WeakMap]"]=!1;var sut=function(e){return Tu(e)&&Cy(e.length)&&!!Tn[Vu(e)]},iut=function(e){return function(n){return e(n)}},Y8=sh((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&FA.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}})();e.exports=a})),Z8=Y8&&Y8.isTypedArray,Ey=Z8?iut(Z8):sut,aut=Object.prototype.hasOwnProperty,out=function(e,n){var t=Ys(e),r=!t&&Vp(e),s=!t&&!r&&H0(e),a=!t&&!r&&!s&&Ey(e),o=t||r||s||a,l=o?Jct(e.length,String):[],c=l.length;for(var f in e)!aut.call(e,f)||o&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||KA(f,c))||l.push(f);return l},lut=Object.prototype,XA=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||lut)},cut=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),uut=Object.prototype.hasOwnProperty,YA=function(e){if(!XA(e))return cut(e);var n=[];for(var t in Object(e))uut.call(e,t)&&t!="constructor"&&n.push(t);return n},Wp=function(e){return e!=null&&Cy(e.length)&&!qA(e)},Ny=function(e){return Wp(e)?out(e):YA(e)},Q8=function(e){return Kct(e,Ny,Qct)},fut=Object.prototype.hasOwnProperty,dut=function(e,n,t,r,s,a){var o=1&t,l=Q8(e),c=l.length;if(c!=Q8(n).length&&!o)return!1;for(var f=c;f--;){var _=l[f];if(!(o?_ in n:fut.call(n,_)))return!1}var h=a.get(e),m=a.get(n);if(h&&m)return h==n&&m==e;var g=!0;a.set(e,n),a.set(n,e);for(var S=o;++f1)return!1;if(e.length===1){var n=Vt(e,1)[0];return n.type==="text"&&!n.value}return!0}function eft(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,a=ol(e,Qut),o=s?function(l,c){return s(l,rk,c)}:rk;return d.jsx("td",en(en({},a),{},{"data-change-key":n,children:r?Jut(r)?" ":r.map(o):t||" "}))}var sj=R.memo(eft);function ij(e,n){return function(){var t=n==="old"?Qp(e):Jp(e);return t===-1?void 0:t}}function aj(e,n){return function(t){return e&&t?d.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function P0(e,n){return n?function(t){e(),n(t)}:e}function sk(e,n,t,r){return R.useMemo((function(){var s=rj(e,(function(a){return function(o){return a&&a(n,o)}}));return s.onMouseEnter=P0(t,s.onMouseEnter),s.onMouseLeave=P0(r,s.onMouseLeave),s}),[e,t,r,n])}function ik(e,n,t,r,s,a,o,l,c){var f={change:n,side:r,inHoverState:l,renderDefault:ij(n,r),wrapInAnchor:aj(s,a)};return d.jsx("td",en(en({className:e},o),{},{"data-change-key":t,children:c(f)}))}function tft(e){var n,t,r,s=e.change,a=e.selected,o=e.tokens,l=e.className,c=e.generateLineClassName,f=e.gutterClassName,_=e.codeClassName,h=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.gutterAnchor,k=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=tl(s),z=(n=Vt(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=Vt(z,3),T=N[0],j=N[1],D=N[2],I=R.useMemo((function(){return{change:s}}),[s]),L=sk(h,I,j,D),U=sk(m,I,j,D),q=k(s),W=c({changes:[s],defaultGenerate:function(){return l}}),Z=qs("diff-gutter","diff-gutter-".concat(w),f,{"diff-gutter-selected":a}),X=qs("diff-code","diff-code-".concat(w),_,{"diff-code-selected":a});return d.jsxs("tr",{id:q,className:qs("diff-line",W),children:[!g&&ik(Z,s,C,"old",S,q,L,T,b),!g&&ik(Z,s,C,"new",S,q,L,T,b),d.jsx(sj,en({className:X,changeKey:C,text:y,tokens:o,renderToken:v},U))]})}var nft=R.memo(tft);function rft(e){var n=e.hideGutter,t=e.element;return d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var sft=["hideGutter","selectedChanges","tokens","lineClassName"],ift=["hunk","widgets","className"];function aft(e){var n=e.hunk,t=e.widgets,r=e.className,s=ol(e,ift),a=(function(o,l){return o.reduce((function(c,f){var _=tl(f);c.push(["change",_,f]);var h=l[_];return h&&c.push(["widget",_,h]),c}),[])})(n.changes,t);return d.jsx("tbody",{className:qs("diff-hunk",r),children:a.map((function(o){return(function(l,c){var f=Vt(l,3),_=f[0],h=f[1],m=f[2],g=c.hideGutter,S=c.selectedChanges,k=c.tokens,v=c.lineClassName,b=ol(c,sft);if(_==="change"){var w=Ws(m)?"old":"new",y=Ws(m)?Qp(m):Jp(m),C=k?k[w][y-1]:null;return d.jsx(nft,en({className:v,change:m,hideGutter:g,selected:S.includes(h),tokens:C},b),"change".concat(h))}return _==="widget"?d.jsx(rft,{hideGutter:g,element:m},"widget".concat(h)):null})(o,s)}))})}var oj=0;function I_(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),a=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var o=rj(r,(function(l){return function(c){return l&&l({side:e,change:t},c)}}));return o.onMouseEnter=P0(s,o.onMouseEnter),o.onMouseLeave=P0(a,o.onMouseLeave),o}),[t,r,s,e,a])}function Sb(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,c=e.codeEvents,f=e.anchorID,_=e.gutterAnchor,h=e.gutterAnchorTarget,m=e.hideGutter,g=e.hover,S=e.renderToken,k=e.renderGutter;if(!n){var v=qs("diff-gutter","diff-gutter-omit",a),b=qs("diff-code","diff-code-omit",o);return[!m&&d.jsx("td",{className:v},"gutter"),d.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=tl(n),z=t===oj?"old":"new",N=en({id:f||void 0,className:qs("diff-gutter","diff-gutter-".concat(w),Yv({"diff-gutter-selected":r},"diff-line-hover-"+z,g),a),children:k({change:n,side:z,inHoverState:g,renderDefault:ij(n,z),wrapInAnchor:aj(_,h)})},l),T=qs("diff-code","diff-code-".concat(w),Yv({"diff-code-selected":r},"diff-line-hover-"+z,g),o);return[!m&&d.jsx("td",en(en({},N),{},{"data-change-key":C}),"gutter"),d.jsx(sj,en({className:T,changeKey:C,text:y,tokens:s,renderToken:S},c),"code")]}function oft(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,c=e.monotonous,f=e.gutterClassName,_=e.codeClassName,h=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.generateAnchorID,k=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=Vt(R.useState(""),2),C=y[0],z=y[1],N=I_("old",z,t,h),T=I_("new",z,r,h),j=I_("old",z,t,m),D=I_("new",z,r,m),I=t&&S(t),L=r&&S(r),U=k({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:c,hideGutter:g,gutterClassName:f,codeClassName:_,gutterEvents:h,codeEvents:m,renderToken:b,renderGutter:w},W=en(en({},q),{},{change:t,side:oj,selected:s,tokens:o,gutterEvents:N,codeEvents:j,anchorID:I,gutterAnchor:v,gutterAnchorTarget:I,hover:C==="old"}),Z=en(en({},q),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:T,codeEvents:D,anchorID:t===r?null:L,gutterAnchor:v,gutterAnchorTarget:t===r?I:L,hover:C==="new"});if(c)return d.jsx("tr",{className:qs("diff-line",U),children:Sb(t?W:Z)});var X=(function(J,ee){return J&&!ee?"diff-line-old-only":!J&&ee?"diff-line-new-only":J===ee?"diff-line-normal":"diff-line-compare"})(t,r);return d.jsxs("tr",{className:qs("diff-line",X,U),children:[Sb(W),Sb(Z)]})}var lft=R.memo(oft);function cft(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):d.jsxs("tr",{className:"diff-widget",children:[d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var uft=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],fft=["hunk","widgets","className"];function B_(e,n){return(e?tl(e):"00")+(n?tl(n):"00")}function dft(e){var n=e.hunk,t=e.widgets,r=e.className,s=ol(e,fft),a=(function(o,l){for(var c=function(b){if(!b)return null;var w=tl(b);return l[w]||null},f=[],_=0;_=s&&r=a&&s-1},Pct=function(e,n){var t=this.__data__,r=Up(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function tu(e){var n=-1,t=e==null?0:e.length;for(this.clear();++nl))return!1;var f=a.get(e),_=a.get(n);if(f&&_)return f==n&&_==e;var d=-1,m=!0,g=2&t?new Cut:void 0;for(a.set(e,n),a.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Dn={};Dn["[object Float32Array]"]=Dn["[object Float64Array]"]=Dn["[object Int8Array]"]=Dn["[object Int16Array]"]=Dn["[object Int32Array]"]=Dn["[object Uint8Array]"]=Dn["[object Uint8ClampedArray]"]=Dn["[object Uint16Array]"]=Dn["[object Uint32Array]"]=!0,Dn["[object Arguments]"]=Dn["[object Array]"]=Dn["[object ArrayBuffer]"]=Dn["[object Boolean]"]=Dn["[object DataView]"]=Dn["[object Date]"]=Dn["[object Error]"]=Dn["[object Function]"]=Dn["[object Map]"]=Dn["[object Number]"]=Dn["[object Object]"]=Dn["[object RegExp]"]=Dn["[object Set]"]=Dn["[object String]"]=Dn["[object WeakMap]"]=!1;var Fut=function(e){return Tu(e)&&Ny(e.length)&&!!Dn[Vu(e)]},Put=function(e){return function(n){return e(n)}},Q8=sd((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&GA.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}})();e.exports=a})),J8=Q8&&Q8.isTypedArray,zy=J8?Put(J8):Fut,Uut=Object.prototype.hasOwnProperty,qut=function(e,n){var t=Js(e),r=!t&&Wp(e),s=!t&&!r&&F0(e),a=!t&&!r&&!s&&zy(e),o=t||r||s||a,l=o?Out(e.length,String):[],c=l.length;for(var f in e)!Uut.call(e,f)||o&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ZA(f,c))||l.push(f);return l},Gut=Object.prototype,QA=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Gut)},Vut=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Wut=Object.prototype.hasOwnProperty,JA=function(e){if(!QA(e))return Vut(e);var n=[];for(var t in Object(e))Wut.call(e,t)&&t!="constructor"&&n.push(t);return n},Kp=function(e){return e!=null&&Ny(e.length)&&!WA(e)},Ay=function(e){return Kp(e)?qut(e):JA(e)},ek=function(e){return Tut(e,Ay,Lut)},Kut=Object.prototype.hasOwnProperty,Xut=function(e,n,t,r,s,a){var o=1&t,l=ek(e),c=l.length;if(c!=ek(n).length&&!o)return!1;for(var f=c;f--;){var _=l[f];if(!(o?_ in n:Kut.call(n,_)))return!1}var d=a.get(e),m=a.get(n);if(d&&m)return d==n&&m==e;var g=!0;a.set(e,n),a.set(n,e);for(var S=o;++f1)return!1;if(e.length===1){var n=Vt(e,1)[0];return n.type==="text"&&!n.value}return!0}function Ift(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,a=ol(e,Lft),o=s?function(l,c){return s(l,ik,c)}:ik;return h.jsx("td",tn(tn({},a),{},{"data-change-key":n,children:r?Oft(r)?" ":r.map(o):t||" "}))}var oj=R.memo(Ift);function lj(e,n){return function(){var t=n==="old"?Jp(e):em(e);return t===-1?void 0:t}}function cj(e,n){return function(t){return e&&t?h.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function P0(e,n){return n?function(t){e(),n(t)}:e}function ak(e,n,t,r){return R.useMemo((function(){var s=aj(e,(function(a){return function(o){return a&&a(n,o)}}));return s.onMouseEnter=P0(t,s.onMouseEnter),s.onMouseLeave=P0(r,s.onMouseLeave),s}),[e,t,r,n])}function ok(e,n,t,r,s,a,o,l,c){var f={change:n,side:r,inHoverState:l,renderDefault:lj(n,r),wrapInAnchor:cj(s,a)};return h.jsx("td",tn(tn({className:e},o),{},{"data-change-key":t,children:c(f)}))}function Bft(e){var n,t,r,s=e.change,a=e.selected,o=e.tokens,l=e.className,c=e.generateLineClassName,f=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.gutterAnchor,k=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=tl(s),z=(n=Vt(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=Vt(z,3),T=N[0],j=N[1],D=N[2],I=R.useMemo((function(){return{change:s}}),[s]),L=ak(d,I,j,D),P=ak(m,I,j,D),q=k(s),W=c({changes:[s],defaultGenerate:function(){return l}}),Z=Ws("diff-gutter","diff-gutter-".concat(w),f,{"diff-gutter-selected":a}),X=Ws("diff-code","diff-code-".concat(w),_,{"diff-code-selected":a});return h.jsxs("tr",{id:q,className:Ws("diff-line",W),children:[!g&&ok(Z,s,C,"old",S,q,L,T,b),!g&&ok(Z,s,C,"new",S,q,L,T,b),h.jsx(oj,tn({className:X,changeKey:C,text:y,tokens:o,renderToken:v},P))]})}var $ft=R.memo(Bft);function Hft(e){var n=e.hideGutter,t=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var Fft=["hideGutter","selectedChanges","tokens","lineClassName"],Pft=["hunk","widgets","className"];function Uft(e){var n=e.hunk,t=e.widgets,r=e.className,s=ol(e,Pft),a=(function(o,l){return o.reduce((function(c,f){var _=tl(f);c.push(["change",_,f]);var d=l[_];return d&&c.push(["widget",_,d]),c}),[])})(n.changes,t);return h.jsx("tbody",{className:Ws("diff-hunk",r),children:a.map((function(o){return(function(l,c){var f=Vt(l,3),_=f[0],d=f[1],m=f[2],g=c.hideGutter,S=c.selectedChanges,k=c.tokens,v=c.lineClassName,b=ol(c,Fft);if(_==="change"){var w=Ys(m)?"old":"new",y=Ys(m)?Jp(m):em(m),C=k?k[w][y-1]:null;return h.jsx($ft,tn({className:v,change:m,hideGutter:g,selected:S.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?h.jsx(Hft,{hideGutter:g,element:m},"widget".concat(d)):null})(o,s)}))})}var uj=0;function I_(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),a=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var o=aj(r,(function(l){return function(c){return l&&l({side:e,change:t},c)}}));return o.onMouseEnter=P0(s,o.onMouseEnter),o.onMouseLeave=P0(a,o.onMouseLeave),o}),[t,r,s,e,a])}function Eb(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,c=e.codeEvents,f=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,m=e.hideGutter,g=e.hover,S=e.renderToken,k=e.renderGutter;if(!n){var v=Ws("diff-gutter","diff-gutter-omit",a),b=Ws("diff-code","diff-code-omit",o);return[!m&&h.jsx("td",{className:v},"gutter"),h.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=tl(n),z=t===uj?"old":"new",N=tn({id:f||void 0,className:Ws("diff-gutter","diff-gutter-".concat(w),Qv({"diff-gutter-selected":r},"diff-line-hover-"+z,g),a),children:k({change:n,side:z,inHoverState:g,renderDefault:lj(n,z),wrapInAnchor:cj(_,d)})},l),T=Ws("diff-code","diff-code-".concat(w),Qv({"diff-code-selected":r},"diff-line-hover-"+z,g),o);return[!m&&h.jsx("td",tn(tn({},N),{},{"data-change-key":C}),"gutter"),h.jsx(oj,tn({className:T,changeKey:C,text:y,tokens:s,renderToken:S},c),"code")]}function qft(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,c=e.monotonous,f=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.generateAnchorID,k=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=Vt(R.useState(""),2),C=y[0],z=y[1],N=I_("old",z,t,d),T=I_("new",z,r,d),j=I_("old",z,t,m),D=I_("new",z,r,m),I=t&&S(t),L=r&&S(r),P=k({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:c,hideGutter:g,gutterClassName:f,codeClassName:_,gutterEvents:d,codeEvents:m,renderToken:b,renderGutter:w},W=tn(tn({},q),{},{change:t,side:uj,selected:s,tokens:o,gutterEvents:N,codeEvents:j,anchorID:I,gutterAnchor:v,gutterAnchorTarget:I,hover:C==="old"}),Z=tn(tn({},q),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:T,codeEvents:D,anchorID:t===r?null:L,gutterAnchor:v,gutterAnchorTarget:t===r?I:L,hover:C==="new"});if(c)return h.jsx("tr",{className:Ws("diff-line",P),children:Eb(t?W:Z)});var X=(function(J,ee){return J&&!ee?"diff-line-old-only":!J&&ee?"diff-line-new-only":J===ee?"diff-line-normal":"diff-line-compare"})(t,r);return h.jsxs("tr",{className:Ws("diff-line",X,P),children:[Eb(W),Eb(Z)]})}var Gft=R.memo(qft);function Vft(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Wft=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Kft=["hunk","widgets","className"];function B_(e,n){return(e?tl(e):"00")+(n?tl(n):"00")}function Xft(e){var n=e.hunk,t=e.widgets,r=e.className,s=ol(e,Kft),a=(function(o,l){for(var c=function(b){if(!b)return null;var w=tl(b);return l[w]||null},f=[],_=0;_=(a==null?void 0:a.value.length))return[e];var l=function(h,m){var g=a.value.slice(h,m);return[].concat(Vs(s),[en(en({},a),{},{value:g})])};if(n>0){var c=l(0,n);o.push(lu(c))}var f=l(Math.max(n,0),t);if(o.push(r?(function(h,m){return[m].concat(Vs(lu(h)))})(f,r):lu(f)),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=ol(e,Mft);t.push(s);var a,o=Sy(r);try{for(o.s();!(a=o.n()).done;)fj(a.value,n,t)}catch(l){o.e(l)}finally{o.f()}t.pop()}else n.push(lu([].concat(Vs(t.slice(1)),[e])));return n}function Rft(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var f=My(c);return f.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[$_(r(n.oldSource)),$_(r(t))]}var s=Vt(uht(e),2),a=s[0],o=s[1],l=n.highlight?function(c){return $_(n.refractor.highlight(c,n.language))}:function(c){return $_([{type:"text",value:c}])};return[l(a),l(o)]}function lu(e){return e.map((function(n){return tn({},n)}))}function hht(e,n){return[].concat(Xs(lu(e.slice(0,-1))),[n])}function dht(e){return e.type==="text"}function Dy(e){var n=e[e.length-1];if(dht(n))return n;throw new Error("Invalid token path with leaf of type ".concat(n.type))}function _ht(e,n,t,r){var s=e.slice(0,-1),a=Dy(e),o=[];if(t<=0||n>=(a==null?void 0:a.value.length))return[e];var l=function(d,m){var g=a.value.slice(d,m);return[].concat(Xs(s),[tn(tn({},a),{},{value:g})])};if(n>0){var c=l(0,n);o.push(lu(c))}var f=l(Math.max(n,0),t);if(o.push(r?(function(d,m){return[m].concat(Xs(lu(d)))})(f,r):lu(f)),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=ol(e,pht);t.push(s);var a,o=Cy(r);try{for(o.s();!(a=o.n()).done;)_j(a.value,n,t)}catch(l){o.e(l)}finally{o.f()}t.pop()}else n.push(lu([].concat(Xs(t.slice(1)),[e])));return n}function mht(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var f=Dy(c);return f.value.includes(` `)?f.value.split(` -`).map((function(_){return Aft(c,en(en({},f),{},{value:_}))})):[c]})(t),a=DA(s),o=a[0],l=a.slice(1);return[].concat(Vs(n.slice(0,-1)),[[].concat(Vs(r),[o])],Vs(l.map((function(c){return[c]}))))}),[[]])}function ck(e){return Rft(fj(e))}var Dft=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?Kp(e,n,void 0,t):!!r},Lft=function(e,n){return Kp(e,n)},Oft=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Ift(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Oft(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Dft(t,r,(function(a,o,l){return l==="chlidren"||Lft(a,o)}))))?e.children[e.children.length-1]=(function(a,o){return"value"in a&&"value"in o?en(en({},a),{},{value:"".concat(a.value).concat(o.value)}):a})(s,n):e.children.push(n),e.children[e.children.length-1]}function uk(e){var n,t={type:"root",children:[]},r=Sy(e);try{var s=function(){var a=n.value;a.reduce((function(o,l,c){return Ift(o,c===a.length-1?en({},l):en(en({},l),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(a){r.e(a)}finally{r.f()}return t}var Bft=Object.prototype.hasOwnProperty,$ft=cj((function(e,n,t){Bft.call(e,t)?e[t].push(n):jy(e,t,[n])})),Hft=Object.prototype.hasOwnProperty,Pft=function(e){if(e==null)return!0;if(Wp(e)&&(Ys(e)||typeof e=="string"||typeof e.splice=="function"||H0(e)||Ey(e)||Vp(e)))return!e.length;var n=s2(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(XA(e))return!YA(e).length;for(var t in e)if(Hft.call(e,t))return!1;return!0},Fft=function(e,n){var t=n.start,r=n.length,s=t+r,a=e.reduce((function(o,l){var c=Vt(o,2),f=c[0],_=c[1],h=_+My(l).value.length;if(_>s||hr.length?t:r,c=t.length>r.length?r:t,f=l.indexOf(c);if(f!=-1)return o=[new n.Diff(1,l.substring(0,f)),new n.Diff(0,c),new n.Diff(1,l.substring(f+c.length))],t.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var h=_[0],m=_[1],g=_[2],S=_[3],k=_[4],v=this.diff_main(h,g,s,a),b=this.diff_main(m,S,s,a);return v.concat([new n.Diff(0,k)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,a):this.diff_bisect_(t,r,a)},n.prototype.diff_lineMode_=function(t,r,s){var a=this.diff_linesToChars_(t,r);t=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(t,r,!1,s);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new n.Diff(0,""));for(var c=0,f=0,_=0,h="",m="";c=1&&_>=1){l.splice(c-f-_,f+_),c=c-f-_;for(var g=this.diff_main(h,m,!1,s),S=g.length-1;S>=0;S--)l.splice(c,0,g[S]);c+=g.length}_=0,f=0,h="",m=""}c++}return l.pop(),l},n.prototype.diff_bisect_=function(t,r,s){for(var a=t.length,o=r.length,l=Math.ceil((a+o)/2),c=l,f=2*l,_=new Array(f),h=new Array(f),m=0;ms);y++){for(var C=-y+k;C<=y-v;C+=2){for(var z=c+C,N=(L=C==-y||C!=y&&_[z-1]<_[z+1]?_[z+1]:_[z-1]+1)-C;La)v+=2;else if(N>o)k+=2;else if(S&&(D=c+g-C)>=0&&D=(j=a-h[D]))return this.diff_bisectSplit_(t,r,L,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,D=c+T,I=(j=T==-y||T!=y&&h[D-1]a)w+=2;else if(I>o)b+=2;else if(!S&&(z=c+g-T)>=0&&z=(j=a-j))return this.diff_bisectSplit_(t,r,L,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,a,o){var l=t.substring(0,s),c=r.substring(0,a),f=t.substring(s),_=r.substring(a),h=this.diff_main(l,c,!1,o),m=this.diff_main(f,_,!1,o);return h.concat(m)},n.prototype.diff_linesToChars_=function(t,r){var s=[],a={};function o(f){for(var _="",h=0,m=-1,g=s.length;ma?t=t.substring(s-a):sr.length?t:r,a=t.length>r.length?r:t;if(s.length<4||2*a.length=k.length?[w,y,C,z,j]:null}var c,f,_,h,m,g=l(s,a,Math.ceil(s.length/4)),S=l(s,a,Math.ceil(s.length/2));return g||S?(c=S?g&&g[4].length>S[4].length?g:S:g,t.length>r.length?(f=c[0],_=c[1],h=c[2],m=c[3]):(h=c[0],m=c[1],f=c[2],_=c[3]),[f,_,h,m,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],a=0,o=null,l=0,c=0,f=0,_=0,h=0;l0?s[a-1]:-1,c=0,f=0,_=0,h=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),l=1;l=k?(S>=m.length/2||S>=g.length/2)&&(t.splice(l,0,new n.Diff(0,g.substring(0,S))),t[l-1][1]=m.substring(0,m.length-S),t[l+1][1]=g.substring(S),l++):(k>=m.length/2||k>=g.length/2)&&(t.splice(l,0,new n.Diff(0,m.substring(0,k))),t[l-1][0]=1,t[l-1][1]=g.substring(0,g.length-k),t[l+1][0]=-1,t[l+1][1]=m.substring(k),l++),l++}l++}},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_),z=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=z&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),D=T&&k.match(n.blanklineEndRegex_),I=j&&v.match(n.blanklineStartRegex_);return D||I?5:T||j?4:y&&!z&&N?3:z||N?2:y||C?1:0}for(var s=1;s=g&&(g=S,_=a,h=o,m=l)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=h,m?t[s+1][1]=m:(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=[],a=0,o=null,l=0,c=!1,f=!1,_=!1,h=!1;l0?s[a-1]:-1,_=h=!1),r=!0)),l++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,a=0,o=0,l="",c="";s1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(c,l))!==0&&(s-a-o>0&&t[s-a-o-1][0]==0?t[s-a-o-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(c,l))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),l=l.substring(0,l.length-r))),s-=a+o,t.splice(s,a+o),l.length&&(t.splice(s,0,new n.Diff(-1,l)),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++,o=0,a=0,l="",c=""}t[t.length-1][1]===""&&t.pop();var f=!1;for(s=1;sr));s++)l=a,c=o;return t.length!=s&&t[s][0]===-1?c:c+(r-l)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,a=//g,l=/\n/g,c=0;c");switch(f){case 1:r[c]=''+_+"";break;case-1:r[c]=''+_+"";break;case 0:r[c]=""+_+""}}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 a=this.match_alphabet_(r),o=this;function l(N,T){var j=N/r.length,D=Math.abs(s-T);return o.Match_Distance?j+D/o.Match_Distance:D?1:j}var c=this.Match_Threshold,f=t.indexOf(r,s);f!=-1&&(c=Math.min(l(0,f),c),(f=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(l(0,f),c)));var _,h,m=1<=v;y--){var C=a[t.charAt(y-1)];if(w[y]=k===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(g[y+1]|g[y])<<1|1|g[y+1],w[y]&m){var z=l(k,y-1);if(z<=c){if(c=z,!((f=y-1)>s))break;v=Math.max(1,2*s-f)}}}if(l(k+1,s)>c)break;g=w}return f},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)o=t,a=this.diff_text1(o);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)a=t,o=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");a=t,o=s}if(o.length===0)return[];for(var l=[],c=new n.patch_obj,f=0,_=0,h=0,m=a,g=a,S=0;S=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,m),l.push(c),c=new n.patch_obj,f=0,m=g,_=h)}k!==1&&(_+=v.length),k!==-1&&(h+=v.length)}return f&&(this.patch_addContext_(c,m),l.push(c)),l},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,h.substring(0,this.Match_MaxBits),_))!=-1&&((m=this.match_main(r,h.substring(h.length-this.Match_MaxBits),_+h.length-this.Match_MaxBits))==-1||c>=m)&&(c=-1):c=this.match_main(r,h,_),c==-1)o[l]=!1,a-=t[l].length2-t[l].length1;else if(o[l]=!0,a=c-_,h==(f=m==-1?r.substring(c,c+h.length):r.substring(c,m+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[l].diffs)+r.substring(c+h.length);else{var g=this.diff_main(h,f,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(g);for(var S,k=0,v=0;vl[0][1].length){var c=r-l[0][1].length;l[0][1]=s.substring(l[0][1].length)+l[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}return(l=(o=t[t.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new n.Diff(0,s)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(c=r-l[l.length-1][1].length,l[l.length-1][1]+=s.substring(0,c),o.length1+=c,o.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(f.length1+=m.length,o+=m.length,_=!1,f.diffs.push(new n.Diff(h,m)),a.diffs.shift()):(m=m.substring(0,r-f.length1-this.Patch_Margin),f.length1+=m.length,o+=m.length,h===0?(f.length2+=m.length,l+=m.length):_=!1,f.diffs.push(new n.Diff(h,m)),m==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(m.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var g=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);g!==""&&(f.length1+=g.length,f.length2+=g.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=g:f.diffs.push(new n.Diff(0,g))),_||t.splice(++s,0,f)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;ss||dr.length?t:r,c=t.length>r.length?r:t,f=l.indexOf(c);if(f!=-1)return o=[new n.Diff(1,l.substring(0,f)),new n.Diff(0,c),new n.Diff(1,l.substring(f+c.length))],t.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],m=_[1],g=_[2],S=_[3],k=_[4],v=this.diff_main(d,g,s,a),b=this.diff_main(m,S,s,a);return v.concat([new n.Diff(0,k)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,a):this.diff_bisect_(t,r,a)},n.prototype.diff_lineMode_=function(t,r,s){var a=this.diff_linesToChars_(t,r);t=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(t,r,!1,s);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new n.Diff(0,""));for(var c=0,f=0,_=0,d="",m="";c=1&&_>=1){l.splice(c-f-_,f+_),c=c-f-_;for(var g=this.diff_main(d,m,!1,s),S=g.length-1;S>=0;S--)l.splice(c,0,g[S]);c+=g.length}_=0,f=0,d="",m=""}c++}return l.pop(),l},n.prototype.diff_bisect_=function(t,r,s){for(var a=t.length,o=r.length,l=Math.ceil((a+o)/2),c=l,f=2*l,_=new Array(f),d=new Array(f),m=0;ms);y++){for(var C=-y+k;C<=y-v;C+=2){for(var z=c+C,N=(L=C==-y||C!=y&&_[z-1]<_[z+1]?_[z+1]:_[z-1]+1)-C;La)v+=2;else if(N>o)k+=2;else if(S&&(D=c+g-C)>=0&&D=(j=a-d[D]))return this.diff_bisectSplit_(t,r,L,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,D=c+T,I=(j=T==-y||T!=y&&d[D-1]a)w+=2;else if(I>o)b+=2;else if(!S&&(z=c+g-T)>=0&&z=(j=a-j))return this.diff_bisectSplit_(t,r,L,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,a,o){var l=t.substring(0,s),c=r.substring(0,a),f=t.substring(s),_=r.substring(a),d=this.diff_main(l,c,!1,o),m=this.diff_main(f,_,!1,o);return d.concat(m)},n.prototype.diff_linesToChars_=function(t,r){var s=[],a={};function o(f){for(var _="",d=0,m=-1,g=s.length;ma?t=t.substring(s-a):sr.length?t:r,a=t.length>r.length?r:t;if(s.length<4||2*a.length=k.length?[w,y,C,z,j]:null}var c,f,_,d,m,g=l(s,a,Math.ceil(s.length/4)),S=l(s,a,Math.ceil(s.length/2));return g||S?(c=S?g&&g[4].length>S[4].length?g:S:g,t.length>r.length?(f=c[0],_=c[1],d=c[2],m=c[3]):(d=c[0],m=c[1],f=c[2],_=c[3]),[f,_,d,m,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],a=0,o=null,l=0,c=0,f=0,_=0,d=0;l0?s[a-1]:-1,c=0,f=0,_=0,d=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),l=1;l=k?(S>=m.length/2||S>=g.length/2)&&(t.splice(l,0,new n.Diff(0,g.substring(0,S))),t[l-1][1]=m.substring(0,m.length-S),t[l+1][1]=g.substring(S),l++):(k>=m.length/2||k>=g.length/2)&&(t.splice(l,0,new n.Diff(0,m.substring(0,k))),t[l-1][0]=1,t[l-1][1]=g.substring(0,g.length-k),t[l+1][0]=-1,t[l+1][1]=m.substring(k),l++),l++}l++}},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_),z=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=z&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),D=T&&k.match(n.blanklineEndRegex_),I=j&&v.match(n.blanklineStartRegex_);return D||I?5:T||j?4:y&&!z&&N?3:z||N?2:y||C?1:0}for(var s=1;s=g&&(g=S,_=a,d=o,m=l)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,m?t[s+1][1]=m:(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=[],a=0,o=null,l=0,c=!1,f=!1,_=!1,d=!1;l0?s[a-1]:-1,_=d=!1),r=!0)),l++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,a=0,o=0,l="",c="";s1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(c,l))!==0&&(s-a-o>0&&t[s-a-o-1][0]==0?t[s-a-o-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(c,l))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),l=l.substring(0,l.length-r))),s-=a+o,t.splice(s,a+o),l.length&&(t.splice(s,0,new n.Diff(-1,l)),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++,o=0,a=0,l="",c=""}t[t.length-1][1]===""&&t.pop();var f=!1;for(s=1;sr));s++)l=a,c=o;return t.length!=s&&t[s][0]===-1?c:c+(r-l)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,a=//g,l=/\n/g,c=0;c");switch(f){case 1:r[c]=''+_+"";break;case-1:r[c]=''+_+"";break;case 0:r[c]=""+_+""}}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 a=this.match_alphabet_(r),o=this;function l(N,T){var j=N/r.length,D=Math.abs(s-T);return o.Match_Distance?j+D/o.Match_Distance:D?1:j}var c=this.Match_Threshold,f=t.indexOf(r,s);f!=-1&&(c=Math.min(l(0,f),c),(f=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(l(0,f),c)));var _,d,m=1<=v;y--){var C=a[t.charAt(y-1)];if(w[y]=k===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(g[y+1]|g[y])<<1|1|g[y+1],w[y]&m){var z=l(k,y-1);if(z<=c){if(c=z,!((f=y-1)>s))break;v=Math.max(1,2*s-f)}}}if(l(k+1,s)>c)break;g=w}return f},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)o=t,a=this.diff_text1(o);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)a=t,o=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");a=t,o=s}if(o.length===0)return[];for(var l=[],c=new n.patch_obj,f=0,_=0,d=0,m=a,g=a,S=0;S=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,m),l.push(c),c=new n.patch_obj,f=0,m=g,_=d)}k!==1&&(_+=v.length),k!==-1&&(d+=v.length)}return f&&(this.patch_addContext_(c,m),l.push(c)),l},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((m=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||c>=m)&&(c=-1):c=this.match_main(r,d,_),c==-1)o[l]=!1,a-=t[l].length2-t[l].length1;else if(o[l]=!0,a=c-_,d==(f=m==-1?r.substring(c,c+d.length):r.substring(c,m+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[l].diffs)+r.substring(c+d.length);else{var g=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(g)/d.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(g);for(var S,k=0,v=0;vl[0][1].length){var c=r-l[0][1].length;l[0][1]=s.substring(l[0][1].length)+l[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}return(l=(o=t[t.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new n.Diff(0,s)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(c=r-l[l.length-1][1].length,l[l.length-1][1]+=s.substring(0,c),o.length1+=c,o.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(f.length1+=m.length,o+=m.length,_=!1,f.diffs.push(new n.Diff(d,m)),a.diffs.shift()):(m=m.substring(0,r-f.length1-this.Patch_Margin),f.length1+=m.length,o+=m.length,d===0?(f.length2+=m.length,l+=m.length):_=!1,f.diffs.push(new n.Diff(d,m)),m==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(m.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var g=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);g!==""&&(f.length1+=g.length,f.length2+=g.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=g:f.diffs.push(new n.Diff(0,g))),_||t.splice(++s,0,f)}}},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"?Kft:Xft,r=Ty(e.map((function(l){return l.changes})),dj).map(t).reduce((function(l,c){var f=Vt(l,2),_=f[0],h=f[1],m=Vt(c,2),g=m[0],S=m[1];return[_.concat(g),h.concat(S)]}),[[],[]]),s=Vt(r,2),a=s[0],o=s[1];return Uft(dk(a),dk(o))}var Zft=["enhancers"],mk=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,a=Vt(zft(e,ol(t,Zft)),2),o=a[0],l=a[1],c=[ck(o),ck(l)],f=(n=[c[0],c[1]],s.reduce((function(k,v){return v(k)}),n)),_=Vt(f,2),h=_[0],m=_[1],g=[h.map(uk),m.map(uk)],S=g[1];return{old:g[0].map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]})),new:S.map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]}))}};const a2=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:start-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]: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-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.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-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),Qft=2e3,Jft={highlight(e,n){return ot.highlight(e,n).children}};function edt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Ry(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 tdt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function o2(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 ndt(e){const n=[Yft(e.hunks,{type:"line"})],t=Ix(tdt(e));return t&&ot.registered(t)?mk(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Jft}):mk(e.hunks,{enhancers:n,highlight:!1})}function rdt(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:Qv(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:Qv(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const sdt=({change:e,side:n})=>n==="old"?null:edt(e);function _j({bytesRead:e,byteLimit:n}){return d.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[d.jsx("h4",{children:afe()}),d.jsx("p",{children:Bfe({limit:je(Bi(n)),read:je(Bi(e))})})]})}function pj({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:a}=R.useMemo(()=>Ry(e),[e]),o=t&&s+a<=Qft,l=R.useMemo(()=>{if(o)try{return ndt(e)}catch{return}},[e,o]);return d.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:[d.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-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[d.jsx("span",{className:"chev",children:t?d.jsx(ya,{size:14}):d.jsx(wa,{size:14})}),d.jsx("span",{className:"path",children:d.jsx("code",{children:o2(e)})}),d.jsxs("span",{className:"stats",children:[d.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),d.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),t&&(e.hunks.length===0?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:wfe()}):d.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:d.jsx(bft,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:sdt,tokens:l,viewType:"unified"})}))]})}function idt({files:e,className:n}){return d.jsx("div",{className:n?`${a2} ${n}`:a2,children:e.map((t,r)=>d.jsx(pj,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function adt(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 mj({diff:e,partial:n=!1}){var m;const t=R.useMemo(()=>rdt(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((g,S)=>({file:g,key:`${g.oldPath}→${g.newPath}#${S}`,changes:Ry(g)})),[r]),[a,o]=R.useState(null),[l,c]=R.useState(!1),f=l&&!n,_=s.some(g=>g.key===a)?a:((m=s[0])==null?void 0:m.key)??null,h=s.find(g=>g.key===_)??null;return t.failed?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:n?bfe():Dfe()}):s.length===0?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:_fe()}):d.jsxs("div",{className:"diff-explorer @container",children:[d.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[d.jsx("strong",{children:n?s.length===1?jfe():ufe({count:Ht(s.length)}):s.length===1?Efe():Que({count:Ht(s.length)})}),!n&&d.jsx("button",{type:"button",onClick:()=>c(g=>!g),children:f?Kue():Ffe()})]}),f?d.jsx(idt,{files:r}):d.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:[d.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-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":nfe(),children:s.map(g=>d.jsxs("button",{type:"button",className:g.key===_?"active":"","aria-pressed":g.key===_,onClick:()=>o(g.key),children:[d.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${g.file.type}`,children:adt(g.file)}),d.jsx("code",{title:o2(g.file),children:o2(g.file)}),d.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",g.changes.additions]}),d.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",g.changes.deletions]})]},g.key))}),d.jsx("div",{className:`${a2} diff-explorer-preview min-w-0`,children:h&&d.jsx(pj,{file:h.file,defaultExpanded:!0},h.key)})]})]})}function odt({experiment:e,refreshKey:n,onLoadingChange:t}){const[r,s]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return t(!0),o(null),s(null),DWe(e.id).then(c=>{l||s(c)}).catch(c=>{l||o(c.message)}).finally(()=>{l||t(!1)}),()=>{l=!0}},[e.id,n,t]),d.jsx("div",{className:`${fu} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?d.jsxs("div",{className:Oi,children:[lG()," ",je(a)]}):r?r.diff.trim()?d.jsxs(d.Fragment,{children:[r.truncated&&d.jsx(_j,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),d.jsx(mj,{diff:r.diff,partial:r.truncated})]}):d.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?mG():sG()}):d.jsx("div",{className:Oi,children:dG()})})}function gj({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:a,githubTitle:o,refreshing:l,onRefresh:c}){return d.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&&d.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":xte(),children:[d.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:kte()}),d.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:mte()})]}),r&&d.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[d.jsx(lp,{size:12}),d.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&d.jsx("a",{className:mn,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:d.jsx(Op,{size:13})}),d.jsx("span",{style:{flex:1}}),d.jsx("button",{className:mn,title:C6(),"aria-label":C6(),onClick:c,children:l?d.jsx("span",{className:Lt}):d.jsx(nE,{size:13})})]})}const ldt=/\.(md|mdx|markdown)$/i,cdt=/\.tex$/i,udt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,fdt=/\.(csv|tsv|xlsx?|ods)$/i,ddt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,hdt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,_dt=/\.pdf$/i,pdt=/\.(docx?|log|rtf|txt)$/i;function mdt(e){return udt.test(e)}function Dy(e){return ldt.test(e)}function bj(e){return cdt.test(e)}function vj({name:e}){const n=Dy(e)?"markdown":mdt(e)?"image":fdt.test(e)?"spreadsheet":ddt.test(e)?"code":hdt.test(e)?"archive":_dt.test(e)?"pdf":pdt.test(e)||bj(e)?"document":"file";let t;return n==="markdown"?t=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),d.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=d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),d.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),d.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=d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),d.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=d.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=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),d.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),d.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),d.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})}const xj=["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]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),gk=["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 bk(){return{dirs:new Map,files:[]}}function yj(e){const n=bk();for(const t of e){const r=t.split("/");let s=n;for(let a=0;aa(t),title:t,children:[c?d.jsx(ya,{size:13,className:gk}):d.jsx(wa,{size:13,className:gk}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),c&&d.jsx(Ly,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:a,onOpenFile:o})]})}function Ly({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:a}){const o=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),l=[...e.files].sort((c,f)=>c.localeCompare(f));return d.jsxs(d.Fragment,{children:[o.map(c=>{const f=n?`${n}/${c}`:c;return d.jsx(gdt,{name:c,node:e.dirs.get(c),path:f,depth:t,toggled:r,onToggle:s,onOpenFile:a},`d:${f}`)}),l.map(c=>{const f=n?`${n}/${c}`:c;return d.jsxs("button",{type:"button",className:xj,style:{paddingInlineStart:8+t*14},...nr(_=>a(f,_)),title:LL({name:je(f)}),children:[d.jsx(vj,{name:c}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c})]},`f:${f}`)})]})}function bdt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:a,onToggledChange:o,onOpenFile:l}){const c=t.branchName,f=`${e}:${c}`,[_,h]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState(!1),[w,y]=R.useState(0),[C,z]=R.useState(void 0),N=R.useRef(0),T=R.useRef(null),j=R.useCallback(()=>{T.current=f;const U=++N.current;k(!0),Yb(e,{ref:c}).then(q=>{U===N.current&&(h(q),g(null))}).catch(q=>{U===N.current&&g(q.message)}).finally(()=>{U===N.current&&k(!1)})},[e,c,f]);R.useEffect(()=>(N.current++,T.current=null,h(null),g(null),k(!1),()=>{N.current++}),[f]),R.useEffect(()=>{r==="files"&&T.current!==f&&j()},[r,f,j]),R.useEffect(()=>{z(void 0);const U=t.chatSessionId;if(!U)return;let q=!1;return fE(U).then(W=>{!q&&W.exists&&W.branch===c&&z(U)}).catch(()=>{}),()=>{q=!0}},[t.chatSessionId,c]);const D=R.useMemo(()=>_?yj(_.entries):null,[_]),I=r==="files"?S:v,L=R.useCallback(U=>{const q=new Set(s);q.has(U)?q.delete(U):q.add(U),o(q)},[s,o]);return d.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[d.jsx(gj,{view:r,onViewChange:a,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?up(n.githubOwner,n.githubRepo,c):void 0,githubTitle:s9({branch:je(c)}),refreshing:I,onRefresh:()=>r==="files"?j():y(U=>U+1)}),r==="changes"?d.jsx(odt,{experiment:t,refreshKey:w,onLoadingChange:b},t.id):d.jsxs(d.Fragment,{children:[(_==null?void 0:_.truncated)&&d.jsx("div",{className:Oi,children:Tte()}),m&&D&&d.jsxs("div",{className:Oi,children:[$te()," ",je(m)]}),d.jsx("div",{className:fu,children:D?D.dirs.size===0&&D.files.length===0?d.jsx("div",{className:Oi,children:Lte()}):d.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:d.jsx(Ly,{node:D,parentPath:"",depth:0,toggled:s,onToggle:L,onOpenFile:(U,q)=>C?l(U,C,void 0,q):l(U,void 0,c,q)})}):d.jsx("div",{className:Oi,children:m?c9({error:je(m)}):u9()})})]})]})}const vdt=5e3;function xdt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:a,onOpenFile:o}){var D;const l=n.id,[c,f]=R.useState(null),[_,h]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!0),v=R.useRef(0),b=R.useCallback(()=>{const I=++v.current;k(!0),(async()=>{if(!e)return[null,await Yb(l,{ref:n.baselineBranch})];const U=await fE(e),q=U.exists?{sessionId:e}:{ref:n.baselineBranch};return[U,await Yb(l,q)]})().then(([U,q])=>{I===v.current&&(f(U),h(q),g(null))}).catch(U=>{I===v.current&&g(U.message)}).finally(()=>{I===v.current&&k(!1)})},[e,l,n.baselineBranch]);R.useEffect(()=>(f(null),h(null),g(null),b(),()=>{v.current++}),[b]),R.useEffect(()=>{if(!e)return;let I=!1,L=!1,U=!1,q=null;const W=()=>{q||(q=setInterval(b,vdt))},Z=()=>{q&&(clearInterval(q),q=null)},X=dd(J=>{J.type!=="busy"||J.sessionId!==e||(L=!0,J.busy&&!I?(I=!0,W()):!J.busy&&I&&(I=!1,Z(),b()))});return J_(l).then(J=>{var ee;U||L||I||(ee=J.find($=>$.id===e))!=null&&ee.busy&&(I=!0,W())}).catch(()=>{}),()=>{U=!0,X(),Z()}},[e,l,b]);const w=R.useMemo(()=>_?yj(_.entries):null,[_]),y=R.useCallback(I=>{const L=new Set(r);L.has(I)?L.delete(I):L.add(I),a(L)},[r,a]),C=e&&(c!=null&&c.exists)?c:null,z=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?Xqe({branch:je(C.baselineBranch)}):N9()),N=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,T=C?Pqe({branch:je(`${z}${N>0?"*":""}`)}):Gqe({branch:je(n.baselineBranch)}),j=C?C.branch:n.baselineBranch;return d.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[d.jsx(gj,{view:C?t:"files",onViewChange:s,showViewToggle:!!C,branchLabel:T,branchTitle:T,githubHref:n.githubEnabled&&j?up(n.githubOwner,n.githubRepo,j):void 0,githubTitle:j?s9({branch:je(j)}):void 0,refreshing:S,onRefresh:b}),m&&(c||_)&&d.jsxs("div",{className:Oi,children:[pGe()," ",je(m)]}),!_||e&&!c?d.jsx("div",{className:fu,children:d.jsx("div",{className:Oi,children:m?c9({error:je(m)}):u9()})}):C&&t==="changes"?d.jsx("div",{className:`${fu} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:N===0||!C.diff?d.jsx("div",{className:"changes-note text-sm text-muted",children:oGe()}):d.jsxs(d.Fragment,{children:[C.diff.truncated&&d.jsx(_j,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),d.jsx(mj,{diff:C.diff.diff,partial:C.diff.truncated})]})}):d.jsxs("div",{className:fu,children:[_.truncated&&d.jsx("div",{className:Oi,children:Jqe()}),w?w.dirs.size===0&&w.files.length===0?d.jsx("div",{className:Oi,children:fGe()}):d.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:d.jsx(Ly,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:(I,L)=>C?o(I,e,void 0,L):o(I,void 0,n.baselineBranch,L)})}):d.jsx("div",{className:Oi,children:rGe()})]})]})}const F0="font-mono text-sm leading-[1.55] [tab-size:4]",wj="whitespace-pre-wrap break-words",Sj="file-view-gutter text-right text-muted select-none";function kj(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function Cj({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const a=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` -`),h=Zz(_,Ix(n));return _.endsWith(` -`)?h.slice(0,-1):h},[e,n]),o=t&&a.length>0?Math.min(Math.max(Math.trunc(t),1),a.length):void 0,l=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(o?((_=l.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):a.length===0&&(s==null||s()))},[a.length,s,r,o]);const{ruleCh:c}=kj(a.length),f=R.useMemo(()=>a.map((_,h)=>d.jsxs("div",{ref:h+1===o?l:void 0,className:`file-view-line flex items-stretch ${h+1===o?"file-view-line-highlight bg-accent-blue-subtle shadow-[inset_2px_0_0_var(--accent-blue)]":""}`,children:[d.jsx("span",{"data-line":h+1,className:`${Sj} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),d.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${F0} ${wj}`,children:Qz(_)?d.jsx("br",{}):_})]},h)),[a,c,o]);return d.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${F0}`,children:[a.length>0&&d.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"}),f]})}function Ej(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function vk({url:e,name:n}){return d.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Bhe()," ",d.jsxs("a",{href:e,download:n,children:[m9()," ",je(n)]})]})}function l2({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,a]=R.useState(!1);if(R.useEffect(()=>a(!1),[e,n]),s)return d.jsx(vk,{url:n,name:t});let o;return e==="image"?o=d.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:d.jsx("img",{src:n,alt:t,onError:()=>a(!0)})}):e==="audio"?o=d.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:d.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>a(!0)})}):e==="video"?o=d.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:d.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>a(!0)})}):o=d.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>a(!0),children:d.jsx(vk,{url:n,name:t})}),d.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&d.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-xs",children:d.jsxs("a",{href:n,download:t,children:[m9()," ",t]})})]})}const xk=`${mn} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function ydt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function wdt(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),a=r===-1?"":t.slice(r),o=s.indexOf("?"),l=o===-1?s:s.slice(0,o),c=o===-1?"":s.slice(o+1),f=l.startsWith("/")?[]:n.split("/").filter(g=>g.length>0);for(const g of l.split("/"))if(!(!g||g==="."))if(g===".."){if(f.length===0)return null;f.pop()}else f.push(g);const _=f.join("/");if(!_)return null;const h=new URLSearchParams(c);h.delete("path");const m=h.toString();return`${Vd(e,_)}${m?`&${m}`:""}${a}`}function Sdt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const Nj="orx:files-tree-width",zj="orx:artifacts-collapsed:",Aj=180,jj=560,kdt=8,Cdt=280;function Edt(){try{const e=Number(localStorage.getItem(Nj));if(Number.isFinite(e)&&e>=Aj&&e<=jj)return e}catch{}return Cdt}function Ndt(e){try{const n=localStorage.getItem(`${zj}${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 c2(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=c2(t.children??[],n);if(r)return r}}return null}function Tj({projectId:e,folder:n,markdown:t}){const r=s=>ydt(s)?s:wdt(e,n,s);return d.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]: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-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-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-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:d.jsx(get,{remarkPlugins:[Uz,[qz,tA]],rehypePlugins:[bz],components:{a:({href:s,children:a,...o})=>{const l=!s||s.startsWith("#"),c=l?s:r(s);return c?d.jsx("a",{...o,href:c,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):d.jsx("span",{children:a})},img:({src:s,alt:a})=>{if(!s||typeof s!="string")return null;const o=r(s);return o?d.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[d.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&d.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...nA},children:Jz(Sdt(t))})})}function zdt(e){return e.presentation==="text"&&Dy(e.name)?"markdown":Ej(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function Adt(e,n,t){const[r,s]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(!1),[f,_]=R.useState(null),h=R.useRef(0),m=R.useRef(!1),g=t==="markdown"||t==="text"&&n.size<=hE;return R.useEffect(()=>{if(o(!1),c(!1),_(null),!g)return;let S=!1;const k=++h.current;return _E(e,n.path).then(b=>{if(!b)throw new Error(WU());return b}).then(b=>{S||k!==h.current||(b.binary?o(!0):(m.current=!0,s(b.content)),c(b.truncated))}).catch(b=>{!S&&k===h.current&&!m.current&&_(b instanceof Error?b.message:String(b))}),()=>{S=!0}},[e,n.path,n.modifiedAt,t,g]),{text:r,binary:a,truncated:l,error:f,wantsText:g}}function jdt({projectId:e,entry:n,onDelete:t}){const r=zdt(n),{text:s,binary:a,truncated:o,error:l,wantsText:c}=Adt(e,n,r),[f,_]=R.useState(!1),h=r==="markdown",m=n.path.split("/").slice(0,-1).join("/"),g=`${Vd(e,n.path)}&v=${n.modifiedAt}`;let S;return r==="image"||r==="audio"||r==="video"||r==="pdf"?S=d.jsx(l2,{kind:r,url:g,name:n.name}):r==="download"||!c||a?S=d.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[r==="download"||a?$U():eG()," ",d.jsx("a",{href:g,...r==="download"||a?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:r==="download"||a?_9():ZU()})]}):l?S=d.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[mq()," ",je(l)]}):s===null?S=d.jsxs("div",{className:pr,children:[d.jsx("span",{className:Lt})," ",zq()]}):h&&!f?S=d.jsx(Tj,{projectId:e,folder:m,markdown:s}):S=d.jsx(Cj,{text:s,path:n.path}),d.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[d.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[d.jsx(wu,{size:13,style:{flexShrink:0}}),d.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:je(n.path),children:n.path}),d.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[Oq()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),(r==="text"||r==="download")&&d.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Bi(n.size)}),h&&d.jsx("button",{className:`${mn} ${f?"active":""}`,"data-tip":f?v0():iu(),"data-tip-align":"end","aria-label":f?v0():iu(),onClick:()=>_(k=>!k),children:d.jsx(Wb,{size:13})}),d.jsx("a",{className:mn,href:g,target:"_blank",rel:"noopener noreferrer","data-tip":Jw(),"data-tip-align":"end","aria-label":Jw(),children:d.jsx(Jl,{size:13})}),d.jsx("button",{className:mn,"data-tip":Qw(),"data-tip-align":"end","aria-label":Qw(),onClick:()=>{window.confirm(i9({path:je(n.path)}))&&t(n.path)},children:d.jsx(Bu,{size:13})})]}),d.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 ${h&&!f?"doc":""}`,children:[S,o&&d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:xq()})]})]})}function Mj({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:a,onOpenFile:o,onDelete:l}){return d.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(c=>{var _;const f={paddingInlineStart:8+Math.min(n,kdt)*14};if(c.isDir){const h=!t.has(c.path);return d.jsxs("div",{className:"min-w-0 max-w-full",children:[d.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] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:f,onClick:()=>s(c.path),children:[d.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":h?kU({name:je(c.name)}):LU({name:je(c.name)}),onClick:m=>{m.stopPropagation(),s(c.path)},children:d.jsx(wa,{size:13,className:h?"open":""})}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name}),d.jsx("button",{className:`${Wd} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":dq(),"data-tip-align":"end","aria-label":TU({name:je(c.name)}),onClick:m=>{m.stopPropagation(),window.confirm(i9({path:je(c.path)}))&&l(c.path)},children:d.jsx(Bu,{size:12})})]}),h&&(((_=c.children)==null?void 0:_.length)??0)>0&&d.jsx(Mj,{entries:c.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:a,onOpenFile:o,onDelete:l})]},c.path)}return d.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] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===c.path?"selected":""}`,style:f,title:MD({path:je(c.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===c.path,onClick:()=>a(c.path),onDoubleClick:()=>o(c.path),onAuxClick:h=>{h.button===1&&(h.preventDefault(),a(c.path),o(c.path))},onKeyDown:h=>{if(h.key===" "){h.preventDefault(),h.stopPropagation(),a(c.path);return}h.key==="Enter"&&(h.preventDefault(),h.stopPropagation(),a(c.path),o(c.path))},children:[d.jsx(vj,{name:c.name}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name})]},c.path)})})}function yk({dir:e,onOpenStorage:n}){const[t,r]=R.useState(!1);return d.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:je(e),children:[d.jsx("code",{className:"path-front-ellipsis",children:e}),d.jsx("button",{className:xk,"data-tip":t?b0():UU(),"aria-label":iq(),onClick:()=>{var s;(s=navigator.clipboard)==null||s.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:t?d.jsx(os,{size:12}):d.jsx(ap,{size:12})}),d.jsx("button",{className:xk,"data-tip":e6(),"data-tip-align":"end","aria-label":e6(),onClick:n,children:d.jsx(eWe,{size:12})})]})}function Tdt({project:e,artifacts:n,onChanged:t,onOpenFile:r,onOpenStorage:s}){const[a,o]=R.useState(null),[l,c]=R.useState(()=>Ndt(e.id)),[f,_]=R.useState(Edt),h=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${zj}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const m=b=>{var N;b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId);const w=(N=h.current)==null?void 0:N.getBoundingClientRect(),y=document.body.style.userSelect;document.body.style.userSelect="none";const C=T=>{const j=Math.round(T.clientX-((w==null?void 0:w.left)??0)),D=Math.min(Math.max(j,Aj),jj);_(D);try{localStorage.setItem(Nj,String(D))}catch{}},z=()=>{window.removeEventListener("pointermove",C),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z),document.body.style.userSelect=y};window.addEventListener("pointermove",C),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z)};R.useEffect(()=>{if(!a||!n)return;const b=c2(n.entries,a);(!b||b.isDir)&&o(null)},[a,n]);const g=b=>c(w=>{const y=new Set(w);return y.has(b)?y.delete(b):y.add(b),y}),S=b=>{(a===b||a!=null&&a.startsWith(b+"/"))&&o(null),yKe(e.id,b).catch(()=>{}).finally(t)};if(!n)return d.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:d.jsxs("div",{className:pr,style:{padding:20},children:[d.jsx("span",{className:Lt})," ",Mq()]})});const k=b=>d.jsx(Mj,{entries:b,depth:0,collapsed:l,selected:a,onToggle:g,onSelect:o,onOpenFile:r,onDelete:S}),v=a?c2(n.entries,a):null;return n.entries.length===0?d.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:d.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[d.jsx(F2,{size:28,strokeWidth:1.5}),d.jsx("h3",{children:Hq()}),d.jsx("p",{children:Yq()}),d.jsx(yk,{dir:n.dir,onOpenStorage:s})]})}):d.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[d.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",ref:h,style:{width:f},children:[d.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:m}),d.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[k(n.entries),n.truncated&&d.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:kq()})]}),d.jsx(yk,{dir:n.dir,onOpenStorage:s})]}),v?d.jsx(jdt,{projectId:e.id,entry:v,onDelete:S},v.path):d.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[d.jsx($Ve,{size:22,strokeWidth:1.5}),d.jsx("span",{children:tq()})]})]})}const Rj=20*1024*1024,U0="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",Oy="mt-0 mx-0 mb-3 text-muted text-md leading-normal",Iy="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",By="font-mono text-sm font-medium text-text",$y="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function Dj(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 a=s.indexOf(",");n(a>=0?s.slice(a+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function Mdt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}const Rdt="flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-start text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed";function Lj({scope:e,onScope:n,project:t,label:r}){const s=a=>`${Rdt} ${a?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return d.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":r,children:[d.jsxs("button",{type:"button","aria-pressed":e==="global",className:s(e==="global"),onClick:()=>n("global"),children:[H2(),d.jsx("span",{className:"text-2xs font-normal text-muted",children:JBe()})]}),d.jsxs("button",{type:"button","aria-pressed":e==="project",className:s(e==="project"),disabled:!t,title:t?void 0:iBe(),onClick:()=>n("project"),children:[P2(),d.jsx("span",{className:"text-2xs font-normal text-muted",children:t?t.name:ZIe()})]})]})}function Oj({accept:e,busy:n,prompt:t,destination:r,onFile:s}){const[a,o]=R.useState(!1),l=R.useRef(null);return d.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${n?"cursor-default":"cursor-pointer"} ${a?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:c=>{c.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:c=>{var _;c.preventDefault(),o(!1);const f=(_=c.dataTransfer.files)==null?void 0:_[0];f&&s(f)},onClick:()=>{var c;return(c=l.current)==null?void 0:c.click()},role:"button",tabIndex:0,onKeyDown:c=>{var f;(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),(f=l.current)==null||f.click())},children:[d.jsx("input",{ref:l,type:"file",accept:e,hidden:!0,onChange:c=>{var _;const f=(_=c.target.files)==null?void 0:_[0];f&&s(f),c.target.value=""}}),n?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Lt}),d.jsx("span",{children:G$e()})]}):d.jsxs(d.Fragment,{children:[d.jsx(_We,{size:20,strokeWidth:1.5}),d.jsx("span",{children:t}),d.jsxs("span",{dir:"auto",className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[d.jsx(lVe,{size:12})," ",RBe()," ",d.jsx("strong",{dir:"auto",className:"text-text font-semibold",children:r})]})]})]})}function Ddt({skill:e,projectId:n,onDeleted:t,onError:r}){const[s,a]=R.useState(!1);return d.jsxs("div",{className:Iy,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("code",{className:By,children:["/",e.name]}),d.jsx("p",{className:$y,children:e.description})]}),d.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5",children:[d.jsx("div",{className:"text-2xs text-subtext",children:Bi(e.bytes)}),e.updatedAt>0&&d.jsx("div",{className:"text-2xs text-muted",children:qi(e.updatedAt)})]}),d.jsx("button",{className:mn,"data-tip":GBe(),"data-tip-align":"end","aria-label":gIe({name:je(e.name)}),disabled:s,onClick:()=>{window.confirm(hIe({name:je(e.name)}))&&(a(!0),PKe({scope:e.scope,name:e.name,projectId:e.scope==="project"?n:void 0}).then(t).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:d.jsx(Bu,{size:13})})]})}function wk({title:e,hint:n,skills:t,projectId:r,onChanged:s,onError:a}){return d.jsxs("section",{className:U0,children:[d.jsx("h3",{children:e}),d.jsx("p",{className:Oy,children:n}),t.length===0?d.jsx("div",{className:"text-muted text-sm",children:E$e()}):d.jsx("div",{className:"flex flex-col",children:t.map(o=>d.jsx(Ddt,{skill:o,projectId:r,onDeleted:s,onError:a},o.name))})]})}function Ldt({skill:e,scopeLabel:n,alreadyImported:t,onImport:r}){const[s,a]=R.useState(!1);return d.jsxs("div",{className:Iy,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:By,children:["/",e.name]}),d.jsx("span",{className:_r,children:e.harnessName})]}),d.jsx("p",{className:$y,children:e.description})]}),d.jsxs("button",{className:Ks,disabled:s,title:TL({name:n}),onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[s?d.jsx("span",{className:Lt}):d.jsx(K9,{size:13}),t?gBe():WIe()]})]})}function Odt({project:e}){const[n,t]=R.useState(null),[r,s]=R.useState("global"),[a,o]=R.useState(!1),[l,c]=R.useState(null),[f,_]=R.useState(null),h=R.useCallback(()=>{OKe(e==null?void 0:e.id).then(k=>{t(k),_(null)}).catch(k=>{t([]),_(k instanceof Error?k.message:String(k))})},[e==null?void 0:e.id]);R.useEffect(()=>{h()},[h]),R.useEffect(()=>{!e&&r==="project"&&s("global")},[e,r]);const m=R.useRef(!1),g=R.useCallback(async k=>{if(m.current)return;c(null);const v=k.name.toLowerCase();if(!v.endsWith(".tex")&&!v.endsWith(".zip")){c(oHe());return}if(k.size>Rj){c($9());return}m.current=!0,o(!0);try{await IKe({scope:r,projectId:r==="project"?e==null?void 0:e.id:void 0,filename:k.name,contentBase64:await Dj(k)}),h()}catch(b){c(b instanceof Error?b.message:String(b))}finally{m.current=!1,o(!1)}},[r,e==null?void 0:e.id,h]),S=n??[];return d.jsxs("section",{className:U0,children:[d.jsx("h3",{children:_$e()}),d.jsx("p",{className:`${Oy} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text`,children:J$e()}),d.jsx(Lj,{scope:r,onScope:s,project:e,label:X$e()}),d.jsx(Oj,{accept:".tex,.zip",busy:a,destination:r==="global"?H9():(e==null?void 0:e.name)??"",prompt:RIe(),onFile:k=>void g(k)}),l&&d.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:l}),n===null?d.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md pt-3",children:[d.jsx("span",{className:Lt})," ",w$e()]}):f?d.jsxs("div",{className:"text-accent-red text-sm pt-3",children:[IBe()," ",f]}):S.length===0?d.jsx("div",{className:"text-muted text-sm pt-3",children:j$e()}):d.jsx("div",{className:"flex flex-col mt-1",children:S.map(k=>d.jsx(Idt,{template:k,projectId:e==null?void 0:e.id,onChanged:h,onError:c},`${k.scope}:${k.name}`))})]})}function Idt({template:e,projectId:n,onChanged:t,onError:r}){const[s,a]=R.useState(!1),o=e.supportFiles.length;return d.jsxs("div",{className:Iy,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:By,children:e.name}),d.jsx("span",{className:_r,children:e.scope==="global"?H2():P2()})]}),d.jsxs("p",{className:$y,children:[e.entry,o>0&&(o===1?tBe():CBe({count:Ht(o)}))]})]}),d.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5",children:[d.jsx("div",{className:"text-2xs text-subtext",children:Bi(e.bytes)}),e.updatedAt>0&&d.jsx("div",{className:"text-2xs text-muted",children:qi(e.updatedAt)})]}),d.jsx("button",{className:mn,"data-tip":XBe(),"data-tip-align":"end","aria-label":CIe({name:je(e.name)}),disabled:s,onClick:()=>{window.confirm(yIe({name:je(e.name)}))&&(a(!0),BKe({scope:e.scope,name:e.name,projectId:e.scope==="project"?n:void 0}).then(t).catch(l=>{a(!1),r(l instanceof Error?l.message:String(l))}))},children:d.jsx(Bu,{size:13})})]})}function Bdt({project:e}){const[n,t]=R.useState(null),[r,s]=R.useState([]),[a,o]=R.useState("global"),[l,c]=R.useState(!1),[f,_]=R.useState(null),h=R.useCallback(()=>{$Ke(e==null?void 0:e.id).then(t).catch(()=>t([]))},[e==null?void 0:e.id]);R.useEffect(()=>{h()},[h]),R.useEffect(()=>{FKe().then(s).catch(()=>s([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const m=R.useRef(!1),g=R.useCallback(async y=>{if(!m.current){if(_(null),!Mdt(y.name)){_(rHe());return}if(y.size>Rj){_($9());return}m.current=!0,c(!0);try{const C=await Dj(y);await HKe({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:y.name,contentBase64:C}),h()}catch(C){_(C instanceof Error?C.message:String(C))}finally{m.current=!1,c(!1)}}},[a,e==null?void 0:e.id,h]),S=R.useCallback(async y=>{_(null);try{await UKe({harness:y.harnessId,name:y.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),h()}catch(C){_(C instanceof Error?C.message:String(C))}},[a,e==null?void 0:e.id,h]),k=(n??[]).filter(y=>y.scope==="global"),v=(n??[]).filter(y=>y.scope==="project"),b=a==="global"?H2():(e==null?void 0:e.name)??P2(),w=new Set((n??[]).filter(y=>y.scope===a).map(y=>y.name));return d.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:[d.jsx("h1",{children:PBe()}),d.jsx("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:cBe()}),d.jsx(Odt,{project:e}),d.jsxs("section",{className:U0,children:[d.jsx("h3",{children:ABe()}),d.jsx(Lj,{scope:a,onScope:o,project:e,label:yBe()}),d.jsx(Oj,{accept:".md,.markdown,.zip",busy:l,destination:a==="global"?H9():(e==null?void 0:e.name)??"",prompt:AIe(),onFile:y=>void g(y)}),f&&d.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:f})]}),r.length>0&&d.jsxs("section",{className:U0,children:[d.jsx("h3",{children:u$e()}),d.jsxs("p",{dir:"auto",className:`${Oy} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:[D$e()," ",d.jsx("strong",{children:b})," ",B$e()," ",d.jsx("code",{children:"/name"}),"."]}),d.jsx("div",{className:"flex flex-col",children:r.map(y=>d.jsx(Ldt,{skill:y,scopeLabel:b,alreadyImported:w.has(y.name),onImport:S},`${y.harnessId}:${y.name}`))})]}),n===null?d.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[d.jsx("span",{className:Lt})," ",b$e()]}):d.jsxs(d.Fragment,{children:[d.jsx(wk,{title:a$e(),hint:UIe(),skills:k,onChanged:h,onError:_}),e&&d.jsx(wk,{title:$L({name:e.name}),hint:hBe(),skills:v,projectId:e.id,onChanged:h,onError:_})]})]})}const $dt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Xo({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:a,onPromote:o,onClose:l}){return d.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-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-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?$dt:""}`,onClick:a,onDoubleClick:o,title:s?JPe({label:n}):n,"aria-label":s?XPe({label:n}):n,children:[t,d.jsx("span",{className:"tab-label","data-label":n,children:d.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),d.jsx("span",{role:"button",className:"tab-close",title:dte(),onClick:c=>{c.stopPropagation(),l()},children:d.jsx(Gr,{size:12})})]})}const Sk=["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 Hdt({owner:e,repo:n,branch:t}){return!e||!n?d.jsx("span",{className:Sk,children:d.jsx("code",{children:t})}):d.jsxs("a",{className:Sk,href:up(e,n,t),target:"_blank",rel:"noopener noreferrer",title:g0({name:je(t)}),children:[d.jsx("code",{children:t}),d.jsx(Op,{size:12})]})}const kk=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),kb=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),Ck=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function Ek(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Nk(e,n){return C0((e.endedAt??n)-e.createdAt)}function Pdt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:a}){const o=r[0]??null,l=r.some(_=>_.status==="running"||_.status==="starting"),[c,f]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;f(Date.now());const _=window.setInterval(()=>f(Date.now()),1e3);return()=>window.clearInterval(_)},[l]),d.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:d.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:[d.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[d.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[d.jsx("h1",{children:e.title||e.slug}),d.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),d.jsx(no,{status:o?wi(o):"idle"})]}),d.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&d.jsxs("button",{className:kk,...nr(_=>s(o.id,_)),children:[d.jsx(Su,{size:15}),Jae()]}),d.jsxs("button",{className:kk,...nr(a),children:[d.jsx(op,{size:15}),Cae()]})]}),e.description&&d.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[d.jsx("h2",{children:Iae()}),d.jsx(ga,{text:e.description})]}),d.jsxs("section",{className:kb,children:[d.jsx("h2",{children:o?yae():poe()}),o&&d.jsxs(d.Fragment,{children:[d.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:[d.jsx(no,{status:wi(o)}),d.jsx(_y,{backend:o.backend}),d.jsxs("span",{title:foe(),children:[d.jsx(jGe,{size:13}),Ek(o.createdAt)]}),d.jsxs("span",{title:Pae(),children:[d.jsx(qGe,{size:13}),Nk(o,c)]}),o.commitSha&&d.jsxs("span",{title:Aae(),children:[d.jsx(vVe,{size:14}),d.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&d.jsxs("span",{children:[Gae()," ",o.exitCode]})]}),o.command&&d.jsxs("code",{className:Ck,children:["$ ",o.command]}),o.resultMarkdown&&d.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:d.jsx(ga,{text:o.resultMarkdown})})]})]}),d.jsxs("section",{className:kb,children:[d.jsx("h2",{children:"Git"}),d.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:[d.jsx(Hdt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&d.jsxs("span",{children:[Xae()," ",d.jsx("code",{children:n.slug})]}),d.jsxs("span",{title:Ek(e.createdAt),children:[Rae()," ",qi(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&d.jsxs("code",{className:Ck,children:["$ ",e.runCommand]})]}),r.length>0&&d.jsxs("section",{className:kb,children:[d.jsx("h2",{children:ooe()}),d.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)=>d.jsxs("button",{...nr(m=>s(_.id,m)),children:[d.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:[roe()," ",r.length-h]}),d.jsx(no,{status:wi(_)}),d.jsx("span",{children:qi(_.createdAt)}),d.jsx("span",{children:Nk(_,c)}),d.jsx(Su,{size:13})]},_.id))})]})]})})}var Cb={exports:{}},zk;function Fdt(){return zk||(zk=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 a=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(a._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,a=s._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=c-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),m=f-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(m/a.css.cell.width)),rows:Math.max(1,Math.floor(h/a.css.cell.height))}}}})(),t})()))})(Cb)),Cb.exports}var Udt=Fdt(),Eb={exports:{}},Ak;function qdt(){return Ak||(Ak=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),m=c(9924),g=c(844),S=c(4725),k=c(2585),v=c(3656);let b=l.AccessibilityManager=class extends g.Disposable{constructor(w,y,C,z){super(),this._terminal=w,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 N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`:"")+_.content]}),["",""]),t=Vt(n,2),r=Vt(mj(t[0],t[1]),2),s=r[0],a=r[1];if(s.length===0&&a.length===0)return[[],[]];var o=function(f){if(f&&!oo(f))return f.lineNumber},l=o(e.find(Ys)),c=o(e.find(hl));if(l===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[gk(mk(s),l),gk(mk(a),c)]}function Mht(e){var n=e.reduce((function(r,s){var a=Vt(r,3),o=a[0],l=a[1],c=a[2];if(!c||!Ys(c)||!hl(s))return[o,l,s];var f=Vt(mj(c.content,s.content),2),_=f[0],d=f[1];return[o.concat(o2(_,c.lineNumber)),l.concat(o2(d,s.lineNumber)),s]}),[[],[],null]),t=Vt(n,2);return[t[0],t[1]]}function Rht(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?Tht:Mht,r=Ry(e.map((function(l){return l.changes})),pj).map(t).reduce((function(l,c){var f=Vt(l,2),_=f[0],d=f[1],m=Vt(c,2),g=m[0],S=m[1];return[_.concat(g),d.concat(S)]}),[[],[]]),s=Vt(r,2),a=s[0],o=s[1];return Eht(_k(a),_k(o))}var Dht=["enhancers"],bk=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,a=Vt(fht(e,ol(t,Dht)),2),o=a[0],l=a[1],c=[fk(o),fk(l)],f=(n=[c[0],c[1]],s.reduce((function(k,v){return v(k)}),n)),_=Vt(f,2),d=_[0],m=_[1],g=[d.map(hk),m.map(hk)],S=g[1];return{old:g[0].map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]})),new:S.map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]}))}};const l2=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:start-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]: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-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.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-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),Lht=2e3,Oht={highlight(e,n){return lt.highlight(e,n).children}};function Iht(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 Bht(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function c2(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 $ht(e){const n=[Rht(e.hunks,{type:"line"})],t=$x(Bht(e));return t&<.registered(t)?bk(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Oht}):bk(e.hunks,{enhancers:n,highlight:!1})}function Hht(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:e2(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:e2(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const Fht=({change:e,side:n})=>n==="old"?null:Iht(e);function gj({bytesRead:e,byteLimit:n}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:cfe()}),h.jsx("p",{children:Ffe({limit:Ae($i(n)),read:Ae($i(e))})})]})}function bj({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:a}=R.useMemo(()=>Ly(e),[e]),o=t&&s+a<=Lht,l=R.useMemo(()=>{if(o)try{return $ht(e)}catch{return}},[e,o]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[h.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-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[h.jsx("span",{className:"chev",children:t?h.jsx(ya,{size:14}):h.jsx(wa,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:c2(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),t&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:Cfe()}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(tht,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:Fht,tokens:l,viewType:"unified"})}))]})}function Pht({files:e,className:n}){return h.jsx("div",{className:n?`${l2} ${n}`:l2,children:e.map((t,r)=>h.jsx(bj,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function Uht(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 vj({diff:e,partial:n=!1}){var m;const t=R.useMemo(()=>Hht(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((g,S)=>({file:g,key:`${g.oldPath}→${g.newPath}#${S}`,changes:Ly(g)})),[r]),[a,o]=R.useState(null),[l,c]=R.useState(!1),f=l&&!n,_=s.some(g=>g.key===a)?a:((m=s[0])==null?void 0:m.key)??null,d=s.find(g=>g.key===_)??null;return t.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:n?yfe():Ife()}):s.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:gfe()}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:n?s.length===1?Rfe():dfe({count:$t(s.length)}):s.length===1?Afe():tfe({count:$t(s.length)})}),!n&&h.jsx("button",{type:"button",onClick:()=>c(g=>!g),children:f?Zue():Gfe()})]}),f?h.jsx(Pht,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":ife(),children:s.map(g=>h.jsxs("button",{type:"button",className:g.key===_?"active":"","aria-pressed":g.key===_,onClick:()=>o(g.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${g.file.type}`,children:Uht(g.file)}),h.jsx("code",{title:c2(g.file),children:c2(g.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",g.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",g.changes.deletions]})]},g.key))}),h.jsx("div",{className:`${l2} diff-explorer-preview min-w-0`,children:d&&h.jsx(bj,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function qht({experiment:e,refreshKey:n,onLoadingChange:t}){const[r,s]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return t(!0),o(null),s(null),gKe(e.id).then(c=>{l||s(c)}).catch(c=>{l||o(c.message)}).finally(()=>{l||t(!1)}),()=>{l=!0}},[e.id,n,t]),h.jsx("div",{className:`${fu} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?h.jsxs("div",{className:Ii,children:[fG()," ",Ae(a)]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(gj,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(vj,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?vG():oG()}):h.jsx("div",{className:Ii,children:pG()})})}function xj({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:a,githubTitle:o,refreshing:l,onRefresh:c}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":Ste(),children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:Nte()}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:vte()})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[h.jsx(cp,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&h.jsx("a",{className:vn,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:h.jsx(Ip,{size:13})}),h.jsx("span",{style:{flex:1}}),h.jsx("button",{className:vn,title:N6(),"aria-label":N6(),onClick:c,children:l?h.jsx("span",{className:Dt}):h.jsx(iE,{size:13})})]})}const Ght=/\.(md|mdx|markdown)$/i,Vht=/\.tex$/i,Wht=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,Kht=/\.(csv|tsv|xlsx?|ods)$/i,Xht=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,Yht=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,Zht=/\.pdf$/i,Qht=/\.(docx?|log|rtf|txt)$/i;function Jht(e){return Wht.test(e)}function Oy(e){return Ght.test(e)}function yj(e){return Vht.test(e)}function wj({name:e}){const n=Oy(e)?"markdown":Jht(e)?"image":Kht.test(e)?"spreadsheet":Xht.test(e)?"code":Yht.test(e)?"archive":Zht.test(e)?"pdf":Qht.test(e)||yj(e)?"document":"file";let t;return n==="markdown"?t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}const Sj=["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]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),vk=["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 xk(){return{dirs:new Map,files:[]}}function kj(e){const n=xk();for(const t of e){const r=t.split("/");let s=n;for(let a=0;aa(t),title:t,children:[c?h.jsx(ya,{size:13,className:vk}):h.jsx(wa,{size:13,className:vk}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),c&&h.jsx(Iy,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:a,onOpenFile:o})]})}function Iy({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:a}){const o=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),l=[...e.files].sort((c,f)=>c.localeCompare(f));return h.jsxs(h.Fragment,{children:[o.map(c=>{const f=n?`${n}/${c}`:c;return h.jsx(edt,{name:c,node:e.dirs.get(c),path:f,depth:t,toggled:r,onToggle:s,onOpenFile:a},`d:${f}`)}),l.map(c=>{const f=n?`${n}/${c}`:c;return h.jsxs("button",{type:"button",className:Sj,style:{paddingInlineStart:8+t*14},...ir(_=>a(f,_)),title:BL({name:Ae(f)}),children:[h.jsx(wj,{name:c}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c})]},`f:${f}`)})]})}function tdt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:a,onToggledChange:o,onOpenFile:l}){const c=t.branchName,f=`${e}:${c}`,[_,d]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState(!1),[w,y]=R.useState(0),[C,z]=R.useState(void 0),N=R.useRef(0),T=R.useRef(null),j=R.useCallback(()=>{T.current=f;const P=++N.current;k(!0),Qb(e,{ref:c}).then(q=>{P===N.current&&(d(q),g(null))}).catch(q=>{P===N.current&&g(q.message)}).finally(()=>{P===N.current&&k(!1)})},[e,c,f]);R.useEffect(()=>(N.current++,T.current=null,d(null),g(null),k(!1),()=>{N.current++}),[f]),R.useEffect(()=>{r==="files"&&T.current!==f&&j()},[r,f,j]),R.useEffect(()=>{z(void 0);const P=t.chatSessionId;if(!P)return;let q=!1;return _E(P).then(W=>{!q&&W.exists&&W.branch===c&&z(P)}).catch(()=>{}),()=>{q=!0}},[t.chatSessionId,c]);const D=R.useMemo(()=>_?kj(_.entries):null,[_]),I=r==="files"?S:v,L=R.useCallback(P=>{const q=new Set(s);q.has(P)?q.delete(P):q.add(P),o(q)},[s,o]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(xj,{view:r,onViewChange:a,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?fp(n.githubOwner,n.githubRepo,c):void 0,githubTitle:o9({branch:Ae(c)}),refreshing:I,onRefresh:()=>r==="files"?j():y(P=>P+1)}),r==="changes"?h.jsx(qht,{experiment:t,refreshKey:w,onLoadingChange:b},t.id):h.jsxs(h.Fragment,{children:[(_==null?void 0:_.truncated)&&h.jsx("div",{className:Ii,children:Dte()}),m&&D&&h.jsxs("div",{className:Ii,children:[Pte()," ",Ae(m)]}),h.jsx("div",{className:fu,children:D?D.dirs.size===0&&D.files.length===0?h.jsx("div",{className:Ii,children:Bte()}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(Iy,{node:D,parentPath:"",depth:0,toggled:s,onToggle:L,onOpenFile:(P,q)=>C?l(P,C,void 0,q):l(P,void 0,c,q)})}):h.jsx("div",{className:Ii,children:m?h9({error:Ae(m)}):d9()})})]})]})}const ndt=5e3;function rdt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:a,onOpenFile:o}){var D;const l=n.id,[c,f]=R.useState(null),[_,d]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!0),v=R.useRef(0),b=R.useCallback(()=>{const I=++v.current;k(!0),(async()=>{if(!e)return[null,await Qb(l,{ref:n.baselineBranch})];const P=await _E(e),q=P.exists?{sessionId:e}:{ref:n.baselineBranch};return[P,await Qb(l,q)]})().then(([P,q])=>{I===v.current&&(f(P),d(q),g(null))}).catch(P=>{I===v.current&&g(P.message)}).finally(()=>{I===v.current&&k(!1)})},[e,l,n.baselineBranch]);R.useEffect(()=>(f(null),d(null),g(null),b(),()=>{v.current++}),[b]),R.useEffect(()=>{if(!e)return;let I=!1,L=!1,P=!1,q=null;const W=()=>{q||(q=setInterval(b,ndt))},Z=()=>{q&&(clearInterval(q),q=null)},X=hh(J=>{J.type!=="busy"||J.sessionId!==e||(L=!0,J.busy&&!I?(I=!0,W()):!J.busy&&I&&(I=!1,Z(),b()))});return e0(l).then(J=>{var ee;P||L||I||(ee=J.find($=>$.id===e))!=null&&ee.busy&&(I=!0,W())}).catch(()=>{}),()=>{P=!0,X(),Z()}},[e,l,b]);const w=R.useMemo(()=>_?kj(_.entries):null,[_]),y=R.useCallback(I=>{const L=new Set(r);L.has(I)?L.delete(I):L.add(I),a(L)},[r,a]),C=e&&(c!=null&&c.exists)?c:null,z=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?MGe({branch:Ae(C.baselineBranch)}):j9()),N=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,T=C?kGe({branch:Ae(`${z}${N>0?"*":""}`)}):zGe({branch:Ae(n.baselineBranch)}),j=C?C.branch:n.baselineBranch;return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(xj,{view:C?t:"files",onViewChange:s,showViewToggle:!!C,branchLabel:T,branchTitle:T,githubHref:n.githubEnabled&&j?fp(n.githubOwner,n.githubRepo,j):void 0,githubTitle:j?o9({branch:Ae(j)}):void 0,refreshing:S,onRefresh:b}),m&&(c||_)&&h.jsxs("div",{className:Ii,children:[QGe()," ",Ae(m)]}),!_||e&&!c?h.jsx("div",{className:fu,children:h.jsx("div",{className:Ii,children:m?h9({error:Ae(m)}):d9()})}):C&&t==="changes"?h.jsx("div",{className:`${fu} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:N===0||!C.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:qGe()}):h.jsxs(h.Fragment,{children:[C.diff.truncated&&h.jsx(gj,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),h.jsx(vj,{diff:C.diff.diff,partial:C.diff.truncated})]})}):h.jsxs("div",{className:fu,children:[_.truncated&&h.jsx("div",{className:Ii,children:OGe()}),w?w.dirs.size===0&&w.files.length===0?h.jsx("div",{className:Ii,children:KGe()}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(Iy,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:(I,L)=>C?o(I,e,void 0,L):o(I,void 0,n.baselineBranch,L)})}):h.jsx("div",{className:Ii,children:HGe()})]})]})}const U0="font-mono text-sm leading-[1.55] [tab-size:4]",Cj="whitespace-pre-wrap break-words",Ej="file-view-gutter text-right text-muted select-none";function Nj(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function zj({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const a=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +`),d=eA(_,$x(n));return _.endsWith(` +`)?d.slice(0,-1):d},[e,n]),o=t&&a.length>0?Math.min(Math.max(Math.trunc(t),1),a.length):void 0,l=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(o?((_=l.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):a.length===0&&(s==null||s()))},[a.length,s,r,o]);const{ruleCh:c}=Nj(a.length),f=R.useMemo(()=>a.map((_,d)=>h.jsxs("div",{ref:d+1===o?l:void 0,className:`file-view-line flex items-stretch ${d+1===o?"file-view-line-highlight bg-accent-blue-subtle shadow-[inset_2px_0_0_var(--accent-blue)]":""}`,children:[h.jsx("span",{"data-line":d+1,className:`${Ej} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),h.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${U0} ${Cj}`,children:tA(_)?h.jsx("br",{}):_})]},d)),[a,c,o]);return h.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${U0}`,children:[a.length>0&&h.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"}),f]})}function Aj(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function yk({url:e,name:n}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Fde()," ",h.jsxs("a",{href:e,download:n,children:[v9()," ",Ae(n)]})]})}function u2({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,a]=R.useState(!1);if(R.useEffect(()=>a(!1),[e,n]),s)return h.jsx(yk,{url:n,name:t});let o;return e==="image"?o=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:n,alt:t,onError:()=>a(!0)})}):e==="audio"?o=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>a(!0)})}):e==="video"?o=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>a(!0)})}):o=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>a(!0),children:h.jsx(yk,{url:n,name:t})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-xs",children:h.jsxs("a",{href:n,download:t,children:[v9()," ",t]})})]})}const wk=`${vn} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function sdt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function idt(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),a=r===-1?"":t.slice(r),o=s.indexOf("?"),l=o===-1?s:s.slice(0,o),c=o===-1?"":s.slice(o+1),f=l.startsWith("/")?[]:n.split("/").filter(g=>g.length>0);for(const g of l.split("/"))if(!(!g||g==="."))if(g===".."){if(f.length===0)return null;f.pop()}else f.push(g);const _=f.join("/");if(!_)return null;const d=new URLSearchParams(c);d.delete("path");const m=d.toString();return`${Vh(e,_)}${m?`&${m}`:""}${a}`}function adt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const jj="orx:files-tree-width",Tj="orx:artifacts-collapsed:",Mj=180,Rj=560,odt=8,ldt=280;function cdt(){try{const e=Number(localStorage.getItem(jj));if(Number.isFinite(e)&&e>=Mj&&e<=Rj)return e}catch{}return ldt}function udt(e){try{const n=localStorage.getItem(`${Tj}${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 f2(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=f2(t.children??[],n);if(r)return r}}return null}function Dj({projectId:e,folder:n,markdown:t}){const r=s=>sdt(s)?s:idt(e,n,s);return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]: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-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-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-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(ttt,{remarkPlugins:[Vz,[Wz,sA]],rehypePlugins:[yz],components:{a:({href:s,children:a,...o})=>{const l=!s||s.startsWith("#"),c=l?s:r(s);return c?h.jsx("a",{...o,href:c,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:s,alt:a})=>{if(!s||typeof s!="string")return null;const o=r(s);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...iA},children:nA(adt(t))})})}function fdt(e){return e.presentation==="text"&&Oy(e.name)?"markdown":Aj(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function hdt(e,n,t){const[r,s]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(!1),[f,_]=R.useState(null),d=R.useRef(0),m=R.useRef(!1),g=t==="markdown"||t==="text"&&n.size<=mE;return R.useEffect(()=>{if(o(!1),c(!1),_(null),!g)return;let S=!1;const k=++d.current;return gE(e,n.path).then(b=>{if(!b)throw new Error(YU());return b}).then(b=>{S||k!==d.current||(b.binary?o(!0):(m.current=!0,s(b.content)),c(b.truncated))}).catch(b=>{!S&&k===d.current&&!m.current&&_(b instanceof Error?b.message:String(b))}),()=>{S=!0}},[e,n.path,n.modifiedAt,t,g]),{text:r,binary:a,truncated:l,error:f,wantsText:g}}function ddt({projectId:e,entry:n,onDelete:t}){const r=fdt(n),{text:s,binary:a,truncated:o,error:l,wantsText:c}=hdt(e,n,r),[f,_]=R.useState(!1),d=r==="markdown",m=n.path.split("/").slice(0,-1).join("/"),g=`${Vh(e,n.path)}&v=${n.modifiedAt}`;let S;return r==="image"||r==="audio"||r==="video"||r==="pdf"?S=h.jsx(u2,{kind:r,url:g,name:n.name}):r==="download"||!c||a?S=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[r==="download"||a?PU():rG()," ",h.jsx("a",{href:g,...r==="download"||a?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:r==="download"||a?g9():eq()})]}):l?S=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[vq()," ",Ae(l)]}):s===null?S=h.jsxs("div",{className:br,children:[h.jsx("span",{className:Dt})," ",Tq()]}):d&&!f?S=h.jsx(Dj,{projectId:e,folder:m,markdown:s}):S=h.jsx(zj,{text:s,path:n.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[h.jsx(wu,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:Ae(n.path),children:n.path}),h.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[$q()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),(r==="text"||r==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:$i(n.size)}),d&&h.jsx("button",{className:`${vn} ${f?"active":""}`,"data-tip":f?x0():iu(),"data-tip-align":"end","aria-label":f?x0():iu(),onClick:()=>_(k=>!k),children:h.jsx(Xb,{size:13})}),h.jsx("a",{className:vn,href:g,target:"_blank",rel:"noopener noreferrer","data-tip":t6(),"data-tip-align":"end","aria-label":t6(),children:h.jsx(Jl,{size:13})}),h.jsx("button",{className:vn,"data-tip":e6(),"data-tip-align":"end","aria-label":e6(),onClick:()=>{window.confirm(l9({path:Ae(n.path)}))&&t(n.path)},children:h.jsx(Bu,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${d&&!f?"doc":""}`,children:[S,o&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Sq()})]})]})}function Lj({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:a,onOpenFile:o,onDelete:l}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(c=>{var _;const f={paddingInlineStart:8+Math.min(n,odt)*14};if(c.isDir){const d=!t.has(c.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:f,onClick:()=>s(c.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":d?NU({name:Ae(c.name)}):BU({name:Ae(c.name)}),onClick:m=>{m.stopPropagation(),s(c.path)},children:h.jsx(wa,{size:13,className:d?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name}),h.jsx("button",{className:`${Wh} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":pq(),"data-tip-align":"end","aria-label":DU({name:Ae(c.name)}),onClick:m=>{m.stopPropagation(),window.confirm(l9({path:Ae(c.path)}))&&l(c.path)},children:h.jsx(Bu,{size:12})})]}),d&&(((_=c.children)==null?void 0:_.length)??0)>0&&h.jsx(Lj,{entries:c.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:a,onOpenFile:o,onDelete:l})]},c.path)}return h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===c.path?"selected":""}`,style:f,title:LD({path:Ae(c.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===c.path,onClick:()=>a(c.path),onDoubleClick:()=>o(c.path),onAuxClick:d=>{d.button===1&&(d.preventDefault(),a(c.path),o(c.path))},onKeyDown:d=>{if(d.key===" "){d.preventDefault(),d.stopPropagation(),a(c.path);return}d.key==="Enter"&&(d.preventDefault(),d.stopPropagation(),a(c.path),o(c.path))},children:[h.jsx(wj,{name:c.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name})]},c.path)})})}function Sk({dir:e,onOpenStorage:n}){const[t,r]=R.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:Ae(e),children:[h.jsx("code",{className:"path-front-ellipsis",children:e}),h.jsx("button",{className:wk,"data-tip":t?v0():VU(),"aria-label":lq(),onClick:()=>{var s;(s=navigator.clipboard)==null||s.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:t?h.jsx(ds,{size:12}):h.jsx(op,{size:12})}),h.jsx("button",{className:wk,"data-tip":n6(),"data-tip-align":"end","aria-label":n6(),onClick:n,children:h.jsx(IWe,{size:12})})]})}function _dt({project:e,artifacts:n,onChanged:t,onOpenFile:r,onOpenStorage:s}){const[a,o]=R.useState(null),[l,c]=R.useState(()=>udt(e.id)),[f,_]=R.useState(cdt),d=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${Tj}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const m=b=>{var N;b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId);const w=(N=d.current)==null?void 0:N.getBoundingClientRect(),y=document.body.style.userSelect;document.body.style.userSelect="none";const C=T=>{const j=Math.round(T.clientX-((w==null?void 0:w.left)??0)),D=Math.min(Math.max(j,Mj),Rj);_(D);try{localStorage.setItem(jj,String(D))}catch{}},z=()=>{window.removeEventListener("pointermove",C),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z),document.body.style.userSelect=y};window.addEventListener("pointermove",C),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z)};R.useEffect(()=>{if(!a||!n)return;const b=f2(n.entries,a);(!b||b.isDir)&&o(null)},[a,n]);const g=b=>c(w=>{const y=new Set(w);return y.has(b)?y.delete(b):y.add(b),y}),S=b=>{(a===b||a!=null&&a.startsWith(b+"/"))&&o(null),sXe(e.id,b).catch(()=>{}).finally(t)};if(!n)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:br,style:{padding:20},children:[h.jsx("span",{className:Dt})," ",Lq()]})});const k=b=>h.jsx(Lj,{entries:b,depth:0,collapsed:l,selected:a,onToggle:g,onSelect:o,onOpenFile:r,onDelete:S}),v=a?f2(n.entries,a):null;return n.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(q2,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:Uq()}),h.jsx("p",{children:Jq()}),h.jsx(Sk,{dir:n.dir,onOpenStorage:s})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background",ref:d,style:{width:f},children:[h.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:m}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[k(n.entries),n.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:Nq()})]}),h.jsx(Sk,{dir:n.dir,onOpenStorage:s})]}),v?h.jsx(ddt,{projectId:e.id,entry:v,onDelete:S},v.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[h.jsx(wWe,{size:22,strokeWidth:1.5}),h.jsx("span",{children:sq()})]})]})}const Oj=20*1024*1024,q0="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",By="mt-0 mx-0 mb-3 text-muted text-md leading-normal",$y="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",Hy="font-mono text-sm font-medium text-text",Fy="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function Ij(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 a=s.indexOf(",");n(a>=0?s.slice(a+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function pdt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}const mdt="flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-start text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed";function Bj({scope:e,onScope:n,project:t,label:r}){const s=a=>`${mdt} ${a?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return h.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":r,children:[h.jsxs("button",{type:"button","aria-pressed":e==="global",className:s(e==="global"),onClick:()=>n("global"),children:[P2(),h.jsx("span",{className:"text-2xs font-normal text-muted",children:O$e()})]}),h.jsxs("button",{type:"button","aria-pressed":e==="project",className:s(e==="project"),disabled:!t,title:t?void 0:PBe(),onClick:()=>n("project"),children:[U2(),h.jsx("span",{className:"text-2xs font-normal text-muted",children:t?t.name:DBe()})]})]})}function $j({accept:e,busy:n,prompt:t,destination:r,onFile:s}){const[a,o]=R.useState(!1),l=R.useRef(null);return h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${n?"cursor-default":"cursor-pointer"} ${a?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:c=>{c.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:c=>{var _;c.preventDefault(),o(!1);const f=(_=c.dataTransfer.files)==null?void 0:_[0];f&&s(f)},onClick:()=>{var c;return(c=l.current)==null?void 0:c.click()},role:"button",tabIndex:0,onKeyDown:c=>{var f;(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),(f=l.current)==null||f.click())},children:[h.jsx("input",{ref:l,type:"file",accept:e,hidden:!0,onChange:c=>{var _;const f=(_=c.target.files)==null?void 0:_[0];f&&s(f),c.target.value=""}}),n?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Dt}),h.jsx("span",{children:zHe()})]}):h.jsxs(h.Fragment,{children:[h.jsx(ZWe,{size:20,strokeWidth:1.5}),h.jsx("span",{children:t}),h.jsxs("span",{dir:"auto",className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[h.jsx(GVe,{size:12})," ",m$e()," ",h.jsx("strong",{dir:"auto",className:"text-text font-semibold",children:r})]})]})]})}function gdt({skill:e,projectId:n,onDeleted:t,onError:r}){const[s,a]=R.useState(!1);return h.jsxs("div",{className:$y,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("code",{className:Hy,children:["/",e.name]}),h.jsx("p",{className:Fy,children:e.description})]}),h.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:$i(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Gi(e.updatedAt)})]}),h.jsx("button",{className:vn,"data-tip":z$e(),"data-tip-align":"end","aria-label":eBe({name:Ae(e.name)}),disabled:s,onClick:()=>{window.confirm(YIe({name:Ae(e.name)}))&&(a(!0),kXe({scope:e.scope,name:e.name,projectId:e.scope==="project"?n:void 0}).then(t).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:h.jsx(Bu,{size:13})})]})}function kk({title:e,hint:n,skills:t,projectId:r,onChanged:s,onError:a}){return h.jsxs("section",{className:q0,children:[h.jsx("h3",{children:e}),h.jsx("p",{className:By,children:n}),t.length===0?h.jsx("div",{className:"text-muted text-sm",children:cHe()}):h.jsx("div",{className:"flex flex-col",children:t.map(o=>h.jsx(gdt,{skill:o,projectId:r,onDeleted:s,onError:a},o.name))})]})}function bdt({skill:e,scopeLabel:n,alreadyImported:t,onImport:r}){const[s,a]=R.useState(!1);return h.jsxs("div",{className:$y,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("code",{className:Hy,children:["/",e.name]}),h.jsx("span",{className:gr,children:e.harnessName})]}),h.jsx("p",{className:Fy,children:e.description})]}),h.jsxs("button",{className:Zs,disabled:s,title:DL({name:n}),onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[s?h.jsx("span",{className:Dt}):h.jsx(Z9,{size:13}),t?e$e():jBe()]})]})}function vdt({project:e}){const[n,t]=R.useState(null),[r,s]=R.useState("global"),[a,o]=R.useState(!1),[l,c]=R.useState(null),[f,_]=R.useState(null),d=R.useCallback(()=>{vXe(e==null?void 0:e.id).then(k=>{t(k),_(null)}).catch(k=>{t([]),_(k instanceof Error?k.message:String(k))})},[e==null?void 0:e.id]);R.useEffect(()=>{d()},[d]),R.useEffect(()=>{!e&&r==="project"&&s("global")},[e,r]);const m=R.useRef(!1),g=R.useCallback(async k=>{if(m.current)return;c(null);const v=k.name.toLowerCase();if(!v.endsWith(".tex")&&!v.endsWith(".zip")){c(qHe());return}if(k.size>Oj){c(P9());return}m.current=!0,o(!0);try{await xXe({scope:r,projectId:r==="project"?e==null?void 0:e.id:void 0,filename:k.name,contentBase64:await Ij(k)}),d()}catch(b){c(b instanceof Error?b.message:String(b))}finally{m.current=!1,o(!1)}},[r,e==null?void 0:e.id,d]),S=n??[];return h.jsxs("section",{className:q0,children:[h.jsx("h3",{children:Z$e()}),h.jsx("p",{className:`${By} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text`,children:OHe()}),h.jsx(Bj,{scope:r,onScope:s,project:e,label:MHe()}),h.jsx($j,{accept:".tex,.zip",busy:a,destination:r==="global"?U9():(e==null?void 0:e.name)??"",prompt:mBe(),onFile:k=>void g(k)}),l&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:l}),n===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md pt-3",children:[h.jsx("span",{className:Dt})," ",iHe()]}):f?h.jsxs("div",{className:"text-accent-red text-sm pt-3",children:[x$e()," ",f]}):S.length===0?h.jsx("div",{className:"text-muted text-sm pt-3",children:dHe()}):h.jsx("div",{className:"flex flex-col mt-1",children:S.map(k=>h.jsx(xdt,{template:k,projectId:e==null?void 0:e.id,onChanged:d,onError:c},`${k.scope}:${k.name}`))})]})}function xdt({template:e,projectId:n,onChanged:t,onError:r}){const[s,a]=R.useState(!1),o=e.supportFiles.length;return h.jsxs("div",{className:$y,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:Hy,children:e.name}),h.jsx("span",{className:gr,children:e.scope==="global"?P2():U2()})]}),h.jsxs("p",{className:Fy,children:[e.entry,o>0&&(o===1?BBe():l$e({count:$t(o)}))]})]}),h.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:$i(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Gi(e.updatedAt)})]}),h.jsx("button",{className:vn,"data-tip":M$e(),"data-tip-align":"end","aria-label":lBe({name:Ae(e.name)}),disabled:s,onClick:()=>{window.confirm(sBe({name:Ae(e.name)}))&&(a(!0),yXe({scope:e.scope,name:e.name,projectId:e.scope==="project"?n:void 0}).then(t).catch(l=>{a(!1),r(l instanceof Error?l.message:String(l))}))},children:h.jsx(Bu,{size:13})})]})}function ydt({project:e}){const[n,t]=R.useState(null),[r,s]=R.useState([]),[a,o]=R.useState("global"),[l,c]=R.useState(!1),[f,_]=R.useState(null),d=R.useCallback(()=>{wXe(e==null?void 0:e.id).then(t).catch(()=>t([]))},[e==null?void 0:e.id]);R.useEffect(()=>{d()},[d]),R.useEffect(()=>{CXe().then(s).catch(()=>s([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const m=R.useRef(!1),g=R.useCallback(async y=>{if(!m.current){if(_(null),!pdt(y.name)){_(HHe());return}if(y.size>Oj){_(P9());return}m.current=!0,c(!0);try{const C=await Ij(y);await SXe({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:y.name,contentBase64:C}),d()}catch(C){_(C instanceof Error?C.message:String(C))}finally{m.current=!1,c(!1)}}},[a,e==null?void 0:e.id,d]),S=R.useCallback(async y=>{_(null);try{await EXe({harness:y.harnessId,name:y.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),d()}catch(C){_(C instanceof Error?C.message:String(C))}},[a,e==null?void 0:e.id,d]),k=(n??[]).filter(y=>y.scope==="global"),v=(n??[]).filter(y=>y.scope==="project"),b=a==="global"?P2():(e==null?void 0:e.name)??U2(),w=new Set((n??[]).filter(y=>y.scope===a).map(y=>y.name));return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:k$e()}),h.jsx("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:VBe()}),h.jsx(vdt,{project:e}),h.jsxs("section",{className:q0,children:[h.jsx("h3",{children:h$e()}),h.jsx(Bj,{scope:a,onScope:o,project:e,label:s$e()}),h.jsx($j,{accept:".md,.markdown,.zip",busy:l,destination:a==="global"?U9():(e==null?void 0:e.name)??"",prompt:hBe(),onFile:y=>void g(y)}),f&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:f})]}),r.length>0&&h.jsxs("section",{className:q0,children:[h.jsx("h3",{children:W$e()}),h.jsxs("p",{dir:"auto",className:`${By} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:[gHe()," ",h.jsx("strong",{children:b})," ",yHe()," ",h.jsx("code",{children:"/name"}),"."]}),h.jsx("div",{className:"flex flex-col",children:r.map(y=>h.jsx(bdt,{skill:y,scopeLabel:b,alreadyImported:w.has(y.name),onImport:S},`${y.harnessId}:${y.name}`))})]}),n===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[h.jsx("span",{className:Dt})," ",tHe()]}):h.jsxs(h.Fragment,{children:[h.jsx(kk,{title:U$e(),hint:EBe(),skills:k,onChanged:d,onError:_}),e&&h.jsx(kk,{title:PL({name:e.name}),hint:YBe(),skills:v,projectId:e.id,onChanged:d,onError:_})]})]})}const wdt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Xo({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:a,onPromote:o,onClose:l}){return h.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-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-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?wdt:""}`,onClick:a,onDoubleClick:o,title:s?OPe({label:n}):n,"aria-label":s?MPe({label:n}):n,children:[t,h.jsx("span",{className:"tab-label","data-label":n,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),h.jsx("span",{role:"button",className:"tab-close",title:pte(),onClick:c=>{c.stopPropagation(),l()},children:h.jsx(Yr,{size:12})})]})}const Ck=["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 Sdt({owner:e,repo:n,branch:t}){return!e||!n?h.jsx("span",{className:Ck,children:h.jsx("code",{children:t})}):h.jsxs("a",{className:Ck,href:fp(e,n,t),target:"_blank",rel:"noopener noreferrer",title:b0({name:Ae(t)}),children:[h.jsx("code",{children:t}),h.jsx(Ip,{size:12})]})}const Ek=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),Nb=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),Nk=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function zk(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Ak(e,n){return E0((e.endedAt??n)-e.createdAt)}function kdt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:a}){const o=r[0]??null,l=r.some(_=>_.status==="running"||_.status==="starting"),[c,f]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;f(Date.now());const _=window.setInterval(()=>f(Date.now()),1e3);return()=>window.clearInterval(_)},[l]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),h.jsx(no,{status:o?Si(o):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&h.jsxs("button",{className:Ek,...ir(_=>s(o.id,_)),children:[h.jsx(Su,{size:15}),noe()]}),h.jsxs("button",{className:Ek,...ir(a),children:[h.jsx(lp,{size:15}),zae()]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:Hae()}),h.jsx(ga,{text:e.description})]}),h.jsxs("section",{className:Nb,children:[h.jsx("h2",{children:o?kae():boe()}),o&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(no,{status:Si(o)}),h.jsx(my,{backend:o.backend}),h.jsxs("span",{title:_oe(),children:[h.jsx(dVe,{size:13}),zk(o.createdAt)]}),h.jsxs("span",{title:qae(),children:[h.jsx(NVe,{size:13}),Ak(o,c)]}),o.commitSha&&h.jsxs("span",{title:Mae(),children:[h.jsx(nWe,{size:14}),h.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&h.jsxs("span",{children:[Kae()," ",o.exitCode]})]}),o.command&&h.jsxs("code",{className:Nk,children:["$ ",o.command]}),o.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:h.jsx(ga,{text:o.resultMarkdown})})]})]}),h.jsxs("section",{className:Nb,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(Sdt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&h.jsxs("span",{children:[Qae()," ",h.jsx("code",{children:n.slug})]}),h.jsxs("span",{title:zk(e.createdAt),children:[Oae()," ",Gi(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&h.jsxs("code",{className:Nk,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:Nb,children:[h.jsx("h2",{children:uoe()}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-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((_,d)=>h.jsxs("button",{...ir(m=>s(_.id,m)),children:[h.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:[aoe()," ",r.length-d]}),h.jsx(no,{status:Si(_)}),h.jsx("span",{children:Gi(_.createdAt)}),h.jsx("span",{children:Ak(_,c)}),h.jsx(Su,{size:13})]},_.id))})]})]})})}var zb={exports:{}},jk;function Cdt(){return jk||(jk=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 a=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(a._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,a=s._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=c-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),m=f-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(m/a.css.cell.width)),rows:Math.max(1,Math.floor(d/a.css.cell.height))}}}})(),t})()))})(zb)),zb.exports}var Edt=Cdt(),Ab={exports:{}},Tk;function Ndt(){return Tk||(Tk=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=c(9042),m=c(9924),g=c(844),S=c(4725),k=c(2585),v=c(3656);let b=l.AccessibilityManager=class extends g.Disposable{constructor(w,y,C,z){super(),this._terminal=w,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 N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.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+=h.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,z=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],D=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",I=(C.ydisp+N+1).toString(),L=this._rowElements[N];L&&(D.length===0?(L.innerText=" ",this._rowColumns.set(L,[0,1])):(L.textContent=D,this._rowColumns.set(L,j)),L.setAttribute("aria-posinset",I),L.setAttribute("aria-setsize",z))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,z=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==z)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.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 D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const z=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(z)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:z,offset:((D=z.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:I,offset:L})=>{const U=I instanceof Text?I.parentNode:I;let q=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(U);if(!W)return console.warn("columns is null. Race condition?"),null;let Z=L=this._terminal.cols&&(++q,Z=0),{row:q,column:Z}},T=N(y),j=N(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(m){return m.replace(/\r?\n/g,"\r")}function f(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function _(m,g,S,k){m=f(m=c(m),S.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(m,!0),g.value=""}function h(m,g,S){const k=S.getBoundingClientRect(),v=m.clientX-k.left-10,b=m.clientY-k.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${b}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=f,l.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,g,S,k){m.stopPropagation(),m.clipboardData&&_(m.clipboardData.getData("text/plain"),g,S,k)},l.paste=_,l.moveTextAreaUnderMouseCursor=h,l.rightClickHandler=function(m,g,S,k,v){h(m,g,S),v&&k.rightClickSelect(m),g.value=k.selectionText,g.select()}},7239:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=c(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(_,h,m){this._css.set(_,h,m)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,m){this._color.set(_,h,m)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,f,_,h){c.addEventListener(f,_,h);let m=!1;return{dispose:()=>{m||(m=!0,c.removeEventListener(f,_,h))}}}},3551:function(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const h=c(3656),m=c(8460),g=c(844),S=c(2585),k=c(4725);let v=l.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,z){super(),this._element=b,this._mouseService=w,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 m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.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{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(z=this._activeProviderReplies)!=null&&z.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var I,L;if(this._isMouseOut)return;const D=j==null?void 0:j.map((U=>({link:U})));(I=this._activeProviderReplies)==null||I.set(N,D),y=this._checkLinkProviderResult(N,b,y),((L=this._activeProviderReplies)==null?void 0:L.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 I=j;I<=D;I++){if(y.has(I)){z.splice(N--,1);break}y.add(I)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let z=!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(D.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,g.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,z,N;(C=this._currentLink)!=null&&C.state&&((N=(z=this._currentLink)==null?void 0:z.state)==null?void 0:N.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 N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!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,z=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(z)}_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,z=w.y*this._bufferService.cols+w.x;return y<=z&&z<=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,z){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:z}}};l.Linkifier=v=f([_(1,k.IMouseService),_(2,k.IRenderService),_(3,S.IBufferService),_(4,k.ILinkProviderService)],v)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const h=c(511),m=c(2585);let g=l.OscLinkProvider=class{constructor(k,v,b){this._bufferService=k,this._optionsService=v,this._oscLinkService=b}provideLinks(k,v){var D;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 h.CellData,z=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let I=0;Iy?y.activate(W,Z,U):S(0,Z),hover:(W,Z)=>{var X;return(X=y==null?void 0:y.hover)==null?void 0:X.call(y,W,Z,U)},leave:(W,Z)=>{var X;return(X=y==null?void 0:y.leave)==null?void 0:X.call(y,W,Z,U)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=I,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function S(k,v){if(confirm(`Do you want to navigate to ${v}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.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,z=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],D=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",I=(C.ydisp+N+1).toString(),L=this._rowElements[N];L&&(D.length===0?(L.innerText=" ",this._rowColumns.set(L,[0,1])):(L.textContent=D,this._rowColumns.set(L,j)),L.setAttribute("aria-posinset",I),L.setAttribute("aria-setsize",z))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,z=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==z)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.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 D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const z=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(z)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:z,offset:((D=z.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:I,offset:L})=>{const P=I instanceof Text?I.parentNode:I;let q=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(P);if(!W)return console.warn("columns is null. Race condition?"),null;let Z=L=this._terminal.cols&&(++q,Z=0),{row:q,column:Z}},T=N(y),j=N(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(m){return m.replace(/\r?\n/g,"\r")}function f(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function _(m,g,S,k){m=f(m=c(m),S.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(m,!0),g.value=""}function d(m,g,S){const k=S.getBoundingClientRect(),v=m.clientX-k.left-10,b=m.clientY-k.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${b}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=f,l.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,g,S,k){m.stopPropagation(),m.clipboardData&&_(m.clipboardData.getData("text/plain"),g,S,k)},l.paste=_,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(m,g,S,k,v){d(m,g,S),v&&k.rightClickSelect(m),g.value=k.selectionText,g.select()}},7239:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=c(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(_,d,m){this._css.set(_,d,m)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,m){this._color.set(_,d,m)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,f,_,d){c.addEventListener(f,_,d);let m=!1;return{dispose:()=>{m||(m=!0,c.removeEventListener(f,_,d))}}}},3551:function(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=c(3656),m=c(8460),g=c(844),S=c(2585),k=c(4725);let v=l.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,z){super(),this._element=b,this._mouseService=w,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 m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(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{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(z=this._activeProviderReplies)!=null&&z.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var I,L;if(this._isMouseOut)return;const D=j==null?void 0:j.map((P=>({link:P})));(I=this._activeProviderReplies)==null||I.set(N,D),y=this._checkLinkProviderResult(N,b,y),((L=this._activeProviderReplies)==null?void 0:L.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 I=j;I<=D;I++){if(y.has(I)){z.splice(N--,1);break}y.add(I)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let z=!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(D.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,g.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,z,N;(C=this._currentLink)!=null&&C.state&&((N=(z=this._currentLink)==null?void 0:z.state)==null?void 0:N.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 N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!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,z=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(z)}_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,z=w.y*this._bufferService.cols+w.x;return y<=z&&z<=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,z){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:z}}};l.Linkifier=v=f([_(1,k.IMouseService),_(2,k.IRenderService),_(3,S.IBufferService),_(4,k.ILinkProviderService)],v)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=c(511),m=c(2585);let g=l.OscLinkProvider=class{constructor(k,v,b){this._bufferService=k,this._optionsService=v,this._oscLinkService=b}provideLinks(k,v){var D;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 d.CellData,z=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let I=0;Iy?y.activate(W,Z,P):S(0,Z),hover:(W,Z)=>{var X;return(X=y==null?void 0:y.hover)==null?void 0:X.call(y,W,Z,P)},leave:(W,Z)=>{var X;return(X=y==null?void 0:y.leave)==null?void 0:X.call(y,W,Z,P)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=I,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function S(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")}}l.OscLinkProvider=g=f([_(0,m.IBufferService),_(1,m.IOptionsService),_(2,m.IOscLinkService)],g)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,_){this._rowCount=_,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=c(3614),_=c(3656),h=c(3551),m=c(9042),g=c(3730),S=c(1680),k=c(3107),v=c(5744),b=c(2950),w=c(1296),y=c(428),C=c(4269),z=c(5114),N=c(8934),T=c(3230),j=c(9312),D=c(4725),I=c(6731),L=c(8055),U=c(8969),q=c(8460),W=c(844),Z=c(6114),X=c(8437),J=c(2584),ee=c(7399),$=c(5941),B=c(9074),H=c(2585),K=c(5435),G=c(4567),ie=c(779);class ve extends U.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(re={}){super(re),this.browser=Z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.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(B.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,oe)=>this.refresh(P,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,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((P=>this._afterResize(P.cols,P.rows)))),this.register((0,W.toDisposable)((()=>{var P,oe;this._customKeyEventHandler=void 0,(oe=(P=this.element)==null?void 0:P.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(re){if(this._themeService)for(const P of re){let oe,ue="";switch(P.index){case 256:oe="foreground",ue="10";break;case 257:oe="background",ue="11";break;case 258:oe="cursor",ue="12";break;default:oe="ansi",ue="4;"+P.index}switch(P.type){case 0:const de=L.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${ue};${(0,$.toRgbString)(de)}${J.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ge=>ge.ansi[P.index]=L.channels.toColor(...P.color)));else{const ge=oe;this._themeService.modifyColors((Ee=>Ee[ge]=L.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(re){re?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(re){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var re;return(re=this.textarea)==null?void 0:re.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 re=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(re);if(!P)return;const oe=Math.min(this.buffer.x,this.cols-1),ue=this._renderService.dimensions.css.cell.height,de=P.getWidth(oe),ge=this._renderService.dimensions.css.cell.width*de,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Ae=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ae+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ge+"px",this.textarea.style.height=ue+"px",this.textarea.style.lineHeight=ue+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,f.copyHandler)(P,this._selectionService)})));const re=P=>(0,f.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",re)),this.register((0,_.addDisposableDomListener)(this.element,"paste",re)),Z.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Z.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,f.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(re=>this._keyUp(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(re=>this._keyDown(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(re=>this._keyPress(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(re=>this._compositionHelper.compositionupdate(re)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(re=>this._inputEvent(re)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(re){var oe;if(!re)throw new Error("Terminal requires a parent element.");if(re.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=re.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"),re.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(ue=>this.updateCursorStyle(ue)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),Z.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,re.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ue=>this._handleTextAreaFocus(ue)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ue=>this._onRender.fire(ue)))),this.onResize((ue=>this._renderService.resize(ue.cols,ue.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(N.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.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(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ue=>this._renderService.handleSelectionChanged(ue.start,ue.end,ue.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ue=>{this.textarea.value=ue,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ue=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ue=>this._selectionService.handleMouseDown(ue)))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ue=>this._handleScreenReaderModeOptionChange(ue)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ue=>{!this._overviewRulerRenderer&&ue&&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 re=this,P=this.element;function oe(ge){const Ee=re._mouseService.getMouseReportCoords(ge,re.screenElement);if(!Ee)return!1;let Ae,He;switch(ge.overrideType||ge.type){case"mousemove":He=32,ge.buttons===void 0?(Ae=3,ge.button!==void 0&&(Ae=ge.button<3?ge.button:3)):Ae=1&ge.buttons?0:4&ge.buttons?1:2&ge.buttons?2:3;break;case"mouseup":He=0,Ae=ge.button<3?ge.button:3;break;case"mousedown":He=1,Ae=ge.button<3?ge.button:3;break;case"wheel":if(re._customWheelEventHandler&&re._customWheelEventHandler(ge)===!1||re.viewport.getLinesScrolled(ge)===0)return!1;He=ge.deltaY<0?0:1,Ae=4;break;default:return!1}return!(He===void 0||Ae===void 0||Ae>4)&&re.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Ae,action:He,ctrl:ge.ctrlKey,alt:ge.altKey,shift:ge.shiftKey})}const ue={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ge=>(oe(ge),ge.buttons||(this._document.removeEventListener("mouseup",ue.mouseup),ue.mousedrag&&this._document.removeEventListener("mousemove",ue.mousedrag)),this.cancel(ge)),wheel:ge=>(oe(ge),this.cancel(ge,!0)),mousedrag:ge=>{ge.buttons&&oe(ge)},mousemove:ge=>{ge.buttons||oe(ge)}};this.register(this.coreMouseService.onProtocolChange((ge=>{ge?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ge)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ge?ue.mousemove||(P.addEventListener("mousemove",de.mousemove),ue.mousemove=de.mousemove):(P.removeEventListener("mousemove",ue.mousemove),ue.mousemove=null),16&ge?ue.wheel||(P.addEventListener("wheel",de.wheel,{passive:!1}),ue.wheel=de.wheel):(P.removeEventListener("wheel",ue.wheel),ue.wheel=null),2&ge?ue.mouseup||(ue.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ue.mouseup),ue.mouseup=null),4&ge?ue.mousedrag||(ue.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ue.mousedrag),ue.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(P,"mousedown",(ge=>{if(ge.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ge))return oe(ge),ue.mouseup&&this._document.addEventListener("mouseup",ue.mouseup),ue.mousedrag&&this._document.addEventListener("mousemove",ue.mousedrag),this.cancel(ge)}))),this.register((0,_.addDisposableDomListener)(P,"wheel",(ge=>{if(!ue.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ge)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ge);if(Ee===0)return;const Ae=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ge.deltaY<0?"A":"B");let He="";for(let Re=0;Re{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ge),this.cancel(ge)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(P,"touchmove",(ge=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ge)?void 0:this.cancel(ge)}),{passive:!1}))}refresh(re,P){var oe;(oe=this._renderService)==null||oe.refreshRows(re,P)}updateCursorStyle(re){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(re)?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(re,P,oe=0){var ue;oe===1?(super.scrollLines(re,P,oe),this.refresh(0,this.rows-1)):(ue=this.viewport)==null||ue.scrollLines(re)}paste(re){(0,f.paste)(re,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(re){this._customKeyEventHandler=re}attachCustomWheelEventHandler(re){this._customWheelEventHandler=re}registerLinkProvider(re){return this._linkProviderService.registerLinkProvider(re)}registerCharacterJoiner(re){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(re);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(re){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(re)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(re){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+re)}registerDecoration(re){return this._decorationService.registerDecoration(re)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(re,P,oe){this._selectionService.setSelection(re,P,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 re;(re=this._selectionService)==null||re.clearSelection()}selectAll(){var re;(re=this._selectionService)==null||re.selectAll()}selectLines(re,P){var oe;(oe=this._selectionService)==null||oe.selectLines(re,P)}_keyDown(re){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&re.altKey;if(!P&&!this._compositionHelper.keydown(re))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||re.key!=="Dead"&&re.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,ee.evaluateKeyboardEvent)(re,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(re),oe.type===3||oe.type===2){const ue=this.rows-1;return this.scrollLines(oe.type===2?-ue:ue),this.cancel(re,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,re)||(oe.cancel&&this.cancel(re,!0),!oe.key||!!(re.key&&!re.ctrlKey&&!re.altKey&&!re.metaKey&&re.key.length===1&&re.key.charCodeAt(0)>=65&&re.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:re}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||re.altKey||re.ctrlKey?this.cancel(re,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(re,P){const oe=re.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||re.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||re.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?oe:oe&&(!P.keyCode||P.keyCode>47)}_keyUp(re){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(re)||this.focus(),this.updateCursorStyle(re),this._keyPressHandled=!1)}_keyPress(re){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1)return!1;if(this.cancel(re),re.charCode)P=re.charCode;else if(re.which===null||re.which===void 0)P=re.keyCode;else{if(re.which===0||re.charCode===0)return!1;P=re.which}return!(!P||(re.altKey||re.ctrlKey||re.metaKey)&&!this._isThirdLevelShift(this.browser,re)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:re}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(re){if(re.data&&re.inputType==="insertText"&&(!re.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=re.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(re),!0}return!1}resize(re,P){re!==this.cols||P!==this.rows?super.resize(re,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(re,P){var oe,ue;(oe=this._charSizeService)==null||oe.measure(),(ue=this.viewport)==null||ue.syncScrollArea(!0)}clear(){var re;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,_){this._rowCount=_,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=h-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=c(3656),m=c(4725),g=c(8460),S=c(844),k=c(2585);let v=l.Viewport=class extends S.Disposable{constructor(b,w,y,C,z,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=z,this._renderService=N,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((D=>this._handleThemeChange(D)))),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=U),C=""}}return{bufferElements:z,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))}};l.Viewport=v=f([_(2,k.IBufferService),_(3,k.IOptionsService),_(4,m.ICharSizeService),_(5,m.IRenderService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],v)},3107:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=c(4725),m=c(844),g=c(2585);let S=l.BufferDecorationRenderer=class extends m.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,m.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()}};l.BufferDecorationRenderer=S=f([_(1,g.IBufferService),_(2,h.ICoreBrowserService),_(3,g.IDecorationService),_(4,h.IRenderService)],S)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,_){return f>=c.startBufferLine-this._linePadding[_||"full"]&&f<=c.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(o,l,c){var f=this&&this.__decorate||function(y,C,z,N){var T,j=arguments.length,D=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,z):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,z,N);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(D=(j<3?T(D):j>3?T(C,z,D):T(C,z))||D);return j>3&&D&&Object.defineProperty(C,z,D),D},_=this&&this.__param||function(y,C){return function(z,N){C(z,N,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=c(5871),m=c(4725),g=c(844),S=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=l.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,z,N,T,j,D){var L;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=z,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=D,this._colorZoneStore=new h.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(),(L=this._viewportElement.parentElement)==null||L.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var U;(U=this._canvas)==null||U.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})))}};l.OverviewRulerRenderer=w=f([_(2,S.IBufferService),_(3,S.IDecorationService),_(4,m.IRenderService),_(5,S.IOptionsService),_(6,m.ICoreBrowserService)],w)},2950:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=c(4725),m=c(2585),g=c(2584);let S=l.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)}}};l.CompositionHelper=S=f([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,m.ICoreService),_(5,h.IRenderService)],S)},9806:(o,l)=>{function c(f,_,h){const m=h.getBoundingClientRect(),g=f.getComputedStyle(h),S=parseInt(g.getPropertyValue("padding-left")),k=parseInt(g.getPropertyValue("padding-top"));return[_.clientX-m.left-S,_.clientY-m.top-k]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(f,_,h,m,g,S,k,v,b){if(!S)return;const w=c(f,_,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),m+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),g),w):void 0}},9504:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=c(2584);function _(v,b,w,y){const C=v-h(v,w),z=b-h(b,w),N=Math.abs(C-z)-(function(T,j,D){let I=0;const L=T-h(T,D),U=j-h(j,D);for(let q=0;q=0&&vb?"A":"B"}function g(v,b,w,y,C,z){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>z.cols-1?(j+=z.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=z.buffer.translateBufferLineToString(T,!1,0,v+1),N=z.cols-1,v=N,T--);return j+z.buffer.translateBufferLineToString(T,!1,v,N)}function S(v,b){const w=b?"O":"[";return f.C0.ESC+w+v}function k(v,b){v=Math.floor(v);let w="";for(let y=0;y0?L-h(L,U):D;const Z=L,X=(function(J,ee,$,B,H,K){let G;return G=_($,B,H,K).length>0?B-h(B,H):ee,J<$&&G<=B||J>=$&&Gv?"D":"C",k(Math.abs(C-v),S(N,y));N=z>b?"D":"C";const T=Math.abs(z-b);return k((function(j,D){return D.cols-j})(z>b?v:C,w)+(T-1)*w.cols+1+((z>b?C:v)-1),S(N,y))}},1296:function(o,l,c){var f=this&&this.__decorate||function(q,W,Z,X){var J,ee=arguments.length,$=ee<3?W:X===null?X=Object.getOwnPropertyDescriptor(W,Z):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(q,W,Z,X);else for(var B=q.length-1;B>=0;B--)(J=q[B])&&($=(ee<3?J($):ee>3?J(W,Z,$):J(W,Z))||$);return ee>3&&$&&Object.defineProperty(W,Z,$),$},_=this&&this.__param||function(q,W){return function(Z,X){W(Z,X,q)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=c(3787),m=c(2550),g=c(2223),S=c(6171),k=c(6052),v=c(4725),b=c(8055),w=c(8460),y=c(844),C=c(2585),z="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",D="xterm-focus",I="xterm-selection";let L=1,U=l.DomRenderer=class extends y.Disposable{constructor(q,W,Z,X,J,ee,$,B,H,K,G,ie,ve){super(),this._terminal=q,this._document=W,this._element=Z,this._screenElement=X,this._viewportElement=J,this._helperContainer=ee,this._linkifier2=$,this._charSizeService=H,this._optionsService=K,this._bufferService=G,this._coreBrowserService=ie,this._themeService=ve,this._terminalClass=L++,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(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(z+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),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 m.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 Z of this._rowElements)Z.style.width=`${this.dimensions.css.canvas.width}px`,Z.style.height=`${this.dimensions.css.cell.height}px`,Z.style.lineHeight=`${this.dimensions.css.cell.height}px`,Z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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 W=`${this._terminalSelector} .${N} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,W+=`${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 Z=`blink_underline_${this._terminalClass}`,X=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;W+=`@keyframes ${Z} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${X} { 50% { box-shadow: none; }}`,W+=`@keyframes ${J} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,W+=`${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,$]of q.ansi.entries())W+=`${this._terminalSelector} .${T}${ee} { color: ${$.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${b.color.multiplyOpacity($,.5).css}; }${this._terminalSelector} .${j}${ee} { background-color: ${$.css}; }`;W+=`${this._terminalSelector} .${T}${g.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${g.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=W}_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,W){for(let Z=this._rowElements.length;Z<=W;Z++){const X=this._document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,W){this._refreshRowElements(q,W),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,W,Z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,W,Z),this.renderRows(0,this._bufferService.rows-1),!q||!W)return;this._selectionRenderModel.update(this._terminal,q,W,Z);const X=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,$=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||$<0)return;const B=this._document.createDocumentFragment();if(Z){const H=q[0]>W[0];B.appendChild(this._createSelectionElement(ee,H?W[0]:q[0],H?q[0]:W[0],$-ee+1))}else{const H=X===ee?q[0]:0,K=ee===J?W[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(ee,H,K));const G=$-ee-1;if(B.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,G)),ee!==$){const ie=J===$?W[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement($,0,ie))}}this._selectionContainer.appendChild(B)}_createSelectionElement(q,W,Z,X=1){const J=this._document.createElement("div"),ee=W*this.dimensions.css.cell.width;let $=this.dimensions.css.cell.width*(Z-W);return ee+$>this.dimensions.css.canvas.width&&($=this.dimensions.css.canvas.width-ee),J.style.height=X*this.dimensions.css.cell.height+"px",J.style.top=q*this.dimensions.css.cell.height+"px",J.style.left=`${ee}px`,J.style.width=`${$}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,W){const Z=this._bufferService.buffer,X=Z.ybase+Z.y,J=Math.min(Z.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=q;H<=W;H++){const K=H+Z.ydisp,G=this._rowElements[H],ie=Z.lines.get(K);if(!G||!ie)break;G.replaceChildren(...this._rowFactory.createRow(ie,K,K===X,$,B,J,ee,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,W,Z,X,J,ee){Z<0&&(q=0),X<0&&(W=0);const $=this._bufferService.rows-1;Z=Math.max(Math.min(Z,$),0),X=Math.max(Math.min(X,$),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,H=B.ybase+B.y,K=Math.min(B.x,J-1),G=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=Z;ce<=X;++ce){const re=ce+B.ydisp,P=this._rowElements[ce],oe=B.lines.get(re);if(!P||!oe)break;P.replaceChildren(...this._rowFactory.createRow(oe,re,re===H,ie,ve,K,G,this.dimensions.css.cell.width,this._widthCache,ee?ce===Z?q:0:-1,ee?(ce===X?W:J)-1:-1))}}};l.DomRenderer=U=f([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],U)},3787:function(o,l,c){var f=this&&this.__decorate||function(N,T,j,D){var I,L=arguments.length,U=L<3?T:D===null?D=Object.getOwnPropertyDescriptor(T,j):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(N,T,j,D);else for(var q=N.length-1;q>=0;q--)(I=N[q])&&(U=(L<3?I(U):L>3?I(T,j,U):I(T,j))||U);return L>3&&U&&Object.defineProperty(T,j,U),U},_=this&&this.__param||function(N,T){return function(j,D){T(j,D,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=c(2223),m=c(643),g=c(511),S=c(2585),k=c(8055),v=c(4725),b=c(4269),w=c(6171),y=c(3734);let C=l.DomRendererRowFactory=class{constructor(N,T,j,D,I,L,U){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=D,this._coreService=I,this._decorationService=L,this._themeService=U,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,D,I,L,U,q,W,Z,X){const J=[],ee=this._characterJoinerService.getJoinedCharacters(T),$=this._themeService.colors;let B,H=N.getNoBgTrimmedLength();j&&H0&&Ee===ee[0][0]){He=!0;const vt=ee.shift();Ie=new b.JoinedCellData(this._workCell,N.translateToString(!0,vt[0],vt[1]),vt[1]-vt[0]),Re=vt[1]-1,Ae=Ie.getWidth()}const nt=this._isCellInSelection(Ee,T),Rt=j&&Ee===L,At=ge&&Ee>=Z&&Ee<=X;let bt=!1;this._decorationService.forEachDecorationAtCell(Ee,T,void 0,(vt=>{bt=!0}));let Mt=Ie.getChars()||m.WHITESPACE_CELL_CHAR;if(Mt===" "&&(Ie.isUnderline()||Ie.isOverline())&&(Mt=" "),ue=Ae*q-W.get(Mt,Ie.isBold(),Ie.isItalic()),B){if(K&&(nt&&oe||!nt&&!oe&&Ie.bg===ie)&&(nt&&oe&&$.selectionForeground||Ie.fg===ve)&&Ie.extended.ext===ce&&At===re&&ue===P&&!Rt&&!He&&!bt){Ie.isInvisible()?G+=m.WHITESPACE_CELL_CHAR:G+=Mt,K++;continue}K&&(B.textContent=G),B=this._document.createElement("span"),K=0,G=""}else B=this._document.createElement("span");if(ie=Ie.bg,ve=Ie.fg,ce=Ie.extended.ext,re=At,P=ue,oe=nt,He&&L>=Ee&&L<=Re&&(L=Ee),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&de.push("xterm-cursor-blink"),de.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(Ie.isBold()&&de.push("xterm-bold"),Ie.isItalic()&&de.push("xterm-italic"),Ie.isDim()&&de.push("xterm-dim"),G=Ie.isInvisible()?m.WHITESPACE_CELL_CHAR:Ie.getChars()||m.WHITESPACE_CELL_CHAR,Ie.isUnderline()&&(de.push(`xterm-underline-${Ie.extended.underlineStyle}`),G===" "&&(G=" "),!Ie.isUnderlineColorDefault()))if(Ie.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ie.getUnderlineColor()).join(",")})`;else{let vt=Ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ie.isBold()&&vt<8&&(vt+=8),B.style.textDecorationColor=$.ansi[vt].css}Ie.isOverline()&&(de.push("xterm-overline"),G===" "&&(G=" ")),Ie.isStrikethrough()&&de.push("xterm-strikethrough"),At&&(B.style.textDecoration="underline");let Ct=Ie.getFgColor(),ut=Ie.getFgColorMode(),ht=Ie.getBgColor(),we=Ie.getBgColorMode();const Le=!!Ie.isInverse();if(Le){const vt=Ct;Ct=ht,ht=vt;const It=ut;ut=we,we=It}let Ge,et,st,Dt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,T,void 0,(vt=>{vt.options.layer!=="top"&&Dt||(vt.backgroundColorRGB&&(we=50331648,ht=vt.backgroundColorRGB.rgba>>8&16777215,Ge=vt.backgroundColorRGB),vt.foregroundColorRGB&&(ut=50331648,Ct=vt.foregroundColorRGB.rgba>>8&16777215,et=vt.foregroundColorRGB),Dt=vt.options.layer==="top")})),!Dt&&nt&&(Ge=this._coreBrowserService.isFocused?$.selectionBackgroundOpaque:$.selectionInactiveBackgroundOpaque,ht=Ge.rgba>>8&16777215,we=50331648,Dt=!0,$.selectionForeground&&(ut=50331648,Ct=$.selectionForeground.rgba>>8&16777215,et=$.selectionForeground)),Dt&&de.push("xterm-decoration-top"),we){case 16777216:case 33554432:st=$.ansi[ht],de.push(`xterm-bg-${ht}`);break;case 50331648:st=k.channels.toColor(ht>>16,ht>>8&255,255&ht),this._addStyle(B,`background-color:#${z((ht>>>0).toString(16),"0",6)}`);break;default:Le?(st=$.foreground,de.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):st=$.background}switch(Ge||Ie.isDim()&&(Ge=k.color.multiplyOpacity(st,.5)),ut){case 16777216:case 33554432:Ie.isBold()&&Ct<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ct+=8),this._applyMinimumContrast(B,st,$.ansi[Ct],Ie,Ge,void 0)||de.push(`xterm-fg-${Ct}`);break;case 50331648:const vt=k.channels.toColor(Ct>>16&255,Ct>>8&255,255&Ct);this._applyMinimumContrast(B,st,vt,Ie,Ge,et)||this._addStyle(B,`color:#${z(Ct.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,st,$.foreground,Ie,Ge,et)||Le&&de.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}de.length&&(B.className=de.join(" "),de.length=0),Rt||He||bt?B.textContent=G:K++,ue!==this.defaultSpacing&&(B.style.letterSpacing=`${ue}px`),J.push(B),Ee=Re}return B&&K&&(B.textContent=G),J}_applyMinimumContrast(N,T,j,D,I,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const U=this._getContrastCache(D);let q;if(I||L||(q=U.getColor(T.rgba,j.rgba)),q===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);q=k.color.ensureContrastRatio(I||T,L||j,W),U.setColor((I||T).rgba,(L||j).rgba,q??null)}return!!q&&(this._addStyle(N,`color:${q.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,D=this._selectionEnd;return!(!j||!D)&&(this._columnSelectMode?j[0]<=D[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=D[0]&&T<=D[1]:T>j[1]&&T=j[0]&&N=j[0])}};function z(N,T,j){for(;N.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=c.createElement("span");_.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[_,h,m,g],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(m),this._container.appendChild(g),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,_,h){c===this._font&&f===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=f,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,f,_){let h=0;if(!f&&!_&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const S=this._measure(c,0);return S>0&&(this._flat[h]=S),S}let m=c;f&&(m+="B"),_&&(m+="I");let g=this._holey.get(m);if(g===void 0){let S=0;f&&(S|=1),_&&(S|=2),g=this._measure(c,S),g>0&&this._holey.set(m,g)}return g}_measure(c,f){const _=this._measureElements[f];return _.textContent=c.repeat(32),_.offsetWidth/32}}},2223:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function c(_){return 57508<=_&&_<=57558}function f(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},l.isEmoji=f,l.allowRescaling=function(_,h,m,g){return h===1&&m>Math.ceil(1.5*g)&&_!==void 0&&_>255&&!f(_)&&!c(_)&&!(function(S){return 57344<=S&&S<=63743})(_)},l.treatGlyphAsBackgroundColor=function(_){return c(_)||(function(h){return 9472<=h&&h<=9631})(_)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(_,h,m=0){return(_-(2*Math.round(h)-m))%(2*Math.round(h))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,m,g=!1){if(this.selectionStart=h,this.selectionEnd=m,!h||!m||h[0]===m[0]&&h[1]===m[1])return void this.clear();const S=_.buffers.active.ydisp,k=h[1]-S,v=m[1]-S,b=Math.max(k,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=k,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=h[0],this.endCol=m[0])}isCellSelected(_,h,m){return!!this.hasSelection&&(m-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&m>=this.viewportCappedStartRow&&h=this.viewportCappedStartRow&&h>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m=this.startCol&&h=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=c(2585),m=c(8460),g=c(844);let S=l.CharSizeService=class extends g.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 m.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())}};l.CharSizeService=S=f([_(2,h.IOptionsService)],S);class k extends g.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(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=c(3734),m=c(643),g=c(511),S=c(2585);class k extends h.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=k;let v=l.CharacterJoinerService=class Ij{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.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 U=this._getJoinedRanges(z,j,T,y,N);for(let q=0;q1){const L=this._getJoinedRanges(z,j,T,y,N);for(let U=0;U{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=c(844),_=c(8460),h=c(3656);class m extends f.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 g(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(k){this._window!==k&&(this._window=k,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=m;class g extends f.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var k;this._outerListener&&((k=this._resolutionMediaMatchList)==null||k.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=c(844);class _ extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const g=this.linkProviders.indexOf(m);g!==-1&&this.linkProviders.splice(g,1)}}}}l.LinkProviderService=_},8934:function(o,l,c){var f=this&&this.__decorate||function(S,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(S,k,v,b);else for(var z=S.length-1;z>=0;z--)(w=S[z])&&(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},_=this&&this.__param||function(S,k){return function(v,b){k(v,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=c(4725),m=c(9806);let g=l.MouseService=class{constructor(S,k){this._renderService=S,this._charSizeService=k}getCoords(S,k,v,b,w){return(0,m.getCoords)(window,S,k,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(S,k){const v=(0,m.getCoordsRelativeToElement)(window,S,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])}}};l.MouseService=g=f([_(0,h.IRenderService),_(1,h.ICharSizeService)],g)},3230:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=c(6193),m=c(4725),g=c(8460),S=c(844),k=c(7226),v=c(2585);let b=l.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,z,N,T,j,D){super(),this._rowCount=w,this._charSizeService=z,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new S.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((I,L)=>this._renderRows(I,L)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.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(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((z=>this._handleIntersectionChange(z[z.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,S.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var z;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(z=this._renderer.value)==null||z.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=b=f([_(2,v.IOptionsService),_(3,m.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],b)},9312:function(o,l,c){var f=this&&this.__decorate||function(j,D,I,L){var U,q=arguments.length,W=q<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,I):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(j,D,I,L);else for(var Z=j.length-1;Z>=0;Z--)(U=j[Z])&&(W=(q<3?U(W):q>3?U(D,I,W):U(D,I))||W);return q>3&&W&&Object.defineProperty(D,I,W),W},_=this&&this.__param||function(j,D){return function(I,L){D(I,L,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=c(9806),m=c(9504),g=c(456),S=c(4725),k=c(8460),v=c(844),b=c(6114),w=c(4841),y=c(511),C=c(2585),z=" ",N=new RegExp(z,"g");let T=l.SelectionService=class extends v.Disposable{constructor(j,D,I,L,U,q,W,Z,X){super(),this._element=j,this._screenElement=D,this._linkifier=I,this._bufferService=L,this._coreService=U,this._mouseService=q,this._optionsService=W,this._renderService=Z,this._coreBrowserService=X,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 g.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,D=this._model.finalSelectionEnd;return!(!j||!D||j[0]===D[0]&&j[1]===D[1])}get selectionText(){const j=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!j||!D)return"";const I=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(j[0]===D[0])return"";const U=j[0]U.replace(N," "))).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")}}l.OscLinkProvider=g=f([_(0,m.IBufferService),_(1,m.IOptionsService),_(2,m.IOscLinkService)],g)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,_){this._rowCount=_,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=c(3614),_=c(3656),d=c(3551),m=c(9042),g=c(3730),S=c(1680),k=c(3107),v=c(5744),b=c(2950),w=c(1296),y=c(428),C=c(4269),z=c(5114),N=c(8934),T=c(3230),j=c(9312),D=c(4725),I=c(6731),L=c(8055),P=c(8969),q=c(8460),W=c(844),Z=c(6114),X=c(8437),J=c(2584),ee=c(7399),$=c(5941),B=c(9074),H=c(2585),K=c(5435),G=c(4567),ie=c(779);class ve extends P.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(re={}){super(re),this.browser=Z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.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(B.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,oe)=>this.refresh(F,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),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((F=>this._afterResize(F.cols,F.rows)))),this.register((0,W.toDisposable)((()=>{var F,oe;this._customKeyEventHandler=void 0,(oe=(F=this.element)==null?void 0:F.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(re){if(this._themeService)for(const F of re){let oe,ue="";switch(F.index){case 256:oe="foreground",ue="10";break;case 257:oe="background",ue="11";break;case 258:oe="cursor",ue="12";break;default:oe="ansi",ue="4;"+F.index}switch(F.type){case 0:const he=L.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${ue};${(0,$.toRgbString)(he)}${J.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((me=>me.ansi[F.index]=L.channels.toColor(...F.color)));else{const me=oe;this._themeService.modifyColors((Ee=>Ee[me]=L.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(re){re?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(re){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var re;return(re=this.textarea)==null?void 0:re.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 re=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(re);if(!F)return;const oe=Math.min(this.buffer.x,this.cols-1),ue=this._renderService.dimensions.css.cell.height,he=F.getWidth(oe),me=this._renderService.dimensions.css.cell.width*he,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=me+"px",this.textarea.style.height=ue+"px",this.textarea.style.lineHeight=ue+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(F=>{this.hasSelection()&&(0,f.copyHandler)(F,this._selectionService)})));const re=F=>(0,f.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",re)),this.register((0,_.addDisposableDomListener)(this.element,"paste",re)),Z.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Z.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,f.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(re=>this._keyUp(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(re=>this._keyDown(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(re=>this._keyPress(re)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(re=>this._compositionHelper.compositionupdate(re)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(re=>this._inputEvent(re)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(re){var oe;if(!re)throw new Error("Terminal requires a parent element.");if(re.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=re.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"),re.appendChild(this.element);const F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.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,_.addDisposableDomListener)(this.screenElement,"mousemove",(ue=>this.updateCursorStyle(ue)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),Z.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,re.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ue=>this._handleTextAreaFocus(ue)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ue=>this._onRender.fire(ue)))),this.onResize((ue=>this._renderService.resize(ue.cols,ue.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(N.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(F);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.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(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ue=>this._renderService.handleSelectionChanged(ue.start,ue.end,ue.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ue=>{this.textarea.value=ue,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ue=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ue=>this._selectionService.handleMouseDown(ue)))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ue=>this._handleScreenReaderModeOptionChange(ue)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ue=>{!this._overviewRulerRenderer&&ue&&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 re=this,F=this.element;function oe(me){const Ee=re._mouseService.getMouseReportCoords(me,re.screenElement);if(!Ee)return!1;let Re,He;switch(me.overrideType||me.type){case"mousemove":He=32,me.buttons===void 0?(Re=3,me.button!==void 0&&(Re=me.button<3?me.button:3)):Re=1&me.buttons?0:4&me.buttons?1:2&me.buttons?2:3;break;case"mouseup":He=0,Re=me.button<3?me.button:3;break;case"mousedown":He=1,Re=me.button<3?me.button:3;break;case"wheel":if(re._customWheelEventHandler&&re._customWheelEventHandler(me)===!1||re.viewport.getLinesScrolled(me)===0)return!1;He=me.deltaY<0?0:1,Re=4;break;default:return!1}return!(He===void 0||Re===void 0||Re>4)&&re.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Re,action:He,ctrl:me.ctrlKey,alt:me.altKey,shift:me.shiftKey})}const ue={mouseup:null,wheel:null,mousedrag:null,mousemove:null},he={mouseup:me=>(oe(me),me.buttons||(this._document.removeEventListener("mouseup",ue.mouseup),ue.mousedrag&&this._document.removeEventListener("mousemove",ue.mousedrag)),this.cancel(me)),wheel:me=>(oe(me),this.cancel(me,!0)),mousedrag:me=>{me.buttons&&oe(me)},mousemove:me=>{me.buttons||oe(me)}};this.register(this.coreMouseService.onProtocolChange((me=>{me?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(me)),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&me?ue.mousemove||(F.addEventListener("mousemove",he.mousemove),ue.mousemove=he.mousemove):(F.removeEventListener("mousemove",ue.mousemove),ue.mousemove=null),16&me?ue.wheel||(F.addEventListener("wheel",he.wheel,{passive:!1}),ue.wheel=he.wheel):(F.removeEventListener("wheel",ue.wheel),ue.wheel=null),2&me?ue.mouseup||(ue.mouseup=he.mouseup):(this._document.removeEventListener("mouseup",ue.mouseup),ue.mouseup=null),4&me?ue.mousedrag||(ue.mousedrag=he.mousedrag):(this._document.removeEventListener("mousemove",ue.mousedrag),ue.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(F,"mousedown",(me=>{if(me.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(me))return oe(me),ue.mouseup&&this._document.addEventListener("mouseup",ue.mouseup),ue.mousedrag&&this._document.addEventListener("mousemove",ue.mousedrag),this.cancel(me)}))),this.register((0,_.addDisposableDomListener)(F,"wheel",(me=>{if(!ue.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(me)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(me);if(Ee===0)return;const Re=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(me.deltaY<0?"A":"B");let He="";for(let Te=0;Te{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(me),this.cancel(me)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(F,"touchmove",(me=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(me)?void 0:this.cancel(me)}),{passive:!1}))}refresh(re,F){var oe;(oe=this._renderService)==null||oe.refreshRows(re,F)}updateCursorStyle(re){var F;(F=this._selectionService)!=null&&F.shouldColumnSelect(re)?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(re,F,oe=0){var ue;oe===1?(super.scrollLines(re,F,oe),this.refresh(0,this.rows-1)):(ue=this.viewport)==null||ue.scrollLines(re)}paste(re){(0,f.paste)(re,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(re){this._customKeyEventHandler=re}attachCustomWheelEventHandler(re){this._customWheelEventHandler=re}registerLinkProvider(re){return this._linkProviderService.registerLinkProvider(re)}registerCharacterJoiner(re){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(re);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(re){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(re)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(re){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+re)}registerDecoration(re){return this._decorationService.registerDecoration(re)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(re,F,oe){this._selectionService.setSelection(re,F,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 re;(re=this._selectionService)==null||re.clearSelection()}selectAll(){var re;(re=this._selectionService)==null||re.selectAll()}selectLines(re,F){var oe;(oe=this._selectionService)==null||oe.selectLines(re,F)}_keyDown(re){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&re.altKey;if(!F&&!this._compositionHelper.keydown(re))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||re.key!=="Dead"&&re.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,ee.evaluateKeyboardEvent)(re,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(re),oe.type===3||oe.type===2){const ue=this.rows-1;return this.scrollLines(oe.type===2?-ue:ue),this.cancel(re,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,re)||(oe.cancel&&this.cancel(re,!0),!oe.key||!!(re.key&&!re.ctrlKey&&!re.altKey&&!re.metaKey&&re.key.length===1&&re.key.charCodeAt(0)>=65&&re.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:re}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||re.altKey||re.ctrlKey?this.cancel(re,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(re,F){const oe=re.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||re.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||re.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?oe:oe&&(!F.keyCode||F.keyCode>47)}_keyUp(re){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(re)||this.focus(),this.updateCursorStyle(re),this._keyPressHandled=!1)}_keyPress(re){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(re)===!1)return!1;if(this.cancel(re),re.charCode)F=re.charCode;else if(re.which===null||re.which===void 0)F=re.keyCode;else{if(re.which===0||re.charCode===0)return!1;F=re.which}return!(!F||(re.altKey||re.ctrlKey||re.metaKey)&&!this._isThirdLevelShift(this.browser,re)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:re}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(re){if(re.data&&re.inputType==="insertText"&&(!re.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=re.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(re),!0}return!1}resize(re,F){re!==this.cols||F!==this.rows?super.resize(re,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(re,F){var oe,ue;(oe=this._charSizeService)==null||oe.measure(),(ue=this.viewport)==null||ue.syncScrollArea(!0)}clear(){var re;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 F=1;F{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,_){this._rowCount=_,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=d-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=c(3656),m=c(4725),g=c(8460),S=c(844),k=c(2585);let v=l.Viewport=class extends S.Disposable{constructor(b,w,y,C,z,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=z,this._renderService=N,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((D=>this._handleThemeChange(D)))),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=P),C=""}}return{bufferElements:z,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))}};l.Viewport=v=f([_(2,k.IBufferService),_(3,k.IOptionsService),_(4,m.ICharSizeService),_(5,m.IRenderService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],v)},3107:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=c(4725),m=c(844),g=c(2585);let S=l.BufferDecorationRenderer=class extends m.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,m.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()}};l.BufferDecorationRenderer=S=f([_(1,g.IBufferService),_(2,d.ICoreBrowserService),_(3,g.IDecorationService),_(4,d.IRenderService)],S)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,_){return f>=c.startBufferLine-this._linePadding[_||"full"]&&f<=c.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(o,l,c){var f=this&&this.__decorate||function(y,C,z,N){var T,j=arguments.length,D=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,z):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,z,N);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(D=(j<3?T(D):j>3?T(C,z,D):T(C,z))||D);return j>3&&D&&Object.defineProperty(C,z,D),D},_=this&&this.__param||function(y,C){return function(z,N){C(z,N,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=c(5871),m=c(4725),g=c(844),S=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=l.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,z,N,T,j,D){var L;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=z,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=D,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)==null||L.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var P;(P=this._canvas)==null||P.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})))}};l.OverviewRulerRenderer=w=f([_(2,S.IBufferService),_(3,S.IDecorationService),_(4,m.IRenderService),_(5,S.IOptionsService),_(6,m.ICoreBrowserService)],w)},2950:function(o,l,c){var f=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,z=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,w);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(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},_=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=c(4725),m=c(2585),g=c(2584);let S=l.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)}}};l.CompositionHelper=S=f([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,m.ICoreService),_(5,d.IRenderService)],S)},9806:(o,l)=>{function c(f,_,d){const m=d.getBoundingClientRect(),g=f.getComputedStyle(d),S=parseInt(g.getPropertyValue("padding-left")),k=parseInt(g.getPropertyValue("padding-top"));return[_.clientX-m.left-S,_.clientY-m.top-k]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(f,_,d,m,g,S,k,v,b){if(!S)return;const w=c(f,_,d);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),m+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),g),w):void 0}},9504:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=c(2584);function _(v,b,w,y){const C=v-d(v,w),z=b-d(b,w),N=Math.abs(C-z)-(function(T,j,D){let I=0;const L=T-d(T,D),P=j-d(j,D);for(let q=0;q=0&&vb?"A":"B"}function g(v,b,w,y,C,z){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>z.cols-1?(j+=z.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=z.buffer.translateBufferLineToString(T,!1,0,v+1),N=z.cols-1,v=N,T--);return j+z.buffer.translateBufferLineToString(T,!1,v,N)}function S(v,b){const w=b?"O":"[";return f.C0.ESC+w+v}function k(v,b){v=Math.floor(v);let w="";for(let y=0;y0?L-d(L,P):D;const Z=L,X=(function(J,ee,$,B,H,K){let G;return G=_($,B,H,K).length>0?B-d(B,H):ee,J<$&&G<=B||J>=$&&Gv?"D":"C",k(Math.abs(C-v),S(N,y));N=z>b?"D":"C";const T=Math.abs(z-b);return k((function(j,D){return D.cols-j})(z>b?v:C,w)+(T-1)*w.cols+1+((z>b?C:v)-1),S(N,y))}},1296:function(o,l,c){var f=this&&this.__decorate||function(q,W,Z,X){var J,ee=arguments.length,$=ee<3?W:X===null?X=Object.getOwnPropertyDescriptor(W,Z):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(q,W,Z,X);else for(var B=q.length-1;B>=0;B--)(J=q[B])&&($=(ee<3?J($):ee>3?J(W,Z,$):J(W,Z))||$);return ee>3&&$&&Object.defineProperty(W,Z,$),$},_=this&&this.__param||function(q,W){return function(Z,X){W(Z,X,q)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=c(3787),m=c(2550),g=c(2223),S=c(6171),k=c(6052),v=c(4725),b=c(8055),w=c(8460),y=c(844),C=c(2585),z="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",D="xterm-focus",I="xterm-selection";let L=1,P=l.DomRenderer=class extends y.Disposable{constructor(q,W,Z,X,J,ee,$,B,H,K,G,ie,ve){super(),this._terminal=q,this._document=W,this._element=Z,this._screenElement=X,this._viewportElement=J,this._helperContainer=ee,this._linkifier2=$,this._charSizeService=H,this._optionsService=K,this._bufferService=G,this._coreBrowserService=ie,this._themeService=ve,this._terminalClass=L++,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(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(z+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),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 m.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 Z of this._rowElements)Z.style.width=`${this.dimensions.css.canvas.width}px`,Z.style.height=`${this.dimensions.css.cell.height}px`,Z.style.lineHeight=`${this.dimensions.css.cell.height}px`,Z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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 W=`${this._terminalSelector} .${N} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,W+=`${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 Z=`blink_underline_${this._terminalClass}`,X=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;W+=`@keyframes ${Z} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${X} { 50% { box-shadow: none; }}`,W+=`@keyframes ${J} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,W+=`${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,$]of q.ansi.entries())W+=`${this._terminalSelector} .${T}${ee} { color: ${$.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${b.color.multiplyOpacity($,.5).css}; }${this._terminalSelector} .${j}${ee} { background-color: ${$.css}; }`;W+=`${this._terminalSelector} .${T}${g.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${g.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=W}_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,W){for(let Z=this._rowElements.length;Z<=W;Z++){const X=this._document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,W){this._refreshRowElements(q,W),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,W,Z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,W,Z),this.renderRows(0,this._bufferService.rows-1),!q||!W)return;this._selectionRenderModel.update(this._terminal,q,W,Z);const X=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,$=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||$<0)return;const B=this._document.createDocumentFragment();if(Z){const H=q[0]>W[0];B.appendChild(this._createSelectionElement(ee,H?W[0]:q[0],H?q[0]:W[0],$-ee+1))}else{const H=X===ee?q[0]:0,K=ee===J?W[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(ee,H,K));const G=$-ee-1;if(B.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,G)),ee!==$){const ie=J===$?W[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement($,0,ie))}}this._selectionContainer.appendChild(B)}_createSelectionElement(q,W,Z,X=1){const J=this._document.createElement("div"),ee=W*this.dimensions.css.cell.width;let $=this.dimensions.css.cell.width*(Z-W);return ee+$>this.dimensions.css.canvas.width&&($=this.dimensions.css.canvas.width-ee),J.style.height=X*this.dimensions.css.cell.height+"px",J.style.top=q*this.dimensions.css.cell.height+"px",J.style.left=`${ee}px`,J.style.width=`${$}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,W){const Z=this._bufferService.buffer,X=Z.ybase+Z.y,J=Math.min(Z.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=q;H<=W;H++){const K=H+Z.ydisp,G=this._rowElements[H],ie=Z.lines.get(K);if(!G||!ie)break;G.replaceChildren(...this._rowFactory.createRow(ie,K,K===X,$,B,J,ee,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,W,Z,X,J,ee){Z<0&&(q=0),X<0&&(W=0);const $=this._bufferService.rows-1;Z=Math.max(Math.min(Z,$),0),X=Math.max(Math.min(X,$),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,H=B.ybase+B.y,K=Math.min(B.x,J-1),G=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=Z;ce<=X;++ce){const re=ce+B.ydisp,F=this._rowElements[ce],oe=B.lines.get(re);if(!F||!oe)break;F.replaceChildren(...this._rowFactory.createRow(oe,re,re===H,ie,ve,K,G,this.dimensions.css.cell.width,this._widthCache,ee?ce===Z?q:0:-1,ee?(ce===X?W:J)-1:-1))}}};l.DomRenderer=P=f([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],P)},3787:function(o,l,c){var f=this&&this.__decorate||function(N,T,j,D){var I,L=arguments.length,P=L<3?T:D===null?D=Object.getOwnPropertyDescriptor(T,j):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(N,T,j,D);else for(var q=N.length-1;q>=0;q--)(I=N[q])&&(P=(L<3?I(P):L>3?I(T,j,P):I(T,j))||P);return L>3&&P&&Object.defineProperty(T,j,P),P},_=this&&this.__param||function(N,T){return function(j,D){T(j,D,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=c(2223),m=c(643),g=c(511),S=c(2585),k=c(8055),v=c(4725),b=c(4269),w=c(6171),y=c(3734);let C=l.DomRendererRowFactory=class{constructor(N,T,j,D,I,L,P){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=D,this._coreService=I,this._decorationService=L,this._themeService=P,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,D,I,L,P,q,W,Z,X){const J=[],ee=this._characterJoinerService.getJoinedCharacters(T),$=this._themeService.colors;let B,H=N.getNoBgTrimmedLength();j&&H0&&Ee===ee[0][0]){He=!0;const yt=ee.shift();Ie=new b.JoinedCellData(this._workCell,N.translateToString(!0,yt[0],yt[1]),yt[1]-yt[0]),Te=yt[1]-1,Re=Ie.getWidth()}const et=this._isCellInSelection(Ee,T),Tt=j&&Ee===L,zt=me&&Ee>=Z&&Ee<=X;let Wt=!1;this._decorationService.forEachDecorationAtCell(Ee,T,void 0,(yt=>{Wt=!0}));let fn=Ie.getChars()||m.WHITESPACE_CELL_CHAR;if(fn===" "&&(Ie.isUnderline()||Ie.isOverline())&&(fn=" "),ue=Re*q-W.get(fn,Ie.isBold(),Ie.isItalic()),B){if(K&&(et&&oe||!et&&!oe&&Ie.bg===ie)&&(et&&oe&&$.selectionForeground||Ie.fg===ve)&&Ie.extended.ext===ce&&zt===re&&ue===F&&!Tt&&!He&&!Wt){Ie.isInvisible()?G+=m.WHITESPACE_CELL_CHAR:G+=fn,K++;continue}K&&(B.textContent=G),B=this._document.createElement("span"),K=0,G=""}else B=this._document.createElement("span");if(ie=Ie.bg,ve=Ie.fg,ce=Ie.extended.ext,re=zt,F=ue,oe=et,He&&L>=Ee&&L<=Te&&(L=Ee),!this._coreService.isCursorHidden&&Tt&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&he.push("xterm-cursor-blink"),he.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline")}}if(Ie.isBold()&&he.push("xterm-bold"),Ie.isItalic()&&he.push("xterm-italic"),Ie.isDim()&&he.push("xterm-dim"),G=Ie.isInvisible()?m.WHITESPACE_CELL_CHAR:Ie.getChars()||m.WHITESPACE_CELL_CHAR,Ie.isUnderline()&&(he.push(`xterm-underline-${Ie.extended.underlineStyle}`),G===" "&&(G=" "),!Ie.isUnderlineColorDefault()))if(Ie.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ie.getUnderlineColor()).join(",")})`;else{let yt=Ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ie.isBold()&&yt<8&&(yt+=8),B.style.textDecorationColor=$.ansi[yt].css}Ie.isOverline()&&(he.push("xterm-overline"),G===" "&&(G=" ")),Ie.isStrikethrough()&&he.push("xterm-strikethrough"),zt&&(B.style.textDecoration="underline");let ht=Ie.getFgColor(),Qe=Ie.getFgColorMode(),st=Ie.getBgColor(),we=Ie.getBgColorMode();const Le=!!Ie.isInverse();if(Le){const yt=ht;ht=st,st=yt;const Ot=Qe;Qe=we,we=Ot}let qe,tt,at,Mt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,T,void 0,(yt=>{yt.options.layer!=="top"&&Mt||(yt.backgroundColorRGB&&(we=50331648,st=yt.backgroundColorRGB.rgba>>8&16777215,qe=yt.backgroundColorRGB),yt.foregroundColorRGB&&(Qe=50331648,ht=yt.foregroundColorRGB.rgba>>8&16777215,tt=yt.foregroundColorRGB),Mt=yt.options.layer==="top")})),!Mt&&et&&(qe=this._coreBrowserService.isFocused?$.selectionBackgroundOpaque:$.selectionInactiveBackgroundOpaque,st=qe.rgba>>8&16777215,we=50331648,Mt=!0,$.selectionForeground&&(Qe=50331648,ht=$.selectionForeground.rgba>>8&16777215,tt=$.selectionForeground)),Mt&&he.push("xterm-decoration-top"),we){case 16777216:case 33554432:at=$.ansi[st],he.push(`xterm-bg-${st}`);break;case 50331648:at=k.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(B,`background-color:#${z((st>>>0).toString(16),"0",6)}`);break;default:Le?(at=$.foreground,he.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):at=$.background}switch(qe||Ie.isDim()&&(qe=k.color.multiplyOpacity(at,.5)),Qe){case 16777216:case 33554432:Ie.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(B,at,$.ansi[ht],Ie,qe,void 0)||he.push(`xterm-fg-${ht}`);break;case 50331648:const yt=k.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(B,at,yt,Ie,qe,tt)||this._addStyle(B,`color:#${z(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,at,$.foreground,Ie,qe,tt)||Le&&he.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}he.length&&(B.className=he.join(" "),he.length=0),Tt||He||Wt?B.textContent=G:K++,ue!==this.defaultSpacing&&(B.style.letterSpacing=`${ue}px`),J.push(B),Ee=Te}return B&&K&&(B.textContent=G),J}_applyMinimumContrast(N,T,j,D,I,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const P=this._getContrastCache(D);let q;if(I||L||(q=P.getColor(T.rgba,j.rgba)),q===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);q=k.color.ensureContrastRatio(I||T,L||j,W),P.setColor((I||T).rgba,(L||j).rgba,q??null)}return!!q&&(this._addStyle(N,`color:${q.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,D=this._selectionEnd;return!(!j||!D)&&(this._columnSelectMode?j[0]<=D[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=D[0]&&T<=D[1]:T>j[1]&&T=j[0]&&N=j[0])}};function z(N,T,j){for(;N.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=c.createElement("span");_.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[_,d,m,g],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(m),this._container.appendChild(g),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,_,d){c===this._font&&f===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,_){let d=0;if(!f&&!_&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const S=this._measure(c,0);return S>0&&(this._flat[d]=S),S}let m=c;f&&(m+="B"),_&&(m+="I");let g=this._holey.get(m);if(g===void 0){let S=0;f&&(S|=1),_&&(S|=2),g=this._measure(c,S),g>0&&this._holey.set(m,g)}return g}_measure(c,f){const _=this._measureElements[f];return _.textContent=c.repeat(32),_.offsetWidth/32}}},2223:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function c(_){return 57508<=_&&_<=57558}function f(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},l.isEmoji=f,l.allowRescaling=function(_,d,m,g){return d===1&&m>Math.ceil(1.5*g)&&_!==void 0&&_>255&&!f(_)&&!c(_)&&!(function(S){return 57344<=S&&S<=63743})(_)},l.treatGlyphAsBackgroundColor=function(_){return c(_)||(function(d){return 9472<=d&&d<=9631})(_)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(_,d,m=0){return(_-(2*Math.round(d)-m))%(2*Math.round(d))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,m,g=!1){if(this.selectionStart=d,this.selectionEnd=m,!d||!m||d[0]===m[0]&&d[1]===m[1])return void this.clear();const S=_.buffers.active.ydisp,k=d[1]-S,v=m[1]-S,b=Math.max(k,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=k,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=m[0])}isCellSelected(_,d,m){return!!this.hasSelection&&(m-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&m>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m=this.startCol&&d=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=c(2585),m=c(8460),g=c(844);let S=l.CharSizeService=class extends g.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 m.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())}};l.CharSizeService=S=f([_(2,d.IOptionsService)],S);class k extends g.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(o,l,c){var f=this&&this.__decorate||function(b,w,y,C){var z,N=arguments.length,T=N<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--)(z=b[j])&&(T=(N<3?z(T):N>3?z(w,y,T):z(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=c(3734),m=c(643),g=c(511),S=c(2585);class k extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=k;let v=l.CharacterJoinerService=class Hj{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.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 P=this._getJoinedRanges(z,j,T,y,N);for(let q=0;q1){const L=this._getJoinedRanges(z,j,T,y,N);for(let P=0;P{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=c(844),_=c(8460),d=c(3656);class m extends f.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 g(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(k){this._window!==k&&(this._window=k,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=m;class g extends f.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var k;this._outerListener&&((k=this._resolutionMediaMatchList)==null||k.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=c(844);class _ extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const g=this.linkProviders.indexOf(m);g!==-1&&this.linkProviders.splice(g,1)}}}}l.LinkProviderService=_},8934:function(o,l,c){var f=this&&this.__decorate||function(S,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(S,k,v,b);else for(var z=S.length-1;z>=0;z--)(w=S[z])&&(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},_=this&&this.__param||function(S,k){return function(v,b){k(v,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=c(4725),m=c(9806);let g=l.MouseService=class{constructor(S,k){this._renderService=S,this._charSizeService=k}getCoords(S,k,v,b,w){return(0,m.getCoords)(window,S,k,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(S,k){const v=(0,m.getCoordsRelativeToElement)(window,S,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])}}};l.MouseService=g=f([_(0,d.IRenderService),_(1,d.ICharSizeService)],g)},3230:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=c(6193),m=c(4725),g=c(8460),S=c(844),k=c(7226),v=c(2585);let b=l.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,z,N,T,j,D){super(),this._rowCount=w,this._charSizeService=z,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new S.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((I,L)=>this._renderRows(I,L)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.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(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((z=>this._handleIntersectionChange(z[z.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,S.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var z;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(z=this._renderer.value)==null||z.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=b=f([_(2,v.IOptionsService),_(3,m.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],b)},9312:function(o,l,c){var f=this&&this.__decorate||function(j,D,I,L){var P,q=arguments.length,W=q<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,I):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(j,D,I,L);else for(var Z=j.length-1;Z>=0;Z--)(P=j[Z])&&(W=(q<3?P(W):q>3?P(D,I,W):P(D,I))||W);return q>3&&W&&Object.defineProperty(D,I,W),W},_=this&&this.__param||function(j,D){return function(I,L){D(I,L,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=c(9806),m=c(9504),g=c(456),S=c(4725),k=c(8460),v=c(844),b=c(6114),w=c(4841),y=c(511),C=c(2585),z=" ",N=new RegExp(z,"g");let T=l.SelectionService=class extends v.Disposable{constructor(j,D,I,L,P,q,W,Z,X){super(),this._element=j,this._screenElement=D,this._linkifier=I,this._bufferService=L,this._coreService=P,this._mouseService=q,this._optionsService=W,this._renderService=Z,this._coreBrowserService=X,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 g.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,D=this._model.finalSelectionEnd;return!(!j||!D||j[0]===D[0]&&j[1]===D[1])}get selectionText(){const j=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!j||!D)return"";const I=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(j[0]===D[0])return"";const P=j[0]P.replace(N," "))).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 D=this._getMouseBufferCoords(j),I=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(I&&L&&D)&&this._areCoordsInSelection(D,I,L)}isCellInSelection(j,D){const I=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!I||!L)&&this._areCoordsInSelection([j,D],I,L)}_areCoordsInSelection(j,D,I){return j[1]>D[1]&&j[1]=D[0]&&j[0]=D[0]}_selectWordAtCursor(j,D){var U,q;const I=(q=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:q.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(j);return!!L&&(this._selectWordAt(L,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,D){this._model.clearSelection(),j=Math.max(j,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const D=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(j){let D=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(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 D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const D=this._getMouseBufferCoords(j);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 I=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(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 D=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const L=(0,m.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!j||!D||j[0]===D[0]&&j[1]===D[1]);I?j&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(j,D,I)}_fireOnSelectionChange(j,D,I){this._oldSelectionStart=j,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(j,D){let I=D;for(let L=0;D>=L;L++){const U=j.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:U>1&&D!==L&&(I+=U-1)}return I}setSelection(j,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,D,I=!0,L=!0){if(j[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,q=U.lines.get(j[1]);if(!q)return;const W=U.translateBufferLineToString(j[1],!1);let Z=this._convertViewportColToCharacterIndex(q,j[0]),X=Z;const J=j[0]-Z;let ee=0,$=0,B=0,H=0;if(W.charAt(Z)===" "){for(;Z>0&&W.charAt(Z-1)===" ";)Z--;for(;X1&&(H+=ce-1,X+=ce-1);ie>0&&Z>0&&!this._isCharWordSeparator(q.loadCell(ie-1,this._workCell));){q.loadCell(ie-1,this._workCell);const re=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ie--):re>1&&(B+=re-1,Z-=re-1),Z--,ie--}for(;ve1&&(H+=re-1,X+=re-1),X++,ve++}}X++;let K=Z+J-ee+B,G=Math.min(this._bufferService.cols,X-Z+ee+$-B-H);if(D||W.slice(Z,X).trim()!==""){if(I&&K===0&&q.getCodePoint(0)!==32){const ie=U.lines.get(j[1]-1);if(ie&&q.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ve){const ce=this._bufferService.cols-ve.start;K-=ce,G+=ce}}}if(L&&K+G===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ie=U.lines.get(j[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const ve=this._getWordAt([0,j[1]+1],!1,!1,!0);ve&&(G+=ve.length)}}return{start:K,length:G}}}_selectWordAt(j,D){const I=this._getWordAt(j,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[I.start,j[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(j){const D=this._getWordAt(j,!0);if(D){let I=j[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const D=this._bufferService.buffer.getWrappedRangeForLine(j),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=T=f([_(3,C.IBufferService),_(4,C.ICoreService),_(5,S.IMouseService),_(6,C.IOptionsService),_(7,S.IRenderService),_(8,S.ICoreBrowserService)],T)},4725:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=c(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(o,l,c){var f=this&&this.__decorate||function(T,j,D,I){var L,U=arguments.length,q=U<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,D,I);else for(var W=T.length-1;W>=0;W--)(L=T[W])&&(q=(U<3?L(q):U>3?L(j,D,q):L(j,D))||q);return U>3&&q&&Object.defineProperty(j,D,q),q},_=this&&this.__param||function(T,j){return function(D,I){j(D,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),m=c(8055),g=c(8460),S=c(844),k=c(2585),v=m.css.toColor("#ffffff"),b=m.css.toColor("#000000"),w=m.css.toColor("#ffffff"),y=m.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=j[D/36%6|0],L=j[D/6%6|0],U=j[D%6];T.push({css:m.channels.toCss(I,L,U),rgba:m.channels.toRgba(I,L,U)})}for(let D=0;D<24;D++){const I=8+10*D;T.push({css:m.channels.toCss(I,I,I),rgba:m.channels.toRgba(I,I,I)})}return T})());let z=l.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:m.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:m.color.blend(b,C),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=m.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=m.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,m.NULL_COLOR):void 0,j.selectionForeground===m.NULL_COLOR&&(j.selectionForeground=void 0),m.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=m.color.opacity(j.selectionBackgroundTransparent,.3)),m.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=m.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=l.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,l.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,l.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,l.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,l.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,l.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,l.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,l.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,l.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,l.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,l.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,l.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,l.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,l.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,l.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,l.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const D=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let I=0;I{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=c(8460),_=c(844);class h extends _.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const S=new Array(g);for(let k=0;kthis._length)for(let S=this._length;S=g;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(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,k){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let b=S-1;b>=0;b--)this.set(g+b+k,this.get(g+b));const v=g+S+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(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(f,_=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const m in f)h[m]=_<=1?f[m]:f[m]&&c(f[m],_-1);return h}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,f=0,_=0,h=0;var m,g,S,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,z,N,T){return{css:y.toCss(C,z,N,T),rgba:y.toRgba(C,z,N,T)}}})(m||(l.channels=m={})),(function(y){function C(z,N){return h=Math.round(255*N),[c,f,_]=v.toChannels(z.rgba),{css:m.toCss(c,f,_,h),rgba:m.toRgba(c,f,_,h)}}y.blend=function(z,N){if(h=(255&N.rgba)/255,h===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,D=N.rgba>>8&255,I=z.rgba>>24&255,L=z.rgba>>16&255,U=z.rgba>>8&255;return c=I+Math.round((T-I)*h),f=L+Math.round((j-L)*h),_=U+Math.round((D-U)*h),{css:m.toCss(c,f,_),rgba:m.toRgba(c,f,_)}},y.isOpaque=function(z){return(255&z.rgba)==255},y.ensureContrastRatio=function(z,N,T){const j=v.ensureContrastRatio(z.rgba,N.rgba,T);if(j)return m.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(z){const N=(255|z.rgba)>>>0;return[c,f,_]=v.toChannels(N),{css:m.toCss(c,f,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(z,N){return h=255&z.rgba,C(z,h*N/255)},y.toColorRGB=function(z){return[z.rgba>>24&255,z.rgba>>16&255,z.rgba>>8&255]}})(g||(l.color=g={})),(function(y){let C,z;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",z=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),m.toColor(c,f,_);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),h=parseInt(N.slice(4,5).repeat(2),16),m.toColor(c,f,_,h);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),f=parseInt(T[2]),_=parseInt(T[3]),h=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),m.toColor(c,f,_,h);if(!C||!z)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=z,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,f,_,h]=C.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(c,f,_,h),css:N}}})(S||(l.css=S={})),(function(y){function C(z,N,T){const j=z/255,D=N/255,I=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(z){return C(z>>16&255,z>>8&255,255&z)},y.relativeLuminance2=C})(k||(l.rgb=k={})),(function(y){function C(N,T,j){const D=N>>24&255,I=N>>16&255,L=N>>8&255;let U=T>>24&255,q=T>>16&255,W=T>>8&255,Z=w(k.relativeLuminance2(U,q,W),k.relativeLuminance2(D,I,L));for(;Z0||q>0||W>0);)U-=Math.max(0,Math.ceil(.1*U)),q-=Math.max(0,Math.ceil(.1*q)),W-=Math.max(0,Math.ceil(.1*W)),Z=w(k.relativeLuminance2(U,q,W),k.relativeLuminance2(D,I,L));return(U<<24|q<<16|W<<8|255)>>>0}function z(N,T,j){const D=N>>24&255,I=N>>16&255,L=N>>8&255;let U=T>>24&255,q=T>>16&255,W=T>>8&255,Z=w(k.relativeLuminance2(U,q,W),k.relativeLuminance2(D,I,L));for(;Z>>0}y.blend=function(N,T){if(h=(255&T)/255,h===1)return T;const j=T>>24&255,D=T>>16&255,I=T>>8&255,L=N>>24&255,U=N>>16&255,q=N>>8&255;return c=L+Math.round((j-L)*h),f=U+Math.round((D-U)*h),_=q+Math.round((I-q)*h),m.toRgba(c,f,_)},y.ensureContrastRatio=function(N,T,j){const D=k.relativeLuminance(N>>8),I=k.relativeLuminance(T>>8);if(w(D,I)>8));if(Ww(D,k.relativeLuminance(Z>>8))?q:Z}return q}const L=z(N,T,j),U=w(D,k.relativeLuminance(L>>8));if(Uw(D,k.relativeLuminance(q>>8))?L:q}return L}},y.reduceLuminance=C,y.increaseLuminance=z,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(l.rgba=v={})),l.toPaddedHex=b,l.contrastRatio=w},8969:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=c(844),_=c(2585),h=c(4348),m=c(7866),g=c(744),S=c(7302),k=c(6975),v=c(8460),b=c(1753),w=c(1480),y=c(7994),C=c(9282),z=c(5435),N=c(5981),T=c(2660);let j=!1;class D extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((L=>{var U;(U=this._onScrollApi)==null||U.fire(L.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(L){for(const U in L)this.optionsService.options[U]=L[U]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new f.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 h.InstantiationService,this.optionsService=this.register(new S.OptionsService(L)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.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((U=>{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((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((U,q)=>this._inputHandler.parse(U,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,U){this._writeBuffer.write(L,U)}writeSync(L,U){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(L,U)}input(L,U=!0){this.coreService.triggerDataEvent(L,U)}resize(L,U){isNaN(L)||isNaN(U)||(L=Math.max(L,g.MINIMUM_COLS),U=Math.max(U,g.MINIMUM_ROWS),this._bufferService.resize(L,U))}scroll(L,U=!1){this._bufferService.scroll(L,U)}scrollLines(L,U,q){this._bufferService.scrollLines(L,U,q)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const U=L-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(L,U){return this._inputHandler.registerEscHandler(L,U)}registerDcsHandler(L,U){return this._inputHandler.registerDcsHandler(L,U)}registerCsiHandler(L,U){return this._inputHandler.registerCsiHandler(L,U)}registerOscHandler(L,U){return this._inputHandler.registerOscHandler(L,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?L=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const U of L)U.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;ff.fire(_)))},l.runAndSubscribe=function(c,f){return f(void 0),c((_=>f(_)))}},5435:function(o,l,c){var f=this&&this.__decorate||function(ee,$,B,H){var K,G=arguments.length,ie=G<3?$:H===null?H=Object.getOwnPropertyDescriptor($,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(ee,$,B,H);else for(var ve=ee.length-1;ve>=0;ve--)(K=ee[ve])&&(ie=(G<3?K(ie):G>3?K($,B,ie):K($,B))||ie);return G>3&&ie&&Object.defineProperty($,B,ie),ie},_=this&&this.__param||function(ee,$){return function(B,H){$(B,H,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),m=c(7116),g=c(2015),S=c(844),k=c(482),v=c(8437),b=c(8460),w=c(643),y=c(511),C=c(3734),z=c(2585),N=c(1480),T=c(6242),j=c(6351),D=c(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},L=131072;function U(ee,$){if(ee>24)return $.setWinLines||!1;switch(ee){case 1:return!!$.restoreWin;case 2:return!!$.minimizeWin;case 3:return!!$.setWinPosition;case 4:return!!$.setWinSizePixels;case 5:return!!$.raiseWin;case 6:return!!$.lowerWin;case 7:return!!$.refreshWin;case 8:return!!$.setWinSizeChars;case 9:return!!$.maximizeWin;case 10:return!!$.fullscreenWin;case 11:return!!$.getWinState;case 13:return!!$.getWinPosition;case 14:return!!$.getWinSizePixels;case 15:return!!$.getScreenSizePixels;case 16:return!!$.getCellSizePixels;case 18:return!!$.getWinSizeChars;case 19:return!!$.getScreenSizeChars;case 20:return!!$.getIconTitle;case 21:return!!$.getWinTitle;case 22:return!!$.pushTitle;case 23:return!!$.popTitle;case 24:return!!$.setWinLines}return!1}var q;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(l.WindowsOptionsReportType=q={}));let W=0;class Z extends S.Disposable{getAttrData(){return this._curAttrData}constructor($,B,H,K,G,ie,ve,ce,re=new g.EscapeSequenceParser){super(),this._bufferService=$,this._charsetService=B,this._coreService=H,this._logService=K,this._optionsService=G,this._oscLinkService=ie,this._coreMouseService=ve,this._unicodeService=ce,this._parser=re,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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:oe.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,oe,ue)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:oe,data:ue})})),this._parser.setDcsHandlerFallback(((P,oe,ue)=>{oe==="HOOK"&&(ue=ue.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:oe,payload:ue})})),this._parser.setPrintHandler(((P,oe,ue)=>this.print(P,oe,ue))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new T.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new T.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new T.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new T.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new T.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new T.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new T.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new T.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new T.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new T.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((P,oe)=>this.requestStatusString(P,oe))))}_preserveStack($,B,H,K){this._parseStack.paused=!0,this._parseStack.cursorStartX=$,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=H,this._parseStack.position=K}_logSlowResolvingAsync($){this._logService.logLevel<=z.LogLevelEnum.WARN&&Promise.race([$,new Promise(((B,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse($,B){let H,K=this._activeBuffer.x,G=this._activeBuffer.y,ie=0;const ve=this._parseStack.paused;if(ve){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(H),H;K=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,$.length>L&&(ie=this._parseStack.position+L)}if(this._logService.logLevel<=z.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof $=="string"?` "${$}"`:` "${Array.prototype.map.call($,(P=>String.fromCharCode(P))).join("")}"`),typeof $=="string"?$.split("").map((P=>P.charCodeAt(0))):$),this._parseBuffer.length<$.length&&this._parseBuffer.lengthL)for(let P=ie;P<$.length;P+=L){const oe=P+L<$.length?P+L:$.length,ue=typeof $=="string"?this._stringDecoder.decode($.substring(P,oe),this._parseBuffer):this._utf8Decoder.decode($.subarray(P,oe),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,ue))return this._preserveStack(K,G,ue,P),this._logSlowResolvingAsync(H),H}else if(!ve){const P=typeof $=="string"?this._stringDecoder.decode($,this._parseBuffer):this._utf8Decoder.decode($,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,P))return this._preserveStack(K,G,P,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===K&&this._activeBuffer.y===G||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),re=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);re0&&ue.getWidth(this._activeBuffer.x-1)===2&&ue.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let de=this._parser.precedingJoinState;for(let ge=B;gece){if(re){const Re=ue;let Ie=this._activeBuffer.x-He;for(this._activeBuffer.x=He,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),ue=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&ue instanceof v.BufferLine&&ue.copyCellsFrom(Re,Ie,0,He,!1);Ie=0;)ue.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(P&&(ue.insertCells(this._activeBuffer.x,G-He,this._activeBuffer.getNullCell(oe)),ue.getWidth(ce-1)===2&&ue.setCellFromCodepoint(ce-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,oe)),ue.setCellFromCodepoint(this._activeBuffer.x++,K,G,oe),G>0)for(;--G;)ue.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=de,this._activeBuffer.x0&&ue.getWidth(this._activeBuffer.x)===0&&!ue.hasContent(this._activeBuffer.x)&&ue.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler($,B){return $.final!=="t"||$.prefix||$.intermediates?this._parser.registerCsiHandler($,B):this._parser.registerCsiHandler($,(H=>!U(H.params[0],this._optionsService.rawOptions.windowOptions)||B(H)))}registerDcsHandler($,B){return this._parser.registerDcsHandler($,new j.DcsHandler(B))}registerEscHandler($,B){return this._parser.registerEscHandler($,B)}registerOscHandler($,B){return this._parser.registerOscHandler($,new T.OscHandler(B))}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 $;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&&(($=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&$.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const $=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-$),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor($=this._bufferService.cols-1){this._activeBuffer.x=Math.min($,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){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=$,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=$,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor($,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+$,this._activeBuffer.y+B)}cursorUp($){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,$.params[0]||1)):this._moveCursor(0,-($.params[0]||1)),!0}cursorDown($){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,$.params[0]||1)):this._moveCursor(0,$.params[0]||1),!0}cursorForward($){return this._moveCursor($.params[0]||1,0),!0}cursorBackward($){return this._moveCursor(-($.params[0]||1),0),!0}cursorNextLine($){return this.cursorDown($),this._activeBuffer.x=0,!0}cursorPrecedingLine($){return this.cursorUp($),this._activeBuffer.x=0,!0}cursorCharAbsolute($){return this._setCursor(($.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition($){return this._setCursor($.length>=2?($.params[1]||1)-1:0,($.params[0]||1)-1),!0}charPosAbsolute($){return this._setCursor(($.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative($){return this._moveCursor($.params[0]||1,0),!0}linePosAbsolute($){return this._setCursor(this._activeBuffer.x,($.params[0]||1)-1),!0}vPositionRelative($){return this._moveCursor(0,$.params[0]||1),!0}hVPosition($){return this.cursorPosition($),!0}tabClear($){const B=$.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab($){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=$.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab($){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=$.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected($){const B=$.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine($,B,H,K=!1,G=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);ie.replaceCells(B,H,this._activeBuffer.getNullCell(this._eraseAttrData()),G),K&&(ie.isWrapped=!1)}_resetBufferLine($,B=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+$),H.isWrapped=!1)}eraseInDisplay($,B=!1){let H;switch(this._restrictCursor(this._bufferService.cols),$.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,B);this._dirtyRowTracker.markDirty(0);break;case 3:const K=this._activeBuffer.lines.length-this._bufferService.rows;K>0&&(this._activeBuffer.lines.trimStart(K),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-K,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-K,0),this._onScroll.fire(0))}return!0}eraseInLine($,B=!1){switch(this._restrictCursor(this._bufferService.cols),$.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines($){this._restrictCursor();let 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 re=ce;for(let P=1;P0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary($){return $.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent($.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is($){return(this._optionsService.rawOptions.termName+"").indexOf($)===0}setMode($){for(let B=0;B<$.length;B++)switch($.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate($){for(let B=0;B<$.length;B++)switch($.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode($){for(let B=0;B<$.length;B++)switch($.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate($){for(let B=0;B<$.length;B++)switch($.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),$.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode($,B){const H=this._coreService.decPrivateModes,{activeProtocol:K,activeEncoding:G}=this._coreMouseService,ie=this._coreService,{buffers:ve,cols:ce}=this._bufferService,{active:re,alt:P}=ve,oe=this._optionsService.rawOptions,ue=Ae=>Ae?1:2,de=$.params[0];return ge=de,Ee=B?de===2?4:de===4?ue(ie.modes.insertMode):de===12?3:de===20?ue(oe.convertEol):0:de===1?ue(H.applicationCursorKeys):de===3?oe.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:de===6?ue(H.origin):de===7?ue(H.wraparound):de===8?3:de===9?ue(K==="X10"):de===12?ue(oe.cursorBlink):de===25?ue(!ie.isCursorHidden):de===45?ue(H.reverseWraparound):de===66?ue(H.applicationKeypad):de===67?4:de===1e3?ue(K==="VT200"):de===1002?ue(K==="DRAG"):de===1003?ue(K==="ANY"):de===1004?ue(H.sendFocus):de===1005?4:de===1006?ue(G==="SGR"):de===1015?4:de===1016?ue(G==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ue(re===P):de===2004?ue(H.bracketedPasteMode):0,ie.triggerDataEvent(`${h.C0.ESC}[${B?"":"?"}${ge};${Ee}$y`),!0;var ge,Ee}_updateAttrColor($,B,H,K,G){return B===2?($|=50331648,$&=-16777216,$|=C.AttributeData.fromColorRGB([H,K,G])):B===5&&($&=-50331904,$|=33554432|255&H),$}_extractColor($,B,H){const K=[0,0,-1,0,0,0];let G=0,ie=0;do{if(K[ie+G]=$.params[B+ie],$.hasSubParams(B+ie)){const ve=$.getSubParams(B+ie);let ce=0;do K[1]===5&&(G=1),K[ie+ce+1+G]=ve[ce];while(++ce=2||K[1]===2&&ie+G>=5)break;K[1]&&(G=1)}while(++ie+B<$.length&&ie+G5)&&($=1),B.extended.underlineStyle=$,B.fg|=268435456,$===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0($){$.fg=v.DEFAULT_ATTR_DATA.fg,$.bg=v.DEFAULT_ATTR_DATA.bg,$.extended=$.extended.clone(),$.extended.underlineStyle=0,$.extended.underlineColor&=-67108864,$.updateExtended()}charAttributes($){if($.length===1&&$.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=$.length;let H;const K=this._curAttrData;for(let G=0;G=30&&H<=37?(K.fg&=-50331904,K.fg|=16777216|H-30):H>=40&&H<=47?(K.bg&=-50331904,K.bg|=16777216|H-40):H>=90&&H<=97?(K.fg&=-50331904,K.fg|=16777224|H-90):H>=100&&H<=107?(K.bg&=-50331904,K.bg|=16777224|H-100):H===0?this._processSGR0(K):H===1?K.fg|=134217728:H===3?K.bg|=67108864:H===4?(K.fg|=268435456,this._processUnderline($.hasSubParams(G)?$.getSubParams(G)[0]:1,K)):H===5?K.fg|=536870912:H===7?K.fg|=67108864:H===8?K.fg|=1073741824:H===9?K.fg|=2147483648:H===2?K.bg|=134217728:H===21?this._processUnderline(2,K):H===22?(K.fg&=-134217729,K.bg&=-134217729):H===23?K.bg&=-67108865:H===24?(K.fg&=-268435457,this._processUnderline(0,K)):H===25?K.fg&=-536870913:H===27?K.fg&=-67108865:H===28?K.fg&=-1073741825:H===29?K.fg&=2147483647:H===39?(K.fg&=-67108864,K.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):H===49?(K.bg&=-67108864,K.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?G+=this._extractColor($,G,K):H===53?K.bg|=1073741824:H===55?K.bg&=-1073741825:H===59?(K.extended=K.extended.clone(),K.extended.underlineColor=-1,K.updateExtended()):H===100?(K.fg&=-67108864,K.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,K.bg&=-67108864,K.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus($){switch($.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${B};${H}R`)}return!0}deviceStatusPrivate($){if($.params[0]===6){const B=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${B};${H}R`)}return!0}softReset($){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($){const B=$.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const H=B%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion($){const B=$.params[0]||1;let H;return($.length<2||(H=$.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions($){if(!U($.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=$.length>1?$.params[1]:0;switch($.params[0]){case 14:B!==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(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor($){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($){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($){return this._windowTitle=$,this._onTitleChange.fire($),!0}setIconName($){return this._iconName=$,!0}setOrReportIndexedColor($){const B=[],H=$.split(";");for(;H.length>1;){const K=H.shift(),G=H.shift();if(/^\d+$/.exec(K)){const ie=parseInt(K);if(J(ie))if(G==="?")B.push({type:0,index:ie});else{const ve=(0,D.parseColor)(G);ve&&B.push({type:1,index:ie,color:ve})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink($){const B=$.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink($,B){this._getCurrentLinkId()&&this._finishHyperlink();const H=$.split(":");let K;const G=H.findIndex((ie=>ie.startsWith("id=")));return G!==-1&&(K=H[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:K,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor($,B){const H=$.split(";");for(let K=0;K=this._specialColors.length);++K,++B)if(H[K]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const G=(0,D.parseColor)(H[K]);G&&this._onColor.fire([{type:1,index:this._specialColors[B],color:G}])}return!0}setOrReportFgColor($){return this._setOrReportSpecialColor($,0)}setOrReportBgColor($){return this._setOrReportSpecialColor($,1)}setOrReportCursorColor($){return this._setOrReportSpecialColor($,2)}restoreIndexedColor($){if(!$)return this._onColor.fire([{type:2}]),!0;const B=[],H=$.split(";");for(let K=0;K=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 $=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,$,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($){return this._charsetService.setgLevel($),!0}screenAlignmentPattern(){const $=new y.CellData;$.content=4194373,$.fg=this._curAttrData.fg,$.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B(this._coreService.triggerDataEvent(`${h.C0.ESC}${G}${h.C0.ESC}\\`),!0))($==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:$==='"p'?'P1$r61;1"p':$==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:$==="m"?"P1$r0m":$===" q"?`P1$r${{block:2,underline:4,bar:6}[K.cursorStyle]-(K.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty($,B){this._dirtyRowTracker.markRangeDirty($,B)}}l.InputHandler=Z;let X=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,$){ee>$&&(W=ee,ee=$,$=W),eethis.end&&(this.end=$)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(ee){return 0<=ee&&ee<256}X=f([_(0,z.IBufferService)],X)},844:(o,l)=>{function c(f){for(const _ of f)_.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)==null||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=c,l.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(_,h,m){this._data[_]||(this._data[_]={}),this._data[_][h]=m}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(f,_,h,m,g){this._data.get(f,_)||this._data.set(f,_,new c),this._data.get(f,_).set(h,m,g)}get(f,_,h,m){var g;return(g=this._data.get(f,_))==null?void 0:g.get(h,m)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const _=c.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const _=this._getKey(f);if(_===void 0||(c=this._search(_),c===-1)||this._getKey(this._array[c])!==_)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===f))do _(this._array[c]);while(++c=_;){let m=_+h>>1;const g=this._getKey(this._array[m]);if(g>f)h=m-1;else{if(!(g0&&this._getKey(this._array[m-1])===f;)m--;return m}_=m+1}}return _}}},7226:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=c(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),this._start()}flush(){for(;this._ib)return v-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-S))}ms`),void this._start();v=b}this.clear()}}class h extends _{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=c(643);l.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),m=h==null?void 0:h.get(_.cols-1),g=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);g&&m&&(g.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,m=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=c(6349),_=c(7226),h=c(3734),m=c(8437),g=c(4634),S=c(511),k=c(643),v=c(4863),b=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(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 h.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 h.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new m.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=m.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 f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(m.DEFAULT_ATTR_DATA);let z=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),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 m.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(N0&&(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=N}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,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(C.length>0){const z=(0,g.reflowLargerCreateNewLayout)(this.lines,C);(0,g.reflowLargerApplyNewLayout)(this.lines,z.layout),this._reflowLargerAdjustViewport(w,y,z.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const z=this.getNullCell(m.DEFAULT_ATTR_DATA);let N=C;for(;N-- >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 D=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),D.unshift(j);const I=this.ybase+this.y;if(I>=T&&I0&&(z.push({start:T+D.length+N,newLines:Z}),N+=Z.length),D.push(...Z);let X=U.length-1,J=U[X];J===0&&(X--,J=U[X]);let ee=D.length-q-1,$=L;for(;ee>=0;){const H=Math.min($,J);if(D[X]===void 0)break;if(D[X].copyCellsFrom(D[ee],$-H,J-H,H,!0),J-=H,J===0&&(X--,J=U[X]),$-=H,$===0){ee--;const K=Math.max(ee,0);$=(0,g.getWrappedLineTrimmedLength)(D,K,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const T=[],j=[];for(let X=0;X=0;X--)if(U&&U.start>I+q){for(let J=U.newLines.length-1;J>=0;J--)this.lines.set(X--,U.newLines[J]);X++,T.push({index:I+1,amount:U.newLines.length}),q+=U.newLines.length,U=z[++L]}else this.lines.set(X,j[I--]);let W=0;for(let X=T.length-1;X>=0;X--)T[X].index+=W,this.lines.onInsertEmitter.fire(T[X]),W+=T[X].amount;const Z=Math.max(0,D+N-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}}translateBufferLineToString(w,y,C=0,z){const N=this.lines.get(w);return N?N.translateToString(y,C,z):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=c(3734),_=c(511),h=c(643),m=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let g=0;class S{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.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[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.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,m.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return g=3*v,b.content=this._data[g+0],b.fg=this._data[g+1],b.bg=this._data[g+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,m.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,m.stringFromCodePoint)(2097151&y)+(0,m.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[N]}const C=Object.keys(this._extendedAttrs);for(let z=0;z=v&&delete this._extendedAttrs[N]}}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 z=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]=z[3*(b+T)+j];268435456&z[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}}l.BufferLine=S},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(o,l)=>{function c(f,_,h){if(_===f.length-1)return f[_].getTrimmedLength();const m=!f[_].hasContent(h-1)&&f[_].getWidth(h-1)===1,g=f[_+1].getWidth(0)===2;return m&&g?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,_,h,m,g){const S=[];for(let k=0;k=k&&m0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(S.push(k+w.length-T),S.push(T)),k+=w.length-1}return S},l.reflowLargerCreateNewLayout=function(f,_){const h=[];let m=0,g=_[m],S=0;for(let k=0;kc(f,w,_))).reduce(((b,w)=>b+w));let S=0,k=0,v=0;for(;vb&&(S-=b,k++);const w=f[k].getWidth(S-1)===2;w&&S--;const y=w?h-1:h;m.push(y),v+=y}return m},l.getWrappedLineTrimmedLength=c},5295:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=c(8460),_=c(844),h=c(9092);class m extends _.Disposable{constructor(S,k){super(),this._optionsService=S,this._bufferService=k,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(S,k){this._normal.resize(S,k),this._alt.resize(S,k),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}l.BufferSet=m},511:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=c(482),_=c(643),h=c(3734);class m extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const k=new m;return k.setFromCharData(S),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(S[_.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(S[_.CHAR_DATA_CHAR_INDEX].length===2){const v=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|S[_.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[_.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=S[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=m},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=c(8460),_=c(844);class h{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}l.Marker=h,h._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var c,f,_;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=` -`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(l.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(f||(l.C1=f={})),(function(h){h.ST=`${c.ESC}\\`})(_||(l.C1_ESCAPED=_={}))},7399:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=c(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(h,m,g,S){const k={type:0,cancel:!1,key:void 0},v=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?k.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?k.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?k.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(k.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:k.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(k.key=f.C0.ESC+k.key);break;case 9:if(h.shiftKey){k.key=f.C0.ESC+"[Z";break}k.key=f.C0.HT,k.cancel=!0;break;case 13:k.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,k.cancel=!0;break;case 27:k.key=f.C0.ESC,h.altKey&&(k.key=f.C0.ESC+f.C0.ESC),k.cancel=!0;break;case 37:if(h.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"D",k.key===f.C0.ESC+"[1;3D"&&(k.key=f.C0.ESC+(g?"b":"[1;5D"))):k.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"C",k.key===f.C0.ESC+"[1;3C"&&(k.key=f.C0.ESC+(g?"f":"[1;5C"))):k.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"A",g||k.key!==f.C0.ESC+"[1;3A"||(k.key=f.C0.ESC+"[1;5A")):k.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"B",g||k.key!==f.C0.ESC+"[1;3B"||(k.key=f.C0.ESC+"[1;5B")):k.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(k.key=f.C0.ESC+"[2~");break;case 46:k.key=v?f.C0.ESC+"[3;"+(v+1)+"~":f.C0.ESC+"[3~";break;case 36:k.key=v?f.C0.ESC+"[1;"+(v+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:k.key=v?f.C0.ESC+"[1;"+(v+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?k.type=2:h.ctrlKey?k.key=f.C0.ESC+"[5;"+(v+1)+"~":k.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?k.type=3:h.ctrlKey?k.key=f.C0.ESC+"[6;"+(v+1)+"~":k.key=f.C0.ESC+"[6~";break;case 112:k.key=v?f.C0.ESC+"[1;"+(v+1)+"P":f.C0.ESC+"OP";break;case 113:k.key=v?f.C0.ESC+"[1;"+(v+1)+"Q":f.C0.ESC+"OQ";break;case 114:k.key=v?f.C0.ESC+"[1;"+(v+1)+"R":f.C0.ESC+"OR";break;case 115:k.key=v?f.C0.ESC+"[1;"+(v+1)+"S":f.C0.ESC+"OS";break;case 116:k.key=v?f.C0.ESC+"[15;"+(v+1)+"~":f.C0.ESC+"[15~";break;case 117:k.key=v?f.C0.ESC+"[17;"+(v+1)+"~":f.C0.ESC+"[17~";break;case 118:k.key=v?f.C0.ESC+"[18;"+(v+1)+"~":f.C0.ESC+"[18~";break;case 119:k.key=v?f.C0.ESC+"[19;"+(v+1)+"~":f.C0.ESC+"[19~";break;case 120:k.key=v?f.C0.ESC+"[20;"+(v+1)+"~":f.C0.ESC+"[20~";break;case 121:k.key=v?f.C0.ESC+"[21;"+(v+1)+"~":f.C0.ESC+"[21~";break;case 122:k.key=v?f.C0.ESC+"[23;"+(v+1)+"~":f.C0.ESC+"[23~";break;case 123:k.key=v?f.C0.ESC+"[24;"+(v+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(g&&!S||!h.altKey||h.metaKey)!g||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?k.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(k.key=f.C0.US),h.key==="@"&&(k.key=f.C0.NUL)):h.keyCode===65&&(k.type=1);else{const b=_[h.keyCode],w=b==null?void 0:b[h.shiftKey?1:0];if(w)k.key=f.C0.ESC+w;else if(h.keyCode>=65&&h.keyCode<=90){const y=h.ctrlKey?h.keyCode-64:h.keyCode+32;let C=String.fromCharCode(y);h.shiftKey&&(C=C.toUpperCase()),k.key=f.C0.ESC+C}else if(h.keyCode===32)k.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let y=h.code.slice(3,4);h.shiftKey||(y=y.toLowerCase()),k.key=f.C0.ESC+y,k.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?k.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?k.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?k.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?k.key=f.C0.DEL:h.keyCode===219?k.key=f.C0.ESC:h.keyCode===220?k.key=f.C0.FS:h.keyCode===221&&(k.key=f.C0.GS)}return k}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,f=0,_=c.length){let h="";for(let m=f;m<_;++m){let g=c[m];g>65535?(g-=65536,h+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):h+=String.fromCharCode(g)}return h},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const _=c.length;if(!_)return 0;let h=0,m=0;if(this._interim){const g=c.charCodeAt(m++);56320<=g&&g<=57343?f[h++]=1024*(this._interim-55296)+g-56320+65536:(f[h++]=this._interim,f[h++]=g),this._interim=0}for(let g=m;g<_;++g){const S=c.charCodeAt(g);if(55296<=S&&S<=56319){if(++g>=_)return this._interim=S,h;const k=c.charCodeAt(g);56320<=k&&k<=57343?f[h++]=1024*(S-55296)+k-56320+65536:(f[h++]=S,f[h++]=k)}else S!==65279&&(f[h++]=S)}return h}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const _=c.length;if(!_)return 0;let h,m,g,S,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 N,T=0;for(;(N=63&this.interim[++T])&&T<4;)z<<=6,z|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=j-T;for(;b=_)return 0;if(N=c[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,z<<=6,z|=63&N}C||(j===2?z<128?b--:f[k++]=z:j===3?z<2048||z>=55296&&z<=57343||z===65279||(f[k++]=z):z<65536||z>1114111||(f[k++]=z)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(v=(31&h)<<6|63&m,v<128){y--;continue}f[k++]=v}else if((240&h)==224){if(y>=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(v=(15&h)<<12|(63&m)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;f[k++]=v}else if((248&h)==240){if(y>=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,this.interim[2]=g,k;if(S=c[y++],(192&S)!=128){y--;continue}if(v=(7&h)<<18|(63&m)<<12|(63&g)<<6|63&S,v<65536||v>1114111)continue;f[k++]=v}}return k}}},225:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=c(1480),_=[[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]],h=[[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 m;l.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<_.length;++g)m.fill(0,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(S,k){let v,b=0,w=k.length-1;if(Sk[w][1])return!1;for(;w>=b;)if(v=b+w>>1,S>k[v][1])b=v+1;else{if(!(S=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,S){let k=this.wcwidth(g),v=k===0&&S!==0;if(v){const b=f.UnicodeService.extractWidth(S);b===0?v=!1:b>k&&(k=b)}return f.UnicodeService.createPropertyValue(0,k,v)}}},5981:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=c(8460),_=c(844);class h extends _.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),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(g,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S)}_innerWrite(g=0,S=!0){const k=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,S);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()}}l.WriteBuffer=h},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function _(h,m){const g=h.toString(16),S=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}l.parseColor=function(h){if(!h)return;let m=h.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=c.exec(m);if(g){const S=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/S*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/S*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/S*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,S=[0,0,0];for(let k=0;k<3;++k){const v=parseInt(m.slice(g*k,g*k+g),16);S[k]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return S}},l.toRgbString=function(h,m=16){const[g,S,k]=h;return`rgb:${_(g,m)}/${_(S,m)}/${_(k,m)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=c(482),_=c(8742),h=c(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(S,k){this._handlers[S]===void 0&&(this._handlers[S]=[]);const v=this._handlers[S];return v.push(k),{dispose:()=>{const b=v.indexOf(k);b!==-1&&v.splice(b,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(S,k){if(this.reset(),this._ident=S,this._active=this._handlers[S]||m,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(S,k,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(S,k,v);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(S,k,v))}unhook(S,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(S),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",S);this._active=m,this._ident=0}};const g=new _.Params;g.addParam(0),l.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=g,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():g,this._data="",this._hitLimit=!1}put(S,k,v){this._hitLimit||(this._data+=(0,f.utf32ToString)(S,k,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let k=!1;if(this._hitLimit)k=!1;else if(S&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((v=>(this._params=g,this._data="",this._hitLimit=!1,v)));return this._params=g,this._data="",this._hitLimit=!1,k}}},2015:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=c(844),_=c(8742),h=c(6242),m=c(6351);class g{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 z=0;zj)),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 z=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),z)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,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(S,0,2,0),v.add(S,8,5,8),v.add(S,6,0,6),v.add(S,11,0,11),v.add(S,13,13,13),v})();class k extends f.Disposable{constructor(b=l.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 _.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,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new m.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 z=0;zN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}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 z=C.indexOf(w);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,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 z=C.indexOf(w);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,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,z){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=z}parse(b,w,y){let C,z=0,N=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 D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=j[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=j[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,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>=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=0&&(C=D[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,D,I,N,j),C;I<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 L=this._escHandlers[this._collect<<8|z];let U=L?L.length-1:-1;for(;U>=0&&(C=L[U](),C!==!0);U--)if(C instanceof Promise)return this._preserveStack(4,L,U,N,j),C;U<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>=w||(z=b[q])===24||z===26||z===27||z>127&&z=w||(z=b[q])<32||z>127&&z{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=c(5770),_=c(482),h=[];l.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const S=this._handlers[m];return S.push(g),{dispose:()=>{const k=S.indexOf(g);k!==-1&&S.splice(k,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,S){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(m,g,S);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(m,g,S))}start(){this.reset(),this._state=1}put(m,g,S){if(this._state!==3){if(this._state===1)for(;g0&&this._put(m,g,S)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,k=this._active.length-1,v=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,S=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&S===!1){for(;k>=0&&(S=this._active[k].end(m),S!==!0);k--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,S;k--}for(;k>=0;k--)if(S=this._active[k].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",m);this._active=h,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,S){this._hitLimit||(this._data+=(0,_.utf32ToString)(m,g,S),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,g}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class f{static fromArray(h){const m=new f;if(!h.length)return m;for(let g=Array.isArray(h[0])?1:0;g256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&h.push(Array.prototype.slice.call(this._subParams,g,S))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const m=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const h={};for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&(h[m]=this._subParams.slice(g,S))}return h}addDigit(h){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,S=g[m-1];g[m-1]=~S?Math.min(10*S+h,c):h}}l.Params=f},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const _={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(_),f.dispose=()=>this._wrappedAddonDispose(_),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let _=0;_{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=c(3785),_=c(511);l.BufferApiView=class{constructor(h,m){this._buffer=h,this.type=m}init(h){return this._buffer=h,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(h){const m=this._buffer.lines.get(h);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new _.CellData}}},3785:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=c(511);l.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new f.CellData)}translateToString(_,h,m){return this._line.translateToString(_,h,m)}}},8285:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=c(8771),_=c(8460),h=c(844);class m extends h.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=m},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(_=>f(_.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((_,h)=>f(_,h.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(o,l,c){var f=this&&this.__decorate||function(v,b,w,y){var C,z=arguments.length,N=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(z<3?C(N):z>3?C(b,w,N):C(b,w))||N);return z>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const h=c(8460),m=c(844),g=c(5295),S=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let k=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new g.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,z=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;z===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(z+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=z-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(z,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))}};l.BufferService=k=f([_(0,S.IOptionsService)],k)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(o,l,c){var f=this&&this.__decorate||function(y,C,z,N){var T,j=arguments.length,D=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,z):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,z,N);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(D=(j<3?T(D):j>3?T(C,z,D):T(C,z))||D);return j>3&&D&&Object.defineProperty(C,z,D),D},_=this&&this.__param||function(y,C){return function(z,N){C(z,N,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const h=c(2585),m=c(8460),g=c(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function k(y,C){let 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 w=l.CoreMouseService=class extends g.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 m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const z of Object.keys(S))this.addProtocol(z,S[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}};l.CoreMouseService=w=f([_(0,h.IBufferService),_(1,h.ICoreService)],w)},6975:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const h=c(1439),m=c(8460),g=c(844),S=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=l.CoreService=class extends g.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 m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(v)}reset(){this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.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((z=>z.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=b=f([_(0,S.IBufferService),_(1,S.ILogService),_(2,S.IOptionsService)],b)},9074:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=c(8055),_=c(8460),h=c(844),m=c(6106);let g=0,S=0;class k extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.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 z=0,N=0;for(const T of this._decorations.getKeyIterator(y))z=T.options.x??0,N=z+(T.options.width??1),w>=z&&w{g=N.options.x??0,S=g+(N.options.width??1),w>=g&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=c(2585),_=c(8343);class h{constructor(...g){this._entries=new Map;for(const[S,k]of g)this.set(S,k)}set(g,S){const k=this._entries.get(g);return this._entries.set(g,S),k}forEach(g){for(const[S,k]of this._entries.entries())g(S,k)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}l.ServiceCollection=h,l.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const S=(0,_.getServiceDependencies)(m).sort(((b,w)=>b.index-w.index)),k=[];for(const b of S){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${b.id}.`);k.push(w)}const v=S.length>0?S[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new m(...g,...k)}}},7866:function(o,l,c){var f=this&&this.__decorate||function(v,b,w,y){var C,z=arguments.length,N=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(z<3?C(N):z>3?C(b,w,N):C(b,w))||N);return z>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const h=c(844),m=c(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let S,k=l.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const z=y.apply(this,C);return S.trace(`GlyphRenderer#${y.name} return`,z),z}}},7302:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=c(8460),_=c(844),h=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends _.Disposable{constructor(k){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.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,_.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 l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in l.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=l.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=l.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=m.includes(v)?v:l.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}}l.OptionsService=g},2660:function(o,l,c){var f=this&&this.__decorate||function(g,S,k,v){var b,w=arguments.length,y=w<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,k):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(g,S,k,v);else for(var C=g.length-1;C>=0;C--)(b=g[C])&&(y=(w<3?b(y):w>3?b(S,k,y):b(S,k))||y);return w>3&&y&&Object.defineProperty(S,k,y),y},_=this&&this.__param||function(g,S){return function(k,v){S(k,v,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const h=c(2585);let m=l.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const S=this._bufferService.buffer;if(g.id===void 0){const C=S.addMarker(S.ybase+S.y),z={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(z,C))),this._dataByLinkId.set(z.id,z),z.id}const k=g,v=this._getEntryIdKey(k),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,S.ybase+S.y),b.id;const w=S.addMarker(S.ybase+S.y),y={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(g,S){const k=this._dataByLinkId.get(g);if(k&&k.lines.every((v=>v.line!==S))){const v=this._bufferService.buffer.addMarker(S);k.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(k,v)))}}getLinkData(g){var S;return(S=this._dataByLinkId.get(g))==null?void 0:S.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,S){const k=g.lines.indexOf(S);k!==-1&&(g.lines.splice(k,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};l.OscLinkService=m=f([_(0,h.IBufferService)],m)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(_){return _[f]||[]},l.createDecorator=function(_){if(l.serviceRegistry.has(_))return l.serviceRegistry.get(_);const h=function(m,g,S){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[f].push({id:k,index:b}):(v[f]=[{id:k,index:b}],v[c]=v)})(h,m,S)};return h.toString=()=>_,l.serviceRegistry.set(_,h),h}},2585:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=c(8343);var _;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(_||(l.LogLevelEnum=_={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=c(8460),_=c(225);class h{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,S,k=!1){return(16777215&g)<<3|(3&S)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const g=new _.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let S=0,k=0;const v=g.length;for(let b=0;b=v)return S+this.wcwidth(w);const z=g.charCodeAt(b);56320<=z&&z<=57343?w=1024*(w-55296)+z-56320+65536:S+=this.wcwidth(z)}const y=this.charProperties(w,k);let C=h.extractWidth(y);h.extractShouldJoin(y)&&(C-=h.extractWidth(k)),S+=C,k=y}return S}charProperties(g,S){return this._activeProvider.charProperties(g,S)}}l.UnicodeService=h}},r={};function s(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return t[o].call(c.exports,c,c.exports,s),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=s(9042),c=s(3236),f=s(844),_=s(5741),h=s(8285),m=s(7975),g=s(7090),S=["cols","rows"];class k extends f.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=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:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,z)}}_checkReadonlyOptions(b){if(S.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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.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 h.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 l}_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")}}o.Terminal=k})(),a})()))})(Eb)),Eb.exports}var Gdt=qdt();function jk(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const r=new Gdt.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),s=new Udt.FitAddon;r.loadAddon(s),r.open(t);try{s.fit()}catch{}const a=new ResizeObserver(()=>{try{s.fit()}catch{}});a.observe(t);let o=!1,l=0,c=!1,f=!1;async function _(){if(c){f=!0;return}c=!0;try{for(;;){const m=await MWe(e,l);if(o)return;if(m.dataBase64&&r.write(jk(m.dataBase64)),l=m.nextOffset,m.eof)break}}catch{}finally{c=!1,f&&!o&&(f=!1,_())}}const h=lXe(e,m=>{if(o)return;const g=jk(m.dataBase64);!c&&m.offset===l?(r.write(g),l+=g.length):m.offset+g.length>l&&_()});return _(),()=>{o=!0,h(),a.disconnect(),r.dispose()}},[e]),d.jsx("div",{ref:n,style:{width:"100%",height:"100%"}})}function Wdt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:c}){const f=r.filter(_=>_.experimentId===e.id).sort((_,h)=>h.createdAt-_.createdAt);return t==="overview"?d.jsx(Pdt,{experiment:e,parentExperiment:o,project:n,runs:f,onOpenLogs:(_,h)=>l("terminal",_,h),onOpenCode:_=>c("files",_)}):d.jsx(Kdt,{experiment:e,expRuns:f,selectedRunId:s,onSelectRun:a})}function Kdt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,a]=R.useState(null),[o,l]=R.useState(null),[c,f]=R.useState(!1),_=R.useRef(null),h=t&&n.find(b=>b.id===t)||n[0]||null,m=(h==null?void 0:h.status)==="running"||(h==null?void 0:h.status)==="starting",g=!!(h&&m&&(h.cancelRequested||o===h.id)),S=b=>{const w=n.findIndex(y=>y.id===b);return w===-1?n.length:n.length-w},k=R.useRef(null);R.useEffect(()=>{if(k.current===null){k.current=new Set(n.map(w=>w.id));return}const b=n.find(w=>!k.current.has(w.id));for(const w of n)k.current.add(w.id);b&&r(b.id)},[n,r]),R.useEffect(()=>{if(!c)return;const b=w=>{var y;(y=_.current)!=null&&y.contains(w.target)||f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c]);async function v(){if(h){a(null),l(h.id);try{await cE(h.id)}catch(b){l(null),a(b instanceof Error?b.message:String(b))}}}return d.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[d.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:[d.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),d.jsx("span",{style:{flex:1}}),s&&d.jsx("span",{className:"error",role:"alert",children:s}),m&&d.jsxs("button",{className:`${Ks} ghost`,disabled:g,onClick:()=>void v(),children:[d.jsx(G9,{size:13}),g?Ute():d9()]}),n.length>0&&h&&d.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[d.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pe-1.5 pb-1 ps-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:$ie(),onClick:()=>f(b=>!b),children:[d.jsxs("span",{className:"run-label",children:[E6()," ",S(h.id)]}),d.jsx(no,{status:g?"cancelling":wi(h)}),d.jsx(ya,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:n.map(b=>d.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-start py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ms-auto [&_.when]:text-xs [&_.when]:text-muted ${b.id===(h==null?void 0:h.id)?"active":""}`,onClick:()=>{r(b.id),f(!1)},children:[d.jsxs("span",{className:"run-label",children:[E6()," ",S(b.id)]}),d.jsx(no,{status:wi(b)}),d.jsx("span",{className:"when",children:qi(b.createdAt)})]},b.id))})]})]}),d.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pe-0 pb-1 ps-1.5",children:h?d.jsx(Vdt,{runId:h.id},h.id):d.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:Mie()})})]})}function Xdt({projectId:e,filePath:n,sessionId:t,enabled:r,ready:s,source:a}){const[o,l]=R.useState(void 0),[c,f]=R.useState(null),[_,h]=R.useState(null),[m,g]=R.useState(!1),[S,k]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,z]=R.useState(null),[N,T]=R.useState(null),[j,D]=R.useState(!1),[I,L]=R.useState(0),U=R.useCallback(J=>{D(J),J&&L(ee=>ee+1)},[]),q=R.useRef(a);q.current=a,R.useEffect(()=>{if(!r)return;let J=!1;return BWe().then(ee=>{J||(l(ee.engine),f(ee.hint),h(ee.installCommand))}).catch(()=>{J||l(null)}),()=>{J=!0}},[r]);const W=R.useRef(!1),Z=R.useCallback(()=>{if(W.current)return;W.current=!0,g(!0);const J=q.current;T(null),b(null),z(null),$We(e,n,{sessionId:t}).then(ee=>{var B,H;const $=ee.pdfPath;if(ee.ok&&$){k(K=>({path:$,version:((K==null?void 0:K.version)??0)+1,source:J})),y(ee.hadErrors),z(ee.note),ee.hadErrors&&b(((B=ee.log)==null?void 0:B.trim())||null),U(!0);return}k(null),y(!1),z(ee.note),D(!1),b(((H=ee.log)==null?void 0:H.trim())||xhe())}).catch(ee=>{k(null),y(!1),z(null),D(!1),T(ee instanceof Error?ee.message:String(ee))}).finally(()=>{W.current=!1,g(!1)})},[e,n,t,U]),X=R.useRef(null);return R.useEffect(()=>{!r||!s||!o||X.current!==n&&(X.current=n,Z())},[r,s,o,n,Z]),{engine:o,installHint:c,installCommand:_,compiling:m,compiled:S,stale:S!==null&&S.source!==a,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:U,viewNonce:I,compile:Z,dismiss:()=>{T(null),b(null)}}}const Ydt=3e4;function Zdt({projectId:e,filePath:n,sessionId:t,enabled:r,savedSource:s,dirty:a,onPulled:o}){const[l,c]=R.useState(!1),[f,_]=R.useState(null),[h,m]=R.useState(!1),[g,S]=R.useState(!1),[k,v]=R.useState(null),[b,w]=R.useState(null),[y,C]=R.useState(!1),z=R.useCallback(U=>{c(U.hasToken),_(U.link)},[]);R.useEffect(()=>{let U=!1;if(m(!1),_(null),v(null),w(null),C(!1),D.current=!1,!!r)return FWe(e,n,{sessionId:t}).then(q=>{U||z(q)}).catch(q=>{U||w(q instanceof Error?q.message:String(q))}).finally(()=>{U||m(!0)}),()=>{U=!0}},[r,e,n,t,z]),R.useEffect(()=>{C(!1)},[s]);const N=R.useRef(!1),T=R.useRef(o);T.current=o;const j=R.useRef(a);j.current=a;const D=R.useRef(!1),I=R.useCallback(U=>N.current||j.current?!1:(N.current=!0,S(!0),w(null),GWe(e,n,{sessionId:t,resolve:U}).then(q=>{D.current=!1,v(q),q.pulled.includes(n)&&(j.current?C(!0):T.current(q.pulled))}).catch(q=>{D.current=!0,v(null),w(q instanceof Error?q.message:String(q))}).finally(()=>{N.current=!1,S(!1)}),!0),[e,n,t]),L=R.useRef(null);return R.useEffect(()=>{if(!r||!h||!f||a)return;const U=`${n}:${f.projectId}:${s}`;L.current!==U&&I()&&(L.current=U)},[r,h,f,n,s,a,g,I]),R.useEffect(()=>{if(!r||!h||!f||a)return;const U=setInterval(()=>{N.current||D.current||VWe(e,n,{sessionId:t}).then(q=>{q.remoteChanged&&I()}).catch(q=>{D.current=!0,w(q instanceof Error?q.message:String(q))})},Ydt);return()=>clearInterval(U)},[r,h,f,a,e,n,t,I]),{hasToken:l,link:f,loaded:h,syncing:g,last:k,error:b,blocked:a,staleOnDisk:y,reloaded:()=>C(!1),uploadUrl:WWe(e,n,{sessionId:t}),saveToken:async U=>{const q=await uE(U);c(q.hasToken)},linkProject:async U=>{z(await UWe(e,n,{project:U,sessionId:t}))},unlink:async()=>{z(await qWe(e,n,{sessionId:t})),L.current=null,D.current=!1,v(null),w(null)},sync:U=>{D.current=!1,I(U)},dismiss:()=>{D.current=!1,w(null)}}}function Qdt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function Tk(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=s.indexOf("?"),l=o===-1?s:s.slice(0,o),c=o===-1?"":s.slice(o+1);let f;try{f=decodeURI(l)}catch{return null}if(!f||f.includes("\0"))return null;const _=f.startsWith("/"),h=_?[]:e.split("/").filter(Boolean);for(const m of f.split("/"))if(!(!m||m===".")){if(m===".."){if(h.length===0)return null;h.pop();continue}h.push(m)}return h.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${h.join("/")}`,query:c,hash:a}}function Jdt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}function eht({value:e,onChange:n,onSave:t,onBlur:r,path:s,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const c=R.useMemo(()=>Zz(e,Ix(s)),[e,s]),{ruleCh:f,codeCh:_}=kj(c.length),h=R.useRef(null),m=R.useRef(null),g=()=>{const v=h.current;v&&m.current&&(m.current.scrollTop=v.scrollTop)};R.useLayoutEffect(g,[e]),R.useLayoutEffect(()=>{var z;const v=h.current;if(!v||!a)return;const b=e.split(` -`),w=Math.min(Math.max(Math.trunc(a),1),b.length);let y=0;for(let N=0;N{if((v.metaKey||v.ctrlKey)&&v.key.toLowerCase()==="s"){v.preventDefault(),t();return}if(v.key==="Tab"){v.preventDefault();const b=v.currentTarget,{selectionStart:w,selectionEnd:y}=b,C=e.slice(0,w)+" "+e.slice(y);n(C),requestAnimationFrame(()=>{b.selectionStart=b.selectionEnd=w+1})}},k=`absolute inset-0 m-0 py-3.5 pe-4 ${F0} ${wj} [scrollbar-gutter:stable]`;return d.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${F0}`,children:[d.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${f}ch`},"aria-hidden":"true"}),d.jsx("div",{ref:m,className:`file-view-code ${k} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:c.map((v,b)=>d.jsxs("div",{"data-line":b+1,className:"relative",style:{paddingInlineStart:`${_}ch`},children:[d.jsx("span",{className:`${Sj} absolute start-0 pe-[1ch]`,style:{width:`${f}ch`},children:b+1}),Qz(v)?d.jsx("br",{}):v]},b))}),d.jsx("textarea",{ref:h,className:`file-view-editarea ${k} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none`,style:{paddingInlineStart:`${_}ch`},value:e,onChange:v=>n(v.target.value),onScroll:g,onKeyDown:S,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}const H_=e=>eo(new Intl.ListFormat(E()).format(e.map(je)));function tht(e){if(e.error)return E2e();if(e.syncing)return sye();if(e.blocked)return S9();const n=e.last;return n?n.pulled.length&&n.pushed.length?Txe({pulled:H_(n.pulled),pushed:H_(n.pushed)}):n.pulled.length?Nxe({paths:H_(n.pulled)}):n.pushed.length?Lxe({paths:H_(n.pushed)}):n.conflicts.length?B2e():w9():Sxe()}function Mk({href:e}){return d.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:pxe()})}function nht({overleaf:e}){var m,g;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[a,o]=R.useState(null),[l,c]=R.useState(!1),f=()=>{t(""),o(null),c(!0)},_=!e.hasToken||l;async function h(S){S.preventDefault();const k=n.trim();if(!(r||!k)){s(!0),o(null);try{_?(await e.saveToken(k),c(!1)):await e.linkProject(k),t("")}catch(v){o(v instanceof Error?v.message:String(v))}finally{s(!1)}}}if(e.link&&!l){const S=((m=e.last)==null?void 0:m.conflicts)??[];return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("div",{className:"flex items-center flex-wrap gap-2 text-sm text-subtext",children:[d.jsx("span",{className:"flex-1 min-w-0",children:tht(e)}),e.syncing&&d.jsx("span",{className:Lt}),d.jsxs("a",{className:"inline-flex items-center gap-1 text-sm text-subtext whitespace-nowrap",href:e.link.url,target:"_blank",rel:"noreferrer",children:[exe()," ",d.jsx(Jl,{size:11})]}),d.jsx("button",{className:qn,disabled:e.syncing||e.blocked,"data-tip":e.blocked?$xe():void 0,onClick:()=>e.sync(),children:oxe()}),d.jsx("button",{className:Ul,disabled:e.syncing,onClick:()=>void e.unlink().catch(k=>{o(k instanceof Error?k.message:String(k))}),children:fxe()})]}),S.map(k=>d.jsxs("div",{className:"flex items-center flex-wrap gap-2 text-sm text-accent-red",children:[d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("code",{className:"font-mono",children:k})," ",V2e()]}),d.jsx("button",{className:qn,disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"keep-local"}),children:Y2e()}),d.jsx("button",{className:qn,disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"take-overleaf"}),children:vxe()})]},k)),((g=e.last)==null?void 0:g.note)&&d.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),a&&d.jsx("div",{className:"text-sm text-accent-red whitespace-pre-wrap",children:a}),d.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[d.jsx(Mk,{href:e.uploadUrl}),d.jsx("button",{type:"button",className:Ul,onClick:f,children:Y6()})]})]})}return d.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:h,children:[d.jsx("div",{className:"text-sm text-subtext",children:_?lye():dye()}),d.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[d.jsx("input",{className:"flex-1 min-w-55 font-mono text-sm",type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?v2e():"https://www.overleaf.com/project/…",autoComplete:"off"}),d.jsx("button",{type:"submit",className:qn,disabled:r||!n.trim(),children:r?_?xa():rp():_?Vxe():j2e()}),d.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?p2e():D2e()})]}),a&&d.jsx("div",{className:"text-sm text-accent-red whitespace-pre-wrap",children:a}),d.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[d.jsx(Mk,{href:e.uploadUrl}),l?d.jsx("button",{type:"button",className:Ul,onClick:()=>c(!1),children:F2e()}):e.hasToken&&d.jsx("button",{type:"button",className:Ul,onClick:f,children:Y6()})]})]})}function rht({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const a=r.current;if(a){const o=document.createRange();o.selectNodeContents(a);const l=window.getSelection();l==null||l.removeAllRanges(),l==null||l.addRange(o)}t("select"),setTimeout(()=>t("idle"),4e3)}};return d.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[d.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}),d.jsx("button",{className:mn,"data-tip":n==="copied"?b0():n==="select"?bue():Mle(),"aria-label":Ole(),onClick:()=>void s(),children:n==="copied"?d.jsx(os,{size:13}):d.jsx(ap,{size:13})})]})}function sht({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:a,branchLabel:o,onOpenFile:l,scrollPosition:c,onScrollPositionChange:f,lineScrollRequest:_,onLineScrollRequestHandled:h,onEdit:m}){var un;const[g,S]=R.useState(null),[k,v]=R.useState(null),[b,w]=R.useState(!0),[y,C]=R.useState(0),z=t==="artifacts",N=t==="abs",T=Dy(n),j=bj(n),[D,I]=R.useState(!1),[L,U]=R.useState(""),[q,W]=R.useState(!1),[Z,X]=R.useState(null),J=R.useRef(null),ee=R.useRef(c),$=(g==null?void 0:g.file)??null,B=(g==null?void 0:g.source)==="checkout"?g.file.path:n,H=B.split("/").slice(0,-1).join("/"),K=R.useCallback(Xe=>{var lt;return((lt=Tk(H,Xe,N))==null?void 0:lt.path)??null},[N,H]),G=R.useCallback(Xe=>{if(Qdt(Xe))return Xe;const lt=Tk(H,Xe,N);if(!lt)return null;const gn=N?p7(lt.path):w1(e,lt.path,{sessionId:r,ref:s});return Jdt(gn,lt)},[s,N,H,e,r]),ie=Ej($==null?void 0:$.presentation),ve=(g==null?void 0:g.source)==="artifact"&&!z,ce=z&&(g==null?void 0:g.source)==="checkout",re=(g==null?void 0:g.source)==="artifact",P=!s&&(g==null?void 0:g.source)==="checkout"&&$!=null&&!$.notFound,oe=r!=null&&(g==null?void 0:g.source)==="checkout"&&g.file.root==="clone",ue=P&&$!=null&&!$.binary&&!$.truncated&&!ie&&!oe,de=R.useMemo(()=>(($==null?void 0:$.content)??"").replace(/\r\n/g,` -`),[$==null?void 0:$.content]),ge=ue&&L!==de,Ee=R.useRef(null);R.useEffect(()=>{const Xe=($==null?void 0:$.content)??"";if(Ee.current!==null&&Xe===Ee.current){Ee.current=null;return}U(Xe.replace(/\r\n/g,` -`)),X(null)},[$==null?void 0:$.content,n]);const Ae=async()=>{if(!ue||$==null||!ge||q)return!ge;const Xe=$.content.includes(`\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 D=this._getMouseBufferCoords(j),I=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(I&&L&&D)&&this._areCoordsInSelection(D,I,L)}isCellInSelection(j,D){const I=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!I||!L)&&this._areCoordsInSelection([j,D],I,L)}_areCoordsInSelection(j,D,I){return j[1]>D[1]&&j[1]=D[0]&&j[0]=D[0]}_selectWordAtCursor(j,D){var P,q;const I=(q=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:q.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(j);return!!L&&(this._selectWordAt(L,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,D){this._model.clearSelection(),j=Math.max(j,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const D=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(j){let D=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(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 D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const D=this._getMouseBufferCoords(j);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 I=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(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 D=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const L=(0,m.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!j||!D||j[0]===D[0]&&j[1]===D[1]);I?j&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(j,D,I)}_fireOnSelectionChange(j,D,I){this._oldSelectionStart=j,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(j,D){let I=D;for(let L=0;D>=L;L++){const P=j.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:P>1&&D!==L&&(I+=P-1)}return I}setSelection(j,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,D,I=!0,L=!0){if(j[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,q=P.lines.get(j[1]);if(!q)return;const W=P.translateBufferLineToString(j[1],!1);let Z=this._convertViewportColToCharacterIndex(q,j[0]),X=Z;const J=j[0]-Z;let ee=0,$=0,B=0,H=0;if(W.charAt(Z)===" "){for(;Z>0&&W.charAt(Z-1)===" ";)Z--;for(;X1&&(H+=ce-1,X+=ce-1);ie>0&&Z>0&&!this._isCharWordSeparator(q.loadCell(ie-1,this._workCell));){q.loadCell(ie-1,this._workCell);const re=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ie--):re>1&&(B+=re-1,Z-=re-1),Z--,ie--}for(;ve1&&(H+=re-1,X+=re-1),X++,ve++}}X++;let K=Z+J-ee+B,G=Math.min(this._bufferService.cols,X-Z+ee+$-B-H);if(D||W.slice(Z,X).trim()!==""){if(I&&K===0&&q.getCodePoint(0)!==32){const ie=P.lines.get(j[1]-1);if(ie&&q.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ve){const ce=this._bufferService.cols-ve.start;K-=ce,G+=ce}}}if(L&&K+G===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ie=P.lines.get(j[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const ve=this._getWordAt([0,j[1]+1],!1,!1,!0);ve&&(G+=ve.length)}}return{start:K,length:G}}}_selectWordAt(j,D){const I=this._getWordAt(j,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[I.start,j[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(j){const D=this._getWordAt(j,!0);if(D){let I=j[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const D=this._bufferService.buffer.getWrappedRangeForLine(j),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=T=f([_(3,C.IBufferService),_(4,C.ICoreService),_(5,S.IMouseService),_(6,C.IOptionsService),_(7,S.IRenderService),_(8,S.ICoreBrowserService)],T)},4725:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=c(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(o,l,c){var f=this&&this.__decorate||function(T,j,D,I){var L,P=arguments.length,q=P<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,D,I);else for(var W=T.length-1;W>=0;W--)(L=T[W])&&(q=(P<3?L(q):P>3?L(j,D,q):L(j,D))||q);return P>3&&q&&Object.defineProperty(j,D,q),q},_=this&&this.__param||function(T,j){return function(D,I){j(D,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),m=c(8055),g=c(8460),S=c(844),k=c(2585),v=m.css.toColor("#ffffff"),b=m.css.toColor("#000000"),w=m.css.toColor("#ffffff"),y=m.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=j[D/36%6|0],L=j[D/6%6|0],P=j[D%6];T.push({css:m.channels.toCss(I,L,P),rgba:m.channels.toRgba(I,L,P)})}for(let D=0;D<24;D++){const I=8+10*D;T.push({css:m.channels.toCss(I,I,I),rgba:m.channels.toRgba(I,I,I)})}return T})());let z=l.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:m.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:m.color.blend(b,C),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=m.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=m.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,m.NULL_COLOR):void 0,j.selectionForeground===m.NULL_COLOR&&(j.selectionForeground=void 0),m.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=m.color.opacity(j.selectionBackgroundTransparent,.3)),m.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=m.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=l.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,l.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,l.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,l.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,l.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,l.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,l.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,l.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,l.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,l.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,l.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,l.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,l.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,l.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,l.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,l.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const D=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let I=0;I{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=c(8460),_=c(844);class d extends _.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const S=new Array(g);for(let k=0;kthis._length)for(let S=this._length;S=g;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(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,k){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let b=S-1;b>=0;b--)this.set(g+b+k,this.get(g+b));const v=g+S+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(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(f,_=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const m in f)d[m]=_<=1?f[m]:f[m]&&c(f[m],_-1);return d}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,f=0,_=0,d=0;var m,g,S,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,z,N,T){return{css:y.toCss(C,z,N,T),rgba:y.toRgba(C,z,N,T)}}})(m||(l.channels=m={})),(function(y){function C(z,N){return d=Math.round(255*N),[c,f,_]=v.toChannels(z.rgba),{css:m.toCss(c,f,_,d),rgba:m.toRgba(c,f,_,d)}}y.blend=function(z,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,D=N.rgba>>8&255,I=z.rgba>>24&255,L=z.rgba>>16&255,P=z.rgba>>8&255;return c=I+Math.round((T-I)*d),f=L+Math.round((j-L)*d),_=P+Math.round((D-P)*d),{css:m.toCss(c,f,_),rgba:m.toRgba(c,f,_)}},y.isOpaque=function(z){return(255&z.rgba)==255},y.ensureContrastRatio=function(z,N,T){const j=v.ensureContrastRatio(z.rgba,N.rgba,T);if(j)return m.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(z){const N=(255|z.rgba)>>>0;return[c,f,_]=v.toChannels(N),{css:m.toCss(c,f,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(z,N){return d=255&z.rgba,C(z,d*N/255)},y.toColorRGB=function(z){return[z.rgba>>24&255,z.rgba>>16&255,z.rgba>>8&255]}})(g||(l.color=g={})),(function(y){let C,z;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",z=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),m.toColor(c,f,_);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),m.toColor(c,f,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),f=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),m.toColor(c,f,_,d);if(!C||!z)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=z,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,f,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(c,f,_,d),css:N}}})(S||(l.css=S={})),(function(y){function C(z,N,T){const j=z/255,D=N/255,I=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(z){return C(z>>16&255,z>>8&255,255&z)},y.relativeLuminance2=C})(k||(l.rgb=k={})),(function(y){function C(N,T,j){const D=N>>24&255,I=N>>16&255,L=N>>8&255;let P=T>>24&255,q=T>>16&255,W=T>>8&255,Z=w(k.relativeLuminance2(P,q,W),k.relativeLuminance2(D,I,L));for(;Z0||q>0||W>0);)P-=Math.max(0,Math.ceil(.1*P)),q-=Math.max(0,Math.ceil(.1*q)),W-=Math.max(0,Math.ceil(.1*W)),Z=w(k.relativeLuminance2(P,q,W),k.relativeLuminance2(D,I,L));return(P<<24|q<<16|W<<8|255)>>>0}function z(N,T,j){const D=N>>24&255,I=N>>16&255,L=N>>8&255;let P=T>>24&255,q=T>>16&255,W=T>>8&255,Z=w(k.relativeLuminance2(P,q,W),k.relativeLuminance2(D,I,L));for(;Z>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,D=T>>16&255,I=T>>8&255,L=N>>24&255,P=N>>16&255,q=N>>8&255;return c=L+Math.round((j-L)*d),f=P+Math.round((D-P)*d),_=q+Math.round((I-q)*d),m.toRgba(c,f,_)},y.ensureContrastRatio=function(N,T,j){const D=k.relativeLuminance(N>>8),I=k.relativeLuminance(T>>8);if(w(D,I)>8));if(Ww(D,k.relativeLuminance(Z>>8))?q:Z}return q}const L=z(N,T,j),P=w(D,k.relativeLuminance(L>>8));if(Pw(D,k.relativeLuminance(q>>8))?L:q}return L}},y.reduceLuminance=C,y.increaseLuminance=z,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(l.rgba=v={})),l.toPaddedHex=b,l.contrastRatio=w},8969:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=c(844),_=c(2585),d=c(4348),m=c(7866),g=c(744),S=c(7302),k=c(6975),v=c(8460),b=c(1753),w=c(1480),y=c(7994),C=c(9282),z=c(5435),N=c(5981),T=c(2660);let j=!1;class D extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((L=>{var P;(P=this._onScrollApi)==null||P.fire(L.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(L){for(const P in L)this.optionsService.options[P]=L[P]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new f.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 d.InstantiationService,this.optionsService=this.register(new S.OptionsService(L)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.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((P=>{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((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((P,q)=>this._inputHandler.parse(P,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,P){this._writeBuffer.write(L,P)}writeSync(L,P){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(L,P)}input(L,P=!0){this.coreService.triggerDataEvent(L,P)}resize(L,P){isNaN(L)||isNaN(P)||(L=Math.max(L,g.MINIMUM_COLS),P=Math.max(P,g.MINIMUM_ROWS),this._bufferService.resize(L,P))}scroll(L,P=!1){this._bufferService.scroll(L,P)}scrollLines(L,P,q){this._bufferService.scrollLines(L,P,q)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const P=L-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(L,P){return this._inputHandler.registerEscHandler(L,P)}registerDcsHandler(L,P){return this._inputHandler.registerDcsHandler(L,P)}registerCsiHandler(L,P){return this._inputHandler.registerCsiHandler(L,P)}registerOscHandler(L,P){return this._inputHandler.registerOscHandler(L,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?L=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const P of L)P.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;ff.fire(_)))},l.runAndSubscribe=function(c,f){return f(void 0),c((_=>f(_)))}},5435:function(o,l,c){var f=this&&this.__decorate||function(ee,$,B,H){var K,G=arguments.length,ie=G<3?$:H===null?H=Object.getOwnPropertyDescriptor($,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(ee,$,B,H);else for(var ve=ee.length-1;ve>=0;ve--)(K=ee[ve])&&(ie=(G<3?K(ie):G>3?K($,B,ie):K($,B))||ie);return G>3&&ie&&Object.defineProperty($,B,ie),ie},_=this&&this.__param||function(ee,$){return function(B,H){$(B,H,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=c(2584),m=c(7116),g=c(2015),S=c(844),k=c(482),v=c(8437),b=c(8460),w=c(643),y=c(511),C=c(3734),z=c(2585),N=c(1480),T=c(6242),j=c(6351),D=c(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},L=131072;function P(ee,$){if(ee>24)return $.setWinLines||!1;switch(ee){case 1:return!!$.restoreWin;case 2:return!!$.minimizeWin;case 3:return!!$.setWinPosition;case 4:return!!$.setWinSizePixels;case 5:return!!$.raiseWin;case 6:return!!$.lowerWin;case 7:return!!$.refreshWin;case 8:return!!$.setWinSizeChars;case 9:return!!$.maximizeWin;case 10:return!!$.fullscreenWin;case 11:return!!$.getWinState;case 13:return!!$.getWinPosition;case 14:return!!$.getWinSizePixels;case 15:return!!$.getScreenSizePixels;case 16:return!!$.getCellSizePixels;case 18:return!!$.getWinSizeChars;case 19:return!!$.getScreenSizeChars;case 20:return!!$.getIconTitle;case 21:return!!$.getWinTitle;case 22:return!!$.pushTitle;case 23:return!!$.popTitle;case 24:return!!$.setWinLines}return!1}var q;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(l.WindowsOptionsReportType=q={}));let W=0;class Z extends S.Disposable{getAttrData(){return this._curAttrData}constructor($,B,H,K,G,ie,ve,ce,re=new g.EscapeSequenceParser){super(),this._bufferService=$,this._charsetService=B,this._coreService=H,this._logService=K,this._optionsService=G,this._oscLinkService=ie,this._coreMouseService=ve,this._unicodeService=ce,this._parser=re,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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:oe.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,oe,ue)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:oe,data:ue})})),this._parser.setDcsHandlerFallback(((F,oe,ue)=>{oe==="HOOK"&&(ue=ue.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:oe,payload:ue})})),this._parser.setPrintHandler(((F,oe,ue)=>this.print(F,oe,ue))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new T.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new T.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new T.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new T.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new T.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new T.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new T.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new T.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new T.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new T.OscHandler((F=>this.restoreCursorColor(F)))),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 F in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((F,oe)=>this.requestStatusString(F,oe))))}_preserveStack($,B,H,K){this._parseStack.paused=!0,this._parseStack.cursorStartX=$,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=H,this._parseStack.position=K}_logSlowResolvingAsync($){this._logService.logLevel<=z.LogLevelEnum.WARN&&Promise.race([$,new Promise(((B,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse($,B){let H,K=this._activeBuffer.x,G=this._activeBuffer.y,ie=0;const ve=this._parseStack.paused;if(ve){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(H),H;K=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,$.length>L&&(ie=this._parseStack.position+L)}if(this._logService.logLevel<=z.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof $=="string"?` "${$}"`:` "${Array.prototype.map.call($,(F=>String.fromCharCode(F))).join("")}"`),typeof $=="string"?$.split("").map((F=>F.charCodeAt(0))):$),this._parseBuffer.length<$.length&&this._parseBuffer.lengthL)for(let F=ie;F<$.length;F+=L){const oe=F+L<$.length?F+L:$.length,ue=typeof $=="string"?this._stringDecoder.decode($.substring(F,oe),this._parseBuffer):this._utf8Decoder.decode($.subarray(F,oe),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,ue))return this._preserveStack(K,G,ue,F),this._logSlowResolvingAsync(H),H}else if(!ve){const F=typeof $=="string"?this._stringDecoder.decode($,this._parseBuffer):this._utf8Decoder.decode($,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,F))return this._preserveStack(K,G,F,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===K&&this._activeBuffer.y===G||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),re=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);re0&&ue.getWidth(this._activeBuffer.x-1)===2&&ue.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let he=this._parser.precedingJoinState;for(let me=B;mece){if(re){const Te=ue;let Ie=this._activeBuffer.x-He;for(this._activeBuffer.x=He,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),ue=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&ue instanceof v.BufferLine&&ue.copyCellsFrom(Te,Ie,0,He,!1);Ie=0;)ue.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(F&&(ue.insertCells(this._activeBuffer.x,G-He,this._activeBuffer.getNullCell(oe)),ue.getWidth(ce-1)===2&&ue.setCellFromCodepoint(ce-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,oe)),ue.setCellFromCodepoint(this._activeBuffer.x++,K,G,oe),G>0)for(;--G;)ue.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=he,this._activeBuffer.x0&&ue.getWidth(this._activeBuffer.x)===0&&!ue.hasContent(this._activeBuffer.x)&&ue.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler($,B){return $.final!=="t"||$.prefix||$.intermediates?this._parser.registerCsiHandler($,B):this._parser.registerCsiHandler($,(H=>!P(H.params[0],this._optionsService.rawOptions.windowOptions)||B(H)))}registerDcsHandler($,B){return this._parser.registerDcsHandler($,new j.DcsHandler(B))}registerEscHandler($,B){return this._parser.registerEscHandler($,B)}registerOscHandler($,B){return this._parser.registerOscHandler($,new T.OscHandler(B))}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 $;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&&(($=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&$.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const $=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-$),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor($=this._bufferService.cols-1){this._activeBuffer.x=Math.min($,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){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=$,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=$,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor($,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+$,this._activeBuffer.y+B)}cursorUp($){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,$.params[0]||1)):this._moveCursor(0,-($.params[0]||1)),!0}cursorDown($){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,$.params[0]||1)):this._moveCursor(0,$.params[0]||1),!0}cursorForward($){return this._moveCursor($.params[0]||1,0),!0}cursorBackward($){return this._moveCursor(-($.params[0]||1),0),!0}cursorNextLine($){return this.cursorDown($),this._activeBuffer.x=0,!0}cursorPrecedingLine($){return this.cursorUp($),this._activeBuffer.x=0,!0}cursorCharAbsolute($){return this._setCursor(($.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition($){return this._setCursor($.length>=2?($.params[1]||1)-1:0,($.params[0]||1)-1),!0}charPosAbsolute($){return this._setCursor(($.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative($){return this._moveCursor($.params[0]||1,0),!0}linePosAbsolute($){return this._setCursor(this._activeBuffer.x,($.params[0]||1)-1),!0}vPositionRelative($){return this._moveCursor(0,$.params[0]||1),!0}hVPosition($){return this.cursorPosition($),!0}tabClear($){const B=$.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab($){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=$.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab($){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=$.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected($){const B=$.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine($,B,H,K=!1,G=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);ie.replaceCells(B,H,this._activeBuffer.getNullCell(this._eraseAttrData()),G),K&&(ie.isWrapped=!1)}_resetBufferLine($,B=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+$);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+$),H.isWrapped=!1)}eraseInDisplay($,B=!1){let H;switch(this._restrictCursor(this._bufferService.cols),$.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,B);this._dirtyRowTracker.markDirty(0);break;case 3:const K=this._activeBuffer.lines.length-this._bufferService.rows;K>0&&(this._activeBuffer.lines.trimStart(K),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-K,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-K,0),this._onScroll.fire(0))}return!0}eraseInLine($,B=!1){switch(this._restrictCursor(this._bufferService.cols),$.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines($){this._restrictCursor();let 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 re=ce;for(let F=1;F0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary($){return $.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent($.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is($){return(this._optionsService.rawOptions.termName+"").indexOf($)===0}setMode($){for(let B=0;B<$.length;B++)switch($.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate($){for(let B=0;B<$.length;B++)switch($.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode($){for(let B=0;B<$.length;B++)switch($.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate($){for(let B=0;B<$.length;B++)switch($.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),$.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode($,B){const H=this._coreService.decPrivateModes,{activeProtocol:K,activeEncoding:G}=this._coreMouseService,ie=this._coreService,{buffers:ve,cols:ce}=this._bufferService,{active:re,alt:F}=ve,oe=this._optionsService.rawOptions,ue=Re=>Re?1:2,he=$.params[0];return me=he,Ee=B?he===2?4:he===4?ue(ie.modes.insertMode):he===12?3:he===20?ue(oe.convertEol):0:he===1?ue(H.applicationCursorKeys):he===3?oe.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:he===6?ue(H.origin):he===7?ue(H.wraparound):he===8?3:he===9?ue(K==="X10"):he===12?ue(oe.cursorBlink):he===25?ue(!ie.isCursorHidden):he===45?ue(H.reverseWraparound):he===66?ue(H.applicationKeypad):he===67?4:he===1e3?ue(K==="VT200"):he===1002?ue(K==="DRAG"):he===1003?ue(K==="ANY"):he===1004?ue(H.sendFocus):he===1005?4:he===1006?ue(G==="SGR"):he===1015?4:he===1016?ue(G==="SGR_PIXELS"):he===1048?1:he===47||he===1047||he===1049?ue(re===F):he===2004?ue(H.bracketedPasteMode):0,ie.triggerDataEvent(`${d.C0.ESC}[${B?"":"?"}${me};${Ee}$y`),!0;var me,Ee}_updateAttrColor($,B,H,K,G){return B===2?($|=50331648,$&=-16777216,$|=C.AttributeData.fromColorRGB([H,K,G])):B===5&&($&=-50331904,$|=33554432|255&H),$}_extractColor($,B,H){const K=[0,0,-1,0,0,0];let G=0,ie=0;do{if(K[ie+G]=$.params[B+ie],$.hasSubParams(B+ie)){const ve=$.getSubParams(B+ie);let ce=0;do K[1]===5&&(G=1),K[ie+ce+1+G]=ve[ce];while(++ce=2||K[1]===2&&ie+G>=5)break;K[1]&&(G=1)}while(++ie+B<$.length&&ie+G5)&&($=1),B.extended.underlineStyle=$,B.fg|=268435456,$===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0($){$.fg=v.DEFAULT_ATTR_DATA.fg,$.bg=v.DEFAULT_ATTR_DATA.bg,$.extended=$.extended.clone(),$.extended.underlineStyle=0,$.extended.underlineColor&=-67108864,$.updateExtended()}charAttributes($){if($.length===1&&$.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=$.length;let H;const K=this._curAttrData;for(let G=0;G=30&&H<=37?(K.fg&=-50331904,K.fg|=16777216|H-30):H>=40&&H<=47?(K.bg&=-50331904,K.bg|=16777216|H-40):H>=90&&H<=97?(K.fg&=-50331904,K.fg|=16777224|H-90):H>=100&&H<=107?(K.bg&=-50331904,K.bg|=16777224|H-100):H===0?this._processSGR0(K):H===1?K.fg|=134217728:H===3?K.bg|=67108864:H===4?(K.fg|=268435456,this._processUnderline($.hasSubParams(G)?$.getSubParams(G)[0]:1,K)):H===5?K.fg|=536870912:H===7?K.fg|=67108864:H===8?K.fg|=1073741824:H===9?K.fg|=2147483648:H===2?K.bg|=134217728:H===21?this._processUnderline(2,K):H===22?(K.fg&=-134217729,K.bg&=-134217729):H===23?K.bg&=-67108865:H===24?(K.fg&=-268435457,this._processUnderline(0,K)):H===25?K.fg&=-536870913:H===27?K.fg&=-67108865:H===28?K.fg&=-1073741825:H===29?K.fg&=2147483647:H===39?(K.fg&=-67108864,K.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):H===49?(K.bg&=-67108864,K.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?G+=this._extractColor($,G,K):H===53?K.bg|=1073741824:H===55?K.bg&=-1073741825:H===59?(K.extended=K.extended.clone(),K.extended.underlineColor=-1,K.updateExtended()):H===100?(K.fg&=-67108864,K.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,K.bg&=-67108864,K.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus($){switch($.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${B};${H}R`)}return!0}deviceStatusPrivate($){if($.params[0]===6){const B=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${B};${H}R`)}return!0}softReset($){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($){const B=$.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const H=B%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion($){const B=$.params[0]||1;let H;return($.length<2||(H=$.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions($){if(!P($.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=$.length>1?$.params[1]:0;switch($.params[0]){case 14:B!==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(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor($){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($){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($){return this._windowTitle=$,this._onTitleChange.fire($),!0}setIconName($){return this._iconName=$,!0}setOrReportIndexedColor($){const B=[],H=$.split(";");for(;H.length>1;){const K=H.shift(),G=H.shift();if(/^\d+$/.exec(K)){const ie=parseInt(K);if(J(ie))if(G==="?")B.push({type:0,index:ie});else{const ve=(0,D.parseColor)(G);ve&&B.push({type:1,index:ie,color:ve})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink($){const B=$.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink($,B){this._getCurrentLinkId()&&this._finishHyperlink();const H=$.split(":");let K;const G=H.findIndex((ie=>ie.startsWith("id=")));return G!==-1&&(K=H[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:K,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor($,B){const H=$.split(";");for(let K=0;K=this._specialColors.length);++K,++B)if(H[K]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const G=(0,D.parseColor)(H[K]);G&&this._onColor.fire([{type:1,index:this._specialColors[B],color:G}])}return!0}setOrReportFgColor($){return this._setOrReportSpecialColor($,0)}setOrReportBgColor($){return this._setOrReportSpecialColor($,1)}setOrReportCursorColor($){return this._setOrReportSpecialColor($,2)}restoreIndexedColor($){if(!$)return this._onColor.fire([{type:2}]),!0;const B=[],H=$.split(";");for(let K=0;K=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 $=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,$,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($){return this._charsetService.setgLevel($),!0}screenAlignmentPattern(){const $=new y.CellData;$.content=4194373,$.fg=this._curAttrData.fg,$.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B(this._coreService.triggerDataEvent(`${d.C0.ESC}${G}${d.C0.ESC}\\`),!0))($==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:$==='"p'?'P1$r61;1"p':$==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:$==="m"?"P1$r0m":$===" q"?`P1$r${{block:2,underline:4,bar:6}[K.cursorStyle]-(K.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty($,B){this._dirtyRowTracker.markRangeDirty($,B)}}l.InputHandler=Z;let X=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,$){ee>$&&(W=ee,ee=$,$=W),eethis.end&&(this.end=$)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(ee){return 0<=ee&&ee<256}X=f([_(0,z.IBufferService)],X)},844:(o,l)=>{function c(f){for(const _ of f)_.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)==null||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=c,l.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(_,d,m){this._data[_]||(this._data[_]={}),this._data[_][d]=m}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(f,_,d,m,g){this._data.get(f,_)||this._data.set(f,_,new c),this._data.get(f,_).set(d,m,g)}get(f,_,d,m){var g;return(g=this._data.get(f,_))==null?void 0:g.get(d,m)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const _=c.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const _=this._getKey(f);if(_===void 0||(c=this._search(_),c===-1)||this._getKey(this._array[c])!==_)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===f))do _(this._array[c]);while(++c=_;){let m=_+d>>1;const g=this._getKey(this._array[m]);if(g>f)d=m-1;else{if(!(g0&&this._getKey(this._array[m-1])===f;)m--;return m}_=m+1}}return _}}},7226:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=c(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),this._start()}flush(){for(;this._ib)return v-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-S))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=c(643);l.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),m=d==null?void 0:d.get(_.cols-1),g=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);g&&m&&(g.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,m=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=c(6349),_=c(7226),d=c(3734),m=c(8437),g=c(4634),S=c(511),k=c(643),v=c(4863),b=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(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 d.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 d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new m.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=m.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 f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(m.DEFAULT_ATTR_DATA);let z=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),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 m.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(N0&&(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=N}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,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(C.length>0){const z=(0,g.reflowLargerCreateNewLayout)(this.lines,C);(0,g.reflowLargerApplyNewLayout)(this.lines,z.layout),this._reflowLargerAdjustViewport(w,y,z.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const z=this.getNullCell(m.DEFAULT_ATTR_DATA);let N=C;for(;N-- >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 D=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),D.unshift(j);const I=this.ybase+this.y;if(I>=T&&I0&&(z.push({start:T+D.length+N,newLines:Z}),N+=Z.length),D.push(...Z);let X=P.length-1,J=P[X];J===0&&(X--,J=P[X]);let ee=D.length-q-1,$=L;for(;ee>=0;){const H=Math.min($,J);if(D[X]===void 0)break;if(D[X].copyCellsFrom(D[ee],$-H,J-H,H,!0),J-=H,J===0&&(X--,J=P[X]),$-=H,$===0){ee--;const K=Math.max(ee,0);$=(0,g.getWrappedLineTrimmedLength)(D,K,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const T=[],j=[];for(let X=0;X=0;X--)if(P&&P.start>I+q){for(let J=P.newLines.length-1;J>=0;J--)this.lines.set(X--,P.newLines[J]);X++,T.push({index:I+1,amount:P.newLines.length}),q+=P.newLines.length,P=z[++L]}else this.lines.set(X,j[I--]);let W=0;for(let X=T.length-1;X>=0;X--)T[X].index+=W,this.lines.onInsertEmitter.fire(T[X]),W+=T[X].amount;const Z=Math.max(0,D+N-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}}translateBufferLineToString(w,y,C=0,z){const N=this.lines.get(w);return N?N.translateToString(y,C,z):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=c(3734),_=c(511),d=c(643),m=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let g=0;class S{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.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[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.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,m.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return g=3*v,b.content=this._data[g+0],b.fg=this._data[g+1],b.bg=this._data[g+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,m.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,m.stringFromCodePoint)(2097151&y)+(0,m.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[N]}const C=Object.keys(this._extendedAttrs);for(let z=0;z=v&&delete this._extendedAttrs[N]}}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 z=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]=z[3*(b+T)+j];268435456&z[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}}l.BufferLine=S},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(o,l)=>{function c(f,_,d){if(_===f.length-1)return f[_].getTrimmedLength();const m=!f[_].hasContent(d-1)&&f[_].getWidth(d-1)===1,g=f[_+1].getWidth(0)===2;return m&&g?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,_,d,m,g){const S=[];for(let k=0;k=k&&m0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(S.push(k+w.length-T),S.push(T)),k+=w.length-1}return S},l.reflowLargerCreateNewLayout=function(f,_){const d=[];let m=0,g=_[m],S=0;for(let k=0;kc(f,w,_))).reduce(((b,w)=>b+w));let S=0,k=0,v=0;for(;vb&&(S-=b,k++);const w=f[k].getWidth(S-1)===2;w&&S--;const y=w?d-1:d;m.push(y),v+=y}return m},l.getWrappedLineTrimmedLength=c},5295:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=c(8460),_=c(844),d=c(9092);class m extends _.Disposable{constructor(S,k){super(),this._optionsService=S,this._bufferService=k,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(S,k){this._normal.resize(S,k),this._alt.resize(S,k),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}l.BufferSet=m},511:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=c(482),_=c(643),d=c(3734);class m extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const k=new m;return k.setFromCharData(S),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(S[_.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(S[_.CHAR_DATA_CHAR_INDEX].length===2){const v=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|S[_.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[_.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=S[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=m},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=c(8460),_=c(844);class d{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}l.Marker=d,d._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var c,f,_;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(l.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(l.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(_||(l.C1_ESCAPED=_={}))},7399:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=c(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(d,m,g,S){const k={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?k.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?k.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?k.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(k.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:k.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(k.key=f.C0.ESC+k.key);break;case 9:if(d.shiftKey){k.key=f.C0.ESC+"[Z";break}k.key=f.C0.HT,k.cancel=!0;break;case 13:k.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,k.cancel=!0;break;case 27:k.key=f.C0.ESC,d.altKey&&(k.key=f.C0.ESC+f.C0.ESC),k.cancel=!0;break;case 37:if(d.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"D",k.key===f.C0.ESC+"[1;3D"&&(k.key=f.C0.ESC+(g?"b":"[1;5D"))):k.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"C",k.key===f.C0.ESC+"[1;3C"&&(k.key=f.C0.ESC+(g?"f":"[1;5C"))):k.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"A",g||k.key!==f.C0.ESC+"[1;3A"||(k.key=f.C0.ESC+"[1;5A")):k.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(k.key=f.C0.ESC+"[1;"+(v+1)+"B",g||k.key!==f.C0.ESC+"[1;3B"||(k.key=f.C0.ESC+"[1;5B")):k.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(k.key=f.C0.ESC+"[2~");break;case 46:k.key=v?f.C0.ESC+"[3;"+(v+1)+"~":f.C0.ESC+"[3~";break;case 36:k.key=v?f.C0.ESC+"[1;"+(v+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:k.key=v?f.C0.ESC+"[1;"+(v+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?k.type=2:d.ctrlKey?k.key=f.C0.ESC+"[5;"+(v+1)+"~":k.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?k.type=3:d.ctrlKey?k.key=f.C0.ESC+"[6;"+(v+1)+"~":k.key=f.C0.ESC+"[6~";break;case 112:k.key=v?f.C0.ESC+"[1;"+(v+1)+"P":f.C0.ESC+"OP";break;case 113:k.key=v?f.C0.ESC+"[1;"+(v+1)+"Q":f.C0.ESC+"OQ";break;case 114:k.key=v?f.C0.ESC+"[1;"+(v+1)+"R":f.C0.ESC+"OR";break;case 115:k.key=v?f.C0.ESC+"[1;"+(v+1)+"S":f.C0.ESC+"OS";break;case 116:k.key=v?f.C0.ESC+"[15;"+(v+1)+"~":f.C0.ESC+"[15~";break;case 117:k.key=v?f.C0.ESC+"[17;"+(v+1)+"~":f.C0.ESC+"[17~";break;case 118:k.key=v?f.C0.ESC+"[18;"+(v+1)+"~":f.C0.ESC+"[18~";break;case 119:k.key=v?f.C0.ESC+"[19;"+(v+1)+"~":f.C0.ESC+"[19~";break;case 120:k.key=v?f.C0.ESC+"[20;"+(v+1)+"~":f.C0.ESC+"[20~";break;case 121:k.key=v?f.C0.ESC+"[21;"+(v+1)+"~":f.C0.ESC+"[21~";break;case 122:k.key=v?f.C0.ESC+"[23;"+(v+1)+"~":f.C0.ESC+"[23~";break;case 123:k.key=v?f.C0.ESC+"[24;"+(v+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(g&&!S||!d.altKey||d.metaKey)!g||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?k.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(k.key=f.C0.US),d.key==="@"&&(k.key=f.C0.NUL)):d.keyCode===65&&(k.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)k.key=f.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),k.key=f.C0.ESC+C}else if(d.keyCode===32)k.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),k.key=f.C0.ESC+y,k.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?k.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?k.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?k.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?k.key=f.C0.DEL:d.keyCode===219?k.key=f.C0.ESC:d.keyCode===220?k.key=f.C0.FS:d.keyCode===221&&(k.key=f.C0.GS)}return k}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,f=0,_=c.length){let d="";for(let m=f;m<_;++m){let g=c[m];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const _=c.length;if(!_)return 0;let d=0,m=0;if(this._interim){const g=c.charCodeAt(m++);56320<=g&&g<=57343?f[d++]=1024*(this._interim-55296)+g-56320+65536:(f[d++]=this._interim,f[d++]=g),this._interim=0}for(let g=m;g<_;++g){const S=c.charCodeAt(g);if(55296<=S&&S<=56319){if(++g>=_)return this._interim=S,d;const k=c.charCodeAt(g);56320<=k&&k<=57343?f[d++]=1024*(S-55296)+k-56320+65536:(f[d++]=S,f[d++]=k)}else S!==65279&&(f[d++]=S)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const _=c.length;if(!_)return 0;let d,m,g,S,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 N,T=0;for(;(N=63&this.interim[++T])&&T<4;)z<<=6,z|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=j-T;for(;b=_)return 0;if(N=c[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,z<<=6,z|=63&N}C||(j===2?z<128?b--:f[k++]=z:j===3?z<2048||z>=55296&&z<=57343||z===65279||(f[k++]=z):z<65536||z>1114111||(f[k++]=z)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,k;if(m=c[y++],(192&m)!=128){y--;continue}if(v=(31&d)<<6|63&m,v<128){y--;continue}f[k++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(v=(15&d)<<12|(63&m)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;f[k++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=m,this.interim[2]=g,k;if(S=c[y++],(192&S)!=128){y--;continue}if(v=(7&d)<<18|(63&m)<<12|(63&g)<<6|63&S,v<65536||v>1114111)continue;f[k++]=v}}return k}}},225:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=c(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;l.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<_.length;++g)m.fill(0,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(S,k){let v,b=0,w=k.length-1;if(Sk[w][1])return!1;for(;w>=b;)if(v=b+w>>1,S>k[v][1])b=v+1;else{if(!(S=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,S){let k=this.wcwidth(g),v=k===0&&S!==0;if(v){const b=f.UnicodeService.extractWidth(S);b===0?v=!1:b>k&&(k=b)}return f.UnicodeService.createPropertyValue(0,k,v)}}},5981:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=c(8460),_=c(844);class d extends _.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),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(g,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S)}_innerWrite(g=0,S=!0){const k=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,S);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()}}l.WriteBuffer=d},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function _(d,m){const g=d.toString(16),S=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}l.parseColor=function(d){if(!d)return;let m=d.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=c.exec(m);if(g){const S=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/S*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/S*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/S*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,S=[0,0,0];for(let k=0;k<3;++k){const v=parseInt(m.slice(g*k,g*k+g),16);S[k]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return S}},l.toRgbString=function(d,m=16){const[g,S,k]=d;return`rgb:${_(g,m)}/${_(S,m)}/${_(k,m)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=c(482),_=c(8742),d=c(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(S,k){this._handlers[S]===void 0&&(this._handlers[S]=[]);const v=this._handlers[S];return v.push(k),{dispose:()=>{const b=v.indexOf(k);b!==-1&&v.splice(b,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(S,k){if(this.reset(),this._ident=S,this._active=this._handlers[S]||m,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(S,k,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(S,k,v);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(S,k,v))}unhook(S,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(S),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",S);this._active=m,this._ident=0}};const g=new _.Params;g.addParam(0),l.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=g,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():g,this._data="",this._hitLimit=!1}put(S,k,v){this._hitLimit||(this._data+=(0,f.utf32ToString)(S,k,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let k=!1;if(this._hitLimit)k=!1;else if(S&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((v=>(this._params=g,this._data="",this._hitLimit=!1,v)));return this._params=g,this._data="",this._hitLimit=!1,k}}},2015:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=c(844),_=c(8742),d=c(6242),m=c(6351);class g{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 z=0;zj)),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 z=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),z)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,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(S,0,2,0),v.add(S,8,5,8),v.add(S,6,0,6),v.add(S,11,0,11),v.add(S,13,13,13),v})();class k extends f.Disposable{constructor(b=l.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 _.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,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new m.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 z=0;zN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}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 z=C.indexOf(w);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,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 z=C.indexOf(w);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,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,z){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=z}parse(b,w,y){let C,z=0,N=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 D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=j[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=j[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,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>=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=w||(z=b[q])<32||z>126&&z=0&&(C=D[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,D,I,N,j),C;I<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 L=this._escHandlers[this._collect<<8|z];let P=L?L.length-1:-1;for(;P>=0&&(C=L[P](),C!==!0);P--)if(C instanceof Promise)return this._preserveStack(4,L,P,N,j),C;P<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>=w||(z=b[q])===24||z===26||z===27||z>127&&z=w||(z=b[q])<32||z>127&&z{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=c(5770),_=c(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const S=this._handlers[m];return S.push(g),{dispose:()=>{const k=S.indexOf(g);k!==-1&&S.splice(k,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,S){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(m,g,S);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(m,g,S))}start(){this.reset(),this._state=1}put(m,g,S){if(this._state!==3){if(this._state===1)for(;g0&&this._put(m,g,S)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,k=this._active.length-1,v=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,S=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&S===!1){for(;k>=0&&(S=this._active[k].end(m),S!==!0);k--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,S;k--}for(;k>=0;k--)if(S=this._active[k].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",m);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,S){this._hitLimit||(this._data+=(0,_.utf32ToString)(m,g,S),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,g}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class f{static fromArray(d){const m=new f;if(!d.length)return m;for(let g=Array.isArray(d[0])?1:0;g256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&d.push(Array.prototype.slice.call(this._subParams,g,S))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const m=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const d={};for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&(d[m]=this._subParams.slice(g,S))}return d}addDigit(d){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,S=g[m-1];g[m-1]=~S?Math.min(10*S+d,c):d}}l.Params=f},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const _={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(_),f.dispose=()=>this._wrappedAddonDispose(_),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let _=0;_{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=c(3785),_=c(511);l.BufferApiView=class{constructor(d,m){this._buffer=d,this.type=m}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const m=this._buffer.lines.get(d);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new _.CellData}}},3785:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=c(511);l.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new f.CellData)}translateToString(_,d,m){return this._line.translateToString(_,d,m)}}},8285:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=c(8771),_=c(8460),d=c(844);class m extends d.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=m},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(_=>f(_.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((_,d)=>f(_,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(o,l,c){var f=this&&this.__decorate||function(v,b,w,y){var C,z=arguments.length,N=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(z<3?C(N):z>3?C(b,w,N):C(b,w))||N);return z>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=c(8460),m=c(844),g=c(5295),S=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let k=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new g.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,z=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;z===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(z+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=z-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(z,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))}};l.BufferService=k=f([_(0,S.IOptionsService)],k)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(o,l,c){var f=this&&this.__decorate||function(y,C,z,N){var T,j=arguments.length,D=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,z):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,z,N);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(D=(j<3?T(D):j>3?T(C,z,D):T(C,z))||D);return j>3&&D&&Object.defineProperty(C,z,D),D},_=this&&this.__param||function(y,C){return function(z,N){C(z,N,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=c(2585),m=c(8460),g=c(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function k(y,C){let 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 w=l.CoreMouseService=class extends g.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 m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const z of Object.keys(S))this.addProtocol(z,S[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}};l.CoreMouseService=w=f([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(o,l,c){var f=this&&this.__decorate||function(w,y,C,z){var N,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(w,y,C,z);else for(var D=w.length-1;D>=0;D--)(N=w[D])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,z){y(C,z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=c(1439),m=c(8460),g=c(844),S=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=l.CoreService=class extends g.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 m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(k),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(k),this.decPrivateModes=(0,d.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((z=>z.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=b=f([_(0,S.IBufferService),_(1,S.ILogService),_(2,S.IOptionsService)],b)},9074:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=c(8055),_=c(8460),d=c(844),m=c(6106);let g=0,S=0;class k extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.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 z=0,N=0;for(const T of this._decorations.getKeyIterator(y))z=T.options.x??0,N=z+(T.options.width??1),w>=z&&w{g=N.options.x??0,S=g+(N.options.width??1),w>=g&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=c(2585),_=c(8343);class d{constructor(...g){this._entries=new Map;for(const[S,k]of g)this.set(S,k)}set(g,S){const k=this._entries.get(g);return this._entries.set(g,S),k}forEach(g){for(const[S,k]of this._entries.entries())g(S,k)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const S=(0,_.getServiceDependencies)(m).sort(((b,w)=>b.index-w.index)),k=[];for(const b of S){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${b.id}.`);k.push(w)}const v=S.length>0?S[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new m(...g,...k)}}},7866:function(o,l,c){var f=this&&this.__decorate||function(v,b,w,y){var C,z=arguments.length,N=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(z<3?C(N):z>3?C(b,w,N):C(b,w))||N);return z>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=c(844),m=c(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let S,k=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const z=y.apply(this,C);return S.trace(`GlyphRenderer#${y.name} return`,z),z}}},7302:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=c(8460),_=c(844),d=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends _.Disposable{constructor(k){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.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,_.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 l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in l.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=l.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=l.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=m.includes(v)?v:l.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}}l.OptionsService=g},2660:function(o,l,c){var f=this&&this.__decorate||function(g,S,k,v){var b,w=arguments.length,y=w<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,k):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(g,S,k,v);else for(var C=g.length-1;C>=0;C--)(b=g[C])&&(y=(w<3?b(y):w>3?b(S,k,y):b(S,k))||y);return w>3&&y&&Object.defineProperty(S,k,y),y},_=this&&this.__param||function(g,S){return function(k,v){S(k,v,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=c(2585);let m=l.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const S=this._bufferService.buffer;if(g.id===void 0){const C=S.addMarker(S.ybase+S.y),z={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(z,C))),this._dataByLinkId.set(z.id,z),z.id}const k=g,v=this._getEntryIdKey(k),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,S.ybase+S.y),b.id;const w=S.addMarker(S.ybase+S.y),y={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(g,S){const k=this._dataByLinkId.get(g);if(k&&k.lines.every((v=>v.line!==S))){const v=this._bufferService.buffer.addMarker(S);k.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(k,v)))}}getLinkData(g){var S;return(S=this._dataByLinkId.get(g))==null?void 0:S.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,S){const k=g.lines.indexOf(S);k!==-1&&(g.lines.splice(k,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};l.OscLinkService=m=f([_(0,d.IBufferService)],m)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(_){return _[f]||[]},l.createDecorator=function(_){if(l.serviceRegistry.has(_))return l.serviceRegistry.get(_);const d=function(m,g,S){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[f].push({id:k,index:b}):(v[f]=[{id:k,index:b}],v[c]=v)})(d,m,S)};return d.toString=()=>_,l.serviceRegistry.set(_,d),d}},2585:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=c(8343);var _;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(l.LogLevelEnum=_={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=c(8460),_=c(225);class d{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,S,k=!1){return(16777215&g)<<3|(3&S)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const g=new _.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let S=0,k=0;const v=g.length;for(let b=0;b=v)return S+this.wcwidth(w);const z=g.charCodeAt(b);56320<=z&&z<=57343?w=1024*(w-55296)+z-56320+65536:S+=this.wcwidth(z)}const y=this.charProperties(w,k);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(k)),S+=C,k=y}return S}charProperties(g,S){return this._activeProvider.charProperties(g,S)}}l.UnicodeService=d}},r={};function s(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return t[o].call(c.exports,c,c.exports,s),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=s(9042),c=s(3236),f=s(844),_=s(5741),d=s(8285),m=s(7975),g=s(7090),S=["cols","rows"];class k extends f.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=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:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,z)}}_checkReadonlyOptions(b){if(S.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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const 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 l}_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")}}o.Terminal=k})(),a})()))})(Ab)),Ab.exports}var zdt=Ndt();function Mk(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const r=new zdt.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),s=new Edt.FitAddon;r.loadAddon(s),r.open(t);try{s.fit()}catch{}const a=new ResizeObserver(()=>{try{s.fit()}catch{}});a.observe(t);let o=!1,l=0,c=!1,f=!1;async function _(){if(c){f=!0;return}c=!0;try{for(;;){const m=await pKe(e,l);if(o)return;if(m.dataBase64&&r.write(Mk(m.dataBase64)),l=m.nextOffset,m.eof)break}}catch{}finally{c=!1,f&&!o&&(f=!1,_())}}const d=GXe(e,m=>{if(o)return;const g=Mk(m.dataBase64);!c&&m.offset===l?(r.write(g),l+=g.length):m.offset+g.length>l&&_()});return _(),()=>{o=!0,d(),a.disconnect(),r.dispose()}},[e]),h.jsx("div",{ref:n,style:{width:"100%",height:"100%"}})}function jdt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:c}){const f=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?h.jsx(kdt,{experiment:e,parentExperiment:o,project:n,runs:f,onOpenLogs:(_,d)=>l("terminal",_,d),onOpenCode:_=>c("files",_)}):h.jsx(Tdt,{experiment:e,expRuns:f,selectedRunId:s,onSelectRun:a})}function Tdt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,a]=R.useState(null),[o,l]=R.useState(null),[c,f]=R.useState(!1),_=R.useRef(null),d=t&&n.find(b=>b.id===t)||n[0]||null,m=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",g=!!(d&&m&&(d.cancelRequested||o===d.id)),S=b=>{const w=n.findIndex(y=>y.id===b);return w===-1?n.length:n.length-w},k=R.useRef(null);R.useEffect(()=>{if(k.current===null){k.current=new Set(n.map(w=>w.id));return}const b=n.find(w=>!k.current.has(w.id));for(const w of n)k.current.add(w.id);b&&r(b.id)},[n,r]),R.useEffect(()=>{if(!c)return;const b=w=>{var y;(y=_.current)!=null&&y.contains(w.target)||f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c]);async function v(){if(d){a(null),l(d.id);try{await hE(d.id)}catch(b){l(null),a(b instanceof Error?b.message:String(b))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{style:{flex:1}}),s&&h.jsx("span",{className:"error",role:"alert",children:s}),m&&h.jsxs("button",{className:`${Zs} ghost`,disabled:g,onClick:()=>void v(),children:[h.jsx(K9,{size:13}),g?Vte():p9()]}),n.length>0&&d&&h.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[h.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pe-1.5 pb-1 ps-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:Pie(),onClick:()=>f(b=>!b),children:[h.jsxs("span",{className:"run-label",children:[z6()," ",S(d.id)]}),h.jsx(no,{status:g?"cancelling":Si(d)}),h.jsx(ya,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:n.map(b=>h.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-start py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ms-auto [&_.when]:text-xs [&_.when]:text-muted ${b.id===(d==null?void 0:d.id)?"active":""}`,onClick:()=>{r(b.id),f(!1)},children:[h.jsxs("span",{className:"run-label",children:[z6()," ",S(b.id)]}),h.jsx(no,{status:Si(b)}),h.jsx("span",{className:"when",children:Gi(b.createdAt)})]},b.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pe-0 pb-1 ps-1.5",children:d?h.jsx(Adt,{runId:d.id},d.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:Lie()})})]})}function Mdt({projectId:e,filePath:n,sessionId:t,enabled:r,ready:s,source:a}){const[o,l]=R.useState(void 0),[c,f]=R.useState(null),[_,d]=R.useState(null),[m,g]=R.useState(!1),[S,k]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,z]=R.useState(null),[N,T]=R.useState(null),[j,D]=R.useState(!1),[I,L]=R.useState(0),P=R.useCallback(J=>{D(J),J&&L(ee=>ee+1)},[]),q=R.useRef(a);q.current=a,R.useEffect(()=>{if(!r)return;let J=!1;return yKe().then(ee=>{J||(l(ee.engine),f(ee.hint),d(ee.installCommand))}).catch(()=>{J||l(null)}),()=>{J=!0}},[r]);const W=R.useRef(!1),Z=R.useCallback(()=>{if(W.current)return;W.current=!0,g(!0);const J=q.current;T(null),b(null),z(null),wKe(e,n,{sessionId:t}).then(ee=>{var B,H;const $=ee.pdfPath;if(ee.ok&&$){k(K=>({path:$,version:((K==null?void 0:K.version)??0)+1,source:J})),y(ee.hadErrors),z(ee.note),ee.hadErrors&&b(((B=ee.log)==null?void 0:B.trim())||null),P(!0);return}k(null),y(!1),z(ee.note),D(!1),b(((H=ee.log)==null?void 0:H.trim())||Sde())}).catch(ee=>{k(null),y(!1),z(null),D(!1),T(ee instanceof Error?ee.message:String(ee))}).finally(()=>{W.current=!1,g(!1)})},[e,n,t,P]),X=R.useRef(null);return R.useEffect(()=>{!r||!s||!o||X.current!==n&&(X.current=n,Z())},[r,s,o,n,Z]),{engine:o,installHint:c,installCommand:_,compiling:m,compiled:S,stale:S!==null&&S.source!==a,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:P,viewNonce:I,compile:Z,dismiss:()=>{T(null),b(null)}}}const Rdt=3e4;function Ddt({projectId:e,filePath:n,sessionId:t,enabled:r,savedSource:s,dirty:a,onPulled:o}){const[l,c]=R.useState(!1),[f,_]=R.useState(null),[d,m]=R.useState(!1),[g,S]=R.useState(!1),[k,v]=R.useState(null),[b,w]=R.useState(null),[y,C]=R.useState(!1),z=R.useCallback(P=>{c(P.hasToken),_(P.link)},[]);R.useEffect(()=>{let P=!1;if(m(!1),_(null),v(null),w(null),C(!1),D.current=!1,!!r)return CKe(e,n,{sessionId:t}).then(q=>{P||z(q)}).catch(q=>{P||w(q instanceof Error?q.message:String(q))}).finally(()=>{P||m(!0)}),()=>{P=!0}},[r,e,n,t,z]),R.useEffect(()=>{C(!1)},[s]);const N=R.useRef(!1),T=R.useRef(o);T.current=o;const j=R.useRef(a);j.current=a;const D=R.useRef(!1),I=R.useCallback(P=>N.current||j.current?!1:(N.current=!0,S(!0),w(null),zKe(e,n,{sessionId:t,resolve:P}).then(q=>{D.current=!1,v(q),q.pulled.includes(n)&&(j.current?C(!0):T.current(q.pulled))}).catch(q=>{D.current=!0,v(null),w(q instanceof Error?q.message:String(q))}).finally(()=>{N.current=!1,S(!1)}),!0),[e,n,t]),L=R.useRef(null);return R.useEffect(()=>{if(!r||!d||!f||a)return;const P=`${n}:${f.projectId}:${s}`;L.current!==P&&I()&&(L.current=P)},[r,d,f,n,s,a,g,I]),R.useEffect(()=>{if(!r||!d||!f||a)return;const P=setInterval(()=>{N.current||D.current||AKe(e,n,{sessionId:t}).then(q=>{q.remoteChanged&&I()}).catch(q=>{D.current=!0,w(q instanceof Error?q.message:String(q))})},Rdt);return()=>clearInterval(P)},[r,d,f,a,e,n,t,I]),{hasToken:l,link:f,loaded:d,syncing:g,last:k,error:b,blocked:a,staleOnDisk:y,reloaded:()=>C(!1),uploadUrl:jKe(e,n,{sessionId:t}),saveToken:async P=>{const q=await dE(P);c(q.hasToken)},linkProject:async P=>{z(await EKe(e,n,{project:P,sessionId:t}))},unlink:async()=>{z(await NKe(e,n,{sessionId:t})),L.current=null,D.current=!1,v(null),w(null)},sync:P=>{D.current=!1,I(P)},dismiss:()=>{D.current=!1,w(null)}}}function Ldt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function Rk(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=s.indexOf("?"),l=o===-1?s:s.slice(0,o),c=o===-1?"":s.slice(o+1);let f;try{f=decodeURI(l)}catch{return null}if(!f||f.includes("\0"))return null;const _=f.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const m of f.split("/"))if(!(!m||m===".")){if(m===".."){if(d.length===0)return null;d.pop();continue}d.push(m)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:c,hash:a}}function Odt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}function Idt({value:e,onChange:n,onSave:t,onBlur:r,path:s,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const c=R.useMemo(()=>eA(e,$x(s)),[e,s]),{ruleCh:f,codeCh:_}=Nj(c.length),d=R.useRef(null),m=R.useRef(null),g=()=>{const v=d.current;v&&m.current&&(m.current.scrollTop=v.scrollTop)};R.useLayoutEffect(g,[e]),R.useLayoutEffect(()=>{var z;const v=d.current;if(!v||!a)return;const b=e.split(` +`),w=Math.min(Math.max(Math.trunc(a),1),b.length);let y=0;for(let N=0;N{if((v.metaKey||v.ctrlKey)&&v.key.toLowerCase()==="s"){v.preventDefault(),t();return}if(v.key==="Tab"){v.preventDefault();const b=v.currentTarget,{selectionStart:w,selectionEnd:y}=b,C=e.slice(0,w)+" "+e.slice(y);n(C),requestAnimationFrame(()=>{b.selectionStart=b.selectionEnd=w+1})}},k=`absolute inset-0 m-0 py-3.5 pe-4 ${U0} ${Cj} [scrollbar-gutter:stable]`;return h.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${U0}`,children:[h.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${f}ch`},"aria-hidden":"true"}),h.jsx("div",{ref:m,className:`file-view-code ${k} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:c.map((v,b)=>h.jsxs("div",{"data-line":b+1,className:"relative",style:{paddingInlineStart:`${_}ch`},children:[h.jsx("span",{className:`${Ej} absolute start-0 pe-[1ch]`,style:{width:`${f}ch`},children:b+1}),tA(v)?h.jsx("br",{}):v]},b))}),h.jsx("textarea",{ref:d,className:`file-view-editarea ${k} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none`,style:{paddingInlineStart:`${_}ch`},value:e,onChange:v=>n(v.target.value),onScroll:g,onKeyDown:S,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}const H_=e=>eo(new Intl.ListFormat(E()).format(e.map(Ae)));function Bdt(e){if(e.error)return cxe();if(e.syncing)return Fye();if(e.blocked)return E9();const n=e.last;return n?n.pulled.length&&n.pushed.length?_ye({pulled:H_(n.pulled),pushed:H_(n.pushed)}):n.pulled.length?uye({paths:H_(n.pulled)}):n.pushed.length?bye({paths:H_(n.pushed)}):n.conflicts.length?yxe():C9():aye()}function Dk({href:e}){return h.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:Qxe()})}function $dt({overleaf:e}){var m,g;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[a,o]=R.useState(null),[l,c]=R.useState(!1),f=()=>{t(""),o(null),c(!0)},_=!e.hasToken||l;async function d(S){S.preventDefault();const k=n.trim();if(!(r||!k)){s(!0),o(null);try{_?(await e.saveToken(k),c(!1)):await e.linkProject(k),t("")}catch(v){o(v instanceof Error?v.message:String(v))}finally{s(!1)}}}if(e.link&&!l){const S=((m=e.last)==null?void 0:m.conflicts)??[];return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center flex-wrap gap-2 text-sm text-subtext",children:[h.jsx("span",{className:"flex-1 min-w-0",children:Bdt(e)}),e.syncing&&h.jsx("span",{className:Dt}),h.jsxs("a",{className:"inline-flex items-center gap-1 text-sm text-subtext whitespace-nowrap",href:e.link.url,target:"_blank",rel:"noreferrer",children:[Ixe()," ",h.jsx(Jl,{size:11})]}),h.jsx("button",{className:Wn,disabled:e.syncing||e.blocked,"data-tip":e.blocked?wye():void 0,onClick:()=>e.sync(),children:qxe()}),h.jsx("button",{className:Ul,disabled:e.syncing,onClick:()=>void e.unlink().catch(k=>{o(k instanceof Error?k.message:String(k))}),children:Kxe()})]}),S.map(k=>h.jsxs("div",{className:"flex items-center flex-wrap gap-2 text-sm text-accent-red",children:[h.jsxs("span",{className:"flex-1 min-w-0",children:[h.jsx("code",{className:"font-mono",children:k})," ",Axe()]}),h.jsx("button",{className:Wn,disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"keep-local"}),children:Rxe()}),h.jsx("button",{className:Wn,disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"take-overleaf"}),children:nye()})]},k)),((g=e.last)==null?void 0:g.note)&&h.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),a&&h.jsx("div",{className:"text-sm text-accent-red whitespace-pre-wrap",children:a}),h.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[h.jsx(Dk,{href:e.uploadUrl}),h.jsx("button",{type:"button",className:Ul,onClick:f,children:Q6()})]})]})}return h.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[h.jsx("div",{className:"text-sm text-subtext",children:_?Gye():Xye()}),h.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[h.jsx("input",{className:"flex-1 min-w-55 font-mono text-sm",type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?nxe():"https://www.overleaf.com/project/…",autoComplete:"off"}),h.jsx("button",{type:"submit",className:Wn,disabled:r||!n.trim(),children:r?_?xa():sp():_?Aye():dxe()}),h.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?Q2e():gxe()})]}),a&&h.jsx("div",{className:"text-sm text-accent-red whitespace-pre-wrap",children:a}),h.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[h.jsx(Dk,{href:e.uploadUrl}),l?h.jsx("button",{type:"button",className:Ul,onClick:()=>c(!1),children:Cxe()}):e.hasToken&&h.jsx("button",{type:"button",className:Ul,onClick:f,children:Q6()})]})]})}function Hdt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const a=r.current;if(a){const o=document.createRange();o.selectNodeContents(a);const l=window.getSelection();l==null||l.removeAllRanges(),l==null||l.addRange(o)}t("select"),setTimeout(()=>t("idle"),4e3)}};return h.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[h.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}),h.jsx("button",{className:vn,"data-tip":n==="copied"?v0():n==="select"?yue():Lle(),"aria-label":$le(),onClick:()=>void s(),children:n==="copied"?h.jsx(ds,{size:13}):h.jsx(op,{size:13})})]})}function Fdt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:a,branchLabel:o,onOpenFile:l,scrollPosition:c,onScrollPositionChange:f,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:m}){var dn;const[g,S]=R.useState(null),[k,v]=R.useState(null),[b,w]=R.useState(!0),[y,C]=R.useState(0),z=t==="artifacts",N=t==="abs",T=Oy(n),j=yj(n),[D,I]=R.useState(!1),[L,P]=R.useState(""),[q,W]=R.useState(!1),[Z,X]=R.useState(null),J=R.useRef(null),ee=R.useRef(c),$=(g==null?void 0:g.file)??null,B=(g==null?void 0:g.source)==="checkout"?g.file.path:n,H=B.split("/").slice(0,-1).join("/"),K=R.useCallback(Ke=>{var ut;return((ut=Rk(H,Ke,N))==null?void 0:ut.path)??null},[N,H]),G=R.useCallback(Ke=>{if(Ldt(Ke))return Ke;const ut=Rk(H,Ke,N);if(!ut)return null;const _n=N?g7(ut.path):C1(e,ut.path,{sessionId:r,ref:s});return Odt(_n,ut)},[s,N,H,e,r]),ie=Aj($==null?void 0:$.presentation),ve=(g==null?void 0:g.source)==="artifact"&&!z,ce=z&&(g==null?void 0:g.source)==="checkout",re=(g==null?void 0:g.source)==="artifact",F=!s&&(g==null?void 0:g.source)==="checkout"&&$!=null&&!$.notFound,oe=r!=null&&(g==null?void 0:g.source)==="checkout"&&g.file.root==="clone",ue=F&&$!=null&&!$.binary&&!$.truncated&&!ie&&!oe,he=R.useMemo(()=>(($==null?void 0:$.content)??"").replace(/\r\n/g,` +`),[$==null?void 0:$.content]),me=ue&&L!==he,Ee=R.useRef(null);R.useEffect(()=>{const Ke=($==null?void 0:$.content)??"";if(Ee.current!==null&&Ke===Ee.current){Ee.current=null;return}P(Ke.replace(/\r\n/g,` +`)),X(null)},[$==null?void 0:$.content,n]);const Re=async()=>{if(!ue||$==null||!me||q)return!me;const Ke=$.content.includes(`\r `)?L.replace(/\n/g,`\r -`):L;W(!0),X(null);try{return await OWe(e,B,Xe,{sessionId:r}),Ee.current=Xe,S(lt=>lt&<.source==="checkout"?{source:"checkout",file:{...lt.file,content:Xe}}:lt),!0}catch(lt){return X(lt instanceof Error?lt.message:String(lt)),!1}finally{W(!1)}},He=j&&P&&!oe,Re=Xdt({projectId:e,filePath:B,sessionId:r,enabled:He,ready:$!=null&&!$.notFound,source:ue?L:($==null?void 0:$.content)??""}),Ie=Zdt({projectId:e,filePath:B,sessionId:r,enabled:He,savedSource:de,dirty:ge,onPulled:R.useCallback(Xe=>{Xe.includes(B)&&C(lt=>lt+1)},[B])}),[nt,Rt]=R.useState(!1),At=((un=Ie.last)==null?void 0:un.conflicts.length)??0;R.useEffect(()=>{At>0&&Rt(!0)},[At]);const bt=Ie.error?eye():At>0?f2e():Ie.blocked?S9():Ie.link?w9():Yxe(),Mt=Ie.error||At>0?"text-accent-red":Ie.link?"text-accent-green":void 0,Ct=j&&Re.showPdf&&Re.compiled!=null,ut=ue&&!(T&&!D)&&!Ct,ht=Re.compiled?`${w1(e,Re.compiled.path,{sessionId:r})}&v=${Re.compiled.version}`:null,we=ht?`${ht}&view=${Re.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,Le=Re.compiled?Re.compiled.path.split("/").pop()??Re.compiled.path:null,Ge=async()=>{ge&&!await Ae()||j&&Re.engine&&Re.compile()},et=async()=>{ge&&await Ge()},[st,Dt]=R.useState(!1),[vt,It]=R.useState(null),Zt=async()=>{Dt(!0),It(null);try{await IWe(e,B,{sessionId:r})}catch(Xe){It(Xe instanceof Error?Xe.message:String(Xe))}finally{Dt(!1)}},xt=`${N?p7(n):re?Vd(e,n):w1(e,B,{sessionId:r,ref:s})}&v=${y}`;R.useEffect(()=>{let Xe=!1;w(!0);const lt=async()=>{const Be=await kKe(e,n),Qe=(Be==null?void 0:Be.presentation)==="text"||(Be==null?void 0:Be.presentation)==="unknown",St=Be&&Qe?await _E(e,n):null,fn=Be===null||Qe&&St===null;return{path:n,content:(St==null?void 0:St.content)??"",truncated:(St==null?void 0:St.truncated)??!1,binary:(St==null?void 0:St.binary)??(Be==null?void 0:Be.presentation)==="download",notFound:fn,presentation:St?St.binary?"download":"text":(Be==null?void 0:Be.presentation)??"download"}},gn=async()=>{for(const Be of[`artifacts/${n}`,n]){const Qe=await _7(e,Be,{sessionId:r}).catch(()=>null);if(Qe&&!Qe.notFound)return Qe}return null};return(N?LWe(n).then(Be=>({source:"absolute",file:Be})):z?lt().then(async Be=>{if(!Be.notFound)return{source:"artifact",file:Be};const Qe=await gn();return Qe?{source:"checkout",file:Qe}:{source:"artifact",file:Be}}):_7(e,n,{sessionId:r,ref:s}).then(Be=>Be.notFound&&!s?lt().then(Qe=>Qe.notFound?{source:"checkout",file:Be}:{source:"artifact",file:Qe,checkoutRoot:Be.root}):{source:"checkout",file:Be})).then(Be=>{Xe||(S(Be),v(null))}).catch(Be=>{Xe||v(Be.message)}).finally(()=>{Xe||w(!1)}),()=>{Xe=!0}},[e,n,t,r,s,y]),R.useLayoutEffect(()=>{const Xe=J.current,lt=ee.current;!Xe||!$||!lt||(Xe.scrollTop=lt.top,Xe.scrollLeft=lt.left)},[$]);const Sn=Xe=>{if(Xe.source==="absolute")return Mce();if(z)return kce({root:r?v_():b_()});if(s)return zce({branch:je(s)});if(r&&Xe.source==="checkout"&&Xe.file.root==="clone")return que();const lt=Xe.source==="checkout"?Xe.file.root:Xe.checkoutRoot;return Oce({root:lt==="worktree"?v_():b_()})};return d.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[d.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[d.jsx(wu,{size:13,style:{flexShrink:0}}),d.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:B,children:B}),o&&d.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:OD({branch:je(o)}),children:[d.jsx(lp,{size:11}),o]}),ut&&(q||ge||Z)&&d.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${Z?"text-accent-red":"text-muted"}`,title:Z??(q?xa():Hue()),children:q?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Lt})," ",_ue()]}):Z?uue():Oue()}),j&&Re.compiled&&d.jsx("button",{className:`${mn} ${Re.showPdf?"":"active"}`,"data-tip":Re.stale&&Re.showPdf?Zce():Re.showPdf?iu():M6(),"data-tip-align":"end","aria-label":Re.showPdf?iu():M6(),onClick:()=>Re.setShowPdf(!Re.showPdf),children:Re.showPdf?d.jsx(Wb,{size:13}):d.jsx(wu,{size:13,className:Re.stale?"text-accent-amber":void 0})}),j&&ht&&Le&&d.jsx("a",{className:mn,"data-tip":Re.stale?sce({name:je(Le)}):Uw({name:je(Le)}),"data-tip-align":"end","aria-label":Uw({name:je(Le)}),href:ht,download:Le,children:d.jsx(K9,{size:13,className:Re.stale?"text-accent-amber":void 0})}),He&&d.jsx("button",{className:`${mn} ${nt?"active":""}`,"data-tip":bt,"data-tip-align":"end","aria-label":pO({status:bt}),"aria-expanded":nt,onClick:()=>Rt(Xe=>!Xe),children:Ie.syncing?d.jsx("span",{className:Lt}):d.jsx(KGe,{size:13,className:Mt})}),j&&P&&d.jsx("button",{className:mn,"data-tip":Re.compiled?j6():N6(),"data-tip-align":"end","aria-label":Re.compiled?j6():N6(),disabled:Re.compiling||!Re.engine,onClick:()=>void Ge(),children:Re.compiling?d.jsx("span",{className:Lt}):d.jsx(iVe,{size:13})}),T&&d.jsx("button",{className:`${mn} ${D?"active":""}`,"data-tip":D?v0():iu(),"data-tip-align":"end","aria-label":D?v0():iu(),onClick:()=>I(Xe=>!Xe),children:d.jsx(Wb,{size:13})}),P&&d.jsx("button",{className:mn,"data-tip":vt??A6(),"data-tip-align":"end","aria-label":A6(),disabled:st,onClick:()=>void Zt(),children:st?d.jsx("span",{className:Lt}):d.jsx(Jl,{size:13})}),d.jsx("button",{className:mn,"data-tip":T6(),"data-tip-align":"end","aria-label":T6(),onClick:()=>C(Xe=>Xe+1),children:b?d.jsx("span",{className:Lt}):d.jsx(nE,{size:13})})]}),!k&&ce&&(g==null?void 0:g.source)==="checkout"&&d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Hce({root:g.file.root==="worktree"?v_():b_()})}),(Re.error||Re.log)&&d.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:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("span",{className:`flex-1 min-w-0 text-sm ${Re.builtWithErrors?"text-subtext":"text-accent-red"}`,children:Re.error??(Re.builtWithErrors?zle():yle())}),d.jsx("button",{className:mn,"data-tip":z6(),"data-tip-align":"end","aria-label":Wle(),onClick:Re.dismiss,children:d.jsx(Gr,{size:13})})]}),Re.log&&d.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:Re.log})]}),He&&Ie.staleOnDisk&&d.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:[d.jsx("span",{className:"flex-1 min-w-0",children:Wce()}),d.jsx("button",{className:qn,onClick:()=>{Ie.reloaded(),C(Xe=>Xe+1)},children:Hle()})]}),He&&Ie.error&&d.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4 flex items-start gap-2",children:[d.jsx("span",{className:"flex-1 min-w-0 text-sm text-accent-red whitespace-pre-wrap",children:Ie.error}),d.jsx("button",{className:mn,"data-tip":z6(),"data-tip-align":"end","aria-label":Zle(),onClick:Ie.dismiss,children:d.jsx(Gr,{size:13})})]}),He&&nt&&Ie.loaded&&d.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4",children:d.jsx(nht,{overleaf:Ie})}),j&&P&&Re.engine===null&&Re.installHint&&d.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[Re.installHint,Re.installCommand&&d.jsx(rht,{command:Re.installCommand})]}),Re.note&&d.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:Re.note}),Ct&&Re.stale&&d.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:zue()}),d.jsxs("div",{ref:J,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Xe=>{const lt={top:Xe.currentTarget.scrollTop,left:Xe.currentTarget.scrollLeft};ee.current=lt,f==null||f(lt)},children:[!ut&&!k&&!z&&(g==null?void 0:g.source)==="checkout"&&!g.file.notFound&&!s&&r&&g.file.root==="clone"&&d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Mue()}),!ut&&!k&&(g==null?void 0:g.source)==="artifact"&&!g.file.notFound&&ve&&d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:hle({root:g.checkoutRoot==="worktree"?v_():b_()})}),k?d.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[lce()," ",je(k)]}):$===null?d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:mce()}):$.notFound?d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:g?Sn(g):xce()}):ie?d.jsx(l2,{kind:ie,url:xt,name:n.split("/").pop()??n}):$.binary?d.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[gle()," ",d.jsx("a",{href:xt,download:n.split("/").pop()??n,children:_9()})]}):Ct&&we&&Le?d.jsx(l2,{kind:"pdf",url:we,name:Le,downloadBar:!1},we):T&&!D?d.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:re?d.jsx(Tj,{projectId:e,folder:H,markdown:$.content}):d.jsx(ga,{text:$.content,resolveFilePath:K,resolveImageSrc:G,onOpenFile:l&&((Xe,lt,gn,Cr,Be)=>l(Xe,r,s,Be))})}):ut?d.jsx(eht,{value:L,onChange:Xe=>{U(Xe),m==null||m(),Z&&X(null)},onSave:()=>void et(),onBlur:()=>void et(),path:n,highlightLine:a,scrollRequest:_,onScrollRequestHandled:h}):d.jsxs(d.Fragment,{children:[d.jsx(Cj,{text:$.content,path:n,highlightLine:a,scrollRequest:_,onScrollRequestHandled:h}),$.truncated&&d.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:dce()})]})]})]})}const Nb=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function iht({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:a,setOpen:o,ref:l}=_o(),c=R.useRef(null);return R.useEffect(()=>{if(!a)return;const f=_=>{var h;_.key==="Escape"&&((h=c.current)==null||h.focus())};return document.addEventListener("keydown",f,!0),()=>document.removeEventListener("keydown",f,!0)},[a]),d.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-start [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:start-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[d.jsx("button",{className:`${mn} project-back !text-text`,"aria-label":R6(),onClick:n,children:d.jsx(ud,{size:18})}),d.jsxs("div",{className:"project-switcher",ref:l,children:[d.jsxs("button",{ref:c,className:`brand${a?" open":""}`,onClick:()=>o(f=>!f),"aria-expanded":a,children:[d.jsxs("span",{className:"brand-project-copy",children:[d.jsx("span",{className:"brand-project-label",children:ude()}),d.jsx("span",{className:"brand-project",children:e})]}),d.jsx(ya,{className:"project-chevron",size:14})]}),a&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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 project-menu",children:[d.jsx("button",{className:Vr,onClick:()=>{o(!1),r()},children:d.jsxs("span",{className:Nb,children:[d.jsx(Q9,{size:14}),Jfe()]})}),d.jsx("button",{className:Vr,onClick:()=>{o(!1),n()},children:d.jsxs("span",{className:Nb,children:[d.jsx(SVe,{size:14}),R6()]})}),d.jsx("button",{className:Vr,onClick:()=>{var f;(f=c.current)==null||f.focus(),o(!1),t()},children:d.jsxs("span",{className:Nb,children:[d.jsx(hVe,{size:14}),rde()]})})]})]}),s&&d.jsx("button",{className:mn,"data-tip":D6(),"data-tip-align":"end","aria-label":D6(),onClick:s,children:d.jsx(eE,{size:15})})]})}const Rk=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),zd=["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(" "),Dk=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),Bj=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Lk=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),aht=[{id:"AI/ML",label:lge},{id:"Biology",label:dge},{id:"Physics",label:xge},{id:"Other",label:mge}];function oht({onDone:e,preferredAgent:n}){const[t,r]=R.useState(0),[s,a]=R.useState(null),[o,l]=R.useState(),[c,f]=R.useState(!1),[_,h]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState([]),[w,y]=R.useState(""),[C,z]=R.useState(""),[N,T]=R.useState([]),[j,D]=R.useState(""),[I,L]=R.useState([]),[U,q]=R.useState(!1),W=R.useRef(0),[Z,X]=R.useState(!1),[J,ee]=R.useState(!1),$=(s==null?void 0:s.some(P=>P.agentReady))??!1,B=o!=null,H=R.useRef(0),K=(P,oe=!1)=>{const ue=++H.current;k(!0),X(!1),ee(!1),l(void 0);const de=()=>ue===H.current;Promise.allSettled([k0(P,oe).then(ge=>de()&&a(ge)),oE().then(ge=>de()&&l(ge.gitVersion))]).then(([ge,Ee])=>{de()&&(ge.status==="rejected"&&(X(!0),a(null)),Ee.status==="rejected"&&(ee(!0),l(void 0)))}).finally(()=>de()&&k(!1))};R.useEffect(()=>K(!1),[]),R.useEffect(()=>{if(s===null)return;const P=s.filter(oe=>oe.agentReady);g(oe=>{var de;if(oe&&P.some(ge=>ge.id===oe))return oe;const ue=n&&P.find(ge=>ge.id===n.harness);return(ue==null?void 0:ue.id)??((de=P[0])==null?void 0:de.id)??null})},[s,n]),R.useEffect(()=>Z2(()=>{k0(!0).then(P=>{a(P),X(!1)}).catch(()=>X(!0))}),[]),R.useEffect(()=>{CKe().then(P=>{b(P.researchAreas),y(P.otherArea??""),z(P.background??""),T(P.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const P=j.trim();if(P.length<3){L([]),q(!1);return}const oe=++W.current;q(!0);const ue=setTimeout(()=>{lE(P).then(de=>oe===W.current&&L(de)).catch(()=>oe===W.current&&L([])).finally(()=>oe===W.current&&q(!1))},350);return()=>clearTimeout(ue)},[j]);const G=P=>{const oe=N.some(ue=>ue.paperId===P.paperId);T(ue=>ue.some(de=>de.paperId===P.paperId)?ue:[...ue,{paperId:P.paperId,title:Ok(P.title)}]),D(""),L([]),oe||Xb(P.paperId).then(ue=>{var ge;const de=(ge=ue.title)==null?void 0:ge.trim();de&&T(Ee=>Ee.map(Ae=>Ae.paperId===P.paperId?{...Ae,title:de}:Ae))}).catch(()=>{})},ie=P=>T(oe=>oe.filter(ue=>ue.paperId!==P)),ve=P=>{b(oe=>oe.includes(P)?oe.filter(ue=>ue!==P):[...oe,P])},ce=v.length>0&&(!v.includes("Other")||w.trim().length>0),re=async()=>{const P=s==null?void 0:s.find(ue=>ue.id===m&&ue.agentReady);if(!P||c)return;const oe=cht(P);f(!0),h(null);try{const ue=await SWe(oe,{researchAreas:v,otherArea:v.includes("Other")?w:null,background:C||null,papers:N});e(ue.project,ue.selection)}catch(ue){h(ue instanceof Error?ue.message:String(ue))}finally{f(!1)}};return d.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${t===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:d.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${t===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:t===0?d.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:[d.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[d.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:d.jsx(S1,{})}),d.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:Zme()})]}),d.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[d.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),d.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[d.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:d.jsxs("span",{children:[d.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:i1e()}),d.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:Rve()})]})}),d.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:d.jsxs("span",{children:[d.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:O1e()}),d.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:hve()})]})}),d.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:d.jsxs("span",{children:[d.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:k1e()}),d.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:r2e()})]})})]})]}),d.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:d.jsxs("button",{className:`${Xr} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:[W6()," ",d.jsx(Q_,{size:20})]})})]}):t===1?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[d.jsx(S1,{})," ",gve()]}),d.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:$ge()}),d.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:lbe()}),s!==null&&!$&&d.jsx("p",{className:Rk,children:ive()}),s!==null&&$&&m===null&&d.jsx("p",{className:Rk,children:Uge()}),d.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:s!==null?s.map(P=>d.jsx(fht,{h:P,selected:m===P.id,onSelect:()=>g(P.id)},P.id)):Z?d.jsx("div",{className:zd,children:X6()}):d.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[d.jsx("span",{className:Lt})," ",m1e()]})}),(o===null||J)&&d.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[d.jsx(dht,{gitVersion:o,error:J}),J?d.jsx("p",{className:Dk,children:X6()}):d.jsx("p",{className:Dk,children:M1e()})]}),d.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[d.jsxs("button",{className:Ul,onClick:()=>r(0),children:[d.jsx(ud,{size:12})," ",V6()]}),(Z||J||o===null||s!==null&&!$)&&d.jsxs("button",{className:Ul,onClick:()=>K(!0,!0),disabled:S,children:[d.jsx(Gd,{size:12,className:S?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",mbe()]}),d.jsx("div",{style:{flex:1}}),d.jsxs("button",{className:Xr,onClick:()=>r(2),disabled:S||!$||m===null||!B,title:S?Xve():$?m===null?t1e():J?kbe():o===void 0?Gve():o===null?q1e():void 0:tve(),children:[W6()," ",d.jsx(Q_,{size:13})]})]})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[d.jsx(S1,{})," ",yve()]}),d.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:Cve()}),d.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:d.jsxs("div",{className:Bj,children:[d.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[d.jsx("legend",{children:Jve()}),d.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:Zge()}),d.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:aht.map(P=>d.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:[d.jsx("input",{type:"checkbox",checked:v.includes(P.id),onChange:()=>ve(P.id),disabled:c}),d.jsx("span",{children:P.label()})]},P.id))}),v.includes("Other")&&d.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:P=>y(P.target.value),disabled:c,placeholder:Ave(),"aria-label":dbe()})]}),d.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:Mbe()}),d.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:P=>z(P.target.value),disabled:c,rows:4,placeholder:x1e()}),d.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:zbe()}),d.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:tge()}),d.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[d.jsx("input",{id:"onb-paper-search",value:j,onChange:P=>D(P.target.value),disabled:c,placeholder:$be()}),U?d.jsx("div",{className:zd,children:Ube()}):I.length>0?d.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-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:I.map(P=>d.jsxs("button",{type:"button",onClick:()=>G(P),disabled:c,children:[d.jsx("span",{className:hd,children:Ok(P.title)}),d.jsx("span",{className:"id",children:P.paperId})]},P.paperId))}):null]}),N.length>0&&d.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:N.map(P=>d.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]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[d.jsx("span",{className:hd,children:P.title||P.paperId}),d.jsx("span",{className:"id",children:P.paperId}),d.jsx("button",{type:"button","aria-label":NO({name:je(P.paperId)}),onClick:()=>ie(P.paperId),disabled:c,children:d.jsx(Gr,{size:12})})]},P.paperId))})]})}),!ce&&d.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:v.length===0?Wge():d1e()}),d.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[d.jsxs("button",{className:Ul,onClick:()=>r(1),disabled:c,children:[d.jsx(ud,{size:12})," ",V6()]}),d.jsx("div",{style:{flex:1}}),d.jsx("button",{className:Xr,onClick:()=>void re(),disabled:c||m===null||!ce,children:c?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Lt})," ",Zbe()]}):d.jsxs(d.Fragment,{children:[z1e()," ",d.jsx(Q_,{size:13})]})})]}),m===null&&d.jsx("p",{className:Lk,children:o2e()}),_&&d.jsx("p",{className:Lk,children:_})]})})})}function Ok(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function lht(e){return e.agentReady?{cls:"st-done",label:cve()}:e.installed?e.installBroken?{cls:"st-starting",label:H1e()}:e.authState==="unknown"?{cls:"st-starting",label:Ive()}:e.authState==="unsupported"?{cls:"st-starting",label:Pve()}:e.installed?{cls:"st-starting",label:sbe()}:{cls:"st-idle",label:K6()}:{cls:"st-idle",label:K6()}}function cht(e){var t,r;const n=((t=e.models[0])==null?void 0:t.id)??null;return{harness:e.id,model:n,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:fp(e,n).defaultId}}function uht({harness:e}){return d.jsx(Fv,{harness:e,size:26})}function fht({h:e,selected:n,onSelect:t}){var c;const r=lht(e),s=n?{cls:"st-done",label:Wbe()}:r,o=[(c=e.version)==null?void 0:c.replace(/\s*\(.*\)$/,""),e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(f=>y0(f)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · "),l=d.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[d.jsx(uht,{harness:e.id}),d.jsx("span",{className:"onb-card-name text-xl font-semibold tracking-[-0.01em]",children:e.name})]}),d.jsxs("span",{className:`${J2} ${s.cls}`,children:[e.agentReady?d.jsx(os,{size:12,strokeWidth:3}):d.jsx("span",{className:"dot"}),s.label]})]});return e.agentReady?d.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 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-[0_0_0_1px_var(--accent)]${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[l,d.jsxs("div",{className:`onb-card-detail ${Wr}`,children:[e.account??x9(),e.plan?` · ${e.plan}`:""]}),d.jsx("div",{className:`${zd} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:o,children:o})]}):d.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 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-[0_0_0_1px_var(--accent)]",children:[l,d.jsx("div",{className:zd,children:Lp(e.agentNote)})]})}function dht({gitVersion:e,error:n}){return d.jsxs("div",{className:Bj,children:[d.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[d.jsx("span",{className:"onb-card-name font-semibold text-base",children:K1e()}),d.jsxs("span",{className:`${J2} ${e?"st-done":n||e===null?"st-failed":"st-starting"}`,children:[e?d.jsx(os,{size:12,strokeWidth:3}):d.jsx("span",{className:"dot"}),e?xbe():n?Nge():e===null?y9():Tge()]})]}),(e||!n&&e===void 0)&&d.jsx("div",{className:zd,children:e??Lge()})]})}function zb(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function hht(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 _ht(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 pht(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function mht({onCreated:e,onCancel:n}){const[t,r]=R.useState("blank"),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(""),[_,h]=R.useState(!1),[m,g]=R.useState(null),[S,k]=R.useState(null),[v,b]=R.useState(!1),[w,y]=R.useState(!1),[C,z]=R.useState(!1),[N,T]=R.useState(null),[j,D]=R.useState(!1),[I,L]=R.useState(!1),[U,q]=R.useState(void 0),[W,Z]=R.useState("research-project"),[X,J]=R.useState(null),[ee,$]=R.useState(!1),[B,H]=R.useState(!1),[K,G]=R.useState(""),[ie,ve]=R.useState(null),[ce,re]=R.useState([]),[P,oe]=R.useState(!1),[ue,de]=R.useState(""),[ge,Ee]=R.useState(0),Ae=R.useRef(0),He=R.useRef(0),Re=R.useRef(0),Ie=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),nt=t==="paper"?_ht(ie==null?void 0:ie.repoUrl):null,Rt=s.trim()?`~/OpenResearch/${zb(s,48)}`:"",At=`~/OpenResearch/${zb(s||(ie==null?void 0:ie.title)||(ie==null?void 0:ie.paperId)||"")}`,bt=t==="blank"&&!_?Rt:t==="paper"&&ie&&!_?At:c,Mt=nt??(m!=null&&m.githubOwner&&m.githubRepo?{owner:m.githubOwner,repo:m.githubRepo}:null);R.useEffect(()=>{EWe().then(({login:Be})=>q(Be)).catch(()=>q(null)),K2().then(Be=>L(Be.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let Be=!0;$(!0);const Qe=setTimeout(()=>{NWe(s.trim()).then(({repo:St})=>Be&&Z(St)).catch(()=>Be&&Z(zb(s,48))).finally(()=>Be&&$(!1))},150);return()=>{Be=!1,clearTimeout(Qe)}},[s]),R.useEffect(()=>{let Be=!0;if(J(null),H(!!Mt),!!Mt)return zWe(Mt.owner,Mt.repo).then(({canPush:Qe})=>{Be&&Qe&&J(`github.com/${Mt.owner}/${Mt.repo}`)}).catch(()=>{}).finally(()=>Be&&H(!1)),()=>{Be=!1}},[Mt==null?void 0:Mt.owner,Mt==null?void 0:Mt.repo]),R.useEffect(()=>{const Be=++He.current,Qe=bt.trim();if(!Qe){g(null),k(null),b(!1);return}b(!0),k(null);const St=setTimeout(()=>{oE(Qe).then(fn=>{Be===He.current&&g(fn)}).catch(fn=>{Be===He.current&&(g(null),k(fn instanceof Error?fn.message:String(fn)))}).finally(()=>{Be===He.current&&b(!1)})},200);return()=>clearTimeout(St)},[t,ge,bt]),R.useEffect(()=>{const Be=++Ae.current;if(t!=="paper"||ie){oe(!1);return}const Qe=K.trim(),St=hht(Qe);if(!St&&Qe.length<3){re([]),de(""),oe(!1);return}T(null),oe(!0),re([]),de("");const fn=setTimeout(()=>{if(St){Xb(St).then(nn=>{var Ns;Be===Ae.current&&(ve(nn),o||a(((Ns=nn.title)==null?void 0:Ns.trim())||nn.paperId))}).catch(nn=>Be===Ae.current&&T(nn instanceof Error?nn.message:String(nn))).finally(()=>Be===Ae.current&&oe(!1));return}lE(Qe).then(nn=>{Be===Ae.current&&(re(nn),de(Qe))}).catch(nn=>Be===Ae.current&&T(nn instanceof Error?nn.message:String(nn))).finally(()=>Be===Ae.current&&oe(!1))},350);return()=>clearTimeout(fn)},[t,ie,K,o]);async function Ct(Be){var St;const Qe=++Ae.current;oe(!0),T(null);try{const fn=await Xb(Be);if(Qe!==Ae.current)return;ve(fn),re([]),o||a(((St=fn.title)==null?void 0:St.trim())||fn.paperId)}catch(fn){Qe===Ae.current&&T(fn instanceof Error?fn.message:String(fn))}finally{Qe===Ae.current&&oe(!1)}}function ut(){Ae.current+=1,Re.current+=1,ve(null),G(""),re([]),de(""),oe(!1),y(!1),f(""),h(!1),Ie.current.paper={name:o?s:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function ht(Be){if(Be===t)return;Ae.current+=1,Re.current+=1,Ie.current[t]={name:s,nameTouched:o,path:c,pathTouched:_};const Qe=Ie.current[Be];r(Be),T(null),k(null),g(null),oe(!1),y(!1),a(Qe.name),l(Qe.nameTouched),f(Qe.path),h(Qe.pathTouched)}async function we(){if(w)return;const Be=++Re.current;y(!0),T(null);try{const Qe=await kWe();if(Be!==Re.current||!Qe)return;if(h(!0),g(null),b(!0),f(Qe),Ee(St=>St+1),t==="folder"&&!o){const St=Qe.replace(/[\\/]+$/,"").split(/[\\/]/).pop();St&&a(St)}}catch(Qe){Be===Re.current&&T(Qe instanceof Error?Qe.message:String(Qe))}finally{Be===Re.current&&y(!1)}}async function Le(Be){if(Be.preventDefault(),!!Xe){z(!0),T(null);try{const Qe=await CWe({name:s.trim(),path:bt.trim(),createFolder:t!=="folder",requireNewFolder:t==="blank",initializeGit:!0,githubSyncEnabled:I,...t==="paper"&&ie?{paperId:ie.paperId,cloneUrl:ie.repoUrl??void 0}:{}});e(Qe.project,Qe.githubPublicationError)}catch(Qe){T(Qe instanceof Error?Qe.message:String(Qe))}finally{z(!1)}}}const Ge=(m==null?void 0:m.gitVersion)===null,et=t==="folder"&&!!bt.trim()&&m!==null&&m.exists===!1,st=t==="blank"&&(m==null?void 0:m.exists)===!0,Dt=!!bt.trim()&&(m==null?void 0:m.exists)===!0&&m.directory===!1,vt=t==="paper"&&!!(ie!=null&&ie.repoUrl)&&(m==null?void 0:m.empty)===!1,It=t==="paper"&&!!ie&&!(ie!=null&&ie.repoUrl)&&((m==null?void 0:m.empty)===!1||(m==null?void 0:m.gitState)!=null&&m.gitState!=="notRepository"),Zt=t==="folder"&&((m==null?void 0:m.gitState)==="detached"||(m==null?void 0:m.gitState)==="invalid"),cn=_&&!bt.trim()||Dt||vt||It,xt=_&&!bt.trim()||Dt||st,Sn=_&&!bt.trim()?G6():Dt?H6():st?O0e():null,un=_&&!bt.trim()?G6():Dt?H6():vt?Tme():It?r0e():null,Xe=!!(s.trim()&&bt.trim())&&!C&&!w&&!v&&m!==null&&!S&&!Ge&&!et&&!st&&!Dt&&!vt&&!It&&!Zt&&(t!=="paper"||!!ie)&&(!I||typeof U=="string"&&!ee&&!B),lt=X??`github.com/${U??"you"}/${W}`,gn=U===void 0||ee||B,Cr=t==="paper"&&!ie&&K.trim().length>=3&&ue===K.trim()&&!P&&ce.length===0&&!N;return d.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-md [&_.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-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]: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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-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-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ms-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:Le,children:[d.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[d.jsx("button",{type:"button",className:t==="blank"?"active":"","aria-pressed":t==="blank",onClick:()=>ht("blank"),children:H0e()}),d.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${t==="paper"?"":" invisible"}`}),d.jsx("button",{type:"button",className:t==="folder"?"active":"","aria-pressed":t==="folder",onClick:()=>ht("folder"),children:cpe()}),d.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${t==="blank"?"":" invisible"}`}),d.jsx("button",{type:"button",className:t==="paper"?"active":"","aria-pressed":t==="paper",onClick:()=>ht("paper"),children:gpe()})]}),t==="paper"&&!ie&&d.jsxs("label",{className:"!font-normal",children:[Hpe(),d.jsx("input",{className:"text-md font-normal","data-initial-focus":!0,value:K,onChange:Be=>{T(null),de(""),G(Be.target.value)},placeholder:Ype()}),!Cr&&d.jsx("span",{className:"repo-hint",children:P?Ume():Lme()}),Cr&&d.jsx("span",{className:"project-path-notice block",children:zpe()}),ce.length>0&&d.jsx("div",{className:"paper-results",children:ce.map(Be=>d.jsxs("button",{type:"button",onClick:()=>void Ct(Be.paperId),children:[d.jsx("span",{className:hd,children:Be.title}),d.jsx("span",{className:"id",children:Be.paperId})]},Be.paperId))})]}),ie&&t==="paper"&&d.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[d.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[d.jsxs("div",{className:"meta",children:[d.jsx("div",{className:`${hd} !font-medium`,children:ie.title||ie.paperId}),ie.repoUrl&&d.jsx("div",{className:"id",children:pht(ie.repoUrl)})]}),d.jsx("button",{type:"button",className:Ks,"aria-label":Q0e(),onClick:ut,children:K0e()})]}),!ie.repoUrl&&d.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:[d.jsxs("span",{className:"flex items-center gap-[5px] text-md",children:[d.jsx(BGe,{size:16})," ",Mpe()]}),d.jsx("span",{className:"text-sm font-normal text-accent-amber",children:Ope()})]})]}),(t!=="paper"||ie)&&d.jsxs(d.Fragment,{children:[t==="blank"&&d.jsxs("label",{className:"!font-normal",children:[d.jsx("span",{className:"project-field-label !font-medium",children:q6()}),d.jsx("input",{className:"text-md font-normal","data-initial-focus":!0,value:s,onChange:Be=>{l(!0),a(Be.target.value)},placeholder:F6()})]}),t==="paper"?d.jsxs("label",{className:"project-location-field",children:[d.jsx("span",{className:"project-location-label !font-medium",children:ie!=null&&ie.repoUrl?b0e():U6()}),d.jsx("input",{className:"text-md font-normal",value:bt,onChange:Be=>{h(!0),g(null),f(Be.target.value)},"aria-describedby":cn?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),v&&d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:P6()}),cn&&d.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:un})]}):t==="folder"?d.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":c?o0e({path:je(c)}):B6(),disabled:w,title:c||void 0,onClick:()=>void we(),children:[d.jsx(fd,{className:c?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),d.jsx("span",{className:c?Wr:"placeholder",children:w?_0e():c||B6()}),d.jsx(wa,{className:"folder-picker-chevron",size:15})]}):s.trim()?d.jsxs("label",{className:"project-location-field",children:[d.jsx("span",{className:"project-location-label !font-medium",children:U6()}),d.jsx("input",{className:"text-md font-normal",value:bt,onChange:Be=>{h(!0),g(null),f(Be.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":xt?"blank-destination-description":void 0,spellCheck:!1}),v&&d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:P6()}),xt&&d.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Sn})]}):null,t!=="blank"&&bt&&d.jsxs("label",{className:"!font-normal",children:[d.jsx("span",{className:"project-field-label !font-medium",children:q6()}),d.jsx("input",{className:"text-md font-normal",value:s,onChange:Be=>{l(!0),a(Be.target.value)},placeholder:F6()})]}),Ge&&d.jsx("div",{className:"project-path-notice error",children:ype()}),!Ge&&t==="folder"&&c.trim()&&!v&&(m==null?void 0:m.exists)===!1&&d.jsx("div",{className:"project-path-notice error",children:sme()}),!Ge&&t==="folder"&&c.trim()&&!v&&Dt&&d.jsx("div",{className:"project-path-notice error",children:dme()}),!Ge&&t==="folder"&&!v&&(m==null?void 0:m.gitState)==="detached"&&d.jsx("div",{className:"project-path-notice error",children:npe()}),!Ge&&t==="folder"&&!v&&(m==null?void 0:m.gitState)==="invalid"&&d.jsx("div",{className:"project-path-notice error",children:lme()}),S&&d.jsx("div",{className:"project-path-notice error",role:"alert",children:S})]}),N&&d.jsx("div",{className:"error",role:"alert",children:N}),(t!=="paper"||ie)&&bt&&(t!=="blank"||s.trim())&&d.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[d.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-md font-medium${I&&U===null?" text-accent-red":" text-text"}`,"aria-expanded":j,"aria-controls":"new-project-advanced-settings",onClick:()=>D(Be=>!Be),children:[I?U===null?X_e():J_e():G_e(),d.jsx(ya,{className:j?"rotate-180":"",size:16})]}),j&&d.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[d.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[d.jsx("input",{className:"m-0",type:"checkbox",checked:I,onChange:Be=>L(Be.target.checked),disabled:C}),d.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:eme()})]}),d.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[d.jsx("span",{children:gn?mme({repository:je(lt)}):X?kme({repository:je(lt)}):xme({repository:je(lt)})}),d.jsx("span",{children:hpe()}),U===null&&d.jsx("span",{children:$me({command:je("gh auth login")})})]})]})]}),d.jsxs("div",{className:"actions new-project-actions",children:[n&&d.jsx("button",{type:"button",className:`${qn} !font-medium`,onClick:n,children:q0e()}),d.jsx("button",{className:`${Xr} !font-medium`,disabled:!Xe,children:C?A0e():t==="paper"?ie!=null&&ie.repoUrl?w0e():$6():t==="folder"?Wme():$6()})]})]})}function $j({onClose:e,onCreated:n}){const t=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const s=t.current;if(!s)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...s.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(s.querySelector("[data-initial-focus]")??o()[0]??s).focus();const l=c=>{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key==="Enter"&&(c.metaKey||c.ctrlKey)&&!c.altKey&&c.shiftKey){c.preventDefault(),c.stopPropagation();return}if(c.key!=="Tab")return;const f=o();if(f.length===0){c.preventDefault(),s.focus();return}const _=f[0],h=f[f.length-1];c.shiftKey&&document.activeElement===_?(c.preventDefault(),h.focus()):!c.shiftKey&&document.activeElement===h&&(c.preventDefault(),_.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),d.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] 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:s=>{s.target===s.currentTarget&&e()},children:d.jsxs("div",{ref:t,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-[0_24px_60px_rgba(0,_0,_0,_0.22)] 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:[d.jsx("h2",{id:"new-project-dialog-title",children:k9()}),d.jsx(mht,{onCancel:e,onCreated:n})]})})}function ght({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const a=R.useRef(null),o=R.useRef(r),l=R.useRef(n);o.current=r,l.current=n,R.useEffect(()=>{const f=a.current;if(!f)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...f.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(h()[0]??f).focus();const m=g=>{if(g.key==="Escape"){g.preventDefault(),l.current||o.current();return}if(g.key!=="Tab")return;const S=h();if(S.length===0){g.preventDefault(),f.focus();return}const k=S[0],v=S[S.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("keydown",m,!0),_==null||_.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return d.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:f=>{!n&&f.target===f.currentTarget&&r()},children:d.jsxs("div",{ref:a,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[d.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:P4e()}),d.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-md leading-normal text-subtext",children:[d.jsx("p",{className:"m-0",children:w4e({name:eo(e.name)})}),d.jsx("p",{className:"m-0",children:c?n5e():a5e()}),t&&d.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),d.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[d.jsx("button",{className:qn,disabled:n,onClick:r,children:R4e()}),d.jsx("button",{className:`${qn} danger`,disabled:n,onClick:s,children:n?X4e():G4e()})]})]})})}function Ik(){return d.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 Bk({projects:e,onOpen:n,onCreated:t,onDeleted:r}){const[s,a]=R.useState(!1),[o,l]=R.useState(null),[c,f]=R.useState(null),[_,h]=R.useState(null),[m,g]=R.useState({}),S=R.useRef(0),k=e.map(b=>b.id).join("\0");R.useEffect(()=>{let b=!0,w=null;const y=()=>{w=null;const N=++S.current;yWe().then(T=>{!b||N!==S.current||g(Object.fromEntries(T.map(j=>[j.projectId,j])))}).catch(()=>{})},C=()=>{w===null&&(w=setTimeout(y,100))};y();const z=uXe(C);return()=>{b=!1,z(),w!==null&&clearTimeout(w)}},[k]);async function v(b){l(b.id),f(null);try{await jWe(b.id),f(null),h(null),r(b.id)}catch(w){f(w instanceof Error?w.message:String(w))}finally{l(null)}}return d.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[d.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:[d.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:[d.jsx("h2",{children:y5e()}),d.jsxs("button",{className:qn,onClick:()=>a(!0),children:[d.jsx(q2,{size:15})," ",k9()]})]}),d.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:d.jsxs("div",{children:[d.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-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[d.jsx("span",{children:g5e()}),d.jsx("span",{children:Z6()}),d.jsx("span",{children:Q6()}),d.jsx("span",{children:J6()})]}),e.length===0?d.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:h5e()}):[...e].sort((b,w)=>{var z,N;const y=((z=m[b.id])==null?void 0:z.lastMessageAt)??b.createdAt;return(((N=m[w.id])==null?void 0:N.lastMessageAt)??w.createdAt)-y||b.name.localeCompare(w.name)}).map(b=>{const w=m[b.id],y=b.githubEnabled?b.githubUrl??(b.githubOwner&&b.githubRepo?`https://github.com/${b.githubOwner}/${b.githubRepo}`:null):null,C=y?b.githubOwner&&b.githubRepo?`${b.githubOwner}/${b.githubRepo}`:y.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):M5e(),z=w?w.activeAgents>0?_4e({count:Ht(w.activeAgents)}):z5e():"—",N=w?w.totalAgents===1?O5e():b4e({count:Ht(w.totalAgents)}):"—",T=w?w.runningExperiments>0?H5e({count:Ht(w.runningExperiments)}):w.totalExperiments===0?T2():e7({count:Ht(w.totalExperiments)}):"—",j=w&&w.runningExperiments>0?e7({count:Ht(w.totalExperiments)}):null;return d.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:[d.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":eO({name:eo(b.name)}),onClick:()=>n(b.id)}),d.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:[d.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:b.name}),d.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[d.jsxs("span",{children:[I4e()," ",qi(b.createdAt)]}),b.paperId&&d.jsx("span",{"aria-hidden":"true",children:"·"}),b.paperId&&d.jsxs("span",{children:[A4e()," ",je(b.paperId)]}),d.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":Gb({name:eo(b.name)}),disabled:o===b.id,onClick:D=>{D.stopPropagation(),f(null),h(b)},children:d.jsx(Bu,{size:14})})]})]}),d.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[d.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:Z6()}),d.jsxs("span",{className:"inline-flex items-center gap-2 text-md text-text",children:[w&&w.activeAgents>0&&d.jsx(Ik,{}),z]}),d.jsx("span",{className:"text-xs text-muted",children:N})]}),d.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[d.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:Q6()}),d.jsxs("span",{className:"inline-flex items-center gap-2 text-md text-text",children:[w&&w.runningExperiments>0&&d.jsx(Ik,{}),T]}),j&&d.jsx("span",{className:"text-xs text-muted",children:j})]}),d.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[d.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:J6()}),y?d.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:y,target:"_blank",rel:"noreferrer","aria-label":g0({name:eo(b.name)}),children:[d.jsx("span",{className:"inline-flex shrink-0",children:d.jsx(Op,{size:14})}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:je(C)})]}):d.jsx("span",{className:"text-sm text-text pointer-events-none",children:C})]})]},b.id)})]})})]}),s&&d.jsx($j,{onClose:()=>a(!1),onCreated:(b,w)=>{a(!1),t(b,w)}}),_&&d.jsx(ght,{project:_,deleting:o===_.id,error:c,onClose:()=>{f(null),h(null)},onConfirm:()=>void v(_)})]})}const $k=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ms-auto"].join(" ");function bht({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:a,onCancel:o}){const[l,c]=R.useState(new Set),[f,_]=R.useState(null),h=new Map;for(const S of e){const k=h.get(S.experimentId);k?k.push(S):h.set(S.experimentId,[S])}for(const S of h.values())S.sort((k,v)=>v.createdAt-k.createdAt);const m=[...n].sort((S,k)=>{var w,y,C,z;const v=((y=(w=h.get(S.id))==null?void 0:w[0])==null?void 0:y.createdAt)??S.createdAt;return(((z=(C=h.get(k.id))==null?void 0:C[0])==null?void 0:z.createdAt)??k.createdAt)-v});if(m.length===0)return d.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:d.jsx("p",{children:t??Soe()})});async function g(S){_(null),c(k=>new Set(k).add(S));try{await o(S)}catch(k){c(v=>{const b=new Set(v);return b.delete(S),b}),_(k instanceof Error?k.message:String(k))}}return d.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[f&&d.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[cle()," ",f]}),d.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":tle(),children:m.map(S=>{const k=h.get(S.id)??[],v=k[0]??null,b=k.find(z=>z.status==="running"||z.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||l.has(b.id))),C=b?y?"cancelling":wi(b):v?wi(v):"idle";return d.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(S,"preview"),onDoubleClick:()=>r(S,"keepOpen"),onAuxClick:z=>{z.button===1&&(z.preventDefault(),r(S,"keepOpen"))},children:[d.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[d.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...nr(z=>r(S,z),{stopPropagation:!0}),children:S.title||S.slug}),d.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:S.branchName,children:[d.jsx(lp,{size:14,"aria-hidden":"true"}),d.jsx("code",{children:S.branchName})]})]}),d.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:[d.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:d.jsx(no,{status:C})}),d.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:d.jsx("span",{children:k.length===1?Toe():$oe({count:Ht(k.length)})})}),d.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:d.jsx("span",{children:v?qi(v.createdAt):Noe()})})]}),d.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":zD({name:S.title||S.slug}),onClick:z=>z.stopPropagation(),onDoubleClick:z=>z.stopPropagation(),onAuxClick:z=>z.stopPropagation(),children:[d.jsxs("button",{className:$k,disabled:!w,title:w?Loe():voe(),...nr(z=>{w&&s(S.id,w.id,z)},{stopPropagation:!0}),children:[d.jsx(Su,{size:15}),ile()]}),d.jsxs("button",{className:$k,title:r9({branch:je(S.branchName)}),...nr(z=>a(S.id,z),{stopPropagation:!0}),children:[d.jsx(op,{size:15}),Zoe()]}),b&&d.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ms-auto danger",disabled:y,title:y?Uoe():Woe(),onClick:()=>void g(b.id),children:[d.jsx(G9,{size:15}),y?zne():d9()]})]})]},S.id)})})]})}function vht({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(c=>{t||(r(!0),a(null),c().catch(()=>a(TFe())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const c=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),l(e))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,l]),R.useEffect(()=>{const c=o.current;if(!c)return;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??c).focus();const h=m=>{if(m.key!=="Tab")return;const g=_();if(g.length===0){m.preventDefault(),c.focus();return}const S=g[0],k=g[g.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),k.focus()):!m.shiftKey&&document.activeElement===k&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",h,!0),()=>{document.removeEventListener("keydown",h,!0),f==null||f.focus()}},[]),gy.createPortal(d.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:d.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[d.jsx("button",{className:`${mn} !absolute top-3.5 end-3.5`,"aria-label":oFe(),onClick:()=>l(e),disabled:t,children:d.jsx(Gr,{size:16})}),d.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[d.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:d.jsx(Y2,{})}),d.jsxs("div",{children:[d.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:pFe()}),d.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:$Fe()})]})]}),d.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[d.jsxs("p",{dir:"auto",children:[LFe()," ",d.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:NFe()}),rFe()]}),d.jsx("p",{dir:"auto",children:SFe()})]}),s&&d.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),d.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[d.jsx("button",{className:qn,onClick:()=>l(n),disabled:t,children:fFe()}),d.jsx("button",{className:Xr,onClick:()=>l(e),disabled:t,children:t?xa():vFe()})]})]})}),document.body)}function gr(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function tm(){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}})}l0.prototype=tm.prototype={constructor:l0,on:function(e,n){var t=this._,r=yht(e+"",t),s,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var t=new Array(s),r=0,s,a;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),Pk.hasOwnProperty(n)?{space:Pk[n],local:e}:e}function Sht(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===u2&&n.documentElement.namespaceURI===u2?n.createElement(e):n.createElementNS(t,e)}}function kht(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hj(e){var n=nm(e);return(n.local?kht:Sht)(n)}function Cht(){}function Hy(e){return e==null?Cht:function(){return this.querySelector(e)}}function Eht(e){typeof e!="function"&&(e=Hy(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(z=v[y])&&++y=0;)(o=r[s])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Zht(e){e||(e=Qht);function n(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var t=this._groups,r=t.length,s=new Array(r),a=0;an?1:e>=n?0:NaN}function Jht(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function e_t(){return Array.from(this)}function t_t(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?d_t:typeof n=="function"?__t:h_t)(e,n,t??"")):Mu(this.node(),e)}function Mu(e,n){return e.style.getPropertyValue(n)||Gj(e).getComputedStyle(e,null).getPropertyValue(n)}function m_t(e){return function(){delete this[e]}}function g_t(e,n){return function(){this[e]=n}}function b_t(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function v_t(e,n){return arguments.length>1?this.each((n==null?m_t:typeof n=="function"?b_t:g_t)(e,n)):this.node()[e]}function Vj(e){return e.trim().split(/^|\s+/)}function Py(e){return e.classList||new Wj(e)}function Wj(e){this._node=e,this._names=Vj(e.getAttribute("class")||"")}Wj.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 Kj(e,n){for(var t=Py(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function W_t(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,a;t()=>e;function f2(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:a,x:o,y:l,dx:c,dy:f,dispatch:_}){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:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:_}})}f2.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function r0t(e){return!e.ctrlKey&&!e.button}function s0t(){return this.parentNode}function i0t(e,n){return n??{x:e.x,y:e.y}}function a0t(){return navigator.maxTouchPoints||"ontouchstart"in this}function eT(){var e=r0t,n=s0t,t=i0t,r=a0t,s={},a=tm("start","drag","end"),o=0,l,c,f,_,h=0;function m(C){C.on("mousedown.drag",g).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,n0t).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(C,z){if(!(_||!e.call(this,C,z))){var N=y(this,n.call(this,C,z),C,z,"mouse");N&&(Us(C.view).on("mousemove.drag",S,Ad).on("mouseup.drag",k,Ad),Qj(C.view),Ab(C),f=!1,l=C.clientX,c=C.clientY,N("start",C))}}function S(C){if(gu(C),!f){var z=C.clientX-l,N=C.clientY-c;f=z*z+N*N>h}s.mouse("drag",C)}function k(C){Us(C.view).on("mousemove.drag mouseup.drag",null),Jj(C.view,f),gu(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,D,I;for(D=0;D>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?F_(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?F_(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=l0t.exec(e))?new ks(n[1],n[2],n[3],1):(n=c0t.exec(e))?new ks(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=u0t.exec(e))?F_(n[1],n[2],n[3],n[4]):(n=f0t.exec(e))?F_(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=d0t.exec(e))?Kk(n[1],n[2]/100,n[3]/100,1):(n=h0t.exec(e))?Kk(n[1],n[2]/100,n[3]/100,n[4]):Fk.hasOwnProperty(e)?Gk(Fk[e]):e==="transparent"?new ks(NaN,NaN,NaN,0):null}function Gk(e){return new ks(e>>16&255,e>>8&255,e&255,1)}function F_(e,n,t,r){return r<=0&&(e=n=t=NaN),new ks(e,n,t,r)}function m0t(e){return e instanceof ah||(e=tc(e)),e?(e=e.rgb(),new ks(e.r,e.g,e.b,e.opacity)):new ks}function d2(e,n,t,r){return arguments.length===1?m0t(e):new ks(e,n,t,r??1)}function ks(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Fy(ks,d2,tT(ah,{brighter(e){return e=e==null?G0:Math.pow(G0,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jd:Math.pow(jd,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ks(Zl(this.r),Zl(this.g),Zl(this.b),V0(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:Vk,formatHex:Vk,formatHex8:g0t,formatRgb:Wk,toString:Wk}));function Vk(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}`}function g0t(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}${Gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wk(){const e=V0(this.opacity);return`${e===1?"rgb(":"rgba("}${Zl(this.r)}, ${Zl(this.g)}, ${Zl(this.b)}${e===1?")":`, ${e})`}`}function V0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gl(e){return e=Zl(e),(e<16?"0":"")+e.toString(16)}function Kk(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Ii(e,n,t,r)}function nT(e){if(e instanceof Ii)return new Ii(e.h,e.s,e.l,e.opacity);if(e instanceof ah||(e=tc(e)),!e)return new Ii;if(e instanceof Ii)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),a=Math.max(n,t,r),o=NaN,l=a-s,c=(a+s)/2;return l?(n===a?o=(t-r)/l+(t0&&c<1?0:o,new Ii(o,l,c,e.opacity)}function b0t(e,n,t,r){return arguments.length===1?nT(e):new Ii(e,n,t,r??1)}function Ii(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Fy(Ii,b0t,tT(ah,{brighter(e){return e=e==null?G0:Math.pow(G0,e),new Ii(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jd:Math.pow(jd,e),new Ii(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 ks(jb(e>=240?e-240:e+120,s,r),jb(e,s,r),jb(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Ii(Xk(this.h),U_(this.s),U_(this.l),V0(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=V0(this.opacity);return`${e===1?"hsl(":"hsla("}${Xk(this.h)}, ${U_(this.s)*100}%, ${U_(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xk(e){return e=(e||0)%360,e<0?e+360:e}function U_(e){return Math.max(0,Math.min(1,e||0))}function jb(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 Uy=e=>()=>e;function v0t(e,n){return function(t){return e+t*n}}function x0t(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 y0t(e){return(e=+e)==1?rT:function(n,t){return t-n?x0t(n,t,e):Uy(isNaN(n)?t:n)}}function rT(e,n){var t=n-e;return t?v0t(e,t):Uy(isNaN(e)?n:e)}const W0=(function e(n){var t=y0t(n);function r(s,a){var o=t((s=d2(s)).r,(a=d2(a)).r),l=t(s.g,a.g),c=t(s.b,a.b),f=rT(s.opacity,a.opacity);return function(_){return s.r=o(_),s.g=l(_),s.b=c(_),s.opacity=f(_),s+""}}return r.gamma=e,r})(1);function w0t(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(a){for(s=0;st&&(a=n.slice(t,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:_a(r,s)})),t=Tb.lastIndex;return t180?_+=360:_-f>180&&(f+=360),m.push({i:h.push(s(h)+"rotate(",null,r)-2,x:_a(f,_)})):_&&h.push(s(h)+"rotate("+_+r)}function l(f,_,h,m){f!==_?m.push({i:h.push(s(h)+"skewX(",null,r)-2,x:_a(f,_)}):_&&h.push(s(h)+"skewX("+_+r)}function c(f,_,h,m,g,S){if(f!==h||_!==m){var k=g.push(s(g)+"scale(",null,",",null,")");S.push({i:k-4,x:_a(f,h)},{i:k-2,x:_a(_,m)})}else(h!==1||m!==1)&&g.push(s(g)+"scale("+h+","+m+")")}return function(f,_){var h=[],m=[];return f=e(f),_=e(_),a(f.translateX,f.translateY,_.translateX,_.translateY,h,m),o(f.rotate,_.rotate,h,m),l(f.skewX,_.skewX,h,m),c(f.scaleX,f.scaleY,_.scaleX,_.scaleY,h,m),f=_=null,function(g){for(var S=-1,k=m.length,v;++S=0&&e._call.call(void 0,n),e=e._next;--Ru}function Qk(){nc=(X0=Md.now())+rm,Ru=Zf=0;try{I0t()}finally{Ru=0,$0t(),nc=0}}function B0t(){var e=Md.now(),n=e-X0;n>oT&&(rm-=n,X0=e)}function $0t(){for(var e,n=K0,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:K0=t);Qf=e,p2(r)}function p2(e){if(!Ru){Zf&&(Zf=clearTimeout(Zf));var n=e-nc;n>24?(e<1/0&&(Zf=setTimeout(Qk,e-Md.now()-rm)),Uf&&(Uf=clearInterval(Uf))):(Uf||(X0=Md.now(),Uf=setInterval(B0t,oT)),Ru=1,lT(Qk))}}function Jk(e,n,t){var r=new Y0;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var H0t=tm("start","end","cancel","interrupt"),P0t=[],uT=0,eC=1,m2=2,u0=3,tC=4,g2=5,f0=6;function sm(e,n,t,r,s,a){var o=e.__transition;if(!o)e.__transition={};else if(t in o)return;F0t(e,t,{name:n,index:r,group:s,on:H0t,tween:P0t,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:uT})}function Gy(e,n){var t=Vi(e,n);if(t.state>uT)throw new Error("too late; already scheduled");return t}function za(e,n){var t=Vi(e,n);if(t.state>u0)throw new Error("too late; already running");return t}function Vi(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function F0t(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=cT(a,0,t.time);function a(f){t.state=eC,t.timer.restart(o,t.delay,t.time),t.delay<=f&&o(f-t.delay)}function o(f){var _,h,m,g;if(t.state!==eC)return c();for(_ in r)if(g=r[_],g.name===t.name){if(g.state===u0)return Jk(o);g.state===tC?(g.state=f0,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[_]):+_m2&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function bpt(e,n,t){var r,s,a=gpt(n)?Gy:za;return function(){var o=a(this,e),l=o.on;l!==r&&(s=(r=l).copy()).on(n,t),o.on=s}}function vpt(e,n){var t=this._id;return arguments.length<2?Vi(this.node(),t).on.on(e):this.each(bpt(t,e,n))}function xpt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function ypt(){return this.on("end.remove",xpt(this._id))}function wpt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=Hy(e));for(var r=this._groups,s=r.length,a=new Array(s),o=0;o()=>e;function Wpt(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 Ja(e,n,t){this.k=e,this.x=n,this.y=t}Ja.prototype={constructor:Ja,scale:function(e){return e===1?this:new Ja(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ja(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 im=new Ja(1,0,0);_T.prototype=Ja.prototype;function _T(e){for(;!e.__zoom;)if(!(e=e.parentNode))return im;return e.__zoom}function Mb(e){e.stopImmediatePropagation()}function qf(e){e.preventDefault(),e.stopImmediatePropagation()}function Kpt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Xpt(){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 nC(){return this.__zoom||im}function Ypt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zpt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qpt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],a=e.invertY(n[0][1])-t[0][1],o=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function pT(){var e=Kpt,n=Xpt,t=Qpt,r=Ypt,s=Zpt,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=c0,f=tm("start","zoom","end"),_,h,m,g=500,S=150,k=0,v=10;function b(W){W.property("__zoom",nC).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",L).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(W,Z,X,J){var ee=W.selection?W.selection():W;ee.property("__zoom",nC),W!==ee?z(W,Z,X,J):ee.interrupt().each(function(){N(this,arguments).event(J).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},b.scaleBy=function(W,Z,X,J){b.scaleTo(W,function(){var ee=this.__zoom.k,$=typeof Z=="function"?Z.apply(this,arguments):Z;return ee*$},X,J)},b.scaleTo=function(W,Z,X,J){b.transform(W,function(){var ee=n.apply(this,arguments),$=this.__zoom,B=X==null?C(ee):typeof X=="function"?X.apply(this,arguments):X,H=$.invert(B),K=typeof Z=="function"?Z.apply(this,arguments):Z;return t(y(w($,K),B,H),ee,o)},X,J)},b.translateBy=function(W,Z,X,J){b.transform(W,function(){return t(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof X=="function"?X.apply(this,arguments):X),n.apply(this,arguments),o)},null,J)},b.translateTo=function(W,Z,X,J,ee){b.transform(W,function(){var $=n.apply(this,arguments),B=this.__zoom,H=J==null?C($):typeof J=="function"?J.apply(this,arguments):J;return t(im.translate(H[0],H[1]).scale(B.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof X=="function"?-X.apply(this,arguments):-X),$,o)},J,ee)};function w(W,Z){return Z=Math.max(a[0],Math.min(a[1],Z)),Z===W.k?W:new Ja(Z,W.x,W.y)}function y(W,Z,X){var J=Z[0]-X[0]*W.k,ee=Z[1]-X[1]*W.k;return J===W.x&&ee===W.y?W:new Ja(W.k,J,ee)}function C(W){return[(+W[0][0]+ +W[1][0])/2,(+W[0][1]+ +W[1][1])/2]}function z(W,Z,X,J){W.on("start.zoom",function(){N(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(J).end()}).tween("zoom",function(){var ee=this,$=arguments,B=N(ee,$).event(J),H=n.apply(ee,$),K=X==null?C(H):typeof X=="function"?X.apply(ee,$):X,G=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ie=ee.__zoom,ve=typeof Z=="function"?Z.apply(ee,$):Z,ce=c(ie.invert(K).concat(G/ie.k),ve.invert(K).concat(G/ve.k));return function(re){if(re===1)re=ve;else{var P=ce(re),oe=G/P[2];re=new Ja(oe,K[0]-P[0]*oe,K[1]-P[1]*oe)}B.zoom(null,re)}})}function N(W,Z,X){return!X&&W.__zooming||new T(W,Z)}function T(W,Z){this.that=W,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=n.apply(W,Z),this.taps=0}T.prototype={event:function(W){return W&&(this.sourceEvent=W),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(W,Z){return this.mouse&&W!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&W!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&W!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(W){var Z=Us(this.that).datum();f.call(W,this.that,new Wpt(W,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:f}),Z)}};function j(W,...Z){if(!e.apply(this,arguments))return;var X=N(this,Z).event(W),J=this.__zoom,ee=Math.max(a[0],Math.min(a[1],J.k*Math.pow(2,r.apply(this,arguments)))),$=Li(W);if(X.wheel)(X.mouse[0][0]!==$[0]||X.mouse[0][1]!==$[1])&&(X.mouse[1]=J.invert(X.mouse[0]=$)),clearTimeout(X.wheel);else{if(J.k===ee)return;X.mouse=[$,J.invert($)],d0(this),X.start()}qf(W),X.wheel=setTimeout(B,S),X.zoom("mouse",t(y(w(J,ee),X.mouse[0],X.mouse[1]),X.extent,o));function B(){X.wheel=null,X.end()}}function D(W,...Z){if(m||!e.apply(this,arguments))return;var X=W.currentTarget,J=N(this,Z,!0).event(W),ee=Us(W.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",G,!0),$=Li(W,X),B=W.clientX,H=W.clientY;Qj(W.view),Mb(W),J.mouse=[$,this.__zoom.invert($)],d0(this),J.start();function K(ie){if(qf(ie),!J.moved){var ve=ie.clientX-B,ce=ie.clientY-H;J.moved=ve*ve+ce*ce>k}J.event(ie).zoom("mouse",t(y(J.that.__zoom,J.mouse[0]=Li(ie,X),J.mouse[1]),J.extent,o))}function G(ie){ee.on("mousemove.zoom mouseup.zoom",null),Jj(ie.view,J.moved),qf(ie),J.event(ie).end()}}function I(W,...Z){if(e.apply(this,arguments)){var X=this.__zoom,J=Li(W.changedTouches?W.changedTouches[0]:W,this),ee=X.invert(J),$=X.k*(W.shiftKey?.5:2),B=t(y(w(X,$),J,ee),n.apply(this,Z),o);qf(W),l>0?Us(this).transition().duration(l).call(z,B,J,W):Us(this).call(b.transform,B,J,W)}}function L(W,...Z){if(e.apply(this,arguments)){var X=W.touches,J=X.length,ee=N(this,Z,W.changedTouches.length===J).event(W),$,B,H,K;for(Mb(W),B=0;B`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.`},Rd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mT=["Enter"," ","Escape"],gT={"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 Du;(function(e){e.Strict="strict",e.Loose="loose"})(Du||(Du={}));var Ql;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ql||(Ql={}));var Dd;(function(e){e.Partial="partial",e.Full="full"})(Dd||(Dd={}));const bT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Qo;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Qo||(Qo={}));var Z0;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Z0||(Z0={}));var at;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(at||(at={}));const rC={[at.Left]:at.Right,[at.Right]:at.Left,[at.Top]:at.Bottom,[at.Bottom]:at.Top};function vT(e){return e===null?null:e?"valid":"invalid"}const xT=e=>"id"in e&&"source"in e&&"target"in e,Jpt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wy=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),oh=(e,n=[0,0])=>{const{width:t,height:r}=mo(e),s=e.origin??n,a=t*s[0],o=r*s[1];return{x:e.position.x-a,y:e.position.y-o}},emt=(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 a=typeof s=="string";let o=!n.nodeLookup&&!a?s:void 0;n.nodeLookup&&(o=a?n.nodeLookup.get(s):Wy(s)?s:n.nodeLookup.get(s.id));const l=o?Q0(o,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return am(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return om(t)},lh=(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=am(t,Q0(s)),r=!0)}),r?om(t):{x:0,y:0,width:0,height:0}},Ky=(e,n,[t,r,s]=[0,0,1],a=!1,o=!1)=>{const l=(n.x-t)/s,c=(n.y-r)/s,f=n.width/s,_=n.height/s,h=[];for(const m of e.values()){const{measured:g,selectable:S=!0,hidden:k=!1}=m;if(o&&!S||k)continue;const v=g.width??m.width??m.initialWidth??0,b=g.height??m.height??m.initialHeight??0,{x:w,y}=m.internals.positionAbsolute,C=kT(l,c,f,_,w,y,v,b),z=v*b,N=a&&C>0;(!m.internals.handleBounds||N||C>=z||m.dragging)&&h.push(m)}return h},tmt=(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 nmt(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 rmt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:a},o){if(e.size===0)return!0;const l=nmt(e,o),c=lh(l),f=Yy(c,n,t,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(f,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function yT({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:a}){const o=t.get(e),l=o.parentId?t.get(o.parentId):void 0,{x:c,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},_=o.origin??r;let h=o.extent||s;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Gi.error005());else{const g=l.measured.width,S=l.measured.height;g&&S&&(h=[[c,f],[c+g,f+S]])}else l&&sc(o.extent)&&(h=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const m=sc(h)?rc(n,h,o.measured):n;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Gi.error015())),{position:{x:m.x-c+(o.measured.width??0)*_[0],y:m.y-f+(o.measured.height??0)*_[1]},positionAbsolute:m}}async function smt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const a=new Set(e.map(m=>m.id)),o=[];for(const m of t){if(m.deletable===!1)continue;const g=a.has(m.id),S=!g&&m.parentId&&o.find(k=>k.id===m.parentId);(g||S)&&o.push(m)}const l=new Set(n.map(m=>m.id)),c=r.filter(m=>m.deletable!==!1),_=tmt(o,c);for(const m of c)l.has(m.id)&&!_.find(S=>S.id===m.id)&&_.push(m);if(!s)return{edges:_,nodes:o};const h=await s({nodes:o,edges:_});return typeof h=="boolean"?h?{edges:_,nodes:o}:{edges:[],nodes:[]}:h}const Lu=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),rc=(e={x:0,y:0},n,t)=>({x:Lu(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Lu(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function wT(e,n,t){const{width:r,height:s}=mo(t),{x:a,y:o}=t.internals.positionAbsolute;return rc(e,[[a,o],[a+r,o+s]],n)}const sC=(e,n,t)=>et?-Lu(Math.abs(e-t),1,n)/n:0,Xy=(e,n,t=15,r=40)=>{const s=sC(e.x,r,n.width-r)*t,a=sC(e.y,r,n.height-r)*t;return[s,a]},am=(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)}),b2=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),om=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),Ld=(e,n=[0,0])=>{var s,a;const{x:t,y:r}=Wy(e)?e.internals.positionAbsolute:oh(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Q0=(e,n=[0,0])=>{var s,a;const{x:t,y:r}=Wy(e)?e.internals.positionAbsolute:oh(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},ST=(e,n)=>om(am(b2(e),b2(n))),kT=(e,n,t,r,s,a,o,l)=>{const c=Math.max(0,Math.min(e+t,s+o)-Math.max(e,s)),f=Math.max(0,Math.min(n+r,a+l)-Math.max(n,a));return Math.ceil(c*f)},J0=(e,n)=>kT(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),iC=e=>$i(e.width)&&$i(e.height)&&$i(e.x)&&$i(e.y),$i=e=>!isNaN(e)&&isFinite(e),CT=(e,n)=>(t,r)=>{},ch=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),uh=({x:e,y:n},[t,r,s],a=!1,o=[1,1])=>{const l={x:(e-t)/s,y:(n-r)/s};return a?ch(l,o):l},Ou=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Zc(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 imt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Zc(e,t),s=Zc(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Zc(e.top??e.y??0,t),s=Zc(e.bottom??e.y??0,t),a=Zc(e.left??e.x??0,n),o=Zc(e.right??e.x??0,n);return{top:r,right:o,bottom:s,left:a,x:a+o,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function amt(e,n,t,r,s,a){const{x:o,y:l}=Ou(e,[n,t,r]),{x:c,y:f}=Ou({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-c,h=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(_),bottom:Math.floor(h)}}const Yy=(e,n,t,r,s,a)=>{const o=imt(a,n,t),l=(n-o.x)/e.width,c=(t-o.y)/e.height,f=Math.min(l,c),_=Lu(f,r,s),h=e.x+e.width/2,m=e.y+e.height/2,g=n/2-h*_,S=t/2-m*_,k=amt(e,g,S,_,n,t),v={left:Math.min(k.left-o.left,0),top:Math.min(k.top-o.top,0),right:Math.min(k.right-o.right,0),bottom:Math.min(k.bottom-o.bottom,0)};return{x:g-v.left+v.right,y:S-v.top+v.bottom,zoom:_}},Od=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function sc(e){return e!=null&&e!=="parent"}function mo(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 ET(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 NT(e,n={width:0,height:0},t,r,s){const a={...e},o=r.get(t);if(o){const l=o.origin||s;a.x+=o.internals.positionAbsolute.x-(n.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(n.height??0)*l[1]}return a}function aC(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function omt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function lmt(e){return{...gT,...e||{}}}function od(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:a,y:o}=Hi(e),l=uh({x:a-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},r),{x:c,y:f}=t?ch(l,n):l;return{xSnapped:c,ySnapped:f,...l}}const Zy=e=>({width:e.offsetWidth,height:e.offsetHeight}),zT=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},cmt=["INPUT","SELECT","TEXTAREA"];function AT(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:cmt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const jT=e=>"clientX"in e,Hi=(e,n)=>{var a,o;const t=jT(e),r=t?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,s=t?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},oC=(e,n,t,r,s)=>{const a=n.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:s,position:o.getAttribute("data-handlepos"),x:(l.left-t.left)/r,y:(l.top-t.top)/r,...Zy(o)}})};function TT({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+s*.375+o*.375+t*.125,f=n*.125+a*.375+l*.375+r*.125,_=Math.abs(c-e),h=Math.abs(f-n);return[c,f,_,h]}function V_(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function lC({pos:e,x1:n,y1:t,x2:r,y2:s,c:a}){switch(e){case at.Left:return[n-V_(n-r,a),t];case at.Right:return[n+V_(r-n,a),t];case at.Top:return[n,t-V_(t-s,a)];case at.Bottom:return[n,t+V_(s-t,a)]}}function MT({sourceX:e,sourceY:n,sourcePosition:t=at.Bottom,targetX:r,targetY:s,targetPosition:a=at.Top,curvature:o=.25}){const[l,c]=lC({pos:t,x1:e,y1:n,x2:r,y2:s,c:o}),[f,_]=lC({pos:a,x1:r,y1:s,x2:e,y2:n,c:o}),[h,m,g,S]=TT({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:_});return[`M${e},${n} C${l},${c} ${f},${_} ${r},${s}`,h,m,g,S]}function RT({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,a=t0}const dmt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,hmt=(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)),_mt=(e,n,t={})=>{var a;if(!e.source||!e.target)return(a=t.onError)==null||a.call(t,"006",Gi.error006()),n;const r=t.getEdgeId||dmt;let s;return xT(e)?s={...e}:s={...e,id:r(e)},hmt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function DT({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,a,o,l]=RT({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,a,o,l]}const cC={[at.Left]:{x:-1,y:0},[at.Right]:{x:1,y:0},[at.Top]:{x:0,y:-1},[at.Bottom]:{x:0,y:1}},pmt=({source:e,sourcePosition:n=at.Bottom,target:t})=>n===at.Left||n===at.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function mmt({source:e,sourcePosition:n=at.Bottom,target:t,targetPosition:r=at.Top,center:s,offset:a,stepPosition:o}){const l=cC[n],c=cC[r],f={x:e.x+l.x*a,y:e.y+l.y*a},_={x:t.x+c.x*a,y:t.y+c.y*a},h=pmt({source:f,sourcePosition:n,target:_}),m=h.x!==0?"x":"y",g=h[m];let S=[],k,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=RT({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(l[m]*c[m]===-1){m==="x"?(k=s.x??f.x+(_.x-f.x)*o,v=s.y??(f.y+_.y)/2):(k=s.x??(f.x+_.x)/2,v=s.y??f.y+(_.y-f.y)*o);const j=[{x:k,y:f.y},{x:k,y:_.y}],D=[{x:f.x,y:v},{x:_.x,y:v}];l[m]===g?S=m==="x"?j:D:S=m==="x"?D:j}else{const j=[{x:f.x,y:_.y}],D=[{x:_.x,y:f.y}];if(m==="x"?S=l.x===g?D:j:S=l.y===g?j:D,n===r){const W=Math.abs(e[m]-t[m]);if(W<=a){const Z=Math.min(a-1,a-W);l[m]===g?b[m]=(f[m]>e[m]?-1:1)*Z:w[m]=(_[m]>t[m]?-1:1)*Z}}if(n!==r){const W=m==="x"?"y":"x",Z=l[m]===c[W],X=f[W]>_[W],J=f[W]<_[W];(l[m]===1&&(!Z&&X||Z&&J)||l[m]!==1&&(!Z&&J||Z&&X))&&(S=m==="x"?j:D)}const I={x:f.x+b.x,y:f.y+b.y},L={x:_.x+w.x,y:_.y+w.y},U=Math.max(Math.abs(I.x-S[0].x),Math.abs(L.x-S[0].x)),q=Math.max(Math.abs(I.y-S[0].y),Math.abs(L.y-S[0].y));U>=q?(k=(I.x+L.x)/2,v=S[0].y):(k=S[0].x,v=(I.y+L.y)/2)}const z={x:f.x+b.x,y:f.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...z.x!==S[0].x||z.y!==S[0].y?[z]:[],...S,...N.x!==S[S.length-1].x||N.y!==S[S.length-1].y?[N]:[],t],k,v,y,C]}function gmt(e,n,t,r){const s=Math.min(uC(e,n)/2,uC(n,t)/2,r),{x:a,y:o}=n;if(e.x===a&&a===t.x||e.y===o&&o===t.y)return`L${a} ${o}`;if(e.y===o){const f=e.xt.id===n):e[0])||null}function x2(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function vmt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const f=x2(c,n);a.has(f)||(o.push({id:f,color:c.color||t,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const LT=1e3,xmt=10,Qy={nodeOrigin:[0,0],nodeExtent:Rd,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},ymt={...Qy,checkEquality:!0};function Jy(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function wmt(e,n,t){const r=Jy(Qy,t);for(const s of e.values())if(s.parentId)t4(s,e,n,r);else{const a=oh(s,r.nodeOrigin),o=sc(s.extent)?s.extent:r.nodeExtent,l=rc(a,o,mo(s));s.internals.positionAbsolute=l}}function Smt(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 a={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(a):s.type==="target"&&r.push(a)}return{source:t,target:r}}function e4(e){return e==="manual"}function y2(e,n,t,r={}){var _,h;const s=Jy(ymt,r),a={i:0},o=new Map(n),l=s!=null&&s.elevateNodesOnSelect&&!e4(s.zIndexMode)?LT:0;let c=e.length>0,f=!1;n.clear(),t.clear();for(const m of e){let g=o.get(m.id);if(s.checkEquality&&m===(g==null?void 0:g.internals.userNode))n.set(m.id,g);else{const S=oh(m,s.nodeOrigin),k=sc(m.extent)?m.extent:s.nodeExtent,v=rc(S,k,mo(m));g={...s.defaults,...m,measured:{width:(_=m.measured)==null?void 0:_.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:v,handleBounds:Smt(m,g),z:OT(m,l,s.zIndexMode),userNode:m}},n.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),m.parentId&&t4(g,n,t,r,a),f||(f=m.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function kmt(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 t4(e,n,t,r,s){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=Jy(Qy,r),f=e.parentId,_=n.get(f);if(!_){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kmt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&c==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*xmt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const h=a&&!e4(c)?LT:0,{x:m,y:g,z:S}=Cmt(e,_,o,l,h,c),{positionAbsolute:k}=e.internals,v=m!==k.x||g!==k.y;(v||S!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:m,y:g}:k,z:S}})}function OT(e,n,t){const r=$i(e.zIndex)?e.zIndex:0;return e4(t)?r:r+(e.selected?n:0)}function Cmt(e,n,t,r,s,a){const{x:o,y:l}=n.internals.positionAbsolute,c=mo(e),f=oh(e,t),_=sc(e.extent)?rc(f,e.extent,c):f;let h=rc({x:o+_.x,y:l+_.y},r,c);e.extent==="parent"&&(h=wT(h,c,n));const m=OT(e,s,a),g=n.internals.z??0;return{x:h.x,y:h.y,z:g>=m?g+1:m}}function n4(e,n,t,r=[0,0]){var o;const s=[],a=new Map;for(const l of e){const c=n.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Ld(c),_=ST(f,l.rect);a.set(l.parentId,{expandedRect:_,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var y;const _=c.internals.positionAbsolute,h=mo(c),m=c.origin??r,g=l.x<_.x?Math.round(Math.abs(_.x-l.x)):0,S=l.y<_.y?Math.round(Math.abs(_.y-l.y)):0,k=Math.max(h.width,Math.round(l.width)),v=Math.max(h.height,Math.round(l.height)),b=(k-h.width)*m[0],w=(v-h.height)*m[1];(g>0||S>0||b||w)&&(s.push({id:f,type:"position",position:{x:c.position.x-g+b,y:c.position.y-S+w}}),(y=t.get(f))==null||y.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+g,y:C.position.y+S}})})),(h.width0){const g=n4(m,n,t,s);f.push(...g)}return{changes:f,updatedInternals:c}}async function Nmt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:a}){if(!n||!e.x&&!e.y)return!1;const o=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,a]],r);return!!o&&(o.x!==t[0]||o.y!==t[1]||o.k!==t[2])}function _C(e,n,t,r,s,a){let o=s;const l=r.get(o)||new Map;r.set(o,l.set(t,n)),o=`${s}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(t,n)),a){o=`${s}-${e}-${a}`;const f=r.get(o)||new Map;r.set(o,f.set(t,n))}}function IT(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:a,sourceHandle:o,targetHandle:l},f=`${s}-${o}--${a}-${l}`,_=`${a}-${l}--${s}-${o}`;_C("source",c,_,e,s,o),_C("target",c,f,e,a,l),n.set(r.id,r)}}function BT(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:BT(t,n):!1}function pC(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 zmt(e,n,t,r){const s=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!BT(o,e))&&(o.draggable||n&&typeof o.draggable>"u")){const l=e.get(a);l&&s.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:t.x-l.internals.positionAbsolute.x,y:t.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Rb({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var o,l,c;const s=[];for(const[f,_]of n){const h=(o=t.get(f))==null?void 0:o.internals.userNode;h&&s.push({...h,position:_.position,dragging:r})}if(!e)return[s[0],s];const a=(l=t.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=n.get(e))==null?void 0:c.position)||a.position,dragging:r}:s[0],s]}function Amt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const a={x:t-s.distance.x,y:r-s.distance.y},o=ch(a,n);return{x:o.x-a.x,y:o.y-a.y}}function jmt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},_=null,h=!1,m=null,g=!1,S=!1,k=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:z,nodeId:N,nodeClickDistance:T=0}){m=Us(C);function j({x:U,y:q}){const{nodeLookup:W,nodeExtent:Z,snapGrid:X,snapToGrid:J,nodeOrigin:ee,onNodeDrag:$,onSelectionDrag:B,onError:H,updateNodePositions:K}=n();a={x:U,y:q};let G=!1;const ie=l.size>1,ve=ie&&Z?b2(lh(l)):null,ce=ie&&J?Amt({dragItems:l,snapGrid:X,x:U,y:q}):null;for(const[re,P]of l){if(!W.has(re))continue;let oe={x:U-P.distance.x,y:q-P.distance.y};J&&(oe=ce?{x:Math.round(oe.x+ce.x),y:Math.round(oe.y+ce.y)}:ch(oe,X));let ue=null;if(ie&&Z&&!P.extent&&ve){const{positionAbsolute:Ee}=P.internals,Ae=Ee.x-ve.x+Z[0][0],He=Ee.x+P.measured.width-ve.x2+Z[1][0],Re=Ee.y-ve.y+Z[0][1],Ie=Ee.y+P.measured.height-ve.y2+Z[1][1];ue=[[Ae,Re],[He,Ie]]}const{position:de,positionAbsolute:ge}=yT({nodeId:re,nextPosition:oe,nodeLookup:W,nodeExtent:ue||Z,nodeOrigin:ee,onError:H});G=G||P.position.x!==de.x||P.position.y!==de.y,P.position=de,P.internals.positionAbsolute=ge}if(S=S||G,!!G&&(K(l,!0),k&&(r||$||!N&&B))){const[re,P]=Rb({nodeId:N,dragItems:l,nodeLookup:W});r==null||r(k,l,re,P),$==null||$(k,re,P),N||B==null||B(k,P)}}async function D(){if(!_)return;const{transform:U,panBy:q,autoPanSpeed:W,autoPanOnNodeDrag:Z}=n();if(!Z){c=!1,cancelAnimationFrame(o);return}const[X,J]=Xy(f,_,W);(X!==0||J!==0)&&(a.x=(a.x??0)-X/U[2],a.y=(a.y??0)-J/U[2],await q({x:X,y:J})&&j(a)),o=requestAnimationFrame(D)}function I(U){var ie;const{nodeLookup:q,multiSelectionActive:W,nodesDraggable:Z,transform:X,snapGrid:J,snapToGrid:ee,selectNodesOnDrag:$,onNodeDragStart:B,onSelectionDragStart:H,unselectNodesAndEdges:K}=n();h=!0,(!$||!z)&&!W&&N&&((ie=q.get(N))!=null&&ie.selected||K()),z&&$&&N&&(e==null||e(N));const G=od(U.sourceEvent,{transform:X,snapGrid:J,snapToGrid:ee,containerBounds:_});if(a=G,l=zmt(q,Z,G,N),l.size>0&&(t||B||!N&&H)){const[ve,ce]=Rb({nodeId:N,dragItems:l,nodeLookup:q});t==null||t(U.sourceEvent,l,ve,ce),B==null||B(U.sourceEvent,ve,ce),N||H==null||H(U.sourceEvent,ce)}}const L=eT().clickDistance(T).on("start",U=>{const{domNode:q,nodeDragThreshold:W,transform:Z,snapGrid:X,snapToGrid:J}=n();_=(q==null?void 0:q.getBoundingClientRect())||null,g=!1,S=!1,k=U.sourceEvent,W===0&&I(U),a=od(U.sourceEvent,{transform:Z,snapGrid:X,snapToGrid:J,containerBounds:_}),f=Hi(U.sourceEvent,_)}).on("drag",U=>{const{autoPanOnNodeDrag:q,transform:W,snapGrid:Z,snapToGrid:X,nodeDragThreshold:J,nodeLookup:ee}=n(),$=od(U.sourceEvent,{transform:W,snapGrid:Z,snapToGrid:X,containerBounds:_});if(k=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||N&&!ee.has(N))&&(g=!0),!g){if(!c&&q&&h&&(c=!0,D()),!h){const B=Hi(U.sourceEvent,_),H=B.x-f.x,K=B.y-f.y;Math.sqrt(H*H+K*K)>J&&I(U)}(a.x!==$.xSnapped||a.y!==$.ySnapped)&&l&&h&&(f=Hi(U.sourceEvent,_),j($))}}).on("end",U=>{if(!h||g){g&&l.size>0&&n().updateNodePositions(l,!1);return}if(c=!1,h=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:q,updateNodePositions:W,onNodeDragStop:Z,onSelectionDragStop:X}=n();if(S&&(W(l,!1),S=!1),s||Z||!N&&X){const[J,ee]=Rb({nodeId:N,dragItems:l,nodeLookup:q,dragging:!1});s==null||s(U.sourceEvent,l,J,ee),Z==null||Z(U.sourceEvent,J,ee),N||X==null||X(U.sourceEvent,ee)}}}).filter(U=>{const q=U.target;return!U.button&&(!w||!pC(q,`.${w}`,C))&&(!y||pC(q,y,C))});m.call(L)}function b(){m==null||m.on(".drag",null)}return{update:v,destroy:b}}function Tmt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const a of n.values())J0(s,Ld(a))>0&&r.push(a);return r}const Mmt=250;function Rmt(e,n,t,r){var l,c;let s=[],a=1/0;const o=Tmt(e,t,n+Mmt);for(const f of o){const _=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const h of _){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:m,y:g}=ic(f,h,h.position,!0),S=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));S>n||(S1){const f=r.type==="source"?"target":"source";return s.find(_=>_.type===f)??s[0]}return s[0]}function $T(e,n,t,r,s,a=!1){var f,_,h;const o=r.get(e);if(!o)return null;const l=s==="strict"?(f=o.internals.handleBounds)==null?void 0:f[n]:[...((_=o.internals.handleBounds)==null?void 0:_.source)??[],...((h=o.internals.handleBounds)==null?void 0:h.target)??[]],c=(t?l==null?void 0:l.find(m=>m.id===t):l==null?void 0:l[0])??null;return c&&a?{...c,...ic(o,c,c.position,!0)}:c}function HT(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Dmt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const PT=()=>!0;function Lmt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:_,flowId:h,panBy:m,cancelConnection:g,onConnectStart:S,onConnect:k,onConnectEnd:v,isValidConnection:b=PT,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:z,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const D=zT(e.target);let I=0,L;const{x:U,y:q}=Hi(e),W=HT(a,j),Z=l==null?void 0:l.getBoundingClientRect();let X=!1;if(!Z||!W)return;const J=$T(s,W,r,c,n);if(!J)return;let ee=Hi(e,Z),$=!1,B=null,H=!1,K=null;function G(){if(!_||!Z)return;const[de,ge]=Xy(ee,Z,N);m({x:de,y:ge}),I=requestAnimationFrame(G)}const ie={...J,nodeId:s,type:W,position:J.position},ve=c.get(s);let re={inProgress:!0,isValid:null,from:ic(ve,ie,at.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ve,to:ee,toHandle:null,toPosition:rC[ie.position],toNode:null,pointer:ee};function P(){X=!0,y(re),S==null||S(e,{nodeId:s,handleId:r,handleType:W})}T===0&&P();function oe(de){if(!X){const{x:Ie,y:nt}=Hi(de),Rt=Ie-U,At=nt-q;if(!(Rt*Rt+At*At>T*T))return;P()}if(!z()||!ie){ue(de);return}const ge=C();ee=Hi(de,Z),L=Rmt(uh(ee,ge,!1,[1,1]),t,c,ie),$||(G(),$=!0);const Ee=FT(de,{handle:L,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:o?"target":"source",isValidConnection:b,doc:D,lib:f,flowId:h,nodeLookup:c});K=Ee.handleDomNode,B=Ee.connection,H=Dmt(!!L,Ee.isValid);const Ae=c.get(s),He=Ae?ic(Ae,ie,at.Left,!0):re.from,Re={...re,from:He,isValid:H,to:Ee.toHandle&&H?Ou({x:Ee.toHandle.x,y:Ee.toHandle.y},ge):ee,toHandle:Ee.toHandle,toPosition:H&&Ee.toHandle?Ee.toHandle.position:rC[ie.position],toNode:Ee.toHandle?c.get(Ee.toHandle.nodeId):null,pointer:ee};y(Re),re=Re}function ue(de){if(!("touches"in de&&de.touches.length>0)){if(X){(L||K)&&B&&H&&(k==null||k(B));const{inProgress:ge,...Ee}=re,Ae={...Ee,toPosition:re.toHandle?re.toPosition:null};v==null||v(de,Ae),a&&(w==null||w(de,Ae))}g(),cancelAnimationFrame(I),$=!1,H=!1,B=null,K=null,D.removeEventListener("mousemove",oe),D.removeEventListener("mouseup",ue),D.removeEventListener("touchmove",oe),D.removeEventListener("touchend",ue)}}D.addEventListener("mousemove",oe),D.addEventListener("mouseup",ue),D.addEventListener("touchmove",oe),D.addEventListener("touchend",ue)}function FT(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=PT,nodeLookup:_}){const h=a==="target",m=n?o.querySelector(`.${l}-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:g,y:S}=Hi(e),k=o.elementFromPoint(g,S),v=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:m,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=HT(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||!w)return b;const T={source:h?y:r,sourceHandle:h?C:s,target:h?r:y,targetHandle:h?s:C};b.connection=T;const D=z&&N&&(t===Du.Strict?h&&w==="source"||!h&&w==="target":y!==r||C!==s);b.isValid=D&&f(T),b.toHandle=$T(y,w,C,_,t,!0)}return b}const w2={onPointerDown:Lmt,isValid:FT};function Omt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Us(e);function a({translateExtent:l,width:c,height:f,zoomStep:_=1,pannable:h=!0,zoomable:m=!0,inversePan:g=!1}){const S=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=y.sourceEvent.ctrlKey&&Od()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,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]))*(g?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},D=[[0,0],[c,f]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},D,l)},w=pT().on("start",v).on("zoom",h?b:null).on("zoom.wheel",m?S:null);s.call(w,{})}function o(){s.on("zoom",null)}return{update:a,destroy:o,pointer:Li}}const lm=e=>({x:e.x,y:e.y,zoom:e.k}),Db=({x:e,y:n,zoom:t})=>im.translate(e,n).scale(t),cu=(e,n)=>e.target.closest(`.${n}`),UT=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Imt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lb=(e,n=0,t=Imt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},qT=e=>{const n=e.ctrlKey&&Od()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Bmt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return _=>{if(cu(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(_.ctrlKey&&o){const v=Li(_),b=qT(_),w=h*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const m=_.deltaMode===1?20:1;let g=s===Ql.Vertical?0:_.deltaX*m,S=s===Ql.Horizontal?0:_.deltaY*m;!Od()&&_.shiftKey&&s!==Ql.Vertical&&(g=_.deltaY*m,S=0),r.translateBy(t,-(g/h)*a,-(S/h)*a,{internal:!0});const k=lm(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(_,k),e.panScrollTimeout=setTimeout(()=>{f==null||f(_,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(_,k))}}function $mt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const a=r.type==="wheel",o=!n&&a&&!r.ctrlKey,l=cu(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),t.call(this,r,s)}}function Hmt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const s=lm(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Pmt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return a=>{var o,l;e.usedRightMouseButton=!!(t&&UT(n,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),s&&!((l=a.sourceEvent)!=null&&l.internal)&&(s==null||s(a.sourceEvent,lm(a.transform)))}}function Fmt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&UT(n,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=lm(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,c)},t?150:0)}}}function Umt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:_}){return h=>{var v;const m=e||n,g=t&&h.ctrlKey,S=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(cu(h,`${f}-flow__node`)||cu(h,`${f}-flow__edge`)))return!0;if(!r&&!m&&!s&&!a&&!t||o||_&&!S||cu(h,l)&&S||cu(h,c)&&(!S||s&&S&&!e)||!t&&h.ctrlKey&&S)return!1;if(!t&&h.type==="touchstart"&&((v=h.touches)==null?void 0:v.length)>1)return h.preventDefault(),!1;if(!m&&!s&&!g&&S||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||S)&&k}}function qmt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),h=pT().scaleExtent([n,t]).translateExtent(r),m=Us(e).call(h);w({x:s.x,y:s.y,zoom:Lu(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const g=m.on("wheel.zoom"),S=m.on("dblclick.zoom");h.wheelDelta(qT);async function k(L,U){return m?new Promise(q=>{h==null||h.interpolate((U==null?void 0:U.interpolate)==="linear"?ad:c0).transform(Lb(m,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>q(!0)),L)}):!1}function v({noWheelClassName:L,noPanClassName:U,onPaneContextMenu:q,userSelectionActive:W,panOnScroll:Z,panOnDrag:X,panOnScrollMode:J,panOnScrollSpeed:ee,preventScrolling:$,zoomOnPinch:B,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:G,lib:ie,onTransformChange:ve,connectionInProgress:ce,paneClickDistance:re,selectionOnDrag:P}){W&&!f.isZoomingOrPanning&&b();const oe=Z&&!G&&!W;h.clickDistance(P?1/0:!$i(re)||re<0?0:re);const ue=oe?Bmt({zoomPanValues:f,noWheelClassName:L,d3Selection:m,d3Zoom:h,panOnScrollMode:J,panOnScrollSpeed:ee,zoomOnPinch:B,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):$mt({noWheelClassName:L,preventScrolling:$,d3ZoomHandler:g});m.on("wheel.zoom",ue,{passive:!1});const de=Hmt({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});h.on("start",de);const ge=Pmt({zoomPanValues:f,panOnDrag:X,onPaneContextMenu:!!q,onPanZoom:a,onTransformChange:ve});h.on("zoom",ge);const Ee=Fmt({zoomPanValues:f,panOnDrag:X,panOnScroll:Z,onPaneContextMenu:q,onPanZoomEnd:l,onDraggingChange:c});h.on("end",Ee);const Ae=Umt({zoomActivationKeyPressed:G,panOnDrag:X,zoomOnScroll:H,panOnScroll:Z,zoomOnDoubleClick:K,zoomOnPinch:B,userSelectionActive:W,noPanClassName:U,noWheelClassName:L,lib:ie,connectionInProgress:ce});h.filter(Ae),K?m.on("dblclick.zoom",S):m.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function w(L,U,q){const W=Db(L),Z=h==null?void 0:h.constrain()(W,U,q);return Z&&await k(Z),Z}async function y(L,U){const q=Db(L);return await k(q,U),q}function C(L){if(m){const U=Db(L),q=m.property("__zoom");(q.k!==L.zoom||q.x!==L.x||q.y!==L.y)&&(h==null||h.transform(m,U,null,{sync:!0}))}}function z(){const L=m?_T(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function N(L,U){return m?new Promise(q=>{h==null||h.interpolate((U==null?void 0:U.interpolate)==="linear"?ad:c0).scaleTo(Lb(m,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>q(!0)),L)}):!1}async function T(L,U){return m?new Promise(q=>{h==null||h.interpolate((U==null?void 0:U.interpolate)==="linear"?ad:c0).scaleBy(Lb(m,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>q(!0)),L)}):!1}function j(L){h==null||h.scaleExtent(L)}function D(L){h==null||h.translateExtent(L)}function I(L){const U=!$i(L)||L<0?0:L;h==null||h.clickDistance(U)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:z,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:D,syncViewport:C,setClickDistance:I}}var Iu;(function(e){e.Line="line",e.Handle="handle"})(Iu||(Iu={}));function Gmt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:a}){const o=e-n,l=t-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&s&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function mC(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 Yo(e,n){return Math.max(0,n-e)}function Zo(e,n){return Math.max(0,e-n)}function W_(e,n,t){return Math.max(0,n-e,e-t)}function gC(e,n){return e?!n:n}function Vmt(e,n,t,r,s,a,o,l){let{affectsX:c,affectsY:f}=n;const{isHorizontal:_,isVertical:h}=n,m=_&&h,{xSnapped:g,ySnapped:S}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:z,height:N,aspectRatio:T}=e;let j=Math.floor(_?g-e.pointerX:0),D=Math.floor(h?S-e.pointerY:0);const I=z+(c?-j:j),L=N+(f?-D:D),U=-a[0]*z,q=-a[1]*N;let W=W_(I,k,v),Z=W_(L,b,w);if(o){let ee=0,$=0;c&&j<0?ee=Yo(y+j+U,o[0][0]):!c&&j>0&&(ee=Zo(y+I+U,o[1][0])),f&&D<0?$=Yo(C+D+q,o[0][1]):!f&&D>0&&($=Zo(C+L+q,o[1][1])),W=Math.max(W,ee),Z=Math.max(Z,$)}if(l){let ee=0,$=0;c&&j>0?ee=Zo(y+j,l[0][0]):!c&&j<0&&(ee=Yo(y+I,l[1][0])),f&&D>0?$=Zo(C+D,l[0][1]):!f&&D<0&&($=Yo(C+L,l[1][1])),W=Math.max(W,ee),Z=Math.max(Z,$)}if(s){if(_){const ee=W_(I/T,b,w)*T;if(W=Math.max(W,ee),o){let $=0;!c&&!f||c&&!f&&m?$=Zo(C+q+I/T,o[1][1])*T:$=Yo(C+q+(c?j:-j)/T,o[0][1])*T,W=Math.max(W,$)}if(l){let $=0;!c&&!f||c&&!f&&m?$=Yo(C+I/T,l[1][1])*T:$=Zo(C+(c?j:-j)/T,l[0][1])*T,W=Math.max(W,$)}}if(h){const ee=W_(L*T,k,v)/T;if(Z=Math.max(Z,ee),o){let $=0;!c&&!f||f&&!c&&m?$=Zo(y+L*T+U,o[1][0])/T:$=Yo(y+(f?D:-D)*T+U,o[0][0])/T,Z=Math.max(Z,$)}if(l){let $=0;!c&&!f||f&&!c&&m?$=Yo(y+L*T,l[1][0])/T:$=Zo(y+(f?D:-D)*T,l[0][0])/T,Z=Math.max(Z,$)}}}D=D+(D<0?Z:-Z),j=j+(j<0?W:-W),s&&(m?I>L*T?D=(gC(c,f)?-j:j)/T:j=(gC(c,f)?-D:D)*T:_?(D=j/T,f=c):(j=D*T,c=f));const X=c?y+j:y,J=f?C+D:C;return{width:z+(c?-j:j),height:N+(f?-D:D),x:a[0]*j*(c?-1:1)+X,y:a[1]*D*(f?-1:1)+J}}const GT={width:0,height:0,x:0,y:0},Wmt={...GT,pointerX:0,pointerY:0,aspectRatio:1};function Kmt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=t[0]*a,c=t[1]*o;return[[r-l,s-c],[r+a-l,s+o-c]]}function Xmt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const a=Us(e);let o={controlDirection:mC("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:_,keepAspectRatio:h,resizeDirection:m,onResizeStart:g,onResize:S,onResizeEnd:k,shouldResize:v}){let b={...GT},w={...Wmt};o={boundaries:_,resizeDirection:m,keepAspectRatio:h,controlDirection:mC(f)};let y,C=null,z=[],N,T,j,D=!1;const I=eT().on("start",L=>{const{nodeLookup:U,transform:q,snapGrid:W,snapToGrid:Z,nodeOrigin:X,paneDomNode:J}=t();if(y=U.get(n),!y)return;C=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:$}=od(L.sourceEvent,{transform:q,snapGrid:W,snapToGrid:Z,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:ee,pointerY:$,aspectRatio:b.width/b.height},N=void 0,T=sc(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=U.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),z=[],j=void 0;for(const[B,H]of U)if(H.parentId===n&&(z.push({id:B,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=Kmt(H,y,H.origin??X);j?j=[[Math.min(K[0][0],j[0][0]),Math.min(K[0][1],j[0][1])],[Math.max(K[1][0],j[1][0]),Math.max(K[1][1],j[1][1])]]:j=K}g==null||g(L,{...b})}).on("drag",L=>{const{transform:U,snapGrid:q,snapToGrid:W,nodeOrigin:Z}=t(),X=od(L.sourceEvent,{transform:U,snapGrid:q,snapToGrid:W,containerBounds:C}),J=[];if(!y)return;const{x:ee,y:$,width:B,height:H}=b,K={},G=y.origin??Z,{width:ie,height:ve,x:ce,y:re}=Vmt(w,o.controlDirection,X,o.boundaries,o.keepAspectRatio,G,T,j),P=ie!==B,oe=ve!==H,ue=ce!==ee&&P,de=re!==$&&oe;if(!ue&&!de&&!P&&!oe)return;if((ue||de||G[0]===1||G[1]===1)&&(K.x=ue?ce:b.x,K.y=de?re:b.y,b.x=K.x,b.y=K.y,z.length>0)){const He=ce-ee,Re=re-$;for(const Ie of z)Ie.position={x:Ie.position.x-He+G[0]*(ie-B),y:Ie.position.y-Re+G[1]*(ve-H)},J.push(Ie)}if((P||oe)&&(K.width=P&&(!o.resizeDirection||o.resizeDirection==="horizontal")?ie:b.width,K.height=oe&&(!o.resizeDirection||o.resizeDirection==="vertical")?ve:b.height,b.width=K.width,b.height=K.height),N&&y.expandParent){const He=G[0]*(K.width??0);K.x&&K.x{D&&(k==null||k(L,{...b}),s==null||s({...b}),D=!1)});a.call(I)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}var Ob={exports:{}},Ib={},Bb={exports:{}},$b={};/** +`):L;W(!0),X(null);try{return await vKe(e,B,Ke,{sessionId:r}),Ee.current=Ke,S(ut=>ut&&ut.source==="checkout"?{source:"checkout",file:{...ut.file,content:Ke}}:ut),!0}catch(ut){return X(ut instanceof Error?ut.message:String(ut)),!1}finally{W(!1)}},He=j&&F&&!oe,Te=Mdt({projectId:e,filePath:B,sessionId:r,enabled:He,ready:$!=null&&!$.notFound,source:ue?L:($==null?void 0:$.content)??""}),Ie=Ddt({projectId:e,filePath:B,sessionId:r,enabled:He,savedSource:he,dirty:me,onPulled:R.useCallback(Ke=>{Ke.includes(B)&&C(ut=>ut+1)},[B])}),[et,Tt]=R.useState(!1),zt=((dn=Ie.last)==null?void 0:dn.conflicts.length)??0;R.useEffect(()=>{zt>0&&Tt(!0)},[zt]);const Wt=Ie.error?Iye():zt>0?K2e():Ie.blocked?E9():Ie.link?C9():Rye(),fn=Ie.error||zt>0?"text-accent-red":Ie.link?"text-accent-green":void 0,ht=j&&Te.showPdf&&Te.compiled!=null,Qe=ue&&!(T&&!D)&&!ht,st=Te.compiled?`${C1(e,Te.compiled.path,{sessionId:r})}&v=${Te.compiled.version}`:null,we=st?`${st}&view=${Te.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,Le=Te.compiled?Te.compiled.path.split("/").pop()??Te.compiled.path:null,qe=async()=>{me&&!await Re()||j&&Te.engine&&Te.compile()},tt=async()=>{me&&await qe()},[at,Mt]=R.useState(!1),[yt,Ot]=R.useState(null),Rt=async()=>{Mt(!0),Ot(null);try{await xKe(e,B,{sessionId:r})}catch(Ke){Ot(Ke instanceof Error?Ke.message:String(Ke))}finally{Mt(!1)}},xt=`${N?g7(n):re?Vh(e,n):C1(e,B,{sessionId:r,ref:s})}&v=${y}`;R.useEffect(()=>{let Ke=!1;w(!0);const ut=async()=>{const ct=await oXe(e,n),Ut=(ct==null?void 0:ct.presentation)==="text"||(ct==null?void 0:ct.presentation)==="unknown",Qt=ct&&Ut?await gE(e,n):null,Gr=ct===null||Ut&&Qt===null;return{path:n,content:(Qt==null?void 0:Qt.content)??"",truncated:(Qt==null?void 0:Qt.truncated)??!1,binary:(Qt==null?void 0:Qt.binary)??(ct==null?void 0:ct.presentation)==="download",notFound:Gr,presentation:Qt?Qt.binary?"download":"text":(ct==null?void 0:ct.presentation)??"download"}},_n=async()=>{for(const ct of[`artifacts/${n}`,n]){const Ut=await m7(e,ct,{sessionId:r}).catch(()=>null);if(Ut&&!Ut.notFound)return Ut}return null};return(N?bKe(n).then(ct=>({source:"absolute",file:ct})):z?ut().then(async ct=>{if(!ct.notFound)return{source:"artifact",file:ct};const Ut=await _n();return Ut?{source:"checkout",file:Ut}:{source:"artifact",file:ct}}):m7(e,n,{sessionId:r,ref:s}).then(ct=>ct.notFound&&!s?ut().then(Ut=>Ut.notFound?{source:"checkout",file:ct}:{source:"artifact",file:Ut,checkoutRoot:ct.root}):{source:"checkout",file:ct})).then(ct=>{Ke||(S(ct),v(null))}).catch(ct=>{Ke||v(ct.message)}).finally(()=>{Ke||w(!1)}),()=>{Ke=!0}},[e,n,t,r,s,y]),R.useLayoutEffect(()=>{const Ke=J.current,ut=ee.current;!Ke||!$||!ut||(Ke.scrollTop=ut.top,Ke.scrollLeft=ut.left)},[$]);const hn=Ke=>{if(Ke.source==="absolute")return Lce();if(z)return Nce({root:r?v_():b_()});if(s)return Tce({branch:Ae(s)});if(r&&Ke.source==="checkout"&&Ke.file.root==="clone")return Wue();const ut=Ke.source==="checkout"?Ke.file.root:Ke.checkoutRoot;return $ce({root:ut==="worktree"?v_():b_()})};return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[h.jsx(wu,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:B,children:B}),o&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:$D({branch:Ae(o)}),children:[h.jsx(cp,{size:11}),o]}),Qe&&(q||me||Z)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${Z?"text-accent-red":"text-muted"}`,title:Z??(q?xa():Uue()),children:q?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Dt})," ",gue()]}):Z?due():$ue()}),j&&Te.compiled&&h.jsx("button",{className:`${vn} ${Te.showPdf?"":"active"}`,"data-tip":Te.stale&&Te.showPdf?eue():Te.showPdf?iu():D6(),"data-tip-align":"end","aria-label":Te.showPdf?iu():D6(),onClick:()=>Te.setShowPdf(!Te.showPdf),children:Te.showPdf?h.jsx(Xb,{size:13}):h.jsx(wu,{size:13,className:Te.stale?"text-accent-amber":void 0})}),j&&st&&Le&&h.jsx("a",{className:vn,"data-tip":Te.stale?oce({name:Ae(Le)}):Gw({name:Ae(Le)}),"data-tip-align":"end","aria-label":Gw({name:Ae(Le)}),href:st,download:Le,children:h.jsx(Z9,{size:13,className:Te.stale?"text-accent-amber":void 0})}),He&&h.jsx("button",{className:`${vn} ${et?"active":""}`,"data-tip":Wt,"data-tip-align":"end","aria-label":bO({status:Wt}),"aria-expanded":et,onClick:()=>Tt(Ke=>!Ke),children:Ie.syncing?h.jsx("span",{className:Dt}):h.jsx(TVe,{size:13,className:fn})}),j&&F&&h.jsx("button",{className:vn,"data-tip":Te.compiled?M6():A6(),"data-tip-align":"end","aria-label":Te.compiled?M6():A6(),disabled:Te.compiling||!Te.engine,onClick:()=>void qe(),children:Te.compiling?h.jsx("span",{className:Dt}):h.jsx(PVe,{size:13})}),T&&h.jsx("button",{className:`${vn} ${D?"active":""}`,"data-tip":D?x0():iu(),"data-tip-align":"end","aria-label":D?x0():iu(),onClick:()=>I(Ke=>!Ke),children:h.jsx(Xb,{size:13})}),F&&h.jsx("button",{className:vn,"data-tip":yt??T6(),"data-tip-align":"end","aria-label":T6(),disabled:at,onClick:()=>void Rt(),children:at?h.jsx("span",{className:Dt}):h.jsx(Jl,{size:13})}),h.jsx("button",{className:vn,"data-tip":R6(),"data-tip-align":"end","aria-label":R6(),onClick:()=>C(Ke=>Ke+1),children:b?h.jsx("span",{className:Dt}):h.jsx(iE,{size:13})})]}),!k&&ce&&(g==null?void 0:g.source)==="checkout"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Uce({root:g.file.root==="worktree"?v_():b_()})}),(Te.error||Te.log)&&h.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:[h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("span",{className:`flex-1 min-w-0 text-sm ${Te.builtWithErrors?"text-subtext":"text-accent-red"}`,children:Te.error??(Te.builtWithErrors?Tle():kle())}),h.jsx("button",{className:vn,"data-tip":j6(),"data-tip-align":"end","aria-label":Yle(),onClick:Te.dismiss,children:h.jsx(Yr,{size:13})})]}),Te.log&&h.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:Te.log})]}),He&&Ie.staleOnDisk&&h.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:[h.jsx("span",{className:"flex-1 min-w-0",children:Yce()}),h.jsx("button",{className:Wn,onClick:()=>{Ie.reloaded(),C(Ke=>Ke+1)},children:Ule()})]}),He&&Ie.error&&h.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4 flex items-start gap-2",children:[h.jsx("span",{className:"flex-1 min-w-0 text-sm text-accent-red whitespace-pre-wrap",children:Ie.error}),h.jsx("button",{className:vn,"data-tip":j6(),"data-tip-align":"end","aria-label":ece(),onClick:Ie.dismiss,children:h.jsx(Yr,{size:13})})]}),He&&et&&Ie.loaded&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4",children:h.jsx($dt,{overleaf:Ie})}),j&&F&&Te.engine===null&&Te.installHint&&h.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[Te.installHint,Te.installCommand&&h.jsx(Hdt,{command:Te.installCommand})]}),Te.note&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:Te.note}),ht&&Te.stale&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:Tue()}),h.jsxs("div",{ref:J,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ke=>{const ut={top:Ke.currentTarget.scrollTop,left:Ke.currentTarget.scrollLeft};ee.current=ut,f==null||f(ut)},children:[!Qe&&!k&&!z&&(g==null?void 0:g.source)==="checkout"&&!g.file.notFound&&!s&&r&&g.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Lue()}),!Qe&&!k&&(g==null?void 0:g.source)==="artifact"&&!g.file.notFound&&ve&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:mle({root:g.checkoutRoot==="worktree"?v_():b_()})}),k?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[fce()," ",Ae(k)]}):$===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:vce()}):$.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:g?hn(g):Sce()}):ie?h.jsx(u2,{kind:ie,url:xt,name:n.split("/").pop()??n}):$.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[xle()," ",h.jsx("a",{href:xt,download:n.split("/").pop()??n,children:g9()})]}):ht&&we&&Le?h.jsx(u2,{kind:"pdf",url:we,name:Le,downloadBar:!1},we):T&&!D?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:re?h.jsx(Dj,{projectId:e,folder:H,markdown:$.content}):h.jsx(ga,{text:$.content,resolveFilePath:K,resolveImageSrc:G,onOpenFile:l&&((Ke,ut,_n,Rr,ct)=>l(Ke,r,s,ct))})}):Qe?h.jsx(Idt,{value:L,onChange:Ke=>{P(Ke),m==null||m(),Z&&X(null)},onSave:()=>void tt(),onBlur:()=>void tt(),path:n,highlightLine:a,scrollRequest:_,onScrollRequestHandled:d}):h.jsxs(h.Fragment,{children:[h.jsx(zj,{text:$.content,path:n,highlightLine:a,scrollRequest:_,onScrollRequestHandled:d}),$.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:pce()})]})]})]})}const jb=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function Pdt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:a,setOpen:o,ref:l}=_o(),c=R.useRef(null);return R.useEffect(()=>{if(!a)return;const f=_=>{var d;_.key==="Escape"&&((d=c.current)==null||d.focus())};return document.addEventListener("keydown",f,!0),()=>document.removeEventListener("keydown",f,!0)},[a]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-start [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:start-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx("button",{className:`${vn} project-back !text-text`,"aria-label":L6(),onClick:n,children:h.jsx(uh,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:l,children:[h.jsxs("button",{ref:c,className:`brand${a?" open":""}`,onClick:()=>o(f=>!f),"aria-expanded":a,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:dhe()}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(ya,{className:"project-chevron",size:14})]}),a&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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 project-menu",children:[h.jsx("button",{className:Zr,onClick:()=>{o(!1),r()},children:h.jsxs("span",{className:jb,children:[h.jsx(tE,{size:14}),nhe()]})}),h.jsx("button",{className:Zr,onClick:()=>{o(!1),n()},children:h.jsxs("span",{className:jb,children:[h.jsx(aWe,{size:14}),L6()]})}),h.jsx("button",{className:Zr,onClick:()=>{var f;(f=c.current)==null||f.focus(),o(!1),t()},children:h.jsxs("span",{className:jb,children:[h.jsx(YVe,{size:14}),ahe()]})})]})]}),s&&h.jsx("button",{className:vn,"data-tip":O6(),"data-tip-align":"end","aria-label":O6(),onClick:s,children:h.jsx(rE,{size:15})})]})}const Lk=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),zh=["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(" "),Ok=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),Fj=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Ik=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),Udt=[{id:"AI/ML",label:Gge},{id:"Biology",label:Xge},{id:"Physics",label:r1e},{id:"Other",label:Jge}];function qdt({onDone:e,preferredAgent:n}){const[t,r]=R.useState(0),[s,a]=R.useState(null),[o,l]=R.useState(),[c,f]=R.useState(!1),[_,d]=R.useState(null),[m,g]=R.useState(null),[S,k]=R.useState(!1),[v,b]=R.useState([]),[w,y]=R.useState(""),[C,z]=R.useState(""),[N,T]=R.useState([]),[j,D]=R.useState(""),[I,L]=R.useState([]),[P,q]=R.useState(!1),W=R.useRef(0),[Z,X]=R.useState(!1),[J,ee]=R.useState(!1),$=(s==null?void 0:s.some(F=>F.agentReady))??!1,B=o!=null,H=R.useRef(0),K=(F,oe=!1)=>{const ue=++H.current;k(!0),X(!1),ee(!1),l(void 0);const he=()=>ue===H.current;Promise.allSettled([C0(F,oe).then(me=>he()&&a(me)),uE().then(me=>he()&&l(me.gitVersion))]).then(([me,Ee])=>{he()&&(me.status==="rejected"&&(X(!0),a(null)),Ee.status==="rejected"&&(ee(!0),l(void 0)))}).finally(()=>he()&&k(!1))};R.useEffect(()=>K(!1),[]),R.useEffect(()=>{if(s===null)return;const F=s.filter(oe=>oe.agentReady);g(oe=>{var he;if(oe&&F.some(me=>me.id===oe))return oe;const ue=n&&F.find(me=>me.id===n.harness);return(ue==null?void 0:ue.id)??((he=F[0])==null?void 0:he.id)??null})},[s,n]),R.useEffect(()=>J2(()=>{C0(!0).then(F=>{a(F),X(!1)}).catch(()=>X(!0))}),[]),R.useEffect(()=>{lXe().then(F=>{b(F.researchAreas),y(F.otherArea??""),z(F.background??""),T(F.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const F=j.trim();if(F.length<3){L([]),q(!1);return}const oe=++W.current;q(!0);const ue=setTimeout(()=>{fE(F).then(he=>oe===W.current&&L(he)).catch(()=>oe===W.current&&L([])).finally(()=>oe===W.current&&q(!1))},350);return()=>clearTimeout(ue)},[j]);const G=F=>{const oe=N.some(ue=>ue.paperId===F.paperId);T(ue=>ue.some(he=>he.paperId===F.paperId)?ue:[...ue,{paperId:F.paperId,title:Bk(F.title)}]),D(""),L([]),oe||Zb(F.paperId).then(ue=>{var me;const he=(me=ue.title)==null?void 0:me.trim();he&&T(Ee=>Ee.map(Re=>Re.paperId===F.paperId?{...Re,title:he}:Re))}).catch(()=>{})},ie=F=>T(oe=>oe.filter(ue=>ue.paperId!==F)),ve=F=>{b(oe=>oe.includes(F)?oe.filter(ue=>ue!==F):[...oe,F])},ce=v.length>0&&(!v.includes("Other")||w.trim().length>0),re=async()=>{const F=s==null?void 0:s.find(ue=>ue.id===m&&ue.agentReady);if(!F||c)return;const oe=Vdt(F);f(!0),d(null);try{const ue=await aKe(oe,{researchAreas:v,otherArea:v.includes("Other")?w:null,background:C||null,papers:N});e(ue.project,ue.selection)}catch(ue){d(ue instanceof Error?ue.message:String(ue))}finally{f(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${t===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${t===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:t===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:h.jsx(E1,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:Dge()})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:P1e()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:m2e()})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:vbe()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:Yve()})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:obe()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:H2e()})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs("button",{className:`${es} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:[X6()," ",h.jsx(J_,{size:20})]})})]}):t===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(E1,{})," ",e2e()]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:w1e()}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:Gbe()}),s!==null&&!$&&h.jsx("p",{className:Lk,children:Pve()}),s!==null&&$&&m===null&&h.jsx("p",{className:Lk,children:E1e()}),h.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:s!==null?s.map(F=>h.jsx(Kdt,{h:F,selected:m===F.id,onSelect:()=>g(F.id)},F.id)):Z?h.jsx("div",{className:zh,children:Z6()}):h.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[h.jsx("span",{className:Dt})," ",J1e()]})}),(o===null||J)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(Xdt,{gitVersion:o,error:J}),J?h.jsx("p",{className:Ok,children:Z6()}):h.jsx("p",{className:Ok,children:pbe()})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:Ul,onClick:()=>r(0),children:[h.jsx(uh,{size:12})," ",K6()]}),(Z||J||o===null||s!==null&&!$)&&h.jsxs("button",{className:Ul,onClick:()=>K(!0,!0),disabled:S,children:[h.jsx(Gh,{size:12,className:S?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," ",Jbe()]}),h.jsx("div",{style:{flex:1}}),h.jsxs("button",{className:es,onClick:()=>r(2),disabled:S||!$||m===null||!B,title:S?M2e():$?m===null?B1e():J?ove():o===void 0?z2e():o===null?Nbe():void 0:Bve(),children:[X6()," ",h.jsx(J_,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(E1,{})," ",s2e()]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:l2e()}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:Fj,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[h.jsx("legend",{children:O2e()}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:D1e()}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:Udt.map(F=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:v.includes(F.id),onChange:()=>ve(F.id),disabled:c}),h.jsx("span",{children:F.label()})]},F.id))}),v.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:F=>y(F.target.value),disabled:c,placeholder:h2e(),"aria-label":Xbe()})]}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:pve()}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:F=>z(F.target.value),disabled:c,rows:4,placeholder:rbe()}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:fve()}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:Bge()}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:j,onChange:F=>D(F.target.value),disabled:c,placeholder:wve()}),P?h.jsx("div",{className:zh,children:Eve()}):I.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:I.map(F=>h.jsxs("button",{type:"button",onClick:()=>G(F),disabled:c,children:[h.jsx("span",{className:dh,children:Bk(F.title)}),h.jsx("span",{className:"id",children:F.paperId})]},F.paperId))}):null]}),N.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:N.map(F=>h.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]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx("span",{className:dh,children:F.title||F.paperId}),h.jsx("span",{className:"id",children:F.paperId}),h.jsx("button",{type:"button","aria-label":jO({name:Ae(F.paperId)}),onClick:()=>ie(F.paperId),disabled:c,children:h.jsx(Yr,{size:12})})]},F.paperId))})]})}),!ce&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:v.length===0?j1e():X1e()}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:Ul,onClick:()=>r(1),disabled:c,children:[h.jsx(uh,{size:12})," ",K6()]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{className:es,onClick:()=>void re(),disabled:c||m===null||!ce,children:c?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Dt})," ",Dve()]}):h.jsxs(h.Fragment,{children:[fbe()," ",h.jsx(J_,{size:13})]})})]}),m===null&&h.jsx("p",{className:Ik,children:q2e()}),_&&h.jsx("p",{className:Ik,children:_})]})})})}function Bk(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function Gdt(e){return e.agentReady?{cls:"st-done",label:Vve()}:e.installed?e.installBroken?{cls:"st-starting",label:Sbe()}:e.authState==="unknown"?{cls:"st-starting",label:x2e()}:e.authState==="unsupported"?{cls:"st-starting",label:k2e()}:e.installed?{cls:"st-starting",label:Fbe()}:{cls:"st-idle",label:Y6()}:{cls:"st-idle",label:Y6()}}function Vdt(e){var t,r;const n=((t=e.models[0])==null?void 0:t.id)??null;return{harness:e.id,model:n,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:hp(e,n).defaultId}}function Wdt({harness:e}){return h.jsx(qv,{harness:e,size:26})}function Kdt({h:e,selected:n,onSelect:t}){var c;const r=Gdt(e),s=n?{cls:"st-done",label:jve()}:r,o=[(c=e.version)==null?void 0:c.replace(/\s*\(.*\)$/,""),e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(f=>w0(f)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · "),l=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[h.jsx(Wdt,{harness:e.id}),h.jsx("span",{className:"onb-card-name text-xl font-semibold tracking-[-0.01em]",children:e.name})]}),h.jsxs("span",{className:`${tx} ${s.cls}`,children:[e.agentReady?h.jsx(ds,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),s.label]})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 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-[0_0_0_1px_var(--accent)]${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[l,h.jsxs("div",{className:`onb-card-detail ${Qr}`,children:[e.account??S9(),e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:`${zh} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:o,children:o})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 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-[0_0_0_1px_var(--accent)]",children:[l,h.jsx("div",{className:zh,children:Op(e.agentNote)})]})}function Xdt({gitVersion:e,error:n}){return h.jsxs("div",{className:Fj,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:Tbe()}),h.jsxs("span",{className:`${tx} ${e?"st-done":n||e===null?"st-failed":"st-starting"}`,children:[e?h.jsx(ds,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),e?rve():n?u1e():e===null?k9():_1e()]})]}),(e||!n&&e===void 0)&&h.jsx("div",{className:zh,children:e??b1e()})]})}function F_(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function Ydt(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 $k(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 Zdt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Qdt({onCreated:e,onCancel:n}){const[t,r]=R.useState("blank"),[s,a]=R.useState(""),[o,l]=R.useState(!1),[c,f]=R.useState(""),[_,d]=R.useState(!1),[m,g]=R.useState(null),[S,k]=R.useState(null),[v,b]=R.useState(!1),[w,y]=R.useState(!1),[C,z]=R.useState(!1),[N,T]=R.useState(null),[j,D]=R.useState(!1),[I,L]=R.useState(!1),[P,q]=R.useState(void 0),[W,Z]=R.useState("research-project"),[X,J]=R.useState(null),[ee,$]=R.useState(!1),[B,H]=R.useState(!1),[K,G]=R.useState(""),[ie,ve]=R.useState(null),[ce,re]=R.useState([]),[F,oe]=R.useState(!1),[ue,he]=R.useState(""),[me,Ee]=R.useState(""),[Re,He]=R.useState(0),Te=R.useRef(0),Ie=R.useRef(0),et=R.useRef(0),Tt=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1},github:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),zt=s.trim()?`~/OpenResearch/${F_(s,48)}`:"",Wt=`~/OpenResearch/${F_(s||(ie==null?void 0:ie.title)||(ie==null?void 0:ie.paperId)||"")}`,fn=t==="paper"?$k(ie==null?void 0:ie.repoUrl):null,ht=t==="github"?$k(me.trim()||null):fn??(m!=null&&m.githubOwner&&m.githubRepo?{owner:m.githubOwner,repo:m.githubRepo}:null),Qe=t==="blank"&&!_?zt:t==="github"&&ht&&!_?`~/OpenResearch/${F_(ht.repo,48)}`:t==="paper"&&ie&&!_?Wt:c,st=t==="github"?null:ht;R.useEffect(()=>{cKe().then(({login:Ze})=>q(Ze)).catch(()=>q(null)),Y2().then(Ze=>L(Ze.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let Ze=!0;$(!0);const mt=setTimeout(()=>{uKe(s.trim()).then(({repo:an})=>Ze&&Z(an)).catch(()=>Ze&&Z(F_(s,48))).finally(()=>Ze&&$(!1))},150);return()=>{Ze=!1,clearTimeout(mt)}},[s]),R.useEffect(()=>{let Ze=!0;if(J(null),H(!!st),!!st)return fKe(st.owner,st.repo).then(({canPush:mt})=>{Ze&&mt&&J(`github.com/${st.owner}/${st.repo}`)}).catch(()=>{}).finally(()=>Ze&&H(!1)),()=>{Ze=!1}},[st==null?void 0:st.owner,st==null?void 0:st.repo]),R.useEffect(()=>{const Ze=++Ie.current,mt=Qe.trim();if(!mt){g(null),k(null),b(!1);return}b(!0),k(null);const an=setTimeout(()=>{uE(mt).then(Cn=>{Ze===Ie.current&&g(Cn)}).catch(Cn=>{Ze===Ie.current&&(g(null),k(Cn instanceof Error?Cn.message:String(Cn)))}).finally(()=>{Ze===Ie.current&&b(!1)})},200);return()=>clearTimeout(an)},[t,Re,Qe]),R.useEffect(()=>{const Ze=++Te.current;if(t!=="paper"||ie){oe(!1);return}const mt=K.trim(),an=Ydt(mt);if(!an&&mt.length<3){re([]),he(""),oe(!1);return}T(null),oe(!0),re([]),he("");const Cn=setTimeout(()=>{if(an){Zb(an).then(En=>{var rs;Ze===Te.current&&(ve(En),o||a(((rs=En.title)==null?void 0:rs.trim())||En.paperId))}).catch(En=>Ze===Te.current&&T(En instanceof Error?En.message:String(En))).finally(()=>Ze===Te.current&&oe(!1));return}fE(mt).then(En=>{Ze===Te.current&&(re(En),he(mt))}).catch(En=>Ze===Te.current&&T(En instanceof Error?En.message:String(En))).finally(()=>Ze===Te.current&&oe(!1))},350);return()=>clearTimeout(Cn)},[t,ie,K,o]);async function we(Ze){var an;const mt=++Te.current;oe(!0),T(null);try{const Cn=await Zb(Ze);if(mt!==Te.current)return;ve(Cn),re([]),o||a(((an=Cn.title)==null?void 0:an.trim())||Cn.paperId)}catch(Cn){mt===Te.current&&T(Cn instanceof Error?Cn.message:String(Cn))}finally{mt===Te.current&&oe(!1)}}function Le(){Te.current+=1,et.current+=1,ve(null),G(""),re([]),he(""),oe(!1),y(!1),f(""),d(!1),Tt.current.paper={name:o?s:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function qe(Ze){if(Ze===t)return;Te.current+=1,et.current+=1,Tt.current[t]={name:s,nameTouched:o,path:c,pathTouched:_};const mt=Tt.current[Ze];r(Ze),T(null),k(null),g(null),oe(!1),y(!1),a(mt.name),l(mt.nameTouched),f(mt.path),d(mt.pathTouched)}async function tt(){if(w)return;const Ze=++et.current;y(!0),T(null);try{const mt=await oKe();if(Ze!==et.current||!mt)return;if(d(!0),g(null),b(!0),f(mt),He(an=>an+1),t==="folder"&&!o){const an=mt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();an&&a(an)}}catch(mt){Ze===et.current&&T(mt instanceof Error?mt.message:String(mt))}finally{Ze===et.current&&y(!1)}}async function at(Ze){if(Ze.preventDefault(),!!Qt){z(!0),T(null);try{const mt=await lKe({name:s.trim(),path:Qe.trim(),createFolder:t!=="folder",requireNewFolder:t==="blank",initializeGit:!0,githubSyncEnabled:I,...t==="github"&&ht?{forkUrl:`https://github.com/${ht.owner}/${ht.repo}`}:{},...t==="paper"&&ie?{paperId:ie.paperId,cloneUrl:ie.repoUrl??void 0}:{}});e(mt.project,mt.githubPublicationError)}catch(mt){T(mt instanceof Error?mt.message:String(mt))}finally{z(!1)}}}const Mt=(m==null?void 0:m.gitVersion)===null,yt=t==="folder"&&!!Qe.trim()&&m!==null&&m.exists===!1,Ot=t==="blank"&&(m==null?void 0:m.exists)===!0,Rt=!!Qe.trim()&&(m==null?void 0:m.exists)===!0&&m.directory===!1,sn=t==="paper"&&!!(ie!=null&&ie.repoUrl)&&(m==null?void 0:m.empty)===!1,xt=t==="github"&&ht&&(m==null?void 0:m.empty)===!1,hn=t==="paper"&&!!ie&&!(ie!=null&&ie.repoUrl)&&((m==null?void 0:m.empty)===!1||(m==null?void 0:m.gitState)!=null&&m.gitState!=="notRepository"),dn=t==="folder"&&((m==null?void 0:m.gitState)==="detached"||(m==null?void 0:m.gitState)==="invalid"),Ke=_&&!Qe.trim()||Rt||sn||hn,ut=_&&!Qe.trim()||Rt||xt,_n=_&&!Qe.trim()||Rt||Ot,Rr=_&&!Qe.trim()?y1():Rt?x1():Ot?$0e():null,ct=_&&!Qe.trim()?y1():Rt?x1():xt?V6():null,Ut=_&&!Qe.trim()?y1():Rt?x1():sn?V6():hn?a0e():null,Qt=!!(s.trim()&&Qe.trim())&&!C&&!w&&!v&&m!==null&&!S&&!Mt&&!yt&&!Ot&&!Rt&&!sn&&!hn&&!xt&&!dn&&(t!=="paper"||!!ie)&&(t!=="github"||!!ht&&typeof P=="string"&&!ee)&&(!I||typeof P=="string"&&!ee&&!B),Gr=X??`github.com/${P??"you"}/${W}`,zr=P===void 0||ee||B,Ts=t==="paper"&&!ie&&K.trim().length>=3&&ue===K.trim()&&!F&&ce.length===0&&!N;return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-md [&_.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-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]: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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-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-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ms-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:at,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:t==="blank"?"active":"","aria-pressed":t==="blank",onClick:()=>qe("blank"),children:Z0e()}),h.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${t==="paper"?"":" invisible"}`}),h.jsx("button",{type:"button",className:t==="folder"?"active":"","aria-pressed":t==="folder",onClick:()=>qe("folder"),children:zpe()}),h.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${t==="blank"?"":" invisible"}`}),h.jsx("button",{type:"button",className:t==="paper"?"active":"","aria-pressed":t==="paper",onClick:()=>qe("paper"),children:Ope()}),h.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${t==="github"?"":" invisible"}`}),h.jsx("button",{type:"button",className:t==="github"?"active":"","aria-pressed":t==="github",onClick:()=>qe("github"),children:Hpe()})]}),t==="github"&&h.jsxs("label",{className:"!font-normal",children:[qpe(),h.jsx("input",{className:"text-md font-normal","data-initial-focus":!0,value:me,onChange:Ze=>{T(null),Ee(Ze.target.value)},placeholder:Kpe()}),ht?h.jsx("span",{className:"repo-hint ok",children:Zme({account:P??"your GitHub account"})}):me.trim()?h.jsx("span",{className:"repo-hint",children:xpe()}):h.jsx("span",{className:"repo-hint",children:Nme()}),!ht&&me.trim()&&h.jsx("div",{className:"project-path-notice error",children:kpe()}),ht&&P===null&&h.jsx("div",{className:"project-path-notice error",children:W6({command:Ae("gh auth login")})})]}),t==="paper"&&!ie&&h.jsxs("label",{className:"!font-normal",children:[gme(),h.jsx("input",{className:"text-md font-normal","data-initial-focus":!0,value:K,onChange:Ze=>{T(null),he(""),G(Ze.target.value)},placeholder:Tme()}),!Ts&&h.jsx("span",{className:"repo-hint",children:F?Ege():vge()}),Ts&&h.jsx("span",{className:"project-path-notice block",children:ime()}),ce.length>0&&h.jsx("div",{className:"paper-results",children:ce.map(Ze=>h.jsxs("button",{type:"button",onClick:()=>void we(Ze.paperId),children:[h.jsx("span",{className:dh,children:Ze.title}),h.jsx("span",{className:"id",children:Ze.paperId})]},Ze.paperId))})]}),ie&&t==="paper"&&h.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[h.jsxs("div",{className:"meta",children:[h.jsx("div",{className:`${dh} !font-medium`,children:ie.title||ie.paperId}),ie.repoUrl&&h.jsx("div",{className:"id",children:Zdt(ie.repoUrl)})]}),h.jsx("button",{type:"button",className:Zs,"aria-label":cpe(),onClick:Le,children:ipe()})]}),!ie.repoUrl&&h.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:[h.jsxs("span",{className:"flex items-center gap-[5px] text-md",children:[h.jsx(yVe,{size:16})," ",cme()]}),h.jsx("span",{className:"text-sm font-normal text-accent-amber",children:dme()})]})]}),(t!=="paper"||ie)&&h.jsxs(h.Fragment,{children:[t==="blank"&&h.jsxs("label",{className:"!font-normal",children:[h.jsx("span",{className:"project-field-label !font-medium",children:G6()}),h.jsx("input",{className:"text-md font-normal","data-initial-focus":!0,value:s,onChange:Ze=>{l(!0),a(Ze.target.value)},placeholder:U6()})]}),t==="paper"||t==="github"?h.jsxs("label",{className:"project-location-field",children:[h.jsx("span",{className:"project-location-label !font-medium",children:t==="github"?W0e():ie!=null&&ie.repoUrl?y0e():q6()}),h.jsx("input",{className:"text-md font-normal",value:Qe,onChange:Ze=>{d(!0),g(null),f(Ze.target.value)},"aria-describedby":t==="github"?ut?"github-destination-description":void 0:Ke?"paper-destination-description":void 0,placeholder:"~/OpenResearch/repo-name",spellCheck:!1}),v&&h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:P6()}),t==="github"&&ut&&h.jsx("span",{id:"github-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:ct}),t==="paper"&&Ke&&h.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Ut})]}):t==="folder"?h.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":c?u0e({path:Ae(c)}):H6(),disabled:w,title:c||void 0,onClick:()=>void tt(),children:[h.jsx(fh,{className:c?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:c?Qr:"placeholder",children:w?g0e():c||H6()}),h.jsx(wa,{className:"folder-picker-chevron",size:15})]}):s.trim()?h.jsxs("label",{className:"project-location-field",children:[h.jsx("span",{className:"project-location-label !font-medium",children:q6()}),h.jsx("input",{className:"text-md font-normal",value:Qe,onChange:Ze=>{d(!0),g(null),f(Ze.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":_n?"blank-destination-description":void 0,spellCheck:!1}),v&&h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:P6()}),_n&&h.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Rr})]}):null,t!=="blank"&&Qe&&h.jsxs("label",{className:"!font-normal",children:[h.jsx("span",{className:"project-field-label !font-medium",children:G6()}),h.jsx("input",{className:"text-md font-normal",value:s,onChange:Ze=>{l(!0),a(Ze.target.value)},placeholder:U6()})]}),Mt&&h.jsx("div",{className:"project-path-notice error",children:Qpe()}),!Mt&&t==="folder"&&c.trim()&&!v&&(m==null?void 0:m.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:$me()}),!Mt&&t==="folder"&&c.trim()&&!v&&Rt&&h.jsx("div",{className:"project-path-notice error",children:Wme()}),!Mt&&t==="folder"&&!v&&(m==null?void 0:m.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:dpe()}),!Mt&&t==="folder"&&!v&&(m==null?void 0:m.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:Ume()}),S&&h.jsx("div",{className:"project-path-notice error",role:"alert",children:S})]}),N&&h.jsx("div",{className:"error",role:"alert",children:N}),(t!=="paper"||ie)&&Qe&&(t!=="blank"||s.trim())&&h.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[h.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-md font-medium${I&&P===null?" text-accent-red":" text-text"}`,"aria-expanded":j,"aria-controls":"new-project-advanced-settings",onClick:()=>D(Ze=>!Ze),children:[I?P===null?Q_e():n0e():K_e(),h.jsx(ya,{className:j?"rotate-180":"",size:16})]}),j&&h.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:I,onChange:Ze=>L(Ze.target.checked),disabled:C}),h.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:Lme()})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[h.jsx("span",{children:zr?tge({repository:Ae(Gr)}):X?cge({repository:Ae(Gr)}):ige({repository:Ae(Gr)})}),h.jsx("span",{children:Mpe()}),P===null&&h.jsx("span",{children:W6({command:Ae("gh auth login")})})]})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[n&&h.jsx("button",{type:"button",className:`${Wn} !font-medium`,onClick:n,children:tpe()}),h.jsx("button",{className:`${es} !font-medium`,disabled:!Qt,children:C?M0e():t==="paper"?ie!=null&&ie.repoUrl?C0e():F6():t==="folder"?jge():t==="github"?U0e():F6()})]})]})}function Pj({onClose:e,onCreated:n}){const t=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const s=t.current;if(!s)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...s.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(s.querySelector("[data-initial-focus]")??o()[0]??s).focus();const l=c=>{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key==="Enter"&&(c.metaKey||c.ctrlKey)&&!c.altKey&&c.shiftKey){c.preventDefault(),c.stopPropagation();return}if(c.key!=="Tab")return;const f=o();if(f.length===0){c.preventDefault(),s.focus();return}const _=f[0],d=f[f.length-1];c.shiftKey&&document.activeElement===_?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),_.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-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:s=>{s.target===s.currentTarget&&e()},children:h.jsxs("div",{ref:t,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-[0_24px_60px_rgba(0,_0,_0,_0.22)] 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:[h.jsx("h2",{id:"new-project-dialog-title",children:N9()}),h.jsx(Qdt,{onCancel:e,onCreated:n})]})})}function Jdt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const a=R.useRef(null),o=R.useRef(r),l=R.useRef(n);o.current=r,l.current=n,R.useEffect(()=>{const f=a.current;if(!f)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...f.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??f).focus();const m=g=>{if(g.key==="Escape"){g.preventDefault(),l.current||o.current();return}if(g.key!=="Tab")return;const S=d();if(S.length===0){g.preventDefault(),f.focus();return}const k=S[0],v=S[S.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("keydown",m,!0),_==null||_.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:f=>{!n&&f.target===f.currentTarget&&r()},children:h.jsxs("div",{ref:a,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[h.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:k5e()}),h.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-md leading-normal text-subtext",children:[h.jsx("p",{className:"m-0",children:i5e({name:eo(e.name)})}),h.jsx("p",{className:"m-0",children:c?$5e():U5e()}),t&&h.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),h.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[h.jsx("button",{className:Wn,disabled:n,onClick:r,children:m5e()}),h.jsx("button",{className:`${Wn} danger`,disabled:n,onClick:s,children:n?M5e():z5e()})]})]})})}function Hk(){return h.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 Fk({projects:e,onOpen:n,onCreated:t,onDeleted:r}){const[s,a]=R.useState(!1),[o,l]=R.useState(null),[c,f]=R.useState(null),[_,d]=R.useState(null),[m,g]=R.useState({}),S=R.useRef(0),k=e.map(b=>b.id).join("\0");R.useEffect(()=>{let b=!0,w=null;const y=()=>{w=null;const N=++S.current;sKe().then(T=>{!b||N!==S.current||g(Object.fromEntries(T.map(j=>[j.projectId,j])))}).catch(()=>{})},C=()=>{w===null&&(w=setTimeout(y,100))};y();const z=WXe(C);return()=>{b=!1,z(),w!==null&&clearTimeout(w)}},[k]);async function v(b){l(b.id),f(null);try{await dKe(b.id),f(null),d(null),r(b.id)}catch(w){f(w instanceof Error?w.message:String(w))}finally{l(null)}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[h.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:[h.jsx("h2",{children:s3e()}),h.jsxs("button",{className:Wn,onClick:()=>a(!0),children:[h.jsx(V2,{size:15})," ",N9()]})]}),h.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:h.jsxs("div",{children:[h.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-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[h.jsx("span",{children:e3e()}),h.jsx("span",{children:J6()}),h.jsx("span",{children:e7()}),h.jsx("span",{children:t7()})]}),e.length===0?h.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:Y5e()}):[...e].sort((b,w)=>{var z,N;const y=((z=m[b.id])==null?void 0:z.lastMessageAt)??b.createdAt;return(((N=m[w.id])==null?void 0:N.lastMessageAt)??w.createdAt)-y||b.name.localeCompare(w.name)}).map(b=>{const w=m[b.id],y=b.githubEnabled?b.githubUrl??(b.githubOwner&&b.githubRepo?`https://github.com/${b.githubOwner}/${b.githubRepo}`:null):null,C=y?b.githubOwner&&b.githubRepo?`${b.githubOwner}/${b.githubRepo}`:y.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):p3e(),z=w?w.activeAgents>0?Z4e({count:$t(w.activeAgents)}):f3e():"—",N=w?w.totalAgents===1?v3e():t5e({count:$t(w.totalAgents)}):"—",T=w?w.runningExperiments>0?S3e({count:$t(w.runningExperiments)}):w.totalExperiments===0?R2():n7({count:$t(w.totalExperiments)}):"—",j=w&&w.runningExperiments>0?n7({count:$t(w.totalExperiments)}):null;return h.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:[h.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":rO({name:eo(b.name)}),onClick:()=>n(b.id)}),h.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:[h.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:b.name}),h.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[h.jsxs("span",{children:[x5e()," ",Gi(b.createdAt)]}),b.paperId&&h.jsx("span",{"aria-hidden":"true",children:"·"}),b.paperId&&h.jsxs("span",{children:[h5e()," ",Ae(b.paperId)]}),h.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":Wb({name:eo(b.name)}),disabled:o===b.id,onClick:D=>{D.stopPropagation(),f(null),d(b)},children:h.jsx(Bu,{size:14})})]})]}),h.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[h.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:J6()}),h.jsxs("span",{className:"inline-flex items-center gap-2 text-md text-text",children:[w&&w.activeAgents>0&&h.jsx(Hk,{}),z]}),h.jsx("span",{className:"text-xs text-muted",children:N})]}),h.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[h.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:e7()}),h.jsxs("span",{className:"inline-flex items-center gap-2 text-md text-text",children:[w&&w.runningExperiments>0&&h.jsx(Hk,{}),T]}),j&&h.jsx("span",{className:"text-xs text-muted",children:j})]}),h.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[h.jsx("span",{className:"hidden text-2xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:t7()}),y?h.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:y,target:"_blank",rel:"noreferrer","aria-label":b0({name:eo(b.name)}),children:[h.jsx("span",{className:"inline-flex shrink-0",children:h.jsx(Ip,{size:14})}),h.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ae(C)})]}):h.jsx("span",{className:"text-sm text-text pointer-events-none",children:C})]})]},b.id)})]})})]}),s&&h.jsx(Pj,{onClose:()=>a(!1),onCreated:(b,w)=>{a(!1),t(b,w)}}),_&&h.jsx(Jdt,{project:_,deleting:o===_.id,error:c,onClose:()=>{f(null),d(null)},onConfirm:()=>void v(_)})]})}const Pk=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ms-auto"].join(" ");function e_t({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:a,onCancel:o}){const[l,c]=R.useState(new Set),[f,_]=R.useState(null),d=new Map;for(const S of e){const k=d.get(S.experimentId);k?k.push(S):d.set(S.experimentId,[S])}for(const S of d.values())S.sort((k,v)=>v.createdAt-k.createdAt);const m=[...n].sort((S,k)=>{var w,y,C,z;const v=((y=(w=d.get(S.id))==null?void 0:w[0])==null?void 0:y.createdAt)??S.createdAt;return(((z=(C=d.get(k.id))==null?void 0:C[0])==null?void 0:z.createdAt)??k.createdAt)-v});if(m.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:t??Eoe()})});async function g(S){_(null),c(k=>new Set(k).add(S));try{await o(S)}catch(k){c(v=>{const b=new Set(v);return b.delete(S),b}),_(k instanceof Error?k.message:String(k))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[f&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[hle()," ",f]}),h.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":sle(),children:m.map(S=>{const k=d.get(S.id)??[],v=k[0]??null,b=k.find(z=>z.status==="running"||z.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||l.has(b.id))),C=b?y?"cancelling":Si(b):v?Si(v):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(S,"preview"),onDoubleClick:()=>r(S,"keepOpen"),onAuxClick:z=>{z.button===1&&(z.preventDefault(),r(S,"keepOpen"))},children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...ir(z=>r(S,z),{stopPropagation:!0}),children:S.title||S.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:S.branchName,children:[h.jsx(cp,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:S.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(no,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:h.jsx("span",{children:k.length===1?Doe():Poe({count:$t(k.length)})})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:h.jsx("span",{children:v?Gi(v.createdAt):joe()})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":TD({name:S.title||S.slug}),onClick:z=>z.stopPropagation(),onDoubleClick:z=>z.stopPropagation(),onAuxClick:z=>z.stopPropagation(),children:[h.jsxs("button",{className:Pk,disabled:!w,title:w?Boe():woe(),...ir(z=>{w&&s(S.id,w.id,z)},{stopPropagation:!0}),children:[h.jsx(Su,{size:15}),lle()]}),h.jsxs("button",{className:Pk,title:a9({branch:Ae(S.branchName)}),...ir(z=>a(S.id,z),{stopPropagation:!0}),children:[h.jsx(lp,{size:15}),ele()]}),b&&h.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ms-auto danger",disabled:y,title:y?Voe():Yoe(),onClick:()=>void g(b.id),children:[h.jsx(K9,{size:15}),y?Tne():p9()]})]})]},S.id)})})]})}function t_t({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(c=>{t||(r(!0),a(null),c().catch(()=>a(_Ue())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const c=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),l(e))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,l]),R.useEffect(()=>{const c=o.current;if(!c)return;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??c).focus();const d=m=>{if(m.key!=="Tab")return;const g=_();if(g.length===0){m.preventDefault(),c.focus();return}const S=g[0],k=g[g.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),k.focus()):!m.shiftKey&&document.activeElement===k&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),f==null||f.focus()}},[]),vy.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:h.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx("button",{className:`${vn} !absolute top-3.5 end-3.5`,"aria-label":qPe(),onClick:()=>l(e),disabled:t,children:h.jsx(Yr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(Q2,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:QPe()}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:wUe()})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{dir:"auto",children:[bUe()," ",h.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:uUe()}),HPe()]}),h.jsx("p",{dir:"auto",children:aUe()})]}),s&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx("button",{className:Wn,onClick:()=>l(n),disabled:t,children:KPe()}),h.jsx("button",{className:es,onClick:()=>l(e),disabled:t,children:t?xa():nUe()})]})]})}),document.body)}function xr(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function nm(){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}})}c0.prototype=nm.prototype={constructor:c0,on:function(e,n){var t=this._,r=r_t(e+"",t),s,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var t=new Array(s),r=0,s,a;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),qk.hasOwnProperty(n)?{space:qk[n],local:e}:e}function i_t(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h2&&n.documentElement.namespaceURI===h2?n.createElement(e):n.createElementNS(t,e)}}function a_t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Uj(e){var n=rm(e);return(n.local?a_t:i_t)(n)}function o_t(){}function Py(e){return e==null?o_t:function(){return this.querySelector(e)}}function l_t(e){typeof e!="function"&&(e=Py(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(z=v[y])&&++y=0;)(o=r[s])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function R_t(e){e||(e=D_t);function n(d,m){return d&&m?e(d.__data__,m.__data__):!d-!m}for(var t=this._groups,r=t.length,s=new Array(r),a=0;an?1:e>=n?0:NaN}function L_t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function O_t(){return Array.from(this)}function I_t(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?K_t:typeof n=="function"?Y_t:X_t)(e,n,t??"")):Mu(this.node(),e)}function Mu(e,n){return e.style.getPropertyValue(n)||Kj(e).getComputedStyle(e,null).getPropertyValue(n)}function Q_t(e){return function(){delete this[e]}}function J_t(e,n){return function(){this[e]=n}}function e0t(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function t0t(e,n){return arguments.length>1?this.each((n==null?Q_t:typeof n=="function"?e0t:J_t)(e,n)):this.node()[e]}function Xj(e){return e.trim().split(/^|\s+/)}function Uy(e){return e.classList||new Yj(e)}function Yj(e){this._node=e,this._names=Xj(e.getAttribute("class")||"")}Yj.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 Zj(e,n){for(var t=Uy(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function A0t(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,a;t()=>e;function d2(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:a,x:o,y:l,dx:c,dy:f,dispatch:_}){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:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:_}})}d2.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $0t(e){return!e.ctrlKey&&!e.button}function H0t(){return this.parentNode}function F0t(e,n){return n??{x:e.x,y:e.y}}function P0t(){return navigator.maxTouchPoints||"ontouchstart"in this}function rT(){var e=$0t,n=H0t,t=F0t,r=P0t,s={},a=nm("start","drag","end"),o=0,l,c,f,_,d=0;function m(C){C.on("mousedown.drag",g).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,B0t).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(C,z){if(!(_||!e.call(this,C,z))){var N=y(this,n.call(this,C,z),C,z,"mouse");N&&(Vs(C.view).on("mousemove.drag",S,Ah).on("mouseup.drag",k,Ah),tT(C.view),Tb(C),f=!1,l=C.clientX,c=C.clientY,N("start",C))}}function S(C){if(gu(C),!f){var z=C.clientX-l,N=C.clientY-c;f=z*z+N*N>d}s.mouse("drag",C)}function k(C){Vs(C.view).on("mousemove.drag mouseup.drag",null),nT(C.view,f),gu(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,D,I;for(D=0;D>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?U_(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?U_(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=q0t.exec(e))?new zs(n[1],n[2],n[3],1):(n=G0t.exec(e))?new zs(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=V0t.exec(e))?U_(n[1],n[2],n[3],n[4]):(n=W0t.exec(e))?U_(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=K0t.exec(e))?Zk(n[1],n[2]/100,n[3]/100,1):(n=X0t.exec(e))?Zk(n[1],n[2]/100,n[3]/100,n[4]):Gk.hasOwnProperty(e)?Kk(Gk[e]):e==="transparent"?new zs(NaN,NaN,NaN,0):null}function Kk(e){return new zs(e>>16&255,e>>8&255,e&255,1)}function U_(e,n,t,r){return r<=0&&(e=n=t=NaN),new zs(e,n,t,r)}function Q0t(e){return e instanceof ad||(e=tc(e)),e?(e=e.rgb(),new zs(e.r,e.g,e.b,e.opacity)):new zs}function _2(e,n,t,r){return arguments.length===1?Q0t(e):new zs(e,n,t,r??1)}function zs(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}qy(zs,_2,sT(ad,{brighter(e){return e=e==null?V0:Math.pow(V0,e),new zs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jh:Math.pow(jh,e),new zs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zs(Zl(this.r),Zl(this.g),Zl(this.b),W0(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:Xk,formatHex:Xk,formatHex8:J0t,formatRgb:Yk,toString:Yk}));function Xk(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}`}function J0t(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}${Gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yk(){const e=W0(this.opacity);return`${e===1?"rgb(":"rgba("}${Zl(this.r)}, ${Zl(this.g)}, ${Zl(this.b)}${e===1?")":`, ${e})`}`}function W0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gl(e){return e=Zl(e),(e<16?"0":"")+e.toString(16)}function Zk(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Bi(e,n,t,r)}function iT(e){if(e instanceof Bi)return new Bi(e.h,e.s,e.l,e.opacity);if(e instanceof ad||(e=tc(e)),!e)return new Bi;if(e instanceof Bi)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),a=Math.max(n,t,r),o=NaN,l=a-s,c=(a+s)/2;return l?(n===a?o=(t-r)/l+(t0&&c<1?0:o,new Bi(o,l,c,e.opacity)}function ept(e,n,t,r){return arguments.length===1?iT(e):new Bi(e,n,t,r??1)}function Bi(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}qy(Bi,ept,sT(ad,{brighter(e){return e=e==null?V0:Math.pow(V0,e),new Bi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jh:Math.pow(jh,e),new Bi(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 zs(Mb(e>=240?e-240:e+120,s,r),Mb(e,s,r),Mb(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Bi(Qk(this.h),q_(this.s),q_(this.l),W0(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=W0(this.opacity);return`${e===1?"hsl(":"hsla("}${Qk(this.h)}, ${q_(this.s)*100}%, ${q_(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Qk(e){return e=(e||0)%360,e<0?e+360:e}function q_(e){return Math.max(0,Math.min(1,e||0))}function Mb(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 Gy=e=>()=>e;function tpt(e,n){return function(t){return e+t*n}}function npt(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 rpt(e){return(e=+e)==1?aT:function(n,t){return t-n?npt(n,t,e):Gy(isNaN(n)?t:n)}}function aT(e,n){var t=n-e;return t?tpt(e,t):Gy(isNaN(e)?n:e)}const K0=(function e(n){var t=rpt(n);function r(s,a){var o=t((s=_2(s)).r,(a=_2(a)).r),l=t(s.g,a.g),c=t(s.b,a.b),f=aT(s.opacity,a.opacity);return function(_){return s.r=o(_),s.g=l(_),s.b=c(_),s.opacity=f(_),s+""}}return r.gamma=e,r})(1);function spt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(a){for(s=0;st&&(a=n.slice(t,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:_a(r,s)})),t=Rb.lastIndex;return t180?_+=360:_-f>180&&(f+=360),m.push({i:d.push(s(d)+"rotate(",null,r)-2,x:_a(f,_)})):_&&d.push(s(d)+"rotate("+_+r)}function l(f,_,d,m){f!==_?m.push({i:d.push(s(d)+"skewX(",null,r)-2,x:_a(f,_)}):_&&d.push(s(d)+"skewX("+_+r)}function c(f,_,d,m,g,S){if(f!==d||_!==m){var k=g.push(s(g)+"scale(",null,",",null,")");S.push({i:k-4,x:_a(f,d)},{i:k-2,x:_a(_,m)})}else(d!==1||m!==1)&&g.push(s(g)+"scale("+d+","+m+")")}return function(f,_){var d=[],m=[];return f=e(f),_=e(_),a(f.translateX,f.translateY,_.translateX,_.translateY,d,m),o(f.rotate,_.rotate,d,m),l(f.skewX,_.skewX,d,m),c(f.scaleX,f.scaleY,_.scaleX,_.scaleY,d,m),f=_=null,function(g){for(var S=-1,k=m.length,v;++S=0&&e._call.call(void 0,n),e=e._next;--Ru}function tC(){nc=(Y0=Mh.now())+sm,Ru=Zf=0;try{vpt()}finally{Ru=0,ypt(),nc=0}}function xpt(){var e=Mh.now(),n=e-Y0;n>uT&&(sm-=n,Y0=e)}function ypt(){for(var e,n=X0,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:X0=t);Qf=e,g2(r)}function g2(e){if(!Ru){Zf&&(Zf=clearTimeout(Zf));var n=e-nc;n>24?(e<1/0&&(Zf=setTimeout(tC,e-Mh.now()-sm)),Uf&&(Uf=clearInterval(Uf))):(Uf||(Y0=Mh.now(),Uf=setInterval(xpt,uT)),Ru=1,fT(tC))}}function nC(e,n,t){var r=new Z0;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var wpt=nm("start","end","cancel","interrupt"),Spt=[],dT=0,rC=1,b2=2,f0=3,sC=4,v2=5,h0=6;function im(e,n,t,r,s,a){var o=e.__transition;if(!o)e.__transition={};else if(t in o)return;kpt(e,t,{name:n,index:r,group:s,on:wpt,tween:Spt,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:dT})}function Wy(e,n){var t=Wi(e,n);if(t.state>dT)throw new Error("too late; already scheduled");return t}function za(e,n){var t=Wi(e,n);if(t.state>f0)throw new Error("too late; already running");return t}function Wi(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function kpt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=hT(a,0,t.time);function a(f){t.state=rC,t.timer.restart(o,t.delay,t.time),t.delay<=f&&o(f-t.delay)}function o(f){var _,d,m,g;if(t.state!==rC)return c();for(_ in r)if(g=r[_],g.name===t.name){if(g.state===f0)return nC(o);g.state===sC?(g.state=h0,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[_]):+_b2&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function emt(e,n,t){var r,s,a=Jpt(n)?Wy:za;return function(){var o=a(this,e),l=o.on;l!==r&&(s=(r=l).copy()).on(n,t),o.on=s}}function tmt(e,n){var t=this._id;return arguments.length<2?Wi(this.node(),t).on.on(e):this.each(emt(t,e,n))}function nmt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function rmt(){return this.on("end.remove",nmt(this._id))}function smt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=Py(e));for(var r=this._groups,s=r.length,a=new Array(s),o=0;o()=>e;function Amt(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 Ja(e,n,t){this.k=e,this.x=n,this.y=t}Ja.prototype={constructor:Ja,scale:function(e){return e===1?this:new Ja(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ja(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 am=new Ja(1,0,0);gT.prototype=Ja.prototype;function gT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return am;return e.__zoom}function Db(e){e.stopImmediatePropagation()}function qf(e){e.preventDefault(),e.stopImmediatePropagation()}function jmt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Tmt(){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 iC(){return this.__zoom||am}function Mmt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Rmt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dmt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],a=e.invertY(n[0][1])-t[0][1],o=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function bT(){var e=jmt,n=Tmt,t=Dmt,r=Mmt,s=Rmt,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=u0,f=nm("start","zoom","end"),_,d,m,g=500,S=150,k=0,v=10;function b(W){W.property("__zoom",iC).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",L).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(W,Z,X,J){var ee=W.selection?W.selection():W;ee.property("__zoom",iC),W!==ee?z(W,Z,X,J):ee.interrupt().each(function(){N(this,arguments).event(J).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},b.scaleBy=function(W,Z,X,J){b.scaleTo(W,function(){var ee=this.__zoom.k,$=typeof Z=="function"?Z.apply(this,arguments):Z;return ee*$},X,J)},b.scaleTo=function(W,Z,X,J){b.transform(W,function(){var ee=n.apply(this,arguments),$=this.__zoom,B=X==null?C(ee):typeof X=="function"?X.apply(this,arguments):X,H=$.invert(B),K=typeof Z=="function"?Z.apply(this,arguments):Z;return t(y(w($,K),B,H),ee,o)},X,J)},b.translateBy=function(W,Z,X,J){b.transform(W,function(){return t(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof X=="function"?X.apply(this,arguments):X),n.apply(this,arguments),o)},null,J)},b.translateTo=function(W,Z,X,J,ee){b.transform(W,function(){var $=n.apply(this,arguments),B=this.__zoom,H=J==null?C($):typeof J=="function"?J.apply(this,arguments):J;return t(am.translate(H[0],H[1]).scale(B.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof X=="function"?-X.apply(this,arguments):-X),$,o)},J,ee)};function w(W,Z){return Z=Math.max(a[0],Math.min(a[1],Z)),Z===W.k?W:new Ja(Z,W.x,W.y)}function y(W,Z,X){var J=Z[0]-X[0]*W.k,ee=Z[1]-X[1]*W.k;return J===W.x&&ee===W.y?W:new Ja(W.k,J,ee)}function C(W){return[(+W[0][0]+ +W[1][0])/2,(+W[0][1]+ +W[1][1])/2]}function z(W,Z,X,J){W.on("start.zoom",function(){N(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(J).end()}).tween("zoom",function(){var ee=this,$=arguments,B=N(ee,$).event(J),H=n.apply(ee,$),K=X==null?C(H):typeof X=="function"?X.apply(ee,$):X,G=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ie=ee.__zoom,ve=typeof Z=="function"?Z.apply(ee,$):Z,ce=c(ie.invert(K).concat(G/ie.k),ve.invert(K).concat(G/ve.k));return function(re){if(re===1)re=ve;else{var F=ce(re),oe=G/F[2];re=new Ja(oe,K[0]-F[0]*oe,K[1]-F[1]*oe)}B.zoom(null,re)}})}function N(W,Z,X){return!X&&W.__zooming||new T(W,Z)}function T(W,Z){this.that=W,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=n.apply(W,Z),this.taps=0}T.prototype={event:function(W){return W&&(this.sourceEvent=W),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(W,Z){return this.mouse&&W!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&W!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&W!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(W){var Z=Vs(this.that).datum();f.call(W,this.that,new Amt(W,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:f}),Z)}};function j(W,...Z){if(!e.apply(this,arguments))return;var X=N(this,Z).event(W),J=this.__zoom,ee=Math.max(a[0],Math.min(a[1],J.k*Math.pow(2,r.apply(this,arguments)))),$=Oi(W);if(X.wheel)(X.mouse[0][0]!==$[0]||X.mouse[0][1]!==$[1])&&(X.mouse[1]=J.invert(X.mouse[0]=$)),clearTimeout(X.wheel);else{if(J.k===ee)return;X.mouse=[$,J.invert($)],d0(this),X.start()}qf(W),X.wheel=setTimeout(B,S),X.zoom("mouse",t(y(w(J,ee),X.mouse[0],X.mouse[1]),X.extent,o));function B(){X.wheel=null,X.end()}}function D(W,...Z){if(m||!e.apply(this,arguments))return;var X=W.currentTarget,J=N(this,Z,!0).event(W),ee=Vs(W.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",G,!0),$=Oi(W,X),B=W.clientX,H=W.clientY;tT(W.view),Db(W),J.mouse=[$,this.__zoom.invert($)],d0(this),J.start();function K(ie){if(qf(ie),!J.moved){var ve=ie.clientX-B,ce=ie.clientY-H;J.moved=ve*ve+ce*ce>k}J.event(ie).zoom("mouse",t(y(J.that.__zoom,J.mouse[0]=Oi(ie,X),J.mouse[1]),J.extent,o))}function G(ie){ee.on("mousemove.zoom mouseup.zoom",null),nT(ie.view,J.moved),qf(ie),J.event(ie).end()}}function I(W,...Z){if(e.apply(this,arguments)){var X=this.__zoom,J=Oi(W.changedTouches?W.changedTouches[0]:W,this),ee=X.invert(J),$=X.k*(W.shiftKey?.5:2),B=t(y(w(X,$),J,ee),n.apply(this,Z),o);qf(W),l>0?Vs(this).transition().duration(l).call(z,B,J,W):Vs(this).call(b.transform,B,J,W)}}function L(W,...Z){if(e.apply(this,arguments)){var X=W.touches,J=X.length,ee=N(this,Z,W.changedTouches.length===J).event(W),$,B,H,K;for(Db(W),B=0;B`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.`},Rh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vT=["Enter"," ","Escape"],xT={"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 Du;(function(e){e.Strict="strict",e.Loose="loose"})(Du||(Du={}));var Ql;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ql||(Ql={}));var Dh;(function(e){e.Partial="partial",e.Full="full"})(Dh||(Dh={}));const yT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Qo;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Qo||(Qo={}));var Q0;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Q0||(Q0={}));var ot;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ot||(ot={}));const aC={[ot.Left]:ot.Right,[ot.Right]:ot.Left,[ot.Top]:ot.Bottom,[ot.Bottom]:ot.Top};function wT(e){return e===null?null:e?"valid":"invalid"}const ST=e=>"id"in e&&"source"in e&&"target"in e,Lmt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xy=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),od=(e,n=[0,0])=>{const{width:t,height:r}=mo(e),s=e.origin??n,a=t*s[0],o=r*s[1];return{x:e.position.x-a,y:e.position.y-o}},Omt=(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 a=typeof s=="string";let o=!n.nodeLookup&&!a?s:void 0;n.nodeLookup&&(o=a?n.nodeLookup.get(s):Xy(s)?s:n.nodeLookup.get(s.id));const l=o?J0(o,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return om(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return lm(t)},ld=(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=om(t,J0(s)),r=!0)}),r?lm(t):{x:0,y:0,width:0,height:0}},Yy=(e,n,[t,r,s]=[0,0,1],a=!1,o=!1)=>{const l=(n.x-t)/s,c=(n.y-r)/s,f=n.width/s,_=n.height/s,d=[];for(const m of e.values()){const{measured:g,selectable:S=!0,hidden:k=!1}=m;if(o&&!S||k)continue;const v=g.width??m.width??m.initialWidth??0,b=g.height??m.height??m.initialHeight??0,{x:w,y}=m.internals.positionAbsolute,C=NT(l,c,f,_,w,y,v,b),z=v*b,N=a&&C>0;(!m.internals.handleBounds||N||C>=z||m.dragging)&&d.push(m)}return d},Imt=(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 Bmt(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 $mt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:a},o){if(e.size===0)return!0;const l=Bmt(e,o),c=ld(l),f=Qy(c,n,t,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(f,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function kT({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:a}){const o=t.get(e),l=o.parentId?t.get(o.parentId):void 0,{x:c,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},_=o.origin??r;let d=o.extent||s;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Vi.error005());else{const g=l.measured.width,S=l.measured.height;g&&S&&(d=[[c,f],[c+g,f+S]])}else l&&sc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const m=sc(d)?rc(n,d,o.measured):n;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Vi.error015())),{position:{x:m.x-c+(o.measured.width??0)*_[0],y:m.y-f+(o.measured.height??0)*_[1]},positionAbsolute:m}}async function Hmt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const a=new Set(e.map(m=>m.id)),o=[];for(const m of t){if(m.deletable===!1)continue;const g=a.has(m.id),S=!g&&m.parentId&&o.find(k=>k.id===m.parentId);(g||S)&&o.push(m)}const l=new Set(n.map(m=>m.id)),c=r.filter(m=>m.deletable!==!1),_=Imt(o,c);for(const m of c)l.has(m.id)&&!_.find(S=>S.id===m.id)&&_.push(m);if(!s)return{edges:_,nodes:o};const d=await s({nodes:o,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:o}:{edges:[],nodes:[]}:d}const Lu=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),rc=(e={x:0,y:0},n,t)=>({x:Lu(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Lu(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function CT(e,n,t){const{width:r,height:s}=mo(t),{x:a,y:o}=t.internals.positionAbsolute;return rc(e,[[a,o],[a+r,o+s]],n)}const oC=(e,n,t)=>et?-Lu(Math.abs(e-t),1,n)/n:0,Zy=(e,n,t=15,r=40)=>{const s=oC(e.x,r,n.width-r)*t,a=oC(e.y,r,n.height-r)*t;return[s,a]},om=(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)}),x2=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),lm=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),Lh=(e,n=[0,0])=>{var s,a;const{x:t,y:r}=Xy(e)?e.internals.positionAbsolute:od(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},J0=(e,n=[0,0])=>{var s,a;const{x:t,y:r}=Xy(e)?e.internals.positionAbsolute:od(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},ET=(e,n)=>lm(om(x2(e),x2(n))),NT=(e,n,t,r,s,a,o,l)=>{const c=Math.max(0,Math.min(e+t,s+o)-Math.max(e,s)),f=Math.max(0,Math.min(n+r,a+l)-Math.max(n,a));return Math.ceil(c*f)},ep=(e,n)=>NT(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lC=e=>Hi(e.width)&&Hi(e.height)&&Hi(e.x)&&Hi(e.y),Hi=e=>!isNaN(e)&&isFinite(e),zT=(e,n)=>(t,r)=>{},cd=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),ud=({x:e,y:n},[t,r,s],a=!1,o=[1,1])=>{const l={x:(e-t)/s,y:(n-r)/s};return a?cd(l,o):l},Ou=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Zc(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 Fmt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Zc(e,t),s=Zc(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Zc(e.top??e.y??0,t),s=Zc(e.bottom??e.y??0,t),a=Zc(e.left??e.x??0,n),o=Zc(e.right??e.x??0,n);return{top:r,right:o,bottom:s,left:a,x:a+o,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Pmt(e,n,t,r,s,a){const{x:o,y:l}=Ou(e,[n,t,r]),{x:c,y:f}=Ou({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-c,d=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(_),bottom:Math.floor(d)}}const Qy=(e,n,t,r,s,a)=>{const o=Fmt(a,n,t),l=(n-o.x)/e.width,c=(t-o.y)/e.height,f=Math.min(l,c),_=Lu(f,r,s),d=e.x+e.width/2,m=e.y+e.height/2,g=n/2-d*_,S=t/2-m*_,k=Pmt(e,g,S,_,n,t),v={left:Math.min(k.left-o.left,0),top:Math.min(k.top-o.top,0),right:Math.min(k.right-o.right,0),bottom:Math.min(k.bottom-o.bottom,0)};return{x:g-v.left+v.right,y:S-v.top+v.bottom,zoom:_}},Oh=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function sc(e){return e!=null&&e!=="parent"}function mo(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 AT(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 jT(e,n={width:0,height:0},t,r,s){const a={...e},o=r.get(t);if(o){const l=o.origin||s;a.x+=o.internals.positionAbsolute.x-(n.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(n.height??0)*l[1]}return a}function cC(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function Umt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function qmt(e){return{...xT,...e||{}}}function oh(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:a,y:o}=Fi(e),l=ud({x:a-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},r),{x:c,y:f}=t?cd(l,n):l;return{xSnapped:c,ySnapped:f,...l}}const Jy=e=>({width:e.offsetWidth,height:e.offsetHeight}),TT=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},Gmt=["INPUT","SELECT","TEXTAREA"];function MT(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:Gmt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const RT=e=>"clientX"in e,Fi=(e,n)=>{var a,o;const t=RT(e),r=t?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,s=t?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uC=(e,n,t,r,s)=>{const a=n.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:s,position:o.getAttribute("data-handlepos"),x:(l.left-t.left)/r,y:(l.top-t.top)/r,...Jy(o)}})};function DT({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+s*.375+o*.375+t*.125,f=n*.125+a*.375+l*.375+r*.125,_=Math.abs(c-e),d=Math.abs(f-n);return[c,f,_,d]}function W_(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fC({pos:e,x1:n,y1:t,x2:r,y2:s,c:a}){switch(e){case ot.Left:return[n-W_(n-r,a),t];case ot.Right:return[n+W_(r-n,a),t];case ot.Top:return[n,t-W_(t-s,a)];case ot.Bottom:return[n,t+W_(s-t,a)]}}function LT({sourceX:e,sourceY:n,sourcePosition:t=ot.Bottom,targetX:r,targetY:s,targetPosition:a=ot.Top,curvature:o=.25}){const[l,c]=fC({pos:t,x1:e,y1:n,x2:r,y2:s,c:o}),[f,_]=fC({pos:a,x1:r,y1:s,x2:e,y2:n,c:o}),[d,m,g,S]=DT({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:_});return[`M${e},${n} C${l},${c} ${f},${_} ${r},${s}`,d,m,g,S]}function OT({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,a=t0}const Kmt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,Xmt=(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)),Ymt=(e,n,t={})=>{var a;if(!e.source||!e.target)return(a=t.onError)==null||a.call(t,"006",Vi.error006()),n;const r=t.getEdgeId||Kmt;let s;return ST(e)?s={...e}:s={...e,id:r(e)},Xmt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function IT({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,a,o,l]=OT({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,a,o,l]}const hC={[ot.Left]:{x:-1,y:0},[ot.Right]:{x:1,y:0},[ot.Top]:{x:0,y:-1},[ot.Bottom]:{x:0,y:1}},Zmt=({source:e,sourcePosition:n=ot.Bottom,target:t})=>n===ot.Left||n===ot.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function Qmt({source:e,sourcePosition:n=ot.Bottom,target:t,targetPosition:r=ot.Top,center:s,offset:a,stepPosition:o}){const l=hC[n],c=hC[r],f={x:e.x+l.x*a,y:e.y+l.y*a},_={x:t.x+c.x*a,y:t.y+c.y*a},d=Zmt({source:f,sourcePosition:n,target:_}),m=d.x!==0?"x":"y",g=d[m];let S=[],k,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=OT({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(l[m]*c[m]===-1){m==="x"?(k=s.x??f.x+(_.x-f.x)*o,v=s.y??(f.y+_.y)/2):(k=s.x??(f.x+_.x)/2,v=s.y??f.y+(_.y-f.y)*o);const j=[{x:k,y:f.y},{x:k,y:_.y}],D=[{x:f.x,y:v},{x:_.x,y:v}];l[m]===g?S=m==="x"?j:D:S=m==="x"?D:j}else{const j=[{x:f.x,y:_.y}],D=[{x:_.x,y:f.y}];if(m==="x"?S=l.x===g?D:j:S=l.y===g?j:D,n===r){const W=Math.abs(e[m]-t[m]);if(W<=a){const Z=Math.min(a-1,a-W);l[m]===g?b[m]=(f[m]>e[m]?-1:1)*Z:w[m]=(_[m]>t[m]?-1:1)*Z}}if(n!==r){const W=m==="x"?"y":"x",Z=l[m]===c[W],X=f[W]>_[W],J=f[W]<_[W];(l[m]===1&&(!Z&&X||Z&&J)||l[m]!==1&&(!Z&&J||Z&&X))&&(S=m==="x"?j:D)}const I={x:f.x+b.x,y:f.y+b.y},L={x:_.x+w.x,y:_.y+w.y},P=Math.max(Math.abs(I.x-S[0].x),Math.abs(L.x-S[0].x)),q=Math.max(Math.abs(I.y-S[0].y),Math.abs(L.y-S[0].y));P>=q?(k=(I.x+L.x)/2,v=S[0].y):(k=S[0].x,v=(I.y+L.y)/2)}const z={x:f.x+b.x,y:f.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...z.x!==S[0].x||z.y!==S[0].y?[z]:[],...S,...N.x!==S[S.length-1].x||N.y!==S[S.length-1].y?[N]:[],t],k,v,y,C]}function Jmt(e,n,t,r){const s=Math.min(dC(e,n)/2,dC(n,t)/2,r),{x:a,y:o}=n;if(e.x===a&&a===t.x||e.y===o&&o===t.y)return`L${a} ${o}`;if(e.y===o){const f=e.xt.id===n):e[0])||null}function w2(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function tgt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const f=w2(c,n);a.has(f)||(o.push({id:f,color:c.color||t,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const BT=1e3,ngt=10,e4={nodeOrigin:[0,0],nodeExtent:Rh,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rgt={...e4,checkEquality:!0};function t4(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function sgt(e,n,t){const r=t4(e4,t);for(const s of e.values())if(s.parentId)r4(s,e,n,r);else{const a=od(s,r.nodeOrigin),o=sc(s.extent)?s.extent:r.nodeExtent,l=rc(a,o,mo(s));s.internals.positionAbsolute=l}}function igt(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 a={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(a):s.type==="target"&&r.push(a)}return{source:t,target:r}}function n4(e){return e==="manual"}function S2(e,n,t,r={}){var _,d;const s=t4(rgt,r),a={i:0},o=new Map(n),l=s!=null&&s.elevateNodesOnSelect&&!n4(s.zIndexMode)?BT:0;let c=e.length>0,f=!1;n.clear(),t.clear();for(const m of e){let g=o.get(m.id);if(s.checkEquality&&m===(g==null?void 0:g.internals.userNode))n.set(m.id,g);else{const S=od(m,s.nodeOrigin),k=sc(m.extent)?m.extent:s.nodeExtent,v=rc(S,k,mo(m));g={...s.defaults,...m,measured:{width:(_=m.measured)==null?void 0:_.width,height:(d=m.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:igt(m,g),z:$T(m,l,s.zIndexMode),userNode:m}},n.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),m.parentId&&r4(g,n,t,r,a),f||(f=m.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function agt(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 r4(e,n,t,r,s){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=t4(e4,r),f=e.parentId,_=n.get(f);if(!_){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}agt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&c==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*ngt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=a&&!n4(c)?BT:0,{x:m,y:g,z:S}=ogt(e,_,o,l,d,c),{positionAbsolute:k}=e.internals,v=m!==k.x||g!==k.y;(v||S!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:m,y:g}:k,z:S}})}function $T(e,n,t){const r=Hi(e.zIndex)?e.zIndex:0;return n4(t)?r:r+(e.selected?n:0)}function ogt(e,n,t,r,s,a){const{x:o,y:l}=n.internals.positionAbsolute,c=mo(e),f=od(e,t),_=sc(e.extent)?rc(f,e.extent,c):f;let d=rc({x:o+_.x,y:l+_.y},r,c);e.extent==="parent"&&(d=CT(d,c,n));const m=$T(e,s,a),g=n.internals.z??0;return{x:d.x,y:d.y,z:g>=m?g+1:m}}function s4(e,n,t,r=[0,0]){var o;const s=[],a=new Map;for(const l of e){const c=n.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Lh(c),_=ET(f,l.rect);a.set(l.parentId,{expandedRect:_,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var y;const _=c.internals.positionAbsolute,d=mo(c),m=c.origin??r,g=l.x<_.x?Math.round(Math.abs(_.x-l.x)):0,S=l.y<_.y?Math.round(Math.abs(_.y-l.y)):0,k=Math.max(d.width,Math.round(l.width)),v=Math.max(d.height,Math.round(l.height)),b=(k-d.width)*m[0],w=(v-d.height)*m[1];(g>0||S>0||b||w)&&(s.push({id:f,type:"position",position:{x:c.position.x-g+b,y:c.position.y-S+w}}),(y=t.get(f))==null||y.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+g,y:C.position.y+S}})})),(d.width0){const g=s4(m,n,t,s);f.push(...g)}return{changes:f,updatedInternals:c}}async function cgt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:a}){if(!n||!e.x&&!e.y)return!1;const o=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,a]],r);return!!o&&(o.x!==t[0]||o.y!==t[1]||o.k!==t[2])}function gC(e,n,t,r,s,a){let o=s;const l=r.get(o)||new Map;r.set(o,l.set(t,n)),o=`${s}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(t,n)),a){o=`${s}-${e}-${a}`;const f=r.get(o)||new Map;r.set(o,f.set(t,n))}}function HT(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:a,sourceHandle:o,targetHandle:l},f=`${s}-${o}--${a}-${l}`,_=`${a}-${l}--${s}-${o}`;gC("source",c,_,e,s,o),gC("target",c,f,e,a,l),n.set(r.id,r)}}function FT(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:FT(t,n):!1}function bC(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 ugt(e,n,t,r){const s=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!FT(o,e))&&(o.draggable||n&&typeof o.draggable>"u")){const l=e.get(a);l&&s.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:t.x-l.internals.positionAbsolute.x,y:t.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Lb({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var o,l,c;const s=[];for(const[f,_]of n){const d=(o=t.get(f))==null?void 0:o.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const a=(l=t.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=n.get(e))==null?void 0:c.position)||a.position,dragging:r}:s[0],s]}function fgt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const a={x:t-s.distance.x,y:r-s.distance.y},o=cd(a,n);return{x:o.x-a.x,y:o.y-a.y}}function hgt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},_=null,d=!1,m=null,g=!1,S=!1,k=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:z,nodeId:N,nodeClickDistance:T=0}){m=Vs(C);function j({x:P,y:q}){const{nodeLookup:W,nodeExtent:Z,snapGrid:X,snapToGrid:J,nodeOrigin:ee,onNodeDrag:$,onSelectionDrag:B,onError:H,updateNodePositions:K}=n();a={x:P,y:q};let G=!1;const ie=l.size>1,ve=ie&&Z?x2(ld(l)):null,ce=ie&&J?fgt({dragItems:l,snapGrid:X,x:P,y:q}):null;for(const[re,F]of l){if(!W.has(re))continue;let oe={x:P-F.distance.x,y:q-F.distance.y};J&&(oe=ce?{x:Math.round(oe.x+ce.x),y:Math.round(oe.y+ce.y)}:cd(oe,X));let ue=null;if(ie&&Z&&!F.extent&&ve){const{positionAbsolute:Ee}=F.internals,Re=Ee.x-ve.x+Z[0][0],He=Ee.x+F.measured.width-ve.x2+Z[1][0],Te=Ee.y-ve.y+Z[0][1],Ie=Ee.y+F.measured.height-ve.y2+Z[1][1];ue=[[Re,Te],[He,Ie]]}const{position:he,positionAbsolute:me}=kT({nodeId:re,nextPosition:oe,nodeLookup:W,nodeExtent:ue||Z,nodeOrigin:ee,onError:H});G=G||F.position.x!==he.x||F.position.y!==he.y,F.position=he,F.internals.positionAbsolute=me}if(S=S||G,!!G&&(K(l,!0),k&&(r||$||!N&&B))){const[re,F]=Lb({nodeId:N,dragItems:l,nodeLookup:W});r==null||r(k,l,re,F),$==null||$(k,re,F),N||B==null||B(k,F)}}async function D(){if(!_)return;const{transform:P,panBy:q,autoPanSpeed:W,autoPanOnNodeDrag:Z}=n();if(!Z){c=!1,cancelAnimationFrame(o);return}const[X,J]=Zy(f,_,W);(X!==0||J!==0)&&(a.x=(a.x??0)-X/P[2],a.y=(a.y??0)-J/P[2],await q({x:X,y:J})&&j(a)),o=requestAnimationFrame(D)}function I(P){var ie;const{nodeLookup:q,multiSelectionActive:W,nodesDraggable:Z,transform:X,snapGrid:J,snapToGrid:ee,selectNodesOnDrag:$,onNodeDragStart:B,onSelectionDragStart:H,unselectNodesAndEdges:K}=n();d=!0,(!$||!z)&&!W&&N&&((ie=q.get(N))!=null&&ie.selected||K()),z&&$&&N&&(e==null||e(N));const G=oh(P.sourceEvent,{transform:X,snapGrid:J,snapToGrid:ee,containerBounds:_});if(a=G,l=ugt(q,Z,G,N),l.size>0&&(t||B||!N&&H)){const[ve,ce]=Lb({nodeId:N,dragItems:l,nodeLookup:q});t==null||t(P.sourceEvent,l,ve,ce),B==null||B(P.sourceEvent,ve,ce),N||H==null||H(P.sourceEvent,ce)}}const L=rT().clickDistance(T).on("start",P=>{const{domNode:q,nodeDragThreshold:W,transform:Z,snapGrid:X,snapToGrid:J}=n();_=(q==null?void 0:q.getBoundingClientRect())||null,g=!1,S=!1,k=P.sourceEvent,W===0&&I(P),a=oh(P.sourceEvent,{transform:Z,snapGrid:X,snapToGrid:J,containerBounds:_}),f=Fi(P.sourceEvent,_)}).on("drag",P=>{const{autoPanOnNodeDrag:q,transform:W,snapGrid:Z,snapToGrid:X,nodeDragThreshold:J,nodeLookup:ee}=n(),$=oh(P.sourceEvent,{transform:W,snapGrid:Z,snapToGrid:X,containerBounds:_});if(k=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||N&&!ee.has(N))&&(g=!0),!g){if(!c&&q&&d&&(c=!0,D()),!d){const B=Fi(P.sourceEvent,_),H=B.x-f.x,K=B.y-f.y;Math.sqrt(H*H+K*K)>J&&I(P)}(a.x!==$.xSnapped||a.y!==$.ySnapped)&&l&&d&&(f=Fi(P.sourceEvent,_),j($))}}).on("end",P=>{if(!d||g){g&&l.size>0&&n().updateNodePositions(l,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:q,updateNodePositions:W,onNodeDragStop:Z,onSelectionDragStop:X}=n();if(S&&(W(l,!1),S=!1),s||Z||!N&&X){const[J,ee]=Lb({nodeId:N,dragItems:l,nodeLookup:q,dragging:!1});s==null||s(P.sourceEvent,l,J,ee),Z==null||Z(P.sourceEvent,J,ee),N||X==null||X(P.sourceEvent,ee)}}}).filter(P=>{const q=P.target;return!P.button&&(!w||!bC(q,`.${w}`,C))&&(!y||bC(q,y,C))});m.call(L)}function b(){m==null||m.on(".drag",null)}return{update:v,destroy:b}}function dgt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const a of n.values())ep(s,Lh(a))>0&&r.push(a);return r}const _gt=250;function pgt(e,n,t,r){var l,c;let s=[],a=1/0;const o=dgt(e,t,n+_gt);for(const f of o){const _=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:m,y:g}=ic(f,d,d.position,!0),S=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));S>n||(S1){const f=r.type==="source"?"target":"source";return s.find(_=>_.type===f)??s[0]}return s[0]}function PT(e,n,t,r,s,a=!1){var f,_,d;const o=r.get(e);if(!o)return null;const l=s==="strict"?(f=o.internals.handleBounds)==null?void 0:f[n]:[...((_=o.internals.handleBounds)==null?void 0:_.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(t?l==null?void 0:l.find(m=>m.id===t):l==null?void 0:l[0])??null;return c&&a?{...c,...ic(o,c,c.position,!0)}:c}function UT(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function mgt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const qT=()=>!0;function ggt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:_,flowId:d,panBy:m,cancelConnection:g,onConnectStart:S,onConnect:k,onConnectEnd:v,isValidConnection:b=qT,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:z,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const D=TT(e.target);let I=0,L;const{x:P,y:q}=Fi(e),W=UT(a,j),Z=l==null?void 0:l.getBoundingClientRect();let X=!1;if(!Z||!W)return;const J=PT(s,W,r,c,n);if(!J)return;let ee=Fi(e,Z),$=!1,B=null,H=!1,K=null;function G(){if(!_||!Z)return;const[he,me]=Zy(ee,Z,N);m({x:he,y:me}),I=requestAnimationFrame(G)}const ie={...J,nodeId:s,type:W,position:J.position},ve=c.get(s);let re={inProgress:!0,isValid:null,from:ic(ve,ie,ot.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ve,to:ee,toHandle:null,toPosition:aC[ie.position],toNode:null,pointer:ee};function F(){X=!0,y(re),S==null||S(e,{nodeId:s,handleId:r,handleType:W})}T===0&&F();function oe(he){if(!X){const{x:Ie,y:et}=Fi(he),Tt=Ie-P,zt=et-q;if(!(Tt*Tt+zt*zt>T*T))return;F()}if(!z()||!ie){ue(he);return}const me=C();ee=Fi(he,Z),L=pgt(ud(ee,me,!1,[1,1]),t,c,ie),$||(G(),$=!0);const Ee=GT(he,{handle:L,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:o?"target":"source",isValidConnection:b,doc:D,lib:f,flowId:d,nodeLookup:c});K=Ee.handleDomNode,B=Ee.connection,H=mgt(!!L,Ee.isValid);const Re=c.get(s),He=Re?ic(Re,ie,ot.Left,!0):re.from,Te={...re,from:He,isValid:H,to:Ee.toHandle&&H?Ou({x:Ee.toHandle.x,y:Ee.toHandle.y},me):ee,toHandle:Ee.toHandle,toPosition:H&&Ee.toHandle?Ee.toHandle.position:aC[ie.position],toNode:Ee.toHandle?c.get(Ee.toHandle.nodeId):null,pointer:ee};y(Te),re=Te}function ue(he){if(!("touches"in he&&he.touches.length>0)){if(X){(L||K)&&B&&H&&(k==null||k(B));const{inProgress:me,...Ee}=re,Re={...Ee,toPosition:re.toHandle?re.toPosition:null};v==null||v(he,Re),a&&(w==null||w(he,Re))}g(),cancelAnimationFrame(I),$=!1,H=!1,B=null,K=null,D.removeEventListener("mousemove",oe),D.removeEventListener("mouseup",ue),D.removeEventListener("touchmove",oe),D.removeEventListener("touchend",ue)}}D.addEventListener("mousemove",oe),D.addEventListener("mouseup",ue),D.addEventListener("touchmove",oe),D.addEventListener("touchend",ue)}function GT(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=qT,nodeLookup:_}){const d=a==="target",m=n?o.querySelector(`.${l}-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:g,y:S}=Fi(e),k=o.elementFromPoint(g,S),v=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:m,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=UT(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||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const D=z&&N&&(t===Du.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=D&&f(T),b.toHandle=PT(y,w,C,_,t,!0)}return b}const k2={onPointerDown:ggt,isValid:GT};function bgt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Vs(e);function a({translateExtent:l,width:c,height:f,zoomStep:_=1,pannable:d=!0,zoomable:m=!0,inversePan:g=!1}){const S=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=y.sourceEvent.ctrlKey&&Oh()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,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]))*(g?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},D=[[0,0],[c,f]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},D,l)},w=bT().on("start",v).on("zoom",d?b:null).on("zoom.wheel",m?S:null);s.call(w,{})}function o(){s.on("zoom",null)}return{update:a,destroy:o,pointer:Oi}}const cm=e=>({x:e.x,y:e.y,zoom:e.k}),Ob=({x:e,y:n,zoom:t})=>am.translate(e,n).scale(t),cu=(e,n)=>e.target.closest(`.${n}`),VT=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),vgt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ib=(e,n=0,t=vgt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},WT=e=>{const n=e.ctrlKey&&Oh()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function xgt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return _=>{if(cu(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&o){const v=Oi(_),b=WT(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const m=_.deltaMode===1?20:1;let g=s===Ql.Vertical?0:_.deltaX*m,S=s===Ql.Horizontal?0:_.deltaY*m;!Oh()&&_.shiftKey&&s!==Ql.Vertical&&(g=_.deltaY*m,S=0),r.translateBy(t,-(g/d)*a,-(S/d)*a,{internal:!0});const k=cm(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(_,k),e.panScrollTimeout=setTimeout(()=>{f==null||f(_,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(_,k))}}function ygt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const a=r.type==="wheel",o=!n&&a&&!r.ctrlKey,l=cu(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),t.call(this,r,s)}}function wgt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const s=cm(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Sgt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return a=>{var o,l;e.usedRightMouseButton=!!(t&&VT(n,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),s&&!((l=a.sourceEvent)!=null&&l.internal)&&(s==null||s(a.sourceEvent,cm(a.transform)))}}function kgt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&VT(n,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=cm(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,c)},t?150:0)}}}function Cgt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:_}){return d=>{var v;const m=e||n,g=t&&d.ctrlKey,S=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(cu(d,`${f}-flow__node`)||cu(d,`${f}-flow__edge`)))return!0;if(!r&&!m&&!s&&!a&&!t||o||_&&!S||cu(d,l)&&S||cu(d,c)&&(!S||s&&S&&!e)||!t&&d.ctrlKey&&S)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!m&&!s&&!g&&S||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||S)&&k}}function Egt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=bT().scaleExtent([n,t]).translateExtent(r),m=Vs(e).call(d);w({x:s.x,y:s.y,zoom:Lu(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const g=m.on("wheel.zoom"),S=m.on("dblclick.zoom");d.wheelDelta(WT);async function k(L,P){return m?new Promise(q=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?ah:u0).transform(Ib(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>q(!0)),L)}):!1}function v({noWheelClassName:L,noPanClassName:P,onPaneContextMenu:q,userSelectionActive:W,panOnScroll:Z,panOnDrag:X,panOnScrollMode:J,panOnScrollSpeed:ee,preventScrolling:$,zoomOnPinch:B,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:G,lib:ie,onTransformChange:ve,connectionInProgress:ce,paneClickDistance:re,selectionOnDrag:F}){W&&!f.isZoomingOrPanning&&b();const oe=Z&&!G&&!W;d.clickDistance(F?1/0:!Hi(re)||re<0?0:re);const ue=oe?xgt({zoomPanValues:f,noWheelClassName:L,d3Selection:m,d3Zoom:d,panOnScrollMode:J,panOnScrollSpeed:ee,zoomOnPinch:B,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):ygt({noWheelClassName:L,preventScrolling:$,d3ZoomHandler:g});m.on("wheel.zoom",ue,{passive:!1});const he=wgt({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});d.on("start",he);const me=Sgt({zoomPanValues:f,panOnDrag:X,onPaneContextMenu:!!q,onPanZoom:a,onTransformChange:ve});d.on("zoom",me);const Ee=kgt({zoomPanValues:f,panOnDrag:X,panOnScroll:Z,onPaneContextMenu:q,onPanZoomEnd:l,onDraggingChange:c});d.on("end",Ee);const Re=Cgt({zoomActivationKeyPressed:G,panOnDrag:X,zoomOnScroll:H,panOnScroll:Z,zoomOnDoubleClick:K,zoomOnPinch:B,userSelectionActive:W,noPanClassName:P,noWheelClassName:L,lib:ie,connectionInProgress:ce});d.filter(Re),K?m.on("dblclick.zoom",S):m.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(L,P,q){const W=Ob(L),Z=d==null?void 0:d.constrain()(W,P,q);return Z&&await k(Z),Z}async function y(L,P){const q=Ob(L);return await k(q,P),q}function C(L){if(m){const P=Ob(L),q=m.property("__zoom");(q.k!==L.zoom||q.x!==L.x||q.y!==L.y)&&(d==null||d.transform(m,P,null,{sync:!0}))}}function z(){const L=m?gT(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function N(L,P){return m?new Promise(q=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?ah:u0).scaleTo(Ib(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>q(!0)),L)}):!1}async function T(L,P){return m?new Promise(q=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?ah:u0).scaleBy(Ib(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>q(!0)),L)}):!1}function j(L){d==null||d.scaleExtent(L)}function D(L){d==null||d.translateExtent(L)}function I(L){const P=!Hi(L)||L<0?0:L;d==null||d.clickDistance(P)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:z,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:D,syncViewport:C,setClickDistance:I}}var Iu;(function(e){e.Line="line",e.Handle="handle"})(Iu||(Iu={}));function Ngt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:a}){const o=e-n,l=t-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&s&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function vC(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 Yo(e,n){return Math.max(0,n-e)}function Zo(e,n){return Math.max(0,e-n)}function K_(e,n,t){return Math.max(0,n-e,e-t)}function xC(e,n){return e?!n:n}function zgt(e,n,t,r,s,a,o,l){let{affectsX:c,affectsY:f}=n;const{isHorizontal:_,isVertical:d}=n,m=_&&d,{xSnapped:g,ySnapped:S}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:z,height:N,aspectRatio:T}=e;let j=Math.floor(_?g-e.pointerX:0),D=Math.floor(d?S-e.pointerY:0);const I=z+(c?-j:j),L=N+(f?-D:D),P=-a[0]*z,q=-a[1]*N;let W=K_(I,k,v),Z=K_(L,b,w);if(o){let ee=0,$=0;c&&j<0?ee=Yo(y+j+P,o[0][0]):!c&&j>0&&(ee=Zo(y+I+P,o[1][0])),f&&D<0?$=Yo(C+D+q,o[0][1]):!f&&D>0&&($=Zo(C+L+q,o[1][1])),W=Math.max(W,ee),Z=Math.max(Z,$)}if(l){let ee=0,$=0;c&&j>0?ee=Zo(y+j,l[0][0]):!c&&j<0&&(ee=Yo(y+I,l[1][0])),f&&D>0?$=Zo(C+D,l[0][1]):!f&&D<0&&($=Yo(C+L,l[1][1])),W=Math.max(W,ee),Z=Math.max(Z,$)}if(s){if(_){const ee=K_(I/T,b,w)*T;if(W=Math.max(W,ee),o){let $=0;!c&&!f||c&&!f&&m?$=Zo(C+q+I/T,o[1][1])*T:$=Yo(C+q+(c?j:-j)/T,o[0][1])*T,W=Math.max(W,$)}if(l){let $=0;!c&&!f||c&&!f&&m?$=Yo(C+I/T,l[1][1])*T:$=Zo(C+(c?j:-j)/T,l[0][1])*T,W=Math.max(W,$)}}if(d){const ee=K_(L*T,k,v)/T;if(Z=Math.max(Z,ee),o){let $=0;!c&&!f||f&&!c&&m?$=Zo(y+L*T+P,o[1][0])/T:$=Yo(y+(f?D:-D)*T+P,o[0][0])/T,Z=Math.max(Z,$)}if(l){let $=0;!c&&!f||f&&!c&&m?$=Yo(y+L*T,l[1][0])/T:$=Zo(y+(f?D:-D)*T,l[0][0])/T,Z=Math.max(Z,$)}}}D=D+(D<0?Z:-Z),j=j+(j<0?W:-W),s&&(m?I>L*T?D=(xC(c,f)?-j:j)/T:j=(xC(c,f)?-D:D)*T:_?(D=j/T,f=c):(j=D*T,c=f));const X=c?y+j:y,J=f?C+D:C;return{width:z+(c?-j:j),height:N+(f?-D:D),x:a[0]*j*(c?-1:1)+X,y:a[1]*D*(f?-1:1)+J}}const KT={width:0,height:0,x:0,y:0},Agt={...KT,pointerX:0,pointerY:0,aspectRatio:1};function jgt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=t[0]*a,c=t[1]*o;return[[r-l,s-c],[r+a-l,s+o-c]]}function Tgt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const a=Vs(e);let o={controlDirection:vC("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:_,keepAspectRatio:d,resizeDirection:m,onResizeStart:g,onResize:S,onResizeEnd:k,shouldResize:v}){let b={...KT},w={...Agt};o={boundaries:_,resizeDirection:m,keepAspectRatio:d,controlDirection:vC(f)};let y,C=null,z=[],N,T,j,D=!1;const I=rT().on("start",L=>{const{nodeLookup:P,transform:q,snapGrid:W,snapToGrid:Z,nodeOrigin:X,paneDomNode:J}=t();if(y=P.get(n),!y)return;C=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:$}=oh(L.sourceEvent,{transform:q,snapGrid:W,snapToGrid:Z,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:ee,pointerY:$,aspectRatio:b.width/b.height},N=void 0,T=sc(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=P.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),z=[],j=void 0;for(const[B,H]of P)if(H.parentId===n&&(z.push({id:B,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=jgt(H,y,H.origin??X);j?j=[[Math.min(K[0][0],j[0][0]),Math.min(K[0][1],j[0][1])],[Math.max(K[1][0],j[1][0]),Math.max(K[1][1],j[1][1])]]:j=K}g==null||g(L,{...b})}).on("drag",L=>{const{transform:P,snapGrid:q,snapToGrid:W,nodeOrigin:Z}=t(),X=oh(L.sourceEvent,{transform:P,snapGrid:q,snapToGrid:W,containerBounds:C}),J=[];if(!y)return;const{x:ee,y:$,width:B,height:H}=b,K={},G=y.origin??Z,{width:ie,height:ve,x:ce,y:re}=zgt(w,o.controlDirection,X,o.boundaries,o.keepAspectRatio,G,T,j),F=ie!==B,oe=ve!==H,ue=ce!==ee&&F,he=re!==$&&oe;if(!ue&&!he&&!F&&!oe)return;if((ue||he||G[0]===1||G[1]===1)&&(K.x=ue?ce:b.x,K.y=he?re:b.y,b.x=K.x,b.y=K.y,z.length>0)){const He=ce-ee,Te=re-$;for(const Ie of z)Ie.position={x:Ie.position.x-He+G[0]*(ie-B),y:Ie.position.y-Te+G[1]*(ve-H)},J.push(Ie)}if((F||oe)&&(K.width=F&&(!o.resizeDirection||o.resizeDirection==="horizontal")?ie:b.width,K.height=oe&&(!o.resizeDirection||o.resizeDirection==="vertical")?ve:b.height,b.width=K.width,b.height=K.height),N&&y.expandParent){const He=G[0]*(K.width??0);K.x&&K.x{D&&(k==null||k(L,{...b}),s==null||s({...b}),D=!1)});a.call(I)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}var Bb={exports:{}},$b={},Hb={exports:{}},Fb={};/** * @license React * use-sync-external-store-shim.production.js * @@ -1032,7 +1032,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bC;function Ymt(){if(bC)return $b;bC=1;var e=qd();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(h,m){var g=m(),S=r({inst:{value:g,getSnapshot:m}}),k=S[0].inst,v=S[1];return a(function(){k.value=g,k.getSnapshot=m,c(k)&&v({inst:k})},[h,g,m]),s(function(){return c(k)&&v({inst:k}),h(function(){c(k)&&v({inst:k})})},[h]),o(g),g}function c(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!t(h,g)}catch{return!0}}function f(h,m){return m()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return $b.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,$b}var vC;function Zmt(){return vC||(vC=1,Bb.exports=Ymt()),Bb.exports}/** + */var yC;function Mgt(){if(yC)return Fb;yC=1;var e=qh();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(d,m){var g=m(),S=r({inst:{value:g,getSnapshot:m}}),k=S[0].inst,v=S[1];return a(function(){k.value=g,k.getSnapshot=m,c(k)&&v({inst:k})},[d,g,m]),s(function(){return c(k)&&v({inst:k}),d(function(){c(k)&&v({inst:k})})},[d]),o(g),g}function c(d){var m=d.getSnapshot;d=d.value;try{var g=m();return!t(d,g)}catch{return!0}}function f(d,m){return m()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return Fb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,Fb}var wC;function Rgt(){return wC||(wC=1,Hb.exports=Mgt()),Hb.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -1040,12 +1040,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xC;function Qmt(){if(xC)return Ib;xC=1;var e=qd(),n=Zmt();function t(f,_){return f===_&&(f!==0||1/f===1/_)||f!==f&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Ib.useSyncExternalStoreWithSelector=function(f,_,h,m,g){var S=a(null);if(S.current===null){var k={hasValue:!1,value:null};S.current=k}else k=S.current;S=l(function(){function b(N){if(!w){if(w=!0,y=N,N=m(N),g!==void 0&&k.hasValue){var T=k.value;if(g(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=m(N);return g!==void 0&&g(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,z=h===void 0?null:h;return[function(){return b(_())},z===null?void 0:function(){return b(z())}]},[_,h,m,g]);var v=s(f,S[0],S[1]);return o(function(){k.hasValue=!0,k.value=v},[v]),c(v),v},Ib}var yC;function Jmt(){return yC||(yC=1,Ob.exports=Qmt()),Ob.exports}var egt=Jmt();const tgt=tp(egt),ngt={},wC=e=>{let n;const t=new Set,r=(_,h)=>{const m=typeof _=="function"?_(n):_;if(!Object.is(m,n)){const g=n;n=h??(typeof m!="object"||m===null)?m:Object.assign({},n,m),t.forEach(S=>S(n,g))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>f,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(ngt?"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()}},f=n=e(r,s,c);return c},rgt=e=>e?wC(e):wC,{useDebugValue:sgt}=aD,{useSyncExternalStoreWithSelector:igt}=tgt,agt=e=>e;function VT(e,n=agt,t){const r=igt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return sgt(r),r}const SC=(e,n)=>{const t=rgt(e),r=(s,a=n)=>VT(t,s,a);return Object.assign(r,t),r},ogt=(e,n)=>e?SC(e,n):SC;function On(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 cm=R.createContext(null),lgt=cm.Provider,WT=Gi.error001("react");function Wt(e,n){const t=R.useContext(cm);if(t===null)throw new Error(WT);return VT(t,e,n)}function Bn(){const e=R.useContext(cm);if(e===null)throw new Error(WT);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kC={display:"none"},cgt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},KT="react-flow__node-desc",XT="react-flow__edge-desc",ugt="react-flow__aria-live",fgt=e=>e.ariaLiveMessage,dgt=e=>e.ariaLabelConfig;function hgt({rfId:e}){const n=Wt(fgt);return d.jsx("div",{id:`${ugt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:cgt,children:n})}function _gt({rfId:e,disableKeyboardA11y:n}){const t=Wt(dgt);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${KT}-${e}`,style:kC,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${XT}-${e}`,style:kC,children:t["edge.a11yDescription.default"]}),!n&&d.jsx(hgt,{rfId:e})]})}const um=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},a)=>{const o=`${e}`.split("-");return d.jsx("div",{className:gr(["react-flow__panel",t,...o]),style:r,ref:a,...s,children:n})});um.displayName="Panel";const CC="https://reactflow.dev?utm_source=attribution";function pgt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(um,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${CC}`,children:d.jsx("a",{href:CC,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mgt=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}},K_=e=>e.id;function ggt(e,n){return On(e.selectedNodes.map(K_),n.selectedNodes.map(K_))&&On(e.selectedEdges.map(K_),n.selectedEdges.map(K_))}function bgt({onSelectionChange:e}){const n=Bn(),{selectedNodes:t,selectedEdges:r}=Wt(mgt,ggt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(a=>a(s))},[t,r,e]),null}const vgt=e=>!!e.onSelectionChangeHandlers;function xgt({onSelectionChange:e}){const n=Wt(vgt);return e||n?d.jsx(bgt,{onSelectionChange:e}):null}const YT=[0,0],ygt={x:0,y:0,zoom:1},wgt=["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"],EC=[...wgt,"rfId"],Sgt=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}),NC={translateExtent:Rd,nodeOrigin:YT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kgt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Wt(Sgt,On),f=Bn();R.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{_.current=NC,l()}),[]);const _=R.useRef(NC);return R.useEffect(()=>{for(const h of EC){const m=e[h],g=_.current[h];m!==g&&(typeof e[h]>"u"||(h==="nodes"?n(m):h==="edges"?t(m):h==="minZoom"?r(m):h==="maxZoom"?s(m):h==="translateExtent"?a(m):h==="nodeExtent"?o(m):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:lmt(m)}):h==="fitView"?f.setState({fitViewQueued:m}):h==="fitViewOptions"?f.setState({fitViewOptions:m}):f.setState({[h]:m})))}_.current=e},EC.map(h=>e[h])),null}function zC(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Cgt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=zC(),a=()=>t(s!=null&&s.matches?"dark":"light");return a(),s==null||s.addEventListener("change",a),()=>{s==null||s.removeEventListener("change",a)}},[e]),n!==null?n:(r=zC())!=null&&r.matches?"dark":"light"}const AC=typeof document<"u"?document:null;function Id(e=null,n={target:AC,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",` + */var SC;function Dgt(){if(SC)return $b;SC=1;var e=qh(),n=Rgt();function t(f,_){return f===_&&(f!==0||1/f===1/_)||f!==f&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return $b.useSyncExternalStoreWithSelector=function(f,_,d,m,g){var S=a(null);if(S.current===null){var k={hasValue:!1,value:null};S.current=k}else k=S.current;S=l(function(){function b(N){if(!w){if(w=!0,y=N,N=m(N),g!==void 0&&k.hasValue){var T=k.value;if(g(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=m(N);return g!==void 0&&g(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,z=d===void 0?null:d;return[function(){return b(_())},z===null?void 0:function(){return b(z())}]},[_,d,m,g]);var v=s(f,S[0],S[1]);return o(function(){k.hasValue=!0,k.value=v},[v]),c(v),v},$b}var kC;function Lgt(){return kC||(kC=1,Bb.exports=Dgt()),Bb.exports}var Ogt=Lgt();const Igt=np(Ogt),Bgt={},CC=e=>{let n;const t=new Set,r=(_,d)=>{const m=typeof _=="function"?_(n):_;if(!Object.is(m,n)){const g=n;n=d??(typeof m!="object"||m===null)?m:Object.assign({},n,m),t.forEach(S=>S(n,g))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>f,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(Bgt?"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()}},f=n=e(r,s,c);return c},$gt=e=>e?CC(e):CC,{useDebugValue:Hgt}=cD,{useSyncExternalStoreWithSelector:Fgt}=Igt,Pgt=e=>e;function XT(e,n=Pgt,t){const r=Fgt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return Hgt(r),r}const EC=(e,n)=>{const t=$gt(e),r=(s,a=n)=>XT(t,s,a);return Object.assign(r,t),r},Ugt=(e,n)=>e?EC(e,n):EC;function $n(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 um=R.createContext(null),qgt=um.Provider,YT=Vi.error001("react");function Kt(e,n){const t=R.useContext(um);if(t===null)throw new Error(YT);return XT(t,e,n)}function Fn(){const e=R.useContext(um);if(e===null)throw new Error(YT);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const NC={display:"none"},Ggt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ZT="react-flow__node-desc",QT="react-flow__edge-desc",Vgt="react-flow__aria-live",Wgt=e=>e.ariaLiveMessage,Kgt=e=>e.ariaLabelConfig;function Xgt({rfId:e}){const n=Kt(Wgt);return h.jsx("div",{id:`${Vgt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ggt,children:n})}function Ygt({rfId:e,disableKeyboardA11y:n}){const t=Kt(Kgt);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${ZT}-${e}`,style:NC,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${QT}-${e}`,style:NC,children:t["edge.a11yDescription.default"]}),!n&&h.jsx(Xgt,{rfId:e})]})}const fm=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:xr(["react-flow__panel",t,...o]),style:r,ref:a,...s,children:n})});fm.displayName="Panel";const zC="https://reactflow.dev?utm_source=attribution";function Zgt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(fm,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${zC}`,children:h.jsx("a",{href:zC,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Qgt=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}},X_=e=>e.id;function Jgt(e,n){return $n(e.selectedNodes.map(X_),n.selectedNodes.map(X_))&&$n(e.selectedEdges.map(X_),n.selectedEdges.map(X_))}function e1t({onSelectionChange:e}){const n=Fn(),{selectedNodes:t,selectedEdges:r}=Kt(Qgt,Jgt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(a=>a(s))},[t,r,e]),null}const t1t=e=>!!e.onSelectionChangeHandlers;function n1t({onSelectionChange:e}){const n=Kt(t1t);return e||n?h.jsx(e1t,{onSelectionChange:e}):null}const JT=[0,0],r1t={x:0,y:0,zoom:1},s1t=["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"],AC=[...s1t,"rfId"],i1t=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}),jC={translateExtent:Rh,nodeOrigin:JT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function a1t(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Kt(i1t,$n),f=Fn();R.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{_.current=jC,l()}),[]);const _=R.useRef(jC);return R.useEffect(()=>{for(const d of AC){const m=e[d],g=_.current[d];m!==g&&(typeof e[d]>"u"||(d==="nodes"?n(m):d==="edges"?t(m):d==="minZoom"?r(m):d==="maxZoom"?s(m):d==="translateExtent"?a(m):d==="nodeExtent"?o(m):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:qmt(m)}):d==="fitView"?f.setState({fitViewQueued:m}):d==="fitViewOptions"?f.setState({fitViewOptions:m}):f.setState({[d]:m})))}_.current=e},AC.map(d=>e[d])),null}function TC(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function o1t(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=TC(),a=()=>t(s!=null&&s.matches?"dark":"light");return a(),s==null||s.addEventListener("change",a),()=>{s==null||s.removeEventListener("change",a)}},[e]),n!==null?n:(r=TC())!=null&&r.matches?"dark":"light"}const MC=typeof document<"u"?document:null;function Ih(e=null,n={target:MC,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=f.reduce((h,m)=>h.concat(...m),[]);return[f,_]}return[[],[]]},[e]);return R.useEffect(()=>{const c=(n==null?void 0:n.target)??AC,f=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=g=>{var v,b;if(s.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!s.current||s.current&&!f)&&AT(g))return!1;const k=TC(g.code,l);if(a.current.add(g[k]),jC(o,a.current,!1)){const w=((b=(v=g.composedPath)==null?void 0:v.call(g))==null?void 0:b[0])||g.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&g.preventDefault(),r(!0)}},h=g=>{const S=TC(g.code,l);jC(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(g[S]),g.key==="Meta"&&a.current.clear(),s.current=!1},m=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",_),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",_),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),t}function jC(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TC(e,n){return n.includes(e)?"code":"key"}const Egt=()=>{const e=Bn();return R.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,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??a},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:a,maxZoom:o,panZoom:l}=e.getState(),c=Yy(n,r,s,a,o,(t==null?void 0:t.padding)??.1);return l?(await l.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:a,domNode:o}=e.getState();if(!o)return n;const{x:l,y:c}=o.getBoundingClientRect(),f={x:n.x-l,y:n.y-c},_=t.snapGrid??s,h=t.snapToGrid??a;return uh(f,r,h,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:a}=r.getBoundingClientRect(),o=Ou(n,t);return{x:o.x+s,y:o.y+a}}}),[])};function ZT(e,n){const t=[],r=new Map,s=[];for(const a of e)if(a.type==="add"){s.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of n){const o=r.get(a.id);if(!o){t.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){t.push({...o[0].item});continue}const l={...a};for(const c of o)Ngt(c,l);t.push(l)}return s.length&&s.forEach(a=>{a.index!==void 0?t.splice(a.index,0,{...a.item}):t.push({...a.item})}),t}function Ngt(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 zgt(e,n){return ZT(e,n)}function Agt(e,n){return ZT(e,n)}function Pl(e,n){return{id:e,type:"select",selected:n}}function uu(e,n=new Set,t=!1){const r=[];for(const[s,a]of e){const o=n.has(s);!(a.selected===void 0&&!o)&&a.selected!==o&&(t&&(a.selected=o),r.push(Pl(a.id,o)))}return r}function MC({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=n.get(o.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;c!==void 0&&c!==o&&t.push({id:o.id,item:o,type:"replace"}),c===void 0&&t.push({item:o,type:"add",index:a})}for(const[a]of n)r.get(a)===void 0&&t.push({id:a,type:"remove"});return t}function RC(e){return{id:e.id,type:"remove"}}const jgt=CT();function Tgt(e,n,t={}){return _mt(e,n,{...t,onError:t.onError??jgt})}const DC=e=>Jpt(e),Mgt=e=>xT(e);function QT(e){return R.forwardRef(e)}const Rgt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function LC(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>Dgt(()=>t(s=>s+BigInt(1))));return Rgt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function Dgt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const JT=R.createContext(null);function Lgt({children:e}){const n=Bn(),t=R.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:_,onNodesChange:h,nodeLookup:m,fitViewQueued:g,onNodesChangeMiddlewareMap:S}=n.getState();let k=c;for(const b of l)k=typeof b=="function"?b(k):b;let v=MC({items:k,lookup:m});for(const b of S.values())v=b(v);_&&f(k),v.length>0?h==null||h(v):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=LC(t),s=R.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:_,onEdgesChange:h,edgeLookup:m}=n.getState();let g=c;for(const S of l)g=typeof S=="function"?S(g):S;_?f(g):h&&h(MC({items:g,lookup:m}))},[]),a=LC(s),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return d.jsx(JT.Provider,{value:o,children:e})}function Ogt(){const e=R.useContext(JT);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Igt=e=>!!e.panZoom;function r4(){const e=Egt(),n=Bn(),t=Ogt(),r=Wt(Igt),s=R.useMemo(()=>{const a=h=>n.getState().nodeLookup.get(h),o=h=>{t.nodeQueue.push(h)},l=h=>{t.edgeQueue.push(h)},c=h=>{var b,w;const{nodeLookup:m,nodeOrigin:g}=n.getState(),S=DC(h)?h:m.get(h.id),k=S.parentId?NT(S.position,S.measured,S.parentId,m,g):S.position,v={...S,position:k,width:((b=S.measured)==null?void 0:b.width)??S.width,height:((w=S.measured)==null?void 0:w.height)??S.height};return Ld(v)},f=(h,m,g={replace:!1})=>{o(S=>S.map(k=>{if(k.id===h){const v=typeof m=="function"?m(k):m;return g.replace&&DC(v)?v:{...k,...v}}return k}))},_=(h,m,g={replace:!1})=>{l(S=>S.map(k=>{if(k.id===h){const v=typeof m=="function"?m(k):m;return g.replace&&Mgt(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(h=>({...h})),getNode:h=>{var m;return(m=a(h))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=n.getState();return h.map(m=>({...m}))},getEdge:h=>n.getState().edgeLookup.get(h),setNodes:o,setEdges:l,addNodes:h=>{const m=Array.isArray(h)?h:[h];t.nodeQueue.push(g=>[...g,...m])},addEdges:h=>{const m=Array.isArray(h)?h:[h];t.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:h=[],edges:m=[],transform:g}=n.getState(),[S,k,v]=g;return{nodes:h.map(b=>({...b})),edges:m.map(b=>({...b})),viewport:{x:S,y:k,zoom:v}}},deleteElements:async({nodes:h=[],edges:m=[]})=>{const{nodes:g,edges:S,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:z,edges:N}=await smt({nodesToRemove:h,edgesToRemove:m,nodes:g,edges:S,onBeforeDelete:C}),T=N.length>0,j=z.length>0;if(T){const D=N.map(RC);v==null||v(N),w(D)}if(j){const D=z.map(RC);k==null||k(z),b(D)}return(j||T)&&(y==null||y({nodes:z,edges:N})),{deletedNodes:z,deletedEdges:N}},getIntersectingNodes:(h,m=!0,g)=>{const S=iC(h),k=S?h:c(h),v=g!==void 0;return k?(g||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!S&&(b.id===h.id||!w.internals.positionAbsolute))return!1;const y=Ld(v?b:w),C=J0(y,k);return m&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(h,m,g=!0)=>{const k=iC(h)?h:c(h);if(!k)return!1;const v=J0(k,m);return g&&v>0||v>=m.width*m.height||v>=k.width*k.height},updateNode:f,updateNodeData:(h,m,g={replace:!1})=>{f(h,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},updateEdge:_,updateEdgeData:(h,m,g={replace:!1})=>{_(h,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},getNodesBounds:h=>{const{nodeLookup:m,nodeOrigin:g}=n.getState();return emt(h,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:h,id:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}-${h}${m?`-${m}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:h,handleId:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}${h?m?`-${h}-${m}`:`-${h}`:""}`))==null?void 0:S.values())??[])},fitView:async h=>{const m=n.getState().fitViewResolver??omt();return n.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:m}),t.nodeQueue.push(g=>[...g]),m.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const OC=e=>e.selected,Bgt=typeof window<"u"?window:void 0;function $gt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Bn(),{deleteElements:r}=r4(),s=Id(e,{actInsideInputWithModifier:!1}),a=Id(n,{target:Bgt});R.useEffect(()=>{if(s){const{edges:o,nodes:l}=t.getState();r({nodes:l.filter(OC),edges:o.filter(OC)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:a})},[a])}function Hgt(e){const n=Bn();R.useEffect(()=>{const t=()=>{var s,a,o,l;if(!e.current||!(((a=(s=e.current).checkVisibility)==null?void 0:a.call(s))??!0))return!1;const r=Zy(e.current);(r.height===0||r.width===0)&&((l=(o=n.getState()).onError)==null||l.call(o,"004",Gi.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 fm={position:"absolute",width:"100%",height:"100%",top:0,left:0},Pgt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Fgt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Ql.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:_,maxZoom:h,zoomActivationKeyCode:m,preventScrolling:g=!0,children:S,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const z=Bn(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:D}=Wt(Pgt,On),I=Id(m),L=R.useRef();Hgt(N);const U=R.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),w||z.setState({transform:q})},[b,w]);return R.useEffect(()=>{if(N.current){L.current=qmt({domNode:N.current,minZoom:_,maxZoom:h,translateExtent:f,viewport:c,onDraggingChange:X=>z.setState(J=>J.paneDragging===X?J:{paneDragging:X}),onPanZoomStart:(X,J)=>{const{onViewportChangeStart:ee,onMoveStart:$}=z.getState();$==null||$(X,J),ee==null||ee(J)},onPanZoom:(X,J)=>{const{onViewportChange:ee,onMove:$}=z.getState();$==null||$(X,J),ee==null||ee(J)},onPanZoomEnd:(X,J)=>{const{onViewportChangeEnd:ee,onMoveEnd:$}=z.getState();$==null||$(X,J),ee==null||ee(J)}});const{x:q,y:W,zoom:Z}=L.current.getViewport();return z.setState({panZoom:L.current,transform:[q,W,Z],domNode:N.current.closest(".react-flow")}),()=>{var X;(X=L.current)==null||X.destroy()}}},[]),R.useEffect(()=>{var q;(q=L.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:g,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:U,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,a,o,l,I,g,v,T,k,j,U,D,C,y]),d.jsx("div",{className:"react-flow__renderer",ref:N,style:fm,children:S})}const Ugt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qgt(){const{userSelectionActive:e,userSelectionRect:n}=Wt(Ugt,On);return e&&n?d.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 Hb=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},Ggt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Vgt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=Dd.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:_,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:S,children:k}){const v=R.useRef(0),b=Bn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:z,autoPanSpeed:N}=Wt(Ggt,On),T=y&&(e||w),j=R.useRef(null),D=R.useRef(),I=R.useRef(new Set),L=R.useRef(new Set),U=R.useRef(!1),q=R.useRef(!1),W=R.useRef({x:0,y:0}),Z=R.useRef(!1),X=P=>{if(q.current||U.current||b.getState().connection.inProgress){q.current=!1,U.current=!1;return}f==null||f(P),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},J=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}_==null||_(P)},ee=h?P=>h(P):void 0,$=P=>{q.current&&(P.stopPropagation(),q.current=!1)},B=P=>{var Ie,nt;const{domNode:oe,transform:ue}=b.getState();if(D.current=oe==null?void 0:oe.getBoundingClientRect(),!D.current)return;const de=P.target===j.current;if(!de&&!!P.target.closest(".nokey")||!e||!(o&&de||n)||P.button!==0||!P.isPrimary)return;(nt=(Ie=P.target)==null?void 0:Ie.setPointerCapture)==null||nt.call(Ie,P.pointerId),q.current=!1;const{x:Ae,y:He}=Hi(P.nativeEvent,D.current),Re=uh({x:Ae,y:He},ue);b.setState({userSelectionRect:{width:0,height:0,startX:Re.x,startY:Re.y,x:Ae,y:He}}),de||(P.stopPropagation(),P.preventDefault())};function H(P,oe){const{userSelectionRect:ue}=b.getState();if(!ue)return;const{transform:de,nodeLookup:ge,edgeLookup:Ee,connectionLookup:Ae,triggerNodeChanges:He,triggerEdgeChanges:Re,defaultEdgeOptions:Ie}=b.getState(),nt={x:ue.startX,y:ue.startY},{x:Rt,y:At}=Ou(nt,de),bt={startX:nt.x,startY:nt.y,x:Pht.id)),L.current=new Set;const ut=(Ie==null?void 0:Ie.selectable)??!0;for(const ht of I.current){const we=Ae.get(ht);if(we)for(const{edgeId:Le}of we.values()){const Ge=Ee.get(Le);Ge&&(Ge.selectable??ut)&&L.current.add(Le)}}if(!aC(Mt,I.current)){const ht=uu(ge,I.current,!0);He(ht)}if(!aC(Ct,L.current)){const ht=uu(Ee,L.current);Re(ht)}b.setState({userSelectionRect:bt,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!s||!D.current)return;const[P,oe]=Xy(W.current,D.current,N);z({x:P,y:oe}).then(ue=>{if(!q.current||!ue){v.current=requestAnimationFrame(K);return}const{x:de,y:ge}=W.current;H(de,ge),v.current=requestAnimationFrame(K)})}const G=()=>{cancelAnimationFrame(v.current),v.current=0,Z.current=!1};R.useEffect(()=>()=>G(),[]);const ie=P=>{const{userSelectionRect:oe,transform:ue,resetSelectedElements:de}=b.getState();if(!D.current||!oe)return;const{x:ge,y:Ee}=Hi(P.nativeEvent,D.current);W.current={x:ge,y:Ee};const Ae=Ou({x:oe.startX,y:oe.startY},ue);if(!q.current){const He=n?0:a;if(Math.hypot(ge-Ae.x,Ee-Ae.y)<=He)return;de(),l==null||l(P)}q.current=!0,Z.current||(K(),Z.current=!0),H(ge,Ee)},ve=P=>{var oe,ue;if(!T){P.target===j.current&&b.getState().connection.inProgress&&(U.current=!0);return}P.button===0&&((ue=(oe=P.target)==null?void 0:oe.releasePointerCapture)==null||ue.call(oe,P.pointerId),!w&&P.target===j.current&&b.getState().userSelectionRect&&(X==null||X(P)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(P),b.setState({nodesSelectionActive:I.current.size>0})),G())},ce=P=>{var oe,ue;(ue=(oe=P.target)==null?void 0:oe.releasePointerCapture)==null||ue.call(oe,P.pointerId),G()},re=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:gr(["react-flow__pane",{draggable:re,dragging:C,selection:e}]),onClick:T?void 0:Hb(X,j),onContextMenu:Hb(J,j),onWheel:Hb(ee,j),onPointerEnter:T?void 0:m,onPointerMove:T?ie:g,onPointerUp:ve,onPointerCancel:T?ce:void 0,onPointerDownCapture:T?B:void 0,onClickCapture:T?$:void 0,onPointerLeave:S,ref:j,style:fm,children:[k,d.jsx(qgt,{})]})}function S2({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=n.getState(),f=l.get(e);if(!f){c==null||c("012",Gi.error012(e));return}n.setState({nodesSelectionActive:!1}),f.selected?(t||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function eM({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:a,nodeClickDistance:o}){const l=Bn(),[c,f]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=jmt({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{S2({id:h,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:s,nodeClickDistance:o}),()=>{var h;(h=_.current)==null||h.destroy()}},[t,r,n,a,e,s,o]),c}const Wgt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function tM(){const e=Bn();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:_}=e.getState(),h=new Map,m=Wgt(o),g=s?a[0]:5,S=s?a[1]:5,k=t.direction.x*g*t.factor,v=t.direction.y*S*t.factor;for(const[,b]of f){if(!m(b))continue;let w={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(w=ch(w,a));const{position:y,positionAbsolute:C}=yT({nodeId:b.id,nextPosition:w,nodeLookup:f,nodeExtent:r,nodeOrigin:_,onError:l});b.position=y,b.internals.positionAbsolute=C,h.set(b.id,b)}c(h)},[])}const s4=R.createContext(null),Kgt=s4.Provider;s4.Consumer;const nM=()=>R.useContext(s4),Xgt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rM=R.createContext(null);function Ygt({children:e}){const n=Wt(Xgt,On);return d.jsx(rM.Provider,{value:n,children:e})}function Zgt(){const e=R.useContext(rM);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Qgt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Jgt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o;if(!l&&!s)return Qgt;const _=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:a===Du.Strict?(l==null?void 0:l.type)!==t:e!==(l==null?void 0:l.nodeId)||n!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:_&&f}};function e1t({type:e="source",position:n=at.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:_,onTouchStart:h,...m},g){var Z,X;const S=o||null,k=e==="target",v=Bn(),b=nM(),{connectOnClick:w,noPanClassName:y,rfId:C}=Zgt(),{connectingFrom:z,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:D,clickConnectionInProcess:I,valid:L}=Wt(Jgt(b,S,e),On);b||(X=(Z=v.getState()).onError)==null||X.call(Z,"010",Gi.error010());const U=J=>{const{defaultEdgeOptions:ee,onConnect:$,hasDefaultEdges:B}=v.getState(),H={...ee,...J};if(B){const{edges:K,setEdges:G,onError:ie}=v.getState();G(Tgt(H,K,{onError:ie}))}$==null||$(H),l==null||l(H)},q=J=>{if(!b)return;const ee=jT(J.nativeEvent);if(s&&(ee&&J.button===0||!ee)){const $=v.getState();w2.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:k,handleId:S,nodeId:b,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...B)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...B)},updateConnection:$.updateConnection,onConnect:U,isValidConnection:t||((...B)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...B))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}ee?_==null||_(J):h==null||h(J)},W=J=>{const{onClickConnectStart:ee,onClickConnectEnd:$,connectionClickStartHandle:B,connectionMode:H,isValidConnection:K,lib:G,rfId:ie,nodeLookup:ve,connection:ce}=v.getState();if(!b||!B&&!s)return;if(!B){ee==null||ee(J.nativeEvent,{nodeId:b,handleId:S,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:S}});return}const re=zT(J.target),P=t||K,{connection:oe,isValid:ue}=w2.isValid(J.nativeEvent,{handle:{nodeId:b,id:S,type:e},connectionMode:H,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:P,flowId:ie,doc:re,lib:G,nodeLookup:ve});ue&&oe&&U(oe);const de=structuredClone(ce);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,$==null||$(J,de),v.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":S,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${S}-${e}`,className:gr(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,f,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:a,clickconnecting:T,connectingfrom:z,connectingto:N,valid:L,connectionindicator:r&&(!D||j)&&(D||I?a:s)}]),onMouseDown:q,onTouchStart:q,onClick:w?W:void 0,ref:g,...m,children:c})}const ll=R.memo(QT(e1t));function t1t({data:e,isConnectable:n,sourcePosition:t=at.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(ll,{type:"source",position:t,isConnectable:n})]})}function n1t({data:e,isConnectable:n,targetPosition:t=at.Top,sourcePosition:r=at.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(ll,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,d.jsx(ll,{type:"source",position:r,isConnectable:n})]})}function r1t(){return null}function s1t({data:e,isConnectable:n,targetPosition:t=at.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(ll,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const ep={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},IC={input:t1t,default:n1t,output:s1t,group:r1t};function i1t(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 a1t=e=>{const{width:n,height:t,x:r,y:s}=lh(e.nodeLookup,{filter:a=>!!a.selected});return{width:$i(n)?n:null,height:$i(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 o1t({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Bn(),{width:s,height:a,transformString:o,userSelectionActive:l}=Wt(a1t,On),c=tM(),f=R.useRef(null);R.useEffect(()=>{var g;t||(g=f.current)==null||g.focus({preventScroll:!0})},[t]);const _=!l&&s!==null&&a!==null;if(eM({nodeRef:f,disabled:!_}),!_)return null;const h=e?g=>{const S=r.getState().nodes.filter(k=>k.selected);e(g,S)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(ep,g.key)&&(g.preventDefault(),c({direction:ep[g.key],factor:g.shiftKey?4:1}))};return d.jsx("div",{className:gr(["react-flow__nodesselection","react-flow__container",n]),style:{transform:o},children:d.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:m,style:{width:s,height:a}})})}const BC=typeof window<"u"?window:void 0,l1t=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function sM({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:_,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:D,defaultViewport:I,translateExtent:L,minZoom:U,maxZoom:q,preventScrolling:W,onSelectionContextMenu:Z,noWheelClassName:X,noPanClassName:J,disableKeyboardA11y:ee,onViewportChange:$,isControlledViewport:B}){const{nodesSelectionActive:H,userSelectionActive:K}=Wt(l1t,On),G=Id(f,{target:BC}),ie=Id(k,{target:BC}),ve=ie||j,ce=ie||C,re=_&&ve!==!0,P=G||K||re;return $gt({deleteKeyCode:c,multiSelectionKeyCode:S}),d.jsx(Fgt,{onPaneContextMenu:a,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!G&&ve,defaultViewport:I,translateExtent:L,minZoom:U,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:W,noWheelClassName:X,noPanClassName:J,onViewportChange:$,isControlledViewport:B,paneClickDistance:l,selectionOnDrag:re,children:d.jsxs(Vgt,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ve,autoPanOnSelection:D,isSelecting:!!P,selectionMode:h,selectionKeyPressed:G,paneClickDistance:l,selectionOnDrag:re,children:[e,H&&d.jsx(o1t,{onSelectionContextMenu:Z,noPanClassName:J,disableKeyboardA11y:ee})]})})}sM.displayName="FlowRenderer";const c1t=R.memo(sM),u1t=e=>n=>e?Ky(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 f1t(e){return Wt(R.useCallback(u1t(e),[e]),On)}const d1t=e=>e.updateNodeInternals;function h1t(){const e=Wt(d1t),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const a=s.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function _1t({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Bn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),c=R.useRef(e.targetPosition),f=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!_||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[_,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const h=f.current!==n,m=l.current!==e.sourcePosition,g=c.current!==e.targetPosition;(h||m||g)&&(f.current=n,l.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),a}function p1t({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:_,resizeObserver:h,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:S,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:z}=Wt(P=>{const oe=P.nodeLookup.get(e),ue=P.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ue}},On);let N=y.type||"default",T=(v==null?void 0:v[N])||IC[N];T===void 0&&(w==null||w("003",Gi.error003(N)),N="default",T=(v==null?void 0:v.default)||IC.default);const j=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),I=!!(y.connectable||f&&typeof y.connectable>"u"),L=!!(y.focusable||_&&typeof y.focusable>"u"),U=Bn(),q=ET(y),W=_1t({node:y,nodeType:N,hasDimensions:q,resizeObserver:h}),Z=eM({nodeRef:W,disabled:y.hidden||!j,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:b}),X=tM();if(y.hidden)return null;const J=mo(y),ee=i1t(y),$=D||j||n||t||r||s,B=t?P=>t(P,{...C.userNode}):void 0,H=r?P=>r(P,{...C.userNode}):void 0,K=s?P=>s(P,{...C.userNode}):void 0,G=a?P=>a(P,{...C.userNode}):void 0,ie=o?P=>o(P,{...C.userNode}):void 0,ve=P=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ue}=U.getState();D&&(!oe||!j||ue>0)&&S2({id:e,store:U,nodeRef:W}),n&&n(P,{...C.userNode})},ce=P=>{if(!(AT(P.nativeEvent)||S)){if(mT.includes(P.key)&&D){const oe=P.key==="Escape";S2({id:e,store:U,unselect:oe,nodeRef:W})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(ep,P.key)){P.preventDefault();const{ariaLabelConfig:oe}=U.getState();U.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:P.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),X({direction:ep[P.key],factor:P.shiftKey?4:1})}}},re=()=>{var Ae;if(S||!((Ae=W.current)!=null&&Ae.matches(":focus-visible")))return;const{transform:P,width:oe,height:ue,autoPanOnNodeFocus:de,setCenter:ge}=U.getState();if(!de)return;Ky(new Map([[e,y]]),{x:0,y:0,width:oe,height:ue},P,!0).length>0||ge(y.position.x+J.width/2,y.position.y+J.height/2,{zoom:P[2]})};return d.jsx("div",{className:gr(["react-flow__node",`react-flow__node-${N}`,{[g]:j},y.className,{selected:y.selected,selectable:D,parent:z,draggable:j,dragging:Z}]),ref:W,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:q?"visible":"hidden",...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:H,onMouseLeave:K,onContextMenu:G,onClick:ve,onDoubleClick:ie,onKeyDown:L?ce:void 0,tabIndex:L?0:void 0,onFocus:L?re:void 0,role:y.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${KT}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:d.jsx(Kgt,{value:e,children:d.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:j,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Z,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...J})})})}var m1t=R.memo(p1t);const g1t=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iM(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:a}=Wt(g1t,On),o=f1t(e.onlyRenderVisibleElements),l=h1t();return d.jsx("div",{className:"react-flow__nodes",style:fm,children:o.map(c=>d.jsx(m1t,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}iM.displayName="NodeRenderer";const b1t=R.memo(iM);function v1t(e){return Wt(R.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 a=t.nodeLookup.get(s.source),o=t.nodeLookup.get(s.target);a&&o&&fmt({sourceNode:a,targetNode:o,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),On)}const x1t=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},y1t=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},$C={[Z0.Arrow]:x1t,[Z0.ArrowClosed]:y1t};function w1t(e){const n=Bn();return R.useMemo(()=>{var s,a;return Object.prototype.hasOwnProperty.call($C,e)?$C[e]:((a=(s=n.getState()).onError)==null||a.call(s,"009",Gi.error009(e)),null)},[e])}const S1t=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=w1t(n);return c?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:d.jsx(c,{color:t,strokeWidth:o})}):null},aM=({defaultColor:e,rfId:n})=>{const t=Wt(a=>a.edges),r=Wt(a=>a.defaultEdgeOptions),s=R.useMemo(()=>vmt(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?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:s.map(a=>d.jsx(S1t,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};aM.displayName="MarkerDefinitions";var k1t=R.memo(aM);function oM({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,..._}){const[h,m]=R.useState({x:1,y:0,width:0,height:0}),g=gr(["react-flow__edge-textwrapper",f]),S=R.useRef(null);return R.useEffect(()=>{if(S.current){const k=S.current.getBBox();m({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?d.jsxs("g",{transform:`translate(${e-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",..._,children:[s&&d.jsx("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),d.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:S,style:r,children:t}),c]}):null}oM.displayName="EdgeText";const C1t=R.memo(oM);function dm({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,..._}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{..._,d:e,fill:"none",className:gr(["react-flow__edge-path",_.className])}),f?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&$i(n)&&$i(t)?d.jsx(C1t,{x:n,y:t,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function HC({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===at.Left||e===at.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function lM({sourceX:e,sourceY:n,sourcePosition:t=at.Bottom,targetX:r,targetY:s,targetPosition:a=at.Top}){const[o,l]=HC({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,f]=HC({pos:a,x1:r,y1:s,x2:e,y2:n}),[_,h,m,g]=TT({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${n} C${o},${l} ${c},${f} ${r},${s}`,_,h,m,g]}function cM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[w,y,C]=lM({sourceX:t,sourceY:r,sourcePosition:o,targetX:s,targetY:a,targetPosition:l}),z=e.isInternal?void 0:n;return d.jsx(dm,{id:z,path:w,labelX:y,labelY:C,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})})}const E1t=cM({isInternal:!1}),uM=cM({isInternal:!0});E1t.displayName="SimpleBezierEdge";uM.displayName="SimpleBezierEdgeInternal";function fM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:h,style:m,sourcePosition:g=at.Bottom,targetPosition:S=at.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,z]=v2({sourceX:t,sourceY:r,sourcePosition:g,targetX:s,targetY:a,targetPosition:S,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 d.jsx(dm,{id:N,path:y,labelX:C,labelY:z,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:k,markerStart:v,interactionWidth:w})})}const dM=fM({isInternal:!1}),hM=fM({isInternal:!0});dM.displayName="SmoothStepEdge";hM.displayName="SmoothStepEdgeInternal";function _M(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return d.jsx(dM,{...t,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=t.pathOptions)==null?void 0:a.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const N1t=_M({isInternal:!1}),pM=_M({isInternal:!0});N1t.displayName="StepEdge";pM.displayName="StepEdgeInternal";function mM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:S,interactionWidth:k})=>{const[v,b,w]=DT({sourceX:t,sourceY:r,targetX:s,targetY:a}),y=e.isInternal?void 0:n;return d.jsx(dm,{id:y,path:v,labelX:b,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:S,interactionWidth:k})})}const z1t=mM({isInternal:!1}),gM=mM({isInternal:!0});z1t.displayName="StraightEdge";gM.displayName="StraightEdgeInternal";function bM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,sourcePosition:o=at.Bottom,targetPosition:l=at.Top,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,z]=MT({sourceX:t,sourceY:r,sourcePosition:o,targetX:s,targetY:a,targetPosition:l,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return d.jsx(dm,{id:N,path:y,labelX:C,labelY:z,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:w})})}const A1t=bM({isInternal:!1}),vM=bM({isInternal:!0});A1t.displayName="BezierEdge";vM.displayName="BezierEdgeInternal";const PC={default:vM,straight:gM,step:pM,smoothstep:hM,simplebezier:uM},FC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},j1t=(e,n,t)=>t===at.Left?e-n:t===at.Right?e+n:e,T1t=(e,n,t)=>t===at.Top?e-n:t===at.Bottom?e+n:e,UC="react-flow__edgeupdater";function qC({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:a,onMouseOut:o,type:l}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:o,className:gr([UC,`${UC}-${l}`]),cx:j1t(n,r,e),cy:T1t(t,r,e),r,stroke:"transparent",fill:"transparent"})}function M1t({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:_,onReconnectEnd:h,setReconnecting:m,setUpdateHover:g}){const S=Bn(),k=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:D,lib:I,onConnectStart:L,cancelConnection:U,nodeLookup:q,rfId:W,panBy:Z,updateConnection:X}=S.getState(),J=z.type==="target",ee=(H,K)=>{m(!1),h==null||h(H,t,z.type,K)},$=H=>f==null?void 0:f(t,H),B=(H,K)=>{m(!0),_==null||_(C,t,z.type),L==null||L(H,K)};w2.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:D,domNode:T,handleId:z.id,nodeId:z.nodeId,nodeLookup:q,isTarget:J,edgeUpdaterType:z.type,lib:I,flowId:W,cancelConnection:U,panBy:Z,isValidConnection:(...H)=>{var K,G;return((G=(K=S.getState()).isValidConnection)==null?void 0:G.call(K,...H))??!0},onConnect:$,onConnectStart:B,onConnectEnd:(...H)=>{var K,G;return(G=(K=S.getState()).onConnectEnd)==null?void 0:G.call(K,...H)},onReconnectEnd:ee,updateConnection:X,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.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=()=>g(!0),y=()=>g(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(qC,{position:l,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&d.jsx(qC,{position:c,centerX:a,centerY:o,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function R1t({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:_,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,rfId:S,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=Wt(ge=>ge.edgeLookup.get(e));const C=Wt(ge=>ge.defaultEdgeOptions);y=C?{...C,...y}:y;let z=y.type||"default",N=(k==null?void 0:k[z])||PC[z];N===void 0&&(b==null||b("011",Gi.error011(z)),z="default",N=(k==null?void 0:k.default)||PC.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof h<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),I=R.useRef(null),[L,U]=R.useState(!1),[q,W]=R.useState(!1),Z=Bn(),{zIndex:X=y.zIndex,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K}=Wt(R.useCallback(ge=>{const Ee=ge.nodeLookup.get(y.source),Ae=ge.nodeLookup.get(y.target);if(!Ee||!Ae)return FC;const He=bmt({id:e,sourceNode:Ee,targetNode:Ae,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ge.connectionMode,onError:b}),Re=umt({selected:y.selected,zIndex:y.zIndex,sourceNode:Ee,targetNode:Ae,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode});return{...He||FC,zIndex:Re}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),On),G=R.useMemo(()=>y.markerStart?`url('#${x2(y.markerStart,S)}')`:void 0,[y.markerStart,S]),ie=R.useMemo(()=>y.markerEnd?`url('#${x2(y.markerEnd,S)}')`:void 0,[y.markerEnd,S]);if(y.hidden||J===null||ee===null||$===null||B===null)return null;const ve=ge=>{var Re;const{addSelectedEdges:Ee,unselectNodesAndEdges:Ae,multiSelectionActive:He}=Z.getState();D&&(Z.setState({nodesSelectionActive:!1}),y.selected&&He?(Ae({nodes:[],edges:[y]}),(Re=I.current)==null||Re.blur()):Ee([e])),s&&s(ge,y)},ce=a?ge=>{a(ge,{...y})}:void 0,re=o?ge=>{o(ge,{...y})}:void 0,P=l?ge=>{l(ge,{...y})}:void 0,oe=c?ge=>{c(ge,{...y})}:void 0,ue=f?ge=>{f(ge,{...y})}:void 0,de=ge=>{var Ee;if(!w&&mT.includes(ge.key)&&D){const{unselectNodesAndEdges:Ae,addSelectedEdges:He}=Z.getState();ge.key==="Escape"?((Ee=I.current)==null||Ee.blur(),Ae({edges:[y]})):He([e])}};return d.jsx("svg",{style:{zIndex:X},children:d.jsxs("g",{className:gr(["react-flow__edge",`react-flow__edge-${z}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!D&&!s,updating:L,selectable:D}]),onClick:ve,onDoubleClick:ce,onContextMenu:re,onMouseEnter:P,onMouseMove:oe,onMouseLeave:ue,onKeyDown:T?de: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?`${XT}-${S}`:void 0,ref:I,...y.domAttributes,children:[!q&&d.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:G,markerEnd:ie,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&d.jsx(M1t,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K,setUpdateHover:U,setReconnecting:W})]})})}var D1t=R.memo(R1t);const L1t=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xM({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:_,reconnectRadius:h,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=Wt(L1t,On),C=v1t(n);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(k1t,{defaultColor:e,rfId:t}),C.map(z=>d.jsx(D1t,{id:z,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:_,reconnectRadius:h,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},z))]})}xM.displayName="EdgeRenderer";const O1t=R.memo(xM),I1t=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function B1t({children:e}){const n=Wt(I1t);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function $1t(e){const n=r4(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const H1t=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function P1t(e){const n=Wt(H1t),t=Bn();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function F1t(e){return e.connection.inProgress?{...e.connection,to:uh(e.connection.to,e.transform)}:{...e.connection}}function U1t(e){return F1t}function q1t(e){const n=U1t();return Wt(n,On)}const G1t=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function V1t({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:a,height:o,isValid:l,inProgress:c}=Wt(G1t,On);return!(a&&s&&c)?null:d.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:gr(["react-flow__connection",vT(l)]),children:d.jsx(yM,{style:n,type:t,CustomComponent:r,isValid:l})})})}const yM=({style:e,type:n=Qo.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:_,toHandle:h,toPosition:m,pointer:g}=q1t();if(!s)return;if(t)return d.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:m,connectionStatus:vT(r),toNode:_,toHandle:h,pointer:g});let S="";const k={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:m};switch(n){case Qo.Bezier:[S]=MT(k);break;case Qo.SimpleBezier:[S]=lM(k);break;case Qo.Step:[S]=v2({...k,borderRadius:0});break;case Qo.SmoothStep:[S]=v2(k);break;default:[S]=DT(k)}return d.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};yM.displayName="ConnectionLine";const W1t={};function GC(e=W1t){R.useRef(e),Bn(),R.useEffect(()=>{},[e])}function K1t(){Bn(),R.useRef(!1),R.useEffect(()=>{},[])}function wM({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:_,onSelectionContextMenu:h,onSelectionStart:m,onSelectionEnd:g,connectionLineType:S,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:L,translateExtent:U,minZoom:q,maxZoom:W,preventScrolling:Z,defaultMarkerColor:X,zoomOnScroll:J,zoomOnPinch:ee,panOnScroll:$,panOnScrollSpeed:B,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:G,autoPanOnSelection:ie,onPaneClick:ve,onPaneMouseEnter:ce,onPaneMouseMove:re,onPaneMouseLeave:P,onPaneScroll:oe,onPaneContextMenu:ue,paneClickDistance:de,nodeClickDistance:ge,onEdgeContextMenu:Ee,onEdgeMouseEnter:Ae,onEdgeMouseMove:He,onEdgeMouseLeave:Re,reconnectRadius:Ie,onReconnect:nt,onReconnectStart:Rt,onReconnectEnd:At,noDragClassName:bt,noWheelClassName:Mt,noPanClassName:Ct,disableKeyboardA11y:ut,nodeExtent:ht,rfId:we,viewport:Le,onViewportChange:Ge}){return GC(e),GC(n),K1t(),$1t(t),P1t(Le),d.jsx(c1t,{onPaneClick:ve,onPaneMouseEnter:ce,onPaneMouseMove:re,onPaneMouseLeave:P,onPaneContextMenu:ue,onPaneScroll:oe,paneClickDistance:de,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:J,zoomOnPinch:ee,zoomOnDoubleClick:K,panOnScroll:$,panOnScrollSpeed:B,panOnScrollMode:H,panOnDrag:G,autoPanOnSelection:ie,defaultViewport:L,translateExtent:U,minZoom:q,maxZoom:W,onSelectionContextMenu:h,preventScrolling:Z,noDragClassName:bt,noWheelClassName:Mt,noPanClassName:Ct,disableKeyboardA11y:ut,onViewportChange:Ge,isControlledViewport:!!Le,children:d.jsxs(B1t,{children:[d.jsx(O1t,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:nt,onReconnectStart:Rt,onReconnectEnd:At,onlyRenderVisibleElements:D,onEdgeContextMenu:Ee,onEdgeMouseEnter:Ae,onEdgeMouseMove:He,onEdgeMouseLeave:Re,reconnectRadius:Ie,defaultMarkerColor:X,noPanClassName:Ct,disableKeyboardA11y:ut,rfId:we}),d.jsx(V1t,{style:k,type:S,component:v,containerStyle:b}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(b1t,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:_,nodeClickDistance:ge,onlyRenderVisibleElements:D,noPanClassName:Ct,noDragClassName:bt,disableKeyboardA11y:ut,nodeExtent:ht,rfId:we}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}wM.displayName="GraphView";const X1t=R.memo(wM),Y1t=CT(),VC=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:_,nodeExtent:h,zIndexMode:m="basic"}={})=>{const g=new Map,S=new Map,k=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=h??Rd;IT(k,v,b);const{nodesInitialized:z}=y2(w,g,S,{nodeOrigin:y,nodeExtent:C,zIndexMode:m});let N=[0,0,1];if(o&&s&&a){const T=lh(g,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:j,y:D,zoom:I}=Yy(T,s,a,c,f,(l==null?void 0:l.padding)??.1);N=[j,D,I]}return{rfId:"1",width:s??0,height:a??0,transform:N,nodes:w,nodesInitialized:z,nodeLookup:g,parentLookup:S,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:Rd,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Du.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...bT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Y1t,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:gT,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Z1t=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:_,nodeExtent:h,zIndexMode:m})=>ogt((g,S)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:z,minZoom:N,maxZoom:T}=S();b&&(await rmt({nodes:v,width:C,height:z,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),g({fitViewResolver:null}))}return{...VC({nodes:e,edges:n,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:_,nodeExtent:h,defaultNodes:t,defaultEdges:r,zIndexMode:m}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:N,nodesSelectionActive:T}=S(),{nodesInitialized:j,hasSelectedNodes:D}=y2(v,b,w,{nodeOrigin:y,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),I=T&&D;z&&j?(k(),g({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):g({nodes:v,nodesInitialized:j,nodesSelectionActive:I})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=S();IT(b,w,v),g({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=S();w(v),g({hasDefaultNodes:!0})}if(b){const{setEdges:w}=S();w(b),g({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:z,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:D}=S(),{changes:I,updatedInternals:L}=Emt(v,w,y,C,z,N,D);L&&(wmt(w,y,{nodeOrigin:z,nodeExtent:N,zIndexMode:D}),j?(k(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),b==null||b(I)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:z,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=S();for(const[D,I]of v){const L=C.get(D),U=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(I!=null&&I.position)),q={id:D,type:"position",position:U?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:b};if(L&&N.inProgress&&N.fromNode.id===L.id){const W=ic(L,N.fromHandle,at.Left,!0);T({...N,from:W})}U&&L.parentId&&w.push({id:D,parentId:L.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(q)}if(w.length>0){const{parentLookup:D,nodeOrigin:I}=S(),L=n4(w,C,D,I);y.push(...L)}for(const D of j.values())y=D(y);z(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:z}=S();if(v!=null&&v.length){if(C){const N=zgt(v,y);w(N)}z&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:z}=S();if(v!=null&&v.length){if(C){const N=Agt(v,y);w(N)}z&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=S();if(b){const N=v.map(T=>Pl(T,!0));C(N);return}C(uu(y,new Set([...v]),!0)),z(uu(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=S();if(b){const N=v.map(T=>Pl(T,!0));z(N);return}z(uu(w,new Set([...v]))),C(uu(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:N}=S(),T=v||y,j=b||w,D=[];for(const L of T){if(!L.selected)continue;const U=C.get(L.id);U&&(U.selected=!1),D.push(Pl(L.id,!1))}const I=[];for(const L of j)L.selected&&I.push(Pl(L.id,!1));z(D),N(I)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=S();b==null||b.setScaleExtent([v,w]),g({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=S();b==null||b.setScaleExtent([w,v]),g({maxZoom:v})},setTranslateExtent:v=>{var b;(b=S().panZoom)==null||b.setTranslateExtent(v),g({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=S();if(!C)return;const z=b.reduce((T,j)=>j.selected?[...T,Pl(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,Pl(j.id,!1)]:T,[]);w(z),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:N,zIndexMode:T}=S();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(y2(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:T}),g({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:z}=S();return Nmt({delta:v,panZoom:C,transform:b,translateExtent:z,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:z,panZoom:N}=S();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:z;return await N.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:()=>{g({connection:{...bT}})},updateConnection:v=>{g({connection:v})},reset:()=>g({...VC()})}},Object.is);function Q1t({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:_,nodeExtent:h,zIndexMode:m,children:g}){const[S]=R.useState(()=>Z1t({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:_,nodeExtent:h,zIndexMode:m}));return d.jsx(lgt,{value:S,children:d.jsx(Lgt,{children:d.jsx(Ygt,{children:g})})})}function J1t({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:_,nodeOrigin:h,nodeExtent:m,zIndexMode:g}){return R.useContext(cm)?d.jsx(d.Fragment,{children:e}):d.jsx(Q1t,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:_,nodeOrigin:h,nodeExtent:m,zIndexMode:g,children:e})}const ebt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tbt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:_,onMoveStart:h,onMoveEnd:m,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:L,onDelete:U,onSelectionChange:q,onSelectionDragStart:W,onSelectionDrag:Z,onSelectionDragStop:X,onSelectionContextMenu:J,onSelectionStart:ee,onSelectionEnd:$,onBeforeDelete:B,connectionMode:H,connectionLineType:K=Qo.Bezier,connectionLineStyle:G,connectionLineComponent:ie,connectionLineContainerStyle:ve,deleteKeyCode:ce="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:P=!1,selectionMode:oe=Dd.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:de=Od()?"Meta":"Control",zoomActivationKeyCode:ge=Od()?"Meta":"Control",snapToGrid:Ee,snapGrid:Ae,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Re,nodesDraggable:Ie,autoPanOnNodeFocus:nt,nodesConnectable:Rt,nodesFocusable:At,nodeOrigin:bt=YT,edgesFocusable:Mt,edgesReconnectable:Ct,elementsSelectable:ut=!0,defaultViewport:ht=ygt,minZoom:we=.5,maxZoom:Le=2,translateExtent:Ge=Rd,preventScrolling:et=!0,nodeExtent:st,defaultMarkerColor:Dt="#b1b1b7",zoomOnScroll:vt=!0,zoomOnPinch:It=!0,panOnScroll:Zt=!1,panOnScrollSpeed:cn=.5,panOnScrollMode:xt=Ql.Free,zoomOnDoubleClick:Sn=!0,panOnDrag:un=!0,onPaneClick:Xe,onPaneMouseEnter:lt,onPaneMouseMove:gn,onPaneMouseLeave:Cr,onPaneScroll:Be,onPaneContextMenu:Qe,paneClickDistance:St=1,nodeClickDistance:fn=0,children:nn,onReconnect:Ns,onReconnectStart:cs,onReconnectEnd:us,onEdgeContextMenu:zs,onEdgeDoubleClick:Wi,onEdgeMouseEnter:ei,onEdgeMouseMove:ti,onEdgeMouseLeave:jr,reconnectRadius:Pr=10,onNodesChange:Tr,onEdgesChange:En,noDragClassName:sn="nodrag",noWheelClassName:kn="nowheel",noPanClassName:pt="nopan",fitView:Yn,fitViewOptions:Fr,connectOnClick:Ke,attributionPosition:ft,proOptions:Mn,defaultEdgeOptions:dn,elevateNodesOnSelect:rr=!0,elevateEdgesOnSelect:As=!1,disableKeyboardA11y:js=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Cn,autoPanOnSelection:ni=!0,autoPanSpeed:qt,connectionRadius:fs,isValidConnection:Zn,onError:br,style:ds,id:Ki,nodeDragThreshold:Ci,connectionDragThreshold:ri,viewport:si,onViewportChange:Er,width:vr,height:Ts,colorMode:xr="light",debug:ii,onScroll:Ms,ariaLabelConfig:Nn,zIndexMode:Gn="basic",...sr},Xi){const Nr=Ki||"1",Ei=Cgt(xr),ai=R.useCallback(Rr=>{Rr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ms==null||Ms(Rr)},[Ms]);return d.jsx("div",{"data-testid":"rf__wrapper",...sr,onScroll:ai,style:{...ds,...ebt},ref:Xi,className:gr(["react-flow",s,Ei]),id:Ki,role:"application",children:d.jsxs(J1t,{nodes:e,edges:n,width:vr,height:Ts,fitView:Yn,fitViewOptions:Fr,minZoom:we,maxZoom:Le,nodeOrigin:bt,nodeExtent:st,zIndexMode:Gn,children:[d.jsx(kgt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Ie,autoPanOnNodeFocus:nt,nodesConnectable:Rt,nodesFocusable:At,edgesFocusable:Mt,edgesReconnectable:Ct,elementsSelectable:ut,elevateNodesOnSelect:rr,elevateEdgesOnSelect:As,minZoom:we,maxZoom:Le,nodeExtent:st,onNodesChange:Tr,onEdgesChange:En,snapToGrid:Ee,snapGrid:Ae,connectionMode:H,translateExtent:Ge,connectOnClick:Ke,defaultEdgeOptions:dn,fitView:Yn,fitViewOptions:Fr,onNodesDelete:I,onEdgesDelete:L,onDelete:U,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:D,onSelectionDrag:Z,onSelectionDragStart:W,onSelectionDragStop:X,onMove:_,onMoveStart:h,onMoveEnd:m,noPanClassName:pt,nodeOrigin:bt,rfId:Nr,autoPanOnConnect:Mr,autoPanOnNodeDrag:Cn,autoPanSpeed:qt,onError:br,connectionRadius:fs,isValidConnection:Zn,selectNodesOnDrag:Re,nodeDragThreshold:Ci,connectionDragThreshold:ri,onBeforeDelete:B,debug:ii,ariaLabelConfig:Nn,zIndexMode:Gn}),d.jsx(X1t,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:o,connectionLineType:K,connectionLineStyle:G,connectionLineComponent:ie,connectionLineContainerStyle:ve,selectionKeyCode:re,selectionOnDrag:P,selectionMode:oe,deleteKeyCode:ce,multiSelectionKeyCode:de,panActivationKeyCode:ue,zoomActivationKeyCode:ge,onlyRenderVisibleElements:He,defaultViewport:ht,translateExtent:Ge,minZoom:we,maxZoom:Le,preventScrolling:et,zoomOnScroll:vt,zoomOnPinch:It,zoomOnDoubleClick:Sn,panOnScroll:Zt,panOnScrollSpeed:cn,panOnScrollMode:xt,panOnDrag:un,autoPanOnSelection:ni,onPaneClick:Xe,onPaneMouseEnter:lt,onPaneMouseMove:gn,onPaneMouseLeave:Cr,onPaneScroll:Be,onPaneContextMenu:Qe,paneClickDistance:St,nodeClickDistance:fn,onSelectionContextMenu:J,onSelectionStart:ee,onSelectionEnd:$,onReconnect:Ns,onReconnectStart:cs,onReconnectEnd:us,onEdgeContextMenu:zs,onEdgeDoubleClick:Wi,onEdgeMouseEnter:ei,onEdgeMouseMove:ti,onEdgeMouseLeave:jr,reconnectRadius:Pr,defaultMarkerColor:Dt,noDragClassName:sn,noWheelClassName:kn,noPanClassName:pt,rfId:Nr,disableKeyboardA11y:js,nodeExtent:st,viewport:si,onViewportChange:Er}),d.jsx(xgt,{onSelectionChange:q}),nn,d.jsx(pgt,{proOptions:Mn,position:ft}),d.jsx(_gt,{rfId:Nr,disableKeyboardA11y:js})]})})}var nbt=QT(tbt);function rbt({dimensions:e,lineWidth:n,variant:t,className:r}){return d.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gr(["react-flow__background-pattern",t,r])})}function sbt({radius:e,className:n}){return d.jsx("circle",{cx:e,cy:e,r:e,className:gr(["react-flow__background-pattern","dots",n])})}var ro;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ro||(ro={}));const ibt={[ro.Dots]:1,[ro.Lines]:1,[ro.Cross]:6},abt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function SM({id:e,variant:n=ro.Dots,gap:t=20,size:r,lineWidth:s=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:_}){const h=R.useRef(null),{transform:m,patternId:g}=Wt(abt,On),S=r||ibt[n],k=n===ro.Dots,v=n===ro.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*m[2]||1,b[1]*m[2]||1],y=S*m[2],C=Array.isArray(a)?a:[a,a],z=v?[y,y]:w,N=[C[0]*m[2]||1+z[0]/2,C[1]*m[2]||1+z[1]/2],T=`${g}${e||""}`;return d.jsxs("svg",{className:gr(["react-flow__background",f]),style:{...c,...fm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:h,"data-testid":"rf__background",children:[d.jsx("pattern",{id:T,x:m[0]%w[0],y:m[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:k?d.jsx(sbt,{radius:y/2,className:_}):d.jsx(rbt,{dimensions:z,lineWidth:s,variant:n,className:_})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}SM.displayName="Background";const obt=R.memo(SM);function lbt(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cbt(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function ubt(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 fbt(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 dbt(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 X_({children:e,className:n,...t}){return d.jsx("button",{type:"button",className:gr(["react-flow__controls-button",n]),...t,children:e})}const hbt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function kM({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:_,position:h="bottom-left",orientation:m="vertical","aria-label":g}){const S=Bn(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=Wt(hbt,On),{zoomIn:y,zoomOut:C,fitView:z}=r4(),N=()=>{y(),a==null||a()},T=()=>{C(),o==null||o()},j=()=>{z(s),l==null||l()},D=()=>{S.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},I=m==="horizontal"?"horizontal":"vertical";return d.jsxs(um,{className:gr(["react-flow__controls",I,f]),position:h,style:e,"data-testid":"rf__controls","aria-label":g??w["controls.ariaLabel"],children:[n&&d.jsxs(d.Fragment,{children:[d.jsx(X_,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:d.jsx(lbt,{})}),d.jsx(X_,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:d.jsx(cbt,{})})]}),t&&d.jsx(X_,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:d.jsx(ubt,{})}),r&&d.jsx(X_,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:k?d.jsx(dbt,{}):d.jsx(fbt,{})}),_]})}kM.displayName="Controls";R.memo(kM);function _bt({id:e,x:n,y:t,width:r,height:s,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:_,shapeRendering:h,selected:m,onClick:g}){const{background:S,backgroundColor:k}=a||{},v=o||S||k;return d.jsx("rect",{className:gr(["react-flow__minimap-node",{selected:m},f]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:h,onClick:g?b=>g(b,e):void 0})}const pbt=R.memo(_bt),mbt=e=>e.nodes.map(n=>n.id),Pb=e=>e instanceof Function?e:()=>e;function gbt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:a=pbt,onClick:o}){const l=Wt(mbt,On),c=Pb(n),f=Pb(e),_=Pb(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:l.map(m=>d.jsx(vbt,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:a,onClick:o,shapeRendering:h},m))})}function bbt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:_,y:h,width:m,height:g}=Wt(S=>{const k=S.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}=mo(v);return{node:v,x:b,y:w,width:y,height:C}},On);return!f||f.hidden||!ET(f)?null:d.jsx(l,{x:_,y:h,width:m,height:g,style:f.style,selected:!!f.selected,className:r(f),color:n(f),borderRadius:s,strokeColor:t(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const vbt=R.memo(bbt);var xbt=R.memo(gbt);const ybt=200,wbt=150,Sbt=e=>!e.hidden,kbt=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?ST(lh(e.nodeLookup,{filter:Sbt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Cbt="react-flow__minimap-desc";function CM({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:_,maskStrokeWidth:h,position:m="bottom-right",onClick:g,onNodeClick:S,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const z=Bn(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:D,panZoom:I,translateExtent:L,flowWidth:U,flowHeight:q,ariaLabelConfig:W}=Wt(kbt,On),Z=(e==null?void 0:e.width)??ybt,X=(e==null?void 0:e.height)??wbt,J=T.width/Z,ee=T.height/X,$=Math.max(J,ee),B=$*Z,H=$*X,K=C*$,G=T.x-(B-T.width)/2-K,ie=T.y-(H-T.height)/2-K,ve=B+K*2,ce=H+K*2,re=`${Cbt}-${D}`,P=R.useRef(0),oe=R.useRef();P.current=$,R.useEffect(()=>{if(N.current&&I)return oe.current=Omt({domNode:N.current,panZoom:I,getTransform:()=>z.getState().transform,getViewScale:()=>P.current}),()=>{var Ee;(Ee=oe.current)==null||Ee.destroy()}},[I]),R.useEffect(()=>{var Ee;(Ee=oe.current)==null||Ee.update({translateExtent:L,width:U,height:q,inversePan:w,pannable:k,zoomStep:y,zoomable:v})},[k,v,w,y,L,U,q]);const ue=g?Ee=>{var Re;const[Ae,He]=((Re=oe.current)==null?void 0:Re.pointer(Ee))||[0,0];g(Ee,{x:Ae,y:He})}:void 0,de=S?R.useCallback((Ee,Ae)=>{const He=z.getState().nodeLookup.get(Ae).internals.userNode;S(Ee,He)},[]):void 0,ge=b??W["minimap.ariaLabel"];return d.jsx(um,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*$: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 o=="number"?o:void 0},className:gr(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:Z,height:X,viewBox:`${G} ${ie} ${ve} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:N,onClick:ue,children:[ge&&d.jsx("title",{id:re,children:ge}),d.jsx(xbt,{onClick:de,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:a,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:l}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-K},${ie-K}h${ve+K*2}v${ce+K*2}h${-ve-K*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CM.displayName="MiniMap";R.memo(CM);const Ebt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,Nbt={[Iu.Line]:"right",[Iu.Handle]:"bottom-right"};function zbt({nodeId:e,position:n,variant:t=Iu.Handle,className:r,style:s=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:m,autoScale:g=!0,shouldResize:S,onResizeStart:k,onResize:v,onResizeEnd:b}){const w=nM(),y=typeof e=="string"?e:w,C=Bn(),z=R.useRef(null),N=t===Iu.Handle,T=Wt(R.useCallback(Ebt(N&&g),[N,g]),On),j=R.useRef(null),D=n??Nbt[t];R.useEffect(()=>{if(!(!z.current||!y))return j.current||(j.current=Xmt({domNode:z.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:L,transform:U,snapGrid:q,snapToGrid:W,nodeOrigin:Z,domNode:X}=C.getState();return{nodeLookup:L,transform:U,snapGrid:q,snapToGrid:W,nodeOrigin:Z,paneDomNode:X}},onChange:(L,U)=>{const{triggerNodeChanges:q,nodeLookup:W,parentLookup:Z,nodeOrigin:X}=C.getState(),J=[],ee={x:L.x,y:L.y},$=W.get(y);if($&&$.expandParent&&$.parentId){const B=$.origin??X,H=L.width??$.measured.width??0,K=L.height??$.measured.height??0,G={id:$.id,parentId:$.parentId,rect:{width:H,height:K,...NT({x:L.x??$.position.x,y:L.y??$.position.y},{width:H,height:K},$.parentId,W,B)}},ie=n4([G],W,Z,X);J.push(...ie),ee.x=L.x?Math.max(B[0]*H,L.x):void 0,ee.y=L.y?Math.max(B[1]*K,L.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const B={id:y,type:"position",position:{...ee}};J.push(B)}if(L.width!==void 0&&L.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};J.push(H)}for(const B of U){const H={...B,type:"position"};J.push(H)}q(J)},onEnd:({width:L,height:U})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:L,height:U}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:_},keepAspectRatio:h,resizeDirection:m,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:S}),()=>{var L;(L=j.current)==null||L.destroy()}},[D,l,c,f,_,h,k,v,b,S]);const I=D.split("-");return d.jsx("div",{className:gr(["react-flow__resize-control","nodrag",...I,t,r]),ref:z,style:{...s,scale:T,...o&&{[N?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(zbt);function Abt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){n(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),c=new MutationObserver(o);return l.observe(a),c.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const Y_=8;function jbt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let l=0,c=0,f=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":l=e.x-t-_,c=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+_,c=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-t/2,c=e.y+e.height+_;break;case"above":l=e.x+e.width/2-t/2,c=e.y-r-_;break}const h=l,m=c;l=Math.min(Math.max(l,Y_),a-t-Y_),c=Math.min(Math.max(c,Y_),s-r-Y_),f=e.anchor==="left"||e.anchor==="right"?m-c:h-l}return{x:l,y:c,arrowAdjustment:f}}const Fb=380,Ub=12,Tbt=350,Mbt=150,k2=new EventTarget;function Rbt(){k2.dispatchEvent(new Event("move"))}function Dbt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const f=()=>{window.clearTimeout(s.current),window.clearTimeout(a.current),r(null)};return k2.addEventListener("move",f),()=>{k2.removeEventListener("move",f),window.clearTimeout(s.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(f=>{var h;if(!f)return f;const _=((h=e.current)==null?void 0:h.getBoundingClientRect())??null;return _&&f.x===_.x&&f.y===_.y&&f.width===_.width&&f.height===_.height?f:_})},[e,n]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var f;r(((f=e.current)==null?void 0:f.getBoundingClientRect())??null)},Tbt)},[e]),l=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Mbt)},[]),c=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:t,onMouseEnter:o,onMouseLeave:l,keepOpen:c}}function Lbt(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 Obt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:c}){const f=Abt(),_=s.right+Ub+Fb<=window.innerWidth,h=s.x-Ub-Fb>=0,m=_?"right":h?"left":s.y>window.innerHeight/2?"above":"below",{x:g,y:S}=jbt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:m,distance:Ub},f),[k,v]=R.useState(null),b=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null;R.useEffect(()=>{if(v(null),!b)return;let L=!1;return RWe(b).then(U=>{let q=U.diff;if(U.truncated){const J=q.lastIndexOf(` +`)),_=f.reduce((d,m)=>d.concat(...m),[]);return[f,_]}return[[],[]]},[e]);return R.useEffect(()=>{const c=(n==null?void 0:n.target)??MC,f=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=g=>{var v,b;if(s.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!s.current||s.current&&!f)&&MT(g))return!1;const k=DC(g.code,l);if(a.current.add(g[k]),RC(o,a.current,!1)){const w=((b=(v=g.composedPath)==null?void 0:v.call(g))==null?void 0:b[0])||g.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&g.preventDefault(),r(!0)}},d=g=>{const S=DC(g.code,l);RC(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(g[S]),g.key==="Meta"&&a.current.clear(),s.current=!1},m=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",_),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",_),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),t}function RC(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DC(e,n){return n.includes(e)?"code":"key"}const l1t=()=>{const e=Fn();return R.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,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??a},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:a,maxZoom:o,panZoom:l}=e.getState(),c=Qy(n,r,s,a,o,(t==null?void 0:t.padding)??.1);return l?(await l.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:a,domNode:o}=e.getState();if(!o)return n;const{x:l,y:c}=o.getBoundingClientRect(),f={x:n.x-l,y:n.y-c},_=t.snapGrid??s,d=t.snapToGrid??a;return ud(f,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:a}=r.getBoundingClientRect(),o=Ou(n,t);return{x:o.x+s,y:o.y+a}}}),[])};function eM(e,n){const t=[],r=new Map,s=[];for(const a of e)if(a.type==="add"){s.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of n){const o=r.get(a.id);if(!o){t.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){t.push({...o[0].item});continue}const l={...a};for(const c of o)c1t(c,l);t.push(l)}return s.length&&s.forEach(a=>{a.index!==void 0?t.splice(a.index,0,{...a.item}):t.push({...a.item})}),t}function c1t(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 u1t(e,n){return eM(e,n)}function f1t(e,n){return eM(e,n)}function Fl(e,n){return{id:e,type:"select",selected:n}}function uu(e,n=new Set,t=!1){const r=[];for(const[s,a]of e){const o=n.has(s);!(a.selected===void 0&&!o)&&a.selected!==o&&(t&&(a.selected=o),r.push(Fl(a.id,o)))}return r}function LC({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=n.get(o.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;c!==void 0&&c!==o&&t.push({id:o.id,item:o,type:"replace"}),c===void 0&&t.push({item:o,type:"add",index:a})}for(const[a]of n)r.get(a)===void 0&&t.push({id:a,type:"remove"});return t}function OC(e){return{id:e.id,type:"remove"}}const h1t=zT();function d1t(e,n,t={}){return Ymt(e,n,{...t,onError:t.onError??h1t})}const IC=e=>Lmt(e),_1t=e=>ST(e);function tM(e){return R.forwardRef(e)}const p1t=typeof window<"u"?R.useLayoutEffect:R.useEffect;function BC(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>m1t(()=>t(s=>s+BigInt(1))));return p1t(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function m1t(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const nM=R.createContext(null);function g1t({children:e}){const n=Fn(),t=R.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:_,onNodesChange:d,nodeLookup:m,fitViewQueued:g,onNodesChangeMiddlewareMap:S}=n.getState();let k=c;for(const b of l)k=typeof b=="function"?b(k):b;let v=LC({items:k,lookup:m});for(const b of S.values())v=b(v);_&&f(k),v.length>0?d==null||d(v):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=BC(t),s=R.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:m}=n.getState();let g=c;for(const S of l)g=typeof S=="function"?S(g):S;_?f(g):d&&d(LC({items:g,lookup:m}))},[]),a=BC(s),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(nM.Provider,{value:o,children:e})}function b1t(){const e=R.useContext(nM);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const v1t=e=>!!e.panZoom;function i4(){const e=l1t(),n=Fn(),t=b1t(),r=Kt(v1t),s=R.useMemo(()=>{const a=d=>n.getState().nodeLookup.get(d),o=d=>{t.nodeQueue.push(d)},l=d=>{t.edgeQueue.push(d)},c=d=>{var b,w;const{nodeLookup:m,nodeOrigin:g}=n.getState(),S=IC(d)?d:m.get(d.id),k=S.parentId?jT(S.position,S.measured,S.parentId,m,g):S.position,v={...S,position:k,width:((b=S.measured)==null?void 0:b.width)??S.width,height:((w=S.measured)==null?void 0:w.height)??S.height};return Lh(v)},f=(d,m,g={replace:!1})=>{o(S=>S.map(k=>{if(k.id===d){const v=typeof m=="function"?m(k):m;return g.replace&&IC(v)?v:{...k,...v}}return k}))},_=(d,m,g={replace:!1})=>{l(S=>S.map(k=>{if(k.id===d){const v=typeof m=="function"?m(k):m;return g.replace&&_1t(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var m;return(m=a(d))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(m=>({...m}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const m=Array.isArray(d)?d:[d];t.nodeQueue.push(g=>[...g,...m])},addEdges:d=>{const m=Array.isArray(d)?d:[d];t.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:d=[],edges:m=[],transform:g}=n.getState(),[S,k,v]=g;return{nodes:d.map(b=>({...b})),edges:m.map(b=>({...b})),viewport:{x:S,y:k,zoom:v}}},deleteElements:async({nodes:d=[],edges:m=[]})=>{const{nodes:g,edges:S,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:z,edges:N}=await Hmt({nodesToRemove:d,edgesToRemove:m,nodes:g,edges:S,onBeforeDelete:C}),T=N.length>0,j=z.length>0;if(T){const D=N.map(OC);v==null||v(N),w(D)}if(j){const D=z.map(OC);k==null||k(z),b(D)}return(j||T)&&(y==null||y({nodes:z,edges:N})),{deletedNodes:z,deletedEdges:N}},getIntersectingNodes:(d,m=!0,g)=>{const S=lC(d),k=S?d:c(d),v=g!==void 0;return k?(g||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!S&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=Lh(v?b:w),C=ep(y,k);return m&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(d,m,g=!0)=>{const k=lC(d)?d:c(d);if(!k)return!1;const v=ep(k,m);return g&&v>0||v>=m.width*m.height||v>=k.width*k.height},updateNode:f,updateNodeData:(d,m,g={replace:!1})=>{f(d,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},updateEdge:_,updateEdgeData:(d,m,g={replace:!1})=>{_(d,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},getNodesBounds:d=>{const{nodeLookup:m,nodeOrigin:g}=n.getState();return Omt(d,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:d,id:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}-${d}${m?`-${m}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:d,handleId:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}${d?m?`-${d}-${m}`:`-${d}`:""}`))==null?void 0:S.values())??[])},fitView:async d=>{const m=n.getState().fitViewResolver??Umt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:m}),t.nodeQueue.push(g=>[...g]),m.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const $C=e=>e.selected,x1t=typeof window<"u"?window:void 0;function y1t({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Fn(),{deleteElements:r}=i4(),s=Ih(e,{actInsideInputWithModifier:!1}),a=Ih(n,{target:x1t});R.useEffect(()=>{if(s){const{edges:o,nodes:l}=t.getState();r({nodes:l.filter($C),edges:o.filter($C)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:a})},[a])}function w1t(e){const n=Fn();R.useEffect(()=>{const t=()=>{var s,a,o,l;if(!e.current||!(((a=(s=e.current).checkVisibility)==null?void 0:a.call(s))??!0))return!1;const r=Jy(e.current);(r.height===0||r.width===0)&&((l=(o=n.getState()).onError)==null||l.call(o,"004",Vi.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 hm={position:"absolute",width:"100%",height:"100%",top:0,left:0},S1t=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function k1t({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Ql.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:_,maxZoom:d,zoomActivationKeyCode:m,preventScrolling:g=!0,children:S,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const z=Fn(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:D}=Kt(S1t,$n),I=Ih(m),L=R.useRef();w1t(N);const P=R.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),w||z.setState({transform:q})},[b,w]);return R.useEffect(()=>{if(N.current){L.current=Egt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:X=>z.setState(J=>J.paneDragging===X?J:{paneDragging:X}),onPanZoomStart:(X,J)=>{const{onViewportChangeStart:ee,onMoveStart:$}=z.getState();$==null||$(X,J),ee==null||ee(J)},onPanZoom:(X,J)=>{const{onViewportChange:ee,onMove:$}=z.getState();$==null||$(X,J),ee==null||ee(J)},onPanZoomEnd:(X,J)=>{const{onViewportChangeEnd:ee,onMoveEnd:$}=z.getState();$==null||$(X,J),ee==null||ee(J)}});const{x:q,y:W,zoom:Z}=L.current.getViewport();return z.setState({panZoom:L.current,transform:[q,W,Z],domNode:N.current.closest(".react-flow")}),()=>{var X;(X=L.current)==null||X.destroy()}}},[]),R.useEffect(()=>{var q;(q=L.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:g,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:P,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,a,o,l,I,g,v,T,k,j,P,D,C,y]),h.jsx("div",{className:"react-flow__renderer",ref:N,style:hm,children:S})}const C1t=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function E1t(){const{userSelectionActive:e,userSelectionRect:n}=Kt(C1t,$n);return e&&n?h.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 Pb=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},N1t=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function z1t({isSelecting:e,selectionKeyPressed:n,selectionMode:t=Dh.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:S,children:k}){const v=R.useRef(0),b=Fn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:z,autoPanSpeed:N}=Kt(N1t,$n),T=y&&(e||w),j=R.useRef(null),D=R.useRef(),I=R.useRef(new Set),L=R.useRef(new Set),P=R.useRef(!1),q=R.useRef(!1),W=R.useRef({x:0,y:0}),Z=R.useRef(!1),X=F=>{if(q.current||P.current||b.getState().connection.inProgress){q.current=!1,P.current=!1;return}f==null||f(F),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},J=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}_==null||_(F)},ee=d?F=>d(F):void 0,$=F=>{q.current&&(F.stopPropagation(),q.current=!1)},B=F=>{var Ie,et;const{domNode:oe,transform:ue}=b.getState();if(D.current=oe==null?void 0:oe.getBoundingClientRect(),!D.current)return;const he=F.target===j.current;if(!he&&!!F.target.closest(".nokey")||!e||!(o&&he||n)||F.button!==0||!F.isPrimary)return;(et=(Ie=F.target)==null?void 0:Ie.setPointerCapture)==null||et.call(Ie,F.pointerId),q.current=!1;const{x:Re,y:He}=Fi(F.nativeEvent,D.current),Te=ud({x:Re,y:He},ue);b.setState({userSelectionRect:{width:0,height:0,startX:Te.x,startY:Te.y,x:Re,y:He}}),he||(F.stopPropagation(),F.preventDefault())};function H(F,oe){const{userSelectionRect:ue}=b.getState();if(!ue)return;const{transform:he,nodeLookup:me,edgeLookup:Ee,connectionLookup:Re,triggerNodeChanges:He,triggerEdgeChanges:Te,defaultEdgeOptions:Ie}=b.getState(),et={x:ue.startX,y:ue.startY},{x:Tt,y:zt}=Ou(et,he),Wt={startX:et.x,startY:et.y,x:Fst.id)),L.current=new Set;const Qe=(Ie==null?void 0:Ie.selectable)??!0;for(const st of I.current){const we=Re.get(st);if(we)for(const{edgeId:Le}of we.values()){const qe=Ee.get(Le);qe&&(qe.selectable??Qe)&&L.current.add(Le)}}if(!cC(fn,I.current)){const st=uu(me,I.current,!0);He(st)}if(!cC(ht,L.current)){const st=uu(Ee,L.current);Te(st)}b.setState({userSelectionRect:Wt,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!s||!D.current)return;const[F,oe]=Zy(W.current,D.current,N);z({x:F,y:oe}).then(ue=>{if(!q.current||!ue){v.current=requestAnimationFrame(K);return}const{x:he,y:me}=W.current;H(he,me),v.current=requestAnimationFrame(K)})}const G=()=>{cancelAnimationFrame(v.current),v.current=0,Z.current=!1};R.useEffect(()=>()=>G(),[]);const ie=F=>{const{userSelectionRect:oe,transform:ue,resetSelectedElements:he}=b.getState();if(!D.current||!oe)return;const{x:me,y:Ee}=Fi(F.nativeEvent,D.current);W.current={x:me,y:Ee};const Re=Ou({x:oe.startX,y:oe.startY},ue);if(!q.current){const He=n?0:a;if(Math.hypot(me-Re.x,Ee-Re.y)<=He)return;he(),l==null||l(F)}q.current=!0,Z.current||(K(),Z.current=!0),H(me,Ee)},ve=F=>{var oe,ue;if(!T){F.target===j.current&&b.getState().connection.inProgress&&(P.current=!0);return}F.button===0&&((ue=(oe=F.target)==null?void 0:oe.releasePointerCapture)==null||ue.call(oe,F.pointerId),!w&&F.target===j.current&&b.getState().userSelectionRect&&(X==null||X(F)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(F),b.setState({nodesSelectionActive:I.current.size>0})),G())},ce=F=>{var oe,ue;(ue=(oe=F.target)==null?void 0:oe.releasePointerCapture)==null||ue.call(oe,F.pointerId),G()},re=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:xr(["react-flow__pane",{draggable:re,dragging:C,selection:e}]),onClick:T?void 0:Pb(X,j),onContextMenu:Pb(J,j),onWheel:Pb(ee,j),onPointerEnter:T?void 0:m,onPointerMove:T?ie:g,onPointerUp:ve,onPointerCancel:T?ce:void 0,onPointerDownCapture:T?B:void 0,onClickCapture:T?$:void 0,onPointerLeave:S,ref:j,style:hm,children:[k,h.jsx(E1t,{})]})}function C2({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=n.getState(),f=l.get(e);if(!f){c==null||c("012",Vi.error012(e));return}n.setState({nodesSelectionActive:!1}),f.selected?(t||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function rM({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:a,nodeClickDistance:o}){const l=Fn(),[c,f]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=hgt({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{C2({id:d,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:s,nodeClickDistance:o}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,a,e,s,o]),c}const A1t=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function sM(){const e=Fn();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:_}=e.getState(),d=new Map,m=A1t(o),g=s?a[0]:5,S=s?a[1]:5,k=t.direction.x*g*t.factor,v=t.direction.y*S*t.factor;for(const[,b]of f){if(!m(b))continue;let w={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(w=cd(w,a));const{position:y,positionAbsolute:C}=kT({nodeId:b.id,nextPosition:w,nodeLookup:f,nodeExtent:r,nodeOrigin:_,onError:l});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}c(d)},[])}const a4=R.createContext(null),j1t=a4.Provider;a4.Consumer;const iM=()=>R.useContext(a4),T1t=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),aM=R.createContext(null);function M1t({children:e}){const n=Kt(T1t,$n);return h.jsx(aM.Provider,{value:n,children:e})}function R1t(){const e=R.useContext(aM);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const D1t={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},L1t=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o;if(!l&&!s)return D1t;const _=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:a===Du.Strict?(l==null?void 0:l.type)!==t:e!==(l==null?void 0:l.nodeId)||n!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:_&&f}};function O1t({type:e="source",position:n=ot.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:_,onTouchStart:d,...m},g){var Z,X;const S=o||null,k=e==="target",v=Fn(),b=iM(),{connectOnClick:w,noPanClassName:y,rfId:C}=R1t(),{connectingFrom:z,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:D,clickConnectionInProcess:I,valid:L}=Kt(L1t(b,S,e),$n);b||(X=(Z=v.getState()).onError)==null||X.call(Z,"010",Vi.error010());const P=J=>{const{defaultEdgeOptions:ee,onConnect:$,hasDefaultEdges:B}=v.getState(),H={...ee,...J};if(B){const{edges:K,setEdges:G,onError:ie}=v.getState();G(d1t(H,K,{onError:ie}))}$==null||$(H),l==null||l(H)},q=J=>{if(!b)return;const ee=RT(J.nativeEvent);if(s&&(ee&&J.button===0||!ee)){const $=v.getState();k2.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:k,handleId:S,nodeId:b,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...B)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...B)},updateConnection:$.updateConnection,onConnect:P,isValidConnection:t||((...B)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...B))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}ee?_==null||_(J):d==null||d(J)},W=J=>{const{onClickConnectStart:ee,onClickConnectEnd:$,connectionClickStartHandle:B,connectionMode:H,isValidConnection:K,lib:G,rfId:ie,nodeLookup:ve,connection:ce}=v.getState();if(!b||!B&&!s)return;if(!B){ee==null||ee(J.nativeEvent,{nodeId:b,handleId:S,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:S}});return}const re=TT(J.target),F=t||K,{connection:oe,isValid:ue}=k2.isValid(J.nativeEvent,{handle:{nodeId:b,id:S,type:e},connectionMode:H,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:F,flowId:ie,doc:re,lib:G,nodeLookup:ve});ue&&oe&&P(oe);const he=structuredClone(ce);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,$==null||$(J,he),v.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":S,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${S}-${e}`,className:xr(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,f,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:a,clickconnecting:T,connectingfrom:z,connectingto:N,valid:L,connectionindicator:r&&(!D||j)&&(D||I?a:s)}]),onMouseDown:q,onTouchStart:q,onClick:w?W:void 0,ref:g,...m,children:c})}const ll=R.memo(tM(O1t));function I1t({data:e,isConnectable:n,sourcePosition:t=ot.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(ll,{type:"source",position:t,isConnectable:n})]})}function B1t({data:e,isConnectable:n,targetPosition:t=ot.Top,sourcePosition:r=ot.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(ll,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,h.jsx(ll,{type:"source",position:r,isConnectable:n})]})}function $1t(){return null}function H1t({data:e,isConnectable:n,targetPosition:t=ot.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(ll,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const tp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},HC={input:I1t,default:B1t,output:H1t,group:$1t};function F1t(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 P1t=e=>{const{width:n,height:t,x:r,y:s}=ld(e.nodeLookup,{filter:a=>!!a.selected});return{width:Hi(n)?n:null,height:Hi(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 U1t({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Fn(),{width:s,height:a,transformString:o,userSelectionActive:l}=Kt(P1t,$n),c=sM(),f=R.useRef(null);R.useEffect(()=>{var g;t||(g=f.current)==null||g.focus({preventScroll:!0})},[t]);const _=!l&&s!==null&&a!==null;if(rM({nodeRef:f,disabled:!_}),!_)return null;const d=e?g=>{const S=r.getState().nodes.filter(k=>k.selected);e(g,S)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(tp,g.key)&&(g.preventDefault(),c({direction:tp[g.key],factor:g.shiftKey?4:1}))};return h.jsx("div",{className:xr(["react-flow__nodesselection","react-flow__container",n]),style:{transform:o},children:h.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:m,style:{width:s,height:a}})})}const FC=typeof window<"u"?window:void 0,q1t=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function oM({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:_,selectionMode:d,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:D,defaultViewport:I,translateExtent:L,minZoom:P,maxZoom:q,preventScrolling:W,onSelectionContextMenu:Z,noWheelClassName:X,noPanClassName:J,disableKeyboardA11y:ee,onViewportChange:$,isControlledViewport:B}){const{nodesSelectionActive:H,userSelectionActive:K}=Kt(q1t,$n),G=Ih(f,{target:FC}),ie=Ih(k,{target:FC}),ve=ie||j,ce=ie||C,re=_&&ve!==!0,F=G||K||re;return y1t({deleteKeyCode:c,multiSelectionKeyCode:S}),h.jsx(k1t,{onPaneContextMenu:a,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!G&&ve,defaultViewport:I,translateExtent:L,minZoom:P,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:W,noWheelClassName:X,noPanClassName:J,onViewportChange:$,isControlledViewport:B,paneClickDistance:l,selectionOnDrag:re,children:h.jsxs(z1t,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ve,autoPanOnSelection:D,isSelecting:!!F,selectionMode:d,selectionKeyPressed:G,paneClickDistance:l,selectionOnDrag:re,children:[e,H&&h.jsx(U1t,{onSelectionContextMenu:Z,noPanClassName:J,disableKeyboardA11y:ee})]})})}oM.displayName="FlowRenderer";const G1t=R.memo(oM),V1t=e=>n=>e?Yy(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 W1t(e){return Kt(R.useCallback(V1t(e),[e]),$n)}const K1t=e=>e.updateNodeInternals;function X1t(){const e=Kt(K1t),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const a=s.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function Y1t({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Fn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),c=R.useRef(e.targetPosition),f=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!_||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[_,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const d=f.current!==n,m=l.current!==e.sourcePosition,g=c.current!==e.targetPosition;(d||m||g)&&(f.current=n,l.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),a}function Z1t({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:_,resizeObserver:d,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:S,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:z}=Kt(F=>{const oe=F.nodeLookup.get(e),ue=F.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ue}},$n);let N=y.type||"default",T=(v==null?void 0:v[N])||HC[N];T===void 0&&(w==null||w("003",Vi.error003(N)),N="default",T=(v==null?void 0:v.default)||HC.default);const j=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),I=!!(y.connectable||f&&typeof y.connectable>"u"),L=!!(y.focusable||_&&typeof y.focusable>"u"),P=Fn(),q=AT(y),W=Y1t({node:y,nodeType:N,hasDimensions:q,resizeObserver:d}),Z=rM({nodeRef:W,disabled:y.hidden||!j,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:b}),X=sM();if(y.hidden)return null;const J=mo(y),ee=F1t(y),$=D||j||n||t||r||s,B=t?F=>t(F,{...C.userNode}):void 0,H=r?F=>r(F,{...C.userNode}):void 0,K=s?F=>s(F,{...C.userNode}):void 0,G=a?F=>a(F,{...C.userNode}):void 0,ie=o?F=>o(F,{...C.userNode}):void 0,ve=F=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ue}=P.getState();D&&(!oe||!j||ue>0)&&C2({id:e,store:P,nodeRef:W}),n&&n(F,{...C.userNode})},ce=F=>{if(!(MT(F.nativeEvent)||S)){if(vT.includes(F.key)&&D){const oe=F.key==="Escape";C2({id:e,store:P,unselect:oe,nodeRef:W})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(tp,F.key)){F.preventDefault();const{ariaLabelConfig:oe}=P.getState();P.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:F.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),X({direction:tp[F.key],factor:F.shiftKey?4:1})}}},re=()=>{var Re;if(S||!((Re=W.current)!=null&&Re.matches(":focus-visible")))return;const{transform:F,width:oe,height:ue,autoPanOnNodeFocus:he,setCenter:me}=P.getState();if(!he)return;Yy(new Map([[e,y]]),{x:0,y:0,width:oe,height:ue},F,!0).length>0||me(y.position.x+J.width/2,y.position.y+J.height/2,{zoom:F[2]})};return h.jsx("div",{className:xr(["react-flow__node",`react-flow__node-${N}`,{[g]:j},y.className,{selected:y.selected,selectable:D,parent:z,draggable:j,dragging:Z}]),ref:W,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:q?"visible":"hidden",...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:H,onMouseLeave:K,onContextMenu:G,onClick:ve,onDoubleClick:ie,onKeyDown:L?ce:void 0,tabIndex:L?0:void 0,onFocus:L?re:void 0,role:y.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${ZT}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(j1t,{value:e,children:h.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:j,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Z,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...J})})})}var Q1t=R.memo(Z1t);const J1t=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function lM(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:a}=Kt(J1t,$n),o=W1t(e.onlyRenderVisibleElements),l=X1t();return h.jsx("div",{className:"react-flow__nodes",style:hm,children:o.map(c=>h.jsx(Q1t,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}lM.displayName="NodeRenderer";const ebt=R.memo(lM);function tbt(e){return Kt(R.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 a=t.nodeLookup.get(s.source),o=t.nodeLookup.get(s.target);a&&o&&Wmt({sourceNode:a,targetNode:o,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),$n)}const nbt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},rbt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},PC={[Q0.Arrow]:nbt,[Q0.ArrowClosed]:rbt};function sbt(e){const n=Fn();return R.useMemo(()=>{var s,a;return Object.prototype.hasOwnProperty.call(PC,e)?PC[e]:((a=(s=n.getState()).onError)==null||a.call(s,"009",Vi.error009(e)),null)},[e])}const ibt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=sbt(n);return c?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(c,{color:t,strokeWidth:o})}):null},cM=({defaultColor:e,rfId:n})=>{const t=Kt(a=>a.edges),r=Kt(a=>a.defaultEdgeOptions),s=R.useMemo(()=>tgt(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?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:s.map(a=>h.jsx(ibt,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};cM.displayName="MarkerDefinitions";var abt=R.memo(cM);function uM({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,..._}){const[d,m]=R.useState({x:1,y:0,width:0,height:0}),g=xr(["react-flow__edge-textwrapper",f]),S=R.useRef(null);return R.useEffect(()=>{if(S.current){const k=S.current.getBBox();m({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?h.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",..._,children:[s&&h.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:S,style:r,children:t}),c]}):null}uM.displayName="EdgeText";const obt=R.memo(uM);function dm({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,..._}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{..._,d:e,fill:"none",className:xr(["react-flow__edge-path",_.className])}),f?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Hi(n)&&Hi(t)?h.jsx(obt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function UC({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===ot.Left||e===ot.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function fM({sourceX:e,sourceY:n,sourcePosition:t=ot.Bottom,targetX:r,targetY:s,targetPosition:a=ot.Top}){const[o,l]=UC({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,f]=UC({pos:a,x1:r,y1:s,x2:e,y2:n}),[_,d,m,g]=DT({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${n} C${o},${l} ${c},${f} ${r},${s}`,_,d,m,g]}function hM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[w,y,C]=fM({sourceX:t,sourceY:r,sourcePosition:o,targetX:s,targetY:a,targetPosition:l}),z=e.isInternal?void 0:n;return h.jsx(dm,{id:z,path:w,labelX:y,labelY:C,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})})}const lbt=hM({isInternal:!1}),dM=hM({isInternal:!0});lbt.displayName="SimpleBezierEdge";dM.displayName="SimpleBezierEdgeInternal";function _M(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:d,style:m,sourcePosition:g=ot.Bottom,targetPosition:S=ot.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,z]=y2({sourceX:t,sourceY:r,sourcePosition:g,targetX:s,targetY:a,targetPosition:S,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 h.jsx(dm,{id:N,path:y,labelX:C,labelY:z,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:d,style:m,markerEnd:k,markerStart:v,interactionWidth:w})})}const pM=_M({isInternal:!1}),mM=_M({isInternal:!0});pM.displayName="SmoothStepEdge";mM.displayName="SmoothStepEdgeInternal";function gM(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return h.jsx(pM,{...t,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=t.pathOptions)==null?void 0:a.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const cbt=gM({isInternal:!1}),bM=gM({isInternal:!0});cbt.displayName="StepEdge";bM.displayName="StepEdgeInternal";function vM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:d,style:m,markerEnd:g,markerStart:S,interactionWidth:k})=>{const[v,b,w]=IT({sourceX:t,sourceY:r,targetX:s,targetY:a}),y=e.isInternal?void 0:n;return h.jsx(dm,{id:y,path:v,labelX:b,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:_,labelBgBorderRadius:d,style:m,markerEnd:g,markerStart:S,interactionWidth:k})})}const ubt=vM({isInternal:!1}),xM=vM({isInternal:!0});ubt.displayName="StraightEdge";xM.displayName="StraightEdgeInternal";function yM(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:a,sourcePosition:o=ot.Bottom,targetPosition:l=ot.Top,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,z]=LT({sourceX:t,sourceY:r,sourcePosition:o,targetX:s,targetY:a,targetPosition:l,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return h.jsx(dm,{id:N,path:y,labelX:C,labelY:z,label:c,labelStyle:f,labelShowBg:_,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:w})})}const fbt=yM({isInternal:!1}),wM=yM({isInternal:!0});fbt.displayName="BezierEdge";wM.displayName="BezierEdgeInternal";const qC={default:wM,straight:xM,step:bM,smoothstep:mM,simplebezier:dM},GC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},hbt=(e,n,t)=>t===ot.Left?e-n:t===ot.Right?e+n:e,dbt=(e,n,t)=>t===ot.Top?e-n:t===ot.Bottom?e+n:e,VC="react-flow__edgeupdater";function WC({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:o,className:xr([VC,`${VC}-${l}`]),cx:hbt(n,r,e),cy:dbt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function _bt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:_,onReconnectEnd:d,setReconnecting:m,setUpdateHover:g}){const S=Fn(),k=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:D,lib:I,onConnectStart:L,cancelConnection:P,nodeLookup:q,rfId:W,panBy:Z,updateConnection:X}=S.getState(),J=z.type==="target",ee=(H,K)=>{m(!1),d==null||d(H,t,z.type,K)},$=H=>f==null?void 0:f(t,H),B=(H,K)=>{m(!0),_==null||_(C,t,z.type),L==null||L(H,K)};k2.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:D,domNode:T,handleId:z.id,nodeId:z.nodeId,nodeLookup:q,isTarget:J,edgeUpdaterType:z.type,lib:I,flowId:W,cancelConnection:P,panBy:Z,isValidConnection:(...H)=>{var K,G;return((G=(K=S.getState()).isValidConnection)==null?void 0:G.call(K,...H))??!0},onConnect:$,onConnectStart:B,onConnectEnd:(...H)=>{var K,G;return(G=(K=S.getState()).onConnectEnd)==null?void 0:G.call(K,...H)},onReconnectEnd:ee,updateConnection:X,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.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=()=>g(!0),y=()=>g(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(WC,{position:l,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(WC,{position:c,centerX:a,centerY:o,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function pbt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:_,onReconnect:d,onReconnectStart:m,onReconnectEnd:g,rfId:S,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=Kt(me=>me.edgeLookup.get(e));const C=Kt(me=>me.defaultEdgeOptions);y=C?{...C,...y}:y;let z=y.type||"default",N=(k==null?void 0:k[z])||qC[z];N===void 0&&(b==null||b("011",Vi.error011(z)),z="default",N=(k==null?void 0:k.default)||qC.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),I=R.useRef(null),[L,P]=R.useState(!1),[q,W]=R.useState(!1),Z=Fn(),{zIndex:X=y.zIndex,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K}=Kt(R.useCallback(me=>{const Ee=me.nodeLookup.get(y.source),Re=me.nodeLookup.get(y.target);if(!Ee||!Re)return GC;const He=egt({id:e,sourceNode:Ee,targetNode:Re,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:me.connectionMode,onError:b}),Te=Vmt({selected:y.selected,zIndex:y.zIndex,sourceNode:Ee,targetNode:Re,elevateOnSelect:me.elevateEdgesOnSelect,zIndexMode:me.zIndexMode});return{...He||GC,zIndex:Te}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),$n),G=R.useMemo(()=>y.markerStart?`url('#${w2(y.markerStart,S)}')`:void 0,[y.markerStart,S]),ie=R.useMemo(()=>y.markerEnd?`url('#${w2(y.markerEnd,S)}')`:void 0,[y.markerEnd,S]);if(y.hidden||J===null||ee===null||$===null||B===null)return null;const ve=me=>{var Te;const{addSelectedEdges:Ee,unselectNodesAndEdges:Re,multiSelectionActive:He}=Z.getState();D&&(Z.setState({nodesSelectionActive:!1}),y.selected&&He?(Re({nodes:[],edges:[y]}),(Te=I.current)==null||Te.blur()):Ee([e])),s&&s(me,y)},ce=a?me=>{a(me,{...y})}:void 0,re=o?me=>{o(me,{...y})}:void 0,F=l?me=>{l(me,{...y})}:void 0,oe=c?me=>{c(me,{...y})}:void 0,ue=f?me=>{f(me,{...y})}:void 0,he=me=>{var Ee;if(!w&&vT.includes(me.key)&&D){const{unselectNodesAndEdges:Re,addSelectedEdges:He}=Z.getState();me.key==="Escape"?((Ee=I.current)==null||Ee.blur(),Re({edges:[y]})):He([e])}};return h.jsx("svg",{style:{zIndex:X},children:h.jsxs("g",{className:xr(["react-flow__edge",`react-flow__edge-${z}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!D&&!s,updating:L,selectable:D}]),onClick:ve,onDoubleClick:ce,onContextMenu:re,onMouseEnter:F,onMouseMove:oe,onMouseLeave:ue,onKeyDown:T?he: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?`${QT}-${S}`:void 0,ref:I,...y.domAttributes,children:[!q&&h.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:G,markerEnd:ie,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&h.jsx(_bt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:m,onReconnectEnd:g,sourceX:J,sourceY:ee,targetX:$,targetY:B,sourcePosition:H,targetPosition:K,setUpdateHover:P,setReconnecting:W})]})})}var mbt=R.memo(pbt);const gbt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function SM({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=Kt(gbt,$n),C=tbt(n);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(abt,{defaultColor:e,rfId:t}),C.map(z=>h.jsx(mbt,{id:z,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:_,reconnectRadius:d,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},z))]})}SM.displayName="EdgeRenderer";const bbt=R.memo(SM),vbt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function xbt({children:e}){const n=Kt(vbt);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function ybt(e){const n=i4(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const wbt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function Sbt(e){const n=Kt(wbt),t=Fn();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function kbt(e){return e.connection.inProgress?{...e.connection,to:ud(e.connection.to,e.transform)}:{...e.connection}}function Cbt(e){return kbt}function Ebt(e){const n=Cbt();return Kt(n,$n)}const Nbt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function zbt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:a,height:o,isValid:l,inProgress:c}=Kt(Nbt,$n);return!(a&&s&&c)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:xr(["react-flow__connection",wT(l)]),children:h.jsx(kM,{style:n,type:t,CustomComponent:r,isValid:l})})})}const kM=({style:e,type:n=Qo.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:_,toHandle:d,toPosition:m,pointer:g}=Ebt();if(!s)return;if(t)return h.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:m,connectionStatus:wT(r),toNode:_,toHandle:d,pointer:g});let S="";const k={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:m};switch(n){case Qo.Bezier:[S]=LT(k);break;case Qo.SimpleBezier:[S]=fM(k);break;case Qo.Step:[S]=y2({...k,borderRadius:0});break;case Qo.SmoothStep:[S]=y2(k);break;default:[S]=IT(k)}return h.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};kM.displayName="ConnectionLine";const Abt={};function KC(e=Abt){R.useRef(e),Fn(),R.useEffect(()=>{},[e])}function jbt(){Fn(),R.useRef(!1),R.useEffect(()=>{},[])}function CM({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:m,onSelectionEnd:g,connectionLineType:S,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:L,translateExtent:P,minZoom:q,maxZoom:W,preventScrolling:Z,defaultMarkerColor:X,zoomOnScroll:J,zoomOnPinch:ee,panOnScroll:$,panOnScrollSpeed:B,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:G,autoPanOnSelection:ie,onPaneClick:ve,onPaneMouseEnter:ce,onPaneMouseMove:re,onPaneMouseLeave:F,onPaneScroll:oe,onPaneContextMenu:ue,paneClickDistance:he,nodeClickDistance:me,onEdgeContextMenu:Ee,onEdgeMouseEnter:Re,onEdgeMouseMove:He,onEdgeMouseLeave:Te,reconnectRadius:Ie,onReconnect:et,onReconnectStart:Tt,onReconnectEnd:zt,noDragClassName:Wt,noWheelClassName:fn,noPanClassName:ht,disableKeyboardA11y:Qe,nodeExtent:st,rfId:we,viewport:Le,onViewportChange:qe}){return KC(e),KC(n),jbt(),ybt(t),Sbt(Le),h.jsx(G1t,{onPaneClick:ve,onPaneMouseEnter:ce,onPaneMouseMove:re,onPaneMouseLeave:F,onPaneContextMenu:ue,onPaneScroll:oe,paneClickDistance:he,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:J,zoomOnPinch:ee,zoomOnDoubleClick:K,panOnScroll:$,panOnScrollSpeed:B,panOnScrollMode:H,panOnDrag:G,autoPanOnSelection:ie,defaultViewport:L,translateExtent:P,minZoom:q,maxZoom:W,onSelectionContextMenu:d,preventScrolling:Z,noDragClassName:Wt,noWheelClassName:fn,noPanClassName:ht,disableKeyboardA11y:Qe,onViewportChange:qe,isControlledViewport:!!Le,children:h.jsxs(xbt,{children:[h.jsx(bbt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:et,onReconnectStart:Tt,onReconnectEnd:zt,onlyRenderVisibleElements:D,onEdgeContextMenu:Ee,onEdgeMouseEnter:Re,onEdgeMouseMove:He,onEdgeMouseLeave:Te,reconnectRadius:Ie,defaultMarkerColor:X,noPanClassName:ht,disableKeyboardA11y:Qe,rfId:we}),h.jsx(zbt,{style:k,type:S,component:v,containerStyle:b}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(ebt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:_,nodeClickDistance:me,onlyRenderVisibleElements:D,noPanClassName:ht,noDragClassName:Wt,disableKeyboardA11y:Qe,nodeExtent:st,rfId:we}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}CM.displayName="GraphView";const Tbt=R.memo(CM),Mbt=zT(),XC=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:_,nodeExtent:d,zIndexMode:m="basic"}={})=>{const g=new Map,S=new Map,k=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Rh;HT(k,v,b);const{nodesInitialized:z}=S2(w,g,S,{nodeOrigin:y,nodeExtent:C,zIndexMode:m});let N=[0,0,1];if(o&&s&&a){const T=ld(g,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:j,y:D,zoom:I}=Qy(T,s,a,c,f,(l==null?void 0:l.padding)??.1);N=[j,D,I]}return{rfId:"1",width:s??0,height:a??0,transform:N,nodes:w,nodesInitialized:z,nodeLookup:g,parentLookup:S,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:Rh,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Du.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...yT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Mbt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:xT,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Rbt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:_,nodeExtent:d,zIndexMode:m})=>Ugt((g,S)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:z,minZoom:N,maxZoom:T}=S();b&&(await $mt({nodes:v,width:C,height:z,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),g({fitViewResolver:null}))}return{...XC({nodes:e,edges:n,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:m}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:N,nodesSelectionActive:T}=S(),{nodesInitialized:j,hasSelectedNodes:D}=S2(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),I=T&&D;z&&j?(k(),g({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):g({nodes:v,nodesInitialized:j,nodesSelectionActive:I})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=S();HT(b,w,v),g({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=S();w(v),g({hasDefaultNodes:!0})}if(b){const{setEdges:w}=S();w(b),g({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:z,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:D}=S(),{changes:I,updatedInternals:L}=lgt(v,w,y,C,z,N,D);L&&(sgt(w,y,{nodeOrigin:z,nodeExtent:N,zIndexMode:D}),j?(k(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),b==null||b(I)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:z,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=S();for(const[D,I]of v){const L=C.get(D),P=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(I!=null&&I.position)),q={id:D,type:"position",position:P?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:b};if(L&&N.inProgress&&N.fromNode.id===L.id){const W=ic(L,N.fromHandle,ot.Left,!0);T({...N,from:W})}P&&L.parentId&&w.push({id:D,parentId:L.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(q)}if(w.length>0){const{parentLookup:D,nodeOrigin:I}=S(),L=s4(w,C,D,I);y.push(...L)}for(const D of j.values())y=D(y);z(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:z}=S();if(v!=null&&v.length){if(C){const N=u1t(v,y);w(N)}z&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:z}=S();if(v!=null&&v.length){if(C){const N=f1t(v,y);w(N)}z&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=S();if(b){const N=v.map(T=>Fl(T,!0));C(N);return}C(uu(y,new Set([...v]),!0)),z(uu(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=S();if(b){const N=v.map(T=>Fl(T,!0));z(N);return}z(uu(w,new Set([...v]))),C(uu(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:N}=S(),T=v||y,j=b||w,D=[];for(const L of T){if(!L.selected)continue;const P=C.get(L.id);P&&(P.selected=!1),D.push(Fl(L.id,!1))}const I=[];for(const L of j)L.selected&&I.push(Fl(L.id,!1));z(D),N(I)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=S();b==null||b.setScaleExtent([v,w]),g({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=S();b==null||b.setScaleExtent([w,v]),g({maxZoom:v})},setTranslateExtent:v=>{var b;(b=S().panZoom)==null||b.setTranslateExtent(v),g({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=S();if(!C)return;const z=b.reduce((T,j)=>j.selected?[...T,Fl(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,Fl(j.id,!1)]:T,[]);w(z),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:N,zIndexMode:T}=S();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(S2(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:T}),g({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:z}=S();return cgt({delta:v,panZoom:C,transform:b,translateExtent:z,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:z,panZoom:N}=S();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:z;return await N.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:()=>{g({connection:{...yT}})},updateConnection:v=>{g({connection:v})},reset:()=>g({...XC()})}},Object.is);function Dbt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:_,nodeExtent:d,zIndexMode:m,children:g}){const[S]=R.useState(()=>Rbt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:_,nodeExtent:d,zIndexMode:m}));return h.jsx(qgt,{value:S,children:h.jsx(g1t,{children:h.jsx(M1t,{children:g})})})}function Lbt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:_,nodeOrigin:d,nodeExtent:m,zIndexMode:g}){return R.useContext(um)?h.jsx(h.Fragment,{children:e}):h.jsx(Dbt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:_,nodeOrigin:d,nodeExtent:m,zIndexMode:g,children:e})}const Obt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Ibt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:_,onMoveStart:d,onMoveEnd:m,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:L,onDelete:P,onSelectionChange:q,onSelectionDragStart:W,onSelectionDrag:Z,onSelectionDragStop:X,onSelectionContextMenu:J,onSelectionStart:ee,onSelectionEnd:$,onBeforeDelete:B,connectionMode:H,connectionLineType:K=Qo.Bezier,connectionLineStyle:G,connectionLineComponent:ie,connectionLineContainerStyle:ve,deleteKeyCode:ce="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:F=!1,selectionMode:oe=Dh.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:he=Oh()?"Meta":"Control",zoomActivationKeyCode:me=Oh()?"Meta":"Control",snapToGrid:Ee,snapGrid:Re,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Te,nodesDraggable:Ie,autoPanOnNodeFocus:et,nodesConnectable:Tt,nodesFocusable:zt,nodeOrigin:Wt=JT,edgesFocusable:fn,edgesReconnectable:ht,elementsSelectable:Qe=!0,defaultViewport:st=r1t,minZoom:we=.5,maxZoom:Le=2,translateExtent:qe=Rh,preventScrolling:tt=!0,nodeExtent:at,defaultMarkerColor:Mt="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Ot=!0,panOnScroll:Rt=!1,panOnScrollSpeed:sn=.5,panOnScrollMode:xt=Ql.Free,zoomOnDoubleClick:hn=!0,panOnDrag:dn=!0,onPaneClick:Ke,onPaneMouseEnter:ut,onPaneMouseMove:_n,onPaneMouseLeave:Rr,onPaneScroll:ct,onPaneContextMenu:Ut,paneClickDistance:Qt=1,nodeClickDistance:Gr=0,children:zr,onReconnect:Ts,onReconnectStart:Ze,onReconnectEnd:mt,onEdgeContextMenu:an,onEdgeDoubleClick:Cn,onEdgeMouseEnter:En,onEdgeMouseMove:rs,onEdgeMouseLeave:Dr,reconnectRadius:Vr=10,onNodesChange:Lr,onEdgesChange:An,noDragClassName:on="nodrag",noWheelClassName:Nn="nowheel",noPanClassName:gt="nopan",fitView:Jn,fitViewOptions:Wr,connectOnClick:We,attributionPosition:dt,proOptions:Ln,defaultEdgeOptions:pn,elevateNodesOnSelect:ar=!0,elevateEdgesOnSelect:Ms=!1,disableKeyboardA11y:Rs=!1,autoPanOnConnect:Or,autoPanOnNodeDrag:zn,autoPanOnSelection:ri=!0,autoPanSpeed:qt,connectionRadius:ps,isValidConnection:er,onError:yr,style:ms,id:Ki,nodeDragThreshold:Ei,connectionDragThreshold:si,viewport:ii,onViewportChange:Ar,width:wr,height:Ds,colorMode:Sr="light",debug:ai,onScroll:Ls,ariaLabelConfig:jn,zIndexMode:Kn="basic",...or},Xi){const jr=Ki||"1",Ni=o1t(Sr),oi=R.useCallback(Ir=>{Ir.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ls==null||Ls(Ir)},[Ls]);return h.jsx("div",{"data-testid":"rf__wrapper",...or,onScroll:oi,style:{...ms,...Obt},ref:Xi,className:xr(["react-flow",s,Ni]),id:Ki,role:"application",children:h.jsxs(Lbt,{nodes:e,edges:n,width:wr,height:Ds,fitView:Jn,fitViewOptions:Wr,minZoom:we,maxZoom:Le,nodeOrigin:Wt,nodeExtent:at,zIndexMode:Kn,children:[h.jsx(a1t,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Ie,autoPanOnNodeFocus:et,nodesConnectable:Tt,nodesFocusable:zt,edgesFocusable:fn,edgesReconnectable:ht,elementsSelectable:Qe,elevateNodesOnSelect:ar,elevateEdgesOnSelect:Ms,minZoom:we,maxZoom:Le,nodeExtent:at,onNodesChange:Lr,onEdgesChange:An,snapToGrid:Ee,snapGrid:Re,connectionMode:H,translateExtent:qe,connectOnClick:We,defaultEdgeOptions:pn,fitView:Jn,fitViewOptions:Wr,onNodesDelete:I,onEdgesDelete:L,onDelete:P,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:D,onSelectionDrag:Z,onSelectionDragStart:W,onSelectionDragStop:X,onMove:_,onMoveStart:d,onMoveEnd:m,noPanClassName:gt,nodeOrigin:Wt,rfId:jr,autoPanOnConnect:Or,autoPanOnNodeDrag:zn,autoPanSpeed:qt,onError:yr,connectionRadius:ps,isValidConnection:er,selectNodesOnDrag:Te,nodeDragThreshold:Ei,connectionDragThreshold:si,onBeforeDelete:B,debug:ai,ariaLabelConfig:jn,zIndexMode:Kn}),h.jsx(Tbt,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:o,connectionLineType:K,connectionLineStyle:G,connectionLineComponent:ie,connectionLineContainerStyle:ve,selectionKeyCode:re,selectionOnDrag:F,selectionMode:oe,deleteKeyCode:ce,multiSelectionKeyCode:he,panActivationKeyCode:ue,zoomActivationKeyCode:me,onlyRenderVisibleElements:He,defaultViewport:st,translateExtent:qe,minZoom:we,maxZoom:Le,preventScrolling:tt,zoomOnScroll:yt,zoomOnPinch:Ot,zoomOnDoubleClick:hn,panOnScroll:Rt,panOnScrollSpeed:sn,panOnScrollMode:xt,panOnDrag:dn,autoPanOnSelection:ri,onPaneClick:Ke,onPaneMouseEnter:ut,onPaneMouseMove:_n,onPaneMouseLeave:Rr,onPaneScroll:ct,onPaneContextMenu:Ut,paneClickDistance:Qt,nodeClickDistance:Gr,onSelectionContextMenu:J,onSelectionStart:ee,onSelectionEnd:$,onReconnect:Ts,onReconnectStart:Ze,onReconnectEnd:mt,onEdgeContextMenu:an,onEdgeDoubleClick:Cn,onEdgeMouseEnter:En,onEdgeMouseMove:rs,onEdgeMouseLeave:Dr,reconnectRadius:Vr,defaultMarkerColor:Mt,noDragClassName:on,noWheelClassName:Nn,noPanClassName:gt,rfId:jr,disableKeyboardA11y:Rs,nodeExtent:at,viewport:ii,onViewportChange:Ar}),h.jsx(n1t,{onSelectionChange:q}),zr,h.jsx(Zgt,{proOptions:Ln,position:dt}),h.jsx(Ygt,{rfId:jr,disableKeyboardA11y:Rs})]})})}var Bbt=tM(Ibt);function $bt({dimensions:e,lineWidth:n,variant:t,className:r}){return h.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xr(["react-flow__background-pattern",t,r])})}function Hbt({radius:e,className:n}){return h.jsx("circle",{cx:e,cy:e,r:e,className:xr(["react-flow__background-pattern","dots",n])})}var ro;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ro||(ro={}));const Fbt={[ro.Dots]:1,[ro.Lines]:1,[ro.Cross]:6},Pbt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function EM({id:e,variant:n=ro.Dots,gap:t=20,size:r,lineWidth:s=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:_}){const d=R.useRef(null),{transform:m,patternId:g}=Kt(Pbt,$n),S=r||Fbt[n],k=n===ro.Dots,v=n===ro.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*m[2]||1,b[1]*m[2]||1],y=S*m[2],C=Array.isArray(a)?a:[a,a],z=v?[y,y]:w,N=[C[0]*m[2]||1+z[0]/2,C[1]*m[2]||1+z[1]/2],T=`${g}${e||""}`;return h.jsxs("svg",{className:xr(["react-flow__background",f]),style:{...c,...hm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:T,x:m[0]%w[0],y:m[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:k?h.jsx(Hbt,{radius:y/2,className:_}):h.jsx($bt,{dimensions:z,lineWidth:s,variant:n,className:_})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}EM.displayName="Background";const Ubt=R.memo(EM);function qbt(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gbt(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vbt(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Wbt(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Kbt(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Y_({children:e,className:n,...t}){return h.jsx("button",{type:"button",className:xr(["react-flow__controls-button",n]),...t,children:e})}const Xbt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function NM({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:_,position:d="bottom-left",orientation:m="vertical","aria-label":g}){const S=Fn(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=Kt(Xbt,$n),{zoomIn:y,zoomOut:C,fitView:z}=i4(),N=()=>{y(),a==null||a()},T=()=>{C(),o==null||o()},j=()=>{z(s),l==null||l()},D=()=>{S.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},I=m==="horizontal"?"horizontal":"vertical";return h.jsxs(fm,{className:xr(["react-flow__controls",I,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??w["controls.ariaLabel"],children:[n&&h.jsxs(h.Fragment,{children:[h.jsx(Y_,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:h.jsx(qbt,{})}),h.jsx(Y_,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:h.jsx(Gbt,{})})]}),t&&h.jsx(Y_,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:h.jsx(Vbt,{})}),r&&h.jsx(Y_,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:k?h.jsx(Kbt,{}):h.jsx(Wbt,{})}),_]})}NM.displayName="Controls";R.memo(NM);function Ybt({id:e,x:n,y:t,width:r,height:s,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:_,shapeRendering:d,selected:m,onClick:g}){const{background:S,backgroundColor:k}=a||{},v=o||S||k;return h.jsx("rect",{className:xr(["react-flow__minimap-node",{selected:m},f]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:d,onClick:g?b=>g(b,e):void 0})}const Zbt=R.memo(Ybt),Qbt=e=>e.nodes.map(n=>n.id),Ub=e=>e instanceof Function?e:()=>e;function Jbt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:a=Zbt,onClick:o}){const l=Kt(Qbt,$n),c=Ub(n),f=Ub(e),_=Ub(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(m=>h.jsx(tvt,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:a,onClick:o,shapeRendering:d},m))})}function evt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:_,y:d,width:m,height:g}=Kt(S=>{const k=S.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}=mo(v);return{node:v,x:b,y:w,width:y,height:C}},$n);return!f||f.hidden||!AT(f)?null:h.jsx(l,{x:_,y:d,width:m,height:g,style:f.style,selected:!!f.selected,className:r(f),color:n(f),borderRadius:s,strokeColor:t(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const tvt=R.memo(evt);var nvt=R.memo(Jbt);const rvt=200,svt=150,ivt=e=>!e.hidden,avt=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?ET(ld(e.nodeLookup,{filter:ivt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ovt="react-flow__minimap-desc";function zM({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:_,maskStrokeWidth:d,position:m="bottom-right",onClick:g,onNodeClick:S,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const z=Fn(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:D,panZoom:I,translateExtent:L,flowWidth:P,flowHeight:q,ariaLabelConfig:W}=Kt(avt,$n),Z=(e==null?void 0:e.width)??rvt,X=(e==null?void 0:e.height)??svt,J=T.width/Z,ee=T.height/X,$=Math.max(J,ee),B=$*Z,H=$*X,K=C*$,G=T.x-(B-T.width)/2-K,ie=T.y-(H-T.height)/2-K,ve=B+K*2,ce=H+K*2,re=`${ovt}-${D}`,F=R.useRef(0),oe=R.useRef();F.current=$,R.useEffect(()=>{if(N.current&&I)return oe.current=bgt({domNode:N.current,panZoom:I,getTransform:()=>z.getState().transform,getViewScale:()=>F.current}),()=>{var Ee;(Ee=oe.current)==null||Ee.destroy()}},[I]),R.useEffect(()=>{var Ee;(Ee=oe.current)==null||Ee.update({translateExtent:L,width:P,height:q,inversePan:w,pannable:k,zoomStep:y,zoomable:v})},[k,v,w,y,L,P,q]);const ue=g?Ee=>{var Te;const[Re,He]=((Te=oe.current)==null?void 0:Te.pointer(Ee))||[0,0];g(Ee,{x:Re,y:He})}:void 0,he=S?R.useCallback((Ee,Re)=>{const He=z.getState().nodeLookup.get(Re).internals.userNode;S(Ee,He)},[]):void 0,me=b??W["minimap.ariaLabel"];return h.jsx(fm,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*$: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 o=="number"?o:void 0},className:xr(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:Z,height:X,viewBox:`${G} ${ie} ${ve} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:N,onClick:ue,children:[me&&h.jsx("title",{id:re,children:me}),h.jsx(nvt,{onClick:he,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:a,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-K},${ie-K}h${ve+K*2}v${ce+K*2}h${-ve-K*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zM.displayName="MiniMap";R.memo(zM);const lvt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,cvt={[Iu.Line]:"right",[Iu.Handle]:"bottom-right"};function uvt({nodeId:e,position:n,variant:t=Iu.Handle,className:r,style:s=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:m,autoScale:g=!0,shouldResize:S,onResizeStart:k,onResize:v,onResizeEnd:b}){const w=iM(),y=typeof e=="string"?e:w,C=Fn(),z=R.useRef(null),N=t===Iu.Handle,T=Kt(R.useCallback(lvt(N&&g),[N,g]),$n),j=R.useRef(null),D=n??cvt[t];R.useEffect(()=>{if(!(!z.current||!y))return j.current||(j.current=Tgt({domNode:z.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:L,transform:P,snapGrid:q,snapToGrid:W,nodeOrigin:Z,domNode:X}=C.getState();return{nodeLookup:L,transform:P,snapGrid:q,snapToGrid:W,nodeOrigin:Z,paneDomNode:X}},onChange:(L,P)=>{const{triggerNodeChanges:q,nodeLookup:W,parentLookup:Z,nodeOrigin:X}=C.getState(),J=[],ee={x:L.x,y:L.y},$=W.get(y);if($&&$.expandParent&&$.parentId){const B=$.origin??X,H=L.width??$.measured.width??0,K=L.height??$.measured.height??0,G={id:$.id,parentId:$.parentId,rect:{width:H,height:K,...jT({x:L.x??$.position.x,y:L.y??$.position.y},{width:H,height:K},$.parentId,W,B)}},ie=s4([G],W,Z,X);J.push(...ie),ee.x=L.x?Math.max(B[0]*H,L.x):void 0,ee.y=L.y?Math.max(B[1]*K,L.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const B={id:y,type:"position",position:{...ee}};J.push(B)}if(L.width!==void 0&&L.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};J.push(H)}for(const B of P){const H={...B,type:"position"};J.push(H)}q(J)},onEnd:({width:L,height:P})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:L,height:P}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:_},keepAspectRatio:d,resizeDirection:m,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:S}),()=>{var L;(L=j.current)==null||L.destroy()}},[D,l,c,f,_,d,k,v,b,S]);const I=D.split("-");return h.jsx("div",{className:xr(["react-flow__resize-control","nodrag",...I,t,r]),ref:z,style:{...s,scale:T,...o&&{[N?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(uvt);function fvt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){n(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),c=new MutationObserver(o);return l.observe(a),c.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const Z_=8;function hvt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let l=0,c=0,f=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":l=e.x-t-_,c=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+_,c=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-t/2,c=e.y+e.height+_;break;case"above":l=e.x+e.width/2-t/2,c=e.y-r-_;break}const d=l,m=c;l=Math.min(Math.max(l,Z_),a-t-Z_),c=Math.min(Math.max(c,Z_),s-r-Z_),f=e.anchor==="left"||e.anchor==="right"?m-c:d-l}return{x:l,y:c,arrowAdjustment:f}}const qb=380,Gb=12,dvt=350,_vt=150,E2=new EventTarget;function pvt(){E2.dispatchEvent(new Event("move"))}function mvt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const f=()=>{window.clearTimeout(s.current),window.clearTimeout(a.current),r(null)};return E2.addEventListener("move",f),()=>{E2.removeEventListener("move",f),window.clearTimeout(s.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(f=>{var d;if(!f)return f;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&f.x===_.x&&f.y===_.y&&f.width===_.width&&f.height===_.height?f:_})},[e,n]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var f;r(((f=e.current)==null?void 0:f.getBoundingClientRect())??null)},dvt)},[e]),l=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),_vt)},[]),c=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:t,onMouseEnter:o,onMouseLeave:l,keepOpen:c}}function gvt(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 bvt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:c}){const f=fvt(),_=s.right+Gb+qb<=window.innerWidth,d=s.x-Gb-qb>=0,m=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:g,y:S}=hvt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:m,distance:Gb},f),[k,v]=R.useState(null),b=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null;R.useEffect(()=>{if(v(null),!b)return;let L=!1;return mKe(b).then(P=>{let q=P.diff;if(P.truncated){const J=q.lastIndexOf(` diff --git `);q=J!==-1?q.slice(0,J+1):q.slice(0,q.lastIndexOf(` -`)+1)}let W=[];try{W=q.trim()?Qv(q):[]}catch{return}if(U.truncated&&W.every(J=>J.hunks.length===0))return;let Z=0,X=0;for(const J of W){const ee=Ry(J);Z+=ee.additions,X+=ee.deletions}L||v({fileCount:W.length,additions:Z,deletions:X,truncated:U.truncated})}).catch(()=>{}),()=>{L=!0}},[b]);const w={done:0,failed:0,cancelled:0,live:0};for(const L of n)L.status==="done"?w.done+=1:L.status==="failed"?w.failed+=1:L.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?C0((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=R.useRef(null),[T,j]=R.useState(!1),[D,I]=R.useState(!1);return R.useEffect(()=>{j(!1)},[z]),R.useEffect(()=>{const L=N.current;L&&I(L.scrollHeight>L.clientHeight+1)},[z,T]),gy.createPortal(d.jsxs("div",{ref:f.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:Fb,left:g,top:S,visibility:f.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:c,children:[d.jsxs("div",{className:"hc-head",children:[d.jsx("span",{className:"hc-slug",children:e.slug}),d.jsx(no,{status:t?wi(t):"idle"})]}),e.title&&d.jsx("div",{className:"hc-title",children:e.title}),d.jsxs("div",{className:"hc-actions",children:[a&&d.jsxs("button",{type:"button",...nr(a),children:[d.jsx(Su,{size:13}),gae()]}),d.jsxs("button",{type:"button",...nr(o),children:[d.jsx(op,{size:13}),iae()]})]}),z&&d.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:z}),z&&(D||T)&&d.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(L=>!L),children:T?f9():yne()}),C&&d.jsx("div",{className:"hc-failure",children:C}),d.jsxs("div",{className:"hc-stats",children:[d.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?Fde():Vde({count:Ht(n.length)}),...w.done>0?[bde({count:Ht(w.done)})]:[],...w.failed>0?[wde({count:Ht(w.failed)})]:[],...w.cancelled>0?[_de({count:Ht(w.cancelled)})]:[],...w.live>0?[Dde({count:Ht(w.live)})]:[]])}),t&&X2(t.backend)&&d.jsx(_y,{backend:t.backend}),y&&d.jsx("span",{children:y}),t&&d.jsx("span",{children:qi(t.createdAt)})]}),d.jsxs("div",{className:"hc-git",children:[d.jsxs("div",{className:"hc-git-row",children:[d.jsxs("span",{className:"hc-branch",title:e.branchName,children:[d.jsx(lp,{size:12}),e.branchName]}),r&&d.jsxs("span",{children:[hae()," ",d.jsx("span",{className:"hc-mono",children:r})]})]}),k&&k.fileCount>0&&d.jsx("div",{className:"hc-git-row",title:k.truncated?tL({parent:je(r??"parent")}):ZD({parent:je(r??"parent")}),children:d.jsxs("span",{children:[k.truncated&&"≥ ",d.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",k.additions]})," ",d.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",k.deletions]})," · ",k.fileCount===1&&!k.truncated?Bde():k.truncated?jde({count:Ht(k.fileCount)}):Ede({count:Ht(k.fileCount)})]})})]}),d.jsxs("div",{className:"hc-foot",children:[d.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),d.jsxs("span",{children:[cae()," ",Lbt(e.createdAt)]})]})]}),document.body)}const WC=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),Ibt=264,KC=132,h0=44,Bbt=72,$bt=148,Hbt=44;function Pbt(e){const n=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),t=[];for(const a of e){const o=n.get(a.id),l=a.parentExperimentId?n.get(a.parentExperimentId):void 0;l?l.children.push(o):t.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,s=a=>{a.children.sort(r),a.children.forEach(s)};return t.sort(r),t.forEach(s),t}function Fbt(e,n){const t=new Map,r=l=>{const c=t.get(l)??1+l.children.reduce((f,_)=>f+r(_),0);return t.set(l,c),c},s=new Map,a=l=>{const c=s.get(l)??(n(l)||l.children.some(a));return s.set(l,c),c};function o(l){if(n(l)){const _=[];let h=0;for(const m of l.children)a(m)?_.push(...o(m)):h+=r(m);return h>0&&_.push({kind:"elided",id:`el-${l.exp.id}`,count:h,children:[]}),[{kind:"exp",exp:l.exp,children:_}]}if(!a(l))return[];let c=0;const f=[];return(function _(h){c+=1;for(const m of h.children)n(m)?f.push(...o(m)):a(m)?_(m):c+=r(m)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:c,children:f}]}return e.flatMap(o)}function C2(e){return e.kind==="exp"?Ibt:$bt}function Z_(e){return e.kind==="exp"?e.exp.id:e.id}function _0(e){if(e.children.length===0)return C2(e);const n=e.children.reduce((t,r)=>t+_0(r),0)+h0*(e.children.length-1);return Math.max(C2(e),n)}function Ubt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const qbt=R.memo(function({data:n}){const{exp:t,latestRun:r,runs:s,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:c,onOpenView:f,onOpenCode:_}=n,h=r?wi(r):void 0,m=h==="running"||h==="starting"||h==="cancelling",g=a?UFe():m?sUe():Ya(),S=s.slice(-8),k=R.useRef(null),v=Dbt(k,n);return d.jsxs("div",{ref:k,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-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-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[d.jsx(ll,{type:"target",position:at.Top}),d.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...nr(b=>f(t.id,"overview",b)),children:[d.jsxs("div",{className:"node-eyebrow",children:[d.jsx("span",{children:g}),d.jsx(no,{status:h??"idle"})]}),d.jsx("div",{className:"node-head",children:d.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&d.jsx("div",{className:"node-title",children:t.title||t.description}),d.jsxs("div",{className:"node-meta",children:[d.jsx("span",{children:UUe()}),S.length>0?d.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:S.map(b=>d.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Ubt(wi(b))}`,title:oA(wi(b))},b.id))}):d.jsx("span",{children:TUe()}),d.jsx("span",{style:{flex:1}}),r&&d.jsx("span",{children:qi(r.createdAt)})]})]}),d.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&d.jsxs("button",{className:"node-action",title:LUe(),...nr(b=>f(t.id,"terminal",b)),children:[d.jsx(Su,{size:13}),P9()]}),d.jsxs("button",{className:"node-action",title:r9({branch:je(t.branchName)}),...nr(b=>_(t.id,t.branchName,"files",b)),children:[d.jsx(op,{size:13}),mUe()]}),l&&c&&d.jsx("a",{className:"node-action node-action-ext",title:g0({name:je(t.branchName)}),"aria-label":g0({name:je(t.branchName)}),href:up(l,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:d.jsx(Op,{size:13})})]}),d.jsx(ll,{type:"source",position:at.Bottom}),v.rect&&d.jsx(Obt,{exp:t,runs:s,latestRun:r,parentSlug:o,anchor:v.rect,onOpenLogs:s.length>0?b=>f(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),Gbt=R.memo(function({data:n}){const{count:t,onShowProjectScope:r}=n;return d.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-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:WUe(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[d.jsx(ll,{type:"target",position:at.Top}),d.jsx(X9,{size:14}),d.jsxs("span",{className:"elided-node-label",children:[t===1?eUe():YFe({count:Ht(t)}),d.jsx("span",{className:"elided-node-sub",children:$Ue()})]}),d.jsx(ll,{type:"source",position:at.Bottom})]})}),Vbt={exp:qbt,elided:Gbt},EM={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Wbt={...EM.style,strokeDasharray:"4 4"};function Kbt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:c}=R.useMemo(()=>{const f=new Map;for(const b of n){const w=f.get(b.experimentId);w?w.push(b):f.set(b.experimentId,[b])}for(const b of f.values())b.sort((w,y)=>w.createdAt-y.createdAt);const _=[],h=[],m=b=>!a||b.exp.chatSessionId===a,g=Fbt(Pbt(e),m),S=new Map(e.map(b=>[b.id,b.slug]));function k(b,w,y){const C=w-C2(b)/2;if(b.kind==="exp"){const T=f.get(b.exp.id)??[];_.push({id:b.exp.id,type:"exp",position:{x:C,y},data:{exp:b.exp,latestRun:T[T.length-1]??null,runs:T,isBaseline:!b.exp.parentExperimentId,parentSlug:b.exp.parentExperimentId?S.get(b.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else _.push({id:b.id,type:"elided",position:{x:C,y:y+(KC-Hbt)/2},data:{count:b.count,onShowProjectScope:o}});if(b.children.length===0)return;const z=b.children.reduce((T,j)=>T+_0(j),0)+h0*(b.children.length-1);let N=w-z/2;for(const T of b.children){const j=_0(T),D=b.kind==="elided"||T.kind==="elided";h.push({id:`e-${Z_(b)}-${Z_(T)}`,source:Z_(b),target:Z_(T),...D?{style:Wbt}:{}}),k(T,N+j/2,y+KC+Bbt),N+=j+h0}}let v=0;for(const b of g){const w=_0(b);k(b,v+w/2,0),v+=w+h0}return{nodes:_,edges:h}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,a,o]);return e.length===0?d.jsxs("div",{className:WC,children:[d.jsx("p",{className:"empty-state-title",children:NUe()}),d.jsx("p",{className:"empty-state-hint",children:dUe()})]}):l.length===0&&a?d.jsxs("div",{className:WC,children:[d.jsx("p",{className:"empty-state-title",children:SUe()}),d.jsx("p",{className:"empty-state-hint",children:lUe()})]}):d.jsx(nbt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:c,nodeTypes:Vbt,defaultEdgeOptions:EM,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:Rbt,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:d.jsx(obt,{variant:ro.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const XC=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),qb=(e,n)=>e.id===n.id&&e.view===n.view,Qc=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,i4=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Gf=(e,n,t)=>`${e}:${n??""}:${i4(t)}`,NM=e=>({...e,lineScrollRequest:void 0});function Vf(e){return typeof e=="object"&&"path"in e?NM(e):e}const Jc=(e,n)=>e.branch===n.branch;function zt(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:${i4(e)}`:`experiment:${e.id}:${e.view}`}function Wf(e,n){const t=e.filter(r=>zt(r)!==n);return t.length===e.length?e:t}function Xbt(e){return e!==void 0}function YC(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===Jf&&n){const r={path:Kb,source:"artifacts"};return{...t,rightTab:r,tabHistory:[r],fileTabs:[r],contentTabOrder:[zt(r)],panelOpen:!0}}if(e===iE){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(zt),panelOpen:!0}}if(e===aE){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(zt),panelOpen:!0}}return t}function Ybt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zbt(e,n,t,r,s){let a=e,o;const l=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const f=m=>{const g=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[S,k]=[g(a),g(m)];return S===k?"":S.startsWith(`${k}/`)?S.slice(k.length).replace(/^\/+/,""):null},_=a.startsWith("/")&&c?f(c):null,h=a.startsWith("/")&&l?f(l):null;if(!a.startsWith("/"))o=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(h!==null)a=h;else{const m=s?Ybt(s):"[^/]+",g=a.match(new RegExp(`/files/${m}/(.+)$`)),S=g?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=g||S?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(g)return{path:g[1],source:"artifacts"};S?(o=S[1],a=S[2]):k&&(a=k[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function Qbt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const E2="orx:panel-width",zM="orx:experiments-view";function Jbt(){try{return localStorage.getItem(zM)==="tree"?"tree":"table"}catch{return"table"}}const Bd=360,evt=10,tvt=272,nvt=380,rvt=tvt+56,svt=80,ivt=48;function p0(){return Math.max(Bd,window.innerWidth-rvt-nvt)}function avt(){const e=p0();try{const n=Number(localStorage.getItem(E2));if(Number.isFinite(n)&&n>=Bd)return Math.min(n,e)}catch{}return Math.max(Bd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function Kf(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 ZC(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function ovt(){var ml;const[e,n]=R.useState(null),[t,r]=R.useState(null),s=R.useRef(void 0);s.current=t==null?void 0:t.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),c=R.useRef(null),[f,_]=R.useState(null),[h,m]=R.useState([]),[g,S]=R.useState([]),k=R.useRef(g);k.current=g;const v=R.useRef(new Map),b=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),z=R.useRef(new Map),N=R.useRef(0),T=R.useRef(h);T.current=h;const[j,D]=R.useState(null),[I,L]=R.useState(Jbt),[U,q]=R.useState("project"),W=R.useRef(null),{open:Z,setOpen:X,ref:J}=_o(W),[ee,$]=R.useState(null),[B,H]=R.useState(!1),K=h.every(se=>se.chatSessionId),G=ee&&K?U:"project",ie=R.useMemo(()=>G!=="agent"?h:h.filter(se=>se.chatSessionId===ee),[h,G,ee]),ve=R.useMemo(()=>{if(G!=="agent")return g;const se=new Set(ie.map(ye=>ye.id));return g.filter(ye=>se.has(ye.experimentId))},[g,ie,G]);R.useEffect(()=>{try{localStorage.setItem(zM,I)}catch{}},[I]);const[ce,re]=R.useState(null),[P,oe]=R.useState("experiments"),[ue,de]=R.useState([]),[ge,Ee]=R.useState(!1),[Ae,He]=R.useState(!1),[Re,Ie]=R.useState(!1),[nt,Rt]=R.useState([]),[At,bt]=R.useState([]),Mt=R.useRef(new Map),Ct=R.useRef(0),[ut,ht]=R.useState([]),[we,Le]=R.useState([]),[Ge,et]=R.useState([]),[st,Dt]=R.useState([]),[vt,It]=R.useState(null),[Zt,cn]=R.useState("files"),[xt,Sn]=R.useState(new Set),[un,Xe]=R.useState(!1),[lt,gn]=R.useState(!1),[Cr,Be]=R.useState(avt),[Qe,St]=R.useState(!0),[fn,nn]=R.useState(!1),[Ns,cs]=R.useState(!1),[us,zs]=R.useState("chat"),[Wi,ei]=R.useState(null),ti=R.useRef(new Map),jr=R.useRef(YC()),Pr=R.useRef(null),Tr=R.useRef(!1),En=R.useRef(ue);En.current=ue;const sn=R.useRef(st);sn.current=st;const kn=R.useRef(null),pt=R.useCallback(se=>{const ye=[...se];sn.current=ye,Dt(ye)},[]),Yn=R.useCallback(se=>{kn.current=se,It(se)},[]),Fr=R.useCallback(se=>{const ye=zt(se);Rt(ae=>Wf(ae,ye)),bt(ae=>Wf(ae,ye)),ht(ae=>Wf(ae,ye)),Le(ae=>Wf(ae,ye)),et(ae=>Wf(ae,ye));const Ne=Zn.current;Ne&&"path"in se&&Mt.current.delete(Gf(Ne,Pr.current,se));const Y=En.current.filter(ae=>zt(ae)!==ye);En.current=Y,de(Y)},[]),Ke=R.useCallback(se=>{Tr.current=!1;const ye=zt(se),Ne=[...En.current.filter(Y=>zt(Y)!==ye),Vf(se)];En.current=Ne,de(Ne),oe(se)},[]),ft=R.useCallback((se,ye)=>{Tr.current=!1;const Ne=zt(se),Y=kn.current,ae=Hit({order:sn.current,previewKey:Y?zt(Y):null},Ne,ye);ae.replacedKey&&Y&&typeof Y!="string"&&zt(Y)===ae.replacedKey&&Fr(Y),pt(ae.order),ae.previewKey===null?Yn(null):ae.previewKey===Ne&&Yn(Vf(se));const be=[...En.current.filter(me=>zt(me)!==Ne),Vf(se)];En.current=be,de(be),oe(se)},[Fr,pt,Yn]),Mn=R.useCallback(se=>{const ye=kn.current;ye&&zt(ye)===zt(se)&&Yn(null)},[Yn]);R.useEffect(()=>{let se=!1;const ye=Y=>{const ae=kn.current,be=Y.target;if(be instanceof Element&&be.closest("input, textarea, [contenteditable='true']")!==null){se=!1;return}if(ae&&zt(ae)===zt(jr.current.rightTab)&&(Y.metaKey||Y.ctrlKey)&&!Y.altKey&&!Y.shiftKey&&Y.key.toLowerCase()==="k"){Y.preventDefault(),se=!0;return}if(se&&Y.key==="Enter"){Y.preventDefault(),se=!1;const Te=kn.current;Te&&Mn(Te);return}se=!1},Ne=()=>{se=!1};return window.addEventListener("keydown",ye),window.addEventListener("blur",Ne),window.addEventListener("pointerdown",Ne),()=>{window.removeEventListener("keydown",ye),window.removeEventListener("blur",Ne),window.removeEventListener("pointerdown",Ne)}},[Mn]);const dn=R.useCallback((se,ye)=>{Tr.current=!1;const Ne=zt(se),Y=kn.current;Y&&zt(Y)===Ne&&Yn(null);const ae=Pit({order:sn.current,previewKey:Y?zt(Y):null},Ne,En.current.map(zt));pt(ae.order);const be=En.current.filter(Te=>zt(Te)!==Ne);if(En.current=be,de(be),!ye)return;const me=ae.fallbackKey?be.find(Te=>zt(Te)===ae.fallbackKey):void 0;me?oe(me):(Xe(!1),gn(!1))},[pt,Yn]),rr=R.useCallback(se=>{se!=="chat"&&(Tr.current=!1),zs(se)},[]);jr.current={rightTab:Vf(P),tabHistory:ue,experimentsTabOpen:ge,filesTabOpen:Ae,artifactsTabOpen:Re,expTabs:nt,fileTabs:At,planTabs:ut,subagentTabs:we,codeTabs:Ge,contentTabOrder:sn.current,previewTab:kn.current,filesView:Zt,filesToggled:xt,selectedRunId:ce,scope:U,panelOpen:un,panelMax:lt};const As=R.useCallback(se=>{const ye=Pr.current;if(ye===se)return;ye&&ti.current.set(ye,jr.current);let Ne=se?ti.current.get(se):void 0;if(!Ne){const Y=se===Jf&&s.current===!1&&!a.current;Y&&(a.current=!0,H(!0)),Ne=YC(se??void 0,Y)}if(se&&Tr.current){Tr.current=!1;const Y="experiments";Ne={...Ne,rightTab:Y,tabHistory:[...Ne.tabHistory.filter(ae=>zt(ae)!==zt(Y)),Y],experimentsTabOpen:!0,panelOpen:!0}}oe(Ne.rightTab),En.current=Ne.tabHistory,de(Ne.tabHistory),Ee(Ne.experimentsTabOpen),He(Ne.filesTabOpen),Ie(Ne.artifactsTabOpen),Rt(Ne.expTabs),bt(Ne.fileTabs),ht(Ne.planTabs),Le(Ne.subagentTabs),et(Ne.codeTabs),pt(Ne.contentTabOrder),Yn(Ne.previewTab),cn(Ne.filesView),Sn(Ne.filesToggled),re(Ne.selectedRunId),q(Ne.scope),Xe(Ne.panelOpen),gn(Ne.panelMax),Pr.current=se,$(se)},[pt,Yn]),js=(t==null?void 0:t.onboardingCompleted)??!1,[Mr,Cn]=R.useState(!1),ni=R.useCallback(()=>Cn(!0),[]),qt=R.useCallback(async()=>{const se=await h7({tourCompleted:!0});r(ye=>ye&&{...ye,tourCompleted:se.tourCompleted}),Cn(!1)},[]),fs=R.useCallback(async()=>{await qt(),cs(!0)},[qt]);R.useEffect(()=>{!f||!y1(f)||fn||!js||t!=null&&t.tourCompleted||ni()},[f,fn,js,ni,t==null?void 0:t.tourCompleted]);const Zn=R.useRef(f);Zn.current=f;const br=R.useCallback(()=>{zs("chat"),Ee(!0),Ke("experiments"),Xe(!0),Pr.current||(Tr.current=!0)},[Ke]),ds=R.useCallback(()=>{l(null),n(null),r(null),Promise.allSettled([xWe(),wWe()]).then(([se,ye])=>{const Ne=[];se.status==="fulfilled"?(n(se.value),_(Y=>{var ae;return Y&&se.value.some(be=>be.id===Y)?Y:((ae=se.value[0])==null?void 0:ae.id)??null})):Ne.push(qF()),ye.status==="fulfilled"?(c.current=ye.value.preferredAgent,r(ye.value)):Ne.push(sU()),Ne.length>0&&l(lU({items:new Intl.ListFormat(E()).format(Ne)}))})},[]);R.useEffect(()=>{ds()},[ds]);const Ki=R.useRef(Promise.resolve()),Ci=R.useRef(0),ri=R.useCallback(se=>{const ye=++Ci.current;r(Y=>Y&&{...Y,preferredAgent:se});const Ne=Ki.current.then(()=>h7({preferredAgent:se})).then(Y=>{c.current=Y.preferredAgent,ye===Ci.current&&r(ae=>ae&&{...ae,preferredAgent:Y.preferredAgent})}).catch(Y=>{throw ye===Ci.current&&r(ae=>ae&&{...ae,preferredAgent:c.current}),Y});return Ki.current=Ne.catch(()=>{}),Ne},[]);R.useEffect(()=>{const se=()=>Be(ye=>Math.min(ye,p0()));return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[]);const si=R.useCallback(se=>{y.current=!1,C.current.clear(),z.current.clear();const ye=++N.current;W2(se).then(Ne=>{if(Zn.current!==se||w.current!==se||N.current!==ye)return;C.current=new Map(Ne.map(ae=>[ae.id,ae]));const Y=[...z.current.values()].some(ae=>{const be=C.current.get(ae.id);return!be||be.status!=="running"&&be.updatedAt<=ae.updatedAt});z.current.clear();for(const ae of Ne){const be=v.current.get(ae.id);(!be||be.updatedAt{const be=new Map(Ne.map(me=>[me.id,me]));for(const me of ae){const Te=be.get(me.id);(!Te||Te.updatedAt<=me.updatedAt)&&be.set(me.id,me)}return[...be.values()]}),y.current=!0,Y&&br()}).catch(()=>{N.current===ye&&z.current.clear()})},[br]);R.useEffect(()=>{if(!f)return;const se=Pr.current;se&&ti.current.set(se,jr.current),Pr.current=null,Tr.current=!1,$(null),w.current=f,v.current.clear(),b.current.clear(),AWe(f).catch(()=>{}),m([]),S([]),D(null),re(null),Rt([]),bt([]),H(!1),ht([]),Le([]),et([]),pt([]),Yn(null),cn("files"),Sn(new Set),En.current=[],de([]),oe("experiments"),Ee(!1),He(!1),Ie(!1),Xe(!1),gn(!1),q("project"),TWe(f).then(m).catch(()=>{}),si(f),m7(f).then(D).catch(()=>{})},[si,f,pt,Yn]);const Er=R.useCallback(()=>{const se=Zn.current;se&&m7(se).then(D).catch(()=>{})},[]),vr=R.useCallback(()=>{Er(),zs("chat"),Ie(!0),Ke("artifacts"),Xe(!0)},[Er,Ke]);_Xe({onReconnect:()=>{const se=Zn.current;se&&(w.current=se,v.current.clear(),b.current.clear(),si(se))},onRun:se=>{if(se.projectId!==Zn.current||se.projectId!==w.current)return;const ye=v.current.get(se.id),Ne=b.current.has(se.id);if(ye&&ye.updatedAt>se.updatedAt||(v.current.set(se.id,se),b.current.add(se.id),S(be=>Kf(be,se)),se.status!=="running"||(ye==null?void 0:ye.status)==="running"))return;const Y=C.current.get(se.id),ae=y.current&&(!Y||Y.status!=="running"&&Y.updatedAt<=se.updatedAt);Ne&&ye||ae?br():y.current||z.current.set(se.id,se)},onExperiment:se=>{se.projectId===Zn.current&&m(ye=>Kf(ye,se))},onProject:se=>{n(ye=>ye?Kf(ye,se):[se])},onArtifacts:se=>{se===Zn.current&&Er()}});const Ts=R.useCallback(()=>q("project"),[]),xr=R.useCallback((se,ye="overview",Ne="preview")=>{const Y={id:se,view:ye};Rt(ae=>ae.some(be=>qb(be,Y))?ae:[...ae,Y]),ft(Y,Ne),Xe(!0)},[ft]),ii=R.useCallback((se,ye="preview")=>{const Ne=k.current.filter(ae=>ae.id===se||ae.id.startsWith(se)),Y=Ne.length===1?Ne[0]:null;Y&&(re(Y.id),xr(Y.experimentId,"terminal",ye))},[xr]),Ms=R.useMemo(()=>new Map(h.map(se=>{var ye;return[se.id,((ye=se.title)==null?void 0:ye.trim())||se.slug||Ya()]})),[h]),Nn=ZC(Ms),Gn=R.useMemo(()=>{const se=new Map;for(const ye of g)se.set(ye.id,Nn.get(ye.experimentId)??Ya());return se},[Nn,g]),sr=ZC(Gn),Xi=R.useCallback(se=>{const ye=sr.get(se);if(ye)return ye;const Ne=[...sr].filter(([Y])=>Y.startsWith(se));return Ne.length===1?Ne[0][1]:""},[sr]),Nr=R.useCallback(se=>{const ye=Nn.get(se);if(ye)return ye;const Ne=[...Nn].filter(([Y])=>Y.startsWith(se));return Ne.length===1?Ne[0][1]:""},[Nn]),Ei=R.useCallback((se,ye="preview")=>{const Ne=T.current.filter(Y=>Y.id===se||Y.id.startsWith(se));Ne.length===1&&xr(Ne[0].id,"overview",ye)},[xr]),ai=R.useCallback(se=>{const ye=nt.findIndex(Ne=>qb(Ne,se));ye!==-1&&(Rt(Ne=>Ne.filter((Y,ae)=>ae!==ye)),dn(se,zt(P)===zt(se)))},[nt,dn,P]),Rr=R.useCallback((se,ye="preview")=>{const Ne=NM(se);bt(Y=>{const ae=Y.findIndex(me=>Qc(me,se));if(ae===-1)return[...Y,Ne];const be=Y.slice();return be[ae]=Ne,be}),ft(se,ye),Xe(!0)},[ft]),Aa=R.useCallback((se,ye,Ne,Y,ae,be)=>{const me=e==null?void 0:e.find(Vn=>Vn.id===f),Te=Zbt(se,me==null?void 0:me.repoPath,ye,(me==null?void 0:me.artifactsDir)??(me==null?void 0:me.filesDir),me==null?void 0:me.slug);if(!Te)return null;const We=ae?T.current.find(Vn=>Vn.id===ae||ae.length>=6&&Vn.id.startsWith(ae)):void 0,bn=Ne??(We==null?void 0:We.branchName),zn=Te.source==null||Te.source==="repo";return bn&&zn&&(Te.ref=bn),be&&!Te.ref&&zn&&(Te.branchLabel=be),Y!=null&&(Te.line=Y,Te.lineScrollRequest=++Ct.current),Te},[e,f]),hs=R.useCallback((se,ye,Ne,Y,ae,be,me="preview")=>{const Te=Aa(se,ye,Ne,Y,ae,be);Te&&Rr(Te,me)},[Rr,Aa]),Wu=R.useCallback(se=>Rr({path:se,source:"artifacts"},"keepOpen"),[Rr]),go=R.useCallback((se,ye,Ne,Y,ae,be="preview")=>{const me=Aa(se,ye,ae,Ne,Y);me&&Rr(me,be)},[Rr,Aa]),_s=R.useCallback((se,ye)=>{Mn(se),ye()},[Mn]),$n=R.useCallback(se=>{const ye=At.findIndex(Ne=>Qc(Ne,se));ye!==-1&&(bt(Ne=>Ne.filter((Y,ae)=>ae!==ye)),f&&Mt.current.delete(Gf(f,ee,se)),ee===Jf&&Qc(se,{path:Kb,source:"artifacts"})&&H(!1),dn(se,zt(P)===zt(se)))},[ee,At,dn,f,P]),_c=R.useCallback(se=>{se.lineScrollRequest!==void 0&&oe(ye=>typeof ye!="object"||!("path"in ye)||!Qc(ye,se)||ye.lineScrollRequest!==se.lineScrollRequest?ye:Vf(ye))},[]),Dr=R.useCallback((se,ye,Ne,Y="preview")=>{const ae={kind:"plan",sessionId:ye,promptId:Ne,plan:se};ht(be=>{const me=be.findIndex(We=>We.promptId===Ne);if(me===-1)return[...be,ae];const Te=be.slice();return Te[me]=ae,Te}),ft(ae,Y),Xe(!0)},[ft]),Qr=R.useCallback(se=>{const ye=ut.findIndex(Ne=>Ne.promptId===se.promptId);ye!==-1&&(ht(Ne=>Ne.filter((Y,ae)=>ae!==ye)),dn(se,zt(P)===zt(se)))},[dn,ut,P]),Jr=R.useCallback((se,ye,Ne,Y="preview")=>{const ae={kind:"subagent",sessionId:se,spawnPartId:ye,label:Ne};Le(be=>be.some(me=>me.spawnPartId===ye)?be:[...be,ae]),ft(ae,Y),Xe(!0)},[ft]),ps=R.useCallback(se=>{const ye=we.findIndex(Ne=>Ne.spawnPartId===se.spawnPartId);ye!==-1&&(Le(Ne=>Ne.filter((Y,ae)=>ae!==ye)),dn(se,zt(P)===zt(se)))},[dn,P,we]),[ja,oi]=R.useState({});R.useEffect(()=>{if(oi(me=>{const Te=new Set(we.map(We=>We.spawnPartId));return Object.keys(me).every(We=>Te.has(We))?me:Object.fromEntries(Object.entries(me).filter(([We])=>Te.has(We)))}),we.length===0)return;let se=!0;const ye=new Set,Ne=(me,Te,We)=>{oi(bn=>{var Vn;let zn=bn;for(const ir of Te)if(!(We&&ye.has(ir.spawnPartId)))for(const ta of me){const na=yy(ta.parts,ir.spawnPartId);if(!na)continue;We||ye.add(ir.spawnPartId);const xo={label:Mlt(na),running:((Vn=na.state)==null?void 0:Vn.status)==="running"},Ta=zn[ir.spawnPartId];(!Ta||Ta.label!==xo.label||Ta.running!==xo.running)&&(zn===bn&&(zn={...bn}),zn[ir.spawnPartId]=xo);break}return zn})};let Y=0;const ae=()=>{const me=++Y;for(const Te of new Set(we.map(We=>We.sessionId)))au(Te).then(({messages:We})=>{se&&me===Y&&Ne(We,we.filter(bn=>bn.sessionId===Te),!0)}).catch(()=>{})};ae();const be=dd(me=>{if(me.type==="reconnected"){ye.clear(),ae();return}if(me.type!=="message")return;const Te=we.filter(We=>We.sessionId===me.sessionId);Te.length&&Ne([me.message],Te,!1)});return()=>{se=!1,be()}},[we]);const li=R.useCallback((se,ye,Ne="files",Y="preview")=>{const ae={code:!0,experimentId:se,branch:ye,view:Ne,toggled:new Set};et(be=>be.some(me=>Jc(me,ae))?be.map(me=>Jc(me,ae)?{...me,experimentId:se,view:Ne}:me):[...be,ae]),ft(ae,Y),Xe(!0)},[ft]),bo=R.useCallback((se,ye)=>{et(Ne=>Ne.map(Y=>Jc(Y,se)?{...Y,...ye}:Y))},[]),Yi=R.useCallback(se=>{const ye=Ge.findIndex(Ne=>Jc(Ne,se));ye!==-1&&(et(Ne=>Ne.filter((Y,ae)=>ae!==ye)),dn(se,zt(P)===zt(se)))},[Ge,dn,P]),pc=R.useCallback(()=>{zs("chat"),He(!0),Ke("files"),Xe(!0)},[Ke]),Ni=R.useCallback(se=>{se==="experiments"?Ee(!1):se==="files"?He(!1):Ie(!1),dn(se,P===se)},[dn,P]),es=se=>{se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId);const Ne=document.body.style.userSelect;document.body.style.userSelect="none";const Y=lt,ae=se.clientX,be=Cr;let me=!1;function Te(){window.removeEventListener("pointermove",We),window.removeEventListener("pointerup",Te),window.removeEventListener("pointercancel",Te),document.body.style.userSelect=Ne}function We(bn){if(Y){const ta=bn.clientX-ae;if(me||taVn+svt){gn(!0);return}gn(!1);const ir=Math.min(Math.max(zn,Bd),Vn);Be(ir);try{localStorage.setItem(E2,String(ir))}catch{}}window.addEventListener("pointermove",We),window.addEventListener("pointerup",Te),window.addEventListener("pointercancel",Te)},Zi=(se,ye)=>{n(Ne=>Ne?Kf(Ne,se):[se]),_(se.id),nn(!1),ye&&(ei({projectId:se.id,message:ye}),rr("git"))},zi=se=>{n(ye=>ye&&ye.filter(Ne=>Ne.id!==se)),f===se&&_(null)},Qn=typeof P=="object"&&"id"in P?P:null,Hn=typeof P=="object"&&"path"in P?P:null,Ai=ee===Jf&&B?At.find(se=>Qc(se,{path:Kb,source:"artifacts"})):void 0,hl=Ai?[Ai]:[],Rs=typeof P=="object"&&"kind"in P&&P.kind==="plan"?P:null,Jn=typeof P=="object"&&"kind"in P&&P.kind==="subagent"?P:null,_l=typeof P=="object"&&"code"in P?P:null,an=_l?Ge.find(se=>Jc(se,_l))??null:null,ci=new Map;for(const se of[...nt,...At,...ut,...we,...Ge])ci.set(zt(se),se);const ui=Ai?zt(Ai):null,Qi=st.filter(se=>se!==ui).map(se=>ci.get(se)).filter(Xbt),Ji=se=>vt!==null&&zt(vt)===zt(se),vo=se=>d.jsx(Xo,{active:Hn!==null&&Qc(Hn,se),label:se.path.split("/").pop()||se.path,icon:d.jsx(Y9,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>Ke(se),onPromote:()=>Mn(se),onClose:()=>$n(se)},`file:${i4(se)}`),Kt=(e==null?void 0:e.find(se=>se.id===f))??null,Ur=Qn?h.find(se=>se.id===Qn.id)??null:null,ea=an?h.find(se=>se.id===an.experimentId)??null:null,pl=se=>{var Ne,Y;if("path"in se)return vo(se);if("id"in se){const ae=h.find(be=>be.id===se.id);return d.jsx(Xo,{active:Qn!==null&&qb(Qn,se),label:ae?ae.title||ae.slug:"…",icon:se.view==="overview"?d.jsx(MGe,{size:12,style:{flexShrink:0}}):d.jsx(Su,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>Ke(se),onPromote:()=>Mn(se),onClose:()=>ai(se)},zt(se))}if("kind"in se&&se.kind==="plan")return d.jsx(Xo,{active:Rs!==null&&Rs.promptId===se.promptId,label:o9(),icon:d.jsx(G2,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>Ke(se),onPromote:()=>Mn(se),onClose:()=>Qr(se)},zt(se));if("kind"in se)return d.jsx(Xo,{active:Jn!==null&&Jn.spawnPartId===se.spawnPartId,label:((Ne=ja[se.spawnPartId])==null?void 0:Ne.label)??se.label??dU(),shimmer:((Y=ja[se.spawnPartId])==null?void 0:Y.running)??!1,icon:d.jsx(V2,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>Ke(se),onPromote:()=>Mn(se),onClose:()=>ps(se)},zt(se));const ye=h.find(ae=>ae.id===se.experimentId);return d.jsx(Xo,{active:an!==null&&Jc(an,se),label:(ye==null?void 0:ye.slug)??se.branch,icon:d.jsx(fd,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>Ke(se),onPromote:()=>Mn(se),onClose:()=>Yi(se)},zt(se))};if(o)return d.jsx("div",{className:"app flex flex-col h-full",children:d.jsxs("div",{className:XC,children:[d.jsx("p",{children:o}),d.jsx("button",{className:Xr,onClick:ds,children:A2()})]})});if(e===null||t===null)return d.jsx("div",{className:"app flex flex-col h-full",children:d.jsx("div",{className:XC,children:d.jsx("span",{className:Lt})})});if(e.length===0)return d.jsx("div",{className:"app flex flex-col h-full",children:js?d.jsx(Bk,{projects:e,onOpen:_,onCreated:Zi,onDeleted:zi}):d.jsx(oht,{preferredAgent:t.preferredAgent,onDone:(se,ye)=>{zot(),c.current=ye,n([se]),_(se.id),r(Ne=>({...Ne??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:ye}))}})});const mc=d.jsx(iht,{projectName:((ml=e.find(se=>se.id===f))==null?void 0:ml.name)??"",onHome:()=>nn(!0),onNewProject:()=>cs(!0),onRepository:()=>rr("git"),onCollapse:()=>St(!1)});return d.jsxs("div",{className:"app flex flex-col h-full",children:[d.jsx(Qit,{}),fn?d.jsx(Bk,{projects:e,onOpen:se=>{_(se),nn(!1)},onCreated:Zi,onDeleted:zi}):d.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[f&&d.jsx(qlt,{projectId:f,projectName:(Kt==null?void 0:Kt.name)??"",railHeader:mc,railOpen:Qe,onShowRail:()=>St(!0),mainView:us,onSelectMainView:rr,experimentsActive:us==="chat"&&un&&P==="experiments",filesActive:us==="chat"&&un&&P==="files",artifactsActive:us==="chat"&&un&&P==="artifacts",onOpenExperiments:br,onOpenArtifacts:vr,onOpenFile:go,onOpenRun:ii,runExperimentName:Xi,onOpenExperiment:Ei,experimentName:Nr,onOpenPlan:Dr,onOpenSubagent:Jr,onOpenWorktree:pc,onOpenDemoWelcome:Kt&&y1(Kt.id)?ni:void 0,onActiveSessionChange:As,preferredAgent:t.preferredAgent,onPreferredAgentChange:ri,children:us==="skills"?d.jsx(Bdt,{project:Kt}):us!=="chat"?d.jsx(hot,{tab:us,project:Kt,githubPublicationError:Wi&&Wi.projectId===(Kt==null?void 0:Kt.id)?Wi.message:null,onProjectUpdate:se=>{n(ye=>ye?Kf(ye,se):[se]),se.githubEnabled&&ei(null)},onSelectTab:rr}):null}),us==="chat"&&un&&d.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-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg overflow-hidden ${rv} ${lt?"max":""}`,style:lt?void 0:{width:Cr},"data-onboarding":"experiments",children:[d.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${lt?"cursor-e-resize":"cursor-col-resize"}`,title:lt?nF():QP(),onPointerDown:es}),d.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:[d.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:[hl.map(vo),Ae&&d.jsx(Xo,{active:P==="files",label:kF(),icon:d.jsx(fd,{size:12,style:{flexShrink:0}}),onSelect:()=>Ke("files"),onClose:()=>Ni("files")}),Re&&d.jsx(Xo,{active:P==="artifacts",label:FP(),icon:d.jsx(F2,{size:12,style:{flexShrink:0}}),onSelect:()=>Ke("artifacts"),onClose:()=>Ni("artifacts")}),ge&&d.jsx(Xo,{active:P==="experiments",label:xF(),icon:d.jsx(Z9,{size:12,style:{flexShrink:0}}),onSelect:()=>Ke("experiments"),onClose:()=>Ni("experiments")}),Qi.map(pl)]}),d.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[d.jsx("button",{className:mn,title:lt?Zw():Yw(),"aria-label":lt?Zw():Yw(),onClick:()=>gn(se=>!se),children:lt?d.jsx(RVe,{size:14}):d.jsx(jVe,{size:14})}),d.jsx("button",{className:mn,title:Ww(),"aria-label":Ww(),onClick:()=>{Tr.current=!1,Xe(!1),gn(!1)},children:d.jsx(Gr,{size:14})})]})]}),P==="artifacts"?d.jsx("div",{className:Xa,children:Kt&&d.jsx(Tdt,{project:Kt,artifacts:j,onChanged:Er,onOpenFile:Wu,onOpenStorage:()=>rr("storage")},Kt.id)}):P==="experiments"?d.jsxs("div",{className:Xa,children:[d.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[d.jsx("span",{style:{flex:1}}),d.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[d.jsxs("div",{className:"option-picker relative inline-flex",ref:J,children:[d.jsx("button",{ref:W,className:`${Wd} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${G==="agent"?" active":""}`,title:dF({scope:G==="agent"?Kw():Xw()}),"aria-label":zF(),"aria-expanded":Z,onClick:()=>X(se=>!se),children:d.jsx(mVe,{size:16,strokeWidth:2.5})}),Z&&d.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[d.jsxs("button",{className:Vr,"aria-pressed":G==="agent",disabled:!ee||!K,title:ee?K?void 0:MF():HF(),onClick:()=>{q("agent"),X(!1)},children:[d.jsx("span",{children:Kw()}),G==="agent"&&d.jsx(os,{size:13})]}),d.jsxs("button",{className:Vr,"aria-pressed":G==="project",onClick:()=>{q("project"),X(!1)},children:[d.jsx("span",{children:Xw()}),G==="project"&&d.jsx(os,{size:13})]})]})]}),d.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":mF(),children:[d.jsx("button",{className:I==="table"?"active":"","aria-pressed":I==="table",onClick:()=>L("table"),children:mU()}),d.jsx("button",{className:I==="tree"?"active":"","aria-pressed":I==="tree",onClick:()=>L("tree"),children:xU()})]})]})]}),d.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:I==="tree"?Kt&&d.jsx(Kbt,{experiments:h,runs:ve,project:Kt,onOpenView:xr,onOpenCode:li,agentSessionId:G==="agent"?ee:null,onShowProjectScope:Ts}):d.jsx(bht,{runs:ve,emptyHint:G==="agent"&&h.length>0?OF():void 0,experiments:ie,onOpen:(se,ye)=>{xr(se.id,"overview",ye)},onOpenLogs:(se,ye,Ne)=>{re(ye),xr(se,"terminal",Ne)},onOpenCode:(se,ye)=>{const Ne=h.find(Y=>Y.id===se);Ne&&li(Ne.id,Ne.branchName,"files",ye)},onCancel:cE})})]}):P==="files"?d.jsx("div",{className:Xa,children:Kt?d.jsx(xdt,{sessionId:ee??void 0,project:Kt,view:Zt,toggled:xt,onViewChange:cn,onToggledChange:Sn,onOpenFile:(se,ye,Ne,Y)=>hs(se,ye,Ne,void 0,void 0,void 0,Y)},`files:${ee??`project:${Kt.id}`}`):d.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:d.jsx("div",{className:fu,children:d.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:[d.jsx(Q9,{size:22}),d.jsx("p",{children:eU()})]})})})}):Hn?d.jsx("div",{className:Xa,children:f&&d.jsx(sht,{projectId:f,path:Hn.path,source:Hn.source,sessionId:Hn.source==="artifacts"?ee??void 0:Hn.sessionId,gitRef:Hn.ref,line:Hn.line,branchLabel:Qbt(Hn,Kt==null?void 0:Kt.baselineBranch),onOpenFile:(se,ye,Ne,Y)=>_s(Hn,()=>hs(se,ye,Ne,void 0,void 0,void 0,Y)),scrollPosition:Mt.current.get(Gf(f,ee,Hn)),onScrollPositionChange:se=>{Mt.current.set(Gf(f,ee,Hn),se)},lineScrollRequest:Hn.lineScrollRequest,onLineScrollRequestHandled:()=>_c(Hn),onEdit:()=>Mn(Hn)},Gf(f,ee,Hn))}):Rs?d.jsx("div",{className:Xa,children:d.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:d.jsx(ga,{text:Rs.plan,onOpenFile:(se,ye,Ne,Y,ae)=>_s(Rs,()=>hs(se,Rs.sessionId,Y,ye,Ne,void 0,ae))})})}):Jn?d.jsx(Glt,{sessionId:Jn.sessionId,spawnPartId:Jn.spawnPartId,onOpenFile:(se,ye,Ne,Y,ae)=>_s(Jn,()=>go(se,Jn.sessionId,ye,Ne,Y,ae)),onOpenRun:(se,ye)=>_s(Jn,()=>ii(se,ye)),runExperimentName:Xi,onOpenExperiment:(se,ye)=>_s(Jn,()=>Ei(se,ye)),experimentName:Nr,onOpenSubagent:(se,ye,Ne)=>_s(Jn,()=>Jr(Jn.sessionId,se,ye,Ne))},Jn.spawnPartId):an?d.jsx("div",{className:Xa,children:f&&Kt&&an&&ea&&d.jsx(bdt,{projectId:f,project:Kt,experiment:ea,view:an.view,toggled:an.toggled,onViewChange:se=>bo(an,{view:se}),onToggledChange:se=>bo(an,{toggled:se}),onOpenFile:(se,ye,Ne,Y)=>_s(an,()=>hs(se,ye,Ne,void 0,void 0,ea.branchName,Y))},`code:${an.branch}`)}):d.jsx("div",{className:Xa,children:Qn&&Ur&&Kt&&d.jsx(Wdt,{experiment:Ur,project:Kt,view:Qn.view,runs:g,selectedRunId:ce,onSelectRun:re,parentExperiment:h.find(se=>se.id===Ur.parentExperimentId)??null,onOpenView:(se,ye,Ne)=>{ye&&re(ye),_s(Qn,()=>xr(Ur.id,se,Ne))},onOpenCode:(se,ye)=>_s(Qn,()=>li(Ur.id,Ur.branchName,se,ye))},`${Qn.id}:${Qn.view}`)})]})]}),Ns&&d.jsx($j,{onClose:()=>cs(!1),onCreated:(se,ye)=>{cs(!1),Zi(se,ye)}}),Mr&&!fn&&Kt&&y1(Kt.id)&&d.jsx(vht,{onClose:qt,onCreateProject:fs})]})}const lvt=E();document.documentElement.lang=lvt;document.documentElement.dir="ltr";dD.createRoot(document.getElementById("root")).render(d.jsx(R.StrictMode,{children:d.jsx(ovt,{})})); +`)+1)}let W=[];try{W=q.trim()?e2(q):[]}catch{return}if(P.truncated&&W.every(J=>J.hunks.length===0))return;let Z=0,X=0;for(const J of W){const ee=Ly(J);Z+=ee.additions,X+=ee.deletions}L||v({fileCount:W.length,additions:Z,deletions:X,truncated:P.truncated})}).catch(()=>{}),()=>{L=!0}},[b]);const w={done:0,failed:0,cancelled:0,live:0};for(const L of n)L.status==="done"?w.done+=1:L.status==="failed"?w.failed+=1:L.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?E0((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=R.useRef(null),[T,j]=R.useState(!1),[D,I]=R.useState(!1);return R.useEffect(()=>{j(!1)},[z]),R.useEffect(()=>{const L=N.current;L&&I(L.scrollHeight>L.clientHeight+1)},[z,T]),vy.createPortal(h.jsxs("div",{ref:f.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:qb,left:g,top:S,visibility:f.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:c,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(no,{status:t?Si(t):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[a&&h.jsxs("button",{type:"button",...ir(a),children:[h.jsx(Su,{size:13}),xae()]}),h.jsxs("button",{type:"button",...ir(o),children:[h.jsx(lp,{size:13}),lae()]})]}),z&&h.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:z}),z&&(D||T)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(L=>!L),children:T?_9():kne()}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?Ghe():Xhe({count:$t(n.length)}),...w.done>0?[yhe({count:$t(w.done)})]:[],...w.failed>0?[Che({count:$t(w.failed)})]:[],...w.cancelled>0?[ghe({count:$t(w.cancelled)})]:[],...w.live>0?[Ihe({count:$t(w.live)})]:[]])}),t&&Z2(t.backend)&&h.jsx(my,{backend:t.backend}),y&&h.jsx("span",{children:y}),t&&h.jsx("span",{children:Gi(t.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(cp,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:[mae()," ",h.jsx("span",{className:"hc-mono",children:r})]})]}),k&&k.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:k.truncated?sL({parent:Ae(r??"parent")}):eL({parent:Ae(r??"parent")}),children:h.jsxs("span",{children:[k.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",k.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",k.deletions]})," · ",k.fileCount===1&&!k.truncated?Fhe():k.truncated?Rhe({count:$t(k.fileCount)}):Ahe({count:$t(k.fileCount)})]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:[hae()," ",gvt(e.createdAt)]})]})]}),document.body)}const YC=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),vvt=264,ZC=132,_0=44,xvt=72,yvt=148,wvt=44;function Svt(e){const n=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),t=[];for(const a of e){const o=n.get(a.id),l=a.parentExperimentId?n.get(a.parentExperimentId):void 0;l?l.children.push(o):t.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,s=a=>{a.children.sort(r),a.children.forEach(s)};return t.sort(r),t.forEach(s),t}function kvt(e,n){const t=new Map,r=l=>{const c=t.get(l)??1+l.children.reduce((f,_)=>f+r(_),0);return t.set(l,c),c},s=new Map,a=l=>{const c=s.get(l)??(n(l)||l.children.some(a));return s.set(l,c),c};function o(l){if(n(l)){const _=[];let d=0;for(const m of l.children)a(m)?_.push(...o(m)):d+=r(m);return d>0&&_.push({kind:"elided",id:`el-${l.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:l.exp,children:_}]}if(!a(l))return[];let c=0;const f=[];return(function _(d){c+=1;for(const m of d.children)n(m)?f.push(...o(m)):a(m)?_(m):c+=r(m)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:c,children:f}]}return e.flatMap(o)}function N2(e){return e.kind==="exp"?vvt:yvt}function Q_(e){return e.kind==="exp"?e.exp.id:e.id}function p0(e){if(e.children.length===0)return N2(e);const n=e.children.reduce((t,r)=>t+p0(r),0)+_0*(e.children.length-1);return Math.max(N2(e),n)}function Cvt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Evt=R.memo(function({data:n}){const{exp:t,latestRun:r,runs:s,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:c,onOpenView:f,onOpenCode:_}=n,d=r?Si(r):void 0,m=d==="running"||d==="starting"||d==="cancelling",g=a?EUe():m?FUe():Ya(),S=s.slice(-8),k=R.useRef(null),v=mvt(k,n);return h.jsxs("div",{ref:k,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-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-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[h.jsx(ll,{type:"target",position:ot.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...ir(b=>f(t.id,"overview",b)),children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:g}),h.jsx(no,{status:d??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&h.jsx("div",{className:"node-title",children:t.title||t.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:Eqe()}),S.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:S.map(b=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Cvt(Si(b))}`,title:uA(Si(b))},b.id))}):h.jsx("span",{children:_qe()}),h.jsx("span",{style:{flex:1}}),r&&h.jsx("span",{children:Gi(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&h.jsxs("button",{className:"node-action",title:bqe(),...ir(b=>f(t.id,"terminal",b)),children:[h.jsx(Su,{size:13}),q9()]}),h.jsxs("button",{className:"node-action",title:a9({branch:Ae(t.branchName)}),...ir(b=>_(t.id,t.branchName,"files",b)),children:[h.jsx(lp,{size:13}),JUe()]}),l&&c&&h.jsx("a",{className:"node-action node-action-ext",title:b0({name:Ae(t.branchName)}),"aria-label":b0({name:Ae(t.branchName)}),href:fp(l,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:h.jsx(Ip,{size:13})})]}),h.jsx(ll,{type:"source",position:ot.Bottom}),v.rect&&h.jsx(bvt,{exp:t,runs:s,latestRun:r,parentSlug:o,anchor:v.rect,onOpenLogs:s.length>0?b=>f(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),Nvt=R.memo(function({data:n}){const{count:t,onShowProjectScope:r}=n;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-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:jqe(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[h.jsx(ll,{type:"target",position:ot.Top}),h.jsx(Q9,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[t===1?IUe():RUe({count:$t(t)}),h.jsx("span",{className:"elided-node-sub",children:wqe()})]}),h.jsx(ll,{type:"source",position:ot.Bottom})]})}),zvt={exp:Evt,elided:Nvt},AM={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Avt={...AM.style,strokeDasharray:"4 4"};function jvt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:c}=R.useMemo(()=>{const f=new Map;for(const b of n){const w=f.get(b.experimentId);w?w.push(b):f.set(b.experimentId,[b])}for(const b of f.values())b.sort((w,y)=>w.createdAt-y.createdAt);const _=[],d=[],m=b=>!a||b.exp.chatSessionId===a,g=kvt(Svt(e),m),S=new Map(e.map(b=>[b.id,b.slug]));function k(b,w,y){const C=w-N2(b)/2;if(b.kind==="exp"){const T=f.get(b.exp.id)??[];_.push({id:b.exp.id,type:"exp",position:{x:C,y},data:{exp:b.exp,latestRun:T[T.length-1]??null,runs:T,isBaseline:!b.exp.parentExperimentId,parentSlug:b.exp.parentExperimentId?S.get(b.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else _.push({id:b.id,type:"elided",position:{x:C,y:y+(ZC-wvt)/2},data:{count:b.count,onShowProjectScope:o}});if(b.children.length===0)return;const z=b.children.reduce((T,j)=>T+p0(j),0)+_0*(b.children.length-1);let N=w-z/2;for(const T of b.children){const j=p0(T),D=b.kind==="elided"||T.kind==="elided";d.push({id:`e-${Q_(b)}-${Q_(T)}`,source:Q_(b),target:Q_(T),...D?{style:Avt}:{}}),k(T,N+j/2,y+ZC+xvt),N+=j+_0}}let v=0;for(const b of g){const w=p0(b);k(b,v+w/2,0),v+=w+_0}return{nodes:_,edges:d}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,a,o]);return e.length===0?h.jsxs("div",{className:YC,children:[h.jsx("p",{className:"empty-state-title",children:uqe()}),h.jsx("p",{className:"empty-state-hint",children:XUe()})]}):l.length===0&&a?h.jsxs("div",{className:YC,children:[h.jsx("p",{className:"empty-state-title",children:aqe()}),h.jsx("p",{className:"empty-state-hint",children:GUe()})]}):h.jsx(Bbt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:c,nodeTypes:zvt,defaultEdgeOptions:AM,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:pvt,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(Ubt,{variant:ro.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const QC=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),Vb=(e,n)=>e.id===n.id&&e.view===n.view,Qc=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,o4=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Gf=(e,n,t)=>`${e}:${n??""}:${o4(t)}`,jM=e=>({...e,lineScrollRequest:void 0});function Vf(e){return typeof e=="object"&&"path"in e?jM(e):e}const Jc=(e,n)=>e.branch===n.branch;function Nt(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:${o4(e)}`:`experiment:${e.id}:${e.view}`}function Wf(e,n){const t=e.filter(r=>Nt(r)!==n);return t.length===e.length?e:t}function Tvt(e){return e!==void 0}function JC(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===Jf&&n){const r={path:Yb,source:"artifacts"};return{...t,rightTab:r,tabHistory:[r],fileTabs:[r],contentTabOrder:[Nt(r)],panelOpen:!0}}if(e===lE){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(Nt),panelOpen:!0}}if(e===cE){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Nt),panelOpen:!0}}return t}function Mvt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rvt(e,n,t,r,s){let a=e,o;const l=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const f=m=>{const g=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[S,k]=[g(a),g(m)];return S===k?"":S.startsWith(`${k}/`)?S.slice(k.length).replace(/^\/+/,""):null},_=a.startsWith("/")&&c?f(c):null,d=a.startsWith("/")&&l?f(l):null;if(!a.startsWith("/"))o=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)a=d;else{const m=s?Mvt(s):"[^/]+",g=a.match(new RegExp(`/files/${m}/(.+)$`)),S=g?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=g||S?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(g)return{path:g[1],source:"artifacts"};S?(o=S[1],a=S[2]):k&&(a=k[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function Dvt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const z2="orx:panel-width",TM="orx:experiments-view";function Lvt(){try{return localStorage.getItem(TM)==="tree"?"tree":"table"}catch{return"table"}}const Bh=360,Ovt=10,Ivt=272,Bvt=380,$vt=Ivt+56,Hvt=80,Fvt=48;function m0(){return Math.max(Bh,window.innerWidth-$vt-Bvt)}function Pvt(){const e=m0();try{const n=Number(localStorage.getItem(z2));if(Number.isFinite(n)&&n>=Bh)return Math.min(n,e)}catch{}return Math.max(Bh,Math.min(760,e,Math.round(window.innerWidth*.42)))}function Kf(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 e9(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function Uvt(){var ml;const[e,n]=R.useState(null),[t,r]=R.useState(null),s=R.useRef(void 0);s.current=t==null?void 0:t.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),c=R.useRef(null),[f,_]=R.useState(null),[d,m]=R.useState([]),[g,S]=R.useState([]),k=R.useRef(g);k.current=g;const v=R.useRef(new Map),b=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),z=R.useRef(new Map),N=R.useRef(0),T=R.useRef(d);T.current=d;const[j,D]=R.useState(null),[I,L]=R.useState(Lvt),[P,q]=R.useState("project"),W=R.useRef(null),{open:Z,setOpen:X,ref:J}=_o(W),[ee,$]=R.useState(null),[B,H]=R.useState(!1),K=d.every(se=>se.chatSessionId),G=ee&&K?P:"project",ie=R.useMemo(()=>G!=="agent"?d:d.filter(se=>se.chatSessionId===ee),[d,G,ee]),ve=R.useMemo(()=>{if(G!=="agent")return g;const se=new Set(ie.map(ye=>ye.id));return g.filter(ye=>se.has(ye.experimentId))},[g,ie,G]);R.useEffect(()=>{try{localStorage.setItem(TM,I)}catch{}},[I]);const[ce,re]=R.useState(null),[F,oe]=R.useState("experiments"),[ue,he]=R.useState([]),[me,Ee]=R.useState(!1),[Re,He]=R.useState(!1),[Te,Ie]=R.useState(!1),[et,Tt]=R.useState([]),[zt,Wt]=R.useState([]),fn=R.useRef(new Map),ht=R.useRef(0),[Qe,st]=R.useState([]),[we,Le]=R.useState([]),[qe,tt]=R.useState([]),[at,Mt]=R.useState([]),[yt,Ot]=R.useState(null),[Rt,sn]=R.useState("files"),[xt,hn]=R.useState(new Set),[dn,Ke]=R.useState(!1),[ut,_n]=R.useState(!1),[Rr,ct]=R.useState(Pvt),[Ut,Qt]=R.useState(!0),[Gr,zr]=R.useState(!1),[Ts,Ze]=R.useState(!1),[mt,an]=R.useState("chat"),[Cn,En]=R.useState(null),rs=R.useRef(new Map),Dr=R.useRef(JC()),Vr=R.useRef(null),Lr=R.useRef(!1),An=R.useRef(ue);An.current=ue;const on=R.useRef(at);on.current=at;const Nn=R.useRef(null),gt=R.useCallback(se=>{const ye=[...se];on.current=ye,Mt(ye)},[]),Jn=R.useCallback(se=>{Nn.current=se,Ot(se)},[]),Wr=R.useCallback(se=>{const ye=Nt(se);Tt(ae=>Wf(ae,ye)),Wt(ae=>Wf(ae,ye)),st(ae=>Wf(ae,ye)),Le(ae=>Wf(ae,ye)),tt(ae=>Wf(ae,ye));const Ne=er.current;Ne&&"path"in se&&fn.current.delete(Gf(Ne,Vr.current,se));const Y=An.current.filter(ae=>Nt(ae)!==ye);An.current=Y,he(Y)},[]),We=R.useCallback(se=>{Lr.current=!1;const ye=Nt(se),Ne=[...An.current.filter(Y=>Nt(Y)!==ye),Vf(se)];An.current=Ne,he(Ne),oe(se)},[]),dt=R.useCallback((se,ye)=>{Lr.current=!1;const Ne=Nt(se),Y=Nn.current,ae=Sat({order:on.current,previewKey:Y?Nt(Y):null},Ne,ye);ae.replacedKey&&Y&&typeof Y!="string"&&Nt(Y)===ae.replacedKey&&Wr(Y),gt(ae.order),ae.previewKey===null?Jn(null):ae.previewKey===Ne&&Jn(Vf(se));const be=[...An.current.filter(ge=>Nt(ge)!==Ne),Vf(se)];An.current=be,he(be),oe(se)},[Wr,gt,Jn]),Ln=R.useCallback(se=>{const ye=Nn.current;ye&&Nt(ye)===Nt(se)&&Jn(null)},[Jn]);R.useEffect(()=>{let se=!1;const ye=Y=>{const ae=Nn.current,be=Y.target;if(be instanceof Element&&be.closest("input, textarea, [contenteditable='true']")!==null){se=!1;return}if(ae&&Nt(ae)===Nt(Dr.current.rightTab)&&(Y.metaKey||Y.ctrlKey)&&!Y.altKey&&!Y.shiftKey&&Y.key.toLowerCase()==="k"){Y.preventDefault(),se=!0;return}if(se&&Y.key==="Enter"){Y.preventDefault(),se=!1;const je=Nn.current;je&&Ln(je);return}se=!1},Ne=()=>{se=!1};return window.addEventListener("keydown",ye),window.addEventListener("blur",Ne),window.addEventListener("pointerdown",Ne),()=>{window.removeEventListener("keydown",ye),window.removeEventListener("blur",Ne),window.removeEventListener("pointerdown",Ne)}},[Ln]);const pn=R.useCallback((se,ye)=>{Lr.current=!1;const Ne=Nt(se),Y=Nn.current;Y&&Nt(Y)===Ne&&Jn(null);const ae=kat({order:on.current,previewKey:Y?Nt(Y):null},Ne,An.current.map(Nt));gt(ae.order);const be=An.current.filter(je=>Nt(je)!==Ne);if(An.current=be,he(be),!ye)return;const ge=ae.fallbackKey?be.find(je=>Nt(je)===ae.fallbackKey):void 0;ge?oe(ge):(Ke(!1),_n(!1))},[gt,Jn]),ar=R.useCallback(se=>{se!=="chat"&&(Lr.current=!1),an(se)},[]);Dr.current={rightTab:Vf(F),tabHistory:ue,experimentsTabOpen:me,filesTabOpen:Re,artifactsTabOpen:Te,expTabs:et,fileTabs:zt,planTabs:Qe,subagentTabs:we,codeTabs:qe,contentTabOrder:on.current,previewTab:Nn.current,filesView:Rt,filesToggled:xt,selectedRunId:ce,scope:P,panelOpen:dn,panelMax:ut};const Ms=R.useCallback(se=>{const ye=Vr.current;if(ye===se)return;ye&&rs.current.set(ye,Dr.current);let Ne=se?rs.current.get(se):void 0;if(!Ne){const Y=se===Jf&&s.current===!1&&!a.current;Y&&(a.current=!0,H(!0)),Ne=JC(se??void 0,Y)}if(se&&Lr.current){Lr.current=!1;const Y="experiments";Ne={...Ne,rightTab:Y,tabHistory:[...Ne.tabHistory.filter(ae=>Nt(ae)!==Nt(Y)),Y],experimentsTabOpen:!0,panelOpen:!0}}oe(Ne.rightTab),An.current=Ne.tabHistory,he(Ne.tabHistory),Ee(Ne.experimentsTabOpen),He(Ne.filesTabOpen),Ie(Ne.artifactsTabOpen),Tt(Ne.expTabs),Wt(Ne.fileTabs),st(Ne.planTabs),Le(Ne.subagentTabs),tt(Ne.codeTabs),gt(Ne.contentTabOrder),Jn(Ne.previewTab),sn(Ne.filesView),hn(Ne.filesToggled),re(Ne.selectedRunId),q(Ne.scope),Ke(Ne.panelOpen),_n(Ne.panelMax),Vr.current=se,$(se)},[gt,Jn]),Rs=(t==null?void 0:t.onboardingCompleted)??!1,[Or,zn]=R.useState(!1),ri=R.useCallback(()=>zn(!0),[]),qt=R.useCallback(async()=>{const se=await p7({tourCompleted:!0});r(ye=>ye&&{...ye,tourCompleted:se.tourCompleted}),zn(!1)},[]),ps=R.useCallback(async()=>{await qt(),Ze(!0)},[qt]);R.useEffect(()=>{!f||!k1(f)||Gr||!Rs||t!=null&&t.tourCompleted||ri()},[f,Gr,Rs,ri,t==null?void 0:t.tourCompleted]);const er=R.useRef(f);er.current=f;const yr=R.useCallback(()=>{an("chat"),Ee(!0),We("experiments"),Ke(!0),Vr.current||(Lr.current=!0)},[We]),ms=R.useCallback(()=>{l(null),n(null),r(null),Promise.allSettled([rKe(),iKe()]).then(([se,ye])=>{const Ne=[];se.status==="fulfilled"?(n(se.value),_(Y=>{var ae;return Y&&se.value.some(be=>be.id===Y)?Y:((ae=se.value[0])==null?void 0:ae.id)??null})):Ne.push(WP()),ye.status==="fulfilled"?(c.current=ye.value.preferredAgent,r(ye.value)):Ne.push(oU()),Ne.length>0&&l(fU({items:new Intl.ListFormat(E()).format(Ne)}))})},[]);R.useEffect(()=>{ms()},[ms]);const Ki=R.useRef(Promise.resolve()),Ei=R.useRef(0),si=R.useCallback(se=>{const ye=++Ei.current;r(Y=>Y&&{...Y,preferredAgent:se});const Ne=Ki.current.then(()=>p7({preferredAgent:se})).then(Y=>{c.current=Y.preferredAgent,ye===Ei.current&&r(ae=>ae&&{...ae,preferredAgent:Y.preferredAgent})}).catch(Y=>{throw ye===Ei.current&&r(ae=>ae&&{...ae,preferredAgent:c.current}),Y});return Ki.current=Ne.catch(()=>{}),Ne},[]);R.useEffect(()=>{const se=()=>ct(ye=>Math.min(ye,m0()));return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[]);const ii=R.useCallback(se=>{y.current=!1,C.current.clear(),z.current.clear();const ye=++N.current;X2(se).then(Ne=>{if(er.current!==se||w.current!==se||N.current!==ye)return;C.current=new Map(Ne.map(ae=>[ae.id,ae]));const Y=[...z.current.values()].some(ae=>{const be=C.current.get(ae.id);return!be||be.status!=="running"&&be.updatedAt<=ae.updatedAt});z.current.clear();for(const ae of Ne){const be=v.current.get(ae.id);(!be||be.updatedAt{const be=new Map(Ne.map(ge=>[ge.id,ge]));for(const ge of ae){const je=be.get(ge.id);(!je||je.updatedAt<=ge.updatedAt)&&be.set(ge.id,ge)}return[...be.values()]}),y.current=!0,Y&&yr()}).catch(()=>{N.current===ye&&z.current.clear()})},[yr]);R.useEffect(()=>{if(!f)return;const se=Vr.current;se&&rs.current.set(se,Dr.current),Vr.current=null,Lr.current=!1,$(null),w.current=f,v.current.clear(),b.current.clear(),hKe(f).catch(()=>{}),m([]),S([]),D(null),re(null),Tt([]),Wt([]),H(!1),st([]),Le([]),tt([]),gt([]),Jn(null),sn("files"),hn(new Set),An.current=[],he([]),oe("experiments"),Ee(!1),He(!1),Ie(!1),Ke(!1),_n(!1),q("project"),_Ke(f).then(m).catch(()=>{}),ii(f),b7(f).then(D).catch(()=>{})},[ii,f,gt,Jn]);const Ar=R.useCallback(()=>{const se=er.current;se&&b7(se).then(D).catch(()=>{})},[]),wr=R.useCallback(()=>{Ar(),an("chat"),Ie(!0),We("artifacts"),Ke(!0)},[Ar,We]);ZXe({onReconnect:()=>{const se=er.current;se&&(w.current=se,v.current.clear(),b.current.clear(),ii(se))},onRun:se=>{if(se.projectId!==er.current||se.projectId!==w.current)return;const ye=v.current.get(se.id),Ne=b.current.has(se.id);if(ye&&ye.updatedAt>se.updatedAt||(v.current.set(se.id,se),b.current.add(se.id),S(be=>Kf(be,se)),se.status!=="running"||(ye==null?void 0:ye.status)==="running"))return;const Y=C.current.get(se.id),ae=y.current&&(!Y||Y.status!=="running"&&Y.updatedAt<=se.updatedAt);Ne&&ye||ae?yr():y.current||z.current.set(se.id,se)},onExperiment:se=>{se.projectId===er.current&&m(ye=>Kf(ye,se))},onProject:se=>{n(ye=>ye?Kf(ye,se):[se])},onArtifacts:se=>{se===er.current&&Ar()}});const Ds=R.useCallback(()=>q("project"),[]),Sr=R.useCallback((se,ye="overview",Ne="preview")=>{const Y={id:se,view:ye};Tt(ae=>ae.some(be=>Vb(be,Y))?ae:[...ae,Y]),dt(Y,Ne),Ke(!0)},[dt]),ai=R.useCallback((se,ye="preview")=>{const Ne=k.current.filter(ae=>ae.id===se||ae.id.startsWith(se)),Y=Ne.length===1?Ne[0]:null;Y&&(re(Y.id),Sr(Y.experimentId,"terminal",ye))},[Sr]),Ls=R.useMemo(()=>new Map(d.map(se=>{var ye;return[se.id,((ye=se.title)==null?void 0:ye.trim())||se.slug||Ya()]})),[d]),jn=e9(Ls),Kn=R.useMemo(()=>{const se=new Map;for(const ye of g)se.set(ye.id,jn.get(ye.experimentId)??Ya());return se},[jn,g]),or=e9(Kn),Xi=R.useCallback(se=>{const ye=or.get(se);if(ye)return ye;const Ne=[...or].filter(([Y])=>Y.startsWith(se));return Ne.length===1?Ne[0][1]:""},[or]),jr=R.useCallback(se=>{const ye=jn.get(se);if(ye)return ye;const Ne=[...jn].filter(([Y])=>Y.startsWith(se));return Ne.length===1?Ne[0][1]:""},[jn]),Ni=R.useCallback((se,ye="preview")=>{const Ne=T.current.filter(Y=>Y.id===se||Y.id.startsWith(se));Ne.length===1&&Sr(Ne[0].id,"overview",ye)},[Sr]),oi=R.useCallback(se=>{const ye=et.findIndex(Ne=>Vb(Ne,se));ye!==-1&&(Tt(Ne=>Ne.filter((Y,ae)=>ae!==ye)),pn(se,Nt(F)===Nt(se)))},[et,pn,F]),Ir=R.useCallback((se,ye="preview")=>{const Ne=jM(se);Wt(Y=>{const ae=Y.findIndex(ge=>Qc(ge,se));if(ae===-1)return[...Y,Ne];const be=Y.slice();return be[ae]=Ne,be}),dt(se,ye),Ke(!0)},[dt]),Aa=R.useCallback((se,ye,Ne,Y,ae,be)=>{const ge=e==null?void 0:e.find(Xn=>Xn.id===f),je=Rvt(se,ge==null?void 0:ge.repoPath,ye,(ge==null?void 0:ge.artifactsDir)??(ge==null?void 0:ge.filesDir),ge==null?void 0:ge.slug);if(!je)return null;const Ve=ae?T.current.find(Xn=>Xn.id===ae||ae.length>=6&&Xn.id.startsWith(ae)):void 0,xn=Ne??(Ve==null?void 0:Ve.branchName),Tn=je.source==null||je.source==="repo";return xn&&Tn&&(je.ref=xn),be&&!je.ref&&Tn&&(je.branchLabel=be),Y!=null&&(je.line=Y,je.lineScrollRequest=++ht.current),je},[e,f]),gs=R.useCallback((se,ye,Ne,Y,ae,be,ge="preview")=>{const je=Aa(se,ye,Ne,Y,ae,be);je&&Ir(je,ge)},[Ir,Aa]),Wu=R.useCallback(se=>Ir({path:se,source:"artifacts"},"keepOpen"),[Ir]),go=R.useCallback((se,ye,Ne,Y,ae,be="preview")=>{const ge=Aa(se,ye,ae,Ne,Y);ge&&Ir(ge,be)},[Ir,Aa]),bs=R.useCallback((se,ye)=>{Ln(se),ye()},[Ln]),Pn=R.useCallback(se=>{const ye=zt.findIndex(Ne=>Qc(Ne,se));ye!==-1&&(Wt(Ne=>Ne.filter((Y,ae)=>ae!==ye)),f&&fn.current.delete(Gf(f,ee,se)),ee===Jf&&Qc(se,{path:Yb,source:"artifacts"})&&H(!1),pn(se,Nt(F)===Nt(se)))},[ee,zt,pn,f,F]),_c=R.useCallback(se=>{se.lineScrollRequest!==void 0&&oe(ye=>typeof ye!="object"||!("path"in ye)||!Qc(ye,se)||ye.lineScrollRequest!==se.lineScrollRequest?ye:Vf(ye))},[]),Br=R.useCallback((se,ye,Ne,Y="preview")=>{const ae={kind:"plan",sessionId:ye,promptId:Ne,plan:se};st(be=>{const ge=be.findIndex(Ve=>Ve.promptId===Ne);if(ge===-1)return[...be,ae];const je=be.slice();return je[ge]=ae,je}),dt(ae,Y),Ke(!0)},[dt]),ss=R.useCallback(se=>{const ye=Qe.findIndex(Ne=>Ne.promptId===se.promptId);ye!==-1&&(st(Ne=>Ne.filter((Y,ae)=>ae!==ye)),pn(se,Nt(F)===Nt(se)))},[pn,Qe,F]),is=R.useCallback((se,ye,Ne,Y="preview")=>{const ae={kind:"subagent",sessionId:se,spawnPartId:ye,label:Ne};Le(be=>be.some(ge=>ge.spawnPartId===ye)?be:[...be,ae]),dt(ae,Y),Ke(!0)},[dt]),vs=R.useCallback(se=>{const ye=we.findIndex(Ne=>Ne.spawnPartId===se.spawnPartId);ye!==-1&&(Le(Ne=>Ne.filter((Y,ae)=>ae!==ye)),pn(se,Nt(F)===Nt(se)))},[pn,F,we]),[ja,li]=R.useState({});R.useEffect(()=>{if(li(ge=>{const je=new Set(we.map(Ve=>Ve.spawnPartId));return Object.keys(ge).every(Ve=>je.has(Ve))?ge:Object.fromEntries(Object.entries(ge).filter(([Ve])=>je.has(Ve)))}),we.length===0)return;let se=!0;const ye=new Set,Ne=(ge,je,Ve)=>{li(xn=>{var Xn;let Tn=xn;for(const lr of je)if(!(Ve&&ye.has(lr.spawnPartId)))for(const ta of ge){const na=Sy(ta.parts,lr.spawnPartId);if(!na)continue;Ve||ye.add(lr.spawnPartId);const xo={label:pct(na),running:((Xn=na.state)==null?void 0:Xn.status)==="running"},Ta=Tn[lr.spawnPartId];(!Ta||Ta.label!==xo.label||Ta.running!==xo.running)&&(Tn===xn&&(Tn={...xn}),Tn[lr.spawnPartId]=xo);break}return Tn})};let Y=0;const ae=()=>{const ge=++Y;for(const je of new Set(we.map(Ve=>Ve.sessionId)))au(je).then(({messages:Ve})=>{se&&ge===Y&&Ne(Ve,we.filter(xn=>xn.sessionId===je),!0)}).catch(()=>{})};ae();const be=hh(ge=>{if(ge.type==="reconnected"){ye.clear(),ae();return}if(ge.type!=="message")return;const je=we.filter(Ve=>Ve.sessionId===ge.sessionId);je.length&&Ne([ge.message],je,!1)});return()=>{se=!1,be()}},[we]);const ci=R.useCallback((se,ye,Ne="files",Y="preview")=>{const ae={code:!0,experimentId:se,branch:ye,view:Ne,toggled:new Set};tt(be=>be.some(ge=>Jc(ge,ae))?be.map(ge=>Jc(ge,ae)?{...ge,experimentId:se,view:Ne}:ge):[...be,ae]),dt(ae,Y),Ke(!0)},[dt]),bo=R.useCallback((se,ye)=>{tt(Ne=>Ne.map(Y=>Jc(Y,se)?{...Y,...ye}:Y))},[]),Yi=R.useCallback(se=>{const ye=qe.findIndex(Ne=>Jc(Ne,se));ye!==-1&&(tt(Ne=>Ne.filter((Y,ae)=>ae!==ye)),pn(se,Nt(F)===Nt(se)))},[qe,pn,F]),pc=R.useCallback(()=>{an("chat"),He(!0),We("files"),Ke(!0)},[We]),zi=R.useCallback(se=>{se==="experiments"?Ee(!1):se==="files"?He(!1):Ie(!1),pn(se,F===se)},[pn,F]),as=se=>{se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId);const Ne=document.body.style.userSelect;document.body.style.userSelect="none";const Y=ut,ae=se.clientX,be=Rr;let ge=!1;function je(){window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",je),window.removeEventListener("pointercancel",je),document.body.style.userSelect=Ne}function Ve(xn){if(Y){const ta=xn.clientX-ae;if(ge||taXn+Hvt){_n(!0);return}_n(!1);const lr=Math.min(Math.max(Tn,Bh),Xn);ct(lr);try{localStorage.setItem(z2,String(lr))}catch{}}window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",je),window.addEventListener("pointercancel",je)},Zi=(se,ye)=>{n(Ne=>Ne?Kf(Ne,se):[se]),_(se.id),zr(!1),ye&&(En({projectId:se.id,message:ye}),ar("git"))},Ai=se=>{n(ye=>ye&&ye.filter(Ne=>Ne.id!==se)),f===se&&_(null)},tr=typeof F=="object"&&"id"in F?F:null,Un=typeof F=="object"&&"path"in F?F:null,ji=ee===Jf&&B?zt.find(se=>Qc(se,{path:Yb,source:"artifacts"})):void 0,dl=ji?[ji]:[],Os=typeof F=="object"&&"kind"in F&&F.kind==="plan"?F:null,nr=typeof F=="object"&&"kind"in F&&F.kind==="subagent"?F:null,_l=typeof F=="object"&&"code"in F?F:null,ln=_l?qe.find(se=>Jc(se,_l))??null:null,ui=new Map;for(const se of[...et,...zt,...Qe,...we,...qe])ui.set(Nt(se),se);const fi=ji?Nt(ji):null,Qi=at.filter(se=>se!==fi).map(se=>ui.get(se)).filter(Tvt),Ji=se=>yt!==null&&Nt(yt)===Nt(se),vo=se=>h.jsx(Xo,{active:Un!==null&&Qc(Un,se),label:se.path.split("/").pop()||se.path,icon:h.jsx(J9,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>We(se),onPromote:()=>Ln(se),onClose:()=>Pn(se)},`file:${o4(se)}`),Xt=(e==null?void 0:e.find(se=>se.id===f))??null,Kr=tr?d.find(se=>se.id===tr.id)??null:null,ea=ln?d.find(se=>se.id===ln.experimentId)??null:null,pl=se=>{var Ne,Y;if("path"in se)return vo(se);if("id"in se){const ae=d.find(be=>be.id===se.id);return h.jsx(Xo,{active:tr!==null&&Vb(tr,se),label:ae?ae.title||ae.slug:"…",icon:se.view==="overview"?h.jsx(pVe,{size:12,style:{flexShrink:0}}):h.jsx(Su,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>We(se),onPromote:()=>Ln(se),onClose:()=>oi(se)},Nt(se))}if("kind"in se&&se.kind==="plan")return h.jsx(Xo,{active:Os!==null&&Os.promptId===se.promptId,label:u9(),icon:h.jsx(W2,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>We(se),onPromote:()=>Ln(se),onClose:()=>ss(se)},Nt(se));if("kind"in se)return h.jsx(Xo,{active:nr!==null&&nr.spawnPartId===se.spawnPartId,label:((Ne=ja[se.spawnPartId])==null?void 0:Ne.label)??se.label??pU(),shimmer:((Y=ja[se.spawnPartId])==null?void 0:Y.running)??!1,icon:h.jsx(K2,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>We(se),onPromote:()=>Ln(se),onClose:()=>vs(se)},Nt(se));const ye=d.find(ae=>ae.id===se.experimentId);return h.jsx(Xo,{active:ln!==null&&Jc(ln,se),label:(ye==null?void 0:ye.slug)??se.branch,icon:h.jsx(fh,{size:12,style:{flexShrink:0}}),preview:Ji(se),onSelect:()=>We(se),onPromote:()=>Ln(se),onClose:()=>Yi(se)},Nt(se))};if(o)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsxs("div",{className:QC,children:[h.jsx("p",{children:o}),h.jsx("button",{className:es,onClick:ms,children:T2()})]})});if(e===null||t===null)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsx("div",{className:QC,children:h.jsx("span",{className:Dt})})});if(e.length===0)return h.jsx("div",{className:"app flex flex-col h-full",children:Rs?h.jsx(Fk,{projects:e,onOpen:_,onCreated:Zi,onDeleted:Ai}):h.jsx(qdt,{preferredAgent:t.preferredAgent,onDone:(se,ye)=>{flt(),c.current=ye,n([se]),_(se.id),r(Ne=>({...Ne??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:ye}))}})});const mc=h.jsx(Pdt,{projectName:((ml=e.find(se=>se.id===f))==null?void 0:ml.name)??"",onHome:()=>zr(!0),onNewProject:()=>Ze(!0),onRepository:()=>ar("git"),onCollapse:()=>Qt(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx(Lat,{}),Gr?h.jsx(Fk,{projects:e,onOpen:se=>{_(se),zr(!1)},onCreated:Zi,onDeleted:Ai}):h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[f&&h.jsx(Nct,{projectId:f,projectName:(Xt==null?void 0:Xt.name)??"",railHeader:mc,railOpen:Ut,onShowRail:()=>Qt(!0),mainView:mt,onSelectMainView:ar,experimentsActive:mt==="chat"&&dn&&F==="experiments",filesActive:mt==="chat"&&dn&&F==="files",artifactsActive:mt==="chat"&&dn&&F==="artifacts",onOpenExperiments:yr,onOpenArtifacts:wr,onOpenFile:go,onOpenRun:ai,runExperimentName:Xi,onOpenExperiment:Ni,experimentName:jr,onOpenPlan:Br,onOpenSubagent:is,onOpenWorktree:pc,onOpenDemoWelcome:Xt&&k1(Xt.id)?ri:void 0,onActiveSessionChange:Ms,preferredAgent:t.preferredAgent,onPreferredAgentChange:si,children:mt==="skills"?h.jsx(ydt,{project:Xt}):mt!=="chat"?h.jsx(Yot,{tab:mt,project:Xt,githubPublicationError:Cn&&Cn.projectId===(Xt==null?void 0:Xt.id)?Cn.message:null,onProjectUpdate:se=>{n(ye=>ye?Kf(ye,se):[se]),se.githubEnabled&&En(null)},onSelectTab:ar}):null}),mt==="chat"&&dn&&h.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-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg overflow-hidden ${iv} ${ut?"max":""}`,style:ut?void 0:{width:Rr},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${ut?"cursor-e-resize":"cursor-col-resize"}`,title:ut?iP():tP(),onPointerDown:as}),h.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:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[dl.map(vo),Re&&h.jsx(Xo,{active:F==="files",label:NP(),icon:h.jsx(fh,{size:12,style:{flexShrink:0}}),onSelect:()=>We("files"),onClose:()=>zi("files")}),Te&&h.jsx(Xo,{active:F==="artifacts",label:GF(),icon:h.jsx(q2,{size:12,style:{flexShrink:0}}),onSelect:()=>We("artifacts"),onClose:()=>zi("artifacts")}),me&&h.jsx(Xo,{active:F==="experiments",label:SP(),icon:h.jsx(eE,{size:12,style:{flexShrink:0}}),onSelect:()=>We("experiments"),onClose:()=>zi("experiments")}),Qi.map(pl)]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx("button",{className:vn,title:ut?Jw():Qw(),"aria-label":ut?Jw():Qw(),onClick:()=>_n(se=>!se),children:ut?h.jsx(mWe,{size:14}):h.jsx(dWe,{size:14})}),h.jsx("button",{className:vn,title:Xw(),"aria-label":Xw(),onClick:()=>{Lr.current=!1,Ke(!1),_n(!1)},children:h.jsx(Yr,{size:14})})]})]}),F==="artifacts"?h.jsx("div",{className:Xa,children:Xt&&h.jsx(_dt,{project:Xt,artifacts:j,onChanged:Ar,onOpenFile:Wu,onOpenStorage:()=>ar("storage")},Xt.id)}):F==="experiments"?h.jsxs("div",{className:Xa,children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{style:{flex:1}}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:J,children:[h.jsx("button",{ref:W,className:`${Wh} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${G==="agent"?" active":""}`,title:pP({scope:G==="agent"?Yw():Zw()}),"aria-label":TP(),"aria-expanded":Z,onClick:()=>X(se=>!se),children:h.jsx(JVe,{size:16,strokeWidth:2.5})}),Z&&h.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-[0_12px_32px_rgba(0,_0,_0,_0.18)] 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:[h.jsxs("button",{className:Zr,"aria-pressed":G==="agent",disabled:!ee||!K,title:ee?K?void 0:LP():UP(),onClick:()=>{q("agent"),X(!1)},children:[h.jsx("span",{children:Yw()}),G==="agent"&&h.jsx(ds,{size:13})]}),h.jsxs("button",{className:Zr,"aria-pressed":G==="project",onClick:()=>{q("project"),X(!1)},children:[h.jsx("span",{children:Zw()}),G==="project"&&h.jsx(ds,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":vP(),children:[h.jsx("button",{className:I==="table"?"active":"","aria-pressed":I==="table",onClick:()=>L("table"),children:vU()}),h.jsx("button",{className:I==="tree"?"active":"","aria-pressed":I==="tree",onClick:()=>L("tree"),children:SU()})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:I==="tree"?Xt&&h.jsx(jvt,{experiments:d,runs:ve,project:Xt,onOpenView:Sr,onOpenCode:ci,agentSessionId:G==="agent"?ee:null,onShowProjectScope:Ds}):h.jsx(e_t,{runs:ve,emptyHint:G==="agent"&&d.length>0?$P():void 0,experiments:ie,onOpen:(se,ye)=>{Sr(se.id,"overview",ye)},onOpenLogs:(se,ye,Ne)=>{re(ye),Sr(se,"terminal",Ne)},onOpenCode:(se,ye)=>{const Ne=d.find(Y=>Y.id===se);Ne&&ci(Ne.id,Ne.branchName,"files",ye)},onCancel:hE})})]}):F==="files"?h.jsx("div",{className:Xa,children:Xt?h.jsx(rdt,{sessionId:ee??void 0,project:Xt,view:Rt,toggled:xt,onViewChange:sn,onToggledChange:hn,onOpenFile:(se,ye,Ne,Y)=>gs(se,ye,Ne,void 0,void 0,void 0,Y)},`files:${ee??`project:${Xt.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx("div",{className:fu,children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(tE,{size:22}),h.jsx("p",{children:rU()})]})})})}):Un?h.jsx("div",{className:Xa,children:f&&h.jsx(Fdt,{projectId:f,path:Un.path,source:Un.source,sessionId:Un.source==="artifacts"?ee??void 0:Un.sessionId,gitRef:Un.ref,line:Un.line,branchLabel:Dvt(Un,Xt==null?void 0:Xt.baselineBranch),onOpenFile:(se,ye,Ne,Y)=>bs(Un,()=>gs(se,ye,Ne,void 0,void 0,void 0,Y)),scrollPosition:fn.current.get(Gf(f,ee,Un)),onScrollPositionChange:se=>{fn.current.set(Gf(f,ee,Un),se)},lineScrollRequest:Un.lineScrollRequest,onLineScrollRequestHandled:()=>_c(Un),onEdit:()=>Ln(Un)},Gf(f,ee,Un))}):Os?h.jsx("div",{className:Xa,children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(ga,{text:Os.plan,onOpenFile:(se,ye,Ne,Y,ae)=>bs(Os,()=>gs(se,Os.sessionId,Y,ye,Ne,void 0,ae))})})}):nr?h.jsx(zct,{sessionId:nr.sessionId,spawnPartId:nr.spawnPartId,onOpenFile:(se,ye,Ne,Y,ae)=>bs(nr,()=>go(se,nr.sessionId,ye,Ne,Y,ae)),onOpenRun:(se,ye)=>bs(nr,()=>ai(se,ye)),runExperimentName:Xi,onOpenExperiment:(se,ye)=>bs(nr,()=>Ni(se,ye)),experimentName:jr,onOpenSubagent:(se,ye,Ne)=>bs(nr,()=>is(nr.sessionId,se,ye,Ne))},nr.spawnPartId):ln?h.jsx("div",{className:Xa,children:f&&Xt&&ln&&ea&&h.jsx(tdt,{projectId:f,project:Xt,experiment:ea,view:ln.view,toggled:ln.toggled,onViewChange:se=>bo(ln,{view:se}),onToggledChange:se=>bo(ln,{toggled:se}),onOpenFile:(se,ye,Ne,Y)=>bs(ln,()=>gs(se,ye,Ne,void 0,void 0,ea.branchName,Y))},`code:${ln.branch}`)}):h.jsx("div",{className:Xa,children:tr&&Kr&&Xt&&h.jsx(jdt,{experiment:Kr,project:Xt,view:tr.view,runs:g,selectedRunId:ce,onSelectRun:re,parentExperiment:d.find(se=>se.id===Kr.parentExperimentId)??null,onOpenView:(se,ye,Ne)=>{ye&&re(ye),bs(tr,()=>Sr(Kr.id,se,Ne))},onOpenCode:(se,ye)=>bs(tr,()=>ci(Kr.id,Kr.branchName,se,ye))},`${tr.id}:${tr.view}`)})]})]}),Ts&&h.jsx(Pj,{onClose:()=>Ze(!1),onCreated:(se,ye)=>{Ze(!1),Zi(se,ye)}}),Or&&!Gr&&Xt&&k1(Xt.id)&&h.jsx(t_t,{onClose:qt,onCreateProject:ps})]})}const qvt=E();document.documentElement.lang=qvt;document.documentElement.dir="ltr";pD.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(Uvt,{})})); diff --git a/ui/dist/index.html b/ui/dist/index.html index 36b39c08..e574b5e7 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/messages/en.json b/ui/messages/en.json index 776a25a1..505c5b1a 100644 --- a/ui/messages/en.json +++ b/ui/messages/en.json @@ -192,6 +192,13 @@ "new_project_form_existing_folder": "Existing folder", "new_project_form_experiment_branches_will_be_pushed_to_the_remote": "Experiment branches will be pushed to the remote GitHub repository.", "new_project_form_from_a_paper": "From a paper", + "new_project_form_from_git_hub": "From GitHub", + "new_project_form_git_hub_repository": "GitHub repository", + "new_project_form_git_hub_repository_placeholder": "https://github.com/owner/repo", + "new_project_form_will_fork_under": "Will be forked under {account}.", + "new_project_form_enter_a_public_git_hub_repo_url": "Enter a public GitHub repository URL.", + "new_project_form_enter_a_valid_git_hub_url": "Enter a valid GitHub repository URL.", + "new_project_form_public_repo_is_forked_and_cloned": "The public repository is forked under your GitHub account and cloned locally.", "new_project_form_git_is_required_for_experiments_but_is_not": "Git is required for experiments but is not installed. Install Git, then restart OpenResearch.", "new_project_form_my_research": "my-research", "new_project_form_no_papers_found_try_an_ar_xiv_id": "No papers found. Try an arXiv ID, URL, or a different title.", @@ -829,6 +836,7 @@ "new_project_searching_alphaxiv": "Searching alphaXiv…", "new_project_public_repo_cloned": "A linked public code repository is cloned without credentials.", "new_project_clone_destination": "Clone destination", + "new_project_fork_destination": "Fork destination", "new_project_change_folder": "Change project folder; current folder: {path}", "new_project_choose_existing_folder": "Choose an existing project folder", "new_project_choosing": "Choosing…", @@ -841,6 +849,7 @@ "new_project_creating": "Creating…", "new_project_clone_paper": "Clone paper project", "new_project_create": "Create project", + "new_project_fork": "Fork project", "new_project_use_folder": "Use folder", "common_checking": "Checking…", "overleaf_last_sync_failed": "The last sync did not finish.", diff --git a/ui/messages/fa.json b/ui/messages/fa.json index 11fe77d3..ff90e3b1 100644 --- a/ui/messages/fa.json +++ b/ui/messages/fa.json @@ -192,6 +192,13 @@ "new_project_form_existing_folder": "پوشهٔ موجود", "new_project_form_experiment_branches_will_be_pushed_to_the_remote": "شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.", "new_project_form_from_a_paper": "از یک مقاله", + "new_project_form_from_git_hub": "از GitHub", + "new_project_form_git_hub_repository": "مخزن GitHub", + "new_project_form_git_hub_repository_placeholder": "https://github.com/owner/repo", + "new_project_form_will_fork_under": "زیر {account} فورک خواهد شد.", + "new_project_form_enter_a_public_git_hub_repo_url": "نشانی مخزن عمومی GitHub را وارد کنید.", + "new_project_form_enter_a_valid_git_hub_url": "یک نشانی مخزن GitHub معتبر وارد کنید.", + "new_project_form_public_repo_is_forked_and_cloned": "مخزن عمومی زیر حساب GitHub شما فورک و بهصورت محلی کلون میشود.", "new_project_form_git_is_required_for_experiments_but_is_not": "Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.", "new_project_form_my_research": "my-research", "new_project_form_no_papers_found_try_an_ar_xiv_id": "مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.", @@ -829,6 +836,7 @@ "new_project_searching_alphaxiv": "در حال جست‌وجوی alphaXiv…", "new_project_public_repo_cloned": "مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.", "new_project_clone_destination": "مقصد کلون", + "new_project_fork_destination": "مقصد فورک", "new_project_change_folder": "تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: {path}", "new_project_choose_existing_folder": "انتخاب پوشهٔ موجود پروژه", "new_project_choosing": "در حال انتخاب…", @@ -841,6 +849,7 @@ "new_project_creating": "در حال ایجاد…", "new_project_clone_paper": "کلون پروژهٔ مقاله", "new_project_create": "ایجاد پروژه", + "new_project_fork": "ایجاد شاخه (فورک)", "new_project_use_folder": "استفاده از پوشه", "common_checking": "در حال بررسی…", "overleaf_last_sync_failed": "آخرین همگام‌سازی کامل نشد.", diff --git a/ui/messages/zh-CN.json b/ui/messages/zh-CN.json index 1003fdba..684acee9 100644 --- a/ui/messages/zh-CN.json +++ b/ui/messages/zh-CN.json @@ -192,6 +192,13 @@ "new_project_form_existing_folder": "现有文件夹", "new_project_form_experiment_branches_will_be_pushed_to_the_remote": "实验分支将推送到远程 GitHub 仓库。", "new_project_form_from_a_paper": "从论文创建", + "new_project_form_from_git_hub": "从 GitHub 创建", + "new_project_form_git_hub_repository": "GitHub 仓库", + "new_project_form_git_hub_repository_placeholder": "https://github.com/owner/repo", + "new_project_form_will_fork_under": "将复刻到 {account} 下。", + "new_project_form_enter_a_public_git_hub_repo_url": "请输入公开的 GitHub 仓库 URL。", + "new_project_form_enter_a_valid_git_hub_url": "请输入有效的 GitHub 仓库 URL。", + "new_project_form_public_repo_is_forked_and_cloned": "该公开仓库会复刻到你的 GitHub 账户下并克隆到本地。", "new_project_form_git_is_required_for_experiments_but_is_not": "实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。", "new_project_form_my_research": "my-research", "new_project_form_no_papers_found_try_an_ar_xiv_id": "未找到论文。请尝试 arXiv ID、网址或其他标题。", @@ -829,6 +836,7 @@ "new_project_searching_alphaxiv": "正在搜索 alphaXiv…", "new_project_public_repo_cloned": "关联的公开代码仓库无需凭据即可克隆。", "new_project_clone_destination": "克隆位置", + "new_project_fork_destination": "复刻位置", "new_project_change_folder": "更改项目文件夹;当前文件夹:{path}", "new_project_choose_existing_folder": "选择现有项目文件夹", "new_project_choosing": "正在选择…", @@ -841,6 +849,7 @@ "new_project_creating": "正在创建…", "new_project_clone_paper": "克隆论文项目", "new_project_create": "创建项目", + "new_project_fork": "创建复刻项目", "new_project_use_folder": "使用文件夹", "common_checking": "正在检查…", "overleaf_last_sync_failed": "上次同步未完成。", diff --git a/ui/src/api.ts b/ui/src/api.ts index 1d742063..c7518390 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -183,6 +183,7 @@ export interface NewProject { runCommand?: string; paperId?: string; cloneUrl?: string; + forkUrl?: string; createFolder?: boolean; requireNewFolder?: boolean; initializeGit?: boolean; diff --git a/ui/src/components/NewProjectForm.tsx b/ui/src/components/NewProjectForm.tsx index 080e25eb..9defe3bb 100644 --- a/ui/src/components/NewProjectForm.tsx +++ b/ui/src/components/NewProjectForm.tsx @@ -48,7 +48,7 @@ function displayRepository(url: string): string { .replace(/\/$/, ""); } -type Mode = "blank" | "folder" | "paper"; +type Mode = "blank" | "folder" | "paper" | "github"; type ProjectDraft = { name: string; nameTouched: boolean; @@ -86,6 +86,7 @@ export function NewProjectForm({ const [hits, setHits] = useState([]); const [searching, setSearching] = useState(false); const [searchedPaperQuery, setSearchedPaperQuery] = useState(""); + const [githubUrl, setGithubUrl] = useState(""); const [pathCheckNonce, setPathCheckNonce] = useState(0); const seq = useRef(0); const pathSeq = useRef(0); @@ -94,20 +95,30 @@ export function NewProjectForm({ blank: { name: "", nameTouched: false, path: "", pathTouched: false }, folder: { name: "", nameTouched: false, path: "", pathTouched: false }, paper: { name: "", nameTouched: false, path: "", pathTouched: false }, + github: { name: "", nameTouched: false, path: "", pathTouched: false }, }); - const paperGithubRepo = mode === "paper" ? parseGithubRepository(paper?.repoUrl) : null; const automaticBlankProjectPath = name.trim() ? `~/OpenResearch/${slugify(name, 48)}` : ""; const automaticPaperProjectPath = `~/OpenResearch/${slugify(name || paper?.title || paper?.paperId || "")}`; + const paperGithubRepo = mode === "paper" ? parseGithubRepository(paper?.repoUrl) : null; + const githubRepo = + mode === "github" + ? parseGithubRepository(githubUrl.trim() || null) + : paperGithubRepo ?? ( + pathStatus?.githubOwner && pathStatus.githubRepo + ? { owner: pathStatus.githubOwner, repo: pathStatus.githubRepo } + : null + ); const projectPath = mode === "blank" && !pathTouched ? automaticBlankProjectPath - : mode === "paper" && paper && !pathTouched - ? automaticPaperProjectPath - : path; - const existingGithubRepo = paperGithubRepo ?? ( - pathStatus?.githubOwner && pathStatus.githubRepo - ? { owner: pathStatus.githubOwner, repo: pathStatus.githubRepo } - : null - ); + : mode === "github" && githubRepo && !pathTouched + ? `~/OpenResearch/${slugify(githubRepo.repo, 48)}` + : mode === "paper" && paper && !pathTouched + ? automaticPaperProjectPath + : path; + // A remote we can already push to, for labeling the GitHub sync option. A + // fork targets a brand-new repo under the account, so it never reuses one. + const existingGithubRepo = + mode === "github" ? null : githubRepo; useEffect(() => { void githubAccount() @@ -315,6 +326,9 @@ export function NewProjectForm({ requireNewFolder: mode === "blank", initializeGit: true, githubSyncEnabled, + ...(mode === "github" && githubRepo + ? { forkUrl: `https://github.com/${githubRepo.owner}/${githubRepo.repo}` } + : {}), ...(mode === "paper" && paper ? { paperId: paper.paperId, cloneUrl: paper.repoUrl ?? undefined } : {}), @@ -338,6 +352,8 @@ export function NewProjectForm({ Boolean(projectPath.trim()) && pathStatus?.exists === true && pathStatus.directory === false; const nonemptyPaperCloneFolder = mode === "paper" && Boolean(paper?.repoUrl) && pathStatus?.empty === false; + const nonemptyGithubCloneFolder = + mode === "github" && githubRepo && pathStatus?.empty === false; // A blank paper project is seeded and committed at the folder it initializes, // so it needs a folder of its own rather than one inside an existing repo. const unusableBlankPaperFolder = @@ -354,6 +370,8 @@ export function NewProjectForm({ invalidProjectDestination || nonemptyPaperCloneFolder || unusableBlankPaperFolder; + const githubDestinationHasError = + (pathTouched && !projectPath.trim()) || invalidProjectDestination || nonemptyGithubCloneFolder; const blankDestinationHasError = (pathTouched && !projectPath.trim()) || invalidProjectDestination || existingBlankFolder; const blankDestinationError = pathTouched && !projectPath.trim() @@ -363,6 +381,13 @@ export function NewProjectForm({ : existingBlankFolder ? m.new_project_folder_exists() : null; + const githubDestinationError = pathTouched && !projectPath.trim() + ? m.new_project_location_required() + : invalidProjectDestination + ? m.new_project_destination_is_file() + : nonemptyGithubCloneFolder + ? m.new_project_paper_needs_empty_folder() + : null; const paperDestinationError = pathTouched && !projectPath.trim() ? m.new_project_location_required() : invalidProjectDestination @@ -385,8 +410,13 @@ export function NewProjectForm({ !invalidProjectDestination && !nonemptyPaperCloneFolder && !unusableBlankPaperFolder && + !nonemptyGithubCloneFolder && !unusableRepository && (mode !== "paper" || Boolean(paper)) && + (mode !== "github" || + (Boolean(githubRepo) && + typeof githubLogin === "string" && + !githubRepoPreviewPending)) && (!githubSyncEnabled || (typeof githubLogin === "string" && !githubRepoPreviewPending && @@ -433,8 +463,48 @@ export function NewProjectForm({ > {m.new_project_form_from_a_paper()} + + + {mode === "github" && ( + + )} + {mode === "paper" && !paper && ( )} - {mode === "paper" ? ( + {mode === "paper" || mode === "github" ? (