@tui-sandbox/library 9.5.0 → 9.6.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/browser/assets/{index-06LPWRXA.js → index-Dm7lp9YI.js} +6 -6
  3. package/dist/browser/index.html +1 -1
  4. package/dist/src/browser/neovim-client.d.ts +2 -1
  5. package/dist/src/browser/neovim-client.js +3 -0
  6. package/dist/src/browser/neovim-client.js.map +1 -1
  7. package/dist/src/client/neovim-terminal-client.d.ts +2 -1
  8. package/dist/src/client/neovim-terminal-client.js +9 -0
  9. package/dist/src/client/neovim-terminal-client.js.map +1 -1
  10. package/dist/src/server/cypress-support/contents.js +20 -1
  11. package/dist/src/server/cypress-support/contents.js.map +1 -1
  12. package/dist/src/server/dirtree/index.test.js +5 -0
  13. package/dist/src/server/dirtree/index.test.js.map +1 -1
  14. package/dist/src/server/neovim/index.d.ts +5 -0
  15. package/dist/src/server/neovim/index.js +33 -0
  16. package/dist/src/server/neovim/index.js.map +1 -1
  17. package/dist/src/server/server.d.ts +34 -0
  18. package/dist/src/server/server.js +17 -2
  19. package/dist/src/server/server.js.map +1 -1
  20. package/dist/src/server/utilities/timeout.js +1 -1
  21. package/dist/src/server/utilities/timeout.js.map +1 -1
  22. package/dist/src/server/utilities/timeoutable.d.ts +1 -0
  23. package/dist/src/server/utilities/timeoutable.js +18 -0
  24. package/dist/src/server/utilities/timeoutable.js.map +1 -0
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +9 -9
  27. package/src/browser/neovim-client.ts +5 -1
  28. package/src/client/neovim-terminal-client.ts +10 -1
  29. package/src/server/cypress-support/contents.ts +20 -1
  30. package/src/server/dirtree/index.test.ts +5 -0
  31. package/src/server/neovim/index.ts +56 -0
  32. package/src/server/server.ts +22 -2
  33. package/src/server/utilities/timeout.ts +1 -1
  34. package/src/server/utilities/timeoutable.ts +19 -0
@@ -1,9 +1,9 @@
1
- var jr=Object.defineProperty;var $r=(c,e,a)=>e in c?jr(c,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[e]=a;var Se=(c,e,a)=>$r(c,typeof e!="symbol"?e+"":e,a);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))d(v);new MutationObserver(v=>{for(const y of v)if(y.type==="childList")for(const k of y.addedNodes)k.tagName==="LINK"&&k.rel==="modulepreload"&&d(k)}).observe(document,{childList:!0,subtree:!0});function a(v){const y={};return v.integrity&&(y.integrity=v.integrity),v.referrerPolicy&&(y.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?y.credentials="include":v.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function d(v){if(v.ep)return;v.ep=!0;const y=a(v);fetch(v.href,y)}})();function qe(c){const e={subscribe(a){let d=null,v=!1,y=!1,k=!1;function t(){if(d===null){k=!0;return}y||(y=!0,typeof d=="function"?d():d&&d.unsubscribe())}return d=c({next(o){var l;v||(l=a.next)==null||l.call(a,o)},error(o){var l;v||(v=!0,(l=a.error)==null||l.call(a,o),t())},complete(){var o;v||(v=!0,(o=a.complete)==null||o.call(a),t())}}),k&&t(),{unsubscribe:t}},pipe(...a){return a.reduce(Ur,e)}};return e}function Ur(c,e){return e(c)}function zr(c){const e=new AbortController;return new Promise((d,v)=>{let y=!1;function k(){y||(y=!0,t.unsubscribe())}e.signal.addEventListener("abort",()=>{v(e.signal.reason)});const t=c.subscribe({next(o){y=!0,d(o),k()},error(o){v(o)},complete(){e.abort(),k()}})})}function qr(c){return e=>{let a=0,d=null;const v=[];function y(){d||(d=e.subscribe({next(t){var o;for(const l of v)(o=l.next)==null||o.call(l,t)},error(t){var o;for(const l of v)(o=l.error)==null||o.call(l,t)},complete(){var t;for(const o of v)(t=o.complete)==null||t.call(o)}}))}function k(){if(a===0&&d){const t=d;d=null,t.unsubscribe()}}return qe(t=>(a++,v.push(t),y(),{unsubscribe(){a--,k();const o=v.findIndex(l=>l===t);o>-1&&v.splice(o,1)}}))}}function dr(c){let e=c;const a=[],d=k=>{e!==void 0&&k.next(e),a.push(k)},v=k=>{a.splice(a.indexOf(k),1)},y=qe(k=>(d(k),()=>{v(k)}));return y.next=k=>{if(e!==k){e=k;for(const t of a)t.next(k)}},y.get=()=>e,y}function ur(c){return qe(e=>{function a(v=0,y=c.op){const k=c.links[v];if(!k)throw new Error("No more links to execute - did you forget to add an ending link?");return k({op:y,next(o){return a(v+1,o)}})}return a().subscribe(e)})}const fr=()=>{},Zt=c=>{Object.freeze&&Object.freeze(c)};function _r(c,e,a){var d,v;const y=e.join(".");return(d=a)[v=y]??(d[v]=new Proxy(fr,{get(k,t){if(!(typeof t!="string"||t==="then"))return _r(c,[...e,t],a)},apply(k,t,o){const l=e[e.length-1];let _={args:o,path:e};return l==="call"?_={args:o.length>=2?[o[1]]:[],path:e.slice(0,-1)}:l==="apply"&&(_={args:o.length>=2?o[1]:[],path:e.slice(0,-1)}),Zt(_.args),Zt(_.path),c(_)}})),a[y]}const Vr=c=>_r(c,[],Object.create(null)),Zr=c=>new Proxy(fr,{get(e,a){if(a!=="then")return c(a)}}),pt={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603};function Xe(c){return!!c&&!Array.isArray(c)&&typeof c=="object"}const pr=c=>c();function Kr(c,e){if("error"in c){const d=e.deserialize(c.error);return{ok:!1,error:{...c,error:d}}}return{ok:!0,result:{...c.result,...(!c.result.type||c.result.type==="data")&&{type:"data",data:e.deserialize(c.result.data)}}}}class Ot extends Error{constructor(){super("Unable to transform response from server")}}function Gr(c,e){let a;try{a=Kr(c,e)}catch{throw new Ot}if(!a.ok&&(!Xe(a.error.error)||typeof a.error.error.code!="number"))throw new Ot;if(a.ok&&!Xe(a.result))throw new Ot;return a}function gt(c,e,a){return e in c?Object.defineProperty(c,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):c[e]=a,c}var gr;const Mt=new WeakMap,Jr=()=>{};gr=Symbol.toStringTag;let Yr=gr;class xe{subscribe(){let e,a;const{settlement:d}=this;if(d===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const v=Qr();this.subscribers=es(this.subscribers,v),e=v.promise,a=()=>{this.subscribers!==null&&(this.subscribers=rs(this.subscribers,v))}}else{const{status:v}=d;v==="fulfilled"?e=Promise.resolve(d.value):e=Promise.reject(d.reason),a=Jr}return Object.assign(e,{unsubscribe:a})}then(e,a){const d=this.subscribe(),{unsubscribe:v}=d;return Object.assign(d.then(e,a),{unsubscribe:v})}catch(e){const a=this.subscribe(),{unsubscribe:d}=a;return Object.assign(a.catch(e),{unsubscribe:d})}finally(e){const a=this.subscribe(),{unsubscribe:d}=a;return Object.assign(a.finally(e),{unsubscribe:d})}static proxy(e){const a=xe.getSubscribablePromise(e);return typeof a<"u"?a:xe.createSubscribablePromise(e)}static createSubscribablePromise(e){const a=new xe(e);return Mt.set(e,a),Mt.set(a,a),a}static getSubscribablePromise(e){return Mt.get(e)}static resolve(e){const a=typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"?e:Promise.resolve(e);return xe.proxy(a).subscribe()}static async any(e){const d=(Array.isArray(e)?e:[...e]).map(xe.resolve);try{return await Promise.any(d)}finally{d.forEach(({unsubscribe:v})=>{v()})}}static async race(e){const d=(Array.isArray(e)?e:[...e]).map(xe.resolve);try{return await Promise.race(d)}finally{d.forEach(({unsubscribe:v})=>{v()})}}static async raceReferences(e){const a=e.map(Xr);try{return await Promise.race(a)}finally{for(const d of a)d.unsubscribe()}}constructor(e){gt(this,"promise",void 0),gt(this,"subscribers",[]),gt(this,"settlement",null),gt(this,Yr,"Unpromise"),typeof e=="function"?this.promise=new Promise(e):this.promise=e;const a=this.promise.then(d=>{const{subscribers:v}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:d},v==null||v.forEach(({resolve:y})=>{y(d)})});"catch"in a&&a.catch(d=>{const{subscribers:v}=this;this.subscribers=null,this.settlement={status:"rejected",reason:d},v==null||v.forEach(({reject:y})=>{y(d)})})}}function Xr(c){return xe.proxy(c).then(()=>[c])}function Qr(){let c,e;return{promise:new Promise((d,v)=>{c=d,e=v}),resolve:c,reject:e}}function es(c,e){return[...c,e]}function ts(c,e){return[...c.slice(0,e),...c.slice(e+1)]}function rs(c,e){const a=c.indexOf(e);return a!==-1?ts(c,a):c}var Kt,Gt;(Kt=Symbol).dispose??(Kt.dispose=Symbol());(Gt=Symbol).asyncDispose??(Gt.asyncDispose=Symbol());function ss(c,e){const a=c,d=a[Symbol.dispose];return a[Symbol.dispose]=()=>{e(),d==null||d()},a}function is(c,e){const a=c,d=a[Symbol.asyncDispose];return a[Symbol.asyncDispose]=async()=>{await e(),await(d==null?void 0:d())},a}const mr=Symbol();function ns(c){let e=null;return ss({start(){if(e)throw new Error("Timer already started");return new Promise(d=>{e=setTimeout(()=>d(mr),c)})}},()=>{e&&clearTimeout(e)})}function vr(c,e,a){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var d,v;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");d=e[Symbol.asyncDispose]}if(d===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");d=e[Symbol.dispose],a&&(v=d)}if(typeof d!="function")throw new TypeError("Object not disposable.");v&&(d=function(){try{v.call(this)}catch(y){return Promise.reject(y)}}),c.stack.push({value:e,dispose:d,async:a})}else a&&c.stack.push({async:!0});return e}function Ut(c){var e=typeof SuppressedError=="function"?SuppressedError:function(a,d,v){var y=new Error(v);return y.name="SuppressedError",y.error=a,y.suppressed=d,y};return(Ut=function(d){function v(o){d.error=d.hasError?new e(o,d.error,"An error was suppressed during disposal."):o,d.hasError=!0}var y,k=0;function t(){for(;y=d.stack.pop();)try{if(!y.async&&k===1)return k=0,d.stack.push(y),Promise.resolve().then(t);if(y.dispose){var o=y.dispose.call(y.value);if(y.async)return k|=2,Promise.resolve(o).then(t,function(l){return v(l),t()})}else k|=1}catch(l){v(l)}if(k===1)return d.hasError?Promise.reject(d.error):Promise.resolve();if(d.hasError)throw d.error}return t()})(c)}const os="ping",as="serialized-error",cs="connected",hs="return";async function ls(c){const e={stack:[],error:void 0,hasError:!1};try{const a=vr(e,ns(c.timeoutMs),!1),d=await xe.race([c.promise,a.start()]);return d===mr?await c.onTimeout():d}catch(a){e.error=a,e.hasError=!0}finally{Ut(e)}}function ds(c){const{deserialize:e=t=>t}=c;let a={};const d=c.signal;let v=null;const y=()=>new ReadableStream({async start(t){const[o,l]=await Promise.all([c.url(),c.init()]),_=v=new c.EventSource(o,l);t.enqueue({type:"connecting",eventSource:v,event:null}),_.addEventListener(cs,p=>{const C=JSON.parse(p.data);a=C,t.enqueue({type:"connected",options:C,eventSource:_})}),_.addEventListener(as,p=>{const m=p;t.enqueue({type:"serialized-error",error:e(JSON.parse(m.data)),eventSource:_})}),_.addEventListener(os,()=>{t.enqueue({type:"ping",eventSource:_})}),_.addEventListener(hs,()=>{_.close(),t.close(),v=null}),_.addEventListener("error",p=>{_.readyState===EventSource.CLOSED?t.error(p):t.enqueue({type:"connecting",eventSource:_,event:p})}),_.addEventListener("message",p=>{const m=p,f={data:e(JSON.parse(m.data))};m.lastEventId&&(f.id=m.lastEventId),t.enqueue({type:"data",data:f,eventSource:_})});const h=()=>{try{_.close(),t.close()}catch{}};d.aborted?h():d.addEventListener("abort",h)},cancel(){v==null||v.close()}}),k=()=>{let t=y(),o=t.getReader();async function l(){await o.cancel(),v=null}return is({read(){return o.read()},async recreate(){await l(),t=y(),o=t.getReader()}},l)};return pr(async function*(){const t={stack:[],error:void 0,hasError:!1};try{const o=vr(t,k(),!0);for(;;){let l=o.read();const _=a.reconnectAfterInactivityMs;_&&(l=ls({promise:l,timeoutMs:_,onTimeout:async()=>{const p={value:{type:"timeout",ms:_,eventSource:v},done:!1};return await o.recreate(),p}}));const h=await l;if(h.done)return h.value;yield h.value}}catch(o){t.error=o,t.hasError=!0}finally{const o=Ut(t);o&&await o}})}var nr,or,ar,cr,hr,lr;typeof window>"u"||"Deno"in window||((or=(nr=globalThis.process)==null?void 0:nr.env)==null?void 0:or.NODE_ENV)==="test"||(cr=(ar=globalThis.process)==null?void 0:ar.env)!=null&&cr.JEST_WORKER_ID||(lr=(hr=globalThis.process)==null?void 0:hr.env)!=null&&lr.VITEST_WORKER_ID;function mt(c,e,a){return e in c?Object.defineProperty(c,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):c[e]=a,c}function us(c){return c instanceof pe||c instanceof Error&&c.name==="TRPCClientError"}function fs(c){return Xe(c)&&Xe(c.error)&&typeof c.error.code=="number"&&typeof c.error.message=="string"}function _s(c,e){return typeof c=="string"?c:Xe(c)&&typeof c.message=="string"?c.message:e}class pe extends Error{static from(e,a={}){const d=e;return us(d)?(a.meta&&(d.meta={...d.meta,...a.meta}),d):fs(d)?new pe(d.error.message,{...a,result:d}):new pe(_s(d,"Unknown error"),{...a,cause:d})}constructor(e,a){var v,y;const d=a==null?void 0:a.cause;super(e,{cause:d}),mt(this,"cause",void 0),mt(this,"shape",void 0),mt(this,"data",void 0),mt(this,"meta",void 0),this.meta=a==null?void 0:a.meta,this.cause=d,this.shape=(v=a==null?void 0:a.result)==null?void 0:v.error,this.data=(y=a==null?void 0:a.result)==null?void 0:y.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,pe.prototype)}}function Pt(c,e,a){return e in c?Object.defineProperty(c,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):c[e]=a,c}class ps{$request(e){return ur({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(qr())}async requestAsPromise(e){try{const a=this.$request(e);return(await zr(a)).result.data}catch(a){throw pe.from(a)}}query(e,a,d){return this.requestAsPromise({type:"query",path:e,input:a,context:d==null?void 0:d.context,signal:d==null?void 0:d.signal})}mutation(e,a,d){return this.requestAsPromise({type:"mutation",path:e,input:a,context:d==null?void 0:d.context,signal:d==null?void 0:d.signal})}subscription(e,a,d){return this.$request({type:"subscription",path:e,input:a,context:d.context,signal:d.signal}).subscribe({next(y){var k,t,o,l;switch(y.result.type){case"state":{(k=d.onConnectionStateChange)==null||k.call(d,y.result);break}case"started":{(t=d.onStarted)==null||t.call(d,{context:y.context});break}case"stopped":{(o=d.onStopped)==null||o.call(d);break}case"data":case void 0:{(l=d.onData)==null||l.call(d,y.result.data);break}}},error(y){var k;(k=d.onError)==null||k.call(d,y)},complete(){var y;(y=d.onComplete)==null||y.call(d)}})}constructor(e){Pt(this,"links",void 0),Pt(this,"runtime",void 0),Pt(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(a=>a(this.runtime))}}const gs=Symbol.for("trpc_untypedClient"),ms={query:"query",mutate:"mutation",subscribe:"subscription"},vs=c=>ms[c];function bs(c){const e=Vr(({path:a,args:d})=>{const v=[...a],y=vs(v.pop()),k=v.join(".");return c[y](k,...d)});return Zr(a=>a===gs?c:e[a])}function br(c){const e=new ps(c);return bs(e)}const Jt=c=>typeof c=="function";function Ss(c){if(c)return c;if(typeof window<"u"&&Jt(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Jt(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Yt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Xt(c){let e=null,a=null;const d=()=>{clearTimeout(a),a=null,e=null};function v(t){var _,h;const o=[[]];let l=0;for(;;){const p=t[l];if(!p)break;const m=o[o.length-1];if(p.aborted){(_=p.reject)==null||_.call(p,new Error("Aborted")),l++;continue}if(c.validate(m.concat(p).map(f=>f.key))){m.push(p),l++;continue}if(m.length===0){(h=p.reject)==null||h.call(p,new Error("Input is too big for a single dispatch")),l++;continue}o.push([])}return o}function y(){const t=v(e);d();for(const o of t){if(!o.length)continue;const l={items:o};for(const h of o)h.batch=l;c.fetch(l.items.map(h=>h.key)).then(async h=>{var p;await Promise.all(h.map(async(m,C)=>{var i,n;const f=l.items[C];try{const r=await Promise.resolve(m);(i=f.resolve)==null||i.call(f,r)}catch(r){(n=f.reject)==null||n.call(f,r)}f.batch=null,f.reject=null,f.resolve=null}));for(const m of l.items)(p=m.reject)==null||p.call(m,new Error("Missing result")),m.batch=null}).catch(h=>{var p;for(const m of l.items)(p=m.reject)==null||p.call(m,h),m.batch=null})}}function k(t){const o={aborted:!1,key:t,batch:null,resolve:Yt,reject:Yt},l=new Promise((_,h)=>{o.reject=h,o.resolve=_,e||(e=[]),e.push(o)});return a||(a=setTimeout(y)),l}return{load:k}}function ys(...c){const e=new AbortController,a=c.length;let d=0;const v=()=>{++d===a&&e.abort()};for(const y of c)y!=null&&y.aborted?v():y==null||y.addEventListener("abort",v,{once:!0});return e.signal}function Cs(...c){const e=new AbortController;for(const a of c)a!=null&&a.aborted?e.abort():a==null||a.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}function Sr(c){const e=c;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:a=>a,deserialize:a=>a},output:{serialize:a=>a,deserialize:a=>a}}}function ws(c){return{url:c.url.toString(),fetch:c.fetch,transformer:Sr(c.transformer),methodOverride:c.methodOverride}}function Es(c){const e={};for(let a=0;a<c.length;a++){const d=c[a];e[a]=d}return e}const xs={query:"GET",mutation:"POST",subscription:"PATCH"};function yr(c){return"input"in c?c.transformer.input.serialize(c.input):Es(c.inputs.map(e=>c.transformer.input.serialize(e)))}const zt=c=>{const e=c.url.split("?");let d=e[0].replace(/\/$/,"")+"/"+c.path;const v=[];if(e[1]&&v.push(e[1]),"inputs"in c&&v.push("batch=1"),c.type==="query"||c.type==="subscription"){const y=yr(c);y!==void 0&&c.methodOverride!=="POST"&&v.push(`input=${encodeURIComponent(JSON.stringify(y))}`)}return v.length&&(d+="?"+v.join("&")),d},ks=c=>{if(c.type==="query"&&c.methodOverride!=="POST")return;const e=yr(c);return e!==void 0?JSON.stringify(e):void 0},Rs=c=>As({...c,contentTypeHeader:"application/json",getUrl:zt,getBody:ks});class Ls extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const Ds=c=>{var e;if(c!=null&&c.aborted)throw(e=c.throwIfAborted)==null||e.call(c),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Ls};async function Ts(c){Ds(c.signal);const e=c.getUrl(c),a=c.getBody(c),{type:d}=c,v=await(async()=>{const k=await c.headers();return Symbol.iterator in k?Object.fromEntries(k):k})(),y={...c.contentTypeHeader?{"content-type":c.contentTypeHeader}:{},...c.trpcAcceptHeader?{"trpc-accept":c.trpcAcceptHeader}:void 0,...v};return Ss(c.fetch)(e,{method:c.methodOverride??xs[d],signal:c.signal,body:a,headers:y})}async function As(c){const e={},a=await Ts(c);e.response=a;const d=await a.json();return e.responseJSON=d,{json:d,meta:e}}function Cr(c){const e=ws(c),a=c.maxURLLength??1/0;return()=>{const d=t=>({validate(o){if(a===1/0)return!0;const l=o.map(p=>p.path).join(","),_=o.map(p=>p.input);return zt({...e,type:t,path:l,inputs:_,signal:null}).length<=a},async fetch(o){const l=o.map(f=>f.path).join(","),_=o.map(f=>f.input),h=ys(...o.map(f=>f.signal)),p=await Rs({...e,path:l,inputs:_,type:t,headers(){return c.headers?typeof c.headers=="function"?c.headers({opList:o}):c.headers:{}},signal:h});return(Array.isArray(p.json)?p.json:o.map(()=>p.json)).map(f=>({meta:p.meta,json:f}))}}),v=Xt(d("query")),y=Xt(d("mutation")),k={query:v,mutation:y};return({op:t})=>qe(o=>{/* istanbul ignore if -- @preserve */if(t.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const _=k[t.type].load(t);let h;return _.then(p=>{h=p;const m=Gr(p.json,e.transformer.output);if(!m.ok){o.error(pe.from(m.error,{meta:p.meta}));return}o.next({context:p.meta,result:m.result}),o.complete()}).catch(p=>{o.error(pe.from(p,{meta:h==null?void 0:h.meta}))}),()=>{}})}}function Qt(c){return Array.isArray(c)?c:[c]}function wr(c){return e=>{const a=Qt(c.true).map(v=>v(e)),d=Qt(c.false).map(v=>v(e));return v=>qe(y=>{const k=c.condition(v.op)?a:d;return ur({op:v.op,links:k}).subscribe(y)})}}const bt=(c,...e)=>typeof c=="function"?c(...e):c;function Bs(){let c,e;return{promise:new Promise((d,v)=>{c=d,e=v}),resolve:c,reject:e}}async function Os(c){const e=await bt(c.url);if(!c.connectionParams)return e;const d=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+d}function Me(c,e,a){return e in c?Object.defineProperty(c,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):c[e]=a,c}function Ms(c){const{promise:e,resolve:a,reject:d}=Bs();return c.addEventListener("open",()=>{c.removeEventListener("error",d),a()}),c.addEventListener("error",d),e}function Ps(c,{intervalMs:e,pongTimeoutMs:a}){let d,v;function y(){d=setTimeout(()=>{c.send("PING"),v=setTimeout(()=>{c.close()},a)},e)}function k(){clearTimeout(d),y()}function t(){clearTimeout(v),k()}c.addEventListener("open",y),c.addEventListener("message",({data:o})=>{clearTimeout(d),y(),o==="PONG"&&t()}),c.addEventListener("close",()=>{clearTimeout(d),clearTimeout(v)})}class St{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++St.connectCount;const e=Os(this.urlOptions).then(a=>new this.WebSocketPonyfill(a));this.openPromise=e.then(Ms),this.ws=await e,this.ws.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Ps(this.ws,this.keepAliveOpts),this.ws.addEventListener("close",()=>{this.ws=null});try{await this.openPromise}finally{this.openPromise=null}}async close(){var e;try{await this.openPromise}finally{(e=this.ws)==null||e.close()}}constructor(e){if(Me(this,"id",++St.connectCount),Me(this,"WebSocketPonyfill",void 0),Me(this,"urlOptions",void 0),Me(this,"keepAliveOpts",void 0),Me(this,"wsObservable",dr(null)),Me(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}Me(St,"connectCount",0);function Is(c,e){return!e||c!=null&&typeof c!="object"?c:{...c??{},lastEventId:e}}async function Hs(c){let e=await bt(c.url);if(c.connectionParams){const a=await bt(c.connectionParams),d=e.includes("?")?"&":"?";e+=d+"connectionParams="+encodeURIComponent(JSON.stringify(a))}return e}const Fs=[pt.BAD_GATEWAY,pt.SERVICE_UNAVAILABLE,pt.GATEWAY_TIMEOUT,pt.INTERNAL_SERVER_ERROR];function Er(c){const e=Sr(c.transformer);return()=>({op:a})=>qe(d=>{const{type:v,path:y,input:k}=a;/* istanbul ignore if -- @preserve */if(v!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let t;const o=new AbortController,l=Cs(a.signal,o.signal),_=ds({url:async()=>zt({transformer:e,url:await Hs(c),input:Is(k,t),path:y,type:v,signal:null}),init:()=>bt(c.eventSourceOptions,{op:a}),signal:l,deserialize:e.output.deserialize,EventSource:c.EventSource??globalThis.EventSource}),h=dr({type:"state",state:"connecting",error:null}),p=h.subscribe({next(m){d.next({result:m})}});return pr(async()=>{for await(const m of _)switch(m.type){case"ping":break;case"data":const C=m.data;let f;C.id?(t=C.id,f={id:C.id,data:C}):f={data:C.data},d.next({result:f,context:{eventSource:m.eventSource}});break;case"connected":{d.next({result:{type:"started"},context:{eventSource:m.eventSource}}),h.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const i=pe.from({error:m.error});if(Fs.includes(m.error.code)){h.next({type:"state",state:"connecting",error:i});break}throw i}case"connecting":{const i=h.get(),n=m.event&&pe.from(m.event);if(!n&&i.state==="connecting")break;h.next({type:"state",state:"connecting",error:n});break}case"timeout":h.next({type:"state",state:"connecting",error:new pe(`Timeout of ${m.ms}ms reached while waiting for a response`)})}d.next({result:{type:"stopped"}}),h.next({type:"state",state:"idle",error:null}),d.complete()}).catch(m=>{d.error(pe.from(m))}),()=>{d.complete(),o.abort(),p.unsubscribe()}})}const Ns={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},vt=c=>Object.entries(c),{version:an,...Ws}=Ns,xr=vt(Ws).reduce((c,[e,a])=>(c[e]={...a,colorEntries:vt(a.colors),ansiColorEntries:vt(a.ansiColors)},c),{});vt(xr);var It={exports:{}},er;function js(){return er||(er=1,function(c,e){(function(a,d){c.exports=d()})(self,()=>(()=>{var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.FitAddon=void 0,d.FitAddon=class{activate(v){this._terminal=v}dispose(){}fit(){const v=this.proposeDimensions();if(!v||!this._terminal||isNaN(v.cols)||isNaN(v.rows))return;const y=this._terminal._core;this._terminal.rows===v.rows&&this._terminal.cols===v.cols||(y._renderService.clear(),this._terminal.resize(v.cols,v.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const v=this._terminal._core,y=v._renderService.dimensions;if(y.css.cell.width===0||y.css.cell.height===0)return;const k=this._terminal.options.scrollback===0?0:v.viewport.scrollBarWidth,t=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(t.getPropertyValue("height")),l=Math.max(0,parseInt(t.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=o-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-k;return{cols:Math.max(2,Math.floor(p/y.css.cell.width)),rows:Math.max(1,Math.floor(h/y.css.cell.height))}}}})(),a})())}(It)),It.exports}var $s=js(),Ht={exports:{}},tr;function Us(){return tr||(tr=1,function(c,e){(function(a,d){c.exports=d()})(globalThis,()=>(()=>{var a={4567:function(k,t,o){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const h=o(9042),p=o(9924),m=o(844),C=o(4725),f=o(2585),i=o(3656);let n=t.AccessibilityManager=class extends m.Disposable{constructor(r,s,u,S){super(),this._terminal=r,this._coreBrowserService=u,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(b=>this._handleResize(b.rows))),this.register(this._terminal.onRender(b=>this._refreshRows(b.start,b.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(b=>this._handleChar(b))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ var jr=Object.defineProperty;var $r=(c,e,o)=>e in c?jr(c,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):c[e]=o;var Se=(c,e,o)=>$r(c,typeof e!="symbol"?e+"":e,o);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))d(v);new MutationObserver(v=>{for(const y of v)if(y.type==="childList")for(const k of y.addedNodes)k.tagName==="LINK"&&k.rel==="modulepreload"&&d(k)}).observe(document,{childList:!0,subtree:!0});function o(v){const y={};return v.integrity&&(y.integrity=v.integrity),v.referrerPolicy&&(y.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?y.credentials="include":v.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function d(v){if(v.ep)return;v.ep=!0;const y=o(v);fetch(v.href,y)}})();function qe(c){const e={subscribe(o){let d=null,v=!1,y=!1,k=!1;function t(){if(d===null){k=!0;return}y||(y=!0,typeof d=="function"?d():d&&d.unsubscribe())}return d=c({next(a){var l;v||(l=o.next)==null||l.call(o,a)},error(a){var l;v||(v=!0,(l=o.error)==null||l.call(o,a),t())},complete(){var a;v||(v=!0,(a=o.complete)==null||a.call(o),t())}}),k&&t(),{unsubscribe:t}},pipe(...o){return o.reduce(Ur,e)}};return e}function Ur(c,e){return e(c)}function zr(c){const e=new AbortController;return new Promise((d,v)=>{let y=!1;function k(){y||(y=!0,t.unsubscribe())}e.signal.addEventListener("abort",()=>{v(e.signal.reason)});const t=c.subscribe({next(a){y=!0,d(a),k()},error(a){v(a)},complete(){e.abort(),k()}})})}function qr(c){return e=>{let o=0,d=null;const v=[];function y(){d||(d=e.subscribe({next(t){var a;for(const l of v)(a=l.next)==null||a.call(l,t)},error(t){var a;for(const l of v)(a=l.error)==null||a.call(l,t)},complete(){var t;for(const a of v)(t=a.complete)==null||t.call(a)}}))}function k(){if(o===0&&d){const t=d;d=null,t.unsubscribe()}}return qe(t=>(o++,v.push(t),y(),{unsubscribe(){o--,k();const a=v.findIndex(l=>l===t);a>-1&&v.splice(a,1)}}))}}function dr(c){let e=c;const o=[],d=k=>{e!==void 0&&k.next(e),o.push(k)},v=k=>{o.splice(o.indexOf(k),1)},y=qe(k=>(d(k),()=>{v(k)}));return y.next=k=>{if(e!==k){e=k;for(const t of o)t.next(k)}},y.get=()=>e,y}function ur(c){return qe(e=>{function o(v=0,y=c.op){const k=c.links[v];if(!k)throw new Error("No more links to execute - did you forget to add an ending link?");return k({op:y,next(a){return o(v+1,a)}})}return o().subscribe(e)})}const fr=()=>{},Zt=c=>{Object.freeze&&Object.freeze(c)};function _r(c,e,o){var d,v;const y=e.join(".");return(d=o)[v=y]??(d[v]=new Proxy(fr,{get(k,t){if(!(typeof t!="string"||t==="then"))return _r(c,[...e,t],o)},apply(k,t,a){const l=e[e.length-1];let _={args:a,path:e};return l==="call"?_={args:a.length>=2?[a[1]]:[],path:e.slice(0,-1)}:l==="apply"&&(_={args:a.length>=2?a[1]:[],path:e.slice(0,-1)}),Zt(_.args),Zt(_.path),c(_)}})),o[y]}const Vr=c=>_r(c,[],Object.create(null)),Zr=c=>new Proxy(fr,{get(e,o){if(o!=="then")return c(o)}}),gt={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603};function Xe(c){return!!c&&!Array.isArray(c)&&typeof c=="object"}const pr=c=>c();function Kr(c,e){if("error"in c){const d=e.deserialize(c.error);return{ok:!1,error:{...c,error:d}}}return{ok:!0,result:{...c.result,...(!c.result.type||c.result.type==="data")&&{type:"data",data:e.deserialize(c.result.data)}}}}class Ot extends Error{constructor(){super("Unable to transform response from server")}}function Gr(c,e){let o;try{o=Kr(c,e)}catch{throw new Ot}if(!o.ok&&(!Xe(o.error.error)||typeof o.error.error.code!="number"))throw new Ot;if(o.ok&&!Xe(o.result))throw new Ot;return o}function mt(c,e,o){return e in c?Object.defineProperty(c,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):c[e]=o,c}var gr;const Mt=new WeakMap,Jr=()=>{};gr=Symbol.toStringTag;let Yr=gr;class xe{subscribe(){let e,o;const{settlement:d}=this;if(d===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const v=Qr();this.subscribers=es(this.subscribers,v),e=v.promise,o=()=>{this.subscribers!==null&&(this.subscribers=rs(this.subscribers,v))}}else{const{status:v}=d;v==="fulfilled"?e=Promise.resolve(d.value):e=Promise.reject(d.reason),o=Jr}return Object.assign(e,{unsubscribe:o})}then(e,o){const d=this.subscribe(),{unsubscribe:v}=d;return Object.assign(d.then(e,o),{unsubscribe:v})}catch(e){const o=this.subscribe(),{unsubscribe:d}=o;return Object.assign(o.catch(e),{unsubscribe:d})}finally(e){const o=this.subscribe(),{unsubscribe:d}=o;return Object.assign(o.finally(e),{unsubscribe:d})}static proxy(e){const o=xe.getSubscribablePromise(e);return typeof o<"u"?o:xe.createSubscribablePromise(e)}static createSubscribablePromise(e){const o=new xe(e);return Mt.set(e,o),Mt.set(o,o),o}static getSubscribablePromise(e){return Mt.get(e)}static resolve(e){const o=typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"?e:Promise.resolve(e);return xe.proxy(o).subscribe()}static async any(e){const d=(Array.isArray(e)?e:[...e]).map(xe.resolve);try{return await Promise.any(d)}finally{d.forEach(({unsubscribe:v})=>{v()})}}static async race(e){const d=(Array.isArray(e)?e:[...e]).map(xe.resolve);try{return await Promise.race(d)}finally{d.forEach(({unsubscribe:v})=>{v()})}}static async raceReferences(e){const o=e.map(Xr);try{return await Promise.race(o)}finally{for(const d of o)d.unsubscribe()}}constructor(e){mt(this,"promise",void 0),mt(this,"subscribers",[]),mt(this,"settlement",null),mt(this,Yr,"Unpromise"),typeof e=="function"?this.promise=new Promise(e):this.promise=e;const o=this.promise.then(d=>{const{subscribers:v}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:d},v==null||v.forEach(({resolve:y})=>{y(d)})});"catch"in o&&o.catch(d=>{const{subscribers:v}=this;this.subscribers=null,this.settlement={status:"rejected",reason:d},v==null||v.forEach(({reject:y})=>{y(d)})})}}function Xr(c){return xe.proxy(c).then(()=>[c])}function Qr(){let c,e;return{promise:new Promise((d,v)=>{c=d,e=v}),resolve:c,reject:e}}function es(c,e){return[...c,e]}function ts(c,e){return[...c.slice(0,e),...c.slice(e+1)]}function rs(c,e){const o=c.indexOf(e);return o!==-1?ts(c,o):c}var Kt,Gt;(Kt=Symbol).dispose??(Kt.dispose=Symbol());(Gt=Symbol).asyncDispose??(Gt.asyncDispose=Symbol());function ss(c,e){const o=c,d=o[Symbol.dispose];return o[Symbol.dispose]=()=>{e(),d==null||d()},o}function is(c,e){const o=c,d=o[Symbol.asyncDispose];return o[Symbol.asyncDispose]=async()=>{await e(),await(d==null?void 0:d())},o}const mr=Symbol();function ns(c){let e=null;return ss({start(){if(e)throw new Error("Timer already started");return new Promise(d=>{e=setTimeout(()=>d(mr),c)})}},()=>{e&&clearTimeout(e)})}function vr(c,e,o){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var d,v;if(o){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");d=e[Symbol.asyncDispose]}if(d===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");d=e[Symbol.dispose],o&&(v=d)}if(typeof d!="function")throw new TypeError("Object not disposable.");v&&(d=function(){try{v.call(this)}catch(y){return Promise.reject(y)}}),c.stack.push({value:e,dispose:d,async:o})}else o&&c.stack.push({async:!0});return e}function Ut(c){var e=typeof SuppressedError=="function"?SuppressedError:function(o,d,v){var y=new Error(v);return y.name="SuppressedError",y.error=o,y.suppressed=d,y};return(Ut=function(d){function v(a){d.error=d.hasError?new e(a,d.error,"An error was suppressed during disposal."):a,d.hasError=!0}var y,k=0;function t(){for(;y=d.stack.pop();)try{if(!y.async&&k===1)return k=0,d.stack.push(y),Promise.resolve().then(t);if(y.dispose){var a=y.dispose.call(y.value);if(y.async)return k|=2,Promise.resolve(a).then(t,function(l){return v(l),t()})}else k|=1}catch(l){v(l)}if(k===1)return d.hasError?Promise.reject(d.error):Promise.resolve();if(d.hasError)throw d.error}return t()})(c)}const os="ping",as="serialized-error",cs="connected",hs="return";async function ls(c){const e={stack:[],error:void 0,hasError:!1};try{const o=vr(e,ns(c.timeoutMs),!1),d=await xe.race([c.promise,o.start()]);return d===mr?await c.onTimeout():d}catch(o){e.error=o,e.hasError=!0}finally{Ut(e)}}function ds(c){const{deserialize:e=t=>t}=c;let o={};const d=c.signal;let v=null;const y=()=>new ReadableStream({async start(t){const[a,l]=await Promise.all([c.url(),c.init()]),_=v=new c.EventSource(a,l);t.enqueue({type:"connecting",eventSource:v,event:null}),_.addEventListener(cs,p=>{const C=JSON.parse(p.data);o=C,t.enqueue({type:"connected",options:C,eventSource:_})}),_.addEventListener(as,p=>{const m=p;t.enqueue({type:"serialized-error",error:e(JSON.parse(m.data)),eventSource:_})}),_.addEventListener(os,()=>{t.enqueue({type:"ping",eventSource:_})}),_.addEventListener(hs,()=>{_.close(),t.close(),v=null}),_.addEventListener("error",p=>{_.readyState===EventSource.CLOSED?t.error(p):t.enqueue({type:"connecting",eventSource:_,event:p})}),_.addEventListener("message",p=>{const m=p,f={data:e(JSON.parse(m.data))};m.lastEventId&&(f.id=m.lastEventId),t.enqueue({type:"data",data:f,eventSource:_})});const h=()=>{try{_.close(),t.close()}catch{}};d.aborted?h():d.addEventListener("abort",h)},cancel(){v==null||v.close()}}),k=()=>{let t=y(),a=t.getReader();async function l(){await a.cancel(),v=null}return is({read(){return a.read()},async recreate(){await l(),t=y(),a=t.getReader()}},l)};return pr(async function*(){const t={stack:[],error:void 0,hasError:!1};try{const a=vr(t,k(),!0);for(;;){let l=a.read();const _=o.reconnectAfterInactivityMs;_&&(l=ls({promise:l,timeoutMs:_,onTimeout:async()=>{const p={value:{type:"timeout",ms:_,eventSource:v},done:!1};return await a.recreate(),p}}));const h=await l;if(h.done)return h.value;yield h.value}}catch(a){t.error=a,t.hasError=!0}finally{const a=Ut(t);a&&await a}})}var nr,or,ar,cr,hr,lr;typeof window>"u"||"Deno"in window||((or=(nr=globalThis.process)==null?void 0:nr.env)==null?void 0:or.NODE_ENV)==="test"||(cr=(ar=globalThis.process)==null?void 0:ar.env)!=null&&cr.JEST_WORKER_ID||(lr=(hr=globalThis.process)==null?void 0:hr.env)!=null&&lr.VITEST_WORKER_ID;function vt(c,e,o){return e in c?Object.defineProperty(c,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):c[e]=o,c}function us(c){return c instanceof pe||c instanceof Error&&c.name==="TRPCClientError"}function fs(c){return Xe(c)&&Xe(c.error)&&typeof c.error.code=="number"&&typeof c.error.message=="string"}function _s(c,e){return typeof c=="string"?c:Xe(c)&&typeof c.message=="string"?c.message:e}class pe extends Error{static from(e,o={}){const d=e;return us(d)?(o.meta&&(d.meta={...d.meta,...o.meta}),d):fs(d)?new pe(d.error.message,{...o,result:d}):new pe(_s(d,"Unknown error"),{...o,cause:d})}constructor(e,o){var v,y;const d=o==null?void 0:o.cause;super(e,{cause:d}),vt(this,"cause",void 0),vt(this,"shape",void 0),vt(this,"data",void 0),vt(this,"meta",void 0),this.meta=o==null?void 0:o.meta,this.cause=d,this.shape=(v=o==null?void 0:o.result)==null?void 0:v.error,this.data=(y=o==null?void 0:o.result)==null?void 0:y.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,pe.prototype)}}function Pt(c,e,o){return e in c?Object.defineProperty(c,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):c[e]=o,c}class ps{$request(e){return ur({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(qr())}async requestAsPromise(e){try{const o=this.$request(e);return(await zr(o)).result.data}catch(o){throw pe.from(o)}}query(e,o,d){return this.requestAsPromise({type:"query",path:e,input:o,context:d==null?void 0:d.context,signal:d==null?void 0:d.signal})}mutation(e,o,d){return this.requestAsPromise({type:"mutation",path:e,input:o,context:d==null?void 0:d.context,signal:d==null?void 0:d.signal})}subscription(e,o,d){return this.$request({type:"subscription",path:e,input:o,context:d.context,signal:d.signal}).subscribe({next(y){var k,t,a,l;switch(y.result.type){case"state":{(k=d.onConnectionStateChange)==null||k.call(d,y.result);break}case"started":{(t=d.onStarted)==null||t.call(d,{context:y.context});break}case"stopped":{(a=d.onStopped)==null||a.call(d);break}case"data":case void 0:{(l=d.onData)==null||l.call(d,y.result.data);break}}},error(y){var k;(k=d.onError)==null||k.call(d,y)},complete(){var y;(y=d.onComplete)==null||y.call(d)}})}constructor(e){Pt(this,"links",void 0),Pt(this,"runtime",void 0),Pt(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(o=>o(this.runtime))}}const gs=Symbol.for("trpc_untypedClient"),ms={query:"query",mutate:"mutation",subscribe:"subscription"},vs=c=>ms[c];function bs(c){const e=Vr(({path:o,args:d})=>{const v=[...o],y=vs(v.pop()),k=v.join(".");return c[y](k,...d)});return Zr(o=>o===gs?c:e[o])}function br(c){const e=new ps(c);return bs(e)}const Jt=c=>typeof c=="function";function Ss(c){if(c)return c;if(typeof window<"u"&&Jt(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Jt(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Yt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Xt(c){let e=null,o=null;const d=()=>{clearTimeout(o),o=null,e=null};function v(t){var _,h;const a=[[]];let l=0;for(;;){const p=t[l];if(!p)break;const m=a[a.length-1];if(p.aborted){(_=p.reject)==null||_.call(p,new Error("Aborted")),l++;continue}if(c.validate(m.concat(p).map(f=>f.key))){m.push(p),l++;continue}if(m.length===0){(h=p.reject)==null||h.call(p,new Error("Input is too big for a single dispatch")),l++;continue}a.push([])}return a}function y(){const t=v(e);d();for(const a of t){if(!a.length)continue;const l={items:a};for(const h of a)h.batch=l;c.fetch(l.items.map(h=>h.key)).then(async h=>{var p;await Promise.all(h.map(async(m,C)=>{var i,n;const f=l.items[C];try{const r=await Promise.resolve(m);(i=f.resolve)==null||i.call(f,r)}catch(r){(n=f.reject)==null||n.call(f,r)}f.batch=null,f.reject=null,f.resolve=null}));for(const m of l.items)(p=m.reject)==null||p.call(m,new Error("Missing result")),m.batch=null}).catch(h=>{var p;for(const m of l.items)(p=m.reject)==null||p.call(m,h),m.batch=null})}}function k(t){const a={aborted:!1,key:t,batch:null,resolve:Yt,reject:Yt},l=new Promise((_,h)=>{a.reject=h,a.resolve=_,e||(e=[]),e.push(a)});return o||(o=setTimeout(y)),l}return{load:k}}function ys(...c){const e=new AbortController,o=c.length;let d=0;const v=()=>{++d===o&&e.abort()};for(const y of c)y!=null&&y.aborted?v():y==null||y.addEventListener("abort",v,{once:!0});return e.signal}function Cs(...c){const e=new AbortController;for(const o of c)o!=null&&o.aborted?e.abort():o==null||o.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}function Sr(c){const e=c;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:o=>o,deserialize:o=>o},output:{serialize:o=>o,deserialize:o=>o}}}function ws(c){return{url:c.url.toString(),fetch:c.fetch,transformer:Sr(c.transformer),methodOverride:c.methodOverride}}function Es(c){const e={};for(let o=0;o<c.length;o++){const d=c[o];e[o]=d}return e}const xs={query:"GET",mutation:"POST",subscription:"PATCH"};function yr(c){return"input"in c?c.transformer.input.serialize(c.input):Es(c.inputs.map(e=>c.transformer.input.serialize(e)))}const zt=c=>{const e=c.url.split("?");let d=e[0].replace(/\/$/,"")+"/"+c.path;const v=[];if(e[1]&&v.push(e[1]),"inputs"in c&&v.push("batch=1"),c.type==="query"||c.type==="subscription"){const y=yr(c);y!==void 0&&c.methodOverride!=="POST"&&v.push(`input=${encodeURIComponent(JSON.stringify(y))}`)}return v.length&&(d+="?"+v.join("&")),d},ks=c=>{if(c.type==="query"&&c.methodOverride!=="POST")return;const e=yr(c);return e!==void 0?JSON.stringify(e):void 0},Rs=c=>As({...c,contentTypeHeader:"application/json",getUrl:zt,getBody:ks});class Ls extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const Ds=c=>{var e;if(c!=null&&c.aborted)throw(e=c.throwIfAborted)==null||e.call(c),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Ls};async function Ts(c){Ds(c.signal);const e=c.getUrl(c),o=c.getBody(c),{type:d}=c,v=await(async()=>{const k=await c.headers();return Symbol.iterator in k?Object.fromEntries(k):k})(),y={...c.contentTypeHeader?{"content-type":c.contentTypeHeader}:{},...c.trpcAcceptHeader?{"trpc-accept":c.trpcAcceptHeader}:void 0,...v};return Ss(c.fetch)(e,{method:c.methodOverride??xs[d],signal:c.signal,body:o,headers:y})}async function As(c){const e={},o=await Ts(c);e.response=o;const d=await o.json();return e.responseJSON=d,{json:d,meta:e}}function Cr(c){const e=ws(c),o=c.maxURLLength??1/0;return()=>{const d=t=>({validate(a){if(o===1/0)return!0;const l=a.map(p=>p.path).join(","),_=a.map(p=>p.input);return zt({...e,type:t,path:l,inputs:_,signal:null}).length<=o},async fetch(a){const l=a.map(f=>f.path).join(","),_=a.map(f=>f.input),h=ys(...a.map(f=>f.signal)),p=await Rs({...e,path:l,inputs:_,type:t,headers(){return c.headers?typeof c.headers=="function"?c.headers({opList:a}):c.headers:{}},signal:h});return(Array.isArray(p.json)?p.json:a.map(()=>p.json)).map(f=>({meta:p.meta,json:f}))}}),v=Xt(d("query")),y=Xt(d("mutation")),k={query:v,mutation:y};return({op:t})=>qe(a=>{/* istanbul ignore if -- @preserve */if(t.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const _=k[t.type].load(t);let h;return _.then(p=>{h=p;const m=Gr(p.json,e.transformer.output);if(!m.ok){a.error(pe.from(m.error,{meta:p.meta}));return}a.next({context:p.meta,result:m.result}),a.complete()}).catch(p=>{a.error(pe.from(p,{meta:h==null?void 0:h.meta}))}),()=>{}})}}function Qt(c){return Array.isArray(c)?c:[c]}function wr(c){return e=>{const o=Qt(c.true).map(v=>v(e)),d=Qt(c.false).map(v=>v(e));return v=>qe(y=>{const k=c.condition(v.op)?o:d;return ur({op:v.op,links:k}).subscribe(y)})}}const Qe=(c,...e)=>typeof c=="function"?c(...e):c;function Bs(){let c,e;return{promise:new Promise((d,v)=>{c=d,e=v}),resolve:c,reject:e}}async function Os(c){const e=await Qe(c.url);if(!c.connectionParams)return e;const d=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+d}async function Ms(c){const e={method:"connectionParams",data:await Qe(c)};return JSON.stringify(e)}function Me(c,e,o){return e in c?Object.defineProperty(c,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):c[e]=o,c}function Ps(c){const{promise:e,resolve:o,reject:d}=Bs();return c.addEventListener("open",()=>{c.removeEventListener("error",d),o()}),c.addEventListener("error",d),e}function Is(c,{intervalMs:e,pongTimeoutMs:o}){let d,v;function y(){d=setTimeout(()=>{c.send("PING"),v=setTimeout(()=>{c.close()},o)},e)}function k(){clearTimeout(d),y()}function t(){clearTimeout(v),k()}c.addEventListener("open",y),c.addEventListener("message",({data:a})=>{clearTimeout(d),y(),a==="PONG"&&t()}),c.addEventListener("close",()=>{clearTimeout(d),clearTimeout(v)})}class St{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++St.connectCount;const e=Os(this.urlOptions).then(o=>new this.WebSocketPonyfill(o));this.openPromise=e.then(async o=>{this.ws=o,o.addEventListener("message",function({data:d}){d==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Is(o,this.keepAliveOpts),o.addEventListener("close",()=>{this.ws===o&&(this.ws=null)}),await Ps(o),this.urlOptions.connectionParams&&o.send(await Ms(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var e;try{await this.openPromise}finally{(e=this.ws)==null||e.close()}}constructor(e){if(Me(this,"id",++St.connectCount),Me(this,"WebSocketPonyfill",void 0),Me(this,"urlOptions",void 0),Me(this,"keepAliveOpts",void 0),Me(this,"wsObservable",dr(null)),Me(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}Me(St,"connectCount",0);function Hs(c,e){return!e||c!=null&&typeof c!="object"?c:{...c??{},lastEventId:e}}async function Fs(c){let e=await Qe(c.url);if(c.connectionParams){const o=await Qe(c.connectionParams),d=e.includes("?")?"&":"?";e+=d+"connectionParams="+encodeURIComponent(JSON.stringify(o))}return e}const Ns=[gt.BAD_GATEWAY,gt.SERVICE_UNAVAILABLE,gt.GATEWAY_TIMEOUT,gt.INTERNAL_SERVER_ERROR];function Er(c){const e=Sr(c.transformer);return()=>({op:o})=>qe(d=>{const{type:v,path:y,input:k}=o;/* istanbul ignore if -- @preserve */if(v!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let t;const a=new AbortController,l=Cs(o.signal,a.signal),_=ds({url:async()=>zt({transformer:e,url:await Fs(c),input:Hs(k,t),path:y,type:v,signal:null}),init:()=>Qe(c.eventSourceOptions,{op:o}),signal:l,deserialize:e.output.deserialize,EventSource:c.EventSource??globalThis.EventSource}),h=dr({type:"state",state:"connecting",error:null}),p=h.subscribe({next(m){d.next({result:m})}});return pr(async()=>{for await(const m of _)switch(m.type){case"ping":break;case"data":const C=m.data;let f;C.id?(t=C.id,f={id:C.id,data:C}):f={data:C.data},d.next({result:f,context:{eventSource:m.eventSource}});break;case"connected":{d.next({result:{type:"started"},context:{eventSource:m.eventSource}}),h.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const i=pe.from({error:m.error});if(Ns.includes(m.error.code)){h.next({type:"state",state:"connecting",error:i});break}throw i}case"connecting":{const i=h.get(),n=m.event&&pe.from(m.event);if(!n&&i.state==="connecting")break;h.next({type:"state",state:"connecting",error:n});break}case"timeout":h.next({type:"state",state:"connecting",error:new pe(`Timeout of ${m.ms}ms reached while waiting for a response`)})}d.next({result:{type:"stopped"}}),h.next({type:"state",state:"idle",error:null}),d.complete()}).catch(m=>{d.error(pe.from(m))}),()=>{d.complete(),a.abort(),p.unsubscribe()}})}const Ws={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},bt=c=>Object.entries(c),{version:cn,...js}=Ws,xr=bt(js).reduce((c,[e,o])=>(c[e]={...o,colorEntries:bt(o.colors),ansiColorEntries:bt(o.ansiColors)},c),{});bt(xr);var It={exports:{}},er;function $s(){return er||(er=1,function(c,e){(function(o,d){c.exports=d()})(self,()=>(()=>{var o={};return(()=>{var d=o;Object.defineProperty(d,"__esModule",{value:!0}),d.FitAddon=void 0,d.FitAddon=class{activate(v){this._terminal=v}dispose(){}fit(){const v=this.proposeDimensions();if(!v||!this._terminal||isNaN(v.cols)||isNaN(v.rows))return;const y=this._terminal._core;this._terminal.rows===v.rows&&this._terminal.cols===v.cols||(y._renderService.clear(),this._terminal.resize(v.cols,v.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const v=this._terminal._core,y=v._renderService.dimensions;if(y.css.cell.width===0||y.css.cell.height===0)return;const k=this._terminal.options.scrollback===0?0:v.viewport.scrollBarWidth,t=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(t.getPropertyValue("height")),l=Math.max(0,parseInt(t.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-k;return{cols:Math.max(2,Math.floor(p/y.css.cell.width)),rows:Math.max(1,Math.floor(h/y.css.cell.height))}}}})(),o})())}(It)),It.exports}var Us=$s(),Ht={exports:{}},tr;function zs(){return tr||(tr=1,function(c,e){(function(o,d){c.exports=d()})(globalThis,()=>(()=>{var o={4567:function(k,t,a){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const h=a(9042),p=a(9924),m=a(844),C=a(4725),f=a(2585),i=a(3656);let n=t.AccessibilityManager=class extends m.Disposable{constructor(r,s,u,S){super(),this._terminal=r,this._coreBrowserService=u,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(b=>this._handleResize(b.rows))),this.register(this._terminal.onRender(b=>this._refreshRows(b.start,b.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(b=>this._handleChar(b))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(b=>this._handleTab(b))),this.register(this._terminal.onKey(b=>this._handleKey(b.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,i.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,m.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(r){for(let s=0;s<r;s++)this._handleChar(" ")}_handleChar(r){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
3
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(r){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(r)||this._charsToConsume.push(r)}_refreshRows(r,s){this._liveRegionDebouncer.refresh(r,s,this._terminal.rows)}_renderRows(r,s){const u=this._terminal.buffer,S=u.lines.length.toString();for(let b=r;b<=s;b++){const w=u.lines.get(u.ydisp+b),g=[],E=(w==null?void 0:w.translateToString(!0,void 0,void 0,g))||"",T=(u.ydisp+b+1).toString(),B=this._rowElements[b];B&&(E.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=E,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(r,s){const u=r.target,S=this._rowElements[s===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||r.relatedTarget!==S)return;let b,w;if(s===0?(b=u,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(b=this._rowElements.shift(),w=u,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),s===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(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const r=document.getSelection();if(!r)return;if(r.isCollapsed)return void(this._rowContainer.contains(r.anchorNode)&&this._terminal.clearSelection());if(!r.anchorNode||!r.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:r.anchorNode,offset:r.anchorOffset},u={node:r.focusNode,offset:r.focusOffset};if((s.node.compareDocumentPosition(u.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===u.node&&s.offset>u.offset)&&([s,u]=[u,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const S=this._rowElements.slice(-1)[0];if(u.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(u={node:S,offset:((E=S.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(u.node))return;const b=({node:T,offset:B})=>{const O=T instanceof Text?T.parentNode:T;let D=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(O);if(!I)return console.warn("columns is null. Race condition?"),null;let F=B<I.length?I[B]:I.slice(-1)[0]+1;return F>=this._terminal.cols&&(++D,F=0),{row:D,column:F}},w=b(s),g=b(u);if(w&&g){if(w.row>g.row||w.row===g.row&&w.column>=g.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(g.row-w.row)*this._terminal.cols-w.column+g.column)}}_handleResize(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const r=this._coreBrowserService.mainDocument.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r}_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 r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}}_refreshRowDimensions(r){r.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=n=l([_(1,f.IInstantiationService),_(2,C.ICoreBrowserService),_(3,C.IRenderService)],n)},3614:(k,t)=>{function o(p){return p.replace(/\r?\n/g,"\r")}function l(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,C,f){p=l(p=o(p),C.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(p,!0),m.value=""}function h(p,m,C){const f=C.getBoundingClientRect(),i=p.clientX-f.left-10,n=p.clientY-f.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${i}px`,m.style.top=`${n}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=o,t.bracketTextForPaste=l,t.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},t.handlePasteEvent=function(p,m,C,f){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,C,f)},t.paste=_,t.moveTextAreaUnderMouseCursor=h,t.rightClickHandler=function(p,m,C,f,i){h(p,m,C),i&&f.rightClickSelect(p),m.value=f.selectionText,m.select()}},7239:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const l=o(1505);t.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,h,p){this._css.set(_,h,p)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,p){this._color.set(_,h,p)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(o,l,_,h){o.addEventListener(l,_,h);let p=!1;return{dispose:()=>{p||(p=!0,o.removeEventListener(l,_,h))}}}},3551:function(k,t,o){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const h=o(3656),p=o(8460),m=o(844),C=o(2585),f=o(4725);let i=t.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(n,r,s,u,S){super(),this._element=n,this._mouseService=r,this._renderService=s,this._bufferService=u,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){this._lastMouseEvent=n;const r=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const s=n.composedPath();for(let u=0;u<s.length;u++){const S=s[u];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,r){var u,S;this._activeProviderReplies&&r||((u=this._activeProviderReplies)==null||u.forEach(b=>{b==null||b.forEach(w=>{w.link.dispose&&w.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let s=!1;for(const[b,w]of this._linkProviderService.linkProviders.entries())r?(S=this._activeProviderReplies)!=null&&S.get(b)&&(s=this._checkLinkProviderResult(b,n,s)):w.provideLinks(n.y,g=>{var T,B;if(this._isMouseOut)return;const E=g==null?void 0:g.map(O=>({link:O}));(T=this._activeProviderReplies)==null||T.set(b,E),s=this._checkLinkProviderResult(b,n,s),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,r){const s=new Set;for(let u=0;u<r.size;u++){const S=r.get(u);if(S)for(let b=0;b<S.length;b++){const w=S[b],g=w.link.range.start.y<n?0:w.link.range.start.x,E=w.link.range.end.y>n?this._bufferService.cols:w.link.range.end.x;for(let T=g;T<=E;T++){if(s.has(T)){S.splice(b--,1);break}s.add(T)}}}}_checkLinkProviderResult(n,r,s){var b;if(!this._activeProviderReplies)return s;const u=this._activeProviderReplies.get(n);let S=!1;for(let w=0;w<n;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(S=!0);if(!S&&u){const w=u.find(g=>this._linkAtPosition(g.link,r));w&&(s=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let w=0;w<this._activeProviderReplies.size;w++){const g=(b=this._activeProviderReplies.get(w))==null?void 0:b.find(E=>this._linkAtPosition(E.link,r));if(g){s=!0,this._handleNewLink(g);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._currentLink)return;const r=this._positionFromMouseEvent(n,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,r){this._currentLink&&this._lastMouseEvent&&(!n||!r||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._lastMouseEvent)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(n.link,r)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var s,u;return(u=(s=this._currentLink)==null?void 0:s.state)==null?void 0:u.decorations.pointerCursor},set:s=>{var u;(u=this._currentLink)!=null&&u.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,u;return(u=(s=this._currentLink)==null?void 0:s.state)==null?void 0:u.decorations.underline},set:s=>{var u,S,b;(u=this._currentLink)!=null&&u.state&&((b=(S=this._currentLink)==null?void 0:S.state)==null?void 0:b.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const u=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(u,S),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(n,r,s){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)}_fireUnderlineEvent(n,r){const s=n.range,u=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-u-1,s.end.x,s.end.y-u-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(n,r,s){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)}_linkAtPosition(n,r){const s=n.range.start.y*this._bufferService.cols+n.range.start.x,u=n.range.end.y*this._bufferService.cols+n.range.end.x,S=r.y*this._bufferService.cols+r.x;return s<=S&&S<=u}_positionFromMouseEvent(n,r,s){const u=s.getCoords(n,r,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,r,s,u,S){return{x1:n,y1:r,x2:s,y2:u,cols:this._bufferService.cols,fg:S}}};t.Linkifier=i=l([_(1,f.IMouseService),_(2,f.IRenderService),_(3,C.IBufferService),_(4,f.ILinkProviderService)],i)},9042:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(k,t,o){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const h=o(511),p=o(2585);let m=t.OscLinkProvider=class{constructor(f,i,n){this._bufferService=f,this._optionsService=i,this._oscLinkService=n}provideLinks(f,i){var E;const n=this._bufferService.buffer.lines.get(f-1);if(!n)return void i(void 0);const r=[],s=this._optionsService.rawOptions.linkHandler,u=new h.CellData,S=n.getTrimmedLength();let b=-1,w=-1,g=!1;for(let T=0;T<S;T++)if(w!==-1||n.hasContent(T)){if(n.loadCell(T,u),u.hasExtendedAttrs()&&u.extended.urlId){if(w===-1){w=T,b=u.extended.urlId;continue}g=u.extended.urlId!==b}else w!==-1&&(g=!0);if(g||w!==-1&&T===S-1){const B=(E=this._oscLinkService.getLinkData(b))==null?void 0:E.uri;if(B){const O={start:{x:w+1,y:f},end:{x:T+(g||T!==S-1?0:1),y:f}};let D=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const I=new URL(B);["http:","https:"].includes(I.protocol)||(D=!0)}catch{D=!0}D||r.push({text:B,range:O,activate:(I,F)=>s?s.activate(I,F,O):C(0,F),hover:(I,F)=>{var $;return($=s==null?void 0:s.hover)==null?void 0:$.call(s,I,F,O)},leave:(I,F)=>{var $;return($=s==null?void 0:s.leave)==null?void 0:$.call(s,I,F,O)}})}g=!1,u.hasExtendedAttrs()&&u.extended.urlId?(w=T,b=u.extended.urlId):(w=-1,b=-1)}}i(r)}};function C(f,i){if(confirm(`Do you want to navigate to ${i}?
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(r){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(r)||this._charsToConsume.push(r)}_refreshRows(r,s){this._liveRegionDebouncer.refresh(r,s,this._terminal.rows)}_renderRows(r,s){const u=this._terminal.buffer,S=u.lines.length.toString();for(let b=r;b<=s;b++){const w=u.lines.get(u.ydisp+b),g=[],E=(w==null?void 0:w.translateToString(!0,void 0,void 0,g))||"",T=(u.ydisp+b+1).toString(),B=this._rowElements[b];B&&(E.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=E,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(r,s){const u=r.target,S=this._rowElements[s===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||r.relatedTarget!==S)return;let b,w;if(s===0?(b=u,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(b=this._rowElements.shift(),w=u,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),s===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(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const r=document.getSelection();if(!r)return;if(r.isCollapsed)return void(this._rowContainer.contains(r.anchorNode)&&this._terminal.clearSelection());if(!r.anchorNode||!r.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:r.anchorNode,offset:r.anchorOffset},u={node:r.focusNode,offset:r.focusOffset};if((s.node.compareDocumentPosition(u.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===u.node&&s.offset>u.offset)&&([s,u]=[u,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const S=this._rowElements.slice(-1)[0];if(u.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(u={node:S,offset:((E=S.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(u.node))return;const b=({node:T,offset:B})=>{const O=T instanceof Text?T.parentNode:T;let D=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(O);if(!I)return console.warn("columns is null. Race condition?"),null;let F=B<I.length?I[B]:I.slice(-1)[0]+1;return F>=this._terminal.cols&&(++D,F=0),{row:D,column:F}},w=b(s),g=b(u);if(w&&g){if(w.row>g.row||w.row===g.row&&w.column>=g.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(g.row-w.row)*this._terminal.cols-w.column+g.column)}}_handleResize(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const r=this._coreBrowserService.mainDocument.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r}_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 r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}}_refreshRowDimensions(r){r.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=n=l([_(1,f.IInstantiationService),_(2,C.ICoreBrowserService),_(3,C.IRenderService)],n)},3614:(k,t)=>{function a(p){return p.replace(/\r?\n/g,"\r")}function l(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,C,f){p=l(p=a(p),C.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(p,!0),m.value=""}function h(p,m,C){const f=C.getBoundingClientRect(),i=p.clientX-f.left-10,n=p.clientY-f.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${i}px`,m.style.top=`${n}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=a,t.bracketTextForPaste=l,t.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},t.handlePasteEvent=function(p,m,C,f){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,C,f)},t.paste=_,t.moveTextAreaUnderMouseCursor=h,t.rightClickHandler=function(p,m,C,f,i){h(p,m,C),i&&f.rightClickSelect(p),m.value=f.selectionText,m.select()}},7239:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const l=a(1505);t.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,h,p){this._css.set(_,h,p)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,p){this._color.set(_,h,p)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,l,_,h){a.addEventListener(l,_,h);let p=!1;return{dispose:()=>{p||(p=!0,a.removeEventListener(l,_,h))}}}},3551:function(k,t,a){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const h=a(3656),p=a(8460),m=a(844),C=a(2585),f=a(4725);let i=t.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(n,r,s,u,S){super(),this._element=n,this._mouseService=r,this._renderService=s,this._bufferService=u,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){this._lastMouseEvent=n;const r=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const s=n.composedPath();for(let u=0;u<s.length;u++){const S=s[u];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,r){var u,S;this._activeProviderReplies&&r||((u=this._activeProviderReplies)==null||u.forEach(b=>{b==null||b.forEach(w=>{w.link.dispose&&w.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let s=!1;for(const[b,w]of this._linkProviderService.linkProviders.entries())r?(S=this._activeProviderReplies)!=null&&S.get(b)&&(s=this._checkLinkProviderResult(b,n,s)):w.provideLinks(n.y,g=>{var T,B;if(this._isMouseOut)return;const E=g==null?void 0:g.map(O=>({link:O}));(T=this._activeProviderReplies)==null||T.set(b,E),s=this._checkLinkProviderResult(b,n,s),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,r){const s=new Set;for(let u=0;u<r.size;u++){const S=r.get(u);if(S)for(let b=0;b<S.length;b++){const w=S[b],g=w.link.range.start.y<n?0:w.link.range.start.x,E=w.link.range.end.y>n?this._bufferService.cols:w.link.range.end.x;for(let T=g;T<=E;T++){if(s.has(T)){S.splice(b--,1);break}s.add(T)}}}}_checkLinkProviderResult(n,r,s){var b;if(!this._activeProviderReplies)return s;const u=this._activeProviderReplies.get(n);let S=!1;for(let w=0;w<n;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(S=!0);if(!S&&u){const w=u.find(g=>this._linkAtPosition(g.link,r));w&&(s=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let w=0;w<this._activeProviderReplies.size;w++){const g=(b=this._activeProviderReplies.get(w))==null?void 0:b.find(E=>this._linkAtPosition(E.link,r));if(g){s=!0,this._handleNewLink(g);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._currentLink)return;const r=this._positionFromMouseEvent(n,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,r){this._currentLink&&this._lastMouseEvent&&(!n||!r||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._lastMouseEvent)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(n.link,r)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var s,u;return(u=(s=this._currentLink)==null?void 0:s.state)==null?void 0:u.decorations.pointerCursor},set:s=>{var u;(u=this._currentLink)!=null&&u.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,u;return(u=(s=this._currentLink)==null?void 0:s.state)==null?void 0:u.decorations.underline},set:s=>{var u,S,b;(u=this._currentLink)!=null&&u.state&&((b=(S=this._currentLink)==null?void 0:S.state)==null?void 0:b.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const u=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(u,S),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(n,r,s){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)}_fireUnderlineEvent(n,r){const s=n.range,u=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-u-1,s.end.x,s.end.y-u-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(n,r,s){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)}_linkAtPosition(n,r){const s=n.range.start.y*this._bufferService.cols+n.range.start.x,u=n.range.end.y*this._bufferService.cols+n.range.end.x,S=r.y*this._bufferService.cols+r.x;return s<=S&&S<=u}_positionFromMouseEvent(n,r,s){const u=s.getCoords(n,r,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,r,s,u,S){return{x1:n,y1:r,x2:s,y2:u,cols:this._bufferService.cols,fg:S}}};t.Linkifier=i=l([_(1,f.IMouseService),_(2,f.IRenderService),_(3,C.IBufferService),_(4,f.ILinkProviderService)],i)},9042:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(k,t,a){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const h=a(511),p=a(2585);let m=t.OscLinkProvider=class{constructor(f,i,n){this._bufferService=f,this._optionsService=i,this._oscLinkService=n}provideLinks(f,i){var E;const n=this._bufferService.buffer.lines.get(f-1);if(!n)return void i(void 0);const r=[],s=this._optionsService.rawOptions.linkHandler,u=new h.CellData,S=n.getTrimmedLength();let b=-1,w=-1,g=!1;for(let T=0;T<S;T++)if(w!==-1||n.hasContent(T)){if(n.loadCell(T,u),u.hasExtendedAttrs()&&u.extended.urlId){if(w===-1){w=T,b=u.extended.urlId;continue}g=u.extended.urlId!==b}else w!==-1&&(g=!0);if(g||w!==-1&&T===S-1){const B=(E=this._oscLinkService.getLinkData(b))==null?void 0:E.uri;if(B){const O={start:{x:w+1,y:f},end:{x:T+(g||T!==S-1?0:1),y:f}};let D=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const I=new URL(B);["http:","https:"].includes(I.protocol)||(D=!0)}catch{D=!0}D||r.push({text:B,range:O,activate:(I,F)=>s?s.activate(I,F,O):C(0,F),hover:(I,F)=>{var $;return($=s==null?void 0:s.hover)==null?void 0:$.call(s,I,F,O)},leave:(I,F)=>{var $;return($=s==null?void 0:s.leave)==null?void 0:$.call(s,I,F,O)}})}g=!1,u.hasExtendedAttrs()&&u.extended.urlId?(w=T,b=u.extended.urlId):(w=-1,b=-1)}}i(r)}};function C(f,i){if(confirm(`Do you want to navigate to ${i}?
4
4
 
5
- WARNING: This link could potentially be dangerous`)){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=m=l([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(o,l){this._renderCallback=o,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,l,_){this._rowCount=_,o=o!==void 0?o:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 o=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const l=o(3614),_=o(3656),h=o(3551),p=o(9042),m=o(3730),C=o(1680),f=o(3107),i=o(5744),n=o(2950),r=o(1296),s=o(428),u=o(4269),S=o(5114),b=o(8934),w=o(3230),g=o(9312),E=o(4725),T=o(6731),B=o(8055),O=o(8969),D=o(8460),I=o(844),F=o(6114),$=o(8437),G=o(2584),U=o(7399),x=o(5941),L=o(9074),A=o(2585),M=o(5435),N=o(4567),z=o(779);class Y extends O.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(P={}){super(P),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(z.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,W)=>this.refresh(R,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,I.toDisposable)(()=>{var R,W;this._customKeyEventHandler=void 0,(W=(R=this.element)==null?void 0:R.parentNode)==null||W.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const R of P){let W,H="";switch(R.index){case 256:W="foreground",H="10";break;case 257:W="background",H="11";break;case 258:W="cursor",H="12";break;default:W="ansi",H="4;"+R.index}switch(R.type){case 0:const Z=B.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${H};${(0,x.toRgbString)(Z)}${G.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(V=>V.ansi[R.index]=B.channels.toColor(...R.color));else{const V=W;this._themeService.modifyColors(ie=>ie[V]=B.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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 P=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(P);if(!R)return;const W=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Z=R.getWidth(W),V=this._renderService.dimensions.css.cell.width*Z,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,ce=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ce+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=V+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,l.copyHandler)(R,this._selectionService)}));const P=R=>(0,l.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,_.addDisposableDomListener)(this.element,"paste",P)),F.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,l.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var W;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((W=this.element)==null?void 0:W.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),F.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,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(u.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(n.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(r.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,R=this.element;function W(V){const ie=P._mouseService.getMouseReportCoords(V,P.screenElement);if(!ie)return!1;let ce,he;switch(V.overrideType||V.type){case"mousemove":he=32,V.buttons===void 0?(ce=3,V.button!==void 0&&(ce=V.button<3?V.button:3)):ce=1&V.buttons?0:4&V.buttons?1:2&V.buttons?2:3;break;case"mouseup":he=0,ce=V.button<3?V.button:3;break;case"mousedown":he=1,ce=V.button<3?V.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(V)===!1||P.viewport.getLinesScrolled(V)===0)return!1;he=V.deltaY<0?0:1,ce=4;break;default:return!1}return!(he===void 0||ce===void 0||ce>4)&&P.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:ce,action:he,ctrl:V.ctrlKey,alt:V.altKey,shift:V.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Z={mouseup:V=>(W(V),V.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(V)),wheel:V=>(W(V),this.cancel(V,!0)),mousedrag:V=>{V.buttons&&W(V)},mousemove:V=>{V.buttons||W(V)}};this.register(this.coreMouseService.onProtocolChange(V=>{V?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(V)),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&V?H.mousemove||(R.addEventListener("mousemove",Z.mousemove),H.mousemove=Z.mousemove):(R.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&V?H.wheel||(R.addEventListener("wheel",Z.wheel,{passive:!1}),H.wheel=Z.wheel):(R.removeEventListener("wheel",H.wheel),H.wheel=null),2&V?H.mouseup||(H.mouseup=Z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&V?H.mousedrag||(H.mousedrag=Z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(R,"mousedown",V=>{if(V.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(V))return W(V),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(V)})),this.register((0,_.addDisposableDomListener)(R,"wheel",V=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(V)===!1)return!1;if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(V);if(ie===0)return;const ce=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(V.deltaY<0?"A":"B");let he="";for(let ue=0;ue<Math.abs(ie);ue++)he+=ce;return this.coreService.triggerDataEvent(he,!0),this.cancel(V,!0)}return this.viewport.handleWheel(V)?this.cancel(V):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(R,"touchstart",V=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(V),this.cancel(V)},{passive:!0})),this.register((0,_.addDisposableDomListener)(R,"touchmove",V=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(V)?void 0:this.cancel(V)},{passive:!1}))}refresh(P,R){var W;(W=this._renderService)==null||W.refreshRows(P,R)}updateCursorStyle(P){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(P)?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(P,R,W=0){var H;W===1?(super.scrollLines(P,R,W),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(P)}paste(P){(0,l.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,R,W){this._selectionService.setSelection(P,R,W)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,R){var W;(W=this._selectionService)==null||W.selectLines(P,R)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!R&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,U.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),W.type===3||W.type===2){const H=this.rows-1;return this.scrollLines(W.type===2?-H:H),this.cancel(P,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(W.cancel&&this.cancel(P,!0),!W.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==G.C0.ETX&&W.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,R){const W=P.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||P.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||P.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?W:W&&(!R.keyCode||R.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)R=P.charCode;else if(P.which===null||P.which===void 0)R=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;R=P.which}return!(!R||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=P.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(P),!0}return!1}resize(P,R){P!==this.cols||R!==this.rows?super.resize(P,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,R){var W,H;(W=this._charSizeService)==null||W.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var P;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var R,W;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),(W=this.viewport)==null||W.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${W};${R}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${Z};${H}t`)}}cancel(P,R){if(this.options.cancelEvents||R)return P.preventDefault(),P.stopPropagation(),!1}}t.Terminal=Y},9924:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(o,l=1e3){this._renderCallback=o,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,l,_){this._rowCount=_,o=o!==void 0?o:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=h-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,l)}}},1680:function(k,t,o){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const h=o(3656),p=o(4725),m=o(8460),C=o(844),f=o(2585);let i=t.Viewport=class extends C.Disposable{constructor(n,r,s,u,S,b,w,g){super(),this._viewportElement=n,this._scrollArea=r,this._bufferService=s,this._optionsService=u,this._charSizeService=S,this._renderService=b,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(g.colors),this.register(g.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(n){this._viewportElement.style.backgroundColor=n.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(n){if(n)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 r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==n&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=n),this._refreshAnimationFrame=null}syncScrollArea(n=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(n);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(n)}_handleScroll(n){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 r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:r,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const n=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(n*(this._smoothScrollState.target-this._smoothScrollState.origin)),n<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(n,r){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&s<this._lastRecordedBufferHeight)||(n.cancelable&&n.preventDefault(),!1)}handleWheel(n){const r=this._getPixelsScrolled(n);return r!==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+r:this._smoothScrollState.target+=r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=r,this._bubbleScroll(n,r))}scrollLines(n){if(n!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const r=n*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!1})}_getPixelsScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let r=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r}getBufferElements(n,r){var g;let s,u="";const S=[],b=r??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let E=n;E<b;E++){const T=w.get(E);if(!T)continue;const B=(g=w.get(E+1))==null?void 0:g.isWrapped;if(u+=T.translateToString(!B),!B||E===w.length-1){const O=document.createElement("div");O.textContent=u,S.push(O),u.length>0&&(s=O),u=""}}return{bufferElements:S,cursorElement:s}}getLinesScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let r=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(n,r){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&r.altKey||s==="ctrl"&&r.ctrlKey||s==="shift"&&r.shiftKey?n*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:n*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(n){this._lastTouchY=n.touches[0].pageY}handleTouchMove(n){const r=this._lastTouchY-n.touches[0].pageY;return this._lastTouchY=n.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(n,r))}};t.Viewport=i=l([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],i)},3107:function(k,t,o){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const h=o(4725),p=o(844),m=o(2585);let C=t.BufferDecorationRenderer=class extends p.Disposable{constructor(f,i,n,r,s){super(),this._screenElement=f,this._bufferService=i,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(u=>this._removeDecoration(u))),this.register((0,p.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var r;const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((r=f==null?void 0:f.options)==null?void 0:r.layer)==="top"),i.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=f.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(f,i),i}_refreshStyle(f){const i=f.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let n=this._decorationElements.get(f);n||(n=this._createElement(f),f.element=n,this._decorationElements.set(f,n),this._container.appendChild(n),f.onDispose(()=>{this._decorationElements.delete(f),n.remove()})),n.style.top=i*this._renderService.dimensions.css.cell.height+"px",n.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(n)}}_refreshXPosition(f,i=f.element){if(!i)return;const n=f.options.x??0;(f.options.anchor||"left")==="right"?i.style.right=n?n*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=n?n*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var i;(i=this._decorationElements.get(f))==null||i.remove(),this._decorationElements.delete(f),f.dispose()}};t.BufferDecorationRenderer=C=l([_(1,m.IBufferService),_(2,h.ICoreBrowserService),_(3,m.IDecorationService),_(4,h.IRenderService)],C)},5871:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.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(o){if(o.options.overviewRulerOptions){for(const l of this._zones)if(l.color===o.options.overviewRulerOptions.color&&l.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,o.marker.line))return;if(this._lineAdjacentToZone(l,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(l,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,l){return l>=o.startBufferLine&&l<=o.endBufferLine}_lineAdjacentToZone(o,l,_){return l>=o.startBufferLine-this._linePadding[_||"full"]&&l<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,l){o.startBufferLine=Math.min(o.startBufferLine,l),o.endBufferLine=Math.max(o.endBufferLine,l)}}},5744:function(k,t,o){var l=this&&this.__decorate||function(s,u,S,b){var w,g=arguments.length,E=g<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,u,S,b);else for(var T=s.length-1;T>=0;T--)(w=s[T])&&(E=(g<3?w(E):g>3?w(u,S,E):w(u,S))||E);return g>3&&E&&Object.defineProperty(u,S,E),E},_=this&&this.__param||function(s,u){return function(S,b){u(S,b,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const h=o(5871),p=o(4725),m=o(844),C=o(2585),f={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0};let r=t.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,u,S,b,w,g,E){var B;super(),this._viewportElement=s,this._screenElement=u,this._bufferService=S,this._decorationService=b,this._renderService=w,this._optionsService=g,this._coreBrowserService=E,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(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,m.toDisposable)(()=>{var O;(O=this._canvas)==null||O.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const s=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=s,i.center=u,i.right=s,this._refreshDrawHeightConstants(),n.full=0,n.left=0,n.center=i.left,n.right=i.left+i.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);f.left=u,f.center=u,f.right=u}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const u of s)u.position!=="full"&&this._renderColorZone(u);for(const u of s)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(n[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-f[s.position||"full"]/2),i[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[s.position||"full"]))}_queueRefresh(s,u){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t.OverviewRulerRenderer=r=l([_(2,C.IBufferService),_(3,C.IDecorationService),_(4,p.IRenderService),_(5,C.IOptionsService),_(6,p.ICoreBrowserService)],r)},2950:function(k,t,o){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const h=o(4725),p=o(2585),m=o(2584);let C=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,i,n,r,s,u){this._textarea=f,this._compositionView=i,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=u,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(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let n;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,n=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const i=this._textarea.value,n=i.replace(f,"");this._dataAlreadySent=n,i.length>f.length?this._coreService.triggerDataEvent(n,!0):i.length<f.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):i.length===f.length&&i!==f&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const u=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};t.CompositionHelper=C=l([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,h.IRenderService)],C)},9806:(k,t)=>{function o(l,_,h){const p=h.getBoundingClientRect(),m=l.getComputedStyle(h),C=parseInt(m.getPropertyValue("padding-left")),f=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-C,_.clientY-p.top-f]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=o,t.getCoords=function(l,_,h,p,m,C,f,i,n){if(!C)return;const r=o(l,_,h);return r?(r[0]=Math.ceil((r[0]+(n?f/2:0))/f),r[1]=Math.ceil(r[1]/i),r[0]=Math.min(Math.max(r[0],1),p+(n?1:0)),r[1]=Math.min(Math.max(r[1],1),m),r):void 0}},9504:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const l=o(2584);function _(i,n,r,s){const u=i-h(i,r),S=n-h(n,r),b=Math.abs(u-S)-function(w,g,E){let T=0;const B=w-h(w,E),O=g-h(g,E);for(let D=0;D<Math.abs(B-O);D++){const I=p(w,g)==="A"?-1:1,F=E.buffer.lines.get(B+I*D);F!=null&&F.isWrapped&&T++}return T}(i,n,r);return f(b,C(p(i,n),s))}function h(i,n){let r=0,s=n.buffer.lines.get(i),u=s==null?void 0:s.isWrapped;for(;u&&i>=0&&i<n.rows;)r++,s=n.buffer.lines.get(--i),u=s==null?void 0:s.isWrapped;return r}function p(i,n){return i>n?"A":"B"}function m(i,n,r,s,u,S){let b=i,w=n,g="";for(;b!==r||w!==s;)b+=u?1:-1,u&&b>S.cols-1?(g+=S.buffer.translateBufferLineToString(w,!1,i,b),b=0,i=0,w++):!u&&b<0&&(g+=S.buffer.translateBufferLineToString(w,!1,0,i+1),b=S.cols-1,i=b,w--);return g+S.buffer.translateBufferLineToString(w,!1,i,b)}function C(i,n){const r=n?"O":"[";return l.C0.ESC+r+i}function f(i,n){i=Math.floor(i);let r="";for(let s=0;s<i;s++)r+=n;return r}t.moveToCellSequence=function(i,n,r,s){const u=r.buffer.x,S=r.buffer.y;if(!r.buffer.hasScrollback)return function(g,E,T,B,O,D){return _(E,B,O,D).length===0?"":f(m(g,E,g,E-h(E,O),!1,O).length,C("D",D))}(u,S,0,n,r,s)+_(S,n,r,s)+function(g,E,T,B,O,D){let I;I=_(E,B,O,D).length>0?B-h(B,O):E;const F=B,$=function(G,U,x,L,A,M){let N;return N=_(x,L,A,M).length>0?L-h(L,A):U,G<x&&N<=L||G>=x&&N<L?"C":"D"}(g,E,T,B,O,D);return f(m(g,I,T,F,$==="C",O).length,C($,D))}(u,S,i,n,r,s);let b;if(S===n)return b=u>i?"D":"C",f(Math.abs(u-i),C(b,s));b=S>n?"D":"C";const w=Math.abs(S-n);return f(function(g,E){return E.cols-g}(S>n?i:u,r)+(w-1)*r.cols+1+((S>n?u:i)-1),C(b,s))}},1296:function(k,t,o){var l=this&&this.__decorate||function(D,I,F,$){var G,U=arguments.length,x=U<3?I:$===null?$=Object.getOwnPropertyDescriptor(I,F):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(D,I,F,$);else for(var L=D.length-1;L>=0;L--)(G=D[L])&&(x=(U<3?G(x):U>3?G(I,F,x):G(I,F))||x);return U>3&&x&&Object.defineProperty(I,F,x),x},_=this&&this.__param||function(D,I){return function(F,$){I(F,$,D)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const h=o(3787),p=o(2550),m=o(2223),C=o(6171),f=o(6052),i=o(4725),n=o(8055),r=o(8460),s=o(844),u=o(2585),S="xterm-dom-renderer-owner-",b="xterm-rows",w="xterm-fg-",g="xterm-bg-",E="xterm-focus",T="xterm-selection";let B=1,O=t.DomRenderer=class extends s.Disposable{constructor(D,I,F,$,G,U,x,L,A,M,N,z,Y){super(),this._terminal=D,this._document=I,this._element=F,this._screenElement=$,this._viewportElement=G,this._helperContainer=U,this._linkifier2=x,this._charSizeService=A,this._optionsService=M,this._bufferService=N,this._coreBrowserService=z,this._themeService=Y,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new r.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(ee=>this._injectCss(ee))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(ee=>this._handleLinkHover(ee))),this.register(this._linkifier2.onHideLinkUnderline(ee=>this._handleLinkLeave(ee))),this.register((0,s.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 p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const I=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=I,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let I=`${this._terminalSelector} .${b} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;I+=`${this._terminalSelector} .${b} .xterm-dim { color: ${n.color.multiplyOpacity(D.foreground,.5).css};}`,I+=`${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 F=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;I+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,I+=`@keyframes ${$} { 50% { box-shadow: none; }}`,I+=`@keyframes ${G} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,I+=`${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,I+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[U,x]of D.ansi.entries())I+=`${this._terminalSelector} .${w}${U} { color: ${x.css}; }${this._terminalSelector} .${w}${U}.xterm-dim { color: ${n.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${g}${U} { background-color: ${x.css}; }`;I+=`${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(D.background).css}; }${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${g}${m.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=I}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,I){for(let F=this._rowElements.length;F<=I;F++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>I;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,I){this._refreshRowElements(D,I),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,I,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,I,F),this.renderRows(0,this._bufferService.rows-1),!D||!I)return;this._selectionRenderModel.update(this._terminal,D,I,F);const $=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||x<0)return;const L=this._document.createDocumentFragment();if(F){const A=D[0]>I[0];L.appendChild(this._createSelectionElement(U,A?I[0]:D[0],A?D[0]:I[0],x-U+1))}else{const A=$===U?D[0]:0,M=U===G?I[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(U,A,M));const N=x-U-1;if(L.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,N)),U!==x){const z=G===x?I[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(x,0,z))}}this._selectionContainer.appendChild(L)}_createSelectionElement(D,I,F,$=1){const G=this._document.createElement("div"),U=I*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(F-I);return U+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-U),G.style.height=$*this.dimensions.css.cell.height+"px",G.style.top=D*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${x}px`,G}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 D of this._rowElements)D.replaceChildren()}renderRows(D,I){const F=this._bufferService.buffer,$=F.ybase+F.y,G=Math.min(F.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=D;A<=I;A++){const M=A+F.ydisp,N=this._rowElements[A],z=F.lines.get(M);if(!N||!z)break;N.replaceChildren(...this._rowFactory.createRow(z,M,M===$,x,L,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,I,F,$,G,U){F<0&&(D=0),$<0&&(I=0);const x=this._bufferService.rows-1;F=Math.max(Math.min(F,x),0),$=Math.max(Math.min($,x),0),G=Math.min(G,this._bufferService.cols);const L=this._bufferService.buffer,A=L.ybase+L.y,M=Math.min(L.x,G-1),N=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=F;ee<=$;++ee){const P=ee+L.ydisp,R=this._rowElements[ee],W=L.lines.get(P);if(!R||!W)break;R.replaceChildren(...this._rowFactory.createRow(W,P,P===A,z,Y,M,N,this.dimensions.css.cell.width,this._widthCache,U?ee===F?D:0:-1,U?(ee===$?I:G)-1:-1))}}};t.DomRenderer=O=l([_(7,u.IInstantiationService),_(8,i.ICharSizeService),_(9,u.IOptionsService),_(10,u.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],O)},3787:function(k,t,o){var l=this&&this.__decorate||function(b,w,g,E){var T,B=arguments.length,O=B<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,g):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,w,g,E);else for(var D=b.length-1;D>=0;D--)(T=b[D])&&(O=(B<3?T(O):B>3?T(w,g,O):T(w,g))||O);return B>3&&O&&Object.defineProperty(w,g,O),O},_=this&&this.__param||function(b,w){return function(g,E){w(g,E,b)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const h=o(2223),p=o(643),m=o(511),C=o(2585),f=o(8055),i=o(4725),n=o(4269),r=o(6171),s=o(3734);let u=t.DomRendererRowFactory=class{constructor(b,w,g,E,T,B,O){this._document=b,this._characterJoinerService=w,this._optionsService=g,this._coreBrowserService=E,this._coreService=T,this._decorationService=B,this._themeService=O,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,w,g){this._selectionStart=b,this._selectionEnd=w,this._columnSelectMode=g}createRow(b,w,g,E,T,B,O,D,I,F,$){const G=[],U=this._characterJoinerService.getJoinedCharacters(w),x=this._themeService.colors;let L,A=b.getNoBgTrimmedLength();g&&A<B+1&&(A=B+1);let M=0,N="",z=0,Y=0,ee=0,P=!1,R=0,W=!1,H=0;const Z=[],V=F!==-1&&$!==-1;for(let ie=0;ie<A;ie++){b.loadCell(ie,this._workCell);let ce=this._workCell.getWidth();if(ce===0)continue;let he=!1,ue=ie,te=this._workCell;if(U.length>0&&ie===U[0][0]){he=!0;const oe=U.shift();te=new n.JoinedCellData(this._workCell,b.translateToString(!0,oe[0],oe[1]),oe[1]-oe[0]),ue=oe[1]-1,ce=te.getWidth()}const Ve=this._isCellInSelection(ie,w),Dt=g&&ie===B,Tt=V&&ie>=F&&ie<=$;let At=!1;this._decorationService.forEachDecorationAtCell(ie,w,void 0,oe=>{At=!0});let ft=te.getChars()||p.WHITESPACE_CELL_CHAR;if(ft===" "&&(te.isUnderline()||te.isOverline())&&(ft=" "),H=ce*D-I.get(ft,te.isBold(),te.isItalic()),L){if(M&&(Ve&&W||!Ve&&!W&&te.bg===z)&&(Ve&&W&&x.selectionForeground||te.fg===Y)&&te.extended.ext===ee&&Tt===P&&H===R&&!Dt&&!he&&!At){te.isInvisible()?N+=p.WHITESPACE_CELL_CHAR:N+=ft,M++;continue}M&&(L.textContent=N),L=this._document.createElement("span"),M=0,N=""}else L=this._document.createElement("span");if(z=te.bg,Y=te.fg,ee=te.extended.ext,P=Tt,R=H,W=Ve,he&&B>=ie&&B<=ue&&(B=ie),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Z.push("xterm-cursor-blink"),Z.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Z.push("xterm-cursor-outline");break;case"block":Z.push("xterm-cursor-block");break;case"bar":Z.push("xterm-cursor-bar");break;case"underline":Z.push("xterm-cursor-underline")}}if(te.isBold()&&Z.push("xterm-bold"),te.isItalic()&&Z.push("xterm-italic"),te.isDim()&&Z.push("xterm-dim"),N=te.isInvisible()?p.WHITESPACE_CELL_CHAR:te.getChars()||p.WHITESPACE_CELL_CHAR,te.isUnderline()&&(Z.push(`xterm-underline-${te.extended.underlineStyle}`),N===" "&&(N=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let oe=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&oe<8&&(oe+=8),L.style.textDecorationColor=x.ansi[oe].css}te.isOverline()&&(Z.push("xterm-overline"),N===" "&&(N=" ")),te.isStrikethrough()&&Z.push("xterm-strikethrough"),Tt&&(L.style.textDecoration="underline");let _e=te.getFgColor(),Ze=te.getFgColorMode(),be=te.getBgColor(),Ke=te.getBgColorMode();const Bt=!!te.isInverse();if(Bt){const oe=_e;_e=be,be=oe;const Wr=Ze;Ze=Ke,Ke=Wr}let Le,_t,De,Ge=!1;switch(this._decorationService.forEachDecorationAtCell(ie,w,void 0,oe=>{oe.options.layer!=="top"&&Ge||(oe.backgroundColorRGB&&(Ke=50331648,be=oe.backgroundColorRGB.rgba>>8&16777215,Le=oe.backgroundColorRGB),oe.foregroundColorRGB&&(Ze=50331648,_e=oe.foregroundColorRGB.rgba>>8&16777215,_t=oe.foregroundColorRGB),Ge=oe.options.layer==="top")}),!Ge&&Ve&&(Le=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,be=Le.rgba>>8&16777215,Ke=50331648,Ge=!0,x.selectionForeground&&(Ze=50331648,_e=x.selectionForeground.rgba>>8&16777215,_t=x.selectionForeground)),Ge&&Z.push("xterm-decoration-top"),Ke){case 16777216:case 33554432:De=x.ansi[be],Z.push(`xterm-bg-${be}`);break;case 50331648:De=f.channels.toColor(be>>16,be>>8&255,255&be),this._addStyle(L,`background-color:#${S((be>>>0).toString(16),"0",6)}`);break;default:Bt?(De=x.foreground,Z.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):De=x.background}switch(Le||te.isDim()&&(Le=f.color.multiplyOpacity(De,.5)),Ze){case 16777216:case 33554432:te.isBold()&&_e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_e+=8),this._applyMinimumContrast(L,De,x.ansi[_e],te,Le,void 0)||Z.push(`xterm-fg-${_e}`);break;case 50331648:const oe=f.channels.toColor(_e>>16&255,_e>>8&255,255&_e);this._applyMinimumContrast(L,De,oe,te,Le,_t)||this._addStyle(L,`color:#${S(_e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,De,x.foreground,te,Le,_t)||Bt&&Z.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Z.length&&(L.className=Z.join(" "),Z.length=0),Dt||he||At?L.textContent=N:M++,H!==this.defaultSpacing&&(L.style.letterSpacing=`${H}px`),G.push(L),ie=ue}return L&&M&&(L.textContent=N),G}_applyMinimumContrast(b,w,g,E,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,r.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const O=this._getContrastCache(E);let D;if(T||B||(D=O.getColor(w.rgba,g.rgba)),D===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=f.color.ensureContrastRatio(T||w,B||g,I),O.setColor((T||w).rgba,(B||g).rgba,D??null)}return!!D&&(this._addStyle(b,`color:${D.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,w){b.setAttribute("style",`${b.getAttribute("style")||""}${w};`)}_isCellInSelection(b,w){const g=this._selectionStart,E=this._selectionEnd;return!(!g||!E)&&(this._columnSelectMode?g[0]<=E[0]?b>=g[0]&&w>=g[1]&&b<E[0]&&w<=E[1]:b<g[0]&&w>=g[1]&&b>=E[0]&&w<=E[1]:w>g[1]&&w<E[1]||g[1]===E[1]&&w===g[1]&&b>=g[0]&&b<E[0]||g[1]<E[1]&&w===E[1]&&b<E[0]||g[1]<E[1]&&w===g[1]&&b>=g[0])}};function S(b,w,g){for(;b.length<g;)b=w+b;return b}t.DomRendererRowFactory=u=l([_(1,i.ICharacterJoinerService),_(2,C.IOptionsService),_(3,i.ICoreBrowserService),_(4,C.ICoreService),_(5,C.IDecorationService),_(6,i.IThemeService)],u)},2550:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(o,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 _=o.createElement("span");_.classList.add("xterm-char-measure-element");const h=o.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const p=o.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=o.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,h,p,m],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(p),this._container.appendChild(m),l.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(o,l,_,h){o===this._font&&l===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=o,this._fontSize=l,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(o,l,_){let h=0;if(!l&&!_&&o.length===1&&(h=o.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(o,0);return C>0&&(this._flat[h]=C),C}let p=o;l&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let C=0;l&&(C|=1),_&&(C|=2),m=this._measure(o,C),m>0&&this._holey.set(p,m)}return m}_measure(o,l){const _=this._measureElements[l];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=o(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(k,t)=>{function o(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},t.isPowerlineGlyph=o,t.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},t.isEmoji=l,t.allowRescaling=function(_,h,p,m){return h===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!l(_)&&!o(_)&&!function(C){return 57344<=C&&C<=63743}(_)},t.treatGlyphAsBackgroundColor=function(_){return o(_)||function(h){return 9472<=h&&h<=9631}(_)},t.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}}}},t.computeNextVariantOffset=function(_,h,p=0){return(_-(2*Math.round(h)-p))%(2*Math.round(h))}},6052:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,p,m=!1){if(this.selectionStart=h,this.selectionEnd=p,!h||!p||h[0]===p[0]&&h[1]===p[1])return void this.clear();const C=_.buffers.active.ydisp,f=h[1]-C,i=p[1]-C,n=Math.max(f,0),r=Math.min(i,_.rows-1);n>=_.rows||r<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=f,this.viewportEndRow=i,this.viewportCappedStartRow=n,this.viewportCappedEndRow=r,this.startCol=h[0],this.endCol=p[0])}isCellSelected(_,h,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&p>=this.viewportCappedStartRow&&h<this.endCol&&p<=this.viewportCappedEndRow:h<this.startCol&&p>=this.viewportCappedStartRow&&h>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol)}}t.createSelectionRenderModel=function(){return new o}},456:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,l=this.selectionEnd;return!(!o||!l)&&(o[1]>l[1]||o[1]===l[1]&&o[0]>l[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(k,t,o){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const h=o(2585),p=o(8460),m=o(844);let C=t.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(r,s,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new n(this._optionsService))}catch{this._measureStrategy=this.register(new i(r,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const r=this._measureStrategy.measure();r.width===this.width&&r.height===this.height||(this.width=r.width,this.height=r.height,this._onCharSizeChange.fire())}};t.CharSizeService=C=l([_(2,h.IOptionsService)],C);class f extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,u){s!==void 0&&s>0&&u!==void 0&&u>0&&(this._result.width=s,this._result.height=u)}}class i extends f{constructor(s,u,S){super(),this._document=s,this._parentElement=u,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 n extends f{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const u=this._ctx.measureText("W");if(!("width"in u&&"fontBoundingBoxAscent"in u&&"fontBoundingBoxDescent"in u))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(k,t,o){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const h=o(3734),p=o(643),m=o(511),C=o(2585);class f extends h.AttributeData{constructor(r,s,u){super(),this.content=0,this.combinedData="",this.fg=r.fg,this.bg=r.bg,this.combinedData=s,this._width=u}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(r){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=f;let i=t.CharacterJoinerService=class kr{constructor(r){this._bufferService=r,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(r){const s={id:this._nextCharacterJoinerId++,handler:r};return this._characterJoiners.push(s),s.id}deregister(r){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===r)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(r){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(r);if(!s||s.length===0)return[];const u=[],S=s.translateToString(!0);let b=0,w=0,g=0,E=s.getFg(0),T=s.getBg(0);for(let B=0;B<s.getTrimmedLength();B++)if(s.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==T){if(B-b>1){const O=this._getJoinedRanges(S,g,w,s,b);for(let D=0;D<O.length;D++)u.push(O[D])}b=B,g=w,E=this._workCell.fg,T=this._workCell.bg}w+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const B=this._getJoinedRanges(S,g,w,s,b);for(let O=0;O<B.length;O++)u.push(B[O])}return u}_getJoinedRanges(r,s,u,S,b){const w=r.substring(s,u);let g=[];try{g=this._characterJoiners[0].handler(w)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const T=this._characterJoiners[E].handler(w);for(let B=0;B<T.length;B++)kr._mergeRanges(g,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,S,b),g}_stringRangesToCellRanges(r,s,u){let S=0,b=!1,w=0,g=r[S];if(g){for(let E=u;E<this._bufferService.cols;E++){const T=s.getWidth(E),B=s.getString(E).length||p.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!b&&g[0]<=w&&(g[0]=E,b=!0),g[1]<=w){if(g[1]=E,g=r[++S],!g)break;g[0]<=w?(g[0]=E,b=!0):b=!1}w+=B}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(r,s){let u=!1;for(let S=0;S<r.length;S++){const b=r[S];if(u){if(s[1]<=b[0])return r[S-1][1]=s[1],r;if(s[1]<=b[1])return r[S-1][1]=Math.max(s[1],b[1]),r.splice(S,1),r;r.splice(S,1),S--}else{if(s[1]<=b[0])return r.splice(S,0,s),r;if(s[1]<=b[1])return b[0]=Math.min(s[0],b[0]),r;s[0]<b[1]&&(b[0]=Math.min(s[0],b[0]),u=!0)}}return u?r[r.length-1][1]=s[1]:r.push(s),r}};t.CharacterJoinerService=i=l([_(0,C.IBufferService)],i)},5114:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const l=o(844),_=o(8460),h=o(3656);class p extends l.Disposable{constructor(f,i,n){super(),this._textarea=f,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(f){this._window!==f&&(this._window=f,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}}t.CoreBrowserService=p;class m extends l.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)(()=>this.clearListener()))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.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:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const l=o(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}t.LinkProviderService=_},8934:function(k,t,o){var l=this&&this.__decorate||function(C,f,i,n){var r,s=arguments.length,u=s<3?f:n===null?n=Object.getOwnPropertyDescriptor(f,i):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(C,f,i,n);else for(var S=C.length-1;S>=0;S--)(r=C[S])&&(u=(s<3?r(u):s>3?r(f,i,u):r(f,i))||u);return s>3&&u&&Object.defineProperty(f,i,u),u},_=this&&this.__param||function(C,f){return function(i,n){f(i,n,C)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const h=o(4725),p=o(9806);let m=t.MouseService=class{constructor(C,f){this._renderService=C,this._charSizeService=f}getCoords(C,f,i,n,r){return(0,p.getCoords)(window,C,f,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(C,f){const i=(0,p.getCoordsRelativeToElement)(window,C,f);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};t.MouseService=m=l([_(0,h.IRenderService),_(1,h.ICharSizeService)],m)},3230:function(k,t,o){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const h=o(6193),p=o(4725),m=o(8460),C=o(844),f=o(7226),i=o(2585);let n=t.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(r,s,u,S,b,w,g,E){super(),this._rowCount=r,this._charSizeService=S,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,B)=>this._renderRows(T,B),g),this.register(this._renderDebouncer),this.register(g.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(w.onResize(()=>this._fullRefresh())),this.register(w.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(u.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()})),this.register(u.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(w.buffer.y,w.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(g.window,s),this.register(g.onWindowChange(T=>this._registerIntersectionObserver(T,s)))}_registerIntersectionObserver(r,s){if("IntersectionObserver"in r){const u=new r.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});u.observe(s),this._observerDisposable.value=(0,C.toDisposable)(()=>u.disconnect())}}_handleIntersectionChange(r){this._isPaused=r.isIntersecting===void 0?r.intersectionRatio===0:!r.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(r,s,u=!1){this._isPaused?this._needsFullRefresh=!0:(u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(r,s,this._rowCount))}_renderRows(r,s){this._renderer.value&&(r=Math.min(r,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(r,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:r,end:s}),this._onRender.fire({start:r,end:s}),this._isNextRenderRedrawOnly=!0)}resize(r,s){this._rowCount=s,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(r){this._renderer.value=r,this._renderer.value&&(this._renderer.value.onRequestRedraw(s=>this.refreshRows(s.start,s.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(r){return this._renderDebouncer.addRefreshCallback(r)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var r,s;this._renderer.value&&((s=(r=this._renderer.value).clearTextureAtlas)==null||s.call(r),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(r,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var u;return(u=this._renderer.value)==null?void 0:u.handleResize(r,s)}):this._renderer.value.handleResize(r,s),this._fullRefresh())}handleCharSizeChanged(){var r;(r=this._renderer.value)==null||r.handleCharSizeChanged()}handleBlur(){var r;(r=this._renderer.value)==null||r.handleBlur()}handleFocus(){var r;(r=this._renderer.value)==null||r.handleFocus()}handleSelectionChanged(r,s,u){var S;this._selectionState.start=r,this._selectionState.end=s,this._selectionState.columnSelectMode=u,(S=this._renderer.value)==null||S.handleSelectionChanged(r,s,u)}handleCursorMove(){var r;(r=this._renderer.value)==null||r.handleCursorMove()}clear(){var r;(r=this._renderer.value)==null||r.clear()}};t.RenderService=n=l([_(2,i.IOptionsService),_(3,p.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],n)},9312:function(k,t,o){var l=this&&this.__decorate||function(g,E,T,B){var O,D=arguments.length,I=D<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(g,E,T,B);else for(var F=g.length-1;F>=0;F--)(O=g[F])&&(I=(D<3?O(I):D>3?O(E,T,I):O(E,T))||I);return D>3&&I&&Object.defineProperty(E,T,I),I},_=this&&this.__param||function(g,E){return function(T,B){E(T,B,g)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const h=o(9806),p=o(9504),m=o(456),C=o(4725),f=o(8460),i=o(844),n=o(6114),r=o(4841),s=o(511),u=o(2585),S=" ",b=new RegExp(S,"g");let w=t.SelectionService=class extends i.Disposable{constructor(g,E,T,B,O,D,I,F,$){super(),this._element=g,this._screenElement=E,this._linkifier=T,this._bufferService=B,this._coreService=O,this._mouseService=D,this._optionsService=I,this._renderService=F,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(G=>this._handleTrim(G)),this.register(this._bufferService.buffers.onBufferActivate(G=>this._handleBufferActivate(G))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.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,E=this._model.finalSelectionEnd;return!(!g||!E||g[0]===E[0]&&g[1]===E[1])}get selectionText(){const g=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!g||!E)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(g[0]===E[0])return"";const O=g[0]<E[0]?g[0]:E[0],D=g[0]<E[0]?E[0]:g[0];for(let I=g[1];I<=E[1];I++){const F=T.translateBufferLineToString(I,!0,O,D);B.push(F)}}else{const O=g[1]===E[1]?E[0]:void 0;B.push(T.translateBufferLineToString(g[1],!0,g[0],O));for(let D=g[1]+1;D<=E[1]-1;D++){const I=T.lines.get(D),F=T.translateBufferLineToString(D,!0);I!=null&&I.isWrapped?B[B.length-1]+=F:B.push(F)}if(g[1]!==E[1]){const D=T.lines.get(E[1]),I=T.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?B[B.length-1]+=I:B.push(I)}}return B.map(O=>O.replace(b," ")).join(n.isWindows?`\r
5
+ WARNING: This link could potentially be dangerous`)){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=m=l([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,l,_){this._rowCount=_,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const l=a(3614),_=a(3656),h=a(3551),p=a(9042),m=a(3730),C=a(1680),f=a(3107),i=a(5744),n=a(2950),r=a(1296),s=a(428),u=a(4269),S=a(5114),b=a(8934),w=a(3230),g=a(9312),E=a(4725),T=a(6731),B=a(8055),O=a(8969),D=a(8460),I=a(844),F=a(6114),$=a(8437),G=a(2584),U=a(7399),x=a(5941),L=a(9074),A=a(2585),M=a(5435),N=a(4567),z=a(779);class Y extends O.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(P={}){super(P),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(z.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,W)=>this.refresh(R,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,I.toDisposable)(()=>{var R,W;this._customKeyEventHandler=void 0,(W=(R=this.element)==null?void 0:R.parentNode)==null||W.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const R of P){let W,H="";switch(R.index){case 256:W="foreground",H="10";break;case 257:W="background",H="11";break;case 258:W="cursor",H="12";break;default:W="ansi",H="4;"+R.index}switch(R.type){case 0:const Z=B.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${H};${(0,x.toRgbString)(Z)}${G.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(V=>V.ansi[R.index]=B.channels.toColor(...R.color));else{const V=W;this._themeService.modifyColors(ie=>ie[V]=B.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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 P=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(P);if(!R)return;const W=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Z=R.getWidth(W),V=this._renderService.dimensions.css.cell.width*Z,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,ce=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ce+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=V+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,l.copyHandler)(R,this._selectionService)}));const P=R=>(0,l.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,_.addDisposableDomListener)(this.element,"paste",P)),F.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,l.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var W;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((W=this.element)==null?void 0:W.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),F.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,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(u.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(n.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(r.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,R=this.element;function W(V){const ie=P._mouseService.getMouseReportCoords(V,P.screenElement);if(!ie)return!1;let ce,he;switch(V.overrideType||V.type){case"mousemove":he=32,V.buttons===void 0?(ce=3,V.button!==void 0&&(ce=V.button<3?V.button:3)):ce=1&V.buttons?0:4&V.buttons?1:2&V.buttons?2:3;break;case"mouseup":he=0,ce=V.button<3?V.button:3;break;case"mousedown":he=1,ce=V.button<3?V.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(V)===!1||P.viewport.getLinesScrolled(V)===0)return!1;he=V.deltaY<0?0:1,ce=4;break;default:return!1}return!(he===void 0||ce===void 0||ce>4)&&P.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:ce,action:he,ctrl:V.ctrlKey,alt:V.altKey,shift:V.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Z={mouseup:V=>(W(V),V.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(V)),wheel:V=>(W(V),this.cancel(V,!0)),mousedrag:V=>{V.buttons&&W(V)},mousemove:V=>{V.buttons||W(V)}};this.register(this.coreMouseService.onProtocolChange(V=>{V?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(V)),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&V?H.mousemove||(R.addEventListener("mousemove",Z.mousemove),H.mousemove=Z.mousemove):(R.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&V?H.wheel||(R.addEventListener("wheel",Z.wheel,{passive:!1}),H.wheel=Z.wheel):(R.removeEventListener("wheel",H.wheel),H.wheel=null),2&V?H.mouseup||(H.mouseup=Z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&V?H.mousedrag||(H.mousedrag=Z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(R,"mousedown",V=>{if(V.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(V))return W(V),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(V)})),this.register((0,_.addDisposableDomListener)(R,"wheel",V=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(V)===!1)return!1;if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(V);if(ie===0)return;const ce=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(V.deltaY<0?"A":"B");let he="";for(let ue=0;ue<Math.abs(ie);ue++)he+=ce;return this.coreService.triggerDataEvent(he,!0),this.cancel(V,!0)}return this.viewport.handleWheel(V)?this.cancel(V):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(R,"touchstart",V=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(V),this.cancel(V)},{passive:!0})),this.register((0,_.addDisposableDomListener)(R,"touchmove",V=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(V)?void 0:this.cancel(V)},{passive:!1}))}refresh(P,R){var W;(W=this._renderService)==null||W.refreshRows(P,R)}updateCursorStyle(P){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(P)?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(P,R,W=0){var H;W===1?(super.scrollLines(P,R,W),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(P)}paste(P){(0,l.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,R,W){this._selectionService.setSelection(P,R,W)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,R){var W;(W=this._selectionService)==null||W.selectLines(P,R)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!R&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,U.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),W.type===3||W.type===2){const H=this.rows-1;return this.scrollLines(W.type===2?-H:H),this.cancel(P,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(W.cancel&&this.cancel(P,!0),!W.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==G.C0.ETX&&W.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,R){const W=P.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||P.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||P.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?W:W&&(!R.keyCode||R.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)R=P.charCode;else if(P.which===null||P.which===void 0)R=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;R=P.which}return!(!R||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=P.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(P),!0}return!1}resize(P,R){P!==this.cols||R!==this.rows?super.resize(P,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,R){var W,H;(W=this._charSizeService)==null||W.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var P;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var R,W;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),(W=this.viewport)==null||W.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${W};${R}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${Z};${H}t`)}}cancel(P,R){if(this.options.cancelEvents||R)return P.preventDefault(),P.stopPropagation(),!1}}t.Terminal=Y},9924:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(a,l=1e3){this._renderCallback=a,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,l,_){this._rowCount=_,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=h-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l)}}},1680:function(k,t,a){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const h=a(3656),p=a(4725),m=a(8460),C=a(844),f=a(2585);let i=t.Viewport=class extends C.Disposable{constructor(n,r,s,u,S,b,w,g){super(),this._viewportElement=n,this._scrollArea=r,this._bufferService=s,this._optionsService=u,this._charSizeService=S,this._renderService=b,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(g.colors),this.register(g.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(n){this._viewportElement.style.backgroundColor=n.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(n){if(n)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 r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==n&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=n),this._refreshAnimationFrame=null}syncScrollArea(n=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(n);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(n)}_handleScroll(n){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 r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:r,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const n=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(n*(this._smoothScrollState.target-this._smoothScrollState.origin)),n<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(n,r){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&s<this._lastRecordedBufferHeight)||(n.cancelable&&n.preventDefault(),!1)}handleWheel(n){const r=this._getPixelsScrolled(n);return r!==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+r:this._smoothScrollState.target+=r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=r,this._bubbleScroll(n,r))}scrollLines(n){if(n!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const r=n*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!1})}_getPixelsScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let r=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r}getBufferElements(n,r){var g;let s,u="";const S=[],b=r??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let E=n;E<b;E++){const T=w.get(E);if(!T)continue;const B=(g=w.get(E+1))==null?void 0:g.isWrapped;if(u+=T.translateToString(!B),!B||E===w.length-1){const O=document.createElement("div");O.textContent=u,S.push(O),u.length>0&&(s=O),u=""}}return{bufferElements:S,cursorElement:s}}getLinesScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let r=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(n,r){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&r.altKey||s==="ctrl"&&r.ctrlKey||s==="shift"&&r.shiftKey?n*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:n*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(n){this._lastTouchY=n.touches[0].pageY}handleTouchMove(n){const r=this._lastTouchY-n.touches[0].pageY;return this._lastTouchY=n.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(n,r))}};t.Viewport=i=l([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],i)},3107:function(k,t,a){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const h=a(4725),p=a(844),m=a(2585);let C=t.BufferDecorationRenderer=class extends p.Disposable{constructor(f,i,n,r,s){super(),this._screenElement=f,this._bufferService=i,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(u=>this._removeDecoration(u))),this.register((0,p.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var r;const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((r=f==null?void 0:f.options)==null?void 0:r.layer)==="top"),i.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=f.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(f,i),i}_refreshStyle(f){const i=f.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let n=this._decorationElements.get(f);n||(n=this._createElement(f),f.element=n,this._decorationElements.set(f,n),this._container.appendChild(n),f.onDispose(()=>{this._decorationElements.delete(f),n.remove()})),n.style.top=i*this._renderService.dimensions.css.cell.height+"px",n.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(n)}}_refreshXPosition(f,i=f.element){if(!i)return;const n=f.options.x??0;(f.options.anchor||"left")==="right"?i.style.right=n?n*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=n?n*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var i;(i=this._decorationElements.get(f))==null||i.remove(),this._decorationElements.delete(f),f.dispose()}};t.BufferDecorationRenderer=C=l([_(1,m.IBufferService),_(2,h.ICoreBrowserService),_(3,m.IDecorationService),_(4,h.IRenderService)],C)},5871:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const l of this._zones)if(l.color===a.options.overviewRulerOptions.color&&l.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,a.marker.line))return;if(this._lineAdjacentToZone(l,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(l,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,l){return l>=a.startBufferLine&&l<=a.endBufferLine}_lineAdjacentToZone(a,l,_){return l>=a.startBufferLine-this._linePadding[_||"full"]&&l<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,l){a.startBufferLine=Math.min(a.startBufferLine,l),a.endBufferLine=Math.max(a.endBufferLine,l)}}},5744:function(k,t,a){var l=this&&this.__decorate||function(s,u,S,b){var w,g=arguments.length,E=g<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,u,S,b);else for(var T=s.length-1;T>=0;T--)(w=s[T])&&(E=(g<3?w(E):g>3?w(u,S,E):w(u,S))||E);return g>3&&E&&Object.defineProperty(u,S,E),E},_=this&&this.__param||function(s,u){return function(S,b){u(S,b,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const h=a(5871),p=a(4725),m=a(844),C=a(2585),f={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0};let r=t.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,u,S,b,w,g,E){var B;super(),this._viewportElement=s,this._screenElement=u,this._bufferService=S,this._decorationService=b,this._renderService=w,this._optionsService=g,this._coreBrowserService=E,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(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,m.toDisposable)(()=>{var O;(O=this._canvas)==null||O.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const s=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=s,i.center=u,i.right=s,this._refreshDrawHeightConstants(),n.full=0,n.left=0,n.center=i.left,n.right=i.left+i.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);f.left=u,f.center=u,f.right=u}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const u of s)u.position!=="full"&&this._renderColorZone(u);for(const u of s)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(n[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-f[s.position||"full"]/2),i[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[s.position||"full"]))}_queueRefresh(s,u){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t.OverviewRulerRenderer=r=l([_(2,C.IBufferService),_(3,C.IDecorationService),_(4,p.IRenderService),_(5,C.IOptionsService),_(6,p.ICoreBrowserService)],r)},2950:function(k,t,a){var l=this&&this.__decorate||function(f,i,n,r){var s,u=arguments.length,S=u<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,i,n,r);else for(var b=f.length-1;b>=0;b--)(s=f[b])&&(S=(u<3?s(S):u>3?s(i,n,S):s(i,n))||S);return u>3&&S&&Object.defineProperty(i,n,S),S},_=this&&this.__param||function(f,i){return function(n,r){i(n,r,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const h=a(4725),p=a(2585),m=a(2584);let C=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,i,n,r,s,u){this._textarea=f,this._compositionView=i,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=u,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(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let n;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,n=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const i=this._textarea.value,n=i.replace(f,"");this._dataAlreadySent=n,i.length>f.length?this._coreService.triggerDataEvent(n,!0):i.length<f.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):i.length===f.length&&i!==f&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const u=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};t.CompositionHelper=C=l([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,h.IRenderService)],C)},9806:(k,t)=>{function a(l,_,h){const p=h.getBoundingClientRect(),m=l.getComputedStyle(h),C=parseInt(m.getPropertyValue("padding-left")),f=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-C,_.clientY-p.top-f]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=a,t.getCoords=function(l,_,h,p,m,C,f,i,n){if(!C)return;const r=a(l,_,h);return r?(r[0]=Math.ceil((r[0]+(n?f/2:0))/f),r[1]=Math.ceil(r[1]/i),r[0]=Math.min(Math.max(r[0],1),p+(n?1:0)),r[1]=Math.min(Math.max(r[1],1),m),r):void 0}},9504:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const l=a(2584);function _(i,n,r,s){const u=i-h(i,r),S=n-h(n,r),b=Math.abs(u-S)-function(w,g,E){let T=0;const B=w-h(w,E),O=g-h(g,E);for(let D=0;D<Math.abs(B-O);D++){const I=p(w,g)==="A"?-1:1,F=E.buffer.lines.get(B+I*D);F!=null&&F.isWrapped&&T++}return T}(i,n,r);return f(b,C(p(i,n),s))}function h(i,n){let r=0,s=n.buffer.lines.get(i),u=s==null?void 0:s.isWrapped;for(;u&&i>=0&&i<n.rows;)r++,s=n.buffer.lines.get(--i),u=s==null?void 0:s.isWrapped;return r}function p(i,n){return i>n?"A":"B"}function m(i,n,r,s,u,S){let b=i,w=n,g="";for(;b!==r||w!==s;)b+=u?1:-1,u&&b>S.cols-1?(g+=S.buffer.translateBufferLineToString(w,!1,i,b),b=0,i=0,w++):!u&&b<0&&(g+=S.buffer.translateBufferLineToString(w,!1,0,i+1),b=S.cols-1,i=b,w--);return g+S.buffer.translateBufferLineToString(w,!1,i,b)}function C(i,n){const r=n?"O":"[";return l.C0.ESC+r+i}function f(i,n){i=Math.floor(i);let r="";for(let s=0;s<i;s++)r+=n;return r}t.moveToCellSequence=function(i,n,r,s){const u=r.buffer.x,S=r.buffer.y;if(!r.buffer.hasScrollback)return function(g,E,T,B,O,D){return _(E,B,O,D).length===0?"":f(m(g,E,g,E-h(E,O),!1,O).length,C("D",D))}(u,S,0,n,r,s)+_(S,n,r,s)+function(g,E,T,B,O,D){let I;I=_(E,B,O,D).length>0?B-h(B,O):E;const F=B,$=function(G,U,x,L,A,M){let N;return N=_(x,L,A,M).length>0?L-h(L,A):U,G<x&&N<=L||G>=x&&N<L?"C":"D"}(g,E,T,B,O,D);return f(m(g,I,T,F,$==="C",O).length,C($,D))}(u,S,i,n,r,s);let b;if(S===n)return b=u>i?"D":"C",f(Math.abs(u-i),C(b,s));b=S>n?"D":"C";const w=Math.abs(S-n);return f(function(g,E){return E.cols-g}(S>n?i:u,r)+(w-1)*r.cols+1+((S>n?u:i)-1),C(b,s))}},1296:function(k,t,a){var l=this&&this.__decorate||function(D,I,F,$){var G,U=arguments.length,x=U<3?I:$===null?$=Object.getOwnPropertyDescriptor(I,F):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(D,I,F,$);else for(var L=D.length-1;L>=0;L--)(G=D[L])&&(x=(U<3?G(x):U>3?G(I,F,x):G(I,F))||x);return U>3&&x&&Object.defineProperty(I,F,x),x},_=this&&this.__param||function(D,I){return function(F,$){I(F,$,D)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const h=a(3787),p=a(2550),m=a(2223),C=a(6171),f=a(6052),i=a(4725),n=a(8055),r=a(8460),s=a(844),u=a(2585),S="xterm-dom-renderer-owner-",b="xterm-rows",w="xterm-fg-",g="xterm-bg-",E="xterm-focus",T="xterm-selection";let B=1,O=t.DomRenderer=class extends s.Disposable{constructor(D,I,F,$,G,U,x,L,A,M,N,z,Y){super(),this._terminal=D,this._document=I,this._element=F,this._screenElement=$,this._viewportElement=G,this._helperContainer=U,this._linkifier2=x,this._charSizeService=A,this._optionsService=M,this._bufferService=N,this._coreBrowserService=z,this._themeService=Y,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new r.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(ee=>this._injectCss(ee))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(ee=>this._handleLinkHover(ee))),this.register(this._linkifier2.onHideLinkUnderline(ee=>this._handleLinkLeave(ee))),this.register((0,s.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 p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const I=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=I,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let I=`${this._terminalSelector} .${b} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;I+=`${this._terminalSelector} .${b} .xterm-dim { color: ${n.color.multiplyOpacity(D.foreground,.5).css};}`,I+=`${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 F=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;I+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,I+=`@keyframes ${$} { 50% { box-shadow: none; }}`,I+=`@keyframes ${G} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,I+=`${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,I+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[U,x]of D.ansi.entries())I+=`${this._terminalSelector} .${w}${U} { color: ${x.css}; }${this._terminalSelector} .${w}${U}.xterm-dim { color: ${n.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${g}${U} { background-color: ${x.css}; }`;I+=`${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(D.background).css}; }${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${g}${m.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=I}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,I){for(let F=this._rowElements.length;F<=I;F++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>I;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,I){this._refreshRowElements(D,I),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,I,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,I,F),this.renderRows(0,this._bufferService.rows-1),!D||!I)return;this._selectionRenderModel.update(this._terminal,D,I,F);const $=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||x<0)return;const L=this._document.createDocumentFragment();if(F){const A=D[0]>I[0];L.appendChild(this._createSelectionElement(U,A?I[0]:D[0],A?D[0]:I[0],x-U+1))}else{const A=$===U?D[0]:0,M=U===G?I[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(U,A,M));const N=x-U-1;if(L.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,N)),U!==x){const z=G===x?I[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(x,0,z))}}this._selectionContainer.appendChild(L)}_createSelectionElement(D,I,F,$=1){const G=this._document.createElement("div"),U=I*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(F-I);return U+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-U),G.style.height=$*this.dimensions.css.cell.height+"px",G.style.top=D*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${x}px`,G}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 D of this._rowElements)D.replaceChildren()}renderRows(D,I){const F=this._bufferService.buffer,$=F.ybase+F.y,G=Math.min(F.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=D;A<=I;A++){const M=A+F.ydisp,N=this._rowElements[A],z=F.lines.get(M);if(!N||!z)break;N.replaceChildren(...this._rowFactory.createRow(z,M,M===$,x,L,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,I,F,$,G,U){F<0&&(D=0),$<0&&(I=0);const x=this._bufferService.rows-1;F=Math.max(Math.min(F,x),0),$=Math.max(Math.min($,x),0),G=Math.min(G,this._bufferService.cols);const L=this._bufferService.buffer,A=L.ybase+L.y,M=Math.min(L.x,G-1),N=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=F;ee<=$;++ee){const P=ee+L.ydisp,R=this._rowElements[ee],W=L.lines.get(P);if(!R||!W)break;R.replaceChildren(...this._rowFactory.createRow(W,P,P===A,z,Y,M,N,this.dimensions.css.cell.width,this._widthCache,U?ee===F?D:0:-1,U?(ee===$?I:G)-1:-1))}}};t.DomRenderer=O=l([_(7,u.IInstantiationService),_(8,i.ICharSizeService),_(9,u.IOptionsService),_(10,u.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],O)},3787:function(k,t,a){var l=this&&this.__decorate||function(b,w,g,E){var T,B=arguments.length,O=B<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,g):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,w,g,E);else for(var D=b.length-1;D>=0;D--)(T=b[D])&&(O=(B<3?T(O):B>3?T(w,g,O):T(w,g))||O);return B>3&&O&&Object.defineProperty(w,g,O),O},_=this&&this.__param||function(b,w){return function(g,E){w(g,E,b)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const h=a(2223),p=a(643),m=a(511),C=a(2585),f=a(8055),i=a(4725),n=a(4269),r=a(6171),s=a(3734);let u=t.DomRendererRowFactory=class{constructor(b,w,g,E,T,B,O){this._document=b,this._characterJoinerService=w,this._optionsService=g,this._coreBrowserService=E,this._coreService=T,this._decorationService=B,this._themeService=O,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,w,g){this._selectionStart=b,this._selectionEnd=w,this._columnSelectMode=g}createRow(b,w,g,E,T,B,O,D,I,F,$){const G=[],U=this._characterJoinerService.getJoinedCharacters(w),x=this._themeService.colors;let L,A=b.getNoBgTrimmedLength();g&&A<B+1&&(A=B+1);let M=0,N="",z=0,Y=0,ee=0,P=!1,R=0,W=!1,H=0;const Z=[],V=F!==-1&&$!==-1;for(let ie=0;ie<A;ie++){b.loadCell(ie,this._workCell);let ce=this._workCell.getWidth();if(ce===0)continue;let he=!1,ue=ie,te=this._workCell;if(U.length>0&&ie===U[0][0]){he=!0;const oe=U.shift();te=new n.JoinedCellData(this._workCell,b.translateToString(!0,oe[0],oe[1]),oe[1]-oe[0]),ue=oe[1]-1,ce=te.getWidth()}const Ve=this._isCellInSelection(ie,w),Dt=g&&ie===B,Tt=V&&ie>=F&&ie<=$;let At=!1;this._decorationService.forEachDecorationAtCell(ie,w,void 0,oe=>{At=!0});let _t=te.getChars()||p.WHITESPACE_CELL_CHAR;if(_t===" "&&(te.isUnderline()||te.isOverline())&&(_t=" "),H=ce*D-I.get(_t,te.isBold(),te.isItalic()),L){if(M&&(Ve&&W||!Ve&&!W&&te.bg===z)&&(Ve&&W&&x.selectionForeground||te.fg===Y)&&te.extended.ext===ee&&Tt===P&&H===R&&!Dt&&!he&&!At){te.isInvisible()?N+=p.WHITESPACE_CELL_CHAR:N+=_t,M++;continue}M&&(L.textContent=N),L=this._document.createElement("span"),M=0,N=""}else L=this._document.createElement("span");if(z=te.bg,Y=te.fg,ee=te.extended.ext,P=Tt,R=H,W=Ve,he&&B>=ie&&B<=ue&&(B=ie),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Z.push("xterm-cursor-blink"),Z.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Z.push("xterm-cursor-outline");break;case"block":Z.push("xterm-cursor-block");break;case"bar":Z.push("xterm-cursor-bar");break;case"underline":Z.push("xterm-cursor-underline")}}if(te.isBold()&&Z.push("xterm-bold"),te.isItalic()&&Z.push("xterm-italic"),te.isDim()&&Z.push("xterm-dim"),N=te.isInvisible()?p.WHITESPACE_CELL_CHAR:te.getChars()||p.WHITESPACE_CELL_CHAR,te.isUnderline()&&(Z.push(`xterm-underline-${te.extended.underlineStyle}`),N===" "&&(N=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let oe=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&oe<8&&(oe+=8),L.style.textDecorationColor=x.ansi[oe].css}te.isOverline()&&(Z.push("xterm-overline"),N===" "&&(N=" ")),te.isStrikethrough()&&Z.push("xterm-strikethrough"),Tt&&(L.style.textDecoration="underline");let _e=te.getFgColor(),Ze=te.getFgColorMode(),be=te.getBgColor(),Ke=te.getBgColorMode();const Bt=!!te.isInverse();if(Bt){const oe=_e;_e=be,be=oe;const Wr=Ze;Ze=Ke,Ke=Wr}let Le,pt,De,Ge=!1;switch(this._decorationService.forEachDecorationAtCell(ie,w,void 0,oe=>{oe.options.layer!=="top"&&Ge||(oe.backgroundColorRGB&&(Ke=50331648,be=oe.backgroundColorRGB.rgba>>8&16777215,Le=oe.backgroundColorRGB),oe.foregroundColorRGB&&(Ze=50331648,_e=oe.foregroundColorRGB.rgba>>8&16777215,pt=oe.foregroundColorRGB),Ge=oe.options.layer==="top")}),!Ge&&Ve&&(Le=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,be=Le.rgba>>8&16777215,Ke=50331648,Ge=!0,x.selectionForeground&&(Ze=50331648,_e=x.selectionForeground.rgba>>8&16777215,pt=x.selectionForeground)),Ge&&Z.push("xterm-decoration-top"),Ke){case 16777216:case 33554432:De=x.ansi[be],Z.push(`xterm-bg-${be}`);break;case 50331648:De=f.channels.toColor(be>>16,be>>8&255,255&be),this._addStyle(L,`background-color:#${S((be>>>0).toString(16),"0",6)}`);break;default:Bt?(De=x.foreground,Z.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):De=x.background}switch(Le||te.isDim()&&(Le=f.color.multiplyOpacity(De,.5)),Ze){case 16777216:case 33554432:te.isBold()&&_e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_e+=8),this._applyMinimumContrast(L,De,x.ansi[_e],te,Le,void 0)||Z.push(`xterm-fg-${_e}`);break;case 50331648:const oe=f.channels.toColor(_e>>16&255,_e>>8&255,255&_e);this._applyMinimumContrast(L,De,oe,te,Le,pt)||this._addStyle(L,`color:#${S(_e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,De,x.foreground,te,Le,pt)||Bt&&Z.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Z.length&&(L.className=Z.join(" "),Z.length=0),Dt||he||At?L.textContent=N:M++,H!==this.defaultSpacing&&(L.style.letterSpacing=`${H}px`),G.push(L),ie=ue}return L&&M&&(L.textContent=N),G}_applyMinimumContrast(b,w,g,E,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,r.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const O=this._getContrastCache(E);let D;if(T||B||(D=O.getColor(w.rgba,g.rgba)),D===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=f.color.ensureContrastRatio(T||w,B||g,I),O.setColor((T||w).rgba,(B||g).rgba,D??null)}return!!D&&(this._addStyle(b,`color:${D.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,w){b.setAttribute("style",`${b.getAttribute("style")||""}${w};`)}_isCellInSelection(b,w){const g=this._selectionStart,E=this._selectionEnd;return!(!g||!E)&&(this._columnSelectMode?g[0]<=E[0]?b>=g[0]&&w>=g[1]&&b<E[0]&&w<=E[1]:b<g[0]&&w>=g[1]&&b>=E[0]&&w<=E[1]:w>g[1]&&w<E[1]||g[1]===E[1]&&w===g[1]&&b>=g[0]&&b<E[0]||g[1]<E[1]&&w===E[1]&&b<E[0]||g[1]<E[1]&&w===g[1]&&b>=g[0])}};function S(b,w,g){for(;b.length<g;)b=w+b;return b}t.DomRendererRowFactory=u=l([_(1,i.ICharacterJoinerService),_(2,C.IOptionsService),_(3,i.ICoreBrowserService),_(4,C.ICoreService),_(5,C.IDecorationService),_(6,i.IThemeService)],u)},2550:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(a,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=a.createElement("span");_.classList.add("xterm-char-measure-element");const h=a.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const p=a.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=a.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,h,p,m],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(p),this._container.appendChild(m),l.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,l,_,h){a===this._font&&l===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=a,this._fontSize=l,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(a,l,_){let h=0;if(!l&&!_&&a.length===1&&(h=a.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(a,0);return C>0&&(this._flat[h]=C),C}let p=a;l&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let C=0;l&&(C|=1),_&&(C|=2),m=this._measure(a,C),m>0&&this._holey.set(p,m)}return m}_measure(a,l){const _=this._measureElements[l];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(k,t)=>{function a(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},t.isEmoji=l,t.allowRescaling=function(_,h,p,m){return h===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!l(_)&&!a(_)&&!function(C){return 57344<=C&&C<=63743}(_)},t.treatGlyphAsBackgroundColor=function(_){return a(_)||function(h){return 9472<=h&&h<=9631}(_)},t.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}}}},t.computeNextVariantOffset=function(_,h,p=0){return(_-(2*Math.round(h)-p))%(2*Math.round(h))}},6052:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,p,m=!1){if(this.selectionStart=h,this.selectionEnd=p,!h||!p||h[0]===p[0]&&h[1]===p[1])return void this.clear();const C=_.buffers.active.ydisp,f=h[1]-C,i=p[1]-C,n=Math.max(f,0),r=Math.min(i,_.rows-1);n>=_.rows||r<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=f,this.viewportEndRow=i,this.viewportCappedStartRow=n,this.viewportCappedEndRow=r,this.startCol=h[0],this.endCol=p[0])}isCellSelected(_,h,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&p>=this.viewportCappedStartRow&&h<this.endCol&&p<=this.viewportCappedEndRow:h<this.startCol&&p>=this.viewportCappedStartRow&&h>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},456:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,l=this.selectionEnd;return!(!a||!l)&&(a[1]>l[1]||a[1]===l[1]&&a[0]>l[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(k,t,a){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const h=a(2585),p=a(8460),m=a(844);let C=t.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(r,s,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new n(this._optionsService))}catch{this._measureStrategy=this.register(new i(r,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const r=this._measureStrategy.measure();r.width===this.width&&r.height===this.height||(this.width=r.width,this.height=r.height,this._onCharSizeChange.fire())}};t.CharSizeService=C=l([_(2,h.IOptionsService)],C);class f extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,u){s!==void 0&&s>0&&u!==void 0&&u>0&&(this._result.width=s,this._result.height=u)}}class i extends f{constructor(s,u,S){super(),this._document=s,this._parentElement=u,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 n extends f{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const u=this._ctx.measureText("W");if(!("width"in u&&"fontBoundingBoxAscent"in u&&"fontBoundingBoxDescent"in u))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(k,t,a){var l=this&&this.__decorate||function(n,r,s,u){var S,b=arguments.length,w=b<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,r,s,u);else for(var g=n.length-1;g>=0;g--)(S=n[g])&&(w=(b<3?S(w):b>3?S(r,s,w):S(r,s))||w);return b>3&&w&&Object.defineProperty(r,s,w),w},_=this&&this.__param||function(n,r){return function(s,u){r(s,u,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const h=a(3734),p=a(643),m=a(511),C=a(2585);class f extends h.AttributeData{constructor(r,s,u){super(),this.content=0,this.combinedData="",this.fg=r.fg,this.bg=r.bg,this.combinedData=s,this._width=u}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(r){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=f;let i=t.CharacterJoinerService=class kr{constructor(r){this._bufferService=r,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(r){const s={id:this._nextCharacterJoinerId++,handler:r};return this._characterJoiners.push(s),s.id}deregister(r){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===r)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(r){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(r);if(!s||s.length===0)return[];const u=[],S=s.translateToString(!0);let b=0,w=0,g=0,E=s.getFg(0),T=s.getBg(0);for(let B=0;B<s.getTrimmedLength();B++)if(s.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==T){if(B-b>1){const O=this._getJoinedRanges(S,g,w,s,b);for(let D=0;D<O.length;D++)u.push(O[D])}b=B,g=w,E=this._workCell.fg,T=this._workCell.bg}w+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const B=this._getJoinedRanges(S,g,w,s,b);for(let O=0;O<B.length;O++)u.push(B[O])}return u}_getJoinedRanges(r,s,u,S,b){const w=r.substring(s,u);let g=[];try{g=this._characterJoiners[0].handler(w)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const T=this._characterJoiners[E].handler(w);for(let B=0;B<T.length;B++)kr._mergeRanges(g,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,S,b),g}_stringRangesToCellRanges(r,s,u){let S=0,b=!1,w=0,g=r[S];if(g){for(let E=u;E<this._bufferService.cols;E++){const T=s.getWidth(E),B=s.getString(E).length||p.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!b&&g[0]<=w&&(g[0]=E,b=!0),g[1]<=w){if(g[1]=E,g=r[++S],!g)break;g[0]<=w?(g[0]=E,b=!0):b=!1}w+=B}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(r,s){let u=!1;for(let S=0;S<r.length;S++){const b=r[S];if(u){if(s[1]<=b[0])return r[S-1][1]=s[1],r;if(s[1]<=b[1])return r[S-1][1]=Math.max(s[1],b[1]),r.splice(S,1),r;r.splice(S,1),S--}else{if(s[1]<=b[0])return r.splice(S,0,s),r;if(s[1]<=b[1])return b[0]=Math.min(s[0],b[0]),r;s[0]<b[1]&&(b[0]=Math.min(s[0],b[0]),u=!0)}}return u?r[r.length-1][1]=s[1]:r.push(s),r}};t.CharacterJoinerService=i=l([_(0,C.IBufferService)],i)},5114:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const l=a(844),_=a(8460),h=a(3656);class p extends l.Disposable{constructor(f,i,n){super(),this._textarea=f,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(f){this._window!==f&&(this._window=f,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}}t.CoreBrowserService=p;class m extends l.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)(()=>this.clearListener()))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.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:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const l=a(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}t.LinkProviderService=_},8934:function(k,t,a){var l=this&&this.__decorate||function(C,f,i,n){var r,s=arguments.length,u=s<3?f:n===null?n=Object.getOwnPropertyDescriptor(f,i):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(C,f,i,n);else for(var S=C.length-1;S>=0;S--)(r=C[S])&&(u=(s<3?r(u):s>3?r(f,i,u):r(f,i))||u);return s>3&&u&&Object.defineProperty(f,i,u),u},_=this&&this.__param||function(C,f){return function(i,n){f(i,n,C)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const h=a(4725),p=a(9806);let m=t.MouseService=class{constructor(C,f){this._renderService=C,this._charSizeService=f}getCoords(C,f,i,n,r){return(0,p.getCoords)(window,C,f,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(C,f){const i=(0,p.getCoordsRelativeToElement)(window,C,f);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};t.MouseService=m=l([_(0,h.IRenderService),_(1,h.ICharSizeService)],m)},3230:function(k,t,a){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const h=a(6193),p=a(4725),m=a(8460),C=a(844),f=a(7226),i=a(2585);let n=t.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(r,s,u,S,b,w,g,E){super(),this._rowCount=r,this._charSizeService=S,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,B)=>this._renderRows(T,B),g),this.register(this._renderDebouncer),this.register(g.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(w.onResize(()=>this._fullRefresh())),this.register(w.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(u.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()})),this.register(u.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(w.buffer.y,w.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(g.window,s),this.register(g.onWindowChange(T=>this._registerIntersectionObserver(T,s)))}_registerIntersectionObserver(r,s){if("IntersectionObserver"in r){const u=new r.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});u.observe(s),this._observerDisposable.value=(0,C.toDisposable)(()=>u.disconnect())}}_handleIntersectionChange(r){this._isPaused=r.isIntersecting===void 0?r.intersectionRatio===0:!r.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(r,s,u=!1){this._isPaused?this._needsFullRefresh=!0:(u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(r,s,this._rowCount))}_renderRows(r,s){this._renderer.value&&(r=Math.min(r,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(r,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:r,end:s}),this._onRender.fire({start:r,end:s}),this._isNextRenderRedrawOnly=!0)}resize(r,s){this._rowCount=s,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(r){this._renderer.value=r,this._renderer.value&&(this._renderer.value.onRequestRedraw(s=>this.refreshRows(s.start,s.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(r){return this._renderDebouncer.addRefreshCallback(r)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var r,s;this._renderer.value&&((s=(r=this._renderer.value).clearTextureAtlas)==null||s.call(r),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(r,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var u;return(u=this._renderer.value)==null?void 0:u.handleResize(r,s)}):this._renderer.value.handleResize(r,s),this._fullRefresh())}handleCharSizeChanged(){var r;(r=this._renderer.value)==null||r.handleCharSizeChanged()}handleBlur(){var r;(r=this._renderer.value)==null||r.handleBlur()}handleFocus(){var r;(r=this._renderer.value)==null||r.handleFocus()}handleSelectionChanged(r,s,u){var S;this._selectionState.start=r,this._selectionState.end=s,this._selectionState.columnSelectMode=u,(S=this._renderer.value)==null||S.handleSelectionChanged(r,s,u)}handleCursorMove(){var r;(r=this._renderer.value)==null||r.handleCursorMove()}clear(){var r;(r=this._renderer.value)==null||r.clear()}};t.RenderService=n=l([_(2,i.IOptionsService),_(3,p.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],n)},9312:function(k,t,a){var l=this&&this.__decorate||function(g,E,T,B){var O,D=arguments.length,I=D<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(g,E,T,B);else for(var F=g.length-1;F>=0;F--)(O=g[F])&&(I=(D<3?O(I):D>3?O(E,T,I):O(E,T))||I);return D>3&&I&&Object.defineProperty(E,T,I),I},_=this&&this.__param||function(g,E){return function(T,B){E(T,B,g)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const h=a(9806),p=a(9504),m=a(456),C=a(4725),f=a(8460),i=a(844),n=a(6114),r=a(4841),s=a(511),u=a(2585),S=" ",b=new RegExp(S,"g");let w=t.SelectionService=class extends i.Disposable{constructor(g,E,T,B,O,D,I,F,$){super(),this._element=g,this._screenElement=E,this._linkifier=T,this._bufferService=B,this._coreService=O,this._mouseService=D,this._optionsService=I,this._renderService=F,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(G=>this._handleTrim(G)),this.register(this._bufferService.buffers.onBufferActivate(G=>this._handleBufferActivate(G))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.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,E=this._model.finalSelectionEnd;return!(!g||!E||g[0]===E[0]&&g[1]===E[1])}get selectionText(){const g=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!g||!E)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(g[0]===E[0])return"";const O=g[0]<E[0]?g[0]:E[0],D=g[0]<E[0]?E[0]:g[0];for(let I=g[1];I<=E[1];I++){const F=T.translateBufferLineToString(I,!0,O,D);B.push(F)}}else{const O=g[1]===E[1]?E[0]:void 0;B.push(T.translateBufferLineToString(g[1],!0,g[0],O));for(let D=g[1]+1;D<=E[1]-1;D++){const I=T.lines.get(D),F=T.translateBufferLineToString(D,!0);I!=null&&I.isWrapped?B[B.length-1]+=F:B.push(F)}if(g[1]!==E[1]){const D=T.lines.get(E[1]),I=T.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?B[B.length-1]+=I:B.push(I)}}return B.map(O=>O.replace(b," ")).join(n.isWindows?`\r
6
6
  `:`
7
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),n.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 E=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&E)&&this._areCoordsInSelection(E,T,B)}isCellInSelection(g,E){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([g,E],T,B)}_areCoordsInSelection(g,E,T){return g[1]>E[1]&&g[1]<T[1]||E[1]===T[1]&&g[1]===E[1]&&g[0]>=E[0]&&g[0]<T[0]||E[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||E[1]<T[1]&&g[1]===E[1]&&g[0]>=E[0]}_selectWordAtCursor(g,E){var O,D;const T=(D=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:D.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,r.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(g);return!!B&&(this._selectWordAt(B,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,E){this._model.clearSelection(),g=Math.max(g,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const E=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(g){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=T?0:(E>T&&(E-=T),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(g){return n.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 E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const E=this._getMouseBufferCoords(g);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(g){return g.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const E=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]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 E=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<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,p.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,E=this._model.finalSelectionEnd,T=!(!g||!E||g[0]===E[0]&&g[1]===E[1]);T?g&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,E,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,E,T)}_fireOnSelectionChange(g,E,T){this._oldSelectionStart=g,this._oldSelectionEnd=E,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(g,E){let T=E;for(let B=0;E>=B;B++){const O=g.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&E!==B&&(T+=O-1)}return T}setSelection(g,E,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,E],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,E,T=!0,B=!0){if(g[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,D=O.lines.get(g[1]);if(!D)return;const I=O.translateBufferLineToString(g[1],!1);let F=this._convertViewportColToCharacterIndex(D,g[0]),$=F;const G=g[0]-F;let U=0,x=0,L=0,A=0;if(I.charAt(F)===" "){for(;F>0&&I.charAt(F-1)===" ";)F--;for(;$<I.length&&I.charAt($+1)===" ";)$++}else{let z=g[0],Y=g[0];D.getWidth(z)===0&&(U++,z--),D.getWidth(Y)===2&&(x++,Y++);const ee=D.getString(Y).length;for(ee>1&&(A+=ee-1,$+=ee-1);z>0&&F>0&&!this._isCharWordSeparator(D.loadCell(z-1,this._workCell));){D.loadCell(z-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,z--):P>1&&(L+=P-1,F-=P-1),F--,z--}for(;Y<D.length&&$+1<I.length&&!this._isCharWordSeparator(D.loadCell(Y+1,this._workCell));){D.loadCell(Y+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,Y++):P>1&&(A+=P-1,$+=P-1),$++,Y++}}$++;let M=F+G-U+L,N=Math.min(this._bufferService.cols,$-F+U+x-L-A);if(E||I.slice(F,$).trim()!==""){if(T&&M===0&&D.getCodePoint(0)!==32){const z=O.lines.get(g[1]-1);if(z&&D.isWrapped&&z.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(Y){const ee=this._bufferService.cols-Y.start;M-=ee,N+=ee}}}if(B&&M+N===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const z=O.lines.get(g[1]+1);if(z!=null&&z.isWrapped&&z.getCodePoint(0)!==32){const Y=this._getWordAt([0,g[1]+1],!1,!1,!0);Y&&(N+=Y.length)}}return{start:M,length:N}}}_selectWordAt(g,E){const T=this._getWordAt(g,E);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 E=this._getWordAt(g,!0);if(E){let T=g[1];for(;E.start<0;)E.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const E=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,r.getRangeLength)(T,this._bufferService.cols)}};t.SelectionService=w=l([_(3,u.IBufferService),_(4,u.ICoreService),_(5,C.IMouseService),_(6,u.IOptionsService),_(7,C.IRenderService),_(8,C.ICoreBrowserService)],w)},4725:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const l=o(8343);t.ICharSizeService=(0,l.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),t.IMouseService=(0,l.createDecorator)("MouseService"),t.IRenderService=(0,l.createDecorator)("RenderService"),t.ISelectionService=(0,l.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,l.createDecorator)("ThemeService"),t.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(k,t,o){var l=this&&this.__decorate||function(w,g,E,T){var B,O=arguments.length,D=O<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,g,E,T);else for(var I=w.length-1;I>=0;I--)(B=w[I])&&(D=(O<3?B(D):O>3?B(g,E,D):B(g,E))||D);return O>3&&D&&Object.defineProperty(g,E,D),D},_=this&&this.__param||function(w,g){return function(E,T){g(E,T,w)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const h=o(7239),p=o(8055),m=o(8460),C=o(844),f=o(2585),i=p.css.toColor("#ffffff"),n=p.css.toColor("#000000"),r=p.css.toColor("#ffffff"),s=p.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let E=0;E<216;E++){const T=g[E/36%6|0],B=g[E/6%6|0],O=g[E%6];w.push({css:p.channels.toCss(T,B,O),rgba:p.channels.toRgba(T,B,O)})}for(let E=0;E<24;E++){const T=8+10*E;w.push({css:p.channels.toCss(T,T,T),rgba:p.channels.toRgba(T,T,T)})}return w})());let S=t.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:n,cursor:r,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:u,selectionBackgroundOpaque:p.color.blend(n,u),selectionInactiveBackgroundTransparent:u,selectionInactiveBackgroundOpaque:p.color.blend(n,u),ansi:t.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(w={}){const g=this._colors;if(g.foreground=b(w.foreground,i),g.background=b(w.background,n),g.cursor=b(w.cursor,r),g.cursorAccent=b(w.cursorAccent,s),g.selectionBackgroundTransparent=b(w.selectionBackground,u),g.selectionBackgroundOpaque=p.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=b(w.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=p.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=w.selectionForeground?b(w.selectionForeground,p.NULL_COLOR):void 0,g.selectionForeground===p.NULL_COLOR&&(g.selectionForeground=void 0),p.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=p.color.opacity(g.selectionBackgroundTransparent,.3)),p.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=p.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=t.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=b(w.black,t.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=b(w.red,t.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=b(w.green,t.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=b(w.yellow,t.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=b(w.blue,t.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=b(w.magenta,t.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=b(w.cyan,t.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=b(w.white,t.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=b(w.brightBlack,t.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=b(w.brightRed,t.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=b(w.brightGreen,t.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=b(w.brightYellow,t.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=b(w.brightBlue,t.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=b(w.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=b(w.brightCyan,t.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=b(w.brightWhite,t.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const E=Math.min(g.ansi.length-16,w.extendedAnsi.length);for(let T=0;T<E;T++)g.ansi[T+16]=b(w.extendedAnsi[T],t.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(w){w(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 b(w,g){if(w!==void 0)try{return p.css.toColor(w)}catch{}return g}t.ThemeService=S=l([_(0,f.IOptionsService)],S)},6349:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const l=o(8460),_=o(844);class h extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const C=new Array(m);for(let f=0;f<Math.min(m,this.length);f++)C[f]=this._array[this._getCyclicIndex(f)];this._array=C,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let C=this._length;C<m;C++)this._array[C]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,C){this._array[this._getCyclicIndex(m)]=C}push(m){this._array[this._getCyclicIndex(this._length)]=m,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,C,...f){if(C){for(let i=m;i<this._length-C;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+C)];this._length-=C,this.onDeleteEmitter.fire({index:m,amount:C})}for(let i=this._length-1;i>=m;i--)this._array[this._getCyclicIndex(i+f.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<f.length;i++)this._array[this._getCyclicIndex(m+i)]=f[i];if(f.length&&this.onInsertEmitter.fire({index:m,amount:f.length}),this._length+f.length>this._maxLength){const i=this._length+f.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=f.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,C,f){if(!(C<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let n=C-1;n>=0;n--)this.set(m+n+f,this.get(m+n));const i=m+C+f-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<C;i++)this.set(m+i+f,this.get(m+i))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}t.CircularList=h},1439:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function o(l,_=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const p in l)h[p]=_<=1?l[p]:l[p]&&o(l[p],_-1);return h}},8055:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let o=0,l=0,_=0,h=0;var p,m,C,f,i;function n(s){const u=s.toString(16);return u.length<2?"0"+u:u}function r(s,u){return s<u?(u+.05)/(s+.05):(s+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(s){s.toCss=function(u,S,b,w){return w!==void 0?`#${n(u)}${n(S)}${n(b)}${n(w)}`:`#${n(u)}${n(S)}${n(b)}`},s.toRgba=function(u,S,b,w=255){return(u<<24|S<<16|b<<8|w)>>>0},s.toColor=function(u,S,b,w){return{css:s.toCss(u,S,b,w),rgba:s.toRgba(u,S,b,w)}}}(p||(t.channels=p={})),function(s){function u(S,b){return h=Math.round(255*b),[o,l,_]=i.toChannels(S.rgba),{css:p.toCss(o,l,_,h),rgba:p.toRgba(o,l,_,h)}}s.blend=function(S,b){if(h=(255&b.rgba)/255,h===1)return{css:b.css,rgba:b.rgba};const w=b.rgba>>24&255,g=b.rgba>>16&255,E=b.rgba>>8&255,T=S.rgba>>24&255,B=S.rgba>>16&255,O=S.rgba>>8&255;return o=T+Math.round((w-T)*h),l=B+Math.round((g-B)*h),_=O+Math.round((E-O)*h),{css:p.toCss(o,l,_),rgba:p.toRgba(o,l,_)}},s.isOpaque=function(S){return(255&S.rgba)==255},s.ensureContrastRatio=function(S,b,w){const g=i.ensureContrastRatio(S.rgba,b.rgba,w);if(g)return p.toColor(g>>24&255,g>>16&255,g>>8&255)},s.opaque=function(S){const b=(255|S.rgba)>>>0;return[o,l,_]=i.toChannels(b),{css:p.toCss(o,l,_),rgba:b}},s.opacity=u,s.multiplyOpacity=function(S,b){return h=255&S.rgba,u(S,h*b/255)},s.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(m||(t.color=m={})),function(s){let u,S;try{const b=document.createElement("canvas");b.width=1,b.height=1;const w=b.getContext("2d",{willReadFrequently:!0});w&&(u=w,u.globalCompositeOperation="copy",S=u.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return o=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),p.toColor(o,l,_);case 5:return o=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),h=parseInt(b.slice(4,5).repeat(2),16),p.toColor(o,l,_,h);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const w=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return o=parseInt(w[1]),l=parseInt(w[2]),_=parseInt(w[3]),h=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),p.toColor(o,l,_,h);if(!u||!S)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=S,u.fillStyle=b,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[o,l,_,h]=u.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,l,_,h),css:b}}}(C||(t.css=C={})),function(s){function u(S,b,w){const g=S/255,E=b/255,T=w/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}s.relativeLuminance=function(S){return u(S>>16&255,S>>8&255,255&S)},s.relativeLuminance2=u}(f||(t.rgb=f={})),function(s){function u(b,w,g){const E=b>>24&255,T=b>>16&255,B=b>>8&255;let O=w>>24&255,D=w>>16&255,I=w>>8&255,F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));for(;F<g&&(O>0||D>0||I>0);)O-=Math.max(0,Math.ceil(.1*O)),D-=Math.max(0,Math.ceil(.1*D)),I-=Math.max(0,Math.ceil(.1*I)),F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));return(O<<24|D<<16|I<<8|255)>>>0}function S(b,w,g){const E=b>>24&255,T=b>>16&255,B=b>>8&255;let O=w>>24&255,D=w>>16&255,I=w>>8&255,F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));for(;F<g&&(O<255||D<255||I<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),D=Math.min(255,D+Math.ceil(.1*(255-D))),I=Math.min(255,I+Math.ceil(.1*(255-I))),F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));return(O<<24|D<<16|I<<8|255)>>>0}s.blend=function(b,w){if(h=(255&w)/255,h===1)return w;const g=w>>24&255,E=w>>16&255,T=w>>8&255,B=b>>24&255,O=b>>16&255,D=b>>8&255;return o=B+Math.round((g-B)*h),l=O+Math.round((E-O)*h),_=D+Math.round((T-D)*h),p.toRgba(o,l,_)},s.ensureContrastRatio=function(b,w,g){const E=f.relativeLuminance(b>>8),T=f.relativeLuminance(w>>8);if(r(E,T)<g){if(T<E){const D=u(b,w,g),I=r(E,f.relativeLuminance(D>>8));if(I<g){const F=S(b,w,g);return I>r(E,f.relativeLuminance(F>>8))?D:F}return D}const B=S(b,w,g),O=r(E,f.relativeLuminance(B>>8));if(O<g){const D=u(b,w,g);return O>r(E,f.relativeLuminance(D>>8))?B:D}return B}},s.reduceLuminance=u,s.increaseLuminance=S,s.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}}(i||(t.rgba=i={})),t.toPaddedHex=n,t.contrastRatio=r},8969:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const l=o(844),_=o(2585),h=o(4348),p=o(7866),m=o(744),C=o(7302),f=o(6975),i=o(8460),n=o(1753),r=o(1480),s=o(7994),u=o(9282),S=o(5435),b=o(5981),w=o(2660);let g=!1;class E extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event(B=>{var O;(O=this._onScrollApi)==null||O.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 O in B)this.optionsService.options[O]=B[O]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(n.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(r.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(_.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,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((O,D)=>this._inputHandler.parse(O,D))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,O){this._writeBuffer.write(B,O)}writeSync(B,O){this._logService.logLevel<=_.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(B,O)}input(B,O=!0){this.coreService.triggerDataEvent(B,O)}resize(B,O){isNaN(B)||isNaN(O)||(B=Math.max(B,m.MINIMUM_COLS),O=Math.max(O,m.MINIMUM_ROWS),this._bufferService.resize(B,O))}scroll(B,O=!1){this._bufferService.scroll(B,O)}scrollLines(B,O,D){this._bufferService.scrollLines(B,O,D)}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 O=B-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(B,O){return this._inputHandler.registerEscHandler(B,O)}registerDcsHandler(B,O){return this._inputHandler.registerDcsHandler(B,O)}registerCsiHandler(B,O){return this._inputHandler.registerCsiHandler(B,O)}registerOscHandler(B,O){return this._inputHandler.registerOscHandler(B,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?B=O.backend==="conpty"&&O.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(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const O of B)O.dispose()})}}}t.CoreTerminal=E},8460:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===o)return void this._listeners.splice(l,1)}}})),this._event}fire(o,l){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,o,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(o,l){return o(_=>l.fire(_))},t.runAndSubscribe=function(o,l){return l(void 0),o(_=>l(_))}},5435:function(k,t,o){var l=this&&this.__decorate||function(U,x,L,A){var M,N=arguments.length,z=N<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,x,L,A);else for(var Y=U.length-1;Y>=0;Y--)(M=U[Y])&&(z=(N<3?M(z):N>3?M(x,L,z):M(x,L))||z);return N>3&&z&&Object.defineProperty(x,L,z),z},_=this&&this.__param||function(U,x){return function(L,A){x(L,A,U)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const h=o(2584),p=o(7116),m=o(2015),C=o(844),f=o(482),i=o(8437),n=o(8460),r=o(643),s=o(511),u=o(3734),S=o(2585),b=o(1480),w=o(6242),g=o(6351),E=o(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function O(U,x){if(U>24)return x.setWinLines||!1;switch(U){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var D;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(t.WindowsOptionsReportType=D={}));let I=0;class F extends C.Disposable{getAttrData(){return this._curAttrData}constructor(x,L,A,M,N,z,Y,ee,P=new m.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=L,this._coreService=A,this._logService=M,this._optionsService=N,this._oscLinkService=z,this._coreMouseService=Y,this._unicodeService=ee,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new n.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new n.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new n.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new n.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new n.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new n.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new n.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new n.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new n.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new n.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new n.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:W.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,W,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:W,data:H})}),this._parser.setDcsHandlerFallback((R,W,H)=>{W==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:W,payload:H})}),this._parser.setPrintHandler((R,W,H)=>this.print(R,W,H)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new w.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new w.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new w.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new w.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new w.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new w.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new w.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new w.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new w.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new w.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new w.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new w.OscHandler(R=>this.restoreCursorColor(R))),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 R in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((R,W)=>this.requestStatusString(R,W)))}_preserveStack(x,L,A,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=A,this._parseStack.position=M}_logSlowResolvingAsync(x){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([x,new Promise((L,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(x,L){let A,M=this._activeBuffer.x,N=this._activeBuffer.y,z=0;const Y=this._parseStack.paused;if(Y){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(A),A;M=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>B&&(z=this._parseStack.position+B)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,R=>String.fromCharCode(R)).join("")}"`),typeof x=="string"?x.split("").map(R=>R.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(x.length,B))),Y||this._dirtyRowTracker.clearRange(),x.length>B)for(let R=z;R<x.length;R+=B){const W=R+B<x.length?R+B:x.length,H=typeof x=="string"?this._stringDecoder.decode(x.substring(R,W),this._parseBuffer):this._utf8Decoder.decode(x.subarray(R,W),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,H))return this._preserveStack(M,N,H,R),this._logSlowResolvingAsync(A),A}else if(!Y){const R=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,R))return this._preserveStack(M,N,R,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===M&&this._activeBuffer.y===N||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(x,L,A){let M,N;const z=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,W=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-L>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let Z=this._parser.precedingJoinState;for(let V=L;V<A;++V){if(M=x[V],M<127&&z){const ue=z[String.fromCharCode(M)];ue&&(M=ue.charCodeAt(0))}const ie=this._unicodeService.charProperties(M,Z);N=b.UnicodeService.extractWidth(ie);const ce=b.UnicodeService.extractShouldJoin(ie),he=ce?b.UnicodeService.extractWidth(Z):0;if(Z=ie,Y&&this._onA11yChar.fire((0,f.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-he>ee){if(P){const ue=H;let te=this._activeBuffer.x-he;for(this._activeBuffer.x=he,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&H instanceof i.BufferLine&&H.copyCellsFrom(ue,te,0,he,!1);te<ee;)ue.setCellFromCodepoint(te++,0,1,W)}else if(this._activeBuffer.x=ee-1,N===2)continue}if(ce&&this._activeBuffer.x){const ue=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ue,M,N);for(let te=N-he;--te>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(R&&(H.insertCells(this._activeBuffer.x,N-he,this._activeBuffer.getNullCell(W)),H.getWidth(ee-1)===2&&H.setCellFromCodepoint(ee-1,r.NULL_CELL_CODE,r.NULL_CELL_WIDTH,W)),H.setCellFromCodepoint(this._activeBuffer.x++,M,N,W),N>0)for(;--N;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=Z,this._activeBuffer.x<ee&&A-L>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,W),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,L){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,L):this._parser.registerCsiHandler(x,A=>!O(A.params[0],this._optionsService.rawOptions.windowOptions)||L(A))}registerDcsHandler(x,L){return this._parser.registerDcsHandler(x,new g.DcsHandler(L))}registerEscHandler(x,L){return this._parser.registerEscHandler(x,L)}registerOscHandler(x,L){return this._parser.registerOscHandler(x,new w.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var x;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&&((x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&x.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=x,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+L)}cursorUp(x){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const L=x.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const L=x.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,L,A,M=!1,N=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);z.replaceCells(L,A,this._activeBuffer.getNullCell(this._eraseAttrData()),N),M&&(z.isWrapped=!1)}_resetBufferLine(x,L=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),A.isWrapped=!1)}eraseInDisplay(x,L=!1){let A;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);A<this._bufferService.rows;A++)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(x,L=!1){switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;L--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;L--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let L=x.params[0]||1;for(;L--;)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(x){let L=x.params[0]||1;for(;L--;)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(i.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const L=this._parser.precedingJoinState;if(!L)return!0;const A=x.params[0]||1,M=b.UnicodeService.extractWidth(L),N=this._activeBuffer.x-M,z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),Y=new Uint32Array(z.length*A);let ee=0;for(let R=0;R<z.length;){const W=z.codePointAt(R)||0;Y[ee++]=W,R+=W>65535?2:1}let P=ee;for(let R=1;R<A;++R)Y.copyWithin(P,0,ee),P+=ee;return this.print(Y,0,P),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){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(),x.params[L]===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(x,L){const A=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:N}=this._coreMouseService,z=this._coreService,{buffers:Y,cols:ee}=this._bufferService,{active:P,alt:R}=Y,W=this._optionsService.rawOptions,H=ce=>ce?1:2,Z=x.params[0];return V=Z,ie=L?Z===2?4:Z===4?H(z.modes.insertMode):Z===12?3:Z===20?H(W.convertEol):0:Z===1?H(A.applicationCursorKeys):Z===3?W.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:Z===6?H(A.origin):Z===7?H(A.wraparound):Z===8?3:Z===9?H(M==="X10"):Z===12?H(W.cursorBlink):Z===25?H(!z.isCursorHidden):Z===45?H(A.reverseWraparound):Z===66?H(A.applicationKeypad):Z===67?4:Z===1e3?H(M==="VT200"):Z===1002?H(M==="DRAG"):Z===1003?H(M==="ANY"):Z===1004?H(A.sendFocus):Z===1005?4:Z===1006?H(N==="SGR"):Z===1015?4:Z===1016?H(N==="SGR_PIXELS"):Z===1048?1:Z===47||Z===1047||Z===1049?H(P===R):Z===2004?H(A.bracketedPasteMode):0,z.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${V};${ie}$y`),!0;var V,ie}_updateAttrColor(x,L,A,M,N){return L===2?(x|=50331648,x&=-16777216,x|=u.AttributeData.fromColorRGB([A,M,N])):L===5&&(x&=-50331904,x|=33554432|255&A),x}_extractColor(x,L,A){const M=[0,0,-1,0,0,0];let N=0,z=0;do{if(M[z+N]=x.params[L+z],x.hasSubParams(L+z)){const Y=x.getSubParams(L+z);let ee=0;do M[1]===5&&(N=1),M[z+ee+1+N]=Y[ee];while(++ee<Y.length&&ee+z+1+N<M.length);break}if(M[1]===5&&z+N>=2||M[1]===2&&z+N>=5)break;M[1]&&(N=1)}while(++z+L<x.length&&z+N<M.length);for(let Y=2;Y<M.length;++Y)M[Y]===-1&&(M[Y]=0);switch(M[0]){case 38:A.fg=this._updateAttrColor(A.fg,M[1],M[3],M[4],M[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,M[1],M[3],M[4],M[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,M[1],M[3],M[4],M[5])}return z}_processUnderline(x,L){L.extended=L.extended.clone(),(!~x||x>5)&&(x=1),L.extended.underlineStyle=x,L.fg|=268435456,x===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(x){x.fg=i.DEFAULT_ATTR_DATA.fg,x.bg=i.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=x.length;let A;const M=this._curAttrData;for(let N=0;N<L;N++)A=x.params[N],A>=30&&A<=37?(M.fg&=-50331904,M.fg|=16777216|A-30):A>=40&&A<=47?(M.bg&=-50331904,M.bg|=16777216|A-40):A>=90&&A<=97?(M.fg&=-50331904,M.fg|=16777224|A-90):A>=100&&A<=107?(M.bg&=-50331904,M.bg|=16777224|A-100):A===0?this._processSGR0(M):A===1?M.fg|=134217728:A===3?M.bg|=67108864:A===4?(M.fg|=268435456,this._processUnderline(x.hasSubParams(N)?x.getSubParams(N)[0]:1,M)):A===5?M.fg|=536870912:A===7?M.fg|=67108864:A===8?M.fg|=1073741824:A===9?M.fg|=2147483648:A===2?M.bg|=134217728:A===21?this._processUnderline(2,M):A===22?(M.fg&=-134217729,M.bg&=-134217729):A===23?M.bg&=-67108865:A===24?(M.fg&=-268435457,this._processUnderline(0,M)):A===25?M.fg&=-536870913:A===27?M.fg&=-67108865:A===28?M.fg&=-1073741825:A===29?M.fg&=2147483647:A===39?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):A===49?(M.bg&=-67108864,M.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?N+=this._extractColor(x,N,M):A===53?M.bg|=1073741824:A===55?M.bg&=-1073741825:A===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):A===100?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${A}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${A}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.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(x){const L=x.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=L%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(x){const L=x.params[0]||1;let A;return(x.length<2||(A=x.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(x){if(!O(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const L=[],A=x.split(";");for(;A.length>1;){const M=A.shift(),N=A.shift();if(/^\d+$/.exec(M)){const z=parseInt(M);if(G(z))if(N==="?")L.push({type:0,index:z});else{const Y=(0,E.parseColor)(N);Y&&L.push({type:1,index:z,color:Y})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(x){const L=x.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(x,L){this._getCurrentLinkId()&&this._finishHyperlink();const A=x.split(":");let M;const N=A.findIndex(z=>z.startsWith("id="));return N!==-1&&(M=A[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(x,L){const A=x.split(";");for(let M=0;M<A.length&&!(L>=this._specialColors.length);++M,++L)if(A[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const N=(0,E.parseColor)(A[M]);N&&this._onColor.fire([{type:1,index:this._specialColors[L],color:N}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const L=[],A=x.split(";");for(let M=0;M<A.length;++M)if(/^\d+$/.exec(A[M])){const N=parseInt(A[M]);G(N)&&L.push({type:2,index:N})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,p.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(T[x[0]],p.CHARSETS[x[1]]||p.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,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=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new s.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const A=this._activeBuffer.ybase+this._activeBuffer.y+L,M=this._activeBuffer.lines.get(A);M&&(M.fill(x),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,L){const A=this._bufferService.buffer,M=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${N}${h.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,L){this._dirtyRowTracker.markRangeDirty(x,L)}}t.InputHandler=F;let $=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,x){U>x&&(I=U,U=x,x=I),U<this.start&&(this.start=U),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}$=l([_(0,S.IBufferService)],$)},844:(k,t)=>{function o(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var _;this._isDisposed||l===this._value||((_=this._value)==null||_.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=o,t.getDisposeArrayDisposable=function(l){return{dispose:()=>o(l)}}},1505:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,h,p){this._data[_]||(this._data[_]={}),this._data[_][h]=p}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}t.TwoKeyMap=o,t.FourKeyMap=class{constructor(){this._data=new o}set(l,_,h,p,m){this._data.get(l,_)||this._data.set(l,_,new o),this._data.get(l,_).set(h,p,m)}get(l,_,h,p){var m;return(m=this._data.get(l,_))==null?void 0:m.get(h,p)}clear(){this._data.clear()}}},6114:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const o=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=o.includes("Firefox"),t.isLegacyEdge=o.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(o),t.getSafariVersion=function(){if(!t.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(o)},6106:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let o=0;t.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(o=this._search(this._getKey(l)),this._array.splice(o,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===l)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===_);return!1}*getKeyIterator(l){if(this._array.length!==0&&(o=this._search(l),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===l))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===l)}forEachByKey(l,_){if(this._array.length!==0&&(o=this._search(l),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===l))do _(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===l)}values(){return[...this._array].values()}_search(l){let _=0,h=this._array.length-1;for(;h>=_;){let p=_+h>>1;const m=this._getKey(this._array[p]);if(m>l)h=p-1;else{if(!(m<l)){for(;p>0&&this._getKey(this._array[p-1])===l;)p--;return p}_=p+1}}return _}}},7226:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let C=0,f=0,i=m.timeRemaining(),n=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),f=Math.max(C,f),n=m.timeRemaining(),1.5*f>n)return i-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-C))}ms`),void this._start();i=n}this.clear()}}class h extends _{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const C=Date.now()+m;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}t.PriorityTaskQueue=h,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:h,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const l=o(643);t.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=h==null?void 0:h.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&p[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new o;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=o;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,p=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=p}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},9092:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const l=o(6349),_=o(7226),h=o(3734),p=o(8437),m=o(4634),C=o(511),f=o(643),i=o(4863),n=o(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(r,s,u){this._hasScrollback=r,this._optionsService=s,this._bufferService=u,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=n.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(r){return r?(this._nullCell.fg=r.fg,this._nullCell.bg=r.bg,this._nullCell.extended=r.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(r){return r?(this._whitespaceCell.fg=r.fg,this._whitespaceCell.bg=r.bg,this._whitespaceCell.extended=r.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(r,s){return new p.BufferLine(this._bufferService.cols,this.getNullCell(r),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const r=this.ybase+this.y-this.ydisp;return r>=0&&r<this._rows}_getCorrectBufferLength(r){if(!this._hasScrollback)return r;const s=r+this._optionsService.rawOptions.scrollback;return s>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:s}fillViewportRows(r){if(this.lines.length===0){r===void 0&&(r=p.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(r))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(r,s){const u=this.getNullCell(p.DEFAULT_ATTR_DATA);let S=0;const b=this._getCorrectBufferLength(s);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<r)for(let g=0;g<this.lines.length;g++)S+=+this.lines.get(g).resize(r,u);let w=0;if(this._rows<s)for(let g=this._rows;g<s;g++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(r,u)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(r,u)));else for(let g=this._rows;g>s;g--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const g=this.lines.length-b;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=b}this.x=Math.min(this.x,r-1),this.y=Math.min(this.y,s-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,r-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(r,s),this._cols>r))for(let w=0;w<this.lines.length;w++)S+=+this.lines.get(w).resize(r,u);this._cols=r,this._rows=s,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let r=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,r=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return r}get _isReflowEnabled(){const r=this._optionsService.rawOptions.windowsPty;return r&&r.buildNumber?this._hasScrollback&&r.backend==="conpty"&&r.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(r,s){this._cols!==r&&(r>this._cols?this._reflowLarger(r,s):this._reflowSmaller(r,s))}_reflowLarger(r,s){const u=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,r,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(u.length>0){const S=(0,m.reflowLargerCreateNewLayout)(this.lines,u);(0,m.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(r,s,S.countRemoved)}}_reflowLargerAdjustViewport(r,s,u){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=u;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new p.BufferLine(r,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-u,0)}_reflowSmaller(r,s){const u=this.getNullCell(p.DEFAULT_ATTR_DATA),S=[];let b=0;for(let w=this.lines.length-1;w>=0;w--){let g=this.lines.get(w);if(!g||!g.isWrapped&&g.getTrimmedLength()<=r)continue;const E=[g];for(;g.isWrapped&&w>0;)g=this.lines.get(--w),E.unshift(g);const T=this.ybase+this.y;if(T>=w&&T<w+E.length)continue;const B=E[E.length-1].getTrimmedLength(),O=(0,m.reflowSmallerGetNewLineLengths)(E,this._cols,r),D=O.length-E.length;let I;I=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const F=[];for(let A=0;A<D;A++){const M=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(M)}F.length>0&&(S.push({start:w+E.length+b,newLines:F}),b+=F.length),E.push(...F);let $=O.length-1,G=O[$];G===0&&($--,G=O[$]);let U=E.length-D-1,x=B;for(;U>=0;){const A=Math.min(x,G);if(E[$]===void 0)break;if(E[$].copyCellsFrom(E[U],x-A,G-A,A,!0),G-=A,G===0&&($--,G=O[$]),x-=A,x===0){U--;const M=Math.max(U,0);x=(0,m.getWrappedLineTrimmedLength)(E,M,this._cols)}}for(let A=0;A<E.length;A++)O[A]<r&&E[A].setCell(O[A],u);let L=D-I;for(;L-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+s-1)}if(S.length>0){const w=[],g=[];for(let $=0;$<this.lines.length;$++)g.push(this.lines.get($));const E=this.lines.length;let T=E-1,B=0,O=S[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let D=0;for(let $=Math.min(this.lines.maxLength-1,E+b-1);$>=0;$--)if(O&&O.start>T+D){for(let G=O.newLines.length-1;G>=0;G--)this.lines.set($--,O.newLines[G]);$++,w.push({index:T+1,amount:O.newLines.length}),D+=O.newLines.length,O=S[++B]}else this.lines.set($,g[T--]);let I=0;for(let $=w.length-1;$>=0;$--)w[$].index+=I,this.lines.onInsertEmitter.fire(w[$]),I+=w[$].amount;const F=Math.max(0,E+b-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(r,s,u=0,S){const b=this.lines.get(r);return b?b.translateToString(s,u,S):""}getWrappedRangeForLine(r){let s=r,u=r;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;u+1<this.lines.length&&this.lines.get(u+1).isWrapped;)u++;return{first:s,last:u}}setupTabStops(r){for(r!=null?this.tabs[r]||(r=this.prevStop(r)):(this.tabs={},r=0);r<this._cols;r+=this._optionsService.rawOptions.tabStopWidth)this.tabs[r]=!0}prevStop(r){for(r==null&&(r=this.x);!this.tabs[--r]&&r>0;);return r>=this._cols?this._cols-1:r<0?0:r}nextStop(r){for(r==null&&(r=this.x);!this.tabs[++r]&&r<this._cols;);return r>=this._cols?this._cols-1:r<0?0:r}clearMarkers(r){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===r&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].dispose(),this.markers.splice(r--,1);this._isClearing=!1}addMarker(r){const s=new i.Marker(r);return this.markers.push(s),s.register(this.lines.onTrim(u=>{s.line-=u,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(u=>{s.line>=u.index&&(s.line+=u.amount)})),s.register(this.lines.onDelete(u=>{s.line>=u.index&&s.line<u.index+u.amount&&s.dispose(),s.line>u.index&&(s.line-=u.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(r){this._isClearing||this.markers.splice(this.markers.indexOf(r),1)}}},8437:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const l=o(3734),_=o(511),h=o(643),p=o(482);t.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let m=0;class C{constructor(i,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const s=n||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let u=0;u<i;++u)this.setCell(u,s);this.length=i}get(i){const n=this._data[3*i+0],r=2097151&n;return[this._data[3*i+1],2097152&n?this._combined[i]:r?(0,p.stringFromCodePoint)(r):"",n>>22,2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):r]}set(i,n){this._data[3*i+1]=n[h.CHAR_DATA_ATTR_INDEX],n[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=n[1],this._data[3*i+0]=2097152|i|n[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=n[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&n}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i]:2097151&n?(0,p.stringFromCodePoint)(2097151&n):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,n){return m=3*i,n.content=this._data[m+0],n.fg=this._data[m+1],n.bg=this._data[m+2],2097152&n.content&&(n.combinedData=this._combined[i]),268435456&n.bg&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){2097152&n.content&&(this._combined[i]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[i]=n.extended),this._data[3*i+0]=n.content,this._data[3*i+1]=n.fg,this._data[3*i+2]=n.bg}setCellFromCodepoint(i,n,r,s){268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=n|r<<22,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}addCodepointToCell(i,n,r){let s=this._data[3*i+0];2097152&s?this._combined[i]+=(0,p.stringFromCodePoint)(n):2097151&s?(this._combined[i]=(0,p.stringFromCodePoint)(2097151&s)+(0,p.stringFromCodePoint)(n),s&=-2097152,s|=2097152):s=n|4194304,r&&(s&=-12582913,s|=r<<22),this._data[3*i+0]=s}insertCells(i,n,r){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length-i){const s=new _.CellData;for(let u=this.length-i-n-1;u>=0;--u)this.setCell(i+n+u,this.loadCell(i+u,s));for(let u=0;u<n;++u)this.setCell(i+u,r)}else for(let s=i;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(i,n,r){if(i%=this.length,n<this.length-i){const s=new _.CellData;for(let u=0;u<this.length-i-n;++u)this.setCell(i+u,this.loadCell(i+n+u,s));for(let u=this.length-n;u<this.length;++u)this.setCell(u,r)}else for(let s=i;s<this.length;++s)this.setCell(s,r);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),this.getWidth(i)!==0||this.hasContent(i)||this.setCellFromCodepoint(i,0,1,r)}replaceCells(i,n,r,s=!1){if(s)for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,r),i++;else for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);i<n&&i<this.length;)this.setCell(i++,r)}resize(i,n){if(i===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const r=3*i;if(i>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{const s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<i;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);const s=Object.keys(this._combined);for(let S=0;S<s.length;S++){const b=parseInt(s[S],10);b>=i&&delete this._combined[b]}const u=Object.keys(this._extendedAttrs);for(let S=0;S<u.length;S++){const b=parseInt(u[S],10);b>=i&&delete this._extendedAttrs[b]}}return this.length=i,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n)for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,i);else{this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,i)}}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(const n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(const n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){const i=new C(0);i._data=new Uint32Array(this._data),i.length=this.length;for(const n in this._combined)i._combined[n]=this._combined[n];for(const n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,n,r,s,u){const S=i._data;if(u)for(let w=s-1;w>=0;w--){for(let g=0;g<3;g++)this._data[3*(r+w)+g]=S[3*(n+w)+g];268435456&S[3*(n+w)+2]&&(this._extendedAttrs[r+w]=i._extendedAttrs[n+w])}else for(let w=0;w<s;w++){for(let g=0;g<3;g++)this._data[3*(r+w)+g]=S[3*(n+w)+g];268435456&S[3*(n+w)+2]&&(this._extendedAttrs[r+w]=i._extendedAttrs[n+w])}const b=Object.keys(i._combined);for(let w=0;w<b.length;w++){const g=parseInt(b[w],10);g>=n&&(this._combined[g-n+r]=i._combined[g])}}translateToString(i,n,r,s){n=n??0,r=r??this.length,i&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let u="";for(;n<r;){const S=this._data[3*n+0],b=2097151&S,w=2097152&S?this._combined[n]:b?(0,p.stringFromCodePoint)(b):h.WHITESPACE_CELL_CHAR;if(u+=w,s)for(let g=0;g<w.length;++g)s.push(n);n+=S>>22||1}return s&&s.push(n),u}}t.BufferLine=C},4841:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(o,l){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return l*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(k,t)=>{function o(l,_,h){if(_===l.length-1)return l[_].getTrimmedLength();const p=!l[_].hasContent(h-1)&&l[_].getWidth(h-1)===1,m=l[_+1].getWidth(0)===2;return p&&m?h-1:h}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(l,_,h,p,m){const C=[];for(let f=0;f<l.length-1;f++){let i=f,n=l.get(++i);if(!n.isWrapped)continue;const r=[l.get(f)];for(;i<l.length&&n.isWrapped;)r.push(n),n=l.get(++i);if(p>=f&&p<i){f+=r.length-1;continue}let s=0,u=o(r,s,_),S=1,b=0;for(;S<r.length;){const g=o(r,S,_),E=g-b,T=h-u,B=Math.min(E,T);r[s].copyCellsFrom(r[S],b,u,B,!1),u+=B,u===h&&(s++,u=0),b+=B,b===g&&(S++,b=0),u===0&&s!==0&&r[s-1].getWidth(h-1)===2&&(r[s].copyCellsFrom(r[s-1],h-1,u++,1,!1),r[s-1].setCell(h-1,m))}r[s].replaceCells(u,h,m);let w=0;for(let g=r.length-1;g>0&&(g>s||r[g].getTrimmedLength()===0);g--)w++;w>0&&(C.push(f+r.length-w),C.push(w)),f+=r.length-1}return C},t.reflowLargerCreateNewLayout=function(l,_){const h=[];let p=0,m=_[p],C=0;for(let f=0;f<l.length;f++)if(m===f){const i=_[++p];l.onDeleteEmitter.fire({index:f-C,amount:i}),f+=i-1,C+=i,m=_[++p]}else h.push(f);return{layout:h,countRemoved:C}},t.reflowLargerApplyNewLayout=function(l,_){const h=[];for(let p=0;p<_.length;p++)h.push(l.get(_[p]));for(let p=0;p<h.length;p++)l.set(p,h[p]);l.length=_.length},t.reflowSmallerGetNewLineLengths=function(l,_,h){const p=[],m=l.map((n,r)=>o(l,r,_)).reduce((n,r)=>n+r);let C=0,f=0,i=0;for(;i<m;){if(m-i<h){p.push(m-i);break}C+=h;const n=o(l,f,_);C>n&&(C-=n,f++);const r=l[f].getWidth(C-1)===2;r&&C--;const s=r?h-1:h;p.push(s),i+=s}return p},t.getWrappedLineTrimmedLength=o},5295:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const l=o(8460),_=o(844),h=o(9092);class p extends _.Disposable{constructor(C,f){super(),this._optionsService=C,this._bufferService=f,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,f){this._normal.resize(C,f),this._alt.resize(C,f),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}t.BufferSet=p},511:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=o(482),_=o(643),h=o(3734);class p extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const f=new p;return f.setFromCharData(C),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(C[_.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(C[_.CHAR_DATA_CHAR_INDEX].length===2){const i=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const n=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(i-55296)+n-56320+65536|C[_.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[_.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=C[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=p},643:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const l=o(8460),_=o(844);class h{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}t.Marker=h,h._nextId=1},7116:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(k,t)=>{var o,l,_;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
8
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(o||(t.C0=o={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(l||(t.C1=l={})),function(h){h.ST=`${o.ESC}\\`}(_||(t.C1_ESCAPED=_={}))},7399:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const l=o(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(h,p,m,C){const f={type:0,cancel:!1,key:void 0},i=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?f.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?f.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?f.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(f.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:f.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(f.key=l.C0.ESC+f.key);break;case 9:if(h.shiftKey){f.key=l.C0.ESC+"[Z";break}f.key=l.C0.HT,f.cancel=!0;break;case 13:f.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,f.cancel=!0;break;case 27:f.key=l.C0.ESC,h.altKey&&(f.key=l.C0.ESC+l.C0.ESC),f.cancel=!0;break;case 37:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"D",f.key===l.C0.ESC+"[1;3D"&&(f.key=l.C0.ESC+(m?"b":"[1;5D"))):f.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"C",f.key===l.C0.ESC+"[1;3C"&&(f.key=l.C0.ESC+(m?"f":"[1;5C"))):f.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"A",m||f.key!==l.C0.ESC+"[1;3A"||(f.key=l.C0.ESC+"[1;5A")):f.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"B",m||f.key!==l.C0.ESC+"[1;3B"||(f.key=l.C0.ESC+"[1;5B")):f.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(f.key=l.C0.ESC+"[2~");break;case 46:f.key=i?l.C0.ESC+"[3;"+(i+1)+"~":l.C0.ESC+"[3~";break;case 36:f.key=i?l.C0.ESC+"[1;"+(i+1)+"H":p?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:f.key=i?l.C0.ESC+"[1;"+(i+1)+"F":p?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?f.type=2:h.ctrlKey?f.key=l.C0.ESC+"[5;"+(i+1)+"~":f.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?f.type=3:h.ctrlKey?f.key=l.C0.ESC+"[6;"+(i+1)+"~":f.key=l.C0.ESC+"[6~";break;case 112:f.key=i?l.C0.ESC+"[1;"+(i+1)+"P":l.C0.ESC+"OP";break;case 113:f.key=i?l.C0.ESC+"[1;"+(i+1)+"Q":l.C0.ESC+"OQ";break;case 114:f.key=i?l.C0.ESC+"[1;"+(i+1)+"R":l.C0.ESC+"OR";break;case 115:f.key=i?l.C0.ESC+"[1;"+(i+1)+"S":l.C0.ESC+"OS";break;case 116:f.key=i?l.C0.ESC+"[15;"+(i+1)+"~":l.C0.ESC+"[15~";break;case 117:f.key=i?l.C0.ESC+"[17;"+(i+1)+"~":l.C0.ESC+"[17~";break;case 118:f.key=i?l.C0.ESC+"[18;"+(i+1)+"~":l.C0.ESC+"[18~";break;case 119:f.key=i?l.C0.ESC+"[19;"+(i+1)+"~":l.C0.ESC+"[19~";break;case 120:f.key=i?l.C0.ESC+"[20;"+(i+1)+"~":l.C0.ESC+"[20~";break;case 121:f.key=i?l.C0.ESC+"[21;"+(i+1)+"~":l.C0.ESC+"[21~";break;case 122:f.key=i?l.C0.ESC+"[23;"+(i+1)+"~":l.C0.ESC+"[23~";break;case 123:f.key=i?l.C0.ESC+"[24;"+(i+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(m&&!C||!h.altKey||h.metaKey)!m||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?f.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(f.key=l.C0.US),h.key==="@"&&(f.key=l.C0.NUL)):h.keyCode===65&&(f.type=1);else{const n=_[h.keyCode],r=n==null?void 0:n[h.shiftKey?1:0];if(r)f.key=l.C0.ESC+r;else if(h.keyCode>=65&&h.keyCode<=90){const s=h.ctrlKey?h.keyCode-64:h.keyCode+32;let u=String.fromCharCode(s);h.shiftKey&&(u=u.toUpperCase()),f.key=l.C0.ESC+u}else if(h.keyCode===32)f.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let s=h.code.slice(3,4);h.shiftKey||(s=s.toLowerCase()),f.key=l.C0.ESC+s,f.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?f.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?f.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?f.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?f.key=l.C0.DEL:h.keyCode===219?f.key=l.C0.ESC:h.keyCode===220?f.key=l.C0.FS:h.keyCode===221&&(f.key=l.C0.GS)}return f}},482:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},t.utf32ToString=function(o,l=0,_=o.length){let h="";for(let p=l;p<_;++p){let m=o[p];m>65535?(m-=65536,h+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):h+=String.fromCharCode(m)}return h},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,l){const _=o.length;if(!_)return 0;let h=0,p=0;if(this._interim){const m=o.charCodeAt(p++);56320<=m&&m<=57343?l[h++]=1024*(this._interim-55296)+m-56320+65536:(l[h++]=this._interim,l[h++]=m),this._interim=0}for(let m=p;m<_;++m){const C=o.charCodeAt(m);if(55296<=C&&C<=56319){if(++m>=_)return this._interim=C,h;const f=o.charCodeAt(m);56320<=f&&f<=57343?l[h++]=1024*(C-55296)+f-56320+65536:(l[h++]=C,l[h++]=f)}else C!==65279&&(l[h++]=C)}return h}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,l){const _=o.length;if(!_)return 0;let h,p,m,C,f=0,i=0,n=0;if(this.interim[0]){let u=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let b,w=0;for(;(b=63&this.interim[++w])&&w<4;)S<<=6,S|=b;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=g-w;for(;n<E;){if(n>=_)return 0;if(b=o[n++],(192&b)!=128){n--,u=!0;break}this.interim[w++]=b,S<<=6,S|=63&b}u||(g===2?S<128?n--:l[f++]=S:g===3?S<2048||S>=55296&&S<=57343||S===65279||(l[f++]=S):S<65536||S>1114111||(l[f++]=S)),this.interim.fill(0)}const r=_-4;let s=n;for(;s<_;){for(;!(!(s<r)||128&(h=o[s])||128&(p=o[s+1])||128&(m=o[s+2])||128&(C=o[s+3]));)l[f++]=h,l[f++]=p,l[f++]=m,l[f++]=C,s+=4;if(h=o[s++],h<128)l[f++]=h;else if((224&h)==192){if(s>=_)return this.interim[0]=h,f;if(p=o[s++],(192&p)!=128){s--;continue}if(i=(31&h)<<6|63&p,i<128){s--;continue}l[f++]=i}else if((240&h)==224){if(s>=_)return this.interim[0]=h,f;if(p=o[s++],(192&p)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,f;if(m=o[s++],(192&m)!=128){s--;continue}if(i=(15&h)<<12|(63&p)<<6|63&m,i<2048||i>=55296&&i<=57343||i===65279)continue;l[f++]=i}else if((248&h)==240){if(s>=_)return this.interim[0]=h,f;if(p=o[s++],(192&p)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,f;if(m=o[s++],(192&m)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=m,f;if(C=o[s++],(192&C)!=128){s--;continue}if(i=(7&h)<<18|(63&p)<<12|(63&m)<<6|63&C,i<65536||i>1114111)continue;l[f++]=i}}return f}}},225:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const l=o(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;t.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:function(C,f){let i,n=0,r=f.length-1;if(C<f[0][0]||C>f[r][1])return!1;for(;r>=n;)if(i=n+r>>1,C>f[i][1])n=i+1;else{if(!(C<f[i][0]))return!0;r=i-1}return!1}(m,h)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,C){let f=this.wcwidth(m),i=f===0&&C!==0;if(i){const n=l.UnicodeService.extractWidth(C);n===0?i=!1:n>f&&(f=n)}return l.UnicodeService.createPropertyValue(0,f,i)}}},5981:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const l=o(8460),_=o(844);class h extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(C),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(C)}_innerWrite(m=0,C=!0){const f=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],n=this._action(i,C);if(n){const s=u=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(f,u);return void n.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(s)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=i.length,Date.now()-f>=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()}}t.WriteBuffer=h},5941:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const o=/^([\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})$/,l=/^[\da-f]+$/;function _(h,p){const m=h.toString(16),C=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}t.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=o.exec(p);if(m){const C=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/C*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/C*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/C*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),l.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,C=[0,0,0];for(let f=0;f<3;++f){const i=parseInt(p.slice(m*f,m*f+m),16);C[f]=m===1?i<<4:m===2?i:m===3?i>>4:i>>8}return C}},t.toRgbString=function(h,p=16){const[m,C,f]=h;return`rgb:${_(m,p)}/${_(C,p)}/${_(f,p)}`}},5770:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const l=o(482),_=o(8742),h=o(5770),p=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(C,f){this._handlers[C]===void 0&&(this._handlers[C]=[]);const i=this._handlers[C];return i.push(f),{dispose:()=>{const n=i.indexOf(f);n!==-1&&i.splice(n,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(C,f){if(this.reset(),this._ident=C,this._active=this._handlers[C]||p,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(C,f,i){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(C,f,i);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(C,f,i))}unhook(C,f=!0){if(this._active.length){let i=!1,n=this._active.length-1,r=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=f,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;n>=0&&(i=this._active[n].unhook(C),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",C);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),t.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=m,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():m,this._data="",this._hitLimit=!1}put(C,f,i){this._hitLimit||(this._data+=(0,l.utf32ToString)(C,f,i),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let f=!1;if(this._hitLimit)f=!1;else if(C&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(i=>(this._params=m,this._data="",this._hitLimit=!1,i));return this._params=m,this._data="",this._hitLimit=!1,f}}},2015:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const l=o(844),_=o(8742),h=o(6242),p=o(6351);class m{constructor(n){this.table=new Uint8Array(n)}setDefault(n,r){this.table.fill(n<<4|r)}add(n,r,s,u){this.table[r<<8|n]=s<<4|u}addMany(n,r,s,u){for(let S=0;S<n.length;S++)this.table[r<<8|n[S]]=s<<4|u}}t.TransitionTable=m;const C=160;t.VT500_TRANSITION_TABLE=function(){const i=new m(4095),n=Array.apply(null,Array(256)).map((w,g)=>g),r=(w,g)=>n.slice(w,g),s=r(32,127),u=r(0,24);u.push(25),u.push.apply(u,r(28,32));const S=r(0,14);let b;for(b in i.setDefault(1,0),i.addMany(s,0,2,0),S)i.addMany([24,26,153,154],b,3,0),i.addMany(r(128,144),b,3,0),i.addMany(r(144,152),b,3,0),i.add(156,b,0,0),i.add(27,b,11,1),i.add(157,b,4,8),i.addMany([152,158,159],b,0,7),i.add(155,b,11,3),i.add(144,b,11,9);return i.addMany(u,0,3,0),i.addMany(u,1,3,1),i.add(127,1,0,1),i.addMany(u,8,0,8),i.addMany(u,3,3,3),i.add(127,3,0,3),i.addMany(u,4,3,4),i.add(127,4,0,4),i.addMany(u,6,3,6),i.addMany(u,5,3,5),i.add(127,5,0,5),i.addMany(u,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(s,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(r(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(s,7,0,7),i.addMany(u,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(r(64,127),3,7,0),i.addMany(r(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(r(48,60),4,8,4),i.addMany(r(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(r(32,64),6,0,6),i.add(127,6,0,6),i.addMany(r(64,127),6,0,0),i.addMany(r(32,48),3,9,5),i.addMany(r(32,48),5,9,5),i.addMany(r(48,64),5,0,6),i.addMany(r(64,127),5,7,0),i.addMany(r(32,48),4,9,5),i.addMany(r(32,48),1,9,2),i.addMany(r(32,48),2,9,2),i.addMany(r(48,127),2,10,0),i.addMany(r(48,80),1,10,0),i.addMany(r(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(r(96,127),1,10,0),i.add(80,1,11,9),i.addMany(u,9,0,9),i.add(127,9,0,9),i.addMany(r(28,32),9,0,9),i.addMany(r(32,48),9,9,12),i.addMany(r(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(u,11,0,11),i.addMany(r(32,128),11,0,11),i.addMany(r(28,32),11,0,11),i.addMany(u,10,0,10),i.add(127,10,0,10),i.addMany(r(28,32),10,0,10),i.addMany(r(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(r(32,48),10,9,12),i.addMany(u,12,0,12),i.add(127,12,0,12),i.addMany(r(28,32),12,0,12),i.addMany(r(32,48),12,9,12),i.addMany(r(48,64),12,0,11),i.addMany(r(64,127),12,12,13),i.addMany(r(64,127),10,12,13),i.addMany(r(64,127),9,12,13),i.addMany(u,13,13,13),i.addMany(s,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(C,0,2,0),i.add(C,8,5,8),i.add(C,6,0,6),i.add(C,11,0,11),i.add(C,13,13,13),i}();class f extends l.Disposable{constructor(n=t.VT500_TRANSITION_TABLE){super(),this._transitions=n,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,s,u)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,s)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(n,r=[64,126]){let s=0;if(n.prefix){if(n.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=n.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(n.intermediates){if(n.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<n.intermediates.length;++S){const b=n.intermediates.charCodeAt(S);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=b}}if(n.final.length!==1)throw new Error("final must be a single byte");const u=n.final.charCodeAt(0);if(r[0]>u||u>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return s<<=8,s|=u,s}identToString(n){const r=[];for(;n;)r.push(String.fromCharCode(255&n)),n>>=8;return r.reverse().join("")}setPrintHandler(n){this._printHandler=n}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(n,r){const s=this._identifier(n,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const u=this._escHandlers[s];return u.push(r),{dispose:()=>{const S=u.indexOf(r);S!==-1&&u.splice(S,1)}}}clearEscHandler(n){this._escHandlers[this._identifier(n,[48,126])]&&delete this._escHandlers[this._identifier(n,[48,126])]}setEscHandlerFallback(n){this._escHandlerFb=n}setExecuteHandler(n,r){this._executeHandlers[n.charCodeAt(0)]=r}clearExecuteHandler(n){this._executeHandlers[n.charCodeAt(0)]&&delete this._executeHandlers[n.charCodeAt(0)]}setExecuteHandlerFallback(n){this._executeHandlerFb=n}registerCsiHandler(n,r){const s=this._identifier(n);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const u=this._csiHandlers[s];return u.push(r),{dispose:()=>{const S=u.indexOf(r);S!==-1&&u.splice(S,1)}}}clearCsiHandler(n){this._csiHandlers[this._identifier(n)]&&delete this._csiHandlers[this._identifier(n)]}setCsiHandlerFallback(n){this._csiHandlerFb=n}registerDcsHandler(n,r){return this._dcsParser.registerHandler(this._identifier(n),r)}clearDcsHandler(n){this._dcsParser.clearHandler(this._identifier(n))}setDcsHandlerFallback(n){this._dcsParser.setHandlerFallback(n)}registerOscHandler(n,r){return this._oscParser.registerHandler(n,r)}clearOscHandler(n){this._oscParser.clearHandler(n)}setOscHandlerFallback(n){this._oscParser.setHandlerFallback(n)}setErrorHandler(n){this._errorHandler=n}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(n,r,s,u,S){this._parseStack.state=n,this._parseStack.handlers=r,this._parseStack.handlerPos=s,this._parseStack.transition=u,this._parseStack.chunkPos=S}parse(n,r,s){let u,S=0,b=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&E>-1){for(;E>=0&&(u=g[E](this._params),u!==!0);E--)if(u instanceof Promise)return this._parseStack.handlerPos=E,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&E>-1){for(;E>=0&&(u=g[E](),u!==!0);E--)if(u instanceof Promise)return this._parseStack.handlerPos=E,u}this._parseStack.handlers=[];break;case 6:if(S=n[this._parseStack.chunkPos],u=this._dcsParser.unhook(S!==24&&S!==26,s),u)return u;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=n[this._parseStack.chunkPos],u=this._oscParser.end(S!==24&&S!==26,s),u)return u;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=w;g<r;++g){switch(S=n[g],b=this._transitions.table[this.currentState<<8|(S<160?S:C)],b>>4){case 2:for(let D=g+1;;++D){if(D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-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 E=this._csiHandlers[this._collect<<8|S];let T=E?E.length-1:-1;for(;T>=0&&(u=E[T](this._params),u!==!0);T--)if(u instanceof Promise)return this._preserveStack(3,E,T,b,g),u;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<r&&(S=n[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 O=B?B.length-1:-1;for(;O>=0&&(u=B[O](),u!==!0);O--)if(u instanceof Promise)return this._preserveStack(4,B,O,b,g),u;O<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 D=g+1;;++D)if(D>=r||(S=n[D])===24||S===26||S===27||S>127&&S<C){this._dcsParser.put(n,g,D),g=D-1;break}break;case 14:if(u=this._dcsParser.unhook(S!==24&&S!==26),u)return this._preserveStack(6,[],0,b,g),u;S===27&&(b|=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 D=g+1;;D++)if(D>=r||(S=n[D])<32||S>127&&S<C){this._oscParser.put(n,g,D),g=D-1;break}break;case 6:if(u=this._oscParser.end(S!==24&&S!==26),u)return this._preserveStack(5,[],0,b,g),u;S===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}t.EscapeSequenceParser=f},6242:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const l=o(5770),_=o(482),h=[];t.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const C=this._handlers[p];return C.push(m),{dispose:()=>{const f=C.indexOf(m);f!==-1&&C.splice(f,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,C){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(p,m,C);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,C))}start(){this.reset(),this._state=1}put(p,m,C){if(this._state!==3){if(this._state===1)for(;m<C;){const f=p[m++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&C-m>0&&this._put(p,m,C)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,f=this._active.length-1,i=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,C=m,i=this._stack.fallThrough,this._stack.paused=!1),!i&&C===!1){for(;f>=0&&(C=this._active[f].end(p),C!==!0);f--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,C;f--}for(;f>=0;f--)if(C=this._active[f].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,C){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,C),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then(C=>(this._data="",this._hitLimit=!1,C));return this._data="",this._hitLimit=!1,m}}},8742:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const o=2147483647;class l{static fromArray(h){const p=new l;if(!h.length)return p;for(let m=Array.isArray(h[0])?1:0;m<h.length;++m){const C=h[m];if(Array.isArray(C))for(let f=0;f<C.length;++f)p.addSubParam(C[f]);else p.addParam(C)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const m=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];C-m>0&&h.push(Array.prototype.slice.call(this._subParams,m,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>o?o:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>o?o:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,m=255&this._subParamsIdx[h];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const m=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];C-m>0&&(h[p]=this._subParams.slice(m,C))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,C=m[p-1];m[p-1]=~C?Math.min(10*C+h,o):h}}t.Params=l},5741:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let l=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===o){l=_;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(l,1)}}},8771:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const l=o(3785),_=o(511);t.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const p=this._buffer.lines.get(h);if(p)return new l.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const l=o(511);t.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new l.CellData)}translateToString(_,h,p){return this._line.translateToString(_,h,p)}}},8285:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const l=o(8771),_=o(8460),h=o(844);class p extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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)}}t.BufferNamespaceApi=p},7975:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,l){return this._core.registerCsiHandler(o,_=>l(_.toArray()))}addCsiHandler(o,l){return this.registerCsiHandler(o,l)}registerDcsHandler(o,l){return this._core.registerDcsHandler(o,(_,h)=>l(_,h.toArray()))}addDcsHandler(o,l){return this.registerDcsHandler(o,l)}registerEscHandler(o,l){return this._core.registerEscHandler(o,l)}addEscHandler(o,l){return this.registerEscHandler(o,l)}registerOscHandler(o,l){return this._core.registerOscHandler(o,l)}addOscHandler(o,l){return this.registerOscHandler(o,l)}}},7090:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(k,t,o){var l=this&&this.__decorate||function(i,n,r,s){var u,S=arguments.length,b=S<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(i,n,r,s);else for(var w=i.length-1;w>=0;w--)(u=i[w])&&(b=(S<3?u(b):S>3?u(n,r,b):u(n,r))||b);return S>3&&b&&Object.defineProperty(n,r,b),b},_=this&&this.__param||function(i,n){return function(r,s){n(r,s,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const h=o(8460),p=o(844),m=o(5295),C=o(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let f=t.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(i,this))}resize(i,n){this.cols=i,this.rows=n,this.buffers.resize(i,n),this._onResize.fire({cols:i,rows:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,n=!1){const r=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===i.fg&&s.getBg(0)===i.bg||(s=r.getBlankLine(i,n),this._cachedBlankLine=s),s.isWrapped=n;const u=r.ybase+r.scrollTop,S=r.ybase+r.scrollBottom;if(r.scrollTop===0){const b=r.lines.isFull;S===r.lines.length-1?b?r.lines.recycle().copyFrom(s):r.lines.push(s.clone()):r.lines.splice(S+1,0,s.clone()),b?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{const b=S-u+1;r.lines.shiftElements(u+1,b-1,-1),r.lines.set(S,s.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(i,n,r){const s=this.buffer;if(i<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else i+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const u=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+i,s.ybase),0),u!==s.ydisp&&(n||this._onScroll.fire(s.ydisp))}};t.BufferService=f=l([_(0,C.IOptionsService)],f)},7994:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,l){this._charsets[o]=l,this.glevel===o&&(this.charset=l)}}},1753:function(k,t,o){var l=this&&this.__decorate||function(s,u,S,b){var w,g=arguments.length,E=g<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,u,S,b);else for(var T=s.length-1;T>=0;T--)(w=s[T])&&(E=(g<3?w(E):g>3?w(u,S,E):w(u,S))||E);return g>3&&E&&Object.defineProperty(u,S,E),E},_=this&&this.__param||function(s,u){return function(S,b){u(S,b,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const h=o(2585),p=o(8460),m=o(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function f(s,u){let S=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(S|=64,S|=s.action):(S|=3&s.button,4&s.button&&(S|=64),8&s.button&&(S|=128),s.action===32?S|=32:s.action!==0||u||(S|=3)),S}const i=String.fromCharCode,n={DEFAULT:s=>{const u=[f(s,!1)+32,s.col+32,s.row+32];return u[0]>255||u[1]>255||u[2]>255?"":`\x1B[M${i(u[0])}${i(u[1])}${i(u[2])}`},SGR:s=>{const u=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.col};${s.row}${u}`},SGR_PIXELS:s=>{const u=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.x};${s.y}${u}`}};let r=t.CoreMouseService=class extends m.Disposable{constructor(s,u){super(),this._bufferService=s,this._coreService=u,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(C))this.addProtocol(S,C[S]);for(const S of Object.keys(n))this.addEncoding(S,n[S]);this.reset()}addProtocol(s,u){this._protocols[s]=u}addEncoding(s,u){this._encodings[s]=u}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const u=this._encodings[this._activeEncoding](s);return u&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(u):this._coreService.triggerDataEvent(u,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,u,S){if(S){if(s.x!==u.x||s.y!==u.y)return!1}else if(s.col!==u.col||s.row!==u.row)return!1;return s.button===u.button&&s.action===u.action&&s.ctrl===u.ctrl&&s.alt===u.alt&&s.shift===u.shift}};t.CoreMouseService=r=l([_(0,h.IBufferService),_(1,h.ICoreService)],r)},6975:function(k,t,o){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const h=o(1439),p=o(8460),m=o(844),C=o(2585),f=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let n=t.CoreService=class extends m.Disposable{constructor(r,s,u){super(),this._bufferService=r,this._logService=s,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(i)}reset(){this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(i)}triggerDataEvent(r,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const u=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${r}"`,()=>r.split("").map(S=>S.charCodeAt(0))),this._onData.fire(r)}triggerBinaryEvent(r){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${r}"`,()=>r.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(r))}};t.CoreService=n=l([_(0,C.IBufferService),_(1,C.ILogService),_(2,C.IOptionsService)],n)},9074:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const l=o(8055),_=o(8460),h=o(844),p=o(6106);let m=0,C=0;class f extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(r=>r==null?void 0:r.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(r){if(r.marker.isDisposed)return;const s=new i(r);if(s){const u=s.marker.onDispose(()=>s.dispose());s.onDispose(()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),u.dispose())}),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const r of this._decorations.values())r.dispose();this._decorations.clear()}*getDecorationsAtCell(r,s,u){let S=0,b=0;for(const w of this._decorations.getKeyIterator(s))S=w.options.x??0,b=S+(w.options.width??1),r>=S&&r<b&&(!u||(w.options.layer??"bottom")===u)&&(yield w)}forEachDecorationAtCell(r,s,u,S){this._decorations.forEachByKey(s,b=>{m=b.options.x??0,C=m+(b.options.width??1),r>=m&&r<C&&(!u||(b.options.layer??"bottom")===u)&&S(b)})}}t.DecorationService=f;class i extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(r){super(),this.options=r,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=r.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const l=o(2585),_=o(8343);class h{constructor(...m){this._entries=new Map;for(const[C,f]of m)this.set(C,f)}set(m,C){const f=this._entries.get(m);return this._entries.set(m,C),f}forEach(m){for(const[C,f]of this._entries.entries())m(C,f)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}t.ServiceCollection=h,t.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const C=(0,_.getServiceDependencies)(p).sort((n,r)=>n.index-r.index),f=[];for(const n of C){const r=this._services.get(n.id);if(!r)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${n.id}.`);f.push(r)}const i=C.length>0?C[0].index:m.length;if(m.length!==i)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${i+1} conflicts with ${m.length} static arguments`);return new p(...m,...f)}}},7866:function(k,t,o){var l=this&&this.__decorate||function(i,n,r,s){var u,S=arguments.length,b=S<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(i,n,r,s);else for(var w=i.length-1;w>=0;w--)(u=i[w])&&(b=(S<3?u(b):S>3?u(n,r,b):u(n,r))||b);return S>3&&b&&Object.defineProperty(n,r,b),b},_=this&&this.__param||function(i,n){return function(r,s){n(r,s,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const h=o(844),p=o(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let C,f=t.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),C=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let n=0;n<i.length;n++)typeof i[n]=="function"&&(i[n]=i[n]())}_log(i,n,r){this._evalLazyOptionalParams(r),i.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+n,...r)}trace(i,...n){var r;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,i,n)}debug(i,...n){var r;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,i,n)}info(i,...n){var r;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,i,n)}warn(i,...n){var r;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,i,n)}error(i,...n){var r;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,i,n)}};t.LogService=f=l([_(0,p.IOptionsService)],f),t.setTraceLogger=function(i){C=i},t.traceCall=function(i,n,r){if(typeof r.value!="function")throw new Error("not supported");const s=r.value;r.value=function(...u){if(C.logLevel!==p.LogLevelEnum.TRACE)return s.apply(this,u);C.trace(`GlyphRenderer#${s.name}(${u.map(b=>JSON.stringify(b)).join(", ")})`);const S=s.apply(this,u);return C.trace(`GlyphRenderer#${s.name} return`,S),S}}},7302:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const l=o(8460),_=o(844),h=o(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(f){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...t.DEFAULT_OPTIONS};for(const n in f)if(n in i)try{const r=f[n];i[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(f,i){return this.onOptionChange(n=>{n===f&&i(this.rawOptions[f])})}onMultipleOptionChange(f,i){return this.onOptionChange(n=>{f.indexOf(n)!==-1&&i()})}_setupOptions(){const f=n=>{if(!(n in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,r)=>{if(!(n in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(const n in this.rawOptions){const r={get:f.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(f,i){switch(f){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[f]),!function(n){return n==="block"||n==="underline"||n==="bar"}(i))throw new Error(`"${i}" is not a valid value for ${f}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=p.includes(i)?i:t.DEFAULT_OPTIONS[f];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${f} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${f} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}t.OptionsService=m},2660:function(k,t,o){var l=this&&this.__decorate||function(m,C,f,i){var n,r=arguments.length,s=r<3?C:i===null?i=Object.getOwnPropertyDescriptor(C,f):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(m,C,f,i);else for(var u=m.length-1;u>=0;u--)(n=m[u])&&(s=(r<3?n(s):r>3?n(C,f,s):n(C,f))||s);return r>3&&s&&Object.defineProperty(C,f,s),s},_=this&&this.__param||function(m,C){return function(f,i){C(f,i,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const h=o(2585);let p=t.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const C=this._bufferService.buffer;if(m.id===void 0){const u=C.addMarker(C.ybase+C.y),S={data:m,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(S,u)),this._dataByLinkId.set(S.id,S),S.id}const f=m,i=this._getEntryIdKey(f),n=this._entriesWithId.get(i);if(n)return this.addLineToLink(n.id,C.ybase+C.y),n.id;const r=C.addMarker(C.ybase+C.y),s={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(s,r)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(m,C){const f=this._dataByLinkId.get(m);if(f&&f.lines.every(i=>i.line!==C)){const i=this._bufferService.buffer.addMarker(C);f.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(f,i))}}getLinkData(m){var C;return(C=this._dataByLinkId.get(m))==null?void 0:C.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,C){const f=m.lines.indexOf(C);f!==-1&&(m.lines.splice(f,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};t.OscLinkService=p=l([_(0,h.IBufferService)],p)},8343:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const o="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(_){return _[l]||[]},t.createDecorator=function(_){if(t.serviceRegistry.has(_))return t.serviceRegistry.get(_);const h=function(p,m,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,i,n){i[o]===i?i[l].push({id:f,index:n}):(i[l]=[{id:f,index:n}],i[o]=i)})(h,p,C)};return h.toString=()=>_,t.serviceRegistry.set(_,h),h}},2585:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=o(8343);var _;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(_||(t.LogLevelEnum=_={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(k,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const l=o(8460),_=o(225);class h{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,C,f=!1){return(16777215&m)<<3|(3&C)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let C=0,f=0;const i=m.length;for(let n=0;n<i;++n){let r=m.charCodeAt(n);if(55296<=r&&r<=56319){if(++n>=i)return C+this.wcwidth(r);const S=m.charCodeAt(n);56320<=S&&S<=57343?r=1024*(r-55296)+S-56320+65536:C+=this.wcwidth(S)}const s=this.charProperties(r,f);let u=h.extractWidth(s);h.extractShouldJoin(s)&&(u-=h.extractWidth(f)),C+=u,f=s}return C}charProperties(m,C){return this._activeProvider.charProperties(m,C)}}t.UnicodeService=h}},d={};function v(k){var t=d[k];if(t!==void 0)return t.exports;var o=d[k]={exports:{}};return a[k].call(o.exports,o,o.exports,v),o.exports}var y={};return(()=>{var k=y;Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;const t=v(9042),o=v(3236),l=v(844),_=v(5741),h=v(8285),p=v(7975),m=v(7090),C=["cols","rows"];class f extends l.Disposable{constructor(n){super(),this._core=this.register(new o.Terminal(n)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const r=u=>this._core.options[u],s=(u,S)=>{this._checkReadonlyOptions(u),this._core.options[u]=S};for(const u in this._core.options){const S={get:r.bind(this,u),set:s.bind(this,u)};Object.defineProperty(this._publicOptions,u,S)}}_checkReadonlyOptions(n){if(C.includes(n))throw new Error(`Option "${n}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const n=this._core.coreService.decPrivateModes;let r="none";switch(this._core.coreMouseService.activeProtocol){case"X10":r="x10";break;case"VT200":r="vt200";break;case"DRAG":r="drag";break;case"ANY":r="any"}return{applicationCursorKeysMode:n.applicationCursorKeys,applicationKeypadMode:n.applicationKeypad,bracketedPasteMode:n.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:r,originMode:n.origin,reverseWraparoundMode:n.reverseWraparound,sendFocusMode:n.sendFocus,wraparoundMode:n.wraparound}}get options(){return this._publicOptions}set options(n){for(const r in n)this._publicOptions[r]=n[r]}blur(){this._core.blur()}focus(){this._core.focus()}input(n,r=!0){this._core.input(n,r)}resize(n,r){this._verifyIntegers(n,r),this._core.resize(n,r)}open(n){this._core.open(n)}attachCustomKeyEventHandler(n){this._core.attachCustomKeyEventHandler(n)}attachCustomWheelEventHandler(n){this._core.attachCustomWheelEventHandler(n)}registerLinkProvider(n){return this._core.registerLinkProvider(n)}registerCharacterJoiner(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)}deregisterCharacterJoiner(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)}registerMarker(n=0){return this._verifyIntegers(n),this._core.registerMarker(n)}registerDecoration(n){return this._checkProposedApi(),this._verifyPositiveIntegers(n.x??0,n.width??0,n.height??0),this._core.registerDecoration(n)}hasSelection(){return this._core.hasSelection()}select(n,r,s){this._verifyIntegers(n,r,s),this._core.select(n,r,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(n,r){this._verifyIntegers(n,r),this._core.selectLines(n,r)}dispose(){super.dispose()}scrollLines(n){this._verifyIntegers(n),this._core.scrollLines(n)}scrollPages(n){this._verifyIntegers(n),this._core.scrollPages(n)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(n){this._verifyIntegers(n),this._core.scrollToLine(n)}clear(){this._core.clear()}write(n,r){this._core.write(n,r)}writeln(n,r){this._core.write(n),this._core.write(`\r
9
- `,r)}paste(n){this._core.paste(n)}refresh(n,r){this._verifyIntegers(n,r),this._core.refresh(n,r)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(n){this._addonManager.loadAddon(this,n)}static get strings(){return t}_verifyIntegers(...n){for(const r of n)if(r===1/0||isNaN(r)||r%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...n){for(const r of n)if(r&&(r===1/0||isNaN(r)||r%1!=0||r<0))throw new Error("This API only accepts positive integers")}}k.Terminal=f})(),y})())}(Ht)),Ht.exports}var zs=Us(),ne;(function(c){c.assertEqual=v=>v;function e(v){}c.assertIs=e;function a(v){throw new Error}c.assertNever=a,c.arrayToEnum=v=>{const y={};for(const k of v)y[k]=k;return y},c.getValidEnumValues=v=>{const y=c.objectKeys(v).filter(t=>typeof v[v[t]]!="number"),k={};for(const t of y)k[t]=v[t];return c.objectValues(k)},c.objectValues=v=>c.objectKeys(v).map(function(y){return v[y]}),c.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const y=[];for(const k in v)Object.prototype.hasOwnProperty.call(v,k)&&y.push(k);return y},c.find=(v,y)=>{for(const k of v)if(y(k))return k},c.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function d(v,y=" | "){return v.map(k=>typeof k=="string"?`'${k}'`:k).join(y)}c.joinValues=d,c.jsonStringifyReplacer=(v,y)=>typeof y=="bigint"?y.toString():y})(ne||(ne={}));var Nt;(function(c){c.mergeShapes=(e,a)=>({...e,...a})})(Nt||(Nt={}));const K=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ke=c=>{switch(typeof c){case"undefined":return K.undefined;case"string":return K.string;case"number":return isNaN(c)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(c)?K.array:c===null?K.null:c.then&&typeof c.then=="function"&&c.catch&&typeof c.catch=="function"?K.promise:typeof Map<"u"&&c instanceof Map?K.map:typeof Set<"u"&&c instanceof Set?K.set:typeof Date<"u"&&c instanceof Date?K.date:K.object;default:return K.unknown}},j=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qs=c=>JSON.stringify(c,null,2).replace(/"([^"]+)":/g,"$1:");class fe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(y){return y.message},d={_errors:[]},v=y=>{for(const k of y.issues)if(k.code==="invalid_union")k.unionErrors.map(v);else if(k.code==="invalid_return_type")v(k.returnTypeError);else if(k.code==="invalid_arguments")v(k.argumentsError);else if(k.path.length===0)d._errors.push(a(k));else{let t=d,o=0;for(;o<k.path.length;){const l=k.path[o];o===k.path.length-1?(t[l]=t[l]||{_errors:[]},t[l]._errors.push(a(k))):t[l]=t[l]||{_errors:[]},t=t[l],o++}}};return v(this),d}static assert(e){if(!(e instanceof fe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a={},d=[];for(const v of this.issues)v.path.length>0?(a[v.path[0]]=a[v.path[0]]||[],a[v.path[0]].push(e(v))):d.push(e(v));return{formErrors:d,fieldErrors:a}}get formErrors(){return this.flatten()}}fe.create=c=>new fe(c);const $e=(c,e)=>{let a;switch(c.code){case j.invalid_type:c.received===K.undefined?a="Required":a=`Expected ${c.expected}, received ${c.received}`;break;case j.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(c.expected,ne.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:a=`Unrecognized key(s) in object: ${ne.joinValues(c.keys,", ")}`;break;case j.invalid_union:a="Invalid input";break;case j.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${ne.joinValues(c.options)}`;break;case j.invalid_enum_value:a=`Invalid enum value. Expected ${ne.joinValues(c.options)}, received '${c.received}'`;break;case j.invalid_arguments:a="Invalid function arguments";break;case j.invalid_return_type:a="Invalid function return type";break;case j.invalid_date:a="Invalid date";break;case j.invalid_string:typeof c.validation=="object"?"includes"in c.validation?(a=`Invalid input: must include "${c.validation.includes}"`,typeof c.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${c.validation.position}`)):"startsWith"in c.validation?a=`Invalid input: must start with "${c.validation.startsWith}"`:"endsWith"in c.validation?a=`Invalid input: must end with "${c.validation.endsWith}"`:ne.assertNever(c.validation):c.validation!=="regex"?a=`Invalid ${c.validation}`:a="Invalid";break;case j.too_small:c.type==="array"?a=`Array must contain ${c.exact?"exactly":c.inclusive?"at least":"more than"} ${c.minimum} element(s)`:c.type==="string"?a=`String must contain ${c.exact?"exactly":c.inclusive?"at least":"over"} ${c.minimum} character(s)`:c.type==="number"?a=`Number must be ${c.exact?"exactly equal to ":c.inclusive?"greater than or equal to ":"greater than "}${c.minimum}`:c.type==="date"?a=`Date must be ${c.exact?"exactly equal to ":c.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(c.minimum))}`:a="Invalid input";break;case j.too_big:c.type==="array"?a=`Array must contain ${c.exact?"exactly":c.inclusive?"at most":"less than"} ${c.maximum} element(s)`:c.type==="string"?a=`String must contain ${c.exact?"exactly":c.inclusive?"at most":"under"} ${c.maximum} character(s)`:c.type==="number"?a=`Number must be ${c.exact?"exactly":c.inclusive?"less than or equal to":"less than"} ${c.maximum}`:c.type==="bigint"?a=`BigInt must be ${c.exact?"exactly":c.inclusive?"less than or equal to":"less than"} ${c.maximum}`:c.type==="date"?a=`Date must be ${c.exact?"exactly":c.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(c.maximum))}`:a="Invalid input";break;case j.custom:a="Invalid input";break;case j.invalid_intersection_types:a="Intersection results could not be merged";break;case j.not_multiple_of:a=`Number must be a multiple of ${c.multipleOf}`;break;case j.not_finite:a="Number must be finite";break;default:a=e.defaultError,ne.assertNever(c)}return{message:a}};let Rr=$e;function Vs(c){Rr=c}function yt(){return Rr}const Ct=c=>{const{data:e,path:a,errorMaps:d,issueData:v}=c,y=[...a,...v.path||[]],k={...v,path:y};if(v.message!==void 0)return{...v,path:y,message:v.message};let t="";const o=d.filter(l=>!!l).slice().reverse();for(const l of o)t=l(k,{data:e,defaultError:t}).message;return{...v,path:y,message:t}},Zs=[];function q(c,e){const a=yt(),d=Ct({issueData:e,data:c.data,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,a,a===$e?void 0:$e].filter(v=>!!v)});c.common.issues.push(d)}class le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){const d=[];for(const v of a){if(v.status==="aborted")return Q;v.status==="dirty"&&e.dirty(),d.push(v.value)}return{status:e.value,value:d}}static async mergeObjectAsync(e,a){const d=[];for(const v of a){const y=await v.key,k=await v.value;d.push({key:y,value:k})}return le.mergeObjectSync(e,d)}static mergeObjectSync(e,a){const d={};for(const v of a){const{key:y,value:k}=v;if(y.status==="aborted"||k.status==="aborted")return Q;y.status==="dirty"&&e.dirty(),k.status==="dirty"&&e.dirty(),y.value!=="__proto__"&&(typeof k.value<"u"||v.alwaysSet)&&(d[y.value]=k.value)}return{status:e.value,value:d}}}const Q=Object.freeze({status:"aborted"}),We=c=>({status:"dirty",value:c}),de=c=>({status:"valid",value:c}),Wt=c=>c.status==="aborted",jt=c=>c.status==="dirty",Ie=c=>c.status==="valid",Qe=c=>typeof Promise<"u"&&c instanceof Promise;function wt(c,e,a,d){if(typeof e=="function"?c!==e||!0:!e.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(c)}function Lr(c,e,a,d,v){if(typeof e=="function"?c!==e||!0:!e.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(c,a),a}var J;(function(c){c.errToObj=e=>typeof e=="string"?{message:e}:e||{},c.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(J||(J={}));var Je,Ye;class Ce{constructor(e,a,d,v){this._cachedPath=[],this.parent=e,this.data=a,this._path=d,this._key=v}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rr=(c,e)=>{if(Ie(e))return{success:!0,data:e.value};if(!c.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new fe(c.common.issues);return this._error=a,this._error}}};function re(c){if(!c)return{};const{errorMap:e,invalid_type_error:a,required_error:d,description:v}=c;if(e&&(a||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:v}:{errorMap:(k,t)=>{var o,l;const{message:_}=c;return k.code==="invalid_enum_value"?{message:_??t.defaultError}:typeof t.data>"u"?{message:(o=_??d)!==null&&o!==void 0?o:t.defaultError}:k.code!=="invalid_type"?{message:t.defaultError}:{message:(l=_??a)!==null&&l!==void 0?l:t.defaultError}},description:v}}class se{get description(){return this._def.description}_getType(e){return ke(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:ke(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new le,ctx:{common:e.parent.common,data:e.data,parsedType:ke(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const a=this._parse(e);if(Qe(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){const a=this._parse(e);return Promise.resolve(a)}parse(e,a){const d=this.safeParse(e,a);if(d.success)return d.data;throw d.error}safeParse(e,a){var d;const v={common:{issues:[],async:(d=a==null?void 0:a.async)!==null&&d!==void 0?d:!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)},y=this._parseSync({data:e,path:v.path,parent:v});return rr(v,y)}"~validate"(e){var a,d;const v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)};if(!this["~standard"].async)try{const y=this._parseSync({data:e,path:[],parent:v});return Ie(y)?{value:y.value}:{issues:v.common.issues}}catch(y){!((d=(a=y==null?void 0:y.message)===null||a===void 0?void 0:a.toLowerCase())===null||d===void 0)&&d.includes("encountered")&&(this["~standard"].async=!0),v.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:v}).then(y=>Ie(y)?{value:y.value}:{issues:v.common.issues})}async parseAsync(e,a){const d=await this.safeParseAsync(e,a);if(d.success)return d.data;throw d.error}async safeParseAsync(e,a){const d={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)},v=this._parse({data:e,path:d.path,parent:d}),y=await(Qe(v)?v:Promise.resolve(v));return rr(d,y)}refine(e,a){const d=v=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(v):a;return this._refinement((v,y)=>{const k=e(v),t=()=>y.addIssue({code:j.custom,...d(v)});return typeof Promise<"u"&&k instanceof Promise?k.then(o=>o?!0:(t(),!1)):k?!0:(t(),!1)})}refinement(e,a){return this._refinement((d,v)=>e(d)?!0:(v.addIssue(typeof a=="function"?a(d,v):a),!1))}_refinement(e){return new ve({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return ye.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return ze.create(this,this._def)}or(e){return st.create([this,e],this._def)}and(e){return it.create(this,e,this._def)}transform(e){return new ve({...re(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const a=typeof e=="function"?e:()=>e;return new ht({...re(this._def),innerType:this,defaultValue:a,typeName:X.ZodDefault})}brand(){return new qt({typeName:X.ZodBranded,type:this,...re(this._def)})}catch(e){const a=typeof e=="function"?e:()=>e;return new lt({...re(this._def),innerType:this,catchValue:a,typeName:X.ZodCatch})}describe(e){const a=this.constructor;return new a({...this._def,description:e})}pipe(e){return ut.create(this,e)}readonly(){return dt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ks=/^c[^\s-]{8,}$/i,Gs=/^[0-9a-z]+$/,Js=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ys=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xs=/^[a-z0-9_-]{21}$/i,Qs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ei=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ti=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ri="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ft;const si=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ni=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,oi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ai=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ci=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hi=new RegExp(`^${Dr}$`);function Tr(c){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return c.precision?e=`${e}\\.\\d{${c.precision}}`:c.precision==null&&(e=`${e}(\\.\\d+)?`),e}function li(c){return new RegExp(`^${Tr(c)}$`)}function Ar(c){let e=`${Dr}T${Tr(c)}`;const a=[];return a.push(c.local?"Z?":"Z"),c.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function di(c,e){return!!((e==="v4"||!e)&&si.test(c)||(e==="v6"||!e)&&ni.test(c))}function ui(c,e){if(!Qs.test(c))return!1;try{const[a]=c.split("."),d=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),v=JSON.parse(atob(d));return!(typeof v!="object"||v===null||!v.typ||!v.alg||e&&v.alg!==e)}catch{return!1}}function fi(c,e){return!!((e==="v4"||!e)&&ii.test(c)||(e==="v6"||!e)&&oi.test(c))}class ge extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==K.string){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.string,received:y.parsedType}),Q}const d=new le;let v;for(const y of this._def.checks)if(y.kind==="min")e.data.length<y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),d.dirty());else if(y.kind==="max")e.data.length>y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),d.dirty());else if(y.kind==="length"){const k=e.data.length>y.value,t=e.data.length<y.value;(k||t)&&(v=this._getOrReturnCtx(e,v),k?q(v,{code:j.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}):t&&q(v,{code:j.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}),d.dirty())}else if(y.kind==="email")ti.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"email",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="emoji")Ft||(Ft=new RegExp(ri,"u")),Ft.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"emoji",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="uuid")Ys.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"uuid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="nanoid")Xs.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"nanoid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="cuid")Ks.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cuid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="cuid2")Gs.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cuid2",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="ulid")Js.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"ulid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="url")try{new URL(e.data)}catch{v=this._getOrReturnCtx(e,v),q(v,{validation:"url",code:j.invalid_string,message:y.message}),d.dirty()}else y.kind==="regex"?(y.regex.lastIndex=0,y.regex.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"regex",code:j.invalid_string,message:y.message}),d.dirty())):y.kind==="trim"?e.data=e.data.trim():y.kind==="includes"?e.data.includes(y.value,y.position)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{includes:y.value,position:y.position},message:y.message}),d.dirty()):y.kind==="toLowerCase"?e.data=e.data.toLowerCase():y.kind==="toUpperCase"?e.data=e.data.toUpperCase():y.kind==="startsWith"?e.data.startsWith(y.value)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{startsWith:y.value},message:y.message}),d.dirty()):y.kind==="endsWith"?e.data.endsWith(y.value)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{endsWith:y.value},message:y.message}),d.dirty()):y.kind==="datetime"?Ar(y).test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"datetime",message:y.message}),d.dirty()):y.kind==="date"?hi.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"date",message:y.message}),d.dirty()):y.kind==="time"?li(y).test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"time",message:y.message}),d.dirty()):y.kind==="duration"?ei.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"duration",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="ip"?di(e.data,y.version)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"ip",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="jwt"?ui(e.data,y.alg)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"jwt",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="cidr"?fi(e.data,y.version)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cidr",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="base64"?ai.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"base64",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="base64url"?ci.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"base64url",code:j.invalid_string,message:y.message}),d.dirty()):ne.assertNever(y);return{status:d.value,value:e.data}}_regex(e,a,d){return this.refinement(v=>e.test(v),{validation:a,code:j.invalid_string,...J.errToObj(d)})}_addCheck(e){return new ge({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.errToObj(e)})}datetime(e){var a,d;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(a=e==null?void 0:e.offset)!==null&&a!==void 0?a:!1,local:(d=e==null?void 0:e.local)!==null&&d!==void 0?d:!1,...J.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...J.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...J.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a==null?void 0:a.position,...J.errToObj(a==null?void 0:a.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...J.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...J.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...J.errToObj(a)})}nonempty(e){return this.min(1,J.errToObj(e))}trim(){return new ge({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}ge.create=c=>{var e;return new ge({checks:[],typeName:X.ZodString,coerce:(e=c==null?void 0:c.coerce)!==null&&e!==void 0?e:!1,...re(c)})};function _i(c,e){const a=(c.toString().split(".")[1]||"").length,d=(e.toString().split(".")[1]||"").length,v=a>d?a:d,y=parseInt(c.toFixed(v).replace(".","")),k=parseInt(e.toFixed(v).replace(".",""));return y%k/Math.pow(10,v)}class Te extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==K.number){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.number,received:y.parsedType}),Q}let d;const v=new le;for(const y of this._def.checks)y.kind==="int"?ne.isInteger(e.data)||(d=this._getOrReturnCtx(e,d),q(d,{code:j.invalid_type,expected:"integer",received:"float",message:y.message}),v.dirty()):y.kind==="min"?(y.inclusive?e.data<y.value:e.data<=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_small,minimum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?e.data>y.value:e.data>=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_big,maximum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="multipleOf"?_i(e.data,y.value)!==0&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):y.kind==="finite"?Number.isFinite(e.data)||(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_finite,message:y.message}),v.dirty()):ne.assertNever(y);return{status:v.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,J.toString(a))}gt(e,a){return this.setLimit("min",e,!1,J.toString(a))}lte(e,a){return this.setLimit("max",e,!0,J.toString(a))}lt(e,a){return this.setLimit("max",e,!1,J.toString(a))}setLimit(e,a,d,v){return new Te({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:d,message:J.toString(v)}]})}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.toString(e)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,a=null;for(const d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(a===null||d.value>a)&&(a=d.value):d.kind==="max"&&(e===null||d.value<e)&&(e=d.value)}return Number.isFinite(a)&&Number.isFinite(e)}}Te.create=c=>new Te({checks:[],typeName:X.ZodNumber,coerce:(c==null?void 0:c.coerce)||!1,...re(c)});class Ae extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==K.bigint)return this._getInvalidInput(e);let d;const v=new le;for(const y of this._def.checks)y.kind==="min"?(y.inclusive?e.data<y.value:e.data<=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_small,type:"bigint",minimum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?e.data>y.value:e.data>=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_big,type:"bigint",maximum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="multipleOf"?e.data%y.value!==BigInt(0)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):ne.assertNever(y);return{status:v.value,value:e.data}}_getInvalidInput(e){const a=this._getOrReturnCtx(e);return q(a,{code:j.invalid_type,expected:K.bigint,received:a.parsedType}),Q}gte(e,a){return this.setLimit("min",e,!0,J.toString(a))}gt(e,a){return this.setLimit("min",e,!1,J.toString(a))}lte(e,a){return this.setLimit("max",e,!0,J.toString(a))}lt(e,a){return this.setLimit("max",e,!1,J.toString(a))}setLimit(e,a,d,v){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:d,message:J.toString(v)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(a)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}Ae.create=c=>{var e;return new Ae({checks:[],typeName:X.ZodBigInt,coerce:(e=c==null?void 0:c.coerce)!==null&&e!==void 0?e:!1,...re(c)})};class et extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==K.boolean){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.boolean,received:d.parsedType}),Q}return de(e.data)}}et.create=c=>new et({typeName:X.ZodBoolean,coerce:(c==null?void 0:c.coerce)||!1,...re(c)});class He extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==K.date){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.date,received:y.parsedType}),Q}if(isNaN(e.data.getTime())){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_date}),Q}const d=new le;let v;for(const y of this._def.checks)y.kind==="min"?e.data.getTime()<y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_small,message:y.message,inclusive:!0,exact:!1,minimum:y.value,type:"date"}),d.dirty()):y.kind==="max"?e.data.getTime()>y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_big,message:y.message,inclusive:!0,exact:!1,maximum:y.value,type:"date"}),d.dirty()):ne.assertNever(y);return{status:d.value,value:new Date(e.data.getTime())}}_addCheck(e){return new He({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:J.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:J.toString(a)})}get minDate(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}}He.create=c=>new He({checks:[],coerce:(c==null?void 0:c.coerce)||!1,typeName:X.ZodDate,...re(c)});class Et extends se{_parse(e){if(this._getType(e)!==K.symbol){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.symbol,received:d.parsedType}),Q}return de(e.data)}}Et.create=c=>new Et({typeName:X.ZodSymbol,...re(c)});class tt extends se{_parse(e){if(this._getType(e)!==K.undefined){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.undefined,received:d.parsedType}),Q}return de(e.data)}}tt.create=c=>new tt({typeName:X.ZodUndefined,...re(c)});class rt extends se{_parse(e){if(this._getType(e)!==K.null){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.null,received:d.parsedType}),Q}return de(e.data)}}rt.create=c=>new rt({typeName:X.ZodNull,...re(c)});class Ue extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}Ue.create=c=>new Ue({typeName:X.ZodAny,...re(c)});class Pe extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}Pe.create=c=>new Pe({typeName:X.ZodUnknown,...re(c)});class Re extends se{_parse(e){const a=this._getOrReturnCtx(e);return q(a,{code:j.invalid_type,expected:K.never,received:a.parsedType}),Q}}Re.create=c=>new Re({typeName:X.ZodNever,...re(c)});class xt extends se{_parse(e){if(this._getType(e)!==K.undefined){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.void,received:d.parsedType}),Q}return de(e.data)}}xt.create=c=>new xt({typeName:X.ZodVoid,...re(c)});class me extends se{_parse(e){const{ctx:a,status:d}=this._processInputParams(e),v=this._def;if(a.parsedType!==K.array)return q(a,{code:j.invalid_type,expected:K.array,received:a.parsedType}),Q;if(v.exactLength!==null){const k=a.data.length>v.exactLength.value,t=a.data.length<v.exactLength.value;(k||t)&&(q(a,{code:k?j.too_big:j.too_small,minimum:t?v.exactLength.value:void 0,maximum:k?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),d.dirty())}if(v.minLength!==null&&a.data.length<v.minLength.value&&(q(a,{code:j.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),d.dirty()),v.maxLength!==null&&a.data.length>v.maxLength.value&&(q(a,{code:j.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),d.dirty()),a.common.async)return Promise.all([...a.data].map((k,t)=>v.type._parseAsync(new Ce(a,k,a.path,t)))).then(k=>le.mergeArray(d,k));const y=[...a.data].map((k,t)=>v.type._parseSync(new Ce(a,k,a.path,t)));return le.mergeArray(d,y)}get element(){return this._def.type}min(e,a){return new me({...this._def,minLength:{value:e,message:J.toString(a)}})}max(e,a){return new me({...this._def,maxLength:{value:e,message:J.toString(a)}})}length(e,a){return new me({...this._def,exactLength:{value:e,message:J.toString(a)}})}nonempty(e){return this.min(1,e)}}me.create=(c,e)=>new me({type:c,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...re(e)});function Ne(c){if(c instanceof ae){const e={};for(const a in c.shape){const d=c.shape[a];e[a]=ye.create(Ne(d))}return new ae({...c._def,shape:()=>e})}else return c instanceof me?new me({...c._def,type:Ne(c.element)}):c instanceof ye?ye.create(Ne(c.unwrap())):c instanceof Oe?Oe.create(Ne(c.unwrap())):c instanceof we?we.create(c.items.map(e=>Ne(e))):c}class ae extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),a=ne.objectKeys(e);return this._cached={shape:e,keys:a}}_parse(e){if(this._getType(e)!==K.object){const l=this._getOrReturnCtx(e);return q(l,{code:j.invalid_type,expected:K.object,received:l.parsedType}),Q}const{status:d,ctx:v}=this._processInputParams(e),{shape:y,keys:k}=this._getCached(),t=[];if(!(this._def.catchall instanceof Re&&this._def.unknownKeys==="strip"))for(const l in v.data)k.includes(l)||t.push(l);const o=[];for(const l of k){const _=y[l],h=v.data[l];o.push({key:{status:"valid",value:l},value:_._parse(new Ce(v,h,v.path,l)),alwaysSet:l in v.data})}if(this._def.catchall instanceof Re){const l=this._def.unknownKeys;if(l==="passthrough")for(const _ of t)o.push({key:{status:"valid",value:_},value:{status:"valid",value:v.data[_]}});else if(l==="strict")t.length>0&&(q(v,{code:j.unrecognized_keys,keys:t}),d.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const _ of t){const h=v.data[_];o.push({key:{status:"valid",value:_},value:l._parse(new Ce(v,h,v.path,_)),alwaysSet:_ in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const l=[];for(const _ of o){const h=await _.key,p=await _.value;l.push({key:h,value:p,alwaysSet:_.alwaysSet})}return l}).then(l=>le.mergeObjectSync(d,l)):le.mergeObjectSync(d,o)}get shape(){return this._def.shape()}strict(e){return J.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,d)=>{var v,y,k,t;const o=(k=(y=(v=this._def).errorMap)===null||y===void 0?void 0:y.call(v,a,d).message)!==null&&k!==void 0?k:d.defaultError;return a.code==="unrecognized_keys"?{message:(t=J.errToObj(e).message)!==null&&t!==void 0?t:o}:{message:o}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const a={};return ne.objectKeys(e).forEach(d=>{e[d]&&this.shape[d]&&(a[d]=this.shape[d])}),new ae({...this._def,shape:()=>a})}omit(e){const a={};return ne.objectKeys(this.shape).forEach(d=>{e[d]||(a[d]=this.shape[d])}),new ae({...this._def,shape:()=>a})}deepPartial(){return Ne(this)}partial(e){const a={};return ne.objectKeys(this.shape).forEach(d=>{const v=this.shape[d];e&&!e[d]?a[d]=v:a[d]=v.optional()}),new ae({...this._def,shape:()=>a})}required(e){const a={};return ne.objectKeys(this.shape).forEach(d=>{if(e&&!e[d])a[d]=this.shape[d];else{let y=this.shape[d];for(;y instanceof ye;)y=y._def.innerType;a[d]=y}}),new ae({...this._def,shape:()=>a})}keyof(){return Br(ne.objectKeys(this.shape))}}ae.create=(c,e)=>new ae({shape:()=>c,unknownKeys:"strip",catchall:Re.create(),typeName:X.ZodObject,...re(e)});ae.strictCreate=(c,e)=>new ae({shape:()=>c,unknownKeys:"strict",catchall:Re.create(),typeName:X.ZodObject,...re(e)});ae.lazycreate=(c,e)=>new ae({shape:c,unknownKeys:"strip",catchall:Re.create(),typeName:X.ZodObject,...re(e)});class st extends se{_parse(e){const{ctx:a}=this._processInputParams(e),d=this._def.options;function v(y){for(const t of y)if(t.result.status==="valid")return t.result;for(const t of y)if(t.result.status==="dirty")return a.common.issues.push(...t.ctx.common.issues),t.result;const k=y.map(t=>new fe(t.ctx.common.issues));return q(a,{code:j.invalid_union,unionErrors:k}),Q}if(a.common.async)return Promise.all(d.map(async y=>{const k={...a,common:{...a.common,issues:[]},parent:null};return{result:await y._parseAsync({data:a.data,path:a.path,parent:k}),ctx:k}})).then(v);{let y;const k=[];for(const o of d){const l={...a,common:{...a.common,issues:[]},parent:null},_=o._parseSync({data:a.data,path:a.path,parent:l});if(_.status==="valid")return _;_.status==="dirty"&&!y&&(y={result:_,ctx:l}),l.common.issues.length&&k.push(l.common.issues)}if(y)return a.common.issues.push(...y.ctx.common.issues),y.result;const t=k.map(o=>new fe(o));return q(a,{code:j.invalid_union,unionErrors:t}),Q}}get options(){return this._def.options}}st.create=(c,e)=>new st({options:c,typeName:X.ZodUnion,...re(e)});const Ee=c=>c instanceof ot?Ee(c.schema):c instanceof ve?Ee(c.innerType()):c instanceof at?[c.value]:c instanceof Be?c.options:c instanceof ct?ne.objectValues(c.enum):c instanceof ht?Ee(c._def.innerType):c instanceof tt?[void 0]:c instanceof rt?[null]:c instanceof ye?[void 0,...Ee(c.unwrap())]:c instanceof Oe?[null,...Ee(c.unwrap())]:c instanceof qt||c instanceof dt?Ee(c.unwrap()):c instanceof lt?Ee(c._def.innerType):[];class Lt extends se{_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==K.object)return q(a,{code:j.invalid_type,expected:K.object,received:a.parsedType}),Q;const d=this.discriminator,v=a.data[d],y=this.optionsMap.get(v);return y?a.common.async?y._parseAsync({data:a.data,path:a.path,parent:a}):y._parseSync({data:a.data,path:a.path,parent:a}):(q(a,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,d){const v=new Map;for(const y of a){const k=Ee(y.shape[e]);if(!k.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const t of k){if(v.has(t))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(t)}`);v.set(t,y)}}return new Lt({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:v,...re(d)})}}function $t(c,e){const a=ke(c),d=ke(e);if(c===e)return{valid:!0,data:c};if(a===K.object&&d===K.object){const v=ne.objectKeys(e),y=ne.objectKeys(c).filter(t=>v.indexOf(t)!==-1),k={...c,...e};for(const t of y){const o=$t(c[t],e[t]);if(!o.valid)return{valid:!1};k[t]=o.data}return{valid:!0,data:k}}else if(a===K.array&&d===K.array){if(c.length!==e.length)return{valid:!1};const v=[];for(let y=0;y<c.length;y++){const k=c[y],t=e[y],o=$t(k,t);if(!o.valid)return{valid:!1};v.push(o.data)}return{valid:!0,data:v}}else return a===K.date&&d===K.date&&+c==+e?{valid:!0,data:c}:{valid:!1}}class it extends se{_parse(e){const{status:a,ctx:d}=this._processInputParams(e),v=(y,k)=>{if(Wt(y)||Wt(k))return Q;const t=$t(y.value,k.value);return t.valid?((jt(y)||jt(k))&&a.dirty(),{status:a.value,value:t.data}):(q(d,{code:j.invalid_intersection_types}),Q)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([y,k])=>v(y,k)):v(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}it.create=(c,e,a)=>new it({left:c,right:e,typeName:X.ZodIntersection,...re(a)});class we extends se{_parse(e){const{status:a,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.array)return q(d,{code:j.invalid_type,expected:K.array,received:d.parsedType}),Q;if(d.data.length<this._def.items.length)return q(d,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&d.data.length>this._def.items.length&&(q(d,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const y=[...d.data].map((k,t)=>{const o=this._def.items[t]||this._def.rest;return o?o._parse(new Ce(d,k,d.path,t)):null}).filter(k=>!!k);return d.common.async?Promise.all(y).then(k=>le.mergeArray(a,k)):le.mergeArray(a,y)}get items(){return this._def.items}rest(e){return new we({...this._def,rest:e})}}we.create=(c,e)=>{if(!Array.isArray(c))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:c,typeName:X.ZodTuple,rest:null,...re(e)})};class nt extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:a,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.object)return q(d,{code:j.invalid_type,expected:K.object,received:d.parsedType}),Q;const v=[],y=this._def.keyType,k=this._def.valueType;for(const t in d.data)v.push({key:y._parse(new Ce(d,t,d.path,t)),value:k._parse(new Ce(d,d.data[t],d.path,t)),alwaysSet:t in d.data});return d.common.async?le.mergeObjectAsync(a,v):le.mergeObjectSync(a,v)}get element(){return this._def.valueType}static create(e,a,d){return a instanceof se?new nt({keyType:e,valueType:a,typeName:X.ZodRecord,...re(d)}):new nt({keyType:ge.create(),valueType:e,typeName:X.ZodRecord,...re(a)})}}class kt extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:a,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.map)return q(d,{code:j.invalid_type,expected:K.map,received:d.parsedType}),Q;const v=this._def.keyType,y=this._def.valueType,k=[...d.data.entries()].map(([t,o],l)=>({key:v._parse(new Ce(d,t,d.path,[l,"key"])),value:y._parse(new Ce(d,o,d.path,[l,"value"]))}));if(d.common.async){const t=new Map;return Promise.resolve().then(async()=>{for(const o of k){const l=await o.key,_=await o.value;if(l.status==="aborted"||_.status==="aborted")return Q;(l.status==="dirty"||_.status==="dirty")&&a.dirty(),t.set(l.value,_.value)}return{status:a.value,value:t}})}else{const t=new Map;for(const o of k){const l=o.key,_=o.value;if(l.status==="aborted"||_.status==="aborted")return Q;(l.status==="dirty"||_.status==="dirty")&&a.dirty(),t.set(l.value,_.value)}return{status:a.value,value:t}}}}kt.create=(c,e,a)=>new kt({valueType:e,keyType:c,typeName:X.ZodMap,...re(a)});class Fe extends se{_parse(e){const{status:a,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.set)return q(d,{code:j.invalid_type,expected:K.set,received:d.parsedType}),Q;const v=this._def;v.minSize!==null&&d.data.size<v.minSize.value&&(q(d,{code:j.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),a.dirty()),v.maxSize!==null&&d.data.size>v.maxSize.value&&(q(d,{code:j.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),a.dirty());const y=this._def.valueType;function k(o){const l=new Set;for(const _ of o){if(_.status==="aborted")return Q;_.status==="dirty"&&a.dirty(),l.add(_.value)}return{status:a.value,value:l}}const t=[...d.data.values()].map((o,l)=>y._parse(new Ce(d,o,d.path,l)));return d.common.async?Promise.all(t).then(o=>k(o)):k(t)}min(e,a){return new Fe({...this._def,minSize:{value:e,message:J.toString(a)}})}max(e,a){return new Fe({...this._def,maxSize:{value:e,message:J.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}}Fe.create=(c,e)=>new Fe({valueType:c,minSize:null,maxSize:null,typeName:X.ZodSet,...re(e)});class je extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==K.function)return q(a,{code:j.invalid_type,expected:K.function,received:a.parsedType}),Q;function d(t,o){return Ct({data:t,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,yt(),$e].filter(l=>!!l),issueData:{code:j.invalid_arguments,argumentsError:o}})}function v(t,o){return Ct({data:t,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,yt(),$e].filter(l=>!!l),issueData:{code:j.invalid_return_type,returnTypeError:o}})}const y={errorMap:a.common.contextualErrorMap},k=a.data;if(this._def.returns instanceof ze){const t=this;return de(async function(...o){const l=new fe([]),_=await t._def.args.parseAsync(o,y).catch(m=>{throw l.addIssue(d(o,m)),l}),h=await Reflect.apply(k,this,_);return await t._def.returns._def.type.parseAsync(h,y).catch(m=>{throw l.addIssue(v(h,m)),l})})}else{const t=this;return de(function(...o){const l=t._def.args.safeParse(o,y);if(!l.success)throw new fe([d(o,l.error)]);const _=Reflect.apply(k,this,l.data),h=t._def.returns.safeParse(_,y);if(!h.success)throw new fe([v(_,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new je({...this._def,args:we.create(e).rest(Pe.create())})}returns(e){return new je({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,d){return new je({args:e||we.create([]).rest(Pe.create()),returns:a||Pe.create(),typeName:X.ZodFunction,...re(d)})}}class ot extends se{get schema(){return this._def.getter()}_parse(e){const{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}ot.create=(c,e)=>new ot({getter:c,typeName:X.ZodLazy,...re(e)});class at extends se{_parse(e){if(e.data!==this._def.value){const a=this._getOrReturnCtx(e);return q(a,{received:a.data,code:j.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}at.create=(c,e)=>new at({value:c,typeName:X.ZodLiteral,...re(e)});function Br(c,e){return new Be({values:c,typeName:X.ZodEnum,...re(e)})}class Be extends se{constructor(){super(...arguments),Je.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const a=this._getOrReturnCtx(e),d=this._def.values;return q(a,{expected:ne.joinValues(d),received:a.parsedType,code:j.invalid_type}),Q}if(wt(this,Je)||Lr(this,Je,new Set(this._def.values)),!wt(this,Je).has(e.data)){const a=this._getOrReturnCtx(e),d=this._def.values;return q(a,{received:a.data,code:j.invalid_enum_value,options:d}),Q}return de(e.data)}get options(){return this._def.values}get enum(){const e={};for(const a of this._def.values)e[a]=a;return e}get Values(){const e={};for(const a of this._def.values)e[a]=a;return e}get Enum(){const e={};for(const a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return Be.create(e,{...this._def,...a})}exclude(e,a=this._def){return Be.create(this.options.filter(d=>!e.includes(d)),{...this._def,...a})}}Je=new WeakMap;Be.create=Br;class ct extends se{constructor(){super(...arguments),Ye.set(this,void 0)}_parse(e){const a=ne.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(e);if(d.parsedType!==K.string&&d.parsedType!==K.number){const v=ne.objectValues(a);return q(d,{expected:ne.joinValues(v),received:d.parsedType,code:j.invalid_type}),Q}if(wt(this,Ye)||Lr(this,Ye,new Set(ne.getValidEnumValues(this._def.values))),!wt(this,Ye).has(e.data)){const v=ne.objectValues(a);return q(d,{received:d.data,code:j.invalid_enum_value,options:v}),Q}return de(e.data)}get enum(){return this._def.values}}Ye=new WeakMap;ct.create=(c,e)=>new ct({values:c,typeName:X.ZodNativeEnum,...re(e)});class ze extends se{unwrap(){return this._def.type}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==K.promise&&a.common.async===!1)return q(a,{code:j.invalid_type,expected:K.promise,received:a.parsedType}),Q;const d=a.parsedType===K.promise?a.data:Promise.resolve(a.data);return de(d.then(v=>this._def.type.parseAsync(v,{path:a.path,errorMap:a.common.contextualErrorMap})))}}ze.create=(c,e)=>new ze({type:c,typeName:X.ZodPromise,...re(e)});class ve extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:a,ctx:d}=this._processInputParams(e),v=this._def.effect||null,y={addIssue:k=>{q(d,k),k.fatal?a.abort():a.dirty()},get path(){return d.path}};if(y.addIssue=y.addIssue.bind(y),v.type==="preprocess"){const k=v.transform(d.data,y);if(d.common.async)return Promise.resolve(k).then(async t=>{if(a.value==="aborted")return Q;const o=await this._def.schema._parseAsync({data:t,path:d.path,parent:d});return o.status==="aborted"?Q:o.status==="dirty"||a.value==="dirty"?We(o.value):o});{if(a.value==="aborted")return Q;const t=this._def.schema._parseSync({data:k,path:d.path,parent:d});return t.status==="aborted"?Q:t.status==="dirty"||a.value==="dirty"?We(t.value):t}}if(v.type==="refinement"){const k=t=>{const o=v.refinement(t,y);if(d.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(d.common.async===!1){const t=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return t.status==="aborted"?Q:(t.status==="dirty"&&a.dirty(),k(t.value),{status:a.value,value:t.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(t=>t.status==="aborted"?Q:(t.status==="dirty"&&a.dirty(),k(t.value).then(()=>({status:a.value,value:t.value}))))}if(v.type==="transform")if(d.common.async===!1){const k=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Ie(k))return k;const t=v.transform(k.value,y);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:t}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(k=>Ie(k)?Promise.resolve(v.transform(k.value,y)).then(t=>({status:a.value,value:t})):k);ne.assertNever(v)}}ve.create=(c,e,a)=>new ve({schema:c,typeName:X.ZodEffects,effect:e,...re(a)});ve.createWithPreprocess=(c,e,a)=>new ve({schema:e,effect:{type:"preprocess",transform:c},typeName:X.ZodEffects,...re(a)});class ye extends se{_parse(e){return this._getType(e)===K.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(c,e)=>new ye({innerType:c,typeName:X.ZodOptional,...re(e)});class Oe extends se{_parse(e){return this._getType(e)===K.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(c,e)=>new Oe({innerType:c,typeName:X.ZodNullable,...re(e)});class ht extends se{_parse(e){const{ctx:a}=this._processInputParams(e);let d=a.data;return a.parsedType===K.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}ht.create=(c,e)=>new ht({innerType:c,typeName:X.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class lt extends se{_parse(e){const{ctx:a}=this._processInputParams(e),d={...a,common:{...a.common,issues:[]}},v=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return Qe(v)?v.then(y=>({status:"valid",value:y.status==="valid"?y.value:this._def.catchValue({get error(){return new fe(d.common.issues)},input:d.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new fe(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}lt.create=(c,e)=>new lt({innerType:c,typeName:X.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Rt extends se{_parse(e){if(this._getType(e)!==K.nan){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.nan,received:d.parsedType}),Q}return{status:"valid",value:e.data}}}Rt.create=c=>new Rt({typeName:X.ZodNaN,...re(c)});const pi=Symbol("zod_brand");class qt extends se{_parse(e){const{ctx:a}=this._processInputParams(e),d=a.data;return this._def.type._parse({data:d,path:a.path,parent:a})}unwrap(){return this._def.type}}class ut extends se{_parse(e){const{status:a,ctx:d}=this._processInputParams(e);if(d.common.async)return(async()=>{const y=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return y.status==="aborted"?Q:y.status==="dirty"?(a.dirty(),We(y.value)):this._def.out._parseAsync({data:y.value,path:d.path,parent:d})})();{const v=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return v.status==="aborted"?Q:v.status==="dirty"?(a.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:d.path,parent:d})}}static create(e,a){return new ut({in:e,out:a,typeName:X.ZodPipeline})}}class dt extends se{_parse(e){const a=this._def.innerType._parse(e),d=v=>(Ie(v)&&(v.value=Object.freeze(v.value)),v);return Qe(a)?a.then(v=>d(v)):d(a)}unwrap(){return this._def.innerType}}dt.create=(c,e)=>new dt({innerType:c,typeName:X.ZodReadonly,...re(e)});function sr(c,e){const a=typeof c=="function"?c(e):typeof c=="string"?{message:c}:c;return typeof a=="string"?{message:a}:a}function Or(c,e={},a){return c?Ue.create().superRefine((d,v)=>{var y,k;const t=c(d);if(t instanceof Promise)return t.then(o=>{var l,_;if(!o){const h=sr(e,d),p=(_=(l=h.fatal)!==null&&l!==void 0?l:a)!==null&&_!==void 0?_:!0;v.addIssue({code:"custom",...h,fatal:p})}});if(!t){const o=sr(e,d),l=(k=(y=o.fatal)!==null&&y!==void 0?y:a)!==null&&k!==void 0?k:!0;v.addIssue({code:"custom",...o,fatal:l})}}):Ue.create()}const gi={object:ae.lazycreate};var X;(function(c){c.ZodString="ZodString",c.ZodNumber="ZodNumber",c.ZodNaN="ZodNaN",c.ZodBigInt="ZodBigInt",c.ZodBoolean="ZodBoolean",c.ZodDate="ZodDate",c.ZodSymbol="ZodSymbol",c.ZodUndefined="ZodUndefined",c.ZodNull="ZodNull",c.ZodAny="ZodAny",c.ZodUnknown="ZodUnknown",c.ZodNever="ZodNever",c.ZodVoid="ZodVoid",c.ZodArray="ZodArray",c.ZodObject="ZodObject",c.ZodUnion="ZodUnion",c.ZodDiscriminatedUnion="ZodDiscriminatedUnion",c.ZodIntersection="ZodIntersection",c.ZodTuple="ZodTuple",c.ZodRecord="ZodRecord",c.ZodMap="ZodMap",c.ZodSet="ZodSet",c.ZodFunction="ZodFunction",c.ZodLazy="ZodLazy",c.ZodLiteral="ZodLiteral",c.ZodEnum="ZodEnum",c.ZodEffects="ZodEffects",c.ZodNativeEnum="ZodNativeEnum",c.ZodOptional="ZodOptional",c.ZodNullable="ZodNullable",c.ZodDefault="ZodDefault",c.ZodCatch="ZodCatch",c.ZodPromise="ZodPromise",c.ZodBranded="ZodBranded",c.ZodPipeline="ZodPipeline",c.ZodReadonly="ZodReadonly"})(X||(X={}));const mi=(c,e={message:`Input not instance of ${c.name}`})=>Or(a=>a instanceof c,e),Mr=ge.create,Pr=Te.create,vi=Rt.create,bi=Ae.create,Ir=et.create,Si=He.create,yi=Et.create,Ci=tt.create,wi=rt.create,Ei=Ue.create,xi=Pe.create,ki=Re.create,Ri=xt.create,Li=me.create,Di=ae.create,Ti=ae.strictCreate,Ai=st.create,Bi=Lt.create,Oi=it.create,Mi=we.create,Pi=nt.create,Ii=kt.create,Hi=Fe.create,Fi=je.create,Ni=ot.create,Wi=at.create,ji=Be.create,$i=ct.create,Ui=ze.create,ir=ve.create,zi=ye.create,qi=Oe.create,Vi=ve.createWithPreprocess,Zi=ut.create,Ki=()=>Mr().optional(),Gi=()=>Pr().optional(),Ji=()=>Ir().optional(),Yi={string:c=>ge.create({...c,coerce:!0}),number:c=>Te.create({...c,coerce:!0}),boolean:c=>et.create({...c,coerce:!0}),bigint:c=>Ae.create({...c,coerce:!0}),date:c=>He.create({...c,coerce:!0})},Xi=Q;var Qi=Object.freeze({__proto__:null,defaultErrorMap:$e,setErrorMap:Vs,getErrorMap:yt,makeIssue:Ct,EMPTY_PATH:Zs,addIssueToContext:q,ParseStatus:le,INVALID:Q,DIRTY:We,OK:de,isAborted:Wt,isDirty:jt,isValid:Ie,isAsync:Qe,get util(){return ne},get objectUtil(){return Nt},ZodParsedType:K,getParsedType:ke,ZodType:se,datetimeRegex:Ar,ZodString:ge,ZodNumber:Te,ZodBigInt:Ae,ZodBoolean:et,ZodDate:He,ZodSymbol:Et,ZodUndefined:tt,ZodNull:rt,ZodAny:Ue,ZodUnknown:Pe,ZodNever:Re,ZodVoid:xt,ZodArray:me,ZodObject:ae,ZodUnion:st,ZodDiscriminatedUnion:Lt,ZodIntersection:it,ZodTuple:we,ZodRecord:nt,ZodMap:kt,ZodSet:Fe,ZodFunction:je,ZodLazy:ot,ZodLiteral:at,ZodEnum:Be,ZodNativeEnum:ct,ZodPromise:ze,ZodEffects:ve,ZodTransformer:ve,ZodOptional:ye,ZodNullable:Oe,ZodDefault:ht,ZodCatch:lt,ZodNaN:Rt,BRAND:pi,ZodBranded:qt,ZodPipeline:ut,ZodReadonly:dt,custom:Or,Schema:se,ZodSchema:se,late:gi,get ZodFirstPartyTypeKind(){return X},coerce:Yi,any:Ei,array:Li,bigint:bi,boolean:Ir,date:Si,discriminatedUnion:Bi,effect:ir,enum:ji,function:Fi,instanceof:mi,intersection:Oi,lazy:Ni,literal:Wi,map:Ii,nan:vi,nativeEnum:$i,never:ki,null:wi,nullable:qi,number:Pr,object:Di,oboolean:Ji,onumber:Gi,optional:zi,ostring:Ki,pipeline:Zi,preprocess:Vi,promise:Ui,record:Pi,set:Hi,strictObject:Ti,string:Mr,symbol:yi,transformer:ir,tuple:Mi,undefined:Ci,union:Ai,unknown:xi,void:Ri,NEVER:Xi,ZodIssueCode:j,quotelessJson:qs,ZodError:fe});function en(c){const e=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(c);if(!e)return;if(!e[1]||!e[2]||!e[3]||!e[4])throw new Error(`Mouse event: Invalid match for data ${c}`);const a=parseInt(e[1],10),d=parseInt(e[2],10),v=parseInt(e[3],10),y=e[4]==="m";return console.log(`Mouse event: buttonCode=${a}, column=${d}, row=${v}, isRelease=${y}`),c}function Hr(c,e){const a=new zs.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),d=xr.macchiato.colors;a.options.theme={background:d.base.hex,black:d.crust.hex,brightBlack:d.surface2.hex,blue:d.blue.hex,brightBlue:d.blue.hex,brightCyan:d.sky.hex,brightRed:d.maroon.hex,brightYellow:d.yellow.hex,cursor:d.text.hex,cyan:d.sky.hex,foreground:d.text.hex,green:d.green.hex,magenta:d.lavender.hex,red:d.red.hex,white:d.text.hex,yellow:d.yellow.hex};const v=new $s.FitAddon;return a.loadAddon(v),a.open(c),v.fit(),window.addEventListener("resize",()=>{v.fit()}),a.onData(y=>{if(typeof y!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(y)}'`);const k=en(y);k&&e.onMouseEvent(k)}),a.onKey(y=>{e.onKeyPress(y)}),a}function Fr(){let c=Qi.string().safeParse(sessionStorage.getItem("tabId")).data;return c||(c=Math.random().toString(36),sessionStorage.setItem("tabId",c)),{tabId:c}}class tn{constructor(e){Se(this,"ready");Se(this,"tabId");Se(this,"terminal");Se(this,"trpc");const a=br({links:[wr({condition:y=>y.type==="subscription",true:Er({url:"/trpc"}),false:Cr({url:"/trpc"})})]});this.trpc=a,this.tabId=Fr();const d=this.tabId,v=Hr(e,{onMouseEvent(y){a.neovim.sendStdin.mutate({tabId:d,data:y}).catch(k=>{console.error("Error sending mouse event",k)})},onKeyPress(y){a.neovim.sendStdin.mutate({tabId:d,data:y.key})}});this.terminal=v,this.ready=new Promise(y=>{console.log("Subscribing to stdout"),a.neovim.onStdout.subscribe({client:d},{onStarted(){y()},onData(k){v.write(k)},onError(k){console.error("Error from the application",k)}})})}async startNeovim(e){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:e.filename,additionalEnvironmentVariables:e.additionalEnvironmentVariables,startupScriptModifications:e.startupScriptModifications,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}},tabId:this.tabId})}async runBlockingShellCommand(e){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...e,tabId:this.tabId})}async runLuaCode(e){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...e,tabId:this.tabId})}async runExCommand(e){return await this.ready,this.trpc.neovim.runExCommand.mutate({...e,tabId:this.tabId})}}class rn{constructor(e){Se(this,"ready");Se(this,"tabId");Se(this,"terminal");Se(this,"trpc");const a=br({links:[wr({condition:y=>y.type==="subscription",true:Er({url:"/trpc"}),false:Cr({url:"/trpc"})})]});this.trpc=a,this.tabId=Fr();const d=this.tabId,v=Hr(e,{onMouseEvent(y){a.terminal.sendStdin.mutate({tabId:d,data:y}).catch(k=>{console.error("Error sending mouse event",k)})},onKeyPress(y){a.terminal.sendStdin.mutate({tabId:d,data:y.key})}});this.terminal=v,this.ready=new Promise(y=>{console.log("Subscribing to stdout"),a.terminal.onStdout.subscribe({client:d},{onStarted(){y()},onData(k){v.write(k)},onError(k){console.error("Error from the application",k)}})})}async startTerminalApplication(e){return await this.ready,await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:e.additionalEnvironmentVariables,commandToRun:e.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(e){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...e,tabId:this.tabId})}}class Nr{constructor(e){Se(this,"value");this.factory=e}get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const Vt=document.querySelector("#app");if(!Vt)throw new Error("No app element found");const sn=new Nr(()=>new tn(Vt)),nn=new Nr(()=>new rn(Vt));window.startNeovim=async function(c){const e=sn.get(),a=await e.startNeovim({additionalEnvironmentVariables:c==null?void 0:c.additionalEnvironmentVariables,filename:(c==null?void 0:c.filename)??"initial-file.txt",startupScriptModifications:(c==null?void 0:c.startupScriptModifications)??[]});return{runBlockingShellCommand(v){return e.runBlockingShellCommand(v)},runLuaCode(v){return e.runLuaCode(v)},runExCommand(v){return e.runExCommand(v)},dir:a}};window.startTerminalApplication=async function(c){const e=nn.get();return{dir:await e.startTerminalApplication(c),runBlockingShellCommand(d){return e.runBlockingShellCommand(d)}}};
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),n.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 E=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&E)&&this._areCoordsInSelection(E,T,B)}isCellInSelection(g,E){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([g,E],T,B)}_areCoordsInSelection(g,E,T){return g[1]>E[1]&&g[1]<T[1]||E[1]===T[1]&&g[1]===E[1]&&g[0]>=E[0]&&g[0]<T[0]||E[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||E[1]<T[1]&&g[1]===E[1]&&g[0]>=E[0]}_selectWordAtCursor(g,E){var O,D;const T=(D=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:D.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,r.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(g);return!!B&&(this._selectWordAt(B,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,E){this._model.clearSelection(),g=Math.max(g,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const E=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(g){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=T?0:(E>T&&(E-=T),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(g){return n.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 E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const E=this._getMouseBufferCoords(g);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(g){return g.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const E=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]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 E=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<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,p.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,E=this._model.finalSelectionEnd,T=!(!g||!E||g[0]===E[0]&&g[1]===E[1]);T?g&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,E,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,E,T)}_fireOnSelectionChange(g,E,T){this._oldSelectionStart=g,this._oldSelectionEnd=E,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(g,E){let T=E;for(let B=0;E>=B;B++){const O=g.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&E!==B&&(T+=O-1)}return T}setSelection(g,E,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,E],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,E,T=!0,B=!0){if(g[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,D=O.lines.get(g[1]);if(!D)return;const I=O.translateBufferLineToString(g[1],!1);let F=this._convertViewportColToCharacterIndex(D,g[0]),$=F;const G=g[0]-F;let U=0,x=0,L=0,A=0;if(I.charAt(F)===" "){for(;F>0&&I.charAt(F-1)===" ";)F--;for(;$<I.length&&I.charAt($+1)===" ";)$++}else{let z=g[0],Y=g[0];D.getWidth(z)===0&&(U++,z--),D.getWidth(Y)===2&&(x++,Y++);const ee=D.getString(Y).length;for(ee>1&&(A+=ee-1,$+=ee-1);z>0&&F>0&&!this._isCharWordSeparator(D.loadCell(z-1,this._workCell));){D.loadCell(z-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,z--):P>1&&(L+=P-1,F-=P-1),F--,z--}for(;Y<D.length&&$+1<I.length&&!this._isCharWordSeparator(D.loadCell(Y+1,this._workCell));){D.loadCell(Y+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,Y++):P>1&&(A+=P-1,$+=P-1),$++,Y++}}$++;let M=F+G-U+L,N=Math.min(this._bufferService.cols,$-F+U+x-L-A);if(E||I.slice(F,$).trim()!==""){if(T&&M===0&&D.getCodePoint(0)!==32){const z=O.lines.get(g[1]-1);if(z&&D.isWrapped&&z.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(Y){const ee=this._bufferService.cols-Y.start;M-=ee,N+=ee}}}if(B&&M+N===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const z=O.lines.get(g[1]+1);if(z!=null&&z.isWrapped&&z.getCodePoint(0)!==32){const Y=this._getWordAt([0,g[1]+1],!1,!1,!0);Y&&(N+=Y.length)}}return{start:M,length:N}}}_selectWordAt(g,E){const T=this._getWordAt(g,E);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 E=this._getWordAt(g,!0);if(E){let T=g[1];for(;E.start<0;)E.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const E=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,r.getRangeLength)(T,this._bufferService.cols)}};t.SelectionService=w=l([_(3,u.IBufferService),_(4,u.ICoreService),_(5,C.IMouseService),_(6,u.IOptionsService),_(7,C.IRenderService),_(8,C.ICoreBrowserService)],w)},4725:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const l=a(8343);t.ICharSizeService=(0,l.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),t.IMouseService=(0,l.createDecorator)("MouseService"),t.IRenderService=(0,l.createDecorator)("RenderService"),t.ISelectionService=(0,l.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,l.createDecorator)("ThemeService"),t.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(k,t,a){var l=this&&this.__decorate||function(w,g,E,T){var B,O=arguments.length,D=O<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,g,E,T);else for(var I=w.length-1;I>=0;I--)(B=w[I])&&(D=(O<3?B(D):O>3?B(g,E,D):B(g,E))||D);return O>3&&D&&Object.defineProperty(g,E,D),D},_=this&&this.__param||function(w,g){return function(E,T){g(E,T,w)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const h=a(7239),p=a(8055),m=a(8460),C=a(844),f=a(2585),i=p.css.toColor("#ffffff"),n=p.css.toColor("#000000"),r=p.css.toColor("#ffffff"),s=p.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let E=0;E<216;E++){const T=g[E/36%6|0],B=g[E/6%6|0],O=g[E%6];w.push({css:p.channels.toCss(T,B,O),rgba:p.channels.toRgba(T,B,O)})}for(let E=0;E<24;E++){const T=8+10*E;w.push({css:p.channels.toCss(T,T,T),rgba:p.channels.toRgba(T,T,T)})}return w})());let S=t.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:n,cursor:r,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:u,selectionBackgroundOpaque:p.color.blend(n,u),selectionInactiveBackgroundTransparent:u,selectionInactiveBackgroundOpaque:p.color.blend(n,u),ansi:t.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(w={}){const g=this._colors;if(g.foreground=b(w.foreground,i),g.background=b(w.background,n),g.cursor=b(w.cursor,r),g.cursorAccent=b(w.cursorAccent,s),g.selectionBackgroundTransparent=b(w.selectionBackground,u),g.selectionBackgroundOpaque=p.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=b(w.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=p.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=w.selectionForeground?b(w.selectionForeground,p.NULL_COLOR):void 0,g.selectionForeground===p.NULL_COLOR&&(g.selectionForeground=void 0),p.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=p.color.opacity(g.selectionBackgroundTransparent,.3)),p.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=p.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=t.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=b(w.black,t.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=b(w.red,t.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=b(w.green,t.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=b(w.yellow,t.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=b(w.blue,t.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=b(w.magenta,t.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=b(w.cyan,t.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=b(w.white,t.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=b(w.brightBlack,t.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=b(w.brightRed,t.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=b(w.brightGreen,t.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=b(w.brightYellow,t.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=b(w.brightBlue,t.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=b(w.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=b(w.brightCyan,t.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=b(w.brightWhite,t.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const E=Math.min(g.ansi.length-16,w.extendedAnsi.length);for(let T=0;T<E;T++)g.ansi[T+16]=b(w.extendedAnsi[T],t.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(w){w(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 b(w,g){if(w!==void 0)try{return p.css.toColor(w)}catch{}return g}t.ThemeService=S=l([_(0,f.IOptionsService)],S)},6349:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const l=a(8460),_=a(844);class h extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const C=new Array(m);for(let f=0;f<Math.min(m,this.length);f++)C[f]=this._array[this._getCyclicIndex(f)];this._array=C,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let C=this._length;C<m;C++)this._array[C]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,C){this._array[this._getCyclicIndex(m)]=C}push(m){this._array[this._getCyclicIndex(this._length)]=m,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,C,...f){if(C){for(let i=m;i<this._length-C;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+C)];this._length-=C,this.onDeleteEmitter.fire({index:m,amount:C})}for(let i=this._length-1;i>=m;i--)this._array[this._getCyclicIndex(i+f.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<f.length;i++)this._array[this._getCyclicIndex(m+i)]=f[i];if(f.length&&this.onInsertEmitter.fire({index:m,amount:f.length}),this._length+f.length>this._maxLength){const i=this._length+f.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=f.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,C,f){if(!(C<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let n=C-1;n>=0;n--)this.set(m+n+f,this.get(m+n));const i=m+C+f-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<C;i++)this.set(m+i+f,this.get(m+i))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}t.CircularList=h},1439:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function a(l,_=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const p in l)h[p]=_<=1?l[p]:l[p]&&a(l[p],_-1);return h}},8055:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,_=0,h=0;var p,m,C,f,i;function n(s){const u=s.toString(16);return u.length<2?"0"+u:u}function r(s,u){return s<u?(u+.05)/(s+.05):(s+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(s){s.toCss=function(u,S,b,w){return w!==void 0?`#${n(u)}${n(S)}${n(b)}${n(w)}`:`#${n(u)}${n(S)}${n(b)}`},s.toRgba=function(u,S,b,w=255){return(u<<24|S<<16|b<<8|w)>>>0},s.toColor=function(u,S,b,w){return{css:s.toCss(u,S,b,w),rgba:s.toRgba(u,S,b,w)}}}(p||(t.channels=p={})),function(s){function u(S,b){return h=Math.round(255*b),[a,l,_]=i.toChannels(S.rgba),{css:p.toCss(a,l,_,h),rgba:p.toRgba(a,l,_,h)}}s.blend=function(S,b){if(h=(255&b.rgba)/255,h===1)return{css:b.css,rgba:b.rgba};const w=b.rgba>>24&255,g=b.rgba>>16&255,E=b.rgba>>8&255,T=S.rgba>>24&255,B=S.rgba>>16&255,O=S.rgba>>8&255;return a=T+Math.round((w-T)*h),l=B+Math.round((g-B)*h),_=O+Math.round((E-O)*h),{css:p.toCss(a,l,_),rgba:p.toRgba(a,l,_)}},s.isOpaque=function(S){return(255&S.rgba)==255},s.ensureContrastRatio=function(S,b,w){const g=i.ensureContrastRatio(S.rgba,b.rgba,w);if(g)return p.toColor(g>>24&255,g>>16&255,g>>8&255)},s.opaque=function(S){const b=(255|S.rgba)>>>0;return[a,l,_]=i.toChannels(b),{css:p.toCss(a,l,_),rgba:b}},s.opacity=u,s.multiplyOpacity=function(S,b){return h=255&S.rgba,u(S,h*b/255)},s.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(m||(t.color=m={})),function(s){let u,S;try{const b=document.createElement("canvas");b.width=1,b.height=1;const w=b.getContext("2d",{willReadFrequently:!0});w&&(u=w,u.globalCompositeOperation="copy",S=u.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return a=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),p.toColor(a,l,_);case 5:return a=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),h=parseInt(b.slice(4,5).repeat(2),16),p.toColor(a,l,_,h);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const w=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return a=parseInt(w[1]),l=parseInt(w[2]),_=parseInt(w[3]),h=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),p.toColor(a,l,_,h);if(!u||!S)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=S,u.fillStyle=b,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,l,_,h]=u.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(a,l,_,h),css:b}}}(C||(t.css=C={})),function(s){function u(S,b,w){const g=S/255,E=b/255,T=w/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}s.relativeLuminance=function(S){return u(S>>16&255,S>>8&255,255&S)},s.relativeLuminance2=u}(f||(t.rgb=f={})),function(s){function u(b,w,g){const E=b>>24&255,T=b>>16&255,B=b>>8&255;let O=w>>24&255,D=w>>16&255,I=w>>8&255,F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));for(;F<g&&(O>0||D>0||I>0);)O-=Math.max(0,Math.ceil(.1*O)),D-=Math.max(0,Math.ceil(.1*D)),I-=Math.max(0,Math.ceil(.1*I)),F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));return(O<<24|D<<16|I<<8|255)>>>0}function S(b,w,g){const E=b>>24&255,T=b>>16&255,B=b>>8&255;let O=w>>24&255,D=w>>16&255,I=w>>8&255,F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));for(;F<g&&(O<255||D<255||I<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),D=Math.min(255,D+Math.ceil(.1*(255-D))),I=Math.min(255,I+Math.ceil(.1*(255-I))),F=r(f.relativeLuminance2(O,D,I),f.relativeLuminance2(E,T,B));return(O<<24|D<<16|I<<8|255)>>>0}s.blend=function(b,w){if(h=(255&w)/255,h===1)return w;const g=w>>24&255,E=w>>16&255,T=w>>8&255,B=b>>24&255,O=b>>16&255,D=b>>8&255;return a=B+Math.round((g-B)*h),l=O+Math.round((E-O)*h),_=D+Math.round((T-D)*h),p.toRgba(a,l,_)},s.ensureContrastRatio=function(b,w,g){const E=f.relativeLuminance(b>>8),T=f.relativeLuminance(w>>8);if(r(E,T)<g){if(T<E){const D=u(b,w,g),I=r(E,f.relativeLuminance(D>>8));if(I<g){const F=S(b,w,g);return I>r(E,f.relativeLuminance(F>>8))?D:F}return D}const B=S(b,w,g),O=r(E,f.relativeLuminance(B>>8));if(O<g){const D=u(b,w,g);return O>r(E,f.relativeLuminance(D>>8))?B:D}return B}},s.reduceLuminance=u,s.increaseLuminance=S,s.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}}(i||(t.rgba=i={})),t.toPaddedHex=n,t.contrastRatio=r},8969:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const l=a(844),_=a(2585),h=a(4348),p=a(7866),m=a(744),C=a(7302),f=a(6975),i=a(8460),n=a(1753),r=a(1480),s=a(7994),u=a(9282),S=a(5435),b=a(5981),w=a(2660);let g=!1;class E extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event(B=>{var O;(O=this._onScrollApi)==null||O.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 O in B)this.optionsService.options[O]=B[O]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(n.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(r.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(_.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,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((O,D)=>this._inputHandler.parse(O,D))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,O){this._writeBuffer.write(B,O)}writeSync(B,O){this._logService.logLevel<=_.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(B,O)}input(B,O=!0){this.coreService.triggerDataEvent(B,O)}resize(B,O){isNaN(B)||isNaN(O)||(B=Math.max(B,m.MINIMUM_COLS),O=Math.max(O,m.MINIMUM_ROWS),this._bufferService.resize(B,O))}scroll(B,O=!1){this._bufferService.scroll(B,O)}scrollLines(B,O,D){this._bufferService.scrollLines(B,O,D)}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 O=B-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(B,O){return this._inputHandler.registerEscHandler(B,O)}registerDcsHandler(B,O){return this._inputHandler.registerDcsHandler(B,O)}registerCsiHandler(B,O){return this._inputHandler.registerCsiHandler(B,O)}registerOscHandler(B,O){return this._inputHandler.registerOscHandler(B,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?B=O.backend==="conpty"&&O.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(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const O of B)O.dispose()})}}}t.CoreTerminal=E},8460:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a(_=>l.fire(_))},t.runAndSubscribe=function(a,l){return l(void 0),a(_=>l(_))}},5435:function(k,t,a){var l=this&&this.__decorate||function(U,x,L,A){var M,N=arguments.length,z=N<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,x,L,A);else for(var Y=U.length-1;Y>=0;Y--)(M=U[Y])&&(z=(N<3?M(z):N>3?M(x,L,z):M(x,L))||z);return N>3&&z&&Object.defineProperty(x,L,z),z},_=this&&this.__param||function(U,x){return function(L,A){x(L,A,U)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const h=a(2584),p=a(7116),m=a(2015),C=a(844),f=a(482),i=a(8437),n=a(8460),r=a(643),s=a(511),u=a(3734),S=a(2585),b=a(1480),w=a(6242),g=a(6351),E=a(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function O(U,x){if(U>24)return x.setWinLines||!1;switch(U){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var D;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(t.WindowsOptionsReportType=D={}));let I=0;class F extends C.Disposable{getAttrData(){return this._curAttrData}constructor(x,L,A,M,N,z,Y,ee,P=new m.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=L,this._coreService=A,this._logService=M,this._optionsService=N,this._oscLinkService=z,this._coreMouseService=Y,this._unicodeService=ee,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new n.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new n.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new n.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new n.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new n.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new n.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new n.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new n.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new n.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new n.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new n.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:W.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,W,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:W,data:H})}),this._parser.setDcsHandlerFallback((R,W,H)=>{W==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:W,payload:H})}),this._parser.setPrintHandler((R,W,H)=>this.print(R,W,H)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new w.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new w.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new w.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new w.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new w.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new w.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new w.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new w.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new w.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new w.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new w.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new w.OscHandler(R=>this.restoreCursorColor(R))),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 R in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((R,W)=>this.requestStatusString(R,W)))}_preserveStack(x,L,A,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=A,this._parseStack.position=M}_logSlowResolvingAsync(x){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([x,new Promise((L,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(x,L){let A,M=this._activeBuffer.x,N=this._activeBuffer.y,z=0;const Y=this._parseStack.paused;if(Y){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(A),A;M=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>B&&(z=this._parseStack.position+B)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,R=>String.fromCharCode(R)).join("")}"`),typeof x=="string"?x.split("").map(R=>R.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(x.length,B))),Y||this._dirtyRowTracker.clearRange(),x.length>B)for(let R=z;R<x.length;R+=B){const W=R+B<x.length?R+B:x.length,H=typeof x=="string"?this._stringDecoder.decode(x.substring(R,W),this._parseBuffer):this._utf8Decoder.decode(x.subarray(R,W),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,H))return this._preserveStack(M,N,H,R),this._logSlowResolvingAsync(A),A}else if(!Y){const R=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,R))return this._preserveStack(M,N,R,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===M&&this._activeBuffer.y===N||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(x,L,A){let M,N;const z=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,W=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-L>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let Z=this._parser.precedingJoinState;for(let V=L;V<A;++V){if(M=x[V],M<127&&z){const ue=z[String.fromCharCode(M)];ue&&(M=ue.charCodeAt(0))}const ie=this._unicodeService.charProperties(M,Z);N=b.UnicodeService.extractWidth(ie);const ce=b.UnicodeService.extractShouldJoin(ie),he=ce?b.UnicodeService.extractWidth(Z):0;if(Z=ie,Y&&this._onA11yChar.fire((0,f.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-he>ee){if(P){const ue=H;let te=this._activeBuffer.x-he;for(this._activeBuffer.x=he,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&H instanceof i.BufferLine&&H.copyCellsFrom(ue,te,0,he,!1);te<ee;)ue.setCellFromCodepoint(te++,0,1,W)}else if(this._activeBuffer.x=ee-1,N===2)continue}if(ce&&this._activeBuffer.x){const ue=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ue,M,N);for(let te=N-he;--te>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(R&&(H.insertCells(this._activeBuffer.x,N-he,this._activeBuffer.getNullCell(W)),H.getWidth(ee-1)===2&&H.setCellFromCodepoint(ee-1,r.NULL_CELL_CODE,r.NULL_CELL_WIDTH,W)),H.setCellFromCodepoint(this._activeBuffer.x++,M,N,W),N>0)for(;--N;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=Z,this._activeBuffer.x<ee&&A-L>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,W),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,L){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,L):this._parser.registerCsiHandler(x,A=>!O(A.params[0],this._optionsService.rawOptions.windowOptions)||L(A))}registerDcsHandler(x,L){return this._parser.registerDcsHandler(x,new g.DcsHandler(L))}registerEscHandler(x,L){return this._parser.registerEscHandler(x,L)}registerOscHandler(x,L){return this._parser.registerOscHandler(x,new w.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var x;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&&((x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&x.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=x,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+L)}cursorUp(x){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const L=x.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const L=x.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,L,A,M=!1,N=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);z.replaceCells(L,A,this._activeBuffer.getNullCell(this._eraseAttrData()),N),M&&(z.isWrapped=!1)}_resetBufferLine(x,L=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),A.isWrapped=!1)}eraseInDisplay(x,L=!1){let A;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);A<this._bufferService.rows;A++)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(x,L=!1){switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;L--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;L--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let L=x.params[0]||1;for(;L--;)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(x){let L=x.params[0]||1;for(;L--;)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(i.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const L=this._parser.precedingJoinState;if(!L)return!0;const A=x.params[0]||1,M=b.UnicodeService.extractWidth(L),N=this._activeBuffer.x-M,z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),Y=new Uint32Array(z.length*A);let ee=0;for(let R=0;R<z.length;){const W=z.codePointAt(R)||0;Y[ee++]=W,R+=W>65535?2:1}let P=ee;for(let R=1;R<A;++R)Y.copyWithin(P,0,ee),P+=ee;return this.print(Y,0,P),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){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(),x.params[L]===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(x,L){const A=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:N}=this._coreMouseService,z=this._coreService,{buffers:Y,cols:ee}=this._bufferService,{active:P,alt:R}=Y,W=this._optionsService.rawOptions,H=ce=>ce?1:2,Z=x.params[0];return V=Z,ie=L?Z===2?4:Z===4?H(z.modes.insertMode):Z===12?3:Z===20?H(W.convertEol):0:Z===1?H(A.applicationCursorKeys):Z===3?W.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:Z===6?H(A.origin):Z===7?H(A.wraparound):Z===8?3:Z===9?H(M==="X10"):Z===12?H(W.cursorBlink):Z===25?H(!z.isCursorHidden):Z===45?H(A.reverseWraparound):Z===66?H(A.applicationKeypad):Z===67?4:Z===1e3?H(M==="VT200"):Z===1002?H(M==="DRAG"):Z===1003?H(M==="ANY"):Z===1004?H(A.sendFocus):Z===1005?4:Z===1006?H(N==="SGR"):Z===1015?4:Z===1016?H(N==="SGR_PIXELS"):Z===1048?1:Z===47||Z===1047||Z===1049?H(P===R):Z===2004?H(A.bracketedPasteMode):0,z.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${V};${ie}$y`),!0;var V,ie}_updateAttrColor(x,L,A,M,N){return L===2?(x|=50331648,x&=-16777216,x|=u.AttributeData.fromColorRGB([A,M,N])):L===5&&(x&=-50331904,x|=33554432|255&A),x}_extractColor(x,L,A){const M=[0,0,-1,0,0,0];let N=0,z=0;do{if(M[z+N]=x.params[L+z],x.hasSubParams(L+z)){const Y=x.getSubParams(L+z);let ee=0;do M[1]===5&&(N=1),M[z+ee+1+N]=Y[ee];while(++ee<Y.length&&ee+z+1+N<M.length);break}if(M[1]===5&&z+N>=2||M[1]===2&&z+N>=5)break;M[1]&&(N=1)}while(++z+L<x.length&&z+N<M.length);for(let Y=2;Y<M.length;++Y)M[Y]===-1&&(M[Y]=0);switch(M[0]){case 38:A.fg=this._updateAttrColor(A.fg,M[1],M[3],M[4],M[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,M[1],M[3],M[4],M[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,M[1],M[3],M[4],M[5])}return z}_processUnderline(x,L){L.extended=L.extended.clone(),(!~x||x>5)&&(x=1),L.extended.underlineStyle=x,L.fg|=268435456,x===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(x){x.fg=i.DEFAULT_ATTR_DATA.fg,x.bg=i.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=x.length;let A;const M=this._curAttrData;for(let N=0;N<L;N++)A=x.params[N],A>=30&&A<=37?(M.fg&=-50331904,M.fg|=16777216|A-30):A>=40&&A<=47?(M.bg&=-50331904,M.bg|=16777216|A-40):A>=90&&A<=97?(M.fg&=-50331904,M.fg|=16777224|A-90):A>=100&&A<=107?(M.bg&=-50331904,M.bg|=16777224|A-100):A===0?this._processSGR0(M):A===1?M.fg|=134217728:A===3?M.bg|=67108864:A===4?(M.fg|=268435456,this._processUnderline(x.hasSubParams(N)?x.getSubParams(N)[0]:1,M)):A===5?M.fg|=536870912:A===7?M.fg|=67108864:A===8?M.fg|=1073741824:A===9?M.fg|=2147483648:A===2?M.bg|=134217728:A===21?this._processUnderline(2,M):A===22?(M.fg&=-134217729,M.bg&=-134217729):A===23?M.bg&=-67108865:A===24?(M.fg&=-268435457,this._processUnderline(0,M)):A===25?M.fg&=-536870913:A===27?M.fg&=-67108865:A===28?M.fg&=-1073741825:A===29?M.fg&=2147483647:A===39?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):A===49?(M.bg&=-67108864,M.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?N+=this._extractColor(x,N,M):A===53?M.bg|=1073741824:A===55?M.bg&=-1073741825:A===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):A===100?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${A}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${A}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.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(x){const L=x.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=L%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(x){const L=x.params[0]||1;let A;return(x.length<2||(A=x.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(x){if(!O(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const L=[],A=x.split(";");for(;A.length>1;){const M=A.shift(),N=A.shift();if(/^\d+$/.exec(M)){const z=parseInt(M);if(G(z))if(N==="?")L.push({type:0,index:z});else{const Y=(0,E.parseColor)(N);Y&&L.push({type:1,index:z,color:Y})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(x){const L=x.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(x,L){this._getCurrentLinkId()&&this._finishHyperlink();const A=x.split(":");let M;const N=A.findIndex(z=>z.startsWith("id="));return N!==-1&&(M=A[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(x,L){const A=x.split(";");for(let M=0;M<A.length&&!(L>=this._specialColors.length);++M,++L)if(A[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const N=(0,E.parseColor)(A[M]);N&&this._onColor.fire([{type:1,index:this._specialColors[L],color:N}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const L=[],A=x.split(";");for(let M=0;M<A.length;++M)if(/^\d+$/.exec(A[M])){const N=parseInt(A[M]);G(N)&&L.push({type:2,index:N})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,p.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(T[x[0]],p.CHARSETS[x[1]]||p.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,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=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new s.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const A=this._activeBuffer.ybase+this._activeBuffer.y+L,M=this._activeBuffer.lines.get(A);M&&(M.fill(x),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,L){const A=this._bufferService.buffer,M=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${N}${h.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,L){this._dirtyRowTracker.markRangeDirty(x,L)}}t.InputHandler=F;let $=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,x){U>x&&(I=U,U=x,x=I),U<this.start&&(this.start=U),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}$=l([_(0,S.IBufferService)],$)},844:(k,t)=>{function a(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var _;this._isDisposed||l===this._value||((_=this._value)==null||_.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,h,p){this._data[_]||(this._data[_]={}),this._data[_][h]=p}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,_,h,p,m){this._data.get(l,_)||this._data.set(l,_,new a),this._data.get(l,_).set(h,p,m)}get(l,_,h,p){var m;return(m=this._data.get(l,_))==null?void 0:m.get(h,p)}clear(){this._data.clear()}}},6114:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},6106:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let a=0;t.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===_);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,_){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let _=0,h=this._array.length-1;for(;h>=_;){let p=_+h>>1;const m=this._getKey(this._array[p]);if(m>l)h=p-1;else{if(!(m<l)){for(;p>0&&this._getKey(this._array[p-1])===l;)p--;return p}_=p+1}}return _}}},7226:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let C=0,f=0,i=m.timeRemaining(),n=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),f=Math.max(C,f),n=m.timeRemaining(),1.5*f>n)return i-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-C))}ms`),void this._start();i=n}this.clear()}}class h extends _{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const C=Date.now()+m;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}t.PriorityTaskQueue=h,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:h,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const l=a(643);t.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=h==null?void 0:h.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&p[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new a;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,p=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=p}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},9092:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const l=a(6349),_=a(7226),h=a(3734),p=a(8437),m=a(4634),C=a(511),f=a(643),i=a(4863),n=a(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(r,s,u){this._hasScrollback=r,this._optionsService=s,this._bufferService=u,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=n.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(r){return r?(this._nullCell.fg=r.fg,this._nullCell.bg=r.bg,this._nullCell.extended=r.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(r){return r?(this._whitespaceCell.fg=r.fg,this._whitespaceCell.bg=r.bg,this._whitespaceCell.extended=r.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(r,s){return new p.BufferLine(this._bufferService.cols,this.getNullCell(r),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const r=this.ybase+this.y-this.ydisp;return r>=0&&r<this._rows}_getCorrectBufferLength(r){if(!this._hasScrollback)return r;const s=r+this._optionsService.rawOptions.scrollback;return s>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:s}fillViewportRows(r){if(this.lines.length===0){r===void 0&&(r=p.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(r))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(r,s){const u=this.getNullCell(p.DEFAULT_ATTR_DATA);let S=0;const b=this._getCorrectBufferLength(s);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<r)for(let g=0;g<this.lines.length;g++)S+=+this.lines.get(g).resize(r,u);let w=0;if(this._rows<s)for(let g=this._rows;g<s;g++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(r,u)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(r,u)));else for(let g=this._rows;g>s;g--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const g=this.lines.length-b;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=b}this.x=Math.min(this.x,r-1),this.y=Math.min(this.y,s-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,r-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(r,s),this._cols>r))for(let w=0;w<this.lines.length;w++)S+=+this.lines.get(w).resize(r,u);this._cols=r,this._rows=s,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let r=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,r=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return r}get _isReflowEnabled(){const r=this._optionsService.rawOptions.windowsPty;return r&&r.buildNumber?this._hasScrollback&&r.backend==="conpty"&&r.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(r,s){this._cols!==r&&(r>this._cols?this._reflowLarger(r,s):this._reflowSmaller(r,s))}_reflowLarger(r,s){const u=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,r,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(u.length>0){const S=(0,m.reflowLargerCreateNewLayout)(this.lines,u);(0,m.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(r,s,S.countRemoved)}}_reflowLargerAdjustViewport(r,s,u){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=u;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new p.BufferLine(r,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-u,0)}_reflowSmaller(r,s){const u=this.getNullCell(p.DEFAULT_ATTR_DATA),S=[];let b=0;for(let w=this.lines.length-1;w>=0;w--){let g=this.lines.get(w);if(!g||!g.isWrapped&&g.getTrimmedLength()<=r)continue;const E=[g];for(;g.isWrapped&&w>0;)g=this.lines.get(--w),E.unshift(g);const T=this.ybase+this.y;if(T>=w&&T<w+E.length)continue;const B=E[E.length-1].getTrimmedLength(),O=(0,m.reflowSmallerGetNewLineLengths)(E,this._cols,r),D=O.length-E.length;let I;I=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const F=[];for(let A=0;A<D;A++){const M=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(M)}F.length>0&&(S.push({start:w+E.length+b,newLines:F}),b+=F.length),E.push(...F);let $=O.length-1,G=O[$];G===0&&($--,G=O[$]);let U=E.length-D-1,x=B;for(;U>=0;){const A=Math.min(x,G);if(E[$]===void 0)break;if(E[$].copyCellsFrom(E[U],x-A,G-A,A,!0),G-=A,G===0&&($--,G=O[$]),x-=A,x===0){U--;const M=Math.max(U,0);x=(0,m.getWrappedLineTrimmedLength)(E,M,this._cols)}}for(let A=0;A<E.length;A++)O[A]<r&&E[A].setCell(O[A],u);let L=D-I;for(;L-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+s-1)}if(S.length>0){const w=[],g=[];for(let $=0;$<this.lines.length;$++)g.push(this.lines.get($));const E=this.lines.length;let T=E-1,B=0,O=S[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let D=0;for(let $=Math.min(this.lines.maxLength-1,E+b-1);$>=0;$--)if(O&&O.start>T+D){for(let G=O.newLines.length-1;G>=0;G--)this.lines.set($--,O.newLines[G]);$++,w.push({index:T+1,amount:O.newLines.length}),D+=O.newLines.length,O=S[++B]}else this.lines.set($,g[T--]);let I=0;for(let $=w.length-1;$>=0;$--)w[$].index+=I,this.lines.onInsertEmitter.fire(w[$]),I+=w[$].amount;const F=Math.max(0,E+b-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(r,s,u=0,S){const b=this.lines.get(r);return b?b.translateToString(s,u,S):""}getWrappedRangeForLine(r){let s=r,u=r;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;u+1<this.lines.length&&this.lines.get(u+1).isWrapped;)u++;return{first:s,last:u}}setupTabStops(r){for(r!=null?this.tabs[r]||(r=this.prevStop(r)):(this.tabs={},r=0);r<this._cols;r+=this._optionsService.rawOptions.tabStopWidth)this.tabs[r]=!0}prevStop(r){for(r==null&&(r=this.x);!this.tabs[--r]&&r>0;);return r>=this._cols?this._cols-1:r<0?0:r}nextStop(r){for(r==null&&(r=this.x);!this.tabs[++r]&&r<this._cols;);return r>=this._cols?this._cols-1:r<0?0:r}clearMarkers(r){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===r&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].dispose(),this.markers.splice(r--,1);this._isClearing=!1}addMarker(r){const s=new i.Marker(r);return this.markers.push(s),s.register(this.lines.onTrim(u=>{s.line-=u,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(u=>{s.line>=u.index&&(s.line+=u.amount)})),s.register(this.lines.onDelete(u=>{s.line>=u.index&&s.line<u.index+u.amount&&s.dispose(),s.line>u.index&&(s.line-=u.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(r){this._isClearing||this.markers.splice(this.markers.indexOf(r),1)}}},8437:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const l=a(3734),_=a(511),h=a(643),p=a(482);t.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let m=0;class C{constructor(i,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const s=n||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let u=0;u<i;++u)this.setCell(u,s);this.length=i}get(i){const n=this._data[3*i+0],r=2097151&n;return[this._data[3*i+1],2097152&n?this._combined[i]:r?(0,p.stringFromCodePoint)(r):"",n>>22,2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):r]}set(i,n){this._data[3*i+1]=n[h.CHAR_DATA_ATTR_INDEX],n[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=n[1],this._data[3*i+0]=2097152|i|n[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=n[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&n}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i]:2097151&n?(0,p.stringFromCodePoint)(2097151&n):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,n){return m=3*i,n.content=this._data[m+0],n.fg=this._data[m+1],n.bg=this._data[m+2],2097152&n.content&&(n.combinedData=this._combined[i]),268435456&n.bg&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){2097152&n.content&&(this._combined[i]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[i]=n.extended),this._data[3*i+0]=n.content,this._data[3*i+1]=n.fg,this._data[3*i+2]=n.bg}setCellFromCodepoint(i,n,r,s){268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=n|r<<22,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}addCodepointToCell(i,n,r){let s=this._data[3*i+0];2097152&s?this._combined[i]+=(0,p.stringFromCodePoint)(n):2097151&s?(this._combined[i]=(0,p.stringFromCodePoint)(2097151&s)+(0,p.stringFromCodePoint)(n),s&=-2097152,s|=2097152):s=n|4194304,r&&(s&=-12582913,s|=r<<22),this._data[3*i+0]=s}insertCells(i,n,r){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length-i){const s=new _.CellData;for(let u=this.length-i-n-1;u>=0;--u)this.setCell(i+n+u,this.loadCell(i+u,s));for(let u=0;u<n;++u)this.setCell(i+u,r)}else for(let s=i;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(i,n,r){if(i%=this.length,n<this.length-i){const s=new _.CellData;for(let u=0;u<this.length-i-n;++u)this.setCell(i+u,this.loadCell(i+n+u,s));for(let u=this.length-n;u<this.length;++u)this.setCell(u,r)}else for(let s=i;s<this.length;++s)this.setCell(s,r);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),this.getWidth(i)!==0||this.hasContent(i)||this.setCellFromCodepoint(i,0,1,r)}replaceCells(i,n,r,s=!1){if(s)for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,r),i++;else for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);i<n&&i<this.length;)this.setCell(i++,r)}resize(i,n){if(i===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const r=3*i;if(i>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{const s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<i;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);const s=Object.keys(this._combined);for(let S=0;S<s.length;S++){const b=parseInt(s[S],10);b>=i&&delete this._combined[b]}const u=Object.keys(this._extendedAttrs);for(let S=0;S<u.length;S++){const b=parseInt(u[S],10);b>=i&&delete this._extendedAttrs[b]}}return this.length=i,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n)for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,i);else{this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,i)}}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(const n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(const n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){const i=new C(0);i._data=new Uint32Array(this._data),i.length=this.length;for(const n in this._combined)i._combined[n]=this._combined[n];for(const n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,n,r,s,u){const S=i._data;if(u)for(let w=s-1;w>=0;w--){for(let g=0;g<3;g++)this._data[3*(r+w)+g]=S[3*(n+w)+g];268435456&S[3*(n+w)+2]&&(this._extendedAttrs[r+w]=i._extendedAttrs[n+w])}else for(let w=0;w<s;w++){for(let g=0;g<3;g++)this._data[3*(r+w)+g]=S[3*(n+w)+g];268435456&S[3*(n+w)+2]&&(this._extendedAttrs[r+w]=i._extendedAttrs[n+w])}const b=Object.keys(i._combined);for(let w=0;w<b.length;w++){const g=parseInt(b[w],10);g>=n&&(this._combined[g-n+r]=i._combined[g])}}translateToString(i,n,r,s){n=n??0,r=r??this.length,i&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let u="";for(;n<r;){const S=this._data[3*n+0],b=2097151&S,w=2097152&S?this._combined[n]:b?(0,p.stringFromCodePoint)(b):h.WHITESPACE_CELL_CHAR;if(u+=w,s)for(let g=0;g<w.length;++g)s.push(n);n+=S>>22||1}return s&&s.push(n),u}}t.BufferLine=C},4841:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(k,t)=>{function a(l,_,h){if(_===l.length-1)return l[_].getTrimmedLength();const p=!l[_].hasContent(h-1)&&l[_].getWidth(h-1)===1,m=l[_+1].getWidth(0)===2;return p&&m?h-1:h}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(l,_,h,p,m){const C=[];for(let f=0;f<l.length-1;f++){let i=f,n=l.get(++i);if(!n.isWrapped)continue;const r=[l.get(f)];for(;i<l.length&&n.isWrapped;)r.push(n),n=l.get(++i);if(p>=f&&p<i){f+=r.length-1;continue}let s=0,u=a(r,s,_),S=1,b=0;for(;S<r.length;){const g=a(r,S,_),E=g-b,T=h-u,B=Math.min(E,T);r[s].copyCellsFrom(r[S],b,u,B,!1),u+=B,u===h&&(s++,u=0),b+=B,b===g&&(S++,b=0),u===0&&s!==0&&r[s-1].getWidth(h-1)===2&&(r[s].copyCellsFrom(r[s-1],h-1,u++,1,!1),r[s-1].setCell(h-1,m))}r[s].replaceCells(u,h,m);let w=0;for(let g=r.length-1;g>0&&(g>s||r[g].getTrimmedLength()===0);g--)w++;w>0&&(C.push(f+r.length-w),C.push(w)),f+=r.length-1}return C},t.reflowLargerCreateNewLayout=function(l,_){const h=[];let p=0,m=_[p],C=0;for(let f=0;f<l.length;f++)if(m===f){const i=_[++p];l.onDeleteEmitter.fire({index:f-C,amount:i}),f+=i-1,C+=i,m=_[++p]}else h.push(f);return{layout:h,countRemoved:C}},t.reflowLargerApplyNewLayout=function(l,_){const h=[];for(let p=0;p<_.length;p++)h.push(l.get(_[p]));for(let p=0;p<h.length;p++)l.set(p,h[p]);l.length=_.length},t.reflowSmallerGetNewLineLengths=function(l,_,h){const p=[],m=l.map((n,r)=>a(l,r,_)).reduce((n,r)=>n+r);let C=0,f=0,i=0;for(;i<m;){if(m-i<h){p.push(m-i);break}C+=h;const n=a(l,f,_);C>n&&(C-=n,f++);const r=l[f].getWidth(C-1)===2;r&&C--;const s=r?h-1:h;p.push(s),i+=s}return p},t.getWrappedLineTrimmedLength=a},5295:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const l=a(8460),_=a(844),h=a(9092);class p extends _.Disposable{constructor(C,f){super(),this._optionsService=C,this._bufferService=f,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,f){this._normal.resize(C,f),this._alt.resize(C,f),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}t.BufferSet=p},511:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(482),_=a(643),h=a(3734);class p extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const f=new p;return f.setFromCharData(C),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(C[_.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(C[_.CHAR_DATA_CHAR_INDEX].length===2){const i=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const n=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(i-55296)+n-56320+65536|C[_.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[_.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=C[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=p},643:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const l=a(8460),_=a(844);class h{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}t.Marker=h,h._nextId=1},7116:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(k,t)=>{var a,l,_;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
8
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(a||(t.C0=a={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(l||(t.C1=l={})),function(h){h.ST=`${a.ESC}\\`}(_||(t.C1_ESCAPED=_={}))},7399:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const l=a(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(h,p,m,C){const f={type:0,cancel:!1,key:void 0},i=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?f.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?f.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?f.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(f.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:f.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(f.key=l.C0.ESC+f.key);break;case 9:if(h.shiftKey){f.key=l.C0.ESC+"[Z";break}f.key=l.C0.HT,f.cancel=!0;break;case 13:f.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,f.cancel=!0;break;case 27:f.key=l.C0.ESC,h.altKey&&(f.key=l.C0.ESC+l.C0.ESC),f.cancel=!0;break;case 37:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"D",f.key===l.C0.ESC+"[1;3D"&&(f.key=l.C0.ESC+(m?"b":"[1;5D"))):f.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"C",f.key===l.C0.ESC+"[1;3C"&&(f.key=l.C0.ESC+(m?"f":"[1;5C"))):f.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"A",m||f.key!==l.C0.ESC+"[1;3A"||(f.key=l.C0.ESC+"[1;5A")):f.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;i?(f.key=l.C0.ESC+"[1;"+(i+1)+"B",m||f.key!==l.C0.ESC+"[1;3B"||(f.key=l.C0.ESC+"[1;5B")):f.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(f.key=l.C0.ESC+"[2~");break;case 46:f.key=i?l.C0.ESC+"[3;"+(i+1)+"~":l.C0.ESC+"[3~";break;case 36:f.key=i?l.C0.ESC+"[1;"+(i+1)+"H":p?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:f.key=i?l.C0.ESC+"[1;"+(i+1)+"F":p?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?f.type=2:h.ctrlKey?f.key=l.C0.ESC+"[5;"+(i+1)+"~":f.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?f.type=3:h.ctrlKey?f.key=l.C0.ESC+"[6;"+(i+1)+"~":f.key=l.C0.ESC+"[6~";break;case 112:f.key=i?l.C0.ESC+"[1;"+(i+1)+"P":l.C0.ESC+"OP";break;case 113:f.key=i?l.C0.ESC+"[1;"+(i+1)+"Q":l.C0.ESC+"OQ";break;case 114:f.key=i?l.C0.ESC+"[1;"+(i+1)+"R":l.C0.ESC+"OR";break;case 115:f.key=i?l.C0.ESC+"[1;"+(i+1)+"S":l.C0.ESC+"OS";break;case 116:f.key=i?l.C0.ESC+"[15;"+(i+1)+"~":l.C0.ESC+"[15~";break;case 117:f.key=i?l.C0.ESC+"[17;"+(i+1)+"~":l.C0.ESC+"[17~";break;case 118:f.key=i?l.C0.ESC+"[18;"+(i+1)+"~":l.C0.ESC+"[18~";break;case 119:f.key=i?l.C0.ESC+"[19;"+(i+1)+"~":l.C0.ESC+"[19~";break;case 120:f.key=i?l.C0.ESC+"[20;"+(i+1)+"~":l.C0.ESC+"[20~";break;case 121:f.key=i?l.C0.ESC+"[21;"+(i+1)+"~":l.C0.ESC+"[21~";break;case 122:f.key=i?l.C0.ESC+"[23;"+(i+1)+"~":l.C0.ESC+"[23~";break;case 123:f.key=i?l.C0.ESC+"[24;"+(i+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(m&&!C||!h.altKey||h.metaKey)!m||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?f.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(f.key=l.C0.US),h.key==="@"&&(f.key=l.C0.NUL)):h.keyCode===65&&(f.type=1);else{const n=_[h.keyCode],r=n==null?void 0:n[h.shiftKey?1:0];if(r)f.key=l.C0.ESC+r;else if(h.keyCode>=65&&h.keyCode<=90){const s=h.ctrlKey?h.keyCode-64:h.keyCode+32;let u=String.fromCharCode(s);h.shiftKey&&(u=u.toUpperCase()),f.key=l.C0.ESC+u}else if(h.keyCode===32)f.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let s=h.code.slice(3,4);h.shiftKey||(s=s.toLowerCase()),f.key=l.C0.ESC+s,f.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?f.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?f.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?f.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?f.key=l.C0.DEL:h.keyCode===219?f.key=l.C0.ESC:h.keyCode===220?f.key=l.C0.FS:h.keyCode===221&&(f.key=l.C0.GS)}return f}},482:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,_=a.length){let h="";for(let p=l;p<_;++p){let m=a[p];m>65535?(m-=65536,h+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):h+=String.fromCharCode(m)}return h},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const _=a.length;if(!_)return 0;let h=0,p=0;if(this._interim){const m=a.charCodeAt(p++);56320<=m&&m<=57343?l[h++]=1024*(this._interim-55296)+m-56320+65536:(l[h++]=this._interim,l[h++]=m),this._interim=0}for(let m=p;m<_;++m){const C=a.charCodeAt(m);if(55296<=C&&C<=56319){if(++m>=_)return this._interim=C,h;const f=a.charCodeAt(m);56320<=f&&f<=57343?l[h++]=1024*(C-55296)+f-56320+65536:(l[h++]=C,l[h++]=f)}else C!==65279&&(l[h++]=C)}return h}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const _=a.length;if(!_)return 0;let h,p,m,C,f=0,i=0,n=0;if(this.interim[0]){let u=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let b,w=0;for(;(b=63&this.interim[++w])&&w<4;)S<<=6,S|=b;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=g-w;for(;n<E;){if(n>=_)return 0;if(b=a[n++],(192&b)!=128){n--,u=!0;break}this.interim[w++]=b,S<<=6,S|=63&b}u||(g===2?S<128?n--:l[f++]=S:g===3?S<2048||S>=55296&&S<=57343||S===65279||(l[f++]=S):S<65536||S>1114111||(l[f++]=S)),this.interim.fill(0)}const r=_-4;let s=n;for(;s<_;){for(;!(!(s<r)||128&(h=a[s])||128&(p=a[s+1])||128&(m=a[s+2])||128&(C=a[s+3]));)l[f++]=h,l[f++]=p,l[f++]=m,l[f++]=C,s+=4;if(h=a[s++],h<128)l[f++]=h;else if((224&h)==192){if(s>=_)return this.interim[0]=h,f;if(p=a[s++],(192&p)!=128){s--;continue}if(i=(31&h)<<6|63&p,i<128){s--;continue}l[f++]=i}else if((240&h)==224){if(s>=_)return this.interim[0]=h,f;if(p=a[s++],(192&p)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,f;if(m=a[s++],(192&m)!=128){s--;continue}if(i=(15&h)<<12|(63&p)<<6|63&m,i<2048||i>=55296&&i<=57343||i===65279)continue;l[f++]=i}else if((248&h)==240){if(s>=_)return this.interim[0]=h,f;if(p=a[s++],(192&p)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,f;if(m=a[s++],(192&m)!=128){s--;continue}if(s>=_)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=m,f;if(C=a[s++],(192&C)!=128){s--;continue}if(i=(7&h)<<18|(63&p)<<12|(63&m)<<6|63&C,i<65536||i>1114111)continue;l[f++]=i}}return f}}},225:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const l=a(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;t.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:function(C,f){let i,n=0,r=f.length-1;if(C<f[0][0]||C>f[r][1])return!1;for(;r>=n;)if(i=n+r>>1,C>f[i][1])n=i+1;else{if(!(C<f[i][0]))return!0;r=i-1}return!1}(m,h)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,C){let f=this.wcwidth(m),i=f===0&&C!==0;if(i){const n=l.UnicodeService.extractWidth(C);n===0?i=!1:n>f&&(f=n)}return l.UnicodeService.createPropertyValue(0,f,i)}}},5981:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const l=a(8460),_=a(844);class h extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(C),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(C)}_innerWrite(m=0,C=!0){const f=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],n=this._action(i,C);if(n){const s=u=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(f,u);return void n.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(s)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=i.length,Date.now()-f>=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()}}t.WriteBuffer=h},5941:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function _(h,p){const m=h.toString(16),C=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}t.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=a.exec(p);if(m){const C=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/C*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/C*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/C*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),l.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,C=[0,0,0];for(let f=0;f<3;++f){const i=parseInt(p.slice(m*f,m*f+m),16);C[f]=m===1?i<<4:m===2?i:m===3?i>>4:i>>8}return C}},t.toRgbString=function(h,p=16){const[m,C,f]=h;return`rgb:${_(m,p)}/${_(C,p)}/${_(f,p)}`}},5770:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const l=a(482),_=a(8742),h=a(5770),p=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(C,f){this._handlers[C]===void 0&&(this._handlers[C]=[]);const i=this._handlers[C];return i.push(f),{dispose:()=>{const n=i.indexOf(f);n!==-1&&i.splice(n,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(C,f){if(this.reset(),this._ident=C,this._active=this._handlers[C]||p,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(C,f,i){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(C,f,i);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(C,f,i))}unhook(C,f=!0){if(this._active.length){let i=!1,n=this._active.length-1,r=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=f,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;n>=0&&(i=this._active[n].unhook(C),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",C);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),t.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=m,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():m,this._data="",this._hitLimit=!1}put(C,f,i){this._hitLimit||(this._data+=(0,l.utf32ToString)(C,f,i),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let f=!1;if(this._hitLimit)f=!1;else if(C&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(i=>(this._params=m,this._data="",this._hitLimit=!1,i));return this._params=m,this._data="",this._hitLimit=!1,f}}},2015:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const l=a(844),_=a(8742),h=a(6242),p=a(6351);class m{constructor(n){this.table=new Uint8Array(n)}setDefault(n,r){this.table.fill(n<<4|r)}add(n,r,s,u){this.table[r<<8|n]=s<<4|u}addMany(n,r,s,u){for(let S=0;S<n.length;S++)this.table[r<<8|n[S]]=s<<4|u}}t.TransitionTable=m;const C=160;t.VT500_TRANSITION_TABLE=function(){const i=new m(4095),n=Array.apply(null,Array(256)).map((w,g)=>g),r=(w,g)=>n.slice(w,g),s=r(32,127),u=r(0,24);u.push(25),u.push.apply(u,r(28,32));const S=r(0,14);let b;for(b in i.setDefault(1,0),i.addMany(s,0,2,0),S)i.addMany([24,26,153,154],b,3,0),i.addMany(r(128,144),b,3,0),i.addMany(r(144,152),b,3,0),i.add(156,b,0,0),i.add(27,b,11,1),i.add(157,b,4,8),i.addMany([152,158,159],b,0,7),i.add(155,b,11,3),i.add(144,b,11,9);return i.addMany(u,0,3,0),i.addMany(u,1,3,1),i.add(127,1,0,1),i.addMany(u,8,0,8),i.addMany(u,3,3,3),i.add(127,3,0,3),i.addMany(u,4,3,4),i.add(127,4,0,4),i.addMany(u,6,3,6),i.addMany(u,5,3,5),i.add(127,5,0,5),i.addMany(u,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(s,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(r(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(s,7,0,7),i.addMany(u,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(r(64,127),3,7,0),i.addMany(r(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(r(48,60),4,8,4),i.addMany(r(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(r(32,64),6,0,6),i.add(127,6,0,6),i.addMany(r(64,127),6,0,0),i.addMany(r(32,48),3,9,5),i.addMany(r(32,48),5,9,5),i.addMany(r(48,64),5,0,6),i.addMany(r(64,127),5,7,0),i.addMany(r(32,48),4,9,5),i.addMany(r(32,48),1,9,2),i.addMany(r(32,48),2,9,2),i.addMany(r(48,127),2,10,0),i.addMany(r(48,80),1,10,0),i.addMany(r(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(r(96,127),1,10,0),i.add(80,1,11,9),i.addMany(u,9,0,9),i.add(127,9,0,9),i.addMany(r(28,32),9,0,9),i.addMany(r(32,48),9,9,12),i.addMany(r(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(u,11,0,11),i.addMany(r(32,128),11,0,11),i.addMany(r(28,32),11,0,11),i.addMany(u,10,0,10),i.add(127,10,0,10),i.addMany(r(28,32),10,0,10),i.addMany(r(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(r(32,48),10,9,12),i.addMany(u,12,0,12),i.add(127,12,0,12),i.addMany(r(28,32),12,0,12),i.addMany(r(32,48),12,9,12),i.addMany(r(48,64),12,0,11),i.addMany(r(64,127),12,12,13),i.addMany(r(64,127),10,12,13),i.addMany(r(64,127),9,12,13),i.addMany(u,13,13,13),i.addMany(s,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(C,0,2,0),i.add(C,8,5,8),i.add(C,6,0,6),i.add(C,11,0,11),i.add(C,13,13,13),i}();class f extends l.Disposable{constructor(n=t.VT500_TRANSITION_TABLE){super(),this._transitions=n,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,s,u)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,s)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(n,r=[64,126]){let s=0;if(n.prefix){if(n.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=n.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(n.intermediates){if(n.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<n.intermediates.length;++S){const b=n.intermediates.charCodeAt(S);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=b}}if(n.final.length!==1)throw new Error("final must be a single byte");const u=n.final.charCodeAt(0);if(r[0]>u||u>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return s<<=8,s|=u,s}identToString(n){const r=[];for(;n;)r.push(String.fromCharCode(255&n)),n>>=8;return r.reverse().join("")}setPrintHandler(n){this._printHandler=n}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(n,r){const s=this._identifier(n,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const u=this._escHandlers[s];return u.push(r),{dispose:()=>{const S=u.indexOf(r);S!==-1&&u.splice(S,1)}}}clearEscHandler(n){this._escHandlers[this._identifier(n,[48,126])]&&delete this._escHandlers[this._identifier(n,[48,126])]}setEscHandlerFallback(n){this._escHandlerFb=n}setExecuteHandler(n,r){this._executeHandlers[n.charCodeAt(0)]=r}clearExecuteHandler(n){this._executeHandlers[n.charCodeAt(0)]&&delete this._executeHandlers[n.charCodeAt(0)]}setExecuteHandlerFallback(n){this._executeHandlerFb=n}registerCsiHandler(n,r){const s=this._identifier(n);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const u=this._csiHandlers[s];return u.push(r),{dispose:()=>{const S=u.indexOf(r);S!==-1&&u.splice(S,1)}}}clearCsiHandler(n){this._csiHandlers[this._identifier(n)]&&delete this._csiHandlers[this._identifier(n)]}setCsiHandlerFallback(n){this._csiHandlerFb=n}registerDcsHandler(n,r){return this._dcsParser.registerHandler(this._identifier(n),r)}clearDcsHandler(n){this._dcsParser.clearHandler(this._identifier(n))}setDcsHandlerFallback(n){this._dcsParser.setHandlerFallback(n)}registerOscHandler(n,r){return this._oscParser.registerHandler(n,r)}clearOscHandler(n){this._oscParser.clearHandler(n)}setOscHandlerFallback(n){this._oscParser.setHandlerFallback(n)}setErrorHandler(n){this._errorHandler=n}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(n,r,s,u,S){this._parseStack.state=n,this._parseStack.handlers=r,this._parseStack.handlerPos=s,this._parseStack.transition=u,this._parseStack.chunkPos=S}parse(n,r,s){let u,S=0,b=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&E>-1){for(;E>=0&&(u=g[E](this._params),u!==!0);E--)if(u instanceof Promise)return this._parseStack.handlerPos=E,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&E>-1){for(;E>=0&&(u=g[E](),u!==!0);E--)if(u instanceof Promise)return this._parseStack.handlerPos=E,u}this._parseStack.handlers=[];break;case 6:if(S=n[this._parseStack.chunkPos],u=this._dcsParser.unhook(S!==24&&S!==26,s),u)return u;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=n[this._parseStack.chunkPos],u=this._oscParser.end(S!==24&&S!==26,s),u)return u;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=w;g<r;++g){switch(S=n[g],b=this._transitions.table[this.currentState<<8|(S<160?S:C)],b>>4){case 2:for(let D=g+1;;++D){if(D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-1;break}if(++D>=r||(S=n[D])<32||S>126&&S<C){this._printHandler(n,g,D),g=D-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 E=this._csiHandlers[this._collect<<8|S];let T=E?E.length-1:-1;for(;T>=0&&(u=E[T](this._params),u!==!0);T--)if(u instanceof Promise)return this._preserveStack(3,E,T,b,g),u;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<r&&(S=n[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 O=B?B.length-1:-1;for(;O>=0&&(u=B[O](),u!==!0);O--)if(u instanceof Promise)return this._preserveStack(4,B,O,b,g),u;O<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 D=g+1;;++D)if(D>=r||(S=n[D])===24||S===26||S===27||S>127&&S<C){this._dcsParser.put(n,g,D),g=D-1;break}break;case 14:if(u=this._dcsParser.unhook(S!==24&&S!==26),u)return this._preserveStack(6,[],0,b,g),u;S===27&&(b|=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 D=g+1;;D++)if(D>=r||(S=n[D])<32||S>127&&S<C){this._oscParser.put(n,g,D),g=D-1;break}break;case 6:if(u=this._oscParser.end(S!==24&&S!==26),u)return this._preserveStack(5,[],0,b,g),u;S===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}t.EscapeSequenceParser=f},6242:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const l=a(5770),_=a(482),h=[];t.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const C=this._handlers[p];return C.push(m),{dispose:()=>{const f=C.indexOf(m);f!==-1&&C.splice(f,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,C){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(p,m,C);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,C))}start(){this.reset(),this._state=1}put(p,m,C){if(this._state!==3){if(this._state===1)for(;m<C;){const f=p[m++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&C-m>0&&this._put(p,m,C)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,f=this._active.length-1,i=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,C=m,i=this._stack.fallThrough,this._stack.paused=!1),!i&&C===!1){for(;f>=0&&(C=this._active[f].end(p),C!==!0);f--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,C;f--}for(;f>=0;f--)if(C=this._active[f].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,C){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,C),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then(C=>(this._data="",this._hitLimit=!1,C));return this._data="",this._hitLimit=!1,m}}},8742:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const a=2147483647;class l{static fromArray(h){const p=new l;if(!h.length)return p;for(let m=Array.isArray(h[0])?1:0;m<h.length;++m){const C=h[m];if(Array.isArray(C))for(let f=0;f<C.length;++f)p.addSubParam(C[f]);else p.addParam(C)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const m=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];C-m>0&&h.push(Array.prototype.slice.call(this._subParams,m,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>a?a:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>a?a:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,m=255&this._subParamsIdx[h];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const m=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];C-m>0&&(h[p]=this._subParams.slice(m,C))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,C=m[p-1];m[p-1]=~C?Math.min(10*C+h,a):h}}t.Params=l},5741:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){l=_;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const l=a(3785),_=a(511);t.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const p=this._buffer.lines.get(h);if(p)return new l.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const l=a(511);t.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new l.CellData)}translateToString(_,h,p){return this._line.translateToString(_,h,p)}}},8285:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const l=a(8771),_=a(8460),h=a(844);class p extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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)}}t.BufferNamespaceApi=p},7975:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,_=>l(_.toArray()))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,(_,h)=>l(_,h.toArray()))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(k,t,a){var l=this&&this.__decorate||function(i,n,r,s){var u,S=arguments.length,b=S<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(i,n,r,s);else for(var w=i.length-1;w>=0;w--)(u=i[w])&&(b=(S<3?u(b):S>3?u(n,r,b):u(n,r))||b);return S>3&&b&&Object.defineProperty(n,r,b),b},_=this&&this.__param||function(i,n){return function(r,s){n(r,s,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const h=a(8460),p=a(844),m=a(5295),C=a(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let f=t.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(i,this))}resize(i,n){this.cols=i,this.rows=n,this.buffers.resize(i,n),this._onResize.fire({cols:i,rows:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,n=!1){const r=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===i.fg&&s.getBg(0)===i.bg||(s=r.getBlankLine(i,n),this._cachedBlankLine=s),s.isWrapped=n;const u=r.ybase+r.scrollTop,S=r.ybase+r.scrollBottom;if(r.scrollTop===0){const b=r.lines.isFull;S===r.lines.length-1?b?r.lines.recycle().copyFrom(s):r.lines.push(s.clone()):r.lines.splice(S+1,0,s.clone()),b?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{const b=S-u+1;r.lines.shiftElements(u+1,b-1,-1),r.lines.set(S,s.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(i,n,r){const s=this.buffer;if(i<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else i+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const u=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+i,s.ybase),0),u!==s.ydisp&&(n||this._onScroll.fire(s.ydisp))}};t.BufferService=f=l([_(0,C.IOptionsService)],f)},7994:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(k,t,a){var l=this&&this.__decorate||function(s,u,S,b){var w,g=arguments.length,E=g<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,u,S,b);else for(var T=s.length-1;T>=0;T--)(w=s[T])&&(E=(g<3?w(E):g>3?w(u,S,E):w(u,S))||E);return g>3&&E&&Object.defineProperty(u,S,E),E},_=this&&this.__param||function(s,u){return function(S,b){u(S,b,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const h=a(2585),p=a(8460),m=a(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function f(s,u){let S=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(S|=64,S|=s.action):(S|=3&s.button,4&s.button&&(S|=64),8&s.button&&(S|=128),s.action===32?S|=32:s.action!==0||u||(S|=3)),S}const i=String.fromCharCode,n={DEFAULT:s=>{const u=[f(s,!1)+32,s.col+32,s.row+32];return u[0]>255||u[1]>255||u[2]>255?"":`\x1B[M${i(u[0])}${i(u[1])}${i(u[2])}`},SGR:s=>{const u=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.col};${s.row}${u}`},SGR_PIXELS:s=>{const u=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.x};${s.y}${u}`}};let r=t.CoreMouseService=class extends m.Disposable{constructor(s,u){super(),this._bufferService=s,this._coreService=u,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(C))this.addProtocol(S,C[S]);for(const S of Object.keys(n))this.addEncoding(S,n[S]);this.reset()}addProtocol(s,u){this._protocols[s]=u}addEncoding(s,u){this._encodings[s]=u}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const u=this._encodings[this._activeEncoding](s);return u&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(u):this._coreService.triggerDataEvent(u,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,u,S){if(S){if(s.x!==u.x||s.y!==u.y)return!1}else if(s.col!==u.col||s.row!==u.row)return!1;return s.button===u.button&&s.action===u.action&&s.ctrl===u.ctrl&&s.alt===u.alt&&s.shift===u.shift}};t.CoreMouseService=r=l([_(0,h.IBufferService),_(1,h.ICoreService)],r)},6975:function(k,t,a){var l=this&&this.__decorate||function(r,s,u,S){var b,w=arguments.length,g=w<3?s:S===null?S=Object.getOwnPropertyDescriptor(s,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,u,S);else for(var E=r.length-1;E>=0;E--)(b=r[E])&&(g=(w<3?b(g):w>3?b(s,u,g):b(s,u))||g);return w>3&&g&&Object.defineProperty(s,u,g),g},_=this&&this.__param||function(r,s){return function(u,S){s(u,S,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const h=a(1439),p=a(8460),m=a(844),C=a(2585),f=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let n=t.CoreService=class extends m.Disposable{constructor(r,s,u){super(),this._bufferService=r,this._logService=s,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(i)}reset(){this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(i)}triggerDataEvent(r,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const u=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${r}"`,()=>r.split("").map(S=>S.charCodeAt(0))),this._onData.fire(r)}triggerBinaryEvent(r){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${r}"`,()=>r.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(r))}};t.CoreService=n=l([_(0,C.IBufferService),_(1,C.ILogService),_(2,C.IOptionsService)],n)},9074:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const l=a(8055),_=a(8460),h=a(844),p=a(6106);let m=0,C=0;class f extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(r=>r==null?void 0:r.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(r){if(r.marker.isDisposed)return;const s=new i(r);if(s){const u=s.marker.onDispose(()=>s.dispose());s.onDispose(()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),u.dispose())}),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const r of this._decorations.values())r.dispose();this._decorations.clear()}*getDecorationsAtCell(r,s,u){let S=0,b=0;for(const w of this._decorations.getKeyIterator(s))S=w.options.x??0,b=S+(w.options.width??1),r>=S&&r<b&&(!u||(w.options.layer??"bottom")===u)&&(yield w)}forEachDecorationAtCell(r,s,u,S){this._decorations.forEachByKey(s,b=>{m=b.options.x??0,C=m+(b.options.width??1),r>=m&&r<C&&(!u||(b.options.layer??"bottom")===u)&&S(b)})}}t.DecorationService=f;class i extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(r){super(),this.options=r,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=r.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const l=a(2585),_=a(8343);class h{constructor(...m){this._entries=new Map;for(const[C,f]of m)this.set(C,f)}set(m,C){const f=this._entries.get(m);return this._entries.set(m,C),f}forEach(m){for(const[C,f]of this._entries.entries())m(C,f)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}t.ServiceCollection=h,t.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const C=(0,_.getServiceDependencies)(p).sort((n,r)=>n.index-r.index),f=[];for(const n of C){const r=this._services.get(n.id);if(!r)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${n.id}.`);f.push(r)}const i=C.length>0?C[0].index:m.length;if(m.length!==i)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${i+1} conflicts with ${m.length} static arguments`);return new p(...m,...f)}}},7866:function(k,t,a){var l=this&&this.__decorate||function(i,n,r,s){var u,S=arguments.length,b=S<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(i,n,r,s);else for(var w=i.length-1;w>=0;w--)(u=i[w])&&(b=(S<3?u(b):S>3?u(n,r,b):u(n,r))||b);return S>3&&b&&Object.defineProperty(n,r,b),b},_=this&&this.__param||function(i,n){return function(r,s){n(r,s,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const h=a(844),p=a(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let C,f=t.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),C=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let n=0;n<i.length;n++)typeof i[n]=="function"&&(i[n]=i[n]())}_log(i,n,r){this._evalLazyOptionalParams(r),i.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+n,...r)}trace(i,...n){var r;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,i,n)}debug(i,...n){var r;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,i,n)}info(i,...n){var r;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,i,n)}warn(i,...n){var r;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,i,n)}error(i,...n){var r;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,i,n)}};t.LogService=f=l([_(0,p.IOptionsService)],f),t.setTraceLogger=function(i){C=i},t.traceCall=function(i,n,r){if(typeof r.value!="function")throw new Error("not supported");const s=r.value;r.value=function(...u){if(C.logLevel!==p.LogLevelEnum.TRACE)return s.apply(this,u);C.trace(`GlyphRenderer#${s.name}(${u.map(b=>JSON.stringify(b)).join(", ")})`);const S=s.apply(this,u);return C.trace(`GlyphRenderer#${s.name} return`,S),S}}},7302:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const l=a(8460),_=a(844),h=a(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(f){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...t.DEFAULT_OPTIONS};for(const n in f)if(n in i)try{const r=f[n];i[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(f,i){return this.onOptionChange(n=>{n===f&&i(this.rawOptions[f])})}onMultipleOptionChange(f,i){return this.onOptionChange(n=>{f.indexOf(n)!==-1&&i()})}_setupOptions(){const f=n=>{if(!(n in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,r)=>{if(!(n in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(const n in this.rawOptions){const r={get:f.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(f,i){switch(f){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[f]),!function(n){return n==="block"||n==="underline"||n==="bar"}(i))throw new Error(`"${i}" is not a valid value for ${f}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=p.includes(i)?i:t.DEFAULT_OPTIONS[f];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${f} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${f} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}t.OptionsService=m},2660:function(k,t,a){var l=this&&this.__decorate||function(m,C,f,i){var n,r=arguments.length,s=r<3?C:i===null?i=Object.getOwnPropertyDescriptor(C,f):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(m,C,f,i);else for(var u=m.length-1;u>=0;u--)(n=m[u])&&(s=(r<3?n(s):r>3?n(C,f,s):n(C,f))||s);return r>3&&s&&Object.defineProperty(C,f,s),s},_=this&&this.__param||function(m,C){return function(f,i){C(f,i,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const h=a(2585);let p=t.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const C=this._bufferService.buffer;if(m.id===void 0){const u=C.addMarker(C.ybase+C.y),S={data:m,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(S,u)),this._dataByLinkId.set(S.id,S),S.id}const f=m,i=this._getEntryIdKey(f),n=this._entriesWithId.get(i);if(n)return this.addLineToLink(n.id,C.ybase+C.y),n.id;const r=C.addMarker(C.ybase+C.y),s={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(s,r)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(m,C){const f=this._dataByLinkId.get(m);if(f&&f.lines.every(i=>i.line!==C)){const i=this._bufferService.buffer.addMarker(C);f.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(f,i))}}getLinkData(m){var C;return(C=this._dataByLinkId.get(m))==null?void 0:C.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,C){const f=m.lines.indexOf(C);f!==-1&&(m.lines.splice(f,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};t.OscLinkService=p=l([_(0,h.IBufferService)],p)},8343:(k,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(_){return _[l]||[]},t.createDecorator=function(_){if(t.serviceRegistry.has(_))return t.serviceRegistry.get(_);const h=function(p,m,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,i,n){i[a]===i?i[l].push({id:f,index:n}):(i[l]=[{id:f,index:n}],i[a]=i)})(h,p,C)};return h.toString=()=>_,t.serviceRegistry.set(_,h),h}},2585:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(8343);var _;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(_||(t.LogLevelEnum=_={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(k,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const l=a(8460),_=a(225);class h{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,C,f=!1){return(16777215&m)<<3|(3&C)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let C=0,f=0;const i=m.length;for(let n=0;n<i;++n){let r=m.charCodeAt(n);if(55296<=r&&r<=56319){if(++n>=i)return C+this.wcwidth(r);const S=m.charCodeAt(n);56320<=S&&S<=57343?r=1024*(r-55296)+S-56320+65536:C+=this.wcwidth(S)}const s=this.charProperties(r,f);let u=h.extractWidth(s);h.extractShouldJoin(s)&&(u-=h.extractWidth(f)),C+=u,f=s}return C}charProperties(m,C){return this._activeProvider.charProperties(m,C)}}t.UnicodeService=h}},d={};function v(k){var t=d[k];if(t!==void 0)return t.exports;var a=d[k]={exports:{}};return o[k].call(a.exports,a,a.exports,v),a.exports}var y={};return(()=>{var k=y;Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;const t=v(9042),a=v(3236),l=v(844),_=v(5741),h=v(8285),p=v(7975),m=v(7090),C=["cols","rows"];class f extends l.Disposable{constructor(n){super(),this._core=this.register(new a.Terminal(n)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const r=u=>this._core.options[u],s=(u,S)=>{this._checkReadonlyOptions(u),this._core.options[u]=S};for(const u in this._core.options){const S={get:r.bind(this,u),set:s.bind(this,u)};Object.defineProperty(this._publicOptions,u,S)}}_checkReadonlyOptions(n){if(C.includes(n))throw new Error(`Option "${n}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const n=this._core.coreService.decPrivateModes;let r="none";switch(this._core.coreMouseService.activeProtocol){case"X10":r="x10";break;case"VT200":r="vt200";break;case"DRAG":r="drag";break;case"ANY":r="any"}return{applicationCursorKeysMode:n.applicationCursorKeys,applicationKeypadMode:n.applicationKeypad,bracketedPasteMode:n.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:r,originMode:n.origin,reverseWraparoundMode:n.reverseWraparound,sendFocusMode:n.sendFocus,wraparoundMode:n.wraparound}}get options(){return this._publicOptions}set options(n){for(const r in n)this._publicOptions[r]=n[r]}blur(){this._core.blur()}focus(){this._core.focus()}input(n,r=!0){this._core.input(n,r)}resize(n,r){this._verifyIntegers(n,r),this._core.resize(n,r)}open(n){this._core.open(n)}attachCustomKeyEventHandler(n){this._core.attachCustomKeyEventHandler(n)}attachCustomWheelEventHandler(n){this._core.attachCustomWheelEventHandler(n)}registerLinkProvider(n){return this._core.registerLinkProvider(n)}registerCharacterJoiner(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)}deregisterCharacterJoiner(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)}registerMarker(n=0){return this._verifyIntegers(n),this._core.registerMarker(n)}registerDecoration(n){return this._checkProposedApi(),this._verifyPositiveIntegers(n.x??0,n.width??0,n.height??0),this._core.registerDecoration(n)}hasSelection(){return this._core.hasSelection()}select(n,r,s){this._verifyIntegers(n,r,s),this._core.select(n,r,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(n,r){this._verifyIntegers(n,r),this._core.selectLines(n,r)}dispose(){super.dispose()}scrollLines(n){this._verifyIntegers(n),this._core.scrollLines(n)}scrollPages(n){this._verifyIntegers(n),this._core.scrollPages(n)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(n){this._verifyIntegers(n),this._core.scrollToLine(n)}clear(){this._core.clear()}write(n,r){this._core.write(n,r)}writeln(n,r){this._core.write(n),this._core.write(`\r
9
+ `,r)}paste(n){this._core.paste(n)}refresh(n,r){this._verifyIntegers(n,r),this._core.refresh(n,r)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(n){this._addonManager.loadAddon(this,n)}static get strings(){return t}_verifyIntegers(...n){for(const r of n)if(r===1/0||isNaN(r)||r%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...n){for(const r of n)if(r&&(r===1/0||isNaN(r)||r%1!=0||r<0))throw new Error("This API only accepts positive integers")}}k.Terminal=f})(),y})())}(Ht)),Ht.exports}var qs=zs(),ne;(function(c){c.assertEqual=v=>v;function e(v){}c.assertIs=e;function o(v){throw new Error}c.assertNever=o,c.arrayToEnum=v=>{const y={};for(const k of v)y[k]=k;return y},c.getValidEnumValues=v=>{const y=c.objectKeys(v).filter(t=>typeof v[v[t]]!="number"),k={};for(const t of y)k[t]=v[t];return c.objectValues(k)},c.objectValues=v=>c.objectKeys(v).map(function(y){return v[y]}),c.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const y=[];for(const k in v)Object.prototype.hasOwnProperty.call(v,k)&&y.push(k);return y},c.find=(v,y)=>{for(const k of v)if(y(k))return k},c.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function d(v,y=" | "){return v.map(k=>typeof k=="string"?`'${k}'`:k).join(y)}c.joinValues=d,c.jsonStringifyReplacer=(v,y)=>typeof y=="bigint"?y.toString():y})(ne||(ne={}));var Nt;(function(c){c.mergeShapes=(e,o)=>({...e,...o})})(Nt||(Nt={}));const K=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ke=c=>{switch(typeof c){case"undefined":return K.undefined;case"string":return K.string;case"number":return isNaN(c)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(c)?K.array:c===null?K.null:c.then&&typeof c.then=="function"&&c.catch&&typeof c.catch=="function"?K.promise:typeof Map<"u"&&c instanceof Map?K.map:typeof Set<"u"&&c instanceof Set?K.set:typeof Date<"u"&&c instanceof Date?K.date:K.object;default:return K.unknown}},j=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Vs=c=>JSON.stringify(c,null,2).replace(/"([^"]+)":/g,"$1:");class fe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};const o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=e}format(e){const o=e||function(y){return y.message},d={_errors:[]},v=y=>{for(const k of y.issues)if(k.code==="invalid_union")k.unionErrors.map(v);else if(k.code==="invalid_return_type")v(k.returnTypeError);else if(k.code==="invalid_arguments")v(k.argumentsError);else if(k.path.length===0)d._errors.push(o(k));else{let t=d,a=0;for(;a<k.path.length;){const l=k.path[a];a===k.path.length-1?(t[l]=t[l]||{_errors:[]},t[l]._errors.push(o(k))):t[l]=t[l]||{_errors:[]},t=t[l],a++}}};return v(this),d}static assert(e){if(!(e instanceof fe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=o=>o.message){const o={},d=[];for(const v of this.issues)v.path.length>0?(o[v.path[0]]=o[v.path[0]]||[],o[v.path[0]].push(e(v))):d.push(e(v));return{formErrors:d,fieldErrors:o}}get formErrors(){return this.flatten()}}fe.create=c=>new fe(c);const $e=(c,e)=>{let o;switch(c.code){case j.invalid_type:c.received===K.undefined?o="Required":o=`Expected ${c.expected}, received ${c.received}`;break;case j.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(c.expected,ne.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:o=`Unrecognized key(s) in object: ${ne.joinValues(c.keys,", ")}`;break;case j.invalid_union:o="Invalid input";break;case j.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${ne.joinValues(c.options)}`;break;case j.invalid_enum_value:o=`Invalid enum value. Expected ${ne.joinValues(c.options)}, received '${c.received}'`;break;case j.invalid_arguments:o="Invalid function arguments";break;case j.invalid_return_type:o="Invalid function return type";break;case j.invalid_date:o="Invalid date";break;case j.invalid_string:typeof c.validation=="object"?"includes"in c.validation?(o=`Invalid input: must include "${c.validation.includes}"`,typeof c.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${c.validation.position}`)):"startsWith"in c.validation?o=`Invalid input: must start with "${c.validation.startsWith}"`:"endsWith"in c.validation?o=`Invalid input: must end with "${c.validation.endsWith}"`:ne.assertNever(c.validation):c.validation!=="regex"?o=`Invalid ${c.validation}`:o="Invalid";break;case j.too_small:c.type==="array"?o=`Array must contain ${c.exact?"exactly":c.inclusive?"at least":"more than"} ${c.minimum} element(s)`:c.type==="string"?o=`String must contain ${c.exact?"exactly":c.inclusive?"at least":"over"} ${c.minimum} character(s)`:c.type==="number"?o=`Number must be ${c.exact?"exactly equal to ":c.inclusive?"greater than or equal to ":"greater than "}${c.minimum}`:c.type==="date"?o=`Date must be ${c.exact?"exactly equal to ":c.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(c.minimum))}`:o="Invalid input";break;case j.too_big:c.type==="array"?o=`Array must contain ${c.exact?"exactly":c.inclusive?"at most":"less than"} ${c.maximum} element(s)`:c.type==="string"?o=`String must contain ${c.exact?"exactly":c.inclusive?"at most":"under"} ${c.maximum} character(s)`:c.type==="number"?o=`Number must be ${c.exact?"exactly":c.inclusive?"less than or equal to":"less than"} ${c.maximum}`:c.type==="bigint"?o=`BigInt must be ${c.exact?"exactly":c.inclusive?"less than or equal to":"less than"} ${c.maximum}`:c.type==="date"?o=`Date must be ${c.exact?"exactly":c.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(c.maximum))}`:o="Invalid input";break;case j.custom:o="Invalid input";break;case j.invalid_intersection_types:o="Intersection results could not be merged";break;case j.not_multiple_of:o=`Number must be a multiple of ${c.multipleOf}`;break;case j.not_finite:o="Number must be finite";break;default:o=e.defaultError,ne.assertNever(c)}return{message:o}};let Rr=$e;function Zs(c){Rr=c}function yt(){return Rr}const Ct=c=>{const{data:e,path:o,errorMaps:d,issueData:v}=c,y=[...o,...v.path||[]],k={...v,path:y};if(v.message!==void 0)return{...v,path:y,message:v.message};let t="";const a=d.filter(l=>!!l).slice().reverse();for(const l of a)t=l(k,{data:e,defaultError:t}).message;return{...v,path:y,message:t}},Ks=[];function q(c,e){const o=yt(),d=Ct({issueData:e,data:c.data,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,o,o===$e?void 0:$e].filter(v=>!!v)});c.common.issues.push(d)}class le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,o){const d=[];for(const v of o){if(v.status==="aborted")return Q;v.status==="dirty"&&e.dirty(),d.push(v.value)}return{status:e.value,value:d}}static async mergeObjectAsync(e,o){const d=[];for(const v of o){const y=await v.key,k=await v.value;d.push({key:y,value:k})}return le.mergeObjectSync(e,d)}static mergeObjectSync(e,o){const d={};for(const v of o){const{key:y,value:k}=v;if(y.status==="aborted"||k.status==="aborted")return Q;y.status==="dirty"&&e.dirty(),k.status==="dirty"&&e.dirty(),y.value!=="__proto__"&&(typeof k.value<"u"||v.alwaysSet)&&(d[y.value]=k.value)}return{status:e.value,value:d}}}const Q=Object.freeze({status:"aborted"}),We=c=>({status:"dirty",value:c}),de=c=>({status:"valid",value:c}),Wt=c=>c.status==="aborted",jt=c=>c.status==="dirty",Ie=c=>c.status==="valid",et=c=>typeof Promise<"u"&&c instanceof Promise;function wt(c,e,o,d){if(typeof e=="function"?c!==e||!0:!e.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(c)}function Lr(c,e,o,d,v){if(typeof e=="function"?c!==e||!0:!e.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(c,o),o}var J;(function(c){c.errToObj=e=>typeof e=="string"?{message:e}:e||{},c.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(J||(J={}));var Je,Ye;class Ce{constructor(e,o,d,v){this._cachedPath=[],this.parent=e,this.data=o,this._path=d,this._key=v}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rr=(c,e)=>{if(Ie(e))return{success:!0,data:e.value};if(!c.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const o=new fe(c.common.issues);return this._error=o,this._error}}};function re(c){if(!c)return{};const{errorMap:e,invalid_type_error:o,required_error:d,description:v}=c;if(e&&(o||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:v}:{errorMap:(k,t)=>{var a,l;const{message:_}=c;return k.code==="invalid_enum_value"?{message:_??t.defaultError}:typeof t.data>"u"?{message:(a=_??d)!==null&&a!==void 0?a:t.defaultError}:k.code!=="invalid_type"?{message:t.defaultError}:{message:(l=_??o)!==null&&l!==void 0?l:t.defaultError}},description:v}}class se{get description(){return this._def.description}_getType(e){return ke(e.data)}_getOrReturnCtx(e,o){return o||{common:e.parent.common,data:e.data,parsedType:ke(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new le,ctx:{common:e.parent.common,data:e.data,parsedType:ke(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const o=this._parse(e);if(et(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(e){const o=this._parse(e);return Promise.resolve(o)}parse(e,o){const d=this.safeParse(e,o);if(d.success)return d.data;throw d.error}safeParse(e,o){var d;const v={common:{issues:[],async:(d=o==null?void 0:o.async)!==null&&d!==void 0?d:!1,contextualErrorMap:o==null?void 0:o.errorMap},path:(o==null?void 0:o.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)},y=this._parseSync({data:e,path:v.path,parent:v});return rr(v,y)}"~validate"(e){var o,d;const v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)};if(!this["~standard"].async)try{const y=this._parseSync({data:e,path:[],parent:v});return Ie(y)?{value:y.value}:{issues:v.common.issues}}catch(y){!((d=(o=y==null?void 0:y.message)===null||o===void 0?void 0:o.toLowerCase())===null||d===void 0)&&d.includes("encountered")&&(this["~standard"].async=!0),v.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:v}).then(y=>Ie(y)?{value:y.value}:{issues:v.common.issues})}async parseAsync(e,o){const d=await this.safeParseAsync(e,o);if(d.success)return d.data;throw d.error}async safeParseAsync(e,o){const d={common:{issues:[],contextualErrorMap:o==null?void 0:o.errorMap,async:!0},path:(o==null?void 0:o.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ke(e)},v=this._parse({data:e,path:d.path,parent:d}),y=await(et(v)?v:Promise.resolve(v));return rr(d,y)}refine(e,o){const d=v=>typeof o=="string"||typeof o>"u"?{message:o}:typeof o=="function"?o(v):o;return this._refinement((v,y)=>{const k=e(v),t=()=>y.addIssue({code:j.custom,...d(v)});return typeof Promise<"u"&&k instanceof Promise?k.then(a=>a?!0:(t(),!1)):k?!0:(t(),!1)})}refinement(e,o){return this._refinement((d,v)=>e(d)?!0:(v.addIssue(typeof o=="function"?o(d,v):o),!1))}_refinement(e){return new ve({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o=>this["~validate"](o)}}optional(){return ye.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return ze.create(this,this._def)}or(e){return it.create([this,e],this._def)}and(e){return nt.create(this,e,this._def)}transform(e){return new ve({...re(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const o=typeof e=="function"?e:()=>e;return new lt({...re(this._def),innerType:this,defaultValue:o,typeName:X.ZodDefault})}brand(){return new qt({typeName:X.ZodBranded,type:this,...re(this._def)})}catch(e){const o=typeof e=="function"?e:()=>e;return new dt({...re(this._def),innerType:this,catchValue:o,typeName:X.ZodCatch})}describe(e){const o=this.constructor;return new o({...this._def,description:e})}pipe(e){return ft.create(this,e)}readonly(){return ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Gs=/^c[^\s-]{8,}$/i,Js=/^[0-9a-z]+$/,Ys=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qs=/^[a-z0-9_-]{21}$/i,ei=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ti=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ri=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,si="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ft;const ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ni=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,oi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ai=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ci=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hi=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",li=new RegExp(`^${Dr}$`);function Tr(c){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return c.precision?e=`${e}\\.\\d{${c.precision}}`:c.precision==null&&(e=`${e}(\\.\\d+)?`),e}function di(c){return new RegExp(`^${Tr(c)}$`)}function Ar(c){let e=`${Dr}T${Tr(c)}`;const o=[];return o.push(c.local?"Z?":"Z"),c.offset&&o.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${o.join("|")})`,new RegExp(`^${e}$`)}function ui(c,e){return!!((e==="v4"||!e)&&ii.test(c)||(e==="v6"||!e)&&oi.test(c))}function fi(c,e){if(!ei.test(c))return!1;try{const[o]=c.split("."),d=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),v=JSON.parse(atob(d));return!(typeof v!="object"||v===null||!v.typ||!v.alg||e&&v.alg!==e)}catch{return!1}}function _i(c,e){return!!((e==="v4"||!e)&&ni.test(c)||(e==="v6"||!e)&&ai.test(c))}class ge extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==K.string){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.string,received:y.parsedType}),Q}const d=new le;let v;for(const y of this._def.checks)if(y.kind==="min")e.data.length<y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),d.dirty());else if(y.kind==="max")e.data.length>y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),d.dirty());else if(y.kind==="length"){const k=e.data.length>y.value,t=e.data.length<y.value;(k||t)&&(v=this._getOrReturnCtx(e,v),k?q(v,{code:j.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}):t&&q(v,{code:j.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}),d.dirty())}else if(y.kind==="email")ri.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"email",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="emoji")Ft||(Ft=new RegExp(si,"u")),Ft.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"emoji",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="uuid")Xs.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"uuid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="nanoid")Qs.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"nanoid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="cuid")Gs.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cuid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="cuid2")Js.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cuid2",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="ulid")Ys.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"ulid",code:j.invalid_string,message:y.message}),d.dirty());else if(y.kind==="url")try{new URL(e.data)}catch{v=this._getOrReturnCtx(e,v),q(v,{validation:"url",code:j.invalid_string,message:y.message}),d.dirty()}else y.kind==="regex"?(y.regex.lastIndex=0,y.regex.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"regex",code:j.invalid_string,message:y.message}),d.dirty())):y.kind==="trim"?e.data=e.data.trim():y.kind==="includes"?e.data.includes(y.value,y.position)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{includes:y.value,position:y.position},message:y.message}),d.dirty()):y.kind==="toLowerCase"?e.data=e.data.toLowerCase():y.kind==="toUpperCase"?e.data=e.data.toUpperCase():y.kind==="startsWith"?e.data.startsWith(y.value)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{startsWith:y.value},message:y.message}),d.dirty()):y.kind==="endsWith"?e.data.endsWith(y.value)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:{endsWith:y.value},message:y.message}),d.dirty()):y.kind==="datetime"?Ar(y).test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"datetime",message:y.message}),d.dirty()):y.kind==="date"?li.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"date",message:y.message}),d.dirty()):y.kind==="time"?di(y).test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{code:j.invalid_string,validation:"time",message:y.message}),d.dirty()):y.kind==="duration"?ti.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"duration",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="ip"?ui(e.data,y.version)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"ip",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="jwt"?fi(e.data,y.alg)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"jwt",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="cidr"?_i(e.data,y.version)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"cidr",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="base64"?ci.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"base64",code:j.invalid_string,message:y.message}),d.dirty()):y.kind==="base64url"?hi.test(e.data)||(v=this._getOrReturnCtx(e,v),q(v,{validation:"base64url",code:j.invalid_string,message:y.message}),d.dirty()):ne.assertNever(y);return{status:d.value,value:e.data}}_regex(e,o,d){return this.refinement(v=>e.test(v),{validation:o,code:j.invalid_string,...J.errToObj(d)})}_addCheck(e){return new ge({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.errToObj(e)})}datetime(e){var o,d;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(o=e==null?void 0:e.offset)!==null&&o!==void 0?o:!1,local:(d=e==null?void 0:e.local)!==null&&d!==void 0?d:!1,...J.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...J.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,o){return this._addCheck({kind:"regex",regex:e,...J.errToObj(o)})}includes(e,o){return this._addCheck({kind:"includes",value:e,position:o==null?void 0:o.position,...J.errToObj(o==null?void 0:o.message)})}startsWith(e,o){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(o)})}endsWith(e,o){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(o)})}min(e,o){return this._addCheck({kind:"min",value:e,...J.errToObj(o)})}max(e,o){return this._addCheck({kind:"max",value:e,...J.errToObj(o)})}length(e,o){return this._addCheck({kind:"length",value:e,...J.errToObj(o)})}nonempty(e){return this.min(1,J.errToObj(e))}trim(){return new ge({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const o of this._def.checks)o.kind==="min"&&(e===null||o.value>e)&&(e=o.value);return e}get maxLength(){let e=null;for(const o of this._def.checks)o.kind==="max"&&(e===null||o.value<e)&&(e=o.value);return e}}ge.create=c=>{var e;return new ge({checks:[],typeName:X.ZodString,coerce:(e=c==null?void 0:c.coerce)!==null&&e!==void 0?e:!1,...re(c)})};function pi(c,e){const o=(c.toString().split(".")[1]||"").length,d=(e.toString().split(".")[1]||"").length,v=o>d?o:d,y=parseInt(c.toFixed(v).replace(".","")),k=parseInt(e.toFixed(v).replace(".",""));return y%k/Math.pow(10,v)}class Te extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==K.number){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.number,received:y.parsedType}),Q}let d;const v=new le;for(const y of this._def.checks)y.kind==="int"?ne.isInteger(e.data)||(d=this._getOrReturnCtx(e,d),q(d,{code:j.invalid_type,expected:"integer",received:"float",message:y.message}),v.dirty()):y.kind==="min"?(y.inclusive?e.data<y.value:e.data<=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_small,minimum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?e.data>y.value:e.data>=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_big,maximum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="multipleOf"?pi(e.data,y.value)!==0&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):y.kind==="finite"?Number.isFinite(e.data)||(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_finite,message:y.message}),v.dirty()):ne.assertNever(y);return{status:v.value,value:e.data}}gte(e,o){return this.setLimit("min",e,!0,J.toString(o))}gt(e,o){return this.setLimit("min",e,!1,J.toString(o))}lte(e,o){return this.setLimit("max",e,!0,J.toString(o))}lt(e,o){return this.setLimit("max",e,!1,J.toString(o))}setLimit(e,o,d,v){return new Te({...this._def,checks:[...this._def.checks,{kind:e,value:o,inclusive:d,message:J.toString(v)}]})}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,o){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(o)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.toString(e)})}get minValue(){let e=null;for(const o of this._def.checks)o.kind==="min"&&(e===null||o.value>e)&&(e=o.value);return e}get maxValue(){let e=null;for(const o of this._def.checks)o.kind==="max"&&(e===null||o.value<e)&&(e=o.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,o=null;for(const d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(o===null||d.value>o)&&(o=d.value):d.kind==="max"&&(e===null||d.value<e)&&(e=d.value)}return Number.isFinite(o)&&Number.isFinite(e)}}Te.create=c=>new Te({checks:[],typeName:X.ZodNumber,coerce:(c==null?void 0:c.coerce)||!1,...re(c)});class Ae extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==K.bigint)return this._getInvalidInput(e);let d;const v=new le;for(const y of this._def.checks)y.kind==="min"?(y.inclusive?e.data<y.value:e.data<=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_small,type:"bigint",minimum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?e.data>y.value:e.data>=y.value)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.too_big,type:"bigint",maximum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="multipleOf"?e.data%y.value!==BigInt(0)&&(d=this._getOrReturnCtx(e,d),q(d,{code:j.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):ne.assertNever(y);return{status:v.value,value:e.data}}_getInvalidInput(e){const o=this._getOrReturnCtx(e);return q(o,{code:j.invalid_type,expected:K.bigint,received:o.parsedType}),Q}gte(e,o){return this.setLimit("min",e,!0,J.toString(o))}gt(e,o){return this.setLimit("min",e,!1,J.toString(o))}lte(e,o){return this.setLimit("max",e,!0,J.toString(o))}lt(e,o){return this.setLimit("max",e,!1,J.toString(o))}setLimit(e,o,d,v){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:o,inclusive:d,message:J.toString(v)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,o){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(o)})}get minValue(){let e=null;for(const o of this._def.checks)o.kind==="min"&&(e===null||o.value>e)&&(e=o.value);return e}get maxValue(){let e=null;for(const o of this._def.checks)o.kind==="max"&&(e===null||o.value<e)&&(e=o.value);return e}}Ae.create=c=>{var e;return new Ae({checks:[],typeName:X.ZodBigInt,coerce:(e=c==null?void 0:c.coerce)!==null&&e!==void 0?e:!1,...re(c)})};class tt extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==K.boolean){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.boolean,received:d.parsedType}),Q}return de(e.data)}}tt.create=c=>new tt({typeName:X.ZodBoolean,coerce:(c==null?void 0:c.coerce)||!1,...re(c)});class He extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==K.date){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_type,expected:K.date,received:y.parsedType}),Q}if(isNaN(e.data.getTime())){const y=this._getOrReturnCtx(e);return q(y,{code:j.invalid_date}),Q}const d=new le;let v;for(const y of this._def.checks)y.kind==="min"?e.data.getTime()<y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_small,message:y.message,inclusive:!0,exact:!1,minimum:y.value,type:"date"}),d.dirty()):y.kind==="max"?e.data.getTime()>y.value&&(v=this._getOrReturnCtx(e,v),q(v,{code:j.too_big,message:y.message,inclusive:!0,exact:!1,maximum:y.value,type:"date"}),d.dirty()):ne.assertNever(y);return{status:d.value,value:new Date(e.data.getTime())}}_addCheck(e){return new He({...this._def,checks:[...this._def.checks,e]})}min(e,o){return this._addCheck({kind:"min",value:e.getTime(),message:J.toString(o)})}max(e,o){return this._addCheck({kind:"max",value:e.getTime(),message:J.toString(o)})}get minDate(){let e=null;for(const o of this._def.checks)o.kind==="min"&&(e===null||o.value>e)&&(e=o.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const o of this._def.checks)o.kind==="max"&&(e===null||o.value<e)&&(e=o.value);return e!=null?new Date(e):null}}He.create=c=>new He({checks:[],coerce:(c==null?void 0:c.coerce)||!1,typeName:X.ZodDate,...re(c)});class Et extends se{_parse(e){if(this._getType(e)!==K.symbol){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.symbol,received:d.parsedType}),Q}return de(e.data)}}Et.create=c=>new Et({typeName:X.ZodSymbol,...re(c)});class rt extends se{_parse(e){if(this._getType(e)!==K.undefined){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.undefined,received:d.parsedType}),Q}return de(e.data)}}rt.create=c=>new rt({typeName:X.ZodUndefined,...re(c)});class st extends se{_parse(e){if(this._getType(e)!==K.null){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.null,received:d.parsedType}),Q}return de(e.data)}}st.create=c=>new st({typeName:X.ZodNull,...re(c)});class Ue extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}Ue.create=c=>new Ue({typeName:X.ZodAny,...re(c)});class Pe extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}Pe.create=c=>new Pe({typeName:X.ZodUnknown,...re(c)});class Re extends se{_parse(e){const o=this._getOrReturnCtx(e);return q(o,{code:j.invalid_type,expected:K.never,received:o.parsedType}),Q}}Re.create=c=>new Re({typeName:X.ZodNever,...re(c)});class xt extends se{_parse(e){if(this._getType(e)!==K.undefined){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.void,received:d.parsedType}),Q}return de(e.data)}}xt.create=c=>new xt({typeName:X.ZodVoid,...re(c)});class me extends se{_parse(e){const{ctx:o,status:d}=this._processInputParams(e),v=this._def;if(o.parsedType!==K.array)return q(o,{code:j.invalid_type,expected:K.array,received:o.parsedType}),Q;if(v.exactLength!==null){const k=o.data.length>v.exactLength.value,t=o.data.length<v.exactLength.value;(k||t)&&(q(o,{code:k?j.too_big:j.too_small,minimum:t?v.exactLength.value:void 0,maximum:k?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),d.dirty())}if(v.minLength!==null&&o.data.length<v.minLength.value&&(q(o,{code:j.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),d.dirty()),v.maxLength!==null&&o.data.length>v.maxLength.value&&(q(o,{code:j.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),d.dirty()),o.common.async)return Promise.all([...o.data].map((k,t)=>v.type._parseAsync(new Ce(o,k,o.path,t)))).then(k=>le.mergeArray(d,k));const y=[...o.data].map((k,t)=>v.type._parseSync(new Ce(o,k,o.path,t)));return le.mergeArray(d,y)}get element(){return this._def.type}min(e,o){return new me({...this._def,minLength:{value:e,message:J.toString(o)}})}max(e,o){return new me({...this._def,maxLength:{value:e,message:J.toString(o)}})}length(e,o){return new me({...this._def,exactLength:{value:e,message:J.toString(o)}})}nonempty(e){return this.min(1,e)}}me.create=(c,e)=>new me({type:c,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...re(e)});function Ne(c){if(c instanceof ae){const e={};for(const o in c.shape){const d=c.shape[o];e[o]=ye.create(Ne(d))}return new ae({...c._def,shape:()=>e})}else return c instanceof me?new me({...c._def,type:Ne(c.element)}):c instanceof ye?ye.create(Ne(c.unwrap())):c instanceof Oe?Oe.create(Ne(c.unwrap())):c instanceof we?we.create(c.items.map(e=>Ne(e))):c}class ae extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),o=ne.objectKeys(e);return this._cached={shape:e,keys:o}}_parse(e){if(this._getType(e)!==K.object){const l=this._getOrReturnCtx(e);return q(l,{code:j.invalid_type,expected:K.object,received:l.parsedType}),Q}const{status:d,ctx:v}=this._processInputParams(e),{shape:y,keys:k}=this._getCached(),t=[];if(!(this._def.catchall instanceof Re&&this._def.unknownKeys==="strip"))for(const l in v.data)k.includes(l)||t.push(l);const a=[];for(const l of k){const _=y[l],h=v.data[l];a.push({key:{status:"valid",value:l},value:_._parse(new Ce(v,h,v.path,l)),alwaysSet:l in v.data})}if(this._def.catchall instanceof Re){const l=this._def.unknownKeys;if(l==="passthrough")for(const _ of t)a.push({key:{status:"valid",value:_},value:{status:"valid",value:v.data[_]}});else if(l==="strict")t.length>0&&(q(v,{code:j.unrecognized_keys,keys:t}),d.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const _ of t){const h=v.data[_];a.push({key:{status:"valid",value:_},value:l._parse(new Ce(v,h,v.path,_)),alwaysSet:_ in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const l=[];for(const _ of a){const h=await _.key,p=await _.value;l.push({key:h,value:p,alwaysSet:_.alwaysSet})}return l}).then(l=>le.mergeObjectSync(d,l)):le.mergeObjectSync(d,a)}get shape(){return this._def.shape()}strict(e){return J.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(o,d)=>{var v,y,k,t;const a=(k=(y=(v=this._def).errorMap)===null||y===void 0?void 0:y.call(v,o,d).message)!==null&&k!==void 0?k:d.defaultError;return o.code==="unrecognized_keys"?{message:(t=J.errToObj(e).message)!==null&&t!==void 0?t:a}:{message:a}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,o){return this.augment({[e]:o})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const o={};return ne.objectKeys(e).forEach(d=>{e[d]&&this.shape[d]&&(o[d]=this.shape[d])}),new ae({...this._def,shape:()=>o})}omit(e){const o={};return ne.objectKeys(this.shape).forEach(d=>{e[d]||(o[d]=this.shape[d])}),new ae({...this._def,shape:()=>o})}deepPartial(){return Ne(this)}partial(e){const o={};return ne.objectKeys(this.shape).forEach(d=>{const v=this.shape[d];e&&!e[d]?o[d]=v:o[d]=v.optional()}),new ae({...this._def,shape:()=>o})}required(e){const o={};return ne.objectKeys(this.shape).forEach(d=>{if(e&&!e[d])o[d]=this.shape[d];else{let y=this.shape[d];for(;y instanceof ye;)y=y._def.innerType;o[d]=y}}),new ae({...this._def,shape:()=>o})}keyof(){return Br(ne.objectKeys(this.shape))}}ae.create=(c,e)=>new ae({shape:()=>c,unknownKeys:"strip",catchall:Re.create(),typeName:X.ZodObject,...re(e)});ae.strictCreate=(c,e)=>new ae({shape:()=>c,unknownKeys:"strict",catchall:Re.create(),typeName:X.ZodObject,...re(e)});ae.lazycreate=(c,e)=>new ae({shape:c,unknownKeys:"strip",catchall:Re.create(),typeName:X.ZodObject,...re(e)});class it extends se{_parse(e){const{ctx:o}=this._processInputParams(e),d=this._def.options;function v(y){for(const t of y)if(t.result.status==="valid")return t.result;for(const t of y)if(t.result.status==="dirty")return o.common.issues.push(...t.ctx.common.issues),t.result;const k=y.map(t=>new fe(t.ctx.common.issues));return q(o,{code:j.invalid_union,unionErrors:k}),Q}if(o.common.async)return Promise.all(d.map(async y=>{const k={...o,common:{...o.common,issues:[]},parent:null};return{result:await y._parseAsync({data:o.data,path:o.path,parent:k}),ctx:k}})).then(v);{let y;const k=[];for(const a of d){const l={...o,common:{...o.common,issues:[]},parent:null},_=a._parseSync({data:o.data,path:o.path,parent:l});if(_.status==="valid")return _;_.status==="dirty"&&!y&&(y={result:_,ctx:l}),l.common.issues.length&&k.push(l.common.issues)}if(y)return o.common.issues.push(...y.ctx.common.issues),y.result;const t=k.map(a=>new fe(a));return q(o,{code:j.invalid_union,unionErrors:t}),Q}}get options(){return this._def.options}}it.create=(c,e)=>new it({options:c,typeName:X.ZodUnion,...re(e)});const Ee=c=>c instanceof at?Ee(c.schema):c instanceof ve?Ee(c.innerType()):c instanceof ct?[c.value]:c instanceof Be?c.options:c instanceof ht?ne.objectValues(c.enum):c instanceof lt?Ee(c._def.innerType):c instanceof rt?[void 0]:c instanceof st?[null]:c instanceof ye?[void 0,...Ee(c.unwrap())]:c instanceof Oe?[null,...Ee(c.unwrap())]:c instanceof qt||c instanceof ut?Ee(c.unwrap()):c instanceof dt?Ee(c._def.innerType):[];class Lt extends se{_parse(e){const{ctx:o}=this._processInputParams(e);if(o.parsedType!==K.object)return q(o,{code:j.invalid_type,expected:K.object,received:o.parsedType}),Q;const d=this.discriminator,v=o.data[d],y=this.optionsMap.get(v);return y?o.common.async?y._parseAsync({data:o.data,path:o.path,parent:o}):y._parseSync({data:o.data,path:o.path,parent:o}):(q(o,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,o,d){const v=new Map;for(const y of o){const k=Ee(y.shape[e]);if(!k.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const t of k){if(v.has(t))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(t)}`);v.set(t,y)}}return new Lt({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:o,optionsMap:v,...re(d)})}}function $t(c,e){const o=ke(c),d=ke(e);if(c===e)return{valid:!0,data:c};if(o===K.object&&d===K.object){const v=ne.objectKeys(e),y=ne.objectKeys(c).filter(t=>v.indexOf(t)!==-1),k={...c,...e};for(const t of y){const a=$t(c[t],e[t]);if(!a.valid)return{valid:!1};k[t]=a.data}return{valid:!0,data:k}}else if(o===K.array&&d===K.array){if(c.length!==e.length)return{valid:!1};const v=[];for(let y=0;y<c.length;y++){const k=c[y],t=e[y],a=$t(k,t);if(!a.valid)return{valid:!1};v.push(a.data)}return{valid:!0,data:v}}else return o===K.date&&d===K.date&&+c==+e?{valid:!0,data:c}:{valid:!1}}class nt extends se{_parse(e){const{status:o,ctx:d}=this._processInputParams(e),v=(y,k)=>{if(Wt(y)||Wt(k))return Q;const t=$t(y.value,k.value);return t.valid?((jt(y)||jt(k))&&o.dirty(),{status:o.value,value:t.data}):(q(d,{code:j.invalid_intersection_types}),Q)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([y,k])=>v(y,k)):v(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}nt.create=(c,e,o)=>new nt({left:c,right:e,typeName:X.ZodIntersection,...re(o)});class we extends se{_parse(e){const{status:o,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.array)return q(d,{code:j.invalid_type,expected:K.array,received:d.parsedType}),Q;if(d.data.length<this._def.items.length)return q(d,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&d.data.length>this._def.items.length&&(q(d,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());const y=[...d.data].map((k,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new Ce(d,k,d.path,t)):null}).filter(k=>!!k);return d.common.async?Promise.all(y).then(k=>le.mergeArray(o,k)):le.mergeArray(o,y)}get items(){return this._def.items}rest(e){return new we({...this._def,rest:e})}}we.create=(c,e)=>{if(!Array.isArray(c))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:c,typeName:X.ZodTuple,rest:null,...re(e)})};class ot extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:o,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.object)return q(d,{code:j.invalid_type,expected:K.object,received:d.parsedType}),Q;const v=[],y=this._def.keyType,k=this._def.valueType;for(const t in d.data)v.push({key:y._parse(new Ce(d,t,d.path,t)),value:k._parse(new Ce(d,d.data[t],d.path,t)),alwaysSet:t in d.data});return d.common.async?le.mergeObjectAsync(o,v):le.mergeObjectSync(o,v)}get element(){return this._def.valueType}static create(e,o,d){return o instanceof se?new ot({keyType:e,valueType:o,typeName:X.ZodRecord,...re(d)}):new ot({keyType:ge.create(),valueType:e,typeName:X.ZodRecord,...re(o)})}}class kt extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:o,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.map)return q(d,{code:j.invalid_type,expected:K.map,received:d.parsedType}),Q;const v=this._def.keyType,y=this._def.valueType,k=[...d.data.entries()].map(([t,a],l)=>({key:v._parse(new Ce(d,t,d.path,[l,"key"])),value:y._parse(new Ce(d,a,d.path,[l,"value"]))}));if(d.common.async){const t=new Map;return Promise.resolve().then(async()=>{for(const a of k){const l=await a.key,_=await a.value;if(l.status==="aborted"||_.status==="aborted")return Q;(l.status==="dirty"||_.status==="dirty")&&o.dirty(),t.set(l.value,_.value)}return{status:o.value,value:t}})}else{const t=new Map;for(const a of k){const l=a.key,_=a.value;if(l.status==="aborted"||_.status==="aborted")return Q;(l.status==="dirty"||_.status==="dirty")&&o.dirty(),t.set(l.value,_.value)}return{status:o.value,value:t}}}}kt.create=(c,e,o)=>new kt({valueType:e,keyType:c,typeName:X.ZodMap,...re(o)});class Fe extends se{_parse(e){const{status:o,ctx:d}=this._processInputParams(e);if(d.parsedType!==K.set)return q(d,{code:j.invalid_type,expected:K.set,received:d.parsedType}),Q;const v=this._def;v.minSize!==null&&d.data.size<v.minSize.value&&(q(d,{code:j.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),o.dirty()),v.maxSize!==null&&d.data.size>v.maxSize.value&&(q(d,{code:j.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),o.dirty());const y=this._def.valueType;function k(a){const l=new Set;for(const _ of a){if(_.status==="aborted")return Q;_.status==="dirty"&&o.dirty(),l.add(_.value)}return{status:o.value,value:l}}const t=[...d.data.values()].map((a,l)=>y._parse(new Ce(d,a,d.path,l)));return d.common.async?Promise.all(t).then(a=>k(a)):k(t)}min(e,o){return new Fe({...this._def,minSize:{value:e,message:J.toString(o)}})}max(e,o){return new Fe({...this._def,maxSize:{value:e,message:J.toString(o)}})}size(e,o){return this.min(e,o).max(e,o)}nonempty(e){return this.min(1,e)}}Fe.create=(c,e)=>new Fe({valueType:c,minSize:null,maxSize:null,typeName:X.ZodSet,...re(e)});class je extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:o}=this._processInputParams(e);if(o.parsedType!==K.function)return q(o,{code:j.invalid_type,expected:K.function,received:o.parsedType}),Q;function d(t,a){return Ct({data:t,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,yt(),$e].filter(l=>!!l),issueData:{code:j.invalid_arguments,argumentsError:a}})}function v(t,a){return Ct({data:t,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,yt(),$e].filter(l=>!!l),issueData:{code:j.invalid_return_type,returnTypeError:a}})}const y={errorMap:o.common.contextualErrorMap},k=o.data;if(this._def.returns instanceof ze){const t=this;return de(async function(...a){const l=new fe([]),_=await t._def.args.parseAsync(a,y).catch(m=>{throw l.addIssue(d(a,m)),l}),h=await Reflect.apply(k,this,_);return await t._def.returns._def.type.parseAsync(h,y).catch(m=>{throw l.addIssue(v(h,m)),l})})}else{const t=this;return de(function(...a){const l=t._def.args.safeParse(a,y);if(!l.success)throw new fe([d(a,l.error)]);const _=Reflect.apply(k,this,l.data),h=t._def.returns.safeParse(_,y);if(!h.success)throw new fe([v(_,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new je({...this._def,args:we.create(e).rest(Pe.create())})}returns(e){return new je({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,o,d){return new je({args:e||we.create([]).rest(Pe.create()),returns:o||Pe.create(),typeName:X.ZodFunction,...re(d)})}}class at extends se{get schema(){return this._def.getter()}_parse(e){const{ctx:o}=this._processInputParams(e);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}}at.create=(c,e)=>new at({getter:c,typeName:X.ZodLazy,...re(e)});class ct extends se{_parse(e){if(e.data!==this._def.value){const o=this._getOrReturnCtx(e);return q(o,{received:o.data,code:j.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}ct.create=(c,e)=>new ct({value:c,typeName:X.ZodLiteral,...re(e)});function Br(c,e){return new Be({values:c,typeName:X.ZodEnum,...re(e)})}class Be extends se{constructor(){super(...arguments),Je.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const o=this._getOrReturnCtx(e),d=this._def.values;return q(o,{expected:ne.joinValues(d),received:o.parsedType,code:j.invalid_type}),Q}if(wt(this,Je)||Lr(this,Je,new Set(this._def.values)),!wt(this,Je).has(e.data)){const o=this._getOrReturnCtx(e),d=this._def.values;return q(o,{received:o.data,code:j.invalid_enum_value,options:d}),Q}return de(e.data)}get options(){return this._def.values}get enum(){const e={};for(const o of this._def.values)e[o]=o;return e}get Values(){const e={};for(const o of this._def.values)e[o]=o;return e}get Enum(){const e={};for(const o of this._def.values)e[o]=o;return e}extract(e,o=this._def){return Be.create(e,{...this._def,...o})}exclude(e,o=this._def){return Be.create(this.options.filter(d=>!e.includes(d)),{...this._def,...o})}}Je=new WeakMap;Be.create=Br;class ht extends se{constructor(){super(...arguments),Ye.set(this,void 0)}_parse(e){const o=ne.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(e);if(d.parsedType!==K.string&&d.parsedType!==K.number){const v=ne.objectValues(o);return q(d,{expected:ne.joinValues(v),received:d.parsedType,code:j.invalid_type}),Q}if(wt(this,Ye)||Lr(this,Ye,new Set(ne.getValidEnumValues(this._def.values))),!wt(this,Ye).has(e.data)){const v=ne.objectValues(o);return q(d,{received:d.data,code:j.invalid_enum_value,options:v}),Q}return de(e.data)}get enum(){return this._def.values}}Ye=new WeakMap;ht.create=(c,e)=>new ht({values:c,typeName:X.ZodNativeEnum,...re(e)});class ze extends se{unwrap(){return this._def.type}_parse(e){const{ctx:o}=this._processInputParams(e);if(o.parsedType!==K.promise&&o.common.async===!1)return q(o,{code:j.invalid_type,expected:K.promise,received:o.parsedType}),Q;const d=o.parsedType===K.promise?o.data:Promise.resolve(o.data);return de(d.then(v=>this._def.type.parseAsync(v,{path:o.path,errorMap:o.common.contextualErrorMap})))}}ze.create=(c,e)=>new ze({type:c,typeName:X.ZodPromise,...re(e)});class ve extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:o,ctx:d}=this._processInputParams(e),v=this._def.effect||null,y={addIssue:k=>{q(d,k),k.fatal?o.abort():o.dirty()},get path(){return d.path}};if(y.addIssue=y.addIssue.bind(y),v.type==="preprocess"){const k=v.transform(d.data,y);if(d.common.async)return Promise.resolve(k).then(async t=>{if(o.value==="aborted")return Q;const a=await this._def.schema._parseAsync({data:t,path:d.path,parent:d});return a.status==="aborted"?Q:a.status==="dirty"||o.value==="dirty"?We(a.value):a});{if(o.value==="aborted")return Q;const t=this._def.schema._parseSync({data:k,path:d.path,parent:d});return t.status==="aborted"?Q:t.status==="dirty"||o.value==="dirty"?We(t.value):t}}if(v.type==="refinement"){const k=t=>{const a=v.refinement(t,y);if(d.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(d.common.async===!1){const t=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return t.status==="aborted"?Q:(t.status==="dirty"&&o.dirty(),k(t.value),{status:o.value,value:t.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(t=>t.status==="aborted"?Q:(t.status==="dirty"&&o.dirty(),k(t.value).then(()=>({status:o.value,value:t.value}))))}if(v.type==="transform")if(d.common.async===!1){const k=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Ie(k))return k;const t=v.transform(k.value,y);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:t}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(k=>Ie(k)?Promise.resolve(v.transform(k.value,y)).then(t=>({status:o.value,value:t})):k);ne.assertNever(v)}}ve.create=(c,e,o)=>new ve({schema:c,typeName:X.ZodEffects,effect:e,...re(o)});ve.createWithPreprocess=(c,e,o)=>new ve({schema:e,effect:{type:"preprocess",transform:c},typeName:X.ZodEffects,...re(o)});class ye extends se{_parse(e){return this._getType(e)===K.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(c,e)=>new ye({innerType:c,typeName:X.ZodOptional,...re(e)});class Oe extends se{_parse(e){return this._getType(e)===K.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(c,e)=>new Oe({innerType:c,typeName:X.ZodNullable,...re(e)});class lt extends se{_parse(e){const{ctx:o}=this._processInputParams(e);let d=o.data;return o.parsedType===K.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:o.path,parent:o})}removeDefault(){return this._def.innerType}}lt.create=(c,e)=>new lt({innerType:c,typeName:X.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class dt extends se{_parse(e){const{ctx:o}=this._processInputParams(e),d={...o,common:{...o.common,issues:[]}},v=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return et(v)?v.then(y=>({status:"valid",value:y.status==="valid"?y.value:this._def.catchValue({get error(){return new fe(d.common.issues)},input:d.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new fe(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}dt.create=(c,e)=>new dt({innerType:c,typeName:X.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Rt extends se{_parse(e){if(this._getType(e)!==K.nan){const d=this._getOrReturnCtx(e);return q(d,{code:j.invalid_type,expected:K.nan,received:d.parsedType}),Q}return{status:"valid",value:e.data}}}Rt.create=c=>new Rt({typeName:X.ZodNaN,...re(c)});const gi=Symbol("zod_brand");class qt extends se{_parse(e){const{ctx:o}=this._processInputParams(e),d=o.data;return this._def.type._parse({data:d,path:o.path,parent:o})}unwrap(){return this._def.type}}class ft extends se{_parse(e){const{status:o,ctx:d}=this._processInputParams(e);if(d.common.async)return(async()=>{const y=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return y.status==="aborted"?Q:y.status==="dirty"?(o.dirty(),We(y.value)):this._def.out._parseAsync({data:y.value,path:d.path,parent:d})})();{const v=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return v.status==="aborted"?Q:v.status==="dirty"?(o.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:d.path,parent:d})}}static create(e,o){return new ft({in:e,out:o,typeName:X.ZodPipeline})}}class ut extends se{_parse(e){const o=this._def.innerType._parse(e),d=v=>(Ie(v)&&(v.value=Object.freeze(v.value)),v);return et(o)?o.then(v=>d(v)):d(o)}unwrap(){return this._def.innerType}}ut.create=(c,e)=>new ut({innerType:c,typeName:X.ZodReadonly,...re(e)});function sr(c,e){const o=typeof c=="function"?c(e):typeof c=="string"?{message:c}:c;return typeof o=="string"?{message:o}:o}function Or(c,e={},o){return c?Ue.create().superRefine((d,v)=>{var y,k;const t=c(d);if(t instanceof Promise)return t.then(a=>{var l,_;if(!a){const h=sr(e,d),p=(_=(l=h.fatal)!==null&&l!==void 0?l:o)!==null&&_!==void 0?_:!0;v.addIssue({code:"custom",...h,fatal:p})}});if(!t){const a=sr(e,d),l=(k=(y=a.fatal)!==null&&y!==void 0?y:o)!==null&&k!==void 0?k:!0;v.addIssue({code:"custom",...a,fatal:l})}}):Ue.create()}const mi={object:ae.lazycreate};var X;(function(c){c.ZodString="ZodString",c.ZodNumber="ZodNumber",c.ZodNaN="ZodNaN",c.ZodBigInt="ZodBigInt",c.ZodBoolean="ZodBoolean",c.ZodDate="ZodDate",c.ZodSymbol="ZodSymbol",c.ZodUndefined="ZodUndefined",c.ZodNull="ZodNull",c.ZodAny="ZodAny",c.ZodUnknown="ZodUnknown",c.ZodNever="ZodNever",c.ZodVoid="ZodVoid",c.ZodArray="ZodArray",c.ZodObject="ZodObject",c.ZodUnion="ZodUnion",c.ZodDiscriminatedUnion="ZodDiscriminatedUnion",c.ZodIntersection="ZodIntersection",c.ZodTuple="ZodTuple",c.ZodRecord="ZodRecord",c.ZodMap="ZodMap",c.ZodSet="ZodSet",c.ZodFunction="ZodFunction",c.ZodLazy="ZodLazy",c.ZodLiteral="ZodLiteral",c.ZodEnum="ZodEnum",c.ZodEffects="ZodEffects",c.ZodNativeEnum="ZodNativeEnum",c.ZodOptional="ZodOptional",c.ZodNullable="ZodNullable",c.ZodDefault="ZodDefault",c.ZodCatch="ZodCatch",c.ZodPromise="ZodPromise",c.ZodBranded="ZodBranded",c.ZodPipeline="ZodPipeline",c.ZodReadonly="ZodReadonly"})(X||(X={}));const vi=(c,e={message:`Input not instance of ${c.name}`})=>Or(o=>o instanceof c,e),Mr=ge.create,Pr=Te.create,bi=Rt.create,Si=Ae.create,Ir=tt.create,yi=He.create,Ci=Et.create,wi=rt.create,Ei=st.create,xi=Ue.create,ki=Pe.create,Ri=Re.create,Li=xt.create,Di=me.create,Ti=ae.create,Ai=ae.strictCreate,Bi=it.create,Oi=Lt.create,Mi=nt.create,Pi=we.create,Ii=ot.create,Hi=kt.create,Fi=Fe.create,Ni=je.create,Wi=at.create,ji=ct.create,$i=Be.create,Ui=ht.create,zi=ze.create,ir=ve.create,qi=ye.create,Vi=Oe.create,Zi=ve.createWithPreprocess,Ki=ft.create,Gi=()=>Mr().optional(),Ji=()=>Pr().optional(),Yi=()=>Ir().optional(),Xi={string:c=>ge.create({...c,coerce:!0}),number:c=>Te.create({...c,coerce:!0}),boolean:c=>tt.create({...c,coerce:!0}),bigint:c=>Ae.create({...c,coerce:!0}),date:c=>He.create({...c,coerce:!0})},Qi=Q;var en=Object.freeze({__proto__:null,defaultErrorMap:$e,setErrorMap:Zs,getErrorMap:yt,makeIssue:Ct,EMPTY_PATH:Ks,addIssueToContext:q,ParseStatus:le,INVALID:Q,DIRTY:We,OK:de,isAborted:Wt,isDirty:jt,isValid:Ie,isAsync:et,get util(){return ne},get objectUtil(){return Nt},ZodParsedType:K,getParsedType:ke,ZodType:se,datetimeRegex:Ar,ZodString:ge,ZodNumber:Te,ZodBigInt:Ae,ZodBoolean:tt,ZodDate:He,ZodSymbol:Et,ZodUndefined:rt,ZodNull:st,ZodAny:Ue,ZodUnknown:Pe,ZodNever:Re,ZodVoid:xt,ZodArray:me,ZodObject:ae,ZodUnion:it,ZodDiscriminatedUnion:Lt,ZodIntersection:nt,ZodTuple:we,ZodRecord:ot,ZodMap:kt,ZodSet:Fe,ZodFunction:je,ZodLazy:at,ZodLiteral:ct,ZodEnum:Be,ZodNativeEnum:ht,ZodPromise:ze,ZodEffects:ve,ZodTransformer:ve,ZodOptional:ye,ZodNullable:Oe,ZodDefault:lt,ZodCatch:dt,ZodNaN:Rt,BRAND:gi,ZodBranded:qt,ZodPipeline:ft,ZodReadonly:ut,custom:Or,Schema:se,ZodSchema:se,late:mi,get ZodFirstPartyTypeKind(){return X},coerce:Xi,any:xi,array:Di,bigint:Si,boolean:Ir,date:yi,discriminatedUnion:Oi,effect:ir,enum:$i,function:Ni,instanceof:vi,intersection:Mi,lazy:Wi,literal:ji,map:Hi,nan:bi,nativeEnum:Ui,never:Ri,null:Ei,nullable:Vi,number:Pr,object:Ti,oboolean:Yi,onumber:Ji,optional:qi,ostring:Gi,pipeline:Ki,preprocess:Zi,promise:zi,record:Ii,set:Fi,strictObject:Ai,string:Mr,symbol:Ci,transformer:ir,tuple:Pi,undefined:wi,union:Bi,unknown:ki,void:Li,NEVER:Qi,ZodIssueCode:j,quotelessJson:Vs,ZodError:fe});function tn(c){const e=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(c);if(!e)return;if(!e[1]||!e[2]||!e[3]||!e[4])throw new Error(`Mouse event: Invalid match for data ${c}`);const o=parseInt(e[1],10),d=parseInt(e[2],10),v=parseInt(e[3],10),y=e[4]==="m";return console.log(`Mouse event: buttonCode=${o}, column=${d}, row=${v}, isRelease=${y}`),c}function Hr(c,e){const o=new qs.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),d=xr.macchiato.colors;o.options.theme={background:d.base.hex,black:d.crust.hex,brightBlack:d.surface2.hex,blue:d.blue.hex,brightBlue:d.blue.hex,brightCyan:d.sky.hex,brightRed:d.maroon.hex,brightYellow:d.yellow.hex,cursor:d.text.hex,cyan:d.sky.hex,foreground:d.text.hex,green:d.green.hex,magenta:d.lavender.hex,red:d.red.hex,white:d.text.hex,yellow:d.yellow.hex};const v=new Us.FitAddon;return o.loadAddon(v),o.open(c),v.fit(),window.addEventListener("resize",()=>{v.fit()}),o.onData(y=>{if(typeof y!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(y)}'`);const k=tn(y);k&&e.onMouseEvent(k)}),o.onKey(y=>{e.onKeyPress(y)}),o}function Fr(){let c=en.string().safeParse(sessionStorage.getItem("tabId")).data;return c||(c=Math.random().toString(36),sessionStorage.setItem("tabId",c)),{tabId:c}}class rn{constructor(e){Se(this,"ready");Se(this,"tabId");Se(this,"terminal");Se(this,"trpc");const o=br({links:[wr({condition:y=>y.type==="subscription",true:Er({url:"/trpc"}),false:Cr({url:"/trpc"})})]});this.trpc=o,this.tabId=Fr();const d=this.tabId,v=Hr(e,{onMouseEvent(y){o.neovim.sendStdin.mutate({tabId:d,data:y}).catch(k=>{console.error("Error sending mouse event",k)})},onKeyPress(y){o.neovim.sendStdin.mutate({tabId:d,data:y.key})}});this.terminal=v,this.ready=new Promise(y=>{console.log("Subscribing to stdout"),o.neovim.onStdout.subscribe({client:d},{onStarted(){y()},onData(k){v.write(k)},onError(k){console.error("Error from the application",k)}})})}async startNeovim(e){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:e.filename,additionalEnvironmentVariables:e.additionalEnvironmentVariables,startupScriptModifications:e.startupScriptModifications,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}},tabId:this.tabId})}async runBlockingShellCommand(e){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...e,tabId:this.tabId})}async runLuaCode(e){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...e,tabId:this.tabId})}async waitForLuaCode(e){await this.ready;try{return await this.trpc.neovim.waitForLuaCode.mutate({...e,tabId:this.tabId})}catch(o){throw o}}async runExCommand(e){return await this.ready,this.trpc.neovim.runExCommand.mutate({...e,tabId:this.tabId})}}class sn{constructor(e){Se(this,"ready");Se(this,"tabId");Se(this,"terminal");Se(this,"trpc");const o=br({links:[wr({condition:y=>y.type==="subscription",true:Er({url:"/trpc"}),false:Cr({url:"/trpc"})})]});this.trpc=o,this.tabId=Fr();const d=this.tabId,v=Hr(e,{onMouseEvent(y){o.terminal.sendStdin.mutate({tabId:d,data:y}).catch(k=>{console.error("Error sending mouse event",k)})},onKeyPress(y){o.terminal.sendStdin.mutate({tabId:d,data:y.key})}});this.terminal=v,this.ready=new Promise(y=>{console.log("Subscribing to stdout"),o.terminal.onStdout.subscribe({client:d},{onStarted(){y()},onData(k){v.write(k)},onError(k){console.error("Error from the application",k)}})})}async startTerminalApplication(e){return await this.ready,await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:e.additionalEnvironmentVariables,commandToRun:e.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(e){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...e,tabId:this.tabId})}}class Nr{constructor(e){Se(this,"value");this.factory=e}get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const Vt=document.querySelector("#app");if(!Vt)throw new Error("No app element found");const nn=new Nr(()=>new rn(Vt)),on=new Nr(()=>new sn(Vt));window.startNeovim=async function(c){const e=nn.get(),o=await e.startNeovim({additionalEnvironmentVariables:c==null?void 0:c.additionalEnvironmentVariables,filename:(c==null?void 0:c.filename)??"initial-file.txt",startupScriptModifications:(c==null?void 0:c.startupScriptModifications)??[]});return{runBlockingShellCommand(v){return e.runBlockingShellCommand(v)},runLuaCode(v){return e.runLuaCode(v)},waitForLuaCode(v){return e.waitForLuaCode(v)},runExCommand(v){return e.runExCommand(v)},dir:o}};window.startTerminalApplication=async function(c){const e=on.get();return{dir:await e.startTerminalApplication(c),runBlockingShellCommand(d){return e.runBlockingShellCommand(d)}}};