webmux 0.19.0 → 0.20.0
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.
- package/README.md +14 -3
- package/backend/dist/server.js +524 -199
- package/bin/webmux.js +383 -181
- package/frontend/dist/assets/{index-N_4ol4EP.css → index-DGNuO17V.css} +1 -1
- package/frontend/dist/assets/index-DrHGpNfR.js +149 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-CKvK6kRL.js +0 -148
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var al=Object.defineProperty;var Gn=t=>{throw TypeError(t)};var ll=(t,e,n)=>e in t?al(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var jt=(t,e,n)=>ll(t,typeof e!="symbol"?e+"":e,n),Ws=(t,e,n)=>e.has(t)||Gn("Cannot "+n);var X=(t,e,n)=>(Ws(t,e,"read from private field"),n?n.call(t):e.get(t)),ge=(t,e,n)=>e.has(t)?Gn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),be=(t,e,n,r)=>(Ws(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),$e=(t,e,n)=>(Ws(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const b of document.querySelectorAll('link[rel="modulepreload"]'))r(b);new MutationObserver(b=>{for(const k of b)if(k.type==="childList")for(const C of k.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&r(C)}).observe(document,{childList:!0,subtree:!0});function n(b){const k={};return b.integrity&&(k.integrity=b.integrity),b.referrerPolicy&&(k.referrerPolicy=b.referrerPolicy),b.crossOrigin==="use-credentials"?k.credentials="include":b.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function r(b){if(b.ep)return;b.ep=!0;const k=n(b);fetch(b.href,k)}})();const cl="5";var Ao;typeof window<"u"&&((Ao=window.__svelte??(window.__svelte={})).v??(Ao.v=new Set)).add(cl);const hl=1,ul=2,Oo=4,dl=8,fl=16,_l=1,vl=4,pl=8,gl=16,ml=1,bl=2,st=Symbol(),Po="http://www.w3.org/1999/xhtml",Sl="http://www.w3.org/2000/svg",wl="http://www.w3.org/1998/Math/MathML",yl="@attach",Cl=!1;var Cn=Array.isArray,xl=Array.prototype.indexOf,bi=Array.prototype.includes,gs=Array.from,El=Object.defineProperty,ci=Object.getOwnPropertyDescriptor,kl=Object.getOwnPropertyDescriptors,Ll=Object.prototype,Dl=Array.prototype,Io=Object.getPrototypeOf,Xn=Object.isExtensible;const Tl=()=>{};function Rl(t){for(var e=0;e<t.length;e++)t[e]()}function Ho(){var t,e,n=new Promise((r,b)=>{t=r,e=b});return{promise:n,resolve:t,reject:e}}const nt=2,Si=4,ms=8,xn=1<<24,Br=16,Gt=32,qr=64,en=128,It=512,rt=1024,ft=2048,nr=4096,Bt=8192,Ht=16384,Jr=32768,tn=1<<25,Vr=65536,Yn=1<<17,Al=1<<18,Ei=1<<19,Bl=1<<20,rr=1<<25,Gr=65536,rn=1<<21,En=1<<22,Lr=1<<23,Kr=Symbol("$state"),Ml=Symbol("legacy props"),Ol=Symbol(""),hr=new class extends Error{constructor(){super(...arguments);jt(this,"name","StaleReactionError");jt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Bo;const kn=!!((Bo=globalThis.document)!=null&&Bo.contentType)&&globalThis.document.contentType.includes("xml");function No(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Pl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Il(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Hl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Nl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Fl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Wl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ul(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function jl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Kl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function $l(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ql(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Vl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Fo(t){return t===this.v}function Gl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wo(t){return!Gl(t,this.v)}let Xl=!1,gt=null;function wi(t){gt=t}function Ve(t,e=!1,n){gt={p:gt,i:!1,c:null,e:null,s:t,x:null,r:Le,l:null}}function Ge(t){var e=gt,n=e.e;if(n!==null){e.e=null;for(var r of n)ha(r)}return t!==void 0&&(e.x=t),e.i=!0,gt=e.p,t??{}}function Uo(){return!0}let Ir=[];function jo(){var t=Ir;Ir=[],Rl(t)}function pr(t){if(Ir.length===0&&!Ni){var e=Ir;queueMicrotask(()=>{e===Ir&&jo()})}Ir.push(t)}function Yl(){for(;Ir.length>0;)jo()}function zo(t){var e=Le;if(e===null)return ye.f|=Lr,t;if((e.f&Jr)===0&&(e.f&Si)===0)throw t;kr(t,e)}function kr(t,e){for(;e!==null;){if((e.f&en)!==0){if((e.f&Jr)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Jl=-7169;function Ze(t,e){t.f=t.f&Jl|e}function Ln(t){(t.f&It)!==0||t.deps===null?Ze(t,rt):Ze(t,nr)}function Ko(t){if(t!==null)for(const e of t)(e.f&nt)===0||(e.f&Gr)===0||(e.f^=Gr,Ko(e.deps))}function $o(t,e,n){(t.f&ft)!==0?e.add(t):(t.f&nr)!==0&&n.add(t),Ko(t.deps),Ze(t,rt)}let ts=!1;function Zl(t){var e=ts;try{return ts=!1,[t(),ts]}finally{ts=e}}const Pr=new Set;let me=null,ct=null,sn=null,Ni=!1,Us=!1,li=null,ss=null;var Jn=0;let Ql=1;var di,fi,_i,vi,ji,Tt,Wr,ur,dr,pi,_t,nn,on,an,ln,qo;const ds=class ds{constructor(){ge(this,_t);jt(this,"id",Ql++);jt(this,"current",new Map);jt(this,"previous",new Map);ge(this,di,new Set);ge(this,fi,new Set);ge(this,_i,0);ge(this,vi,0);ge(this,ji,null);ge(this,Tt,[]);ge(this,Wr,new Set);ge(this,ur,new Set);ge(this,dr,new Map);jt(this,"is_fork",!1);ge(this,pi,!1)}skip_effect(e){X(this,dr).has(e)||X(this,dr).set(e,{d:[],m:[]})}unskip_effect(e){var n=X(this,dr).get(e);if(n){X(this,dr).delete(e);for(var r of n.d)Ze(r,ft),this.schedule(r);for(r of n.m)Ze(r,nr),this.schedule(r)}}capture(e,n){n!==st&&!this.previous.has(e)&&this.previous.set(e,n),(e.f&Lr)===0&&(this.current.set(e,e.v),ct==null||ct.set(e,e.v))}activate(){me=this}deactivate(){me=null,ct=null}flush(){try{Us=!0,me=this,$e(this,_t,on).call(this)}finally{Jn=0,sn=null,li=null,ss=null,Us=!1,me=null,ct=null,Dr.clear()}}discard(){for(const e of X(this,fi))e(this);X(this,fi).clear(),Pr.delete(this)}increment(e){be(this,_i,X(this,_i)+1),e&&be(this,vi,X(this,vi)+1)}decrement(e,n){be(this,_i,X(this,_i)-1),e&&be(this,vi,X(this,vi)-1),!(X(this,pi)||n)&&(be(this,pi,!0),pr(()=>{be(this,pi,!1),this.flush()}))}transfer_effects(e,n){for(const r of e)X(this,Wr).add(r);for(const r of n)X(this,ur).add(r);e.clear(),n.clear()}oncommit(e){X(this,di).add(e)}ondiscard(e){X(this,fi).add(e)}settled(){return(X(this,ji)??be(this,ji,Ho())).promise}static ensure(){if(me===null){const e=me=new ds;Us||(Pr.add(me),Ni||pr(()=>{me===e&&e.flush()}))}return me}apply(){{ct=null;return}}schedule(e){var b;if(sn=e,(b=e.b)!=null&&b.is_pending&&(e.f&(Si|ms|xn))!==0&&(e.f&Jr)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(li!==null&&n===Le&&(ye===null||(ye.f&nt)===0))return;if((r&(qr|Gt))!==0){if((r&rt)===0)return;n.f^=rt}}X(this,Tt).push(n)}};di=new WeakMap,fi=new WeakMap,_i=new WeakMap,vi=new WeakMap,ji=new WeakMap,Tt=new WeakMap,Wr=new WeakMap,ur=new WeakMap,dr=new WeakMap,pi=new WeakMap,_t=new WeakSet,nn=function(){return this.is_fork||X(this,vi)>0},on=function(){var o,c;if(Jn++>1e3&&(Pr.delete(this),tc()),!$e(this,_t,nn).call(this)){for(const h of X(this,Wr))X(this,ur).delete(h),Ze(h,ft),this.schedule(h);for(const h of X(this,ur))Ze(h,nr),this.schedule(h)}const e=X(this,Tt);be(this,Tt,[]),this.apply();var n=li=[],r=[],b=ss=[];for(const h of e)try{$e(this,_t,an).call(this,h,n,r)}catch(d){throw Yo(h),d}if(me=null,b.length>0){var k=ds.ensure();for(const h of b)k.schedule(h)}if(li=null,ss=null,$e(this,_t,nn).call(this)){$e(this,_t,ln).call(this,r),$e(this,_t,ln).call(this,n);for(const[h,d]of X(this,dr))Xo(h,d)}else{X(this,_i)===0&&Pr.delete(this),X(this,Wr).clear(),X(this,ur).clear();for(const h of X(this,di))h(this);X(this,di).clear(),Zn(r),Zn(n),(o=X(this,ji))==null||o.resolve()}var C=me;if(X(this,Tt).length>0){const h=C??(C=this);X(h,Tt).push(...X(this,Tt).filter(d=>!X(h,Tt).includes(d)))}C!==null&&(Pr.add(C),$e(c=C,_t,on).call(c)),Pr.has(this)||$e(this,_t,qo).call(this)},an=function(e,n,r){e.f^=rt;for(var b=e.first;b!==null;){var k=b.f,C=(k&(Gt|qr))!==0,o=C&&(k&rt)!==0,c=o||(k&Bt)!==0||X(this,dr).has(b);if(!c&&b.fn!==null){C?b.f^=rt:(k&Si)!==0?n.push(b):Yi(b)&&((k&Br)!==0&&X(this,ur).add(b),Ci(b));var h=b.first;if(h!==null){b=h;continue}}for(;b!==null;){var d=b.next;if(d!==null){b=d;break}b=b.parent}}},ln=function(e){for(var n=0;n<e.length;n+=1)$o(e[n],X(this,Wr),X(this,ur))},qo=function(){var c;for(const h of Pr){var e=h.id<this.id,n=[];for(const[d,u]of this.current){if(h.current.has(d))if(e&&u!==h.current.get(d))h.current.set(d,u);else continue;n.push(d)}var r=[...h.current.keys()].filter(d=>!this.current.has(d));if(r.length===0)e&&h.discard();else if(n.length>0){h.activate();var b=new Set,k=new Map;for(var C of n)Vo(C,r,b,k);if(X(h,Tt).length>0){h.apply();for(var o of X(h,Tt))$e(c=h,_t,an).call(c,o,[],[]);be(h,Tt,[])}h.deactivate()}}};let Xr=ds;function ec(t){var e=Ni;Ni=!0;try{for(var n;;){if(Yl(),me===null)return n;me.flush()}}finally{Ni=e}}function tc(){try{Wl()}catch(t){kr(t,sn)}}let zt=null;function Zn(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(Ht|Bt))===0&&Yi(r)&&(zt=new Set,Ci(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&_a(r),(zt==null?void 0:zt.size)>0)){Dr.clear();for(const b of zt){if((b.f&(Ht|Bt))!==0)continue;const k=[b];let C=b.parent;for(;C!==null;)zt.has(C)&&(zt.delete(C),k.push(C)),C=C.parent;for(let o=k.length-1;o>=0;o--){const c=k[o];(c.f&(Ht|Bt))===0&&Ci(c)}}zt.clear()}}zt=null}}function Vo(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const b of t.reactions){const k=b.f;(k&nt)!==0?Vo(b,e,n,r):(k&(En|Br))!==0&&(k&ft)===0&&Go(b,e,r)&&(Ze(b,ft),Dn(b))}}function Go(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const b of t.deps){if(bi.call(e,b))return!0;if((b.f&nt)!==0&&Go(b,e,n))return n.set(b,!0),!0}return n.set(t,!1),!1}function Dn(t){me.schedule(t)}function Xo(t,e){if(!((t.f&Gt)!==0&&(t.f&rt)!==0)){(t.f&ft)!==0?e.d.push(t):(t.f&nr)!==0&&e.m.push(t),Ze(t,rt);for(var n=t.first;n!==null;)Xo(n,e),n=n.next}}function Yo(t){Ze(t,rt);for(var e=t.first;e!==null;)Yo(e),e=e.next}function rc(t){let e=0,n=Rr(0),r;return()=>{Rn()&&(w(n),ws(()=>(e===0&&(r=br(()=>t(()=>Tr(n)))),e+=1,()=>{pr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,Tr(n))})})))}}var ic=Vr|Ei;function sc(t,e,n,r){new nc(t,e,n,r)}var Pt,yn,Zt,Ur,wt,Qt,Rt,Kt,fr,jr,xr,gi,zi,Ki,_r,fs,it,oc,ac,lc,cn,ns,os,hn;class nc{constructor(e,n,r,b){ge(this,it);jt(this,"parent");jt(this,"is_pending",!1);jt(this,"transform_error");ge(this,Pt);ge(this,yn,null);ge(this,Zt);ge(this,Ur);ge(this,wt);ge(this,Qt,null);ge(this,Rt,null);ge(this,Kt,null);ge(this,fr,null);ge(this,jr,0);ge(this,xr,0);ge(this,gi,!1);ge(this,zi,new Set);ge(this,Ki,new Set);ge(this,_r,null);ge(this,fs,rc(()=>(be(this,_r,Rr(X(this,jr))),()=>{be(this,_r,null)})));var k;be(this,Pt,e),be(this,Zt,n),be(this,Ur,C=>{var o=Le;o.b=this,o.f|=en,r(C)}),this.parent=Le.b,this.transform_error=b??((k=this.parent)==null?void 0:k.transform_error)??(C=>C),be(this,wt,Xi(()=>{$e(this,it,cn).call(this)},ic))}defer_effect(e){$o(e,X(this,zi),X(this,Ki))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!X(this,Zt).pending}update_pending_count(e,n){$e(this,it,hn).call(this,e,n),be(this,jr,X(this,jr)+e),!(!X(this,_r)||X(this,gi))&&(be(this,gi,!0),pr(()=>{be(this,gi,!1),X(this,_r)&&yi(X(this,_r),X(this,jr))}))}get_effect_pending(){return X(this,fs).call(this),w(X(this,_r))}error(e){var n=X(this,Zt).onerror;let r=X(this,Zt).failed;if(!n&&!r)throw e;X(this,Qt)&&(ht(X(this,Qt)),be(this,Qt,null)),X(this,Rt)&&(ht(X(this,Rt)),be(this,Rt,null)),X(this,Kt)&&(ht(X(this,Kt)),be(this,Kt,null));var b=!1,k=!1;const C=()=>{if(b){Vl();return}b=!0,k&&$l(),X(this,Kt)!==null&&$r(X(this,Kt),()=>{be(this,Kt,null)}),$e(this,it,os).call(this,()=>{$e(this,it,cn).call(this)})},o=c=>{try{k=!0,n==null||n(c,C),k=!1}catch(h){kr(h,X(this,wt)&&X(this,wt).parent)}r&&be(this,Kt,$e(this,it,os).call(this,()=>{try{return Ct(()=>{var h=Le;h.b=this,h.f|=en,r(X(this,Pt),()=>c,()=>C)})}catch(h){return kr(h,X(this,wt).parent),null}}))};pr(()=>{var c;try{c=this.transform_error(e)}catch(h){kr(h,X(this,wt)&&X(this,wt).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(o,h=>kr(h,X(this,wt)&&X(this,wt).parent)):o(c)})}}Pt=new WeakMap,yn=new WeakMap,Zt=new WeakMap,Ur=new WeakMap,wt=new WeakMap,Qt=new WeakMap,Rt=new WeakMap,Kt=new WeakMap,fr=new WeakMap,jr=new WeakMap,xr=new WeakMap,gi=new WeakMap,zi=new WeakMap,Ki=new WeakMap,_r=new WeakMap,fs=new WeakMap,it=new WeakSet,oc=function(){try{be(this,Qt,Ct(()=>X(this,Ur).call(this,X(this,Pt))))}catch(e){this.error(e)}},ac=function(e){const n=X(this,Zt).failed;n&&be(this,Kt,Ct(()=>{n(X(this,Pt),()=>e,()=>()=>{})}))},lc=function(){const e=X(this,Zt).pending;e&&(this.is_pending=!0,be(this,Rt,Ct(()=>e(X(this,Pt)))),pr(()=>{var n=be(this,fr,document.createDocumentFragment()),r=gr();n.append(r),be(this,Qt,$e(this,it,os).call(this,()=>Ct(()=>X(this,Ur).call(this,r)))),X(this,xr)===0&&(X(this,Pt).before(n),be(this,fr,null),$r(X(this,Rt),()=>{be(this,Rt,null)}),$e(this,it,ns).call(this,me))}))},cn=function(){try{if(this.is_pending=this.has_pending_snippet(),be(this,xr,0),be(this,jr,0),be(this,Qt,Ct(()=>{X(this,Ur).call(this,X(this,Pt))})),X(this,xr)>0){var e=be(this,fr,document.createDocumentFragment());On(X(this,Qt),e);const n=X(this,Zt).pending;be(this,Rt,Ct(()=>n(X(this,Pt))))}else $e(this,it,ns).call(this,me)}catch(n){this.error(n)}},ns=function(e){this.is_pending=!1,e.transfer_effects(X(this,zi),X(this,Ki))},os=function(e){var n=Le,r=ye,b=gt;or(X(this,wt)),Ft(X(this,wt)),wi(X(this,wt).ctx);try{return Xr.ensure(),e()}catch(k){return zo(k),null}finally{or(n),Ft(r),wi(b)}},hn=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&$e(r=this.parent,it,hn).call(r,e,n);return}be(this,xr,X(this,xr)+e),X(this,xr)===0&&($e(this,it,ns).call(this,n),X(this,Rt)&&$r(X(this,Rt),()=>{be(this,Rt,null)}),X(this,fr)&&(X(this,Pt).before(X(this,fr)),be(this,fr,null)))};function Jo(t,e,n,r){const b=bs;var k=t.filter(f=>!f.settled);if(n.length===0&&k.length===0){r(e.map(b));return}var C=Le,o=cc(),c=k.length===1?k[0].promise:k.length>1?Promise.all(k.map(f=>f.promise)):null;function h(f){o();try{r(f)}catch(_){(C.f&Ht)===0&&kr(_,C)}hs()}if(n.length===0){c.then(()=>h(e.map(b)));return}var d=Zo();function u(){Promise.all(n.map(f=>hc(f))).then(f=>h([...e.map(b),...f])).catch(f=>kr(f,C)).finally(()=>d())}c?c.then(()=>{o(),u(),hs()}):u()}function cc(){var t=Le,e=ye,n=gt,r=me;return function(k=!0){or(t),Ft(e),wi(n),k&&(t.f&Ht)===0&&(r==null||r.activate(),r==null||r.apply())}}function hs(t=!0){or(null),Ft(null),wi(null),t&&(me==null||me.deactivate())}function Zo(){var t=Le.b,e=me,n=t.is_rendered();return t.update_pending_count(1,e),e.increment(n),(r=!1)=>{t.update_pending_count(-1,e),e.decrement(n,r)}}function bs(t){var e=nt|ft,n=ye!==null&&(ye.f&nt)!==0?ye:null;return Le!==null&&(Le.f|=Ei),{ctx:gt,deps:null,effects:null,equals:Fo,f:e,fn:t,reactions:null,rv:0,v:st,wv:0,parent:n??Le,ac:null}}function hc(t,e,n){let r=Le;r===null&&Pl();var b=void 0,k=Rr(st),C=!ye,o=new Map;return Ec(()=>{var _;var c=Le,h=Ho();b=h.promise;try{Promise.resolve(t()).then(h.resolve,h.reject).finally(hs)}catch(m){h.reject(m),hs()}var d=me;if(C){if((c.f&Jr)!==0)var u=Zo();if(r.b.is_rendered())(_=o.get(d))==null||_.reject(hr),o.delete(d);else{for(const m of o.values())m.reject(hr);o.clear()}o.set(d,h)}const f=(m,v=void 0)=>{if(u){var s=v===hr;u(s)}if(!(v===hr||(c.f&Ht)!==0)){if(d.activate(),v)k.f|=Lr,yi(k,v);else{(k.f&Lr)!==0&&(k.f^=Lr),yi(k,m);for(const[a,i]of o){if(o.delete(a),a===d)break;i.reject(hr)}}d.deactivate()}};h.promise.then(f,m=>f(null,m||"unknown"))}),An(()=>{for(const c of o.values())c.reject(hr)}),new Promise(c=>{function h(d){function u(){d===b?c(k):h(b)}d.then(u,u)}h(b)})}function ue(t){const e=bs(t);return ga(e),e}function Qo(t){const e=bs(t);return e.equals=Wo,e}function uc(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)ht(e[n])}}function dc(t){for(var e=t.parent;e!==null;){if((e.f&nt)===0)return(e.f&Ht)===0?e:null;e=e.parent}return null}function Tn(t){var e,n=Le;or(dc(t));try{t.f&=~Gr,uc(t),e=wa(t)}finally{or(n)}return e}function ea(t){var e=t.v,n=Tn(t);if(!t.equals(n)&&(t.wv=ba(),(!(me!=null&&me.is_fork)||t.deps===null)&&(t.v=n,me==null||me.capture(t,e),t.deps===null))){Ze(t,rt);return}Ar||(ct!==null?(Rn()||me!=null&&me.is_fork)&&ct.set(t,n):Ln(t))}function fc(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort(hr),r.teardown=Tl,r.ac=null,Fi(r,0),Bn(r))}function ta(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&Ci(e)}let un=new Set;const Dr=new Map;let ra=!1;function Rr(t,e){var n={f:0,v:t,reactions:null,equals:Fo,rv:0,wv:0};return n}function ce(t,e){const n=Rr(t);return ga(n),n}function _c(t,e=!1,n=!0){const r=Rr(t);return e||(r.equals=Wo),r}function U(t,e,n=!1){ye!==null&&(!Vt||(ye.f&Yn)!==0)&&Uo()&&(ye.f&(nt|Br|En|Yn))!==0&&(Nt===null||!bi.call(Nt,t))&&Kl();let r=n?Ae(e):e;return yi(t,r,ss)}function yi(t,e,n=null){if(!t.equals(e)){var r=t.v;Ar?Dr.set(t,e):Dr.set(t,r),t.v=e;var b=Xr.ensure();if(b.capture(t,r),(t.f&nt)!==0){const k=t;(t.f&ft)!==0&&Tn(k),ct===null&&Ln(k)}t.wv=ba(),ia(t,ft,n),Le!==null&&(Le.f&rt)!==0&&(Le.f&(Gt|qr))===0&&(Ot===null?Lc([t]):Ot.push(t)),!b.is_fork&&un.size>0&&!ra&&vc()}return e}function vc(){ra=!1;for(const t of un)(t.f&rt)!==0&&Ze(t,nr),Yi(t)&&Ci(t);un.clear()}function pc(t,e=1){var n=w(t),r=e===1?n++:n--;return U(t,n),r}function Tr(t){U(t,t.v+1)}function ia(t,e,n){var r=t.reactions;if(r!==null)for(var b=r.length,k=0;k<b;k++){var C=r[k],o=C.f,c=(o&ft)===0;if(c&&Ze(C,e),(o&nt)!==0){var h=C;ct==null||ct.delete(h),(o&Gr)===0&&(o&It&&(C.f|=Gr),ia(h,nr,n))}else if(c){var d=C;(o&Br)!==0&&zt!==null&&zt.add(d),n!==null?n.push(d):Dn(d)}}}function Ae(t){if(typeof t!="object"||t===null||Kr in t)return t;const e=Io(t);if(e!==Ll&&e!==Dl)return t;var n=new Map,r=Cn(t),b=ce(0),k=mr,C=o=>{if(mr===k)return o();var c=ye,h=mr;Ft(null),ro(k);var d=o();return Ft(c),ro(h),d};return r&&n.set("length",ce(t.length)),new Proxy(t,{defineProperty(o,c,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&jl();var d=n.get(c);return d===void 0?C(()=>{var u=ce(h.value);return n.set(c,u),u}):U(d,h.value,!0),!0},deleteProperty(o,c){var h=n.get(c);if(h===void 0){if(c in o){const d=C(()=>ce(st));n.set(c,d),Tr(b)}}else U(h,st),Tr(b);return!0},get(o,c,h){var _;if(c===Kr)return t;var d=n.get(c),u=c in o;if(d===void 0&&(!u||(_=ci(o,c))!=null&&_.writable)&&(d=C(()=>{var m=Ae(u?o[c]:st),v=ce(m);return v}),n.set(c,d)),d!==void 0){var f=w(d);return f===st?void 0:f}return Reflect.get(o,c,h)},getOwnPropertyDescriptor(o,c){var h=Reflect.getOwnPropertyDescriptor(o,c);if(h&&"value"in h){var d=n.get(c);d&&(h.value=w(d))}else if(h===void 0){var u=n.get(c),f=u==null?void 0:u.v;if(u!==void 0&&f!==st)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return h},has(o,c){var f;if(c===Kr)return!0;var h=n.get(c),d=h!==void 0&&h.v!==st||Reflect.has(o,c);if(h!==void 0||Le!==null&&(!d||(f=ci(o,c))!=null&&f.writable)){h===void 0&&(h=C(()=>{var _=d?Ae(o[c]):st,m=ce(_);return m}),n.set(c,h));var u=w(h);if(u===st)return!1}return d},set(o,c,h,d){var l;var u=n.get(c),f=c in o;if(r&&c==="length")for(var _=h;_<u.v;_+=1){var m=n.get(_+"");m!==void 0?U(m,st):_ in o&&(m=C(()=>ce(st)),n.set(_+"",m))}if(u===void 0)(!f||(l=ci(o,c))!=null&&l.writable)&&(u=C(()=>ce(void 0)),U(u,Ae(h)),n.set(c,u));else{f=u.v!==st;var v=C(()=>Ae(h));U(u,v)}var s=Reflect.getOwnPropertyDescriptor(o,c);if(s!=null&&s.set&&s.set.call(d,h),!f){if(r&&typeof c=="string"){var a=n.get("length"),i=Number(c);Number.isInteger(i)&&i>=a.v&&U(a,i+1)}Tr(b)}return!0},ownKeys(o){w(b);var c=Reflect.ownKeys(o).filter(u=>{var f=n.get(u);return f===void 0||f.v!==st});for(var[h,d]of n)d.v!==st&&!(h in o)&&c.push(h);return c},setPrototypeOf(){zl()}})}function Qn(t){try{if(t!==null&&typeof t=="object"&&Kr in t)return t[Kr]}catch{}return t}function gc(t,e){return Object.is(Qn(t),Qn(e))}var dn,sa,na,oa;function mc(){if(dn===void 0){dn=window,sa=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;na=ci(e,"firstChild").get,oa=ci(e,"nextSibling").get,Xn(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Xn(n)&&(n.__t=void 0)}}function gr(t=""){return document.createTextNode(t)}function ir(t){return na.call(t)}function Vi(t){return oa.call(t)}function j(t,e){return ir(t)}function Pe(t,e=!1){{var n=ir(t);return n instanceof Comment&&n.data===""?Vi(n):n}}function G(t,e=1,n=!1){let r=t;for(;e--;)r=Vi(r);return r}function bc(t){t.textContent=""}function aa(){return!1}function la(t,e,n){return document.createElementNS(e??Po,t,void 0)}function Sc(t,e){if(e){const n=document.body;t.autofocus=!0,pr(()=>{document.activeElement===n&&t.focus()})}}let eo=!1;function wc(){eo||(eo=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function Ss(t){var e=ye,n=Le;Ft(null),or(null);try{return t()}finally{Ft(e),or(n)}}function ca(t,e,n,r=n){t.addEventListener(e,()=>Ss(n));const b=t.__on_r;b?t.__on_r=()=>{b(),r(!0)}:t.__on_r=()=>r(!0),wc()}function yc(t){Le===null&&(ye===null&&Fl(),Nl()),Ar&&Hl()}function Cc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function lr(t,e){var n=Le;n!==null&&(n.f&Bt)!==0&&(t|=Bt);var r={ctx:gt,deps:null,nodes:null,f:t|ft|It,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},b=r;if((t&Si)!==0)li!==null?li.push(r):Xr.ensure().schedule(r);else if(e!==null){try{Ci(r)}catch(C){throw ht(r),C}b.deps===null&&b.teardown===null&&b.nodes===null&&b.first===b.last&&(b.f&Ei)===0&&(b=b.first,(t&Br)!==0&&(t&Vr)!==0&&b!==null&&(b.f|=Vr))}if(b!==null&&(b.parent=n,n!==null&&Cc(b,n),ye!==null&&(ye.f&nt)!==0&&(t&qr)===0)){var k=ye;(k.effects??(k.effects=[])).push(b)}return r}function Rn(){return ye!==null&&!Vt}function An(t){const e=lr(ms,null);return Ze(e,rt),e.teardown=t,e}function pt(t){yc();var e=Le.f,n=!ye&&(e&Gt)!==0&&(e&Jr)===0;if(n){var r=gt;(r.e??(r.e=[])).push(t)}else return ha(t)}function ha(t){return lr(Si|Bl,t)}function xc(t){Xr.ensure();const e=lr(qr|Ei,t);return(n={})=>new Promise(r=>{n.outro?$r(e,()=>{ht(e),r(void 0)}):(ht(e),r(void 0))})}function Gi(t){return lr(Si,t)}function Ec(t){return lr(En|Ei,t)}function ws(t,e=0){return lr(ms|e,t)}function le(t,e=[],n=[],r=[]){Jo(r,e,n,b=>{lr(ms,()=>t(...b.map(w)))})}function Xi(t,e=0){var n=lr(Br|e,t);return n}function ua(t,e=0){var n=lr(xn|e,t);return n}function Ct(t){return lr(Gt|Ei,t)}function da(t){var e=t.teardown;if(e!==null){const n=Ar,r=ye;to(!0),Ft(null);try{e.call(null)}finally{to(n),Ft(r)}}}function Bn(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const b=n.ac;b!==null&&Ss(()=>{b.abort(hr)});var r=n.next;(n.f&qr)!==0?n.parent=null:ht(n,e),n=r}}function kc(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Gt)===0&&ht(e),e=n}}function ht(t,e=!0){var n=!1;(e||(t.f&Al)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(fa(t.nodes.start,t.nodes.end),n=!0),Ze(t,tn),Bn(t,e&&!n),Fi(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const k of r)k.stop();da(t),t.f^=tn,t.f|=Ht;var b=t.parent;b!==null&&b.first!==null&&_a(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function fa(t,e){for(;t!==null;){var n=t===e?null:Vi(t);t.remove(),t=n}}function _a(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function $r(t,e,n=!0){var r=[];va(t,r,!0);var b=()=>{n&&ht(t),e&&e()},k=r.length;if(k>0){var C=()=>--k||b();for(var o of r)o.out(C)}else b()}function va(t,e,n){if((t.f&Bt)===0){t.f^=Bt;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var b=t.first;b!==null;){var k=b.next,C=(b.f&Vr)!==0||(b.f&Gt)!==0&&(t.f&Br)!==0;va(b,e,C?n:!1),b=k}}}function Mn(t){pa(t,!0)}function pa(t,e){if((t.f&Bt)!==0){t.f^=Bt,(t.f&rt)===0&&(Ze(t,ft),Xr.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,b=(n.f&Vr)!==0||(n.f&Gt)!==0;pa(n,b?e:!1),n=r}var k=t.nodes&&t.nodes.t;if(k!==null)for(const C of k)(C.is_global||e)&&C.in()}}function On(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var b=n===r?null:Vi(n);e.append(n),n=b}}let as=!1,Ar=!1;function to(t){Ar=t}let ye=null,Vt=!1;function Ft(t){ye=t}let Le=null;function or(t){Le=t}let Nt=null;function ga(t){ye!==null&&(Nt===null?Nt=[t]:Nt.push(t))}let yt=null,Dt=0,Ot=null;function Lc(t){Ot=t}let ma=1,Hr=0,mr=Hr;function ro(t){mr=t}function ba(){return++ma}function Yi(t){var e=t.f;if((e&ft)!==0)return!0;if(e&nt&&(t.f&=~Gr),(e&nr)!==0){for(var n=t.deps,r=n.length,b=0;b<r;b++){var k=n[b];if(Yi(k)&&ea(k),k.wv>t.wv)return!0}(e&It)!==0&&ct===null&&Ze(t,rt)}return!1}function Sa(t,e,n=!0){var r=t.reactions;if(r!==null&&!(Nt!==null&&bi.call(Nt,t)))for(var b=0;b<r.length;b++){var k=r[b];(k.f&nt)!==0?Sa(k,e,!1):e===k&&(n?Ze(k,ft):(k.f&rt)!==0&&Ze(k,nr),Dn(k))}}function wa(t){var v;var e=yt,n=Dt,r=Ot,b=ye,k=Nt,C=gt,o=Vt,c=mr,h=t.f;yt=null,Dt=0,Ot=null,ye=(h&(Gt|qr))===0?t:null,Nt=null,wi(t.ctx),Vt=!1,mr=++Hr,t.ac!==null&&(Ss(()=>{t.ac.abort(hr)}),t.ac=null);try{t.f|=rn;var d=t.fn,u=d();t.f|=Jr;var f=t.deps,_=me==null?void 0:me.is_fork;if(yt!==null){var m;if(_||Fi(t,Dt),f!==null&&Dt>0)for(f.length=Dt+yt.length,m=0;m<yt.length;m++)f[Dt+m]=yt[m];else t.deps=f=yt;if(Rn()&&(t.f&It)!==0)for(m=Dt;m<f.length;m++)((v=f[m]).reactions??(v.reactions=[])).push(t)}else!_&&f!==null&&Dt<f.length&&(Fi(t,Dt),f.length=Dt);if(Uo()&&Ot!==null&&!Vt&&f!==null&&(t.f&(nt|nr|ft))===0)for(m=0;m<Ot.length;m++)Sa(Ot[m],t);if(b!==null&&b!==t){if(Hr++,b.deps!==null)for(let s=0;s<n;s+=1)b.deps[s].rv=Hr;if(e!==null)for(const s of e)s.rv=Hr;Ot!==null&&(r===null?r=Ot:r.push(...Ot))}return(t.f&Lr)!==0&&(t.f^=Lr),u}catch(s){return zo(s)}finally{t.f^=rn,yt=e,Dt=n,Ot=r,ye=b,Nt=k,wi(C),Vt=o,mr=c}}function Dc(t,e){let n=e.reactions;if(n!==null){var r=xl.call(n,t);if(r!==-1){var b=n.length-1;b===0?n=e.reactions=null:(n[r]=n[b],n.pop())}}if(n===null&&(e.f&nt)!==0&&(yt===null||!bi.call(yt,e))){var k=e;(k.f&It)!==0&&(k.f^=It,k.f&=~Gr),Ln(k),fc(k),Fi(k,0)}}function Fi(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)Dc(t,n[r])}function Ci(t){var e=t.f;if((e&Ht)===0){Ze(t,rt);var n=Le,r=as;Le=t,as=!0;try{(e&(Br|xn))!==0?kc(t):Bn(t),da(t);var b=wa(t);t.teardown=typeof b=="function"?b:null,t.wv=ma;var k;Cl&&Xl&&(t.f&ft)!==0&&t.deps}finally{as=r,Le=n}}}async function Tc(){await Promise.resolve(),ec()}function w(t){var e=t.f,n=(e&nt)!==0;if(ye!==null&&!Vt){var r=Le!==null&&(Le.f&Ht)!==0;if(!r&&(Nt===null||!bi.call(Nt,t))){var b=ye.deps;if((ye.f&rn)!==0)t.rv<Hr&&(t.rv=Hr,yt===null&&b!==null&&b[Dt]===t?Dt++:yt===null?yt=[t]:yt.push(t));else{(ye.deps??(ye.deps=[])).push(t);var k=t.reactions;k===null?t.reactions=[ye]:bi.call(k,ye)||k.push(ye)}}}if(Ar&&Dr.has(t))return Dr.get(t);if(n){var C=t;if(Ar){var o=C.v;return((C.f&rt)===0&&C.reactions!==null||Ca(C))&&(o=Tn(C)),Dr.set(C,o),o}var c=(C.f&It)===0&&!Vt&&ye!==null&&(as||(ye.f&It)!==0),h=(C.f&Jr)===0;Yi(C)&&(c&&(C.f|=It),ea(C)),c&&!h&&(ta(C),ya(C))}if(ct!=null&&ct.has(t))return ct.get(t);if((t.f&Lr)!==0)throw t.v;return t.v}function ya(t){if(t.f|=It,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&nt)!==0&&(e.f&It)===0&&(ta(e),ya(e))}function Ca(t){if(t.v===st)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Dr.has(e)||(e.f&nt)!==0&&Ca(e))return!0;return!1}function br(t){var e=Vt;try{return Vt=!0,t()}finally{Vt=e}}const Nr=Symbol("events"),xa=new Set,fn=new Set;function Ea(t,e,n,r={}){function b(k){if(r.capture||_n.call(e,k),!k.cancelBubble)return Ss(()=>n==null?void 0:n.call(this,k))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?pr(()=>{e.addEventListener(t,b,r)}):e.addEventListener(t,b,r),b}function vr(t,e,n,r,b){var k={capture:r,passive:b},C=Ea(t,e,n,k);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&An(()=>{e.removeEventListener(t,C,k)})}function pe(t,e,n){(e[Nr]??(e[Nr]={}))[t]=n}function xt(t){for(var e=0;e<t.length;e++)xa.add(t[e]);for(var n of fn)n(t)}let io=null;function _n(t){var s,a;var e=this,n=e.ownerDocument,r=t.type,b=((s=t.composedPath)==null?void 0:s.call(t))||[],k=b[0]||t.target;io=t;var C=0,o=io===t&&t[Nr];if(o){var c=b.indexOf(o);if(c!==-1&&(e===document||e===window)){t[Nr]=e;return}var h=b.indexOf(e);if(h===-1)return;c<=h&&(C=c)}if(k=b[C]||t.target,k!==e){El(t,"currentTarget",{configurable:!0,get(){return k||n}});var d=ye,u=Le;Ft(null),or(null);try{for(var f,_=[];k!==null;){var m=k.assignedSlot||k.parentNode||k.host||null;try{var v=(a=k[Nr])==null?void 0:a[r];v!=null&&(!k.disabled||t.target===k)&&v.call(k,t)}catch(i){f?_.push(i):f=i}if(t.cancelBubble||m===e||m===null)break;k=m}if(f){for(let i of _)queueMicrotask(()=>{throw i});throw f}}finally{t[Nr]=e,delete t.currentTarget,Ft(d),or(u)}}}var Mo;const js=((Mo=globalThis==null?void 0:globalThis.window)==null?void 0:Mo.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Rc(t){return(js==null?void 0:js.createHTML(t))??t}function ka(t){var e=la("template");return e.innerHTML=Rc(t.replaceAll("<!>","<!---->")),e.content}function Yr(t,e){var n=Le;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function Z(t,e){var n=(e&ml)!==0,r=(e&bl)!==0,b,k=!t.startsWith("<!>");return()=>{b===void 0&&(b=ka(k?t:"<!>"+t),n||(b=ir(b)));var C=r||sa?document.importNode(b,!0):b.cloneNode(!0);if(n){var o=ir(C),c=C.lastChild;Yr(o,c)}else Yr(C,C);return C}}function Ac(t,e,n="svg"){var r=!t.startsWith("<!>"),b=`<${n}>${r?t:"<!>"+t}</${n}>`,k;return()=>{if(!k){var C=ka(b),o=ir(C);k=ir(o)}var c=k.cloneNode(!0);return Yr(c,c),c}}function ys(t,e){return Ac(t,e,"svg")}function qe(t=""){{var e=gr(t+"");return Yr(e,e),e}}function mt(){var t=document.createDocumentFragment(),e=document.createComment(""),n=gr();return t.append(e,n),Yr(e,n),t}function q(t,e){t!==null&&t.before(e)}function Bc(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Mc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Oc(t){return Mc.includes(t)}const Pc={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 Ic(t){return t=t.toLowerCase(),Pc[t]??t}const Hc=["touchstart","touchmove"];function Nc(t){return Hc.includes(t)}function oe(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=`${n}`)}function Fc(t,e){return Wc(t,e)}const rs=new Map;function Wc(t,{target:e,anchor:n,props:r={},events:b,context:k,intro:C=!0,transformError:o}){mc();var c=void 0,h=xc(()=>{var d=n??e.appendChild(gr());sc(d,{pending:()=>{}},_=>{Ve({});var m=gt;k&&(m.c=k),b&&(r.$$events=b),c=t(_,r)||{},Ge()},o);var u=new Set,f=_=>{for(var m=0;m<_.length;m++){var v=_[m];if(!u.has(v)){u.add(v);var s=Nc(v);for(const l of[e,document]){var a=rs.get(l);a===void 0&&(a=new Map,rs.set(l,a));var i=a.get(v);i===void 0?(l.addEventListener(v,_n,{passive:s}),a.set(v,1)):a.set(v,i+1)}}}};return f(gs(xa)),fn.add(f),()=>{var s;for(var _ of u)for(const a of[e,document]){var m=rs.get(a),v=m.get(_);--v==0?(a.removeEventListener(_,_n),m.delete(_),m.size===0&&rs.delete(a)):m.set(_,v)}fn.delete(f),d!==n&&((s=d.parentNode)==null||s.removeChild(d))}});return Uc.set(c,h),c}let Uc=new WeakMap;var $t,er,At,zr,$i,qi,_s;class Pn{constructor(e,n=!0){jt(this,"anchor");ge(this,$t,new Map);ge(this,er,new Map);ge(this,At,new Map);ge(this,zr,new Set);ge(this,$i,!0);ge(this,qi,e=>{if(X(this,$t).has(e)){var n=X(this,$t).get(e),r=X(this,er).get(n);if(r)Mn(r),X(this,zr).delete(n);else{var b=X(this,At).get(n);b&&(X(this,er).set(n,b.effect),X(this,At).delete(n),b.fragment.lastChild.remove(),this.anchor.before(b.fragment),r=b.effect)}for(const[k,C]of X(this,$t)){if(X(this,$t).delete(k),k===e)break;const o=X(this,At).get(C);o&&(ht(o.effect),X(this,At).delete(C))}for(const[k,C]of X(this,er)){if(k===n||X(this,zr).has(k))continue;const o=()=>{if(Array.from(X(this,$t).values()).includes(k)){var h=document.createDocumentFragment();On(C,h),h.append(gr()),X(this,At).set(k,{effect:C,fragment:h})}else ht(C);X(this,zr).delete(k),X(this,er).delete(k)};X(this,$i)||!r?(X(this,zr).add(k),$r(C,o,!1)):o()}}});ge(this,_s,e=>{X(this,$t).delete(e);const n=Array.from(X(this,$t).values());for(const[r,b]of X(this,At))n.includes(r)||(ht(b.effect),X(this,At).delete(r))});this.anchor=e,be(this,$i,n)}ensure(e,n){var r=me,b=aa();if(n&&!X(this,er).has(e)&&!X(this,At).has(e))if(b){var k=document.createDocumentFragment(),C=gr();k.append(C),X(this,At).set(e,{effect:Ct(()=>n(C)),fragment:k})}else X(this,er).set(e,Ct(()=>n(this.anchor)));if(X(this,$t).set(r,e),b){for(const[o,c]of X(this,er))o===e?r.unskip_effect(c):r.skip_effect(c);for(const[o,c]of X(this,At))o===e?r.unskip_effect(c.effect):r.skip_effect(c.effect);r.oncommit(X(this,qi)),r.ondiscard(X(this,_s))}else X(this,qi).call(this,r)}}$t=new WeakMap,er=new WeakMap,At=new WeakMap,zr=new WeakMap,$i=new WeakMap,qi=new WeakMap,_s=new WeakMap;function In(t,e,...n){var r=new Pn(t);Xi(()=>{const b=e()??null;r.ensure(b,b&&(k=>b(k,...n)))},Vr)}function Hn(t){gt===null&&No(),pt(()=>{const e=br(t);if(typeof e=="function")return e})}function jc(t){gt===null&&No(),Hn(()=>()=>br(t))}function ne(t,e,n=!1){var r=new Pn(t),b=n?Vr:0;function k(C,o){r.ensure(C,o)}Xi(()=>{var C=!1;e((o,c=0)=>{C=!0,k(c,o)}),C||k(-1,null)},b)}const zc=Symbol("NaN");function Kc(t,e,n){var r=new Pn(t);Xi(()=>{var b=e();b!==b&&(b=zc),r.ensure(b,n)})}function Wi(t,e){return e}function $c(t,e,n){for(var r=[],b=e.length,k,C=e.length,o=0;o<b;o++){let u=e[o];$r(u,()=>{if(k){if(k.pending.delete(u),k.done.add(u),k.pending.size===0){var f=t.outrogroups;vn(t,gs(k.done)),f.delete(k),f.size===0&&(t.outrogroups=null)}}else C-=1},!1)}if(C===0){var c=r.length===0&&n!==null;if(c){var h=n,d=h.parentNode;bc(d),d.append(h),t.items.clear()}vn(t,e,!c)}else k={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(k)}function vn(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const C of t.pending.values())for(const o of C)r.add(t.items.get(o).e)}for(var b=0;b<e.length;b++){var k=e[b];if(r!=null&&r.has(k)){k.f|=rr;const C=document.createDocumentFragment();On(k,C)}else ht(e[b],n)}}var so;function Xe(t,e,n,r,b,k=null){var C=t,o=new Map,c=(e&Oo)!==0;if(c){var h=t;C=h.appendChild(gr())}var d=null,u=Qo(()=>{var l=n();return Cn(l)?l:l==null?[]:gs(l)}),f,_=new Map,m=!0;function v(l){(i.effect.f&Ht)===0&&(i.pending.delete(l),i.fallback=d,qc(i,f,C,e,r),d!==null&&(f.length===0?(d.f&rr)===0?Mn(d):(d.f^=rr,Hi(d,null,C)):$r(d,()=>{d=null})))}function s(l){i.pending.delete(l)}var a=Xi(()=>{f=w(u);for(var l=f.length,p=new Set,S=me,y=aa(),E=0;E<l;E+=1){var g=f[E],x=r(g,E),T=m?null:o.get(x);T?(T.v&&yi(T.v,g),T.i&&yi(T.i,E),y&&S.unskip_effect(T.e)):(T=Vc(o,m?C:so??(so=gr()),g,x,E,b,e,n),m||(T.e.f|=rr),o.set(x,T)),p.add(x)}if(l===0&&k&&!d&&(m?d=Ct(()=>k(C)):(d=Ct(()=>k(so??(so=gr()))),d.f|=rr)),l>p.size&&Il(),!m)if(_.set(S,p),y){for(const[B,P]of o)p.has(B)||S.skip_effect(P.e);S.oncommit(v),S.ondiscard(s)}else v(S);w(u)}),i={effect:a,items:o,pending:_,outrogroups:null,fallback:d};m=!1}function Bi(t){for(;t!==null&&(t.f&Gt)===0;)t=t.next;return t}function qc(t,e,n,r,b){var T,B,P,M,H,W,J,ee,Y;var k=(r&dl)!==0,C=e.length,o=t.items,c=Bi(t.effect.first),h,d=null,u,f=[],_=[],m,v,s,a;if(k)for(a=0;a<C;a+=1)m=e[a],v=b(m,a),s=o.get(v).e,(s.f&rr)===0&&((B=(T=s.nodes)==null?void 0:T.a)==null||B.measure(),(u??(u=new Set)).add(s));for(a=0;a<C;a+=1){if(m=e[a],v=b(m,a),s=o.get(v).e,t.outrogroups!==null)for(const L of t.outrogroups)L.pending.delete(s),L.done.delete(s);if((s.f&Bt)!==0&&(Mn(s),k&&((M=(P=s.nodes)==null?void 0:P.a)==null||M.unfix(),(u??(u=new Set)).delete(s))),(s.f&rr)!==0)if(s.f^=rr,s===c)Hi(s,null,n);else{var i=d?d.next:c;s===t.effect.last&&(t.effect.last=s.prev),s.prev&&(s.prev.next=s.next),s.next&&(s.next.prev=s.prev),yr(t,d,s),yr(t,s,i),Hi(s,i,n),d=s,f=[],_=[],c=Bi(d.next);continue}if(s!==c){if(h!==void 0&&h.has(s)){if(f.length<_.length){var l=_[0],p;d=l.prev;var S=f[0],y=f[f.length-1];for(p=0;p<f.length;p+=1)Hi(f[p],l,n);for(p=0;p<_.length;p+=1)h.delete(_[p]);yr(t,S.prev,y.next),yr(t,d,S),yr(t,y,l),c=l,d=y,a-=1,f=[],_=[]}else h.delete(s),Hi(s,c,n),yr(t,s.prev,s.next),yr(t,s,d===null?t.effect.first:d.next),yr(t,d,s),d=s;continue}for(f=[],_=[];c!==null&&c!==s;)(h??(h=new Set)).add(c),_.push(c),c=Bi(c.next);if(c===null)continue}(s.f&rr)===0&&f.push(s),d=s,c=Bi(s.next)}if(t.outrogroups!==null){for(const L of t.outrogroups)L.pending.size===0&&(vn(t,gs(L.done)),(H=t.outrogroups)==null||H.delete(L));t.outrogroups.size===0&&(t.outrogroups=null)}if(c!==null||h!==void 0){var E=[];if(h!==void 0)for(s of h)(s.f&Bt)===0&&E.push(s);for(;c!==null;)(c.f&Bt)===0&&c!==t.fallback&&E.push(c),c=Bi(c.next);var g=E.length;if(g>0){var x=(r&Oo)!==0&&C===0?n:null;if(k){for(a=0;a<g;a+=1)(J=(W=E[a].nodes)==null?void 0:W.a)==null||J.measure();for(a=0;a<g;a+=1)(Y=(ee=E[a].nodes)==null?void 0:ee.a)==null||Y.fix()}$c(t,E,x)}}k&&pr(()=>{var L,A;if(u!==void 0)for(s of u)(A=(L=s.nodes)==null?void 0:L.a)==null||A.apply()})}function Vc(t,e,n,r,b,k,C,o){var c=(C&hl)!==0?(C&fl)===0?_c(n,!1,!1):Rr(n):null,h=(C&ul)!==0?Rr(b):null;return{v:c,i:h,e:Ct(()=>(k(e,c??n,h??b,o),()=>{t.delete(r)}))}}function Hi(t,e,n){if(t.nodes)for(var r=t.nodes.start,b=t.nodes.end,k=e&&(e.f&rr)===0?e.nodes.start:n;r!==null;){var C=Vi(r);if(k.before(r),r===b)return;r=C}}function yr(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Gc(t,e,n=!1,r=!1,b=!1,k=!1){var C=t,o="";if(n)var c=t;le(()=>{var h=Le;if(o!==(o=e()??"")){if(n){h.nodes=null,c.innerHTML=o,o!==""&&Yr(ir(c),c.lastChild);return}if(h.nodes!==null&&(fa(h.nodes.start,h.nodes.end),h.nodes=null),o!==""){var d=r?Sl:b?wl:void 0,u=la(r?"svg":b?"math":"template",d);u.innerHTML=o;var f=r||b?u:u.content;if(Yr(ir(f),f.lastChild),r||b)for(;ir(f);)C.before(ir(f));else C.before(f)}}})}function Xc(t,e,n){Gi(()=>{var r=br(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function Yc(t,e){var n=void 0,r;ua(()=>{n!==(n=e())&&(r&&(ht(r),r=null),n&&(r=Ct(()=>{Gi(()=>n(t))})))})}function La(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var b=t.length;for(e=0;e<b;e++)t[e]&&(n=La(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Jc(){for(var t,e,n=0,r="",b=arguments.length;n<b;n++)(t=arguments[n])&&(e=La(t))&&(r&&(r+=" "),r+=e);return r}function Cs(t){return typeof t=="object"?Jc(t):t??""}const no=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Zc(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var b of Object.keys(n))if(n[b])r=r?r+" "+b:b;else if(r.length)for(var k=b.length,C=0;(C=r.indexOf(b,C))>=0;){var o=C+k;(C===0||no.includes(r[C-1]))&&(o===r.length||no.includes(r[o]))?r=(C===0?"":r.substring(0,C))+r.substring(o+1):C=o}}return r===""?null:r}function oo(t,e=!1){var n=e?" !important;":";",r="";for(var b of Object.keys(t)){var k=t[b];k!=null&&k!==""&&(r+=" "+b+": "+k+n)}return r}function zs(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Qc(t,e){if(e){var n="",r,b;if(Array.isArray(e)?(r=e[0],b=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var k=!1,C=0,o=!1,c=[];r&&c.push(...Object.keys(r).map(zs)),b&&c.push(...Object.keys(b).map(zs));var h=0,d=-1;const v=t.length;for(var u=0;u<v;u++){var f=t[u];if(o?f==="/"&&t[u-1]==="*"&&(o=!1):k?k===f&&(k=!1):f==="/"&&t[u+1]==="*"?o=!0:f==='"'||f==="'"?k=f:f==="("?C++:f===")"&&C--,!o&&k===!1&&C===0){if(f===":"&&d===-1)d=u;else if(f===";"||u===v-1){if(d!==-1){var _=zs(t.substring(h,d).trim());if(!c.includes(_)){f!==";"&&u++;var m=t.substring(h,u).trim();n+=" "+m+";"}}h=u+1,d=-1}}}}return r&&(n+=oo(r)),b&&(n+=oo(b,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Re(t,e,n,r,b,k){var C=t.__className;if(C!==n||C===void 0){var o=Zc(n,r,k);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t.__className=n}else if(k&&b!==k)for(var c in k){var h=!!k[c];(b==null||h!==!!b[c])&&t.classList.toggle(c,h)}return k}function Ks(t,e={},n,r){for(var b in n){var k=n[b];e[b]!==k&&(n[b]==null?t.style.removeProperty(b):t.style.setProperty(b,k,r))}}function ar(t,e,n,r){var b=t.__style;if(b!==e){var k=Qc(e,r);k==null?t.removeAttribute("style"):t.style.cssText=k,t.__style=e}else r&&(Array.isArray(r)?(Ks(t,n==null?void 0:n[0],r[0]),Ks(t,n==null?void 0:n[1],r[1],"important")):Ks(t,n,r));return r}function pn(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Cn(e))return ql();for(var r of t.options)r.selected=e.includes(ao(r));return}for(r of t.options){var b=ao(r);if(gc(b,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function eh(t){var e=new MutationObserver(()=>{pn(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),An(()=>{e.disconnect()})}function ao(t){return"__value"in t?t.__value:t.value}const Mi=Symbol("class"),Oi=Symbol("style"),Da=Symbol("is custom element"),Ta=Symbol("is html"),th=kn?"option":"OPTION",rh=kn?"select":"SELECT",ih=kn?"progress":"PROGRESS";function lo(t,e){var n=xs(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==ih)||(t.value=e??"")}function gn(t,e){var n=xs(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function sh(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function xe(t,e,n,r){var b=xs(t);b[e]!==(b[e]=n)&&(e==="loading"&&(t[Ol]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Aa(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function nh(t,e,n,r,b=!1,k=!1){var C=xs(t),o=C[Da],c=!C[Ta],h=e||{},d=t.nodeName===th;for(var u in e)u in n||(n[u]=null);n.class?n.class=Cs(n.class):n[Mi]&&(n.class=null),n[Oi]&&(n.style??(n.style=null));var f=Aa(t);for(const p in n){let S=n[p];if(d&&p==="value"&&S==null){t.value=t.__value="",h[p]=S;continue}if(p==="class"){var _=t.namespaceURI==="http://www.w3.org/1999/xhtml";Re(t,_,S,r,e==null?void 0:e[Mi],n[Mi]),h[p]=S,h[Mi]=n[Mi];continue}if(p==="style"){ar(t,S,e==null?void 0:e[Oi],n[Oi]),h[p]=S,h[Oi]=n[Oi];continue}var m=h[p];if(!(S===m&&!(S===void 0&&t.hasAttribute(p)))){h[p]=S;var v=p[0]+p[1];if(v!=="$$")if(v==="on"){const y={},E="$$"+p;let g=p.slice(2);var s=Oc(g);if(Bc(g)&&(g=g.slice(0,-7),y.capture=!0),!s&&m){if(S!=null)continue;t.removeEventListener(g,h[E],y),h[E]=null}if(s)pe(g,t,S),xt([g]);else if(S!=null){let x=function(T){h[p].call(this,T)};var l=x;h[E]=Ea(g,t,x,y)}}else if(p==="style")xe(t,p,S);else if(p==="autofocus")Sc(t,!!S);else if(!o&&(p==="__value"||p==="value"&&S!=null))t.value=t.__value=S;else if(p==="selected"&&d)sh(t,S);else{var a=p;c||(a=Ic(a));var i=a==="defaultValue"||a==="defaultChecked";if(S==null&&!o&&!i)if(C[p]=null,a==="value"||a==="checked"){let y=t;const E=e===void 0;if(a==="value"){let g=y.defaultValue;y.removeAttribute(a),y.defaultValue=g,y.value=y.__value=E?g:null}else{let g=y.defaultChecked;y.removeAttribute(a),y.defaultChecked=g,y.checked=E?g:!1}}else t.removeAttribute(p);else i||f.includes(a)&&(o||typeof S!="string")?(t[a]=S,a in C&&(C[a]=st)):typeof S!="function"&&xe(t,a,S)}}}return h}function Ra(t,e,n=[],r=[],b=[],k,C=!1,o=!1){Jo(b,n,r,c=>{var h=void 0,d={},u=t.nodeName===rh,f=!1;if(ua(()=>{var m=e(...c.map(w)),v=nh(t,h,m,k,C,o);f&&u&&"value"in m&&pn(t,m.value);for(let a of Object.getOwnPropertySymbols(d))m[a]||ht(d[a]);for(let a of Object.getOwnPropertySymbols(m)){var s=m[a];a.description===yl&&(!h||s!==h[a])&&(d[a]&&ht(d[a]),d[a]=Ct(()=>Yc(t,()=>s))),v[a]=s}h=v}),u){var _=t;Gi(()=>{pn(_,h.value,!0),eh(_)})}f=!0})}function xs(t){return t.__attributes??(t.__attributes={[Da]:t.nodeName.includes("-"),[Ta]:t.namespaceURI===Po})}var co=new Map;function Aa(t){var e=t.getAttribute("is")||t.nodeName,n=co.get(e);if(n)return n;co.set(e,n=[]);for(var r,b=t,k=Element.prototype;k!==b;){r=kl(b);for(var C in r)r[C].set&&n.push(C);b=Io(b)}return n}function Fr(t,e,n=e){var r=new WeakSet;ca(t,"input",async b=>{var k=b?t.defaultValue:t.value;if(k=$s(t)?qs(k):k,n(k),me!==null&&r.add(me),await Tc(),k!==(k=e())){var C=t.selectionStart,o=t.selectionEnd,c=t.value.length;if(t.value=k??"",o!==null){var h=t.value.length;C===o&&o===c&&h>c?(t.selectionStart=h,t.selectionEnd=h):(t.selectionStart=C,t.selectionEnd=Math.min(o,h))}}}),br(e)==null&&t.value&&(n($s(t)?qs(t.value):t.value),me!==null&&r.add(me)),ws(()=>{var b=e();if(t===document.activeElement){var k=me;if(r.has(k))return}$s(t)&&b===qs(t.value)||t.type==="date"&&!b&&!t.value||b!==t.value&&(t.value=b??"")})}function oh(t,e,n=e){ca(t,"change",r=>{var b=r?t.defaultChecked:t.checked;n(b)}),br(e)==null&&n(t.checked),ws(()=>{var r=e();t.checked=!!r})}function $s(t){var e=t.type;return e==="number"||e==="range"}function qs(t){return t===""?null:+t}function ho(t,e){return t===e||(t==null?void 0:t[Kr])===e}function Ui(t={},e,n,r){var b=gt.r,k=Le;return Gi(()=>{var C,o;return ws(()=>{C=o,o=[],br(()=>{t!==n(...o)&&(e(t,...o),C&&ho(n(...C),t)&&e(null,...C))})}),()=>{let c=k;for(;c!==b&&c.parent!==null&&c.parent.f&tn;)c=c.parent;const h=()=>{o&&ho(n(...o),t)&&e(null,...o)},d=c.teardown;c.teardown=()=>{h(),d==null||d()}}}),t}const ah={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Ba(t,e,n){return new Proxy({props:t,exclude:e},ah)}function Ce(t,e,n,r){var i;var b=(n&pl)!==0,k=(n&gl)!==0,C=r,o=!0,c=()=>(o&&(o=!1,C=k?br(r):r),C);let h;if(b){var d=Kr in t||Ml in t;h=((i=ci(t,e))==null?void 0:i.set)??(d&&e in t?l=>t[e]=l:void 0)}var u,f=!1;b?[u,f]=Zl(()=>t[e]):u=t[e],u===void 0&&r!==void 0&&(u=c(),h&&(Ul(),h(u)));var _;if(_=()=>{var l=t[e];return l===void 0?c():(o=!0,l)},(n&vl)===0)return _;if(h){var m=t.$$legacy;return(function(l,p){return arguments.length>0?((!p||m||f)&&h(p?_():l),l):_()})}var v=!1,s=((n&_l)!==0?bs:Qo)(()=>(v=!1,_()));b&&w(s);var a=Le;return(function(l,p){if(arguments.length>0){const S=p?w(s):b?Ae(l):l;return U(s,S),v=!0,C!==void 0&&(C=S),l}return Ar&&v||(a.f&Ht)!==0?s.v:w(s)})}const lh=["github-dark","dracula","nord","solarized-dark","one-dark"],mn=[{key:"github-dark",label:"GitHub Dark",colors:{surface:"#0d1117",sidebar:"#161b22",topbar:"#1c2128",hover:"#21262d",active:"#1f6feb33",edge:"#30363d",primary:"#e6edf3",muted:"#8b949e",accent:"#58a6ff",danger:"#f85149",success:"#3fb950",warning:"#d29922"},terminal:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"}},{key:"dracula",label:"Dracula",colors:{surface:"#282a36",sidebar:"#21222c",topbar:"#2d2f3f",hover:"#343746",active:"#bd93f933",edge:"#44475a",primary:"#f8f8f2",muted:"#6272a4",accent:"#bd93f9",danger:"#ff5555",success:"#50fa7b",warning:"#f1fa8c"},terminal:{background:"#282a36",foreground:"#f8f8f2",cursor:"#bd93f9",selectionBackground:"#44475a"}},{key:"nord",label:"Nord",colors:{surface:"#2e3440",sidebar:"#272c36",topbar:"#353b49",hover:"#3b4252",active:"#88c0d033",edge:"#4c566a",primary:"#eceff4",muted:"#81a1c1",accent:"#88c0d0",danger:"#bf616a",success:"#a3be8c",warning:"#ebcb8b"},terminal:{background:"#2e3440",foreground:"#eceff4",cursor:"#88c0d0",selectionBackground:"#434c5e"}},{key:"solarized-dark",label:"Solarized Dark",colors:{surface:"#002b36",sidebar:"#00222b",topbar:"#073642",hover:"#0a4050",active:"#268bd233",edge:"#2e5e6a",primary:"#fdf6e3",muted:"#839496",accent:"#268bd2",danger:"#dc322f",success:"#859900",warning:"#b58900"},terminal:{background:"#002b36",foreground:"#fdf6e3",cursor:"#268bd2",selectionBackground:"#073642"}},{key:"one-dark",label:"One Dark",colors:{surface:"#282c34",sidebar:"#21252b",topbar:"#2c323c",hover:"#333842",active:"#61afef33",edge:"#3e4452",primary:"#abb2bf",muted:"#636d83",accent:"#61afef",danger:"#e06c75",success:"#98c379",warning:"#e5c07b"},terminal:{background:"#282c34",foreground:"#abb2bf",cursor:"#61afef",selectionBackground:"#3e4452"}}];function Ma(t){return mn.find(e=>e.key===t)??mn[0]}const ls="wt-ssh-host",Oa="wt-theme",bn="wt-last-selected-worktree",Pa="wt-sidebar-width",ch=220;function Es(t){return t.repo?`${t.repo} #${t.number}`:`PR #${t.number}`}function hh(t){return t==="merged"?"text-merged":t==="closed"?"text-danger":"text-primary"}function uo(t){return t==="merged"?"bg-merged/20 text-merged":t==="closed"?"bg-danger/20 text-danger":t==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}function uh(t){return t==="failed"?"text-danger":t==="success"?"text-success":t==="pending"?"text-warning":"text-muted"}function dh(t){return t==="failed"?"bg-danger":t==="success"?"bg-success":t==="pending"?"bg-warning animate-pulse":"bg-muted"}function fh(t){if(t.ciChecks.length>0){if(t.ciStatus==="failed")return"border-danger/40 bg-danger/5";if(t.ciStatus==="pending")return"border-warning/40 bg-warning/5";if(t.ciStatus==="success")return"border-success/30 bg-success/5"}return t.state==="merged"?"border-merged/35 bg-merged/8":t.state==="closed"?"border-danger/35 bg-danger/5":"border-edge bg-surface"}function tr(t){return t instanceof Error?t.message:String(t)}function Sn(t,e){return e.toLowerCase().includes(t.toLowerCase())}function _h(){const t=localStorage.getItem(Oa);return t&&lh.includes(t)?t:"github-dark"}function vh(){var e;const t=(e=localStorage.getItem(bn))==null?void 0:e.trim();return t||null}function fo(t){if(t){localStorage.setItem(bn,t);return}localStorage.removeItem(bn)}function Ia(t){const e=Ma(t),n=document.documentElement;for(const[r,b]of Object.entries(e.colors))n.style.setProperty(`--color-${r}`,b);localStorage.setItem(Oa,t)}function ph(){const t=localStorage.getItem(Pa);if(t){const e=parseInt(t,10);if(!Number.isNaN(e)&&e>0)return e}return ch}function _o(t){localStorage.setItem(Pa,String(Math.round(t)))}function Ha(t){switch(t){case"creating_worktree":return"Creating worktree";case"preparing_runtime":return"Preparing runtime";case"running_post_create_hook":return"Running post-create hook";case"starting_session":return"Starting session";case"reconciling":return"Reconciling";default:return"Creating"}}function gh(t,e,n,r){return t&&e||!r?t:n.length===0?null:(n.find(k=>k.mux==="✓")??n[0]).branch}var mh=Z('<a target="_blank" rel="noopener"> </a>'),bh=Z("<span> </span>");function Sh(t,e){Ve(e,!0);let n=Ce(e,"clickable",3,!1),r=ue(()=>Es(e.pr));var b=mt(),k=Pe(b);{var C=c=>{var h=mh(),d=j(h);le(u=>{xe(h,"href",e.pr.url),Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),oe(d,w(r))},[()=>uo(e.pr.state)]),q(c,h)},o=c=>{var h=bh(),d=j(h);le(u=>{Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),oe(d,w(r))},[()=>uo(e.pr.state)]),q(c,h)};ne(k,c=>{n()&&e.pr.url?c(C):c(o,-1)})}q(t,b),Ge()}var wh=Z('<a target="_blank" rel="noopener noreferrer"> </a>'),yh=Z("<span> </span>");function Na(t,e){Ve(e,!0);const n="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full";let r=Ce(e,"clickable",3,!1),b=ue(()=>`color: ${e.issue.state.color}; background: ${e.issue.state.color}20;`),k=ue(()=>`${e.issue.identifier} (${e.issue.state.name})`);var C=mt(),o=Pe(C);{var c=d=>{var u=wh();Re(u,1,"shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80");var f=j(u);le(()=>{xe(u,"href",e.issue.url),ar(u,w(b)),xe(u,"title",w(k)),oe(f,e.issue.identifier)}),q(d,u)},h=d=>{var u=yh();Re(u,1,Cs(n));var f=j(u);le(()=>{ar(u,w(b)),xe(u,"title",w(k)),oe(f,e.issue.identifier)}),q(d,u)};ne(o,d=>{r()?d(c):d(h,-1)})}q(t,C),Ge()}var Ch=ys('<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>'),xh=ys('<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>'),Eh=ys('<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>'),kh=ys('<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>'),Lh=Z("<span><!> </span>");function Dh(t,e){const n=d=>{var u=mt(),f=Pe(u);{var _=a=>{var i=Ch();le(()=>{xe(i,"width",r()),xe(i,"height",r())}),q(a,i)},m=a=>{var i=xh();le(()=>{xe(i,"width",r()),xe(i,"height",r())}),q(a,i)},v=a=>{var i=Eh();le(()=>{xe(i,"width",r()),xe(i,"height",r())}),q(a,i)},s=a=>{var i=kh();le(()=>{xe(i,"width",r()),xe(i,"height",r())}),q(a,i)};ne(f,a=>{e.status==="working"?a(_):e.status==="waiting"?a(m,1):e.status==="done"?a(v,2):e.status==="error"&&a(s,3)})}q(d,u)};let r=Ce(e,"size",3,10),b=Ce(e,"pill",3,!1);function k(d){return d==="working"?"bg-success/15 text-success":d==="waiting"?"bg-warning/15 text-warning":d==="done"?"bg-success/15 text-success":d==="error"?"bg-danger/15 text-danger":"bg-hover text-muted"}var C=mt(),o=Pe(C);{var c=d=>{var u=Lh(),f=j(u);n(f);var _=G(f);le(m=>{Re(u,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${m??""}`),oe(_,` ${(e.status||"idle")??""}`)},[()=>k(e.status)]),q(d,u)},h=d=>{n(d)};ne(o,d=>{b()?d(c):d(h,-1)})}q(t,C)}var Th=Z('<span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </span>'),Rh=Z('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),Ah=Z('<span class="shrink-0 text-[10px] text-muted">closed</span>'),Bh=Z('<span class="shrink-0"><!></span>'),Mh=Z('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),Oh=Z("<span> </span>"),Ph=Z("<span> </span>"),Ih=Z("<span> </span>"),Hh=Z('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),Nh=Z('<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">×</button></li>'),Fh=Z('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function Wh(t,e){Ve(e,!0);var n=Fh();Xe(n,21,()=>e.worktrees,r=>r.branch,(r,b)=>{const k=ue(()=>w(b).branch===e.selected),C=ue(()=>e.removing.has(w(b).branch)),o=ue(()=>w(b).mux!=="✓"),c=ue(()=>e.initializing.has(w(b).branch)),h=ue(()=>w(b).creating),d=ue(()=>w(C)||w(c));var u=Nh(),f=j(u),_=j(f),m=j(_),v=j(m),s=j(v),a=G(v,2);{var i=A=>{var R=Th(),I=G(j(R));le(F=>oe(I,` ${F??""}...`),[()=>Ha(w(b).creationPhase)]),q(A,R)},l=A=>{var R=Rh();q(A,R)},p=A=>{var R=Ah();q(A,R)},S=A=>{var R=Bh(),I=j(R);Dh(I,{get status(){return w(b).agent},size:14}),q(A,R)};ne(a,A=>{w(h)?A(i):w(c)?A(l,1):w(o)?A(p,2):A(S,-1)})}var y=G(a,2);{var E=A=>{var R=Mh();q(A,R)},g=ue(()=>e.notifiedBranches.has(w(b).branch));ne(y,A=>{w(g)&&A(E)})}var x=G(m,2);Xe(x,17,()=>w(b).prs,A=>A.repo,(A,R)=>{Sh(A,{get pr(){return w(R)}})});var T=G(x,2);{var B=A=>{Na(A,{get issue(){return w(b).linearIssue},clickable:!1})};ne(T,A=>{w(b).linearIssue&&A(B)})}var P=G(_,2),M=j(P);{var H=A=>{var R=Oh(),I=j(R);le(()=>oe(I,w(b).agentName)),q(A,R)};ne(M,A=>{w(b).agentName&&A(H)})}var W=G(M,2);{var J=A=>{var R=Ph(),I=j(R);le(()=>oe(I,w(b).profile)),q(A,R)};ne(W,A=>{w(b).profile&&A(J)})}var ee=G(P,2);{var Y=A=>{var R=Hh();Xe(R,21,()=>w(b).services,Wi,(I,F)=>{var Q=mt(),ie=Pe(Q);{var he=N=>{var D=Ih(),K=j(D);le(()=>{Re(D,1,Cs(w(F).running?"text-success":"")),oe(K,`${w(F).name??""}:${w(F).port??""}`)}),q(N,D)};ne(ie,N=>{w(F).port&&N(he)})}q(I,Q)}),q(A,R)};ne(ee,A=>{w(b).services.length>0&&A(Y)})}var L=G(f,2);le(()=>{Re(u,1,`mb-0.5 group relative ${w(d)?"opacity-40 pointer-events-none":""}`),f.disabled=w(d),Re(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 ${w(k)?"bg-active border-accent":"border-transparent"} ${w(o)&&!w(c)&&!w(h)?"opacity-50":""}`),oe(s,w(b).branch),L.disabled=w(d)}),pe("click",f,()=>e.onselect(w(b).branch)),pe("click",L,A=>{A.stopPropagation(),e.onremove(w(b).branch)}),q(r,u)}),q(t,n),Ge()}xt(["click"]);var Uh=Z('<button type="button" title="View CI checks"><span></span> <span class="uppercase tracking-[0.08em] text-[9px]">CI</span></button>'),jh=Z('<button type="button" title="Review PR comments"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><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></svg> <span> </span></button>'),zh=Z('<div><a target="_blank" rel="noopener" title="Open PR"><span class="truncate"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17 17 7"></path><path d="M7 7h10v10"></path></svg></a> <!> <!></div>');function Kh(t,e){Ve(e,!0);let n=ue(()=>Es(e.pr)),r=ue(()=>e.pr.ciChecks.length>0),b=ue(()=>e.pr.comments.length>0);var k=zh(),C=j(k),o=j(C),c=j(o),h=G(C,2);{var d=_=>{var m=Uh(),v=j(m);le((s,a)=>{Re(m,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge ${s??""}`),xe(m,"aria-label",`View CI checks for ${w(n)}`),Re(v,1,`inline-block h-1.5 w-1.5 rounded-full ${a??""}`)},[()=>uh(e.pr.ciStatus),()=>dh(e.pr.ciStatus)]),pe("click",m,s=>{s.stopPropagation(),e.onCiClick(e.pr)}),q(_,m)};ne(h,_=>{w(r)&&_(d)})}var u=G(h,2);{var f=_=>{var m=jh();Re(m,1,"relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge text-accent");var v=G(j(m),2),s=j(v);le(()=>{xe(m,"aria-label",`Review ${e.pr.comments.length} comments for ${w(n)}`),oe(s,e.pr.comments.length)}),pe("click",m,a=>{a.stopPropagation(),e.onReviewsClick(e.pr)}),q(_,m)};ne(u,_=>{w(b)&&_(f)})}le((_,m)=>{Re(k,1,`shrink-0 inline-flex min-w-0 items-stretch overflow-hidden rounded-full border text-[10px] font-medium leading-none ${_??""}`),xe(C,"href",e.pr.url),Re(C,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent min-w-0 no-underline ${m??""}`),oe(c,w(n))},[()=>fh(e.pr),()=>hh(e.pr.state)]),q(t,k),Ge()}xt(["click"]);var $h=Z('<span class="shrink-0 text-[10px] font-medium text-muted"> </span>'),qh=Z('<a target="_blank" rel="noopener"> </a>'),Vh=Z('<a class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-medium no-underline hover:opacity-80" title="Open in Cursor">Cursor</a>'),Gh=Z('<div class="flex items-center gap-2 min-w-0"><!> <!> <!> <!></div>');function is(t,e){let n=Ce(e,"services",19,()=>[]),r=Ce(e,"cursorUrl",3,null);var b=Gh(),k=j(b);{var C=u=>{var f=$h(),_=j(f);le(()=>oe(_,`${e.label??""}:`)),q(u,f)};ne(k,u=>{e.label&&u(C)})}var o=G(k,2);Xe(o,17,()=>e.prs,u=>`${u.repo}#${u.number}`,(u,f)=>{Kh(u,{get pr(){return w(f)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})});var c=G(o,2);Xe(c,17,n,Wi,(u,f)=>{var _=mt(),m=Pe(_);{var v=s=>{var a=qh(),i=j(a);le(()=>{xe(a,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${w(f).port??""}`),Re(a,1,`shrink-0 text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${w(f).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),oe(i,`${w(f).name??""} :${w(f).port??""}`)}),q(s,a)};ne(m,s=>{w(f).port&&s(v)})}q(u,_)});var h=G(c,2);{var d=u=>{var f=Vh();le(()=>xe(f,"href",r())),q(u,f)};ne(h,u=>{r()&&u(d)})}q(t,b)}var Xh=Z("<button><!></button>");function ut(t,e){let n=Ce(e,"variant",3,"default"),r=Ce(e,"small",3,!1),b=Ce(e,"class",3,""),k=Ba(e,["$$slots","$$events","$$legacy","variant","small","class","children"]);const C={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},o={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 c=Xh();Ra(c,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${C[r()?"small":"normal"]??""} ${o[n()]??""} ${b()??""}`,...k}));var h=j(c);In(h,()=>e.children),q(t,c)}var Yh=Z('<span class="text-success">✓</span>'),Jh=Z('<span class="text-accent">☍</span>'),Zh=Z('<span class="text-[10px] text-muted"> </span>'),Qh=Z('<span class="text-xs text-accent truncate"> </span>'),eu=Z('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function Fa(t,e){Ve(e,!0);let n=Ce(e,"showTimestamp",3,!1),r=Ce(e,"large",3,!1);var b=eu(),k=Pe(b),C=j(k);{var o=v=>{var s=Yh();q(v,s)},c=v=>{var s=Jh();q(v,s)};ne(C,v=>{e.notification.type==="agent_stopped"?v(o):v(c,-1)})}var h=G(k,2),d=j(h),u=j(d),f=G(d,2);{var _=v=>{var s=Zh(),a=j(s);le(i=>oe(a,i),[()=>new Date(e.notification.timestamp).toLocaleTimeString()]),q(v,s)},m=v=>{var s=Qh(),a=j(s);le(()=>oe(a,e.notification.url)),q(v,s)};ne(f,v=>{n()?v(_):e.notification.url&&v(m,1)})}le(()=>{Re(k,1,`shrink-0 ${r()?"text-base":"text-sm"}`),Re(d,1,`${r()?"text-sm":"text-xs"} text-primary truncate`),oe(u,e.notification.message)}),q(t,b),Ge()}var tu=Z('<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>'),ru=Z('<button type="button" class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning bg-transparent cursor-pointer hover:bg-warning/10"> </button>'),iu=Z("<!> <!> <!>",1),su=Z('<div class="more-dropdown svelte-gwjq7z"><div class="flex flex-col gap-2 p-3"><!> <!></div></div>'),nu=Z('<div class="more-container relative"><button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="More info"><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"><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg></button> <!></div>'),ou=Z('<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>'),au=Z('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),lu=Z('<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>'),cu=Z('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),hu=Z('<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>'),uu=Z('<div class="flex items-stretch bg-topbar border-b border-edge min-h-12"><div class="flex-1 min-w-0 flex flex-col justify-center px-4 py-2.5 gap-1.5"><div class="flex items-center gap-3 min-w-0"><!> <span class="text-sm font-semibold truncate"> </span> <!> <!> <!></div> <!></div> <div class="shrink-0 flex gap-2 items-center px-4"><!> <!> <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> <button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Settings"><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="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></div>');function du(t,e){Ve(e,!0);let n=Ce(e,"linkedRepos",19,()=>[]),r=Ce(e,"isMobile",3,!1),b=Ce(e,"notificationHistory",19,()=>[]),k=Ce(e,"unreadCount",3,0),C=ce(!1),o=ce(!1);function c(){var D;U(C,!w(C)),w(C)&&((D=e.onbellopen)==null||D.call(e))}function h(D){const K=D.target;K.closest(".bell-container")||U(C,!1),K.closest(".more-container")||U(o,!1)}function d(D){return D?e.sshHost?`cursor://vscode-remote/ssh-remote+${e.sshHost}${D}`:`cursor://file${D}`:null}function u(D,K){return!D||D.length<=K?D:`${D.slice(0,K-3)}...`}let f=ue(()=>{var D;return d((D=e.worktree)==null?void 0:D.dir)}),_=ue(()=>u(e.name,30)),m=ue(()=>{var D;return(((D=e.worktree)==null?void 0:D.prs)??[]).filter(K=>!K.repo||!n().some(O=>O.alias===K.repo))}),v=ue(()=>n().map(D=>{var K;return{alias:D.alias,dir:D.dir,cursorUrl:d(D.dir&&e.name?`${D.dir}/${e.name}`:null),prs:(((K=e.worktree)==null?void 0:K.prs)??[]).filter(O=>O.repo===D.alias)}}).filter(D=>D.prs.length>0||D.cursorUrl)),s=ue(()=>w(m).length>0||w(v).length>0);var a=uu();vr("click",dn,h);var i=j(a),l=j(i),p=j(l);{var S=D=>{var K=tu();pe("click",K,function(...O){var V;(V=e.ontogglesidebar)==null||V.apply(this,O)}),q(D,K)};ne(p,D=>{r()&&e.ontogglesidebar&&D(S)})}var y=G(p,2),E=j(y),g=G(y,2);{var x=D=>{var K=ru(),O=j(K);le(()=>oe(O,e.worktree.dirty?"dirty":"unpushed")),pe("click",K,function(...V){var $;($=e.ondirtyclick)==null||$.apply(this,V)}),q(D,K)};ne(g,D=>{var K,O;((K=e.worktree)!=null&&K.dirty||(O=e.worktree)!=null&&O.unpushed)&&D(x)})}var T=G(g,2);{var B=D=>{Na(D,{get issue(){return e.worktree.linearIssue},clickable:!0})};ne(T,D=>{var K;(K=e.worktree)!=null&&K.linearIssue&&D(B)})}var P=G(T,2);{var M=D=>{{let K=ue(()=>{var O;return((O=e.worktree)==null?void 0:O.services)??[]});is(D,{get prs(){return w(m)},get services(){return w(K)},get cursorUrl(){return w(f)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}};ne(P,D=>{r()||D(M)})}var H=G(l,2);{var W=D=>{var K=mt(),O=Pe(K);Xe(O,17,()=>w(v),V=>V.alias,(V,$)=>{is(V,{get label(){return w($).alias},get prs(){return w($).prs},get cursorUrl(){return w($).cursorUrl},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(D,K)};ne(H,D=>{r()||D(W)})}var J=G(i,2),ee=j(J);{var Y=D=>{var K=iu(),O=Pe(K);{var V=se=>{ut(se,{variant:"default",get onclick(){return e.onclose},title:"Close worktree window",children:(de,ve)=>{var re=qe();le(()=>oe(re,r()?"C":"Close")),q(de,re)},$$slots:{default:!0}})};ne(O,se=>{e.worktree.mux==="✓"&&se(V)})}var $=G(O,2);ut($,{variant:"accent-outline",get onclick(){return e.onmerge},title:"Merge worktree",children:(se,de)=>{var ve=qe();le(()=>oe(ve,r()?"M":"Merge")),q(se,ve)},$$slots:{default:!0}});var ae=G($,2);ut(ae,{variant:"danger-outline",get onclick(){return e.onremove},title:"Remove worktree",children:(se,de)=>{var ve=qe();le(()=>oe(ve,r()?"R":"Remove")),q(se,ve)},$$slots:{default:!0}}),q(D,K)};ne(ee,D=>{e.worktree&&D(Y)})}var L=G(ee,2);{var A=D=>{var K=nu(),O=j(K),V=G(O,2);{var $=ae=>{var se=su(),de=j(se),ve=j(de);is(ve,{get prs(){return w(m)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}});var re=G(ve,2);Xe(re,17,()=>w(v),fe=>fe.alias,(fe,De)=>{is(fe,{get label(){return w(De).alias},get prs(){return w(De).prs},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(ae,se)};ne(V,ae=>{w(o)&&ae($)})}pe("keydown",K,()=>{}),pe("click",O,()=>{U(o,!w(o))}),q(D,K)};ne(L,D=>{r()&&e.worktree&&w(s)&&D(A)})}var R=G(L,2),I=j(R),F=G(j(I),2);{var Q=D=>{var K=ou(),O=j(K);le(()=>oe(O,k()>9?"9+":k())),q(D,K)};ne(F,D=>{k()>0&&D(Q)})}var ie=G(I,2);{var he=D=>{var K=hu(),O=G(j(K),2);{var V=ae=>{var se=au();q(ae,se)},$=ae=>{var se=cu();Xe(se,21,b,de=>de.id,(de,ve)=>{var re=lu(),fe=j(re),De=j(fe);Fa(De,{get notification(){return w(ve)},showTimestamp:!0}),pe("click",fe,()=>{var Ie;(Ie=e.onnotificationselect)==null||Ie.call(e,w(ve).branch),U(C,!1)}),q(de,re)}),q(ae,se)};ne(O,ae=>{b().length===0?ae(V):ae($,-1)})}q(D,K)};ne(ie,D=>{w(C)&&D(he)})}var N=G(R,2);le(()=>{xe(y,"title",e.name??void 0),oe(E,w(_)??"Select a worktree")}),pe("keydown",R,()=>{}),pe("click",I,c),pe("click",N,function(...D){var K;(K=e.onsettings)==null||K.apply(this,D)}),q(t,a),Ge()}xt(["click","keydown"]);var Vs={exports:{}},vo;function fu(){return vo||(vo=1,(function(t,e){(function(n,r){t.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(C,o,c){var h=this&&this.__decorate||function(i,l,p,S){var y,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,p,S);else for(var x=i.length-1;x>=0;x--)(y=i[x])&&(g=(E<3?y(g):E>3?y(l,p,g):y(l,p))||g);return E>3&&g&&Object.defineProperty(l,p,g),g},d=this&&this.__param||function(i,l){return function(p,S){l(p,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),f=c(9924),_=c(844),m=c(4725),v=c(2585),s=c(3656);let a=o.AccessibilityManager=class extends _.Disposable{constructor(i,l,p,S){super(),this._terminal=i,this._coreBrowserService=p,this._renderService=S,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,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 f.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((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
3
|
-
`)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,s.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(i){for(let l=0;l<i;l++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
4
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,l){this._liveRegionDebouncer.refresh(i,l,this._terminal.rows)}_renderRows(i,l){const p=this._terminal.buffer,S=p.lines.length.toString();for(let y=i;y<=l;y++){const E=p.lines.get(p.ydisp+y),g=[],x=(E==null?void 0:E.translateToString(!0,void 0,void 0,g))||"",T=(p.ydisp+y+1).toString(),B=this._rowElements[y];B&&(x.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=x,this._rowColumns.set(B,g)),B.setAttribute("aria-posinset",T),B.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,l){const p=i.target,S=this._rowElements[l===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==S)return;let y,E;if(l===0?(y=p,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(y=this._rowElements.shift(),E=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:i.anchorNode,offset:i.anchorOffset},p={node:i.focusNode,offset:i.focusOffset};if((l.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===p.node&&l.offset>p.offset)&&([l,p]=[p,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const S=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:S,offset:((x=S.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:B})=>{const P=T instanceof Text?T.parentNode:T;let M=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(P);if(!H)return console.warn("columns is null. Race condition?"),null;let W=B<H.length?H[B]:H.slice(-1)[0]+1;return W>=this._terminal.cols&&(++M,W=0),{row:M,column:W}},E=y(l),g=y(p);if(E&&g){if(E.row>g.row||E.row===g.row&&E.column>=g.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(g.row-E.row)*this._terminal.cols-E.column+g.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=a=h([d(1,v.IInstantiationService),d(2,m.ICoreBrowserService),d(3,m.IRenderService)],a)},3614:(C,o)=>{function c(f){return f.replace(/\r?\n/g,"\r")}function h(f,_){return _?"\x1B[200~"+f+"\x1B[201~":f}function d(f,_,m,v){f=h(f=c(f),m.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),m.triggerDataEvent(f,!0),_.value=""}function u(f,_,m){const v=m.getBoundingClientRect(),s=f.clientX-v.left-10,a=f.clientY-v.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${s}px`,_.style.top=`${a}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(f,_){f.clipboardData&&f.clipboardData.setData("text/plain",_.selectionText),f.preventDefault()},o.handlePasteEvent=function(f,_,m,v){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),_,m,v)},o.paste=d,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(f,_,m,v,s){u(f,_,m),s&&v.rightClickSelect(f),_.value=v.selectionText,_.select()}},7239:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(d,u,f){this._css.set(d,u,f)}getCss(d,u){return this._css.get(d,u)}setColor(d,u,f){this._color.set(d,u,f)}getColor(d,u){return this._color.get(d,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,d,u){c.addEventListener(h,d,u);let f=!1;return{dispose:()=>{f||(f=!0,c.removeEventListener(h,d,u))}}}},3551:function(C,o,c){var h=this&&this.__decorate||function(a,i,l,p){var S,y=arguments.length,E=y<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,p);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(y<3?S(E):y>3?S(i,l,E):S(i,l))||E);return y>3&&E&&Object.defineProperty(i,l,E),E},d=this&&this.__param||function(a,i){return function(l,p){i(l,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),f=c(8460),_=c(844),m=c(2585),v=c(4725);let s=o.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(a,i,l,p,S){super(),this._element=a,this._mouseService=i,this._renderService=l,this._bufferService=p,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const l=a.composedPath();for(let p=0;p<l.length;p++){const S=l[p];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,i){var p,S;this._activeProviderReplies&&i||((p=this._activeProviderReplies)==null||p.forEach((y=>{y==null||y.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let l=!1;for(const[y,E]of this._linkProviderService.linkProviders.entries())i?(S=this._activeProviderReplies)!=null&&S.get(y)&&(l=this._checkLinkProviderResult(y,a,l)):E.provideLinks(a.y,(g=>{var T,B;if(this._isMouseOut)return;const x=g==null?void 0:g.map((P=>({link:P})));(T=this._activeProviderReplies)==null||T.set(y,x),l=this._checkLinkProviderResult(y,a,l),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,i){const l=new Set;for(let p=0;p<i.size;p++){const S=i.get(p);if(S)for(let y=0;y<S.length;y++){const E=S[y],g=E.link.range.start.y<a?0:E.link.range.start.x,x=E.link.range.end.y>a?this._bufferService.cols:E.link.range.end.x;for(let T=g;T<=x;T++){if(l.has(T)){S.splice(y--,1);break}l.add(T)}}}}_checkLinkProviderResult(a,i,l){var y;if(!this._activeProviderReplies)return l;const p=this._activeProviderReplies.get(a);let S=!1;for(let E=0;E<a;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(S=!0);if(!S&&p){const E=p.find((g=>this._linkAtPosition(g.link,i)));E&&(l=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let E=0;E<this._activeProviderReplies.size;E++){const g=(y=this._activeProviderReplies.get(E))==null?void 0:y.find((x=>this._linkAtPosition(x.link,i)));if(g){l=!0,this._handleNewLink(g);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,i){this._currentLink&&this._lastMouseEvent&&(!a||!i||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(a.link,i)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var l,p;return(p=(l=this._currentLink)==null?void 0:l.state)==null?void 0:p.decorations.pointerCursor},set:l=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,p;return(p=(l=this._currentLink)==null?void 0:l.state)==null?void 0:p.decorations.underline},set:l=>{var p,S,y;(p=this._currentLink)!=null&&p.state&&((y=(S=this._currentLink)==null?void 0:S.state)==null?void 0:y.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const p=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(p,S),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(a,i,l){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(l,i.text)}_fireUnderlineEvent(a,i){const l=a.range,p=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-p-1,l.end.x,l.end.y-p-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(a,i,l){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(l,i.text)}_linkAtPosition(a,i){const l=a.range.start.y*this._bufferService.cols+a.range.start.x,p=a.range.end.y*this._bufferService.cols+a.range.end.x,S=i.y*this._bufferService.cols+i.x;return l<=S&&S<=p}_positionFromMouseEvent(a,i,l){const p=l.getCoords(a,i,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,i,l,p,S){return{x1:a,y1:i,x2:l,y2:p,cols:this._bufferService.cols,fg:S}}};o.Linkifier=s=h([d(1,v.IMouseService),d(2,v.IRenderService),d(3,m.IBufferService),d(4,v.ILinkProviderService)],s)},9042:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,o,c){var h=this&&this.__decorate||function(v,s,a,i){var l,p=arguments.length,S=p<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,s,a,i);else for(var y=v.length-1;y>=0;y--)(l=v[y])&&(S=(p<3?l(S):p>3?l(s,a,S):l(s,a))||S);return p>3&&S&&Object.defineProperty(s,a,S),S},d=this&&this.__param||function(v,s){return function(a,i){s(a,i,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),f=c(2585);let _=o.OscLinkProvider=class{constructor(v,s,a){this._bufferService=v,this._optionsService=s,this._oscLinkService=a}provideLinks(v,s){var x;const a=this._bufferService.buffer.lines.get(v-1);if(!a)return void s(void 0);const i=[],l=this._optionsService.rawOptions.linkHandler,p=new u.CellData,S=a.getTrimmedLength();let y=-1,E=-1,g=!1;for(let T=0;T<S;T++)if(E!==-1||a.hasContent(T)){if(a.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(E===-1){E=T,y=p.extended.urlId;continue}g=p.extended.urlId!==y}else E!==-1&&(g=!0);if(g||E!==-1&&T===S-1){const B=(x=this._oscLinkService.getLinkData(y))==null?void 0:x.uri;if(B){const P={start:{x:E+1,y:v},end:{x:T+(g||T!==S-1?0:1),y:v}};let M=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const H=new URL(B);["http:","https:"].includes(H.protocol)||(M=!0)}catch{M=!0}M||i.push({text:B,range:P,activate:(H,W)=>l?l.activate(H,W,P):m(0,W),hover:(H,W)=>{var J;return(J=l==null?void 0:l.hover)==null?void 0:J.call(l,H,W,P)},leave:(H,W)=>{var J;return(J=l==null?void 0:l.leave)==null?void 0:J.call(l,H,W,P)}})}g=!1,p.hasExtendedAttrs()&&p.extended.urlId?(E=T,y=p.extended.urlId):(E=-1,y=-1)}}s(i)}};function m(v,s){if(confirm(`Do you want to navigate to ${s}?
|
|
5
|
-
|
|
6
|
-
WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=_=h([d(0,f.IBufferService),d(1,f.IOptionsService),d(2,f.IOscLinkService)],_)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,d){this._rowCount=d,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),d=c(3656),u=c(3551),f=c(9042),_=c(3730),m=c(1680),v=c(3107),s=c(5744),a=c(2950),i=c(1296),l=c(428),p=c(4269),S=c(5114),y=c(8934),E=c(3230),g=c(9312),x=c(4725),T=c(6731),B=c(8055),P=c(8969),M=c(8460),H=c(844),W=c(6114),J=c(8437),ee=c(2584),Y=c(7399),L=c(5941),A=c(9074),R=c(2585),I=c(5435),F=c(4567),Q=c(779);class ie extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(N={}){super(N),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,K)=>this.refresh(D,K)))),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,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((D=>this._afterResize(D.cols,D.rows)))),this.register((0,H.toDisposable)((()=>{var D,K;this._customKeyEventHandler=void 0,(K=(D=this.element)==null?void 0:D.parentNode)==null||K.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(const D of N){let K,O="";switch(D.index){case 256:K="foreground",O="10";break;case 257:K="background",O="11";break;case 258:K="cursor",O="12";break;default:K="ansi",O="4;"+D.index}switch(D.type){case 0:const V=B.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${ee.C0.ESC}]${O};${(0,L.toRgbString)(V)}${ee.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(($=>$.ansi[D.index]=B.channels.toColor(...D.color)));else{const $=K;this._themeService.modifyColors((ae=>ae[$]=B.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(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var N;return(N=this.textarea)==null?void 0:N.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.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 N=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(N);if(!D)return;const K=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,V=D.getWidth(K),$=this._renderService.dimensions.css.cell.width*V,ae=this.buffer.y*this._renderService.dimensions.css.cell.height,se=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=$+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,h.copyHandler)(D,this._selectionService)})));const N=D=>(0,h.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,d.addDisposableDomListener)(this.element,"paste",N)),W.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,h.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,d.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){var K;if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.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"),N.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,d.addDisposableDomListener)(this.screenElement,"mousemove",(O=>this.updateCursorStyle(O)))),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",f.promptLabel),W.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(S.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",(O=>this._handleTextAreaFocus(O)))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((O=>this._onRender.fire(O)))),this.onResize((O=>this._renderService.resize(O.cols,O.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.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(m.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((O=>this.scrollLines(O.amount,O.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(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((O=>this.scrollLines(O.amount,O.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((O=>this._renderService.handleSelectionChanged(O.start,O.end,O.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((O=>{this.textarea.value=O,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((O=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(O=>this._selectionService.handleMouseDown(O)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(O=>this._handleScreenReaderModeOptionChange(O)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(O=>{!this._overviewRulerRenderer&&O&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const N=this,D=this.element;function K($){const ae=N._mouseService.getMouseReportCoords($,N.screenElement);if(!ae)return!1;let se,de;switch($.overrideType||$.type){case"mousemove":de=32,$.buttons===void 0?(se=3,$.button!==void 0&&(se=$.button<3?$.button:3)):se=1&$.buttons?0:4&$.buttons?1:2&$.buttons?2:3;break;case"mouseup":de=0,se=$.button<3?$.button:3;break;case"mousedown":de=1,se=$.button<3?$.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler($)===!1||N.viewport.getLinesScrolled($)===0)return!1;de=$.deltaY<0?0:1,se=4;break;default:return!1}return!(de===void 0||se===void 0||se>4)&&N.coreMouseService.triggerMouseEvent({col:ae.col,row:ae.row,x:ae.x,y:ae.y,button:se,action:de,ctrl:$.ctrlKey,alt:$.altKey,shift:$.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},V={mouseup:$=>(K($),$.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel($)),wheel:$=>(K($),this.cancel($,!0)),mousedrag:$=>{$.buttons&&K($)},mousemove:$=>{$.buttons||K($)}};this.register(this.coreMouseService.onProtocolChange(($=>{$?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents($)),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&$?O.mousemove||(D.addEventListener("mousemove",V.mousemove),O.mousemove=V.mousemove):(D.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&$?O.wheel||(D.addEventListener("wheel",V.wheel,{passive:!1}),O.wheel=V.wheel):(D.removeEventListener("wheel",O.wheel),O.wheel=null),2&$?O.mouseup||(O.mouseup=V.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&$?O.mousedrag||(O.mousedrag=V.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(D,"mousedown",($=>{if($.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection($))return K($),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel($)}))),this.register((0,d.addDisposableDomListener)(D,"wheel",($=>{if(!O.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler($)===!1)return!1;if(!this.buffer.hasScrollback){const ae=this.viewport.getLinesScrolled($);if(ae===0)return;const se=ee.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+($.deltaY<0?"A":"B");let de="";for(let ve=0;ve<Math.abs(ae);ve++)de+=se;return this.coreService.triggerDataEvent(de,!0),this.cancel($,!0)}return this.viewport.handleWheel($)?this.cancel($):void 0}}),{passive:!1})),this.register((0,d.addDisposableDomListener)(D,"touchstart",($=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart($),this.cancel($)}),{passive:!0})),this.register((0,d.addDisposableDomListener)(D,"touchmove",($=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove($)?void 0:this.cancel($)}),{passive:!1}))}refresh(N,D){var K;(K=this._renderService)==null||K.refreshRows(N,D)}updateCursorStyle(N){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(N)?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(N,D,K=0){var O;K===1?(super.scrollLines(N,D,K),this.refresh(0,this.rows-1)):(O=this.viewport)==null||O.scrollLines(N)}paste(N){(0,h.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,D,K){this._selectionService.setSelection(N,D,K)}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 N;(N=this._selectionService)==null||N.clearSelection()}selectAll(){var N;(N=this._selectionService)==null||N.selectAll()}selectLines(N,D){var K;(K=this._selectionService)==null||K.selectLines(N,D)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!D&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,Y.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),K.type===3||K.type===2){const O=this.rows-1;return this.scrollLines(K.type===2?-O:O),this.cancel(N,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(K.cancel&&this.cancel(N,!0),!K.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==ee.C0.ETX&&K.key!==ee.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,D){const K=N.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||N.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||N.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?K:K&&(!D.keyCode||D.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)D=N.charCode;else if(N.which===null||N.which===void 0)D=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;D=N.which}return!(!D||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=N.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(N),!0}return!1}resize(N,D){N!==this.cols||D!==this.rows?super.resize(N,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,D){var K,O;(K=this._charSizeService)==null||K.measure(),(O=this.viewport)==null||O.syncScrollArea(!0)}clear(){var N;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(J.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(N=this.viewport)==null||N.reset(),this.refresh(0,this.rows-1)}}reset(){var D,K;this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){var N;(N=this._renderService)==null||N.clearTextureAtlas()}_reportFocus(){var N;(N=this.element)!=null&&N.classList.contains("focus")?this.coreService.triggerDataEvent(ee.C0.ESC+"[I"):this.coreService.triggerDataEvent(ee.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[4;${K};${D}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),V=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[6;${V};${O}t`)}}cancel(N,D){if(this.options.cancelEvents||D)return N.preventDefault(),N.stopPropagation(),!1}}o.Terminal=ie},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,d){this._rowCount=d,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=u-this._lastRefreshMs,_=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(C,o,c){var h=this&&this.__decorate||function(a,i,l,p){var S,y=arguments.length,E=y<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,p);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(y<3?S(E):y>3?S(i,l,E):S(i,l))||E);return y>3&&E&&Object.defineProperty(i,l,E),E},d=this&&this.__param||function(a,i){return function(l,p){i(l,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),f=c(4725),_=c(8460),m=c(844),v=c(2585);let s=o.Viewport=class extends m.Disposable{constructor(a,i,l,p,S,y,E,g){super(),this._viewportElement=a,this._scrollArea=i,this._bufferService=l,this._optionsService=p,this._charSizeService=S,this._renderService=y,this._coreBrowserService=E,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.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(g.colors),this.register(g.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.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(a){if(a)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 i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){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 i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<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(a,i){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&l<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const i=this._getPixelsScrolled(a);return i!==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+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(a,i){var g;let l,p="";const S=[],y=i??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let x=a;x<y;x++){const T=E.get(x);if(!T)continue;const B=(g=E.get(x+1))==null?void 0:g.isWrapped;if(p+=T.translateToString(!B),!B||x===E.length-1){const P=document.createElement("div");P.textContent=p,S.push(P),p.length>0&&(l=P),p=""}}return{bufferElements:S,cursorElement:l}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(a,i){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&i.altKey||l==="ctrl"&&i.ctrlKey||l==="shift"&&i.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const i=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}};o.Viewport=s=h([d(2,v.IBufferService),d(3,v.IOptionsService),d(4,f.ICharSizeService),d(5,f.IRenderService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],s)},3107:function(C,o,c){var h=this&&this.__decorate||function(v,s,a,i){var l,p=arguments.length,S=p<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,s,a,i);else for(var y=v.length-1;y>=0;y--)(l=v[y])&&(S=(p<3?l(S):p>3?l(s,a,S):l(s,a))||S);return p>3&&S&&Object.defineProperty(s,a,S),S},d=this&&this.__param||function(v,s){return function(a,i){s(a,i,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),f=c(844),_=c(2585);let m=o.BufferDecorationRenderer=class extends f.Disposable{constructor(v,s,a,i,l){super(),this._screenElement=v,this._bufferService=s,this._coreBrowserService=a,this._decorationService=i,this._renderService=l,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((p=>this._removeDecoration(p)))),this.register((0,f.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var i;const s=this._coreBrowserService.mainDocument.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer",((i=v==null?void 0:v.options)==null?void 0:i.layer)==="top"),s.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",s.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=v.options.x??0;return a&&a>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(v,s),s}_refreshStyle(v){const s=v.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let a=this._decorationElements.get(v);a||(a=this._createElement(v),v.element=a,this._decorationElements.set(v,a),this._container.appendChild(a),v.onDispose((()=>{this._decorationElements.delete(v),a.remove()}))),a.style.top=s*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(a)}}_refreshXPosition(v,s=v.element){if(!s)return;const a=v.options.x??0;(v.options.anchor||"left")==="right"?s.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var s;(s=this._decorationElements.get(v))==null||s.remove(),this._decorationElements.delete(v),v.dispose()}};o.BufferDecorationRenderer=m=h([d(1,_.IBufferService),d(2,u.ICoreBrowserService),d(3,_.IDecorationService),d(4,u.IRenderService)],m)},5871:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,d){return h>=c.startBufferLine-this._linePadding[d||"full"]&&h<=c.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(C,o,c){var h=this&&this.__decorate||function(l,p,S,y){var E,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,p,S,y);else for(var T=l.length-1;T>=0;T--)(E=l[T])&&(x=(g<3?E(x):g>3?E(p,S,x):E(p,S))||x);return g>3&&x&&Object.defineProperty(p,S,x),x},d=this&&this.__param||function(l,p){return function(S,y){p(S,y,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),f=c(4725),_=c(844),m=c(2585),v={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let i=o.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,p,S,y,E,g,x){var B;super(),this._viewportElement=l,this._screenElement=p,this._bufferService=S,this._decorationService=y,this._renderService=E,this._optionsService=g,this._coreBrowserService=x,this._colorZoneStore=new u.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(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const l=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=l,s.center=p,s.right=l,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=s.left,a.right=s.left+s.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);v.left=p,v.center=p,v.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const p of l)p.position!=="full"&&this._renderColorZone(p);for(const p of l)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(a[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-v[l.position||"full"]/2),s[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[l.position||"full"]))}_queueRefresh(l,p){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=i=h([d(2,m.IBufferService),d(3,m.IDecorationService),d(4,f.IRenderService),d(5,m.IOptionsService),d(6,f.ICoreBrowserService)],i)},2950:function(C,o,c){var h=this&&this.__decorate||function(v,s,a,i){var l,p=arguments.length,S=p<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,s,a,i);else for(var y=v.length-1;y>=0;y--)(l=v[y])&&(S=(p<3?l(S):p>3?l(s,a,S):l(s,a))||S);return p>3&&S&&Object.defineProperty(s,a,S),S},d=this&&this.__param||function(v,s){return function(a,i){s(a,i,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),f=c(2585),_=c(2584);let m=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,s,a,i,l,p){this._textarea=v,this._compositionView=s,this._bufferService=a,this._optionsService=i,this._coreService=l,this._renderService=p,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const s={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,s.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(s.start,s.end):this._textarea.value.substring(s.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const s=this._textarea.value,a=s.replace(v,"");this._dataAlreadySent=a,s.length>v.length?this._coreService.triggerDataEvent(a,!0):s.length<v.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):s.length===v.length&&s!==v&&this._coreService.triggerDataEvent(s,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=s*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=m=h([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,u.IRenderService)],m)},9806:(C,o)=>{function c(h,d,u){const f=u.getBoundingClientRect(),_=h.getComputedStyle(u),m=parseInt(_.getPropertyValue("padding-left")),v=parseInt(_.getPropertyValue("padding-top"));return[d.clientX-f.left-m,d.clientY-f.top-v]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,d,u,f,_,m,v,s,a){if(!m)return;const i=c(h,d,u);return i?(i[0]=Math.ceil((i[0]+(a?v/2:0))/v),i[1]=Math.ceil(i[1]/s),i[0]=Math.min(Math.max(i[0],1),f+(a?1:0)),i[1]=Math.min(Math.max(i[1],1),_),i):void 0}},9504:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function d(s,a,i,l){const p=s-u(s,i),S=a-u(a,i),y=Math.abs(p-S)-(function(E,g,x){let T=0;const B=E-u(E,x),P=g-u(g,x);for(let M=0;M<Math.abs(B-P);M++){const H=f(E,g)==="A"?-1:1,W=x.buffer.lines.get(B+H*M);W!=null&&W.isWrapped&&T++}return T})(s,a,i);return v(y,m(f(s,a),l))}function u(s,a){let i=0,l=a.buffer.lines.get(s),p=l==null?void 0:l.isWrapped;for(;p&&s>=0&&s<a.rows;)i++,l=a.buffer.lines.get(--s),p=l==null?void 0:l.isWrapped;return i}function f(s,a){return s>a?"A":"B"}function _(s,a,i,l,p,S){let y=s,E=a,g="";for(;y!==i||E!==l;)y+=p?1:-1,p&&y>S.cols-1?(g+=S.buffer.translateBufferLineToString(E,!1,s,y),y=0,s=0,E++):!p&&y<0&&(g+=S.buffer.translateBufferLineToString(E,!1,0,s+1),y=S.cols-1,s=y,E--);return g+S.buffer.translateBufferLineToString(E,!1,s,y)}function m(s,a){const i=a?"O":"[";return h.C0.ESC+i+s}function v(s,a){s=Math.floor(s);let i="";for(let l=0;l<s;l++)i+=a;return i}o.moveToCellSequence=function(s,a,i,l){const p=i.buffer.x,S=i.buffer.y;if(!i.buffer.hasScrollback)return(function(g,x,T,B,P,M){return d(x,B,P,M).length===0?"":v(_(g,x,g,x-u(x,P),!1,P).length,m("D",M))})(p,S,0,a,i,l)+d(S,a,i,l)+(function(g,x,T,B,P,M){let H;H=d(x,B,P,M).length>0?B-u(B,P):x;const W=B,J=(function(ee,Y,L,A,R,I){let F;return F=d(L,A,R,I).length>0?A-u(A,R):Y,ee<L&&F<=A||ee>=L&&F<A?"C":"D"})(g,x,T,B,P,M);return v(_(g,H,T,W,J==="C",P).length,m(J,M))})(p,S,s,a,i,l);let y;if(S===a)return y=p>s?"D":"C",v(Math.abs(p-s),m(y,l));y=S>a?"D":"C";const E=Math.abs(S-a);return v((function(g,x){return x.cols-g})(S>a?s:p,i)+(E-1)*i.cols+1+((S>a?p:s)-1),m(y,l))}},1296:function(C,o,c){var h=this&&this.__decorate||function(M,H,W,J){var ee,Y=arguments.length,L=Y<3?H:J===null?J=Object.getOwnPropertyDescriptor(H,W):J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(M,H,W,J);else for(var A=M.length-1;A>=0;A--)(ee=M[A])&&(L=(Y<3?ee(L):Y>3?ee(H,W,L):ee(H,W))||L);return Y>3&&L&&Object.defineProperty(H,W,L),L},d=this&&this.__param||function(M,H){return function(W,J){H(W,J,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),f=c(2550),_=c(2223),m=c(6171),v=c(6052),s=c(4725),a=c(8055),i=c(8460),l=c(844),p=c(2585),S="xterm-dom-renderer-owner-",y="xterm-rows",E="xterm-fg-",g="xterm-bg-",x="xterm-focus",T="xterm-selection";let B=1,P=o.DomRenderer=class extends l.Disposable{constructor(M,H,W,J,ee,Y,L,A,R,I,F,Q,ie){super(),this._terminal=M,this._document=H,this._element=W,this._screenElement=J,this._viewportElement=ee,this._helperContainer=Y,this._linkifier2=L,this._charSizeService=R,this._optionsService=I,this._bufferService=F,this._coreBrowserService=Q,this._themeService=ie,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,m.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=A.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new f.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 M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),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/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),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 W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${y} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${y} .xterm-dim { color: ${a.color.multiplyOpacity(M.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,J=`blink_bar_${this._terminalClass}`,ee=`blink_block_${this._terminalClass}`;H+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${J} { 50% { box-shadow: none; }}`,H+=`@keyframes ${ee} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,H+=`${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,L]of M.ansi.entries())H+=`${this._terminalSelector} .${E}${Y} { color: ${L.css}; }${this._terminalSelector} .${E}${Y}.xterm-dim { color: ${a.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${g}${Y} { background-color: ${L.css}; }`;H+=`${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(M.background).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${g}${_.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,H){for(let W=this._rowElements.length;W<=H;W++){const J=this._document.createElement("div");this._rowContainer.appendChild(J),this._rowElements.push(J)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,H){this._refreshRowElements(M,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(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(M,H,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,H,W),this.renderRows(0,this._bufferService.rows-1),!M||!H)return;this._selectionRenderModel.update(this._terminal,M,H,W);const J=this._selectionRenderModel.viewportStartRow,ee=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||L<0)return;const A=this._document.createDocumentFragment();if(W){const R=M[0]>H[0];A.appendChild(this._createSelectionElement(Y,R?H[0]:M[0],R?M[0]:H[0],L-Y+1))}else{const R=J===Y?M[0]:0,I=Y===ee?H[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(Y,R,I));const F=L-Y-1;if(A.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,F)),Y!==L){const Q=ee===L?H[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(A)}_createSelectionElement(M,H,W,J=1){const ee=this._document.createElement("div"),Y=H*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(W-H);return Y+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-Y),ee.style.height=J*this.dimensions.css.cell.height+"px",ee.style.top=M*this.dimensions.css.cell.height+"px",ee.style.left=`${Y}px`,ee.style.width=`${L}px`,ee}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 M of this._rowElements)M.replaceChildren()}renderRows(M,H){const W=this._bufferService.buffer,J=W.ybase+W.y,ee=Math.min(W.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=M;R<=H;R++){const I=R+W.ydisp,F=this._rowElements[R],Q=W.lines.get(I);if(!F||!Q)break;F.replaceChildren(...this._rowFactory.createRow(Q,I,I===J,L,A,ee,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,H,W,J,ee,Y){W<0&&(M=0),J<0&&(H=0);const L=this._bufferService.rows-1;W=Math.max(Math.min(W,L),0),J=Math.max(Math.min(J,L),0),ee=Math.min(ee,this._bufferService.cols);const A=this._bufferService.buffer,R=A.ybase+A.y,I=Math.min(A.x,ee-1),F=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=W;he<=J;++he){const N=he+A.ydisp,D=this._rowElements[he],K=A.lines.get(N);if(!D||!K)break;D.replaceChildren(...this._rowFactory.createRow(K,N,N===R,Q,ie,I,F,this.dimensions.css.cell.width,this._widthCache,Y?he===W?M:0:-1,Y?(he===J?H:ee)-1:-1))}}};o.DomRenderer=P=h([d(7,p.IInstantiationService),d(8,s.ICharSizeService),d(9,p.IOptionsService),d(10,p.IBufferService),d(11,s.ICoreBrowserService),d(12,s.IThemeService)],P)},3787:function(C,o,c){var h=this&&this.__decorate||function(y,E,g,x){var T,B=arguments.length,P=B<3?E:x===null?x=Object.getOwnPropertyDescriptor(E,g):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,E,g,x);else for(var M=y.length-1;M>=0;M--)(T=y[M])&&(P=(B<3?T(P):B>3?T(E,g,P):T(E,g))||P);return B>3&&P&&Object.defineProperty(E,g,P),P},d=this&&this.__param||function(y,E){return function(g,x){E(g,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),f=c(643),_=c(511),m=c(2585),v=c(8055),s=c(4725),a=c(4269),i=c(6171),l=c(3734);let p=o.DomRendererRowFactory=class{constructor(y,E,g,x,T,B,P){this._document=y,this._characterJoinerService=E,this._optionsService=g,this._coreBrowserService=x,this._coreService=T,this._decorationService=B,this._themeService=P,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,E,g){this._selectionStart=y,this._selectionEnd=E,this._columnSelectMode=g}createRow(y,E,g,x,T,B,P,M,H,W,J){const ee=[],Y=this._characterJoinerService.getJoinedCharacters(E),L=this._themeService.colors;let A,R=y.getNoBgTrimmedLength();g&&R<B+1&&(R=B+1);let I=0,F="",Q=0,ie=0,he=0,N=!1,D=0,K=!1,O=0;const V=[],$=W!==-1&&J!==-1;for(let ae=0;ae<R;ae++){y.loadCell(ae,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let de=!1,ve=ae,re=this._workCell;if(Y.length>0&&ae===Y[0][0]){de=!0;const Oe=Y.shift();re=new a.JoinedCellData(this._workCell,y.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),ve=Oe[1]-1,se=re.getWidth()}const fe=this._isCellInSelection(ae,E),De=g&&ae===B,Ie=$&&ae>=W&&ae<=J;let ot=!1;this._decorationService.forEachDecorationAtCell(ae,E,void 0,(Oe=>{ot=!0}));let Fe=re.getChars()||f.WHITESPACE_CELL_CHAR;if(Fe===" "&&(re.isUnderline()||re.isOverline())&&(Fe=" "),O=se*M-H.get(Fe,re.isBold(),re.isItalic()),A){if(I&&(fe&&K||!fe&&!K&&re.bg===Q)&&(fe&&K&&L.selectionForeground||re.fg===ie)&&re.extended.ext===he&&Ie===N&&O===D&&!De&&!de&&!ot){re.isInvisible()?F+=f.WHITESPACE_CELL_CHAR:F+=Fe,I++;continue}I&&(A.textContent=F),A=this._document.createElement("span"),I=0,F=""}else A=this._document.createElement("span");if(Q=re.bg,ie=re.fg,he=re.extended.ext,N=Ie,D=O,K=fe,de&&B>=ae&&B<=ve&&(B=ae),!this._coreService.isCursorHidden&&De&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&V.push("xterm-cursor-blink"),V.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline")}}if(re.isBold()&&V.push("xterm-bold"),re.isItalic()&&V.push("xterm-italic"),re.isDim()&&V.push("xterm-dim"),F=re.isInvisible()?f.WHITESPACE_CELL_CHAR:re.getChars()||f.WHITESPACE_CELL_CHAR,re.isUnderline()&&(V.push(`xterm-underline-${re.extended.underlineStyle}`),F===" "&&(F=" "),!re.isUnderlineColorDefault()))if(re.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(re.getUnderlineColor()).join(",")})`;else{let Oe=re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&re.isBold()&&Oe<8&&(Oe+=8),A.style.textDecorationColor=L.ansi[Oe].css}re.isOverline()&&(V.push("xterm-overline"),F===" "&&(F=" ")),re.isStrikethrough()&&V.push("xterm-strikethrough"),Ie&&(A.style.textDecoration="underline");let Se=re.getFgColor(),et=re.getFgColorMode(),je=re.getBgColor(),at=re.getBgColorMode();const Xt=!!re.isInverse();if(Xt){const Oe=Se;Se=je,je=Oe;const Mr=et;et=at,at=Mr}let bt,Sr,Ee,Yt=!1;switch(this._decorationService.forEachDecorationAtCell(ae,E,void 0,(Oe=>{Oe.options.layer!=="top"&&Yt||(Oe.backgroundColorRGB&&(at=50331648,je=Oe.backgroundColorRGB.rgba>>8&16777215,bt=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(et=50331648,Se=Oe.foregroundColorRGB.rgba>>8&16777215,Sr=Oe.foregroundColorRGB),Yt=Oe.options.layer==="top")})),!Yt&&fe&&(bt=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,je=bt.rgba>>8&16777215,at=50331648,Yt=!0,L.selectionForeground&&(et=50331648,Se=L.selectionForeground.rgba>>8&16777215,Sr=L.selectionForeground)),Yt&&V.push("xterm-decoration-top"),at){case 16777216:case 33554432:Ee=L.ansi[je],V.push(`xterm-bg-${je}`);break;case 50331648:Ee=v.channels.toColor(je>>16,je>>8&255,255&je),this._addStyle(A,`background-color:#${S((je>>>0).toString(16),"0",6)}`);break;default:Xt?(Ee=L.foreground,V.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ee=L.background}switch(bt||re.isDim()&&(bt=v.color.multiplyOpacity(Ee,.5)),et){case 16777216:case 33554432:re.isBold()&&Se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Se+=8),this._applyMinimumContrast(A,Ee,L.ansi[Se],re,bt,void 0)||V.push(`xterm-fg-${Se}`);break;case 50331648:const Oe=v.channels.toColor(Se>>16&255,Se>>8&255,255&Se);this._applyMinimumContrast(A,Ee,Oe,re,bt,Sr)||this._addStyle(A,`color:#${S(Se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,Ee,L.foreground,re,bt,Sr)||Xt&&V.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}V.length&&(A.className=V.join(" "),V.length=0),De||de||ot?A.textContent=F:I++,O!==this.defaultSpacing&&(A.style.letterSpacing=`${O}px`),ee.push(A),ae=ve}return A&&I&&(A.textContent=F),ee}_applyMinimumContrast(y,E,g,x,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const P=this._getContrastCache(x);let M;if(T||B||(M=P.getColor(E.rgba,g.rgba)),M===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=v.color.ensureContrastRatio(T||E,B||g,H),P.setColor((T||E).rgba,(B||g).rgba,M??null)}return!!M&&(this._addStyle(y,`color:${M.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,E){y.setAttribute("style",`${y.getAttribute("style")||""}${E};`)}_isCellInSelection(y,E){const g=this._selectionStart,x=this._selectionEnd;return!(!g||!x)&&(this._columnSelectMode?g[0]<=x[0]?y>=g[0]&&E>=g[1]&&y<x[0]&&E<=x[1]:y<g[0]&&E>=g[1]&&y>=x[0]&&E<=x[1]:E>g[1]&&E<x[1]||g[1]===x[1]&&E===g[1]&&y>=g[0]&&y<x[0]||g[1]<x[1]&&E===x[1]&&y<x[0]||g[1]<x[1]&&E===g[1]&&y>=g[0])}};function S(y,E,g){for(;y.length<g;)y=E+y;return y}o.DomRendererRowFactory=p=h([d(1,s.ICharacterJoinerService),d(2,m.IOptionsService),d(3,s.ICoreBrowserService),d(4,m.ICoreService),d(5,m.IDecorationService),d(6,s.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=c.createElement("span");d.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[d,u,f,_],this._container.appendChild(d),this._container.appendChild(u),this._container.appendChild(f),this._container.appendChild(_),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,d,u){c===this._font&&h===this._fontSize&&d===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=d,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,d){let u=0;if(!h&&!d&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const m=this._measure(c,0);return m>0&&(this._flat[u]=m),m}let f=c;h&&(f+="B"),d&&(f+="I");let _=this._holey.get(f);if(_===void 0){let m=0;h&&(m|=1),d&&(m|=2),_=this._measure(c,m),_>0&&this._holey.set(f,_)}return _}_measure(c,h){const d=this._measureElements[h];return d.textContent=c.repeat(32),d.offsetWidth/32}}},2223:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function c(d){return 57508<=d&&d<=57558}function h(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},o.isEmoji=h,o.allowRescaling=function(d,u,f,_){return u===1&&f>Math.ceil(1.5*_)&&d!==void 0&&d>255&&!h(d)&&!c(d)&&!(function(m){return 57344<=m&&m<=63743})(d)},o.treatGlyphAsBackgroundColor=function(d){return c(d)||(function(u){return 9472<=u&&u<=9631})(d)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(d,u,f=0){return(d-(2*Math.round(u)-f))%(2*Math.round(u))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(d,u,f,_=!1){if(this.selectionStart=u,this.selectionEnd=f,!u||!f||u[0]===f[0]&&u[1]===f[1])return void this.clear();const m=d.buffers.active.ydisp,v=u[1]-m,s=f[1]-m,a=Math.max(v,0),i=Math.min(s,d.rows-1);a>=d.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=s,this.viewportCappedStartRow=a,this.viewportCappedEndRow=i,this.startCol=u[0],this.endCol=f[0])}isCellSelected(d,u,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&f>=this.viewportCappedStartRow&&u<this.endCol&&f<=this.viewportCappedEndRow:u<this.startCol&&f>=this.viewportCappedStartRow&&u>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,c){var h=this&&this.__decorate||function(i,l,p,S){var y,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,p,S);else for(var x=i.length-1;x>=0;x--)(y=i[x])&&(g=(E<3?y(g):E>3?y(l,p,g):y(l,p))||g);return E>3&&g&&Object.defineProperty(l,p,g),g},d=this&&this.__param||function(i,l){return function(p,S){l(p,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),f=c(8460),_=c(844);let m=o.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,l,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new s(i,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};o.CharSizeService=m=h([d(2,u.IOptionsService)],m);class v extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,p){l!==void 0&&l>0&&p!==void 0&&p>0&&(this._result.width=l,this._result.height=p)}}class s extends v{constructor(l,p,S){super(),this._document=l,this._parentElement=p,this._optionsService=S,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 a extends v{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(C,o,c){var h=this&&this.__decorate||function(a,i,l,p){var S,y=arguments.length,E=y<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,p);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(y<3?S(E):y>3?S(i,l,E):S(i,l))||E);return y>3&&E&&Object.defineProperty(i,l,E),E},d=this&&this.__param||function(a,i){return function(l,p){i(l,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),f=c(643),_=c(511),m=c(2585);class v extends u.AttributeData{constructor(i,l,p){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=l,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=v;let s=o.CharacterJoinerService=class Wa{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(i){const l={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(l),l.id}deregister(i){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===i)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(i);if(!l||l.length===0)return[];const p=[],S=l.translateToString(!0);let y=0,E=0,g=0,x=l.getFg(0),T=l.getBg(0);for(let B=0;B<l.getTrimmedLength();B++)if(l.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==T){if(B-y>1){const P=this._getJoinedRanges(S,g,E,l,y);for(let M=0;M<P.length;M++)p.push(P[M])}y=B,g=E,x=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const B=this._getJoinedRanges(S,g,E,l,y);for(let P=0;P<B.length;P++)p.push(B[P])}return p}_getJoinedRanges(i,l,p,S,y){const E=i.substring(l,p);let g=[];try{g=this._characterJoiners[0].handler(E)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const T=this._characterJoiners[x].handler(E);for(let B=0;B<T.length;B++)Wa._mergeRanges(g,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,S,y),g}_stringRangesToCellRanges(i,l,p){let S=0,y=!1,E=0,g=i[S];if(g){for(let x=p;x<this._bufferService.cols;x++){const T=l.getWidth(x),B=l.getString(x).length||f.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&g[0]<=E&&(g[0]=x,y=!0),g[1]<=E){if(g[1]=x,g=i[++S],!g)break;g[0]<=E?(g[0]=x,y=!0):y=!1}E+=B}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(i,l){let p=!1;for(let S=0;S<i.length;S++){const y=i[S];if(p){if(l[1]<=y[0])return i[S-1][1]=l[1],i;if(l[1]<=y[1])return i[S-1][1]=Math.max(l[1],y[1]),i.splice(S,1),i;i.splice(S,1),S--}else{if(l[1]<=y[0])return i.splice(S,0,l),i;if(l[1]<=y[1])return y[0]=Math.min(l[0],y[0]),i;l[0]<y[1]&&(y[0]=Math.min(l[0],y[0]),p=!0)}}return p?i[i.length-1][1]=l[1]:i.push(l),i}};o.CharacterJoinerService=s=h([d(0,m.IBufferService)],s)},5114:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),d=c(8460),u=c(3656);class f extends h.Disposable{constructor(v,s,a){super(),this._textarea=v,this._window=s,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((i=>this._screenDprMonitor.setWindow(i)))),this.register((0,d.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(v){this._window!==v&&(this._window=v,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=f;class _ extends h.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class d extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const _=this.linkProviders.indexOf(f);_!==-1&&this.linkProviders.splice(_,1)}}}}o.LinkProviderService=d},8934:function(C,o,c){var h=this&&this.__decorate||function(m,v,s,a){var i,l=arguments.length,p=l<3?v:a===null?a=Object.getOwnPropertyDescriptor(v,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(m,v,s,a);else for(var S=m.length-1;S>=0;S--)(i=m[S])&&(p=(l<3?i(p):l>3?i(v,s,p):i(v,s))||p);return l>3&&p&&Object.defineProperty(v,s,p),p},d=this&&this.__param||function(m,v){return function(s,a){v(s,a,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),f=c(9806);let _=o.MouseService=class{constructor(m,v){this._renderService=m,this._charSizeService=v}getCoords(m,v,s,a,i){return(0,f.getCoords)(window,m,v,s,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(m,v){const s=(0,f.getCoordsRelativeToElement)(window,m,v);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};o.MouseService=_=h([d(0,u.IRenderService),d(1,u.ICharSizeService)],_)},3230:function(C,o,c){var h=this&&this.__decorate||function(i,l,p,S){var y,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,p,S);else for(var x=i.length-1;x>=0;x--)(y=i[x])&&(g=(E<3?y(g):E>3?y(l,p,g):y(l,p))||g);return E>3&&g&&Object.defineProperty(l,p,g),g},d=this&&this.__param||function(i,l){return function(p,S){l(p,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),f=c(4725),_=c(8460),m=c(844),v=c(7226),s=c(2585);let a=o.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,l,p,S,y,E,g,x){super(),this._rowCount=i,this._charSizeService=S,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new m.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((T,B)=>this._renderRows(T,B)),g),this.register(this._renderDebouncer),this.register(g.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(p.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(g.window,l),this.register(g.onWindowChange((T=>this._registerIntersectionObserver(T,l))))}_registerIntersectionObserver(i,l){if("IntersectionObserver"in i){const p=new i.IntersectionObserver((S=>this._handleIntersectionChange(S[S.length-1])),{threshold:0});p.observe(l),this._observerDisposable.value=(0,m.toDisposable)((()=>p.disconnect()))}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,l,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,l,this._rowCount))}_renderRows(i,l){this._renderer.value&&(i=Math.min(i,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(i,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:l}),this._onRender.fire({start:i,end:l}),this._isNextRenderRedrawOnly=!0)}resize(i,l){this._rowCount=l,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,l;this._renderer.value&&((l=(i=this._renderer.value).clearTextureAtlas)==null||l.call(i),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(i,l)})):this._renderer.value.handleResize(i,l),this._fullRefresh())}handleCharSizeChanged(){var i;(i=this._renderer.value)==null||i.handleCharSizeChanged()}handleBlur(){var i;(i=this._renderer.value)==null||i.handleBlur()}handleFocus(){var i;(i=this._renderer.value)==null||i.handleFocus()}handleSelectionChanged(i,l,p){var S;this._selectionState.start=i,this._selectionState.end=l,this._selectionState.columnSelectMode=p,(S=this._renderer.value)==null||S.handleSelectionChanged(i,l,p)}handleCursorMove(){var i;(i=this._renderer.value)==null||i.handleCursorMove()}clear(){var i;(i=this._renderer.value)==null||i.clear()}};o.RenderService=a=h([d(2,s.IOptionsService),d(3,f.ICharSizeService),d(4,s.IDecorationService),d(5,s.IBufferService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],a)},9312:function(C,o,c){var h=this&&this.__decorate||function(g,x,T,B){var P,M=arguments.length,H=M<3?x:B===null?B=Object.getOwnPropertyDescriptor(x,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(g,x,T,B);else for(var W=g.length-1;W>=0;W--)(P=g[W])&&(H=(M<3?P(H):M>3?P(x,T,H):P(x,T))||H);return M>3&&H&&Object.defineProperty(x,T,H),H},d=this&&this.__param||function(g,x){return function(T,B){x(T,B,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),f=c(9504),_=c(456),m=c(4725),v=c(8460),s=c(844),a=c(6114),i=c(4841),l=c(511),p=c(2585),S=" ",y=new RegExp(S,"g");let E=o.SelectionService=class extends s.Disposable{constructor(g,x,T,B,P,M,H,W,J){super(),this._element=g,this._screenElement=x,this._linkifier=T,this._bufferService=B,this._coreService=P,this._mouseService=M,this._optionsService=H,this._renderService=W,this._coreBrowserService=J,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ee=>this._handleMouseMove(ee),this._mouseUpListener=ee=>this._handleMouseUp(ee),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ee=>this._handleTrim(ee))),this.register(this._bufferService.buffers.onBufferActivate((ee=>this._handleBufferActivate(ee)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,s.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 g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!g||!x||g[0]===x[0]&&g[1]===x[1])}get selectionText(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!g||!x)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(g[0]===x[0])return"";const P=g[0]<x[0]?g[0]:x[0],M=g[0]<x[0]?x[0]:g[0];for(let H=g[1];H<=x[1];H++){const W=T.translateBufferLineToString(H,!0,P,M);B.push(W)}}else{const P=g[1]===x[1]?x[0]:void 0;B.push(T.translateBufferLineToString(g[1],!0,g[0],P));for(let M=g[1]+1;M<=x[1]-1;M++){const H=T.lines.get(M),W=T.translateBufferLineToString(M,!0);H!=null&&H.isWrapped?B[B.length-1]+=W:B.push(W)}if(g[1]!==x[1]){const M=T.lines.get(x[1]),H=T.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?B[B.length-1]+=H:B.push(H)}}return B.map((P=>P.replace(y," "))).join(a.isWindows?`\r
|
|
7
|
-
`:`
|
|
8
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&g&&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(g){const x=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&x)&&this._areCoordsInSelection(x,T,B)}isCellInSelection(g,x){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([g,x],T,B)}_areCoordsInSelection(g,x,T){return g[1]>x[1]&&g[1]<T[1]||x[1]===T[1]&&g[1]===x[1]&&g[0]>=x[0]&&g[0]<T[0]||x[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||x[1]<T[1]&&g[1]===x[1]&&g[0]>=x[0]}_selectWordAtCursor(g,x){var P,M;const T=(M=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(g);return!!B&&(this._selectWordAt(B,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,x){this._model.clearSelection(),g=Math.max(g,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const x=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(g){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=T?0:(x>T&&(x-=T),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(g){return a.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}handleMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._handleIncrementalClick(g):g.detail===1?this._handleSingleClick(g):g.detail===2?this._handleDoubleClick(g):g.detail===3&&this._handleTripleClick(g),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(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_handleSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!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(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const x=this._getMouseBufferCoords(g);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(g){return g.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.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(g),!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(g),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const B=T.lines.get(this._model.selectionEnd[1]);B&&B.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 g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_handleMouseUp(g){const x=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const B=(0,f.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,T=!(!g||!x||g[0]===x[0]&&g[1]===x[1]);T?g&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,x,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,x,T)}_fireOnSelectionChange(g,x,T){this._oldSelectionStart=g,this._oldSelectionEnd=x,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(g,x){let T=x;for(let B=0;x>=B;B++){const P=g.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&x!==B&&(T+=P-1)}return T}setSelection(g,x,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,x],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,x,T=!0,B=!0){if(g[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,M=P.lines.get(g[1]);if(!M)return;const H=P.translateBufferLineToString(g[1],!1);let W=this._convertViewportColToCharacterIndex(M,g[0]),J=W;const ee=g[0]-W;let Y=0,L=0,A=0,R=0;if(H.charAt(W)===" "){for(;W>0&&H.charAt(W-1)===" ";)W--;for(;J<H.length&&H.charAt(J+1)===" ";)J++}else{let Q=g[0],ie=g[0];M.getWidth(Q)===0&&(Y++,Q--),M.getWidth(ie)===2&&(L++,ie++);const he=M.getString(ie).length;for(he>1&&(R+=he-1,J+=he-1);Q>0&&W>0&&!this._isCharWordSeparator(M.loadCell(Q-1,this._workCell));){M.loadCell(Q-1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,Q--):N>1&&(A+=N-1,W-=N-1),W--,Q--}for(;ie<M.length&&J+1<H.length&&!this._isCharWordSeparator(M.loadCell(ie+1,this._workCell));){M.loadCell(ie+1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,ie++):N>1&&(R+=N-1,J+=N-1),J++,ie++}}J++;let I=W+ee-Y+A,F=Math.min(this._bufferService.cols,J-W+Y+L-A-R);if(x||H.slice(W,J).trim()!==""){if(T&&I===0&&M.getCodePoint(0)!==32){const Q=P.lines.get(g[1]-1);if(Q&&M.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(ie){const he=this._bufferService.cols-ie.start;I-=he,F+=he}}}if(B&&I+F===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const Q=P.lines.get(g[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const ie=this._getWordAt([0,g[1]+1],!1,!1,!0);ie&&(F+=ie.length)}}return{start:I,length:F}}}_selectWordAt(g,x){const T=this._getWordAt(g,x);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[T.start,g[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(g){const x=this._getWordAt(g,!0);if(x){let T=g[1];for(;x.start<0;)x.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const x=this._bufferService.buffer.getWrappedRangeForLine(g),T={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,i.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=E=h([d(3,p.IBufferService),d(4,p.ICoreService),d(5,m.IMouseService),d(6,p.IOptionsService),d(7,m.IRenderService),d(8,m.ICoreBrowserService)],E)},4725:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(C,o,c){var h=this&&this.__decorate||function(E,g,x,T){var B,P=arguments.length,M=P<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,x):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,g,x,T);else for(var H=E.length-1;H>=0;H--)(B=E[H])&&(M=(P<3?B(M):P>3?B(g,x,M):B(g,x))||M);return P>3&&M&&Object.defineProperty(g,x,M),M},d=this&&this.__param||function(E,g){return function(x,T){g(x,T,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),f=c(8055),_=c(8460),m=c(844),v=c(2585),s=f.css.toColor("#ffffff"),a=f.css.toColor("#000000"),i=f.css.toColor("#ffffff"),l=f.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let x=0;x<216;x++){const T=g[x/36%6|0],B=g[x/6%6|0],P=g[x%6];E.push({css:f.channels.toCss(T,B,P),rgba:f.channels.toRgba(T,B,P)})}for(let x=0;x<24;x++){const T=8+10*x;E.push({css:f.channels.toCss(T,T,T),rgba:f.channels.toRgba(T,T,T)})}return E})());let S=o.ThemeService=class extends m.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:s,background:a,cursor:i,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:f.color.blend(a,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:f.color.blend(a,p),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(E={}){const g=this._colors;if(g.foreground=y(E.foreground,s),g.background=y(E.background,a),g.cursor=y(E.cursor,i),g.cursorAccent=y(E.cursorAccent,l),g.selectionBackgroundTransparent=y(E.selectionBackground,p),g.selectionBackgroundOpaque=f.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=y(E.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=f.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=E.selectionForeground?y(E.selectionForeground,f.NULL_COLOR):void 0,g.selectionForeground===f.NULL_COLOR&&(g.selectionForeground=void 0),f.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=f.color.opacity(g.selectionBackgroundTransparent,.3)),f.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=f.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=o.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=y(E.black,o.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=y(E.red,o.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=y(E.green,o.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=y(E.yellow,o.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=y(E.blue,o.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=y(E.magenta,o.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=y(E.cyan,o.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=y(E.white,o.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=y(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=y(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=y(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=y(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=y(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=y(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=y(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=y(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const x=Math.min(g.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<x;T++)g.ansi[T+16]=y(E.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){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[E]=this._restoreColors.ansi[E]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(E){E(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 y(E,g){if(E!==void 0)try{return f.css.toColor(E)}catch{}return g}o.ThemeService=S=h([d(0,v.IOptionsService)],S)},6349:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),d=c(844);class u extends d.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(_){if(this._maxLength===_)return;const m=new Array(_);for(let v=0;v<Math.min(_,this.length);v++)m[v]=this._array[this._getCyclicIndex(v)];this._array=m,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let m=this._length;m<_;m++)this._array[m]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,m){this._array[this._getCyclicIndex(_)]=m}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,m,...v){if(m){for(let s=_;s<this._length-m;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+m)];this._length-=m,this.onDeleteEmitter.fire({index:_,amount:m})}for(let s=this._length-1;s>=_;s--)this._array[this._getCyclicIndex(s+v.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<v.length;s++)this._array[this._getCyclicIndex(_+s)]=v[s];if(v.length&&this.onInsertEmitter.fire({index:_,amount:v.length}),this._length+v.length>this._maxLength){const s=this._length+v.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=v.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,m,v){if(!(m<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let a=m-1;a>=0;a--)this.set(_+a+v,this.get(_+a));const s=_+m+v-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<m;s++)this.set(_+s+v,this.get(_+s))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}o.CircularList=u},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,d=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const f in h)u[f]=d<=1?h[f]:h[f]&&c(h[f],d-1);return u}},8055:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,d=0,u=0;var f,_,m,v,s;function a(l){const p=l.toString(16);return p.length<2?"0"+p:p}function i(l,p){return l<p?(p+.05)/(l+.05):(l+.05)/(p+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(p,S,y,E){return E!==void 0?`#${a(p)}${a(S)}${a(y)}${a(E)}`:`#${a(p)}${a(S)}${a(y)}`},l.toRgba=function(p,S,y,E=255){return(p<<24|S<<16|y<<8|E)>>>0},l.toColor=function(p,S,y,E){return{css:l.toCss(p,S,y,E),rgba:l.toRgba(p,S,y,E)}}})(f||(o.channels=f={})),(function(l){function p(S,y){return u=Math.round(255*y),[c,h,d]=s.toChannels(S.rgba),{css:f.toCss(c,h,d,u),rgba:f.toRgba(c,h,d,u)}}l.blend=function(S,y){if(u=(255&y.rgba)/255,u===1)return{css:y.css,rgba:y.rgba};const E=y.rgba>>24&255,g=y.rgba>>16&255,x=y.rgba>>8&255,T=S.rgba>>24&255,B=S.rgba>>16&255,P=S.rgba>>8&255;return c=T+Math.round((E-T)*u),h=B+Math.round((g-B)*u),d=P+Math.round((x-P)*u),{css:f.toCss(c,h,d),rgba:f.toRgba(c,h,d)}},l.isOpaque=function(S){return(255&S.rgba)==255},l.ensureContrastRatio=function(S,y,E){const g=s.ensureContrastRatio(S.rgba,y.rgba,E);if(g)return f.toColor(g>>24&255,g>>16&255,g>>8&255)},l.opaque=function(S){const y=(255|S.rgba)>>>0;return[c,h,d]=s.toChannels(y),{css:f.toCss(c,h,d),rgba:y}},l.opacity=p,l.multiplyOpacity=function(S,y){return u=255&S.rgba,p(S,u*y/255)},l.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}})(_||(o.color=_={})),(function(l){let p,S;try{const y=document.createElement("canvas");y.width=1,y.height=1;const E=y.getContext("2d",{willReadFrequently:!0});E&&(p=E,p.globalCompositeOperation="copy",S=p.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return c=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),d=parseInt(y.slice(3,4).repeat(2),16),f.toColor(c,h,d);case 5:return c=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),d=parseInt(y.slice(3,4).repeat(2),16),u=parseInt(y.slice(4,5).repeat(2),16),f.toColor(c,h,d,u);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const E=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),h=parseInt(E[2]),d=parseInt(E[3]),u=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(c,h,d,u);if(!p||!S)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=S,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,h,d,u]=p.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(c,h,d,u),css:y}}})(m||(o.css=m={})),(function(l){function p(S,y,E){const g=S/255,x=y/255,T=E/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}l.relativeLuminance=function(S){return p(S>>16&255,S>>8&255,255&S)},l.relativeLuminance2=p})(v||(o.rgb=v={})),(function(l){function p(y,E,g){const x=y>>24&255,T=y>>16&255,B=y>>8&255;let P=E>>24&255,M=E>>16&255,H=E>>8&255,W=i(v.relativeLuminance2(P,M,H),v.relativeLuminance2(x,T,B));for(;W<g&&(P>0||M>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),M-=Math.max(0,Math.ceil(.1*M)),H-=Math.max(0,Math.ceil(.1*H)),W=i(v.relativeLuminance2(P,M,H),v.relativeLuminance2(x,T,B));return(P<<24|M<<16|H<<8|255)>>>0}function S(y,E,g){const x=y>>24&255,T=y>>16&255,B=y>>8&255;let P=E>>24&255,M=E>>16&255,H=E>>8&255,W=i(v.relativeLuminance2(P,M,H),v.relativeLuminance2(x,T,B));for(;W<g&&(P<255||M<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),M=Math.min(255,M+Math.ceil(.1*(255-M))),H=Math.min(255,H+Math.ceil(.1*(255-H))),W=i(v.relativeLuminance2(P,M,H),v.relativeLuminance2(x,T,B));return(P<<24|M<<16|H<<8|255)>>>0}l.blend=function(y,E){if(u=(255&E)/255,u===1)return E;const g=E>>24&255,x=E>>16&255,T=E>>8&255,B=y>>24&255,P=y>>16&255,M=y>>8&255;return c=B+Math.round((g-B)*u),h=P+Math.round((x-P)*u),d=M+Math.round((T-M)*u),f.toRgba(c,h,d)},l.ensureContrastRatio=function(y,E,g){const x=v.relativeLuminance(y>>8),T=v.relativeLuminance(E>>8);if(i(x,T)<g){if(T<x){const M=p(y,E,g),H=i(x,v.relativeLuminance(M>>8));if(H<g){const W=S(y,E,g);return H>i(x,v.relativeLuminance(W>>8))?M:W}return M}const B=S(y,E,g),P=i(x,v.relativeLuminance(B>>8));if(P<g){const M=p(y,E,g);return P>i(x,v.relativeLuminance(M>>8))?B:M}return B}},l.reduceLuminance=p,l.increaseLuminance=S,l.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(s||(o.rgba=s={})),o.toPaddedHex=a,o.contrastRatio=i},8969:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),d=c(2585),u=c(4348),f=c(7866),_=c(744),m=c(7302),v=c(6975),s=c(8460),a=c(1753),i=c(1480),l=c(7994),p=c(9282),S=c(5435),y=c(5981),E=c(2660);let g=!1;class x extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new s.EventEmitter),this._onScroll.event((B=>{var P;(P=this._onScrollApi)==null||P.fire(B.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(B){for(const P in B)this.optionsService.options[P]=B[P]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new s.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new s.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new s.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new s.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new m.OptionsService(B)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,s.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,s.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,s.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,s.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((P,M)=>this._inputHandler.parse(P,M)))),this.register((0,s.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,P){this._writeBuffer.write(B,P)}writeSync(B,P){this._logService.logLevel<=d.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(B,P)}input(B,P=!0){this.coreService.triggerDataEvent(B,P)}resize(B,P){isNaN(B)||isNaN(P)||(B=Math.max(B,_.MINIMUM_COLS),P=Math.max(P,_.MINIMUM_ROWS),this._bufferService.resize(B,P))}scroll(B,P=!1){this._bufferService.scroll(B,P)}scrollLines(B,P,M){this._bufferService.scrollLines(B,P,M)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const P=B-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(B,P){return this._inputHandler.registerEscHandler(B,P)}registerDcsHandler(B,P){return this._inputHandler.registerDcsHandler(B,P)}registerCsiHandler(B,P){return this._inputHandler.registerCsiHandler(B,P)}registerOscHandler(B,P){return this._inputHandler.registerOscHandler(B,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?B=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const P of B)P.dispose()}))}}}o.CoreTerminal=x},8460:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((d=>h.fire(d)))},o.runAndSubscribe=function(c,h){return h(void 0),c((d=>h(d)))}},5435:function(C,o,c){var h=this&&this.__decorate||function(Y,L,A,R){var I,F=arguments.length,Q=F<3?L:R===null?R=Object.getOwnPropertyDescriptor(L,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Y,L,A,R);else for(var ie=Y.length-1;ie>=0;ie--)(I=Y[ie])&&(Q=(F<3?I(Q):F>3?I(L,A,Q):I(L,A))||Q);return F>3&&Q&&Object.defineProperty(L,A,Q),Q},d=this&&this.__param||function(Y,L){return function(A,R){L(A,R,Y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),f=c(7116),_=c(2015),m=c(844),v=c(482),s=c(8437),a=c(8460),i=c(643),l=c(511),p=c(3734),S=c(2585),y=c(1480),E=c(6242),g=c(6351),x=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function P(Y,L){if(Y>24)return L.setWinLines||!1;switch(Y){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var M;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(o.WindowsOptionsReportType=M={}));let H=0;class W extends m.Disposable{getAttrData(){return this._curAttrData}constructor(L,A,R,I,F,Q,ie,he,N=new _.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=A,this._coreService=R,this._logService=I,this._optionsService=F,this._oscLinkService=Q,this._coreMouseService=ie,this._unicodeService=he,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.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 J(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:K.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,K,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:K,data:O})})),this._parser.setDcsHandlerFallback(((D,K,O)=>{K==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:K,payload:O})})),this._parser.setPrintHandler(((D,K,O)=>this.print(D,K,O))),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(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new E.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new E.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new E.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new E.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new E.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new E.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new E.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new E.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new E.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new E.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 f.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 g.DcsHandler(((D,K)=>this.requestStatusString(D,K))))}_preserveStack(L,A,R,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=R,this._parseStack.position=I}_logSlowResolvingAsync(L){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([L,new Promise(((A,R)=>setTimeout((()=>R("#SLOW_TIMEOUT")),5e3)))]).catch((A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,A){let R,I=this._activeBuffer.x,F=this._activeBuffer.y,Q=0;const ie=this._parseStack.paused;if(ie){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(R),R;I=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>B&&(Q=this._parseStack.position+B)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(D=>String.fromCharCode(D))).join("")}"`),typeof L=="string"?L.split("").map((D=>D.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(L.length,B))),ie||this._dirtyRowTracker.clearRange(),L.length>B)for(let D=Q;D<L.length;D+=B){const K=D+B<L.length?D+B:L.length,O=typeof L=="string"?this._stringDecoder.decode(L.substring(D,K),this._parseBuffer):this._utf8Decoder.decode(L.subarray(D,K),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,O))return this._preserveStack(I,F,O,D),this._logSlowResolvingAsync(R),R}else if(!ie){const D=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,D))return this._preserveStack(I,F,D,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===I&&this._activeBuffer.y===F||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(L,A,R){let I,F;const Q=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,K=this._curAttrData;let O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-A>0&&O.getWidth(this._activeBuffer.x-1)===2&&O.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let V=this._parser.precedingJoinState;for(let $=A;$<R;++$){if(I=L[$],I<127&&Q){const ve=Q[String.fromCharCode(I)];ve&&(I=ve.charCodeAt(0))}const ae=this._unicodeService.charProperties(I,V);F=y.UnicodeService.extractWidth(ae);const se=y.UnicodeService.extractShouldJoin(ae),de=se?y.UnicodeService.extractWidth(V):0;if(V=ae,ie&&this._onA11yChar.fire((0,v.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-de>he){if(N){const ve=O;let re=this._activeBuffer.x-de;for(this._activeBuffer.x=de,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),O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),de>0&&O instanceof s.BufferLine&&O.copyCellsFrom(ve,re,0,de,!1);re<he;)ve.setCellFromCodepoint(re++,0,1,K)}else if(this._activeBuffer.x=he-1,F===2)continue}if(se&&this._activeBuffer.x){const ve=O.getWidth(this._activeBuffer.x-1)?1:2;O.addCodepointToCell(this._activeBuffer.x-ve,I,F);for(let re=F-de;--re>=0;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(D&&(O.insertCells(this._activeBuffer.x,F-de,this._activeBuffer.getNullCell(K)),O.getWidth(he-1)===2&&O.setCellFromCodepoint(he-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,K)),O.setCellFromCodepoint(this._activeBuffer.x++,I,F,K),F>0)for(;--F;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=V,this._activeBuffer.x<he&&R-A>0&&O.getWidth(this._activeBuffer.x)===0&&!O.hasContent(this._activeBuffer.x)&&O.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,A){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,A):this._parser.registerCsiHandler(L,(R=>!P(R.params[0],this._optionsService.rawOptions.windowOptions)||A(R)))}registerDcsHandler(L,A){return this._parser.registerDcsHandler(L,new g.DcsHandler(A))}registerEscHandler(L,A){return this._parser.registerEscHandler(L,A)}registerOscHandler(L,A){return this._parser.registerOscHandler(L,new E.OscHandler(A))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=L,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+A)}cursorUp(L){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const A=L.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const A=L.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,A,R,I=!1,F=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(A,R,this._activeBuffer.getNullCell(this._eraseAttrData()),F),I&&(Q.isWrapped=!1)}_resetBufferLine(L,A=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),R.isWrapped=!1)}eraseInDisplay(L,A=!1){let R;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);R<this._bufferService.rows;R++)this._resetBufferLine(R,A);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,A);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(L,A=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;A--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;A--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let A=L.params[0]||1;for(;A--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let A=L.params[0]||1;for(;A--;)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(s.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const A=this._parser.precedingJoinState;if(!A)return!0;const R=L.params[0]||1,I=y.UnicodeService.extractWidth(A),F=this._activeBuffer.x-I,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),ie=new Uint32Array(Q.length*R);let he=0;for(let D=0;D<Q.length;){const K=Q.codePointAt(D)||0;ie[he++]=K,D+=K>65535?2:1}let N=he;for(let D=1;D<R;++D)ie.copyWithin(N,0,he),N+=he;return this.print(ie,0,N),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[A]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,A){const R=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:F}=this._coreMouseService,Q=this._coreService,{buffers:ie,cols:he}=this._bufferService,{active:N,alt:D}=ie,K=this._optionsService.rawOptions,O=se=>se?1:2,V=L.params[0];return $=V,ae=A?V===2?4:V===4?O(Q.modes.insertMode):V===12?3:V===20?O(K.convertEol):0:V===1?O(R.applicationCursorKeys):V===3?K.windowOptions.setWinLines?he===80?2:he===132?1:0:0:V===6?O(R.origin):V===7?O(R.wraparound):V===8?3:V===9?O(I==="X10"):V===12?O(K.cursorBlink):V===25?O(!Q.isCursorHidden):V===45?O(R.reverseWraparound):V===66?O(R.applicationKeypad):V===67?4:V===1e3?O(I==="VT200"):V===1002?O(I==="DRAG"):V===1003?O(I==="ANY"):V===1004?O(R.sendFocus):V===1005?4:V===1006?O(F==="SGR"):V===1015?4:V===1016?O(F==="SGR_PIXELS"):V===1048?1:V===47||V===1047||V===1049?O(N===D):V===2004?O(R.bracketedPasteMode):0,Q.triggerDataEvent(`${u.C0.ESC}[${A?"":"?"}${$};${ae}$y`),!0;var $,ae}_updateAttrColor(L,A,R,I,F){return A===2?(L|=50331648,L&=-16777216,L|=p.AttributeData.fromColorRGB([R,I,F])):A===5&&(L&=-50331904,L|=33554432|255&R),L}_extractColor(L,A,R){const I=[0,0,-1,0,0,0];let F=0,Q=0;do{if(I[Q+F]=L.params[A+Q],L.hasSubParams(A+Q)){const ie=L.getSubParams(A+Q);let he=0;do I[1]===5&&(F=1),I[Q+he+1+F]=ie[he];while(++he<ie.length&&he+Q+1+F<I.length);break}if(I[1]===5&&Q+F>=2||I[1]===2&&Q+F>=5)break;I[1]&&(F=1)}while(++Q+A<L.length&&Q+F<I.length);for(let ie=2;ie<I.length;++ie)I[ie]===-1&&(I[ie]=0);switch(I[0]){case 38:R.fg=this._updateAttrColor(R.fg,I[1],I[3],I[4],I[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,I[1],I[3],I[4],I[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,I[1],I[3],I[4],I[5])}return Q}_processUnderline(L,A){A.extended=A.extended.clone(),(!~L||L>5)&&(L=1),A.extended.underlineStyle=L,A.fg|=268435456,L===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(L){L.fg=s.DEFAULT_ATTR_DATA.fg,L.bg=s.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=L.length;let R;const I=this._curAttrData;for(let F=0;F<A;F++)R=L.params[F],R>=30&&R<=37?(I.fg&=-50331904,I.fg|=16777216|R-30):R>=40&&R<=47?(I.bg&=-50331904,I.bg|=16777216|R-40):R>=90&&R<=97?(I.fg&=-50331904,I.fg|=16777224|R-90):R>=100&&R<=107?(I.bg&=-50331904,I.bg|=16777224|R-100):R===0?this._processSGR0(I):R===1?I.fg|=134217728:R===3?I.bg|=67108864:R===4?(I.fg|=268435456,this._processUnderline(L.hasSubParams(F)?L.getSubParams(F)[0]:1,I)):R===5?I.fg|=536870912:R===7?I.fg|=67108864:R===8?I.fg|=1073741824:R===9?I.fg|=2147483648:R===2?I.bg|=134217728:R===21?this._processUnderline(2,I):R===22?(I.fg&=-134217729,I.bg&=-134217729):R===23?I.bg&=-67108865:R===24?(I.fg&=-268435457,this._processUnderline(0,I)):R===25?I.fg&=-536870913:R===27?I.fg&=-67108865:R===28?I.fg&=-1073741825:R===29?I.fg&=2147483647:R===39?(I.fg&=-67108864,I.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):R===49?(I.bg&=-67108864,I.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?F+=this._extractColor(L,F,I):R===53?I.bg|=1073741824:R===55?I.bg&=-1073741825:R===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):R===100?(I.fg&=-67108864,I.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${A};${R}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const A=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${A};${R}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const A=L.params[0]||1;switch(A){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 R=A%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(L){const A=L.params[0]||1;let R;return(L.length<2||(R=L.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(L){if(!P(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const A=[],R=L.split(";");for(;R.length>1;){const I=R.shift(),F=R.shift();if(/^\d+$/.exec(I)){const Q=parseInt(I);if(ee(Q))if(F==="?")A.push({type:0,index:Q});else{const ie=(0,x.parseColor)(F);ie&&A.push({type:1,index:Q,color:ie})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(L){const A=L.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(L,A){this._getCurrentLinkId()&&this._finishHyperlink();const R=L.split(":");let I;const F=R.findIndex((Q=>Q.startsWith("id=")));return F!==-1&&(I=R[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,A){const R=L.split(";");for(let I=0;I<R.length&&!(A>=this._specialColors.length);++I,++A)if(R[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const F=(0,x.parseColor)(R[I]);F&&this._onColor.fire([{type:1,index:this._specialColors[A],color:F}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const A=[],R=L.split(";");for(let I=0;I<R.length;++I)if(/^\d+$/.exec(R[I])){const F=parseInt(R[I]);ee(F)&&A.push({type:2,index:F})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(T[L[0]],f.CHARSETS[L[1]]||f.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new l.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const R=this._activeBuffer.ybase+this._activeBuffer.y+A,I=this._activeBuffer.lines.get(R);I&&(I.fill(L),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,A){const R=this._bufferService.buffer,I=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${F}${u.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,A){this._dirtyRowTracker.markRangeDirty(L,A)}}o.InputHandler=W;let J=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,L){Y>L&&(H=Y,Y=L,L=H),Y<this.start&&(this.start=Y),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ee(Y){return 0<=Y&&Y<256}J=h([d(0,S.IBufferService)],J)},844:(C,o)=>{function c(h){for(const d of h)d.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const d=this._disposables.indexOf(h);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var d;this._isDisposed||h===this._value||((d=this._value)==null||d.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(d,u,f){this._data[d]||(this._data[d]={}),this._data[d][u]=f}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,d,u,f,_){this._data.get(h,d)||this._data.set(h,d,new c),this._data.get(h,d).set(u,f,_)}get(h,d,u,f){var _;return(_=this._data.get(h,d))==null?void 0:_.get(u,f)}clear(){this._data.clear()}}},6114:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const d=c.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const d=this._getKey(h);if(d===void 0||(c=this._search(d),c===-1)||this._getKey(this._array[c])!==d)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===d);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,d){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do d(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let d=0,u=this._array.length-1;for(;u>=d;){let f=d+u>>1;const _=this._getKey(this._array[f]);if(_>h)u=f-1;else{if(!(_<h)){for(;f>0&&this._getKey(this._array[f-1])===h;)f--;return f}d=f+1}}return d}}},7226:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let m=0,v=0,s=_.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(m=Date.now(),this._tasks[this._i]()||this._i++,m=Math.max(1,Date.now()-m),v=Math.max(m,v),a=_.timeRemaining(),1.5*v>a)return s-m<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-m))}ms`),void this._start();s=a}this.clear()}}class u extends d{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const m=Date.now()+_;return{timeRemaining:()=>Math.max(0,m-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(d){const u=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=u==null?void 0:u.get(d.cols-1),_=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);_&&f&&(_.isWrapped=f[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&f[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,f=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=f}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),d=c(7226),u=c(3734),f=c(8437),_=c(4634),m=c(511),v=c(643),s=c(4863),a=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(i,l,p){this._hasScrollback=i,this._optionsService=l,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=m.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=m.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,l){return new f.BufferLine(this._bufferService.cols,this.getNullCell(i),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const l=i+this._optionsService.rawOptions.scrollback;return l>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:l}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=f.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,l){const p=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const y=this._getCorrectBufferLength(l);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<i)for(let g=0;g<this.lines.length;g++)S+=+this.lines.get(g).resize(i,p);let E=0;if(this._rows<l)for(let g=this._rows;g<l;g++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(i,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(i,p)));else for(let g=this._rows;g>l;g--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const g=this.lines.length-y;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=y}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,l-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(i,l),this._cols>i))for(let E=0;E<this.lines.length;E++)S+=+this.lines.get(E).resize(i,p);this._cols=i,this._rows=l,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,l){this._cols!==i&&(i>this._cols?this._reflowLarger(i,l):this._reflowSmaller(i,l))}_reflowLarger(i,l){const p=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(p.length>0){const S=(0,_.reflowLargerCreateNewLayout)(this.lines,p);(0,_.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(i,l,S.countRemoved)}}_reflowLargerAdjustViewport(i,l,p){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new f.BufferLine(i,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(i,l){const p=this.getNullCell(f.DEFAULT_ATTR_DATA),S=[];let y=0;for(let E=this.lines.length-1;E>=0;E--){let g=this.lines.get(E);if(!g||!g.isWrapped&&g.getTrimmedLength()<=i)continue;const x=[g];for(;g.isWrapped&&E>0;)g=this.lines.get(--E),x.unshift(g);const T=this.ybase+this.y;if(T>=E&&T<E+x.length)continue;const B=x[x.length-1].getTrimmedLength(),P=(0,_.reflowSmallerGetNewLineLengths)(x,this._cols,i),M=P.length-x.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const W=[];for(let R=0;R<M;R++){const I=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);W.push(I)}W.length>0&&(S.push({start:E+x.length+y,newLines:W}),y+=W.length),x.push(...W);let J=P.length-1,ee=P[J];ee===0&&(J--,ee=P[J]);let Y=x.length-M-1,L=B;for(;Y>=0;){const R=Math.min(L,ee);if(x[J]===void 0)break;if(x[J].copyCellsFrom(x[Y],L-R,ee-R,R,!0),ee-=R,ee===0&&(J--,ee=P[J]),L-=R,L===0){Y--;const I=Math.max(Y,0);L=(0,_.getWrappedLineTrimmedLength)(x,I,this._cols)}}for(let R=0;R<x.length;R++)P[R]<i&&x[R].setCell(P[R],p);let A=M-H;for(;A-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+l-1)}if(S.length>0){const E=[],g=[];for(let J=0;J<this.lines.length;J++)g.push(this.lines.get(J));const x=this.lines.length;let T=x-1,B=0,P=S[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let M=0;for(let J=Math.min(this.lines.maxLength-1,x+y-1);J>=0;J--)if(P&&P.start>T+M){for(let ee=P.newLines.length-1;ee>=0;ee--)this.lines.set(J--,P.newLines[ee]);J++,E.push({index:T+1,amount:P.newLines.length}),M+=P.newLines.length,P=S[++B]}else this.lines.set(J,g[T--]);let H=0;for(let J=E.length-1;J>=0;J--)E[J].index+=H,this.lines.onInsertEmitter.fire(E[J]),H+=E[J].amount;const W=Math.max(0,x+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(i,l,p=0,S){const y=this.lines.get(i);return y?y.translateToString(l,p,S):""}getWrappedRangeForLine(i){let l=i,p=i;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:l,last:p}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===i&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const l=new s.Marker(i);return this.markers.push(l),l.register(this.lines.onTrim((p=>{l.line-=p,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((p=>{l.line>=p.index&&(l.line+=p.amount)}))),l.register(this.lines.onDelete((p=>{l.line>=p.index&&l.line<p.index+p.amount&&l.dispose(),l.line>p.index&&(l.line-=p.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),d=c(511),u=c(643),f=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let _=0;class m{constructor(s,a,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*s);const l=a||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let p=0;p<s;++p)this.setCell(p,l);this.length=s}get(s){const a=this._data[3*s+0],i=2097151&a;return[this._data[3*s+1],2097152&a?this._combined[s]:i?(0,f.stringFromCodePoint)(i):"",a>>22,2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):i]}set(s,a){this._data[3*s+1]=a[u.CHAR_DATA_ATTR_INDEX],a[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[s]=a[1],this._data[3*s+0]=2097152|s|a[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*s+0]=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(s){return this._data[3*s+0]>>22}hasWidth(s){return 12582912&this._data[3*s+0]}getFg(s){return this._data[3*s+1]}getBg(s){return this._data[3*s+2]}hasContent(s){return 4194303&this._data[3*s+0]}getCodePoint(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):2097151&a}isCombined(s){return 2097152&this._data[3*s+0]}getString(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s]:2097151&a?(0,f.stringFromCodePoint)(2097151&a):""}isProtected(s){return 536870912&this._data[3*s+2]}loadCell(s,a){return _=3*s,a.content=this._data[_+0],a.fg=this._data[_+1],a.bg=this._data[_+2],2097152&a.content&&(a.combinedData=this._combined[s]),268435456&a.bg&&(a.extended=this._extendedAttrs[s]),a}setCell(s,a){2097152&a.content&&(this._combined[s]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[s]=a.extended),this._data[3*s+0]=a.content,this._data[3*s+1]=a.fg,this._data[3*s+2]=a.bg}setCellFromCodepoint(s,a,i,l){268435456&l.bg&&(this._extendedAttrs[s]=l.extended),this._data[3*s+0]=a|i<<22,this._data[3*s+1]=l.fg,this._data[3*s+2]=l.bg}addCodepointToCell(s,a,i){let l=this._data[3*s+0];2097152&l?this._combined[s]+=(0,f.stringFromCodePoint)(a):2097151&l?(this._combined[s]=(0,f.stringFromCodePoint)(2097151&l)+(0,f.stringFromCodePoint)(a),l&=-2097152,l|=2097152):l=a|4194304,i&&(l&=-12582913,l|=i<<22),this._data[3*s+0]=l}insertCells(s,a,i){if((s%=this.length)&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length-s){const l=new d.CellData;for(let p=this.length-s-a-1;p>=0;--p)this.setCell(s+a+p,this.loadCell(s+p,l));for(let p=0;p<a;++p)this.setCell(s+p,i)}else for(let l=s;l<this.length;++l)this.setCell(l,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(s,a,i){if(s%=this.length,a<this.length-s){const l=new d.CellData;for(let p=0;p<this.length-s-a;++p)this.setCell(s+p,this.loadCell(s+a+p,l));for(let p=this.length-a;p<this.length;++p)this.setCell(p,i)}else for(let l=s;l<this.length;++l)this.setCell(l,i);s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),this.getWidth(s)!==0||this.hasContent(s)||this.setCellFromCodepoint(s,0,1,i)}replaceCells(s,a,i,l=!1){if(l)for(s&&this.getWidth(s-1)===2&&!this.isProtected(s-1)&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,i);s<a&&s<this.length;)this.isProtected(s)||this.setCell(s,i),s++;else for(s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,i);s<a&&s<this.length;)this.setCell(s++,i)}resize(s,a){if(s===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*s;if(s>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const l=new Uint32Array(i);l.set(this._data),this._data=l}for(let l=this.length;l<s;++l)this.setCell(l,a)}else{this._data=this._data.subarray(0,i);const l=Object.keys(this._combined);for(let S=0;S<l.length;S++){const y=parseInt(l[S],10);y>=s&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let S=0;S<p.length;S++){const y=parseInt(p[S],10);y>=s&&delete this._extendedAttrs[y]}}return this.length=s,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const s=new Uint32Array(this._data.length);return s.set(this._data),this._data=s,1}return 0}fill(s,a=!1){if(a)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,s);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,s)}}copyFrom(s){this.length!==s.length?this._data=new Uint32Array(s._data):this._data.set(s._data),this.length=s.length,this._combined={};for(const a in s._combined)this._combined[a]=s._combined[a];this._extendedAttrs={};for(const a in s._extendedAttrs)this._extendedAttrs[a]=s._extendedAttrs[a];this.isWrapped=s.isWrapped}clone(){const s=new m(0);s._data=new Uint32Array(this._data),s.length=this.length;for(const a in this._combined)s._combined[a]=this._combined[a];for(const a in this._extendedAttrs)s._extendedAttrs[a]=this._extendedAttrs[a];return s.isWrapped=this.isWrapped,s}getTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0])return s+(this._data[3*s+0]>>22);return 0}getNoBgTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0]||50331648&this._data[3*s+2])return s+(this._data[3*s+0]>>22);return 0}copyCellsFrom(s,a,i,l,p){const S=s._data;if(p)for(let E=l-1;E>=0;E--){for(let g=0;g<3;g++)this._data[3*(i+E)+g]=S[3*(a+E)+g];268435456&S[3*(a+E)+2]&&(this._extendedAttrs[i+E]=s._extendedAttrs[a+E])}else for(let E=0;E<l;E++){for(let g=0;g<3;g++)this._data[3*(i+E)+g]=S[3*(a+E)+g];268435456&S[3*(a+E)+2]&&(this._extendedAttrs[i+E]=s._extendedAttrs[a+E])}const y=Object.keys(s._combined);for(let E=0;E<y.length;E++){const g=parseInt(y[E],10);g>=a&&(this._combined[g-a+i]=s._combined[g])}}translateToString(s,a,i,l){a=a??0,i=i??this.length,s&&(i=Math.min(i,this.getTrimmedLength())),l&&(l.length=0);let p="";for(;a<i;){const S=this._data[3*a+0],y=2097151&S,E=2097152&S?this._combined[a]:y?(0,f.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR;if(p+=E,l)for(let g=0;g<E.length;++g)l.push(a);a+=S>>22||1}return l&&l.push(a),p}}o.BufferLine=m},4841:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(C,o)=>{function c(h,d,u){if(d===h.length-1)return h[d].getTrimmedLength();const f=!h[d].hasContent(u-1)&&h[d].getWidth(u-1)===1,_=h[d+1].getWidth(0)===2;return f&&_?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,d,u,f,_){const m=[];for(let v=0;v<h.length-1;v++){let s=v,a=h.get(++s);if(!a.isWrapped)continue;const i=[h.get(v)];for(;s<h.length&&a.isWrapped;)i.push(a),a=h.get(++s);if(f>=v&&f<s){v+=i.length-1;continue}let l=0,p=c(i,l,d),S=1,y=0;for(;S<i.length;){const g=c(i,S,d),x=g-y,T=u-p,B=Math.min(x,T);i[l].copyCellsFrom(i[S],y,p,B,!1),p+=B,p===u&&(l++,p=0),y+=B,y===g&&(S++,y=0),p===0&&l!==0&&i[l-1].getWidth(u-1)===2&&(i[l].copyCellsFrom(i[l-1],u-1,p++,1,!1),i[l-1].setCell(u-1,_))}i[l].replaceCells(p,u,_);let E=0;for(let g=i.length-1;g>0&&(g>l||i[g].getTrimmedLength()===0);g--)E++;E>0&&(m.push(v+i.length-E),m.push(E)),v+=i.length-1}return m},o.reflowLargerCreateNewLayout=function(h,d){const u=[];let f=0,_=d[f],m=0;for(let v=0;v<h.length;v++)if(_===v){const s=d[++f];h.onDeleteEmitter.fire({index:v-m,amount:s}),v+=s-1,m+=s,_=d[++f]}else u.push(v);return{layout:u,countRemoved:m}},o.reflowLargerApplyNewLayout=function(h,d){const u=[];for(let f=0;f<d.length;f++)u.push(h.get(d[f]));for(let f=0;f<u.length;f++)h.set(f,u[f]);h.length=d.length},o.reflowSmallerGetNewLineLengths=function(h,d,u){const f=[],_=h.map(((a,i)=>c(h,i,d))).reduce(((a,i)=>a+i));let m=0,v=0,s=0;for(;s<_;){if(_-s<u){f.push(_-s);break}m+=u;const a=c(h,v,d);m>a&&(m-=a,v++);const i=h[v].getWidth(m-1)===2;i&&m--;const l=i?u-1:u;f.push(l),s+=l}return f},o.getWrappedLineTrimmedLength=c},5295:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),d=c(844),u=c(9092);class f extends d.Disposable{constructor(m,v){super(),this._optionsService=m,this._bufferService=v,this._onBufferActivate=this.register(new h.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(m){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(m),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(m,v){this._normal.resize(m,v),this._alt.resize(m,v),this.setupTabStops(m)}setupTabStops(m){this._normal.setupTabStops(m),this._alt.setupTabStops(m)}}o.BufferSet=f},511:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),d=c(643),u=c(3734);class f extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(m){const v=new f;return v.setFromCharData(m),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(m){this.fg=m[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(m[d.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(m[d.CHAR_DATA_CHAR_INDEX].length===2){const s=m[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=s&&s<=56319){const a=m[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(s-55296)+a-56320+65536|m[d.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=m[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[d.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=m[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|m[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},643:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),d=c(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}o.Marker=u,u._nextId=1},7116:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,o)=>{var c,h,d;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
9
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(o.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(d||(o.C1_ESCAPED=d={}))},7399:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),d={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(u,f,_,m){const v={type:0,cancel:!1,key:void 0},s=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?v.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?v.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?v.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(v.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:v.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(v.key=h.C0.ESC+v.key);break;case 9:if(u.shiftKey){v.key=h.C0.ESC+"[Z";break}v.key=h.C0.HT,v.cancel=!0;break;case 13:v.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,v.cancel=!0;break;case 27:v.key=h.C0.ESC,u.altKey&&(v.key=h.C0.ESC+h.C0.ESC),v.cancel=!0;break;case 37:if(u.metaKey)break;s?(v.key=h.C0.ESC+"[1;"+(s+1)+"D",v.key===h.C0.ESC+"[1;3D"&&(v.key=h.C0.ESC+(_?"b":"[1;5D"))):v.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;s?(v.key=h.C0.ESC+"[1;"+(s+1)+"C",v.key===h.C0.ESC+"[1;3C"&&(v.key=h.C0.ESC+(_?"f":"[1;5C"))):v.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;s?(v.key=h.C0.ESC+"[1;"+(s+1)+"A",_||v.key!==h.C0.ESC+"[1;3A"||(v.key=h.C0.ESC+"[1;5A")):v.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;s?(v.key=h.C0.ESC+"[1;"+(s+1)+"B",_||v.key!==h.C0.ESC+"[1;3B"||(v.key=h.C0.ESC+"[1;5B")):v.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(v.key=h.C0.ESC+"[2~");break;case 46:v.key=s?h.C0.ESC+"[3;"+(s+1)+"~":h.C0.ESC+"[3~";break;case 36:v.key=s?h.C0.ESC+"[1;"+(s+1)+"H":f?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:v.key=s?h.C0.ESC+"[1;"+(s+1)+"F":f?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?v.type=2:u.ctrlKey?v.key=h.C0.ESC+"[5;"+(s+1)+"~":v.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?v.type=3:u.ctrlKey?v.key=h.C0.ESC+"[6;"+(s+1)+"~":v.key=h.C0.ESC+"[6~";break;case 112:v.key=s?h.C0.ESC+"[1;"+(s+1)+"P":h.C0.ESC+"OP";break;case 113:v.key=s?h.C0.ESC+"[1;"+(s+1)+"Q":h.C0.ESC+"OQ";break;case 114:v.key=s?h.C0.ESC+"[1;"+(s+1)+"R":h.C0.ESC+"OR";break;case 115:v.key=s?h.C0.ESC+"[1;"+(s+1)+"S":h.C0.ESC+"OS";break;case 116:v.key=s?h.C0.ESC+"[15;"+(s+1)+"~":h.C0.ESC+"[15~";break;case 117:v.key=s?h.C0.ESC+"[17;"+(s+1)+"~":h.C0.ESC+"[17~";break;case 118:v.key=s?h.C0.ESC+"[18;"+(s+1)+"~":h.C0.ESC+"[18~";break;case 119:v.key=s?h.C0.ESC+"[19;"+(s+1)+"~":h.C0.ESC+"[19~";break;case 120:v.key=s?h.C0.ESC+"[20;"+(s+1)+"~":h.C0.ESC+"[20~";break;case 121:v.key=s?h.C0.ESC+"[21;"+(s+1)+"~":h.C0.ESC+"[21~";break;case 122:v.key=s?h.C0.ESC+"[23;"+(s+1)+"~":h.C0.ESC+"[23~";break;case 123:v.key=s?h.C0.ESC+"[24;"+(s+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(_&&!m||!u.altKey||u.metaKey)!_||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?v.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(v.key=h.C0.US),u.key==="@"&&(v.key=h.C0.NUL)):u.keyCode===65&&(v.type=1);else{const a=d[u.keyCode],i=a==null?void 0:a[u.shiftKey?1:0];if(i)v.key=h.C0.ESC+i;else if(u.keyCode>=65&&u.keyCode<=90){const l=u.ctrlKey?u.keyCode-64:u.keyCode+32;let p=String.fromCharCode(l);u.shiftKey&&(p=p.toUpperCase()),v.key=h.C0.ESC+p}else if(u.keyCode===32)v.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let l=u.code.slice(3,4);u.shiftKey||(l=l.toLowerCase()),v.key=h.C0.ESC+l,v.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?v.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?v.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?v.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?v.key=h.C0.DEL:u.keyCode===219?v.key=h.C0.ESC:u.keyCode===220?v.key=h.C0.FS:u.keyCode===221&&(v.key=h.C0.GS)}return v}},482:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,d=c.length){let u="";for(let f=h;f<d;++f){let _=c[f];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const d=c.length;if(!d)return 0;let u=0,f=0;if(this._interim){const _=c.charCodeAt(f++);56320<=_&&_<=57343?h[u++]=1024*(this._interim-55296)+_-56320+65536:(h[u++]=this._interim,h[u++]=_),this._interim=0}for(let _=f;_<d;++_){const m=c.charCodeAt(_);if(55296<=m&&m<=56319){if(++_>=d)return this._interim=m,u;const v=c.charCodeAt(_);56320<=v&&v<=57343?h[u++]=1024*(m-55296)+v-56320+65536:(h[u++]=m,h[u++]=v)}else m!==65279&&(h[u++]=m)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const d=c.length;if(!d)return 0;let u,f,_,m,v=0,s=0,a=0;if(this.interim[0]){let p=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let y,E=0;for(;(y=63&this.interim[++E])&&E<4;)S<<=6,S|=y;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=g-E;for(;a<x;){if(a>=d)return 0;if(y=c[a++],(192&y)!=128){a--,p=!0;break}this.interim[E++]=y,S<<=6,S|=63&y}p||(g===2?S<128?a--:h[v++]=S:g===3?S<2048||S>=55296&&S<=57343||S===65279||(h[v++]=S):S<65536||S>1114111||(h[v++]=S)),this.interim.fill(0)}const i=d-4;let l=a;for(;l<d;){for(;!(!(l<i)||128&(u=c[l])||128&(f=c[l+1])||128&(_=c[l+2])||128&(m=c[l+3]));)h[v++]=u,h[v++]=f,h[v++]=_,h[v++]=m,l+=4;if(u=c[l++],u<128)h[v++]=u;else if((224&u)==192){if(l>=d)return this.interim[0]=u,v;if(f=c[l++],(192&f)!=128){l--;continue}if(s=(31&u)<<6|63&f,s<128){l--;continue}h[v++]=s}else if((240&u)==224){if(l>=d)return this.interim[0]=u,v;if(f=c[l++],(192&f)!=128){l--;continue}if(l>=d)return this.interim[0]=u,this.interim[1]=f,v;if(_=c[l++],(192&_)!=128){l--;continue}if(s=(15&u)<<12|(63&f)<<6|63&_,s<2048||s>=55296&&s<=57343||s===65279)continue;h[v++]=s}else if((248&u)==240){if(l>=d)return this.interim[0]=u,v;if(f=c[l++],(192&f)!=128){l--;continue}if(l>=d)return this.interim[0]=u,this.interim[1]=f,v;if(_=c[l++],(192&_)!=128){l--;continue}if(l>=d)return this.interim[0]=u,this.interim[1]=f,this.interim[2]=_,v;if(m=c[l++],(192&m)!=128){l--;continue}if(s=(7&u)<<18|(63&f)<<12|(63&_)<<6|63&m,s<65536||s>1114111)continue;h[v++]=s}}return v}}},225:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),d=[[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]],u=[[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 f;o.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let _=0;_<d.length;++_)f.fill(0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?f[_]:(function(m,v){let s,a=0,i=v.length-1;if(m<v[0][0]||m>v[i][1])return!1;for(;i>=a;)if(s=a+i>>1,m>v[s][1])a=s+1;else{if(!(m<v[s][0]))return!0;i=s-1}return!1})(_,u)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,m){let v=this.wcwidth(_),s=v===0&&m!==0;if(s){const a=h.UnicodeService.extractWidth(m);a===0?s=!1:a>v&&(v=a)}return h.UnicodeService.createPropertyValue(0,v,s)}}},5981:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),d=c(844);class u extends d.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,m){if(m!==void 0&&this._syncCalls>m)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,m){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(m),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(m)}_innerWrite(_=0,m=!0){const v=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const s=this._writeBuffer[this._bufferOffset],a=this._action(s,m);if(a){const l=p=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,p))):this._innerWrite(v,p);return void a.catch((p=>(queueMicrotask((()=>{throw p})),Promise.resolve(!1)))).then(l)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=s.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=u},5941:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function d(u,f){const _=u.toString(16),m=_.length<2?"0"+_:_;switch(f){case 4:return _[0];case 8:return m;case 12:return(m+m).slice(0,3);default:return m+m}}o.parseColor=function(u){if(!u)return;let f=u.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const _=c.exec(f);if(_){const m=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/m*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/m*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/m*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),h.exec(f)&&[3,6,9,12].includes(f.length))){const _=f.length/3,m=[0,0,0];for(let v=0;v<3;++v){const s=parseInt(f.slice(_*v,_*v+_),16);m[v]=_===1?s<<4:_===2?s:_===3?s>>4:s>>8}return m}},o.toRgbString=function(u,f=16){const[_,m,v]=u;return`rgb:${d(_,f)}/${d(m,f)}/${d(v,f)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),d=c(8742),u=c(5770),f=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(m,v){this._handlers[m]===void 0&&(this._handlers[m]=[]);const s=this._handlers[m];return s.push(v),{dispose:()=>{const a=s.indexOf(v);a!==-1&&s.splice(a,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}reset(){if(this._active.length)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(m,v){if(this.reset(),this._ident=m,this._active=this._handlers[m]||f,this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(m,v,s){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(m,v,s);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(m,v,s))}unhook(m,v=!0){if(this._active.length){let s=!1,a=this._active.length-1,i=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,s=v,i=this._stack.fallThrough,this._stack.paused=!1),!i&&s===!1){for(;a>=0&&(s=this._active[a].unhook(m),s!==!0);a--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,s;a--}for(;a>=0;a--)if(s=this._active[a].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,s}else this._handlerFb(this._ident,"UNHOOK",m);this._active=f,this._ident=0}};const _=new d.Params;_.addParam(0),o.DcsHandler=class{constructor(m){this._handler=m,this._data="",this._params=_,this._hitLimit=!1}hook(m){this._params=m.length>1||m.params[0]?m.clone():_,this._data="",this._hitLimit=!1}put(m,v,s){this._hitLimit||(this._data+=(0,h.utf32ToString)(m,v,s),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(m){let v=!1;if(this._hitLimit)v=!1;else if(m&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((s=>(this._params=_,this._data="",this._hitLimit=!1,s)));return this._params=_,this._data="",this._hitLimit=!1,v}}},2015:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),d=c(8742),u=c(6242),f=c(6351);class _{constructor(a){this.table=new Uint8Array(a)}setDefault(a,i){this.table.fill(a<<4|i)}add(a,i,l,p){this.table[i<<8|a]=l<<4|p}addMany(a,i,l,p){for(let S=0;S<a.length;S++)this.table[i<<8|a[S]]=l<<4|p}}o.TransitionTable=_;const m=160;o.VT500_TRANSITION_TABLE=(function(){const s=new _(4095),a=Array.apply(null,Array(256)).map(((E,g)=>g)),i=(E,g)=>a.slice(E,g),l=i(32,127),p=i(0,24);p.push(25),p.push.apply(p,i(28,32));const S=i(0,14);let y;for(y in s.setDefault(1,0),s.addMany(l,0,2,0),S)s.addMany([24,26,153,154],y,3,0),s.addMany(i(128,144),y,3,0),s.addMany(i(144,152),y,3,0),s.add(156,y,0,0),s.add(27,y,11,1),s.add(157,y,4,8),s.addMany([152,158,159],y,0,7),s.add(155,y,11,3),s.add(144,y,11,9);return s.addMany(p,0,3,0),s.addMany(p,1,3,1),s.add(127,1,0,1),s.addMany(p,8,0,8),s.addMany(p,3,3,3),s.add(127,3,0,3),s.addMany(p,4,3,4),s.add(127,4,0,4),s.addMany(p,6,3,6),s.addMany(p,5,3,5),s.add(127,5,0,5),s.addMany(p,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(l,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(i(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(l,7,0,7),s.addMany(p,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(i(64,127),3,7,0),s.addMany(i(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(i(48,60),4,8,4),s.addMany(i(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(i(32,64),6,0,6),s.add(127,6,0,6),s.addMany(i(64,127),6,0,0),s.addMany(i(32,48),3,9,5),s.addMany(i(32,48),5,9,5),s.addMany(i(48,64),5,0,6),s.addMany(i(64,127),5,7,0),s.addMany(i(32,48),4,9,5),s.addMany(i(32,48),1,9,2),s.addMany(i(32,48),2,9,2),s.addMany(i(48,127),2,10,0),s.addMany(i(48,80),1,10,0),s.addMany(i(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(i(96,127),1,10,0),s.add(80,1,11,9),s.addMany(p,9,0,9),s.add(127,9,0,9),s.addMany(i(28,32),9,0,9),s.addMany(i(32,48),9,9,12),s.addMany(i(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(p,11,0,11),s.addMany(i(32,128),11,0,11),s.addMany(i(28,32),11,0,11),s.addMany(p,10,0,10),s.add(127,10,0,10),s.addMany(i(28,32),10,0,10),s.addMany(i(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(i(32,48),10,9,12),s.addMany(p,12,0,12),s.add(127,12,0,12),s.addMany(i(28,32),12,0,12),s.addMany(i(32,48),12,9,12),s.addMany(i(48,64),12,0,11),s.addMany(i(64,127),12,12,13),s.addMany(i(64,127),10,12,13),s.addMany(i(64,127),9,12,13),s.addMany(p,13,13,13),s.addMany(l,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(m,0,2,0),s.add(m,8,5,8),s.add(m,6,0,6),s.add(m,11,0,11),s.add(m,13,13,13),s})();class v extends h.Disposable{constructor(a=o.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,l,p)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,l)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,i=[64,126]){let l=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=a.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<a.intermediates.length;++S){const y=a.intermediates.charCodeAt(S);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=y}}if(a.final.length!==1)throw new Error("final must be a single byte");const p=a.final.charCodeAt(0);if(i[0]>p||p>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return l<<=8,l|=p,l}identToString(a){const i=[];for(;a;)i.push(String.fromCharCode(255&a)),a>>=8;return i.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,i){const l=this._identifier(a,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const p=this._escHandlers[l];return p.push(i),{dispose:()=>{const S=p.indexOf(i);S!==-1&&p.splice(S,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,i){this._executeHandlers[a.charCodeAt(0)]=i}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,i){const l=this._identifier(a);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const p=this._csiHandlers[l];return p.push(i),{dispose:()=>{const S=p.indexOf(i);S!==-1&&p.splice(S,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,i){return this._dcsParser.registerHandler(this._identifier(a),i)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,i){return this._oscParser.registerHandler(a,i)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,i,l,p,S){this._parseStack.state=a,this._parseStack.handlers=i,this._parseStack.handlerPos=l,this._parseStack.transition=p,this._parseStack.chunkPos=S}parse(a,i,l){let p,S=0,y=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&x>-1){for(;x>=0&&(p=g[x](this._params),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 4:if(l===!1&&x>-1){for(;x>=0&&(p=g[x](),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 6:if(S=a[this._parseStack.chunkPos],p=this._dcsParser.unhook(S!==24&&S!==26,l),p)return p;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=a[this._parseStack.chunkPos],p=this._oscParser.end(S!==24&&S!==26,l),p)return p;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=E;g<i;++g){switch(S=a[g],y=this._transitions.table[this.currentState<<8|(S<160?S:m)],y>>4){case 2:for(let M=g+1;;++M){if(M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|S];let T=x?x.length-1:-1;for(;T>=0&&(p=x[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,x,T,y,g),p;T<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++g<i&&(S=a[g])>47&&S<60);g--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const B=this._escHandlers[this._collect<<8|S];let P=B?B.length-1:-1;for(;P>=0&&(p=B[P](),p!==!0);P--)if(p instanceof Promise)return this._preserveStack(4,B,P,y,g),p;P<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let M=g+1;;++M)if(M>=i||(S=a[M])===24||S===26||S===27||S>127&&S<m){this._dcsParser.put(a,g,M),g=M-1;break}break;case 14:if(p=this._dcsParser.unhook(S!==24&&S!==26),p)return this._preserveStack(6,[],0,y,g),p;S===27&&(y|=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 M=g+1;;M++)if(M>=i||(S=a[M])<32||S>127&&S<m){this._oscParser.put(a,g,M),g=M-1;break}break;case 6:if(p=this._oscParser.end(S!==24&&S!==26),p)return this._preserveStack(5,[],0,y,g),p;S===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}o.EscapeSequenceParser=v},6242:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),d=c(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,_){this._handlers[f]===void 0&&(this._handlers[f]=[]);const m=this._handlers[f];return m.push(_),{dispose:()=>{const v=m.indexOf(_);v!==-1&&m.splice(v,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,_,m){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(f,_,m);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(f,_,m))}start(){this.reset(),this._state=1}put(f,_,m){if(this._state!==3){if(this._state===1)for(;_<m;){const v=f[_++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&m-_>0&&this._put(f,_,m)}}end(f,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let m=!1,v=this._active.length-1,s=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,m=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&m===!1){for(;v>=0&&(m=this._active[v].end(f),m!==!0);v--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,m;v--}for(;v>=0;v--)if(m=this._active[v].end(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,m}else this._handlerFb(this._id,"END",f);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,_,m){this._hitLimit||(this._data+=(0,d.utf32ToString)(f,_,m),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let _=!1;if(this._hitLimit)_=!1;else if(f&&(_=this._handler(this._data),_ instanceof Promise))return _.then((m=>(this._data="",this._hitLimit=!1,m)));return this._data="",this._hitLimit=!1,_}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const f=new h;if(!u.length)return f;for(let _=Array.isArray(u[0])?1:0;_<u.length;++_){const m=u[_];if(Array.isArray(m))for(let v=0;v<m.length;++v)f.addSubParam(m[v]);else f.addParam(m)}return f}constructor(u=32,f=32){if(this.maxLength=u,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let f=0;f<this.length;++f){u.push(this.params[f]);const _=this._subParamsIdx[f]>>8,m=255&this._subParamsIdx[f];m-_>0&&u.push(Array.prototype.slice.call(this._subParams,_,m))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const f=this._subParamsIdx[u]>>8,_=255&this._subParamsIdx[u];return _-f>0?this._subParams.subarray(f,_):null}getSubParamsAll(){const u={};for(let f=0;f<this.length;++f){const _=this._subParamsIdx[f]>>8,m=255&this._subParamsIdx[f];m-_>0&&(u[f]=this._subParams.slice(_,m))}return u}addDigit(u){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,m=_[f-1];_[f-1]=~m?Math.min(10*m+u,c):u}}o.Params=h},5741:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const d={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(d),h.dispose=()=>this._wrappedAddonDispose(d),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===c){h=d;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),d=c(511);o.BufferApiView=class{constructor(u,f){this._buffer=u,this.type=f}init(u){return this._buffer=u,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(u){const f=this._buffer.lines.get(u);if(f)return new h.BufferLineApiView(f)}getNullCell(){return new d.CellData}}},3785:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,u){if(!(d<0||d>=this._line.length))return u?(this._line.loadCell(d,u),u):this._line.loadCell(d,new h.CellData)}translateToString(d,u,f){return this._line.translateToString(d,u,f)}}},8285:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),d=c(8460),u=c(844);class f extends u.Disposable{constructor(m){super(),this._core=m,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=f},7975:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(d=>h(d.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((d,u)=>h(d,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(C,o,c){var h=this&&this.__decorate||function(s,a,i,l){var p,S=arguments.length,y=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,i):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,i,l);else for(var E=s.length-1;E>=0;E--)(p=s[E])&&(y=(S<3?p(y):S>3?p(a,i,y):p(a,i))||y);return S>3&&y&&Object.defineProperty(a,i,y),y},d=this&&this.__param||function(s,a){return function(i,l){a(i,l,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),f=c(844),_=c(5295),m=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(s){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(s.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(s.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(s,this))}resize(s,a){this.cols=s,this.rows=a,this.buffers.resize(s,a),this._onResize.fire({cols:s,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(s,a=!1){const i=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===s.fg&&l.getBg(0)===s.bg||(l=i.getBlankLine(s,a),this._cachedBlankLine=l),l.isWrapped=a;const p=i.ybase+i.scrollTop,S=i.ybase+i.scrollBottom;if(i.scrollTop===0){const y=i.lines.isFull;S===i.lines.length-1?y?i.lines.recycle().copyFrom(l):i.lines.push(l.clone()):i.lines.splice(S+1,0,l.clone()),y?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const y=S-p+1;i.lines.shiftElements(p+1,y-1,-1),i.lines.set(S,l.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(s,a,i){const l=this.buffer;if(s<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else s+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const p=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+s,l.ybase),0),p!==l.ydisp&&(a||this._onScroll.fire(l.ydisp))}};o.BufferService=v=h([d(0,m.IOptionsService)],v)},7994:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(C,o,c){var h=this&&this.__decorate||function(l,p,S,y){var E,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,p,S,y);else for(var T=l.length-1;T>=0;T--)(E=l[T])&&(x=(g<3?E(x):g>3?E(p,S,x):E(p,S))||x);return g>3&&x&&Object.defineProperty(p,S,x),x},d=this&&this.__param||function(l,p){return function(S,y){p(S,y,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),f=c(8460),_=c(844),m={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function v(l,p){let S=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(S|=64,S|=l.action):(S|=3&l.button,4&l.button&&(S|=64),8&l.button&&(S|=128),l.action===32?S|=32:l.action!==0||p||(S|=3)),S}const s=String.fromCharCode,a={DEFAULT:l=>{const p=[v(l,!1)+32,l.col+32,l.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${s(p[0])}${s(p[1])}${s(p[2])}`},SGR:l=>{const p=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.col};${l.row}${p}`},SGR_PIXELS:l=>{const p=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.x};${l.y}${p}`}};let i=o.CoreMouseService=class extends _.Disposable{constructor(l,p){super(),this._bufferService=l,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(m))this.addProtocol(S,m[S]);for(const S of Object.keys(a))this.addEncoding(S,a[S]);this.reset()}addProtocol(l,p){this._protocols[l]=p}addEncoding(l,p){this._encodings[l]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const p=this._encodings[this._activeEncoding](l);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,p,S){if(S){if(l.x!==p.x||l.y!==p.y)return!1}else if(l.col!==p.col||l.row!==p.row)return!1;return l.button===p.button&&l.action===p.action&&l.ctrl===p.ctrl&&l.alt===p.alt&&l.shift===p.shift}};o.CoreMouseService=i=h([d(0,u.IBufferService),d(1,u.ICoreService)],i)},6975:function(C,o,c){var h=this&&this.__decorate||function(i,l,p,S){var y,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,p,S);else for(var x=i.length-1;x>=0;x--)(y=i[x])&&(g=(E<3?y(g):E>3?y(l,p,g):y(l,p))||g);return E>3&&g&&Object.defineProperty(l,p,g),g},d=this&&this.__param||function(i,l){return function(p,S){l(p,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),f=c(8460),_=c(844),m=c(2585),v=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=o.CoreService=class extends _.Disposable{constructor(i,l,p){super(),this._bufferService=i,this._logService=l,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(s)}reset(){this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(s)}triggerDataEvent(i,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,(()=>i.split("").map((S=>S.charCodeAt(0))))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,(()=>i.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(i))}};o.CoreService=a=h([d(0,m.IBufferService),d(1,m.ILogService),d(2,m.IOptionsService)],a)},9074:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),d=c(8460),u=c(844),f=c(6106);let _=0,m=0;class v extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList((i=>i==null?void 0:i.marker.line)),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(i){if(i.marker.isDisposed)return;const l=new s(i);if(l){const p=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),p.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,l,p){let S=0,y=0;for(const E of this._decorations.getKeyIterator(l))S=E.options.x??0,y=S+(E.options.width??1),i>=S&&i<y&&(!p||(E.options.layer??"bottom")===p)&&(yield E)}forEachDecorationAtCell(i,l,p,S){this._decorations.forEachByKey(l,(y=>{_=y.options.x??0,m=_+(y.options.width??1),i>=_&&i<m&&(!p||(y.options.layer??"bottom")===p)&&S(y)}))}}o.DecorationService=v;class s extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),d=c(8343);class u{constructor(..._){this._entries=new Map;for(const[m,v]of _)this.set(m,v)}set(_,m){const v=this._entries.get(_);return this._entries.set(_,m),v}forEach(_){for(const[m,v]of this._entries.entries())_(m,v)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(f,_){this._services.set(f,_)}getService(f){return this._services.get(f)}createInstance(f,..._){const m=(0,d.getServiceDependencies)(f).sort(((a,i)=>a.index-i.index)),v=[];for(const a of m){const i=this._services.get(a.id);if(!i)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${a.id}.`);v.push(i)}const s=m.length>0?m[0].index:_.length;if(_.length!==s)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${s+1} conflicts with ${_.length} static arguments`);return new f(..._,...v)}}},7866:function(C,o,c){var h=this&&this.__decorate||function(s,a,i,l){var p,S=arguments.length,y=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,i):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,i,l);else for(var E=s.length-1;E>=0;E--)(p=s[E])&&(y=(S<3?p(y):S>3?p(a,i,y):p(a,i))||y);return S>3&&y&&Object.defineProperty(a,i,y),y},d=this&&this.__param||function(s,a){return function(i,l){a(i,l,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),f=c(2585),_={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let m,v=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(s){super(),this._optionsService=s,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),m=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(s){for(let a=0;a<s.length;a++)typeof s[a]=="function"&&(s[a]=s[a]())}_log(s,a,i){this._evalLazyOptionalParams(i),s.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...i)}trace(s,...a){var i;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,s,a)}debug(s,...a){var i;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,s,a)}info(s,...a){var i;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,s,a)}warn(s,...a){var i;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,s,a)}error(s,...a){var i;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,s,a)}};o.LogService=v=h([d(0,f.IOptionsService)],v),o.setTraceLogger=function(s){m=s},o.traceCall=function(s,a,i){if(typeof i.value!="function")throw new Error("not supported");const l=i.value;i.value=function(...p){if(m.logLevel!==f.LogLevelEnum.TRACE)return l.apply(this,p);m.trace(`GlyphRenderer#${l.name}(${p.map((y=>JSON.stringify(y))).join(", ")})`);const S=l.apply(this,p);return m.trace(`GlyphRenderer#${l.name} return`,S),S}}},7302:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),d=c(844),u=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends d.Disposable{constructor(v){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const s={...o.DEFAULT_OPTIONS};for(const a in v)if(a in s)try{const i=v[a];s[a]=this._sanitizeAndValidateOption(a,i)}catch(i){console.error(i)}this.rawOptions=s,this.options={...s},this._setupOptions(),this.register((0,d.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,s){return this.onOptionChange((a=>{a===v&&s(this.rawOptions[v])}))}onMultipleOptionChange(v,s){return this.onOptionChange((a=>{v.indexOf(a)!==-1&&s()}))}_setupOptions(){const v=a=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},s=(a,i)=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);i=this._sanitizeAndValidateOption(a,i),this.rawOptions[a]!==i&&(this.rawOptions[a]=i,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const i={get:v.bind(this,a),set:s.bind(this,a)};Object.defineProperty(this.options,a,i)}}_sanitizeAndValidateOption(v,s){switch(v){case"cursorStyle":if(s||(s=o.DEFAULT_OPTIONS[v]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(s))throw new Error(`"${s}" is not a valid value for ${v}`);break;case"wordSeparator":s||(s=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof s=="number"&&1<=s&&s<=1e3)break;s=f.includes(s)?s:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":s=Math.floor(s);case"lineHeight":case"tabStopWidth":if(s<1)throw new Error(`${v} cannot be less than 1, value: ${s}`);break;case"minimumContrastRatio":s=Math.max(1,Math.min(21,Math.round(10*s)/10));break;case"scrollback":if((s=Math.min(s,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${s}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${s}`);break;case"rows":case"cols":if(!s&&s!==0)throw new Error(`${v} must be numeric, value: ${s}`);break;case"windowsPty":s=s??{}}return s}}o.OptionsService=_},2660:function(C,o,c){var h=this&&this.__decorate||function(_,m,v,s){var a,i=arguments.length,l=i<3?m:s===null?s=Object.getOwnPropertyDescriptor(m,v):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(_,m,v,s);else for(var p=_.length-1;p>=0;p--)(a=_[p])&&(l=(i<3?a(l):i>3?a(m,v,l):a(m,v))||l);return i>3&&l&&Object.defineProperty(m,v,l),l},d=this&&this.__param||function(_,m){return function(v,s){m(v,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let f=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const m=this._bufferService.buffer;if(_.id===void 0){const p=m.addMarker(m.ybase+m.y),S={data:_,id:this._nextId++,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(S,p))),this._dataByLinkId.set(S.id,S),S.id}const v=_,s=this._getEntryIdKey(v),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,m.ybase+m.y),a.id;const i=m.addMarker(m.ybase+m.y),l={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(l,i))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(_,m){const v=this._dataByLinkId.get(_);if(v&&v.lines.every((s=>s.line!==m))){const s=this._bufferService.buffer.addMarker(m);v.lines.push(s),s.onDispose((()=>this._removeMarkerFromLink(v,s)))}}getLinkData(_){var m;return(m=this._dataByLinkId.get(_))==null?void 0:m.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,m){const v=_.lines.indexOf(m);v!==-1&&(_.lines.splice(v,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=f=h([d(0,u.IBufferService)],f)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[h]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const u=function(f,_,m){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,s,a){s[c]===s?s[h].push({id:v,index:a}):(s[h]=[{id:v,index:a}],s[c]=s)})(u,f,m)};return u.toString=()=>d,o.serviceRegistry.set(d,u),u}},2585:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var d;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(d||(o.LogLevelEnum=d={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),d=c(225);class u{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,m,v=!1){return(16777215&_)<<3|(3&m)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const _=new d.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let m=0,v=0;const s=_.length;for(let a=0;a<s;++a){let i=_.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=s)return m+this.wcwidth(i);const S=_.charCodeAt(a);56320<=S&&S<=57343?i=1024*(i-55296)+S-56320+65536:m+=this.wcwidth(S)}const l=this.charProperties(i,v);let p=u.extractWidth(l);u.extractShouldJoin(l)&&(p-=u.extractWidth(v)),m+=p,v=l}return m}charProperties(_,m){return this._activeProvider.charProperties(_,m)}}o.UnicodeService=u}},r={};function b(C){var o=r[C];if(o!==void 0)return o.exports;var c=r[C]={exports:{}};return n[C].call(c.exports,c,c.exports,b),c.exports}var k={};return(()=>{var C=k;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=b(9042),c=b(3236),h=b(844),d=b(5741),u=b(8285),f=b(7975),_=b(7090),m=["cols","rows"];class v extends h.Disposable{constructor(a){super(),this._core=this.register(new c.Terminal(a)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const i=p=>this._core.options[p],l=(p,S)=>{this._checkReadonlyOptions(p),this._core.options[p]=S};for(const p in this._core.options){const S={get:i.bind(this,p),set:l.bind(this,p)};Object.defineProperty(this._publicOptions,p,S)}}_checkReadonlyOptions(a){if(m.includes(a))throw new Error(`Option "${a}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const i in a)this._publicOptions[i]=a[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,i=!0){this._core.input(a,i)}resize(a,i){this._verifyIntegers(a,i),this._core.resize(a,i)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,i,l){this._verifyIntegers(a,i,l),this._core.select(a,i,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,i){this._verifyIntegers(a,i),this._core.selectLines(a,i)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,i){this._core.write(a,i)}writeln(a,i){this._core.write(a),this._core.write(`\r
|
|
10
|
-
`,i)}paste(a){this._core.paste(a)}refresh(a,i){this._verifyIntegers(a,i),this._core.refresh(a,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return o}_verifyIntegers(...a){for(const i of a)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const i of a)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}C.Terminal=v})(),k})()))})(Vs)),Vs.exports}var _u=fu(),Gs={exports:{}},po;function vu(){return po||(po=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(b){this._terminal=b}dispose(){}fit(){const b=this.proposeDimensions();if(!b||!this._terminal||isNaN(b.cols)||isNaN(b.rows))return;const k=this._terminal._core;this._terminal.rows===b.rows&&this._terminal.cols===b.cols||(k._renderService.clear(),this._terminal.resize(b.cols,b.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const b=this._terminal._core,k=b._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:b.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u=c-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),f=h-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(f/k.css.cell.width)),rows:Math.max(1,Math.floor(u/k.css.cell.height))}}}})(),n})()))})(Gs)),Gs.exports}var pu=vu(),Xs={exports:{}},go;function gu(){return go||(go=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={6:(C,o)=>{function c(d){try{const u=new URL(d),f=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return d.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(d,u,f,_={}){this._terminal=d,this._regex=u,this._handler=f,this._options=_}provideLinks(d,u){const f=h.computeLink(d,this._regex,this._terminal,this._handler);u(this._addCallbacks(f))}_addCallbacks(d){return d.map((u=>(u.leave=this._options.leave,u.hover=(f,_)=>{if(this._options.hover){const{range:m}=u;this._options.hover(f,_,m)}},u)))}};class h{static computeLink(u,f,_,m){const v=new RegExp(f.source,(f.flags||"")+"g"),[s,a]=h._getWindowedLineStrings(u-1,_),i=s.join("");let l;const p=[];for(;l=v.exec(i);){const S=l[0];if(!c(S))continue;const[y,E]=h._mapStrIdx(_,a,0,l.index),[g,x]=h._mapStrIdx(_,y,E,S.length);if(y===-1||E===-1||g===-1||x===-1)continue;const T={start:{x:E+1,y:y+1},end:{x,y:g+1}};p.push({range:T,text:S,activate:m})}return p}static _getWindowedLineStrings(u,f){let _,m=u,v=u,s=0,a="";const i=[];if(_=f.buffer.active.getLine(u)){const l=_.translateToString(!0);if(_.isWrapped&&l[0]!==" "){for(s=0;(_=f.buffer.active.getLine(--m))&&s<2048&&(a=_.translateToString(!0),s+=a.length,i.push(a),_.isWrapped&&a.indexOf(" ")===-1););i.reverse()}for(i.push(l),s=0;(_=f.buffer.active.getLine(++v))&&_.isWrapped&&s<2048&&(a=_.translateToString(!0),s+=a.length,i.push(a),a.indexOf(" ")===-1););}return[i,m]}static _mapStrIdx(u,f,_,m){const v=u.buffer.active,s=v.getNullCell();let a=_;for(;m;){const i=v.getLine(f);if(!i)return[-1,-1];for(let l=a;l<i.length;++l){i.getCell(l,s);const p=s.getChars();if(s.getWidth()&&(m-=p.length||1,l===i.length-1&&p==="")){const S=v.getLine(f+1);S&&S.isWrapped&&(S.getCell(0,s),s.getWidth()===2&&(m+=1))}if(m<0)return[f,l]}f++,a=0}return[f,a]}}o.LinkComputer=h}},r={};function b(C){var o=r[C];if(o!==void 0)return o.exports;var c=r[C]={exports:{}};return n[C](c,c.exports,b),c.exports}var k={};return(()=>{var C=k;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const o=b(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(d,u){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(d=h,u={}){this._handler=d,this._options=u}activate(d){this._terminal=d;const u=this._options,f=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,f,this._handler,u))}dispose(){var d;(d=this._linkProvider)==null||d.dispose()}}})(),k})()))})(Xs)),Xs.exports}var mu=gu();async function Et(t,e){const n=await fetch(`/api/${t}`,{headers:{"Content-Type":"application/json"},...e}),r=await n.json();if(!n.ok)throw new Error(r.error||`HTTP ${n.status}`);return r}function bu(){return Et("config")}function Su(t){switch(t){case"creating":case"running":case"starting":return"working";case"idle":return"waiting";case"stopped":return"done";case"error":return"error";default:return"idle"}}function wu(t){return{...t,ciChecks:t.ciChecks.map(e=>({...e})),comments:t.comments.map(e=>({...e}))}}function yu(t){var e;return{branch:t.branch,agent:Su(t.status),mux:t.mux?"✓":"",path:t.path,dir:t.dir,dirty:t.dirty,unpushed:t.unpushed,status:t.status,elapsed:t.elapsed,profile:t.profile,agentName:t.agentName,services:t.services.map(n=>({...n})),paneCount:t.paneCount,prs:t.prs.map(n=>wu(n)),linearIssue:t.linearIssue,creating:t.creation!==null,creationPhase:((e=t.creation)==null?void 0:e.phase)??null}}async function Cu(){return(await Et("project")).worktrees.map(e=>yu(e))}async function xu(){return(await Et("branches")).branches}function Eu(t){return Et("worktrees",{method:"POST",body:JSON.stringify({mode:t.mode,...t.branch?{branch:t.branch}:{},profile:t.profile,agent:t.agent,...t.prompt?{prompt:t.prompt}:{},...t.envOverrides&&Object.keys(t.envOverrides).length>0?{envOverrides:t.envOverrides}:{},...t.createLinearTicket?{createLinearTicket:!0}:{},...t.linearTitle?{linearTitle:t.linearTitle}:{}})})}function ku(t){return Et(`worktrees/${encodeURIComponent(t)}`,{method:"DELETE"})}function Lu(t){return Et(`worktrees/${encodeURIComponent(t)}/open`,{method:"POST"})}function Du(t){return Et(`worktrees/${encodeURIComponent(t)}/close`,{method:"POST"})}function Tu(t){return Et(`worktrees/${encodeURIComponent(t)}/merge`,{method:"POST"})}function Ru(){return Et("linear/issues")}function Au(t){return Et("linear/auto-create",{method:"PUT",body:JSON.stringify({enabled:t})})}async function Bu(t){return(await Et(`ci-logs/${t}`)).logs}async function Ua(t,e,n){await Et(`worktrees/${encodeURIComponent(t)}/send`,{method:"POST",body:JSON.stringify({text:e,...n?{preamble:n}:{}})})}function Mu(t,e,n){const r=new EventSource("/api/notifications/stream");return r.addEventListener("initial",b=>{try{const k=JSON.parse(b.data);n==null||n(k)}catch{}}),r.addEventListener("notification",b=>{try{const k=JSON.parse(b.data);t(k)}catch{}}),r.addEventListener("dismiss",b=>{try{const{id:k}=JSON.parse(b.data);e(k)}catch{}}),()=>r.close()}async function Ou(t){await Et(`notifications/${t}/dismiss`,{method:"POST"})}async function Pu(t,e){const n=new FormData;for(const k of e)n.append("files",k);const r=await fetch(`/api/worktrees/${encodeURIComponent(t)}/upload`,{method:"POST",body:n}),b=await r.json();if(!r.ok)throw new Error(b.error||`HTTP ${r.status}`);return b}function Iu(t){return Et(`worktrees/${encodeURIComponent(t)}/diff`)}var Hu=Z('<div class="absolute inset-0 z-10 flex items-center justify-center bg-black/50 border-2 border-dashed border-[var(--color-accent)] rounded pointer-events-none"><span class="text-white text-sm font-medium">Drop image(s) to upload</span></div>'),Nu=Z('<div class="flex-1 min-h-0 w-full p-1 overflow-hidden relative"><!></div>');function Fu(t,e){Ve(e,!0);let n=Ce(e,"isMobile",3,!1);const r=`\r
|
|
11
|
-
\x1B[90m[Disconnected]\x1B[0m`,b=`\r
|
|
12
|
-
\x1B[32m[Reconnected]\x1B[0m`;let k,C,o=!1,c,h=null,d,u,f=null,_=null,m=null,v=0,s=0,a=!1,i=!1,l=!0,p=ce(!1),S=0;function y(O){var $;if(($=navigator.clipboard)!=null&&$.writeText){navigator.clipboard.writeText(O).catch(()=>{});return}const V=document.createElement("textarea");V.value=O,V.style.position="fixed",V.style.opacity="0",document.body.appendChild(V),V.select(),document.execCommand("copy"),document.body.removeChild(V)}function E(O){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"selectPane",pane:O}))}function g(O){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:O}))}function x(){a=!1}function T(){return n()&&!!_&&C.modes.mouseTrackingMode!=="none"}function B(O){if(!T())return;const V=O.touches[0];V&&(v=V.pageX,s=V.pageY,a=!1)}function P(O){const V=O.touches[0];if(!T()||!_||!V)return;const $=v-V.pageX,ae=s-V.pageY;if(v=V.pageX,s=V.pageY,!a){if(Math.abs(ae)<=Math.abs($))return;a=!0}if(ae===0)return;if(!(_.scrollHeight>_.clientHeight)){M(ae,V),O.preventDefault();return}_.scrollTop+=ae,O.preventDefault()}function M(O,V){if(!f)return;const $=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:V.clientX,clientY:V.clientY,deltaMode:WheelEvent.DOM_DELTA_PIXEL,deltaY:O});f.dispatchEvent($)}function H(){const O=k.querySelector(".xterm"),V=k.querySelector(".xterm-viewport");!(O instanceof HTMLElement)||!(V instanceof HTMLElement)||(f=O,_=V,O.addEventListener("touchstart",B,{passive:!0}),O.addEventListener("touchmove",P,{passive:!1}),O.addEventListener("touchend",x),O.addEventListener("touchcancel",x),m=()=>{O.removeEventListener("touchstart",B),O.removeEventListener("touchmove",P),O.removeEventListener("touchend",x),O.removeEventListener("touchcancel",x),f=null,_=null})}function W(O){return O?O.types.includes("Files")||O.types.includes("text/uri-list"):!1}function J(O){W(O.dataTransfer)&&(O.preventDefault(),S++,U(p,!0))}function ee(O){w(p)&&(O.preventDefault(),O.dataTransfer&&(O.dataTransfer.dropEffect="copy"))}function Y(O){S--,S<=0&&(S=0,U(p,!1))}function L(O){const V=O.match(/<img[^>]+src=["']([^"']+)["']/i);return V?V[1]:null}async function A(O){var ae,se,de;O.preventDefault(),O.stopPropagation(),S=0,U(p,!1);const V=O.dataTransfer;if(!V)return;let $=Array.from(V.files).filter(ve=>ve.type.startsWith("image/"));if($.length===0){const ve=V.getData("text/html"),re=V.getData("text/uri-list"),fe=(ve?L(ve):null)??re;if(fe)try{const De=fe.match(/^data:(image\/[^;]+);base64,(.+)/);if(De){const Ie=atob(De[2]),ot=new Uint8Array(Ie.length);for(let Se=0;Se<Ie.length;Se++)ot[Se]=Ie.charCodeAt(Se);const Fe=((ae=De[1].split("/")[1])==null?void 0:ae.replace("+xml",""))||"png";$=[new File([ot],`image.${Fe}`,{type:De[1]})]}else if(/^https?:\/\//i.test(fe)){const Ie=await fetch(fe),ot=Ie.headers.get("content-type")??"",Fe=parseInt(Ie.headers.get("content-length")??"0",10);if(Ie.ok&&ot.startsWith("image/")&&Fe<=10*1024*1024){const Se=await Ie.blob(),et=((de=(se=fe.split("/").pop())==null?void 0:se.split("?")[0])==null?void 0:de.split("#")[0])||"image.png";$=[new File([Se],et,{type:Se.type})]}}}catch{}}$.length!==0&&await R($)}async function R(O){try{const $=(await Pu(e.worktree,O)).files.map(ae=>ae.path).join(" ");g($)}catch(V){const $=V instanceof Error?V.message:String(V);C.writeln(`\r
|
|
13
|
-
\x1B[31m[Upload error: ${$}]\x1B[0m`)}}function I(O){const V=O.clipboardData;if(!V)return;const $=[];for(const ae of V.items)if(ae.kind==="file"&&ae.type.startsWith("image/")){const se=ae.getAsFile();se&&$.push(se)}$.length!==0&&(O.preventDefault(),O.stopPropagation(),R($))}function F(){const O={type:"resize",cols:C.cols,rows:C.rows,...n()&&e.initialPane!==void 0?{initialPane:e.initialPane}:{}};return JSON.stringify(O)}function Q(O=!1){if(i||(h==null?void 0:h.readyState)===WebSocket.OPEN||(h==null?void 0:h.readyState)===WebSocket.CONNECTING)return;const V=location.protocol==="https:"?"wss:":"ws:",$=new WebSocket(`${V}//${location.host}/ws/${encodeURIComponent(e.worktree)}`);h=$,$.onmessage=ae=>{const se=ae.data,de=se[0];if(de==="o"||de==="s"){C.write(se.slice(1));return}try{const ve=JSON.parse(se);switch(ve.type){case"exit":C.writeln(`\r
|
|
14
|
-
\x1B[33m[Process exited with code ${ve.exitCode}]\x1B[0m`);break;case"error":C.writeln(`\r
|
|
15
|
-
\x1B[31m[Error: ${ve.message}]\x1B[0m`);break}}catch{}},$.onerror=()=>{},$.onopen=()=>{h===$&&(l=!0,c.fit(),O&&C.writeln(b),requestAnimationFrame(()=>{c.fit(),C.focus()}),$.send(F()))},$.onclose=()=>{h===$&&(h=null,!i&&(C.writeln(r),!document.hidden&&l&&(l=!1,Q(!0))))}}function ie(){document.hidden||Q(!0)}Hn(()=>{C=new _u.Terminal({cursorBlink:!0,theme:e.terminalTheme,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:n()?13:11,scrollback:1e4}),c=new pu.FitAddon,C.loadAddon(c),C.loadAddon(new mu.WebLinksAddon),C.open(k),H(),k.addEventListener("contextmenu",O=>O.preventDefault()),k.addEventListener("paste",I,!0),C.parser.registerOscHandler(52,O=>{const V=O.indexOf(";");if(V!==-1){const $=O.slice(V+1);try{y(atob($))}catch{}}return!0}),C.onSelectionChange(()=>{const O=C.getSelection();O&&y(O)}),C.attachCustomKeyEventHandler(O=>{if(O.key==="Enter"&&O.shiftKey&&!O.ctrlKey&&!O.metaKey&&!O.altKey)return O.type==="keydown"&&(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(O.type!=="keydown")return!0;const V=O.metaKey||O.ctrlKey;return V&&(O.key==="c"||O.key==="C")?C.hasSelection()?(y(C.getSelection()),C.clearSelection(),!1):!0:!(V&&(O.key==="ArrowUp"||O.key==="ArrowDown")||V&&(O.key==="k"||O.key==="K")||V&&(O.key==="m"||O.key==="M")||V&&(O.key==="d"||O.key==="D"))}),requestAnimationFrame(()=>{c.fit(),C.focus()}),Q(),C.onData(O=>{(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:O}))}),d=new ResizeObserver(()=>{clearTimeout(u),u=setTimeout(()=>{c.fit(),(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},150)}),d.observe(k),document.addEventListener("visibilitychange",ie),window.addEventListener("focus",ie),window.addEventListener("online",ie),o=!0}),pt(()=>{o&&e.terminalTheme&&C.options&&(C.options.theme=e.terminalTheme)}),jc(()=>{i=!0,clearTimeout(u),m==null||m(),d==null||d.disconnect(),k==null||k.removeEventListener("paste",I,!0),document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",ie),window.removeEventListener("online",ie),h==null||h.close(),C==null||C.dispose()});var he={sendSelectPane:E,sendInput:g},N=Nu(),D=j(N);{var K=O=>{var V=Hu();q(O,V)};ne(D,O=>{w(p)&&O(K)})}return Ui(N,O=>k=O,()=>k),vr("dragenter",N,J),vr("dragover",N,ee),vr("dragleave",N,Y),vr("drop",N,A),q(t,N),Ge(he)}var Wu=Z('<dialog><div class="p-6"><!></div></dialog>');function Zr(t,e){Ve(e,!0);let n=Ce(e,"wide",3,!1),r=Ce(e,"maxWidth",3,""),b=Ce(e,"className",3,""),k;pt(()=>{k==null||k.showModal()});var C=Wu();let o;var c=j(C),h=j(c);In(h,()=>e.children),Ui(C,d=>k=d,()=>k),le(()=>{Re(C,1,`bg-sidebar text-primary border border-edge rounded-xl w-[90%] ${r()?"":n()?"max-w-[560px]":"max-w-[380px]"} ${b()??""}`),o=ar(C,"",o,{"max-width":r()||void 0})}),vr("close",C,function(...d){var u;(u=e.onclose)==null||u.apply(this,d)}),pe("click",C,d=>{d.target===k&&k.close()}),q(t,C),Ge()}xt(["click"]);var Uu=Z('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),ju=Z('<span class="spinner"></span>'),zu=Z("<!> ",1),Ku=Z('<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 mo(t,e){Ve(e,!0);let n=Ce(e,"loading",3,!1),r=Ce(e,"error",3,""),b=Ce(e,"confirmLabel",3,"Remove"),k=Ce(e,"variant",3,"danger");Zr(t,{get onclose(){return e.oncancel},children:(C,o)=>{var c=Ku(),h=G(j(c),2),d=j(h),u=G(h,2);{var f=s=>{var a=Uu(),i=j(a);le(()=>oe(i,r())),q(s,a)};ne(u,s=>{r()&&s(f)})}var _=G(u,2),m=j(_);ut(m,{type:"button",get onclick(){return e.oncancel},get disabled(){return n()},children:(s,a)=>{var i=qe("Cancel");q(s,i)},$$slots:{default:!0}});var v=G(m,2);{let s=ue(()=>k()==="accent"?"cta":"danger");ut(v,{type:"submit",get variant(){return w(s)},class:"flex items-center gap-1.5",get disabled(){return n()},autofocus:!0,children:(a,i)=>{var l=zu(),p=Pe(l);{var S=E=>{var g=ju();q(E,g)};ne(p,E=>{n()&&E(S)})}var y=G(p);le(()=>oe(y,` ${b()??""}`)),q(a,l)},$$slots:{default:!0}})}le(()=>oe(d,e.message)),vr("submit",c,s=>{s.preventDefault(),e.onconfirm()}),q(C,c)},$$slots:{default:!0}}),Ge()}var $u=Z('<button type="button" role="switch"><span class="knob svelte-1ljwtyv"></span></button>');function Nn(t,e){Ve(e,!0);let n=Ce(e,"checked",15,!1),r=Ce(e,"disabled",3,!1);var b=$u();let k;le(()=>{xe(b,"aria-checked",n()),xe(b,"aria-label",e["aria-label"]),xe(b,"id",e.id),b.disabled=r(),k=Re(b,1,"toggle svelte-1ljwtyv",null,k,{on:n()})}),pe("click",b,()=>{n(!n())}),q(t,b),Ge()}xt(["click"]);var qu=Z('<div class="mb-3"><label class="flex items-center gap-2 text-xs text-muted cursor-pointer"><!> </label></div>'),Vu=Z('<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>'),Gu=Z('<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 Xu(t,e){Ve(e,!0);let n=Ce(e,"startupEnvs",19,()=>({})),r=Ce(e,"envValues",31,()=>Ae({})),b=ue(()=>Object.keys(n()));var k=mt(),C=Pe(k);{var o=c=>{var h=Gu(),d=G(j(h),2);Xe(d,20,()=>w(b),u=>u,(u,f)=>{var _=mt(),m=Pe(_);{var v=a=>{var i=qu(),l=j(i),p=j(l),S=()=>r()[f],y=g=>r(r()[f]=g,!0);Nn(p,{get"aria-label"(){return f},get checked(){return S()},set checked(g){y(g)}});var E=G(p);le(()=>oe(E,` ${f??""}`)),q(a,i)},s=a=>{var i=Vu(),l=j(i),p=j(l),S=G(l,2);le(()=>{xe(l,"for",`wt-env-${f??""}`),oe(p,f),xe(S,"id",`wt-env-${f??""}`)}),Fr(S,()=>r()[f],y=>r(r()[f]=y,!0)),q(a,i)};ne(m,a=>{typeof n()[f]=="boolean"?a(v):a(s,-1)})}q(u,_)}),q(c,h)};ne(C,c=>{w(b).length>0&&c(o)})}q(t,k),Ge()}var Yu=Z('<p class="mt-2 text-[11px] text-muted">The worktree branch will use the Linear ticket branch name.</p>'),Ju=Z('<button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use existing branch</button>'),Zu=Z('<label class="block text-xs text-muted mb-1.5" for="wt-name">Branch 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"/> <!>',1),Qu=Z('<p class="px-3 py-2 text-xs text-muted">Loading branches...</p>'),ed=Z('<p class="px-3 py-2 text-xs text-muted"> </p>'),td=Z('<p class="px-3 py-2 text-xs text-muted">No matching branches</p>'),rd=Z('<span class="text-[10px] text-accent">Selected</span>'),id=Z('<li><button type="button"><span class="font-mono text-primary"> </span> <!></button></li>'),sd=Z('<div class="border-b border-edge px-3 py-2 text-[11px] text-muted"> </div> <ul class="max-h-48 overflow-y-auto py-1"></ul>',1),nd=Z('<div class="mt-2 rounded-lg border border-edge bg-surface/60"><div class="border-b border-edge p-2"><input type="text" class="w-full rounded-md border border-edge bg-surface px-2.5 py-1.5 text-[12px] text-primary placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Search branches..."/></div> <!></div>'),od=Z('<div><span class="block text-xs text-muted mb-1.5">Existing branch</span> <button type="button" class="flex w-full items-center justify-between gap-3 rounded-md border border-edge bg-surface px-2.5 py-1.5 text-left text-[13px] text-primary outline-none transition-colors hover:bg-hover focus:border-accent"><span> </span> <span class="text-[11px] text-muted"> </span></button> <!></div> <button type="button" class="mt-2 text-[11px] text-accent hover:underline">Create new branch instead</button> <p class="mt-2 text-[11px] text-muted">Removing this worktree will also delete the branch.</p>',1),ad=Z('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),ld=Z('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),cd=Z('<div class="flex flex-col gap-2 mb-6"></div>'),hd=Z('<div class="mt-3"><label class="block text-xs text-muted mb-1.5" for="wt-linear-title">Linear ticket title <span class="opacity-60">(optional)</span></label> <input id="wt-linear-title" 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="Defaults to the first non-empty line of the prompt"/></div>'),ud=Z('<div class="mb-4 rounded-lg border border-edge bg-surface/40 p-3"><div class="flex items-start justify-between gap-3"><div><p class="text-[13px] text-primary">Create Linear ticket</p> <p class="mt-1 text-[11px] text-muted">Creates the ticket first, uses the prompt as the ticket description, and uses the ticket branch name for the worktree.</p></div> <!></div> <!></div>'),dd=Z('<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"> </span></label> <textarea id="wt-prompt" rows="4" 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"></textarea></div> <div class="mb-4"><!></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 fd(t,e){Ve(e,!0);let n=Ce(e,"profiles",19,()=>[]),r=Ce(e,"defaultProfileName",3,""),b=Ce(e,"autoNameEnabled",3,!1),k=Ce(e,"initialBranch",3,""),C=Ce(e,"initialPrompt",3,""),o=Ce(e,"availableBranches",19,()=>[]),c=Ce(e,"availableBranchesLoading",3,!1),h=Ce(e,"availableBranchesError",3,null),d=Ce(e,"startupEnvs",19,()=>({})),u=Ce(e,"linearCreateTicketOption",3,!1),f=Ce(e,"openedFromLinearIssue",3,!1);const _=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}],m="wt-default-profile",v="wt-default-agent",s="wt-default-envs",a=localStorage.getItem(m),i=localStorage.getItem(v),l=localStorage.getItem(s);let p=ue(()=>{var $;return r()||(($=n()[0])==null?void 0:$.name)||"default"}),S=ce("new"),y=ce(Ae(k())),E=ce(Ae(C())),g=ce(""),x=ce(""),T=ce(!1),B=ce(Ae(i==="codex"?"codex":"claude")),P=ce(Ae(a??"")),M=ce(!1),H=ce("");const W=a!=null||i!=null||l!=null;let J=ce(Ae(W)),ee=ce(void 0),Y=ce(void 0);function L(){if(!l)return{...d()};try{const $=JSON.parse(l),ae=Object.fromEntries(Object.entries($).filter(([se])=>se in d()));return{...d(),...ae}}catch{return{...d()}}}let A=ce(Ae(L()));function R($){$.focus()}let I=ue(()=>w(x).trim()?o().filter($=>Sn(w(x),$.name)):o()),F=ue(()=>u()&&!f()&&w(S)==="new"),Q=ue(()=>w(F)&&w(M)),ie=ue(()=>(w(S)==="new"||w(g).length>0)&&(!w(Q)||w(E).trim().length>0));pt(()=>{n().some($=>$.name===w(P))||U(P,w(p),!0)}),pt(()=>{w(F)||(U(M,!1),U(H,""))});function he($){U(g,$,!0),U(x,""),U(T,!1)}function N(){queueMicrotask(()=>{var $;return($=w(Y))==null?void 0:$.focus()})}function D(){U(S,"existing"),U(T,!0),!w(g)&&k().trim().length>0&&U(g,k().trim(),!0),U(x,""),N()}function K(){U(S,"new"),U(T,!1),U(x,"")}function O($){var se;const ae=$.relatedTarget;ae instanceof Node&&((se=w(ee))!=null&&se.contains(ae))||(U(T,!1),U(x,""))}function V(){if(U(T,!w(T)),!w(T)){U(x,"");return}N()}Zr(t,{get onclose(){return e.oncancel},className:"md:max-w-[440px]",children:($,ae)=>{var se=dd(),de=G(j(se),2),ve=j(de),re=G(j(ve)),fe=j(re),De=G(ve,2);Xc(De,we=>R==null?void 0:R(we)),Gi(()=>Fr(De,()=>w(E),we=>U(E,we)));var Ie=G(de,2),ot=j(Ie);{var Fe=we=>{var Be=Zu(),He=G(Pe(Be),2),ke=G(He,2);{var tt=Ke=>{var Wt=Yu();q(Ke,Wt)},lt=Ke=>{var Wt=Ju();pe("click",Wt,D),q(Ke,Wt)};ne(ke,Ke=>{w(M)?Ke(tt):Ke(lt,-1)})}le(()=>{xe(He,"placeholder",w(M)?"Generated from the Linear ticket":b()?"generated from prompt if empty":"auto-generated if empty"),He.disabled=w(M)}),Fr(He,()=>w(y),Ke=>U(y,Ke)),q(we,Be)},Se=we=>{var Be=od(),He=Pe(Be),ke=G(j(He),2),tt=j(ke),lt=j(tt),Ke=G(tt,2),Wt=j(Ke),ki=G(ke,2);{var Qr=wr=>{var Li=nd(),Ji=j(Li),ei=j(Ji);Ui(ei,We=>U(Y,We),()=>w(Y));var ti=G(Ji,2);{var Zi=We=>{var Ut=Qu();q(We,Ut)},Rs=We=>{var Ut=ed(),ri=j(Ut);le(()=>oe(ri,`Failed to load branches: ${h()??""}`)),q(We,Ut)},As=We=>{var Ut=td();q(We,Ut)},Qi=We=>{var Ut=sd(),ri=Pe(Ut),Bs=j(ri),Ms=G(ri,2);Xe(Ms,21,()=>w(I),Di=>Di.name,(Di,ii)=>{var Ti=id(),Ri=j(Ti),Ai=j(Ri),Os=j(Ai),es=G(Ai,2);{var Ps=si=>{var Is=rd();q(si,Is)};ne(es,si=>{w(g)===w(ii).name&&si(Ps)})}le(()=>{Re(Ri,1,`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-[12px] transition-colors hover:bg-hover
|
|
16
|
-
${w(g)===w(ii).name?"bg-accent/10":""}`),oe(Os,w(ii).name)}),pe("click",Ri,()=>he(w(ii).name)),q(Di,Ti)}),le(()=>oe(Bs,`${(w(I).length!==o().length?`${w(I).length}/${o().length}`:o().length)??""}
|
|
17
|
-
available`)),q(We,Ut)};ne(ti,We=>{c()?We(Zi):h()?We(Rs,1):w(I).length===0?We(As,2):We(Qi,-1)})}pe("keydown",ei,We=>{We.key==="Enter"&&!We.shiftKey&&(We.preventDefault(),w(I)[0]&&he(w(I)[0].name)),We.key==="Escape"&&(We.preventDefault(),U(T,!1),U(x,""))}),Fr(ei,()=>w(x),We=>U(x,We)),q(wr,Li)};ne(ki,wr=>{w(T)&&wr(Qr)})}Ui(He,wr=>U(ee,wr),()=>w(ee));var Ts=G(He,2);le(()=>{xe(ke,"aria-expanded",w(T)),Re(tt,1,Cs(w(g)?"font-mono":"text-muted/50")),oe(lt,w(g)||"Select a branch"),oe(Wt,w(T)?"▴":"▾")}),pe("focusout",He,O),pe("click",ke,V),pe("click",Ts,K),q(we,Be)};ne(ot,we=>{w(S)==="new"?we(Fe):we(Se,-1)})}var et=G(Ie,2);Xu(et,{get startupEnvs(){return d()},get envValues(){return w(A)},set envValues(we){U(A,we,!0)}});var je=G(et,2);Xe(je,21,()=>_,Wi,(we,Be)=>{var He=ad(),ke=j(He),tt=G(ke);le(()=>{Re(He,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
18
|
-
${w(B)===w(Be).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),lo(ke,w(Be).value),gn(ke,w(B)===w(Be).value),oe(tt,` ${w(Be).label??""}`)}),pe("change",ke,()=>U(B,w(Be).value,!0)),q(we,He)});var at=G(je,2);{var Xt=we=>{var Be=cd();Xe(Be,21,n,Wi,(He,ke)=>{var tt=ld(),lt=j(tt),Ke=G(lt);le(()=>{Re(tt,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
19
|
-
${w(P)===w(ke).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),lo(lt,w(ke).name),gn(lt,w(P)===w(ke).name),oe(Ke,` ${w(ke).name??""}`)}),pe("change",lt,()=>U(P,w(ke).name,!0)),q(He,tt)}),q(we,Be)};ne(at,we=>{n().length>1&&we(Xt)})}var bt=G(at,2),Sr=j(bt),Ee=G(bt,2);{var Yt=we=>{var Be=ud(),He=j(Be),ke=G(j(He),2);Nn(ke,{"aria-label":"Create Linear ticket",get checked(){return w(M)},set checked(Ke){U(M,Ke,!0)}});var tt=G(He,2);{var lt=Ke=>{var Wt=hd(),ki=G(j(Wt),2);Fr(ki,()=>w(H),Qr=>U(H,Qr)),q(Ke,Wt)};ne(tt,Ke=>{w(M)&&Ke(lt)})}q(we,Be)};ne(Ee,we=>{w(F)&&we(Yt)})}var Oe=G(Ee,2),Mr=j(Oe);ut(Mr,{type:"button",get onclick(){return e.oncancel},children:(we,Be)=>{var He=qe("Cancel");q(we,He)},$$slots:{default:!0}});var Ds=G(Mr,2);{let we=ue(()=>!w(ie));ut(Ds,{type:"submit",variant:"cta",get disabled(){return w(we)},children:(Be,He)=>{var ke=qe("Create");q(Be,ke)},$$slots:{default:!0}})}le(()=>{oe(fe,`(${w(Q)?"required":"optional"})`),xe(De,"placeholder",w(M)?"Describe the task for the agent. This will also be used as the Linear ticket description...":"Describe the task for the agent...")}),vr("submit",se,we=>{if(we.preventDefault(),!w(ie))return;w(J)?(localStorage.setItem(m,w(P)),localStorage.setItem(v,w(B)),localStorage.setItem(s,JSON.stringify(w(A)))):(localStorage.removeItem(m),localStorage.removeItem(v),localStorage.removeItem(s));const Be={};for(const[tt,lt]of Object.entries(w(A)))typeof lt=="boolean"?lt&&(Be[tt]="true"):lt&&(Be[tt]=lt);const He=w(E).trim(),ke=w(S)==="existing"?w(g):w(y).trim();e.oncreate({mode:w(S),...ke&&!(w(S)==="new"&&w(M))?{branch:ke}:{},profile:w(P),agent:w(B),...He?{prompt:He}:{},...Object.keys(Be).length>0?{envOverrides:Be}:{},...w(M)?{createLinearTicket:!0}:{},...w(M)&&w(H).trim()?{linearTitle:w(H).trim()}:{}})}),pe("keydown",De,we=>{var Be;we.key==="Enter"&&!we.shiftKey&&(we.preventDefault(),(Be=we.currentTarget.form)==null||Be.requestSubmit())}),oh(Sr,()=>w(J),we=>U(J,we)),q($,se)},$$slots:{default:!0}}),Ge()}xt(["keydown","click","focusout","change"]);var _d=Z('<span class="w-3 h-3 rounded-full border border-edge"></span>'),vd=Z('<button type="button"><span class="shrink-0 flex gap-0.5"></span> <span> </span></button>'),pd=Z('<form><h2 class="text-base mb-4">Settings</h2> <div class="mb-5"><span class="block text-xs text-muted mb-2">Theme</span> <div class="grid grid-cols-2 gap-2"></div></div> <div class="mb-5"><span class="block text-xs text-muted mb-2">Linear</span> <div class="flex items-center justify-between gap-3 px-3 py-2 rounded-md border border-edge bg-surface"><div><span class="text-[13px] text-primary">Auto-create worktrees</span> <p class="text-[11px] text-muted mt-0.5">Automatically create worktrees for Todo Linear tickets with the "webmux" label.</p></div> <!></div></div> <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 gd(t,e){Ve(e,!0);const n=e.linearAutoCreate;let r=ce(Ae(localStorage.getItem(ls)??"")),b=ce(Ae(n)),k=ce(!1),C=n;pt(()=>{if(w(b)===C)return;const h=w(b);C=h,U(k,!0),Au(h).then(d=>{U(b,d.enabled,!0),C=d.enabled,e.onlinearautocreatechange(d.enabled)}).catch(()=>{U(b,!h),C=!h}).finally(()=>{U(k,!1)})});function o(){const h=w(r).trim();h?localStorage.setItem(ls,h):localStorage.removeItem(ls),e.onsave(h)}function c(h){Ia(h),e.onthemechange(h)}Zr(t,{get onclose(){return e.onclose},wide:!0,children:(h,d)=>{var u=pd(),f=G(j(u),2),_=G(j(f),2);Xe(_,21,()=>mn,y=>y.key,(y,E)=>{var g=vd(),x=j(g);Xe(x,21,()=>[w(E).colors.surface,w(E).colors.accent,w(E).colors.success,w(E).colors.warning],Wi,(P,M)=>{var H=_d();le(()=>ar(H,`background:${w(M)??""}`)),q(P,H)});var T=G(x,2),B=j(T);le(()=>{Re(g,1,`flex items-center gap-2.5 px-3 py-2 rounded-md border cursor-pointer text-left text-[13px] transition-colors ${e.currentTheme===w(E).key?"border-accent bg-active text-primary":"border-edge bg-surface text-muted hover:bg-hover hover:text-primary"}`),oe(B,w(E).label)}),pe("click",g,()=>c(w(E).key)),q(y,g)});var m=G(f,2),v=G(j(m),2),s=G(j(v),2);Nn(s,{get disabled(){return w(k)},"aria-label":"Auto-create worktrees for Linear tickets",get checked(){return w(b)},set checked(y){U(b,y,!0)}});var a=G(m,2),i=G(j(a),2),l=G(a,2),p=j(l);ut(p,{type:"button",get onclick(){return e.onclose},children:(y,E)=>{var g=qe("Cancel");q(y,g)},$$slots:{default:!0}});var S=G(p,2);ut(S,{type:"submit",variant:"cta",children:(y,E)=>{var g=qe("Save");q(y,g)},$$slots:{default:!0}}),vr("submit",u,y=>{y.preventDefault(),o()}),Fr(i,()=>w(r),y=>U(r,y)),q(h,u)},$$slots:{default:!0}}),Ge()}xt(["click"]);function md(t){return t.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function ja(t,e=3e4){const r=md(t).replace(/\r\n/g,`
|
|
20
|
-
`).replace(/\r/g,`
|
|
21
|
-
`).replace(/[^\x09\x0A\x20-\x7E]/g,"");return r.length>e?`[... truncated]
|
|
22
|
-
`+r.slice(-e):r}var bd=Z("<button><!></button>");function cs(t,e){let n=Ba(e,["$$slots","$$events","$$legacy","children"]);var r=bd();Ra(r,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",...n}));var b=j(r);In(b,()=>e.children),q(t,r)}var Sd=Z('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub ↗</a>'),wd=Z('<div class="text-[12px] text-muted py-2 mt-2">Loading logs...</div>'),yd=Z('<div class="mt-2"><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></div>'),Cd=Z('<div class="text-[12px] text-danger py-2 mt-2"> </div>'),xd=Z('<div class="text-[12px] text-danger py-1.5"> </div>'),Ed=Z('<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>'),kd=Z('<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 Ld(t,e){Ve(e,!0);let n=ce(Ae(new Map)),r=ce(Ae(new Set)),b=ce(null),k=ce(""),C=ce(!1),o=ce(!1),c=ce(""),h=ue(()=>Es(e.pr));function d(i){return`${i.name}:${i.runId}`}function u(i){if(i.runId===null)return"";const l=w(n).get(i.runId);if(!l)return"";const p=i.name+" ";return l.split(`
|
|
23
|
-
`).filter(S=>S.startsWith(p)).map(S=>S.slice(p.length)).join(`
|
|
24
|
-
`)}function f(i){w(r).has(i)?w(r).delete(i):w(r).add(i),U(r,new Set(w(r)),!0)}async function _(i){const l=d(i);if(w(n).has(i.runId)){f(l);return}w(r).add(l),U(r,new Set(w(r)),!0),U(k,""),U(b,i.runId,!0);try{const p=await Bu(i.runId);w(n).set(i.runId,p),U(n,new Map(w(n)),!0)}catch(p){U(k,tr(p),!0),w(r).delete(l),U(r,new Set(w(r)),!0)}finally{U(b,null)}}async function m(i,l){if(!e.branch)return;U(c,""),U(o,!0);const p=["Fix the failing CI check.",`PR: ${w(h)}`,`Check: ${i}`,"","Logs:"].join(`
|
|
25
|
-
`)+`
|
|
26
|
-
`,S=ja(l);try{await Ua(e.branch,S,p),e.onfixsuccess()}catch(y){U(c,tr(y),!0)}finally{U(o,!1)}}async function v(i){await navigator.clipboard.writeText(i),U(C,!0),setTimeout(()=>{U(C,!1)},2e3)}function s(i){return i==="success"?"✓":i==="failed"?"✗":i==="skipped"?"—":"○"}function a(i){return i==="success"?"text-success":i==="failed"?"text-danger":i==="pending"?"text-warning":"text-muted"}Zr(t,{get onclose(){return e.onclose},wide:!0,children:(i,l)=>{var p=kd(),S=Pe(p),y=j(S),E=G(S,2);Xe(E,21,()=>e.pr.ciChecks,T=>T.name+T.runId,(T,B)=>{const P=ue(()=>d(w(B))),M=ue(()=>w(B).runId!==null&&w(n).has(w(B).runId)),H=ue(()=>w(r).has(w(P))),W=ue(()=>w(H)?u(w(B)):"");var J=Ed(),ee=j(J),Y=j(ee),L=j(Y),A=G(Y,2),R=j(A),I=G(A,2),F=j(I),Q=G(ee,2),ie=j(Q);{var he=re=>{var fe=mt(),De=Pe(fe);{var Ie=Fe=>{cs(Fe,{onclick:()=>f(w(P)),children:(Se,et)=>{var je=qe();le(()=>oe(je,w(H)?"Hide logs":"Show logs")),q(Se,je)},$$slots:{default:!0}})},ot=Fe=>{cs(Fe,{onclick:()=>_({runId:w(B).runId,name:w(B).name}),children:(Se,et)=>{var je=qe("View logs");q(Se,je)},$$slots:{default:!0}})};ne(De,Fe=>{w(M)?Fe(Ie):Fe(ot,-1)})}q(re,fe)};ne(ie,re=>{w(B).status==="failed"&&w(B).runId!==null&&re(he)})}var N=G(ie,2);{var D=re=>{var fe=Sd();le(()=>xe(fe,"href",w(B).url)),q(re,fe)};ne(N,re=>{w(B).url&&re(D)})}var K=G(Q,2);{var O=re=>{var fe=wd();q(re,fe)},V=re=>{var fe=yd(),De=j(fe),Ie=j(De),ot=G(De,2),Fe=j(ot);cs(Fe,{onclick:()=>v(w(W)),children:(et,je)=>{var at=qe();le(()=>oe(at,w(C)?"Copied!":"Copy logs")),q(et,at)},$$slots:{default:!0}});var Se=G(Fe,2);{let et=ue(()=>!e.branch||w(o));ut(Se,{variant:"cta",small:!0,get disabled(){return w(et)},onclick:()=>m(w(B).name,w(W)),children:(je,at)=>{var Xt=qe();le(()=>oe(Xt,w(o)?"Asking agent...":"Ask agent to fix")),q(je,Xt)},$$slots:{default:!0}})}le(()=>oe(Ie,w(W))),q(re,fe)};ne(K,re=>{w(B).runId!==null&&w(b)===w(B).runId&&w(H)?re(O):w(H)&&w(W)&&re(V,1)})}var $=G(K,2);{var ae=re=>{var fe=Cd(),De=j(fe);le(()=>oe(De,w(k))),q(re,fe)},se=ue(()=>w(k)&&w(b)===null&&w(B).runId!==null&&!w(n).has(w(B).runId));ne($,re=>{w(se)&&re(ae)})}var de=G($,2);{var ve=re=>{var fe=xd(),De=j(fe);le(()=>oe(De,w(c))),q(re,fe)};ne(de,re=>{w(c)&&re(ve)})}le((re,fe,De)=>{Re(Y,1,`text-sm font-bold ${re??""}`),oe(L,fe),oe(R,w(B).name),Re(I,1,`text-[11px] ${De??""}`),oe(F,w(B).status)},[()=>a(w(B).status),()=>s(w(B).status),()=>a(w(B).status)]),q(T,J)});var g=G(E,2),x=j(g);ut(x,{type:"button",get onclick(){return e.onclose},children:(T,B)=>{var P=qe("Close");q(T,P)},$$slots:{default:!0}}),le(()=>oe(y,`CI Checks — ${w(h)??""}`)),q(i,p)},$$slots:{default:!0}}),Ge()}var Dd=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],Td=["difference","intersection","symmetricDifference","union"],bo=!1,mi,qt,Er,vs,xi,za,Ka;const ps=class ps extends Set{constructor(n){super();ge(this,xi);ge(this,mi,new Map);ge(this,qt,ce(0));ge(this,Er,ce(0));ge(this,vs,mr||-1);if(n){for(var r of n)super.add(r);X(this,Er).v=super.size}bo||$e(this,xi,Ka).call(this)}has(n){var r=super.has(n),b=X(this,mi),k=b.get(n);if(k===void 0){if(!r)return w(X(this,qt)),!1;k=$e(this,xi,za).call(this,!0),b.set(n,k)}return w(k),r}add(n){return super.has(n)||(super.add(n),U(X(this,Er),super.size),Tr(X(this,qt))),this}delete(n){var r=super.delete(n),b=X(this,mi),k=b.get(n);return k!==void 0&&(b.delete(n),U(k,!1)),r&&(U(X(this,Er),super.size),Tr(X(this,qt))),r}clear(){if(super.size!==0){super.clear();var n=X(this,mi);for(var r of n.values())U(r,!1);n.clear(),U(X(this,Er),0),Tr(X(this,qt))}}keys(){return this.values()}values(){return w(X(this,qt)),super.values()}entries(){return w(X(this,qt)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return w(X(this,Er))}};mi=new WeakMap,qt=new WeakMap,Er=new WeakMap,vs=new WeakMap,xi=new WeakSet,za=function(n){return mr===X(this,vs)?ce(n):Rr(n)},Ka=function(){bo=!0;var n=ps.prototype,r=Set.prototype;for(const b of Dd)n[b]=function(...k){return w(X(this,qt)),r[b].apply(this,k)};for(const b of Td)n[b]=function(...k){w(X(this,qt));var C=r[b].apply(this,k);return new ps(C)}};let wn=ps;var Rd=Z('<span class="text-muted ml-1">(reply)</span>'),Ad=Z('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),Bd=Z('<span class="text-accent/60 ml-1">review</span>'),Md=Z('<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>'),Od=Z('<div class="text-[12px] text-danger mb-3"> </div>'),Pd=Z('<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 Id(t,e){Ve(e,!0);let n=ce(!1),r=ce("");const b=new wn;pt(()=>{const _=e.pr.comments.length;br(()=>{b.clear();for(let m=0;m<_;m++)b.add(m)})});let k=ue(()=>Es(e.pr)),C=ue(()=>e.pr.comments.map((_,m)=>({comment:_,originalIndex:m})).sort((_,m)=>m.comment.createdAt.localeCompare(_.comment.createdAt))),o=ue(()=>b.size===e.pr.comments.length),c=ue(()=>b.size===0);function h(){if(w(o))b.clear();else for(let _=0;_<e.pr.comments.length;_++)b.add(_)}function d(_){b.has(_)?b.delete(_):b.add(_)}function u(_,m){if(_.type==="inline"){const v=_.line?`${_.path}:${_.line}`:_.path,s=_.diffHunk?`
|
|
27
|
-
\`\`\`diff
|
|
28
|
-
${_.diffHunk}
|
|
29
|
-
\`\`\`
|
|
30
|
-
`:`
|
|
31
|
-
`;return`[${m}] @${_.author} (${_.createdAt.slice(0,10)}) on ${v}:${s}${_.body}`}return`[${m}] @${_.author} (${_.createdAt.slice(0,10)}):
|
|
32
|
-
${_.body}`}async function f(){if(!e.branch||w(c))return;U(n,!0),U(r,"");const _=["Review the PR comments (including inline review comments) and elaborate a plan to address them.",`PR: ${w(k)}`,"","Comments:"].join(`
|
|
33
|
-
`)+`
|
|
34
|
-
`,m=e.pr.comments.filter((v,s)=>b.has(s)).map((v,s)=>u(v,s+1)).join(`
|
|
35
|
-
|
|
36
|
-
`);try{await Ua(e.branch,ja(m,2e4),_),e.onsendsuccess()}catch(v){U(r,tr(v),!0)}finally{U(n,!1)}}Zr(t,{get onclose(){return e.onclose},wide:!0,children:(_,m)=>{var v=Pd(),s=Pe(v),a=j(s),i=G(s,2),l=j(i);cs(l,{onclick:h,children:(P,M)=>{var H=qe();le(()=>oe(H,w(o)?"Deselect all":"Select all")),q(P,H)},$$slots:{default:!0}});var p=G(l,2),S=j(p),y=G(i,2);Xe(y,21,()=>w(C),({comment:P,originalIndex:M})=>M,(P,M)=>{let H=()=>w(M).comment,W=()=>w(M).originalIndex;var J=Md(),ee=j(J),Y=j(ee),L=G(Y,2),A=j(L);{var R=O=>{var V=Ad(),$=j(V),ae=G($);{var se=de=>{var ve=Rd();q(de,ve)};ne(ae,de=>{H().isReply&&de(se)})}le(()=>{xe(V,"title",H().path),oe($,`${H().path??""}${H().line?`:${H().line}`:""} `)}),q(O,V)};ne(A,O=>{H().type==="inline"&&O(R)})}var I=G(A,2),F=j(I),Q=j(F),ie=G(F),he=G(ie);{var N=O=>{var V=Bd();q(O,V)};ne(he,O=>{H().type==="inline"&&O(N)})}var D=G(I,2),K=j(D);le((O,V)=>{gn(Y,O),oe(Q,`@${H().author??""}`),oe(ie,` · ${V??""} `),oe(K,H().body)},[()=>b.has(W()),()=>H().createdAt.slice(0,10)]),pe("change",Y,()=>d(W())),q(P,J)});var E=G(y,2);{var g=P=>{var M=Od(),H=j(M);le(()=>oe(H,w(r))),q(P,M)};ne(E,P=>{w(r)&&P(g)})}var x=G(E,2),T=j(x);ut(T,{type:"button",get onclick(){return e.onclose},children:(P,M)=>{var H=qe("Cancel");q(P,H)},$$slots:{default:!0}});var B=G(T,2);{let P=ue(()=>w(c)||w(n));ut(B,{variant:"cta",small:!0,get disabled(){return w(P)},onclick:f,children:(M,H)=>{var W=qe();le(()=>oe(W,w(n)?"Sending...":`Send ${b.size} to agent`)),q(M,W)},$$slots:{default:!0}})}le(()=>{oe(a,`PR Comments — ${w(k)??""}`),oe(S,`${b.size??""} of ${e.pr.comments.length??""} selected`)}),q(_,v)},$$slots:{default:!0}}),Ge()}xt(["change"]);var Je;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(Je||(Je={}));const Hd={LINE_BY_LINE:"line-by-line"},Nd={NONE:"none"},Fd={WORD:"word"};var hi;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(hi||(hi={}));const Wd=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],Ud=RegExp("["+Wd.join("\\")+"]","g");function jd(t){return t.replace(Ud,"\\$&")}function So(t){return t&&t.replace(/\\/g,"/")}function zd(t){let e,n,r,b=0;for(e=0,r=t.length;e<r;e++)n=t.charCodeAt(e),b=(b<<5)-b+n,b|=0;return b}function $a(t){const e=t.length;let n=-1/0;for(let r=0;r<e;r++)n=Math.max(n,t[r]);return n}function wo(t,e){const n=t.split(".");return n.length>1?n[n.length-1]:e}function yo(t,e){return e.reduce((n,r)=>n||t.startsWith(r),!1)}const Co=["a/","b/","i/","w/","c/","o/"];function Cr(t,e,n){const r=n!==void 0?[...Co,n]:Co,b=e?new RegExp(`^${jd(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,k=""]=b.exec(t)||[],C=r.find(c=>k.indexOf(c)===0);return(C?k.slice(C.length):k).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function Kd(t,e){return Cr(t,"---",e)}function $d(t,e){return Cr(t,"+++",e)}function qd(t,e={}){const n=[];let r=null,b=null,k=null,C=null,o=null,c=null,h=null;const d="--- ",u="+++ ",f="@@",_=/^old mode (\d{6})/,m=/^new mode (\d{6})/,v=/^deleted file mode (\d{6})/,s=/^new file mode (\d{6})/,a=/^copy from "?(.+)"?/,i=/^copy to "?(.+)"?/,l=/^rename from "?(.+)"?/,p=/^rename to "?(.+)"?/,S=/^similarity index (\d+)%/,y=/^dissimilarity index (\d+)%/,E=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,g=/^Binary files (.*) and (.*) differ/,x=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,B=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,P=/^new file mode (\d{6})/,M=/^deleted file mode (\d{6}),(\d{6})/,H=t.replace(/\/g,"").replace(/\r\n?/g,`
|
|
37
|
-
`).split(`
|
|
38
|
-
`);function W(){b!==null&&r!==null&&(r.blocks.push(b),b=null)}function J(){r!==null&&(!r.oldName&&c!==null&&(r.oldName=c),!r.newName&&h!==null&&(r.newName=h),r.newName&&(n.push(r),r=null)),c=null,h=null}function ee(){W(),J(),r={blocks:[],deletedLines:0,addedLines:0}}function Y(R){W();let I;r!==null&&((I=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(R))?(r.isCombined=!1,k=parseInt(I[1],10),o=parseInt(I[2],10)):(I=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(R))?(r.isCombined=!0,k=parseInt(I[1],10),C=parseInt(I[2],10),o=parseInt(I[3],10)):(R.startsWith(f)&&console.error("Failed to parse lines, starting in 0!"),k=0,o=0,r.isCombined=!1)),b={lines:[],oldStartLine:k,oldStartLine2:C,newStartLine:o,header:R}}function L(R){if(r===null||b===null||k===null||o===null)return;const I={content:R},F=r.isCombined?["+ "," +","++"]:["+"],Q=r.isCombined?["- "," -","--"]:["-"];yo(R,F)?(r.addedLines++,I.type=Je.INSERT,I.oldNumber=void 0,I.newNumber=o++):yo(R,Q)?(r.deletedLines++,I.type=Je.DELETE,I.oldNumber=k++,I.newNumber=void 0):(I.type=Je.CONTEXT,I.oldNumber=k++,I.newNumber=o++),b.lines.push(I)}function A(R,I){let F=I;for(;F<H.length-3;){if(R.startsWith("diff"))return!1;if(H[F].startsWith(d)&&H[F+1].startsWith(u)&&H[F+2].startsWith(f))return!0;F++}return!1}return H.forEach((R,I)=>{if(!R||R.startsWith("*"))return;let F;const Q=H[I-1],ie=H[I+1],he=H[I+2];if(R.startsWith("diff --git")||R.startsWith("diff --combined")){if(ee(),(F=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(R))&&(c=Cr(F[1],void 0,e.dstPrefix),h=Cr(F[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isGitDiff=!0;return}if(R.startsWith("Binary files")&&!(r!=null&&r.isGitDiff)){if(ee(),(F=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(R))&&(c=Cr(F[1],void 0,e.dstPrefix),h=Cr(F[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isBinary=!0;return}if((!r||!r.isGitDiff&&r&&R.startsWith(d)&&ie.startsWith(u)&&he.startsWith(f))&&ee(),r!=null&&r.isTooBig)return;if(r&&(typeof e.diffMaxChanges=="number"&&r.addedLines+r.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&R.length>e.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],b=null;const D=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(n.length):"Diff too big to be displayed";Y(D);return}if(R.startsWith(d)&&ie.startsWith(u)||R.startsWith(u)&&Q.startsWith(d)){if(r&&!r.oldName&&R.startsWith("--- ")&&(F=Kd(R,e.srcPrefix))){r.oldName=F,r.language=wo(r.oldName,r.language);return}if(r&&!r.newName&&R.startsWith("+++ ")&&(F=$d(R,e.dstPrefix))){r.newName=F,r.language=wo(r.newName,r.language);return}}if(r&&(R.startsWith(f)||r.isGitDiff&&r.oldName&&r.newName&&!b)){Y(R);return}if(b&&(R.startsWith("+")||R.startsWith("-")||R.startsWith(" "))){L(R);return}const N=!A(R,I);if(r===null)throw new Error("Where is my file !!!");(F=_.exec(R))?r.oldMode=F[1]:(F=m.exec(R))?r.newMode=F[1]:(F=v.exec(R))?(r.deletedFileMode=F[1],r.isDeleted=!0):(F=s.exec(R))?(r.newFileMode=F[1],r.isNew=!0):(F=a.exec(R))?(N&&(r.oldName=F[1]),r.isCopy=!0):(F=i.exec(R))?(N&&(r.newName=F[1]),r.isCopy=!0):(F=l.exec(R))?(N&&(r.oldName=F[1]),r.isRename=!0):(F=p.exec(R))?(N&&(r.newName=F[1]),r.isRename=!0):(F=g.exec(R))?(r.isBinary=!0,r.oldName=Cr(F[1],void 0,e.srcPrefix),r.newName=Cr(F[2],void 0,e.dstPrefix),Y("Binary file")):x.test(R)?(r.isBinary=!0,Y(R)):(F=S.exec(R))?r.unchangedPercentage=parseInt(F[1],10):(F=y.exec(R))?r.changedPercentage=parseInt(F[1],10):(F=E.exec(R))?(r.checksumBefore=F[1],r.checksumAfter=F[2],F[3]&&(r.mode=F[3])):(F=T.exec(R))?(r.checksumBefore=[F[2],F[3]],r.checksumAfter=F[1]):(F=B.exec(R))?(r.oldMode=[F[2],F[3]],r.newMode=F[1]):(F=P.exec(R))?(r.newFileMode=F[1],r.isNew=!0):(F=M.exec(R))&&(r.deletedFileMode=F[1],r.isDeleted=!0)}),W(),J(),n}class qa{diff(e,n,r={}){let b;typeof r=="function"?(b=r,r={}):"callback"in r&&(b=r.callback);const k=this.castInput(e,r),C=this.castInput(n,r),o=this.removeEmpty(this.tokenize(k,r)),c=this.removeEmpty(this.tokenize(C,r));return this.diffWithOptionsObj(o,c,r,b)}diffWithOptionsObj(e,n,r,b){var k;const C=i=>{if(i=this.postProcess(i,r),b){setTimeout(function(){b(i)},0);return}else return i},o=n.length,c=e.length;let h=1,d=o+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const u=(k=r.timeout)!==null&&k!==void 0?k:1/0,f=Date.now()+u,_=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(_[0],n,e,0,r);if(_[0].oldPos+1>=c&&m+1>=o)return C(this.buildValues(_[0].lastComponent,n,e));let v=-1/0,s=1/0;const a=()=>{for(let i=Math.max(v,-h);i<=Math.min(s,h);i+=2){let l;const p=_[i-1],S=_[i+1];p&&(_[i-1]=void 0);let y=!1;if(S){const g=S.oldPos-i;y=S&&0<=g&&g<o}const E=p&&p.oldPos+1<c;if(!y&&!E){_[i]=void 0;continue}if(!E||y&&p.oldPos<S.oldPos?l=this.addToPath(S,!0,!1,0,r):l=this.addToPath(p,!1,!0,1,r),m=this.extractCommon(l,n,e,i,r),l.oldPos+1>=c&&m+1>=o)return C(this.buildValues(l.lastComponent,n,e))||!0;_[i]=l,l.oldPos+1>=c&&(s=Math.min(s,i-1)),m+1>=o&&(v=Math.max(v,i+1))}h++};if(b)(function i(){setTimeout(function(){if(h>d||Date.now()>f)return b(void 0);a()||i()},0)})();else for(;h<=d&&Date.now()<=f;){const i=a();if(i)return i}}addToPath(e,n,r,b,k){const C=e.lastComponent;return C&&!k.oneChangePerToken&&C.added===n&&C.removed===r?{oldPos:e.oldPos+b,lastComponent:{count:C.count+1,added:n,removed:r,previousComponent:C.previousComponent}}:{oldPos:e.oldPos+b,lastComponent:{count:1,added:n,removed:r,previousComponent:C}}}extractCommon(e,n,r,b,k){const C=n.length,o=r.length;let c=e.oldPos,h=c-b,d=0;for(;h+1<C&&c+1<o&&this.equals(r[c+1],n[h+1],k);)h++,c++,d++,k.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!k.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,h}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const b=[];let k;for(;e;)b.push(e),k=e.previousComponent,delete e.previousComponent,e=k;b.reverse();const C=b.length;let o=0,c=0,h=0;for(;o<C;o++){const d=b[o];if(d.removed)d.value=this.join(r.slice(h,h+d.count)),h+=d.count;else{if(!d.added&&this.useLongestToken){let u=n.slice(c,c+d.count);u=u.map(function(f,_){const m=r[h+_];return m.length>f.length?m:f}),d.value=this.join(u)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(h+=d.count)}}return b}}class Vd extends qa{}const Gd=new Vd;function Xd(t,e,n){return Gd.diff(t,e,n)}const xo="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Yd extends qa{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${xo}]+|[^\\S\\n\\r]+|[^${xo}]`,"ug");return e.match(n)||[]}}const Jd=new Yd;function Zd(t,e,n){return Jd.diff(t,e,n)}function Qd(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const n=[];let r;for(r=0;r<=e.length;r++)n[r]=[r];let b;for(b=0;b<=t.length;b++)n[0][b]=b;for(r=1;r<=e.length;r++)for(b=1;b<=t.length;b++)e.charAt(r-1)===t.charAt(b-1)?n[r][b]=n[r-1][b-1]:n[r][b]=Math.min(n[r-1][b-1]+1,Math.min(n[r][b-1]+1,n[r-1][b]+1));return n[e.length][t.length]}function Fn(t){return(e,n)=>{const r=t(e).trim(),b=t(n).trim();return Qd(r,b)/(r.length+b.length)}}function Wn(t){function e(r,b,k=new Map){let C=1/0,o;for(let c=0;c<r.length;++c)for(let h=0;h<b.length;++h){const d=JSON.stringify([r[c],b[h]]);let u;k.has(d)&&(u=k.get(d))||(u=t(r[c],b[h]),k.set(d,u)),u<C&&(C=u,o={indexA:c,indexB:h,score:C})}return o}function n(r,b,k=0,C=new Map){const o=e(r,b,C);if(!o||r.length+b.length<3)return[[r,b]];const c=r.slice(0,o.indexA),h=b.slice(0,o.indexB),d=[r[o.indexA]],u=[b[o.indexB]],f=o.indexA+1,_=o.indexB+1,m=r.slice(f),v=b.slice(_),s=n(c,h,k+1,C),a=n(d,u,k+1,C),i=n(m,v,k+1,C);let l=a;return(o.indexA>0||o.indexB>0)&&(l=s.concat(l)),(r.length>f||b.length>_)&&(l=l.concat(i)),l}return n}const vt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ks={matching:Nd.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:Fd.WORD,colorScheme:hi.LIGHT},Jt="/",Va=Fn(t=>t.value),ef=Wn(Va);function Ys(t){return t.indexOf("dev/null")!==-1}function tf(t){return t.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function rf(t){return t.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function us(t){switch(t){case Je.CONTEXT:return vt.CONTEXT;case Je.INSERT:return vt.INSERTS;case Je.DELETE:return vt.DELETES}}function Un(t){switch(t){case hi.DARK:return"d2h-dark-color-scheme";case hi.AUTO:return"d2h-auto-color-scheme";case hi.LIGHT:default:return"d2h-light-color-scheme"}}function sf(t){return t?2:1}function ui(t){return t.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function sr(t,e,n=!0){const r=sf(e);return{prefix:t.substring(0,r),content:n?ui(t.substring(r)):t.substring(r)}}function Ls(t){const e=So(t.oldName),n=So(t.newName);if(e!==n&&!Ys(e)&&!Ys(n)){const r=[],b=[],k=e.split(Jt),C=n.split(Jt),o=k.length,c=C.length;let h=0,d=o-1,u=c-1;for(;h<d&&h<u&&k[h]===C[h];)r.push(C[h]),h+=1;for(;d>h&&u>h&&k[d]===C[u];)b.unshift(C[u]),d-=1,u-=1;const f=r.join(Jt),_=b.join(Jt),m=k.slice(h,d+1).join(Jt),v=C.slice(h,u+1).join(Jt);return f.length&&_.length?f+Jt+"{"+m+" → "+v+"}"+Jt+_:f.length?f+Jt+"{"+m+" → "+v+"}":_.length?"{"+m+" → "+v+"}"+Jt+_:e+" → "+n}else return Ys(n)?e:n}function jn(t){return`d2h-${zd(Ls(t)).toString().slice(-6)}`}function zn(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function Ga(t,e,n,r={}){const{matching:b,maxLineLengthHighlight:k,matchWordsThreshold:C,diffStyle:o}=Object.assign(Object.assign({},ks),r),c=sr(t,n,!1),h=sr(e,n,!1);if(c.content.length>k||h.content.length>k)return{oldLine:{prefix:c.prefix,content:ui(c.content)},newLine:{prefix:h.prefix,content:ui(h.content)}};const d=o==="char"?Xd(c.content,h.content):Zd(c.content,h.content),u=[];if(o==="word"&&b==="words"){const _=d.filter(s=>s.removed),m=d.filter(s=>s.added);ef(m,_).forEach(s=>{s[0].length===1&&s[1].length===1&&Va(s[0][0],s[1][0])<C&&(u.push(s[0][0]),u.push(s[1][0]))})}const f=d.reduce((_,m)=>{const v=m.added?"ins":m.removed?"del":null,s=u.indexOf(m)>-1?' class="d2h-change"':"",a=ui(m.value);return v!==null?`${_}<${v}${s}>${a}</${v}>`:`${_}${a}`},"");return{oldLine:{prefix:c.prefix,content:tf(f)},newLine:{prefix:h.prefix,content:rf(f)}}}const Eo="file-summary",nf="icon",of={colorScheme:ks.colorScheme};class af{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},of),n)}render(e){const n=e.map(r=>this.hoganUtils.render(Eo,"line",{fileHtmlId:jn(r),oldName:r.oldName,newName:r.newName,fileName:Ls(r),deletedLines:"-"+r.deletedLines,addedLines:"+"+r.addedLines},{fileIcon:this.hoganUtils.template(nf,zn(r))})).join(`
|
|
39
|
-
`);return this.hoganUtils.render(Eo,"wrapper",{colorScheme:Un(this.config.colorScheme),filesNumber:e.length,files:n})}}const Xa=Object.assign(Object.assign({},ks),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Pi="generic",ko="line-by-line",lf="icon",cf="tag";class hf{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Xa),n)}render(e){const n=e.map(r=>{let b;return r.blocks.length?b=this.generateFileHtml(r):b=this.generateEmptyDiff(),this.makeFileDiffHtml(r,b)}).join(`
|
|
40
|
-
`);return this.hoganUtils.render(Pi,"wrapper",{colorScheme:Un(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const r=this.hoganUtils.template(ko,"file-diff"),b=this.hoganUtils.template(Pi,"file-path"),k=this.hoganUtils.template(lf,"file"),C=this.hoganUtils.template(cf,zn(e));return r.render({file:e,fileHtmlId:jn(e),diffs:n,filePath:b.render({fileDiffName:Ls(e)},{fileIcon:k,fileTag:C})})}generateEmptyDiff(){return this.hoganUtils.render(Pi,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:vt})}generateFileHtml(e){const n=Wn(Fn(r=>sr(r.content,e.isCombined).content));return e.blocks.map(r=>{let b=this.hoganUtils.render(Pi,"block-header",{CSSLineClass:vt,blockHeader:e.isTooBig?r.header:ui(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(r).forEach(([k,C,o])=>{if(C.length&&o.length&&!k.length)this.applyRematchMatching(C,o,n).map(([c,h])=>{const{left:d,right:u}=this.processChangedLines(e,e.isCombined,c,h);b+=d,b+=u});else if(k.length)k.forEach(c=>{const{prefix:h,content:d}=sr(c.content,e.isCombined);b+=this.generateSingleLineHtml(e,{type:vt.CONTEXT,prefix:h,content:d,oldNumber:c.oldNumber,newNumber:c.newNumber})});else if(C.length||o.length){const{left:c,right:h}=this.processChangedLines(e,e.isCombined,C,o);b+=c,b+=h}else console.error("Unknown state reached while processing groups of lines",k,C,o)}),b}).join(`
|
|
41
|
-
`)}applyLineGroupping(e){const n=[];let r=[],b=[];for(let k=0;k<e.lines.length;k++){const C=e.lines[k];(C.type!==Je.INSERT&&b.length||C.type===Je.CONTEXT&&r.length>0)&&(n.push([[],r,b]),r=[],b=[]),C.type===Je.CONTEXT?n.push([[C],[],[]]):C.type===Je.INSERT&&r.length===0?n.push([[],[],[C]]):C.type===Je.INSERT&&r.length>0?b.push(C):C.type===Je.DELETE&&r.push(C)}return(r.length||b.length)&&(n.push([[],r,b]),r=[],b=[]),n}applyRematchMatching(e,n,r){const b=e.length*n.length,k=$a(e.concat(n).map(o=>o.content.length));return b<this.config.matchingMaxComparisons&&k<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,n):[[e,n]]}processChangedLines(e,n,r,b){const k={right:"",left:""},C=Math.max(r.length,b.length);for(let o=0;o<C;o++){const c=r[o],h=b[o],d=c!==void 0&&h!==void 0?Ga(c.content,h.content,n,this.config):void 0,u=c!==void 0&&c.oldNumber!==void 0?Object.assign(Object.assign({},d!==void 0?{prefix:d.oldLine.prefix,content:d.oldLine.content,type:vt.DELETE_CHANGES}:Object.assign(Object.assign({},sr(c.content,n)),{type:us(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,f=h!==void 0&&h.newNumber!==void 0?Object.assign(Object.assign({},d!==void 0?{prefix:d.newLine.prefix,content:d.newLine.content,type:vt.INSERT_CHANGES}:Object.assign(Object.assign({},sr(h.content,n)),{type:us(h.type)})),{oldNumber:h.oldNumber,newNumber:h.newNumber}):void 0,{left:_,right:m}=this.generateLineHtml(e,u,f);k.left+=_,k.right+=m}return k}generateLineHtml(e,n,r){return{left:this.generateSingleLineHtml(e,n),right:this.generateSingleLineHtml(e,r)}}generateSingleLineHtml(e,n){if(n===void 0)return"";const r=this.hoganUtils.render(ko,"numbers",{oldNumber:n.oldNumber||"",newNumber:n.newNumber||""});return this.hoganUtils.render(Pi,"line",{type:n.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:n.prefix===" "?" ":n.prefix,content:n.content,lineNumber:r,line:n,file:e})}}const Ya=Object.assign(Object.assign({},ks),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Ii="generic",uf="side-by-side",df="icon",ff="tag";class _f{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Ya),n)}render(e){const n=e.map(r=>{let b;return r.blocks.length?b=this.generateFileHtml(r):b=this.generateEmptyDiff(),this.makeFileDiffHtml(r,b)}).join(`
|
|
42
|
-
`);return this.hoganUtils.render(Ii,"wrapper",{colorScheme:Un(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const r=this.hoganUtils.template(uf,"file-diff"),b=this.hoganUtils.template(Ii,"file-path"),k=this.hoganUtils.template(df,"file"),C=this.hoganUtils.template(ff,zn(e));return r.render({file:e,fileHtmlId:jn(e),diffs:n,filePath:b.render({fileDiffName:Ls(e)},{fileIcon:k,fileTag:C})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Ii,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:vt})}}generateFileHtml(e){const n=Wn(Fn(r=>sr(r.content,e.isCombined).content));return e.blocks.map(r=>{const b={left:this.makeHeaderHtml(r.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(r).forEach(([k,C,o])=>{if(C.length&&o.length&&!k.length)this.applyRematchMatching(C,o,n).map(([c,h])=>{const{left:d,right:u}=this.processChangedLines(e.isCombined,c,h);b.left+=d,b.right+=u});else if(k.length)k.forEach(c=>{const{prefix:h,content:d}=sr(c.content,e.isCombined),{left:u,right:f}=this.generateLineHtml({type:vt.CONTEXT,prefix:h,content:d,number:c.oldNumber},{type:vt.CONTEXT,prefix:h,content:d,number:c.newNumber});b.left+=u,b.right+=f});else if(C.length||o.length){const{left:c,right:h}=this.processChangedLines(e.isCombined,C,o);b.left+=c,b.right+=h}else console.error("Unknown state reached while processing groups of lines",k,C,o)}),b}).reduce((r,b)=>({left:r.left+b.left,right:r.right+b.right}),{left:"",right:""})}applyLineGroupping(e){const n=[];let r=[],b=[];for(let k=0;k<e.lines.length;k++){const C=e.lines[k];(C.type!==Je.INSERT&&b.length||C.type===Je.CONTEXT&&r.length>0)&&(n.push([[],r,b]),r=[],b=[]),C.type===Je.CONTEXT?n.push([[C],[],[]]):C.type===Je.INSERT&&r.length===0?n.push([[],[],[C]]):C.type===Je.INSERT&&r.length>0?b.push(C):C.type===Je.DELETE&&r.push(C)}return(r.length||b.length)&&(n.push([[],r,b]),r=[],b=[]),n}applyRematchMatching(e,n,r){const b=e.length*n.length,k=$a(e.concat(n).map(o=>o.content.length));return b<this.config.matchingMaxComparisons&&k<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,n):[[e,n]]}makeHeaderHtml(e,n){return this.hoganUtils.render(Ii,"block-header",{CSSLineClass:vt,blockHeader:n!=null&&n.isTooBig?e:ui(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,n,r){const b={right:"",left:""},k=Math.max(n.length,r.length);for(let C=0;C<k;C++){const o=n[C],c=r[C],h=o!==void 0&&c!==void 0?Ga(o.content,c.content,e,this.config):void 0,d=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:vt.DELETE_CHANGES}:Object.assign(Object.assign({},sr(o.content,e)),{type:us(o.type)})),{number:o.oldNumber}):void 0,u=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:vt.INSERT_CHANGES}:Object.assign(Object.assign({},sr(c.content,e)),{type:us(c.type)})),{number:c.newNumber}):void 0,{left:f,right:_}=this.generateLineHtml(d,u);b.left+=f,b.right+=_}return b}generateLineHtml(e,n){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(n)}}generateSingleHtml(e){const n="d2h-code-side-linenumber",r="d2h-code-side-line";return this.hoganUtils.render(Ii,"line",{type:(e==null?void 0:e.type)||`${vt.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?" ":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}}var Js={},Lo;function vf(){return Lo||(Lo=1,(function(t){(function(e){var n=/\S/,r=/\"/g,b=/\n/g,k=/\r/g,C=/\\/g,o=/\u2028/,c=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(x,T){var B=x.length,P=0,M=1,H=2,W=P,J=null,ee=null,Y="",L=[],A=!1,R=0,I=0,F="{{",Q="}}";function ie(){Y.length>0&&(L.push({tag:"_t",text:new String(Y)}),Y="")}function he(){for(var K=!0,O=I;O<L.length;O++)if(K=e.tags[L[O].tag]<e.tags._v||L[O].tag=="_t"&&L[O].text.match(n)===null,!K)return!1;return K}function N(K,O){if(ie(),K&&he())for(var V=I,$;V<L.length;V++)L[V].text&&(($=L[V+1])&&$.tag==">"&&($.indent=L[V].text.toString()),L.splice(V,1));else O||L.push({tag:`
|
|
43
|
-
`});A=!1,I=L.length}function D(K,O){var V="="+Q,$=K.indexOf(V,O),ae=d(K.substring(K.indexOf("=",O)+1,$)).split(" ");return F=ae[0],Q=ae[ae.length-1],$+V.length-1}for(T&&(T=T.split(" "),F=T[0],Q=T[1]),R=0;R<B;R++)W==P?u(F,x,R)?(--R,ie(),W=M):x.charAt(R)==`
|
|
44
|
-
`?N(A):Y+=x.charAt(R):W==M?(R+=F.length-1,ee=e.tags[x.charAt(R+1)],J=ee?x.charAt(R+1):"_v",J=="="?(R=D(x,R),W=P):(ee&&R++,W=H),A=R):u(Q,x,R)?(L.push({tag:J,n:d(Y),otag:F,ctag:Q,i:J=="/"?A-F.length:R+Q.length}),Y="",R+=Q.length-1,W=P,J=="{"&&(Q=="}}"?R++:h(L[L.length-1]))):Y+=x.charAt(R);return N(A,!0),L};function h(g){g.n.substr(g.n.length-1)==="}"&&(g.n=g.n.substring(0,g.n.length-1))}function d(g){return g.trim?g.trim():g.replace(/^\s*|\s*$/g,"")}function u(g,x,T){if(x.charAt(T)!=g.charAt(0))return!1;for(var B=1,P=g.length;B<P;B++)if(x.charAt(T+B)!=g.charAt(B))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function _(g,x,T,B){var P=[],M=null,H=null,W=null;for(H=T[T.length-1];g.length>0;){if(W=g.shift(),H&&H.tag=="<"&&!(W.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[W.tag]<=e.tags.$||m(W,B))T.push(W),W.nodes=_(g,W.tag,T,B);else if(W.tag=="/"){if(T.length===0)throw new Error("Closing tag without opener: /"+W.n);if(M=T.pop(),W.n!=M.n&&!v(W.n,M.n,B))throw new Error("Nesting error: "+M.n+" vs. "+W.n);return M.end=W.i,P}else W.tag==`
|
|
45
|
-
`&&(W.last=g.length==0||g[0].tag==`
|
|
46
|
-
`);P.push(W)}if(T.length>0)throw new Error("missing closing tag: "+T.pop().n);return P}function m(g,x){for(var T=0,B=x.length;T<B;T++)if(x[T].o==g.n)return g.tag="#",!0}function v(g,x,T){for(var B=0,P=T.length;B<P;B++)if(T[B].c==g&&T[B].o==x)return!0}function s(g){var x=[];for(var T in g)x.push('"'+l(T)+'": function(c,p,t,i) {'+g[T]+"}");return"{ "+x.join(",")+" }"}function a(g){var x=[];for(var T in g.partials)x.push('"'+l(T)+'":{name:"'+l(g.partials[T].name)+'", '+a(g.partials[T])+"}");return"partials: {"+x.join(",")+"}, subs: "+s(g.subs)}e.stringify=function(g,x,T){return"{code: function (c,p,i) { "+e.wrapMain(g.code)+" },"+a(g)+"}"};var i=0;e.generate=function(g,x,T){i=0;var B={code:"",subs:{},partials:{}};return e.walk(g,B),T.asString?this.stringify(B,x,T):this.makeTemplate(B,x,T)},e.wrapMain=function(g){return'var t=this;t.b(i=i||"");'+g+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(g,x,T){var B=this.makePartials(g);return B.code=new Function("c","p","i",this.wrapMain(g.code)),new this.template(B,x,this,T)},e.makePartials=function(g){var x,T={subs:{},partials:g.partials,name:g.name};for(x in T.partials)T.partials[x]=this.makePartials(T.partials[x]);for(x in g.subs)T.subs[x]=new Function("c","p","t","i",g.subs[x]);return T};function l(g){return g.replace(C,"\\\\").replace(r,'\\"').replace(b,"\\n").replace(k,"\\r").replace(o,"\\u2028").replace(c,"\\u2029")}function p(g){return~g.indexOf(".")?"d":"f"}function S(g,x){var T="<"+(x.prefix||""),B=T+g.n+i++;return x.partials[B]={name:g.n,partials:{}},x.code+='t.b(t.rp("'+l(B)+'",c,p,"'+(g.indent||"")+'"));',B}e.codegen={"#":function(g,x){x.code+="if(t.s(t."+p(g.n)+'("'+l(g.n)+'",c,p,1),c,p,0,'+g.i+","+g.end+',"'+g.otag+" "+g.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(g.nodes,x),x.code+="});c.pop();}"},"^":function(g,x){x.code+="if(!t.s(t."+p(g.n)+'("'+l(g.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(g.nodes,x),x.code+="};"},">":S,"<":function(g,x){var T={partials:{},code:"",subs:{},inPartial:!0};e.walk(g.nodes,T);var B=x.partials[S(g,x)];B.subs=T.subs,B.partials=T.partials},$:function(g,x){var T={subs:{},code:"",partials:x.partials,prefix:g.n};e.walk(g.nodes,T),x.subs[g.n]=T.code,x.inPartial||(x.code+='t.sub("'+l(g.n)+'",c,p,i);')},"\n":function(g,x){x.code+=E('"\\n"'+(g.last?"":" + i"))},_v:function(g,x){x.code+="t.b(t.v(t."+p(g.n)+'("'+l(g.n)+'",c,p,0)));'},_t:function(g,x){x.code+=E('"'+l(g.text)+'"')},"{":y,"&":y};function y(g,x){x.code+="t.b(t.t(t."+p(g.n)+'("'+l(g.n)+'",c,p,0)));'}function E(g){return"t.b("+g+");"}e.walk=function(g,x){for(var T,B=0,P=g.length;B<P;B++)T=e.codegen[g[B].tag],T&&T(g[B],x);return x},e.parse=function(g,x,T){return T=T||{},_(g,"",[],T.sectionTags||[])},e.cache={},e.cacheKey=function(g,x){return[g,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},e.compile=function(g,x){x=x||{};var T=e.cacheKey(g,x),B=this.cache[T];if(B){var P=B.partials;for(var M in P)delete P[M].instance;return B}return B=this.generate(this.parse(this.scan(g,x.delimiters),g,x),g,x),this.cache[T]=B}})(t)})(Js)),Js}var Zs={},Do;function pf(){return Do||(Do=1,(function(t){(function(e){e.Template=function(_,m,v,s){_=_||{},this.r=_.code||this.r,this.c=v,this.options=s||{},this.text=m||"",this.partials=_.partials||{},this.subs=_.subs||{},this.buf=""},e.Template.prototype={r:function(_,m,v){return""},v:u,t:d,render:function(m,v,s){return this.ri([m],v||{},s)},ri:function(_,m,v){return this.r(_,m,v)},ep:function(_,m){var v=this.partials[_],s=m[v.name];if(v.instance&&v.base==s)return v.instance;if(typeof s=="string"){if(!this.c)throw new Error("No compiler available.");s=this.c.compile(s,this.options)}if(!s)return null;if(this.partials[_].base=s,v.subs){m.stackText||(m.stackText={});for(key in v.subs)m.stackText[key]||(m.stackText[key]=this.activeSub!==void 0&&m.stackText[this.activeSub]?m.stackText[this.activeSub]:this.text);s=r(s,v.subs,v.partials,this.stackSubs,this.stackPartials,m.stackText)}return this.partials[_].instance=s,s},rp:function(_,m,v,s){var a=this.ep(_,v);return a?a.ri(m,v,s):""},rs:function(_,m,v){var s=_[_.length-1];if(!f(s)){v(_,m,this);return}for(var a=0;a<s.length;a++)_.push(s[a]),v(_,m,this),_.pop()},s:function(_,m,v,s,a,i,l){var p;return f(_)&&_.length===0?!1:(typeof _=="function"&&(_=this.ms(_,m,v,s,a,i,l)),p=!!_,!s&&p&&m&&m.push(typeof _=="object"?_:m[m.length-1]),p)},d:function(_,m,v,s){var a,i=_.split("."),l=this.f(i[0],m,v,s),p=this.options.modelGet,S=null;if(_==="."&&f(m[m.length-2]))l=m[m.length-1];else for(var y=1;y<i.length;y++)a=n(i[y],l,p),a!==void 0?(S=l,l=a):l="";return s&&!l?!1:(!s&&typeof l=="function"&&(m.push(S),l=this.mv(l,m,v),m.pop()),l)},f:function(_,m,v,s){for(var a=!1,i=null,l=!1,p=this.options.modelGet,S=m.length-1;S>=0;S--)if(i=m[S],a=n(_,i,p),a!==void 0){l=!0;break}return l?(!s&&typeof a=="function"&&(a=this.mv(a,m,v)),a):s?!1:""},ls:function(_,m,v,s,a,i){var l=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(d(_.call(m,a,v)),m,s)),this.options.delimiters=l,!1},ct:function(_,m,v){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(_,this.options).render(m,v)},b:function(_){this.buf+=_},fl:function(){var _=this.buf;return this.buf="",_},ms:function(_,m,v,s,a,i,l){var p,S=m[m.length-1],y=_.call(S);return typeof y=="function"?s?!0:(p=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(y,S,m,v,p.substring(a,i),l)):y},mv:function(_,m,v){var s=m[m.length-1],a=_.call(s);return typeof a=="function"?this.ct(d(a.call(s)),s,v):a},sub:function(_,m,v,s){var a=this.subs[_];a&&(this.activeSub=_,a(m,v,this,s),this.activeSub=!1)}};function n(_,m,v){var s;return m&&typeof m=="object"&&(m[_]!==void 0?s=m[_]:v&&m.get&&typeof m.get=="function"&&(s=m.get(_))),s}function r(_,m,v,s,a,i){function l(){}l.prototype=_;function p(){}p.prototype=_.subs;var S,y=new l;y.subs=new p,y.subsText={},y.buf="",s=s||{},y.stackSubs=s,y.subsText=i;for(S in m)s[S]||(s[S]=m[S]);for(S in s)y.subs[S]=s[S];a=a||{},y.stackPartials=a;for(S in v)a[S]||(a[S]=v[S]);for(S in a)y.partials[S]=a[S];return y}var b=/&/g,k=/</g,C=/>/g,o=/\'/g,c=/\"/g,h=/[&<>\"\']/;function d(_){return String(_??"")}function u(_){return _=d(_),h.test(_)?_.replace(b,"&").replace(k,"<").replace(C,">").replace(o,"'").replace(c,"""):_}var f=Array.isArray||function(_){return Object.prototype.toString.call(_)==="[object Array]"}})(t)})(Zs)),Zs}var Qs,To;function gf(){if(To)return Qs;To=1;var t=vf();return t.Template=pf().Template,t.template=t.Template,Qs=t,Qs}var Ye=gf();const Qe={};Qe["file-summary-line"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<li class="d2h-file-list-line">'),r.b(`
|
|
47
|
-
`+n),r.b(' <span class="d2h-file-name-wrapper">'),r.b(`
|
|
48
|
-
`+n),r.b(r.rp("<fileIcon0",t,e," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",t,e,0))),r.b("</a>"),r.b(`
|
|
49
|
-
`+n),r.b(' <span class="d2h-file-stats">'),r.b(`
|
|
50
|
-
`+n),r.b(' <span class="d2h-lines-added">'),r.b(r.v(r.f("addedLines",t,e,0))),r.b("</span>"),r.b(`
|
|
51
|
-
`+n),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",t,e,0))),r.b("</span>"),r.b(`
|
|
52
|
-
`+n),r.b(" </span>"),r.b(`
|
|
53
|
-
`+n),r.b(" </span>"),r.b(`
|
|
54
|
-
`+n),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});Qe["file-summary-wrapper"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
|
|
55
|
-
`+n),r.b(' <div class="d2h-file-list-header">'),r.b(`
|
|
56
|
-
`+n),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",t,e,0))),r.b(")</span>"),r.b(`
|
|
57
|
-
`+n),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b(`
|
|
58
|
-
`+n),r.b(' <a class="d2h-file-switch d2h-show">show</a>'),r.b(`
|
|
59
|
-
`+n),r.b(" </div>"),r.b(`
|
|
60
|
-
`+n),r.b(' <ol class="d2h-file-list">'),r.b(`
|
|
61
|
-
`+n),r.b(" "),r.b(r.t(r.f("files",t,e,0))),r.b(`
|
|
62
|
-
`+n),r.b(" </ol>"),r.b(`
|
|
63
|
-
`+n),r.b("</div>"),r.fl()},partials:{},subs:{}});Qe["generic-block-header"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b(`
|
|
64
|
-
`+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",t,e,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('"></td>'),r.b(`
|
|
65
|
-
`+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('">'),r.b(`
|
|
66
|
-
`+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",t,e,0))),r.b('">'),r.s(r.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(r.rs(t,e,function(b,k,C){C.b(C.t(C.f("blockHeader",b,k,0)))}),t.pop()),r.s(r.f("blockHeader",t,e,1),t,e,1,0,0,"")||r.b(" "),r.b("</div>"),r.b(`
|
|
67
|
-
`+n),r.b(" </td>"),r.b(`
|
|
68
|
-
`+n),r.b("</tr>"),r.fl()},partials:{},subs:{}});Qe["generic-empty-diff"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b(`
|
|
69
|
-
`+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('">'),r.b(`
|
|
70
|
-
`+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",t,e,0))),r.b('">'),r.b(`
|
|
71
|
-
`+n),r.b(" File without changes"),r.b(`
|
|
72
|
-
`+n),r.b(" </div>"),r.b(`
|
|
73
|
-
`+n),r.b(" </td>"),r.b(`
|
|
74
|
-
`+n),r.b("</tr>"),r.fl()},partials:{},subs:{}});Qe["generic-file-path"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-file-name-wrapper">'),r.b(`
|
|
75
|
-
`+n),r.b(r.rp("<fileIcon0",t,e," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",t,e,0))),r.b("</span>"),r.b(`
|
|
76
|
-
`+n),r.b(r.rp("<fileTag1",t,e," ")),r.b("</span>"),r.b(`
|
|
77
|
-
`+n),r.b('<label class="d2h-file-collapse">'),r.b(`
|
|
78
|
-
`+n),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b(`
|
|
79
|
-
`+n),r.b(" Viewed"),r.b(`
|
|
80
|
-
`+n),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});Qe["generic-line"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b(`
|
|
81
|
-
`+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",t,e,0))),r.b(" "),r.b(r.v(r.f("type",t,e,0))),r.b('">'),r.b(`
|
|
82
|
-
`+n),r.b(" "),r.b(r.t(r.f("lineNumber",t,e,0))),r.b(`
|
|
83
|
-
`+n),r.b(" </td>"),r.b(`
|
|
84
|
-
`+n),r.b(' <td class="'),r.b(r.v(r.f("type",t,e,0))),r.b('">'),r.b(`
|
|
85
|
-
`+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",t,e,0))),r.b('">'),r.b(`
|
|
86
|
-
`+n),r.s(r.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(r.rs(t,e,function(b,k,C){C.b(' <span class="d2h-code-line-prefix">'),C.b(C.t(C.f("prefix",b,k,0))),C.b("</span>"),C.b(`
|
|
87
|
-
`+n)}),t.pop()),r.s(r.f("prefix",t,e,1),t,e,1,0,0,"")||(r.b(' <span class="d2h-code-line-prefix"> </span>'),r.b(`
|
|
88
|
-
`+n)),r.s(r.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(r.rs(t,e,function(b,k,C){C.b(' <span class="d2h-code-line-ctn">'),C.b(C.t(C.f("content",b,k,0))),C.b("</span>"),C.b(`
|
|
89
|
-
`+n)}),t.pop()),r.s(r.f("content",t,e,1),t,e,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b(`
|
|
90
|
-
`+n)),r.b(" </div>"),r.b(`
|
|
91
|
-
`+n),r.b(" </td>"),r.b(`
|
|
92
|
-
`+n),r.b("</tr>"),r.fl()},partials:{},subs:{}});Qe["generic-wrapper"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
|
|
93
|
-
`+n),r.b(" "),r.b(r.t(r.f("content",t,e,0))),r.b(`
|
|
94
|
-
`+n),r.b("</div>"),r.fl()},partials:{},subs:{}});Qe["icon-file-added"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b(`
|
|
95
|
-
`+n),r.b(' width="14">'),r.b(`
|
|
96
|
-
`+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b(`
|
|
97
|
-
`+n),r.b("</svg>"),r.fl()},partials:{},subs:{}});Qe["icon-file-changed"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b(`
|
|
98
|
-
`+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
|
|
99
|
-
`+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b(`
|
|
100
|
-
`+n),r.b("</svg>"),r.fl()},partials:{},subs:{}});Qe["icon-file-deleted"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b(`
|
|
101
|
-
`+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
|
|
102
|
-
`+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b(`
|
|
103
|
-
`+n),r.b("</svg>"),r.fl()},partials:{},subs:{}});Qe["icon-file-renamed"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b(`
|
|
104
|
-
`+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
|
|
105
|
-
`+n),r.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),r.b(`
|
|
106
|
-
`+n),r.b("</svg>"),r.fl()},partials:{},subs:{}});Qe["icon-file"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b(`
|
|
107
|
-
`+n),r.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),r.b(`
|
|
108
|
-
`+n),r.b("</svg>"),r.fl()},partials:{},subs:{}});Qe["line-by-line-file-diff"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
|
|
109
|
-
`+n),r.b(' <div class="d2h-file-header">'),r.b(`
|
|
110
|
-
`+n),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(`
|
|
111
|
-
`+n),r.b(" </div>"),r.b(`
|
|
112
|
-
`+n),r.b(' <div class="d2h-file-diff">'),r.b(`
|
|
113
|
-
`+n),r.b(' <div class="d2h-code-wrapper">'),r.b(`
|
|
114
|
-
`+n),r.b(' <table class="d2h-diff-table">'),r.b(`
|
|
115
|
-
`+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b(`
|
|
116
|
-
`+n),r.b(" "),r.b(r.t(r.f("diffs",t,e,0))),r.b(`
|
|
117
|
-
`+n),r.b(" </tbody>"),r.b(`
|
|
118
|
-
`+n),r.b(" </table>"),r.b(`
|
|
119
|
-
`+n),r.b(" </div>"),r.b(`
|
|
120
|
-
`+n),r.b(" </div>"),r.b(`
|
|
121
|
-
`+n),r.b("</div>"),r.fl()},partials:{},subs:{}});Qe["line-by-line-numbers"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",t,e,0))),r.b("</div>"),r.b(`
|
|
122
|
-
`+n),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",t,e,0))),r.b("</div>"),r.fl()},partials:{},subs:{}});Qe["side-by-side-file-diff"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
|
|
123
|
-
`+n),r.b(' <div class="d2h-file-header">'),r.b(`
|
|
124
|
-
`+n),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(`
|
|
125
|
-
`+n),r.b(" </div>"),r.b(`
|
|
126
|
-
`+n),r.b(' <div class="d2h-files-diff">'),r.b(`
|
|
127
|
-
`+n),r.b(' <div class="d2h-file-side-diff">'),r.b(`
|
|
128
|
-
`+n),r.b(' <div class="d2h-code-wrapper">'),r.b(`
|
|
129
|
-
`+n),r.b(' <table class="d2h-diff-table">'),r.b(`
|
|
130
|
-
`+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b(`
|
|
131
|
-
`+n),r.b(" "),r.b(r.t(r.d("diffs.left",t,e,0))),r.b(`
|
|
132
|
-
`+n),r.b(" </tbody>"),r.b(`
|
|
133
|
-
`+n),r.b(" </table>"),r.b(`
|
|
134
|
-
`+n),r.b(" </div>"),r.b(`
|
|
135
|
-
`+n),r.b(" </div>"),r.b(`
|
|
136
|
-
`+n),r.b(' <div class="d2h-file-side-diff">'),r.b(`
|
|
137
|
-
`+n),r.b(' <div class="d2h-code-wrapper">'),r.b(`
|
|
138
|
-
`+n),r.b(' <table class="d2h-diff-table">'),r.b(`
|
|
139
|
-
`+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b(`
|
|
140
|
-
`+n),r.b(" "),r.b(r.t(r.d("diffs.right",t,e,0))),r.b(`
|
|
141
|
-
`+n),r.b(" </tbody>"),r.b(`
|
|
142
|
-
`+n),r.b(" </table>"),r.b(`
|
|
143
|
-
`+n),r.b(" </div>"),r.b(`
|
|
144
|
-
`+n),r.b(" </div>"),r.b(`
|
|
145
|
-
`+n),r.b(" </div>"),r.b(`
|
|
146
|
-
`+n),r.b("</div>"),r.fl()},partials:{},subs:{}});Qe["tag-file-added"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}});Qe["tag-file-changed"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}});Qe["tag-file-deleted"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}});Qe["tag-file-renamed"]=new Ye.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class mf{constructor({compiledTemplates:e={},rawTemplates:n={}}){const r=Object.entries(n).reduce((b,[k,C])=>{const o=Ye.compile(C,{asString:!1});return Object.assign(Object.assign({},b),{[k]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},Qe),e),r)}static compile(e){return Ye.compile(e,{asString:!1})}render(e,n,r,b,k){const C=this.templateKey(e,n);try{return this.preCompiledTemplates[C].render(r,b,k)}catch{throw new Error(`Could not find template to render '${C}'`)}}template(e,n){return this.preCompiledTemplates[this.templateKey(e,n)]}templateKey(e,n){return`${e}-${n}`}}const bf=Object.assign(Object.assign(Object.assign({},Xa),Ya),{outputFormat:Hd.LINE_BY_LINE,drawFileList:!0});function Sf(t,e={}){const n=Object.assign(Object.assign({},bf),e),r=typeof t=="string"?qd(t,n):t,b=new mf(n),{colorScheme:k}=n,C={colorScheme:k},o=n.drawFileList?new af(b,C).render(r):"",c=n.outputFormat==="side-by-side"?new _f(b,n).render(r):new hf(b,n).render(r);return o+c}var Lt={},Ro;function wf(){if(Ro)return Lt;Ro=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.ColorSchemeType=Lt.DiffStyleType=Lt.LineMatchingType=Lt.OutputFormatType=Lt.LineType=void 0;var t;(function(n){n.INSERT="insert",n.DELETE="delete",n.CONTEXT="context"})(t||(Lt.LineType=t={})),Lt.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},Lt.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},Lt.DiffStyleType={WORD:"word",CHAR:"char"};var e;return(function(n){n.AUTO="auto",n.DARK="dark",n.LIGHT="light"})(e||(Lt.ColorSchemeType=e={})),Lt}var yf=wf(),Cf=Z('<div class="text-sm text-muted py-8 text-center">Loading diff...</div>'),xf=Z('<div class="text-sm text-danger py-8 text-center"> </div>'),Ef=Z('<div class="text-sm text-muted py-8 text-center">No changes</div>'),kf=Z('<div class="text-[11px] text-warning px-3 py-1">Truncated (exceeded 200KB)</div>'),Lf=Z('<div class="diff-container overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge svelte-12rjmc4"><!> <!></div>'),Df=Z('<li class="flex items-baseline gap-2 px-3 py-1.5 border-b border-edge last:border-b-0"><code class="text-[11px] text-accent shrink-0"> </code> <span class="text-[12px] text-primary"> </span></li>'),Tf=Z('<ul class="commit-list overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge list-none m-0 p-0"></ul>'),Rf=Z('<div class="flex gap-1 mb-3"><button type="button">Current diff</button> <button type="button"> </button></div> <!>',1),Af=Z('<h2 class="text-base mb-4">Changes — <span class="font-mono text-sm"> </span></h2> <!> <div class="flex justify-end mt-4"><!></div>',1);function Bf(t,e){Ve(e,!0);let n=ce(""),r=ce(!1),b=ce(Ae([])),k=ce(!0),C=ce("");pt(()=>{U(k,!0),U(C,""),Iu(e.branch).then(f=>{U(n,f.uncommitted,!0),U(r,f.uncommittedTruncated,!0),U(b,f.unpushedCommits,!0)}).catch(f=>{U(C,tr(f),!0)}).finally(()=>{U(k,!1)})});const o={outputFormat:"line-by-line",colorScheme:yf.ColorSchemeType.AUTO,drawFileList:!1};let c=ue(()=>w(n)?Sf(w(n),o):""),h=ue(()=>!!w(n)||w(b).length>0),d=ce("diff"),u=!1;pt(()=>{!w(k)&&!w(C)&&!u&&(u=!0,U(d,w(n)?"diff":"unpushed",!0))}),Zr(t,{get onclose(){return e.onclose},wide:!0,maxWidth:"90vw",className:"diff-dialog",children:(f,_)=>{var m=Af(),v=Pe(m),s=G(j(v)),a=j(s),i=G(v,2);{var l=x=>{var T=Cf();q(x,T)},p=x=>{var T=xf(),B=j(T);le(()=>oe(B,w(C))),q(x,T)},S=x=>{var T=Ef();q(x,T)},y=x=>{var T=Rf(),B=Pe(T),P=j(B);let M;var H=G(P,2);let W;var J=j(H),ee=G(B,2);{var Y=A=>{var R=Lf(),I=j(R);{var F=ie=>{var he=kf();q(ie,he)};ne(I,ie=>{w(r)&&ie(F)})}var Q=G(I,2);Gc(Q,()=>w(c)),q(A,R)},L=A=>{var R=Tf();Xe(R,21,()=>w(b),I=>I.hash,(I,F)=>{var Q=Df(),ie=j(Q),he=j(ie),N=G(ie,2),D=j(N);le(()=>{oe(he,w(F).hash),oe(D,w(F).message)}),q(I,Q)}),q(A,R)};ne(ee,A=>{w(d)==="diff"&&w(n)?A(Y):w(d)==="unpushed"&&w(b).length>0&&A(L,1)})}le(()=>{M=Re(P,1,"tab-btn svelte-12rjmc4",null,M,{active:w(d)==="diff"}),P.disabled=!w(n),W=Re(H,1,"tab-btn svelte-12rjmc4",null,W,{active:w(d)==="unpushed"}),H.disabled=w(b).length===0,oe(J,`Unpushed commits (${w(b).length??""})`)}),pe("click",P,()=>U(d,"diff")),pe("click",H,()=>U(d,"unpushed")),q(x,T)};ne(i,x=>{w(k)?x(l):w(C)?x(p,1):w(h)?x(y,-1):x(S,2)})}var E=G(i,2),g=j(E);ut(g,{type:"button",get onclick(){return e.onclose},children:(x,T)=>{var B=qe("Close");q(x,B)},$$slots:{default:!0}}),le(()=>oe(a,e.branch)),q(f,m)},$$slots:{default:!0}}),Ge()}xt(["click"]);var Mf=Z('<button type="button"> </button>'),Of=Z('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function Pf(t,e){Ve(e,!0);var n=Of();Xe(n,21,()=>e.panes,r=>r.index,(r,b)=>{var k=Mf(),C=j(k);le(()=>{Re(k,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${e.activePane===w(b).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),oe(C,w(b).label)}),pe("click",k,()=>e.onselect(w(b).index)),q(r,k)}),q(t,n),Ge()}xt(["click"]);var If=Z('<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">×</button></div>'),Hf=Z('<div class="fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm"></div>');function Nf(t,e){Ve(e,!0);var n=mt(),r=Pe(n);{var b=k=>{var C=Hf();Xe(C,21,()=>e.notifications,o=>o.id,(o,c)=>{var h=If(),d=j(h),u=j(d);Fa(u,{get notification(){return w(c)},large:!0});var f=G(d,2);pe("click",d,()=>{e.ondismiss(w(c).id),e.onselect(w(c).branch)}),pe("click",f,()=>e.ondismiss(w(c).id)),q(o,h)}),q(k,C)};ne(r,k=>{e.notifications.length>0&&k(b)})}q(t,n),Ge()}xt(["click"]);var Ff=Z('<p class="m-0 px-4 pb-3 text-xs text-muted">Set <code>LINEAR_API_KEY</code> to show your assigned Linear issues here.</p>'),Wf=Z('<p class="m-0 px-4 pb-3 text-xs text-muted">No assigned Linear issues right now.</p>'),Uf=Z('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),jf=Z('<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>'),zf=Z('<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),Kf=Z('<p class="m-0 px-4 pb-3 text-xs text-muted">Linear integration is disabled in this project.</p>'),$f=Z('<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 qf(t,e){Ve(e,!0);let n=ce(!0),r=ce(""),b=ue(()=>w(r)?e.issues.filter(m=>Sn(w(r),m.title)||(m.description?Sn(w(r),m.description):!1)):e.issues),k=ue(()=>e.availability==="ready"?` (${w(b).length!==e.issues.length?`${w(b).length}/`:""}${e.issues.length})`:"");var C=$f(),o=j(C),c=j(o),h=j(c),d=G(c,2),u=j(d),f=G(o,2);{var _=m=>{var v=mt(),s=Pe(v);{var a=p=>{var S=Ff();q(p,S)},i=p=>{var S=mt(),y=Pe(S);{var E=x=>{var T=Wf();q(x,T)},g=x=>{var T=zf(),B=Pe(T),P=j(B),M=G(B,2);Xe(M,21,()=>w(b),H=>H.id,(H,W)=>{var J=jf(),ee=j(J),Y=j(ee),L=G(Y,2),A=j(L),R=G(L,2),I=j(R),F=G(ee,2),Q=j(F),ie=G(F,2);{var he=se=>{var de=Uf(),ve=j(de);le(()=>oe(ve,w(W).description)),q(se,de)};ne(ie,se=>{w(W).description&&se(he)})}var N=G(ie,2),D=j(N),K=j(D),O=G(K);{var V=se=>{var de=qe();le(()=>oe(de,`· ${w(W).project??""}`)),q(se,de)};ne(O,se=>{w(W).project&&se(V)})}var $=G(D,2),ae=j($);ut(ae,{small:!0,variant:"accent-outline",onclick:()=>e.onassign(w(W)),children:(se,de)=>{var ve=qe("Implement");q(se,ve)},$$slots:{default:!0}}),le(()=>{ar(Y,`background: ${w(W).state.color??""};`),xe(Y,"title",w(W).state.name),xe(L,"href",w(W).url),oe(A,w(W).identifier),oe(I,w(W).priorityLabel),oe(Q,w(W).title),oe(K,w(W).team.key)}),pe("click",J,()=>e.onselect(w(W))),pe("keydown",J,se=>{(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),e.onselect(w(W)))}),pe("click",L,se=>se.stopPropagation()),pe("keydown",L,se=>se.stopPropagation()),pe("click",$,se=>se.stopPropagation()),pe("keydown",$,se=>{(se.key==="Enter"||se.key===" ")&&se.stopPropagation()}),q(H,J)}),Fr(P,()=>w(r),H=>U(r,H)),q(x,T)};ne(y,x=>{e.issues.length===0?x(E):x(g,-1)})}q(p,S)},l=p=>{var S=Kf();q(p,S)};ne(s,p=>{e.availability==="missing_api_key"?p(a):e.availability==="ready"?p(i,1):p(l,-1)})}q(m,v)};ne(f,m=>{w(n)||m(_)})}le(()=>{oe(h,`Linear${w(k)??""}`),oe(u,w(n)?"▸":"▾")}),pe("click",o,()=>U(n,!w(n))),q(t,C),Ge()}xt(["click","keydown"]);var Vf=Z('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),Gf=Z('<p class="text-[13px] text-muted italic mb-4">No description</p>'),Xf=Z("<span> </span>"),Yf=Z('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),Jf=Z("<span> </span>"),Zf=Z('<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 Qf(t,e){Ve(e,!0),Zr(t,{get onclose(){return e.onclose},wide:!0,children:(n,r)=>{var b=Zf(),k=Pe(b),C=j(k),o=G(C,2),c=j(o),h=G(o,2),d=j(h),u=G(h,2),f=j(u),_=G(k,2),m=j(_),v=G(_,2);{var s=H=>{var W=Vf(),J=j(W);le(()=>oe(J,e.issue.description)),q(H,W)},a=H=>{var W=Gf();q(H,W)};ne(v,H=>{e.issue.description?H(s):H(a,-1)})}var i=G(v,2),l=j(i),p=j(l),S=G(l,2);{var y=H=>{var W=Xf(),J=j(W);le(()=>oe(J,`· ${e.issue.project??""}`)),q(H,W)};ne(S,H=>{e.issue.project&&H(y)})}var E=G(S,2);{var g=H=>{var W=mt(),J=Pe(W);Xe(J,17,()=>e.issue.labels,ee=>ee.name,(ee,Y)=>{var L=Yf(),A=j(L);le(()=>{ar(L,`color: ${w(Y).color??""}; background: ${w(Y).color??""}20;`),oe(A,w(Y).name)}),q(ee,L)}),q(H,W)};ne(E,H=>{e.issue.labels.length>0&&H(g)})}var x=G(E,2);{var T=H=>{var W=Jf(),J=j(W);le(()=>oe(J,`Due ${e.issue.dueDate??""}`)),q(H,W)};ne(x,H=>{e.issue.dueDate&&H(T)})}var B=G(i,2),P=j(B);ut(P,{get onclick(){return e.onclose},children:(H,W)=>{var J=qe("Close");q(H,J)},$$slots:{default:!0}});var M=G(P,2);ut(M,{variant:"accent-outline",onclick:()=>e.onassign(e.issue),children:(H,W)=>{var J=qe("Implement");q(H,J)},$$slots:{default:!0}}),le(()=>{ar(C,`background: ${e.issue.state.color??""};`),xe(C,"title",e.issue.state.name),xe(o,"href",e.issue.url),oe(c,e.issue.identifier),oe(d,e.issue.state.name),oe(f,`· ${e.issue.priorityLabel??""}`),oe(m,e.issue.title),oe(p,e.issue.team.key)}),q(n,b)},$$slots:{default:!0}}),Ge()}var e_=Z('<div class="fixed inset-0 bg-black/50 z-40"></div>'),t_=Z('<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">×</button>'),r_=Z('<div class="mt-2 flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </div>'),i_=Z('<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>'),s_=Z('<div role="separator" aria-orientation="vertical" tabindex="0"></div>'),n_=Z('<!> <aside><div class="p-4 border-b border-edge"><div class="flex items-center justify-between"><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> <!></div> <!> <!> <!></aside> <!>',1),o_=Z('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-3 text-center"><span class="spinner" style="width: 24px; height: 24px; border-width: 2px;"></span> <p class="text-sm text-primary font-medium"> </p> <p class="text-xs text-muted"> </p></div></div>'),a_=Z('<span class="text-xs text-muted"> </span>'),l_=Z('<span class="text-xs text-muted"> </span>'),c_=Z('<span class="spinner" style="width: 14px; height: 14px; border-width: 1.5px;"></span> Opening...',1),h_=Z('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-4 text-center"><p class="text-sm text-primary font-medium"> </p> <div class="flex flex-col items-center gap-1"><!> <!></div> <button class="mt-2 px-5 py-2 rounded-md bg-accent text-white text-sm font-medium cursor-pointer border-none hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"><!></button></div></div>'),u_=Z('<div class="flex-1 flex items-center justify-center text-muted text-sm"><p>Select a worktree from the sidebar to connect</p></div>'),d_=Z('<div><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!> <!>',1);function f_(t,e){Ve(e,!0);let n=ce(Ae({services:[],profiles:[],defaultProfileName:"",autoName:!1,linearCreateTicketOption:!1,linkedRepos:[]})),r=ce(Ae([])),b=ce(Ae(vh())),k=ce(!1),C=ce(null),o=ce(null),c=ce(Ae(new Set)),h=ce(!1),d=ce(!1),u=ce(null),f=ce(null),_=ce(!1),m=ce(0),v=-1,s=0,a=0,i=ce(Ae(localStorage.getItem(ls)??"")),l=ce(Ae(_h())),p=ue(()=>Ma(w(l)).terminal),S=null,y=ce(null),E=ce(Ae([])),g=ce(!1),x=ce(null),T=ce(Ae([])),B=ce("disabled"),P=ce(null),M=ce(null),H=0;const W=3e5,J=5e3,ee=1e3;let Y=ce(Ae([])),L=ce(Ae([])),A=ce(0);const R=4e3,I=10;let F=ce(Ae(new Set));function Q(z){U(Y,[...w(Y),z],!0),U(F,new Set([...w(F),z.branch]),!0),U(L,[z,...w(L)].slice(0,I),!0),pc(A),setTimeout(()=>{U(Y,w(Y).filter(te=>te.id!==z.id),!0)},R),document.hidden&&Notification.permission==="granted"&&new Notification(z.message,{body:z.url??z.branch,tag:`wm-${z.id}`})}function ie(z){w(L).some(te=>te.id===z.id)||U(L,[z,...w(L)].slice(0,I),!0)}function he(z){U(Y,w(Y).filter(te=>te.id!==z),!0),Ou(z).catch(()=>{})}function N(z){U(Y,w(Y).filter(te=>te.id!==z),!0)}function D(){U(A,0)}const K=140,O=500,V=10;let $=ce(Ae(Math.min(O,Math.max(K,ph())))),ae=ce(!1);function se(z){return Math.min(O,Math.max(K,z))}function de(z){z.preventDefault(),U(ae,!0);const te=z.clientX,_e=w($);function Te(Ue){U($,se(_e+Ue.clientX-te),!0)}function Me(){U(ae,!1),_o(w($)),window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",Me)}window.addEventListener("pointermove",Te),window.addEventListener("pointerup",Me)}function ve(z){if(z.key==="ArrowLeft"||z.key==="ArrowRight"){z.preventDefault();const te=z.key==="ArrowRight"?V:-V;U($,se(w($)+te),!0),_o(w($))}}let re=ce(!1),fe=ce(!1),De=ce(0),Ie=ce(void 0);const ot=200;let Fe=ce(Ae(new Set)),Se=ue(()=>w(r)),et=ue(()=>w(Se).filter(z=>z.creating)),je=ue(()=>w(Se).filter(z=>z.creating).length),at=ue(()=>Math.max(w(m),w(je))),Xt=ue(()=>w(at)>0),bt=ue(()=>w(Se).filter(z=>!w(c).has(z.branch))),Sr=ue(()=>w(at)===1?"Creating...":`Creating ${w(at)}...`),Ee=ue(()=>w(b)&&!w(c).has(w(b))?w(Se).find(z=>z.branch===w(b)):void 0),Yt=ue(()=>{var z,te;return!!w(b)&&((z=w(Ee))==null?void 0:z.mux)==="✓"&&!((te=w(Ee))!=null&&te.creating)}),Oe=ue(()=>w(b)?w(Fe).has(w(b)):!1),Mr=ue(()=>w(Xt)?ee:J),Ds=ue(()=>w(B)!=="disabled");pt(()=>{const z=gh(w(b),w(Ee),w(bt),w(k));z!==w(b)&&U(b,z,!0)}),pt(()=>{if(w(m)===0||v===-1)return;const z=w(y)?w(Se).find(te=>te.branch===w(y)):w(et).length===1?w(et)[0]:void 0;z&&(U(b,z.branch,!0),w(re)&&U(fe,!1))}),pt(()=>{S==null||S(w(Mr))}),pt(()=>{if(w(k)){if(w(Ee)){fo(w(Ee).branch);return}w(bt).length===0&&fo(null)}}),pt(()=>{if(!w(h))return;const z=++a;U(E,[],!0),U(g,!0),U(x,null),xu().then(te=>{z===a&&U(E,te,!0)}).catch(te=>{z===a&&U(x,tr(te),!0)}).finally(()=>{z===a&&U(g,!1)})}),pt(()=>{document.title=w(n).name?`${w(n).name} - Dashboard`:"Dev Dashboard"});let we=ue(()=>{var te;const z=((te=w(Ee))==null?void 0:te.paneCount)??0;return z<2?[]:Array.from({length:z},(_e,Te)=>({index:Te,label:String(Te+1)}))}),Be=ue(()=>w(re)&&w(Yt)&&w(we).length>0);function He(){const z=Date.now();z-H<W||(H=z,Ru().then(te=>{U(B,te.availability,!0),U(T,te.issues,!0)}).catch(te=>console.warn("[linear]",te)))}async function ke(){try{U(r,await Cu(),!0),U(k,!0)}catch(z){console.error("Failed to refresh:",z)}He()}function tt(z){U(P,z,!0),U(h,!0)}async function lt(z){const te=s++,_e=w(Ee)==null;_e&&(v=te),U(m,w(m)+1),_e&&U(y,z.branch??null,!0),U(h,!1),U(P,null);try{const Te=Eu(z);ke();const Me=await Te;_e&&U(y,Me.branch,!0),await ke(),z.createLinearTicket&&(H=0,He()),_e&&te===v&&(U(b,Me.branch,!0),w(re)&&U(fe,!1))}catch(Te){alert(`Failed to create: ${tr(Te)}`)}finally{U(m,Math.max(0,w(m)-1),!0),_e&&te===v&&(U(y,null),v=-1)}}function Ke(z){if(w(b)!==z)return;const te=w(Se).findIndex(Ue=>Ue.branch===z),_e=w(Se)[te-1],Te=w(Se)[te+1],Me=[_e,Te].find(Ue=>Ue&&!w(c).has(Ue.branch));U(b,Me?Me.branch:null,!0)}async function Wt(){const z=w(C);if(z){U(C,null),Ke(z),U(c,new Set([...w(c),z]),!0);try{await ku(z),await ke()}catch(te){alert(`Failed to remove: ${tr(te)}`)}finally{U(c,new Set([...w(c)].filter(te=>te!==z)),!0)}}}async function ki(){const z=w(o);if(z){U(o,null),Ke(z),U(c,new Set([...w(c),z]),!0);try{await Tu(z),await ke()}catch(te){alert(`Failed to merge: ${tr(te)}`)}finally{U(c,new Set([...w(c)].filter(te=>te!==z)),!0)}}}async function Qr(){const z=w(b);if(z){U(Fe,new Set([...w(Fe),z]),!0);try{await Lu(z),await ke()}catch(te){alert(`Failed to open worktree: ${tr(te)}`)}finally{U(Fe,new Set([...w(Fe)].filter(te=>te!==z)),!0)}}}async function Ts(){const z=w(b);if(z){Ke(z);try{await Du(z),await ke()}catch(te){alert(`Failed to close worktree: ${tr(te)}`)}}}function wr(z){const te=w(Se).filter(Me=>!w(c).has(Me.branch));if(te.length===0)return;if(!w(b)){U(b,te[z===1?0:te.length-1].branch,!0);return}const Te=te.findIndex(Me=>Me.branch===w(b))+z;Te>=0&&Te<te.length&&U(b,te[Te].branch,!0)}function Li(z){w(h)||w(C)||w(o)||!(z.metaKey||z.ctrlKey)||(z.key==="ArrowUp"?(z.preventDefault(),wr(-1)):z.key==="ArrowDown"?(z.preventDefault(),wr(1)):z.key==="k"||z.key==="K"?(z.preventDefault(),U(h,!0)):z.key==="m"||z.key==="M"?(z.preventDefault(),w(b)&&U(o,w(b),!0)):z.key==="d"||z.key==="D"?(z.preventDefault(),w(b)&&U(C,w(b),!0)):z.key==="Enter"&&w(Ee)&&w(Ee).mux!=="✓"&&!w(Ee).creating&&!w(Oe)&&(z.preventDefault(),Qr()))}function Ji(z){var te;U(De,z,!0),(te=w(Ie))==null||te.sendSelectPane(z)}Hn(()=>{Ia(w(l)),bu().then(kt=>{U(n,kt,!0)}).catch(()=>{}),ke(),He();let z=w(Mr),te;window.addEventListener("keydown",Li);let _e=Mu(Q,N,ie);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});let Te,Me=!1;function Ue(){te&&clearInterval(te),!(document.hidden||Me)&&(te=setInterval(ke,z))}S=kt=>{z!==kt&&(z=kt,Ue())},Ue();function St(){Me&&(Me=!1,ke(),Ue()),clearTimeout(Te),Te=setTimeout(()=>{Me=!0,te&&clearInterval(te)},6e4)}document.addEventListener("click",St),document.addEventListener("keydown",St),St();function cr(){document.hidden?te&&clearInterval(te):(St(),ke(),Ue())}document.addEventListener("visibilitychange",cr);const Or=window.matchMedia("(max-width: 768px)");U(re,Or.matches,!0),w(re)&&U(fe,!0);function ni(kt){U(re,kt.matches,!0)}return Or.addEventListener("change",ni),()=>{te&&clearInterval(te),S=null,clearTimeout(Te),document.removeEventListener("click",St),document.removeEventListener("keydown",St),window.removeEventListener("keydown",Li),document.removeEventListener("visibilitychange",cr),Or.removeEventListener("change",ni),_e()}});var ei=d_(),ti=Pe(ei),Zi=j(ti);{var Rs=z=>{var te=n_(),_e=Pe(te);{var Te=Ne=>{var ze=e_();pe("click",ze,()=>U(fe,!1)),pe("keydown",ze,ai=>{ai.key==="Escape"&&U(fe,!1)}),q(Ne,ze)};ne(_e,Ne=>{w(re)&&Ne(Te)})}var Me=G(_e,2),Ue=j(Me),St=j(Ue),cr=j(St),Or=j(cr),ni=G(cr,2),kt=j(ni),Hs=G(kt,2);{var Ns=Ne=>{var ze=t_();pe("click",ze,()=>U(fe,!1)),q(Ne,ze)};ne(Hs,Ne=>{w(re)&&Ne(Ns)})}var Fs=G(St,2);{var dt=Ne=>{var ze=r_(),ai=G(j(ze));le(()=>oe(ai,` ${w(Sr)??""}`)),q(Ne,ze)};ne(Fs,Ne=>{w(at)>0&&Ne(dt)})}var Mt=G(Ue,2);Wh(Mt,{get worktrees(){return w(Se)},get selected(){return w(b)},get removing(){return w(c)},get initializing(){return w(Fe)},get notifiedBranches(){return w(F)},onselect:Ne=>{U(b,Ne,!0),U(F,new Set([...w(F)].filter(ze=>ze!==Ne)),!0),w(re)&&U(fe,!1)},onremove:Ne=>U(C,Ne,!0)});var oi=G(Mt,2);{var rl=Ne=>{qf(Ne,{get issues(){return w(T)},get availability(){return w(B)},onassign:tt,onselect:ze=>U(M,ze,!0)})};ne(oi,Ne=>{w(Ds)&&Ne(rl)})}var il=G(oi,2);{var sl=Ne=>{var ze=i_();q(Ne,ze)};ne(il,Ne=>{w(re)||Ne(sl)})}var nl=G(Me,2);{var ol=Ne=>{var ze=s_();let ai;xe(ze,"aria-valuemin",K),xe(ze,"aria-valuemax",O),le(()=>{ai=Re(ze,1,"w-1 shrink-0 cursor-col-resize hover:bg-accent/50 transition-colors",null,ai,{"bg-accent":w(ae)}),xe(ze,"aria-valuenow",w($))}),pe("pointerdown",ze,de),pe("keydown",ze,ve),q(Ne,ze)};ne(nl,Ne=>{w(re)||Ne(ol)})}le(()=>{Re(Me,1,`${w(re)?"fixed inset-0 z-50 w-full":""} bg-sidebar border-r border-edge flex flex-col overflow-hidden shrink-0`),ar(Me,w(re)?"":`width: ${w($)}px`),oe(Or,w(n).name??"Dashboard")}),pe("click",kt,()=>U(h,!0)),q(z,te)};ne(Zi,z=>{(!w(re)||w(fe))&&z(Rs)})}var As=G(Zi,2),Qi=j(As);{let z=ue(()=>{var _e;return((_e=w(Ee))==null?void 0:_e.branch)??null}),te=ue(()=>w(n).linkedRepos??[]);du(Qi,{get name(){return w(z)},get worktree(){return w(Ee)},get sshHost(){return w(i)},get linkedRepos(){return w(te)},get isMobile(){return w(re)},get notificationHistory(){return w(L)},get unreadCount(){return w(A)},ontogglesidebar:()=>U(fe,!w(fe)),onclose:Ts,onmerge:()=>{w(b)&&U(o,w(b),!0)},onremove:()=>{w(b)&&U(C,w(b),!0)},onsettings:()=>U(d,!0),ondirtyclick:()=>U(_,!0),onCiClick:_e=>U(u,_e,!0),onReviewsClick:_e=>U(f,_e,!0),onbellopen:D,onnotificationselect:_e=>{U(b,_e,!0),U(F,new Set([...w(F)].filter(Te=>Te!==_e)),!0),w(re)&&U(fe,!1)}})}var We=G(Qi,2);{var Ut=z=>{var te=mt(),_e=Pe(te);Kc(_e,()=>w(b),Te=>{{let Me=ue(()=>w(re)?w(De):void 0);Ui(Fu(Te,{get worktree(){return w(b)},get isMobile(){return w(re)},get initialPane(){return w(Me)},get terminalTheme(){return w(p)}}),Ue=>U(Ie,Ue,!0),()=>w(Ie))}}),q(z,te)},ri=z=>{var te=o_(),_e=j(te),Te=G(j(_e),2),Me=j(Te),Ue=G(Te,2),St=j(Ue);le(cr=>{oe(Me,w(Ee).branch),oe(St,cr)},[()=>Ha(w(Ee).creationPhase)]),q(z,te)},Bs=z=>{var te=h_(),_e=j(te),Te=j(_e),Me=j(Te),Ue=G(Te,2),St=j(Ue);{var cr=dt=>{var Mt=a_(),oi=j(Mt);le(()=>oe(oi,`Profile: ${w(Ee).profile??""}`)),q(dt,Mt)};ne(St,dt=>{w(Ee).profile&&dt(cr)})}var Or=G(St,2);{var ni=dt=>{var Mt=l_(),oi=j(Mt);le(()=>oe(oi,`Agent: ${w(Ee).agentName??""}`)),q(dt,Mt)};ne(Or,dt=>{w(Ee).agentName&&dt(ni)})}var kt=G(Ue,2),Hs=j(kt);{var Ns=dt=>{var Mt=c_();q(dt,Mt)},Fs=dt=>{var Mt=qe("Open Session");q(dt,Mt)};ne(Hs,dt=>{w(Oe)?dt(Ns):dt(Fs,-1)})}le(()=>{oe(Me,w(Ee).branch),kt.disabled=w(Oe)}),pe("click",kt,Qr),q(z,te)},Ms=z=>{var te=u_();q(z,te)};ne(We,z=>{var te;w(Yt)?z(Ut):(te=w(Ee))!=null&&te.creating?z(ri,1):w(Ee)?z(Bs,2):z(Ms,-1)})}var Di=G(We,2);{var ii=z=>{Pf(z,{get activePane(){return w(De)},get panes(){return w(we)},onselect:Ji})};ne(Di,z=>{w(Be)&&z(ii)})}var Ti=G(ti,2);{var Ri=z=>{{let te=ue(()=>{var Ue;return((Ue=w(P))==null?void 0:Ue.branchName)??""}),_e=ue(()=>w(P)?`${w(P).title}${w(P).description?`
|
|
147
|
-
|
|
148
|
-
`+w(P).description:""}`:""),Te=ue(()=>w(n).startupEnvs??{}),Me=ue(()=>w(P)!==null);fd(z,{get profiles(){return w(n).profiles},get defaultProfileName(){return w(n).defaultProfileName},get autoNameEnabled(){return w(n).autoName},get initialBranch(){return w(te)},get initialPrompt(){return w(_e)},get availableBranches(){return w(E)},get availableBranchesLoading(){return w(g)},get availableBranchesError(){return w(x)},get startupEnvs(){return w(Te)},get linearCreateTicketOption(){return w(n).linearCreateTicketOption},get openedFromLinearIssue(){return w(Me)},oncreate:lt,oncancel:()=>{U(h,!1),U(P,null)}})}};ne(Ti,z=>{w(h)&&z(Ri)})}var Ai=G(Ti,2);{var Os=z=>{{let te=ue(()=>`Remove worktree "${w(C)}"? This action cannot be undone.`);mo(z,{get message(){return w(te)},onconfirm:Wt,oncancel:()=>U(C,null)})}};ne(Ai,z=>{w(C)&&z(Os)})}var es=G(Ai,2);{var Ps=z=>{{let te=ue(()=>`Merge worktree "${w(o)}" into main? The worktree will be removed after merging.`);mo(z,{get message(){return w(te)},confirmLabel:"Merge",variant:"accent",onconfirm:ki,oncancel:()=>U(o,null)})}};ne(es,z=>{w(o)&&z(Ps)})}var si=G(es,2);{var Is=z=>{{let te=ue(()=>w(n).linearAutoCreateWorktrees??!1);gd(z,{get currentTheme(){return w(l)},get linearAutoCreate(){return w(te)},onthemechange:_e=>U(l,_e,!0),onlinearautocreatechange:_e=>{w(n).linearAutoCreateWorktrees=_e},onsave:_e=>{U(i,_e,!0),U(d,!1)},onclose:()=>U(d,!1)})}};ne(si,z=>{w(d)&&z(Is)})}var Kn=G(si,2);{var Ja=z=>{{let te=ue(()=>{var _e;return((_e=w(Ee))==null?void 0:_e.branch)??""});Ld(z,{get pr(){return w(u)},get branch(){return w(te)},onclose:()=>U(u,null),onfixsuccess:()=>{U(u,null),setTimeout(()=>{var _e;return(_e=w(Ie))==null?void 0:_e.sendInput("\r")},ot)}})}};ne(Kn,z=>{w(u)&&z(Ja)})}var $n=G(Kn,2);{var Za=z=>{{let te=ue(()=>{var _e;return((_e=w(Ee))==null?void 0:_e.branch)??""});Id(z,{get pr(){return w(f)},get branch(){return w(te)},onclose:()=>U(f,null),onsendsuccess:()=>{U(f,null),setTimeout(()=>{var _e;return(_e=w(Ie))==null?void 0:_e.sendInput("\r")},ot)}})}};ne($n,z=>{w(f)&&z(Za)})}var qn=G($n,2);{var Qa=z=>{Bf(z,{get branch(){return w(b)},onclose:()=>U(_,!1)})};ne(qn,z=>{w(_)&&w(b)&&z(Qa)})}var Vn=G(qn,2);{var el=z=>{Qf(z,{get issue(){return w(M)},onassign:te=>{U(M,null),tt(te)},onclose:()=>U(M,null)})};ne(Vn,z=>{w(M)&&z(el)})}var tl=G(Vn,2);Nf(tl,{get notifications(){return w(Y)},ondismiss:he,onselect:z=>{U(b,z,!0),U(F,new Set([...w(F)].filter(te=>te!==z)),!0),w(re)&&U(fe,!1)}}),le(()=>{Re(ti,1,`flex h-dvh bg-surface text-primary ${w(ae)?"select-none":""}`),ar(ti,w(ae)?"cursor: col-resize":"")}),q(t,ei),Ge()}xt(["click","keydown","pointerdown"]);Fc(f_,{target:document.getElementById("app")});
|