webmux 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ var mo=Object.defineProperty;var Rs=t=>{throw TypeError(t)};var So=(t,o,_)=>o in t?mo(t,o,{enumerable:!0,configurable:!0,writable:!0,value:_}):t[o]=_;var dt=(t,o,_)=>So(t,typeof o!="symbol"?o+"":o,_),Mi=(t,o,_)=>o.has(t)||Rs("Cannot "+_);var U=(t,o,_)=>(Mi(t,o,"read from private field"),_?_.call(t):o.get(t)),he=(t,o,_)=>o.has(t)?Rs("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,_),de=(t,o,_,b)=>(Mi(t,o,"write to private field"),b?b.call(t,_):o.set(t,_),_),Ee=(t,o,_)=>(Mi(t,o,"access private method"),_);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const w of document.querySelectorAll('link[rel="modulepreload"]'))b(w);new MutationObserver(w=>{for(const k of w)if(k.type==="childList")for(const E of k.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&b(E)}).observe(document,{childList:!0,subtree:!0});function _(w){const k={};return w.integrity&&(k.integrity=w.integrity),w.referrerPolicy&&(k.referrerPolicy=w.referrerPolicy),w.crossOrigin==="use-credentials"?k.credentials="include":w.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function b(w){if(w.ep)return;w.ep=!0;const k=_(w);fetch(w.href,k)}})();const bo="5";var Zs;typeof window<"u"&&((Zs=window.__svelte??(window.__svelte={})).v??(Zs.v=new Set)).add(bo);const wo=1,Co=2,tn=4,yo=8,xo=16,Eo=1,ko=4,Lo=8,Do=16,Ro=1,Ao=2,Oe=Symbol(),rn="http://www.w3.org/1999/xhtml",To="@attach",Bo=!1;var as=Array.isArray,Mo=Array.prototype.indexOf,Br=Array.prototype.includes,yi=Array.from,Po=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,Oo=Object.getOwnPropertyDescriptors,Io=Object.prototype,Ho=Array.prototype,sn=Object.getPrototypeOf,As=Object.isExtensible;const Fo=()=>{};function No(t){for(var o=0;o<t.length;o++)t[o]()}function nn(){var t,o,_=new Promise((b,w)=>{t=b,o=w});return{promise:_,resolve:t,reject:o}}const Fe=2,Mr=4,xi=8,ls=1<<24,er=16,mt=32,dr=64,zi=128,st=512,Ie=1024,Ue=2048,St=4096,et=8192,nt=16384,gr=32768,fr=65536,Ts=1<<17,Wo=1<<18,Nr=1<<19,Uo=1<<20,Dt=1<<25,_r=65536,$i=1<<21,cs=1<<22,Xt=1<<23,hr=Symbol("$state"),jo=Symbol("legacy props"),zo=Symbol(""),Ot=new class extends Error{constructor(){super(...arguments);dt(this,"name","StaleReactionError");dt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Qs;const hs=!!((Qs=globalThis.document)!=null&&Qs.contentType)&&globalThis.document.contentType.includes("xml");function on(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function $o(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ko(t,o,_){throw new Error("https://svelte.dev/e/each_key_duplicate")}function qo(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Vo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Go(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Xo(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Jo(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Yo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Zo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Qo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ea(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ta(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ra(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function an(t){return t===this.v}function ia(t,o){return t!=t?o==o:t!==o||t!==null&&typeof t=="object"||typeof t=="function"}function ln(t){return!ia(t,this.v)}let sa=!1,Xe=null;function Pr(t){Xe=t}function Re(t,o=!1,_){Xe={p:Xe,i:!1,c:null,e:null,s:t,x:null,l:null}}function Ae(t){var o=Xe,_=o.e;if(_!==null){o.e=null;for(var b of _)An(b)}return t!==void 0&&(o.x=t),o.i=!0,Xe=o.p,t??{}}function cn(){return!0}let sr=[];function hn(){var t=sr;sr=[],No(t)}function Rt(t){if(sr.length===0&&!Gr){var o=sr;queueMicrotask(()=>{o===sr&&hn()})}sr.push(t)}function na(){for(;sr.length>0;)hn()}function un(t){var o=pe;if(o===null)return fe.f|=Xt,t;if((o.f&gr)===0&&(o.f&Mr)===0)throw t;Gt(t,o)}function Gt(t,o){for(;o!==null;){if((o.f&zi)!==0){if((o.f&gr)===0)throw t;try{o.b.error(t);return}catch(_){t=_}}o=o.parent}throw t}const oa=-7169;function De(t,o){t.f=t.f&oa|o}function us(t){(t.f&st)!==0||t.deps===null?De(t,Ie):De(t,St)}function dn(t){if(t!==null)for(const o of t)(o.f&Fe)===0||(o.f&_r)===0||(o.f^=_r,dn(o.deps))}function fn(t,o,_){(t.f&Ue)!==0?o.add(t):(t.f&St)!==0&&_.add(t),dn(t.deps),De(t,Ie)}let ci=!1;function aa(t){var o=ci;try{return ci=!1,[t(),ci]}finally{ci=o}}const zr=new Set;let ue=null,Ne=null,Ki=null,Gr=!1,Pi=!1,br=null,ui=null;var Bs=0;let la=1;var Cr,yr,xr,Er,ei,$t,kr,Kt,xt,Lr,ze,qi,Vi,Gi,Xi,_n;const mi=class mi{constructor(){he(this,ze);dt(this,"id",la++);dt(this,"current",new Map);dt(this,"previous",new Map);he(this,Cr,new Set);he(this,yr,new Set);he(this,xr,0);he(this,Er,0);he(this,ei,null);he(this,$t,[]);he(this,kr,new Set);he(this,Kt,new Set);he(this,xt,new Map);dt(this,"is_fork",!1);he(this,Lr,!1)}skip_effect(o){U(this,xt).has(o)||U(this,xt).set(o,{d:[],m:[]})}unskip_effect(o){var _=U(this,xt).get(o);if(_){U(this,xt).delete(o);for(var b of _.d)De(b,Ue),this.schedule(b);for(b of _.m)De(b,St),this.schedule(b)}}capture(o,_){_!==Oe&&!this.previous.has(o)&&this.previous.set(o,_),(o.f&Xt)===0&&(this.current.set(o,o.v),Ne==null||Ne.set(o,o.v))}activate(){ue=this}deactivate(){ue=null,Ne=null}flush(){try{if(Pi=!0,ue=this,!Ee(this,ze,qi).call(this)){for(const o of U(this,kr))U(this,Kt).delete(o),De(o,Ue),this.schedule(o);for(const o of U(this,Kt))De(o,St),this.schedule(o)}Ee(this,ze,Vi).call(this)}finally{Bs=0,Ki=null,br=null,ui=null,Pi=!1,ue=null,Ne=null,Jt.clear()}}discard(){for(const o of U(this,yr))o(this);U(this,yr).clear()}increment(o){de(this,xr,U(this,xr)+1),o&&de(this,Er,U(this,Er)+1)}decrement(o,_){de(this,xr,U(this,xr)-1),o&&de(this,Er,U(this,Er)-1),!(U(this,Lr)||_)&&(de(this,Lr,!0),Rt(()=>{de(this,Lr,!1),this.flush()}))}oncommit(o){U(this,Cr).add(o)}ondiscard(o){U(this,yr).add(o)}settled(){return(U(this,ei)??de(this,ei,nn())).promise}static ensure(){if(ue===null){const o=ue=new mi;Pi||(zr.add(ue),Gr||Rt(()=>{ue===o&&o.flush()}))}return ue}apply(){}schedule(o){var w;if(Ki=o,(w=o.b)!=null&&w.is_pending&&(o.f&(Mr|xi|ls))!==0&&(o.f&gr)===0){o.b.defer_effect(o);return}for(var _=o;_.parent!==null;){_=_.parent;var b=_.f;if(br!==null&&_===pe&&(fe===null||(fe.f&Fe)===0))return;if((b&(dr|mt))!==0){if((b&Ie)===0)return;_.f^=Ie}}U(this,$t).push(_)}};Cr=new WeakMap,yr=new WeakMap,xr=new WeakMap,Er=new WeakMap,ei=new WeakMap,$t=new WeakMap,kr=new WeakMap,Kt=new WeakMap,xt=new WeakMap,Lr=new WeakMap,ze=new WeakSet,qi=function(){return this.is_fork||U(this,Er)>0},Vi=function(){var n,a;Bs++>1e3&&ha();const o=U(this,$t);de(this,$t,[]),this.apply();var _=br=[],b=[],w=ui=[];for(const c of o)Ee(this,ze,Gi).call(this,c,_,b);if(ue=null,w.length>0){var k=mi.ensure();for(const c of w)k.schedule(c)}if(br=null,ui=null,Ee(this,ze,qi).call(this)){Ee(this,ze,Xi).call(this,b),Ee(this,ze,Xi).call(this,_);for(const[c,f]of U(this,xt))gn(c,f)}else{U(this,kr).clear(),U(this,Kt).clear();for(const c of U(this,Cr))c(this);U(this,Cr).clear(),Ms(b),Ms(_),U(this,xr)===0&&Ee(this,ze,_n).call(this),(n=U(this,ei))==null||n.resolve()}var E=ue;E!==null&&(zr.add(E),Ee(a=E,ze,Vi).call(a))},Gi=function(o,_,b){o.f^=Ie;for(var w=o.first;w!==null;){var k=w.f,E=(k&(mt|dr))!==0,n=E&&(k&Ie)!==0,a=n||(k&et)!==0||U(this,xt).has(w);if(!a&&w.fn!==null){E?w.f^=Ie:(k&Mr)!==0?_.push(w):oi(w)&&((k&er)!==0&&U(this,Kt).add(w),Hr(w));var c=w.first;if(c!==null){w=c;continue}}for(;w!==null;){var f=w.next;if(f!==null){w=f;break}w=w.parent}}},Xi=function(o){for(var _=0;_<o.length;_+=1)fn(o[_],U(this,kr),U(this,Kt))},_n=function(){var w;if(zr.size>1){this.previous.clear();var o=ue,_=Ne,b=!0;for(const k of zr){if(k===this){b=!1;continue}const E=[];for(const[a,c]of this.current){if(k.current.has(a))if(b&&c!==k.current.get(a))k.current.set(a,c);else continue;E.push(a)}if(E.length===0)continue;const n=[...k.current.keys()].filter(a=>!this.current.has(a));if(n.length>0){k.activate();const a=new Set,c=new Map;for(const f of E)vn(f,n,a,c);if(U(k,$t).length>0){k.apply();for(const f of U(k,$t))Ee(w=k,ze,Gi).call(w,f,[],[])}k.deactivate()}}ue=o,Ne=_}U(this,xt).clear(),zr.delete(this)};let vr=mi;function ca(t){var o=Gr;Gr=!0;try{for(var _;;){if(na(),ue===null)return _;ue.flush()}}finally{Gr=o}}function ha(){try{Xo()}catch(t){Gt(t,Ki)}}let ft=null;function Ms(t){var o=t.length;if(o!==0){for(var _=0;_<o;){var b=t[_++];if((b.f&(nt|et))===0&&oi(b)&&(ft=new Set,Hr(b),b.deps===null&&b.first===null&&b.nodes===null&&b.teardown===null&&b.ac===null&&Mn(b),(ft==null?void 0:ft.size)>0)){Jt.clear();for(const w of ft){if((w.f&(nt|et))!==0)continue;const k=[w];let E=w.parent;for(;E!==null;)ft.has(E)&&(ft.delete(E),k.push(E)),E=E.parent;for(let n=k.length-1;n>=0;n--){const a=k[n];(a.f&(nt|et))===0&&Hr(a)}}ft.clear()}}ft=null}}function vn(t,o,_,b){if(!_.has(t)&&(_.add(t),t.reactions!==null))for(const w of t.reactions){const k=w.f;(k&Fe)!==0?vn(w,o,_,b):(k&(cs|er))!==0&&(k&Ue)===0&&pn(w,o,b)&&(De(w,Ue),ds(w))}}function pn(t,o,_){const b=_.get(t);if(b!==void 0)return b;if(t.deps!==null)for(const w of t.deps){if(Br.call(o,w))return!0;if((w.f&Fe)!==0&&pn(w,o,_))return _.set(w,!0),!0}return _.set(t,!1),!1}function ds(t){ue.schedule(t)}function gn(t,o){if(!((t.f&mt)!==0&&(t.f&Ie)!==0)){(t.f&Ue)!==0?o.d.push(t):(t.f&St)!==0&&o.m.push(t),De(t,Ie);for(var _=t.first;_!==null;)gn(_,o),_=_.next}}function ua(t){let o=0,_=Zt(0),b;return()=>{_s()&&(L(_),Li(()=>(o===0&&(b=Wt(()=>t(()=>Yt(_)))),o+=1,()=>{Rt(()=>{o-=1,o===0&&(b==null||b(),b=void 0,Yt(_))})})))}}var da=fr|Nr;function fa(t,o,_,b){new _a(t,o,_,b)}var it,os,Et,ar,qe,kt,Ze,_t,It,lr,qt,Dr,Rr,Ar,Ht,Si,Me,va,pa,ga,Ji,di,fi,Yi;class _a{constructor(o,_,b,w){he(this,Me);dt(this,"parent");dt(this,"is_pending",!1);dt(this,"transform_error");he(this,it);he(this,os,null);he(this,Et);he(this,ar);he(this,qe);he(this,kt,null);he(this,Ze,null);he(this,_t,null);he(this,It,null);he(this,lr,0);he(this,qt,0);he(this,Dr,!1);he(this,Rr,new Set);he(this,Ar,new Set);he(this,Ht,null);he(this,Si,ua(()=>(de(this,Ht,Zt(U(this,lr))),()=>{de(this,Ht,null)})));var k;de(this,it,o),de(this,Et,_),de(this,ar,E=>{var n=pe;n.b=this,n.f|=zi,b(E)}),this.parent=pe.b,this.transform_error=w??((k=this.parent)==null?void 0:k.transform_error)??(E=>E),de(this,qe,ni(()=>{Ee(this,Me,Ji).call(this)},da))}defer_effect(o){fn(o,U(this,Rr),U(this,Ar))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!U(this,Et).pending}update_pending_count(o,_){Ee(this,Me,Yi).call(this,o,_),de(this,lr,U(this,lr)+o),!(!U(this,Ht)||U(this,Dr))&&(de(this,Dr,!0),Rt(()=>{de(this,Dr,!1),U(this,Ht)&&Or(U(this,Ht),U(this,lr))}))}get_effect_pending(){return U(this,Si).call(this),L(U(this,Ht))}error(o){var _=U(this,Et).onerror;let b=U(this,Et).failed;if(!_&&!b)throw o;U(this,kt)&&(We(U(this,kt)),de(this,kt,null)),U(this,Ze)&&(We(U(this,Ze)),de(this,Ze,null)),U(this,_t)&&(We(U(this,_t)),de(this,_t,null));var w=!1,k=!1;const E=()=>{if(w){ra();return}w=!0,k&&ea(),U(this,_t)!==null&&ur(U(this,_t),()=>{de(this,_t,null)}),Ee(this,Me,fi).call(this,()=>{Ee(this,Me,Ji).call(this)})},n=a=>{try{k=!0,_==null||_(a,E),k=!1}catch(c){Gt(c,U(this,qe)&&U(this,qe).parent)}b&&de(this,_t,Ee(this,Me,fi).call(this,()=>{try{return Ge(()=>{var c=pe;c.b=this,c.f|=zi,b(U(this,it),()=>a,()=>E)})}catch(c){return Gt(c,U(this,qe).parent),null}}))};Rt(()=>{var a;try{a=this.transform_error(o)}catch(c){Gt(c,U(this,qe)&&U(this,qe).parent);return}a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(n,c=>Gt(c,U(this,qe)&&U(this,qe).parent)):n(a)})}}it=new WeakMap,os=new WeakMap,Et=new WeakMap,ar=new WeakMap,qe=new WeakMap,kt=new WeakMap,Ze=new WeakMap,_t=new WeakMap,It=new WeakMap,lr=new WeakMap,qt=new WeakMap,Dr=new WeakMap,Rr=new WeakMap,Ar=new WeakMap,Ht=new WeakMap,Si=new WeakMap,Me=new WeakSet,va=function(){try{de(this,kt,Ge(()=>U(this,ar).call(this,U(this,it))))}catch(o){this.error(o)}},pa=function(o){const _=U(this,Et).failed;_&&de(this,_t,Ge(()=>{_(U(this,it),()=>o,()=>()=>{})}))},ga=function(){const o=U(this,Et).pending;if(o){this.is_pending=!0,de(this,Ze,Ge(()=>o(U(this,it))));var _=ue;Rt(()=>{var b=de(this,It,document.createDocumentFragment()),w=Ft();b.append(w),de(this,kt,Ee(this,Me,fi).call(this,()=>Ge(()=>U(this,ar).call(this,w)))),U(this,qt)===0&&(U(this,it).before(b),de(this,It,null),ur(U(this,Ze),()=>{de(this,Ze,null)}),Ee(this,Me,di).call(this,_))})}},Ji=function(){var o=ue;try{if(this.is_pending=this.has_pending_snippet(),de(this,qt,0),de(this,lr,0),de(this,kt,Ge(()=>{U(this,ar).call(this,U(this,it))})),U(this,qt)>0){var _=de(this,It,document.createDocumentFragment());ms(U(this,kt),_);const b=U(this,Et).pending;de(this,Ze,Ge(()=>b(U(this,it))))}else Ee(this,Me,di).call(this,o)}catch(b){this.error(b)}},di=function(o){this.is_pending=!1;for(const _ of U(this,Rr))De(_,Ue),o.schedule(_);for(const _ of U(this,Ar))De(_,St),o.schedule(_);U(this,Rr).clear(),U(this,Ar).clear()},fi=function(o){var _=pe,b=fe,w=Xe;At(U(this,qe)),at(U(this,qe)),Pr(U(this,qe).ctx);try{return vr.ensure(),o()}catch(k){return un(k),null}finally{At(_),at(b),Pr(w)}},Yi=function(o,_){var b;if(!this.has_pending_snippet()){this.parent&&Ee(b=this.parent,Me,Yi).call(b,o,_);return}de(this,qt,U(this,qt)+o),U(this,qt)===0&&(Ee(this,Me,di).call(this,_),U(this,Ze)&&ur(U(this,Ze),()=>{de(this,Ze,null)}),U(this,It)&&(U(this,it).before(U(this,It)),de(this,It,null)))};function mn(t,o,_,b){const w=Ei;var k=t.filter(u=>!u.settled);if(_.length===0&&k.length===0){b(o.map(w));return}var E=pe,n=ma(),a=k.length===1?k[0].promise:k.length>1?Promise.all(k.map(u=>u.promise)):null;function c(u){n();try{b(u)}catch(p){(E.f&nt)===0&&Gt(p,E)}pi()}if(_.length===0){a.then(()=>c(o.map(w)));return}var f=Sn();function l(){Promise.all(_.map(u=>Sa(u))).then(u=>c([...o.map(w),...u])).catch(u=>Gt(u,E)).finally(()=>f())}a?a.then(()=>{n(),l(),pi()}):l()}function ma(){var t=pe,o=fe,_=Xe,b=ue;return function(k=!0){At(t),at(o),Pr(_),k&&(t.f&nt)===0&&(b==null||b.activate(),b==null||b.apply())}}function pi(t=!0){At(null),at(null),Pr(null),t&&(ue==null||ue.deactivate())}function Sn(){var t=pe.b,o=ue,_=t.is_rendered();return t.update_pending_count(1,o),o.increment(_),(b=!1)=>{t.update_pending_count(-1,o),o.decrement(_,b)}}function Ei(t){var o=Fe|Ue,_=fe!==null&&(fe.f&Fe)!==0?fe:null;return pe!==null&&(pe.f|=Nr),{ctx:Xe,deps:null,effects:null,equals:an,f:o,fn:t,reactions:null,rv:0,v:Oe,wv:0,parent:_??pe,ac:null}}function Sa(t,o,_){let b=pe;b===null&&$o();var w=void 0,k=Zt(Oe),E=!fe,n=new Map;return Oa(()=>{var p;var a=pe,c=nn();w=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).finally(pi)}catch(g){c.reject(g),pi()}var f=ue;if(E){if((a.f&gr)!==0)var l=Sn();if(b.b.is_rendered())(p=n.get(f))==null||p.reject(Ot),n.delete(f);else{for(const g of n.values())g.reject(Ot);n.clear()}n.set(f,c)}const u=(g,h=void 0)=>{if(l){var r=h===Ot;l(r)}if(!(h===Ot||(a.f&nt)!==0)){if(f.activate(),h)k.f|=Xt,Or(k,h);else{(k.f&Xt)!==0&&(k.f^=Xt),Or(k,g);for(const[i,e]of n){if(n.delete(i),i===f)break;e.reject(Ot)}}f.deactivate()}};c.promise.then(u,g=>u(null,g||"unknown"))}),vs(()=>{for(const a of n.values())a.reject(Ot)}),new Promise(a=>{function c(f){function l(){f===w?a(k):c(w)}f.then(l,l)}c(w)})}function ve(t){const o=Ei(t);return In(o),o}function bn(t){const o=Ei(t);return o.equals=ln,o}function ba(t){var o=t.effects;if(o!==null){t.effects=null;for(var _=0;_<o.length;_+=1)We(o[_])}}function wa(t){for(var o=t.parent;o!==null;){if((o.f&Fe)===0)return(o.f&nt)===0?o:null;o=o.parent}return null}function fs(t){var o,_=pe;At(wa(t));try{t.f&=~_r,ba(t),o=Wn(t)}finally{At(_)}return o}function wn(t){var o=fs(t);if(!t.equals(o)&&(t.wv=Fn(),(!(ue!=null&&ue.is_fork)||t.deps===null)&&(t.v=o,t.deps===null))){De(t,Ie);return}Qt||(Ne!==null?(_s()||ue!=null&&ue.is_fork)&&Ne.set(t,o):us(t))}function Ca(t){var o,_;if(t.effects!==null)for(const b of t.effects)(b.teardown||b.ac)&&((o=b.teardown)==null||o.call(b),(_=b.ac)==null||_.abort(Ot),b.teardown=Fo,b.ac=null,Xr(b,0),ps(b))}function Cn(t){if(t.effects!==null)for(const o of t.effects)o.teardown&&Hr(o)}let Zi=new Set;const Jt=new Map;let yn=!1;function Zt(t,o){var _={f:0,v:t,reactions:null,equals:an,rv:0,wv:0};return _}function ae(t,o){const _=Zt(t);return In(_),_}function ya(t,o=!1,_=!0){const b=Zt(t);return o||(b.equals=ln),b}function V(t,o,_=!1){fe!==null&&(!gt||(fe.f&Ts)!==0)&&cn()&&(fe.f&(Fe|er|cs|Ts))!==0&&(ot===null||!Br.call(ot,t))&&Qo();let b=_?ke(o):o;return Or(t,b,ui)}function Or(t,o,_=null){if(!t.equals(o)){var b=t.v;Qt?Jt.set(t,o):Jt.set(t,b),t.v=o;var w=vr.ensure();if(w.capture(t,b),(t.f&Fe)!==0){const k=t;(t.f&Ue)!==0&&fs(k),us(k)}t.wv=Fn(),xn(t,Ue,_),pe!==null&&(pe.f&Ie)!==0&&(pe.f&(mt|dr))===0&&(rt===null?Fa([t]):rt.push(t)),!w.is_fork&&Zi.size>0&&!yn&&xa()}return o}function xa(){yn=!1;for(const t of Zi)(t.f&Ie)!==0&&De(t,St),oi(t)&&Hr(t);Zi.clear()}function Ea(t,o=1){var _=L(t),b=o===1?_++:_--;return V(t,_),b}function Yt(t){V(t,t.v+1)}function xn(t,o,_){var b=t.reactions;if(b!==null)for(var w=b.length,k=0;k<w;k++){var E=b[k],n=E.f,a=(n&Ue)===0;if(a&&De(E,o),(n&Fe)!==0){var c=E;Ne==null||Ne.delete(c),(n&_r)===0&&(n&st&&(E.f|=_r),xn(c,St,_))}else if(a){var f=E;(n&er)!==0&&ft!==null&&ft.add(f),_!==null?_.push(f):ds(f)}}}function ke(t){if(typeof t!="object"||t===null||hr in t)return t;const o=sn(t);if(o!==Io&&o!==Ho)return t;var _=new Map,b=as(t),w=ae(0),k=Nt,E=n=>{if(Nt===k)return n();var a=fe,c=Nt;at(null),Hs(k);var f=n();return at(a),Hs(c),f};return b&&_.set("length",ae(t.length)),new Proxy(t,{defineProperty(n,a,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Yo();var f=_.get(a);return f===void 0?E(()=>{var l=ae(c.value);return _.set(a,l),l}):V(f,c.value,!0),!0},deleteProperty(n,a){var c=_.get(a);if(c===void 0){if(a in n){const f=E(()=>ae(Oe));_.set(a,f),Yt(w)}}else V(c,Oe),Yt(w);return!0},get(n,a,c){var p;if(a===hr)return t;var f=_.get(a),l=a in n;if(f===void 0&&(!l||(p=wr(n,a))!=null&&p.writable)&&(f=E(()=>{var g=ke(l?n[a]:Oe),h=ae(g);return h}),_.set(a,f)),f!==void 0){var u=L(f);return u===Oe?void 0:u}return Reflect.get(n,a,c)},getOwnPropertyDescriptor(n,a){var c=Reflect.getOwnPropertyDescriptor(n,a);if(c&&"value"in c){var f=_.get(a);f&&(c.value=L(f))}else if(c===void 0){var l=_.get(a),u=l==null?void 0:l.v;if(l!==void 0&&u!==Oe)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return c},has(n,a){var u;if(a===hr)return!0;var c=_.get(a),f=c!==void 0&&c.v!==Oe||Reflect.has(n,a);if(c!==void 0||pe!==null&&(!f||(u=wr(n,a))!=null&&u.writable)){c===void 0&&(c=E(()=>{var p=f?ke(n[a]):Oe,g=ae(p);return g}),_.set(a,c));var l=L(c);if(l===Oe)return!1}return f},set(n,a,c,f){var s;var l=_.get(a),u=a in n;if(b&&a==="length")for(var p=c;p<l.v;p+=1){var g=_.get(p+"");g!==void 0?V(g,Oe):p in n&&(g=E(()=>ae(Oe)),_.set(p+"",g))}if(l===void 0)(!u||(s=wr(n,a))!=null&&s.writable)&&(l=E(()=>ae(void 0)),V(l,ke(c)),_.set(a,l));else{u=l.v!==Oe;var h=E(()=>ke(c));V(l,h)}var r=Reflect.getOwnPropertyDescriptor(n,a);if(r!=null&&r.set&&r.set.call(f,c),!u){if(b&&typeof a=="string"){var i=_.get("length"),e=Number(a);Number.isInteger(e)&&e>=i.v&&V(i,e+1)}Yt(w)}return!0},ownKeys(n){L(w);var a=Reflect.ownKeys(n).filter(l=>{var u=_.get(l);return u===void 0||u.v!==Oe});for(var[c,f]of _)f.v!==Oe&&!(c in n)&&a.push(c);return a},setPrototypeOf(){Zo()}})}function Ps(t){try{if(t!==null&&typeof t=="object"&&hr in t)return t[hr]}catch{}return t}function ka(t,o){return Object.is(Ps(t),Ps(o))}var Qi,En,kn,Ln;function La(){if(Qi===void 0){Qi=window,En=/Firefox/.test(navigator.userAgent);var t=Element.prototype,o=Node.prototype,_=Text.prototype;kn=wr(o,"firstChild").get,Ln=wr(o,"nextSibling").get,As(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),As(_)&&(_.__t=void 0)}}function Ft(t=""){return document.createTextNode(t)}function Ir(t){return kn.call(t)}function ii(t){return Ln.call(t)}function X(t,o){return Ir(t)}function xe(t,o=!1){{var _=Ir(t);return _ instanceof Comment&&_.data===""?ii(_):_}}function J(t,o=1,_=!1){let b=t;for(;o--;)b=ii(b);return b}function Da(t){t.textContent=""}function Dn(){return!1}function Ra(t,o,_){return document.createElementNS(rn,t,void 0)}function Aa(t,o){if(o){const _=document.body;t.autofocus=!0,Rt(()=>{document.activeElement===_&&t.focus()})}}let Os=!1;function Ta(){Os||(Os=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var o;if(!t.defaultPrevented)for(const _ of t.target.elements)(o=_.__on_r)==null||o.call(_)})},{capture:!0}))}function ki(t){var o=fe,_=pe;at(null),At(null);try{return t()}finally{at(o),At(_)}}function Rn(t,o,_,b=_){t.addEventListener(o,()=>ki(_));const w=t.__on_r;w?t.__on_r=()=>{w(),b(!0)}:t.__on_r=()=>b(!0),Ta()}function Ba(t){pe===null&&(fe===null&&Go(),Vo()),Qt&&qo()}function Ma(t,o){var _=o.last;_===null?o.last=o.first=t:(_.next=t,t.prev=_,o.last=t)}function Bt(t,o){var _=pe;_!==null&&(_.f&et)!==0&&(t|=et);var b={ctx:Xe,deps:null,nodes:null,f:t|Ue|st,first:null,fn:o,last:null,next:null,parent:_,b:_&&_.b,prev:null,teardown:null,wv:0,ac:null},w=b;if((t&Mr)!==0)br!==null?br.push(b):vr.ensure().schedule(b);else if(o!==null){try{Hr(b)}catch(E){throw We(b),E}w.deps===null&&w.teardown===null&&w.nodes===null&&w.first===w.last&&(w.f&Nr)===0&&(w=w.first,(t&er)!==0&&(t&fr)!==0&&w!==null&&(w.f|=fr))}if(w!==null&&(w.parent=_,_!==null&&Ma(w,_),fe!==null&&(fe.f&Fe)!==0&&(t&dr)===0)){var k=fe;(k.effects??(k.effects=[])).push(w)}return b}function _s(){return fe!==null&&!gt}function vs(t){const o=Bt(xi,null);return De(o,Ie),o.teardown=t,o}function pr(t){Ba();var o=pe.f,_=!fe&&(o&mt)!==0&&(o&gr)===0;if(_){var b=Xe;(b.e??(b.e=[])).push(t)}else return An(t)}function An(t){return Bt(Mr|Uo,t)}function Pa(t){vr.ensure();const o=Bt(dr|Nr,t);return(_={})=>new Promise(b=>{_.outro?ur(o,()=>{We(o),b(void 0)}):(We(o),b(void 0))})}function si(t){return Bt(Mr,t)}function Oa(t){return Bt(cs|Nr,t)}function Li(t,o=0){return Bt(xi|o,t)}function oe(t,o=[],_=[],b=[]){mn(b,o,_,w=>{Bt(xi,()=>t(...w.map(L)))})}function ni(t,o=0){var _=Bt(er|o,t);return _}function Tn(t,o=0){var _=Bt(ls|o,t);return _}function Ge(t){return Bt(mt|Nr,t)}function Bn(t){var o=t.teardown;if(o!==null){const _=Qt,b=fe;Is(!0),at(null);try{o.call(null)}finally{Is(_),at(b)}}}function ps(t,o=!1){var _=t.first;for(t.first=t.last=null;_!==null;){const w=_.ac;w!==null&&ki(()=>{w.abort(Ot)});var b=_.next;(_.f&dr)!==0?_.parent=null:We(_,o),_=b}}function Ia(t){for(var o=t.first;o!==null;){var _=o.next;(o.f&mt)===0&&We(o),o=_}}function We(t,o=!0){var _=!1;(o||(t.f&Wo)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Ha(t.nodes.start,t.nodes.end),_=!0),ps(t,o&&!_),Xr(t,0),De(t,nt);var b=t.nodes&&t.nodes.t;if(b!==null)for(const k of b)k.stop();Bn(t);var w=t.parent;w!==null&&w.first!==null&&Mn(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ha(t,o){for(;t!==null;){var _=t===o?null:ii(t);t.remove(),t=_}}function Mn(t){var o=t.parent,_=t.prev,b=t.next;_!==null&&(_.next=b),b!==null&&(b.prev=_),o!==null&&(o.first===t&&(o.first=b),o.last===t&&(o.last=_))}function ur(t,o,_=!0){var b=[];Pn(t,b,!0);var w=()=>{_&&We(t),o&&o()},k=b.length;if(k>0){var E=()=>--k||w();for(var n of b)n.out(E)}else w()}function Pn(t,o,_){if((t.f&et)===0){t.f^=et;var b=t.nodes&&t.nodes.t;if(b!==null)for(const n of b)(n.is_global||_)&&o.push(n);for(var w=t.first;w!==null;){var k=w.next,E=(w.f&fr)!==0||(w.f&mt)!==0&&(t.f&er)!==0;Pn(w,o,E?_:!1),w=k}}}function gs(t){On(t,!0)}function On(t,o){if((t.f&et)!==0){t.f^=et,(t.f&Ie)===0&&(De(t,Ue),vr.ensure().schedule(t));for(var _=t.first;_!==null;){var b=_.next,w=(_.f&fr)!==0||(_.f&mt)!==0;On(_,w?o:!1),_=b}var k=t.nodes&&t.nodes.t;if(k!==null)for(const E of k)(E.is_global||o)&&E.in()}}function ms(t,o){if(t.nodes)for(var _=t.nodes.start,b=t.nodes.end;_!==null;){var w=_===b?null:ii(_);o.append(_),_=w}}let _i=!1,Qt=!1;function Is(t){Qt=t}let fe=null,gt=!1;function at(t){fe=t}let pe=null;function At(t){pe=t}let ot=null;function In(t){fe!==null&&(ot===null?ot=[t]:ot.push(t))}let Ve=null,Ye=0,rt=null;function Fa(t){rt=t}let Hn=1,nr=0,Nt=nr;function Hs(t){Nt=t}function Fn(){return++Hn}function oi(t){var o=t.f;if((o&Ue)!==0)return!0;if(o&Fe&&(t.f&=~_r),(o&St)!==0){for(var _=t.deps,b=_.length,w=0;w<b;w++){var k=_[w];if(oi(k)&&wn(k),k.wv>t.wv)return!0}(o&st)!==0&&Ne===null&&De(t,Ie)}return!1}function Nn(t,o,_=!0){var b=t.reactions;if(b!==null&&!(ot!==null&&Br.call(ot,t)))for(var w=0;w<b.length;w++){var k=b[w];(k.f&Fe)!==0?Nn(k,o,!1):o===k&&(_?De(k,Ue):(k.f&Ie)!==0&&De(k,St),ds(k))}}function Wn(t){var h;var o=Ve,_=Ye,b=rt,w=fe,k=ot,E=Xe,n=gt,a=Nt,c=t.f;Ve=null,Ye=0,rt=null,fe=(c&(mt|dr))===0?t:null,ot=null,Pr(t.ctx),gt=!1,Nt=++nr,t.ac!==null&&(ki(()=>{t.ac.abort(Ot)}),t.ac=null);try{t.f|=$i;var f=t.fn,l=f();t.f|=gr;var u=t.deps,p=ue==null?void 0:ue.is_fork;if(Ve!==null){var g;if(p||Xr(t,Ye),u!==null&&Ye>0)for(u.length=Ye+Ve.length,g=0;g<Ve.length;g++)u[Ye+g]=Ve[g];else t.deps=u=Ve;if(_s()&&(t.f&st)!==0)for(g=Ye;g<u.length;g++)((h=u[g]).reactions??(h.reactions=[])).push(t)}else!p&&u!==null&&Ye<u.length&&(Xr(t,Ye),u.length=Ye);if(cn()&&rt!==null&&!gt&&u!==null&&(t.f&(Fe|St|Ue))===0)for(g=0;g<rt.length;g++)Nn(rt[g],t);if(w!==null&&w!==t){if(nr++,w.deps!==null)for(let r=0;r<_;r+=1)w.deps[r].rv=nr;if(o!==null)for(const r of o)r.rv=nr;rt!==null&&(b===null?b=rt:b.push(...rt))}return(t.f&Xt)!==0&&(t.f^=Xt),l}catch(r){return un(r)}finally{t.f^=$i,Ve=o,Ye=_,rt=b,fe=w,ot=k,Pr(E),gt=n,Nt=a}}function Na(t,o){let _=o.reactions;if(_!==null){var b=Mo.call(_,t);if(b!==-1){var w=_.length-1;w===0?_=o.reactions=null:(_[b]=_[w],_.pop())}}if(_===null&&(o.f&Fe)!==0&&(Ve===null||!Br.call(Ve,o))){var k=o;(k.f&st)!==0&&(k.f^=st,k.f&=~_r),us(k),Ca(k),Xr(k,0)}}function Xr(t,o){var _=t.deps;if(_!==null)for(var b=o;b<_.length;b++)Na(t,_[b])}function Hr(t){var o=t.f;if((o&nt)===0){De(t,Ie);var _=pe,b=_i;pe=t,_i=!0;try{(o&(er|ls))!==0?Ia(t):ps(t),Bn(t);var w=Wn(t);t.teardown=typeof w=="function"?w:null,t.wv=Hn;var k;Bo&&sa&&(t.f&Ue)!==0&&t.deps}finally{_i=b,pe=_}}}async function Wa(){await Promise.resolve(),ca()}function L(t){var o=t.f,_=(o&Fe)!==0;if(fe!==null&&!gt){var b=pe!==null&&(pe.f&nt)!==0;if(!b&&(ot===null||!Br.call(ot,t))){var w=fe.deps;if((fe.f&$i)!==0)t.rv<nr&&(t.rv=nr,Ve===null&&w!==null&&w[Ye]===t?Ye++:Ve===null?Ve=[t]:Ve.push(t));else{(fe.deps??(fe.deps=[])).push(t);var k=t.reactions;k===null?t.reactions=[fe]:Br.call(k,fe)||k.push(fe)}}}if(Qt&&Jt.has(t))return Jt.get(t);if(_){var E=t;if(Qt){var n=E.v;return((E.f&Ie)===0&&E.reactions!==null||jn(E))&&(n=fs(E)),Jt.set(E,n),n}var a=(E.f&st)===0&&!gt&&fe!==null&&(_i||(fe.f&st)!==0),c=(E.f&gr)===0;oi(E)&&(a&&(E.f|=st),wn(E)),a&&!c&&(Cn(E),Un(E))}if(Ne!=null&&Ne.has(t))return Ne.get(t);if((t.f&Xt)!==0)throw t.v;return t.v}function Un(t){if(t.f|=st,t.deps!==null)for(const o of t.deps)(o.reactions??(o.reactions=[])).push(t),(o.f&Fe)!==0&&(o.f&st)===0&&(Cn(o),Un(o))}function jn(t){if(t.v===Oe)return!0;if(t.deps===null)return!1;for(const o of t.deps)if(Jt.has(o)||(o.f&Fe)!==0&&jn(o))return!0;return!1}function Wt(t){var o=gt;try{return gt=!0,t()}finally{gt=o}}const or=Symbol("events"),zn=new Set,es=new Set;function $n(t,o,_,b={}){function w(k){if(b.capture||ts.call(o,k),!k.cancelBubble)return ki(()=>_==null?void 0:_.call(this,k))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Rt(()=>{o.addEventListener(t,w,b)}):o.addEventListener(t,w,b),w}function ai(t,o,_,b,w){var k={capture:b,passive:w},E=$n(t,o,_,k);(o===document.body||o===window||o===document||o instanceof HTMLMediaElement)&&vs(()=>{o.removeEventListener(t,E,k)})}function me(t,o,_){(o[or]??(o[or]={}))[t]=_}function lt(t){for(var o=0;o<t.length;o++)zn.add(t[o]);for(var _ of es)_(t)}let Fs=null;function ts(t){var r,i;var o=this,_=o.ownerDocument,b=t.type,w=((r=t.composedPath)==null?void 0:r.call(t))||[],k=w[0]||t.target;Fs=t;var E=0,n=Fs===t&&t[or];if(n){var a=w.indexOf(n);if(a!==-1&&(o===document||o===window)){t[or]=o;return}var c=w.indexOf(o);if(c===-1)return;a<=c&&(E=a)}if(k=w[E]||t.target,k!==o){Po(t,"currentTarget",{configurable:!0,get(){return k||_}});var f=fe,l=pe;at(null),At(null);try{for(var u,p=[];k!==null;){var g=k.assignedSlot||k.parentNode||k.host||null;try{var h=(i=k[or])==null?void 0:i[b];h!=null&&(!k.disabled||t.target===k)&&h.call(k,t)}catch(e){u?p.push(e):u=e}if(t.cancelBubble||g===o||g===null)break;k=g}if(u){for(let e of p)queueMicrotask(()=>{throw e});throw u}}finally{t[or]=o,delete t.currentTarget,at(f),At(l)}}}var en;const Oi=((en=globalThis==null?void 0:globalThis.window)==null?void 0:en.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ua(t){return(Oi==null?void 0:Oi.createHTML(t))??t}function Kn(t){var o=Ra("template");return o.innerHTML=Ua(t.replaceAll("<!>","<!---->")),o.content}function Jr(t,o){var _=pe;_.nodes===null&&(_.nodes={start:t,end:o,a:null,t:null})}function ee(t,o){var _=(o&Ro)!==0,b=(o&Ao)!==0,w,k=!t.startsWith("<!>");return()=>{w===void 0&&(w=Kn(k?t:"<!>"+t),_||(w=Ir(w)));var E=b||En?document.importNode(w,!0):w.cloneNode(!0);if(_){var n=Ir(E),a=E.lastChild;Jr(n,a)}else Jr(E,E);return E}}function ja(t,o,_="svg"){var b=!t.startsWith("<!>"),w=`<${_}>${b?t:"<!>"+t}</${_}>`,k;return()=>{if(!k){var E=Kn(w),n=Ir(E);k=Ir(n)}var a=k.cloneNode(!0);return Jr(a,a),a}}function Di(t,o){return ja(t,o,"svg")}function He(t=""){{var o=Ft(t+"");return Jr(o,o),o}}function Tt(){var t=document.createDocumentFragment(),o=document.createComment(""),_=Ft();return t.append(o,_),Jr(o,_),t}function G(t,o){t!==null&&t.before(o)}function za(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const $a=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ka(t){return $a.includes(t)}const qa={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Va(t){return t=t.toLowerCase(),qa[t]??t}const Ga=["touchstart","touchmove"];function Xa(t){return Ga.includes(t)}function se(t,o){var _=o==null?"":typeof o=="object"?`${o}`:o;_!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=_,t.nodeValue=`${_}`)}function Ja(t,o){return Ya(t,o)}const hi=new Map;function Ya(t,{target:o,anchor:_,props:b={},events:w,context:k,intro:E=!0,transformError:n}){La();var a=void 0,c=Pa(()=>{var f=_??o.appendChild(Ft());fa(f,{pending:()=>{}},p=>{Re({});var g=Xe;k&&(g.c=k),w&&(b.$$events=w),a=t(p,b)||{},Ae()},n);var l=new Set,u=p=>{for(var g=0;g<p.length;g++){var h=p[g];if(!l.has(h)){l.add(h);var r=Xa(h);for(const s of[o,document]){var i=hi.get(s);i===void 0&&(i=new Map,hi.set(s,i));var e=i.get(h);e===void 0?(s.addEventListener(h,ts,{passive:r}),i.set(h,1)):i.set(h,e+1)}}}};return u(yi(zn)),es.add(u),()=>{var r;for(var p of l)for(const i of[o,document]){var g=hi.get(i),h=g.get(p);--h==0?(i.removeEventListener(p,ts),g.delete(p),g.size===0&&hi.delete(i)):g.set(p,h)}es.delete(u),f!==_&&((r=f.parentNode)==null||r.removeChild(f))}});return Za.set(a,c),a}let Za=new WeakMap;var vt,Lt,Qe,cr,ti,ri,bi;class Ss{constructor(o,_=!0){dt(this,"anchor");he(this,vt,new Map);he(this,Lt,new Map);he(this,Qe,new Map);he(this,cr,new Set);he(this,ti,!0);he(this,ri,o=>{if(U(this,vt).has(o)){var _=U(this,vt).get(o),b=U(this,Lt).get(_);if(b)gs(b),U(this,cr).delete(_);else{var w=U(this,Qe).get(_);w&&(U(this,Lt).set(_,w.effect),U(this,Qe).delete(_),w.fragment.lastChild.remove(),this.anchor.before(w.fragment),b=w.effect)}for(const[k,E]of U(this,vt)){if(U(this,vt).delete(k),k===o)break;const n=U(this,Qe).get(E);n&&(We(n.effect),U(this,Qe).delete(E))}for(const[k,E]of U(this,Lt)){if(k===_||U(this,cr).has(k))continue;const n=()=>{if(Array.from(U(this,vt).values()).includes(k)){var c=document.createDocumentFragment();ms(E,c),c.append(Ft()),U(this,Qe).set(k,{effect:E,fragment:c})}else We(E);U(this,cr).delete(k),U(this,Lt).delete(k)};U(this,ti)||!b?(U(this,cr).add(k),ur(E,n,!1)):n()}}});he(this,bi,o=>{U(this,vt).delete(o);const _=Array.from(U(this,vt).values());for(const[b,w]of U(this,Qe))_.includes(b)||(We(w.effect),U(this,Qe).delete(b))});this.anchor=o,de(this,ti,_)}ensure(o,_){var b=ue,w=Dn();if(_&&!U(this,Lt).has(o)&&!U(this,Qe).has(o))if(w){var k=document.createDocumentFragment(),E=Ft();k.append(E),U(this,Qe).set(o,{effect:Ge(()=>_(E)),fragment:k})}else U(this,Lt).set(o,Ge(()=>_(this.anchor)));if(U(this,vt).set(b,o),w){for(const[n,a]of U(this,Lt))n===o?b.unskip_effect(a):b.skip_effect(a);for(const[n,a]of U(this,Qe))n===o?b.unskip_effect(a.effect):b.skip_effect(a.effect);b.oncommit(U(this,ri)),b.ondiscard(U(this,bi))}else U(this,ri).call(this,b)}}vt=new WeakMap,Lt=new WeakMap,Qe=new WeakMap,cr=new WeakMap,ti=new WeakMap,ri=new WeakMap,bi=new WeakMap;function bs(t,o,..._){var b=new Ss(t);ni(()=>{const w=o()??null;b.ensure(w,w&&(k=>w(k,..._)))},fr)}function ws(t){Xe===null&&on(),pr(()=>{const o=Wt(t);if(typeof o=="function")return o})}function Qa(t){Xe===null&&on(),ws(()=>()=>Wt(t))}function ne(t,o,_=!1){var b=new Ss(t),w=_?fr:0;function k(E,n){b.ensure(E,n)}ni(()=>{var E=!1;o((n,a=0)=>{E=!0,k(a,n)}),E||k(-1,null)},w)}const el=Symbol("NaN");function tl(t,o,_){var b=new Ss(t);ni(()=>{var w=o();w!==w&&(w=el),b.ensure(w,_)})}function Yr(t,o){return o}function rl(t,o,_){for(var b=[],w=o.length,k,E=o.length,n=0;n<w;n++){let l=o[n];ur(l,()=>{if(k){if(k.pending.delete(l),k.done.add(l),k.pending.size===0){var u=t.outrogroups;rs(t,yi(k.done)),u.delete(k),u.size===0&&(t.outrogroups=null)}}else E-=1},!1)}if(E===0){var a=b.length===0&&_!==null;if(a){var c=_,f=c.parentNode;Da(f),f.append(c),t.items.clear()}rs(t,o,!a)}else k={pending:new Set(o),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(k)}function rs(t,o,_=!0){var b;if(t.pending.size>0){b=new Set;for(const E of t.pending.values())for(const n of E)b.add(t.items.get(n).e)}for(var w=0;w<o.length;w++){var k=o[w];if(b!=null&&b.has(k)){k.f|=Dt;const E=document.createDocumentFragment();ms(k,E)}else We(o[w],_)}}var Ns;function Ke(t,o,_,b,w,k=null){var E=t,n=new Map,a=(o&tn)!==0;if(a){var c=t;E=c.appendChild(Ft())}var f=null,l=bn(()=>{var s=_();return as(s)?s:s==null?[]:yi(s)}),u,p=new Map,g=!0;function h(s){(e.effect.f&nt)===0&&(e.pending.delete(s),e.fallback=f,il(e,u,E,o,b),f!==null&&(u.length===0?(f.f&Dt)===0?gs(f):(f.f^=Dt,Vr(f,null,E)):ur(f,()=>{f=null})))}function r(s){e.pending.delete(s)}var i=ni(()=>{u=L(l);for(var s=u.length,d=new Set,m=ue,S=Dn(),C=0;C<s;C+=1){var v=u[C],x=b(v,C),B=g?null:n.get(x);B?(B.v&&Or(B.v,v),B.i&&Or(B.i,C),S&&m.unskip_effect(B.e)):(B=sl(n,g?E:Ns??(Ns=Ft()),v,x,C,w,o,_),g||(B.e.f|=Dt),n.set(x,B)),d.add(x)}if(s===0&&k&&!f&&(g?f=Ge(()=>k(E)):(f=Ge(()=>k(Ns??(Ns=Ft()))),f.f|=Dt)),s>d.size&&Ko(),!g)if(p.set(m,d),S){for(const[P,O]of n)d.has(P)||m.skip_effect(O.e);m.oncommit(h),m.ondiscard(r)}else h(m);L(l)}),e={effect:i,items:n,pending:p,outrogroups:null,fallback:f};g=!1}function $r(t){for(;t!==null&&(t.f&mt)===0;)t=t.next;return t}function il(t,o,_,b,w){var B,P,O,A,F,H,W,j,K;var k=(b&yo)!==0,E=o.length,n=t.items,a=$r(t.effect.first),c,f=null,l,u=[],p=[],g,h,r,i;if(k)for(i=0;i<E;i+=1)g=o[i],h=w(g,i),r=n.get(h).e,(r.f&Dt)===0&&((P=(B=r.nodes)==null?void 0:B.a)==null||P.measure(),(l??(l=new Set)).add(r));for(i=0;i<E;i+=1){if(g=o[i],h=w(g,i),r=n.get(h).e,t.outrogroups!==null)for(const y of t.outrogroups)y.pending.delete(r),y.done.delete(r);if((r.f&Dt)!==0)if(r.f^=Dt,r===a)Vr(r,null,_);else{var e=f?f.next:a;r===t.effect.last&&(t.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),jt(t,f,r),jt(t,r,e),Vr(r,e,_),f=r,u=[],p=[],a=$r(f.next);continue}if((r.f&et)!==0&&(gs(r),k&&((A=(O=r.nodes)==null?void 0:O.a)==null||A.unfix(),(l??(l=new Set)).delete(r))),r!==a){if(c!==void 0&&c.has(r)){if(u.length<p.length){var s=p[0],d;f=s.prev;var m=u[0],S=u[u.length-1];for(d=0;d<u.length;d+=1)Vr(u[d],s,_);for(d=0;d<p.length;d+=1)c.delete(p[d]);jt(t,m.prev,S.next),jt(t,f,m),jt(t,S,s),a=s,f=S,i-=1,u=[],p=[]}else c.delete(r),Vr(r,a,_),jt(t,r.prev,r.next),jt(t,r,f===null?t.effect.first:f.next),jt(t,f,r),f=r;continue}for(u=[],p=[];a!==null&&a!==r;)(c??(c=new Set)).add(a),p.push(a),a=$r(a.next);if(a===null)continue}(r.f&Dt)===0&&u.push(r),f=r,a=$r(r.next)}if(t.outrogroups!==null){for(const y of t.outrogroups)y.pending.size===0&&(rs(t,yi(y.done)),(F=t.outrogroups)==null||F.delete(y));t.outrogroups.size===0&&(t.outrogroups=null)}if(a!==null||c!==void 0){var C=[];if(c!==void 0)for(r of c)(r.f&et)===0&&C.push(r);for(;a!==null;)(a.f&et)===0&&a!==t.fallback&&C.push(a),a=$r(a.next);var v=C.length;if(v>0){var x=(b&tn)!==0&&E===0?_:null;if(k){for(i=0;i<v;i+=1)(W=(H=C[i].nodes)==null?void 0:H.a)==null||W.measure();for(i=0;i<v;i+=1)(K=(j=C[i].nodes)==null?void 0:j.a)==null||K.fix()}rl(t,C,x)}}k&&Rt(()=>{var y,R;if(l!==void 0)for(r of l)(R=(y=r.nodes)==null?void 0:y.a)==null||R.apply()})}function sl(t,o,_,b,w,k,E,n){var a=(E&wo)!==0?(E&xo)===0?ya(_,!1,!1):Zt(_):null,c=(E&Co)!==0?Zt(w):null;return{v:a,i:c,e:Ge(()=>(k(o,a??_,c??w,n),()=>{t.delete(b)}))}}function Vr(t,o,_){if(t.nodes)for(var b=t.nodes.start,w=t.nodes.end,k=o&&(o.f&Dt)===0?o.nodes.start:_;b!==null;){var E=ii(b);if(k.before(b),b===w)return;b=E}}function jt(t,o,_){o===null?t.effect.first=_:o.next=_,_===null?t.effect.last=o:_.prev=o}function nl(t,o,_){si(()=>{var b=Wt(()=>o(t,_==null?void 0:_())||{});if(b!=null&&b.destroy)return()=>b.destroy()})}function ol(t,o){var _=void 0,b;Tn(()=>{_!==(_=o())&&(b&&(We(b),b=null),_&&(b=Ge(()=>{si(()=>_(t))})))})}function qn(t){var o,_,b="";if(typeof t=="string"||typeof t=="number")b+=t;else if(typeof t=="object")if(Array.isArray(t)){var w=t.length;for(o=0;o<w;o++)t[o]&&(_=qn(t[o]))&&(b&&(b+=" "),b+=_)}else for(_ in t)t[_]&&(b&&(b+=" "),b+=_);return b}function al(){for(var t,o,_=0,b="",w=arguments.length;_<w;_++)(t=arguments[_])&&(o=qn(t))&&(b&&(b+=" "),b+=o);return b}function Vn(t){return typeof t=="object"?al(t):t??""}const Ws=[...`
2
+ \r\f \v\uFEFF`];function ll(t,o,_){var b=t==null?"":""+t;if(o&&(b=b?b+" "+o:o),_){for(var w of Object.keys(_))if(_[w])b=b?b+" "+w:w;else if(b.length)for(var k=w.length,E=0;(E=b.indexOf(w,E))>=0;){var n=E+k;(E===0||Ws.includes(b[E-1]))&&(n===b.length||Ws.includes(b[n]))?b=(E===0?"":b.substring(0,E))+b.substring(n+1):E=n}}return b===""?null:b}function Us(t,o=!1){var _=o?" !important;":";",b="";for(var w of Object.keys(t)){var k=t[w];k!=null&&k!==""&&(b+=" "+w+": "+k+_)}return b}function Ii(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function cl(t,o){if(o){var _="",b,w;if(Array.isArray(o)?(b=o[0],w=o[1]):b=o,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var k=!1,E=0,n=!1,a=[];b&&a.push(...Object.keys(b).map(Ii)),w&&a.push(...Object.keys(w).map(Ii));var c=0,f=-1;const h=t.length;for(var l=0;l<h;l++){var u=t[l];if(n?u==="/"&&t[l-1]==="*"&&(n=!1):k?k===u&&(k=!1):u==="/"&&t[l+1]==="*"?n=!0:u==='"'||u==="'"?k=u:u==="("?E++:u===")"&&E--,!n&&k===!1&&E===0){if(u===":"&&f===-1)f=l;else if(u===";"||l===h-1){if(f!==-1){var p=Ii(t.substring(c,f).trim());if(!a.includes(p)){u!==";"&&l++;var g=t.substring(c,l).trim();_+=" "+g+";"}}c=l+1,f=-1}}}}return b&&(_+=Us(b)),w&&(_+=Us(w,!0)),_=_.trim(),_===""?null:_}return t==null?null:String(t)}function Be(t,o,_,b,w,k){var E=t.__className;if(E!==_||E===void 0){var n=ll(_,b,k);n==null?t.removeAttribute("class"):o?t.className=n:t.setAttribute("class",n),t.__className=_}else if(k&&w!==k)for(var a in k){var c=!!k[a];(w==null||c!==!!w[a])&&t.classList.toggle(a,c)}return k}function Hi(t,o={},_,b){for(var w in _){var k=_[w];o[w]!==k&&(_[w]==null?t.style.removeProperty(w):t.style.setProperty(w,k,b))}}function Zr(t,o,_,b){var w=t.__style;if(w!==o){var k=cl(o,b);k==null?t.removeAttribute("style"):t.style.cssText=k,t.__style=o}else b&&(Array.isArray(b)?(Hi(t,_==null?void 0:_[0],b[0]),Hi(t,_==null?void 0:_[1],b[1],"important")):Hi(t,_,b));return b}function is(t,o,_=!1){if(t.multiple){if(o==null)return;if(!as(o))return ta();for(var b of t.options)b.selected=o.includes(js(b));return}for(b of t.options){var w=js(b);if(ka(w,o)){b.selected=!0;return}}(!_||o!==void 0)&&(t.selectedIndex=-1)}function hl(t){var o=new MutationObserver(()=>{is(t,t.__value)});o.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),vs(()=>{o.disconnect()})}function js(t){return"__value"in t?t.__value:t.value}const Kr=Symbol("class"),qr=Symbol("style"),Gn=Symbol("is custom element"),Xn=Symbol("is html"),ul=hs?"option":"OPTION",dl=hs?"select":"SELECT",fl=hs?"progress":"PROGRESS";function zs(t,o){var _=Ri(t);_.value===(_.value=o??void 0)||t.value===o&&(o!==0||t.nodeName!==fl)||(t.value=o??"")}function gi(t,o){var _=Ri(t);_.checked!==(_.checked=o??void 0)&&(t.checked=o)}function _l(t,o){o?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function we(t,o,_,b){var w=Ri(t);w[o]!==(w[o]=_)&&(o==="loading"&&(t[zo]=_),_==null?t.removeAttribute(o):typeof _!="string"&&Yn(t).includes(o)?t[o]=_:t.setAttribute(o,_))}function vl(t,o,_,b,w=!1,k=!1){var E=Ri(t),n=E[Gn],a=!E[Xn],c=o||{},f=t.nodeName===ul;for(var l in o)l in _||(_[l]=null);_.class?_.class=Vn(_.class):_[Kr]&&(_.class=null),_[qr]&&(_.style??(_.style=null));var u=Yn(t);for(const d in _){let m=_[d];if(f&&d==="value"&&m==null){t.value=t.__value="",c[d]=m;continue}if(d==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Be(t,p,m,b,o==null?void 0:o[Kr],_[Kr]),c[d]=m,c[Kr]=_[Kr];continue}if(d==="style"){Zr(t,m,o==null?void 0:o[qr],_[qr]),c[d]=m,c[qr]=_[qr];continue}var g=c[d];if(!(m===g&&!(m===void 0&&t.hasAttribute(d)))){c[d]=m;var h=d[0]+d[1];if(h!=="$$")if(h==="on"){const S={},C="$$"+d;let v=d.slice(2);var r=Ka(v);if(za(v)&&(v=v.slice(0,-7),S.capture=!0),!r&&g){if(m!=null)continue;t.removeEventListener(v,c[C],S),c[C]=null}if(r)me(v,t,m),lt([v]);else if(m!=null){let x=function(B){c[d].call(this,B)};var s=x;c[C]=$n(v,t,x,S)}}else if(d==="style")we(t,d,m);else if(d==="autofocus")Aa(t,!!m);else if(!n&&(d==="__value"||d==="value"&&m!=null))t.value=t.__value=m;else if(d==="selected"&&f)_l(t,m);else{var i=d;a||(i=Va(i));var e=i==="defaultValue"||i==="defaultChecked";if(m==null&&!n&&!e)if(E[d]=null,i==="value"||i==="checked"){let S=t;const C=o===void 0;if(i==="value"){let v=S.defaultValue;S.removeAttribute(i),S.defaultValue=v,S.value=S.__value=C?v:null}else{let v=S.defaultChecked;S.removeAttribute(i),S.defaultChecked=v,S.checked=C?v:!1}}else t.removeAttribute(d);else e||u.includes(i)&&(n||typeof m!="string")?(t[i]=m,i in E&&(E[i]=Oe)):typeof m!="function"&&we(t,i,m)}}}return c}function Jn(t,o,_=[],b=[],w=[],k,E=!1,n=!1){mn(w,_,b,a=>{var c=void 0,f={},l=t.nodeName===dl,u=!1;if(Tn(()=>{var g=o(...a.map(L)),h=vl(t,c,g,k,E,n);u&&l&&"value"in g&&is(t,g.value);for(let i of Object.getOwnPropertySymbols(f))g[i]||We(f[i]);for(let i of Object.getOwnPropertySymbols(g)){var r=g[i];i.description===To&&(!c||r!==c[i])&&(f[i]&&We(f[i]),f[i]=Ge(()=>ol(t,()=>r))),h[i]=r}c=h}),l){var p=t;si(()=>{is(p,c.value,!0),hl(p)})}u=!0})}function Ri(t){return t.__attributes??(t.__attributes={[Gn]:t.nodeName.includes("-"),[Xn]:t.namespaceURI===rn})}var $s=new Map;function Yn(t){var o=t.getAttribute("is")||t.nodeName,_=$s.get(o);if(_)return _;$s.set(o,_=[]);for(var b,w=t,k=Element.prototype;k!==w;){b=Oo(w);for(var E in b)b[E].set&&_.push(E);w=sn(w)}return _}function Qr(t,o,_=o){var b=new WeakSet;Rn(t,"input",async w=>{var k=w?t.defaultValue:t.value;if(k=Fi(t)?Ni(k):k,_(k),ue!==null&&b.add(ue),await Wa(),k!==(k=o())){var E=t.selectionStart,n=t.selectionEnd,a=t.value.length;if(t.value=k??"",n!==null){var c=t.value.length;E===n&&n===a&&c>a?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=E,t.selectionEnd=Math.min(n,c))}}}),Wt(o)==null&&t.value&&(_(Fi(t)?Ni(t.value):t.value),ue!==null&&b.add(ue)),Li(()=>{var w=o();if(t===document.activeElement){var k=ue;if(b.has(k))return}Fi(t)&&w===Ni(t.value)||t.type==="date"&&!w&&!t.value||w!==t.value&&(t.value=w??"")})}function pl(t,o,_=o){Rn(t,"change",b=>{var w=b?t.defaultChecked:t.checked;_(w)}),Wt(o)==null&&_(t.checked),Li(()=>{var b=o();t.checked=!!b})}function Fi(t){var o=t.type;return o==="number"||o==="range"}function Ni(t){return t===""?null:+t}function Ks(t,o){return t===o||(t==null?void 0:t[hr])===o}function Ai(t={},o,_,b){return si(()=>{var w,k;return Li(()=>{w=k,k=[],Wt(()=>{t!==_(...k)&&(o(t,...k),w&&Ks(_(...w),t)&&o(null,...w))})}),()=>{Rt(()=>{k&&Ks(_(...k),t)&&o(null,...k)})}}),t}const gl={get(t,o){if(!t.exclude.includes(o))return t.props[o]},set(t,o){return!1},getOwnPropertyDescriptor(t,o){if(!t.exclude.includes(o)&&o in t.props)return{enumerable:!0,configurable:!0,value:t.props[o]}},has(t,o){return t.exclude.includes(o)?!1:o in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(o=>!t.exclude.includes(o))}};function Zn(t,o,_){return new Proxy({props:t,exclude:o},gl)}function Ce(t,o,_,b){var e;var w=(_&Lo)!==0,k=(_&Do)!==0,E=b,n=!0,a=()=>(n&&(n=!1,E=k?Wt(b):b),E);let c;if(w){var f=hr in t||jo in t;c=((e=wr(t,o))==null?void 0:e.set)??(f&&o in t?s=>t[o]=s:void 0)}var l,u=!1;w?[l,u]=aa(()=>t[o]):l=t[o],l===void 0&&b!==void 0&&(l=a(),c&&(Jo(),c(l)));var p;if(p=()=>{var s=t[o];return s===void 0?a():(n=!0,s)},(_&ko)===0)return p;if(c){var g=t.$$legacy;return(function(s,d){return arguments.length>0?((!d||g||u)&&c(d?p():s),s):p()})}var h=!1,r=((_&Eo)!==0?Ei:bn)(()=>(h=!1,p()));w&&L(r);var i=pe;return(function(s,d){if(arguments.length>0){const m=d?L(r):w?ke(s):s;return V(r,m),h=!0,E!==void 0&&(E=m),s}return Qt&&h||(i.f&nt)!==0?r.v:L(r)})}const vi="wt-ssh-host";function Cs(t){return t.repo?`${t.repo} #${t.number}`:`PR #${t.number}`}function zt(t){return t instanceof Error?t.message:String(t)}function qs(t,o){return o.toLowerCase().includes(t.toLowerCase())}var ml=ee('<a target="_blank" rel="noopener"> </a>'),Sl=ee("<span> </span>");function Qn(t,o){Re(o,!0);let _=Ce(o,"clickable",3,!1);function b(c){return c==="merged"?"bg-[#8b5cf6]/20 text-[#a78bfa]":c==="closed"?"bg-danger/20 text-danger":c==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}let w=ve(()=>Cs(o.pr));var k=Tt(),E=xe(k);{var n=c=>{var f=ml(),l=X(f);oe(u=>{we(f,"href",o.pr.url),Be(f,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),se(l,L(w))},[()=>b(o.pr.state)]),G(c,f)},a=c=>{var f=Sl(),l=X(f);oe(u=>{Be(f,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),se(l,L(w))},[()=>b(o.pr.state)]),G(c,f)};ne(E,c=>{_()&&o.pr.url?c(n):c(a,-1)})}G(t,k),Ae()}var bl=ee('<a target="_blank" rel="noopener noreferrer" class="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80"> </a>');function eo(t,o){Re(o,!0);var _=bl(),b=X(_);oe(()=>{we(_,"href",o.issue.url),Zr(_,`color: ${o.issue.state.color??""}; background: ${o.issue.state.color??""}20;`),we(_,"title",`${o.issue.identifier??""} (${o.issue.state.name??""})`),se(b,o.issue.identifier)}),G(t,_),Ae()}var wl=Di('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="19" cy="12" r="1.5"></circle></svg>'),Cl=Di('<svg class="text-warning" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M12 7v2"></path><path d="M12 13h.01"></path></svg>'),yl=Di('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'),xl=Di('<svg class="text-danger" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'),El=ee("<span><!> </span>");function kl(t,o){const _=f=>{var l=Tt(),u=xe(l);{var p=i=>{var e=wl();oe(()=>{we(e,"width",b()),we(e,"height",b())}),G(i,e)},g=i=>{var e=Cl();oe(()=>{we(e,"width",b()),we(e,"height",b())}),G(i,e)},h=i=>{var e=yl();oe(()=>{we(e,"width",b()),we(e,"height",b())}),G(i,e)},r=i=>{var e=xl();oe(()=>{we(e,"width",b()),we(e,"height",b())}),G(i,e)};ne(u,i=>{o.status==="working"?i(p):o.status==="waiting"?i(g,1):o.status==="done"?i(h,2):o.status==="error"&&i(r,3)})}G(f,l)};let b=Ce(o,"size",3,10),w=Ce(o,"pill",3,!1);function k(f){return f==="working"?"bg-success/15 text-success":f==="waiting"?"bg-warning/15 text-warning":f==="done"?"bg-success/15 text-success":f==="error"?"bg-danger/15 text-danger":"bg-hover text-muted"}var E=Tt(),n=xe(E);{var a=f=>{var l=El(),u=X(l);_(u);var p=J(u);oe(g=>{Be(l,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${g??""}`),se(p,` ${(o.status||"idle")??""}`)},[()=>k(o.status)]),G(f,l)},c=f=>{_(f)};ne(n,f=>{w()?f(a):f(c,-1)})}G(t,E)}var Ll=ee('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),Dl=ee('<span class="shrink-0 text-[10px] text-muted">closed</span>'),Rl=ee('<span class="shrink-0"><!></span>'),Al=ee('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),Tl=ee("<span> </span>"),Bl=ee("<span> </span>"),Ml=ee("<span> </span>"),Pl=ee('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),Ol=ee('<li><button type="button"><span class="flex items-center gap-1.5 pr-5 flex-wrap"><div class="flex items-center gap-2 max-w-[90%] min-w-0"><span class="font-medium truncate"> </span> <!> <!></div> <!> <!></span> <span class="flex gap-2 text-[11px] text-muted items-center flex-wrap"><!> <!></span> <!></button> <button type="button" class="absolute top-2 right-2 w-5 h-5 rounded flex items-center justify-center text-muted hover:text-danger hover:bg-hover opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer" title="Remove worktree">&times;</button></li>'),Il=ee('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function Hl(t,o){Re(o,!0);var _=Il();Ke(_,21,()=>o.worktrees,b=>b.branch,(b,w)=>{const k=ve(()=>L(w).branch===o.selected),E=ve(()=>o.removing.has(L(w).branch)),n=ve(()=>L(w).mux!=="✓"),a=ve(()=>o.initializing.has(L(w).branch));var c=Ol(),f=X(c),l=X(f),u=X(l),p=X(u),g=X(p),h=J(p,2);{var r=j=>{var K=Ll();G(j,K)},i=j=>{var K=Dl();G(j,K)},e=j=>{var K=Rl(),y=X(K);kl(y,{get status(){return L(w).agent},size:14}),G(j,K)};ne(h,j=>{L(a)?j(r):L(n)?j(i,1):j(e,-1)})}var s=J(h,2);{var d=j=>{var K=Al();G(j,K)},m=ve(()=>o.notifiedBranches.has(L(w).branch));ne(s,j=>{L(m)&&j(d)})}var S=J(u,2);Ke(S,17,()=>L(w).prs,j=>j.repo,(j,K)=>{Qn(j,{get pr(){return L(K)}})});var C=J(S,2);{var v=j=>{eo(j,{get issue(){return L(w).linearIssue}})};ne(C,j=>{L(w).linearIssue&&j(v)})}var x=J(l,2),B=X(x);{var P=j=>{var K=Tl(),y=X(K);oe(()=>se(y,L(w).agentName)),G(j,K)};ne(B,j=>{L(w).agentName&&j(P)})}var O=J(B,2);{var A=j=>{var K=Bl(),y=X(K);oe(()=>se(y,L(w).profile)),G(j,K)};ne(O,j=>{L(w).profile&&j(A)})}var F=J(x,2);{var H=j=>{var K=Pl();Ke(K,21,()=>L(w).services,Yr,(y,R)=>{var M=Tt(),T=xe(M);{var N=q=>{var Z=Ml(),re=X(Z);oe(()=>{Be(Z,1,Vn(L(R).running?"text-success":"")),se(re,`${L(R).name??""}:${L(R).port??""}`)}),G(q,Z)};ne(T,q=>{L(R).port&&q(N)})}G(y,M)}),G(j,K)};ne(F,j=>{L(w).services.length>0&&j(H)})}var W=J(f,2);oe(()=>{Be(c,1,`mb-0.5 group relative ${L(E)||L(a)?"opacity-40 pointer-events-none":""}`),Be(f,1,`w-full py-2.5 px-3 rounded-md border cursor-pointer flex flex-col gap-1 text-left text-inherit text-sm bg-transparent hover:bg-hover ${L(k)?"bg-active border-accent":"border-transparent"} ${L(n)&&!L(a)?"opacity-50":""}`),se(g,L(w).branch)}),me("click",f,()=>o.onselect(L(w).branch)),me("click",W,j=>{j.stopPropagation(),o.onremove(L(w).branch)}),G(b,c)}),G(t,_),Ae()}lt(["click"]);var Fl=ee('<button type="button" title="View CI checks"><span></span> CI</button>');function Nl(t,o){Re(o,!0);function _(E){return E==="failed"?"bg-danger/20 text-danger":E==="success"?"bg-success/20 text-success":E==="pending"?"bg-warning/20 text-warning":"bg-muted/20 text-muted"}function b(E){return E==="failed"?"bg-danger":E==="success"?"bg-success":E==="pending"?"bg-warning animate-pulse":"bg-muted"}var w=Fl(),k=X(w);oe((E,n)=>{Be(w,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex items-center gap-1 cursor-pointer border-none hover:opacity-80 ${E??""}`),Be(k,1,`inline-block w-1.5 h-1.5 rounded-full ${n??""}`)},[()=>_(o.pr.ciStatus),()=>b(o.pr.ciStatus)]),me("click",w,E=>{E.stopPropagation(),o.onclick(o.pr)}),G(t,w),Ae()}lt(["click"]);var Wl=ee('<button type="button" class="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex items-center gap-1 cursor-pointer border-none hover:opacity-80 bg-accent/20 text-accent" title="Send PR comments to Claude for review"><span class="inline-block w-1.5 h-1.5 rounded-full bg-accent"></span> </button>');function Ul(t,o){Re(o,!0);var _=Wl(),b=J(X(_));oe(()=>se(b,` ${o.pr.comments.length??""} ${o.pr.comments.length===1?"comment":"comments"}`)),me("click",_,w=>{w.stopPropagation(),o.onclick(o.pr)}),G(t,_),Ae()}lt(["click"]);var jl=ee("<button><!></button>");function je(t,o){let _=Ce(o,"variant",3,"default"),b=Ce(o,"small",3,!1),w=Ce(o,"class",3,""),k=Zn(o,["$$slots","$$events","$$legacy","variant","small","class","children"]);const E={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},n={default:"border-edge bg-surface text-primary hover:bg-hover",cta:"border-accent bg-accent text-white hover:opacity-90",danger:"border-danger bg-danger text-white hover:opacity-90","accent-outline":"border-accent text-accent bg-surface hover:bg-accent/10","danger-outline":"border-danger text-danger bg-surface hover:bg-danger/10"};var a=jl();Jn(a,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${E[b()?"small":"normal"]??""} ${n[_()]??""} ${w()??""}`,...k}));var c=X(a);bs(c,()=>o.children),G(t,a)}var zl=ee('<span class="text-success">&#10003;</span>'),$l=ee('<span class="text-accent">&#9741;</span>'),Kl=ee('<span class="text-[10px] text-muted"> </span>'),ql=ee('<span class="text-xs text-accent truncate"> </span>'),Vl=ee('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function to(t,o){Re(o,!0);let _=Ce(o,"showTimestamp",3,!1),b=Ce(o,"large",3,!1);var w=Vl(),k=xe(w),E=X(k);{var n=h=>{var r=zl();G(h,r)},a=h=>{var r=$l();G(h,r)};ne(E,h=>{o.notification.type==="agent_stopped"?h(n):h(a,-1)})}var c=J(k,2),f=X(c),l=X(f),u=J(f,2);{var p=h=>{var r=Kl(),i=X(r);oe(e=>se(i,e),[()=>new Date(o.notification.timestamp).toLocaleTimeString()]),G(h,r)},g=h=>{var r=ql(),i=X(r);oe(()=>se(i,o.notification.url)),G(h,r)};ne(u,h=>{_()?h(p):o.notification.url&&h(g,1)})}oe(()=>{Be(k,1,`shrink-0 ${b()?"text-base":"text-sm"}`),Be(f,1,`${b()?"text-sm":"text-xs"} text-primary truncate`),se(l,o.notification.message)}),G(t,w),Ae()}var Gl=ee('<button type="button" class="p-1 -ml-1 cursor-pointer bg-transparent border-none text-muted hover:text-primary" title="Toggle sidebar"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>'),Xl=ee('<span class="text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning">dirty</span>'),Jl=ee("<!> <!> <!>",1),Yl=ee('<a target="_blank" rel="noopener"> </a>'),Zl=ee('<div class="flex items-center gap-1"><a class="text-[11px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-mono no-underline hover:opacity-80" title="Open in Cursor">Cursor</a><button type="button" class="text-[11px] px-1 py-0.5 rounded border border-accent/40 text-accent cursor-pointer bg-transparent hover:opacity-80 flex items-center" title="Cursor SSH settings"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button></div>'),Ql=ee("<!> <!>",1),ec=ee("<!> <!> <!>",1),tc=ee('<span class="absolute -top-0.5 -right-0.5 w-4 h-4 rounded-full bg-accent text-white text-[10px] flex items-center justify-center leading-none"> </span>'),rc=ee('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),ic=ee('<li><button type="button" class="w-full px-3 py-2 text-left bg-transparent border-none text-inherit cursor-pointer hover:bg-hover flex items-center gap-2"><!></button></li>'),sc=ee('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),nc=ee('<div class="bell-dropdown svelte-gwjq7z"><div class="text-xs font-semibold text-muted px-3 py-2 border-b border-edge">Notifications</div> <!></div>'),oc=ee('<div class="flex items-center justify-between px-4 py-2 bg-topbar border-b border-edge min-h-12"><div class="flex items-center gap-3"><!> <span class="text-sm font-semibold truncate"> </span> <!> <!> <!> <!></div> <div class="flex gap-2 items-center"><!> <div class="bell-container relative ml-3"><button type="button" class="relative p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Notifications"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"></path><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"></path></svg> <!></button> <!></div></div></div>');function ac(t,o){Re(o,!0);let _=Ce(o,"isMobile",3,!1),b=Ce(o,"notificationHistory",19,()=>[]),w=Ce(o,"unreadCount",3,0),k=ae(!1);function E(){var H;V(k,!L(k)),L(k)&&((H=o.onbellopen)==null||H.call(o))}function n(H){H.target.closest(".bell-container")||V(k,!1)}let a=ve(()=>{var W;const H=(W=o.worktree)==null?void 0:W.dir;return H?o.sshHost?`cursor://vscode-remote/ssh-remote+${o.sshHost}${H}`:`cursor://file${H}`:null});var c=oc();ai("click",Qi,n);var f=X(c),l=X(f);{var u=H=>{var W=Gl();me("click",W,function(...j){var K;(K=o.ontogglesidebar)==null||K.apply(this,j)}),G(H,W)};ne(l,H=>{_()&&o.ontogglesidebar&&H(u)})}var p=J(l,2),g=X(p),h=J(p,2);{var r=H=>{var W=Xl();G(H,W)};ne(h,H=>{var W;(W=o.worktree)!=null&&W.dirty&&H(r)})}var i=J(h,2);{var e=H=>{eo(H,{get issue(){return o.worktree.linearIssue}})};ne(i,H=>{var W;(W=o.worktree)!=null&&W.linearIssue&&H(e)})}var s=J(i,2);Ke(s,17,()=>{var H;return((H=o.worktree)==null?void 0:H.prs)??[]},H=>H.repo,(H,W)=>{var j=Jl(),K=xe(j);Qn(K,{get pr(){return L(W)},clickable:!0});var y=J(K,2);{var R=N=>{Nl(N,{get pr(){return L(W)},get onclick(){return o.onciclick}})};ne(y,N=>{L(W).ciChecks&&L(W).ciChecks.length>0&&N(R)})}var M=J(y,2);{var T=N=>{Ul(N,{get pr(){return L(W)},get onclick(){return o.onreviewsclick}})};ne(M,N=>{L(W).comments.length>0&&N(T)})}G(H,j)});var d=J(s,2);{var m=H=>{var W=Ql(),j=xe(W);Ke(j,17,()=>{var R;return((R=o.worktree)==null?void 0:R.services)??[]},Yr,(R,M)=>{var T=Tt(),N=xe(T);{var q=Z=>{var re=Yl(),I=X(re);oe(()=>{we(re,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${L(M).port??""}`),Be(re,1,`text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${L(M).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),se(I,`${L(M).name??""} :${L(M).port??""}`)}),G(Z,re)};ne(N,Z=>{L(M).port&&Z(q)})}G(R,T)});var K=J(j,2);{var y=R=>{var M=Zl(),T=X(M),N=J(T);oe(()=>we(T,"href",L(a))),me("click",N,function(...q){var Z;(Z=o.onsettings)==null||Z.apply(this,q)}),G(R,M)};ne(K,R=>{L(a)&&R(y)})}G(H,W)};ne(d,H=>{_()||H(m)})}var S=J(f,2),C=X(S);{var v=H=>{var W=ec(),j=xe(W);{var K=M=>{je(M,{variant:"default",get onclick(){return o.onclose},title:"Close worktree window",children:(T,N)=>{var q=He();oe(()=>se(q,_()?"C":"Close")),G(T,q)},$$slots:{default:!0}})};ne(j,M=>{o.worktree.mux==="✓"&&M(K)})}var y=J(j,2);je(y,{variant:"accent-outline",get onclick(){return o.onmerge},title:"Merge worktree",children:(M,T)=>{var N=He();oe(()=>se(N,_()?"M":"Merge")),G(M,N)},$$slots:{default:!0}});var R=J(y,2);je(R,{variant:"danger-outline",get onclick(){return o.onremove},title:"Remove worktree",children:(M,T)=>{var N=He();oe(()=>se(N,_()?"R":"Remove")),G(M,N)},$$slots:{default:!0}}),G(H,W)};ne(C,H=>{o.worktree&&H(v)})}var x=J(C,2),B=X(x),P=J(X(B),2);{var O=H=>{var W=tc(),j=X(W);oe(()=>se(j,w()>9?"9+":w())),G(H,W)};ne(P,H=>{w()>0&&H(O)})}var A=J(B,2);{var F=H=>{var W=nc(),j=J(X(W),2);{var K=R=>{var M=rc();G(R,M)},y=R=>{var M=sc();Ke(M,21,b,T=>T.id,(T,N)=>{var q=ic(),Z=X(q),re=X(Z);to(re,{get notification(){return L(N)},showTimestamp:!0}),me("click",Z,()=>{var I;(I=o.onnotificationselect)==null||I.call(o,L(N).branch),V(k,!1)}),G(T,q)}),G(R,M)};ne(j,R=>{b().length===0?R(K):R(y,-1)})}G(H,W)};ne(A,H=>{L(k)&&H(F)})}oe(()=>se(g,o.name??"Select a worktree")),me("keydown",x,()=>{}),me("click",B,E),G(t,c),Ae()}lt(["click","keydown"]);var Wi={exports:{}},Vs;function lc(){return Vs||(Vs=1,(function(t,o){(function(_,b){t.exports=b()})(globalThis,(()=>(()=>{var _={4567:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,m){var S,C=arguments.length,v=C<3?s:m===null?m=Object.getOwnPropertyDescriptor(s,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,m);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,m){s(d,m,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const l=a(9042),u=a(9924),p=a(844),g=a(4725),h=a(2585),r=a(3656);let i=n.AccessibilityManager=class extends p.Disposable{constructor(e,s,d,m){super(),this._terminal=e,this._coreBrowserService=d,this._renderService=m,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 S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,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 u.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((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
3
+ `)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let s=0;s<e;s++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
4
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,s){this._liveRegionDebouncer.refresh(e,s,this._terminal.rows)}_renderRows(e,s){const d=this._terminal.buffer,m=d.lines.length.toString();for(let S=e;S<=s;S++){const C=d.lines.get(d.ydisp+S),v=[],x=(C==null?void 0:C.translateToString(!0,void 0,void 0,v))||"",B=(d.ydisp+S+1).toString(),P=this._rowElements[S];P&&(x.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=x,this._rowColumns.set(P,v)),P.setAttribute("aria-posinset",B),P.setAttribute("aria-setsize",m))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,s){const d=e.target,m=this._rowElements[s===0?1:this._rowElements.length-2];if(d.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==m)return;let S,C;if(s===0?(S=d,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(S=this._rowElements.shift(),C=d,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:e.anchorNode,offset:e.anchorOffset},d={node:e.focusNode,offset:e.focusOffset};if((s.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===d.node&&s.offset>d.offset)&&([s,d]=[d,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const m=this._rowElements.slice(-1)[0];if(d.node.compareDocumentPosition(m)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(d={node:m,offset:((x=m.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(d.node))return;const S=({node:B,offset:P})=>{const O=B instanceof Text?B.parentNode:B;let A=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(O);if(!F)return console.warn("columns is null. Race condition?"),null;let H=P<F.length?F[P]:F.slice(-1)[0]+1;return H>=this._terminal.cols&&(++A,H=0),{row:A,column:H}},C=S(s),v=S(d);if(C&&v){if(C.row>v.row||C.row===v.row&&C.column>=v.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(v.row-C.row)*this._terminal.cols-C.column+v.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=i=c([f(1,h.IInstantiationService),f(2,g.ICoreBrowserService),f(3,g.IRenderService)],i)},3614:(E,n)=>{function a(u){return u.replace(/\r?\n/g,"\r")}function c(u,p){return p?"\x1B[200~"+u+"\x1B[201~":u}function f(u,p,g,h){u=c(u=a(u),g.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(u,!0),p.value=""}function l(u,p,g){const h=g.getBoundingClientRect(),r=u.clientX-h.left-10,i=u.clientY-h.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${r}px`,p.style.top=`${i}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=c,n.copyHandler=function(u,p){u.clipboardData&&u.clipboardData.setData("text/plain",p.selectionText),u.preventDefault()},n.handlePasteEvent=function(u,p,g,h){u.stopPropagation(),u.clipboardData&&f(u.clipboardData.getData("text/plain"),p,g,h)},n.paste=f,n.moveTextAreaUnderMouseCursor=l,n.rightClickHandler=function(u,p,g,h,r){l(u,p,g),r&&h.rightClickSelect(u),p.value=h.selectionText,p.select()}},7239:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const c=a(1505);n.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(f,l,u){this._css.set(f,l,u)}getCss(f,l){return this._css.get(f,l)}setColor(f,l,u){this._color.set(f,l,u)}getColor(f,l){return this._color.get(f,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,c,f,l){a.addEventListener(c,f,l);let u=!1;return{dispose:()=>{u||(u=!0,a.removeEventListener(c,f,l))}}}},3551:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var m,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(m=i[v])&&(C=(S<3?m(C):S>3?m(e,s,C):m(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const l=a(3656),u=a(8460),p=a(844),g=a(2585),h=a(4725);let r=n.Linkifier=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(i,e,s,d,m){super(),this._element=i,this._mouseService=e,this._renderService=s,this._bufferService=d,this._linkProviderService=m,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new u.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new u.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const s=i.composedPath();for(let d=0;d<s.length;d++){const m=s[d];if(m.classList.contains("xterm"))break;if(m.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){var d,m;this._activeProviderReplies&&e||((d=this._activeProviderReplies)==null||d.forEach((S=>{S==null||S.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=i.y);let s=!1;for(const[S,C]of this._linkProviderService.linkProviders.entries())e?(m=this._activeProviderReplies)!=null&&m.get(S)&&(s=this._checkLinkProviderResult(S,i,s)):C.provideLinks(i.y,(v=>{var B,P;if(this._isMouseOut)return;const x=v==null?void 0:v.map((O=>({link:O})));(B=this._activeProviderReplies)==null||B.set(S,x),s=this._checkLinkProviderResult(S,i,s),((P=this._activeProviderReplies)==null?void 0:P.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)}))}_removeIntersectingLinks(i,e){const s=new Set;for(let d=0;d<e.size;d++){const m=e.get(d);if(m)for(let S=0;S<m.length;S++){const C=m[S],v=C.link.range.start.y<i?0:C.link.range.start.x,x=C.link.range.end.y>i?this._bufferService.cols:C.link.range.end.x;for(let B=v;B<=x;B++){if(s.has(B)){m.splice(S--,1);break}s.add(B)}}}}_checkLinkProviderResult(i,e,s){var S;if(!this._activeProviderReplies)return s;const d=this._activeProviderReplies.get(i);let m=!1;for(let C=0;C<i;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(m=!0);if(!m&&d){const C=d.find((v=>this._linkAtPosition(v.link,e)));C&&(s=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let C=0;C<this._activeProviderReplies.size;C++){const v=(S=this._activeProviderReplies.get(C))==null?void 0:S.find((x=>this._linkAtPosition(x.link,e)));if(v){s=!0,this._handleNewLink(v);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.pointerCursor},set:s=>{var d;(d=this._currentLink)!=null&&d.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.underline},set:s=>{var d,m,S;(d=this._currentLink)!=null&&d.state&&((S=(m=this._currentLink)==null?void 0:m.state)==null?void 0:S.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((s=>{if(!this._currentLink)return;const d=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,m=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=m&&(this._clearCurrentLink(d,m),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(i,e,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(s,e.text)}_fireUnderlineEvent(i,e){const s=i.range,d=this._bufferService.buffer.ydisp,m=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-d-1,s.end.x,s.end.y-d-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(m)}_linkLeave(i,e,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(s,e.text)}_linkAtPosition(i,e){const s=i.range.start.y*this._bufferService.cols+i.range.start.x,d=i.range.end.y*this._bufferService.cols+i.range.end.x,m=e.y*this._bufferService.cols+e.x;return s<=m&&m<=d}_positionFromMouseEvent(i,e,s){const d=s.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,s,d,m){return{x1:i,y1:e,x2:s,y2:d,cols:this._bufferService.cols,fg:m}}};n.Linkifier=r=c([f(1,h.IMouseService),f(2,h.IRenderService),f(3,g.IBufferService),f(4,h.ILinkProviderService)],r)},9042:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(E,n,a){var c=this&&this.__decorate||function(h,r,i,e){var s,d=arguments.length,m=d<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,r,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(m=(d<3?s(m):d>3?s(r,i,m):s(r,i))||m);return d>3&&m&&Object.defineProperty(r,i,m),m},f=this&&this.__param||function(h,r){return function(i,e){r(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const l=a(511),u=a(2585);let p=n.OscLinkProvider=class{constructor(h,r,i){this._bufferService=h,this._optionsService=r,this._oscLinkService=i}provideLinks(h,r){var x;const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void r(void 0);const e=[],s=this._optionsService.rawOptions.linkHandler,d=new l.CellData,m=i.getTrimmedLength();let S=-1,C=-1,v=!1;for(let B=0;B<m;B++)if(C!==-1||i.hasContent(B)){if(i.loadCell(B,d),d.hasExtendedAttrs()&&d.extended.urlId){if(C===-1){C=B,S=d.extended.urlId;continue}v=d.extended.urlId!==S}else C!==-1&&(v=!0);if(v||C!==-1&&B===m-1){const P=(x=this._oscLinkService.getLinkData(S))==null?void 0:x.uri;if(P){const O={start:{x:C+1,y:h},end:{x:B+(v||B!==m-1?0:1),y:h}};let A=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const F=new URL(P);["http:","https:"].includes(F.protocol)||(A=!0)}catch{A=!0}A||e.push({text:P,range:O,activate:(F,H)=>s?s.activate(F,H,O):g(0,H),hover:(F,H)=>{var W;return(W=s==null?void 0:s.hover)==null?void 0:W.call(s,F,H,O)},leave:(F,H)=>{var W;return(W=s==null?void 0:s.leave)==null?void 0:W.call(s,F,H,O)}})}v=!1,d.hasExtendedAttrs()&&d.extended.urlId?(C=B,S=d.extended.urlId):(C=-1,S=-1)}}r(e)}};function g(h,r){if(confirm(`Do you want to navigate to ${r}?
5
+
6
+ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=p=c([f(0,u.IBufferService),f(1,u.IOptionsService),f(2,u.IOscLinkService)],p)},6193:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,f){this._rowCount=f,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const c=a(3614),f=a(3656),l=a(3551),u=a(9042),p=a(3730),g=a(1680),h=a(3107),r=a(5744),i=a(2950),e=a(1296),s=a(428),d=a(4269),m=a(5114),S=a(8934),C=a(3230),v=a(9312),x=a(4725),B=a(6731),P=a(8055),O=a(8969),A=a(8460),F=a(844),H=a(6114),W=a(8437),j=a(2584),K=a(7399),y=a(5941),R=a(9074),M=a(2585),T=a(5435),N=a(4567),q=a(779);class Z extends O.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(I={}){super(I),this.browser=H,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(q.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,Y)=>this.refresh(D,Y)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((D=>this._reportWindowsOptions(D)))),this.register(this._inputHandler.onColor((D=>this._handleColorEvent(D)))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((D=>this._afterResize(D.cols,D.rows)))),this.register((0,F.toDisposable)((()=>{var D,Y;this._customKeyEventHandler=void 0,(Y=(D=this.element)==null?void 0:D.parentNode)==null||Y.removeChild(this.element)})))}_handleColorEvent(I){if(this._themeService)for(const D of I){let Y,z="";switch(D.index){case 256:Y="foreground",z="10";break;case 257:Y="background",z="11";break;case 258:Y="cursor",z="12";break;default:Y="ansi",z="4;"+D.index}switch(D.type){case 0:const ie=P.color.toColorRGB(Y==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[Y]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${z};${(0,y.toRgbString)(ie)}${j.C1_ESCAPED.ST}`);break;case 1:if(Y==="ansi")this._themeService.modifyColors((Q=>Q.ansi[D.index]=P.channels.toColor(...D.color)));else{const Q=Y;this._themeService.modifyColors((le=>le[Q]=P.channels.toColor(...D.color)))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.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 I=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(I);if(!D)return;const Y=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,ie=D.getWidth(Y),Q=this._renderService.dimensions.css.cell.width*ie,le=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=Y*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=le+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,c.copyHandler)(D,this._selectionService)})));const I=D=>(0,c.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,f.addDisposableDomListener)(this.element,"paste",I)),H.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,c.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,c.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),H.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,c.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(I=>this._keyUp(I)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(I=>this._keyDown(I)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(I=>this._keyPress(I)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(I=>this._compositionHelper.compositionupdate(I)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(I=>this._inputEvent(I)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(I){var Y;if(!I)throw new Error("Terminal requires a parent element.");if(I.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((Y=this.element)==null?void 0:Y.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=I.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"),I.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.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,f.addDisposableDomListener)(this.screenElement,"mousemove",(z=>this.updateCursorStyle(z)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",u.promptLabel),H.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(m.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(z=>this._handleTextAreaFocus(z)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(d.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((z=>this._onRender.fire(z)))),this.onResize((z=>this._renderService.resize(z.cols,z.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((z=>this.scrollLines(z.amount,z.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((z=>this.scrollLines(z.amount,z.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((z=>this._renderService.handleSelectionChanged(z.start,z.end,z.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((z=>{this.textarea.value=z,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(z=>this._selectionService.handleMouseDown(z)))),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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(z=>this._handleScreenReaderModeOptionChange(z)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,D=this.element;function Y(Q){const le=I._mouseService.getMouseReportCoords(Q,I.screenElement);if(!le)return!1;let _e,Se;switch(Q.overrideType||Q.type){case"mousemove":Se=32,Q.buttons===void 0?(_e=3,Q.button!==void 0&&(_e=Q.button<3?Q.button:3)):_e=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":Se=0,_e=Q.button<3?Q.button:3;break;case"mousedown":Se=1,_e=Q.button<3?Q.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(Q)===!1||I.viewport.getLinesScrolled(Q)===0)return!1;Se=Q.deltaY<0?0:1,_e=4;break;default:return!1}return!(Se===void 0||_e===void 0||_e>4)&&I.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:Se,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ie={mouseup:Q=>(Y(Q),Q.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(Q)),wheel:Q=>(Y(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&Y(Q)},mousemove:Q=>{Q.buttons||Y(Q)}};this.register(this.coreMouseService.onProtocolChange((Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),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&Q?z.mousemove||(D.addEventListener("mousemove",ie.mousemove),z.mousemove=ie.mousemove):(D.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&Q?z.wheel||(D.addEventListener("wheel",ie.wheel,{passive:!1}),z.wheel=ie.wheel):(D.removeEventListener("wheel",z.wheel),z.wheel=null),2&Q?z.mouseup||(z.mouseup=ie.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&Q?z.mousedrag||(z.mousedrag=ie.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(D,"mousedown",(Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return Y(Q),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(Q)}))),this.register((0,f.addDisposableDomListener)(D,"wheel",(Q=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Q)===!1)return!1;if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(Q);if(le===0)return;const _e=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let Se="";for(let Pe=0;Pe<Math.abs(le);Pe++)Se+=_e;return this.coreService.triggerDataEvent(Se,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(D,"touchstart",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(D,"touchmove",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)}),{passive:!1}))}refresh(I,D){var Y;(Y=this._renderService)==null||Y.refreshRows(I,D)}updateCursorStyle(I){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(I)?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(I,D,Y=0){var z;Y===1?(super.scrollLines(I,D,Y),this.refresh(0,this.rows-1)):(z=this.viewport)==null||z.scrollLines(I)}paste(I){(0,c.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,D,Y){this._selectionService.setSelection(I,D,Y)}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 I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,D){var Y;(Y=this._selectionService)==null||Y.selectLines(I,D)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!D&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Y=(0,K.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),Y.type===3||Y.type===2){const z=this.rows-1;return this.scrollLines(Y.type===2?-z:z),this.cancel(I,!0)}return Y.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(Y.cancel&&this.cancel(I,!0),!Y.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Y.key!==j.C0.ETX&&Y.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Y.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(Y.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,D){const Y=I.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||I.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||I.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?Y:Y&&(!D.keyCode||D.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)D=I.charCode;else if(I.which===null||I.which===void 0)D=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;D=I.which}return!(!D||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=I.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(I),!0}return!1}resize(I,D){I!==this.cols||D!==this.rows?super.resize(I,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,D){var Y,z;(Y=this._charSizeService)==null||Y.measure(),(z=this.viewport)==null||z.syncScrollArea(!0)}clear(){var I;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 D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var D,Y;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(Y=this.viewport)==null||Y.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case T.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),Y=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${Y};${D}t`);break;case T.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),ie=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${ie};${z}t`)}}cancel(I,D){if(this.options.cancelEvents||D)return I.preventDefault(),I.stopPropagation(),!1}}n.Terminal=Z},9924:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,f){this._rowCount=f,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const u=l-this._lastRefreshMs,p=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var m,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(m=i[v])&&(C=(S<3?m(C):S>3?m(e,s,C):m(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const l=a(3656),u=a(4725),p=a(8460),g=a(844),h=a(2585);let r=n.Viewport=class extends g.Disposable{constructor(i,e,s,d,m,S,C,v){super(),this._viewportElement=i,this._scrollArea=e,this._bufferService=s,this._optionsService=d,this._charSizeService=m,this._renderService=S,this._coreBrowserService=C,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 p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.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(i){if(i)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<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(i,e){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&s<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const e=this._getPixelsScrolled(i);return e!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=i*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(i,e){var v;let s,d="";const m=[],S=e??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let x=i;x<S;x++){const B=C.get(x);if(!B)continue;const P=(v=C.get(x+1))==null?void 0:v.isWrapped;if(d+=B.translateToString(!P),!P||x===C.length-1){const O=document.createElement("div");O.textContent=d,m.push(O),d.length>0&&(s=O),d=""}}return{bufferElements:m,cursorElement:s}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(i,e){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&e.altKey||s==="ctrl"&&e.ctrlKey||s==="shift"&&e.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const e=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}};n.Viewport=r=c([f(2,h.IBufferService),f(3,h.IOptionsService),f(4,u.ICharSizeService),f(5,u.IRenderService),f(6,u.ICoreBrowserService),f(7,u.IThemeService)],r)},3107:function(E,n,a){var c=this&&this.__decorate||function(h,r,i,e){var s,d=arguments.length,m=d<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,r,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(m=(d<3?s(m):d>3?s(r,i,m):s(r,i))||m);return d>3&&m&&Object.defineProperty(r,i,m),m},f=this&&this.__param||function(h,r){return function(i,e){r(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const l=a(4725),u=a(844),p=a(2585);let g=n.BufferDecorationRenderer=class extends u.Disposable{constructor(h,r,i,e,s){super(),this._screenElement=h,this._bufferService=r,this._coreBrowserService=i,this._decorationService=e,this._renderService=s,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((d=>this._removeDecoration(d)))),this.register((0,u.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 h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var e;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((e=h==null?void 0:h.options)==null?void 0:e.layer)==="top"),r.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=h.options.x??0;return i&&i>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(h,r),r}_refreshStyle(h){const r=h.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let i=this._decorationElements.get(h);i||(i=this._createElement(h),h.element=i,this._decorationElements.set(h,i),this._container.appendChild(i),h.onDispose((()=>{this._decorationElements.delete(h),i.remove()}))),i.style.top=r*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(i)}}_refreshXPosition(h,r=h.element){if(!r)return;const i=h.options.x??0;(h.options.anchor||"left")==="right"?r.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var r;(r=this._decorationElements.get(h))==null||r.remove(),this._decorationElements.delete(h),h.dispose()}};n.BufferDecorationRenderer=g=c([f(1,p.IBufferService),f(2,l.ICoreBrowserService),f(3,p.IDecorationService),f(4,l.IRenderService)],g)},5871:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,f){return c>=a.startBufferLine-this._linePadding[f||"full"]&&c<=a.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(E,n,a){var c=this&&this.__decorate||function(s,d,m,S){var C,v=arguments.length,x=v<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(s,d,m,S);else for(var B=s.length-1;B>=0;B--)(C=s[B])&&(x=(v<3?C(x):v>3?C(d,m,x):C(d,m))||x);return v>3&&x&&Object.defineProperty(d,m,x),x},f=this&&this.__param||function(s,d){return function(m,S){d(m,S,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const l=a(5871),u=a(4725),p=a(844),g=a(2585),h={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let e=n.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,d,m,S,C,v,x){var P;super(),this._viewportElement=s,this._screenElement=d,this._bufferService=m,this._decorationService=S,this._renderService=C,this._optionsService=v,this._coreBrowserService=x,this._colorZoneStore=new l.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(),(P=this._viewportElement.parentElement)==null||P.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,p.toDisposable)((()=>{var O;(O=this._canvas)==null||O.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 s=Math.floor(this._canvas.width/3),d=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=s,r.center=d,r.right=s,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=r.left,i.right=r.left+r.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,d=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);h.left=d,h.center=d,h.right=d}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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 d of this._decorationService.decorations)this._colorZoneStore.addDecoration(d);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const d of s)d.position!=="full"&&this._renderColorZone(d);for(const d of s)d.position==="full"&&this._renderColorZone(d);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(i[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-h[s.position||"full"]/2),r[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[s.position||"full"]))}_queueRefresh(s,d){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=d||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=e=c([f(2,g.IBufferService),f(3,g.IDecorationService),f(4,u.IRenderService),f(5,g.IOptionsService),f(6,u.ICoreBrowserService)],e)},2950:function(E,n,a){var c=this&&this.__decorate||function(h,r,i,e){var s,d=arguments.length,m=d<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,r,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(m=(d<3?s(m):d>3?s(r,i,m):s(r,i))||m);return d>3&&m&&Object.defineProperty(r,i,m),m},f=this&&this.__param||function(h,r){return function(i,e){r(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const l=a(4725),u=a(2585),p=a(2584);let g=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,r,i,e,s,d){this._textarea=h,this._compositionView=r,this._bufferService=i,this._optionsService=e,this._coreService=s,this._renderService=d,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(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,i=r.replace(h,"");this._dataAlreadySent=i,r.length>h.length?this._coreService.triggerDataEvent(i,!0):r.length<h.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):r.length===h.length&&r!==h&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(h){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const d=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(d.width,1)+"px",this._textarea.style.height=Math.max(d.height,1)+"px",this._textarea.style.lineHeight=d.height+"px"}h||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=g=c([f(2,u.IBufferService),f(3,u.IOptionsService),f(4,u.ICoreService),f(5,l.IRenderService)],g)},9806:(E,n)=>{function a(c,f,l){const u=l.getBoundingClientRect(),p=c.getComputedStyle(l),g=parseInt(p.getPropertyValue("padding-left")),h=parseInt(p.getPropertyValue("padding-top"));return[f.clientX-u.left-g,f.clientY-u.top-h]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(c,f,l,u,p,g,h,r,i){if(!g)return;const e=a(c,f,l);return e?(e[0]=Math.ceil((e[0]+(i?h/2:0))/h),e[1]=Math.ceil(e[1]/r),e[0]=Math.min(Math.max(e[0],1),u+(i?1:0)),e[1]=Math.min(Math.max(e[1],1),p),e):void 0}},9504:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const c=a(2584);function f(r,i,e,s){const d=r-l(r,e),m=i-l(i,e),S=Math.abs(d-m)-(function(C,v,x){let B=0;const P=C-l(C,x),O=v-l(v,x);for(let A=0;A<Math.abs(P-O);A++){const F=u(C,v)==="A"?-1:1,H=x.buffer.lines.get(P+F*A);H!=null&&H.isWrapped&&B++}return B})(r,i,e);return h(S,g(u(r,i),s))}function l(r,i){let e=0,s=i.buffer.lines.get(r),d=s==null?void 0:s.isWrapped;for(;d&&r>=0&&r<i.rows;)e++,s=i.buffer.lines.get(--r),d=s==null?void 0:s.isWrapped;return e}function u(r,i){return r>i?"A":"B"}function p(r,i,e,s,d,m){let S=r,C=i,v="";for(;S!==e||C!==s;)S+=d?1:-1,d&&S>m.cols-1?(v+=m.buffer.translateBufferLineToString(C,!1,r,S),S=0,r=0,C++):!d&&S<0&&(v+=m.buffer.translateBufferLineToString(C,!1,0,r+1),S=m.cols-1,r=S,C--);return v+m.buffer.translateBufferLineToString(C,!1,r,S)}function g(r,i){const e=i?"O":"[";return c.C0.ESC+e+r}function h(r,i){r=Math.floor(r);let e="";for(let s=0;s<r;s++)e+=i;return e}n.moveToCellSequence=function(r,i,e,s){const d=e.buffer.x,m=e.buffer.y;if(!e.buffer.hasScrollback)return(function(v,x,B,P,O,A){return f(x,P,O,A).length===0?"":h(p(v,x,v,x-l(x,O),!1,O).length,g("D",A))})(d,m,0,i,e,s)+f(m,i,e,s)+(function(v,x,B,P,O,A){let F;F=f(x,P,O,A).length>0?P-l(P,O):x;const H=P,W=(function(j,K,y,R,M,T){let N;return N=f(y,R,M,T).length>0?R-l(R,M):K,j<y&&N<=R||j>=y&&N<R?"C":"D"})(v,x,B,P,O,A);return h(p(v,F,B,H,W==="C",O).length,g(W,A))})(d,m,r,i,e,s);let S;if(m===i)return S=d>r?"D":"C",h(Math.abs(d-r),g(S,s));S=m>i?"D":"C";const C=Math.abs(m-i);return h((function(v,x){return x.cols-v})(m>i?r:d,e)+(C-1)*e.cols+1+((m>i?d:r)-1),g(S,s))}},1296:function(E,n,a){var c=this&&this.__decorate||function(A,F,H,W){var j,K=arguments.length,y=K<3?F:W===null?W=Object.getOwnPropertyDescriptor(F,H):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(A,F,H,W);else for(var R=A.length-1;R>=0;R--)(j=A[R])&&(y=(K<3?j(y):K>3?j(F,H,y):j(F,H))||y);return K>3&&y&&Object.defineProperty(F,H,y),y},f=this&&this.__param||function(A,F){return function(H,W){F(H,W,A)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const l=a(3787),u=a(2550),p=a(2223),g=a(6171),h=a(6052),r=a(4725),i=a(8055),e=a(8460),s=a(844),d=a(2585),m="xterm-dom-renderer-owner-",S="xterm-rows",C="xterm-fg-",v="xterm-bg-",x="xterm-focus",B="xterm-selection";let P=1,O=n.DomRenderer=class extends s.Disposable{constructor(A,F,H,W,j,K,y,R,M,T,N,q,Z){super(),this._terminal=A,this._document=F,this._element=H,this._screenElement=W,this._viewportElement=j,this._helperContainer=K,this._linkifier2=y,this._charSizeService=M,this._optionsService=T,this._bufferService=N,this._coreBrowserService=q,this._themeService=Z,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,s.toDisposable)((()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new u.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 A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 H of this._rowElements)H.style.width=`${this.dimensions.css.canvas.width}px`,H.style.height=`${this.dimensions.css.cell.height}px`,H.style.lineHeight=`${this.dimensions.css.cell.height}px`,H.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${S} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${S} .xterm-dim { color: ${i.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${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 H=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;F+=`@keyframes ${H} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${W} { 50% { box-shadow: none; }}`,F+=`@keyframes ${j} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[K,y]of A.ansi.entries())F+=`${this._terminalSelector} .${C}${K} { color: ${y.css}; }${this._terminalSelector} .${C}${K}.xterm-dim { color: ${i.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${v}${K} { background-color: ${y.css}; }`;F+=`${this._terminalSelector} .${C}${p.INVERTED_DEFAULT_COLOR} { color: ${i.color.opaque(A.background).css}; }${this._terminalSelector} .${C}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${i.color.multiplyOpacity(i.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${v}${p.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let H=this._rowElements.length;H<=F;H++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),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(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,H){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,H),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,H);const W=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||y<0)return;const R=this._document.createDocumentFragment();if(H){const M=A[0]>F[0];R.appendChild(this._createSelectionElement(K,M?F[0]:A[0],M?A[0]:F[0],y-K+1))}else{const M=W===K?A[0]:0,T=K===j?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(K,M,T));const N=y-K-1;if(R.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,N)),K!==y){const q=j===y?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(y,0,q))}}this._selectionContainer.appendChild(R)}_createSelectionElement(A,F,H,W=1){const j=this._document.createElement("div"),K=F*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(H-F);return K+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-K),j.style.height=W*this.dimensions.css.cell.height+"px",j.style.top=A*this.dimensions.css.cell.height+"px",j.style.left=`${K}px`,j.style.width=`${y}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 A of this._rowElements)A.replaceChildren()}renderRows(A,F){const H=this._bufferService.buffer,W=H.ybase+H.y,j=Math.min(H.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=A;M<=F;M++){const T=M+H.ydisp,N=this._rowElements[M],q=H.lines.get(T);if(!N||!q)break;N.replaceChildren(...this._rowFactory.createRow(q,T,T===W,y,R,j,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,H,W,j,K){H<0&&(A=0),W<0&&(F=0);const y=this._bufferService.rows-1;H=Math.max(Math.min(H,y),0),W=Math.max(Math.min(W,y),0),j=Math.min(j,this._bufferService.cols);const R=this._bufferService.buffer,M=R.ybase+R.y,T=Math.min(R.x,j-1),N=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=H;re<=W;++re){const I=re+R.ydisp,D=this._rowElements[re],Y=R.lines.get(I);if(!D||!Y)break;D.replaceChildren(...this._rowFactory.createRow(Y,I,I===M,q,Z,T,N,this.dimensions.css.cell.width,this._widthCache,K?re===H?A:0:-1,K?(re===W?F:j)-1:-1))}}};n.DomRenderer=O=c([f(7,d.IInstantiationService),f(8,r.ICharSizeService),f(9,d.IOptionsService),f(10,d.IBufferService),f(11,r.ICoreBrowserService),f(12,r.IThemeService)],O)},3787:function(E,n,a){var c=this&&this.__decorate||function(S,C,v,x){var B,P=arguments.length,O=P<3?C:x===null?x=Object.getOwnPropertyDescriptor(C,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(S,C,v,x);else for(var A=S.length-1;A>=0;A--)(B=S[A])&&(O=(P<3?B(O):P>3?B(C,v,O):B(C,v))||O);return P>3&&O&&Object.defineProperty(C,v,O),O},f=this&&this.__param||function(S,C){return function(v,x){C(v,x,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const l=a(2223),u=a(643),p=a(511),g=a(2585),h=a(8055),r=a(4725),i=a(4269),e=a(6171),s=a(3734);let d=n.DomRendererRowFactory=class{constructor(S,C,v,x,B,P,O){this._document=S,this._characterJoinerService=C,this._optionsService=v,this._coreBrowserService=x,this._coreService=B,this._decorationService=P,this._themeService=O,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,C,v){this._selectionStart=S,this._selectionEnd=C,this._columnSelectMode=v}createRow(S,C,v,x,B,P,O,A,F,H,W){const j=[],K=this._characterJoinerService.getJoinedCharacters(C),y=this._themeService.colors;let R,M=S.getNoBgTrimmedLength();v&&M<P+1&&(M=P+1);let T=0,N="",q=0,Z=0,re=0,I=!1,D=0,Y=!1,z=0;const ie=[],Q=H!==-1&&W!==-1;for(let le=0;le<M;le++){S.loadCell(le,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let Se=!1,Pe=le,ce=this._workCell;if(K.length>0&&le===K[0][0]){Se=!0;const be=K.shift();ce=new i.JoinedCellData(this._workCell,S.translateToString(!0,be[0],be[1]),be[1]-be[0]),Pe=be[1]-1,_e=ce.getWidth()}const wt=this._isCellInSelection(le,C),Ct=v&&le===P,Ut=Q&&le>=H&&le<=W;let Mt=!1;this._decorationService.forEachDecorationAtCell(le,C,void 0,(be=>{Mt=!0}));let yt=ce.getChars()||u.WHITESPACE_CELL_CHAR;if(yt===" "&&(ce.isUnderline()||ce.isOverline())&&(yt=" "),z=_e*A-F.get(yt,ce.isBold(),ce.isItalic()),R){if(T&&(wt&&Y||!wt&&!Y&&ce.bg===q)&&(wt&&Y&&y.selectionForeground||ce.fg===Z)&&ce.extended.ext===re&&Ut===I&&z===D&&!Ct&&!Se&&!Mt){ce.isInvisible()?N+=u.WHITESPACE_CELL_CHAR:N+=yt,T++;continue}T&&(R.textContent=N),R=this._document.createElement("span"),T=0,N=""}else R=this._document.createElement("span");if(q=ce.bg,Z=ce.fg,re=ce.extended.ext,I=Ut,D=z,Y=wt,Se&&P>=le&&P<=Pe&&(P=le),!this._coreService.isCursorHidden&&Ct&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&ie.push("xterm-cursor-blink"),ie.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline")}}if(ce.isBold()&&ie.push("xterm-bold"),ce.isItalic()&&ie.push("xterm-italic"),ce.isDim()&&ie.push("xterm-dim"),N=ce.isInvisible()?u.WHITESPACE_CELL_CHAR:ce.getChars()||u.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(ie.push(`xterm-underline-${ce.extended.underlineStyle}`),N===" "&&(N=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let be=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&be<8&&(be+=8),R.style.textDecorationColor=y.ansi[be].css}ce.isOverline()&&(ie.push("xterm-overline"),N===" "&&(N=" ")),ce.isStrikethrough()&&ie.push("xterm-strikethrough"),Ut&&(R.style.textDecoration="underline");let $e=ce.getFgColor(),tr=ce.getFgColorMode(),tt=ce.getBgColor(),rr=ce.getBgColorMode();const Ur=!!ce.isInverse();if(Ur){const be=$e;$e=tt,tt=be;const Ti=tr;tr=rr,rr=Ti}let ct,mr,ht,ir=!1;switch(this._decorationService.forEachDecorationAtCell(le,C,void 0,(be=>{be.options.layer!=="top"&&ir||(be.backgroundColorRGB&&(rr=50331648,tt=be.backgroundColorRGB.rgba>>8&16777215,ct=be.backgroundColorRGB),be.foregroundColorRGB&&(tr=50331648,$e=be.foregroundColorRGB.rgba>>8&16777215,mr=be.foregroundColorRGB),ir=be.options.layer==="top")})),!ir&&wt&&(ct=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,tt=ct.rgba>>8&16777215,rr=50331648,ir=!0,y.selectionForeground&&(tr=50331648,$e=y.selectionForeground.rgba>>8&16777215,mr=y.selectionForeground)),ir&&ie.push("xterm-decoration-top"),rr){case 16777216:case 33554432:ht=y.ansi[tt],ie.push(`xterm-bg-${tt}`);break;case 50331648:ht=h.channels.toColor(tt>>16,tt>>8&255,255&tt),this._addStyle(R,`background-color:#${m((tt>>>0).toString(16),"0",6)}`);break;default:Ur?(ht=y.foreground,ie.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):ht=y.background}switch(ct||ce.isDim()&&(ct=h.color.multiplyOpacity(ht,.5)),tr){case 16777216:case 33554432:ce.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(R,ht,y.ansi[$e],ce,ct,void 0)||ie.push(`xterm-fg-${$e}`);break;case 50331648:const be=h.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(R,ht,be,ce,ct,mr)||this._addStyle(R,`color:#${m($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ht,y.foreground,ce,ct,mr)||Ur&&ie.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}ie.length&&(R.className=ie.join(" "),ie.length=0),Ct||Se||Mt?R.textContent=N:T++,z!==this.defaultSpacing&&(R.style.letterSpacing=`${z}px`),j.push(R),le=Pe}return R&&T&&(R.textContent=N),j}_applyMinimumContrast(S,C,v,x,B,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const O=this._getContrastCache(x);let A;if(B||P||(A=O.getColor(C.rgba,v.rgba)),A===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);A=h.color.ensureContrastRatio(B||C,P||v,F),O.setColor((B||C).rgba,(P||v).rgba,A??null)}return!!A&&(this._addStyle(S,`color:${A.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,C){S.setAttribute("style",`${S.getAttribute("style")||""}${C};`)}_isCellInSelection(S,C){const v=this._selectionStart,x=this._selectionEnd;return!(!v||!x)&&(this._columnSelectMode?v[0]<=x[0]?S>=v[0]&&C>=v[1]&&S<x[0]&&C<=x[1]:S<v[0]&&C>=v[1]&&S>=x[0]&&C<=x[1]:C>v[1]&&C<x[1]||v[1]===x[1]&&C===v[1]&&S>=v[0]&&S<x[0]||v[1]<x[1]&&C===x[1]&&S<x[0]||v[1]<x[1]&&C===v[1]&&S>=v[0])}};function m(S,C,v){for(;S.length<v;)S=C+S;return S}n.DomRendererRowFactory=d=c([f(1,r.ICharacterJoinerService),f(2,g.IOptionsService),f(3,r.ICoreBrowserService),f(4,g.ICoreService),f(5,g.IDecorationService),f(6,r.IThemeService)],d)},2550:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.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 f=a.createElement("span");f.classList.add("xterm-char-measure-element");const l=a.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const u=a.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontStyle="italic";const p=a.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[f,l,u,p],this._container.appendChild(f),this._container.appendChild(l),this._container.appendChild(u),this._container.appendChild(p),c.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(a,c,f,l){a===this._font&&c===this._fontSize&&f===this._weight&&l===this._weightBold||(this._font=a,this._fontSize=c,this._weight=f,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(a,c,f){let l=0;if(!c&&!f&&a.length===1&&(l=a.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const g=this._measure(a,0);return g>0&&(this._flat[l]=g),g}let u=a;c&&(u+="B"),f&&(u+="I");let p=this._holey.get(u);if(p===void 0){let g=0;c&&(g|=1),f&&(g|=2),p=this._measure(a,g),p>0&&this._holey.set(u,p)}return p}_measure(a,c){const f=this._measureElements[c];return f.textContent=a.repeat(32),f.offsetWidth/32}}},2223:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(E,n)=>{function a(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},n.isEmoji=c,n.allowRescaling=function(f,l,u,p){return l===1&&u>Math.ceil(1.5*p)&&f!==void 0&&f>255&&!c(f)&&!a(f)&&!(function(g){return 57344<=g&&g<=63743})(f)},n.treatGlyphAsBackgroundColor=function(f){return a(f)||(function(l){return 9472<=l&&l<=9631})(f)},n.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}}}},n.computeNextVariantOffset=function(f,l,u=0){return(f-(2*Math.round(l)-u))%(2*Math.round(l))}},6052:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class a{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(f,l,u,p=!1){if(this.selectionStart=l,this.selectionEnd=u,!l||!u||l[0]===u[0]&&l[1]===u[1])return void this.clear();const g=f.buffers.active.ydisp,h=l[1]-g,r=u[1]-g,i=Math.max(h,0),e=Math.min(r,f.rows-1);i>=f.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=h,this.viewportEndRow=r,this.viewportCappedStartRow=i,this.viewportCappedEndRow=e,this.startCol=l[0],this.endCol=u[0])}isCellSelected(f,l,u){return!!this.hasSelection&&(u-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&u>=this.viewportCappedStartRow&&l<this.endCol&&u<=this.viewportCappedEndRow:l<this.startCol&&u>=this.viewportCappedStartRow&&l>=this.endCol&&u<=this.viewportCappedEndRow:u>this.viewportStartRow&&u<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&u===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&u===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&u===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new a}},456:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,m){var S,C=arguments.length,v=C<3?s:m===null?m=Object.getOwnPropertyDescriptor(s,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,m);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,m){s(d,m,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const l=a(2585),u=a(8460),p=a(844);let g=n.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new u.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new i(this._optionsService))}catch{this._measureStrategy=this.register(new r(e,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};n.CharSizeService=g=c([f(2,l.IOptionsService)],g);class h extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,d){s!==void 0&&s>0&&d!==void 0&&d>0&&(this._result.width=s,this._result.height=d)}}class r extends h{constructor(s,d,m){super(),this._document=s,this._parentElement=d,this._optionsService=m,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 i extends h{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const d=this._ctx.measureText("W");if(!("width"in d&&"fontBoundingBoxAscent"in d&&"fontBoundingBoxDescent"in d))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var m,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(m=i[v])&&(C=(S<3?m(C):S>3?m(e,s,C):m(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const l=a(3734),u=a(643),p=a(511),g=a(2585);class h extends l.AttributeData{constructor(e,s,d){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=s,this._width=d}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=h;let r=n.CharacterJoinerService=class ro{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(e){const s={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(s),s.id}deregister(e){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===e)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(e);if(!s||s.length===0)return[];const d=[],m=s.translateToString(!0);let S=0,C=0,v=0,x=s.getFg(0),B=s.getBg(0);for(let P=0;P<s.getTrimmedLength();P++)if(s.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==B){if(P-S>1){const O=this._getJoinedRanges(m,v,C,s,S);for(let A=0;A<O.length;A++)d.push(O[A])}S=P,v=C,x=this._workCell.fg,B=this._workCell.bg}C+=this._workCell.getChars().length||u.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const P=this._getJoinedRanges(m,v,C,s,S);for(let O=0;O<P.length;O++)d.push(P[O])}return d}_getJoinedRanges(e,s,d,m,S){const C=e.substring(s,d);let v=[];try{v=this._characterJoiners[0].handler(C)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const B=this._characterJoiners[x].handler(C);for(let P=0;P<B.length;P++)ro._mergeRanges(v,B[P])}catch(B){console.error(B)}return this._stringRangesToCellRanges(v,m,S),v}_stringRangesToCellRanges(e,s,d){let m=0,S=!1,C=0,v=e[m];if(v){for(let x=d;x<this._bufferService.cols;x++){const B=s.getWidth(x),P=s.getString(x).length||u.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!S&&v[0]<=C&&(v[0]=x,S=!0),v[1]<=C){if(v[1]=x,v=e[++m],!v)break;v[0]<=C?(v[0]=x,S=!0):S=!1}C+=P}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(e,s){let d=!1;for(let m=0;m<e.length;m++){const S=e[m];if(d){if(s[1]<=S[0])return e[m-1][1]=s[1],e;if(s[1]<=S[1])return e[m-1][1]=Math.max(s[1],S[1]),e.splice(m,1),e;e.splice(m,1),m--}else{if(s[1]<=S[0])return e.splice(m,0,s),e;if(s[1]<=S[1])return S[0]=Math.min(s[0],S[0]),e;s[0]<S[1]&&(S[0]=Math.min(s[0],S[0]),d=!0)}}return d?e[e.length-1][1]=s[1]:e.push(s),e}};n.CharacterJoinerService=r=c([f(0,g.IBufferService)],r)},5114:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const c=a(844),f=a(8460),l=a(3656);class u extends c.Disposable{constructor(h,r,i){super(),this._textarea=h,this._window=r,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new p(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,f.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(h){this._window!==h&&(this._window=h,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}}n.CoreBrowserService=u;class p extends c.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var h;this._outerListener&&((h=this._resolutionMediaMatchList)==null||h.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:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const c=a(844);class f extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(u){return this.linkProviders.push(u),{dispose:()=>{const p=this.linkProviders.indexOf(u);p!==-1&&this.linkProviders.splice(p,1)}}}}n.LinkProviderService=f},8934:function(E,n,a){var c=this&&this.__decorate||function(g,h,r,i){var e,s=arguments.length,d=s<3?h:i===null?i=Object.getOwnPropertyDescriptor(h,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(g,h,r,i);else for(var m=g.length-1;m>=0;m--)(e=g[m])&&(d=(s<3?e(d):s>3?e(h,r,d):e(h,r))||d);return s>3&&d&&Object.defineProperty(h,r,d),d},f=this&&this.__param||function(g,h){return function(r,i){h(r,i,g)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const l=a(4725),u=a(9806);let p=n.MouseService=class{constructor(g,h){this._renderService=g,this._charSizeService=h}getCoords(g,h,r,i,e){return(0,u.getCoords)(window,g,h,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(g,h){const r=(0,u.getCoordsRelativeToElement)(window,g,h);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};n.MouseService=p=c([f(0,l.IRenderService),f(1,l.ICharSizeService)],p)},3230:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,m){var S,C=arguments.length,v=C<3?s:m===null?m=Object.getOwnPropertyDescriptor(s,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,m);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,m){s(d,m,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const l=a(6193),u=a(4725),p=a(8460),g=a(844),h=a(7226),r=a(2585);let i=n.RenderService=class extends g.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,s,d,m,S,C,v,x){super(),this._rowCount=e,this._charSizeService=m,this._renderer=this.register(new g.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new g.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 p.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new p.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new p.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new p.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((B,P)=>this._renderRows(B,P)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(d.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(d.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(d.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,s),this.register(v.onWindowChange((B=>this._registerIntersectionObserver(B,s))))}_registerIntersectionObserver(e,s){if("IntersectionObserver"in e){const d=new e.IntersectionObserver((m=>this._handleIntersectionChange(m[m.length-1])),{threshold:0});d.observe(s),this._observerDisposable.value=(0,g.toDisposable)((()=>d.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,s,d=!1){this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,s,this._rowCount))}_renderRows(e,s){this._renderer.value&&(e=Math.min(e,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(e,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:s}),this._onRender.fire({start:e,end:s}),this._isNextRenderRedrawOnly=!0)}resize(e,s){this._rowCount=s,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((s=>this.refreshRows(s.start,s.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,s;this._renderer.value&&((s=(e=this._renderer.value).clearTextureAtlas)==null||s.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var d;return(d=this._renderer.value)==null?void 0:d.handleResize(e,s)})):this._renderer.value.handleResize(e,s),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,s,d){var m;this._selectionState.start=e,this._selectionState.end=s,this._selectionState.columnSelectMode=d,(m=this._renderer.value)==null||m.handleSelectionChanged(e,s,d)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};n.RenderService=i=c([f(2,r.IOptionsService),f(3,u.ICharSizeService),f(4,r.IDecorationService),f(5,r.IBufferService),f(6,u.ICoreBrowserService),f(7,u.IThemeService)],i)},9312:function(E,n,a){var c=this&&this.__decorate||function(v,x,B,P){var O,A=arguments.length,F=A<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,B):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(v,x,B,P);else for(var H=v.length-1;H>=0;H--)(O=v[H])&&(F=(A<3?O(F):A>3?O(x,B,F):O(x,B))||F);return A>3&&F&&Object.defineProperty(x,B,F),F},f=this&&this.__param||function(v,x){return function(B,P){x(B,P,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const l=a(9806),u=a(9504),p=a(456),g=a(4725),h=a(8460),r=a(844),i=a(6114),e=a(4841),s=a(511),d=a(2585),m=" ",S=new RegExp(m,"g");let C=n.SelectionService=class extends r.Disposable{constructor(v,x,B,P,O,A,F,H,W){super(),this._element=v,this._screenElement=x,this._linkifier=B,this._bufferService=P,this._coreService=O,this._mouseService=A,this._optionsService=F,this._renderService=H,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.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 p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!v||!x||v[0]===x[0]&&v[1]===x[1])}get selectionText(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!v||!x)return"";const B=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(v[0]===x[0])return"";const O=v[0]<x[0]?v[0]:x[0],A=v[0]<x[0]?x[0]:v[0];for(let F=v[1];F<=x[1];F++){const H=B.translateBufferLineToString(F,!0,O,A);P.push(H)}}else{const O=v[1]===x[1]?x[0]:void 0;P.push(B.translateBufferLineToString(v[1],!0,v[0],O));for(let A=v[1]+1;A<=x[1]-1;A++){const F=B.lines.get(A),H=B.translateBufferLineToString(A,!0);F!=null&&F.isWrapped?P[P.length-1]+=H:P.push(H)}if(v[1]!==x[1]){const A=B.lines.get(x[1]),F=B.translateBufferLineToString(x[1],!0,0,x[0]);A&&A.isWrapped?P[P.length-1]+=F:P.push(F)}}return P.map((O=>O.replace(S," "))).join(i.isWindows?`\r
7
+ `:`
8
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),i.isLinux&&v&&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(v){const x=this._getMouseBufferCoords(v),B=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(B&&P&&x)&&this._areCoordsInSelection(x,B,P)}isCellInSelection(v,x){const B=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!B||!P)&&this._areCoordsInSelection([v,x],B,P)}_areCoordsInSelection(v,x,B){return v[1]>x[1]&&v[1]<B[1]||x[1]===B[1]&&v[1]===x[1]&&v[0]>=x[0]&&v[0]<B[0]||x[1]<B[1]&&v[1]===B[1]&&v[0]<B[0]||x[1]<B[1]&&v[1]===x[1]&&v[0]>=x[0]}_selectWordAtCursor(v,x){var O,A;const B=(A=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:A.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(v);return!!P&&(this._selectWordAt(P,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,x){this._model.clearSelection(),v=Math.max(v,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const x=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(v){let x=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=B?0:(x>B&&(x-=B),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(v){return i.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const x=this._getMouseBufferCoords(v);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(v){return v.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const P=B.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const x=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const P=(0,u.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,B=!(!v||!x||v[0]===x[0]&&v[1]===x[1]);B?v&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,x,B)):this._oldHasSelection&&this._fireOnSelectionChange(v,x,B)}_fireOnSelectionChange(v,x,B){this._oldSelectionStart=v,this._oldSelectionEnd=x,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(v,x){let B=x;for(let P=0;x>=P;P++){const O=v.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:O>1&&x!==P&&(B+=O-1)}return B}setSelection(v,x,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,x],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,x,B=!0,P=!0){if(v[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,A=O.lines.get(v[1]);if(!A)return;const F=O.translateBufferLineToString(v[1],!1);let H=this._convertViewportColToCharacterIndex(A,v[0]),W=H;const j=v[0]-H;let K=0,y=0,R=0,M=0;if(F.charAt(H)===" "){for(;H>0&&F.charAt(H-1)===" ";)H--;for(;W<F.length&&F.charAt(W+1)===" ";)W++}else{let q=v[0],Z=v[0];A.getWidth(q)===0&&(K++,q--),A.getWidth(Z)===2&&(y++,Z++);const re=A.getString(Z).length;for(re>1&&(M+=re-1,W+=re-1);q>0&&H>0&&!this._isCharWordSeparator(A.loadCell(q-1,this._workCell));){A.loadCell(q-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,q--):I>1&&(R+=I-1,H-=I-1),H--,q--}for(;Z<A.length&&W+1<F.length&&!this._isCharWordSeparator(A.loadCell(Z+1,this._workCell));){A.loadCell(Z+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,Z++):I>1&&(M+=I-1,W+=I-1),W++,Z++}}W++;let T=H+j-K+R,N=Math.min(this._bufferService.cols,W-H+K+y-R-M);if(x||F.slice(H,W).trim()!==""){if(B&&T===0&&A.getCodePoint(0)!==32){const q=O.lines.get(v[1]-1);if(q&&A.isWrapped&&q.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(Z){const re=this._bufferService.cols-Z.start;T-=re,N+=re}}}if(P&&T+N===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const q=O.lines.get(v[1]+1);if(q!=null&&q.isWrapped&&q.getCodePoint(0)!==32){const Z=this._getWordAt([0,v[1]+1],!1,!1,!0);Z&&(N+=Z.length)}}return{start:T,length:N}}}_selectWordAt(v,x){const B=this._getWordAt(v,x);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[B.start,v[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(v){const x=this._getWordAt(v,!0);if(x){let B=v[1];for(;x.start<0;)x.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,B]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const x=this._bufferService.buffer.getWrappedRangeForLine(v),B={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(B,this._bufferService.cols)}};n.SelectionService=C=c([f(3,d.IBufferService),f(4,d.ICoreService),f(5,g.IMouseService),f(6,d.IOptionsService),f(7,g.IRenderService),f(8,g.ICoreBrowserService)],C)},4725:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const c=a(8343);n.ICharSizeService=(0,c.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),n.IMouseService=(0,c.createDecorator)("MouseService"),n.IRenderService=(0,c.createDecorator)("RenderService"),n.ISelectionService=(0,c.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,c.createDecorator)("ThemeService"),n.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(E,n,a){var c=this&&this.__decorate||function(C,v,x,B){var P,O=arguments.length,A=O<3?v:B===null?B=Object.getOwnPropertyDescriptor(v,x):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,v,x,B);else for(var F=C.length-1;F>=0;F--)(P=C[F])&&(A=(O<3?P(A):O>3?P(v,x,A):P(v,x))||A);return O>3&&A&&Object.defineProperty(v,x,A),A},f=this&&this.__param||function(C,v){return function(x,B){v(x,B,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const l=a(7239),u=a(8055),p=a(8460),g=a(844),h=a(2585),r=u.css.toColor("#ffffff"),i=u.css.toColor("#000000"),e=u.css.toColor("#ffffff"),s=u.css.toColor("#000000"),d={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[u.css.toColor("#2e3436"),u.css.toColor("#cc0000"),u.css.toColor("#4e9a06"),u.css.toColor("#c4a000"),u.css.toColor("#3465a4"),u.css.toColor("#75507b"),u.css.toColor("#06989a"),u.css.toColor("#d3d7cf"),u.css.toColor("#555753"),u.css.toColor("#ef2929"),u.css.toColor("#8ae234"),u.css.toColor("#fce94f"),u.css.toColor("#729fcf"),u.css.toColor("#ad7fa8"),u.css.toColor("#34e2e2"),u.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let x=0;x<216;x++){const B=v[x/36%6|0],P=v[x/6%6|0],O=v[x%6];C.push({css:u.channels.toCss(B,P,O),rgba:u.channels.toRgba(B,P,O)})}for(let x=0;x<24;x++){const B=8+10*x;C.push({css:u.channels.toCss(B,B,B),rgba:u.channels.toRgba(B,B,B)})}return C})());let m=n.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:i,cursor:e,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:d,selectionBackgroundOpaque:u.color.blend(i,d),selectionInactiveBackgroundTransparent:d,selectionInactiveBackgroundOpaque:u.color.blend(i,d),ansi:n.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(C={}){const v=this._colors;if(v.foreground=S(C.foreground,r),v.background=S(C.background,i),v.cursor=S(C.cursor,e),v.cursorAccent=S(C.cursorAccent,s),v.selectionBackgroundTransparent=S(C.selectionBackground,d),v.selectionBackgroundOpaque=u.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=u.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=C.selectionForeground?S(C.selectionForeground,u.NULL_COLOR):void 0,v.selectionForeground===u.NULL_COLOR&&(v.selectionForeground=void 0),u.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=u.color.opacity(v.selectionBackgroundTransparent,.3)),u.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=u.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=n.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=S(C.black,n.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=S(C.red,n.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=S(C.green,n.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=S(C.yellow,n.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=S(C.blue,n.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=S(C.magenta,n.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=S(C.cyan,n.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=S(C.white,n.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=S(C.brightBlack,n.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=S(C.brightRed,n.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=S(C.brightGreen,n.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=S(C.brightYellow,n.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=S(C.brightBlue,n.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=S(C.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=S(C.brightCyan,n.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=S(C.brightWhite,n.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const x=Math.min(v.ansi.length-16,C.extendedAnsi.length);for(let B=0;B<x;B++)v.ansi[B+16]=S(C.extendedAnsi[B],n.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[C]=this._restoreColors.ansi[C]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(C){C(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function S(C,v){if(C!==void 0)try{return u.css.toColor(C)}catch{}return v}n.ThemeService=m=c([f(0,h.IOptionsService)],m)},6349:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const c=a(8460),f=a(844);class l extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(p){if(this._maxLength===p)return;const g=new Array(p);for(let h=0;h<Math.min(p,this.length);h++)g[h]=this._array[this._getCyclicIndex(h)];this._array=g,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let g=this._length;g<p;g++)this._array[g]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,g){this._array[this._getCyclicIndex(p)]=g}push(p){this._array[this._getCyclicIndex(this._length)]=p,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(p,g,...h){if(g){for(let r=p;r<this._length-g;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+g)];this._length-=g,this.onDeleteEmitter.fire({index:p,amount:g})}for(let r=this._length-1;r>=p;r--)this._array[this._getCyclicIndex(r+h.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<h.length;r++)this._array[this._getCyclicIndex(p+r)]=h[r];if(h.length&&this.onInsertEmitter.fire({index:p,amount:h.length}),this._length+h.length>this._maxLength){const r=this._length+h.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=h.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,g,h){if(!(g<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let i=g-1;i>=0;i--)this.set(p+i+h,this.get(p+i));const r=p+g+h-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<g;r++)this.set(p+r+h,this.get(p+r))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}n.CircularList=l},1439:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(c,f=5){if(typeof c!="object")return c;const l=Array.isArray(c)?[]:{};for(const u in c)l[u]=f<=1?c[u]:c[u]&&a(c[u],f-1);return l}},8055:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let a=0,c=0,f=0,l=0;var u,p,g,h,r;function i(s){const d=s.toString(16);return d.length<2?"0"+d:d}function e(s,d){return s<d?(d+.05)/(s+.05):(s+.05)/(d+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(d,m,S,C){return C!==void 0?`#${i(d)}${i(m)}${i(S)}${i(C)}`:`#${i(d)}${i(m)}${i(S)}`},s.toRgba=function(d,m,S,C=255){return(d<<24|m<<16|S<<8|C)>>>0},s.toColor=function(d,m,S,C){return{css:s.toCss(d,m,S,C),rgba:s.toRgba(d,m,S,C)}}})(u||(n.channels=u={})),(function(s){function d(m,S){return l=Math.round(255*S),[a,c,f]=r.toChannels(m.rgba),{css:u.toCss(a,c,f,l),rgba:u.toRgba(a,c,f,l)}}s.blend=function(m,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,v=S.rgba>>16&255,x=S.rgba>>8&255,B=m.rgba>>24&255,P=m.rgba>>16&255,O=m.rgba>>8&255;return a=B+Math.round((C-B)*l),c=P+Math.round((v-P)*l),f=O+Math.round((x-O)*l),{css:u.toCss(a,c,f),rgba:u.toRgba(a,c,f)}},s.isOpaque=function(m){return(255&m.rgba)==255},s.ensureContrastRatio=function(m,S,C){const v=r.ensureContrastRatio(m.rgba,S.rgba,C);if(v)return u.toColor(v>>24&255,v>>16&255,v>>8&255)},s.opaque=function(m){const S=(255|m.rgba)>>>0;return[a,c,f]=r.toChannels(S),{css:u.toCss(a,c,f),rgba:S}},s.opacity=d,s.multiplyOpacity=function(m,S){return l=255&m.rgba,d(m,l*S/255)},s.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}})(p||(n.color=p={})),(function(s){let d,m;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(d=C,d.globalCompositeOperation="copy",m=d.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return a=parseInt(S.slice(1,2).repeat(2),16),c=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),u.toColor(a,c,f);case 5:return a=parseInt(S.slice(1,2).repeat(2),16),c=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),u.toColor(a,c,f,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return a=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),l=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),u.toColor(a,c,f,l);if(!d||!m)throw new Error("css.toColor: Unsupported css format");if(d.fillStyle=m,d.fillStyle=S,typeof d.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(d.fillRect(0,0,1,1),[a,c,f,l]=d.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:u.toRgba(a,c,f,l),css:S}}})(g||(n.css=g={})),(function(s){function d(m,S,C){const v=m/255,x=S/255,B=C/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}s.relativeLuminance=function(m){return d(m>>16&255,m>>8&255,255&m)},s.relativeLuminance2=d})(h||(n.rgb=h={})),(function(s){function d(S,C,v){const x=S>>24&255,B=S>>16&255,P=S>>8&255;let O=C>>24&255,A=C>>16&255,F=C>>8&255,H=e(h.relativeLuminance2(O,A,F),h.relativeLuminance2(x,B,P));for(;H<v&&(O>0||A>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),H=e(h.relativeLuminance2(O,A,F),h.relativeLuminance2(x,B,P));return(O<<24|A<<16|F<<8|255)>>>0}function m(S,C,v){const x=S>>24&255,B=S>>16&255,P=S>>8&255;let O=C>>24&255,A=C>>16&255,F=C>>8&255,H=e(h.relativeLuminance2(O,A,F),h.relativeLuminance2(x,B,P));for(;H<v&&(O<255||A<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),H=e(h.relativeLuminance2(O,A,F),h.relativeLuminance2(x,B,P));return(O<<24|A<<16|F<<8|255)>>>0}s.blend=function(S,C){if(l=(255&C)/255,l===1)return C;const v=C>>24&255,x=C>>16&255,B=C>>8&255,P=S>>24&255,O=S>>16&255,A=S>>8&255;return a=P+Math.round((v-P)*l),c=O+Math.round((x-O)*l),f=A+Math.round((B-A)*l),u.toRgba(a,c,f)},s.ensureContrastRatio=function(S,C,v){const x=h.relativeLuminance(S>>8),B=h.relativeLuminance(C>>8);if(e(x,B)<v){if(B<x){const A=d(S,C,v),F=e(x,h.relativeLuminance(A>>8));if(F<v){const H=m(S,C,v);return F>e(x,h.relativeLuminance(H>>8))?A:H}return A}const P=m(S,C,v),O=e(x,h.relativeLuminance(P>>8));if(O<v){const A=d(S,C,v);return O>e(x,h.relativeLuminance(A>>8))?P:A}return P}},s.reduceLuminance=d,s.increaseLuminance=m,s.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(r||(n.rgba=r={})),n.toPaddedHex=i,n.contrastRatio=e},8969:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const c=a(844),f=a(2585),l=a(4348),u=a(7866),p=a(744),g=a(7302),h=a(6975),r=a(8460),i=a(1753),e=a(1480),s=a(7994),d=a(9282),m=a(5435),S=a(5981),C=a(2660);let v=!1;class x extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((P=>{var O;(O=this._onScrollApi)==null||O.fire(P.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(P){for(const O in P)this.optionsService.options[O]=P[O]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new g.OptionsService(P)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(u.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new m.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((O=>{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((O=>{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 S.WriteBuffer(((O,A)=>this._inputHandler.parse(O,A)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,O){this._writeBuffer.write(P,O)}writeSync(P,O){this._logService.logLevel<=f.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(P,O)}input(P,O=!0){this.coreService.triggerDataEvent(P,O)}resize(P,O){isNaN(P)||isNaN(O)||(P=Math.max(P,p.MINIMUM_COLS),O=Math.max(O,p.MINIMUM_ROWS),this._bufferService.resize(P,O))}scroll(P,O=!1){this._bufferService.scroll(P,O)}scrollLines(P,O,A){this._bufferService.scrollLines(P,O,A)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const O=P-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(P,O){return this._inputHandler.registerEscHandler(P,O)}registerDcsHandler(P,O){return this._inputHandler.registerDcsHandler(P,O)}registerCsiHandler(P,O){return this._inputHandler.registerCsiHandler(P,O)}registerOscHandler(P,O){return this._inputHandler.registerOscHandler(P,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?P=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const O of P)O.dispose()}))}}}n.CoreTerminal=x},8460:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const f=[];for(let l=0;l<this._listeners.length;l++)f.push(this._listeners[l]);for(let l=0;l<f.length;l++)f[l].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,c){return a((f=>c.fire(f)))},n.runAndSubscribe=function(a,c){return c(void 0),a((f=>c(f)))}},5435:function(E,n,a){var c=this&&this.__decorate||function(K,y,R,M){var T,N=arguments.length,q=N<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(K,y,R,M);else for(var Z=K.length-1;Z>=0;Z--)(T=K[Z])&&(q=(N<3?T(q):N>3?T(y,R,q):T(y,R))||q);return N>3&&q&&Object.defineProperty(y,R,q),q},f=this&&this.__param||function(K,y){return function(R,M){y(R,M,K)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const l=a(2584),u=a(7116),p=a(2015),g=a(844),h=a(482),r=a(8437),i=a(8460),e=a(643),s=a(511),d=a(3734),m=a(2585),S=a(1480),C=a(6242),v=a(6351),x=a(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function O(K,y){if(K>24)return y.setWinLines||!1;switch(K){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var A;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(n.WindowsOptionsReportType=A={}));let F=0;class H extends g.Disposable{getAttrData(){return this._curAttrData}constructor(y,R,M,T,N,q,Z,re,I=new p.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=R,this._coreService=M,this._logService=T,this._optionsService=N,this._oscLinkService=q,this._coreMouseService=Z,this._unicodeService=re,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,Y)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:Y.toArray()})})),this._parser.setEscHandlerFallback((D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})})),this._parser.setExecuteHandlerFallback((D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})})),this._parser.setOscHandlerFallback(((D,Y,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:Y,data:z})})),this._parser.setDcsHandlerFallback(((D,Y,z)=>{Y==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:Y,payload:z})})),this._parser.setPrintHandler(((D,Y,z)=>this.print(D,Y,z))),this._parser.registerCsiHandler({final:"@"},(D=>this.insertChars(D))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(D=>this.scrollLeft(D))),this._parser.registerCsiHandler({final:"A"},(D=>this.cursorUp(D))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(D=>this.scrollRight(D))),this._parser.registerCsiHandler({final:"B"},(D=>this.cursorDown(D))),this._parser.registerCsiHandler({final:"C"},(D=>this.cursorForward(D))),this._parser.registerCsiHandler({final:"D"},(D=>this.cursorBackward(D))),this._parser.registerCsiHandler({final:"E"},(D=>this.cursorNextLine(D))),this._parser.registerCsiHandler({final:"F"},(D=>this.cursorPrecedingLine(D))),this._parser.registerCsiHandler({final:"G"},(D=>this.cursorCharAbsolute(D))),this._parser.registerCsiHandler({final:"H"},(D=>this.cursorPosition(D))),this._parser.registerCsiHandler({final:"I"},(D=>this.cursorForwardTab(D))),this._parser.registerCsiHandler({final:"J"},(D=>this.eraseInDisplay(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(D=>this.eraseInDisplay(D,!0))),this._parser.registerCsiHandler({final:"K"},(D=>this.eraseInLine(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(D=>this.eraseInLine(D,!0))),this._parser.registerCsiHandler({final:"L"},(D=>this.insertLines(D))),this._parser.registerCsiHandler({final:"M"},(D=>this.deleteLines(D))),this._parser.registerCsiHandler({final:"P"},(D=>this.deleteChars(D))),this._parser.registerCsiHandler({final:"S"},(D=>this.scrollUp(D))),this._parser.registerCsiHandler({final:"T"},(D=>this.scrollDown(D))),this._parser.registerCsiHandler({final:"X"},(D=>this.eraseChars(D))),this._parser.registerCsiHandler({final:"Z"},(D=>this.cursorBackwardTab(D))),this._parser.registerCsiHandler({final:"`"},(D=>this.charPosAbsolute(D))),this._parser.registerCsiHandler({final:"a"},(D=>this.hPositionRelative(D))),this._parser.registerCsiHandler({final:"b"},(D=>this.repeatPrecedingCharacter(D))),this._parser.registerCsiHandler({final:"c"},(D=>this.sendDeviceAttributesPrimary(D))),this._parser.registerCsiHandler({prefix:">",final:"c"},(D=>this.sendDeviceAttributesSecondary(D))),this._parser.registerCsiHandler({final:"d"},(D=>this.linePosAbsolute(D))),this._parser.registerCsiHandler({final:"e"},(D=>this.vPositionRelative(D))),this._parser.registerCsiHandler({final:"f"},(D=>this.hVPosition(D))),this._parser.registerCsiHandler({final:"g"},(D=>this.tabClear(D))),this._parser.registerCsiHandler({final:"h"},(D=>this.setMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(D=>this.setModePrivate(D))),this._parser.registerCsiHandler({final:"l"},(D=>this.resetMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(D=>this.resetModePrivate(D))),this._parser.registerCsiHandler({final:"m"},(D=>this.charAttributes(D))),this._parser.registerCsiHandler({final:"n"},(D=>this.deviceStatus(D))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(D=>this.deviceStatusPrivate(D))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(D=>this.softReset(D))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(D=>this.setCursorStyle(D))),this._parser.registerCsiHandler({final:"r"},(D=>this.setScrollRegion(D))),this._parser.registerCsiHandler({final:"s"},(D=>this.saveCursor(D))),this._parser.registerCsiHandler({final:"t"},(D=>this.windowOptions(D))),this._parser.registerCsiHandler({final:"u"},(D=>this.restoreCursor(D))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(D=>this.insertColumns(D))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(D=>this.deleteColumns(D))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(D=>this.selectProtected(D))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(D=>this.requestMode(D,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(D=>this.requestMode(D,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new C.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new C.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new C.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new C.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new C.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new C.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new C.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new C.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new C.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new C.OscHandler((D=>this.restoreCursorColor(D)))),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 D in u.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},(()=>this.selectCharset("("+D))),this._parser.registerEscHandler({intermediates:")",final:D},(()=>this.selectCharset(")"+D))),this._parser.registerEscHandler({intermediates:"*",final:D},(()=>this.selectCharset("*"+D))),this._parser.registerEscHandler({intermediates:"+",final:D},(()=>this.selectCharset("+"+D))),this._parser.registerEscHandler({intermediates:"-",final:D},(()=>this.selectCharset("-"+D))),this._parser.registerEscHandler({intermediates:".",final:D},(()=>this.selectCharset("."+D))),this._parser.registerEscHandler({intermediates:"/",final:D},(()=>this.selectCharset("/"+D)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((D=>(this._logService.error("Parsing error: ",D),D))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((D,Y)=>this.requestStatusString(D,Y))))}_preserveStack(y,R,M,T){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=M,this._parseStack.position=T}_logSlowResolvingAsync(y){this._logService.logLevel<=m.LogLevelEnum.WARN&&Promise.race([y,new Promise(((R,M)=>setTimeout((()=>M("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,R){let M,T=this._activeBuffer.x,N=this._activeBuffer.y,q=0;const Z=this._parseStack.paused;if(Z){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(M),M;T=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>P&&(q=this._parseStack.position+P)}if(this._logService.logLevel<=m.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(D=>String.fromCharCode(D))).join("")}"`),typeof y=="string"?y.split("").map((D=>D.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(y.length,P))),Z||this._dirtyRowTracker.clearRange(),y.length>P)for(let D=q;D<y.length;D+=P){const Y=D+P<y.length?D+P:y.length,z=typeof y=="string"?this._stringDecoder.decode(y.substring(D,Y),this._parseBuffer):this._utf8Decoder.decode(y.subarray(D,Y),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,z))return this._preserveStack(T,N,z,D),this._logSlowResolvingAsync(M),M}else if(!Z){const D=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,D))return this._preserveStack(T,N,D,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===T&&this._activeBuffer.y===N||this._onCursorMove.fire();const re=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(re,this._bufferService.rows-1))}print(y,R,M){let T,N;const q=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,re=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,Y=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-R>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Y);let ie=this._parser.precedingJoinState;for(let Q=R;Q<M;++Q){if(T=y[Q],T<127&&q){const Pe=q[String.fromCharCode(T)];Pe&&(T=Pe.charCodeAt(0))}const le=this._unicodeService.charProperties(T,ie);N=S.UnicodeService.extractWidth(le);const _e=S.UnicodeService.extractShouldJoin(le),Se=_e?S.UnicodeService.extractWidth(ie):0;if(ie=le,Z&&this._onA11yChar.fire((0,h.stringFromCodePoint)(T)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-Se>re){if(I){const Pe=z;let ce=this._activeBuffer.x-Se;for(this._activeBuffer.x=Se,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),z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Se>0&&z instanceof r.BufferLine&&z.copyCellsFrom(Pe,ce,0,Se,!1);ce<re;)Pe.setCellFromCodepoint(ce++,0,1,Y)}else if(this._activeBuffer.x=re-1,N===2)continue}if(_e&&this._activeBuffer.x){const Pe=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-Pe,T,N);for(let ce=N-Se;--ce>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,Y)}else if(D&&(z.insertCells(this._activeBuffer.x,N-Se,this._activeBuffer.getNullCell(Y)),z.getWidth(re-1)===2&&z.setCellFromCodepoint(re-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,Y)),z.setCellFromCodepoint(this._activeBuffer.x++,T,N,Y),N>0)for(;--N;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,Y)}this._parser.precedingJoinState=ie,this._activeBuffer.x<re&&M-R>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,Y),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,R){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,R):this._parser.registerCsiHandler(y,(M=>!O(M.params[0],this._optionsService.rawOptions.windowOptions)||R(M)))}registerDcsHandler(y,R){return this._parser.registerDcsHandler(y,new v.DcsHandler(R))}registerEscHandler(y,R){return this._parser.registerEscHandler(y,R)}registerOscHandler(y,R){return this._parser.registerOscHandler(y,new C.OscHandler(R))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=y,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+R)}cursorUp(y){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const R=y.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const R=y.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,R,M,T=!1,N=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);q.replaceCells(R,M,this._activeBuffer.getNullCell(this._eraseAttrData()),N),T&&(q.isWrapped=!1)}_resetBufferLine(y,R=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),M.isWrapped=!1)}eraseInDisplay(y,R=!1){let M;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);M<this._bufferService.rows;M++)this._resetBufferLine(M,R);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,R);this._dirtyRowTracker.markDirty(0);break;case 3:const T=this._activeBuffer.lines.length-this._bufferService.rows;T>0&&(this._activeBuffer.lines.trimStart(T),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-T,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-T,0),this._onScroll.fire(0))}return!0}eraseInLine(y,R=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,T=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-T+1;for(;R--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let T;for(T=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-T;R--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let R=y.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(y){let R=y.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const R=this._parser.precedingJoinState;if(!R)return!0;const M=y.params[0]||1,T=S.UnicodeService.extractWidth(R),N=this._activeBuffer.x-T,q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),Z=new Uint32Array(q.length*M);let re=0;for(let D=0;D<q.length;){const Y=q.codePointAt(D)||0;Z[re++]=Y,D+=Y>65535?2:1}let I=re;for(let D=1;D<M;++D)Z.copyWithin(I,0,re),I+=re;return this.print(Z,0,I),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,u.DEFAULT_CHARSET),this._charsetService.setgCharset(1,u.DEFAULT_CHARSET),this._charsetService.setgCharset(2,u.DEFAULT_CHARSET),this._charsetService.setgCharset(3,u.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(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){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(),y.params[R]===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(y,R){const M=this._coreService.decPrivateModes,{activeProtocol:T,activeEncoding:N}=this._coreMouseService,q=this._coreService,{buffers:Z,cols:re}=this._bufferService,{active:I,alt:D}=Z,Y=this._optionsService.rawOptions,z=_e=>_e?1:2,ie=y.params[0];return Q=ie,le=R?ie===2?4:ie===4?z(q.modes.insertMode):ie===12?3:ie===20?z(Y.convertEol):0:ie===1?z(M.applicationCursorKeys):ie===3?Y.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ie===6?z(M.origin):ie===7?z(M.wraparound):ie===8?3:ie===9?z(T==="X10"):ie===12?z(Y.cursorBlink):ie===25?z(!q.isCursorHidden):ie===45?z(M.reverseWraparound):ie===66?z(M.applicationKeypad):ie===67?4:ie===1e3?z(T==="VT200"):ie===1002?z(T==="DRAG"):ie===1003?z(T==="ANY"):ie===1004?z(M.sendFocus):ie===1005?4:ie===1006?z(N==="SGR"):ie===1015?4:ie===1016?z(N==="SGR_PIXELS"):ie===1048?1:ie===47||ie===1047||ie===1049?z(I===D):ie===2004?z(M.bracketedPasteMode):0,q.triggerDataEvent(`${l.C0.ESC}[${R?"":"?"}${Q};${le}$y`),!0;var Q,le}_updateAttrColor(y,R,M,T,N){return R===2?(y|=50331648,y&=-16777216,y|=d.AttributeData.fromColorRGB([M,T,N])):R===5&&(y&=-50331904,y|=33554432|255&M),y}_extractColor(y,R,M){const T=[0,0,-1,0,0,0];let N=0,q=0;do{if(T[q+N]=y.params[R+q],y.hasSubParams(R+q)){const Z=y.getSubParams(R+q);let re=0;do T[1]===5&&(N=1),T[q+re+1+N]=Z[re];while(++re<Z.length&&re+q+1+N<T.length);break}if(T[1]===5&&q+N>=2||T[1]===2&&q+N>=5)break;T[1]&&(N=1)}while(++q+R<y.length&&q+N<T.length);for(let Z=2;Z<T.length;++Z)T[Z]===-1&&(T[Z]=0);switch(T[0]){case 38:M.fg=this._updateAttrColor(M.fg,T[1],T[3],T[4],T[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,T[1],T[3],T[4],T[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,T[1],T[3],T[4],T[5])}return q}_processUnderline(y,R){R.extended=R.extended.clone(),(!~y||y>5)&&(y=1),R.extended.underlineStyle=y,R.fg|=268435456,y===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(y){y.fg=r.DEFAULT_ATTR_DATA.fg,y.bg=r.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=y.length;let M;const T=this._curAttrData;for(let N=0;N<R;N++)M=y.params[N],M>=30&&M<=37?(T.fg&=-50331904,T.fg|=16777216|M-30):M>=40&&M<=47?(T.bg&=-50331904,T.bg|=16777216|M-40):M>=90&&M<=97?(T.fg&=-50331904,T.fg|=16777224|M-90):M>=100&&M<=107?(T.bg&=-50331904,T.bg|=16777224|M-100):M===0?this._processSGR0(T):M===1?T.fg|=134217728:M===3?T.bg|=67108864:M===4?(T.fg|=268435456,this._processUnderline(y.hasSubParams(N)?y.getSubParams(N)[0]:1,T)):M===5?T.fg|=536870912:M===7?T.fg|=67108864:M===8?T.fg|=1073741824:M===9?T.fg|=2147483648:M===2?T.bg|=134217728:M===21?this._processUnderline(2,T):M===22?(T.fg&=-134217729,T.bg&=-134217729):M===23?T.bg&=-67108865:M===24?(T.fg&=-268435457,this._processUnderline(0,T)):M===25?T.fg&=-536870913:M===27?T.fg&=-67108865:M===28?T.fg&=-1073741825:M===29?T.fg&=2147483647:M===39?(T.fg&=-67108864,T.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):M===49?(T.bg&=-67108864,T.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?N+=this._extractColor(y,N,T):M===53?T.bg|=1073741824:M===55?T.bg&=-1073741825:M===59?(T.extended=T.extended.clone(),T.extended.underlineColor=-1,T.updateExtended()):M===100?(T.fg&=-67108864,T.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,T.bg&=-67108864,T.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${R};${M}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const R=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${R};${M}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(y){const R=y.params[0]||1;switch(R){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 M=R%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(y){const R=y.params[0]||1;let M;return(y.length<2||(M=y.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(y){if(!O(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const R=[],M=y.split(";");for(;M.length>1;){const T=M.shift(),N=M.shift();if(/^\d+$/.exec(T)){const q=parseInt(T);if(j(q))if(N==="?")R.push({type:0,index:q});else{const Z=(0,x.parseColor)(N);Z&&R.push({type:1,index:q,color:Z})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(y){const R=y.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(y,R){this._getCurrentLinkId()&&this._finishHyperlink();const M=y.split(":");let T;const N=M.findIndex((q=>q.startsWith("id=")));return N!==-1&&(T=M[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:T,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,R){const M=y.split(";");for(let T=0;T<M.length&&!(R>=this._specialColors.length);++T,++R)if(M[T]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const N=(0,x.parseColor)(M[T]);N&&this._onColor.fire([{type:1,index:this._specialColors[R],color:N}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const R=[],M=y.split(";");for(let T=0;T<M.length;++T)if(/^\d+$/.exec(M[T])){const N=parseInt(M[T]);j(N)&&R.push({type:2,index:N})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,u.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(B[y[0]],u.CHARSETS[y[1]]||u.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new s.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const M=this._activeBuffer.ybase+this._activeBuffer.y+R,T=this._activeBuffer.lines.get(M);T&&(T.fill(y),T.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,R){const M=this._bufferService.buffer,T=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${N}${l.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[T.cursorStyle]-(T.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,R){this._dirtyRowTracker.markRangeDirty(y,R)}}n.InputHandler=H;let W=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,y){K>y&&(F=K,K=y,y=F),K<this.start&&(this.start=K),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j(K){return 0<=K&&K<256}W=c([f(0,m.IBufferService)],W)},844:(E,n)=>{function a(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=a,n.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(f,l,u){this._data[f]||(this._data[f]={}),this._data[f][l]=u}get(f,l){return this._data[f]?this._data[f][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(c,f,l,u,p){this._data.get(c,f)||this._data.set(c,f,new a),this._data.get(c,f).set(l,u,p)}get(c,f,l,u){var p;return(p=this._data.get(c,f))==null?void 0:p.get(l,u)}clear(){this._data.clear()}}},6114:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const a=n.isNode?"node":navigator.userAgent,c=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const f=a.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),n.isIpad=c==="iPad",n.isIphone=c==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),n.isLinux=c.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const f=this._getKey(c);if(f===void 0||(a=this._search(f),a===-1)||this._getKey(this._array[a])!==f)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===f);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,f){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do f(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let f=0,l=this._array.length-1;for(;l>=f;){let u=f+l>>1;const p=this._getKey(this._array[u]);if(p>c)l=u-1;else{if(!(p<c)){for(;u>0&&this._getKey(this._array[u-1])===c;)u--;return u}f=u+1}}return f}}},7226:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const c=a(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let g=0,h=0,r=p.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),h=Math.max(g,h),i=p.timeRemaining(),1.5*h>i)return r-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-g))}ms`),void this._start();r=i}this.clear()}}class l extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const g=Date.now()+p;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(u){return requestIdleCallback(u)}_cancelCallback(u){cancelIdleCallback(u)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(u){this._queue.clear(),this._queue.enqueue(u)}flush(){this._queue.flush()}}},9282:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const c=a(643);n.updateWindowsModeWrappedState=function(f){const l=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),u=l==null?void 0:l.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&u&&(p.isWrapped=u[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&u[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}n.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,u=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=u}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=c},9092:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const c=a(6349),f=a(7226),l=a(3734),u=a(8437),p=a(4634),g=a(511),h=a(643),r=a(4863),i=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,s,d){this._hasScrollback=e,this._optionsService=s,this._bufferService=d,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=u.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,s){return new u.BufferLine(this._bufferService.cols,this.getNullCell(e),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const s=e+this._optionsService.rawOptions.scrollback;return s>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:s}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=u.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,s){const d=this.getNullCell(u.DEFAULT_ATTR_DATA);let m=0;const S=this._getCorrectBufferLength(s);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<e)for(let v=0;v<this.lines.length;v++)m+=+this.lines.get(v).resize(e,d);let C=0;if(this._rows<s)for(let v=this._rows;v<s;v++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new u.BufferLine(e,d)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new u.BufferLine(e,d)));else for(let v=this._rows;v>s;v--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const v=this.lines.length-S;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=S}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,s-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(e,s),this._cols>e))for(let C=0;C<this.lines.length;C++)m+=+this.lines.get(C).resize(e,d);this._cols=e,this._rows=s,this._memoryCleanupQueue.clear(),m>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,s){this._cols!==e&&(e>this._cols?this._reflowLarger(e,s):this._reflowSmaller(e,s))}_reflowLarger(e,s){const d=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(u.DEFAULT_ATTR_DATA));if(d.length>0){const m=(0,p.reflowLargerCreateNewLayout)(this.lines,d);(0,p.reflowLargerApplyNewLayout)(this.lines,m.layout),this._reflowLargerAdjustViewport(e,s,m.countRemoved)}}_reflowLargerAdjustViewport(e,s,d){const m=this.getNullCell(u.DEFAULT_ATTR_DATA);let S=d;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new u.BufferLine(e,m))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-d,0)}_reflowSmaller(e,s){const d=this.getNullCell(u.DEFAULT_ATTR_DATA),m=[];let S=0;for(let C=this.lines.length-1;C>=0;C--){let v=this.lines.get(C);if(!v||!v.isWrapped&&v.getTrimmedLength()<=e)continue;const x=[v];for(;v.isWrapped&&C>0;)v=this.lines.get(--C),x.unshift(v);const B=this.ybase+this.y;if(B>=C&&B<C+x.length)continue;const P=x[x.length-1].getTrimmedLength(),O=(0,p.reflowSmallerGetNewLineLengths)(x,this._cols,e),A=O.length-x.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const H=[];for(let M=0;M<A;M++){const T=this.getBlankLine(u.DEFAULT_ATTR_DATA,!0);H.push(T)}H.length>0&&(m.push({start:C+x.length+S,newLines:H}),S+=H.length),x.push(...H);let W=O.length-1,j=O[W];j===0&&(W--,j=O[W]);let K=x.length-A-1,y=P;for(;K>=0;){const M=Math.min(y,j);if(x[W]===void 0)break;if(x[W].copyCellsFrom(x[K],y-M,j-M,M,!0),j-=M,j===0&&(W--,j=O[W]),y-=M,y===0){K--;const T=Math.max(K,0);y=(0,p.getWrappedLineTrimmedLength)(x,T,this._cols)}}for(let M=0;M<x.length;M++)O[M]<e&&x[M].setCell(O[M],d);let R=A-F;for(;R-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+s-1)}if(m.length>0){const C=[],v=[];for(let W=0;W<this.lines.length;W++)v.push(this.lines.get(W));const x=this.lines.length;let B=x-1,P=0,O=m[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let A=0;for(let W=Math.min(this.lines.maxLength-1,x+S-1);W>=0;W--)if(O&&O.start>B+A){for(let j=O.newLines.length-1;j>=0;j--)this.lines.set(W--,O.newLines[j]);W++,C.push({index:B+1,amount:O.newLines.length}),A+=O.newLines.length,O=m[++P]}else this.lines.set(W,v[B--]);let F=0;for(let W=C.length-1;W>=0;W--)C[W].index+=F,this.lines.onInsertEmitter.fire(C[W]),F+=C[W].amount;const H=Math.max(0,x+S-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(e,s,d=0,m){const S=this.lines.get(e);return S?S.translateToString(s,d,m):""}getWrappedRangeForLine(e){let s=e,d=e;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;d+1<this.lines.length&&this.lines.get(d+1).isWrapped;)d++;return{first:s,last:d}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===e&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const s=new r.Marker(e);return this.markers.push(s),s.register(this.lines.onTrim((d=>{s.line-=d,s.line<0&&s.dispose()}))),s.register(this.lines.onInsert((d=>{s.line>=d.index&&(s.line+=d.amount)}))),s.register(this.lines.onDelete((d=>{s.line>=d.index&&s.line<d.index+d.amount&&s.dispose(),s.line>d.index&&(s.line-=d.amount)}))),s.register(s.onDispose((()=>this._removeMarker(s)))),s}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const c=a(3734),f=a(511),l=a(643),u=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let p=0;class g{constructor(r,i,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const s=i||f.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let d=0;d<r;++d)this.setCell(d,s);this.length=r}get(r){const i=this._data[3*r+0],e=2097151&i;return[this._data[3*r+1],2097152&i?this._combined[r]:e?(0,u.stringFromCodePoint)(e):"",i>>22,2097152&i?this._combined[r].charCodeAt(this._combined[r].length-1):e]}set(r,i){this._data[3*r+1]=i[l.CHAR_DATA_ATTR_INDEX],i[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=i[1],this._data[3*r+0]=2097152|r|i[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=i[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const i=this._data[3*r+0];return 2097152&i?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&i}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const i=this._data[3*r+0];return 2097152&i?this._combined[r]:2097151&i?(0,u.stringFromCodePoint)(2097151&i):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,i){return p=3*r,i.content=this._data[p+0],i.fg=this._data[p+1],i.bg=this._data[p+2],2097152&i.content&&(i.combinedData=this._combined[r]),268435456&i.bg&&(i.extended=this._extendedAttrs[r]),i}setCell(r,i){2097152&i.content&&(this._combined[r]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[r]=i.extended),this._data[3*r+0]=i.content,this._data[3*r+1]=i.fg,this._data[3*r+2]=i.bg}setCellFromCodepoint(r,i,e,s){268435456&s.bg&&(this._extendedAttrs[r]=s.extended),this._data[3*r+0]=i|e<<22,this._data[3*r+1]=s.fg,this._data[3*r+2]=s.bg}addCodepointToCell(r,i,e){let s=this._data[3*r+0];2097152&s?this._combined[r]+=(0,u.stringFromCodePoint)(i):2097151&s?(this._combined[r]=(0,u.stringFromCodePoint)(2097151&s)+(0,u.stringFromCodePoint)(i),s&=-2097152,s|=2097152):s=i|4194304,e&&(s&=-12582913,s|=e<<22),this._data[3*r+0]=s}insertCells(r,i,e){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),i<this.length-r){const s=new f.CellData;for(let d=this.length-r-i-1;d>=0;--d)this.setCell(r+i+d,this.loadCell(r+d,s));for(let d=0;d<i;++d)this.setCell(r+d,e)}else for(let s=r;s<this.length;++s)this.setCell(s,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(r,i,e){if(r%=this.length,i<this.length-r){const s=new f.CellData;for(let d=0;d<this.length-r-i;++d)this.setCell(r+d,this.loadCell(r+i+d,s));for(let d=this.length-i;d<this.length;++d)this.setCell(d,e)}else for(let s=r;s<this.length;++s)this.setCell(s,e);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,e)}replaceCells(r,i,e,s=!1){if(s)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,e);r<i&&r<this.length;)this.isProtected(r)||this.setCell(r,e),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,e);r<i&&r<this.length;)this.setCell(r++,e)}resize(r,i){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const s=new Uint32Array(e);s.set(this._data),this._data=s}for(let s=this.length;s<r;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,e);const s=Object.keys(this._combined);for(let m=0;m<s.length;m++){const S=parseInt(s[m],10);S>=r&&delete this._combined[S]}const d=Object.keys(this._extendedAttrs);for(let m=0;m<d.length;m++){const S=parseInt(d[m],10);S>=r&&delete this._extendedAttrs[S]}}return this.length=r,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,i=!1){if(i)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,r);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const i in r._combined)this._combined[i]=r._combined[i];this._extendedAttrs={};for(const i in r._extendedAttrs)this._extendedAttrs[i]=r._extendedAttrs[i];this.isWrapped=r.isWrapped}clone(){const r=new g(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const i in this._combined)r._combined[i]=this._combined[i];for(const i in this._extendedAttrs)r._extendedAttrs[i]=this._extendedAttrs[i];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,i,e,s,d){const m=r._data;if(d)for(let C=s-1;C>=0;C--){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=m[3*(i+C)+v];268435456&m[3*(i+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[i+C])}else for(let C=0;C<s;C++){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=m[3*(i+C)+v];268435456&m[3*(i+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[i+C])}const S=Object.keys(r._combined);for(let C=0;C<S.length;C++){const v=parseInt(S[C],10);v>=i&&(this._combined[v-i+e]=r._combined[v])}}translateToString(r,i,e,s){i=i??0,e=e??this.length,r&&(e=Math.min(e,this.getTrimmedLength())),s&&(s.length=0);let d="";for(;i<e;){const m=this._data[3*i+0],S=2097151&m,C=2097152&m?this._combined[i]:S?(0,u.stringFromCodePoint)(S):l.WHITESPACE_CELL_CHAR;if(d+=C,s)for(let v=0;v<C.length;++v)s.push(i);i+=m>>22||1}return s&&s.push(i),d}}n.BufferLine=g},4841:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(E,n)=>{function a(c,f,l){if(f===c.length-1)return c[f].getTrimmedLength();const u=!c[f].hasContent(l-1)&&c[f].getWidth(l-1)===1,p=c[f+1].getWidth(0)===2;return u&&p?l-1:l}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(c,f,l,u,p){const g=[];for(let h=0;h<c.length-1;h++){let r=h,i=c.get(++r);if(!i.isWrapped)continue;const e=[c.get(h)];for(;r<c.length&&i.isWrapped;)e.push(i),i=c.get(++r);if(u>=h&&u<r){h+=e.length-1;continue}let s=0,d=a(e,s,f),m=1,S=0;for(;m<e.length;){const v=a(e,m,f),x=v-S,B=l-d,P=Math.min(x,B);e[s].copyCellsFrom(e[m],S,d,P,!1),d+=P,d===l&&(s++,d=0),S+=P,S===v&&(m++,S=0),d===0&&s!==0&&e[s-1].getWidth(l-1)===2&&(e[s].copyCellsFrom(e[s-1],l-1,d++,1,!1),e[s-1].setCell(l-1,p))}e[s].replaceCells(d,l,p);let C=0;for(let v=e.length-1;v>0&&(v>s||e[v].getTrimmedLength()===0);v--)C++;C>0&&(g.push(h+e.length-C),g.push(C)),h+=e.length-1}return g},n.reflowLargerCreateNewLayout=function(c,f){const l=[];let u=0,p=f[u],g=0;for(let h=0;h<c.length;h++)if(p===h){const r=f[++u];c.onDeleteEmitter.fire({index:h-g,amount:r}),h+=r-1,g+=r,p=f[++u]}else l.push(h);return{layout:l,countRemoved:g}},n.reflowLargerApplyNewLayout=function(c,f){const l=[];for(let u=0;u<f.length;u++)l.push(c.get(f[u]));for(let u=0;u<l.length;u++)c.set(u,l[u]);c.length=f.length},n.reflowSmallerGetNewLineLengths=function(c,f,l){const u=[],p=c.map(((i,e)=>a(c,e,f))).reduce(((i,e)=>i+e));let g=0,h=0,r=0;for(;r<p;){if(p-r<l){u.push(p-r);break}g+=l;const i=a(c,h,f);g>i&&(g-=i,h++);const e=c[h].getWidth(g-1)===2;e&&g--;const s=e?l-1:l;u.push(s),r+=s}return u},n.getWrappedLineTrimmedLength=a},5295:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const c=a(8460),f=a(844),l=a(9092);class u extends f.Disposable{constructor(g,h){super(),this._optionsService=g,this._bufferService=h,this._onBufferActivate=this.register(new c.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),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(g,h){this._normal.resize(g,h),this._alt.resize(g,h),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}n.BufferSet=u},511:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const c=a(482),f=a(643),l=a(3734);class u extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const h=new u;return h.setFromCharData(g),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(g[f.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(g[f.CHAR_DATA_CHAR_INDEX].length===2){const r=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const i=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(r-55296)+i-56320+65536|g[f.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[f.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=g[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=u},643:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const c=a(8460),f=a(844);class l{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}n.Marker=l,l._nextId=1},7116:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(E,n)=>{var a,c,f;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
9
+ `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(a||(n.C0=a={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(c||(n.C1=c={})),(function(l){l.ST=`${a.ESC}\\`})(f||(n.C1_ESCAPED=f={}))},7399:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const c=a(2584),f={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:["'",'"']};n.evaluateKeyboardEvent=function(l,u,p,g){const h={type:0,cancel:!1,key:void 0},r=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?h.key=u?c.C0.ESC+"OA":c.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?h.key=u?c.C0.ESC+"OD":c.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?h.key=u?c.C0.ESC+"OC":c.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(h.key=u?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:h.key=l.ctrlKey?"\b":c.C0.DEL,l.altKey&&(h.key=c.C0.ESC+h.key);break;case 9:if(l.shiftKey){h.key=c.C0.ESC+"[Z";break}h.key=c.C0.HT,h.cancel=!0;break;case 13:h.key=l.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,h.cancel=!0;break;case 27:h.key=c.C0.ESC,l.altKey&&(h.key=c.C0.ESC+c.C0.ESC),h.cancel=!0;break;case 37:if(l.metaKey)break;r?(h.key=c.C0.ESC+"[1;"+(r+1)+"D",h.key===c.C0.ESC+"[1;3D"&&(h.key=c.C0.ESC+(p?"b":"[1;5D"))):h.key=u?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(l.metaKey)break;r?(h.key=c.C0.ESC+"[1;"+(r+1)+"C",h.key===c.C0.ESC+"[1;3C"&&(h.key=c.C0.ESC+(p?"f":"[1;5C"))):h.key=u?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(l.metaKey)break;r?(h.key=c.C0.ESC+"[1;"+(r+1)+"A",p||h.key!==c.C0.ESC+"[1;3A"||(h.key=c.C0.ESC+"[1;5A")):h.key=u?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(l.metaKey)break;r?(h.key=c.C0.ESC+"[1;"+(r+1)+"B",p||h.key!==c.C0.ESC+"[1;3B"||(h.key=c.C0.ESC+"[1;5B")):h.key=u?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(h.key=c.C0.ESC+"[2~");break;case 46:h.key=r?c.C0.ESC+"[3;"+(r+1)+"~":c.C0.ESC+"[3~";break;case 36:h.key=r?c.C0.ESC+"[1;"+(r+1)+"H":u?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:h.key=r?c.C0.ESC+"[1;"+(r+1)+"F":u?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:l.shiftKey?h.type=2:l.ctrlKey?h.key=c.C0.ESC+"[5;"+(r+1)+"~":h.key=c.C0.ESC+"[5~";break;case 34:l.shiftKey?h.type=3:l.ctrlKey?h.key=c.C0.ESC+"[6;"+(r+1)+"~":h.key=c.C0.ESC+"[6~";break;case 112:h.key=r?c.C0.ESC+"[1;"+(r+1)+"P":c.C0.ESC+"OP";break;case 113:h.key=r?c.C0.ESC+"[1;"+(r+1)+"Q":c.C0.ESC+"OQ";break;case 114:h.key=r?c.C0.ESC+"[1;"+(r+1)+"R":c.C0.ESC+"OR";break;case 115:h.key=r?c.C0.ESC+"[1;"+(r+1)+"S":c.C0.ESC+"OS";break;case 116:h.key=r?c.C0.ESC+"[15;"+(r+1)+"~":c.C0.ESC+"[15~";break;case 117:h.key=r?c.C0.ESC+"[17;"+(r+1)+"~":c.C0.ESC+"[17~";break;case 118:h.key=r?c.C0.ESC+"[18;"+(r+1)+"~":c.C0.ESC+"[18~";break;case 119:h.key=r?c.C0.ESC+"[19;"+(r+1)+"~":c.C0.ESC+"[19~";break;case 120:h.key=r?c.C0.ESC+"[20;"+(r+1)+"~":c.C0.ESC+"[20~";break;case 121:h.key=r?c.C0.ESC+"[21;"+(r+1)+"~":c.C0.ESC+"[21~";break;case 122:h.key=r?c.C0.ESC+"[23;"+(r+1)+"~":c.C0.ESC+"[23~";break;case 123:h.key=r?c.C0.ESC+"[24;"+(r+1)+"~":c.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(p&&!g||!l.altKey||l.metaKey)!p||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?h.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(h.key=c.C0.US),l.key==="@"&&(h.key=c.C0.NUL)):l.keyCode===65&&(h.type=1);else{const i=f[l.keyCode],e=i==null?void 0:i[l.shiftKey?1:0];if(e)h.key=c.C0.ESC+e;else if(l.keyCode>=65&&l.keyCode<=90){const s=l.ctrlKey?l.keyCode-64:l.keyCode+32;let d=String.fromCharCode(s);l.shiftKey&&(d=d.toUpperCase()),h.key=c.C0.ESC+d}else if(l.keyCode===32)h.key=c.C0.ESC+(l.ctrlKey?c.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let s=l.code.slice(3,4);l.shiftKey||(s=s.toLowerCase()),h.key=c.C0.ESC+s,h.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?h.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?h.key=c.C0.NUL:l.keyCode>=51&&l.keyCode<=55?h.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?h.key=c.C0.DEL:l.keyCode===219?h.key=c.C0.ESC:l.keyCode===220?h.key=c.C0.FS:l.keyCode===221&&(h.key=c.C0.GS)}return h}},482:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,c=0,f=a.length){let l="";for(let u=c;u<f;++u){let p=a[u];p>65535?(p-=65536,l+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):l+=String.fromCharCode(p)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const f=a.length;if(!f)return 0;let l=0,u=0;if(this._interim){const p=a.charCodeAt(u++);56320<=p&&p<=57343?c[l++]=1024*(this._interim-55296)+p-56320+65536:(c[l++]=this._interim,c[l++]=p),this._interim=0}for(let p=u;p<f;++p){const g=a.charCodeAt(p);if(55296<=g&&g<=56319){if(++p>=f)return this._interim=g,l;const h=a.charCodeAt(p);56320<=h&&h<=57343?c[l++]=1024*(g-55296)+h-56320+65536:(c[l++]=g,c[l++]=h)}else g!==65279&&(c[l++]=g)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const f=a.length;if(!f)return 0;let l,u,p,g,h=0,r=0,i=0;if(this.interim[0]){let d=!1,m=this.interim[0];m&=(224&m)==192?31:(240&m)==224?15:7;let S,C=0;for(;(S=63&this.interim[++C])&&C<4;)m<<=6,m|=S;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=v-C;for(;i<x;){if(i>=f)return 0;if(S=a[i++],(192&S)!=128){i--,d=!0;break}this.interim[C++]=S,m<<=6,m|=63&S}d||(v===2?m<128?i--:c[h++]=m:v===3?m<2048||m>=55296&&m<=57343||m===65279||(c[h++]=m):m<65536||m>1114111||(c[h++]=m)),this.interim.fill(0)}const e=f-4;let s=i;for(;s<f;){for(;!(!(s<e)||128&(l=a[s])||128&(u=a[s+1])||128&(p=a[s+2])||128&(g=a[s+3]));)c[h++]=l,c[h++]=u,c[h++]=p,c[h++]=g,s+=4;if(l=a[s++],l<128)c[h++]=l;else if((224&l)==192){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(r=(31&l)<<6|63&u,r<128){s--;continue}c[h++]=r}else if((240&l)==224){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,h;if(p=a[s++],(192&p)!=128){s--;continue}if(r=(15&l)<<12|(63&u)<<6|63&p,r<2048||r>=55296&&r<=57343||r===65279)continue;c[h++]=r}else if((248&l)==240){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,h;if(p=a[s++],(192&p)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,this.interim[2]=p,h;if(g=a[s++],(192&g)!=128){s--;continue}if(r=(7&l)<<18|(63&u)<<12|(63&p)<<6|63&g,r<65536||r>1114111)continue;c[h++]=r}}return h}}},225:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const c=a(1480),f=[[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]],l=[[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 u;n.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),u.fill(1),u[0]=0,u.fill(0,1,32),u.fill(0,127,160),u.fill(2,4352,4448),u[9001]=2,u[9002]=2,u.fill(2,11904,42192),u[12351]=1,u.fill(2,44032,55204),u.fill(2,63744,64256),u.fill(2,65040,65050),u.fill(2,65072,65136),u.fill(2,65280,65377),u.fill(2,65504,65511);for(let p=0;p<f.length;++p)u.fill(0,f[p][0],f[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?u[p]:(function(g,h){let r,i=0,e=h.length-1;if(g<h[0][0]||g>h[e][1])return!1;for(;e>=i;)if(r=i+e>>1,g>h[r][1])i=r+1;else{if(!(g<h[r][0]))return!0;e=r-1}return!1})(p,l)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}charProperties(p,g){let h=this.wcwidth(p),r=h===0&&g!==0;if(r){const i=c.UnicodeService.extractWidth(g);i===0?r=!1:i>h&&(h=i)}return c.UnicodeService.createPropertyValue(0,h,r)}}},5981:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const c=a(8460),f=a(844);class l extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,g){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+=p.length,this._writeBuffer.push(p),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(g)}_innerWrite(p=0,g=!0){const h=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],i=this._action(r,g);if(i){const s=d=>Date.now()-h>=12?setTimeout((()=>this._innerWrite(0,d))):this._innerWrite(h,d);return void i.catch((d=>(queueMicrotask((()=>{throw d})),Promise.resolve(!1)))).then(s)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-h>=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()}}n.WriteBuffer=l},5941:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const a=/^([\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})$/,c=/^[\da-f]+$/;function f(l,u){const p=l.toString(16),g=p.length<2?"0"+p:p;switch(u){case 4:return p[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}n.parseColor=function(l){if(!l)return;let u=l.toLowerCase();if(u.indexOf("rgb:")===0){u=u.slice(4);const p=a.exec(u);if(p){const g=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/g*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/g*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/g*255)]}}else if(u.indexOf("#")===0&&(u=u.slice(1),c.exec(u)&&[3,6,9,12].includes(u.length))){const p=u.length/3,g=[0,0,0];for(let h=0;h<3;++h){const r=parseInt(u.slice(p*h,p*h+p),16);g[h]=p===1?r<<4:p===2?r:p===3?r>>4:r>>8}return g}},n.toRgbString=function(l,u=16){const[p,g,h]=l;return`rgb:${f(p,u)}/${f(g,u)}/${f(h,u)}`}},5770:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const c=a(482),f=a(8742),l=a(5770),u=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=u,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}registerHandler(g,h){this._handlers[g]===void 0&&(this._handlers[g]=[]);const r=this._handlers[g];return r.push(h),{dispose:()=>{const i=r.indexOf(h);i!==-1&&r.splice(i,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=u,this._ident=0}hook(g,h){if(this.reset(),this._ident=g,this._active=this._handlers[g]||u,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(g,h,r){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(g,h,r);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(g,h,r))}unhook(g,h=!0){if(this._active.length){let r=!1,i=this._active.length-1,e=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&r===!1){for(;i>=0&&(r=this._active[i].unhook(g),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",g);this._active=u,this._ident=0}};const p=new f.Params;p.addParam(0),n.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=p,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():p,this._data="",this._hitLimit=!1}put(g,h,r){this._hitLimit||(this._data+=(0,c.utf32ToString)(g,h,r),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let h=!1;if(this._hitLimit)h=!1;else if(g&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then((r=>(this._params=p,this._data="",this._hitLimit=!1,r)));return this._params=p,this._data="",this._hitLimit=!1,h}}},2015:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const c=a(844),f=a(8742),l=a(6242),u=a(6351);class p{constructor(i){this.table=new Uint8Array(i)}setDefault(i,e){this.table.fill(i<<4|e)}add(i,e,s,d){this.table[e<<8|i]=s<<4|d}addMany(i,e,s,d){for(let m=0;m<i.length;m++)this.table[e<<8|i[m]]=s<<4|d}}n.TransitionTable=p;const g=160;n.VT500_TRANSITION_TABLE=(function(){const r=new p(4095),i=Array.apply(null,Array(256)).map(((C,v)=>v)),e=(C,v)=>i.slice(C,v),s=e(32,127),d=e(0,24);d.push(25),d.push.apply(d,e(28,32));const m=e(0,14);let S;for(S in r.setDefault(1,0),r.addMany(s,0,2,0),m)r.addMany([24,26,153,154],S,3,0),r.addMany(e(128,144),S,3,0),r.addMany(e(144,152),S,3,0),r.add(156,S,0,0),r.add(27,S,11,1),r.add(157,S,4,8),r.addMany([152,158,159],S,0,7),r.add(155,S,11,3),r.add(144,S,11,9);return r.addMany(d,0,3,0),r.addMany(d,1,3,1),r.add(127,1,0,1),r.addMany(d,8,0,8),r.addMany(d,3,3,3),r.add(127,3,0,3),r.addMany(d,4,3,4),r.add(127,4,0,4),r.addMany(d,6,3,6),r.addMany(d,5,3,5),r.add(127,5,0,5),r.addMany(d,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(s,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(e(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(s,7,0,7),r.addMany(d,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(e(64,127),3,7,0),r.addMany(e(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(e(48,60),4,8,4),r.addMany(e(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(e(32,64),6,0,6),r.add(127,6,0,6),r.addMany(e(64,127),6,0,0),r.addMany(e(32,48),3,9,5),r.addMany(e(32,48),5,9,5),r.addMany(e(48,64),5,0,6),r.addMany(e(64,127),5,7,0),r.addMany(e(32,48),4,9,5),r.addMany(e(32,48),1,9,2),r.addMany(e(32,48),2,9,2),r.addMany(e(48,127),2,10,0),r.addMany(e(48,80),1,10,0),r.addMany(e(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(e(96,127),1,10,0),r.add(80,1,11,9),r.addMany(d,9,0,9),r.add(127,9,0,9),r.addMany(e(28,32),9,0,9),r.addMany(e(32,48),9,9,12),r.addMany(e(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(d,11,0,11),r.addMany(e(32,128),11,0,11),r.addMany(e(28,32),11,0,11),r.addMany(d,10,0,10),r.add(127,10,0,10),r.addMany(e(28,32),10,0,10),r.addMany(e(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(e(32,48),10,9,12),r.addMany(d,12,0,12),r.add(127,12,0,12),r.addMany(e(28,32),12,0,12),r.addMany(e(32,48),12,9,12),r.addMany(e(48,64),12,0,11),r.addMany(e(64,127),12,12,13),r.addMany(e(64,127),10,12,13),r.addMany(e(64,127),9,12,13),r.addMany(d,13,13,13),r.addMany(s,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(g,0,2,0),r.add(g,8,5,8),r.add(g,6,0,6),r.add(g,11,0,11),r.add(g,13,13,13),r})();class h extends c.Disposable{constructor(i=n.VT500_TRANSITION_TABLE){super(),this._transitions=i,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,s,d)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,s)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new u.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(i,e=[64,126]){let s=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=i.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let m=0;m<i.intermediates.length;++m){const S=i.intermediates.charCodeAt(m);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=S}}if(i.final.length!==1)throw new Error("final must be a single byte");const d=i.final.charCodeAt(0);if(e[0]>d||d>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return s<<=8,s|=d,s}identToString(i){const e=[];for(;i;)e.push(String.fromCharCode(255&i)),i>>=8;return e.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,e){const s=this._identifier(i,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const d=this._escHandlers[s];return d.push(e),{dispose:()=>{const m=d.indexOf(e);m!==-1&&d.splice(m,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,e){this._executeHandlers[i.charCodeAt(0)]=e}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,e){const s=this._identifier(i);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const d=this._csiHandlers[s];return d.push(e),{dispose:()=>{const m=d.indexOf(e);m!==-1&&d.splice(m,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,e){return this._dcsParser.registerHandler(this._identifier(i),e)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,e){return this._oscParser.registerHandler(i,e)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}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(i,e,s,d,m){this._parseStack.state=i,this._parseStack.handlers=e,this._parseStack.handlerPos=s,this._parseStack.transition=d,this._parseStack.chunkPos=m}parse(i,e,s){let d,m=0,S=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&x>-1){for(;x>=0&&(d=v[x](this._params),d!==!0);x--)if(d instanceof Promise)return this._parseStack.handlerPos=x,d}this._parseStack.handlers=[];break;case 4:if(s===!1&&x>-1){for(;x>=0&&(d=v[x](),d!==!0);x--)if(d instanceof Promise)return this._parseStack.handlerPos=x,d}this._parseStack.handlers=[];break;case 6:if(m=i[this._parseStack.chunkPos],d=this._dcsParser.unhook(m!==24&&m!==26,s),d)return d;m===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(m=i[this._parseStack.chunkPos],d=this._oscParser.end(m!==24&&m!==26,s),d)return d;m===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=C;v<e;++v){switch(m=i[v],S=this._transitions.table[this.currentState<<8|(m<160?m:g)],S>>4){case 2:for(let A=v+1;;++A){if(A>=e||(m=i[A])<32||m>126&&m<g){this._printHandler(i,v,A),v=A-1;break}if(++A>=e||(m=i[A])<32||m>126&&m<g){this._printHandler(i,v,A),v=A-1;break}if(++A>=e||(m=i[A])<32||m>126&&m<g){this._printHandler(i,v,A),v=A-1;break}if(++A>=e||(m=i[A])<32||m>126&&m<g){this._printHandler(i,v,A),v=A-1;break}}break;case 3:this._executeHandlers[m]?this._executeHandlers[m]():this._executeHandlerFb(m),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:m,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|m];let B=x?x.length-1:-1;for(;B>=0&&(d=x[B](this._params),d!==!0);B--)if(d instanceof Promise)return this._preserveStack(3,x,B,S,v),d;B<0&&this._csiHandlerFb(this._collect<<8|m,this._params),this.precedingJoinState=0;break;case 8:do switch(m){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(m-48)}while(++v<e&&(m=i[v])>47&&m<60);v--;break;case 9:this._collect<<=8,this._collect|=m;break;case 10:const P=this._escHandlers[this._collect<<8|m];let O=P?P.length-1:-1;for(;O>=0&&(d=P[O](),d!==!0);O--)if(d instanceof Promise)return this._preserveStack(4,P,O,S,v),d;O<0&&this._escHandlerFb(this._collect<<8|m),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|m,this._params);break;case 13:for(let A=v+1;;++A)if(A>=e||(m=i[A])===24||m===26||m===27||m>127&&m<g){this._dcsParser.put(i,v,A),v=A-1;break}break;case 14:if(d=this._dcsParser.unhook(m!==24&&m!==26),d)return this._preserveStack(6,[],0,S,v),d;m===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let A=v+1;;A++)if(A>=e||(m=i[A])<32||m>127&&m<g){this._oscParser.put(i,v,A),v=A-1;break}break;case 6:if(d=this._oscParser.end(m!==24&&m!==26),d)return this._preserveStack(5,[],0,S,v),d;m===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}n.EscapeSequenceParser=h},6242:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const c=a(5770),f=a(482),l=[];n.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(u,p){this._handlers[u]===void 0&&(this._handlers[u]=[]);const g=this._handlers[u];return g.push(p),{dispose:()=>{const h=g.indexOf(p);h!==-1&&g.splice(h,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")}_put(u,p,g){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(u,p,g);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(u,p,g))}start(){this.reset(),this._state=1}put(u,p,g){if(this._state!==3){if(this._state===1)for(;p<g;){const h=u[p++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&g-p>0&&this._put(u,p,g)}}end(u,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,h=this._active.length-1,r=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,g=p,r=this._stack.fallThrough,this._stack.paused=!1),!r&&g===!1){for(;h>=0&&(g=this._active[h].end(u),g!==!0);h--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,g;h--}for(;h>=0;h--)if(g=this._active[h].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",u);this._active=l,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(u){this._handler=u,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(u,p,g){this._hitLimit||(this._data+=(0,f.utf32ToString)(u,p,g),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(u){let p=!1;if(this._hitLimit)p=!1;else if(u&&(p=this._handler(this._data),p instanceof Promise))return p.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,p}}},8742:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class c{static fromArray(l){const u=new c;if(!l.length)return u;for(let p=Array.isArray(l[0])?1:0;p<l.length;++p){const g=l[p];if(Array.isArray(g))for(let h=0;h<g.length;++h)u.addSubParam(g[h]);else u.addParam(g)}return u}constructor(l=32,u=32){if(this.maxLength=l,this.maxSubParamsLength=u,u>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(u),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new c(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let u=0;u<this.length;++u){l.push(this.params[u]);const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];g-p>0&&l.push(Array.prototype.slice.call(this._subParams,p,g))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>a?a:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>a?a:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const u=this._subParamsIdx[l]>>8,p=255&this._subParamsIdx[l];return p-u>0?this._subParams.subarray(u,p):null}getSubParamsAll(){const l={};for(let u=0;u<this.length;++u){const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];g-p>0&&(l[u]=this._subParams.slice(p,g))}return l}addDigit(l){let u;if(this._rejectDigits||!(u=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,g=p[u-1];p[u-1]=~g?Math.min(10*g+l,a):l}}n.Params=c},5741:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const f={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(f),c.dispose=()=>this._wrappedAddonDispose(f),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===a){c=f;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const c=a(3785),f=a(511);n.BufferApiView=class{constructor(l,u){this._buffer=l,this.type=u}init(l){return this._buffer=l,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(l){const u=this._buffer.lines.get(l);if(u)return new c.BufferLineApiView(u)}getNullCell(){return new f.CellData}}},3785:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const c=a(511);n.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,l){if(!(f<0||f>=this._line.length))return l?(this._line.loadCell(f,l),l):this._line.loadCell(f,new c.CellData)}translateToString(f,l,u){return this._line.translateToString(f,l,u)}}},8285:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const c=a(8771),f=a(8460),l=a(844);class u extends l.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}n.BufferNamespaceApi=u},7975:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(f=>c(f.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((f,l)=>c(f,l.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(E,n,a){var c=this&&this.__decorate||function(r,i,e,s){var d,m=arguments.length,S=m<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,i,e,s);else for(var C=r.length-1;C>=0;C--)(d=r[C])&&(S=(m<3?d(S):m>3?d(i,e,S):d(i,e))||S);return m>3&&S&&Object.defineProperty(i,e,S),S},f=this&&this.__param||function(r,i){return function(e,s){i(e,s,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const l=a(8460),u=a(844),p=a(5295),g=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let h=n.BufferService=class extends u.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(r,this))}resize(r,i){this.cols=r,this.rows=i,this.buffers.resize(r,i),this._onResize.fire({cols:r,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,i=!1){const e=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===r.fg&&s.getBg(0)===r.bg||(s=e.getBlankLine(r,i),this._cachedBlankLine=s),s.isWrapped=i;const d=e.ybase+e.scrollTop,m=e.ybase+e.scrollBottom;if(e.scrollTop===0){const S=e.lines.isFull;m===e.lines.length-1?S?e.lines.recycle().copyFrom(s):e.lines.push(s.clone()):e.lines.splice(m+1,0,s.clone()),S?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const S=m-d+1;e.lines.shiftElements(d+1,S-1,-1),e.lines.set(m,s.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(r,i,e){const s=this.buffer;if(r<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else r+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const d=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+r,s.ybase),0),d!==s.ydisp&&(i||this._onScroll.fire(s.ydisp))}};n.BufferService=h=c([f(0,g.IOptionsService)],h)},7994:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(E,n,a){var c=this&&this.__decorate||function(s,d,m,S){var C,v=arguments.length,x=v<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(s,d,m,S);else for(var B=s.length-1;B>=0;B--)(C=s[B])&&(x=(v<3?C(x):v>3?C(d,m,x):C(d,m))||x);return v>3&&x&&Object.defineProperty(d,m,x),x},f=this&&this.__param||function(s,d){return function(m,S){d(m,S,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const l=a(2585),u=a(8460),p=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function h(s,d){let m=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(m|=64,m|=s.action):(m|=3&s.button,4&s.button&&(m|=64),8&s.button&&(m|=128),s.action===32?m|=32:s.action!==0||d||(m|=3)),m}const r=String.fromCharCode,i={DEFAULT:s=>{const d=[h(s,!1)+32,s.col+32,s.row+32];return d[0]>255||d[1]>255||d[2]>255?"":`\x1B[M${r(d[0])}${r(d[1])}${r(d[2])}`},SGR:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${h(s,!0)};${s.col};${s.row}${d}`},SGR_PIXELS:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${h(s,!0)};${s.x};${s.y}${d}`}};let e=n.CoreMouseService=class extends p.Disposable{constructor(s,d){super(),this._bufferService=s,this._coreService=d,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new u.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const m of Object.keys(g))this.addProtocol(m,g[m]);for(const m of Object.keys(i))this.addEncoding(m,i[m]);this.reset()}addProtocol(s,d){this._protocols[s]=d}addEncoding(s,d){this._encodings[s]=d}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const d=this._encodings[this._activeEncoding](s);return d&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(d):this._coreService.triggerDataEvent(d,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,d,m){if(m){if(s.x!==d.x||s.y!==d.y)return!1}else if(s.col!==d.col||s.row!==d.row)return!1;return s.button===d.button&&s.action===d.action&&s.ctrl===d.ctrl&&s.alt===d.alt&&s.shift===d.shift}};n.CoreMouseService=e=c([f(0,l.IBufferService),f(1,l.ICoreService)],e)},6975:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,m){var S,C=arguments.length,v=C<3?s:m===null?m=Object.getOwnPropertyDescriptor(s,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,m);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,m){s(d,m,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const l=a(1439),u=a(8460),p=a(844),g=a(2585),h=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=n.CoreService=class extends p.Disposable{constructor(e,s,d){super(),this._bufferService=e,this._logService=s,this._optionsService=d,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new u.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new u.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(h),this.decPrivateModes=(0,l.clone)(r)}reset(){this.modes=(0,l.clone)(h),this.decPrivateModes=(0,l.clone)(r)}triggerDataEvent(e,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const d=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&d.ybase!==d.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((m=>m.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((s=>s.charCodeAt(0))))),this._onBinary.fire(e))}};n.CoreService=i=c([f(0,g.IBufferService),f(1,g.ILogService),f(2,g.IOptionsService)],i)},9074:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const c=a(8055),f=a(8460),l=a(844),u=a(6106);let p=0,g=0;class h extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new u.SortedList((e=>e==null?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const s=new r(e);if(s){const d=s.marker.onDispose((()=>s.dispose()));s.onDispose((()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),d.dispose())})),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,s,d){let m=0,S=0;for(const C of this._decorations.getKeyIterator(s))m=C.options.x??0,S=m+(C.options.width??1),e>=m&&e<S&&(!d||(C.options.layer??"bottom")===d)&&(yield C)}forEachDecorationAtCell(e,s,d,m){this._decorations.forEachByKey(s,(S=>{p=S.options.x??0,g=p+(S.options.width??1),e>=p&&e<g&&(!d||(S.options.layer??"bottom")===d)&&m(S)}))}}n.DecorationService=h;class r extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const c=a(2585),f=a(8343);class l{constructor(...p){this._entries=new Map;for(const[g,h]of p)this.set(g,h)}set(p,g){const h=this._entries.get(p);return this._entries.set(p,g),h}forEach(p){for(const[g,h]of this._entries.entries())p(g,h)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}n.ServiceCollection=l,n.InstantiationService=class{constructor(){this._services=new l,this._services.set(c.IInstantiationService,this)}setService(u,p){this._services.set(u,p)}getService(u){return this._services.get(u)}createInstance(u,...p){const g=(0,f.getServiceDependencies)(u).sort(((i,e)=>i.index-e.index)),h=[];for(const i of g){const e=this._services.get(i.id);if(!e)throw new Error(`[createInstance] ${u.name} depends on UNKNOWN service ${i.id}.`);h.push(e)}const r=g.length>0?g[0].index:p.length;if(p.length!==r)throw new Error(`[createInstance] First service dependency of ${u.name} at position ${r+1} conflicts with ${p.length} static arguments`);return new u(...p,...h)}}},7866:function(E,n,a){var c=this&&this.__decorate||function(r,i,e,s){var d,m=arguments.length,S=m<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(r,i,e,s);else for(var C=r.length-1;C>=0;C--)(d=r[C])&&(S=(m<3?d(S):m>3?d(i,e,S):d(i,e))||S);return m>3&&S&&Object.defineProperty(i,e,S),S},f=this&&this.__param||function(r,i){return function(e,s){i(e,s,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=a(844),u=a(2585),p={trace:u.LogLevelEnum.TRACE,debug:u.LogLevelEnum.DEBUG,info:u.LogLevelEnum.INFO,warn:u.LogLevelEnum.WARN,error:u.LogLevelEnum.ERROR,off:u.LogLevelEnum.OFF};let g,h=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=u.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let i=0;i<r.length;i++)typeof r[i]=="function"&&(r[i]=r[i]())}_log(r,i,e){this._evalLazyOptionalParams(e),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...e)}trace(r,...i){var e;this._logLevel<=u.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,r,i)}debug(r,...i){var e;this._logLevel<=u.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,r,i)}info(r,...i){var e;this._logLevel<=u.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,r,i)}warn(r,...i){var e;this._logLevel<=u.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,r,i)}error(r,...i){var e;this._logLevel<=u.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,r,i)}};n.LogService=h=c([f(0,u.IOptionsService)],h),n.setTraceLogger=function(r){g=r},n.traceCall=function(r,i,e){if(typeof e.value!="function")throw new Error("not supported");const s=e.value;e.value=function(...d){if(g.logLevel!==u.LogLevelEnum.TRACE)return s.apply(this,d);g.trace(`GlyphRenderer#${s.name}(${d.map((S=>JSON.stringify(S))).join(", ")})`);const m=s.apply(this,d);return g.trace(`GlyphRenderer#${s.name} return`,m),m}}},7302:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const c=a(8460),f=a(844),l=a(6114);n.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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const u=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends f.Disposable{constructor(h){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const i in h)if(i in r)try{const e=h[i];r[i]=this._sanitizeAndValidateOption(i,e)}catch(e){console.error(e)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(h,r){return this.onOptionChange((i=>{i===h&&r(this.rawOptions[h])}))}onMultipleOptionChange(h,r){return this.onOptionChange((i=>{h.indexOf(i)!==-1&&r()}))}_setupOptions(){const h=i=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},r=(i,e)=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);e=this._sanitizeAndValidateOption(i,e),this.rawOptions[i]!==e&&(this.rawOptions[i]=e,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const e={get:h.bind(this,i),set:r.bind(this,i)};Object.defineProperty(this.options,i,e)}}_sanitizeAndValidateOption(h,r){switch(h){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[h]),!(function(i){return i==="block"||i==="underline"||i==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${h}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=u.includes(r)?r:n.DEFAULT_OPTIONS[h];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${h} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${h} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=p},2660:function(E,n,a){var c=this&&this.__decorate||function(p,g,h,r){var i,e=arguments.length,s=e<3?g:r===null?r=Object.getOwnPropertyDescriptor(g,h):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(p,g,h,r);else for(var d=p.length-1;d>=0;d--)(i=p[d])&&(s=(e<3?i(s):e>3?i(g,h,s):i(g,h))||s);return e>3&&s&&Object.defineProperty(g,h,s),s},f=this&&this.__param||function(p,g){return function(h,r){g(h,r,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const l=a(2585);let u=n.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const g=this._bufferService.buffer;if(p.id===void 0){const d=g.addMarker(g.ybase+g.y),m={data:p,id:this._nextId++,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(m,d))),this._dataByLinkId.set(m.id,m),m.id}const h=p,r=this._getEntryIdKey(h),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,g.ybase+g.y),i.id;const e=g.addMarker(g.ybase+g.y),s={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(s,e))),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(p,g){const h=this._dataByLinkId.get(p);if(h&&h.lines.every((r=>r.line!==g))){const r=this._bufferService.buffer.addMarker(g);h.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(h,r)))}}getLinkData(p){var g;return(g=this._dataByLinkId.get(p))==null?void 0:g.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,g){const h=p.lines.indexOf(g);h!==-1&&(p.lines.splice(h,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};n.OscLinkService=u=c([f(0,l.IBufferService)],u)},8343:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",c="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(f){return f[c]||[]},n.createDecorator=function(f){if(n.serviceRegistry.has(f))return n.serviceRegistry.get(f);const l=function(u,p,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,r,i){r[a]===r?r[c].push({id:h,index:i}):(r[c]=[{id:h,index:i}],r[a]=r)})(l,u,g)};return l.toString=()=>f,n.serviceRegistry.set(f,l),l}},2585:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const c=a(8343);var f;n.IBufferService=(0,c.createDecorator)("BufferService"),n.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),n.ICoreService=(0,c.createDecorator)("CoreService"),n.ICharsetService=(0,c.createDecorator)("CharsetService"),n.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(f||(n.LogLevelEnum=f={})),n.ILogService=(0,c.createDecorator)("LogService"),n.IOptionsService=(0,c.createDecorator)("OptionsService"),n.IOscLinkService=(0,c.createDecorator)("OscLinkService"),n.IUnicodeService=(0,c.createDecorator)("UnicodeService"),n.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const c=a(8460),f=a(225);class l{static extractShouldJoin(p){return(1&p)!=0}static extractWidth(p){return p>>1&3}static extractCharKind(p){return p>>3}static createPropertyValue(p,g,h=!1){return(16777215&p)<<3|(3&g)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const p=new f.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let g=0,h=0;const r=p.length;for(let i=0;i<r;++i){let e=p.charCodeAt(i);if(55296<=e&&e<=56319){if(++i>=r)return g+this.wcwidth(e);const m=p.charCodeAt(i);56320<=m&&m<=57343?e=1024*(e-55296)+m-56320+65536:g+=this.wcwidth(m)}const s=this.charProperties(e,h);let d=l.extractWidth(s);l.extractShouldJoin(s)&&(d-=l.extractWidth(h)),g+=d,h=s}return g}charProperties(p,g){return this._activeProvider.charProperties(p,g)}}n.UnicodeService=l}},b={};function w(E){var n=b[E];if(n!==void 0)return n.exports;var a=b[E]={exports:{}};return _[E].call(a.exports,a,a.exports,w),a.exports}var k={};return(()=>{var E=k;Object.defineProperty(E,"__esModule",{value:!0}),E.Terminal=void 0;const n=w(9042),a=w(3236),c=w(844),f=w(5741),l=w(8285),u=w(7975),p=w(7090),g=["cols","rows"];class h extends c.Disposable{constructor(i){super(),this._core=this.register(new a.Terminal(i)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const e=d=>this._core.options[d],s=(d,m)=>{this._checkReadonlyOptions(d),this._core.options[d]=m};for(const d in this._core.options){const m={get:e.bind(this,d),set:s.bind(this,d)};Object.defineProperty(this._publicOptions,d,m)}}_checkReadonlyOptions(i){if(g.includes(i))throw new Error(`Option "${i}" 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 u.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new p.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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const e in i)this._publicOptions[e]=i[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(i,e=!0){this._core.input(i,e)}resize(i,e){this._verifyIntegers(i,e),this._core.resize(i,e)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}attachCustomWheelEventHandler(i){this._core.attachCustomWheelEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){return this._checkProposedApi(),this._verifyPositiveIntegers(i.x??0,i.width??0,i.height??0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,e,s){this._verifyIntegers(i,e,s),this._core.select(i,e,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,e){this._verifyIntegers(i,e),this._core.selectLines(i,e)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,e){this._core.write(i,e)}writeln(i,e){this._core.write(i),this._core.write(`\r
10
+ `,e)}paste(i){this._core.paste(i)}refresh(i,e){this._verifyIntegers(i,e),this._core.refresh(i,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(i){this._addonManager.loadAddon(this,i)}static get strings(){return n}_verifyIntegers(...i){for(const e of i)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...i){for(const e of i)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}E.Terminal=h})(),k})()))})(Wi)),Wi.exports}var cc=lc(),Ui={exports:{}},Gs;function hc(){return Gs||(Gs=1,(function(t,o){(function(_,b){t.exports=b()})(self,(()=>(()=>{var _={};return(()=>{var b=_;Object.defineProperty(b,"__esModule",{value:!0}),b.FitAddon=void 0,b.FitAddon=class{activate(w){this._terminal=w}dispose(){}fit(){const w=this.proposeDimensions();if(!w||!this._terminal||isNaN(w.cols)||isNaN(w.rows))return;const k=this._terminal._core;this._terminal.rows===w.rows&&this._terminal.cols===w.cols||(k._renderService.clear(),this._terminal.resize(w.cols,w.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const w=this._terminal._core,k=w._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const E=this._terminal.options.scrollback===0?0:w.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),c=Math.max(0,parseInt(n.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),l=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),u=c-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-E;return{cols:Math.max(2,Math.floor(u/k.css.cell.width)),rows:Math.max(1,Math.floor(l/k.css.cell.height))}}}})(),_})()))})(Ui)),Ui.exports}var uc=hc(),ji={exports:{}},Xs;function dc(){return Xs||(Xs=1,(function(t,o){(function(_,b){t.exports=b()})(self,(()=>(()=>{var _={6:(E,n)=>{function a(f){try{const l=new URL(f),u=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return f.toLocaleLowerCase().startsWith(u.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(f,l,u,p={}){this._terminal=f,this._regex=l,this._handler=u,this._options=p}provideLinks(f,l){const u=c.computeLink(f,this._regex,this._terminal,this._handler);l(this._addCallbacks(u))}_addCallbacks(f){return f.map((l=>(l.leave=this._options.leave,l.hover=(u,p)=>{if(this._options.hover){const{range:g}=l;this._options.hover(u,p,g)}},l)))}};class c{static computeLink(l,u,p,g){const h=new RegExp(u.source,(u.flags||"")+"g"),[r,i]=c._getWindowedLineStrings(l-1,p),e=r.join("");let s;const d=[];for(;s=h.exec(e);){const m=s[0];if(!a(m))continue;const[S,C]=c._mapStrIdx(p,i,0,s.index),[v,x]=c._mapStrIdx(p,S,C,m.length);if(S===-1||C===-1||v===-1||x===-1)continue;const B={start:{x:C+1,y:S+1},end:{x,y:v+1}};d.push({range:B,text:m,activate:g})}return d}static _getWindowedLineStrings(l,u){let p,g=l,h=l,r=0,i="";const e=[];if(p=u.buffer.active.getLine(l)){const s=p.translateToString(!0);if(p.isWrapped&&s[0]!==" "){for(r=0;(p=u.buffer.active.getLine(--g))&&r<2048&&(i=p.translateToString(!0),r+=i.length,e.push(i),p.isWrapped&&i.indexOf(" ")===-1););e.reverse()}for(e.push(s),r=0;(p=u.buffer.active.getLine(++h))&&p.isWrapped&&r<2048&&(i=p.translateToString(!0),r+=i.length,e.push(i),i.indexOf(" ")===-1););}return[e,g]}static _mapStrIdx(l,u,p,g){const h=l.buffer.active,r=h.getNullCell();let i=p;for(;g;){const e=h.getLine(u);if(!e)return[-1,-1];for(let s=i;s<e.length;++s){e.getCell(s,r);const d=r.getChars();if(r.getWidth()&&(g-=d.length||1,s===e.length-1&&d==="")){const m=h.getLine(u+1);m&&m.isWrapped&&(m.getCell(0,r),r.getWidth()===2&&(g+=1))}if(g<0)return[u,s]}u++,i=0}return[u,i]}}n.LinkComputer=c}},b={};function w(E){var n=b[E];if(n!==void 0)return n.exports;var a=b[E]={exports:{}};return _[E](a,a.exports,w),a.exports}var k={};return(()=>{var E=k;Object.defineProperty(E,"__esModule",{value:!0}),E.WebLinksAddon=void 0;const n=w(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(f,l){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}E.WebLinksAddon=class{constructor(f=c,l={}){this._handler=f,this._options=l}activate(f){this._terminal=f;const l=this._options,u=l.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,u,this._handler,l))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),k})()))})(ji)),ji.exports}var fc=dc(),_c=ee('<div class="flex-1 min-h-0 w-full p-1 overflow-hidden"></div>');function vc(t,o){Re(o,!0);let _=Ce(o,"isMobile",3,!1),b,w,k,E,n,a;function c(g){var r;if((r=navigator.clipboard)!=null&&r.writeText){navigator.clipboard.writeText(g).catch(()=>{});return}const h=document.createElement("textarea");h.value=g,h.style.position="fixed",h.style.opacity="0",document.body.appendChild(h),h.select(),document.execCommand("copy"),document.body.removeChild(h)}function f(g){(E==null?void 0:E.readyState)===WebSocket.OPEN&&E.send(JSON.stringify({type:"selectPane",pane:g}))}function l(g){(E==null?void 0:E.readyState)===WebSocket.OPEN&&E.send(JSON.stringify({type:"input",data:g}))}ws(()=>{w=new cc.Terminal({cursorBlink:!0,theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"},fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:_()?13:11,scrollback:1e4}),k=new uc.FitAddon,w.loadAddon(k),w.loadAddon(new fc.WebLinksAddon),w.open(b),b.addEventListener("contextmenu",h=>h.preventDefault()),w.parser.registerOscHandler(52,h=>{const r=h.indexOf(";");if(r!==-1){const i=h.slice(r+1);try{c(atob(i))}catch{}}return!0}),w.onSelectionChange(()=>{const h=w.getSelection();h&&c(h)}),w.attachCustomKeyEventHandler(h=>{if(h.key==="Enter"&&h.shiftKey&&!h.ctrlKey&&!h.metaKey&&!h.altKey)return h.type==="keydown"&&E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(h.type!=="keydown")return!0;const r=h.metaKey||h.ctrlKey;return r&&(h.key==="c"||h.key==="C")?w.hasSelection()?(c(w.getSelection()),w.clearSelection(),!1):!0:!(r&&(h.key==="ArrowUp"||h.key==="ArrowDown")||r&&(h.key==="k"||h.key==="K")||r&&(h.key==="m"||h.key==="M")||r&&(h.key==="d"||h.key==="D"))}),requestAnimationFrame(()=>{k.fit(),w.focus()});const g=location.protocol==="https:"?"wss:":"ws:";E=new WebSocket(`${g}//${location.host}/ws/${encodeURIComponent(o.worktree)}`),E.onmessage=h=>{const r=h.data,i=r[0];if(i==="o"||i==="s"){w.write(r.slice(1));return}try{const e=JSON.parse(r);switch(e.type){case"exit":w.writeln(`\r
11
+ \x1B[33m[Process exited with code ${e.exitCode}]\x1B[0m`);break;case"error":w.writeln(`\r
12
+ \x1B[31m[Error: ${e.message}]\x1B[0m`);break}}catch{}},E.onopen=()=>{k.fit();const h={type:"resize",cols:w.cols,rows:w.rows};_()&&o.initialPane!==void 0&&(h.initialPane=o.initialPane),E.send(JSON.stringify(h))},E.onclose=()=>{w.writeln(`\r
13
+ \x1B[90m[Disconnected]\x1B[0m`)},w.onData(h=>{E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"input",data:h}))}),n=new ResizeObserver(()=>{clearTimeout(a),a=setTimeout(()=>{k.fit(),E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"resize",cols:w.cols,rows:w.rows}))},150)}),n.observe(b)}),Qa(()=>{clearTimeout(a),n==null||n.disconnect(),E==null||E.close(),w==null||w.dispose()});var u={sendSelectPane:f,sendInput:l},p=_c();return Ai(p,g=>b=g,()=>b),G(t,p),Ae(u)}var pc=ee("<dialog><!></dialog>");function Wr(t,o){Re(o,!0);let _=Ce(o,"wide",3,!1),b;pr(()=>{b==null||b.showModal()});var w=pc(),k=X(w);bs(k,()=>o.children),Ai(w,E=>b=E,()=>b),oe(()=>Be(w,1,`bg-sidebar text-primary border border-edge rounded-xl p-6 w-[90%] ${_()?"max-w-[560px]":"max-w-[380px]"}`)),ai("close",w,function(...E){var n;(n=o.onclose)==null||n.apply(this,E)}),G(t,w),Ae()}var gc=ee('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),mc=ee('<span class="spinner"></span>'),Sc=ee("<!> ",1),bc=ee('<form><h2 class="text-base mb-4">Confirm</h2> <p class="text-[13px] text-muted mb-6"> </p> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function Js(t,o){Re(o,!0);let _=Ce(o,"loading",3,!1),b=Ce(o,"error",3,""),w=Ce(o,"confirmLabel",3,"Remove"),k=Ce(o,"variant",3,"danger");Wr(t,{get onclose(){return o.oncancel},children:(E,n)=>{var a=bc(),c=J(X(a),2),f=X(c),l=J(c,2);{var u=r=>{var i=gc(),e=X(i);oe(()=>se(e,b())),G(r,i)};ne(l,r=>{b()&&r(u)})}var p=J(l,2),g=X(p);je(g,{type:"button",get onclick(){return o.oncancel},get disabled(){return _()},children:(r,i)=>{var e=He("Cancel");G(r,e)},$$slots:{default:!0}});var h=J(g,2);{let r=ve(()=>k()==="accent"?"cta":"danger");je(h,{type:"submit",get variant(){return L(r)},class:"flex items-center gap-1.5",get disabled(){return _()},autofocus:!0,children:(i,e)=>{var s=Sc(),d=xe(s);{var m=C=>{var v=mc();G(C,v)};ne(d,C=>{_()&&C(m)})}var S=J(d);oe(()=>se(S,` ${w()??""}`)),G(i,s)},$$slots:{default:!0}})}oe(()=>se(f,o.message)),ai("submit",a,r=>{r.preventDefault(),o.onconfirm()}),G(E,a)},$$slots:{default:!0}}),Ae()}var wc=ee('<div class="mb-3"><label class="flex items-center gap-2 text-xs text-muted cursor-pointer"> <input type="checkbox" class="accent-[var(--accent)]"/></label></div>'),Cc=ee('<div class="mb-3"><label class="block text-xs text-muted mb-1.5"> </label> <input type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/></div>'),yc=ee('<div class="mb-4"><p class="text-xs text-muted mb-2">Startup Environment <span class="opacity-60">(optional)</span></p> <div class="pl-3 border-l border-edge"></div></div>');function xc(t,o){Re(o,!0);let _=Ce(o,"startupEnvs",19,()=>({})),b=Ce(o,"envValues",31,()=>ke({})),w=ve(()=>Object.keys(_()));var k=Tt(),E=xe(k);{var n=a=>{var c=yc(),f=J(X(c),2);Ke(f,20,()=>L(w),l=>l,(l,u)=>{var p=Tt(),g=xe(p);{var h=i=>{var e=wc(),s=X(e),d=X(s),m=J(d);oe(()=>{we(s,"for",`wt-env-${u??""}`),se(d,`${u??""} `),we(m,"id",`wt-env-${u??""}`),gi(m,b()[u]===!0)}),me("change",m,S=>{b(b()[u]=S.currentTarget.checked,!0)}),G(i,e)},r=i=>{var e=Cc(),s=X(e),d=X(s),m=J(s,2);oe(()=>{we(s,"for",`wt-env-${u??""}`),se(d,u),we(m,"id",`wt-env-${u??""}`)}),Qr(m,()=>b()[u],S=>b(b()[u]=S,!0)),G(i,e)};ne(g,i=>{typeof _()[u]=="boolean"?i(h):i(r,-1)})}G(l,p)}),G(a,c)};ne(E,a=>{L(w).length>0&&a(n)})}G(t,k),Ae()}lt(["change"]);var Ec=ee('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),kc=ee('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),Lc=ee('<div class="flex flex-col gap-2 mb-6"></div>'),Dc=ee('<span class="spinner"></span>'),Rc=ee("<!> Create",1),Ac=ee('<form><h2 class="text-base mb-4">New Worktree</h2> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-prompt">Prompt <span class="opacity-60">(optional)</span></label> <textarea id="wt-prompt" rows="3" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent resize-y" placeholder="Describe the task for the agent..."></textarea></div> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-name">Name <span class="opacity-60">(optional)</span></label> <input id="wt-name" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/></div> <!> <div class="flex gap-2 mb-4"></div> <!> <label class="flex items-center gap-2 mb-4 text-[13px] text-muted cursor-pointer"><input type="checkbox" class="accent-[var(--accent)]"/> Save as default</label> <div class="flex justify-end gap-2"><!> <!></div></form>');function Tc(t,o){Re(o,!0);let _=Ce(o,"loading",3,!1),b=Ce(o,"profiles",19,()=>[]),w=Ce(o,"defaultProfileName",3,""),k=Ce(o,"autoNameEnabled",3,!1),E=Ce(o,"initialBranch",3,""),n=Ce(o,"initialPrompt",3,""),a=Ce(o,"startupEnvs",19,()=>({}));const c=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}],f="wt-default-profile",l="wt-default-agent",u=localStorage.getItem(f),p=localStorage.getItem(l);let g=ve(()=>{var S;return w()||((S=b()[0])==null?void 0:S.name)||"default"}),h=ae(ke(E())),r=ae(ke(n())),i=ae(ke(p??"claude")),e=ae(ke(u??"")),s=ae(!1),d=ae(ke({...a()}));function m(S){S.focus()}pr(()=>{b().some(S=>S.name===L(e))||V(e,L(g),!0)}),Wr(t,{get onclose(){return o.oncancel},children:(S,C)=>{var v=Ac(),x=J(X(v),2),B=J(X(x),2);nl(B,T=>m==null?void 0:m(T)),si(()=>Qr(B,()=>L(r),T=>V(r,T)));var P=J(x,2),O=J(X(P),2),A=J(P,2);xc(A,{get startupEnvs(){return a()},get envValues(){return L(d)},set envValues(T){V(d,T,!0)}});var F=J(A,2);Ke(F,21,()=>c,Yr,(T,N)=>{var q=Ec(),Z=X(q),re=J(Z);oe(()=>{Be(q,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
14
+ ${L(i)===L(N).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),zs(Z,L(N).value),gi(Z,L(i)===L(N).value),se(re,` ${L(N).label??""}`)}),me("change",Z,()=>V(i,L(N).value,!0)),G(T,q)});var H=J(F,2);{var W=T=>{var N=Lc();Ke(N,21,b,Yr,(q,Z)=>{var re=kc(),I=X(re),D=J(I);oe(()=>{Be(re,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
15
+ ${L(e)===L(Z).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),zs(I,L(Z).name),gi(I,L(e)===L(Z).name),se(D,` ${L(Z).name??""}`)}),me("change",I,()=>V(e,L(Z).name,!0)),G(q,re)}),G(T,N)};ne(H,T=>{b().length>1&&T(W)})}var j=J(H,2),K=X(j),y=J(j,2),R=X(y);je(R,{type:"button",get onclick(){return o.oncancel},get disabled(){return _()},children:(T,N)=>{var q=He("Cancel");G(T,q)},$$slots:{default:!0}});var M=J(R,2);je(M,{type:"submit",variant:"cta",class:"flex items-center gap-1.5",get disabled(){return _()},children:(T,N)=>{var q=Rc(),Z=xe(q);{var re=I=>{var D=Dc();G(I,D)};ne(Z,I=>{_()&&I(re)})}G(T,q)},$$slots:{default:!0}}),oe(()=>we(O,"placeholder",k()?"generated from prompt if empty":"auto-generated if empty")),ai("submit",v,T=>{T.preventDefault(),L(s)?(localStorage.setItem(f,L(e)),localStorage.setItem(l,L(i))):(localStorage.removeItem(f),localStorage.removeItem(l));const N={};for(const[q,Z]of Object.entries(L(d)))typeof Z=="boolean"?Z&&(N[q]="true"):Z&&(N[q]=Z);o.oncreate(L(h).trim(),L(e),L(i),L(r).trim(),N)}),me("keydown",B,T=>{var N;T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),(N=T.currentTarget.form)==null||N.requestSubmit())}),Qr(O,()=>L(h),T=>V(h,T)),pl(K,()=>L(s),T=>V(s,T)),G(S,v)},$$slots:{default:!0}}),Ae()}lt(["keydown","change"]);var Bc=ee('<form><h2 class="text-base mb-4">Settings</h2> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="ssh-host">SSH Host <span class="opacity-60">(for "Open in Cursor")</span></label> <input id="ssh-host" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="e.g. devbox or 10.0.0.5"/> <p class="text-[11px] text-muted mt-1.5">Must match an entry in your local <code class="text-accent/80">~/.ssh/config</code>. Leave empty for local mode.</p></div> <div class="flex justify-end gap-2"><!> <!></div></form>');function Mc(t,o){Re(o,!0);let _=ae(ke(localStorage.getItem(vi)??"")),b;pr(()=>{b==null||b.focus()});function w(){const k=L(_).trim();k?localStorage.setItem(vi,k):localStorage.removeItem(vi),o.onsave(k)}Wr(t,{get onclose(){return o.onclose},children:(k,E)=>{var n=Bc(),a=J(X(n),2),c=J(X(a),2);Ai(c,p=>b=p,()=>b);var f=J(a,2),l=X(f);je(l,{type:"button",get onclick(){return o.onclose},children:(p,g)=>{var h=He("Cancel");G(p,h)},$$slots:{default:!0}});var u=J(l,2);je(u,{type:"submit",variant:"cta",children:(p,g)=>{var h=He("Save");G(p,h)},$$slots:{default:!0}}),ai("submit",n,p=>{p.preventDefault(),w()}),Qr(c,()=>L(_),p=>V(_,p)),G(k,n)},$$slots:{default:!0}}),Ae()}async function bt(t,o){const _=await fetch(`/api/${t}`,{headers:{"Content-Type":"application/json"},...o}),b=await _.json();if(!_.ok)throw new Error(b.error||`HTTP ${_.status}`);return b}function Pc(){return bt("config")}function Oc(t){switch(t){case"running":case"starting":return"working";case"idle":return"waiting";case"stopped":return"done";case"error":return"error";default:return"idle"}}function Ic(t){return{...t,ciChecks:t.ciChecks.map(o=>({...o})),comments:t.comments.map(o=>({...o}))}}function Hc(t){return{branch:t.branch,agent:Oc(t.status),mux:t.mux?"✓":"",path:t.path,dir:t.dir,dirty:t.dirty,status:t.status,elapsed:t.elapsed,profile:t.profile,agentName:t.agentName,services:t.services.map(o=>({...o})),paneCount:t.paneCount,prs:t.prs.map(o=>Ic(o)),linearIssue:t.linearIssue}}async function Fc(){return(await bt("project")).worktrees.map(o=>Hc(o))}function Nc(t,o,_,b,w){return bt("worktrees",{method:"POST",body:JSON.stringify({...t?{branch:t}:{},profile:o,agent:_,...b?{prompt:b}:{},...w&&Object.keys(w).length>0?{envOverrides:w}:{}})})}function Wc(t){return bt(`worktrees/${encodeURIComponent(t)}`,{method:"DELETE"})}function Uc(t){return bt(`worktrees/${encodeURIComponent(t)}/open`,{method:"POST"})}function jc(t){return bt(`worktrees/${encodeURIComponent(t)}/close`,{method:"POST"})}function zc(t){return bt(`worktrees/${encodeURIComponent(t)}/merge`,{method:"POST"})}function $c(){return bt("linear/issues")}async function Kc(t){return(await bt(`ci-logs/${t}`)).logs}async function io(t,o,_){await bt(`worktrees/${encodeURIComponent(t)}/send`,{method:"POST",body:JSON.stringify({text:o,..._?{preamble:_}:{}})})}function qc(t,o,_){const b=new EventSource("/api/notifications/stream");return b.addEventListener("initial",w=>{try{const k=JSON.parse(w.data);_==null||_(k)}catch{}}),b.addEventListener("notification",w=>{try{const k=JSON.parse(w.data);t(k)}catch{}}),b.addEventListener("dismiss",w=>{try{const{id:k}=JSON.parse(w.data);o(k)}catch{}}),()=>b.close()}async function Vc(t){await bt(`notifications/${t}/dismiss`,{method:"POST"})}function Gc(t){return t.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function so(t,o=3e4){const b=Gc(t).replace(/\r\n/g,`
16
+ `).replace(/\r/g,`
17
+ `).replace(/[^\x09\x0A\x20-\x7E]/g,"");return b.length>o?`[... truncated]
18
+ `+b.slice(-o):b}var Xc=ee("<button><!></button>");function ss(t,o){let _=Zn(o,["$$slots","$$events","$$legacy","children"]);var b=Xc();Jn(b,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",..._}));var w=X(b);bs(w,()=>o.children),G(t,b)}var Jc=ee('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub &nearr;</a>'),Yc=ee('<div class="text-[12px] text-muted py-2">Loading logs...</div>'),Zc=ee('<div class="text-[12px] text-danger py-2"> </div>'),Qc=ee('<pre class="bg-surface border border-edge rounded-md p-3 text-[11px] font-mono overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap m-0"> </pre> <div class="flex justify-end items-center gap-2 mt-1.5"><!> <!></div>',1),eh=ee('<div class="text-[12px] text-danger py-1.5"> </div>'),th=ee('<div class="mt-2"><!> <!></div>'),rh=ee('<li class="rounded-md border border-edge bg-surface p-3"><div class="flex items-center gap-2"><span> </span> <span class="text-[13px] font-medium flex-1 truncate"> </span> <span> </span></div> <div class="flex items-center gap-2 mt-1.5"><!> <!></div> <!></li>'),ih=ee('<h2 class="text-base mb-4"> </h2> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4"></ul> <div class="flex justify-end"><!></div>',1);function sh(t,o){Re(o,!0);let _=ae(null),b=ae(""),w=ae(!1),k=ae(""),E=ae(!1),n=ae(null),a=ae(""),c=ve(()=>Cs(o.pr));async function f(h){if(L(_)===h){V(_,null);return}V(_,h,!0),V(b,""),V(k,""),V(w,!0),V(E,!1),V(a,"");try{V(b,await Kc(h),!0)}catch(r){V(k,zt(r),!0)}finally{V(w,!1)}}async function l(h){if(!o.branch)return;V(a,""),V(n,L(_)??-1,!0);const r=["Fix the failing CI check.",`PR: ${L(c)}`,`Check: ${h}`,"","Logs:"].join(`
19
+ `)+`
20
+ `,i=so(L(b));try{await io(o.branch,i,r),o.onfixsuccess()}catch(e){V(a,zt(e),!0)}finally{V(n,null)}}async function u(){await navigator.clipboard.writeText(L(b)),V(E,!0),setTimeout(()=>{V(E,!1)},2e3)}function p(h){return h==="success"?"✓":h==="failed"?"✗":h==="skipped"?"—":"○"}function g(h){return h==="success"?"text-success":h==="failed"?"text-danger":h==="pending"?"text-warning":"text-muted"}Wr(t,{get onclose(){return o.onclose},wide:!0,children:(h,r)=>{var i=ih(),e=xe(i),s=X(e),d=J(e,2);Ke(d,21,()=>o.pr.ciChecks,C=>C.name+C.runId,(C,v)=>{var x=rh(),B=X(x),P=X(B),O=X(P),A=J(P,2),F=X(A),H=J(A,2),W=X(H),j=J(B,2),K=X(j);{var y=q=>{ss(q,{onclick:()=>f(L(v).runId??-1),children:(Z,re)=>{var I=He();oe(()=>se(I,L(_)===L(v).runId?"Hide logs":"View logs")),G(Z,I)},$$slots:{default:!0}})};ne(K,q=>{L(v).status==="failed"&&L(v).runId!==null&&q(y)})}var R=J(K,2);{var M=q=>{var Z=Jc();oe(()=>we(Z,"href",L(v).url)),G(q,Z)};ne(R,q=>{L(v).url&&q(M)})}var T=J(j,2);{var N=q=>{var Z=th(),re=X(Z);{var I=Q=>{var le=Yc();G(Q,le)},D=Q=>{var le=Zc(),_e=X(le);oe(()=>se(_e,L(k))),G(Q,le)},Y=Q=>{var le=Qc(),_e=xe(le),Se=X(_e),Pe=J(_e,2),ce=X(Pe);ss(ce,{onclick:u,children:(Ct,Ut)=>{var Mt=He();oe(()=>se(Mt,L(E)?"Copied!":"Copy logs")),G(Ct,Mt)},$$slots:{default:!0}});var wt=J(ce,2);{let Ct=ve(()=>!o.branch||!L(b)||L(w)||L(n)!==null);je(wt,{variant:"cta",small:!0,get disabled(){return L(Ct)},onclick:()=>l(L(v).name),children:(Ut,Mt)=>{var yt=He();oe(()=>se(yt,L(n)!==null?"Asking agent...":"Ask agent to fix")),G(Ut,yt)},$$slots:{default:!0}})}oe(()=>se(Se,L(b))),G(Q,le)};ne(re,Q=>{L(w)?Q(I):L(k)?Q(D,1):L(b)&&Q(Y,2)})}var z=J(re,2);{var ie=Q=>{var le=eh(),_e=X(le);oe(()=>se(_e,L(a))),G(Q,le)};ne(z,Q=>{L(a)&&Q(ie)})}G(q,Z)};ne(T,q=>{L(_)===L(v).runId&&q(N)})}oe((q,Z,re)=>{Be(P,1,`text-sm font-bold ${q??""}`),se(O,Z),se(F,L(v).name),Be(H,1,`text-[11px] ${re??""}`),se(W,L(v).status)},[()=>g(L(v).status),()=>p(L(v).status),()=>g(L(v).status)]),G(C,x)});var m=J(d,2),S=X(m);je(S,{type:"button",get onclick(){return o.onclose},children:(C,v)=>{var x=He("Close");G(C,x)},$$slots:{default:!0}}),oe(()=>se(s,`CI Checks — ${L(c)??""}`)),G(h,i)},$$slots:{default:!0}}),Ae()}var nh=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],oh=["difference","intersection","symmetricDifference","union"],Ys=!1,Tr,pt,Vt,wi,Fr,no,oo;const Ci=class Ci extends Set{constructor(_){super();he(this,Fr);he(this,Tr,new Map);he(this,pt,ae(0));he(this,Vt,ae(0));he(this,wi,Nt||-1);if(_){for(var b of _)super.add(b);U(this,Vt).v=super.size}Ys||Ee(this,Fr,oo).call(this)}has(_){var b=super.has(_),w=U(this,Tr),k=w.get(_);if(k===void 0){if(!b)return L(U(this,pt)),!1;k=Ee(this,Fr,no).call(this,!0),w.set(_,k)}return L(k),b}add(_){return super.has(_)||(super.add(_),V(U(this,Vt),super.size),Yt(U(this,pt))),this}delete(_){var b=super.delete(_),w=U(this,Tr),k=w.get(_);return k!==void 0&&(w.delete(_),V(k,!1)),b&&(V(U(this,Vt),super.size),Yt(U(this,pt))),b}clear(){if(super.size!==0){super.clear();var _=U(this,Tr);for(var b of _.values())V(b,!1);_.clear(),V(U(this,Vt),0),Yt(U(this,pt))}}keys(){return this.values()}values(){return L(U(this,pt)),super.values()}entries(){return L(U(this,pt)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return L(U(this,Vt))}};Tr=new WeakMap,pt=new WeakMap,Vt=new WeakMap,wi=new WeakMap,Fr=new WeakSet,no=function(_){return Nt===U(this,wi)?ae(_):Zt(_)},oo=function(){Ys=!0;var _=Ci.prototype,b=Set.prototype;for(const w of nh)_[w]=function(...k){return L(U(this,pt)),b[w].apply(this,k)};for(const w of oh)_[w]=function(...k){L(U(this,pt));var E=b[w].apply(this,k);return new Ci(E)}};let ns=Ci;var ah=ee('<span class="text-muted ml-1">(reply)</span>'),lh=ee('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),ch=ee('<span class="text-accent/60 ml-1">review</span>'),hh=ee('<li class="rounded-md border border-edge bg-surface p-3"><label class="flex items-start gap-2 cursor-pointer"><input type="checkbox" class="mt-0.5 accent-accent"/> <div class="flex-1 min-w-0"><!> <div class="text-[12px] text-muted mb-1"><span class="font-medium text-primary"> </span> <!></div> <pre class="text-[11px] font-mono whitespace-pre-wrap m-0 text-primary/80"> </pre></div></label></li>'),uh=ee('<div class="text-[12px] text-danger mb-3"> </div>'),dh=ee('<h2 class="text-base mb-4"> </h2> <div class="flex items-center justify-between mb-3"><!> <span class="text-[11px] text-muted"> </span></div> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4 max-h-[400px] overflow-y-auto"></ul> <!> <div class="flex justify-end gap-2"><!> <!></div>',1);function fh(t,o){Re(o,!0);let _=ae(!1),b=ae("");const w=new ns;pr(()=>{const u=o.pr.comments.length;Wt(()=>{w.clear();for(let p=0;p<u;p++)w.add(p)})});let k=ve(()=>Cs(o.pr)),E=ve(()=>w.size===o.pr.comments.length),n=ve(()=>w.size===0);function a(){if(L(E))w.clear();else for(let u=0;u<o.pr.comments.length;u++)w.add(u)}function c(u){w.has(u)?w.delete(u):w.add(u)}function f(u,p){if(u.type==="inline"){const g=u.line?`${u.path}:${u.line}`:u.path,h=u.diffHunk?`
21
+ \`\`\`diff
22
+ ${u.diffHunk}
23
+ \`\`\`
24
+ `:`
25
+ `;return`[${p}] @${u.author} (${u.createdAt.slice(0,10)}) on ${g}:${h}${u.body}`}return`[${p}] @${u.author} (${u.createdAt.slice(0,10)}):
26
+ ${u.body}`}async function l(){if(!o.branch||L(n))return;V(_,!0),V(b,"");const u=["Review the PR comments (including inline review comments) and elaborate a plan to address them.",`PR: ${L(k)}`,"","Comments:"].join(`
27
+ `)+`
28
+ `,p=o.pr.comments.filter((g,h)=>w.has(h)).map((g,h)=>f(g,h+1)).join(`
29
+
30
+ `);try{await io(o.branch,so(p,2e4),u),o.onsendsuccess()}catch(g){V(b,zt(g),!0)}finally{V(_,!1)}}Wr(t,{get onclose(){return o.onclose},wide:!0,children:(u,p)=>{var g=dh(),h=xe(g),r=X(h),i=J(h,2),e=X(i);ss(e,{onclick:a,children:(P,O)=>{var A=He();oe(()=>se(A,L(E)?"Deselect all":"Select all")),G(P,A)},$$slots:{default:!0}});var s=J(e,2),d=X(s),m=J(i,2);Ke(m,21,()=>o.pr.comments,Yr,(P,O,A)=>{var F=hh(),H=X(F),W=X(H),j=J(W,2),K=X(j);{var y=D=>{var Y=lh(),z=X(Y),ie=J(z);{var Q=le=>{var _e=ah();G(le,_e)};ne(ie,le=>{L(O).isReply&&le(Q)})}oe(()=>{we(Y,"title",L(O).path),se(z,`${L(O).path??""}${L(O).line?`:${L(O).line}`:""} `)}),G(D,Y)};ne(K,D=>{L(O).type==="inline"&&D(y)})}var R=J(K,2),M=X(R),T=X(M),N=J(M),q=J(N);{var Z=D=>{var Y=ch();G(D,Y)};ne(q,D=>{L(O).type==="inline"&&D(Z)})}var re=J(R,2),I=X(re);oe((D,Y)=>{gi(W,D),se(T,`@${L(O).author??""}`),se(N,` · ${Y??""} `),se(I,L(O).body)},[()=>w.has(A),()=>L(O).createdAt.slice(0,10)]),me("change",W,()=>c(A)),G(P,F)});var S=J(m,2);{var C=P=>{var O=uh(),A=X(O);oe(()=>se(A,L(b))),G(P,O)};ne(S,P=>{L(b)&&P(C)})}var v=J(S,2),x=X(v);je(x,{type:"button",get onclick(){return o.onclose},children:(P,O)=>{var A=He("Cancel");G(P,A)},$$slots:{default:!0}});var B=J(x,2);{let P=ve(()=>L(n)||L(_));je(B,{variant:"cta",small:!0,get disabled(){return L(P)},onclick:l,children:(O,A)=>{var F=He();oe(()=>se(F,L(_)?"Sending...":`Send ${w.size} to agent`)),G(O,F)},$$slots:{default:!0}})}oe(()=>{se(r,`PR Comments — ${L(k)??""}`),se(d,`${w.size??""} of ${o.pr.comments.length??""} selected`)}),G(u,g)},$$slots:{default:!0}}),Ae()}lt(["change"]);var _h=ee('<button type="button"> </button>'),vh=ee('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function ph(t,o){Re(o,!0);var _=vh();Ke(_,21,()=>o.panes,b=>b.index,(b,w)=>{var k=_h(),E=X(k);oe(()=>{Be(k,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${o.activePane===L(w).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),se(E,L(w).label)}),me("click",k,()=>o.onselect(L(w).index)),G(b,k)}),G(t,_),Ae()}lt(["click"]);var gh=ee('<div class="toast svelte-1974bvt" role="alert"><button type="button" class="flex-1 flex items-center gap-2 text-left bg-transparent border-none text-inherit cursor-pointer p-0"><!></button> <button type="button" class="shrink-0 w-6 h-6 flex items-center justify-center text-muted hover:text-primary cursor-pointer bg-transparent border-none text-sm">&times;</button></div>'),mh=ee('<div class="fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm"></div>');function Sh(t,o){Re(o,!0);var _=Tt(),b=xe(_);{var w=k=>{var E=mh();Ke(E,21,()=>o.notifications,n=>n.id,(n,a)=>{var c=gh(),f=X(c),l=X(f);to(l,{get notification(){return L(a)},large:!0});var u=J(f,2);me("click",f,()=>{o.ondismiss(L(a).id),o.onselect(L(a).branch)}),me("click",u,()=>o.ondismiss(L(a).id)),G(n,c)}),G(k,E)};ne(b,k=>{o.notifications.length>0&&k(w)})}G(t,_),Ae()}lt(["click"]);var bh=ee('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),wh=ee('<li class="mb-1 p-2 rounded-md border border-transparent hover:bg-hover text-[12px] cursor-pointer" role="button" tabindex="0"><div class="flex items-center gap-1.5 mb-0.5"><span class="shrink-0 w-2 h-2 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-[11px] text-accent no-underline hover:underline"> </a> <span class="text-[10px] text-muted"> </span></div> <p class="truncate text-primary mb-1 m-0"> </p> <!> <div class="flex items-center justify-between gap-2"><span class="text-[10px] text-muted truncate"> <!></span> <span role="none"><!></span></div></li>'),Ch=ee('<div class="px-2 pb-1"><input type="text" placeholder="Search issues…" class="w-full px-2 py-1 text-xs rounded border border-edge bg-surface text-primary placeholder:text-muted outline-none focus:border-accent"/></div> <ul class="list-none overflow-y-auto max-h-64 px-2 pb-2"></ul>',1),yh=ee('<div class="border-t border-edge"><button type="button" class="w-full flex items-center justify-between px-4 py-2 text-xs text-muted cursor-pointer bg-transparent border-none hover:bg-hover"><span class="font-semibold"> </span> <span class="text-[10px]"> </span></button> <!></div>');function xh(t,o){Re(o,!0);let _=ae(!0),b=ae(""),w=ve(()=>L(b)?o.issues.filter(p=>qs(L(b),p.title)||(p.description?qs(L(b),p.description):!1)):o.issues);var k=yh(),E=X(k),n=X(E),a=X(n),c=J(n,2),f=X(c),l=J(E,2);{var u=p=>{var g=Ch(),h=xe(g),r=X(h),i=J(h,2);Ke(i,21,()=>L(w),e=>e.id,(e,s)=>{var d=wh(),m=X(d),S=X(m),C=J(S,2),v=X(C),x=J(C,2),B=X(x),P=J(m,2),O=X(P),A=J(P,2);{var F=T=>{var N=bh(),q=X(N);oe(()=>se(q,L(s).description)),G(T,N)};ne(A,T=>{L(s).description&&T(F)})}var H=J(A,2),W=X(H),j=X(W),K=J(j);{var y=T=>{var N=He();oe(()=>se(N,`· ${L(s).project??""}`)),G(T,N)};ne(K,T=>{L(s).project&&T(y)})}var R=J(W,2),M=X(R);je(M,{small:!0,variant:"accent-outline",onclick:()=>o.onassign(L(s)),children:(T,N)=>{var q=He("Implement");G(T,q)},$$slots:{default:!0}}),oe(()=>{Zr(S,`background: ${L(s).state.color??""};`),we(S,"title",L(s).state.name),we(C,"href",L(s).url),se(v,L(s).identifier),se(B,L(s).priorityLabel),se(O,L(s).title),se(j,L(s).team.key)}),me("click",d,()=>o.onselect(L(s))),me("keydown",d,T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),o.onselect(L(s)))}),me("click",C,T=>T.stopPropagation()),me("keydown",C,T=>T.stopPropagation()),me("click",R,T=>T.stopPropagation()),me("keydown",R,T=>{(T.key==="Enter"||T.key===" ")&&T.stopPropagation()}),G(e,d)}),Qr(r,()=>L(b),e=>V(b,e)),G(p,g)};ne(l,p=>{L(_)||p(u)})}oe(()=>{se(a,`Linear (${L(w).length!==o.issues.length?`${L(w).length}/`:""}${o.issues.length??""})`),se(f,L(_)?"▸":"▾")}),me("click",E,()=>V(_,!L(_))),G(t,k),Ae()}lt(["click","keydown"]);var Eh=ee('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),kh=ee('<p class="text-[13px] text-muted italic mb-4">No description</p>'),Lh=ee("<span> </span>"),Dh=ee('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),Rh=ee("<span> </span>"),Ah=ee('<div class="flex items-center gap-2 mb-1"><span class="shrink-0 w-2.5 h-2.5 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-xs text-accent no-underline hover:underline"> </a> <span class="text-[11px] text-muted"> </span> <span class="text-[11px] text-muted"> </span></div> <h2 class="text-base font-semibold mb-3"> </h2> <!> <div class="flex items-center gap-3 text-[11px] text-muted mb-4"><span> </span> <!> <!> <!></div> <div class="flex justify-end gap-2"><!> <!></div>',1);function Th(t,o){Re(o,!0),Wr(t,{get onclose(){return o.onclose},wide:!0,children:(_,b)=>{var w=Ah(),k=xe(w),E=X(k),n=J(E,2),a=X(n),c=J(n,2),f=X(c),l=J(c,2),u=X(l),p=J(k,2),g=X(p),h=J(p,2);{var r=F=>{var H=Eh(),W=X(H);oe(()=>se(W,o.issue.description)),G(F,H)},i=F=>{var H=kh();G(F,H)};ne(h,F=>{o.issue.description?F(r):F(i,-1)})}var e=J(h,2),s=X(e),d=X(s),m=J(s,2);{var S=F=>{var H=Lh(),W=X(H);oe(()=>se(W,`· ${o.issue.project??""}`)),G(F,H)};ne(m,F=>{o.issue.project&&F(S)})}var C=J(m,2);{var v=F=>{var H=Tt(),W=xe(H);Ke(W,17,()=>o.issue.labels,j=>j.name,(j,K)=>{var y=Dh(),R=X(y);oe(()=>{Zr(y,`color: ${L(K).color??""}; background: ${L(K).color??""}20;`),se(R,L(K).name)}),G(j,y)}),G(F,H)};ne(C,F=>{o.issue.labels.length>0&&F(v)})}var x=J(C,2);{var B=F=>{var H=Rh(),W=X(H);oe(()=>se(W,`Due ${o.issue.dueDate??""}`)),G(F,H)};ne(x,F=>{o.issue.dueDate&&F(B)})}var P=J(e,2),O=X(P);je(O,{get onclick(){return o.onclose},children:(F,H)=>{var W=He("Close");G(F,W)},$$slots:{default:!0}});var A=J(O,2);je(A,{variant:"accent-outline",onclick:()=>o.onassign(o.issue),children:(F,H)=>{var W=He("Implement");G(F,W)},$$slots:{default:!0}}),oe(()=>{Zr(E,`background: ${o.issue.state.color??""};`),we(E,"title",o.issue.state.name),we(n,"href",o.issue.url),se(a,o.issue.identifier),se(f,o.issue.state.name),se(u,`· ${o.issue.priorityLabel??""}`),se(g,o.issue.title),se(d,o.issue.team.key)}),G(_,w)},$$slots:{default:!0}}),Ae()}var Bh=ee('<div class="fixed inset-0 bg-black/50 z-40"></div>'),Mh=ee('<button class="h-8 w-8 rounded-md border border-edge bg-surface text-muted text-sm flex items-center justify-center cursor-pointer hover:bg-hover" title="Close sidebar">&times;</button>'),Ph=ee('<div class="shrink-0 border-t border-edge px-4 py-3 text-[11px] text-muted flex flex-col gap-1"><div class="flex justify-between"><span>Navigate</span><kbd class="opacity-60">Cmd+Up/Down</kbd></div> <div class="flex justify-between"><span>New worktree</span><kbd class="opacity-60">Cmd+K</kbd></div> <div class="flex justify-between"><span>Merge</span><kbd class="opacity-60">Cmd+M</kbd></div> <div class="flex justify-between"><span>Remove</span><kbd class="opacity-60">Cmd+D</kbd></div></div>'),Oh=ee('<!> <aside><div class="flex items-center justify-between p-4 border-b border-edge"><h1 class="text-base font-semibold"> </h1> <div class="flex items-center gap-2"><button class="h-8 px-2 gap-1.5 rounded-md border border-edge bg-surface text-accent text-xs flex items-center justify-center cursor-pointer hover:bg-hover disabled:opacity-50 disabled:cursor-not-allowed" title="New Worktree (Cmd+K)"><span class="text-lg leading-none">+</span> New</button> <!></div></div> <!> <!> <!></aside>',1),Ih=ee('<div class="flex-1 flex items-center justify-center text-muted text-sm"><p>Select a worktree from the sidebar to connect</p></div>'),Hh=ee('<div class="flex h-dvh bg-surface text-primary"><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!>',1);function Fh(t,o){Re(o,!0);let _=ae(ke({services:[],profiles:[],defaultProfileName:"",autoName:!1})),b=ae(ke([])),w=ae(null),k=ae(null),E=ae(null),n=ae(ke(new Set)),a=ae(!1),c=ae(!1),f=ae(null),l=ae(null),u=ae(!1),p=ae(ke(localStorage.getItem(vi)??"")),g=ae(ke([])),h=ae(null),r=ae(null),i=0;const e=3e5;let s=ae(ke([])),d=ae(ke([])),m=ae(0);const S=4e3,C=10;let v=ae(ke(new Set));function x($){V(s,[...L(s),$],!0),V(v,new Set([...L(v),$.branch]),!0),V(d,[$,...L(d)].slice(0,C),!0),Ea(m),setTimeout(()=>{V(s,L(s).filter(te=>te.id!==$.id),!0)},S),document.hidden&&Notification.permission==="granted"&&new Notification($.message,{body:$.url??$.branch,tag:`wm-${$.id}`})}function B($){L(d).some(te=>te.id===$.id)||V(d,[$,...L(d)].slice(0,C),!0)}function P($){V(s,L(s).filter(te=>te.id!==$),!0),Vc($).catch(()=>{})}function O($){V(s,L(s).filter(te=>te.id!==$),!0)}function A(){V(m,0)}let F=ae(!1),H=ae(!1),W=ae(0),j=ae(void 0);const K=200;let y=ae(ke(new Set)),R=ve(()=>L(b)),M=ve(()=>L(R).filter($=>!L(n).has($.branch))),T=ve(()=>L(w)&&!L(n).has(L(w))?L(R).find($=>$.branch===L(w)):void 0),N=ve(()=>{var $;return!!L(w)&&(($=L(T))==null?void 0:$.mux)==="✓"});pr(()=>{if(L(w)&&L(T))return;if(L(M).length===0){V(w,null);return}const $=L(M).find(te=>te.mux==="✓");V(w,($??L(M)[0]).branch,!0)}),pr(()=>{document.title=L(_).name?`${L(_).name} - Dashboard`:"Dev Dashboard"});let q=ve(()=>{var te;const $=((te=L(T))==null?void 0:te.paneCount)??0;return $<2?[]:Array.from({length:$},(ge,Te)=>({index:Te,label:String(Te+1)}))}),Z=ve(()=>L(F)&&L(N)&&L(q).length>0);function re(){const $=Date.now();$-i<e||(i=$,$c().then(te=>{V(g,te,!0)}).catch(te=>console.warn("[linear]",te)))}async function I(){try{V(b,await Fc(),!0)}catch($){console.error("Failed to refresh:",$)}re()}function D($){V(h,$,!0),V(a,!0)}async function Y($,te,ge,Te,Le){V(u,!0);try{const ut=await Nc($||void 0,te,ge,Te||void 0,Object.keys(Le).length>0?Le:void 0);V(a,!1),V(h,null),await I(),V(w,ut.branch,!0),L(F)&&V(H,!1)}catch(ut){alert(`Failed to create: ${zt(ut)}`)}finally{V(u,!1)}}function z($){if(L(w)!==$)return;const te=L(R).findIndex(Te=>Te.branch===$),ge=L(R)[te-1]??L(R)[te+1];V(w,ge?ge.branch:null,!0)}async function ie(){const $=L(k);if($){V(k,null),z($),V(n,new Set([...L(n),$]),!0);try{await Wc($),await I()}catch(te){alert(`Failed to remove: ${zt(te)}`)}finally{V(n,new Set([...L(n)].filter(te=>te!==$)),!0)}}}async function Q(){const $=L(E);if($){V(E,null),z($),V(n,new Set([...L(n),$]),!0);try{await zc($),await I()}catch(te){alert(`Failed to merge: ${zt(te)}`)}finally{V(n,new Set([...L(n)].filter(te=>te!==$)),!0)}}}async function le(){const $=L(w);if($){z($);try{await jc($),await I()}catch(te){alert(`Failed to close worktree: ${zt(te)}`)}}}function _e($){const te=L(R).filter(Le=>!L(n).has(Le.branch));if(te.length===0)return;if(!L(w)){V(w,te[$===1?0:te.length-1].branch,!0);return}const Te=te.findIndex(Le=>Le.branch===L(w))+$;Te>=0&&Te<te.length&&V(w,te[Te].branch,!0)}function Se($){L(a)||L(k)||L(E)||!($.metaKey||$.ctrlKey)||($.key==="ArrowUp"?($.preventDefault(),_e(-1)):$.key==="ArrowDown"?($.preventDefault(),_e(1)):$.key==="k"||$.key==="K"?($.preventDefault(),L(u)||V(a,!0)):$.key==="m"||$.key==="M"?($.preventDefault(),L(w)&&V(E,L(w),!0)):($.key==="d"||$.key==="D")&&($.preventDefault(),L(w)&&V(k,L(w),!0)))}function Pe($){var te;V(W,$,!0),(te=L(j))==null||te.sendSelectPane($)}ws(()=>{Pc().then(jr=>{V(_,jr,!0)}).catch(()=>{}),I(),re();let $=setInterval(I,5e3);window.addEventListener("keydown",Se);let te=qc(x,O,B);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});let ge,Te=!1;function Le(){Te&&(Te=!1,I(),$=setInterval(I,5e3)),clearTimeout(ge),ge=setTimeout(()=>{Te=!0,clearInterval($)},6e4)}document.addEventListener("click",Le),document.addEventListener("keydown",Le),Le();function ut(){document.hidden?clearInterval($):(Le(),I(),$=setInterval(I,5e3))}document.addEventListener("visibilitychange",ut);const Sr=window.matchMedia("(max-width: 768px)");V(F,Sr.matches,!0),L(F)&&V(H,!0);function li(jr){V(F,jr.matches,!0)}return Sr.addEventListener("change",li),()=>{clearInterval($),clearTimeout(ge),document.removeEventListener("click",Le),document.removeEventListener("keydown",Le),window.removeEventListener("keydown",Se),document.removeEventListener("visibilitychange",ut),Sr.removeEventListener("change",li),te()}});var ce=Hh(),wt=xe(ce),Ct=X(wt);{var Ut=$=>{var te=Oh(),ge=xe(te);{var Te=ye=>{var Je=Bh();me("click",Je,()=>V(H,!1)),me("keydown",Je,Pt=>{Pt.key==="Escape"&&V(H,!1)}),G(ye,Je)};ne(ge,ye=>{L(F)&&ye(Te)})}var Le=J(ge,2),ut=X(Le),Sr=X(ut),li=X(Sr),jr=J(Sr,2),Bi=X(jr),fo=J(Bi,2);{var _o=ye=>{var Je=Mh();me("click",Je,()=>V(H,!1)),G(ye,Je)};ne(fo,ye=>{L(F)&&ye(_o)})}var Ls=J(ut,2);Hl(Ls,{get worktrees(){return L(R)},get selected(){return L(w)},get removing(){return L(n)},get initializing(){return L(y)},get notifiedBranches(){return L(v)},onselect:async ye=>{V(w,ye,!0),V(v,new Set([...L(v)].filter(Pt=>Pt!==ye)),!0),L(F)&&V(H,!1);const Je=L(b).find(Pt=>Pt.branch===ye);if(Je&&Je.mux!=="✓"){V(y,new Set([...L(y),ye]),!0);try{await Uc(ye),await I()}catch(Pt){alert(`Failed to open worktree: ${zt(Pt)}`)}finally{V(y,new Set([...L(y)].filter(Pt=>Pt!==ye)),!0)}}},onremove:ye=>V(k,ye,!0)});var Ds=J(Ls,2);{var vo=ye=>{xh(ye,{get issues(){return L(g)},onassign:D,onselect:Je=>V(r,Je,!0)})};ne(Ds,ye=>{L(g).length>0&&ye(vo)})}var po=J(Ds,2);{var go=ye=>{var Je=Ph();G(ye,Je)};ne(po,ye=>{L(F)||ye(go)})}oe(()=>{Be(Le,1,`${L(F)?"fixed inset-0 z-50 w-full":"w-[220px] min-w-[220px]"} bg-sidebar border-r border-edge flex flex-col overflow-hidden`),se(li,L(_).name??"Dashboard"),Bi.disabled=L(u)}),me("click",Bi,()=>V(a,!0)),G($,te)};ne(Ct,$=>{(!L(F)||L(H))&&$(Ut)})}var Mt=J(Ct,2),yt=X(Mt);{let $=ve(()=>{var te;return((te=L(T))==null?void 0:te.branch)??null});ac(yt,{get name(){return L($)},get worktree(){return L(T)},get sshHost(){return L(p)},get isMobile(){return L(F)},get notificationHistory(){return L(d)},get unreadCount(){return L(m)},ontogglesidebar:()=>V(H,!L(H)),onclose:le,onmerge:()=>{L(w)&&V(E,L(w),!0)},onremove:()=>{L(w)&&V(k,L(w),!0)},onsettings:()=>V(c,!0),onciclick:te=>V(f,te,!0),onreviewsclick:te=>V(l,te,!0),onbellopen:A,onnotificationselect:te=>{V(w,te,!0),V(v,new Set([...L(v)].filter(ge=>ge!==te)),!0),L(F)&&V(H,!1)}})}var $e=J(yt,2);{var tr=$=>{var te=Tt(),ge=xe(te);tl(ge,()=>L(w),Te=>{{let Le=ve(()=>L(F)?L(W):void 0);Ai(vc(Te,{get worktree(){return L(w)},get isMobile(){return L(F)},get initialPane(){return L(Le)}}),ut=>V(j,ut,!0),()=>L(j))}}),G($,te)},tt=$=>{var te=Ih();G($,te)};ne($e,$=>{L(N)?$(tr):$(tt,-1)})}var rr=J($e,2);{var Ur=$=>{ph($,{get activePane(){return L(W)},get panes(){return L(q)},onselect:Pe})};ne(rr,$=>{L(Z)&&$(Ur)})}var ct=J(wt,2);{var mr=$=>{{let te=ve(()=>{var Le;return((Le=L(h))==null?void 0:Le.branchName)??""}),ge=ve(()=>L(h)?`${L(h).title}${L(h).description?`
31
+
32
+ `+L(h).description:""}`:""),Te=ve(()=>L(_).startupEnvs??{});Tc($,{get loading(){return L(u)},get profiles(){return L(_).profiles},get defaultProfileName(){return L(_).defaultProfileName},get autoNameEnabled(){return L(_).autoName},get initialBranch(){return L(te)},get initialPrompt(){return L(ge)},get startupEnvs(){return L(Te)},oncreate:Y,oncancel:()=>{V(a,!1),V(h,null)}})}};ne(ct,$=>{L(a)&&$(mr)})}var ht=J(ct,2);{var ir=$=>{{let te=ve(()=>`Remove worktree "${L(k)}"? This action cannot be undone.`);Js($,{get message(){return L(te)},onconfirm:ie,oncancel:()=>V(k,null)})}};ne(ht,$=>{L(k)&&$(ir)})}var be=J(ht,2);{var Ti=$=>{{let te=ve(()=>`Merge worktree "${L(E)}" into main? The worktree will be removed after merging.`);Js($,{get message(){return L(te)},confirmLabel:"Merge",variant:"accent",onconfirm:Q,oncancel:()=>V(E,null)})}};ne(be,$=>{L(E)&&$(Ti)})}var ys=J(be,2);{var ao=$=>{Mc($,{onsave:te=>{V(p,te,!0),V(c,!1)},onclose:()=>V(c,!1)})};ne(ys,$=>{L(c)&&$(ao)})}var xs=J(ys,2);{var lo=$=>{{let te=ve(()=>{var ge;return((ge=L(T))==null?void 0:ge.branch)??""});sh($,{get pr(){return L(f)},get branch(){return L(te)},onclose:()=>V(f,null),onfixsuccess:()=>{V(f,null),setTimeout(()=>{var ge;return(ge=L(j))==null?void 0:ge.sendInput("\r")},K)}})}};ne(xs,$=>{L(f)&&$(lo)})}var Es=J(xs,2);{var co=$=>{{let te=ve(()=>{var ge;return((ge=L(T))==null?void 0:ge.branch)??""});fh($,{get pr(){return L(l)},get branch(){return L(te)},onclose:()=>V(l,null),onsendsuccess:()=>{V(l,null),setTimeout(()=>{var ge;return(ge=L(j))==null?void 0:ge.sendInput("\r")},K)}})}};ne(Es,$=>{L(l)&&$(co)})}var ks=J(Es,2);{var ho=$=>{Th($,{get issue(){return L(r)},onassign:te=>{V(r,null),D(te)},onclose:()=>V(r,null)})};ne(ks,$=>{L(r)&&$(ho)})}var uo=J(ks,2);Sh(uo,{get notifications(){return L(s)},ondismiss:P,onselect:$=>{V(w,$,!0),V(v,new Set([...L(v)].filter(te=>te!==$)),!0),L(F)&&V(H,!1)}}),G(t,ce),Ae()}lt(["click","keydown"]);Ja(Fh,{target:document.getElementById("app")});