import{c as Ce,r as Y,j as S,u as It,S as Je,g as jt,a as Nt,b as ht,d as Ht,R as Ft}from"./index-XAQEFxR0.js";import{C as Wt}from"./chevron-left-AiuWqI8X.js";import{M as Ve}from"./monitor-Bka8pfvD.js";import{S as Pe}from"./search-BAkj-wLk.js";import{D as Ut}from"./download-B5hOBf36.js";import{F as Te}from"./file-text-YXpqYYkL.js";import{T as Ze}from"./terminal-quH4CBjU.js";import{G as $t}from"./globe-ggO-5B8t.js";import{S as Xe}from"./settings-B7kmtFXD.js";import{U as ct,T as rt}from"./user-CG273jvt.js";import{W as dt,p as ut,M as zt,S as ft}from"./index-Rrq4Fsy1.js";import{C as _t}from"./chevron-down-Aw6gVMVv.js";import{X as pt}from"./x-BjlbuifP.js";import{P as Kt}from"./play-BOJBiIfL.js";import{A as Ge}from"./activity-DJNZk-yp.js";import{F as qt}from"./funnel-yF5iC01W.js";import{I as Vt}from"./info-Cc_BztP1.js";import{C as Re}from"./chevron-right-3LV85XzN.js";import{N as Xt,S as Gt}from"./skull-CbMwERHs.js";import{B as Yt}from"./book-open-YNf-MZ7G.js";/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jt=[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],vt=Ce("battery",Jt);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zt=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Qe=Ce("folder",Zt);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qt=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Ye=Ce("hard-drive",Qt);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const es=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],gt=Ce("layout-grid",es);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ts=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],mt=Ce("power",ts);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ss=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],St=Ce("volume-2",ss),bt=Y.createContext(),ue=()=>{const C=Y.useContext(bt);if(!C)throw new Error("useLab must be used within a LabProvider");return C},is=({children:C,initialOS:E="windows"})=>{const[R,O]=Y.useState(E),[D,H]=Y.useState(!0),[M,r]=Y.useState(!1),n={windows:{name:"Windows 11",bg:"bg-[#0078D7]",taskbarColor:"bg-[#f3f3f3]/80 backdrop-blur-md",windowTitleBar:"bg-white",font:"font-sans"},linux:{name:"Kali Linux",bg:"bg-[#1a1a1a]",taskbarColor:"bg-[#2b2b2b]",windowTitleBar:"bg-[#2d2d2d]",font:"font-mono"}},l=()=>{H(!0),O(t=>t==="windows"?"linux":"windows")},[d,o]=Y.useState([]),u=(t,s,a)=>{const c=d.find(m=>m.appId===t);if(c){o(m=>[...m.filter(v=>v.appId!==t),{...c,isMinimized:!1,isActive:!0}]);return}const _=Date.now();o(m=>[...m,{id:_,appId:t,title:s,x:100+m.length*30,y:80+m.length*30,width:800,height:500,isMinimized:!1,isActive:!0,content:a}])},p=t=>{o(s=>s.filter(a=>a.id!==t))},g=t=>{o(s=>s.map(a=>a.id===t?{...a,isMinimized:!a.isMinimized}:a))},f=t=>{o(s=>{const a=s.find(_=>_.id===t);return a?[...s.filter(_=>_.id!==t),{...a,isActive:!0}]:s})},e=t=>{H(!0),O(t)},i={osType:R,setOsType:O,theme:n[R],isBooting:D,setIsBooting:H,toggleOs:l,switchOS:e,startMenuOpen:M,setStartMenuOpen:r,windows:d,openWindow:u,closeWindow:p,minimizeWindow:g,focusWindow:f};return S.jsx(bt.Provider,{value:i,children:C})},rs=({onComplete:C})=>{const{osType:E}=ue(),[R,O]=Y.useState(0),[D,H]=Y.useState([]);return Y.useEffect(()=>{if(O(0),H([]),E==="linux"){const M=["Loading Linux kernel 6.5.0-kali3-amd64...","Loading initial ramdisk...","[    0.000000] Linux version 6.5.0-kali3-amd64","[    0.000000] Command line: BOOT_IMAGE=/vmlinuz root=UUID=...","[    0.003141] Memory: 16234124K/16777216K available","[    1.234567] usb 1-1: new high-speed USB device number 2","[    2.345678] EXT4-fs (sda1): mounted filesystem","[    3.456789] systemd[1]: Inserted module 'autofs4'","[    4.567890] systemd[1]: Started Password Requests Dispatcher.","[    5.678901] [ OK ] Reached target Remote File Systems.","[    6.789012] [ OK ] Reached target Swap.","[    7.890123] [ OK ] Started Network Manager Dispatcher.","[    8.901234] [ OK ] Started GNOME Display Manager.","[    9.123456] Kali Linux Rolling 2024.1 tty1","kali login: root (automatic)","Password: checksum verified","Last login: Fri Jan  2 07:18:50 EST 2026","Starting X Server..."];let r=0;const n=setInterval(()=>{r<M.length?(H(l=>[...l,M[r]]),r++):(clearInterval(n),C&&setTimeout(C,500))},60+Math.random()*80);return()=>clearInterval(n)}else{const M=setInterval(()=>{O(r=>r>=100?(clearInterval(M),C&&setTimeout(C,800),100):r+(Math.random()>.8?.5:2.5))},50);return()=>clearInterval(M)}},[E,C]),E==="linux"?S.jsxs("div",{className:"fixed inset-0 bg-black text-[#d3d3d3] font-mono text-[11px] p-6 z-[9999] overflow-hidden flex flex-col justify-start items-start leading-tight",children:[S.jsxs("div",{className:"flex gap-4 mb-4 opacity-50",children:[S.jsx("span",{children:"VIRTUAL-BIOS V1.0"}),S.jsx("span",{children:"READY"})]}),S.jsxs("div",{className:"flex-1 overflow-hidden w-full",children:[D.map((M,r)=>S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("span",{className:"text-gray-600",children:["[",r.toString().padStart(2,"0"),"]"]}),S.jsx("span",{className:M&&M.includes&&M.includes("OK")?"text-green-500":"",children:M})]},r)),S.jsx("div",{className:"w-2 h-4 bg-white/50 animate-pulse mt-1"})]})]}):S.jsxs("div",{className:"fixed inset-0 bg-black z-[9999] flex flex-col items-center justify-center text-white",children:[S.jsx("div",{className:"relative mb-20",children:S.jsxs("svg",{width:"100",height:"100",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"0",y:"0",width:"42",height:"42",fill:"white"}),S.jsx("rect",{x:"44",y:"0",width:"42",height:"42",fill:"white"}),S.jsx("rect",{x:"0",y:"44",width:"42",height:"42",fill:"white"}),S.jsx("rect",{x:"44",y:"44",width:"42",height:"42",fill:"white"})]})}),S.jsx("div",{className:"relative flex items-center justify-center h-10",children:S.jsx("div",{className:"flex gap-2",children:[0,1,2,3,4].map(M=>S.jsx("div",{className:"w-1.5 h-1.5 bg-white rounded-full animate-bounce",style:{animationDelay:`${M*150}ms`}},M))})}),S.jsx("div",{className:"mt-12 font-light text-lg tracking-wide opacity-60",children:"Initializing System..."})]})};var wt={exports:{}};(function(C,E){(function(R,O){C.exports=O()})(self,()=>(()=>{var R={4567:function(M,r,n){var l=this&&this.__decorate||function(s,a,c,_){var m,h=arguments.length,v=h<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,c):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,a,c,_);else for(var y=s.length-1;y>=0;y--)(m=s[y])&&(v=(h<3?m(v):h>3?m(a,c,v):m(a,c))||v);return h>3&&v&&Object.defineProperty(a,c,v),v},d=this&&this.__param||function(s,a){return function(c,_){a(c,_,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=n(9042),u=n(6114),p=n(9924),g=n(844),f=n(5596),e=n(4725),i=n(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(s,a){super(),this._terminal=s,this._renderService=a,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=document.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(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(c=>this._handleTab(c))),this.register(this._terminal.onKey(c=>this._handleKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new f.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,i.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let a=0;a<s;a++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)),u.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,u.isMac&&this._liveRegion.remove()}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,a){this._liveRegionDebouncer.refresh(s,a,this._terminal.rows)}_renderRows(s,a){const c=this._terminal.buffer,_=c.lines.length.toString();for(let m=s;m<=a;m++){const h=c.translateBufferLineToString(c.ydisp+m,!0),v=(c.ydisp+m+1).toString(),y=this._rowElements[m];y&&(h.length===0?y.innerText=" ":y.textContent=h,y.setAttribute("aria-posinset",v),y.setAttribute("aria-setsize",_))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,a){const c=s.target,_=this._rowElements[a===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==_)return;let m,h;if(a===0?(m=c,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=c,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),a===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=document.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_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 s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=l([d(1,e.IRenderService)],t)},3614:(M,r)=>{function n(u){return u.replace(/\r?\n/g,"\r")}function l(u,p){return p?"\x1B[200~"+u+"\x1B[201~":u}function d(u,p,g,f){u=l(u=n(u),g.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(u,!0),p.value=""}function o(u,p,g){const f=g.getBoundingClientRect(),e=u.clientX-f.left-10,i=u.clientY-f.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${e}px`,p.style.top=`${i}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=n,r.bracketTextForPaste=l,r.copyHandler=function(u,p){u.clipboardData&&u.clipboardData.setData("text/plain",p.selectionText),u.preventDefault()},r.handlePasteEvent=function(u,p,g,f){u.stopPropagation(),u.clipboardData&&d(u.clipboardData.getData("text/plain"),p,g,f)},r.paste=d,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(u,p,g,f,e){o(u,p,g),e&&f.rightClickSelect(u),p.value=f.selectionText,p.select()}},7239:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=n(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(d,o,u){this._css.set(d,o,u)}getCss(d,o){return this._css.get(d,o)}setColor(d,o,u){this._color.set(d,o,u)}getColor(d,o){return this._color.get(d,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(n,l,d,o){n.addEventListener(l,d,o);let u=!1;return{dispose:()=>{u||(u=!0,n.removeEventListener(l,d,o))}}}},6465:function(M,r,n){var l=this&&this.__decorate||function(e,i,t,s){var a,c=arguments.length,_=c<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,i,t,s);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(_=(c<3?a(_):c>3?a(i,t,_):a(i,t))||_);return c>3&&_&&Object.defineProperty(i,t,_),_},d=this&&this.__param||function(e,i){return function(t,s){i(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const o=n(3656),u=n(8460),p=n(844),g=n(2585);let f=r.Linkifier2=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new u.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new u.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const i=this._linkProviders.indexOf(e);i!==-1&&this._linkProviders.splice(i,1)}}}attachToDom(e,i,t){this._element=e,this._mouseService=i,this._renderService=t,this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const t=e.composedPath();for(let s=0;s<t.length;s++){const a=t[s];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){var t,s;this._activeProviderReplies&&i||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(c=>{c==null||c.forEach(_=>{_.link.dispose&&_.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let a=!1;for(const[c,_]of this._linkProviders.entries())i?!((s=this._activeProviderReplies)===null||s===void 0)&&s.get(c)&&(a=this._checkLinkProviderResult(c,e,a)):_.provideLinks(e.y,m=>{var h,v;if(this._isMouseOut)return;const y=m==null?void 0:m.map(T=>({link:T}));(h=this._activeProviderReplies)===null||h===void 0||h.set(c,y),a=this._checkLinkProviderResult(c,e,a),((v=this._activeProviderReplies)===null||v===void 0?void 0:v.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){const t=new Set;for(let s=0;s<i.size;s++){const a=i.get(s);if(a)for(let c=0;c<a.length;c++){const _=a[c],m=_.link.range.start.y<e?0:_.link.range.start.x,h=_.link.range.end.y>e?this._bufferService.cols:_.link.range.end.x;for(let v=m;v<=h;v++){if(t.has(v)){a.splice(c--,1);break}t.add(v)}}}}_checkLinkProviderResult(e,i,t){var s;if(!this._activeProviderReplies)return t;const a=this._activeProviderReplies.get(e);let c=!1;for(let _=0;_<e;_++)this._activeProviderReplies.has(_)&&!this._activeProviderReplies.get(_)||(c=!0);if(!c&&a){const _=a.find(m=>this._linkAtPosition(m.link,i));_&&(t=!0,this._handleNewLink(_))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let _=0;_<this._activeProviderReplies.size;_++){const m=(s=this._activeProviderReplies.get(_))===null||s===void 0?void 0:s.find(h=>this._linkAtPosition(h.link,i));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,s;return(s=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||s===void 0?void 0:s.decorations.pointerCursor},set:t=>{var s,a;!((s=this._currentLink)===null||s===void 0)&&s.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((a=this._element)===null||a===void 0||a.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,s;return(s=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||s===void 0?void 0:s.decorations.underline},set:t=>{var s,a,c;!((s=this._currentLink)===null||s===void 0)&&s.state&&((c=(a=this._currentLink)===null||a===void 0?void 0:a.state)===null||c===void 0?void 0:c.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const s=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(s,a),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,i,t){var s;!((s=this._currentLink)===null||s===void 0)&&s.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(t,i.text)}_fireUnderlineEvent(e,i){const t=e.range,s=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-s-1,t.end.x,t.end.y-s-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,i,t){var s;!((s=this._currentLink)===null||s===void 0)&&s.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(t,i.text)}_linkAtPosition(e,i){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,a=i.y*this._bufferService.cols+i.x;return t<=a&&a<=s}_positionFromMouseEvent(e,i,t){const s=t.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,t,s,a){return{x1:e,y1:i,x2:t,y2:s,cols:this._bufferService.cols,fg:a}}};r.Linkifier2=f=l([d(0,g.IBufferService)],f)},9042:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(M,r,n){var l=this&&this.__decorate||function(f,e,i,t){var s,a=arguments.length,c=a<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(f,e,i,t);else for(var _=f.length-1;_>=0;_--)(s=f[_])&&(c=(a<3?s(c):a>3?s(e,i,c):s(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c},d=this&&this.__param||function(f,e){return function(i,t){e(i,t,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const o=n(511),u=n(2585);let p=r.OscLinkProvider=class{constructor(f,e,i){this._bufferService=f,this._optionsService=e,this._oscLinkService=i}provideLinks(f,e){var i;const t=this._bufferService.buffer.lines.get(f-1);if(!t)return void e(void 0);const s=[],a=this._optionsService.rawOptions.linkHandler,c=new o.CellData,_=t.getTrimmedLength();let m=-1,h=-1,v=!1;for(let y=0;y<_;y++)if(h!==-1||t.hasContent(y)){if(t.loadCell(y,c),c.hasExtendedAttrs()&&c.extended.urlId){if(h===-1){h=y,m=c.extended.urlId;continue}v=c.extended.urlId!==m}else h!==-1&&(v=!0);if(v||h!==-1&&y===_-1){const T=(i=this._oscLinkService.getLinkData(m))===null||i===void 0?void 0:i.uri;if(T){const x={start:{x:h+1,y:f},end:{x:y+(v||y!==_-1?0:1),y:f}};let A=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{const I=new URL(T);["http:","https:"].includes(I.protocol)||(A=!0)}catch{A=!0}A||s.push({text:T,range:x,activate:(I,F)=>a?a.activate(I,F,x):g(0,F),hover:(I,F)=>{var U;return(U=a==null?void 0:a.hover)===null||U===void 0?void 0:U.call(a,I,F,x)},leave:(I,F)=>{var U;return(U=a==null?void 0:a.leave)===null||U===void 0?void 0:U.call(a,I,F,x)}})}v=!1,c.hasExtendedAttrs()&&c.extended.urlId?(h=y,m=c.extended.urlId):(h=-1,m=-1)}}e(s)}};function g(f,e){if(confirm(`Do you want to navigate to ${e}?

WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=p=l([d(0,u.IBufferService),d(1,u.IOptionsService),d(2,u.IOscLinkService)],p)},6193:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(n,l){this._parentWindow=n,this._renderCallback=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(n,l,d){this._rowCount=d,n=n!==void 0?n:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._parentWindow.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 n=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},5596:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const l=n(844);class d extends l.Disposable{constructor(u){super(),this._parentWindow=u,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,l.toDisposable)(()=>{this.clearListener()}))}setListener(u){this._listener&&this.clearListener(),this._listener=u,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)===null||u===void 0||u.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=d},3236:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=n(3614),d=n(3656),o=n(6465),u=n(9042),p=n(3730),g=n(1680),f=n(3107),e=n(5744),i=n(2950),t=n(1296),s=n(428),a=n(4269),c=n(5114),_=n(8934),m=n(3230),h=n(9312),v=n(4725),y=n(6731),T=n(8055),x=n(8969),A=n(8460),I=n(844),F=n(6114),U=n(8437),W=n(2584),b=n(7399),k=n(5941),L=n(9074),B=n(2585),$=n(5435),z=n(4567),V=typeof window<"u"?window.document:null;class q extends x.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(w={}){super(w),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 A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(o.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((P,N)=>this.refresh(P,N))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(P=>this._reportWindowsOptions(P))),this.register(this._inputHandler.onColor(P=>this._handleColorEvent(P))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(P=>this._afterResize(P.cols,P.rows))),this.register((0,I.toDisposable)(()=>{var P,N;this._customKeyEventHandler=void 0,(N=(P=this.element)===null||P===void 0?void 0:P.parentNode)===null||N===void 0||N.removeChild(this.element)}))}_handleColorEvent(w){if(this._themeService)for(const P of w){let N,j="";switch(P.index){case 256:N="foreground",j="10";break;case 257:N="background",j="11";break;case 258:N="cursor",j="12";break;default:N="ansi",j="4;"+P.index}switch(P.type){case 0:const X=T.color.toColorRGB(N==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[N]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${j};${(0,k.toRgbString)(X)}${W.C1_ESCAPED.ST}`);break;case 1:if(N==="ansi")this._themeService.modifyColors(K=>K.ansi[P.index]=T.rgba.toColor(...P.color));else{const K=N;this._themeService.modifyColors(J=>J[K]=T.rgba.toColor(...P.color))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(w){w?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(w){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.updateCursorStyle(w),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var w;return(w=this.textarea)===null||w===void 0?void 0:w.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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 w=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(w);if(!P)return;const N=Math.min(this.buffer.x,this.cols-1),j=this._renderService.dimensions.css.cell.height,X=P.getWidth(N),K=this._renderService.dimensions.css.cell.width*X,J=this.buffer.y*this._renderService.dimensions.css.cell.height,te=N*this._renderService.dimensions.css.cell.width;this.textarea.style.left=te+"px",this.textarea.style.top=J+"px",this.textarea.style.width=K+"px",this.textarea.style.height=j+"px",this.textarea.style.lineHeight=j+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",P=>{this.hasSelection()&&(0,l.copyHandler)(P,this._selectionService)}));const w=P=>(0,l.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",w)),this.register((0,d.addDisposableDomListener)(this.element,"paste",w)),F.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",P=>{P.button===2&&(0,l.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",P=>{(0,l.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",P=>{P.button===1&&(0,l.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",w=>this._keyUp(w),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",w=>this._keyDown(w),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",w=>this._keyPress(w),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",w=>this._compositionHelper.compositionupdate(w))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",w=>this._inputEvent(w),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(w){var P;if(!w)throw new Error("Terminal requires a parent element.");w.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=w.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),w.appendChild(this.element);const N=V.createDocumentFragment();this._viewportElement=V.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.appendChild(this._viewportElement),this._viewportScrollArea=V.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=V.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=V.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=V.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",u.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._instantiationService.createInstance(c.CoreBrowserService,this.textarea,(P=this._document.defaultView)!==null&&P!==void 0?P:window),this._instantiationService.setService(v.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",j=>this._handleTextAreaFocus(j))),this.register((0,d.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(v.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(y.ThemeService),this._instantiationService.setService(v.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(v.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(v.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(j=>this._onRender.fire(j))),this.onResize(j=>this._renderService.resize(j.cols,j.rows)),this._compositionView=V.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(_.MouseService),this._instantiationService.setService(v.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(j=>this.scrollLines(j.amount,j.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(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(v.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(j=>this.scrollLines(j.amount,j.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(j=>this._renderService.handleSelectionChanged(j.start,j.end,j.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(j=>{this.textarea.value=j,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(j=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",j=>this._selectionService.handleMouseDown(j))),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(z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",j=>this._handleScreenReaderModeOptionChange(j))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",j=>{!this._overviewRulerRenderer&&j&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const w=this,P=this.element;function N(K){const J=w._mouseService.getMouseReportCoords(K,w.screenElement);if(!J)return!1;let te,ne;switch(K.overrideType||K.type){case"mousemove":ne=32,K.buttons===void 0?(te=3,K.button!==void 0&&(te=K.button<3?K.button:3)):te=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":ne=0,te=K.button<3?K.button:3;break;case"mousedown":ne=1,te=K.button<3?K.button:3;break;case"wheel":if(w.viewport.getLinesScrolled(K)===0)return!1;ne=K.deltaY<0?0:1,te=4;break;default:return!1}return!(ne===void 0||te===void 0||te>4)&&w.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:te,action:ne,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const j={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:K=>(N(K),K.buttons||(this._document.removeEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.removeEventListener("mousemove",j.mousedrag)),this.cancel(K)),wheel:K=>(N(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&N(K)},mousemove:K=>{K.buttons||N(K)}};this.register(this.coreMouseService.onProtocolChange(K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?j.mousemove||(P.addEventListener("mousemove",X.mousemove),j.mousemove=X.mousemove):(P.removeEventListener("mousemove",j.mousemove),j.mousemove=null),16&K?j.wheel||(P.addEventListener("wheel",X.wheel,{passive:!1}),j.wheel=X.wheel):(P.removeEventListener("wheel",j.wheel),j.wheel=null),2&K?j.mouseup||(P.addEventListener("mouseup",X.mouseup),j.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",j.mouseup),P.removeEventListener("mouseup",j.mouseup),j.mouseup=null),4&K?j.mousedrag||(j.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",j.mousedrag),j.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(P,"mousedown",K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return N(K),j.mouseup&&this._document.addEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.addEventListener("mousemove",j.mousedrag),this.cancel(K)})),this.register((0,d.addDisposableDomListener)(P,"wheel",K=>{if(!j.wheel){if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(K);if(J===0)return;const te=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let ne="";for(let be=0;be<Math.abs(J);be++)ne+=te;return this.coreService.triggerDataEvent(ne,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(P,"touchstart",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)},{passive:!0})),this.register((0,d.addDisposableDomListener)(P,"touchmove",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)},{passive:!1}))}refresh(w,P){var N;(N=this._renderService)===null||N===void 0||N.refreshRows(w,P)}updateCursorStyle(w){var P;!((P=this._selectionService)===null||P===void 0)&&P.shouldColumnSelect(w)?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(w,P,N=0){var j;N===1?(super.scrollLines(w,P,N),this.refresh(0,this.rows-1)):(j=this.viewport)===null||j===void 0||j.scrollLines(w)}paste(w){(0,l.paste)(w,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(w){this._customKeyEventHandler=w}registerLinkProvider(w){return this.linkifier2.registerLinkProvider(w)}registerCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(w);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(w)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(w){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+w)}registerDecoration(w){return this._decorationService.registerDecoration(w)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(w,P,N){this._selectionService.setSelection(w,P,N)}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 w;(w=this._selectionService)===null||w===void 0||w.clearSelection()}selectAll(){var w;(w=this._selectionService)===null||w===void 0||w.selectAll()}selectLines(w,P){var N;(N=this._selectionService)===null||N===void 0||N.selectLines(w,P)}_keyDown(w){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&w.altKey;if(!P&&!this._compositionHelper.keydown(w))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||w.key!=="Dead"&&w.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const N=(0,b.evaluateKeyboardEvent)(w,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(w),N.type===3||N.type===2){const j=this.rows-1;return this.scrollLines(N.type===2?-j:j),this.cancel(w,!0)}return N.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,w)||(N.cancel&&this.cancel(w,!0),!N.key||!!(w.key&&!w.ctrlKey&&!w.altKey&&!w.metaKey&&w.key.length===1&&w.key.charCodeAt(0)>=65&&w.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(N.key!==W.C0.ETX&&N.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:N.key,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(N.key,!0),!this.optionsService.rawOptions.screenReaderMode||w.altKey||w.ctrlKey?this.cancel(w,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(w,P){const N=w.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||w.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||w.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?N:N&&(!P.keyCode||P.keyCode>47)}_keyUp(w){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1||(function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18}(w)||this.focus(),this.updateCursorStyle(w),this._keyPressHandled=!1)}_keyPress(w){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;if(this.cancel(w),w.charCode)P=w.charCode;else if(w.which===null||w.which===void 0)P=w.keyCode;else{if(w.which===0||w.charCode===0)return!1;P=w.which}return!(!P||(w.altKey||w.ctrlKey||w.metaKey)&&!this._isThirdLevelShift(this.browser,w)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(w){if(w.data&&w.inputType==="insertText"&&(!w.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=w.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(w),!0}return!1}resize(w,P){w!==this.cols||P!==this.rows?super.resize(w,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(w,P){var N,j;(N=this._charSizeService)===null||N===void 0||N.measure(),(j=this.viewport)===null||j===void 0||j.syncScrollArea(!0)}clear(){var w;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(w=this.viewport)===null||w===void 0||w.reset(),this.refresh(0,this.rows-1)}}reset(){var w,P;this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),(w=this._selectionService)===null||w===void 0||w.reset(),this._decorationService.reset(),(P=this.viewport)===null||P===void 0||P.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){var w;(w=this._renderService)===null||w===void 0||w.clearTextureAtlas()}_reportFocus(){var w;!((w=this.element)===null||w===void 0)&&w.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(w){if(this._renderService)switch(w){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),N=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${N};${P}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const j=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${X};${j}t`)}}cancel(w,P){if(this.options.cancelEvents||P)return w.preventDefault(),w.stopPropagation(),!1}}r.Terminal=q},9924:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(n,l=1e3){this._renderCallback=n,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,l,d){this._rowCount=d,n=n!==void 0?n:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const u=o-this._lastRefreshMs,p=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const n=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,l)}}},1680:function(M,r,n){var l=this&&this.__decorate||function(i,t,s,a){var c,_=arguments.length,m=_<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,t,s,a);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(m=(_<3?c(m):_>3?c(t,s,m):c(t,s))||m);return _>3&&m&&Object.defineProperty(t,s,m),m},d=this&&this.__param||function(i,t){return function(s,a){t(s,a,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const o=n(3656),u=n(4725),p=n(8460),g=n(844),f=n(2585);let e=r.Viewport=class extends g.Disposable{constructor(i,t,s,a,c,_,m,h){super(),this._viewportElement=i,this._scrollArea=t,this._bufferService=s,this._optionsService=a,this._charSizeService=c,this._renderService=_,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(v=>this._activeBuffer=v.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(v=>this._renderDimensions=v)),this._handleThemeChange(h.colors),this.register(h.onChangeColors(v=>this._handleThemeChange(v))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(i){if(i)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(i,t){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&s<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const t=this._getPixelsScrolled(i);return t!==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+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(i,t))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=i*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let t=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(i,t){var s;let a,c="";const _=[],m=t??this._bufferService.buffer.lines.length,h=this._bufferService.buffer.lines;for(let v=i;v<m;v++){const y=h.get(v);if(!y)continue;const T=(s=h.get(v+1))===null||s===void 0?void 0:s.isWrapped;if(c+=y.translateToString(!T),!T||v===h.length-1){const x=document.createElement("div");x.textContent=c,_.push(x),c.length>0&&(a=x),c=""}}return{bufferElements:_,cursorElement:a}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let t=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(i,t){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&t.altKey||s==="ctrl"&&t.ctrlKey||s==="shift"&&t.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const t=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(i,t))}};r.Viewport=e=l([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,u.ICharSizeService),d(5,u.IRenderService),d(6,u.ICoreBrowserService),d(7,u.IThemeService)],e)},3107:function(M,r,n){var l=this&&this.__decorate||function(e,i,t,s){var a,c=arguments.length,_=c<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,i,t,s);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(_=(c<3?a(_):c>3?a(i,t,_):a(i,t))||_);return c>3&&_&&Object.defineProperty(i,t,_),_},d=this&&this.__param||function(e,i){return function(t,s){i(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const o=n(3656),u=n(4725),p=n(844),g=n(2585);let f=r.BufferDecorationRenderer=class extends p.Disposable{constructor(e,i,t,s){super(),this._screenElement=e,this._bufferService=i,this._decorationService=t,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((0,o.addDisposableDomListener)(window,"resize",()=>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(a=>this._removeDecoration(a))),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 e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var i,t;const s=document.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)===null||i===void 0?void 0:i.layer)==="top"),s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",s.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=(t=e.options.x)!==null&&t!==void 0?t:0;return a&&a>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(e,s),s}_refreshStyle(e){const i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let t=this._decorationElements.get(e);t||(t=this._createElement(e),e.element=t,this._decorationElements.set(e,t),this._container.appendChild(t),e.onDispose(()=>{this._decorationElements.delete(e),t.remove()})),t.style.top=i*this._renderService.dimensions.css.cell.height+"px",t.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(t)}}_refreshXPosition(e,i=e.element){var t;if(!i)return;const s=(t=e.options.x)!==null&&t!==void 0?t:0;(e.options.anchor||"left")==="right"?i.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))===null||i===void 0||i.remove(),this._decorationElements.delete(e),e.dispose()}};r.BufferDecorationRenderer=f=l([d(1,g.IBufferService),d(2,g.IDecorationService),d(3,u.IRenderService)],f)},5871:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(n){if(n.options.overviewRulerOptions){for(const l of this._zones)if(l.color===n.options.overviewRulerOptions.color&&l.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,n.marker.line))return;if(this._lineAdjacentToZone(l,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(l,n.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=n.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=n.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=n.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=n.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:n.options.overviewRulerOptions.color,position:n.options.overviewRulerOptions.position,startBufferLine:n.marker.line,endBufferLine:n.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(n){this._linePadding=n}_lineIntersectsZone(n,l){return l>=n.startBufferLine&&l<=n.endBufferLine}_lineAdjacentToZone(n,l,d){return l>=n.startBufferLine-this._linePadding[d||"full"]&&l<=n.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(n,l){n.startBufferLine=Math.min(n.startBufferLine,l),n.endBufferLine=Math.max(n.endBufferLine,l)}}},5744:function(M,r,n){var l=this&&this.__decorate||function(a,c,_,m){var h,v=arguments.length,y=v<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,_,m);else for(var T=a.length-1;T>=0;T--)(h=a[T])&&(y=(v<3?h(y):v>3?h(c,_,y):h(c,_))||y);return v>3&&y&&Object.defineProperty(c,_,y),y},d=this&&this.__param||function(a,c){return function(_,m){c(_,m,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const o=n(5871),u=n(3656),p=n(4725),g=n(844),f=n(2585),e={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0};let s=r.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(a,c,_,m,h,v,y){var T;super(),this._viewportElement=a,this._screenElement=c,this._bufferService=_,this._decorationService=m,this._renderService=h,this._optionsService=v,this._coreBrowseService=y,this._colorZoneStore=new o.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(T=this._viewportElement.parentElement)===null||T===void 0||T.insertBefore(this._canvas,this._viewportElement);const x=this._canvas.getContext("2d");if(!x)throw new Error("Ctx cannot be null");this._ctx=x,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var A;(A=this._canvas)===null||A===void 0||A.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((0,u.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const a=Math.floor(this._canvas.width/3),c=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=a,i.center=c,i.right=a,this._refreshDrawHeightConstants(),t.full=0,t.left=0,t.center=i.left,t.right=i.left+i.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const a=this._canvas.height/this._bufferService.buffer.lines.length,c=Math.round(Math.max(Math.min(a,12),6)*this._coreBrowseService.dpr);e.left=c,e.center=c,e.right=c}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const c of this._decorationService.decorations)this._colorZoneStore.addDecoration(c);this._ctx.lineWidth=1;const a=this._colorZoneStore.zones;for(const c of a)c.position!=="full"&&this._renderColorZone(c);for(const c of a)c.position==="full"&&this._renderColorZone(c);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(a){this._ctx.fillStyle=a.color,this._ctx.fillRect(t[a.position||"full"],Math.round((this._canvas.height-1)*(a.startBufferLine/this._bufferService.buffers.active.lines.length)-e[a.position||"full"]/2),i[a.position||"full"],Math.round((this._canvas.height-1)*((a.endBufferLine-a.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[a.position||"full"]))}_queueRefresh(a,c){this._shouldUpdateDimensions=a||this._shouldUpdateDimensions,this._shouldUpdateAnchor=c||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=s=l([d(2,f.IBufferService),d(3,f.IDecorationService),d(4,p.IRenderService),d(5,f.IOptionsService),d(6,p.ICoreBrowserService)],s)},2950:function(M,r,n){var l=this&&this.__decorate||function(f,e,i,t){var s,a=arguments.length,c=a<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(f,e,i,t);else for(var _=f.length-1;_>=0;_--)(s=f[_])&&(c=(a<3?s(c):a>3?s(e,i,c):s(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c},d=this&&this.__param||function(f,e){return function(i,t){e(i,t,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const o=n(4725),u=n(2585),p=n(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,e,i,t,s,a){this._textarea=f,this._compositionView=e,this._bufferService=i,this._optionsService=t,this._coreService=s,this._renderService=a,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 e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,i=e.replace(f,"");this._dataAlreadySent=i,e.length>f.length?this._coreService.triggerDataEvent(i,!0):e.length<f.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):e.length===f.length&&e!==f&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=t+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=g=l([d(2,u.IBufferService),d(3,u.IOptionsService),d(4,u.ICoreService),d(5,o.IRenderService)],g)},9806:(M,r)=>{function n(l,d,o){const u=o.getBoundingClientRect(),p=l.getComputedStyle(o),g=parseInt(p.getPropertyValue("padding-left")),f=parseInt(p.getPropertyValue("padding-top"));return[d.clientX-u.left-g,d.clientY-u.top-f]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=n,r.getCoords=function(l,d,o,u,p,g,f,e,i){if(!g)return;const t=n(l,d,o);return t?(t[0]=Math.ceil((t[0]+(i?f/2:0))/f),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),u+(i?1:0)),t[1]=Math.min(Math.max(t[1],1),p),t):void 0}},9504:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=n(2584);function d(e,i,t,s){const a=e-o(e,t),c=i-o(i,t),_=Math.abs(a-c)-function(m,h,v){let y=0;const T=m-o(m,v),x=h-o(h,v);for(let A=0;A<Math.abs(T-x);A++){const I=u(m,h)==="A"?-1:1,F=v.buffer.lines.get(T+I*A);F!=null&&F.isWrapped&&y++}return y}(e,i,t);return f(_,g(u(e,i),s))}function o(e,i){let t=0,s=i.buffer.lines.get(e),a=s==null?void 0:s.isWrapped;for(;a&&e>=0&&e<i.rows;)t++,s=i.buffer.lines.get(--e),a=s==null?void 0:s.isWrapped;return t}function u(e,i){return e>i?"A":"B"}function p(e,i,t,s,a,c){let _=e,m=i,h="";for(;_!==t||m!==s;)_+=a?1:-1,a&&_>c.cols-1?(h+=c.buffer.translateBufferLineToString(m,!1,e,_),_=0,e=0,m++):!a&&_<0&&(h+=c.buffer.translateBufferLineToString(m,!1,0,e+1),_=c.cols-1,e=_,m--);return h+c.buffer.translateBufferLineToString(m,!1,e,_)}function g(e,i){const t=i?"O":"[";return l.C0.ESC+t+e}function f(e,i){e=Math.floor(e);let t="";for(let s=0;s<e;s++)t+=i;return t}r.moveToCellSequence=function(e,i,t,s){const a=t.buffer.x,c=t.buffer.y;if(!t.buffer.hasScrollback)return function(h,v,y,T,x,A){return d(v,T,x,A).length===0?"":f(p(h,v,h,v-o(v,x),!1,x).length,g("D",A))}(a,c,0,i,t,s)+d(c,i,t,s)+function(h,v,y,T,x,A){let I;I=d(v,T,x,A).length>0?T-o(T,x):v;const F=T,U=function(W,b,k,L,B,$){let z;return z=d(k,L,B,$).length>0?L-o(L,B):b,W<k&&z<=L||W>=k&&z<L?"C":"D"}(h,v,y,T,x,A);return f(p(h,I,y,F,U==="C",x).length,g(U,A))}(a,c,e,i,t,s);let _;if(c===i)return _=a>e?"D":"C",f(Math.abs(a-e),g(_,s));_=c>i?"D":"C";const m=Math.abs(c-i);return f(function(h,v){return v.cols-h}(c>i?e:a,t)+(m-1)*t.cols+1+((c>i?a:e)-1),g(_,s))}},1296:function(M,r,n){var l=this&&this.__decorate||function(x,A,I,F){var U,W=arguments.length,b=W<3?A:F===null?F=Object.getOwnPropertyDescriptor(A,I):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,A,I,F);else for(var k=x.length-1;k>=0;k--)(U=x[k])&&(b=(W<3?U(b):W>3?U(A,I,b):U(A,I))||b);return W>3&&b&&Object.defineProperty(A,I,b),b},d=this&&this.__param||function(x,A){return function(I,F){A(I,F,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const o=n(3787),u=n(2550),p=n(2223),g=n(6171),f=n(4725),e=n(8055),i=n(8460),t=n(844),s=n(2585),a="xterm-dom-renderer-owner-",c="xterm-rows",_="xterm-fg-",m="xterm-bg-",h="xterm-focus",v="xterm-selection";let y=1,T=r.DomRenderer=class extends t.Disposable{constructor(x,A,I,F,U,W,b,k,L,B){super(),this._element=x,this._screenElement=A,this._viewportElement=I,this._linkifier2=F,this._charSizeService=W,this._optionsService=b,this._bufferService=k,this._coreBrowserService=L,this._themeService=B,this._terminalClass=y++,this._rowElements=[],this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(c),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(v),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors($=>this._injectCss($))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(a+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline($=>this._handleLinkHover($))),this.register(this._linkifier2.onHideLinkUnderline($=>this._handleLinkLeave($))),this.register((0,t.toDisposable)(()=>{this._element.classList.remove(a+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new u.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const x=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*x,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*x),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/x),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/x),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 I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const A=`${this._terminalSelector} .${c} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=A,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(x){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let A=`${this._terminalSelector} .${c} { color: ${x.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;A+=`${this._terminalSelector} .${c} .xterm-dim { color: ${e.color.multiplyOpacity(x.foreground,.5).css};}`,A+=`${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;}`,A+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% {  border-bottom-style: hidden; }}",A+="@keyframes blink_block_"+this._terminalClass+` { 0% {  background-color: ${x.cursor.css};  color: ${x.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${x.cursor.css}; }}`,A+=`${this._terminalSelector} .${c}.${h} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c}.${h} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-block { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css};}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${x.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${x.cursor.css} inset;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${x.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,A+=`${this._terminalSelector} .${v} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${v} div { position: absolute; background-color: ${x.selectionBackgroundOpaque.css};}${this._terminalSelector} .${v} div { position: absolute; background-color: ${x.selectionInactiveBackgroundOpaque.css};}`;for(const[I,F]of x.ansi.entries())A+=`${this._terminalSelector} .${_}${I} { color: ${F.css}; }${this._terminalSelector} .${_}${I}.xterm-dim { color: ${e.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${m}${I} { background-color: ${F.css}; }`;A+=`${this._terminalSelector} .${_}${p.INVERTED_DEFAULT_COLOR} { color: ${e.color.opaque(x.background).css}; }${this._terminalSelector} .${_}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${e.color.multiplyOpacity(e.color.opaque(x.background),.5).css}; }${this._terminalSelector} .${m}${p.INVERTED_DEFAULT_COLOR} { background-color: ${x.foreground.css}; }`,this._themeStyleElement.textContent=A}_setDefaultSpacing(){const x=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${x}px`,this._rowFactory.defaultSpacing=x}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(x,A){for(let I=this._rowElements.length;I<=A;I++){const F=document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>A;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(x,A){this._refreshRowElements(x,A),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(h)}handleFocus(){this._rowContainer.classList.add(h),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(x,A,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(x,A,I),this.renderRows(0,this._bufferService.rows-1),!x||!A)return;const F=x[1]-this._bufferService.buffer.ydisp,U=A[1]-this._bufferService.buffer.ydisp,W=Math.max(F,0),b=Math.min(U,this._bufferService.rows-1);if(W>=this._bufferService.rows||b<0)return;const k=document.createDocumentFragment();if(I){const L=x[0]>A[0];k.appendChild(this._createSelectionElement(W,L?A[0]:x[0],L?x[0]:A[0],b-W+1))}else{const L=F===W?x[0]:0,B=W===U?A[0]:this._bufferService.cols;k.appendChild(this._createSelectionElement(W,L,B));const $=b-W-1;if(k.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,$)),W!==b){const z=U===b?A[0]:this._bufferService.cols;k.appendChild(this._createSelectionElement(b,0,z))}}this._selectionContainer.appendChild(k)}_createSelectionElement(x,A,I,F=1){const U=document.createElement("div");return U.style.height=F*this.dimensions.css.cell.height+"px",U.style.top=x*this.dimensions.css.cell.height+"px",U.style.left=A*this.dimensions.css.cell.width+"px",U.style.width=this.dimensions.css.cell.width*(I-A)+"px",U}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 x of this._rowElements)x.replaceChildren()}renderRows(x,A){const I=this._bufferService.buffer,F=I.ybase+I.y,U=Math.min(I.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,k=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=x;L<=A;L++){const B=L+I.ydisp,$=this._rowElements[L],z=I.lines.get(B);if(!$||!z)break;$.replaceChildren(...this._rowFactory.createRow(z,B,B===F,b,k,U,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${a}${this._terminalClass}`}_handleLinkHover(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!0)}_handleLinkLeave(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!1)}_setCellUnderline(x,A,I,F,U,W){I<0&&(x=0),F<0&&(A=0);const b=this._bufferService.rows-1;I=Math.max(Math.min(I,b),0),F=Math.max(Math.min(F,b),0),U=Math.min(U,this._bufferService.cols);const k=this._bufferService.buffer,L=k.ybase+k.y,B=Math.min(k.x,U-1),$=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=I;q<=F;++q){const Z=q+k.ydisp,w=this._rowElements[q],P=k.lines.get(Z);if(!w||!P)break;w.replaceChildren(...this._rowFactory.createRow(P,Z,Z===L,z,V,B,$,this.dimensions.css.cell.width,this._widthCache,W?q===I?x:0:-1,W?(q===F?A:U)-1:-1))}}};r.DomRenderer=T=l([d(4,s.IInstantiationService),d(5,f.ICharSizeService),d(6,s.IOptionsService),d(7,s.IBufferService),d(8,f.ICoreBrowserService),d(9,f.IThemeService)],T)},3787:function(M,r,n){var l=this&&this.__decorate||function(_,m,h,v){var y,T=arguments.length,x=T<3?m:v===null?v=Object.getOwnPropertyDescriptor(m,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,m,h,v);else for(var A=_.length-1;A>=0;A--)(y=_[A])&&(x=(T<3?y(x):T>3?y(m,h,x):y(m,h))||x);return T>3&&x&&Object.defineProperty(m,h,x),x},d=this&&this.__param||function(_,m){return function(h,v){m(h,v,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const o=n(2223),u=n(643),p=n(511),g=n(2585),f=n(8055),e=n(4725),i=n(4269),t=n(6171),s=n(3734);let a=r.DomRendererRowFactory=class{constructor(_,m,h,v,y,T,x){this._document=_,this._characterJoinerService=m,this._optionsService=h,this._coreBrowserService=v,this._coreService=y,this._decorationService=T,this._themeService=x,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(_,m,h){this._selectionStart=_,this._selectionEnd=m,this._columnSelectMode=h}createRow(_,m,h,v,y,T,x,A,I,F,U){const W=[],b=this._characterJoinerService.getJoinedCharacters(m),k=this._themeService.colors;let L,B=_.getNoBgTrimmedLength();h&&B<T+1&&(B=T+1);let $=0,z="",V=0,q=0,Z=0,w=!1,P=0,N=!1,j=0;const X=[],K=F!==-1&&U!==-1;for(let J=0;J<B;J++){_.loadCell(J,this._workCell);let te=this._workCell.getWidth();if(te===0)continue;let ne=!1,be=J,G=this._workCell;if(b.length>0&&J===b[0][0]){ne=!0;const Q=b.shift();G=new i.JoinedCellData(this._workCell,_.translateToString(!0,Q[0],Q[1]),Q[1]-Q[0]),be=Q[1]-1,te=G.getWidth()}const ye=this._isCellInSelection(J,m),He=h&&J===T,Fe=K&&J>=F&&J<=U;let We=!1;this._decorationService.forEachDecorationAtCell(J,m,void 0,Q=>{We=!0});let Le=G.getChars()||u.WHITESPACE_CELL_CHAR;if(Le===" "&&(G.isUnderline()||G.isOverline())&&(Le=" "),j=te*A-I.get(Le,G.isBold(),G.isItalic()),L){if($&&(ye&&N||!ye&&!N&&G.bg===V)&&(ye&&N&&k.selectionForeground||G.fg===q)&&G.extended.ext===Z&&Fe===w&&j===P&&!He&&!ne&&!We){z+=Le,$++;continue}$&&(L.textContent=z),L=this._document.createElement("span"),$=0,z=""}else L=this._document.createElement("span");if(V=G.bg,q=G.fg,Z=G.extended.ext,w=Fe,P=j,N=ye,ne&&T>=J&&T<=be&&(T=J),!this._coreService.isCursorHidden&&He){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)x&&X.push("xterm-cursor-blink"),X.push(v==="bar"?"xterm-cursor-bar":v==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(y)switch(y){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(G.isBold()&&X.push("xterm-bold"),G.isItalic()&&X.push("xterm-italic"),G.isDim()&&X.push("xterm-dim"),z=G.isInvisible()?u.WHITESPACE_CELL_CHAR:G.getChars()||u.WHITESPACE_CELL_CHAR,G.isUnderline()&&(X.push(`xterm-underline-${G.extended.underlineStyle}`),z===" "&&(z=" "),!G.isUnderlineColorDefault()))if(G.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(G.getUnderlineColor()).join(",")})`;else{let Q=G.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&G.isBold()&&Q<8&&(Q+=8),L.style.textDecorationColor=k.ansi[Q].css}G.isOverline()&&(X.push("xterm-overline"),z===" "&&(z=" ")),G.isStrikethrough()&&X.push("xterm-strikethrough"),Fe&&(L.style.textDecoration="underline");let he=G.getFgColor(),xe=G.getFgColorMode(),de=G.getBgColor(),Ee=G.getBgColorMode();const Ue=!!G.isInverse();if(Ue){const Q=he;he=de,de=Q;const Ot=xe;xe=Ee,Ee=Ot}let pe,$e,ve,ke=!1;switch(this._decorationService.forEachDecorationAtCell(J,m,void 0,Q=>{Q.options.layer!=="top"&&ke||(Q.backgroundColorRGB&&(Ee=50331648,de=Q.backgroundColorRGB.rgba>>8&16777215,pe=Q.backgroundColorRGB),Q.foregroundColorRGB&&(xe=50331648,he=Q.foregroundColorRGB.rgba>>8&16777215,$e=Q.foregroundColorRGB),ke=Q.options.layer==="top")}),!ke&&ye&&(pe=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,de=pe.rgba>>8&16777215,Ee=50331648,ke=!0,k.selectionForeground&&(xe=50331648,he=k.selectionForeground.rgba>>8&16777215,$e=k.selectionForeground)),ke&&X.push("xterm-decoration-top"),Ee){case 16777216:case 33554432:ve=k.ansi[de],X.push(`xterm-bg-${de}`);break;case 50331648:ve=f.rgba.toColor(de>>16,de>>8&255,255&de),this._addStyle(L,`background-color:#${c((de>>>0).toString(16),"0",6)}`);break;default:Ue?(ve=k.foreground,X.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):ve=k.background}switch(pe||G.isDim()&&(pe=f.color.multiplyOpacity(ve,.5)),xe){case 16777216:case 33554432:G.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(L,ve,k.ansi[he],G,pe,void 0)||X.push(`xterm-fg-${he}`);break;case 50331648:const Q=f.rgba.toColor(he>>16&255,he>>8&255,255&he);this._applyMinimumContrast(L,ve,Q,G,pe,$e)||this._addStyle(L,`color:#${c(he.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,ve,k.foreground,G,pe,void 0)||Ue&&X.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}X.length&&(L.className=X.join(" "),X.length=0),He||ne||We?L.textContent=z:$++,j!==this.defaultSpacing&&(L.style.letterSpacing=`${j}px`),W.push(L),J=be}return L&&$&&(L.textContent=z),W}_applyMinimumContrast(_,m,h,v,y,T){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.excludeFromContrastRatioDemands)(v.getCode()))return!1;const x=this._getContrastCache(v);let A;if(y||T||(A=x.getColor(m.rgba,h.rgba)),A===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(v.isDim()?2:1);A=f.color.ensureContrastRatio(y||m,T||h,I),x.setColor((y||m).rgba,(T||h).rgba,A??null)}return!!A&&(this._addStyle(_,`color:${A.css}`),!0)}_getContrastCache(_){return _.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(_,m){_.setAttribute("style",`${_.getAttribute("style")||""}${m};`)}_isCellInSelection(_,m){const h=this._selectionStart,v=this._selectionEnd;return!(!h||!v)&&(this._columnSelectMode?h[0]<=v[0]?_>=h[0]&&m>=h[1]&&_<v[0]&&m<=v[1]:_<h[0]&&m>=h[1]&&_>=v[0]&&m<=v[1]:m>h[1]&&m<v[1]||h[1]===v[1]&&m===h[1]&&_>=h[0]&&_<v[0]||h[1]<v[1]&&m===v[1]&&_<v[0]||h[1]<v[1]&&m===h[1]&&_>=h[0])}};function c(_,m,h){for(;_.length<h;)_=m+_;return _}r.DomRendererRowFactory=a=l([d(1,e.ICharacterJoinerService),d(2,g.IOptionsService),d(3,e.ICoreBrowserService),d(4,g.ICoreService),d(5,g.IDecorationService),d(6,e.IThemeService)],a)},2550:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(n){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=n.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const l=n.createElement("span"),d=n.createElement("span");d.style.fontWeight="bold";const o=n.createElement("span");o.style.fontStyle="italic";const u=n.createElement("span");u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[l,d,o,u],this._container.appendChild(l),this._container.appendChild(d),this._container.appendChild(o),this._container.appendChild(u),n.body.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(n,l,d,o){n===this._font&&l===this._fontSize&&d===this._weight&&o===this._weightBold||(this._font=n,this._fontSize=l,this._weight=d,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(n,l,d){let o=0;if(!l&&!d&&n.length===1&&(o=n.charCodeAt(0))<256)return this._flat[o]!==-9999?this._flat[o]:this._flat[o]=this._measure(n,0);let u=n;l&&(u+="B"),d&&(u+="I");let p=this._holey.get(u);if(p===void 0){let g=0;l&&(g|=1),d&&(g|=2),p=this._measure(n,g),this._holey.set(u,p)}return p}_measure(n,l){const d=this._measureElements[l];return d.textContent=n.repeat(32),d.offsetWidth/32}}},2223:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=n(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(M,r)=>{function n(l){return 57508<=l&&l<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(l){if(!l)throw new Error("value must not be falsy");return l},r.isPowerlineGlyph=n,r.isRestrictedPowerlineGlyph=function(l){return 57520<=l&&l<=57527},r.excludeFromContrastRatioDemands=function(l){return n(l)||function(d){return 9472<=d&&d<=9631}(l)},r.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}}}}},456:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(n){this._bufferService=n,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 n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?n%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)-1]:[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[n,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[Math.max(n,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const n=this.selectionStart,l=this.selectionEnd;return!(!n||!l)&&(n[1]>l[1]||n[1]===l[1]&&n[0]>l[0])}handleTrim(n){return this.selectionStart&&(this.selectionStart[1]-=n),this.selectionEnd&&(this.selectionEnd[1]-=n),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(M,r,n){var l=this&&this.__decorate||function(e,i,t,s){var a,c=arguments.length,_=c<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,i,t,s);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(_=(c<3?a(_):c>3?a(i,t,_):a(i,t))||_);return c>3&&_&&Object.defineProperty(i,t,_),_},d=this&&this.__param||function(e,i){return function(t,s){i(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const o=n(2585),u=n(8460),p=n(844);let g=r.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,i,t){super(),this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=this.register(new u.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new f(e,i,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};r.CharSizeService=g=l([d(2,o.IOptionsService)],g);class f{constructor(i,t,s){this._document=i,this._parentElement=t,this._optionsService=s,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const i={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return i.width!==0&&i.height!==0&&(this._result.width=i.width/32,this._result.height=Math.ceil(i.height)),this._result}}},4269:function(M,r,n){var l=this&&this.__decorate||function(i,t,s,a){var c,_=arguments.length,m=_<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,t,s,a);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(m=(_<3?c(m):_>3?c(t,s,m):c(t,s))||m);return _>3&&m&&Object.defineProperty(t,s,m),m},d=this&&this.__param||function(i,t){return function(s,a){t(s,a,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const o=n(3734),u=n(643),p=n(511),g=n(2585);class f extends o.AttributeData{constructor(t,s,a){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=s,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=f;let e=r.CharacterJoinerService=class Ct{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(t){const s={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(s),s.id}deregister(t){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===t)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(t);if(!s||s.length===0)return[];const a=[],c=s.translateToString(!0);let _=0,m=0,h=0,v=s.getFg(0),y=s.getBg(0);for(let T=0;T<s.getTrimmedLength();T++)if(s.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==v||this._workCell.bg!==y){if(T-_>1){const x=this._getJoinedRanges(c,h,m,s,_);for(let A=0;A<x.length;A++)a.push(x[A])}_=T,h=m,v=this._workCell.fg,y=this._workCell.bg}m+=this._workCell.getChars().length||u.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-_>1){const T=this._getJoinedRanges(c,h,m,s,_);for(let x=0;x<T.length;x++)a.push(T[x])}return a}_getJoinedRanges(t,s,a,c,_){const m=t.substring(s,a);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(v){console.error(v)}for(let v=1;v<this._characterJoiners.length;v++)try{const y=this._characterJoiners[v].handler(m);for(let T=0;T<y.length;T++)Ct._mergeRanges(h,y[T])}catch(y){console.error(y)}return this._stringRangesToCellRanges(h,c,_),h}_stringRangesToCellRanges(t,s,a){let c=0,_=!1,m=0,h=t[c];if(h){for(let v=a;v<this._bufferService.cols;v++){const y=s.getWidth(v),T=s.getString(v).length||u.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!_&&h[0]<=m&&(h[0]=v,_=!0),h[1]<=m){if(h[1]=v,h=t[++c],!h)break;h[0]<=m?(h[0]=v,_=!0):_=!1}m+=T}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,s){let a=!1;for(let c=0;c<t.length;c++){const _=t[c];if(a){if(s[1]<=_[0])return t[c-1][1]=s[1],t;if(s[1]<=_[1])return t[c-1][1]=Math.max(s[1],_[1]),t.splice(c,1),t;t.splice(c,1),c--}else{if(s[1]<=_[0])return t.splice(c,0,s),t;if(s[1]<=_[1])return _[0]=Math.min(s[0],_[0]),t;s[0]<_[1]&&(_[0]=Math.min(s[0],_[0]),a=!0)}}return a?t[t.length-1][1]=s[1]:t.push(s),t}};r.CharacterJoinerService=e=l([d(0,g.IBufferService)],e)},5114:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(n,l){this._textarea=n,this.window=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(M,r,n){var l=this&&this.__decorate||function(g,f,e,i){var t,s=arguments.length,a=s<3?f:i===null?i=Object.getOwnPropertyDescriptor(f,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(g,f,e,i);else for(var c=g.length-1;c>=0;c--)(t=g[c])&&(a=(s<3?t(a):s>3?t(f,e,a):t(f,e))||a);return s>3&&a&&Object.defineProperty(f,e,a),a},d=this&&this.__param||function(g,f){return function(e,i){f(e,i,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const o=n(4725),u=n(9806);let p=r.MouseService=class{constructor(g,f){this._renderService=g,this._charSizeService=f}getCoords(g,f,e,i,t){return(0,u.getCoords)(window,g,f,e,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(g,f){const e=(0,u.getCoordsRelativeToElement)(window,g,f);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};r.MouseService=p=l([d(0,o.IRenderService),d(1,o.ICharSizeService)],p)},3230:function(M,r,n){var l=this&&this.__decorate||function(a,c,_,m){var h,v=arguments.length,y=v<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,_,m);else for(var T=a.length-1;T>=0;T--)(h=a[T])&&(y=(v<3?h(y):v>3?h(c,_,y):h(c,_))||y);return v>3&&y&&Object.defineProperty(c,_,y),y},d=this&&this.__param||function(a,c){return function(_,m){c(_,m,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const o=n(3656),u=n(6193),p=n(5596),g=n(4725),f=n(8460),e=n(844),i=n(7226),t=n(2585);let s=r.RenderService=class extends e.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,c,_,m,h,v,y,T){if(super(),this._rowCount=a,this._charSizeService=m,this._renderer=this.register(new e.MutableDisposable),this._pausedResizeTask=new i.DebouncedIdleTask,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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(y.window,(x,A)=>this._renderRows(x,A)),this.register(this._renderDebouncer),this._screenDprMonitor=new p.ScreenDprMonitor(y.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(v.onResize(()=>this._fullRefresh())),this.register(v.buffers.onBufferActivate(()=>{var x;return(x=this._renderer.value)===null||x===void 0?void 0:x.clear()})),this.register(_.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(h.onDecorationRegistered(()=>this._fullRefresh())),this.register(h.onDecorationRemoved(()=>this._fullRefresh())),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(v.cols,v.rows),this._fullRefresh()})),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(v.buffer.y,v.buffer.y,!0))),this.register((0,o.addDisposableDomListener)(y.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(T.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in y.window){const x=new y.window.IntersectionObserver(A=>this._handleIntersectionChange(A[A.length-1]),{threshold:0});x.observe(c),this.register({dispose:()=>x.disconnect()})}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,c,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,c,this._rowCount))}_renderRows(a,c){this._renderer.value&&(a=Math.min(a,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(a,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:c}),this._onRender.fire({start:a,end:c}),this._isNextRenderRedrawOnly=!0)}resize(a,c){this._rowCount=c,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(a){this._renderer.value=a,this._renderer.value.onRequestRedraw(c=>this.refreshRows(c.start,c.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,c;this._renderer.value&&((c=(a=this._renderer.value).clearTextureAtlas)===null||c===void 0||c.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(a,c)):this._renderer.value.handleResize(a,c),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)===null||a===void 0||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)===null||a===void 0||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)===null||a===void 0||a.handleFocus()}handleSelectionChanged(a,c,_){var m;this._selectionState.start=a,this._selectionState.end=c,this._selectionState.columnSelectMode=_,(m=this._renderer.value)===null||m===void 0||m.handleSelectionChanged(a,c,_)}handleCursorMove(){var a;(a=this._renderer.value)===null||a===void 0||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)===null||a===void 0||a.clear()}};r.RenderService=s=l([d(2,t.IOptionsService),d(3,g.ICharSizeService),d(4,t.IDecorationService),d(5,t.IBufferService),d(6,g.ICoreBrowserService),d(7,g.IThemeService)],s)},9312:function(M,r,n){var l=this&&this.__decorate||function(h,v,y,T){var x,A=arguments.length,I=A<3?v:T===null?T=Object.getOwnPropertyDescriptor(v,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(h,v,y,T);else for(var F=h.length-1;F>=0;F--)(x=h[F])&&(I=(A<3?x(I):A>3?x(v,y,I):x(v,y))||I);return A>3&&I&&Object.defineProperty(v,y,I),I},d=this&&this.__param||function(h,v){return function(y,T){v(y,T,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const o=n(9806),u=n(9504),p=n(456),g=n(4725),f=n(8460),e=n(844),i=n(6114),t=n(4841),s=n(511),a=n(2585),c=" ",_=new RegExp(c,"g");let m=r.SelectionService=class extends e.Disposable{constructor(h,v,y,T,x,A,I,F,U){super(),this._element=h,this._screenElement=v,this._linkifier=y,this._bufferService=T,this._coreService=x,this._mouseService=A,this._optionsService=I,this._renderService=F,this._coreBrowserService=U,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=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(W=>this._handleTrim(W)),this.register(this._bufferService.buffers.onBufferActivate(W=>this._handleBufferActivate(W))),this.enable(),this._model=new p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.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 h=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;return!(!h||!v||h[0]===v[0]&&h[1]===v[1])}get selectionText(){const h=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;if(!h||!v)return"";const y=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(h[0]===v[0])return"";const x=h[0]<v[0]?h[0]:v[0],A=h[0]<v[0]?v[0]:h[0];for(let I=h[1];I<=v[1];I++){const F=y.translateBufferLineToString(I,!0,x,A);T.push(F)}}else{const x=h[1]===v[1]?v[0]:void 0;T.push(y.translateBufferLineToString(h[1],!0,h[0],x));for(let A=h[1]+1;A<=v[1]-1;A++){const I=y.lines.get(A),F=y.translateBufferLineToString(A,!0);I!=null&&I.isWrapped?T[T.length-1]+=F:T.push(F)}if(h[1]!==v[1]){const A=y.lines.get(v[1]),I=y.translateBufferLineToString(v[1],!0,0,v[0]);A&&A.isWrapped?T[T.length-1]+=I:T.push(I)}}return T.map(x=>x.replace(_," ")).join(i.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),i.isLinux&&h&&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(h){const v=this._getMouseBufferCoords(h),y=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!!(y&&T&&v)&&this._areCoordsInSelection(v,y,T)}isCellInSelection(h,v){const y=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!y||!T)&&this._areCoordsInSelection([h,v],y,T)}_areCoordsInSelection(h,v,y){return h[1]>v[1]&&h[1]<y[1]||v[1]===y[1]&&h[1]===v[1]&&h[0]>=v[0]&&h[0]<y[0]||v[1]<y[1]&&h[1]===y[1]&&h[0]<y[0]||v[1]<y[1]&&h[1]===v[1]&&h[0]>=v[0]}_selectWordAtCursor(h,v){var y,T;const x=(T=(y=this._linkifier.currentLink)===null||y===void 0?void 0:y.link)===null||T===void 0?void 0:T.range;if(x)return this._model.selectionStart=[x.start.x-1,x.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(x,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(h);return!!A&&(this._selectWordAt(A,v),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,v){this._model.clearSelection(),h=Math.max(h,0),v=Math.min(v,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,v],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const v=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(v)return v[0]--,v[1]--,v[1]+=this._bufferService.buffer.ydisp,v}_getMouseEventScrollAmount(h){let v=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const y=this._renderService.dimensions.css.canvas.height;return v>=0&&v<=y?0:(v>y&&(v-=y),v=Math.min(Math.max(v,-50),50),v/=50,v/Math.abs(v)+Math.round(14*v))}shouldForceSelection(h){return i.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),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(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const v=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);v&&v.length!==this._model.selectionStart[0]&&v.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const v=this._getMouseBufferCoords(h);v&&(this._activeSelectionMode=2,this._selectLineAt(v[1]))}shouldColumnSelect(h){return h.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const v=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!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(h),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const y=this._bufferService.buffer;if(this._model.selectionEnd[1]<y.lines.length){const T=y.lines.get(this._model.selectionEnd[1]);T&&T.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}v&&v[0]===this._model.selectionEnd[0]&&v[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 h=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(h.ydisp+this._bufferService.rows,h.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=h.ydisp),this.refresh()}}_handleMouseUp(h){const v=h.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&v<500&&h.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const y=this._mouseService.getCoords(h,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(y&&y[0]!==void 0&&y[1]!==void 0){const T=(0,u.moveToCellSequence)(y[0]-1,y[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(T,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const h=this._model.finalSelectionStart,v=this._model.finalSelectionEnd,y=!(!h||!v||h[0]===v[0]&&h[1]===v[1]);y?h&&v&&(this._oldSelectionStart&&this._oldSelectionEnd&&h[0]===this._oldSelectionStart[0]&&h[1]===this._oldSelectionStart[1]&&v[0]===this._oldSelectionEnd[0]&&v[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(h,v,y)):this._oldHasSelection&&this._fireOnSelectionChange(h,v,y)}_fireOnSelectionChange(h,v,y){this._oldSelectionStart=h,this._oldSelectionEnd=v,this._oldHasSelection=y,this._onSelectionChange.fire()}_handleBufferActivate(h){this.clearSelection(),this._trimListener.dispose(),this._trimListener=h.activeBuffer.lines.onTrim(v=>this._handleTrim(v))}_convertViewportColToCharacterIndex(h,v){let y=v;for(let T=0;v>=T;T++){const x=h.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?y--:x>1&&v!==T&&(y+=x-1)}return y}setSelection(h,v,y){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[h,v],this._model.selectionStartLength=y,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(h){this._isClickInSelection(h)||(this._selectWordAtCursor(h,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(h,v,y=!0,T=!0){if(h[0]>=this._bufferService.cols)return;const x=this._bufferService.buffer,A=x.lines.get(h[1]);if(!A)return;const I=x.translateBufferLineToString(h[1],!1);let F=this._convertViewportColToCharacterIndex(A,h[0]),U=F;const W=h[0]-F;let b=0,k=0,L=0,B=0;if(I.charAt(F)===" "){for(;F>0&&I.charAt(F-1)===" ";)F--;for(;U<I.length&&I.charAt(U+1)===" ";)U++}else{let V=h[0],q=h[0];A.getWidth(V)===0&&(b++,V--),A.getWidth(q)===2&&(k++,q++);const Z=A.getString(q).length;for(Z>1&&(B+=Z-1,U+=Z-1);V>0&&F>0&&!this._isCharWordSeparator(A.loadCell(V-1,this._workCell));){A.loadCell(V-1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,V--):w>1&&(L+=w-1,F-=w-1),F--,V--}for(;q<A.length&&U+1<I.length&&!this._isCharWordSeparator(A.loadCell(q+1,this._workCell));){A.loadCell(q+1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,q++):w>1&&(B+=w-1,U+=w-1),U++,q++}}U++;let $=F+W-b+L,z=Math.min(this._bufferService.cols,U-F+b+k-L-B);if(v||I.slice(F,U).trim()!==""){if(y&&$===0&&A.getCodePoint(0)!==32){const V=x.lines.get(h[1]-1);if(V&&A.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,h[1]-1],!1,!0,!1);if(q){const Z=this._bufferService.cols-q.start;$-=Z,z+=Z}}}if(T&&$+z===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const V=x.lines.get(h[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const q=this._getWordAt([0,h[1]+1],!1,!1,!0);q&&(z+=q.length)}}return{start:$,length:z}}}_selectWordAt(h,v){const y=this._getWordAt(h,v);if(y){for(;y.start<0;)y.start+=this._bufferService.cols,h[1]--;this._model.selectionStart=[y.start,h[1]],this._model.selectionStartLength=y.length}}_selectToWordAt(h){const v=this._getWordAt(h,!0);if(v){let y=h[1];for(;v.start<0;)v.start+=this._bufferService.cols,y--;if(!this._model.areSelectionValuesReversed())for(;v.start+v.length>this._bufferService.cols;)v.length-=this._bufferService.cols,y++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?v.start:v.start+v.length,y]}}_isCharWordSeparator(h){return h.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(h.getChars())>=0}_selectLineAt(h){const v=this._bufferService.buffer.getWrappedRangeForLine(h),y={start:{x:0,y:v.first},end:{x:this._bufferService.cols-1,y:v.last}};this._model.selectionStart=[0,v.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,t.getRangeLength)(y,this._bufferService.cols)}};r.SelectionService=m=l([d(3,a.IBufferService),d(4,a.ICoreService),d(5,g.IMouseService),d(6,a.IOptionsService),d(7,g.IRenderService),d(8,g.ICoreBrowserService)],m)},4725:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=n(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService")},6731:function(M,r,n){var l=this&&this.__decorate||function(m,h,v,y){var T,x=arguments.length,A=x<3?h:y===null?y=Object.getOwnPropertyDescriptor(h,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,h,v,y);else for(var I=m.length-1;I>=0;I--)(T=m[I])&&(A=(x<3?T(A):x>3?T(h,v,A):T(h,v))||A);return x>3&&A&&Object.defineProperty(h,v,A),A},d=this&&this.__param||function(m,h){return function(v,y){h(v,y,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const o=n(7239),u=n(8055),p=n(8460),g=n(844),f=n(2585),e=u.css.toColor("#ffffff"),i=u.css.toColor("#000000"),t=u.css.toColor("#ffffff"),s=u.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[u.css.toColor("#2e3436"),u.css.toColor("#cc0000"),u.css.toColor("#4e9a06"),u.css.toColor("#c4a000"),u.css.toColor("#3465a4"),u.css.toColor("#75507b"),u.css.toColor("#06989a"),u.css.toColor("#d3d7cf"),u.css.toColor("#555753"),u.css.toColor("#ef2929"),u.css.toColor("#8ae234"),u.css.toColor("#fce94f"),u.css.toColor("#729fcf"),u.css.toColor("#ad7fa8"),u.css.toColor("#34e2e2"),u.css.toColor("#eeeeec")],h=[0,95,135,175,215,255];for(let v=0;v<216;v++){const y=h[v/36%6|0],T=h[v/6%6|0],x=h[v%6];m.push({css:u.channels.toCss(y,T,x),rgba:u.channels.toRgba(y,T,x)})}for(let v=0;v<24;v++){const y=8+10*v;m.push({css:u.channels.toCss(y,y,y),rgba:u.channels.toRgba(y,y,y)})}return m})());let c=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:i,cursor:t,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:u.color.blend(i,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:u.color.blend(i,a),ansi:r.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(m={}){const h=this._colors;if(h.foreground=_(m.foreground,e),h.background=_(m.background,i),h.cursor=_(m.cursor,t),h.cursorAccent=_(m.cursorAccent,s),h.selectionBackgroundTransparent=_(m.selectionBackground,a),h.selectionBackgroundOpaque=u.color.blend(h.background,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundTransparent=_(m.selectionInactiveBackground,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundOpaque=u.color.blend(h.background,h.selectionInactiveBackgroundTransparent),h.selectionForeground=m.selectionForeground?_(m.selectionForeground,u.NULL_COLOR):void 0,h.selectionForeground===u.NULL_COLOR&&(h.selectionForeground=void 0),u.color.isOpaque(h.selectionBackgroundTransparent)&&(h.selectionBackgroundTransparent=u.color.opacity(h.selectionBackgroundTransparent,.3)),u.color.isOpaque(h.selectionInactiveBackgroundTransparent)&&(h.selectionInactiveBackgroundTransparent=u.color.opacity(h.selectionInactiveBackgroundTransparent,.3)),h.ansi=r.DEFAULT_ANSI_COLORS.slice(),h.ansi[0]=_(m.black,r.DEFAULT_ANSI_COLORS[0]),h.ansi[1]=_(m.red,r.DEFAULT_ANSI_COLORS[1]),h.ansi[2]=_(m.green,r.DEFAULT_ANSI_COLORS[2]),h.ansi[3]=_(m.yellow,r.DEFAULT_ANSI_COLORS[3]),h.ansi[4]=_(m.blue,r.DEFAULT_ANSI_COLORS[4]),h.ansi[5]=_(m.magenta,r.DEFAULT_ANSI_COLORS[5]),h.ansi[6]=_(m.cyan,r.DEFAULT_ANSI_COLORS[6]),h.ansi[7]=_(m.white,r.DEFAULT_ANSI_COLORS[7]),h.ansi[8]=_(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),h.ansi[9]=_(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),h.ansi[10]=_(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),h.ansi[11]=_(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),h.ansi[12]=_(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),h.ansi[13]=_(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),h.ansi[14]=_(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),h.ansi[15]=_(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const v=Math.min(h.ansi.length-16,m.extendedAnsi.length);for(let y=0;y<v;y++)h.ansi[y+16]=_(m.extendedAnsi[y],r.DEFAULT_ANSI_COLORS[y+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){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[m]=this._restoreColors.ansi[m]}else for(let h=0;h<this._restoreColors.ansi.length;++h)this._colors.ansi[h]=this._restoreColors.ansi[h]}modifyColors(m){m(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 _(m,h){if(m!==void 0)try{return u.css.toColor(m)}catch{}return h}r.ThemeService=c=l([d(0,f.IOptionsService)],c)},6349:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=n(8460),d=n(844);class o extends d.Disposable{constructor(p){super(),this._maxLength=p,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(p){if(this._maxLength===p)return;const g=new Array(p);for(let f=0;f<Math.min(p,this.length);f++)g[f]=this._array[this._getCyclicIndex(f)];this._array=g,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let g=this._length;g<p;g++)this._array[g]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,g){this._array[this._getCyclicIndex(p)]=g}push(p){this._array[this._getCyclicIndex(this._length)]=p,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(p,g,...f){if(g){for(let e=p;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:p,amount:g})}for(let e=this._length-1;e>=p;e--)this._array[this._getCyclicIndex(e+f.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<f.length;e++)this._array[this._getCyclicIndex(p+e)]=f[e];if(f.length&&this.onInsertEmitter.fire({index:p,amount:f.length}),this._length+f.length>this._maxLength){const e=this._length+f.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=f.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,g,f){if(!(g<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let i=g-1;i>=0;i--)this.set(p+i+f,this.get(p+i));const e=p+g+f-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(p+e+f,this.get(p+e))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}r.CircularList=o},1439:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function n(l,d=5){if(typeof l!="object")return l;const o=Array.isArray(l)?[]:{};for(const u in l)o[u]=d<=1?l[u]:l[u]&&n(l[u],d-1);return o}},8055:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const l=n(6114);let d=0,o=0,u=0,p=0;var g,f,e,i,t;function s(c){const _=c.toString(16);return _.length<2?"0"+_:_}function a(c,_){return c<_?(_+.05)/(c+.05):(c+.05)/(_+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(c){c.toCss=function(_,m,h,v){return v!==void 0?`#${s(_)}${s(m)}${s(h)}${s(v)}`:`#${s(_)}${s(m)}${s(h)}`},c.toRgba=function(_,m,h,v=255){return(_<<24|m<<16|h<<8|v)>>>0}}(g||(r.channels=g={})),function(c){function _(m,h){return p=Math.round(255*h),[d,o,u]=t.toChannels(m.rgba),{css:g.toCss(d,o,u,p),rgba:g.toRgba(d,o,u,p)}}c.blend=function(m,h){if(p=(255&h.rgba)/255,p===1)return{css:h.css,rgba:h.rgba};const v=h.rgba>>24&255,y=h.rgba>>16&255,T=h.rgba>>8&255,x=m.rgba>>24&255,A=m.rgba>>16&255,I=m.rgba>>8&255;return d=x+Math.round((v-x)*p),o=A+Math.round((y-A)*p),u=I+Math.round((T-I)*p),{css:g.toCss(d,o,u),rgba:g.toRgba(d,o,u)}},c.isOpaque=function(m){return(255&m.rgba)==255},c.ensureContrastRatio=function(m,h,v){const y=t.ensureContrastRatio(m.rgba,h.rgba,v);if(y)return t.toColor(y>>24&255,y>>16&255,y>>8&255)},c.opaque=function(m){const h=(255|m.rgba)>>>0;return[d,o,u]=t.toChannels(h),{css:g.toCss(d,o,u),rgba:h}},c.opacity=_,c.multiplyOpacity=function(m,h){return p=255&m.rgba,_(m,p*h/255)},c.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}}(f||(r.color=f={})),function(c){let _,m;if(!l.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const v=h.getContext("2d",{willReadFrequently:!0});v&&(_=v,_.globalCompositeOperation="copy",m=_.createLinearGradient(0,0,1,1))}c.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return d=parseInt(h.slice(1,2).repeat(2),16),o=parseInt(h.slice(2,3).repeat(2),16),u=parseInt(h.slice(3,4).repeat(2),16),t.toColor(d,o,u);case 5:return d=parseInt(h.slice(1,2).repeat(2),16),o=parseInt(h.slice(2,3).repeat(2),16),u=parseInt(h.slice(3,4).repeat(2),16),p=parseInt(h.slice(4,5).repeat(2),16),t.toColor(d,o,u,p);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const v=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(v)return d=parseInt(v[1]),o=parseInt(v[2]),u=parseInt(v[3]),p=Math.round(255*(v[5]===void 0?1:parseFloat(v[5]))),t.toColor(d,o,u,p);if(!_||!m)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=m,_.fillStyle=h,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[d,o,u,p]=_.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(d,o,u,p),css:h}}}(e||(r.css=e={})),function(c){function _(m,h,v){const y=m/255,T=h/255,x=v/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))}c.relativeLuminance=function(m){return _(m>>16&255,m>>8&255,255&m)},c.relativeLuminance2=_}(i||(r.rgb=i={})),function(c){function _(h,v,y){const T=h>>24&255,x=h>>16&255,A=h>>8&255;let I=v>>24&255,F=v>>16&255,U=v>>8&255,W=a(i.relativeLuminance2(I,F,U),i.relativeLuminance2(T,x,A));for(;W<y&&(I>0||F>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),W=a(i.relativeLuminance2(I,F,U),i.relativeLuminance2(T,x,A));return(I<<24|F<<16|U<<8|255)>>>0}function m(h,v,y){const T=h>>24&255,x=h>>16&255,A=h>>8&255;let I=v>>24&255,F=v>>16&255,U=v>>8&255,W=a(i.relativeLuminance2(I,F,U),i.relativeLuminance2(T,x,A));for(;W<y&&(I<255||F<255||U<255);)I=Math.min(255,I+Math.ceil(.1*(255-I))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=a(i.relativeLuminance2(I,F,U),i.relativeLuminance2(T,x,A));return(I<<24|F<<16|U<<8|255)>>>0}c.ensureContrastRatio=function(h,v,y){const T=i.relativeLuminance(h>>8),x=i.relativeLuminance(v>>8);if(a(T,x)<y){if(x<T){const F=_(h,v,y),U=a(T,i.relativeLuminance(F>>8));if(U<y){const W=m(h,v,y);return U>a(T,i.relativeLuminance(W>>8))?F:W}return F}const A=m(h,v,y),I=a(T,i.relativeLuminance(A>>8));if(I<y){const F=_(h,v,y);return I>a(T,i.relativeLuminance(F>>8))?A:F}return A}},c.reduceLuminance=_,c.increaseLuminance=m,c.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},c.toColor=function(h,v,y,T){return{css:g.toCss(h,v,y,T),rgba:g.toRgba(h,v,y,T)}}}(t||(r.rgba=t={})),r.toPaddedHex=s,r.contrastRatio=a},8969:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=n(844),d=n(2585),o=n(4348),u=n(7866),p=n(744),g=n(7302),f=n(6975),e=n(8460),i=n(1753),t=n(1480),s=n(7994),a=n(9282),c=n(5435),_=n(5981),m=n(2660);let h=!1;class v extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(T=>{var x;(x=this._onScrollApi)===null||x===void 0||x.fire(T.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(T){for(const x in T)this.optionsService.options[x]=T[x]}constructor(T){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new g.OptionsService(T)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(u.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.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(x=>{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(x=>{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 _.WriteBuffer((x,A)=>this._inputHandler.parse(x,A))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(T,x){this._writeBuffer.write(T,x)}writeSync(T,x){this._logService.logLevel<=d.LogLevelEnum.WARN&&!h&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h=!0),this._writeBuffer.writeSync(T,x)}resize(T,x){isNaN(T)||isNaN(x)||(T=Math.max(T,p.MINIMUM_COLS),x=Math.max(x,p.MINIMUM_ROWS),this._bufferService.resize(T,x))}scroll(T,x=!1){this._bufferService.scroll(T,x)}scrollLines(T,x,A){this._bufferService.scrollLines(T,x,A)}scrollPages(T){this.scrollLines(T*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(T){const x=T-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)}registerEscHandler(T,x){return this._inputHandler.registerEscHandler(T,x)}registerDcsHandler(T,x){return this._inputHandler.registerDcsHandler(T,x)}registerCsiHandler(T,x){return this._inputHandler.registerCsiHandler(T,x)}registerOscHandler(T,x){return this._inputHandler.registerOscHandler(T,x)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let T=!1;const x=this.optionsService.rawOptions.windowsPty;x&&x.buildNumber!==void 0&&x.buildNumber!==void 0?T=x.backend==="conpty"&&x.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(T=!0),T?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const T=[];T.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),T.push(this.registerCsiHandler({final:"H"},()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const x of T)x.dispose()})}}}r.CoreTerminal=v},8460:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=n=>(this._listeners.push(n),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===n)return void this._listeners.splice(l,1)}}})),this._event}fire(n,l){const d=[];for(let o=0;o<this._listeners.length;o++)d.push(this._listeners[o]);for(let o=0;o<d.length;o++)d[o].call(void 0,n,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(n,l){return n(d=>l.fire(d))}},5435:function(M,r,n){var l=this&&this.__decorate||function(W,b,k,L){var B,$=arguments.length,z=$<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(W,b,k,L);else for(var V=W.length-1;V>=0;V--)(B=W[V])&&(z=($<3?B(z):$>3?B(b,k,z):B(b,k))||z);return $>3&&z&&Object.defineProperty(b,k,z),z},d=this&&this.__param||function(W,b){return function(k,L){b(k,L,W)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const o=n(2584),u=n(7116),p=n(2015),g=n(844),f=n(482),e=n(8437),i=n(8460),t=n(643),s=n(511),a=n(3734),c=n(2585),_=n(6242),m=n(6351),h=n(5941),v={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function T(W,b){if(W>24)return b.setWinLines||!1;switch(W){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var x;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(x||(r.WindowsOptionsReportType=x={}));let A=0;class I extends g.Disposable{getAttrData(){return this._curAttrData}constructor(b,k,L,B,$,z,V,q,Z=new p.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=k,this._coreService=L,this._logService=B,this._optionsService=$,this._oscLinkService=z,this._coreMouseService=V,this._unicodeService=q,this._parser=Z,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=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(w=>this._activeBuffer=w.activeBuffer)),this._parser.setCsiHandlerFallback((w,P)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(w),params:P.toArray()})}),this._parser.setEscHandlerFallback(w=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(w)})}),this._parser.setExecuteHandlerFallback(w=>{this._logService.debug("Unknown EXECUTE code: ",{code:w})}),this._parser.setOscHandlerFallback((w,P,N)=>{this._logService.debug("Unknown OSC code: ",{identifier:w,action:P,data:N})}),this._parser.setDcsHandlerFallback((w,P,N)=>{P==="HOOK"&&(N=N.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(w),action:P,payload:N})}),this._parser.setPrintHandler((w,P,N)=>this.print(w,P,N)),this._parser.registerCsiHandler({final:"@"},w=>this.insertChars(w)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},w=>this.scrollLeft(w)),this._parser.registerCsiHandler({final:"A"},w=>this.cursorUp(w)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},w=>this.scrollRight(w)),this._parser.registerCsiHandler({final:"B"},w=>this.cursorDown(w)),this._parser.registerCsiHandler({final:"C"},w=>this.cursorForward(w)),this._parser.registerCsiHandler({final:"D"},w=>this.cursorBackward(w)),this._parser.registerCsiHandler({final:"E"},w=>this.cursorNextLine(w)),this._parser.registerCsiHandler({final:"F"},w=>this.cursorPrecedingLine(w)),this._parser.registerCsiHandler({final:"G"},w=>this.cursorCharAbsolute(w)),this._parser.registerCsiHandler({final:"H"},w=>this.cursorPosition(w)),this._parser.registerCsiHandler({final:"I"},w=>this.cursorForwardTab(w)),this._parser.registerCsiHandler({final:"J"},w=>this.eraseInDisplay(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},w=>this.eraseInDisplay(w,!0)),this._parser.registerCsiHandler({final:"K"},w=>this.eraseInLine(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},w=>this.eraseInLine(w,!0)),this._parser.registerCsiHandler({final:"L"},w=>this.insertLines(w)),this._parser.registerCsiHandler({final:"M"},w=>this.deleteLines(w)),this._parser.registerCsiHandler({final:"P"},w=>this.deleteChars(w)),this._parser.registerCsiHandler({final:"S"},w=>this.scrollUp(w)),this._parser.registerCsiHandler({final:"T"},w=>this.scrollDown(w)),this._parser.registerCsiHandler({final:"X"},w=>this.eraseChars(w)),this._parser.registerCsiHandler({final:"Z"},w=>this.cursorBackwardTab(w)),this._parser.registerCsiHandler({final:"`"},w=>this.charPosAbsolute(w)),this._parser.registerCsiHandler({final:"a"},w=>this.hPositionRelative(w)),this._parser.registerCsiHandler({final:"b"},w=>this.repeatPrecedingCharacter(w)),this._parser.registerCsiHandler({final:"c"},w=>this.sendDeviceAttributesPrimary(w)),this._parser.registerCsiHandler({prefix:">",final:"c"},w=>this.sendDeviceAttributesSecondary(w)),this._parser.registerCsiHandler({final:"d"},w=>this.linePosAbsolute(w)),this._parser.registerCsiHandler({final:"e"},w=>this.vPositionRelative(w)),this._parser.registerCsiHandler({final:"f"},w=>this.hVPosition(w)),this._parser.registerCsiHandler({final:"g"},w=>this.tabClear(w)),this._parser.registerCsiHandler({final:"h"},w=>this.setMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"h"},w=>this.setModePrivate(w)),this._parser.registerCsiHandler({final:"l"},w=>this.resetMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"l"},w=>this.resetModePrivate(w)),this._parser.registerCsiHandler({final:"m"},w=>this.charAttributes(w)),this._parser.registerCsiHandler({final:"n"},w=>this.deviceStatus(w)),this._parser.registerCsiHandler({prefix:"?",final:"n"},w=>this.deviceStatusPrivate(w)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},w=>this.softReset(w)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},w=>this.setCursorStyle(w)),this._parser.registerCsiHandler({final:"r"},w=>this.setScrollRegion(w)),this._parser.registerCsiHandler({final:"s"},w=>this.saveCursor(w)),this._parser.registerCsiHandler({final:"t"},w=>this.windowOptions(w)),this._parser.registerCsiHandler({final:"u"},w=>this.restoreCursor(w)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},w=>this.insertColumns(w)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},w=>this.deleteColumns(w)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},w=>this.selectProtected(w)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},w=>this.requestMode(w,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},w=>this.requestMode(w,!1)),this._parser.setExecuteHandler(o.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(o.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(o.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(o.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(o.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(o.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(o.C1.IND,()=>this.index()),this._parser.setExecuteHandler(o.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(o.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new _.OscHandler(w=>(this.setTitle(w),this.setIconName(w),!0))),this._parser.registerOscHandler(1,new _.OscHandler(w=>this.setIconName(w))),this._parser.registerOscHandler(2,new _.OscHandler(w=>this.setTitle(w))),this._parser.registerOscHandler(4,new _.OscHandler(w=>this.setOrReportIndexedColor(w))),this._parser.registerOscHandler(8,new _.OscHandler(w=>this.setHyperlink(w))),this._parser.registerOscHandler(10,new _.OscHandler(w=>this.setOrReportFgColor(w))),this._parser.registerOscHandler(11,new _.OscHandler(w=>this.setOrReportBgColor(w))),this._parser.registerOscHandler(12,new _.OscHandler(w=>this.setOrReportCursorColor(w))),this._parser.registerOscHandler(104,new _.OscHandler(w=>this.restoreIndexedColor(w))),this._parser.registerOscHandler(110,new _.OscHandler(w=>this.restoreFgColor(w))),this._parser.registerOscHandler(111,new _.OscHandler(w=>this.restoreBgColor(w))),this._parser.registerOscHandler(112,new _.OscHandler(w=>this.restoreCursorColor(w))),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 w in u.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:w},()=>this.selectCharset("("+w)),this._parser.registerEscHandler({intermediates:")",final:w},()=>this.selectCharset(")"+w)),this._parser.registerEscHandler({intermediates:"*",final:w},()=>this.selectCharset("*"+w)),this._parser.registerEscHandler({intermediates:"+",final:w},()=>this.selectCharset("+"+w)),this._parser.registerEscHandler({intermediates:"-",final:w},()=>this.selectCharset("-"+w)),this._parser.registerEscHandler({intermediates:".",final:w},()=>this.selectCharset("."+w)),this._parser.registerEscHandler({intermediates:"/",final:w},()=>this.selectCharset("/"+w));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(w=>(this._logService.error("Parsing error: ",w),w)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((w,P)=>this.requestStatusString(w,P)))}_preserveStack(b,k,L,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=k,this._parseStack.decodedLength=L,this._parseStack.position=B}_logSlowResolvingAsync(b){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([b,new Promise((k,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(k=>{if(k!=="#SLOW_TIMEOUT")throw k;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,k){let L,B=this._activeBuffer.x,$=this._activeBuffer.y,z=0;const V=this._parseStack.paused;if(V){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,k))return this._logSlowResolvingAsync(L),L;B=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>y&&(z=this._parseStack.position+y)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,q=>String.fromCharCode(q)).join("")}"`),typeof b=="string"?b.split("").map(q=>q.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(b.length,y))),V||this._dirtyRowTracker.clearRange(),b.length>y)for(let q=z;q<b.length;q+=y){const Z=q+y<b.length?q+y:b.length,w=typeof b=="string"?this._stringDecoder.decode(b.substring(q,Z),this._parseBuffer):this._utf8Decoder.decode(b.subarray(q,Z),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,w))return this._preserveStack(B,$,w,q),this._logSlowResolvingAsync(L),L}else if(!V){const q=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,q))return this._preserveStack(B,$,q,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===B&&this._activeBuffer.y===$||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(b,k,L){let B,$;const z=this._charsetService.charset,V=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,w=this._coreService.modes.insertMode,P=this._curAttrData;let N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-k>0&&N.getWidth(this._activeBuffer.x-1)===2&&N.setCellFromCodePoint(this._activeBuffer.x-1,0,1,P.fg,P.bg,P.extended);for(let j=k;j<L;++j){if(B=b[j],$=this._unicodeService.wcwidth(B),B<127&&z){const X=z[String.fromCharCode(B)];X&&(B=X.charCodeAt(0))}if(V&&this._onA11yChar.fire((0,f.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),$||!this._activeBuffer.x){if(this._activeBuffer.x+$-1>=q){if(Z){for(;this._activeBuffer.x<q;)N.setCellFromCodePoint(this._activeBuffer.x++,0,1,P.fg,P.bg,P.extended);this._activeBuffer.x=0,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),N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=q-1,$===2)continue}if(w&&(N.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(P),P),N.getWidth(q-1)===2&&N.setCellFromCodePoint(q-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,P.fg,P.bg,P.extended)),N.setCellFromCodePoint(this._activeBuffer.x++,B,$,P.fg,P.bg,P.extended),$>0)for(;--$;)N.setCellFromCodePoint(this._activeBuffer.x++,0,0,P.fg,P.bg,P.extended)}else N.getWidth(this._activeBuffer.x-1)?N.addCodepointToCell(this._activeBuffer.x-1,B):N.addCodepointToCell(this._activeBuffer.x-2,B)}L-k>0&&(N.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<q&&L-k>0&&N.getWidth(this._activeBuffer.x)===0&&!N.hasContent(this._activeBuffer.x)&&N.setCellFromCodePoint(this._activeBuffer.x,0,1,P.fg,P.bg,P.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,k){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,k):this._parser.registerCsiHandler(b,L=>!T(L.params[0],this._optionsService.rawOptions.windowOptions)||k(L))}registerDcsHandler(b,k){return this._parser.registerDcsHandler(b,new m.DcsHandler(k))}registerEscHandler(b,k){return this._parser.registerEscHandler(b,k)}registerOscHandler(b,k){return this._parser.registerOscHandler(b,new _.OscHandler(k))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||b===void 0)&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);k.hasWidth(this._activeBuffer.x)&&!k.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(b,k){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+k):(this._activeBuffer.x=b,this._activeBuffer.y=k),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,k){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+k)}cursorUp(b){const k=this._activeBuffer.y-this._activeBuffer.scrollTop;return k>=0?this._moveCursor(0,-Math.min(k,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const k=this._activeBuffer.scrollBottom-this._activeBuffer.y;return k>=0?this._moveCursor(0,Math.min(k,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const k=b.params[0];return k===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:k===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let k=b.params[0]||1;for(;k--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let k=b.params[0]||1;for(;k--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const k=b.params[0];return k===1&&(this._curAttrData.bg|=536870912),k!==2&&k!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,k,L,B=!1,$=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);z.replaceCells(k,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),$),B&&(z.isWrapped=!1)}_resetBufferLine(b,k=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),k),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),L.isWrapped=!1)}eraseInDisplay(b,k=!1){let L;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,k);L<this._bufferService.rows;L++)this._resetBufferLine(L,k);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,k),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,k);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,k);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(b,k=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,k);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,k);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,k)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let k=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;k--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let k=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;k--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(b){this._restrictCursor();const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return k&&(k.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return k&&(k.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let k=b.params[0]||1;for(;k--;)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(b){let k=b.params[0]||1;for(;k--;)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(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(0,k,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(0,k,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(this._activeBuffer.x,k,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(this._activeBuffer.x,k,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return k&&(k.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){if(!this._parser.precedingCodepoint)return!0;const k=b.params[0]||1,L=new Uint32Array(k);for(let B=0;B<k;++B)L[B]=this._parser.precedingCodepoint;return this.print(L,0,L.length),!0}sendDeviceAttributesPrimary(b){return b.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(b){return b.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let k=0;k<b.length;k++)switch(b.params[k]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let k=0;k<b.length;k++)switch(b.params[k]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,u.DEFAULT_CHARSET),this._charsetService.setgCharset(1,u.DEFAULT_CHARSET),this._charsetService.setgCharset(2,u.DEFAULT_CHARSET),this._charsetService.setgCharset(3,u.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(b){for(let k=0;k<b.length;k++)switch(b.params[k]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let k=0;k<b.length;k++)switch(b.params[k]){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(),b.params[k]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(b,k){const L=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:$}=this._coreMouseService,z=this._coreService,{buffers:V,cols:q}=this._bufferService,{active:Z,alt:w}=V,P=this._optionsService.rawOptions,N=J=>J?1:2,j=b.params[0];return X=j,K=k?j===2?4:j===4?N(z.modes.insertMode):j===12?3:j===20?N(P.convertEol):0:j===1?N(L.applicationCursorKeys):j===3?P.windowOptions.setWinLines?q===80?2:q===132?1:0:0:j===6?N(L.origin):j===7?N(L.wraparound):j===8?3:j===9?N(B==="X10"):j===12?N(P.cursorBlink):j===25?N(!z.isCursorHidden):j===45?N(L.reverseWraparound):j===66?N(L.applicationKeypad):j===67?4:j===1e3?N(B==="VT200"):j===1002?N(B==="DRAG"):j===1003?N(B==="ANY"):j===1004?N(L.sendFocus):j===1005?4:j===1006?N($==="SGR"):j===1015?4:j===1016?N($==="SGR_PIXELS"):j===1048?1:j===47||j===1047||j===1049?N(Z===w):j===2004?N(L.bracketedPasteMode):0,z.triggerDataEvent(`${o.C0.ESC}[${k?"":"?"}${X};${K}$y`),!0;var X,K}_updateAttrColor(b,k,L,B,$){return k===2?(b|=50331648,b&=-16777216,b|=a.AttributeData.fromColorRGB([L,B,$])):k===5&&(b&=-50331904,b|=33554432|255&L),b}_extractColor(b,k,L){const B=[0,0,-1,0,0,0];let $=0,z=0;do{if(B[z+$]=b.params[k+z],b.hasSubParams(k+z)){const V=b.getSubParams(k+z);let q=0;do B[1]===5&&($=1),B[z+q+1+$]=V[q];while(++q<V.length&&q+z+1+$<B.length);break}if(B[1]===5&&z+$>=2||B[1]===2&&z+$>=5)break;B[1]&&($=1)}while(++z+k<b.length&&z+$<B.length);for(let V=2;V<B.length;++V)B[V]===-1&&(B[V]=0);switch(B[0]){case 38:L.fg=this._updateAttrColor(L.fg,B[1],B[3],B[4],B[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,B[1],B[3],B[4],B[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,B[1],B[3],B[4],B[5])}return z}_processUnderline(b,k){k.extended=k.extended.clone(),(!~b||b>5)&&(b=1),k.extended.underlineStyle=b,k.fg|=268435456,b===0&&(k.fg&=-268435457),k.updateExtended()}_processSGR0(b){b.fg=e.DEFAULT_ATTR_DATA.fg,b.bg=e.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const k=b.length;let L;const B=this._curAttrData;for(let $=0;$<k;$++)L=b.params[$],L>=30&&L<=37?(B.fg&=-50331904,B.fg|=16777216|L-30):L>=40&&L<=47?(B.bg&=-50331904,B.bg|=16777216|L-40):L>=90&&L<=97?(B.fg&=-50331904,B.fg|=16777224|L-90):L>=100&&L<=107?(B.bg&=-50331904,B.bg|=16777224|L-100):L===0?this._processSGR0(B):L===1?B.fg|=134217728:L===3?B.bg|=67108864:L===4?(B.fg|=268435456,this._processUnderline(b.hasSubParams($)?b.getSubParams($)[0]:1,B)):L===5?B.fg|=536870912:L===7?B.fg|=67108864:L===8?B.fg|=1073741824:L===9?B.fg|=2147483648:L===2?B.bg|=134217728:L===21?this._processUnderline(2,B):L===22?(B.fg&=-134217729,B.bg&=-134217729):L===23?B.bg&=-67108865:L===24?(B.fg&=-268435457,this._processUnderline(0,B)):L===25?B.fg&=-536870913:L===27?B.fg&=-67108865:L===28?B.fg&=-1073741825:L===29?B.fg&=2147483647:L===39?(B.fg&=-67108864,B.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):L===49?(B.bg&=-67108864,B.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?$+=this._extractColor(b,$,B):L===53?B.bg|=1073741824:L===55?B.bg&=-1073741825:L===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):L===100?(B.fg&=-67108864,B.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const k=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${k};${L}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const k=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${k};${L}R`)}return!0}softReset(b){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(b){const k=b.params[0]||1;switch(k){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 L=k%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(b){const k=b.params[0]||1;let L;return(b.length<2||(L=b.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>k&&(this._activeBuffer.scrollTop=k-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(b){if(!T(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const k=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:k!==2&&this._onRequestWindowsOptionsReport.fire(x.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(x.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:k!==0&&k!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),k!==0&&k!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:k!==0&&k!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),k!==0&&k!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(b){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const k=[],L=b.split(";");for(;L.length>1;){const B=L.shift(),$=L.shift();if(/^\d+$/.exec(B)){const z=parseInt(B);if(U(z))if($==="?")k.push({type:0,index:z});else{const V=(0,h.parseColor)($);V&&k.push({type:1,index:z,color:V})}}}return k.length&&this._onColor.fire(k),!0}setHyperlink(b){const k=b.split(";");return!(k.length<2)&&(k[1]?this._createHyperlink(k[0],k[1]):!k[0]&&this._finishHyperlink())}_createHyperlink(b,k){this._getCurrentLinkId()&&this._finishHyperlink();const L=b.split(":");let B;const $=L.findIndex(z=>z.startsWith("id="));return $!==-1&&(B=L[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:k}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,k){const L=b.split(";");for(let B=0;B<L.length&&!(k>=this._specialColors.length);++B,++k)if(L[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[k]}]);else{const $=(0,h.parseColor)(L[B]);$&&this._onColor.fire([{type:1,index:this._specialColors[k],color:$}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const k=[],L=b.split(";");for(let B=0;B<L.length;++B)if(/^\d+$/.exec(L[B])){const $=parseInt(L[B]);U($)&&k.push({type:2,index:$})}return k.length&&this._onColor.fire(k),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,u.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(v[b[0]],u.CHARSETS[b[1]]||u.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new s.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let k=0;k<this._bufferService.rows;++k){const L=this._activeBuffer.ybase+this._activeBuffer.y+k,B=this._activeBuffer.lines.get(L);B&&(B.fill(b),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,k){const L=this._bufferService.buffer,B=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${$}${o.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,k){this._dirtyRowTracker.markRangeDirty(b,k)}}r.InputHandler=I;let F=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,b){W>b&&(A=W,W=b,b=A),W<this.start&&(this.start=W),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(W){return 0<=W&&W<256}F=l([d(0,c.IBufferService)],F)},844:(M,r)=>{function n(l){for(const d of l)d.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.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 d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var d;this._isDisposed||l===this._value||((d=this._value)===null||d===void 0||d.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)===null||l===void 0||l.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=n,r.getDisposeArrayDisposable=function(l){return{dispose:()=>n(l)}}},1505:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(d,o,u){this._data[d]||(this._data[d]={}),this._data[d][o]=u}get(d,o){return this._data[d]?this._data[d][o]:void 0}clear(){this._data={}}}r.TwoKeyMap=n,r.FourKeyMap=class{constructor(){this._data=new n}set(l,d,o,u,p){this._data.get(l,d)||this._data.set(l,d,new n),this._data.get(l,d).set(o,u,p)}get(l,d,o,u){var p;return(p=this._data.get(l,d))===null||p===void 0?void 0:p.get(o,u)}clear(){this._data.clear()}}},6114:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const n=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=n.includes("Firefox"),r.isLegacyEdge=n.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(n),r.getSafariVersion=function(){if(!r.isSafari)return 0;const d=n.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(n)},6106:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let n=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(n=this._search(this._getKey(l)),this._array.splice(n,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const d=this._getKey(l);if(d===void 0||(n=this._search(d),n===-1)||this._getKey(this._array[n])!==d)return!1;do if(this._array[n]===l)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===d);return!1}*getKeyIterator(l){if(this._array.length!==0&&(n=this._search(l),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===l))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===l)}forEachByKey(l,d){if(this._array.length!==0&&(n=this._search(l),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===l))do d(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===l)}values(){return[...this._array].values()}_search(l){let d=0,o=this._array.length-1;for(;o>=d;){let u=d+o>>1;const p=this._getKey(this._array[u]);if(p>l)o=u-1;else{if(!(p<l)){for(;u>0&&this._getKey(this._array[u-1])===l;)u--;return u}d=u+1}}return d}}},7226:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=n(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let g=0,f=0,e=p.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),f=Math.max(g,f),i=p.timeRemaining(),1.5*f>i)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=i}this.clear()}}class o extends d{_requestCallback(p){return setTimeout(()=>p(this._createDeadline(16)))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const g=Date.now()+p;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=o,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(u){return requestIdleCallback(u)}_cancelCallback(u){cancelIdleCallback(u)}}:o,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(u){this._queue.clear(),this._queue.enqueue(u)}flush(){this._queue.flush()}}},9282:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=n(643);r.updateWindowsModeWrappedState=function(d){const o=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),u=o==null?void 0:o.get(d.cols-1),p=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);p&&u&&(p.isWrapped=u[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&u[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new n;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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}}r.AttributeData=n;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}constructor(o=0,u=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=u}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=n(6349),d=n(7226),o=n(3734),u=n(8437),p=n(4634),g=n(511),f=n(643),e=n(4863),i=n(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,s,a){this._hasScrollback=t,this._optionsService=s,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=u.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,s){return new u.BufferLine(this._bufferService.cols,this.getNullCell(t),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const s=t+this._optionsService.rawOptions.scrollback;return s>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:s}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=u.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(t))}}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(t,s){const a=this.getNullCell(u.DEFAULT_ATTR_DATA);let c=0;const _=this._getCorrectBufferLength(s);if(_>this.lines.maxLength&&(this.lines.maxLength=_),this.lines.length>0){if(this._cols<t)for(let h=0;h<this.lines.length;h++)c+=+this.lines.get(h).resize(t,a);let m=0;if(this._rows<s)for(let h=this._rows;h<s;h++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new u.BufferLine(t,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new u.BufferLine(t,a)));else for(let h=this._rows;h>s;h--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(_<this.lines.maxLength){const h=this.lines.length-_;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=_}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,s-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(t,s),this._cols>t))for(let m=0;m<this.lines.length;m++)c+=+this.lines.get(m).resize(t,a);this._cols=t,this._rows=s,this._memoryCleanupQueue.clear(),c>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,s){this._cols!==t&&(t>this._cols?this._reflowLarger(t,s):this._reflowSmaller(t,s))}_reflowLarger(t,s){const a=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(u.DEFAULT_ATTR_DATA));if(a.length>0){const c=(0,p.reflowLargerCreateNewLayout)(this.lines,a);(0,p.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(t,s,c.countRemoved)}}_reflowLargerAdjustViewport(t,s,a){const c=this.getNullCell(u.DEFAULT_ATTR_DATA);let _=a;for(;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new u.BufferLine(t,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)}_reflowSmaller(t,s){const a=this.getNullCell(u.DEFAULT_ATTR_DATA),c=[];let _=0;for(let m=this.lines.length-1;m>=0;m--){let h=this.lines.get(m);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;const v=[h];for(;h.isWrapped&&m>0;)h=this.lines.get(--m),v.unshift(h);const y=this.ybase+this.y;if(y>=m&&y<m+v.length)continue;const T=v[v.length-1].getTrimmedLength(),x=(0,p.reflowSmallerGetNewLineLengths)(v,this._cols,t),A=x.length-v.length;let I;I=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const F=[];for(let B=0;B<A;B++){const $=this.getBlankLine(u.DEFAULT_ATTR_DATA,!0);F.push($)}F.length>0&&(c.push({start:m+v.length+_,newLines:F}),_+=F.length),v.push(...F);let U=x.length-1,W=x[U];W===0&&(U--,W=x[U]);let b=v.length-A-1,k=T;for(;b>=0;){const B=Math.min(k,W);if(v[U]===void 0)break;if(v[U].copyCellsFrom(v[b],k-B,W-B,B,!0),W-=B,W===0&&(U--,W=x[U]),k-=B,k===0){b--;const $=Math.max(b,0);k=(0,p.getWrappedLineTrimmedLength)(v,$,this._cols)}}for(let B=0;B<v.length;B++)x[B]<t&&v[B].setCell(x[B],a);let L=A-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+_)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+s-1)}if(c.length>0){const m=[],h=[];for(let U=0;U<this.lines.length;U++)h.push(this.lines.get(U));const v=this.lines.length;let y=v-1,T=0,x=c[T];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);let A=0;for(let U=Math.min(this.lines.maxLength-1,v+_-1);U>=0;U--)if(x&&x.start>y+A){for(let W=x.newLines.length-1;W>=0;W--)this.lines.set(U--,x.newLines[W]);U++,m.push({index:y+1,amount:x.newLines.length}),A+=x.newLines.length,x=c[++T]}else this.lines.set(U,h[y--]);let I=0;for(let U=m.length-1;U>=0;U--)m[U].index+=I,this.lines.onInsertEmitter.fire(m[U]),I+=m[U].amount;const F=Math.max(0,v+_-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(t,s,a=0,c){const _=this.lines.get(t);return _?_.translateToString(s,a,c):""}getWrappedRangeForLine(t){let s=t,a=t;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:s,last:a}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===t&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const s=new e.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(a=>{s.line-=a,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(a=>{s.line>=a.index&&(s.line+=a.amount)})),s.register(this.lines.onDelete(a=>{s.line>=a.index&&s.line<a.index+a.amount&&s.dispose(),s.line>a.index&&(s.line-=a.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=n(3734),d=n(511),o=n(643),u=n(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let p=0;class g{constructor(e,i,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=i||d.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let a=0;a<e;++a)this.setCell(a,s);this.length=e}get(e){const i=this._data[3*e+0],t=2097151&i;return[this._data[3*e+1],2097152&i?this._combined[e]:t?(0,u.stringFromCodePoint)(t):"",i>>22,2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,i){this._data[3*e+1]=i[o.CHAR_DATA_ATTR_INDEX],i[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=i[1],this._data[3*e+0]=2097152|e|i[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=i[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const i=this._data[3*e+0];return 2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&i}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const i=this._data[3*e+0];return 2097152&i?this._combined[e]:2097151&i?(0,u.stringFromCodePoint)(2097151&i):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,i){return p=3*e,i.content=this._data[p+0],i.fg=this._data[p+1],i.bg=this._data[p+2],2097152&i.content&&(i.combinedData=this._combined[e]),268435456&i.bg&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){2097152&i.content&&(this._combined[e]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=i.content,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}setCellFromCodePoint(e,i,t,s,a,c){268435456&a&&(this._extendedAttrs[e]=c),this._data[3*e+0]=i|t<<22,this._data[3*e+1]=s,this._data[3*e+2]=a}addCodepointToCell(e,i){let t=this._data[3*e+0];2097152&t?this._combined[e]+=(0,u.stringFromCodePoint)(i):(2097151&t?(this._combined[e]=(0,u.stringFromCodePoint)(2097151&t)+(0,u.stringFromCodePoint)(i),t&=-2097152,t|=2097152):t=i|4194304,this._data[3*e+0]=t)}insertCells(e,i,t,s){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs),i<this.length-e){const a=new d.CellData;for(let c=this.length-e-i-1;c>=0;--c)this.setCell(e+i+c,this.loadCell(e+c,a));for(let c=0;c<i;++c)this.setCell(e+c,t)}else for(let a=e;a<this.length;++a)this.setCell(a,t);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs)}deleteCells(e,i,t,s){if(e%=this.length,i<this.length-e){const a=new d.CellData;for(let c=0;c<this.length-e-i;++c)this.setCell(e+c,this.loadCell(e+i+c,a));for(let c=this.length-i;c<this.length;++c)this.setCell(c,t)}else for(let a=e;a<this.length;++a)this.setCell(a,t);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs)}replaceCells(e,i,t,s,a=!1){if(a)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodePoint(i,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,t),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodePoint(i,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new l.ExtendedAttrs);e<i&&e<this.length;)this.setCell(e++,t)}resize(e,i){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const s=new Uint32Array(t);s.set(this._data),this._data=s}for(let s=this.length;s<e;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,t);const s=Object.keys(this._combined);for(let c=0;c<s.length;c++){const _=parseInt(s[c],10);_>=e&&delete this._combined[_]}const a=Object.keys(this._extendedAttrs);for(let c=0;c<a.length;c++){const _=parseInt(a[c],10);_>=e&&delete this._extendedAttrs[_]}}return this.length=e,4*t*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(const i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){const e=new g(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const i in this._combined)e._combined[i]=this._combined[i];for(const i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,i,t,s,a){const c=e._data;if(a)for(let m=s-1;m>=0;m--){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=c[3*(i+m)+h];268435456&c[3*(i+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[i+m])}else for(let m=0;m<s;m++){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=c[3*(i+m)+h];268435456&c[3*(i+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[i+m])}const _=Object.keys(e._combined);for(let m=0;m<_.length;m++){const h=parseInt(_[m],10);h>=i&&(this._combined[h-i+t]=e._combined[h])}}translateToString(e=!1,i=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let s="";for(;i<t;){const a=this._data[3*i+0],c=2097151&a;s+=2097152&a?this._combined[i]:c?(0,u.stringFromCodePoint)(c):o.WHITESPACE_CELL_CHAR,i+=a>>22||1}return s}}r.BufferLine=g},4841:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(n,l){if(n.start.y>n.end.y)throw new Error(`Buffer range end (${n.end.x}, ${n.end.y}) cannot be before start (${n.start.x}, ${n.start.y})`);return l*(n.end.y-n.start.y)+(n.end.x-n.start.x+1)}},4634:(M,r)=>{function n(l,d,o){if(d===l.length-1)return l[d].getTrimmedLength();const u=!l[d].hasContent(o-1)&&l[d].getWidth(o-1)===1,p=l[d+1].getWidth(0)===2;return u&&p?o-1:o}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,d,o,u,p){const g=[];for(let f=0;f<l.length-1;f++){let e=f,i=l.get(++e);if(!i.isWrapped)continue;const t=[l.get(f)];for(;e<l.length&&i.isWrapped;)t.push(i),i=l.get(++e);if(u>=f&&u<e){f+=t.length-1;continue}let s=0,a=n(t,s,d),c=1,_=0;for(;c<t.length;){const h=n(t,c,d),v=h-_,y=o-a,T=Math.min(v,y);t[s].copyCellsFrom(t[c],_,a,T,!1),a+=T,a===o&&(s++,a=0),_+=T,_===h&&(c++,_=0),a===0&&s!==0&&t[s-1].getWidth(o-1)===2&&(t[s].copyCellsFrom(t[s-1],o-1,a++,1,!1),t[s-1].setCell(o-1,p))}t[s].replaceCells(a,o,p);let m=0;for(let h=t.length-1;h>0&&(h>s||t[h].getTrimmedLength()===0);h--)m++;m>0&&(g.push(f+t.length-m),g.push(m)),f+=t.length-1}return g},r.reflowLargerCreateNewLayout=function(l,d){const o=[];let u=0,p=d[u],g=0;for(let f=0;f<l.length;f++)if(p===f){const e=d[++u];l.onDeleteEmitter.fire({index:f-g,amount:e}),f+=e-1,g+=e,p=d[++u]}else o.push(f);return{layout:o,countRemoved:g}},r.reflowLargerApplyNewLayout=function(l,d){const o=[];for(let u=0;u<d.length;u++)o.push(l.get(d[u]));for(let u=0;u<o.length;u++)l.set(u,o[u]);l.length=d.length},r.reflowSmallerGetNewLineLengths=function(l,d,o){const u=[],p=l.map((i,t)=>n(l,t,d)).reduce((i,t)=>i+t);let g=0,f=0,e=0;for(;e<p;){if(p-e<o){u.push(p-e);break}g+=o;const i=n(l,f,d);g>i&&(g-=i,f++);const t=l[f].getWidth(g-1)===2;t&&g--;const s=t?o-1:o;u.push(s),e+=s}return u},r.getWrappedLineTrimmedLength=n},5295:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=n(8460),d=n(844),o=n(9092);class u extends d.Disposable{constructor(g,f){super(),this._optionsService=g,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 o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,f){this._normal.resize(g,f),this._alt.resize(g,f),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=u},511:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=n(482),d=n(643),o=n(3734);class u extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const f=new u;return f.setFromCharData(g),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(g){this.fg=g[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(g[d.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(g[d.CHAR_DATA_CHAR_INDEX].length===2){const e=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const i=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(e-55296)+i-56320+65536|g[d.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=g[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=u},643:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=n(8460),d=n(844);class o{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=o._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,d.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}r.Marker=o,o._nextId=1},7116:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(M,r)=>{var n,l,d;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT="	",o.LF=`
`,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""}(n||(r.C0=n={})),function(o){o.PAD="",o.HOP="",o.BPH="",o.NBH="",o.IND="",o.NEL="",o.SSA="",o.ESA="",o.HTS="",o.HTJ="",o.VTS="",o.PLD="",o.PLU="",o.RI="",o.SS2="",o.SS3="",o.DCS="",o.PU1="",o.PU2="",o.STS="",o.CCH="",o.MW="",o.SPA="",o.EPA="",o.SOS="",o.SGCI="",o.SCI="",o.CSI="",o.ST="",o.OSC="",o.PM="",o.APC=""}(l||(r.C1=l={})),function(o){o.ST=`${n.ESC}\\`}(d||(r.C1_ESCAPED=d={}))},7399:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=n(2584),d={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(o,u,p,g){const f={type:0,cancel:!1,key:void 0},e=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?f.key=u?l.C0.ESC+"OA":l.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?f.key=u?l.C0.ESC+"OD":l.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?f.key=u?l.C0.ESC+"OC":l.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(f.key=u?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(o.altKey){f.key=l.C0.ESC+l.C0.DEL;break}f.key=l.C0.DEL;break;case 9:if(o.shiftKey){f.key=l.C0.ESC+"[Z";break}f.key=l.C0.HT,f.cancel=!0;break;case 13:f.key=o.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,f.cancel=!0;break;case 27:f.key=l.C0.ESC,o.altKey&&(f.key=l.C0.ESC+l.C0.ESC),f.cancel=!0;break;case 37:if(o.metaKey)break;e?(f.key=l.C0.ESC+"[1;"+(e+1)+"D",f.key===l.C0.ESC+"[1;3D"&&(f.key=l.C0.ESC+(p?"b":"[1;5D"))):f.key=u?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(o.metaKey)break;e?(f.key=l.C0.ESC+"[1;"+(e+1)+"C",f.key===l.C0.ESC+"[1;3C"&&(f.key=l.C0.ESC+(p?"f":"[1;5C"))):f.key=u?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(o.metaKey)break;e?(f.key=l.C0.ESC+"[1;"+(e+1)+"A",p||f.key!==l.C0.ESC+"[1;3A"||(f.key=l.C0.ESC+"[1;5A")):f.key=u?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(o.metaKey)break;e?(f.key=l.C0.ESC+"[1;"+(e+1)+"B",p||f.key!==l.C0.ESC+"[1;3B"||(f.key=l.C0.ESC+"[1;5B")):f.key=u?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(f.key=l.C0.ESC+"[2~");break;case 46:f.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:f.key=e?l.C0.ESC+"[1;"+(e+1)+"H":u?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:f.key=e?l.C0.ESC+"[1;"+(e+1)+"F":u?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:o.shiftKey?f.type=2:o.ctrlKey?f.key=l.C0.ESC+"[5;"+(e+1)+"~":f.key=l.C0.ESC+"[5~";break;case 34:o.shiftKey?f.type=3:o.ctrlKey?f.key=l.C0.ESC+"[6;"+(e+1)+"~":f.key=l.C0.ESC+"[6~";break;case 112:f.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:f.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:f.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:f.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:f.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:f.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:f.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:f.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:f.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:f.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:f.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:f.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(p&&!g||!o.altKey||o.metaKey)!p||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?f.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(f.key=l.C0.US),o.key==="@"&&(f.key=l.C0.NUL)):o.keyCode===65&&(f.type=1);else{const i=d[o.keyCode],t=i==null?void 0:i[o.shiftKey?1:0];if(t)f.key=l.C0.ESC+t;else if(o.keyCode>=65&&o.keyCode<=90){const s=o.ctrlKey?o.keyCode-64:o.keyCode+32;let a=String.fromCharCode(s);o.shiftKey&&(a=a.toUpperCase()),f.key=l.C0.ESC+a}else if(o.keyCode===32)f.key=l.C0.ESC+(o.ctrlKey?l.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let s=o.code.slice(3,4);o.shiftKey||(s=s.toLowerCase()),f.key=l.C0.ESC+s,f.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?f.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?f.key=l.C0.NUL:o.keyCode>=51&&o.keyCode<=55?f.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?f.key=l.C0.DEL:o.keyCode===219?f.key=l.C0.ESC:o.keyCode===220?f.key=l.C0.FS:o.keyCode===221&&(f.key=l.C0.GS)}return f}},482:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},r.utf32ToString=function(n,l=0,d=n.length){let o="";for(let u=l;u<d;++u){let p=n[u];p>65535?(p-=65536,o+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):o+=String.fromCharCode(p)}return o},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,l){const d=n.length;if(!d)return 0;let o=0,u=0;if(this._interim){const p=n.charCodeAt(u++);56320<=p&&p<=57343?l[o++]=1024*(this._interim-55296)+p-56320+65536:(l[o++]=this._interim,l[o++]=p),this._interim=0}for(let p=u;p<d;++p){const g=n.charCodeAt(p);if(55296<=g&&g<=56319){if(++p>=d)return this._interim=g,o;const f=n.charCodeAt(p);56320<=f&&f<=57343?l[o++]=1024*(g-55296)+f-56320+65536:(l[o++]=g,l[o++]=f)}else g!==65279&&(l[o++]=g)}return o}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,l){const d=n.length;if(!d)return 0;let o,u,p,g,f=0,e=0,i=0;if(this.interim[0]){let a=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let _,m=0;for(;(_=63&this.interim[++m])&&m<4;)c<<=6,c|=_;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,v=h-m;for(;i<v;){if(i>=d)return 0;if(_=n[i++],(192&_)!=128){i--,a=!0;break}this.interim[m++]=_,c<<=6,c|=63&_}a||(h===2?c<128?i--:l[f++]=c:h===3?c<2048||c>=55296&&c<=57343||c===65279||(l[f++]=c):c<65536||c>1114111||(l[f++]=c)),this.interim.fill(0)}const t=d-4;let s=i;for(;s<d;){for(;!(!(s<t)||128&(o=n[s])||128&(u=n[s+1])||128&(p=n[s+2])||128&(g=n[s+3]));)l[f++]=o,l[f++]=u,l[f++]=p,l[f++]=g,s+=4;if(o=n[s++],o<128)l[f++]=o;else if((224&o)==192){if(s>=d)return this.interim[0]=o,f;if(u=n[s++],(192&u)!=128){s--;continue}if(e=(31&o)<<6|63&u,e<128){s--;continue}l[f++]=e}else if((240&o)==224){if(s>=d)return this.interim[0]=o,f;if(u=n[s++],(192&u)!=128){s--;continue}if(s>=d)return this.interim[0]=o,this.interim[1]=u,f;if(p=n[s++],(192&p)!=128){s--;continue}if(e=(15&o)<<12|(63&u)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;l[f++]=e}else if((248&o)==240){if(s>=d)return this.interim[0]=o,f;if(u=n[s++],(192&u)!=128){s--;continue}if(s>=d)return this.interim[0]=o,this.interim[1]=u,f;if(p=n[s++],(192&p)!=128){s--;continue}if(s>=d)return this.interim[0]=o,this.interim[1]=u,this.interim[2]=p,f;if(g=n[s++],(192&g)!=128){s--;continue}if(e=(7&o)<<18|(63&u)<<12|(63&p)<<6|63&g,e<65536||e>1114111)continue;l[f++]=e}}return f}}},225:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;r.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let o=0;o<n.length;++o)d.fill(0,n[o][0],n[o][1]+1)}}wcwidth(o){return o<32?0:o<127?1:o<65536?d[o]:function(u,p){let g,f=0,e=p.length-1;if(u<p[0][0]||u>p[e][1])return!1;for(;e>=f;)if(g=f+e>>1,u>p[g][1])f=g+1;else{if(!(u<p[g][0]))return!0;e=g-1}return!1}(o,l)?0:o>=131072&&o<=196605||o>=196608&&o<=262141?2:1}}},5981:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=n(8460),d=n(844);class o extends d.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(g),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(g)}_innerWrite(p=0,g=!0){const f=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],i=this._action(e,g);if(i){const s=a=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(f,a);return void i.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(s)}const t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=e.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()}}r.WriteBuffer=o},5941:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const n=/^([\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 d(o,u){const p=o.toString(16),g=p.length<2?"0"+p:p;switch(u){case 4:return p[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(o){if(!o)return;let u=o.toLowerCase();if(u.indexOf("rgb:")===0){u=u.slice(4);const p=n.exec(u);if(p){const g=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/g*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/g*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/g*255)]}}else if(u.indexOf("#")===0&&(u=u.slice(1),l.exec(u)&&[3,6,9,12].includes(u.length))){const p=u.length/3,g=[0,0,0];for(let f=0;f<3;++f){const e=parseInt(u.slice(p*f,p*f+p),16);g[f]=p===1?e<<4:p===2?e:p===3?e>>4:e>>8}return g}},r.toRgbString=function(o,u=16){const[p,g,f]=o;return`rgb:${d(p,u)}/${d(g,u)}/${d(f,u)}`}},5770:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=n(482),d=n(8742),o=n(5770),u=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=u,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}registerHandler(g,f){this._handlers[g]===void 0&&(this._handlers[g]=[]);const e=this._handlers[g];return e.push(f),{dispose:()=>{const i=e.indexOf(f);i!==-1&&e.splice(i,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=u,this._ident=0}hook(g,f){if(this.reset(),this._ident=g,this._active=this._handlers[g]||u,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(g,f,e){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(g,f,e);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,f,e))}unhook(g,f=!0){if(this._active.length){let e=!1,i=this._active.length-1,t=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,e=f,t=this._stack.fallThrough,this._stack.paused=!1),!t&&e===!1){for(;i>=0&&(e=this._active[i].unhook(g),e!==!0);i--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,e;i--}for(;i>=0;i--)if(e=this._active[i].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",g);this._active=u,this._ident=0}};const p=new d.Params;p.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=p,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():p,this._data="",this._hitLimit=!1}put(g,f,e){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,f,e),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let f=!1;if(this._hitLimit)f=!1;else if(g&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(e=>(this._params=p,this._data="",this._hitLimit=!1,e));return this._params=p,this._data="",this._hitLimit=!1,f}}},2015:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=n(844),d=n(8742),o=n(6242),u=n(6351);class p{constructor(i){this.table=new Uint8Array(i)}setDefault(i,t){this.table.fill(i<<4|t)}add(i,t,s,a){this.table[t<<8|i]=s<<4|a}addMany(i,t,s,a){for(let c=0;c<i.length;c++)this.table[t<<8|i[c]]=s<<4|a}}r.TransitionTable=p;const g=160;r.VT500_TRANSITION_TABLE=function(){const e=new p(4095),i=Array.apply(null,Array(256)).map((m,h)=>h),t=(m,h)=>i.slice(m,h),s=t(32,127),a=t(0,24);a.push(25),a.push.apply(a,t(28,32));const c=t(0,14);let _;for(_ in e.setDefault(1,0),e.addMany(s,0,2,0),c)e.addMany([24,26,153,154],_,3,0),e.addMany(t(128,144),_,3,0),e.addMany(t(144,152),_,3,0),e.add(156,_,0,0),e.add(27,_,11,1),e.add(157,_,4,8),e.addMany([152,158,159],_,0,7),e.add(155,_,11,3),e.add(144,_,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(g,0,2,0),e.add(g,8,5,8),e.add(g,6,0,6),e.add(g,11,0,11),e.add(g,13,13,13),e}();class f extends l.Disposable{constructor(i=r.VT500_TRANSITION_TABLE){super(),this._transitions=i,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(t,s,a)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,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 o.OscParser),this._dcsParser=this.register(new u.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,t=[64,126]){let s=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=i.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let c=0;c<i.intermediates.length;++c){const _=i.intermediates.charCodeAt(c);if(32>_||_>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=_}}if(i.final.length!==1)throw new Error("final must be a single byte");const a=i.final.charCodeAt(0);if(t[0]>a||a>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=a,s}identToString(i){const t=[];for(;i;)t.push(String.fromCharCode(255&i)),i>>=8;return t.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,t){const s=this._identifier(i,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const a=this._escHandlers[s];return a.push(t),{dispose:()=>{const c=a.indexOf(t);c!==-1&&a.splice(c,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,t){this._executeHandlers[i.charCodeAt(0)]=t}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,t){const s=this._identifier(i);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const a=this._csiHandlers[s];return a.push(t),{dispose:()=>{const c=a.indexOf(t);c!==-1&&a.splice(c,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,t){return this._dcsParser.registerHandler(this._identifier(i),t)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,t){return this._oscParser.registerHandler(i,t)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(i,t,s,a,c){this._parseStack.state=i,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=a,this._parseStack.chunkPos=c}parse(i,t,s){let a,c=0,_=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=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 h=this._parseStack.handlers;let v=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&v>-1){for(;v>=0&&(a=h[v](this._params),a!==!0);v--)if(a instanceof Promise)return this._parseStack.handlerPos=v,a}this._parseStack.handlers=[];break;case 4:if(s===!1&&v>-1){for(;v>=0&&(a=h[v](),a!==!0);v--)if(a instanceof Promise)return this._parseStack.handlerPos=v,a}this._parseStack.handlers=[];break;case 6:if(c=i[this._parseStack.chunkPos],a=this._dcsParser.unhook(c!==24&&c!==26,s),a)return a;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=i[this._parseStack.chunkPos],a=this._oscParser.end(c!==24&&c!==26,s),a)return a;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let h=m;h<t;++h){switch(c=i[h],_=this._transitions.table[this.currentState<<8|(c<160?c:g)],_>>4){case 2:for(let A=h+1;;++A){if(A>=t||(c=i[A])<32||c>126&&c<g){this._printHandler(i,h,A),h=A-1;break}if(++A>=t||(c=i[A])<32||c>126&&c<g){this._printHandler(i,h,A),h=A-1;break}if(++A>=t||(c=i[A])<32||c>126&&c<g){this._printHandler(i,h,A),h=A-1;break}if(++A>=t||(c=i[A])<32||c>126&&c<g){this._printHandler(i,h,A),h=A-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const v=this._csiHandlers[this._collect<<8|c];let y=v?v.length-1:-1;for(;y>=0&&(a=v[y](this._params),a!==!0);y--)if(a instanceof Promise)return this._preserveStack(3,v,y,_,h),a;y<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++h<t&&(c=i[h])>47&&c<60);h--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const T=this._escHandlers[this._collect<<8|c];let x=T?T.length-1:-1;for(;x>=0&&(a=T[x](),a!==!0);x--)if(a instanceof Promise)return this._preserveStack(4,T,x,_,h),a;x<0&&this._escHandlerFb(this._collect<<8|c),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|c,this._params);break;case 13:for(let A=h+1;;++A)if(A>=t||(c=i[A])===24||c===26||c===27||c>127&&c<g){this._dcsParser.put(i,h,A),h=A-1;break}break;case 14:if(a=this._dcsParser.unhook(c!==24&&c!==26),a)return this._preserveStack(6,[],0,_,h),a;c===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let A=h+1;;A++)if(A>=t||(c=i[A])<32||c>127&&c<g){this._oscParser.put(i,h,A),h=A-1;break}break;case 6:if(a=this._oscParser.end(c!==24&&c!==26),a)return this._preserveStack(5,[],0,_,h),a;c===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&_}}}r.EscapeSequenceParser=f},6242:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=n(5770),d=n(482),o=[];r.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(u,p){this._handlers[u]===void 0&&(this._handlers[u]=[]);const g=this._handlers[u];return g.push(p),{dispose:()=>{const f=g.indexOf(p);f!==-1&&g.splice(f,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")}_put(u,p,g){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(u,p,g);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(u,p,g))}start(){this.reset(),this._state=1}put(u,p,g){if(this._state!==3){if(this._state===1)for(;p<g;){const f=u[p++];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&&g-p>0&&this._put(u,p,g)}}end(u,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,f=this._active.length-1,e=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,g=p,e=this._stack.fallThrough,this._stack.paused=!1),!e&&g===!1){for(;f>=0&&(g=this._active[f].end(u),g!==!0);f--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,g;f--}for(;f>=0;f--)if(g=this._active[f].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",u);this._active=o,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(u){this._handler=u,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(u,p,g){this._hitLimit||(this._data+=(0,d.utf32ToString)(u,p,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(u){let p=!1;if(this._hitLimit)p=!1;else if(u&&(p=this._handler(this._data),p instanceof Promise))return p.then(g=>(this._data="",this._hitLimit=!1,g));return this._data="",this._hitLimit=!1,p}}},8742:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const n=2147483647;class l{static fromArray(o){const u=new l;if(!o.length)return u;for(let p=Array.isArray(o[0])?1:0;p<o.length;++p){const g=o[p];if(Array.isArray(g))for(let f=0;f<g.length;++f)u.addSubParam(g[f]);else u.addParam(g)}return u}constructor(o=32,u=32){if(this.maxLength=o,this.maxSubParamsLength=u,u>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(u),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new l(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let u=0;u<this.length;++u){o.push(this.params[u]);const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];g-p>0&&o.push(Array.prototype.slice.call(this._subParams,p,g))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>n?n:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>n?n:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const u=this._subParamsIdx[o]>>8,p=255&this._subParamsIdx[o];return p-u>0?this._subParams.subarray(u,p):null}getSubParamsAll(){const o={};for(let u=0;u<this.length;++u){const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];g-p>0&&(o[u]=this._subParams.slice(p,g))}return o}addDigit(o){let u;if(this._rejectDigits||!(u=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,g=p[u-1];p[u-1]=~g?Math.min(10*g+o,n):o}}r.Params=l},5741:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let n=this._addons.length-1;n>=0;n--)this._addons[n].instance.dispose()}loadAddon(n,l){const d={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(d),l.dispose=()=>this._wrappedAddonDispose(d),l.activate(n)}_wrappedAddonDispose(n){if(n.isDisposed)return;let l=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===n){l=d;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");n.isDisposed=!0,n.dispose.apply(n.instance),this._addons.splice(l,1)}}},8771:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=n(3785),d=n(511);r.BufferApiView=class{constructor(o,u){this._buffer=o,this.type=u}init(o){return this._buffer=o,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(o){const u=this._buffer.lines.get(o);if(u)return new l.BufferLineApiView(u)}getNullCell(){return new d.CellData}}},3785:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=n(511);r.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,o){if(!(d<0||d>=this._line.length))return o?(this._line.loadCell(d,o),o):this._line.loadCell(d,new l.CellData)}translateToString(d,o,u){return this._line.translateToString(d,o,u)}}},8285:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=n(8771),d=n(8460),o=n(844);class u extends o.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new d.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)}}r.BufferNamespaceApi=u},7975:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(n){this._core=n}registerCsiHandler(n,l){return this._core.registerCsiHandler(n,d=>l(d.toArray()))}addCsiHandler(n,l){return this.registerCsiHandler(n,l)}registerDcsHandler(n,l){return this._core.registerDcsHandler(n,(d,o)=>l(d,o.toArray()))}addDcsHandler(n,l){return this.registerDcsHandler(n,l)}registerEscHandler(n,l){return this._core.registerEscHandler(n,l)}addEscHandler(n,l){return this.registerEscHandler(n,l)}registerOscHandler(n,l){return this._core.registerOscHandler(n,l)}addOscHandler(n,l){return this.registerOscHandler(n,l)}}},7090:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(n){this._core=n}register(n){this._core.unicodeService.register(n)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(n){this._core.unicodeService.activeVersion=n}}},744:function(M,r,n){var l=this&&this.__decorate||function(e,i,t,s){var a,c=arguments.length,_=c<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,i,t,s);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(_=(c<3?a(_):c>3?a(i,t,_):a(i,t))||_);return c>3&&_&&Object.defineProperty(i,t,_),_},d=this&&this.__param||function(e,i){return function(t,s){i(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const o=n(8460),u=n(844),p=n(5295),g=n(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let f=r.BufferService=class extends u.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(e,this))}resize(e,i){this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){const t=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=t.getBlankLine(e,i),this._cachedBlankLine=s),s.isWrapped=i;const a=t.ybase+t.scrollTop,c=t.ybase+t.scrollBottom;if(t.scrollTop===0){const _=t.lines.isFull;c===t.lines.length-1?_?t.lines.recycle().copyFrom(s):t.lines.push(s.clone()):t.lines.splice(c+1,0,s.clone()),_?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const _=c-a+1;t.lines.shiftElements(a+1,_-1,-1),t.lines.set(c,s.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(e,i,t){const s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const a=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),a!==s.ydisp&&(i||this._onScroll.fire(s.ydisp))}};r.BufferService=f=l([d(0,g.IOptionsService)],f)},7994:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(n){this.glevel=n,this.charset=this._charsets[n]}setgCharset(n,l){this._charsets[n]=l,this.glevel===n&&(this.charset=l)}}},1753:function(M,r,n){var l=this&&this.__decorate||function(s,a,c,_){var m,h=arguments.length,v=h<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,c):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,a,c,_);else for(var y=s.length-1;y>=0;y--)(m=s[y])&&(v=(h<3?m(v):h>3?m(a,c,v):m(a,c))||v);return h>3&&v&&Object.defineProperty(a,c,v),v},d=this&&this.__param||function(s,a){return function(c,_){a(c,_,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const o=n(2585),u=n(8460),p=n(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function f(s,a){let c=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(c|=64,c|=s.action):(c|=3&s.button,4&s.button&&(c|=64),8&s.button&&(c|=128),s.action===32?c|=32:s.action!==0||a||(c|=3)),c}const e=String.fromCharCode,i={DEFAULT:s=>{const a=[f(s,!1)+32,s.col+32,s.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${e(a[0])}${e(a[1])}${e(a[2])}`},SGR:s=>{const a=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.col};${s.row}${a}`},SGR_PIXELS:s=>{const a=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${f(s,!0)};${s.x};${s.y}${a}`}};let t=r.CoreMouseService=class extends p.Disposable{constructor(s,a){super(),this._bufferService=s,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new u.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(g))this.addProtocol(c,g[c]);for(const c of Object.keys(i))this.addEncoding(c,i[c]);this.reset()}addProtocol(s,a){this._protocols[s]=a}addEncoding(s,a){this._encodings[s]=a}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 a=this._encodings[this._activeEncoding](s);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!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,a,c){if(c){if(s.x!==a.x||s.y!==a.y)return!1}else if(s.col!==a.col||s.row!==a.row)return!1;return s.button===a.button&&s.action===a.action&&s.ctrl===a.ctrl&&s.alt===a.alt&&s.shift===a.shift}};r.CoreMouseService=t=l([d(0,o.IBufferService),d(1,o.ICoreService)],t)},6975:function(M,r,n){var l=this&&this.__decorate||function(t,s,a,c){var _,m=arguments.length,h=m<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(t,s,a,c);else for(var v=t.length-1;v>=0;v--)(_=t[v])&&(h=(m<3?_(h):m>3?_(s,a,h):_(s,a))||h);return m>3&&h&&Object.defineProperty(s,a,h),h},d=this&&this.__param||function(t,s){return function(a,c){s(a,c,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const o=n(1439),u=n(8460),p=n(844),g=n(2585),f=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=r.CoreService=class extends p.Disposable{constructor(t,s,a){super(),this._bufferService=t,this._logService=s,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new u.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new u.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(f),this.decPrivateModes=(0,o.clone)(e)}reset(){this.modes=(0,o.clone)(f),this.decPrivateModes=(0,o.clone)(e)}triggerDataEvent(t,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,()=>t.split("").map(c=>c.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,()=>t.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(t))}};r.CoreService=i=l([d(0,g.IBufferService),d(1,g.ILogService),d(2,g.IOptionsService)],i)},9074:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=n(8055),d=n(8460),o=n(844),u=n(6106);let p=0,g=0;class f extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new u.SortedList(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)(()=>this.reset()))}registerDecoration(t){if(t.marker.isDisposed)return;const s=new e(t);if(s){const a=s.marker.onDispose(()=>s.dispose());s.onDispose(()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),a.dispose())}),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,s,a){var c,_,m;let h=0,v=0;for(const y of this._decorations.getKeyIterator(s))h=(c=y.options.x)!==null&&c!==void 0?c:0,v=h+((_=y.options.width)!==null&&_!==void 0?_:1),t>=h&&t<v&&(!a||((m=y.options.layer)!==null&&m!==void 0?m:"bottom")===a)&&(yield y)}forEachDecorationAtCell(t,s,a,c){this._decorations.forEachByKey(s,_=>{var m,h,v;p=(m=_.options.x)!==null&&m!==void 0?m:0,g=p+((h=_.options.width)!==null&&h!==void 0?h:1),t>=p&&t<g&&(!a||((v=_.options.layer)!==null&&v!==void 0?v:"bottom")===a)&&c(_)})}}r.DecorationService=f;class e extends o.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(t){super(),this.options=t,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=n(2585),d=n(8343);class o{constructor(...p){this._entries=new Map;for(const[g,f]of p)this.set(g,f)}set(p,g){const f=this._entries.get(p);return this._entries.set(p,g),f}forEach(p){for(const[g,f]of this._entries.entries())p(g,f)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}r.ServiceCollection=o,r.InstantiationService=class{constructor(){this._services=new o,this._services.set(l.IInstantiationService,this)}setService(u,p){this._services.set(u,p)}getService(u){return this._services.get(u)}createInstance(u,...p){const g=(0,d.getServiceDependencies)(u).sort((i,t)=>i.index-t.index),f=[];for(const i of g){const t=this._services.get(i.id);if(!t)throw new Error(`[createInstance] ${u.name} depends on UNKNOWN service ${i.id}.`);f.push(t)}const e=g.length>0?g[0].index:p.length;if(p.length!==e)throw new Error(`[createInstance] First service dependency of ${u.name} at position ${e+1} conflicts with ${p.length} static arguments`);return new u(...p,...f)}}},7866:function(M,r,n){var l=this&&this.__decorate||function(e,i,t,s){var a,c=arguments.length,_=c<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,i,t,s);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(_=(c<3?a(_):c>3?a(i,t,_):a(i,t))||_);return c>3&&_&&Object.defineProperty(i,t,_),_},d=this&&this.__param||function(e,i){return function(t,s){i(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const o=n(844),u=n(2585),p={trace:u.LogLevelEnum.TRACE,debug:u.LogLevelEnum.DEBUG,info:u.LogLevelEnum.INFO,warn:u.LogLevelEnum.WARN,error:u.LogLevelEnum.ERROR,off:u.LogLevelEnum.OFF};let g,f=r.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=u.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...t)}trace(e,...i){var t,s;this._logLevel<=u.LogLevelEnum.TRACE&&this._log((s=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.trace.bind(this._optionsService.options.logger))!==null&&s!==void 0?s:console.log,e,i)}debug(e,...i){var t,s;this._logLevel<=u.LogLevelEnum.DEBUG&&this._log((s=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.debug.bind(this._optionsService.options.logger))!==null&&s!==void 0?s:console.log,e,i)}info(e,...i){var t,s;this._logLevel<=u.LogLevelEnum.INFO&&this._log((s=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.info.bind(this._optionsService.options.logger))!==null&&s!==void 0?s:console.info,e,i)}warn(e,...i){var t,s;this._logLevel<=u.LogLevelEnum.WARN&&this._log((s=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.warn.bind(this._optionsService.options.logger))!==null&&s!==void 0?s:console.warn,e,i)}error(e,...i){var t,s;this._logLevel<=u.LogLevelEnum.ERROR&&this._log((s=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.error.bind(this._optionsService.options.logger))!==null&&s!==void 0?s:console.error,e,i)}};r.LogService=f=l([d(0,u.IOptionsService)],f),r.setTraceLogger=function(e){g=e},r.traceCall=function(e,i,t){if(typeof t.value!="function")throw new Error("not supported");const s=t.value;t.value=function(...a){if(g.logLevel!==u.LogLevelEnum.TRACE)return s.apply(this,a);g.trace(`GlyphRenderer#${s.name}(${a.map(_=>JSON.stringify(_)).join(", ")})`);const c=s.apply(this,a);return g.trace(`GlyphRenderer#${s.name} return`,c),c}}},7302:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=n(8460),d=n(844),o=n(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const u=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends d.Disposable{constructor(f){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},r.DEFAULT_OPTIONS);for(const i in f)if(i in e)try{const t=f[i];e[i]=this._sanitizeAndValidateOption(i,t)}catch(t){console.error(t)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(f,e){return this.onOptionChange(i=>{i===f&&e(this.rawOptions[f])})}onMultipleOptionChange(f,e){return this.onOptionChange(i=>{f.indexOf(i)!==-1&&e()})}_setupOptions(){const f=i=>{if(!(i in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},e=(i,t)=>{if(!(i in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);t=this._sanitizeAndValidateOption(i,t),this.rawOptions[i]!==t&&(this.rawOptions[i]=t,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const t={get:f.bind(this,i),set:e.bind(this,i)};Object.defineProperty(this.options,i,t)}}_sanitizeAndValidateOption(f,e){switch(f){case"cursorStyle":if(e||(e=r.DEFAULT_OPTIONS[f]),!function(i){return i==="block"||i==="underline"||i==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${f}`);break;case"wordSeparator":e||(e=r.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=u.includes(e)?e:r.DEFAULT_OPTIONS[f];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${f} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${f} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}r.OptionsService=p},2660:function(M,r,n){var l=this&&this.__decorate||function(p,g,f,e){var i,t=arguments.length,s=t<3?g:e===null?e=Object.getOwnPropertyDescriptor(g,f):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(p,g,f,e);else for(var a=p.length-1;a>=0;a--)(i=p[a])&&(s=(t<3?i(s):t>3?i(g,f,s):i(g,f))||s);return t>3&&s&&Object.defineProperty(g,f,s),s},d=this&&this.__param||function(p,g){return function(f,e){g(f,e,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const o=n(2585);let u=r.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const g=this._bufferService.buffer;if(p.id===void 0){const a=g.addMarker(g.ybase+g.y),c={data:p,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(c,a)),this._dataByLinkId.set(c.id,c),c.id}const f=p,e=this._getEntryIdKey(f),i=this._entriesWithId.get(e);if(i)return this.addLineToLink(i.id,g.ybase+g.y),i.id;const t=g.addMarker(g.ybase+g.y),s={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[t]};return t.onDispose(()=>this._removeMarkerFromLink(s,t)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(p,g){const f=this._dataByLinkId.get(p);if(f&&f.lines.every(e=>e.line!==g)){const e=this._bufferService.buffer.addMarker(g);f.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(f,e))}}getLinkData(p){var g;return(g=this._dataByLinkId.get(p))===null||g===void 0?void 0:g.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,g){const f=p.lines.indexOf(g);f!==-1&&(p.lines.splice(f,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};r.OscLinkService=u=l([d(0,o.IBufferService)],u)},8343:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const n="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(d){return d[l]||[]},r.createDecorator=function(d){if(r.serviceRegistry.has(d))return r.serviceRegistry.get(d);const o=function(u,p,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,e,i){e[n]===e?e[l].push({id:f,index:i}):(e[l]=[{id:f,index:i}],e[n]=e)})(o,u,g)};return o.toString=()=>d,r.serviceRegistry.set(d,o),o}},2585:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=n(8343);var d;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"}(d||(r.LogLevelEnum=d={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(M,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=n(8460),d=n(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const o=new d.UnicodeV6;this.register(o),this._active=o.version,this._activeProvider=o}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(o){if(!this._providers[o])throw new Error(`unknown Unicode version "${o}"`);this._active=o,this._activeProvider=this._providers[o],this._onChange.fire(o)}register(o){this._providers[o.version]=o}wcwidth(o){return this._activeProvider.wcwidth(o)}getStringCellWidth(o){let u=0;const p=o.length;for(let g=0;g<p;++g){let f=o.charCodeAt(g);if(55296<=f&&f<=56319){if(++g>=p)return u+this.wcwidth(f);const e=o.charCodeAt(g);56320<=e&&e<=57343?f=1024*(f-55296)+e-56320+65536:u+=this.wcwidth(e)}u+=this.wcwidth(f)}return u}}}},O={};function D(M){var r=O[M];if(r!==void 0)return r.exports;var n=O[M]={exports:{}};return R[M].call(n.exports,n,n.exports,D),n.exports}var H={};return(()=>{var M=H;Object.defineProperty(M,"__esModule",{value:!0}),M.Terminal=void 0;const r=D(9042),n=D(3236),l=D(844),d=D(5741),o=D(8285),u=D(7975),p=D(7090),g=["cols","rows"];class f extends l.Disposable{constructor(i){super(),this._core=this.register(new n.Terminal(i)),this._addonManager=this.register(new d.AddonManager),this._publicOptions=Object.assign({},this._core.options);const t=a=>this._core.options[a],s=(a,c)=>{this._checkReadonlyOptions(a),this._core.options[a]=c};for(const a in this._core.options){const c={get:t.bind(this,a),set:s.bind(this,a)};Object.defineProperty(this._publicOptions,a,c)}}_checkReadonlyOptions(i){if(g.includes(i))throw new Error(`Option "${i}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new u.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new p.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const t in i)this._publicOptions[t]=i[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(i,t){this._verifyIntegers(i,t),this._core.resize(i,t)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){var t,s,a;return this._checkProposedApi(),this._verifyPositiveIntegers((t=i.x)!==null&&t!==void 0?t:0,(s=i.width)!==null&&s!==void 0?s:0,(a=i.height)!==null&&a!==void 0?a:0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,t,s){this._verifyIntegers(i,t,s),this._core.select(i,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,t){this._verifyIntegers(i,t),this._core.selectLines(i,t)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,t){this._core.write(i,t)}writeln(i,t){this._core.write(i),this._core.write(`\r
`,t)}paste(i){this._core.paste(i)}refresh(i,t){this._verifyIntegers(i,t),this._core.refresh(i,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(i){this._addonManager.loadAddon(this,i)}static get strings(){return r}_verifyIntegers(...i){for(const t of i)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...i){for(const t of i)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}M.Terminal=f})(),H})())})(wt);var ns=wt.exports,yt={exports:{}};(function(C,E){(function(R,O){C.exports=O()})(self,()=>(()=>{var R={};return(()=>{var O=R;Object.defineProperty(O,"__esModule",{value:!0}),O.FitAddon=void 0,O.FitAddon=class{activate(D){this._terminal=D}dispose(){}fit(){const D=this.proposeDimensions();if(!D||!this._terminal||isNaN(D.cols)||isNaN(D.rows))return;const H=this._terminal._core;this._terminal.rows===D.rows&&this._terminal.cols===D.cols||(H._renderService.clear(),this._terminal.resize(D.cols,D.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const D=this._terminal._core,H=D._renderService.dimensions;if(H.css.cell.width===0||H.css.cell.height===0)return;const M=this._terminal.options.scrollback===0?0:D.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),o=n-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),u=l-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-M;return{cols:Math.max(2,Math.floor(u/H.css.cell.width)),rows:Math.max(1,Math.floor(o/H.css.cell.height))}}}})(),R})())})(yt);var os=yt.exports;const oe={targetIP:"192.168.1.50",hostname:"WORKSTATION-01",domain:"infoseclabs.local",currentUser:"admin",ipAddress:"192.168.1.100",gateway:"192.168.1.1",macAddress:"00:1A:2B:3C:4D:5E"},nt={windows:["ls","dir","cd","cat","type","mkdir","whoami","hostname","ipconfig","ping","netstat","tasklist","systeminfo","net","sc","quser","gpresult","reg","cls","clear","echo","help","tree","wireshark"],linux:["ls","cd","cat","mkdir","whoami","hostname","ifconfig","ip","ping","netstat","ss","ps","top","htop","systemctl","service","df","free","uname","lsb_release","grep","find","head","tail","apt","apt-get","sudo","chmod","chown","groups","id","date","uptime","curl","wget","ssh","nc","nmap","hydra","nikto","sqlmap","john","hashcat","msfconsole","tshark","tcpdump","aircrack-ng","clear","cls","echo","help","man","history","wireshark"]},xt={windows:{"C:\\Users\\Admin":["Desktop","Documents","Downloads","Pictures","welcome.txt"],"C:\\Users\\Admin\\Desktop":["Manual.txt","shortcuts.lnk","report.docx"],"C:\\Users\\Admin\\Documents":["notes.txt","passwords.xlsx","projects"],"C:\\Users\\Admin\\Downloads":["setup.exe","report.pdf"],"C:\\Windows":["System32","SysWOW64","Temp","explorer.exe","notepad.exe"],"C:\\Windows\\System32":["cmd.exe","config","drivers","calc.exe","ntoskrnl.exe"],"C:\\Program Files":["Common Files","Internet Explorer","Windows Defender"]},linux:{"/root":["Readme.txt",".bashrc",".ssh","Desktop"],"/root/Desktop":["Readme.txt","exploit.py","nmap_scan.txt"],"/home/kali":["Downloads","Documents","tools"],"/home/kali/Desktop":["Readme.txt","notes.txt"],"/etc":["passwd","shadow","hosts","network","systemd"],"/var/log":["syslog","auth.log","apache2","journal"],"/bin":["bash","ls","cat","grep","nmap","msfconsole"]}},as=(C,E,R)=>{const O=R==="windows",D=O?"\\":"/",H=xt[R]||{};if(E==="~")return O?"C:\\Users\\Admin":"/root";if(E===".."){const n=C.split(D).filter(l=>l);return n.length>(O?1:0)?(n.pop(),O?n.join(D):n.length===0?"/":"/"+n.join(D)):O?C:"/"}if(E===".")return C;if(O&&E.match(/^[A-Z]:\\/i)||!O&&E.startsWith("/"))return H[E]?E:null;const r=(C.endsWith(D)?C:C+D)+E;return H[r]?r:null},ls=(C,E,R,O)=>{const D=[],H=C.toLowerCase(),M=R==="windows";if(!nt[R].includes(H))return M?[`'${C}' is not recognized as an internal or external command,`,"operable program or batch file."]:[`bash: ${C}: command not found`];if(H==="ipconfig"||H==="ifconfig"||H==="ip")M?(D.push("Windows IP Configuration"),D.push(""),D.push("Ethernet adapter Ethernet:"),D.push(`   Connection-specific DNS Suffix  . : ${oe.domain}`),D.push(`   IPv4 Address. . . . . . . . . . . : ${oe.ipAddress}`),D.push("   Subnet Mask . . . . . . . . . . . : 255.255.255.0"),D.push(`   Default Gateway . . . . . . . . . : ${oe.gateway}`)):(D.push("eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500"),D.push(`        inet ${oe.ipAddress}  netmask 255.255.255.0  broadcast 192.168.1.255`),D.push(`        ether ${oe.macAddress}  txqueuelen 1000  (Ethernet)`),D.push("        RX packets 45211  bytes 32.1 MiB"),D.push("        TX packets 12894  bytes 1.4 MiB"));else if(H==="netstat"||H==="ss")M?(D.push("Active Connections"),D.push("  Proto  Local Address          Foreign Address        State           PID"),D.push("  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       844"),D.push("  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4"),D.push(`  TCP    192.168.1.100:52411    ${oe.targetIP}:443       ESTABLISHED     3124`)):(D.push("Netid State      Recv-Q Send-Q Local Address:Port               Peer Address:Port"),D.push("tcp   LISTEN     0      128          0.0.0.0:22                         0.0.0.0:*"),D.push("tcp   LISTEN     0      80           0.0.0.0:80                         0.0.0.0:*"),D.push(`tcp   ESTAB      0      0      192.168.1.100:38422            ${oe.targetIP}:443`));else if(H==="ping"){const r=E[0]||"127.0.0.1";D.push(`Pinging ${r} with 32 bytes of data:`);for(let n=0;n<4;n++)D.push(`Reply from ${r}: bytes=32 time=${(Math.random()*20).toFixed(0)}ms TTL=64`)}else if(H==="whoami")M?E.includes("/all")?(D.push("USER INFORMATION"),D.push("----------------"),D.push(`User Name: ${oe.domain}\\${oe.currentUser}`),D.push("SID: S-1-5-21-3623811015-3361044348-30300820-1013"),D.push(""),D.push("PRIVILEGES INFORMATION"),D.push("----------------------"),D.push("SeShutdownPrivilege            Disabled"),D.push("SeChangeNotifyPrivilege         Enabled"),D.push("SeUndockPrivilege              Disabled")):D.push(`${oe.domain}\\${oe.currentUser}`):D.push("root");else if(H==="hostname")D.push(M?oe.hostname:"kali");else if(H==="tasklist"||H==="ps")M?(D.push("Image Name                     PID Session Name        Session#    Mem Usage"),D.push("========================= ======== ================ =========== ============"),D.push("System Idle Process              0 Services                   0          8 K"),D.push("System                           4 Services                   0        136 K"),D.push("lsass.exe                      748 Services                   0     12,420 K"),D.push("svchost.exe                    844 Services                   0     24,512 K"),D.push("explorer.exe                  3124 Console                    1     84,210 K")):(D.push("PID TTY          TIME CMD"),D.push("  1 ?        00:00:02 systemd"),D.push(" 234 ?        00:00:00 sshd"),D.push("1234 pts/0    00:00:00 zsh"),D.push("1567 pts/0    00:00:00 ps"));else if(H==="systeminfo"||H==="uname"||H==="lsb_release")M?(D.push(`Host Name:                 ${oe.hostname}`),D.push("OS Name:                   Microsoft Windows 11 Enterprise"),D.push("OS Version:                10.0.22000 N/A Build 22000"),D.push("System Manufacturer:       InfoSecLabs VM"),D.push("Registered Owner:          Training Dept"),D.push("Hotfix(s):                 4 Hotfix(s) Installed.")):H==="lsb_release"?(D.push("Distributor ID: Kali"),D.push("Description:    Kali GNU/Linux Rolling"),D.push("Release:        2023.4"),D.push("Codename:       kali-rolling")):D.push("Linux kali 6.1.0-kali7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1kali1 x86_64 GNU/Linux");else if(H==="nmap"){const r=E.find(n=>!n.startsWith("-"))||oe.targetIP;D.push("Starting Nmap 7.93 at 2026-01-01 10:00 EST"),D.push(`Nmap scan report for ${r}`),D.push("PORT     STATE SERVICE  VERSION"),D.push("22/tcp   open  ssh      OpenSSH 8.9p1 Ubuntu"),D.push("80/tcp   open  http     Apache httpd 2.4.52"),D.push("443/tcp  open  ssl/http Apache httpd 2.4.52"),D.push("3389/tcp open  ms-wbt-server Microsoft Terminal Services"),D.push(""),D.push("Nmap done: 1 IP address (1 host up) scanned in 4.12 seconds")}else if(H==="wireshark")D.push("Starting Wireshark..."),D.push("(In this simulation, please use the desktop icon for the full GUI)");else if(H==="msfconsole")D.push("Metasploit Framework: v6.3.5-dev"),D.push('msf6 > (Type "help" for a list of commands)'),D.push("msf6 > use exploit/multi/handler"),D.push("msf6 exploit(multi/handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcp");else if(H==="ls"||H==="dir"){const n=(xt[R]||{})[O]||[];M&&H==="dir"?(D.push(` Directory of ${O}`),D.push(""),n.forEach(l=>D.push(`01/01/2026  10:00 AM    ${l.includes(".")?"    ":"<DIR>"}          ${l}`))):D.push(n.join("  "))}else if(H==="cd"){const r=E[0]||"~",n=as(O,r,R);return n?{output:[],newPath:n}:M?["The system cannot find the path specified."]:[`bash: cd: ${r}: No such file or directory`]}else if(H==="cat"||H==="type"){const r=E[0];if(!r)return[`Usage: ${H} <filename>`];r.toLowerCase().includes("manual")||r.toLowerCase().includes("readme")?(D.push("# LAB DOCUMENTATION"),D.push("This is the system manual. See VirtualDesktop for full content.")):D.push(`Contents of ${r}: [Mock Data]`)}else{if(H==="clear"||H==="cls")return{clear:!0};H==="help"&&(D.push(`AVAILABLE ${R.toUpperCase()} COMMANDS:`),D.push(nt[R].join(", ")))}return D},et=()=>{const C=Y.useRef(null),E=Y.useRef(null),R=Y.useRef(null),{osType:O,windows:D}=ue(),H=Y.useRef(""),M=Y.useRef(O==="windows"?"C:\\Users\\Admin":"/root");Y.useEffect(()=>{if(!C.current)return;const l=O==="windows",d=new ns.Terminal({cursorBlink:!0,cursorStyle:l?"bar":"block",fontFamily:'"Cascadia Code", "Fira Code", Consolas, "Courier New", monospace',fontSize:13,theme:l?{background:"#0c0c0c",foreground:"#cccccc",cursor:"#cccccc"}:{background:"#1a1b26",foreground:"#a9b1d6",cursor:"#c0caf5"},allowTransparency:!0}),o=new os.FitAddon;d.loadAddon(o);try{d.open(C.current),setTimeout(()=>{try{o.fit()}catch{}},50)}catch(p){console.error("XTERM OPEN ERROR:",p)}E.current=d,R.current=o,l?(d.write(`Windows PowerShell\r
Copyright (C) Microsoft Corporation. All rights reserved.\r
\r
`),d.write(`PS ${M.current}> `)):d.write(`\x1B[1;36m┌──(\x1B[1;34mroot@kali\x1B[1;36m)-[\x1B[0m~\x1B[1;36m]\r
└─# \x1B[0m`),d.onData(p=>{p==="\r"?(d.write(`\r
`),n(d,H.current),H.current=""):p===""?H.current.length>0&&(d.write("\b \b"),H.current=H.current.slice(0,-1)):(d.write(p),H.current+=p)});const u=()=>{try{o.fit()}catch{}};return window.addEventListener("resize",u),()=>{d.dispose(),window.removeEventListener("resize",u)}},[]),Y.useEffect(()=>{const l=setTimeout(()=>{try{R.current&&R.current.fit()}catch{}},100);return()=>clearTimeout(l)},[D]);const r=l=>{O==="windows"?l.write(`PS ${M.current}> `):l.write(`\x1B[1;36m┌──(\x1B[1;34mroot@kali\x1B[1;36m)-[\x1B[1;34m${M.current}\x1B[1;36m]\r
└─# \x1B[0m`)},n=(l,d)=>{const o=d.trim().split(" "),u=o[0].toLowerCase();if(u){const p=ls(u,o.slice(1),O,M.current);if(p.clear)l.clear();else{p.newPath&&(M.current=p.newPath);const g=p.output||p;Array.isArray(g)?g.forEach(f=>l.write(f+`\r
`)):typeof g=="string"&&l.write(g+`\r
`)}}r(l)};return S.jsx("div",{className:"flex-1 w-full bg-black/50 overflow-hidden",ref:C})},hs={HKLM:{SOFTWARE:{Microsoft:{Windows:{CurrentVersion:{Run:{SecurityHealth:"C:\\Windows\\system32\\SecurityHealthSystray.exe",OneDrive:"C:\\Program Files\\Microsoft OneDrive\\OneDrive.exe",MaliciousPersist:"C:\\Users\\Public\\bad.exe"}}}}}},HKCU:{ControlPanel:{Desktop:{Wallpaper:"C:\\Windows\\Web\\Wallpaper\\Theme1\\img1.jpg"}}}},Et=()=>{const[C,E]=Y.useState(null),[R,O]=Y.useState(""),[D]=Y.useState(hs),H=({node:M,name:r,currentPath:n})=>{const[l,d]=Y.useState(!1),o=Object.keys(M).some(g=>typeof M[g]=="object"),u=n?`${n}\\${r}`:r,p=g=>{g.stopPropagation(),E(M),O(u),d(!l)};return S.jsxs("div",{className:"pl-4 select-none",children:[S.jsxs("div",{className:`flex items-center gap-1 cursor-pointer hover:bg-blue-100 ${R===u?"bg-blue-200 border border-blue-300":""}`,onClick:p,children:[S.jsx("span",{className:"text-gray-500 w-4",children:o?l?"📂":"📁":"📄"}),S.jsx("span",{className:"text-sm",children:r})]}),l&&o&&S.jsx("div",{children:Object.keys(M).map(g=>typeof M[g]=="object"&&S.jsx(H,{node:M[g],name:g,currentPath:u},g))})]})};return S.jsxs("div",{className:"flex h-full flex-col font-sans text-xs",children:[S.jsxs("div",{className:"flex bg-white border-b p-1 gap-2",children:[S.jsx("span",{children:"File"}),S.jsx("span",{children:"Edit"}),S.jsx("span",{children:"View"}),S.jsx("span",{children:"Favorites"}),S.jsx("span",{children:"Help"})]}),S.jsxs("div",{className:"flex items-center border-b p-1 gap-2 bg-white",children:[S.jsx("span",{className:"text-gray-500",children:"Computer"}),S.jsx("input",{className:"flex-1 border p-0.5",value:R,readOnly:!0})]}),S.jsxs("div",{className:"flex flex-1 overflow-hidden bg-white",children:[S.jsxs("div",{className:"w-1/3 border-r overflow-auto p-2",children:[S.jsxs("div",{className:"flex items-center gap-1 font-bold",children:[S.jsx("span",{children:"🖥️"})," Computer"]}),Object.keys(D).map(M=>S.jsx(H,{node:D[M],name:M,currentPath:""},M))]}),S.jsx("div",{className:"flex-1 overflow-auto p-2 bg-white",children:S.jsxs("table",{className:"w-full text-left border-collapse",children:[S.jsx("thead",{children:S.jsxs("tr",{className:"border-b text-gray-500",children:[S.jsx("th",{className:"p-1 w-1/3",children:"Name"}),S.jsx("th",{className:"p-1 w-1/4",children:"Type"}),S.jsx("th",{className:"p-1",children:"Data"})]})}),S.jsxs("tbody",{children:[C&&Object.keys(C).map(M=>typeof C[M]!="object"&&S.jsxs("tr",{className:"hover:bg-blue-50",children:[S.jsx("td",{className:"p-1 text-red-600",children:M}),S.jsx("td",{className:"p-1 text-gray-500",children:"REG_SZ"}),S.jsx("td",{className:"p-1",children:C[M]})]},M)),(!C||!Object.keys(C).some(M=>typeof C[M]!="object"))&&S.jsxs("tr",{children:[S.jsx("td",{className:"p-1 text-red-600",children:"(Default)"}),S.jsx("td",{className:"p-1 text-gray-500",children:"REG_SZ"}),S.jsx("td",{className:"p-1",children:"(value not set)"})]})]})]})})]}),S.jsx("div",{className:"bg-gray-100 border-t p-1",children:"Ready"})]})},Me=({content:C})=>S.jsx("div",{className:"flex-1 w-full bg-[#1a1a1a] text-[#dcdcdc] p-6 overflow-y-auto selection:bg-blue-500/30",children:S.jsx("pre",{className:"font-mono text-sm whitespace-pre-wrap leading-relaxed",children:C})}),Be=()=>{const{osType:C,openWindow:E}=ue(),R=C==="windows",[O,D]=Y.useState(R?"This PC":"/home/kali"),H=`WINDOWS 11 SECURITY ANALYSIS MANUAL
====================================

Welcome to the Windows Incident Response Lab. 
This environment is optimized for investigating system state and user activity.

CORE CAPABILITIES:
- GUI Exploration: File Explorer for system auditing.
- PowerShell: Advanced command-line management and investigation.
- Registry: Deep system configuration and persistence checks.

ESSENTIAL SECURITY COMMANDS (Terminal):
- whoami /all    : View user SID, groups, and privileges.
- netstat -ano   : Monitor active network connections and PIDs.
- tasklist /svc  : Audit running processes and associated services.
- systeminfo     : Extract OS version, hardware, and hotfix data.
- net user <usr> : Inspect local user account configurations.
- sc query <svc> : Check status of specific system services.
- quser          : Identify all currently logged-in users.
- gpresult /r    : Audit applied Group Policy Objects (GPOs).
- dir /S /B      : Recursive file search for hidden indicators.`,M=`KALI LINUX OFFENSIVE SECURITY MANUAL
=====================================

Welcome to the Pentesting & Security Research Lab.
A specialized Kali Linux environment for offensive security operations.

CORE CAPABILITIES:
- Root Terminal: Full ZSH shell access with root privileges.
- Toolset: Integrated industry-standard security tools.
- File System: Comprehensive Linux directory structure simulation.

ESSENTIAL SECURITY COMMANDS (Terminal):
- lsb_release -a    : Confirm exact distribution and version.
- ss -atnp          : View socket statistics (sockets, ports, PIDs).
- find / -perm -4000: Search for SUID binaries (PrivEsc investigation).
- lsof -i           : Identify processes holding network sockets.
- grep -ri "pass" / : Recursive search for sensitive strings in configs.
- id                : Check current UID, GID, and group context.
- ps aux            : Comprehensive process tree and resource usage.
- systemctl status  : Audit status of system daemons and services.

SECURITY TOOLS (Terminal):
- nmap -sV -O <target>  : Service and OS fingerprinting scan.
- msfconsole            : Launch the Metasploit Framework.
- hydra -l usr -p pwd ..: Parallelized login cracker.
- nikto -h <host>       : Web server vulnerability scanner.
- john / hashcat        : Password and hash cracking utilities.`,r={windows:{Desktop:[{name:"Manual.txt",type:"file",size:"2 KB",action:()=>E("manual","Manual.txt",S.jsx(Me,{content:H}))},{name:"Welcome.txt",type:"file",size:"1 KB"},{name:"Evidence.pcap",type:"file",size:"2.4 MB"}],Documents:[{name:"Report.docx",type:"file",size:"15 KB"},{name:"Notes",type:"folder"}],Downloads:[{name:"installer.exe",type:"file",size:"45 MB"}],"This PC":[{name:"Desktop",type:"folder"},{name:"Documents",type:"folder"},{name:"Downloads",type:"folder"},{name:"Local Disk (C:)",type:"drive",size:"450 GB free"}],"Local Disk (C:)":[{name:"Users",type:"folder"},{name:"Windows",type:"folder"},{name:"Program Files",type:"folder"}]},linux:{"/":[{name:"home",type:"folder"},{name:"etc",type:"folder"},{name:"var",type:"folder"},{name:"root",type:"folder"}],"/home":[{name:"kali",type:"folder"}],"/home/kali":[{name:"Desktop",type:"folder"},{name:"Downloads",type:"folder"},{name:"Documents",type:"folder"},{name:"tools",type:"folder"}],"/home/kali/Desktop":[{name:"Readme.txt",type:"file",size:"2 KB",action:()=>E("manual","Readme.txt",S.jsx(Me,{content:M}))},{name:"exploit.py",type:"file"},{name:"notes.txt",type:"file"}]}},n=()=>(R?r.windows:r.linux)[O]||[],l=e=>{if(e.type==="folder"||e.type==="drive")if(R)D(e.name);else{const i=O==="/"?`/${e.name}`:`${O}/${e.name}`;D(i)}else e.action&&e.action()},d=()=>{if(R)D("This PC");else{const e=O.split("/").filter(Boolean);e.length<=1?D("/"):D("/"+e.slice(0,-1).join("/"))}},o=R?"bg-[#f3f3f3]":"bg-[#2b2b2b]",u=R?"bg-[#f0f0f0]":"bg-[#1f1f1f]",p=R?"bg-white":"bg-[#2b2b2b]",g=R?"text-black":"text-white",f=R?"border-gray-200":"border-gray-700";return S.jsxs("div",{className:`flex flex-col h-full w-full ${o} ${g} text-sm overflow-hidden select-none`,children:[S.jsxs("div",{className:`h-11 border-b ${f} flex items-center px-3 gap-3 bg-white/50 backdrop-blur-sm`,children:[S.jsx("button",{onClick:d,className:"p-1.5 rounded-md hover:bg-black/5 active:bg-black/10 transition-colors",children:S.jsx(Wt,{size:18})}),S.jsxs("div",{className:`flex-1 border ${f} rounded-md px-3 py-1.5 flex items-center bg-white shadow-sm ${!R&&"bg-[#3b3b3b] border-none"}`,children:[R&&S.jsx(Ve,{size:14,className:"mr-2 text-blue-500"}),S.jsx("span",{className:"font-medium truncate opacity-80",children:O})]}),S.jsxs("div",{className:`w-48 border ${f} rounded-md px-3 py-1.5 flex items-center bg-white shadow-sm ${!R&&"bg-[#3b3b3b] border-none hidden sm:flex"}`,children:[S.jsx(Pe,{size:14,className:"mr-2 opacity-40"}),S.jsx("span",{className:"opacity-40",children:"Search"})]})]}),S.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[S.jsxs("div",{className:`w-44 border-r ${f} ${u} p-3 flex flex-col gap-1.5`,children:[S.jsx("div",{className:"font-bold mb-2 px-2 text-[10px] uppercase tracking-widest opacity-40",children:"Quick Access"}),S.jsxs("div",{className:`flex items-center gap-2.5 px-3 py-2 rounded-lg cursor-pointer transition-colors ${O.includes("Desktop")?R?"bg-blue-500/10 text-blue-600":"bg-white/10":"hover:bg-black/5"}`,onClick:()=>D(R?"Desktop":"/home/kali/Desktop"),children:[S.jsx(Ve,{size:16,className:R?"text-blue-500":"text-blue-400"}),S.jsx("span",{className:"font-medium",children:"Desktop"})]}),S.jsxs("div",{className:`flex items-center gap-2.5 px-3 py-2 rounded-lg cursor-pointer transition-colors ${O.includes("Downloads")?R?"bg-blue-500/10 text-blue-600":"bg-white/10":"hover:bg-black/5"}`,onClick:()=>D(R?"Downloads":"/home/kali/Downloads"),children:[S.jsx(Ut,{size:16,className:R?"text-green-600":"text-green-400"}),S.jsx("span",{className:"font-medium",children:"Downloads"})]}),S.jsx("div",{className:"h-[1px] bg-black/5 my-2"}),S.jsxs("div",{className:`flex items-center gap-2.5 px-3 py-2 rounded-lg cursor-pointer transition-colors ${O==="This PC"||O==="/"?R?"bg-blue-500/10 text-blue-600":"bg-white/10":"hover:bg-black/5"}`,onClick:()=>D(R?"This PC":"/"),children:[S.jsx(Ye,{size:16,className:"text-slate-500"}),S.jsx("span",{className:"font-medium",children:R?"This PC":"File System"})]})]}),S.jsx("div",{className:`flex-1 ${p} p-5 overflow-y-auto`,children:S.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-4",children:n().map((e,i)=>S.jsxs("div",{className:"flex flex-col items-center gap-2 p-3 rounded-xl cursor-pointer border border-transparent transition-all hover:bg-black/5 active:scale-95 group",onDoubleClick:t=>{t.stopPropagation(),l(e)},children:[S.jsxs("div",{className:"relative",children:[e.type==="folder"||e.type==="drive"?S.jsx(Qe,{size:48,className:R?"text-yellow-500 fill-yellow-500/20":"text-blue-400 fill-blue-400/20"}):S.jsx(Te,{size:48,className:"text-slate-400"}),e.type==="drive"&&S.jsx("div",{className:"absolute -bottom-1 -right-1 bg-green-500 w-3 h-3 rounded-full border-2 border-white"})]}),S.jsx("span",{className:"text-center text-[11px] font-medium break-all line-clamp-2 px-1",children:e.name})]},i))})})]}),S.jsx("div",{className:`h-7 border-t ${f} ${o} px-4 flex items-center justify-between text-[10px] uppercase tracking-widest opacity-50`,children:S.jsxs("div",{children:[n().length," items"]})})]})},cs=()=>{const C=It(),{setStartMenuOpen:E,openWindow:R}=ue(),[O,D]=Y.useState(""),H=[{id:"terminal",name:"Terminal",icon:Ze,color:"text-blue-400",component:S.jsx(et,{}),title:"Terminal"},{id:"explorer",name:"Explorer",icon:Qe,color:"text-yellow-400",component:S.jsx(Be,{}),title:"File Explorer"},{id:"regedit",name:"Regedit",icon:gt,color:"text-blue-300",component:S.jsx(Et,{}),title:"Registry Editor"},{id:"edge",name:"Browser",icon:$t,color:"text-blue-500"},{id:"settings",name:"Settings",icon:Xe,color:"text-gray-400"},{id:"defender",name:"Security",icon:Je,color:"text-purple-400"}],M=[{id:"rec1",name:"Mission_Brief.docx",icon:Te,sub:"Recently added"},{id:"rec2",name:"Lab_Notes.txt",icon:Te,sub:"2h ago"}],r=l=>{l.component&&R(l.id,l.title||l.name,l.component),E(!1)},n=H.filter(l=>l.name.toLowerCase().includes(O.toLowerCase()));return S.jsxs("div",{className:"fixed bottom-14 left-1/2 -translate-x-1/2 w-[540px] h-[600px] bg-[#1c1c1c]/90 backdrop-blur-3xl rounded-[1.25rem] shadow-[0_20px_50px_rgba(0,0,0,0.6)] border border-white/10 flex flex-col overflow-hidden z-[2000] animate-in slide-in-from-bottom-5 fade-in duration-300",children:[S.jsx("div",{className:"p-8 pb-4",children:S.jsxs("div",{className:"relative group",children:[S.jsx("div",{className:"absolute inset-0 bg-blue-500/10 rounded-full blur-md opacity-0 group-focus-within:opacity-100 transition-opacity"}),S.jsx(Pe,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-white/40 group-focus-within:text-blue-400 transition-colors",size:16}),S.jsx("input",{type:"text",placeholder:"Search for apps, settings, and documents",className:"w-full bg-[#2d2d2d]/80 text-white text-sm pl-11 pr-4 py-2.5 rounded-full border border-white/5 focus:outline-none focus:border-blue-500/50 focus:bg-[#2d2d2d] transition-all",value:O,onChange:l=>D(l.target.value),autoFocus:!0})]})}),S.jsxs("div",{className:"flex-1 overflow-y-auto px-10 py-2",children:[S.jsxs("div",{className:"flex justify-between items-center mb-6 px-2",children:[S.jsx("h3",{className:"text-[13px] font-bold text-white/90",children:"Pinned"}),S.jsx("button",{className:"text-[11px] font-bold bg-white/5 hover:bg-white/10 px-3 py-1 rounded-md border border-white/5 transition-colors text-white/70",children:"All apps >"})]}),S.jsx("div",{className:"grid grid-cols-6 gap-y-6 mb-10",children:n.map(l=>S.jsxs("button",{className:"flex flex-col items-center gap-2 p-2 hover:bg-white/5 rounded-xl transition-all group active:scale-90",onClick:()=>r(l),children:[S.jsx("div",{className:"w-11 h-11 bg-[#2d2d2d] rounded-xl flex items-center justify-center border border-white/5 shadow-lg group-hover:border-white/20 transition-all",children:S.jsx(l.icon,{size:22,className:l.color})}),S.jsx("span",{className:"text-[11px] text-white/80 font-medium group-hover:text-white transition-colors",children:l.name})]},l.id))}),S.jsxs("div",{className:"px-2",children:[S.jsx("h3",{className:"text-[13px] font-bold text-white/90 mb-4",children:"Recommended"}),S.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:M.map(l=>S.jsxs("div",{className:"flex items-center gap-3 p-3 hover:bg-white/5 rounded-xl cursor-default group transition-colors",children:[S.jsx("div",{className:"p-2.5 bg-[#2d2d2d] rounded-lg border border-white/5",children:S.jsx(l.icon,{size:18,className:"text-white/60"})}),S.jsxs("div",{className:"flex flex-col min-w-0",children:[S.jsx("span",{className:"text-[12px] font-bold text-white/90 truncate",children:l.name}),S.jsx("span",{className:"text-[10px] text-white/40 font-medium",children:l.sub})]})]},l.id))})]})]}),S.jsxs("div",{className:"bg-black/20 backdrop-blur-md px-10 py-5 flex justify-between items-center border-t border-white/5",children:[S.jsxs("button",{className:"flex items-center gap-3 hover:bg-white/5 p-2 pr-4 rounded-xl transition-colors group",children:[S.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-blue-500 to-purple-500 rounded-full flex items-center justify-center text-white shadow-lg group-hover:scale-105 transition-transform",children:S.jsx(ct,{size:16})}),S.jsxs("div",{className:"flex flex-col items-start leading-tight",children:[S.jsx("span",{className:"text-[12px] font-bold text-white/90",children:"Jacob Analyst"}),S.jsx("span",{className:"text-[9px] text-white/40 font-bold uppercase tracking-tighter",children:"Level 16 SOC"})]})]}),S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx("button",{className:"p-3 hover:bg-white/5 rounded-xl text-white/60 hover:text-white transition-all",title:"Settings",children:S.jsx(Xe,{size:18})}),S.jsx("button",{onClick:()=>C("/dashboard"),className:"p-3 hover:bg-red-500/10 rounded-xl text-white/60 hover:text-red-400 transition-all group",title:"Disconnect Session",children:S.jsx(mt,{size:18})})]})]})]})},ds=()=>{const{windows:C,activeWindowId:E,startMenuOpen:R,setStartMenuOpen:O,focusWindow:D,minimizeWindow:H,openWindow:M}=ue(),[r,n]=Y.useState(new Date);Y.useEffect(()=>{const d=setInterval(()=>n(new Date),1e3);return()=>clearInterval(d)},[]);const l=[{id:"explorer",title:"File Explorer",icon:Qe,color:"text-yellow-500",action:()=>M("explorer","File Explorer",S.jsx(Be,{}))},{id:"terminal",title:"Terminal",icon:Ze,color:"text-blue-400",action:()=>M("terminal","Terminal",S.jsx(et,{}))},{id:"regedit",title:"Registry Editor",icon:gt,color:"text-blue-300",action:()=>M("regedit","Registry Editor",S.jsx(Et,{}))},{id:"search",title:"Search",icon:Pe,color:"text-gray-400",action:()=>O(!0)}];return S.jsxs(S.Fragment,{children:[R&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"fixed inset-0 z-[1999]",onClick:()=>O(!1)}),S.jsx(cs,{})]}),S.jsxs("div",{className:"h-12 bg-[#1f1f1f]/85 backdrop-blur-2xl border-t border-white/10 flex items-center justify-between px-3 fixed bottom-0 w-full z-[1000] select-none shadow-[0_-4px_20px_rgba(0,0,0,0.5)]",children:[S.jsx("div",{className:"flex-1 hidden md:flex items-center gap-1",children:S.jsx("div",{className:"p-2 hover:bg-white/5 rounded-md transition-colors cursor-default text-white/40 text-[10px]",children:S.jsx(Je,{size:14,className:"mb-1"})})}),S.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 flex items-center gap-0.5 h-full",children:[S.jsx("button",{onClick:()=>O(!R),className:`p-2.5 hover:bg-white/10 rounded-md transition-all duration-200 active:scale-95 group ${R?"bg-white/10 shadow-inner":""}`,title:"Start",children:S.jsxs("div",{className:"grid grid-cols-2 gap-[1.5px] transition-transform group-hover:rotate-[5deg]",children:[S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-[1px]"}),S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-[1px]"}),S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-[1px]"}),S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-[1px]"})]})}),l.map(d=>S.jsxs("button",{className:"p-2.5 hover:bg-white/10 rounded-md transition-all active:scale-90 relative group",onClick:d.action,title:d.title,children:[S.jsx(d.icon,{size:22,className:d.color}),S.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-0 h-[3px] bg-blue-400 rounded-full transition-all group-hover:w-4"}),S.jsx("div",{className:"absolute -top-12 left-1/2 -translate-x-1/2 bg-[#2d2d2d]/95 backdrop-blur-md text-white text-[11px] px-2.5 py-1.5 rounded-lg border border-white/10 opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none shadow-xl",children:d.title})]},d.id)),S.jsx("div",{className:"w-[1px] h-6 bg-white/10 mx-1"}),C.map(d=>S.jsxs("button",{onClick:()=>d.id===E&&!d.isMinimized?H(d.id):D(d.id),className:`p-2.5 rounded-md transition-all relative flex items-center justify-center active:scale-90 ${d.id===E&&!d.isMinimized?"bg-white/10":"hover:bg-white/5"}`,title:d.title,children:[S.jsx("div",{className:"w-6 h-6 bg-gradient-to-br from-gray-600 to-gray-800 rounded flex items-center justify-center text-[10px] font-black text-white overflow-hidden shadow-lg border border-white/5",children:d.title.slice(0,1)}),S.jsx("div",{className:`absolute -bottom-1 w-[4px] h-[4px] rounded-full transition-all ${d.id===E&&!d.isMinimized?"bg-blue-400 w-3 shadow-[0_0_8px_rgba(96,165,250,0.8)]":"bg-gray-500 w-1.5"}`})]},d.id))]}),S.jsxs("div",{className:"flex-1 flex items-center justify-end gap-1.5 h-full",children:[S.jsxs("div",{className:"flex items-center gap-2 px-2 hover:bg-white/5 rounded-md py-1 transition-colors cursor-default border border-transparent hover:border-white/5",children:[S.jsx(dt,{size:16,className:"text-white/80"}),S.jsx(St,{size:16,className:"text-white/80"}),S.jsx(vt,{size:16,className:"text-emerald-400"})]}),S.jsxs("div",{className:"flex flex-col items-end px-2 hover:bg-white/5 rounded-md py-1 transition-colors cursor-default border border-transparent hover:border-white/5",children:[S.jsx("span",{className:"text-[11px] text-white font-semibold",children:r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}),S.jsx("span",{className:"text-[9px] text-white/50 font-bold uppercase tracking-tighter",children:r.toLocaleDateString([],{month:"2-digit",day:"2-digit",year:"numeric"})})]}),S.jsx("div",{className:"w-[1.5px] h-full bg-white/5 hover:bg-white/20 transition-colors cursor-pointer self-stretch ml-1"})]})]})]})},us=()=>{const{osType:C}=ue(),[E,R]=Y.useState(new Date);Y.useEffect(()=>{const H=setInterval(()=>R(new Date),1e3);return()=>clearInterval(H)},[]);const O=H=>H.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),D=H=>H.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"});return C==="windows"?S.jsxs("div",{className:"absolute top-0 left-0 right-0 h-7 bg-black/40 backdrop-blur-md text-white/50 text-[10px] flex items-center justify-between px-4 z-[2000] border-b border-white/5 opacity-0 hover:opacity-100 transition-opacity",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"File"}),S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"Machine"}),S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"View"}),S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"Input"}),S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"Devices"}),S.jsx("span",{className:"font-bold hover:text-white cursor-pointer",children:"Help"})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:"font-mono text-[9px] bg-red-500/20 text-red-300 px-2 py-0.5 rounded border border-red-500/30",children:"REC: Jacob_Session_04"}),S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx(Ve,{size:10}),S.jsx("span",{children:"Windows 11 SIM (60 FPS)"})]})]})]}):S.jsxs("div",{className:"absolute top-0 left-0 right-0 h-8 bg-[#0d0d0d] text-gray-300 text-xs flex items-center justify-between px-2 z-50 border-b border-white/5 shadow-2xl",children:[S.jsxs("div",{className:"flex items-center h-full",children:[S.jsxs("div",{className:"flex items-center gap-2 cursor-default hover:bg-white/10 h-full px-3 transition-colors group",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 text-[#367bf0] group-hover:scale-110 transition-transform",fill:"currentColor",children:S.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"})})}),S.jsx("span",{className:"font-black text-white uppercase tracking-tighter",children:"Applications"})]}),S.jsx("div",{className:"h-4 w-[1px] bg-white/10 mx-1"}),S.jsx("div",{className:"flex items-center gap-1 hover:bg-white/10 h-full px-3 transition-colors cursor-default",children:S.jsx("span",{className:"font-semibold",children:"Places"})})]}),S.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 flex items-center gap-2 hover:bg-white/10 h-full px-4 rounded transition-colors cursor-default",children:[S.jsx("span",{className:"font-mono text-gray-400 opacity-80",children:D(E)}),S.jsx("span",{className:"font-mono font-black text-white tracking-widest",children:O(E)})]}),S.jsxs("div",{className:"flex items-center h-full gap-0.5",children:[S.jsxs("div",{className:"flex items-center gap-3 hover:bg-white/10 h-full px-3 transition-colors cursor-default",children:[S.jsx(dt,{size:14,className:"text-emerald-400"}),S.jsx(St,{size:14,className:"text-gray-400"}),S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx(vt,{size:14,className:"text-gray-400"}),S.jsx("span",{className:"text-[10px] font-bold",children:"88%"})]})]}),S.jsx("div",{className:"h-4 w-[1px] bg-white/10 mx-1"}),S.jsxs("div",{className:"flex items-center gap-2 hover:bg-white/10 h-full px-3 transition-colors cursor-default group",children:[S.jsx("div",{className:"w-5 h-5 bg-gradient-to-br from-blue-600 to-blue-800 rounded-md flex items-center justify-center border border-white/10 shadow-lg",children:S.jsx(ct,{size:12,className:"text-white"})}),S.jsx("span",{className:"font-bold text-white/90",children:"root"}),S.jsx(_t,{size:12,className:"text-white/40 group-hover:text-white"})]}),S.jsx("div",{className:"hover:bg-red-500/20 hover:text-red-400 text-white/40 h-full px-3 flex items-center transition-colors cursor-pointer",children:S.jsx(mt,{size:14})})]})]})};var Oe={exports:{}},kt={};const fs=jt(Nt);var ee={},fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.dontSetMe=ms;fe.findInArray=_s;fe.int=gs;fe.isFunction=ps;fe.isNum=vs;function _s(C,E){for(let R=0,O=C.length;R<O;R++)if(E.apply(E,[C[R],R,C]))return C[R]}function ps(C){return typeof C=="function"||Object.prototype.toString.call(C)==="[object Function]"}function vs(C){return typeof C=="number"&&!isNaN(C)}function gs(C){return parseInt(C,10)}function ms(C,E,R){if(C[E])return new Error(`Invalid prop ${E} passed to ${R} - do not set this, set it on the child.`)}var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.browserPrefixToKey=Lt;Se.browserPrefixToStyle=Ss;Se.default=void 0;Se.getPrefix=Dt;const ze=["Moz","Webkit","O","ms"];function Dt(){var R,O;let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const E=(O=(R=window.document)==null?void 0:R.documentElement)==null?void 0:O.style;if(!E||C in E)return"";for(let D=0;D<ze.length;D++)if(Lt(C,ze[D])in E)return ze[D];return""}function Lt(C,E){return E?`${E}${bs(C)}`:C}function Ss(C,E){return E?`-${E.toLowerCase()}-${C}`:C}function bs(C){let E="",R=!0;for(let O=0;O<C.length;O++)R?(E+=C[O].toUpperCase(),R=!1):C[O]==="-"?R=!0:E+=C[O];return E}Se.default=Dt();Object.defineProperty(ee,"__esModule",{value:!0});ee.addClassName=Tt;ee.addEvent=Cs;ee.addUserSelectStyles=Bs;ee.createCSSTransform=Rs;ee.createSVGTransform=As;ee.getTouch=Ts;ee.getTouchIdentifier=Ms;ee.getTranslation=tt;ee.innerHeight=ks;ee.innerWidth=Ds;ee.matchesSelector=At;ee.matchesSelectorAndParentsTo=ws;ee.offsetXYFromParent=Ls;ee.outerHeight=xs;ee.outerWidth=Es;ee.removeClassName=Mt;ee.removeEvent=ys;ee.scheduleRemoveUserSelectStyles=Ps;var le=fe,ot=Rt(Se);function Rt(C,E){if(typeof WeakMap=="function")var R=new WeakMap,O=new WeakMap;return(Rt=function(D,H){if(!H&&D&&D.__esModule)return D;var M,r,n={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return n;if(M=H?O:R){if(M.has(D))return M.get(D);M.set(D,n)}for(const l in D)l!=="default"&&{}.hasOwnProperty.call(D,l)&&((r=(M=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,l))&&(r.get||r.set)?M(n,l,r):n[l]=D[l]);return n})(C,E)}let Ae="";function At(C,E){return Ae||(Ae=(0,le.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,le.isFunction)(C[R])})),(0,le.isFunction)(C[Ae])?C[Ae](E):!1}function ws(C,E,R){let O=C;do{if(At(O,E))return!0;if(O===R)return!1;O=O.parentNode}while(O);return!1}function Cs(C,E,R,O){if(!C)return;const D={capture:!0,...O};C.addEventListener?C.addEventListener(E,R,D):C.attachEvent?C.attachEvent("on"+E,R):C["on"+E]=R}function ys(C,E,R,O){if(!C)return;const D={capture:!0,...O};C.removeEventListener?C.removeEventListener(E,R,D):C.detachEvent?C.detachEvent("on"+E,R):C["on"+E]=null}function xs(C){let E=C.clientHeight;const R=C.ownerDocument.defaultView.getComputedStyle(C);return E+=(0,le.int)(R.borderTopWidth),E+=(0,le.int)(R.borderBottomWidth),E}function Es(C){let E=C.clientWidth;const R=C.ownerDocument.defaultView.getComputedStyle(C);return E+=(0,le.int)(R.borderLeftWidth),E+=(0,le.int)(R.borderRightWidth),E}function ks(C){let E=C.clientHeight;const R=C.ownerDocument.defaultView.getComputedStyle(C);return E-=(0,le.int)(R.paddingTop),E-=(0,le.int)(R.paddingBottom),E}function Ds(C){let E=C.clientWidth;const R=C.ownerDocument.defaultView.getComputedStyle(C);return E-=(0,le.int)(R.paddingLeft),E-=(0,le.int)(R.paddingRight),E}function Ls(C,E,R){const D=E===E.ownerDocument.body?{left:0,top:0}:E.getBoundingClientRect(),H=(C.clientX+E.scrollLeft-D.left)/R,M=(C.clientY+E.scrollTop-D.top)/R;return{x:H,y:M}}function Rs(C,E){const R=tt(C,E,"px");return{[(0,ot.browserPrefixToKey)("transform",ot.default)]:R}}function As(C,E){return tt(C,E,"")}function tt(C,E,R){let{x:O,y:D}=C,H=`translate(${O}${R},${D}${R})`;if(E){const M=`${typeof E.x=="string"?E.x:E.x+R}`,r=`${typeof E.y=="string"?E.y:E.y+R}`;H=`translate(${M}, ${r})`+H}return H}function Ts(C,E){return C.targetTouches&&(0,le.findInArray)(C.targetTouches,R=>E===R.identifier)||C.changedTouches&&(0,le.findInArray)(C.changedTouches,R=>E===R.identifier)}function Ms(C){if(C.targetTouches&&C.targetTouches[0])return C.targetTouches[0].identifier;if(C.changedTouches&&C.changedTouches[0])return C.changedTouches[0].identifier}function Bs(C){if(!C)return;let E=C.getElementById("react-draggable-style-el");E||(E=C.createElement("style"),E.type="text/css",E.id="react-draggable-style-el",E.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,E.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,C.getElementsByTagName("head")[0].appendChild(E)),C.body&&Tt(C.body,"react-draggable-transparent-selection")}function Ps(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{at(C)}):at(C)}function at(C){if(C)try{if(C.body&&Mt(C.body,"react-draggable-transparent-selection"),C.selection)C.selection.empty();else{const E=(C.defaultView||window).getSelection();E&&E.type!=="Caret"&&E.removeAllRanges()}}catch{}}function Tt(C,E){C.classList?C.classList.add(E):C.className.match(new RegExp(`(?:^|\\s)${E}(?!\\S)`))||(C.className+=` ${E}`)}function Mt(C,E){C.classList?C.classList.remove(E):C.className=C.className.replace(new RegExp(`(?:^|\\s)${E}(?!\\S)`,"g"),"")}var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.canDragX=js;_e.canDragY=Ns;_e.createCoreData=Fs;_e.createDraggableData=Ws;_e.getBoundPosition=Os;_e.getControlPosition=Hs;_e.snapToGrid=Is;var ae=fe,we=ee;function Os(C,E,R){if(!C.props.bounds)return[E,R];let{bounds:O}=C.props;O=typeof O=="string"?O:Us(O);const D=st(C);if(typeof O=="string"){const{ownerDocument:H}=D,M=H.defaultView;let r;if(O==="parent"?r=D.parentNode:r=D.getRootNode().querySelector(O),!(r instanceof M.HTMLElement))throw new Error('Bounds selector "'+O+'" could not find an element.');const n=r,l=M.getComputedStyle(D),d=M.getComputedStyle(n);O={left:-D.offsetLeft+(0,ae.int)(d.paddingLeft)+(0,ae.int)(l.marginLeft),top:-D.offsetTop+(0,ae.int)(d.paddingTop)+(0,ae.int)(l.marginTop),right:(0,we.innerWidth)(n)-(0,we.outerWidth)(D)-D.offsetLeft+(0,ae.int)(d.paddingRight)-(0,ae.int)(l.marginRight),bottom:(0,we.innerHeight)(n)-(0,we.outerHeight)(D)-D.offsetTop+(0,ae.int)(d.paddingBottom)-(0,ae.int)(l.marginBottom)}}return(0,ae.isNum)(O.right)&&(E=Math.min(E,O.right)),(0,ae.isNum)(O.bottom)&&(R=Math.min(R,O.bottom)),(0,ae.isNum)(O.left)&&(E=Math.max(E,O.left)),(0,ae.isNum)(O.top)&&(R=Math.max(R,O.top)),[E,R]}function Is(C,E,R){const O=Math.round(E/C[0])*C[0],D=Math.round(R/C[1])*C[1];return[O,D]}function js(C){return C.props.axis==="both"||C.props.axis==="x"}function Ns(C){return C.props.axis==="both"||C.props.axis==="y"}function Hs(C,E,R){const O=typeof E=="number"?(0,we.getTouch)(C,E):null;if(typeof E=="number"&&!O)return null;const D=st(R),H=R.props.offsetParent||D.offsetParent||D.ownerDocument.body;return(0,we.offsetXYFromParent)(O||C,H,R.props.scale)}function Fs(C,E,R){const O=!(0,ae.isNum)(C.lastX),D=st(C);return O?{node:D,deltaX:0,deltaY:0,lastX:E,lastY:R,x:E,y:R}:{node:D,deltaX:E-C.lastX,deltaY:R-C.lastY,lastX:C.lastX,lastY:C.lastY,x:E,y:R}}function Ws(C,E){const R=C.props.scale;return{node:E.node,x:C.state.x+E.deltaX/R,y:C.state.y+E.deltaY/R,deltaX:E.deltaX/R,deltaY:E.deltaY/R,lastX:C.state.x,lastY:C.state.y}}function Us(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function st(C){const E=C.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}var Ie={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.default=$s;function $s(){}Object.defineProperty(Ie,"__esModule",{value:!0});Ie.default=void 0;var Ke=Bt(Y),ie=it(ut),zs=it(ht),se=ee,ge=_e,qe=fe,De=it(je);function it(C){return C&&C.__esModule?C:{default:C}}function Bt(C,E){if(typeof WeakMap=="function")var R=new WeakMap,O=new WeakMap;return(Bt=function(D,H){if(!H&&D&&D.__esModule)return D;var M,r,n={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return n;if(M=H?O:R){if(M.has(D))return M.get(D);M.set(D,n)}for(const l in D)l!=="default"&&{}.hasOwnProperty.call(D,l)&&((r=(M=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,l))&&(r.get||r.set)?M(n,l,r):n[l]=D[l]);return n})(C,E)}function re(C,E,R){return(E=Ks(E))in C?Object.defineProperty(C,E,{value:R,enumerable:!0,configurable:!0,writable:!0}):C[E]=R,C}function Ks(C){var E=qs(C,"string");return typeof E=="symbol"?E:E+""}function qs(C,E){if(typeof C!="object"||!C)return C;var R=C[Symbol.toPrimitive];if(R!==void 0){var O=R.call(C,E);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(C)}const ce={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let me=ce.mouse,Ne=class extends Ke.Component{constructor(){super(...arguments),re(this,"dragging",!1),re(this,"lastX",NaN),re(this,"lastY",NaN),re(this,"touchIdentifier",null),re(this,"mounted",!1),re(this,"handleDragStart",E=>{if(this.props.onMouseDown(E),!this.props.allowAnyClick&&typeof E.button=="number"&&E.button!==0)return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:O}=R;if(this.props.disabled||!(E.target instanceof O.defaultView.Node)||this.props.handle&&!(0,se.matchesSelectorAndParentsTo)(E.target,this.props.handle,R)||this.props.cancel&&(0,se.matchesSelectorAndParentsTo)(E.target,this.props.cancel,R))return;E.type==="touchstart"&&!this.props.allowMobileScroll&&E.preventDefault();const D=(0,se.getTouchIdentifier)(E);this.touchIdentifier=D;const H=(0,ge.getControlPosition)(E,D,this);if(H==null)return;const{x:M,y:r}=H,n=(0,ge.createCoreData)(this,M,r);(0,De.default)("DraggableCore: handleDragStart: %j",n),(0,De.default)("calling",this.props.onStart),!(this.props.onStart(E,n)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,se.addUserSelectStyles)(O),this.dragging=!0,this.lastX=M,this.lastY=r,(0,se.addEvent)(O,me.move,this.handleDrag),(0,se.addEvent)(O,me.stop,this.handleDragStop))}),re(this,"handleDrag",E=>{const R=(0,ge.getControlPosition)(E,this.touchIdentifier,this);if(R==null)return;let{x:O,y:D}=R;if(Array.isArray(this.props.grid)){let r=O-this.lastX,n=D-this.lastY;if([r,n]=(0,ge.snapToGrid)(this.props.grid,r,n),!r&&!n)return;O=this.lastX+r,D=this.lastY+n}const H=(0,ge.createCoreData)(this,O,D);if((0,De.default)("DraggableCore: handleDrag: %j",H),this.props.onDrag(E,H)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(n)}return}this.lastX=O,this.lastY=D}),re(this,"handleDragStop",E=>{if(!this.dragging)return;const R=(0,ge.getControlPosition)(E,this.touchIdentifier,this);if(R==null)return;let{x:O,y:D}=R;if(Array.isArray(this.props.grid)){let n=O-this.lastX||0,l=D-this.lastY||0;[n,l]=(0,ge.snapToGrid)(this.props.grid,n,l),O=this.lastX+n,D=this.lastY+l}const H=(0,ge.createCoreData)(this,O,D);if(this.props.onStop(E,H)===!1||this.mounted===!1)return!1;const r=this.findDOMNode();r&&this.props.enableUserSelectHack&&(0,se.scheduleRemoveUserSelectStyles)(r.ownerDocument),(0,De.default)("DraggableCore: handleDragStop: %j",H),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,r&&((0,De.default)("DraggableCore: Removing handlers"),(0,se.removeEvent)(r.ownerDocument,me.move,this.handleDrag),(0,se.removeEvent)(r.ownerDocument,me.stop,this.handleDragStop))}),re(this,"onMouseDown",E=>(me=ce.mouse,this.handleDragStart(E))),re(this,"onMouseUp",E=>(me=ce.mouse,this.handleDragStop(E))),re(this,"onTouchStart",E=>(me=ce.touch,this.handleDragStart(E))),re(this,"onTouchEnd",E=>(me=ce.touch,this.handleDragStop(E)))}componentDidMount(){this.mounted=!0;const E=this.findDOMNode();E&&(0,se.addEvent)(E,ce.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const E=this.findDOMNode();if(E){const{ownerDocument:R}=E;(0,se.removeEvent)(R,ce.mouse.move,this.handleDrag),(0,se.removeEvent)(R,ce.touch.move,this.handleDrag),(0,se.removeEvent)(R,ce.mouse.stop,this.handleDragStop),(0,se.removeEvent)(R,ce.touch.stop,this.handleDragStop),(0,se.removeEvent)(E,ce.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,se.scheduleRemoveUserSelectStyles)(R)}}findDOMNode(){var E,R,O;return(E=this.props)!=null&&E.nodeRef?(O=(R=this.props)==null?void 0:R.nodeRef)==null?void 0:O.current:zs.default.findDOMNode(this)}render(){return Ke.cloneElement(Ke.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ie.default=Ne;re(Ne,"displayName","DraggableCore");re(Ne,"propTypes",{allowAnyClick:ie.default.bool,allowMobileScroll:ie.default.bool,children:ie.default.node.isRequired,disabled:ie.default.bool,enableUserSelectHack:ie.default.bool,offsetParent:function(C,E){if(C[E]&&C[E].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ie.default.arrayOf(ie.default.number),handle:ie.default.string,cancel:ie.default.string,nodeRef:ie.default.object,onStart:ie.default.func,onDrag:ie.default.func,onStop:ie.default.func,onMouseDown:ie.default.func,scale:ie.default.number,className:qe.dontSetMe,style:qe.dontSetMe,transform:qe.dontSetMe});re(Ne,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(C){Object.defineProperty(C,"__esModule",{value:!0}),Object.defineProperty(C,"DraggableCore",{enumerable:!0,get:function(){return n.default}}),C.default=void 0;var E=o(Y),R=d(ut),O=d(ht),D=fs,H=ee,M=_e,r=fe,n=d(Ie),l=d(je);function d(i){return i&&i.__esModule?i:{default:i}}function o(i,t){if(typeof WeakMap=="function")var s=new WeakMap,a=new WeakMap;return(o=function(c,_){if(!_&&c&&c.__esModule)return c;var m,h,v={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return v;if(m=_?a:s){if(m.has(c))return m.get(c);m.set(c,v)}for(const y in c)y!=="default"&&{}.hasOwnProperty.call(c,y)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,y))&&(h.get||h.set)?m(v,y,h):v[y]=c[y]);return v})(i,t)}function u(){return u=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)({}).hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},u.apply(null,arguments)}function p(i,t,s){return(t=g(t))in i?Object.defineProperty(i,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[t]=s,i}function g(i){var t=f(i,"string");return typeof t=="symbol"?t:t+""}function f(i,t){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var a=s.call(i,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}class e extends E.Component{static getDerivedStateFromProps(t,s){let{position:a}=t,{prevPropsPosition:c}=s;return a&&(!c||a.x!==c.x||a.y!==c.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:a,prevPropsPosition:c}),{x:a.x,y:a.y,prevPropsPosition:{...a}}):null}constructor(t){super(t),p(this,"onDragStart",(s,a)=>{if((0,l.default)("Draggable: onDragStart: %j",a),this.props.onStart(s,(0,M.createDraggableData)(this,a))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(s,a)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",a);const c=(0,M.createDraggableData)(this,a),_={x:c.x,y:c.y,slackX:0,slackY:0};if(this.props.bounds){const{x:h,y:v}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[y,T]=(0,M.getBoundPosition)(this,_.x,_.y);_.x=y,_.y=T,_.slackX=this.state.slackX+(h-_.x),_.slackY=this.state.slackY+(v-_.y),c.x=_.x,c.y=_.y,c.deltaX=_.x-this.state.x,c.deltaY=_.y-this.state.y}if(this.props.onDrag(s,c)===!1)return!1;this.setState(_)}),p(this,"onDragStop",(s,a)=>{if(!this.state.dragging||this.props.onStop(s,(0,M.createDraggableData)(this,a))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",a);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:h,y:v}=this.props.position;_.x=h,_.y=v}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var t,s;return((s=(t=this.props)==null?void 0:t.nodeRef)==null?void 0:s.current)??O.default.findDOMNode(this)}render(){const{axis:t,bounds:s,children:a,defaultPosition:c,defaultClassName:_,defaultClassNameDragging:m,defaultClassNameDragged:h,position:v,positionOffset:y,scale:T,...x}=this.props;let A={},I=null;const U=!!!v||this.state.dragging,W=v||c,b={x:(0,M.canDragX)(this)&&U?this.state.x:W.x,y:(0,M.canDragY)(this)&&U?this.state.y:W.y};this.state.isElementSVG?I=(0,H.createSVGTransform)(b,y):A=(0,H.createCSSTransform)(b,y);const k=(0,D.clsx)(a.props.className||"",_,{[m]:this.state.dragging,[h]:this.state.dragged});return E.createElement(n.default,u({},x,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),E.cloneElement(E.Children.only(a),{className:k,style:{...a.props.style,...A},transform:I}))}}C.default=e,p(e,"displayName","Draggable"),p(e,"propTypes",{...n.default.propTypes,axis:R.default.oneOf(["both","x","y","none"]),bounds:R.default.oneOfType([R.default.shape({left:R.default.number,right:R.default.number,top:R.default.number,bottom:R.default.number}),R.default.string,R.default.oneOf([!1])]),defaultClassName:R.default.string,defaultClassNameDragging:R.default.string,defaultClassNameDragged:R.default.string,defaultPosition:R.default.shape({x:R.default.number,y:R.default.number}),positionOffset:R.default.shape({x:R.default.oneOfType([R.default.number,R.default.string]),y:R.default.oneOfType([R.default.number,R.default.string])}),position:R.default.shape({x:R.default.number,y:R.default.number}),className:r.dontSetMe,style:r.dontSetMe,transform:r.dontSetMe}),p(e,"defaultProps",{...n.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(kt);const{default:Pt,DraggableCore:Vs}=kt;Oe.exports=Pt;Oe.exports.default=Pt;Oe.exports.DraggableCore=Vs;var Xs=Oe.exports;const Gs=Ht(Xs);class Ys extends Ft.Component{constructor(E){super(E),this.state={hasError:!1}}static getDerivedStateFromError(E){return{hasError:!0}}componentDidCatch(E,R){console.error("Window Error:",E,R)}render(){return this.state.hasError?S.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-red-400 p-8 text-center bg-[#1a1a1a] rounded-b-xl border border-red-500/20",children:[S.jsx("div",{className:"w-12 h-12 bg-red-500/10 rounded-full flex items-center justify-center mb-4",children:S.jsx(pt,{size:24,className:"text-red-500"})}),S.jsx("span",{className:"font-black text-white mb-2 uppercase tracking-tighter",children:"Segment Violation"}),S.jsx("span",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:"Application thread terminated unexpectedly."})]}):this.props.children}}const Js=({window:C})=>{const{closeWindow:E,minimizeWindow:R,focusWindow:O,osType:D}=ue(),{id:H,title:M,content:r,x:n,y:l,isMinimized:d,isActive:o}=C,u=C.width||800,p=C.height||500;if(d)return null;const g=D==="windows";return S.jsx(Gs,{handle:".window-header",defaultPosition:{x:n,y:l},onStart:()=>O(H),onMouseDown:()=>O(H),children:S.jsxs("div",{className:`absolute flex flex-col transition-shadow duration-200 pointer-events-auto ${o?"shadow-[0_30px_60px_-15px_rgba(0,0,0,0.8)]":"shadow-[0_10px_30px_-10px_rgba(0,0,0,0.5)]"} ${g?"rounded-xl border border-white/10":"rounded-lg border border-black shadow-2xl"}`,style:{width:u,height:p,zIndex:o?50:10,backdropFilter:g?"blur(20px)":"none"},onMouseDown:()=>O(H),children:[S.jsxs("div",{className:`window-header h-10 flex items-center justify-between transition-colors px-3 select-none ${g?`${o?"bg-[#1f1f1f]/95":"bg-[#1a1a1a]/95"} rounded-t-xl`:"bg-[#2d2d2d] rounded-t-lg border-b border-black"}`,children:[!g&&S.jsxs("div",{className:"flex gap-2 mr-3",children:[S.jsx("button",{onClick:()=>E(H),className:"w-3 h-3 rounded-full bg-[#ff5555] hover:brightness-125 border border-black/10 transition-all"}),S.jsx("button",{onClick:()=>R(H),className:"w-3 h-3 rounded-full bg-[#f1fa8c] hover:brightness-125 border border-black/10 transition-all"}),S.jsx("button",{className:"w-3 h-3 rounded-full bg-[#50fa7b] hover:brightness-125 border border-black/10 transition-all"})]}),S.jsx("div",{className:`flex items-center gap-2 overflow-hidden ${g?"text-white/70":"flex-1 text-center pr-12"}`,children:M}),g&&S.jsxs("div",{className:"flex items-center",children:[S.jsx("button",{onClick:f=>{f.stopPropagation(),R(H)},className:"w-10 h-10 flex items-center justify-center hover:bg-white/5 transition-colors",children:S.jsx(zt,{size:14,className:"text-white/60"})}),S.jsx("button",{className:"w-10 h-10 flex items-center justify-center hover:bg-white/5 transition-colors",children:S.jsx(ft,{size:12,className:"text-white/60"})}),S.jsx("button",{onClick:f=>{f.stopPropagation(),E(H)},className:"w-10 h-10 flex items-center justify-center hover:bg-[#e81123] hover:text-white rounded-tr-xl transition-colors group",children:S.jsx(pt,{size:16,className:"text-white/60 group-hover:text-white"})})]})]}),S.jsx("div",{className:`flex-1 relative overflow-hidden bg-black/80 ${g?"rounded-b-xl":"rounded-b-lg"}`,children:S.jsx(Ys,{children:S.jsx("div",{className:"absolute inset-0 flex flex-col",children:r})})})]})})},Zs=()=>{const{windows:C,closeWindow:E}=ue();return S.jsx(S.Fragment,{children:C.map(R=>S.jsx(Js,{window:R},R.id))})},lt=()=>{const[C,E]=Y.useState(!1),[R,O]=Y.useState([]),[D,H]=Y.useState(null),M=Y.useRef(null),r=["TCP","HTTP","DNS","TLSv1.2","UDP","ARP","ICMP"],n=["192.168.1.100","192.168.1.50","8.8.8.8","1.1.1.1","10.0.0.1","172.16.0.10"];Y.useEffect(()=>{let d;return C&&(d=setInterval(()=>{const o={id:R.length+1,time:(Date.now()/1e3%1e3).toFixed(6),source:n[Math.floor(Math.random()*n.length)],destination:n[Math.floor(Math.random()*n.length)],protocol:r[Math.floor(Math.random()*r.length)],length:Math.floor(Math.random()*1400)+60,info:"Simulated network traffic data segment "+Math.random().toString(36).substring(7)};O(u=>[...u.slice(-49),o])},800)),()=>clearInterval(d)},[C,R.length]),Y.useEffect(()=>{M.current&&(M.current.scrollTop=M.current.scrollHeight)},[R]);const l=d=>S.jsxs("div",{className:"font-mono text-[10px] leading-tight flex gap-4 text-blue-200/80",children:[S.jsx("pre",{children:`00 1a 2b 3c 4d 5a 00 1c b0 44 32 a1 08 00 45 00
00 28 4a 41 40 00 80 06 00 00 c0 a8 01 64 c0 a8
01 32 d4 35 01 bb 44 bb a2 11 a1 b2 c3 d4 e0 01
50 11 00 00 d4 a1 00 00`}),S.jsx("div",{className:"w-[1px] bg-white/10 h-full"}),S.jsx("pre",{children:`..+<MZ..D2..E.
.(JA@....d
.25.D.
P......`})]});return S.jsxs("div",{className:"flex flex-col h-full bg-[#1e1e1e] text-[#cccccc] font-sans overflow-hidden",children:[S.jsxs("div",{className:"flex items-center gap-2 p-1.5 bg-[#2d2d2d] border-b border-white/5 shadow-sm",children:[S.jsx("button",{onClick:()=>E(!C),className:`p-1.5 rounded hover:bg-white/10 transition-colors ${C?"text-red-400":"text-green-400"}`,title:C?"Stop Capture":"Start Capture",children:C?S.jsx(ft,{size:16,fill:"currentColor"}):S.jsx(Kt,{size:16,fill:"currentColor"})}),S.jsx("button",{className:"p-1.5 rounded hover:bg-white/10 text-blue-400",children:S.jsx(Ge,{size:16})}),S.jsx("div",{className:"w-[1px] h-4 bg-white/10 mx-1"}),S.jsx("button",{className:"p-1.5 rounded hover:bg-white/10",children:S.jsx(Pe,{size:16})}),S.jsx("button",{className:"p-1.5 rounded hover:bg-white/10",children:S.jsx(Qs,{size:16})}),S.jsx("button",{className:"p-1.5 rounded hover:bg-white/10",children:S.jsx(ei,{size:16})}),S.jsx("div",{className:"w-[1px] h-4 bg-white/10 mx-1"}),S.jsxs("div",{className:"flex-1 flex items-center bg-[#1a1a1a] border border-white/10 rounded px-2 gap-2",children:[S.jsx(qt,{size:14,className:"text-gray-500"}),S.jsx("input",{type:"text",placeholder:"Apply a display filter... <Ctrl-/>",className:"bg-transparent border-none outline-none text-xs w-full h-7 py-0.5"})]}),S.jsx("button",{className:"p-1.5 rounded hover:bg-white/10",children:S.jsx(Xe,{size:16})})]}),S.jsx("div",{className:"flex-1 overflow-auto relative border-b border-white/10",ref:M,children:S.jsxs("table",{className:"w-full text-left text-[11px] border-collapse",children:[S.jsx("thead",{className:"sticky top-0 bg-[#2d2d2d] shadow z-10",children:S.jsxs("tr",{children:[S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-12",children:"No."}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-24",children:"Time"}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-32",children:"Source"}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-32",children:"Destination"}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-20",children:"Protocol"}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal w-16",children:"Length"}),S.jsx("th",{className:"px-2 py-1 border-r border-white/5 font-normal",children:"Info"})]})}),S.jsxs("tbody",{children:[R.length===0&&!C&&S.jsx("tr",{children:S.jsx("td",{colSpan:"7",className:"p-8 text-center text-gray-500 italic",children:"Click the green Play button to start capturing traffic."})}),R.map(d=>S.jsxs("tr",{onClick:()=>H(d),className:`cursor-pointer border-b border-white/5 transition-colors ${(D==null?void 0:D.id)===d.id?"bg-blue-600/40":d.protocol==="HTTP"?"bg-green-900/10":d.protocol==="TLSv1.2"?"bg-purple-900/10":d.protocol==="ARP"?"bg-yellow-900/10":"hover:bg-white/5"}`,children:[S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5",children:d.id}),S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5",children:d.time}),S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5",children:d.source}),S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5",children:d.destination}),S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5 font-bold",children:d.protocol}),S.jsx("td",{className:"px-2 py-0.5 border-r border-white/5",children:d.length}),S.jsx("td",{className:"px-2 py-0.5 whitespace-nowrap overflow-hidden text-ellipsis",children:d.info})]},d.id))]})]})}),S.jsxs("div",{className:"h-48 flex flex-col bg-[#252525]",children:[S.jsx("div",{className:"flex-1 overflow-auto border-b border-white/10 p-2 text-xs",children:D?S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-1 hover:bg-white/5 p-0.5 rounded cursor-pointer",children:[S.jsx(Re,{size:14})," Frame ",D.id,": ",D.length," bytes on wire"]}),S.jsxs("div",{className:"flex items-center gap-1 hover:bg-white/5 p-0.5 rounded cursor-pointer text-blue-300",children:[S.jsx(_t,{size:14})," Ethernet II, Src: 00:1a:2b:3c:4d:5a, Dst: 00:1c:b0:44:32:a1"]}),S.jsxs("div",{className:"flex items-center gap-1 hover:bg-white/5 p-0.5 rounded cursor-pointer text-green-300 ml-4",children:[S.jsx(Re,{size:14})," Internet Protocol Version 4, Src: ",D.source,", Dst: ",D.destination]}),S.jsxs("div",{className:"flex items-center gap-1 hover:bg-white/5 p-0.5 rounded cursor-pointer text-purple-300 ml-4",children:[S.jsx(Re,{size:14})," ",D.protocol," Header Info"]}),S.jsxs("div",{className:"flex items-center gap-1 hover:bg-white/5 p-0.5 rounded cursor-pointer ml-4",children:[S.jsx(Re,{size:14})," Data (",D.length-54," bytes)"]})]}):S.jsxs("div",{className:"text-gray-500 italic p-2 items-center flex gap-2",children:[S.jsx(Vt,{size:14})," Select a packet to view details."]})}),S.jsx("div",{className:"h-24 overflow-auto p-2 bg-[#1a1a1a] border-t border-white/5",children:D?l():null})]}),S.jsxs("div",{className:"bg-[#2d2d2d] border-t border-white/10 px-3 py-1 text-[10px] flex items-center justify-between text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsxs("span",{className:"flex items-center gap-1",children:[S.jsx(Xt,{size:12})," Live Capture (eth0)"]}),S.jsxs("span",{children:["Packets: ",R.length]}),S.jsx("span",{children:"Dropped: 0 (0.0%)"})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsx("span",{children:"Profile: Default"})})]})]})},Qs=({size:C})=>S.jsxs("svg",{width:C,height:C,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"m5 12 7-7 7 7"}),S.jsx("path",{d:"M12 19V5"})]}),ei=({size:C})=>S.jsxs("svg",{width:C,height:C,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M12 5v14"}),S.jsx("path",{d:"m19 12-7 7-7-7"})]}),ti=()=>{const{osType:C,openWindow:E}=ue(),[R,O]=Y.useState({visible:!1,x:0,y:0}),D=()=>C==="windows"?"url('https://images.unsplash.com/photo-1620641788421-7a1c342ea42e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80')":"radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(26,26,46,1) 35%, rgba(15,52,96,1) 100%)",H={background:C==="windows"?"white":D(),backgroundImage:C==="windows"?D():"none",backgroundSize:"cover",backgroundPosition:"center"},M=u=>{u.preventDefault(),O({visible:!0,x:u.clientX,y:u.clientY})},r=()=>O({visible:!1,x:0,y:0}),n=`WINDOWS 11 SECURITY ANALYSIS MANUAL
====================================

Welcome to the Windows Incident Response Lab. 
This environment is optimized for investigating system state and user activity.

CORE CAPABILITIES:
- GUI Exploration: File Explorer for system auditing.
- PowerShell: Advanced command-line management and investigation.
- Registry: Deep system configuration and persistence checks.

ESSENTIAL SECURITY COMMANDS (Terminal):
- whoami /all    : View user SID, groups, and privileges.
- netstat -ano   : Monitor active network connections and PIDs.
- tasklist /svc  : Audit running processes and associated services.
- systeminfo     : Extract OS version, hardware, and hotfix data.
- net user <usr> : Inspect local user account configurations.
- sc query <svc> : Check status of specific system services.
- quser          : Identify all currently logged-in users.
- gpresult /r    : Audit applied Group Policy Objects (GPOs).
- dir /S /B      : Recursive file search for hidden indicators.

TIPS:
- Use PowerShell for advanced scripting and automation.
- Monitor active processes for unusual PIDs or services.
- Check 'C:\\Windows\\System32' for critical system binaries.`,l=`KALI LINUX OFFENSIVE SECURITY MANUAL
=====================================

Welcome to the Pentesting & Security Research Lab.
A specialized Kali Linux environment for offensive security operations.

CORE CAPABILITIES:
- Root Terminal: Full ZSH shell access with root privileges.
- Toolset: Integrated industry-standard security tools.
- File System: Comprehensive Linux directory structure simulation.

ESSENTIAL SECURITY COMMANDS (Terminal):
- lsb_release -a    : Confirm exact distribution and version.
- ss -atnp          : View socket statistics (sockets, ports, PIDs).
- find / -perm -4000: Search for SUID binaries (PrivEsc investigation).
- lsof -i           : Identify processes holding network sockets.
- grep -ri "pass" / : Recursive search for sensitive strings in configs.
- id                : Check current UID, GID, and group context.
- ps aux            : Comprehensive process tree and resource usage.
- systemctl status  : Audit status of system daemons and services.

SECURITY TOOLS (Terminal):
- nmap -sV -O <target>  : Service and OS fingerprinting scan.
- msfconsole            : Launch the Metasploit Framework.
- hydra -l usr -p pwd ..: Parallelized login cracker.
- nikto -h <host>       : Web server vulnerability scanner.
- john / hashcat        : Password and hash cracking utilities.

TIPS:
- The terminal is your primary tool in Linux; use 'man <cmd>' for help.
- Scan targets using Nmap before attempting exploitation.
- Always check logs in '/var/log/' for trace evidence.`,d=[{id:"manual",title:"Readme.txt",icon:Yt,color:"text-white bg-blue-600/20",action:()=>E("manual","Readme.txt",S.jsx(Me,{content:l}))},{id:"terminal",title:"Root Terminal",icon:Ze,color:"text-white bg-black/50",action:()=>E("terminal","root@kali: ~",S.jsx(et,{}))},{id:"files",title:"File System",icon:Ye,color:"text-blue-400 bg-white/5",action:()=>E("explorer","File Manager",S.jsx(Be,{}))},{id:"wireshark",title:"Wireshark",icon:Ge,color:"text-blue-400 bg-blue-600/20",action:()=>E("wireshark","Wireshark",S.jsx(lt,{}))},{id:"trash",title:"Trash",icon:rt,color:"text-gray-400 bg-white/5",action:()=>{}}],o=[{id:"manual",title:"Manual.txt",icon:Te,color:"text-blue-500 bg-white/5",action:()=>E("manual","Manual.txt",S.jsx(Me,{content:n}))},{id:"pc",title:"This PC",icon:Ye,color:"text-blue-400 bg-white/5",action:()=>E("explorer","This PC",S.jsx(Be,{}))},{id:"trash",title:"Recycle Bin",icon:rt,color:"text-gray-400 bg-white/5",action:()=>{}},{id:"wireshark",title:"Wireshark",icon:Ge,color:"text-blue-500 bg-white/5",action:()=>E("wireshark","Wireshark",S.jsx(lt,{}))},{id:"sec",title:"Security Lab",icon:Je,color:"text-purple-400 bg-white/5",action:()=>{}}];return S.jsxs("div",{className:"h-full w-full relative flex flex-col overflow-hidden select-none",style:H,onContextMenu:M,onClick:r,children:[R.visible&&S.jsxs("div",{className:"absolute z-[5000] w-48 bg-[#1f1f1f]/95 backdrop-blur-md border border-white/10 rounded-lg shadow-2xl py-1 text-white text-xs",style:{top:R.y,left:R.x},children:[S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"View"}),S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"Sort by"}),S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"Refresh"}),S.jsx("div",{className:"h-[1px] bg-white/10 my-1 mx-2"}),S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"New"}),S.jsx("div",{className:"h-[1px] bg-white/10 my-1 mx-2"}),S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"Display settings"}),S.jsx("div",{className:"px-4 py-2 hover:bg-white/10 cursor-default",children:"Personalize"})]}),C==="linux"&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-[0.03] pointer-events-none",children:S.jsx(Gt,{size:1e3,className:"text-white"})}),S.jsx(us,{}),S.jsx("div",{className:"absolute inset-0 z-10 pointer-events-none",children:S.jsx(Zs,{})}),S.jsx("div",{className:`flex-1 p-6 flex flex-col flex-wrap gap-4 h-full content-start items-start justify-start relative z-20 pointer-events-none ${C==="linux"?"mt-8 ml-16":""}`,children:(C==="linux"?d:o).map(u=>S.jsxs("div",{className:"w-24 h-24 flex flex-col items-center justify-center text-center gap-2 p-2 rounded-lg hover:bg-white/10 border border-transparent hover:border-white/5 transition-all group active:bg-white/20 active:scale-95 cursor-pointer pointer-events-auto",onDoubleClick:u.action,children:[S.jsx("div",{className:`w-14 h-14 ${u.color} rounded-xl backdrop-blur-sm shadow-lg flex items-center justify-center transition-transform group-hover:scale-110 group-active:scale-90`,children:S.jsx(u.icon,{size:28})}),S.jsx("span",{className:"text-[11px] text-white font-medium drop-shadow-[0_2px_2px_rgba(0,0,0,0.8)] px-1.5 py-0.5 rounded-md leading-tight group-hover:bg-blue-500/20 group-hover:backdrop-blur-sm",children:u.title})]},u.id))}),C==="windows"?S.jsx(ds,{}):null,S.jsx("style",{children:`
                .select-none { user-select: none; }
            `})]})},si=()=>{const{isBooting:C,setIsBooting:E,osType:R}=ue(),O=()=>{E(!1)};return S.jsx("div",{className:"h-screen w-screen overflow-hidden bg-black relative",children:C?S.jsx(rs,{onComplete:O}):S.jsx(ti,{})})},xi=({initialOS:C})=>S.jsx(is,{initialOS:C,children:S.jsx(si,{})});export{xi as default};
