@lemoncat7/dsh-ssh 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +272 -255
- package/lib/client.js.map +3 -3
- package/lib/file-transfer-intent.d.ts +4 -0
- package/lib/file-transfer-intent.d.ts.map +1 -1
- package/lib/file-transfer-intent.js +3 -0
- package/lib/file-transfer-intent.js.map +1 -1
- package/lib/file-transfer-workspace.js +4 -5
- package/lib/file-transfer-workspace.js.map +1 -1
- package/lib/sftp-client.js +3 -3
- package/lib/sftp-client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-ssh", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
-
"use strict";var
|
|
3
|
-
`,
|
|
2
|
+
"use strict";var tf=Object.create;var xi=Object.defineProperty;var rf=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyNames;var nf=Object.getPrototypeOf,of=Object.prototype.hasOwnProperty;var Ar=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Hn=(e,t)=>{for(var r in t)xi(e,r,{get:t[r],enumerable:!0})},Al=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sf(t))!of.call(e,o)&&o!==r&&xi(e,o,{get:()=>t[o],enumerable:!(s=rf(t,o))||s.enumerable});return e};var Ms=(e,t,r)=>(r=e!=null?tf(nf(e)):{},Al(t||!e||!e.__esModule?xi(r,"default",{value:e,enumerable:!0}):r,e)),af=e=>Al(xi({},"__esModule",{value:!0}),e);var jn=Ar((yi,Un)=>{(function(e,t){typeof yi=="object"&&typeof Un=="object"?Un.exports=t():typeof define=="function"&&define.amd?define([],t):typeof yi=="object"?yi.FitAddon=t():e.FitAddon=t()})(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(r){this._terminal=r}dispose(){}fit(){let r=this.proposeDimensions();if(!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;let s=this._terminal._core;this._terminal.rows===r.rows&&this._terminal.cols===r.cols||(s._renderService.clear(),this._terminal.resize(r.cols,r.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let r=this._terminal._core,s=r._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;let o=this._terminal.options.scrollback===0?0:r.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),l=n-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),c=a-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(c/s.css.cell.width)),rows:Math.max(1,Math.floor(l/s.css.cell.height))}}}})(),e})()))});var Sh=Ar((Xy,wh)=>{"use strict";var _h=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vf=/\n/g,_f=/^\s*/,bf=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xf=/^:\s*/,yf=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wf=/^[;\s]*/,Sf=/^\s+|\s+$/g,kf=`
|
|
3
|
+
`,bh="/",xh="*",Or="",Cf="comment",Ef="declaration";function Tf(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,s=1;function o(u){var d=u.match(vf);d&&(r+=d.length);var m=u.lastIndexOf(kf);s=~m?u.length-m:s+u.length}function i(){var u={line:r,column:s};return function(d){return d.position=new n(u),l(),d}}function n(u){this.start=u,this.end={line:r,column:s},this.source=t.source}n.prototype.content=e;function a(u){var d=new Error(t.source+":"+r+":"+s+": "+u);if(d.reason=u,d.filename=t.source,d.line=r,d.column=s,d.source=e,!t.silent)throw d}function h(u){var d=u.exec(e);if(d){var m=d[0];return o(m),e=e.slice(m.length),d}}function l(){h(_f)}function c(u){var d;for(u=u||[];d=p();)d!==!1&&u.push(d);return u}function p(){var u=i();if(!(bh!=e.charAt(0)||xh!=e.charAt(1))){for(var d=2;Or!=e.charAt(d)&&(xh!=e.charAt(d)||bh!=e.charAt(d+1));)++d;if(d+=2,Or===e.charAt(d-1))return a("End of comment missing");var m=e.slice(2,d-2);return s+=2,o(m),e=e.slice(d),s+=2,u({type:Cf,comment:m})}}function v(){var u=i(),d=h(bf);if(d){if(p(),!h(xf))return a("property missing ':'");var m=h(yf),f=u({type:Ef,property:yh(d[0].replace(_h,Or)),value:m?yh(m[0].replace(_h,Or)):Or});return h(wf),f}}function g(){var u=[];c(u);for(var d;d=v();)d!==!1&&(u.push(d),c(u));return u}return l(),g()}function yh(e){return e?e.replace(Sf,Or):Or}wh.exports=Tf});var kh=Ar(Hs=>{"use strict";var Pf=Hs&&Hs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.default=Rf;var Df=Pf(Sh());function Rf(e,t){let r=null;if(!e||typeof e!="string")return r;let s=(0,Df.default)(e),o=typeof t=="function";return s.forEach(i=>{if(i.type!=="declaration")return;let{property:n,value:a}=i;o?t(n,a,i):a&&(r=r||{},r[n]=a)}),r}});var Eh=Ar(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.camelCase=void 0;var Af=/^--[a-zA-Z0-9_-]+$/,If=/-([a-z])/g,Lf=/^[^-]+$/,Of=/^-(webkit|moz|ms|o|khtml)-/,Mf=/^-(ms)-/,Bf=function(e){return!e||Lf.test(e)||Af.test(e)},Ff=function(e,t){return t.toUpperCase()},Ch=function(e,t){return"".concat(t,"-")},Nf=function(e,t){return t===void 0&&(t={}),Bf(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Mf,Ch):e=e.replace(Of,Ch),e.replace(If,Ff))};Di.camelCase=Nf});var Ph=Ar((to,Th)=>{"use strict";var zf=to&&to.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Hf=zf(kh()),Uf=Eh();function eo(e,t){var r={};return!e||typeof e!="string"||(0,Hf.default)(e,function(s,o){s&&o&&(r[(0,Uf.camelCase)(s,t)]=o)}),r}eo.default=eo;Th.exports=eo});var Zc=Ar((k2,Qc)=>{"use strict";var Zi=Object.prototype.hasOwnProperty,Yc=Object.prototype.toString,Wc=Object.defineProperty,qc=Object.getOwnPropertyDescriptor,Kc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Yc.call(t)==="[object Array]"},Xc=function(t){if(!t||Yc.call(t)!=="[object Object]")return!1;var r=Zi.call(t,"constructor"),s=t.constructor&&t.constructor.prototype&&Zi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!s)return!1;var o;for(o in t);return typeof o>"u"||Zi.call(t,o)},Jc=function(t,r){Wc&&r.name==="__proto__"?Wc(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},Gc=function(t,r){if(r==="__proto__")if(Zi.call(t,r)){if(qc)return qc(t,r).value}else return;return t[r]};Qc.exports=function e(){var t,r,s,o,i,n,a=arguments[0],h=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},h=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});h<l;++h)if(t=arguments[h],t!=null)for(r in t)s=Gc(a,r),o=Gc(t,r),a!==o&&(c&&o&&(Xc(o)||(i=Kc(o)))?(i?(i=!1,n=s&&Kc(s)?s:[]):n=s&&Xc(s)?s:{},Jc(a,{name:r,newValue:e(c,n,o)})):typeof o<"u"&&Jc(a,{name:r,newValue:o}));return a}});var bp=Ar((An,wl)=>{(function(e,t){if(typeof An=="object"&&typeof wl=="object")wl.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r=t();for(var s in r)(typeof An=="object"?An:e)[s]=r[s]}})(globalThis,(()=>(()=>{"use strict";var e={4567:function(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;let l=n(9042),c=n(9924),p=n(844),v=n(4725),g=n(2585),u=n(3656),d=i.AccessibilityManager=class extends p.Disposable{constructor(m,f,_,x){super(),this._terminal=m,this._coreBrowserService=_,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
4
4
|
`)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(m){for(let f=0;f<m;f++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
|
|
5
5
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),/\p{Control}/u.test(m)||this._charsToConsume.push(m)}_refreshRows(m,f){this._liveRegionDebouncer.refresh(m,f,this._terminal.rows)}_renderRows(m,f){let _=this._terminal.buffer,x=_.lines.length.toString();for(let y=m;y<=f;y++){let w=_.lines.get(_.ydisp+y),b=[],S=w?.translateToString(!0,void 0,void 0,b)||"",T=(_.ydisp+y+1).toString(),R=this._rowElements[y];R&&(S.length===0?(R.innerText="\xA0",this._rowColumns.set(R,[0,1])):(R.textContent=S,this._rowColumns.set(R,b)),R.setAttribute("aria-posinset",T),R.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,f){let _=m.target,x=this._rowElements[f===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==x)return;let y,w;if(f===0?(y=_,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(y=this._rowElements.shift(),w=_,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){let b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{let b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let f={node:m.anchorNode,offset:m.anchorOffset},_={node:m.focusNode,offset:m.focusOffset};if((f.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||f.node===_.node&&f.offset>_.offset)&&([f,_]=[_,f]),f.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(f={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(f.node))return;let x=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:x,offset:x.textContent?.length??0}),!this._rowContainer.contains(_.node))return;let y=({node:S,offset:T})=>{let R=S instanceof Text?S.parentNode:S,E=parseInt(R?.getAttribute("aria-posinset"),10)-1;if(isNaN(E))return console.warn("row is invalid. Race condition?"),null;let A=this._rowColumns.get(R);if(!A)return console.warn("columns is null. Race condition?"),null;let B=T<A.length?A[T]:A.slice(-1)[0]+1;return B>=this._terminal.cols&&(++E,B=0),{row:E,column:B}},w=y(f),b=y(_);if(w&&b){if(w.row>b.row||w.row===b.row&&w.column>=b.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(b.row-w.row)*this._terminal.cols-w.column+b.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=d=a([h(1,g.IInstantiationService),h(2,v.ICoreBrowserService),h(3,v.IRenderService)],d)},3614:(o,i)=>{function n(c){return c.replace(/\r?\n/g,"\r")}function a(c,p){return p?"\x1B[200~"+c+"\x1B[201~":c}function h(c,p,v,g){c=a(c=n(c),v.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),p.value=""}function l(c,p,v){let g=v.getBoundingClientRect(),u=c.clientX-g.left-10,d=c.clientY-g.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${u}px`,p.style.top=`${d}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=n,i.bracketTextForPaste=a,i.copyHandler=function(c,p){c.clipboardData&&c.clipboardData.setData("text/plain",p.selectionText),c.preventDefault()},i.handlePasteEvent=function(c,p,v,g){c.stopPropagation(),c.clipboardData&&h(c.clipboardData.getData("text/plain"),p,v,g)},i.paste=h,i.moveTextAreaUnderMouseCursor=l,i.rightClickHandler=function(c,p,v,g,u){l(c,p,v),u&&g.rightClickSelect(c),p.value=g.selectionText,p.select()}},7239:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;let a=n(1505);i.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(h,l,c){this._css.set(h,l,c)}getCss(h,l){return this._css.get(h,l)}setColor(h,l,c){this._color.set(h,l,c)}getColor(h,l){return this._color.get(h,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(n,a,h,l){n.addEventListener(a,h,l);let c=!1;return{dispose:()=>{c||(c=!0,n.removeEventListener(a,h,l))}}}},3551:function(o,i,n){var a=this&&this.__decorate||function(d,m,f,_){var x,y=arguments.length,w=y<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,f,_);else for(var b=d.length-1;b>=0;b--)(x=d[b])&&(w=(y<3?x(w):y>3?x(m,f,w):x(m,f))||w);return y>3&&w&&Object.defineProperty(m,f,w),w},h=this&&this.__param||function(d,m){return function(f,_){m(f,_,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;let l=n(3656),c=n(8460),p=n(844),v=n(2585),g=n(4725),u=i.Linkifier=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(d,m,f,_,x){super(),this._element=d,this._mouseService=m,this._renderService=f,this._bufferService=_,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){this._lastMouseEvent=d;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;let f=d.composedPath();for(let _=0;_<f.length;_++){let x=f[_];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,m){this._activeProviderReplies&&m||(this._activeProviderReplies?.forEach((_=>{_?.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=d.y);let f=!1;for(let[_,x]of this._linkProviderService.linkProviders.entries())m?this._activeProviderReplies?.get(_)&&(f=this._checkLinkProviderResult(_,d,f)):x.provideLinks(d.y,(y=>{if(this._isMouseOut)return;let w=y?.map((b=>({link:b})));this._activeProviderReplies?.set(_,w),f=this._checkLinkProviderResult(_,d,f),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)}))}_removeIntersectingLinks(d,m){let f=new Set;for(let _=0;_<m.size;_++){let x=m.get(_);if(x)for(let y=0;y<x.length;y++){let w=x[y],b=w.link.range.start.y<d?0:w.link.range.start.x,S=w.link.range.end.y>d?this._bufferService.cols:w.link.range.end.x;for(let T=b;T<=S;T++){if(f.has(T)){x.splice(y--,1);break}f.add(T)}}}}_checkLinkProviderResult(d,m,f){if(!this._activeProviderReplies)return f;let _=this._activeProviderReplies.get(d),x=!1;for(let y=0;y<d;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(x=!0);if(!x&&_){let y=_.find((w=>this._linkAtPosition(w.link,m)));y&&(f=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let y=0;y<this._activeProviderReplies.size;y++){let w=this._activeProviderReplies.get(y)?.find((b=>this._linkAtPosition(b.link,m)));if(w){f=!0,this._handleNewLink(w);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._currentLink)return;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,m){this._currentLink&&this._lastMouseEvent&&(!d||!m||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._lastMouseEvent)return;let m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(d.link,m)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:f=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:f=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((f=>{if(!this._currentLink)return;let _=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(_,x),this._lastMouseEvent)){let y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(d,m,f){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(f,m.text)}_fireUnderlineEvent(d,m){let f=d.range,_=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-_-1,f.end.x,f.end.y-_-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(d,m,f){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(f,m.text)}_linkAtPosition(d,m){let f=d.range.start.y*this._bufferService.cols+d.range.start.x,_=d.range.end.y*this._bufferService.cols+d.range.end.x,x=m.y*this._bufferService.cols+m.x;return f<=x&&x<=_}_positionFromMouseEvent(d,m,f){let _=f.getCoords(d,m,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,m,f,_,x){return{x1:d,y1:m,x2:f,y2:_,cols:this._bufferService.cols,fg:x}}};i.Linkifier=u=a([h(1,g.IMouseService),h(2,g.IRenderService),h(3,v.IBufferService),h(4,g.ILinkProviderService)],u)},9042:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var f,_=arguments.length,x=_<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(f=g[y])&&(x=(_<3?f(x):_>3?f(u,d,x):f(u,d))||x);return _>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;let l=n(511),c=n(2585),p=i.OscLinkProvider=class{constructor(g,u,d){this._bufferService=g,this._optionsService=u,this._oscLinkService=d}provideLinks(g,u){let d=this._bufferService.buffer.lines.get(g-1);if(!d)return void u(void 0);let m=[],f=this._optionsService.rawOptions.linkHandler,_=new l.CellData,x=d.getTrimmedLength(),y=-1,w=-1,b=!1;for(let S=0;S<x;S++)if(w!==-1||d.hasContent(S)){if(d.loadCell(S,_),_.hasExtendedAttrs()&&_.extended.urlId){if(w===-1){w=S,y=_.extended.urlId;continue}b=_.extended.urlId!==y}else w!==-1&&(b=!0);if(b||w!==-1&&S===x-1){let T=this._oscLinkService.getLinkData(y)?.uri;if(T){let R={start:{x:w+1,y:g},end:{x:S+(b||S!==x-1?0:1),y:g}},E=!1;if(!f?.allowNonHttpProtocols)try{let A=new URL(T);["http:","https:"].includes(A.protocol)||(E=!0)}catch{E=!0}E||m.push({text:T,range:R,activate:(A,B)=>f?f.activate(A,B,R):v(0,B),hover:(A,B)=>f?.hover?.(A,B,R),leave:(A,B)=>f?.leave?.(A,B,R)})}b=!1,_.hasExtendedAttrs()&&_.extended.urlId?(w=S,y=_.extended.urlId):(w=-1,y=-1)}}u(m)}};function v(g,u){if(confirm(`Do you want to navigate to ${u}?
|
|
6
6
|
|
|
7
|
-
WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){try{d.opener=null}catch{}d.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=p=a([h(0,c.IBufferService),h(1,c.IOptionsService),h(2,c.IOscLinkService)],p)},6193:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a: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,a):a,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},3236:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;let a=n(3614),h=n(3656),l=n(3551),c=n(9042),p=n(3730),v=n(1680),g=n(3107),u=n(5744),d=n(2950),m=n(1296),f=n(428),_=n(4269),x=n(5114),y=n(8934),w=n(3230),b=n(9312),S=n(4725),T=n(6731),R=n(8055),E=n(8969),A=n(8460),B=n(844),M=n(6114),H=n(8437),z=n(2584),j=n(7399),C=n(5941),D=n(9074),L=n(2585),k=n(5435),U=n(4567),J=n(779);class O extends E.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(N={}){super(N),this.browser=M,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,$)=>this.refresh(P,$)))),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,B.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(let P of N){let $,V="";switch(P.index){case 256:$="foreground",V="10";break;case 257:$="background",V="11";break;case 258:$="cursor",V="12";break;default:$="ansi",V="4;"+P.index}switch(P.type){case 0:let te=R.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${V};${(0,C.toRgbString)(te)}${z.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors((Q=>Q.ansi[P.index]=R.channels.toColor(...P.color)));else{let Q=$;this._themeService.modifyColors((G=>G[Q]=R.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let N=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(N);if(!P)return;let $=Math.min(this.buffer.x,this.cols-1),V=this._renderService.dimensions.css.cell.height,te=P.getWidth($),Q=this._renderService.dimensions.css.cell.width*te,G=this.buffer.y*this._renderService.dimensions.css.cell.height,oe=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=oe+"px",this.textarea.style.top=G+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=V+"px",this.textarea.style.lineHeight=V+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,a.copyHandler)(P,this._selectionService)})));let N=P=>(0,a.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,h.addDisposableDomListener)(this.element,"paste",N)),M.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),M.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,a.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),N.appendChild(this.element);let P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,h.addDisposableDomListener)(this.screenElement,"mousemove",($=>this.updateCursorStyle($)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),M.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",($=>this._handleTextAreaFocus($)))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(($=>this._onRender.fire($)))),this.onResize(($=>this._renderService.resize($.cols,$.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(($=>this.scrollLines($.amount,$.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(($=>this.scrollLines($.amount,$.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw(($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection(($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event(($=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",($=>this._selectionService.handleMouseDown($)))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",($=>this._handleScreenReaderModeOptionChange($)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",($=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let N=this,P=this.element;function $(Q){let G=N._mouseService.getMouseReportCoords(Q,N.screenElement);if(!G)return!1;let oe,me;switch(Q.overrideType||Q.type){case"mousemove":me=32,Q.buttons===void 0?(oe=3,Q.button!==void 0&&(oe=Q.button<3?Q.button:3)):oe=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":me=0,oe=Q.button<3?Q.button:3;break;case"mousedown":me=1,oe=Q.button<3?Q.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(Q)===!1||N.viewport.getLinesScrolled(Q)===0)return!1;me=Q.deltaY<0?0:1,oe=4;break;default:return!1}return!(me===void 0||oe===void 0||oe>4)&&N.coreMouseService.triggerMouseEvent({col:G.col,row:G.row,x:G.x,y:G.y,button:oe,action:me,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}let V={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Q=>($(Q),Q.buttons||(this._document.removeEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.removeEventListener("mousemove",V.mousedrag)),this.cancel(Q)),wheel:Q=>($(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&$(Q)},mousemove:Q=>{Q.buttons||$(Q)}};this.register(this.coreMouseService.onProtocolChange((Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Q?V.mousemove||(P.addEventListener("mousemove",te.mousemove),V.mousemove=te.mousemove):(P.removeEventListener("mousemove",V.mousemove),V.mousemove=null),16&Q?V.wheel||(P.addEventListener("wheel",te.wheel,{passive:!1}),V.wheel=te.wheel):(P.removeEventListener("wheel",V.wheel),V.wheel=null),2&Q?V.mouseup||(V.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",V.mouseup),V.mouseup=null),4&Q?V.mousedrag||(V.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",V.mousedrag),V.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(P,"mousedown",(Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return $(Q),V.mouseup&&this._document.addEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.addEventListener("mousemove",V.mousedrag),this.cancel(Q)}))),this.register((0,h.addDisposableDomListener)(P,"wheel",(Q=>{if(!V.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Q)===!1)return!1;if(!this.buffer.hasScrollback){let G=this.viewport.getLinesScrolled(Q);if(G===0)return;let oe=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B"),me="";for(let De=0;De<Math.abs(G);De++)me+=oe;return this.coreService.triggerDataEvent(me,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}}),{passive:!1})),this.register((0,h.addDisposableDomListener)(P,"touchstart",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(P,"touchmove",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)}),{passive:!1}))}refresh(N,P){this._renderService?.refreshRows(N,P)}updateCursorStyle(N){this._selectionService?.shouldColumnSelect(N)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(N,P,$=0){$===1?(super.scrollLines(N,P,$),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(N)}paste(N){(0,a.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let P=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,P,$){this._selectionService.setSelection(N,P,$)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(N,P){this._selectionService?.selectLines(N,P)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;let P=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!P&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let $=(0,j.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),$.type===3||$.type===2){let V=this.rows-1;return this.scrollLines($.type===2?-V:V),this.cancel(N,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||($.cancel&&this.cancel(N,!0),!$.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==z.C0.ETX&&$.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,P){let $=N.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||N.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||N.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?$:$&&(!P.keyCode||P.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)P=N.charCode;else if(N.which===null||N.which===void 0)P=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;P=N.which}return!(!P||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let P=N.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(N),!0}return!1}resize(N,P){N!==this.cols||P!==this.rows?super.resize(N,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,P){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let N=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let P=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${$};${P}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let V=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${te};${V}t`)}}cancel(N,P){if(this.options.cancelEvents||P)return N.preventDefault(),N.stopPropagation(),!1}}i.Terminal=O},9924:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(n,a=1e3){this._renderCallback=n,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a: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,a):a;let l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let c=l-this._lastRefreshMs,p=this._debounceThresholdMS-c;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;let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a)}}},1680:function(o,i,n){var a=this&&this.__decorate||function(d,m,f,_){var x,y=arguments.length,w=y<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,f,_);else for(var b=d.length-1;b>=0;b--)(x=d[b])&&(w=(y<3?x(w):y>3?x(m,f,w):x(m,f))||w);return y>3&&w&&Object.defineProperty(m,f,w),w},h=this&&this.__param||function(d,m){return function(f,_){m(f,_,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;let l=n(3656),c=n(4725),p=n(8460),v=n(844),g=n(2585),u=i.Viewport=class extends v.Disposable{constructor(d,m,f,_,x,y,w,b){super(),this._viewportElement=d,this._scrollArea=m,this._bufferService=f,this._optionsService=_,this._charSizeService=x,this._renderService=y,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((S=>this._renderDimensions=S))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((S=>this._handleThemeChange(S)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(d){this._viewportElement.style.backgroundColor=d.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(d){if(d)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let d=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=d),this._refreshAnimationFrame=null}syncScrollArea(d=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(d);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(d)}_handleScroll(d){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});let m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let d=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(d*(this._smoothScrollState.target-this._smoothScrollState.origin)),d<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(d,m){let f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&f<this._lastRecordedBufferHeight)||(d.cancelable&&d.preventDefault(),!1)}handleWheel(d){let m=this._getPixelsScrolled(d);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}scrollLines(d){if(d!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let m=d*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!1})}_getPixelsScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(d,m){let f,_="",x=[],y=m??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let b=d;b<y;b++){let S=w.get(b);if(!S)continue;let T=w.get(b+1)?.isWrapped;if(_+=S.translateToString(!T),!T||b===w.length-1){let R=document.createElement("div");R.textContent=_,x.push(R),_.length>0&&(f=R),_=""}}return{bufferElements:x,cursorElement:f}}getLinesScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(d,m){let f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&m.altKey||f==="ctrl"&&m.ctrlKey||f==="shift"&&m.shiftKey?d*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:d*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(d){this._lastTouchY=d.touches[0].pageY}handleTouchMove(d){let m=this._lastTouchY-d.touches[0].pageY;return this._lastTouchY=d.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}};i.Viewport=u=a([h(2,g.IBufferService),h(3,g.IOptionsService),h(4,c.ICharSizeService),h(5,c.IRenderService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],u)},3107:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var f,_=arguments.length,x=_<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(f=g[y])&&(x=(_<3?f(x):_>3?f(u,d,x):f(u,d))||x);return _>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;let l=n(4725),c=n(844),p=n(2585),v=i.BufferDecorationRenderer=class extends c.Disposable{constructor(g,u,d,m,f){super(),this._screenElement=g,this._bufferService=u,this._coreBrowserService=d,this._decorationService=m,this._renderService=f,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,c.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(let g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){let u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",g?.options?.layer==="top"),u.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let d=g.options.x??0;return d&&d>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(g,u),u}_refreshStyle(g){let u=g.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let d=this._decorationElements.get(g);d||(d=this._createElement(g),g.element=d,this._decorationElements.set(g,d),this._container.appendChild(d),g.onDispose((()=>{this._decorationElements.delete(g),d.remove()}))),d.style.top=u*this._renderService.dimensions.css.cell.height+"px",d.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(d)}}_refreshXPosition(g,u=g.element){if(!u)return;let d=g.options.x??0;(g.options.anchor||"left")==="right"?u.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){this._decorationElements.get(g)?.remove(),this._decorationElements.delete(g),g.dispose()}};i.BufferDecorationRenderer=v=a([h(1,p.IBufferService),h(2,l.ICoreBrowserService),h(3,p.IDecorationService),h(4,l.IRenderService)],v)},5871:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(let a of this._zones)if(a.color===n.options.overviewRulerOptions.color&&a.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,n.marker.line))return;if(this._lineAdjacentToZone(a,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(a,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,a){return a>=n.startBufferLine&&a<=n.endBufferLine}_lineAdjacentToZone(n,a,h){return a>=n.startBufferLine-this._linePadding[h||"full"]&&a<=n.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(n,a){n.startBufferLine=Math.min(n.startBufferLine,a),n.endBufferLine=Math.max(n.endBufferLine,a)}}},5744:function(o,i,n){var a=this&&this.__decorate||function(f,_,x,y){var w,b=arguments.length,S=b<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,_,x,y);else for(var T=f.length-1;T>=0;T--)(w=f[T])&&(S=(b<3?w(S):b>3?w(_,x,S):w(_,x))||S);return b>3&&S&&Object.defineProperty(_,x,S),S},h=this&&this.__param||function(f,_){return function(x,y){_(x,y,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;let l=n(5871),c=n(4725),p=n(844),v=n(2585),g={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},m=i.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,_,x,y,w,b,S){super(),this._viewportElement=f,this._screenElement=_,this._bufferService=x,this._decorationService=y,this._renderService=w,this._optionsService=b,this._coreBrowserService=S,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,p.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let f=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=f,u.center=_,u.right=f,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);let f=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);g.left=_,g.center=_,g.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;let f=this._colorZoneStore.zones;for(let _ of f)_.position!=="full"&&this._renderColorZone(_);for(let _ of f)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(d[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-g[f.position||"full"]/2),u[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[f.position||"full"]))}_queueRefresh(f,_){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=m=a([h(2,v.IBufferService),h(3,v.IDecorationService),h(4,c.IRenderService),h(5,v.IOptionsService),h(6,c.ICoreBrowserService)],m)},2950:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var f,_=arguments.length,x=_<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(f=g[y])&&(x=(_<3?f(x):_>3?f(u,d,x):f(u,d))||x);return _>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;let l=n(4725),c=n(2585),p=n(2584),v=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,u,d,m,f,_){this._textarea=g,this._compositionView=u,this._bufferService=d,this._optionsService=m,this._coreService=f,this._renderService=_,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){let u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let d;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,d=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),d.length>0&&this._coreService.triggerDataEvent(d,!0)}}),0)}else{this._isSendingComposition=!1;let u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){let g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let u=this._textarea.value,d=u.replace(g,"");this._dataAlreadySent=d,u.length>g.length?this._coreService.triggerDataEvent(d,!0):u.length<g.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):u.length===g.length&&u!==g&&this._coreService.triggerDataEvent(u,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),d=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let _=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=v=a([h(2,c.IBufferService),h(3,c.IOptionsService),h(4,c.ICoreService),h(5,l.IRenderService)],v)},9806:(o,i)=>{function n(a,h,l){let c=l.getBoundingClientRect(),p=a.getComputedStyle(l),v=parseInt(p.getPropertyValue("padding-left")),g=parseInt(p.getPropertyValue("padding-top"));return[h.clientX-c.left-v,h.clientY-c.top-g]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=n,i.getCoords=function(a,h,l,c,p,v,g,u,d){if(!v)return;let m=n(a,h,l);return m?(m[0]=Math.ceil((m[0]+(d?g/2:0))/g),m[1]=Math.ceil(m[1]/u),m[0]=Math.min(Math.max(m[0],1),c+(d?1:0)),m[1]=Math.min(Math.max(m[1],1),p),m):void 0}},9504:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;let a=n(2584);function h(u,d,m,f){let _=u-l(u,m),x=d-l(d,m),y=Math.abs(_-x)-(function(w,b,S){let T=0,R=w-l(w,S),E=b-l(b,S);for(let A=0;A<Math.abs(R-E);A++){let B=c(w,b)==="A"?-1:1;S.buffer.lines.get(R+B*A)?.isWrapped&&T++}return T})(u,d,m);return g(y,v(c(u,d),f))}function l(u,d){let m=0,f=d.buffer.lines.get(u),_=f?.isWrapped;for(;_&&u>=0&&u<d.rows;)m++,f=d.buffer.lines.get(--u),_=f?.isWrapped;return m}function c(u,d){return u>d?"A":"B"}function p(u,d,m,f,_,x){let y=u,w=d,b="";for(;y!==m||w!==f;)y+=_?1:-1,_&&y>x.cols-1?(b+=x.buffer.translateBufferLineToString(w,!1,u,y),y=0,u=0,w++):!_&&y<0&&(b+=x.buffer.translateBufferLineToString(w,!1,0,u+1),y=x.cols-1,u=y,w--);return b+x.buffer.translateBufferLineToString(w,!1,u,y)}function v(u,d){let m=d?"O":"[";return a.C0.ESC+m+u}function g(u,d){u=Math.floor(u);let m="";for(let f=0;f<u;f++)m+=d;return m}i.moveToCellSequence=function(u,d,m,f){let _=m.buffer.x,x=m.buffer.y;if(!m.buffer.hasScrollback)return(function(b,S,T,R,E,A){return h(S,R,E,A).length===0?"":g(p(b,S,b,S-l(S,E),!1,E).length,v("D",A))})(_,x,0,d,m,f)+h(x,d,m,f)+(function(b,S,T,R,E,A){let B;B=h(S,R,E,A).length>0?R-l(R,E):S;let M=R,H=(function(z,j,C,D,L,k){let U;return U=h(C,D,L,k).length>0?D-l(D,L):j,z<C&&U<=D||z>=C&&U<D?"C":"D"})(b,S,T,R,E,A);return g(p(b,B,T,M,H==="C",E).length,v(H,A))})(_,x,u,d,m,f);let y;if(x===d)return y=_>u?"D":"C",g(Math.abs(_-u),v(y,f));y=x>d?"D":"C";let w=Math.abs(x-d);return g((function(b,S){return S.cols-b})(x>d?u:_,m)+(w-1)*m.cols+1+((x>d?_:u)-1),v(y,f))}},1296:function(o,i,n){var a=this&&this.__decorate||function(A,B,M,H){var z,j=arguments.length,C=j<3?B:H===null?H=Object.getOwnPropertyDescriptor(B,M):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(A,B,M,H);else for(var D=A.length-1;D>=0;D--)(z=A[D])&&(C=(j<3?z(C):j>3?z(B,M,C):z(B,M))||C);return j>3&&C&&Object.defineProperty(B,M,C),C},h=this&&this.__param||function(A,B){return function(M,H){B(M,H,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;let l=n(3787),c=n(2550),p=n(2223),v=n(6171),g=n(6052),u=n(4725),d=n(8055),m=n(8460),f=n(844),_=n(2585),x="xterm-dom-renderer-owner-",y="xterm-rows",w="xterm-fg-",b="xterm-bg-",S="xterm-focus",T="xterm-selection",R=1,E=i.DomRenderer=class extends f.Disposable{constructor(A,B,M,H,z,j,C,D,L,k,U,J,O){super(),this._terminal=A,this._document=B,this._element=M,this._screenElement=H,this._viewportElement=z,this._helperContainer=j,this._linkifier2=C,this._charSizeService=L,this._optionsService=k,this._bufferService=U,this._coreBrowserService=J,this._themeService=O,this._terminalClass=R++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let M of this._rowElements)M.style.width=`${this.dimensions.css.canvas.width}px`,M.style.height=`${this.dimensions.css.cell.height}px`,M.style.lineHeight=`${this.dimensions.css.cell.height}px`,M.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let B=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${y} .xterm-dim { color: ${d.color.multiplyOpacity(A.foreground,.5).css};}`,B+=`${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;}`;let M=`blink_underline_${this._terminalClass}`,H=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;B+=`@keyframes ${M} { 50% { border-bottom-style: hidden; }}`,B+=`@keyframes ${H} { 50% { box-shadow: none; }}`,B+=`@keyframes ${z} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,B+=`${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${M} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(let[j,C]of A.ansi.entries())B+=`${this._terminalSelector} .${w}${j} { color: ${C.css}; }${this._terminalSelector} .${w}${j}.xterm-dim { color: ${d.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${b}${j} { background-color: ${C.css}; }`;B+=`${this._terminalSelector} .${w}${p.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(A.background).css}; }${this._terminalSelector} .${w}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${b}${p.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){let A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,B){for(let M=this._rowElements.length;M<=B;M++){let H=this._document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,B){this._refreshRowElements(A,B),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,B,M){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,B,M),this.renderRows(0,this._bufferService.rows-1),!A||!B)return;this._selectionRenderModel.update(this._terminal,A,B,M);let H=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||C<0)return;let D=this._document.createDocumentFragment();if(M){let L=A[0]>B[0];D.appendChild(this._createSelectionElement(j,L?B[0]:A[0],L?A[0]:B[0],C-j+1))}else{let L=H===j?A[0]:0,k=j===z?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,L,k));let U=C-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,U)),j!==C){let J=z===C?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(C,0,J))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,B,M,H=1){let z=this._document.createElement("div"),j=B*this.dimensions.css.cell.width,C=this.dimensions.css.cell.width*(M-B);return j+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-j),z.style.height=H*this.dimensions.css.cell.height+"px",z.style.top=A*this.dimensions.css.cell.height+"px",z.style.left=`${j}px`,z.style.width=`${C}px`,z}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(let A of this._rowElements)A.replaceChildren()}renderRows(A,B){let M=this._bufferService.buffer,H=M.ybase+M.y,z=Math.min(M.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=A;L<=B;L++){let k=L+M.ydisp,U=this._rowElements[L],J=M.lines.get(k);if(!U||!J)break;U.replaceChildren(...this._rowFactory.createRow(J,k,k===H,C,D,z,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,B,M,H,z,j){M<0&&(A=0),H<0&&(B=0);let C=this._bufferService.rows-1;M=Math.max(Math.min(M,C),0),H=Math.max(Math.min(H,C),0),z=Math.min(z,this._bufferService.cols);let D=this._bufferService.buffer,L=D.ybase+D.y,k=Math.min(D.x,z-1),U=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=M;ee<=H;++ee){let N=ee+D.ydisp,P=this._rowElements[ee],$=D.lines.get(N);if(!P||!$)break;P.replaceChildren(...this._rowFactory.createRow($,N,N===L,J,O,k,U,this.dimensions.css.cell.width,this._widthCache,j?ee===M?A:0:-1,j?(ee===H?B:z)-1:-1))}}};i.DomRenderer=E=a([h(7,_.IInstantiationService),h(8,u.ICharSizeService),h(9,_.IOptionsService),h(10,_.IBufferService),h(11,u.ICoreBrowserService),h(12,u.IThemeService)],E)},3787:function(o,i,n){var a=this&&this.__decorate||function(y,w,b,S){var T,R=arguments.length,E=R<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(y,w,b,S);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(E=(R<3?T(E):R>3?T(w,b,E):T(w,b))||E);return R>3&&E&&Object.defineProperty(w,b,E),E},h=this&&this.__param||function(y,w){return function(b,S){w(b,S,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;let l=n(2223),c=n(643),p=n(511),v=n(2585),g=n(8055),u=n(4725),d=n(4269),m=n(6171),f=n(3734),_=i.DomRendererRowFactory=class{constructor(y,w,b,S,T,R,E){this._document=y,this._characterJoinerService=w,this._optionsService=b,this._coreBrowserService=S,this._coreService=T,this._decorationService=R,this._themeService=E,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,w,b){this._selectionStart=y,this._selectionEnd=w,this._columnSelectMode=b}createRow(y,w,b,S,T,R,E,A,B,M,H){let z=[],j=this._characterJoinerService.getJoinedCharacters(w),C=this._themeService.colors,D,L=y.getNoBgTrimmedLength();b&&L<R+1&&(L=R+1);let k=0,U="",J=0,O=0,ee=0,N=!1,P=0,$=!1,V=0,te=[],Q=M!==-1&&H!==-1;for(let G=0;G<L;G++){y.loadCell(G,this._workCell);let oe=this._workCell.getWidth();if(oe===0)continue;let me=!1,De=G,se=this._workCell;if(j.length>0&&G===j[0][0]){me=!0;let ue=j.shift();se=new d.JoinedCellData(this._workCell,y.translateToString(!0,ue[0],ue[1]),ue[1]-ue[0]),De=ue[1]-1,oe=se.getWidth()}let Te=this._isCellInSelection(G,w),ft=b&&G===R,or=Q&&G>=M&&G<=H,Ot=!1;this._decorationService.forEachDecorationAtCell(G,w,void 0,(ue=>{Ot=!0}));let Tr=se.getChars()||c.WHITESPACE_CELL_CHAR;if(Tr===" "&&(se.isUnderline()||se.isOverline())&&(Tr="\xA0"),V=oe*A-B.get(Tr,se.isBold(),se.isItalic()),D){if(k&&(Te&&$||!Te&&!$&&se.bg===J)&&(Te&&$&&C.selectionForeground||se.fg===O)&&se.extended.ext===ee&&or===N&&V===P&&!ft&&!me&&!Ot){se.isInvisible()?U+=c.WHITESPACE_CELL_CHAR:U+=Tr,k++;continue}k&&(D.textContent=U),D=this._document.createElement("span"),k=0,U=""}else D=this._document.createElement("span");if(J=se.bg,O=se.fg,ee=se.extended.ext,N=or,P=V,$=Te,me&&R>=G&&R<=De&&(R=G),!this._coreService.isCursorHidden&&ft&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&te.push("xterm-cursor-blink"),te.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(se.isBold()&&te.push("xterm-bold"),se.isItalic()&&te.push("xterm-italic"),se.isDim()&&te.push("xterm-dim"),U=se.isInvisible()?c.WHITESPACE_CELL_CHAR:se.getChars()||c.WHITESPACE_CELL_CHAR,se.isUnderline()&&(te.push(`xterm-underline-${se.extended.underlineStyle}`),U===" "&&(U="\xA0"),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let ue=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&ue<8&&(ue+=8),D.style.textDecorationColor=C.ansi[ue].css}se.isOverline()&&(te.push("xterm-overline"),U===" "&&(U="\xA0")),se.isStrikethrough()&&te.push("xterm-strikethrough"),or&&(D.style.textDecoration="underline");let ot=se.getFgColor(),Pr=se.getFgColorMode(),kt=se.getBgColor(),Dr=se.getBgColorMode(),Is=!!se.isInverse();if(Is){let ue=ot;ot=kt,kt=ue;let mt=Pr;Pr=Dr,Dr=mt}let q,Z,ce,ve=!1;switch(this._decorationService.forEachDecorationAtCell(G,w,void 0,(ue=>{ue.options.layer!=="top"&&ve||(ue.backgroundColorRGB&&(Dr=50331648,kt=ue.backgroundColorRGB.rgba>>8&16777215,q=ue.backgroundColorRGB),ue.foregroundColorRGB&&(Pr=50331648,ot=ue.foregroundColorRGB.rgba>>8&16777215,Z=ue.foregroundColorRGB),ve=ue.options.layer==="top")})),!ve&&Te&&(q=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,kt=q.rgba>>8&16777215,Dr=50331648,ve=!0,C.selectionForeground&&(Pr=50331648,ot=C.selectionForeground.rgba>>8&16777215,Z=C.selectionForeground)),ve&&te.push("xterm-decoration-top"),Dr){case 16777216:case 33554432:ce=C.ansi[kt],te.push(`xterm-bg-${kt}`);break;case 50331648:ce=g.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(D,`background-color:#${x((kt>>>0).toString(16),"0",6)}`);break;default:Is?(ce=C.foreground,te.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):ce=C.background}switch(q||se.isDim()&&(q=g.color.multiplyOpacity(ce,.5)),Pr){case 16777216:case 33554432:se.isBold()&&ot<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ot+=8),this._applyMinimumContrast(D,ce,C.ansi[ot],se,q,void 0)||te.push(`xterm-fg-${ot}`);break;case 50331648:let ue=g.channels.toColor(ot>>16&255,ot>>8&255,255&ot);this._applyMinimumContrast(D,ce,ue,se,q,Z)||this._addStyle(D,`color:#${x(ot.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,ce,C.foreground,se,q,Z)||Is&&te.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}te.length&&(D.className=te.join(" "),te.length=0),ft||me||Ot?D.textContent=U:k++,V!==this.defaultSpacing&&(D.style.letterSpacing=`${V}px`),z.push(D),G=De}return D&&k&&(D.textContent=U),z}_applyMinimumContrast(y,w,b,S,T,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(S.getCode()))return!1;let E=this._getContrastCache(S),A;if(T||R||(A=E.getColor(w.rgba,b.rgba)),A===void 0){let B=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);A=g.color.ensureContrastRatio(T||w,R||b,B),E.setColor((T||w).rgba,(R||b).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,w){y.setAttribute("style",`${y.getAttribute("style")||""}${w};`)}_isCellInSelection(y,w){let b=this._selectionStart,S=this._selectionEnd;return!(!b||!S)&&(this._columnSelectMode?b[0]<=S[0]?y>=b[0]&&w>=b[1]&&y<S[0]&&w<=S[1]:y<b[0]&&w>=b[1]&&y>=S[0]&&w<=S[1]:w>b[1]&&w<S[1]||b[1]===S[1]&&w===b[1]&&y>=b[0]&&y<S[0]||b[1]<S[1]&&w===S[1]&&y<S[0]||b[1]<S[1]&&w===b[1]&&y>=b[0])}};function x(y,w,b){for(;y.length<b;)y=w+y;return y}i.DomRendererRowFactory=_=a([h(1,u.ICharacterJoinerService),h(2,v.IOptionsService),h(3,u.ICoreBrowserService),h(4,v.ICoreService),h(5,v.IDecorationService),h(6,u.IThemeService)],_)},2550:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(n,a){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.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let h=n.createElement("span");h.classList.add("xterm-char-measure-element");let l=n.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let c=n.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";let p=n.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[h,l,c,p],this._container.appendChild(h),this._container.appendChild(l),this._container.appendChild(c),this._container.appendChild(p),a.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,a,h,l){n===this._font&&a===this._fontSize&&h===this._weight&&l===this._weightBold||(this._font=n,this._fontSize=a,this._weight=h,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(n,a,h){let l=0;if(!a&&!h&&n.length===1&&(l=n.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let v=this._measure(n,0);return v>0&&(this._flat[l]=v),v}let c=n;a&&(c+="B"),h&&(c+="I");let p=this._holey.get(c);if(p===void 0){let v=0;a&&(v|=1),h&&(v|=2),p=this._measure(n,v),p>0&&this._holey.set(c,p)}return p}_measure(n,a){let h=this._measureElements[a];return h.textContent=n.repeat(32),h.offsetWidth/32}}},2223:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;let a=n(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(o,i)=>{function n(h){return 57508<=h&&h<=57558}function a(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},i.isPowerlineGlyph=n,i.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},i.isEmoji=a,i.allowRescaling=function(h,l,c,p){return l===1&&c>Math.ceil(1.5*p)&&h!==void 0&&h>255&&!a(h)&&!n(h)&&!(function(v){return 57344<=v&&v<=63743})(h)},i.treatGlyphAsBackgroundColor=function(h){return n(h)||(function(l){return 9472<=l&&l<=9631})(h)},i.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}}}},i.computeNextVariantOffset=function(h,l,c=0){return(h-(2*Math.round(l)-c))%(2*Math.round(l))}},6052:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,l,c,p=!1){if(this.selectionStart=l,this.selectionEnd=c,!l||!c||l[0]===c[0]&&l[1]===c[1])return void this.clear();let v=h.buffers.active.ydisp,g=l[1]-v,u=c[1]-v,d=Math.max(g,0),m=Math.min(u,h.rows-1);d>=h.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=g,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=m,this.startCol=l[0],this.endCol=c[0])}isCellSelected(h,l,c){return!!this.hasSelection&&(c-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&c>=this.viewportCappedStartRow&&l<this.endCol&&c<=this.viewportCappedEndRow:l<this.startCol&&c>=this.viewportCappedStartRow&&l>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new n}},456:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.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()){let 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]){let 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(){let n=this.selectionStart,a=this.selectionEnd;return!(!n||!a)&&(n[1]>a[1]||n[1]===a[1]&&n[0]>a[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(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;let l=n(2585),c=n(8460),p=n(844),v=i.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,f,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(m,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){let m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};i.CharSizeService=v=a([h(2,l.IOptionsService)],v);class g extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,_){f!==void 0&&f>0&&_!==void 0&&_>0&&(this._result.width=f,this._result.height=_)}}class u extends g{constructor(f,_,x){super(),this._document=f,this._parentElement=_,this._optionsService=x,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends g{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(o,i,n){var a=this&&this.__decorate||function(d,m,f,_){var x,y=arguments.length,w=y<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,f,_);else for(var b=d.length-1;b>=0;b--)(x=d[b])&&(w=(y<3?x(w):y>3?x(m,f,w):x(m,f))||w);return y>3&&w&&Object.defineProperty(m,f,w),w},h=this&&this.__param||function(d,m){return function(f,_){m(f,_,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;let l=n(3734),c=n(643),p=n(511),v=n(2585);class g extends l.AttributeData{constructor(m,f,_){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=f,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=g;let u=i.CharacterJoinerService=class vp{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(m){let f={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(f),f.id}deregister(m){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===m)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];let f=this._bufferService.buffer.lines.get(m);if(!f||f.length===0)return[];let _=[],x=f.translateToString(!0),y=0,w=0,b=0,S=f.getFg(0),T=f.getBg(0);for(let R=0;R<f.getTrimmedLength();R++)if(f.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==S||this._workCell.bg!==T){if(R-y>1){let E=this._getJoinedRanges(x,b,w,f,y);for(let A=0;A<E.length;A++)_.push(E[A])}y=R,b=w,S=this._workCell.fg,T=this._workCell.bg}w+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){let R=this._getJoinedRanges(x,b,w,f,y);for(let E=0;E<R.length;E++)_.push(R[E])}return _}_getJoinedRanges(m,f,_,x,y){let w=m.substring(f,_),b=[];try{b=this._characterJoiners[0].handler(w)}catch(S){console.error(S)}for(let S=1;S<this._characterJoiners.length;S++)try{let T=this._characterJoiners[S].handler(w);for(let R=0;R<T.length;R++)vp._mergeRanges(b,T[R])}catch(T){console.error(T)}return this._stringRangesToCellRanges(b,x,y),b}_stringRangesToCellRanges(m,f,_){let x=0,y=!1,w=0,b=m[x];if(b){for(let S=_;S<this._bufferService.cols;S++){let T=f.getWidth(S),R=f.getString(S).length||c.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&b[0]<=w&&(b[0]=S,y=!0),b[1]<=w){if(b[1]=S,b=m[++x],!b)break;b[0]<=w?(b[0]=S,y=!0):y=!1}w+=R}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(m,f){let _=!1;for(let x=0;x<m.length;x++){let y=m[x];if(_){if(f[1]<=y[0])return m[x-1][1]=f[1],m;if(f[1]<=y[1])return m[x-1][1]=Math.max(f[1],y[1]),m.splice(x,1),m;m.splice(x,1),x--}else{if(f[1]<=y[0])return m.splice(x,0,f),m;if(f[1]<=y[1])return y[0]=Math.min(f[0],y[0]),m;f[0]<y[1]&&(y[0]=Math.min(f[0],y[0]),_=!0)}}return _?m[m.length-1][1]=f[1]:m.push(f),m}};i.CharacterJoinerService=u=a([h(0,v.IBufferService)],u)},5114:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;let a=n(844),h=n(8460),l=n(3656);class c extends a.Disposable{constructor(g,u,d){super(),this._textarea=g,this._window=u,this.mainDocument=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new p(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,h.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(g){this._window!==g&&(this._window=g,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=c;class p extends a.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;let a=n(844);class h extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{let p=this.linkProviders.indexOf(c);p!==-1&&this.linkProviders.splice(p,1)}}}}i.LinkProviderService=h},8934:function(o,i,n){var a=this&&this.__decorate||function(v,g,u,d){var m,f=arguments.length,_=f<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(v,g,u,d);else for(var x=v.length-1;x>=0;x--)(m=v[x])&&(_=(f<3?m(_):f>3?m(g,u,_):m(g,u))||_);return f>3&&_&&Object.defineProperty(g,u,_),_},h=this&&this.__param||function(v,g){return function(u,d){g(u,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;let l=n(4725),c=n(9806),p=i.MouseService=class{constructor(v,g){this._renderService=v,this._charSizeService=g}getCoords(v,g,u,d,m){return(0,c.getCoords)(window,v,g,u,d,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(v,g){let u=(0,c.getCoordsRelativeToElement)(window,v,g);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};i.MouseService=p=a([h(0,l.IRenderService),h(1,l.ICharSizeService)],p)},3230:function(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;let l=n(6193),c=n(4725),p=n(8460),v=n(844),g=n(7226),u=n(2585),d=i.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,f,_,x,y,w,b,S){super(),this._rowCount=m,this._charSizeService=x,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new p.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new p.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new p.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new p.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((T,R)=>this._renderRows(T,R)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(S.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,f),this.register(b.onWindowChange((T=>this._registerIntersectionObserver(T,f))))}_registerIntersectionObserver(m,f){if("IntersectionObserver"in m){let _=new m.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});_.observe(f),this._observerDisposable.value=(0,v.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,f,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,f,this._rowCount))}_renderRows(m,f){this._renderer.value&&(m=Math.min(m,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(m,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:f}),this._onRender.fire({start:m,end:f}),this._isNextRenderRedrawOnly=!0)}resize(m,f){this._rowCount=f,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((f=>this.refreshRows(f.start,f.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,f))):this._renderer.value.handleResize(m,f),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,f,_){this._selectionState.start=m,this._selectionState.end=f,this._selectionState.columnSelectMode=_,this._renderer.value?.handleSelectionChanged(m,f,_)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};i.RenderService=d=a([h(2,u.IOptionsService),h(3,c.ICharSizeService),h(4,u.IDecorationService),h(5,u.IBufferService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],d)},9312:function(o,i,n){var a=this&&this.__decorate||function(b,S,T,R){var E,A=arguments.length,B=A<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,S,T,R);else for(var M=b.length-1;M>=0;M--)(E=b[M])&&(B=(A<3?E(B):A>3?E(S,T,B):E(S,T))||B);return A>3&&B&&Object.defineProperty(S,T,B),B},h=this&&this.__param||function(b,S){return function(T,R){S(T,R,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;let l=n(9806),c=n(9504),p=n(456),v=n(4725),g=n(8460),u=n(844),d=n(6114),m=n(4841),f=n(511),_=n(2585),x="\xA0",y=new RegExp(x,"g"),w=i.SelectionService=class extends u.Disposable{constructor(b,S,T,R,E,A,B,M,H){super(),this._element=b,this._screenElement=S,this._linkifier=T,this._bufferService=R,this._coreService=E,this._mouseService=A,this._optionsService=B,this._renderService=M,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((z=>this._handleTrim(z))),this.register(this._bufferService.buffers.onBufferActivate((z=>this._handleBufferActivate(z)))),this.enable(),this._model=new p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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(){let b=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!b||!S||b[0]===S[0]&&b[1]===S[1])}get selectionText(){let b=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!b||!S)return"";let T=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(b[0]===S[0])return"";let E=b[0]<S[0]?b[0]:S[0],A=b[0]<S[0]?S[0]:b[0];for(let B=b[1];B<=S[1];B++){let M=T.translateBufferLineToString(B,!0,E,A);R.push(M)}}else{let E=b[1]===S[1]?S[0]:void 0;R.push(T.translateBufferLineToString(b[1],!0,b[0],E));for(let A=b[1]+1;A<=S[1]-1;A++){let B=T.lines.get(A),M=T.translateBufferLineToString(A,!0);B?.isWrapped?R[R.length-1]+=M:R.push(M)}if(b[1]!==S[1]){let A=T.lines.get(S[1]),B=T.translateBufferLineToString(S[1],!0,0,S[0]);A&&A.isWrapped?R[R.length-1]+=B:R.push(B)}}return R.map((E=>E.replace(y," "))).join(d.isWindows?`\r
|
|
7
|
+
WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){try{d.opener=null}catch{}d.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=p=a([h(0,c.IBufferService),h(1,c.IOptionsService),h(2,c.IOscLinkService)],p)},6193:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a: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,a):a,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},3236:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;let a=n(3614),h=n(3656),l=n(3551),c=n(9042),p=n(3730),v=n(1680),g=n(3107),u=n(5744),d=n(2950),m=n(1296),f=n(428),_=n(4269),x=n(5114),y=n(8934),w=n(3230),b=n(9312),S=n(4725),T=n(6731),R=n(8055),E=n(8969),A=n(8460),B=n(844),M=n(6114),H=n(8437),z=n(2584),j=n(7399),C=n(5941),D=n(9074),L=n(2585),k=n(5435),U=n(4567),J=n(779);class O extends E.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(N={}){super(N),this.browser=M,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,$)=>this.refresh(P,$)))),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,B.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(let P of N){let $,V="";switch(P.index){case 256:$="foreground",V="10";break;case 257:$="background",V="11";break;case 258:$="cursor",V="12";break;default:$="ansi",V="4;"+P.index}switch(P.type){case 0:let te=R.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${V};${(0,C.toRgbString)(te)}${z.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors((Q=>Q.ansi[P.index]=R.channels.toColor(...P.color)));else{let Q=$;this._themeService.modifyColors((G=>G[Q]=R.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let N=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(N);if(!P)return;let $=Math.min(this.buffer.x,this.cols-1),V=this._renderService.dimensions.css.cell.height,te=P.getWidth($),Q=this._renderService.dimensions.css.cell.width*te,G=this.buffer.y*this._renderService.dimensions.css.cell.height,oe=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=oe+"px",this.textarea.style.top=G+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=V+"px",this.textarea.style.lineHeight=V+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,a.copyHandler)(P,this._selectionService)})));let N=P=>(0,a.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,h.addDisposableDomListener)(this.element,"paste",N)),M.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),M.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,a.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),N.appendChild(this.element);let P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,h.addDisposableDomListener)(this.screenElement,"mousemove",($=>this.updateCursorStyle($)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),M.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",($=>this._handleTextAreaFocus($)))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(($=>this._onRender.fire($)))),this.onResize(($=>this._renderService.resize($.cols,$.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(($=>this.scrollLines($.amount,$.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(($=>this.scrollLines($.amount,$.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw(($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection(($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event(($=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",($=>this._selectionService.handleMouseDown($)))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",($=>this._handleScreenReaderModeOptionChange($)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",($=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let N=this,P=this.element;function $(Q){let G=N._mouseService.getMouseReportCoords(Q,N.screenElement);if(!G)return!1;let oe,me;switch(Q.overrideType||Q.type){case"mousemove":me=32,Q.buttons===void 0?(oe=3,Q.button!==void 0&&(oe=Q.button<3?Q.button:3)):oe=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":me=0,oe=Q.button<3?Q.button:3;break;case"mousedown":me=1,oe=Q.button<3?Q.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(Q)===!1||N.viewport.getLinesScrolled(Q)===0)return!1;me=Q.deltaY<0?0:1,oe=4;break;default:return!1}return!(me===void 0||oe===void 0||oe>4)&&N.coreMouseService.triggerMouseEvent({col:G.col,row:G.row,x:G.x,y:G.y,button:oe,action:me,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}let V={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Q=>($(Q),Q.buttons||(this._document.removeEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.removeEventListener("mousemove",V.mousedrag)),this.cancel(Q)),wheel:Q=>($(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&$(Q)},mousemove:Q=>{Q.buttons||$(Q)}};this.register(this.coreMouseService.onProtocolChange((Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Q?V.mousemove||(P.addEventListener("mousemove",te.mousemove),V.mousemove=te.mousemove):(P.removeEventListener("mousemove",V.mousemove),V.mousemove=null),16&Q?V.wheel||(P.addEventListener("wheel",te.wheel,{passive:!1}),V.wheel=te.wheel):(P.removeEventListener("wheel",V.wheel),V.wheel=null),2&Q?V.mouseup||(V.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",V.mouseup),V.mouseup=null),4&Q?V.mousedrag||(V.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",V.mousedrag),V.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(P,"mousedown",(Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return $(Q),V.mouseup&&this._document.addEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.addEventListener("mousemove",V.mousedrag),this.cancel(Q)}))),this.register((0,h.addDisposableDomListener)(P,"wheel",(Q=>{if(!V.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Q)===!1)return!1;if(!this.buffer.hasScrollback){let G=this.viewport.getLinesScrolled(Q);if(G===0)return;let oe=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B"),me="";for(let De=0;De<Math.abs(G);De++)me+=oe;return this.coreService.triggerDataEvent(me,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}}),{passive:!1})),this.register((0,h.addDisposableDomListener)(P,"touchstart",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(P,"touchmove",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)}),{passive:!1}))}refresh(N,P){this._renderService?.refreshRows(N,P)}updateCursorStyle(N){this._selectionService?.shouldColumnSelect(N)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(N,P,$=0){$===1?(super.scrollLines(N,P,$),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(N)}paste(N){(0,a.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let P=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,P,$){this._selectionService.setSelection(N,P,$)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(N,P){this._selectionService?.selectLines(N,P)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;let P=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!P&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let $=(0,j.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),$.type===3||$.type===2){let V=this.rows-1;return this.scrollLines($.type===2?-V:V),this.cancel(N,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||($.cancel&&this.cancel(N,!0),!$.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==z.C0.ETX&&$.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,P){let $=N.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||N.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||N.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?$:$&&(!P.keyCode||P.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)P=N.charCode;else if(N.which===null||N.which===void 0)P=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;P=N.which}return!(!P||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let P=N.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(N),!0}return!1}resize(N,P){N!==this.cols||P!==this.rows?super.resize(N,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,P){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let N=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let P=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${$};${P}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let V=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${te};${V}t`)}}cancel(N,P){if(this.options.cancelEvents||P)return N.preventDefault(),N.stopPropagation(),!1}}i.Terminal=O},9924:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(n,a=1e3){this._renderCallback=n,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a: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,a):a;let l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let c=l-this._lastRefreshMs,p=this._debounceThresholdMS-c;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;let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a)}}},1680:function(o,i,n){var a=this&&this.__decorate||function(d,m,f,_){var x,y=arguments.length,w=y<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,f,_);else for(var b=d.length-1;b>=0;b--)(x=d[b])&&(w=(y<3?x(w):y>3?x(m,f,w):x(m,f))||w);return y>3&&w&&Object.defineProperty(m,f,w),w},h=this&&this.__param||function(d,m){return function(f,_){m(f,_,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;let l=n(3656),c=n(4725),p=n(8460),v=n(844),g=n(2585),u=i.Viewport=class extends v.Disposable{constructor(d,m,f,_,x,y,w,b){super(),this._viewportElement=d,this._scrollArea=m,this._bufferService=f,this._optionsService=_,this._charSizeService=x,this._renderService=y,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((S=>this._renderDimensions=S))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((S=>this._handleThemeChange(S)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(d){this._viewportElement.style.backgroundColor=d.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(d){if(d)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let d=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=d),this._refreshAnimationFrame=null}syncScrollArea(d=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(d);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(d)}_handleScroll(d){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});let m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let d=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(d*(this._smoothScrollState.target-this._smoothScrollState.origin)),d<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(d,m){let f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&f<this._lastRecordedBufferHeight)||(d.cancelable&&d.preventDefault(),!1)}handleWheel(d){let m=this._getPixelsScrolled(d);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}scrollLines(d){if(d!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let m=d*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!1})}_getPixelsScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(d,m){let f,_="",x=[],y=m??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let b=d;b<y;b++){let S=w.get(b);if(!S)continue;let T=w.get(b+1)?.isWrapped;if(_+=S.translateToString(!T),!T||b===w.length-1){let R=document.createElement("div");R.textContent=_,x.push(R),_.length>0&&(f=R),_=""}}return{bufferElements:x,cursorElement:f}}getLinesScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(d,m){let f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&m.altKey||f==="ctrl"&&m.ctrlKey||f==="shift"&&m.shiftKey?d*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:d*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(d){this._lastTouchY=d.touches[0].pageY}handleTouchMove(d){let m=this._lastTouchY-d.touches[0].pageY;return this._lastTouchY=d.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}};i.Viewport=u=a([h(2,g.IBufferService),h(3,g.IOptionsService),h(4,c.ICharSizeService),h(5,c.IRenderService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],u)},3107:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var f,_=arguments.length,x=_<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(f=g[y])&&(x=(_<3?f(x):_>3?f(u,d,x):f(u,d))||x);return _>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;let l=n(4725),c=n(844),p=n(2585),v=i.BufferDecorationRenderer=class extends c.Disposable{constructor(g,u,d,m,f){super(),this._screenElement=g,this._bufferService=u,this._coreBrowserService=d,this._decorationService=m,this._renderService=f,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,c.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(let g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){let u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",g?.options?.layer==="top"),u.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let d=g.options.x??0;return d&&d>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(g,u),u}_refreshStyle(g){let u=g.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let d=this._decorationElements.get(g);d||(d=this._createElement(g),g.element=d,this._decorationElements.set(g,d),this._container.appendChild(d),g.onDispose((()=>{this._decorationElements.delete(g),d.remove()}))),d.style.top=u*this._renderService.dimensions.css.cell.height+"px",d.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(d)}}_refreshXPosition(g,u=g.element){if(!u)return;let d=g.options.x??0;(g.options.anchor||"left")==="right"?u.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){this._decorationElements.get(g)?.remove(),this._decorationElements.delete(g),g.dispose()}};i.BufferDecorationRenderer=v=a([h(1,p.IBufferService),h(2,l.ICoreBrowserService),h(3,p.IDecorationService),h(4,l.IRenderService)],v)},5871:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(let a of this._zones)if(a.color===n.options.overviewRulerOptions.color&&a.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,n.marker.line))return;if(this._lineAdjacentToZone(a,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(a,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,a){return a>=n.startBufferLine&&a<=n.endBufferLine}_lineAdjacentToZone(n,a,h){return a>=n.startBufferLine-this._linePadding[h||"full"]&&a<=n.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(n,a){n.startBufferLine=Math.min(n.startBufferLine,a),n.endBufferLine=Math.max(n.endBufferLine,a)}}},5744:function(o,i,n){var a=this&&this.__decorate||function(f,_,x,y){var w,b=arguments.length,S=b<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,_,x,y);else for(var T=f.length-1;T>=0;T--)(w=f[T])&&(S=(b<3?w(S):b>3?w(_,x,S):w(_,x))||S);return b>3&&S&&Object.defineProperty(_,x,S),S},h=this&&this.__param||function(f,_){return function(x,y){_(x,y,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;let l=n(5871),c=n(4725),p=n(844),v=n(2585),g={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},m=i.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,_,x,y,w,b,S){super(),this._viewportElement=f,this._screenElement=_,this._bufferService=x,this._decorationService=y,this._renderService=w,this._optionsService=b,this._coreBrowserService=S,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,p.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let f=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=f,u.center=_,u.right=f,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);let f=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);g.left=_,g.center=_,g.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;let f=this._colorZoneStore.zones;for(let _ of f)_.position!=="full"&&this._renderColorZone(_);for(let _ of f)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(d[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-g[f.position||"full"]/2),u[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[f.position||"full"]))}_queueRefresh(f,_){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=m=a([h(2,v.IBufferService),h(3,v.IDecorationService),h(4,c.IRenderService),h(5,v.IOptionsService),h(6,c.ICoreBrowserService)],m)},2950:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var f,_=arguments.length,x=_<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(f=g[y])&&(x=(_<3?f(x):_>3?f(u,d,x):f(u,d))||x);return _>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;let l=n(4725),c=n(2585),p=n(2584),v=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,u,d,m,f,_){this._textarea=g,this._compositionView=u,this._bufferService=d,this._optionsService=m,this._coreService=f,this._renderService=_,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){let u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let d;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,d=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),d.length>0&&this._coreService.triggerDataEvent(d,!0)}}),0)}else{this._isSendingComposition=!1;let u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){let g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let u=this._textarea.value,d=u.replace(g,"");this._dataAlreadySent=d,u.length>g.length?this._coreService.triggerDataEvent(d,!0):u.length<g.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):u.length===g.length&&u!==g&&this._coreService.triggerDataEvent(u,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),d=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let _=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=v=a([h(2,c.IBufferService),h(3,c.IOptionsService),h(4,c.ICoreService),h(5,l.IRenderService)],v)},9806:(o,i)=>{function n(a,h,l){let c=l.getBoundingClientRect(),p=a.getComputedStyle(l),v=parseInt(p.getPropertyValue("padding-left")),g=parseInt(p.getPropertyValue("padding-top"));return[h.clientX-c.left-v,h.clientY-c.top-g]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=n,i.getCoords=function(a,h,l,c,p,v,g,u,d){if(!v)return;let m=n(a,h,l);return m?(m[0]=Math.ceil((m[0]+(d?g/2:0))/g),m[1]=Math.ceil(m[1]/u),m[0]=Math.min(Math.max(m[0],1),c+(d?1:0)),m[1]=Math.min(Math.max(m[1],1),p),m):void 0}},9504:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;let a=n(2584);function h(u,d,m,f){let _=u-l(u,m),x=d-l(d,m),y=Math.abs(_-x)-(function(w,b,S){let T=0,R=w-l(w,S),E=b-l(b,S);for(let A=0;A<Math.abs(R-E);A++){let B=c(w,b)==="A"?-1:1;S.buffer.lines.get(R+B*A)?.isWrapped&&T++}return T})(u,d,m);return g(y,v(c(u,d),f))}function l(u,d){let m=0,f=d.buffer.lines.get(u),_=f?.isWrapped;for(;_&&u>=0&&u<d.rows;)m++,f=d.buffer.lines.get(--u),_=f?.isWrapped;return m}function c(u,d){return u>d?"A":"B"}function p(u,d,m,f,_,x){let y=u,w=d,b="";for(;y!==m||w!==f;)y+=_?1:-1,_&&y>x.cols-1?(b+=x.buffer.translateBufferLineToString(w,!1,u,y),y=0,u=0,w++):!_&&y<0&&(b+=x.buffer.translateBufferLineToString(w,!1,0,u+1),y=x.cols-1,u=y,w--);return b+x.buffer.translateBufferLineToString(w,!1,u,y)}function v(u,d){let m=d?"O":"[";return a.C0.ESC+m+u}function g(u,d){u=Math.floor(u);let m="";for(let f=0;f<u;f++)m+=d;return m}i.moveToCellSequence=function(u,d,m,f){let _=m.buffer.x,x=m.buffer.y;if(!m.buffer.hasScrollback)return(function(b,S,T,R,E,A){return h(S,R,E,A).length===0?"":g(p(b,S,b,S-l(S,E),!1,E).length,v("D",A))})(_,x,0,d,m,f)+h(x,d,m,f)+(function(b,S,T,R,E,A){let B;B=h(S,R,E,A).length>0?R-l(R,E):S;let M=R,H=(function(z,j,C,D,L,k){let U;return U=h(C,D,L,k).length>0?D-l(D,L):j,z<C&&U<=D||z>=C&&U<D?"C":"D"})(b,S,T,R,E,A);return g(p(b,B,T,M,H==="C",E).length,v(H,A))})(_,x,u,d,m,f);let y;if(x===d)return y=_>u?"D":"C",g(Math.abs(_-u),v(y,f));y=x>d?"D":"C";let w=Math.abs(x-d);return g((function(b,S){return S.cols-b})(x>d?u:_,m)+(w-1)*m.cols+1+((x>d?_:u)-1),v(y,f))}},1296:function(o,i,n){var a=this&&this.__decorate||function(A,B,M,H){var z,j=arguments.length,C=j<3?B:H===null?H=Object.getOwnPropertyDescriptor(B,M):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(A,B,M,H);else for(var D=A.length-1;D>=0;D--)(z=A[D])&&(C=(j<3?z(C):j>3?z(B,M,C):z(B,M))||C);return j>3&&C&&Object.defineProperty(B,M,C),C},h=this&&this.__param||function(A,B){return function(M,H){B(M,H,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;let l=n(3787),c=n(2550),p=n(2223),v=n(6171),g=n(6052),u=n(4725),d=n(8055),m=n(8460),f=n(844),_=n(2585),x="xterm-dom-renderer-owner-",y="xterm-rows",w="xterm-fg-",b="xterm-bg-",S="xterm-focus",T="xterm-selection",R=1,E=i.DomRenderer=class extends f.Disposable{constructor(A,B,M,H,z,j,C,D,L,k,U,J,O){super(),this._terminal=A,this._document=B,this._element=M,this._screenElement=H,this._viewportElement=z,this._helperContainer=j,this._linkifier2=C,this._charSizeService=L,this._optionsService=k,this._bufferService=U,this._coreBrowserService=J,this._themeService=O,this._terminalClass=R++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let M of this._rowElements)M.style.width=`${this.dimensions.css.canvas.width}px`,M.style.height=`${this.dimensions.css.cell.height}px`,M.style.lineHeight=`${this.dimensions.css.cell.height}px`,M.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let B=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${y} .xterm-dim { color: ${d.color.multiplyOpacity(A.foreground,.5).css};}`,B+=`${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;}`;let M=`blink_underline_${this._terminalClass}`,H=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;B+=`@keyframes ${M} { 50% { border-bottom-style: hidden; }}`,B+=`@keyframes ${H} { 50% { box-shadow: none; }}`,B+=`@keyframes ${z} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,B+=`${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${M} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(let[j,C]of A.ansi.entries())B+=`${this._terminalSelector} .${w}${j} { color: ${C.css}; }${this._terminalSelector} .${w}${j}.xterm-dim { color: ${d.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${b}${j} { background-color: ${C.css}; }`;B+=`${this._terminalSelector} .${w}${p.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(A.background).css}; }${this._terminalSelector} .${w}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${b}${p.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){let A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,B){for(let M=this._rowElements.length;M<=B;M++){let H=this._document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,B){this._refreshRowElements(A,B),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,B,M){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,B,M),this.renderRows(0,this._bufferService.rows-1),!A||!B)return;this._selectionRenderModel.update(this._terminal,A,B,M);let H=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||C<0)return;let D=this._document.createDocumentFragment();if(M){let L=A[0]>B[0];D.appendChild(this._createSelectionElement(j,L?B[0]:A[0],L?A[0]:B[0],C-j+1))}else{let L=H===j?A[0]:0,k=j===z?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,L,k));let U=C-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,U)),j!==C){let J=z===C?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(C,0,J))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,B,M,H=1){let z=this._document.createElement("div"),j=B*this.dimensions.css.cell.width,C=this.dimensions.css.cell.width*(M-B);return j+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-j),z.style.height=H*this.dimensions.css.cell.height+"px",z.style.top=A*this.dimensions.css.cell.height+"px",z.style.left=`${j}px`,z.style.width=`${C}px`,z}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(let A of this._rowElements)A.replaceChildren()}renderRows(A,B){let M=this._bufferService.buffer,H=M.ybase+M.y,z=Math.min(M.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=A;L<=B;L++){let k=L+M.ydisp,U=this._rowElements[L],J=M.lines.get(k);if(!U||!J)break;U.replaceChildren(...this._rowFactory.createRow(J,k,k===H,C,D,z,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,B,M,H,z,j){M<0&&(A=0),H<0&&(B=0);let C=this._bufferService.rows-1;M=Math.max(Math.min(M,C),0),H=Math.max(Math.min(H,C),0),z=Math.min(z,this._bufferService.cols);let D=this._bufferService.buffer,L=D.ybase+D.y,k=Math.min(D.x,z-1),U=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=M;ee<=H;++ee){let N=ee+D.ydisp,P=this._rowElements[ee],$=D.lines.get(N);if(!P||!$)break;P.replaceChildren(...this._rowFactory.createRow($,N,N===L,J,O,k,U,this.dimensions.css.cell.width,this._widthCache,j?ee===M?A:0:-1,j?(ee===H?B:z)-1:-1))}}};i.DomRenderer=E=a([h(7,_.IInstantiationService),h(8,u.ICharSizeService),h(9,_.IOptionsService),h(10,_.IBufferService),h(11,u.ICoreBrowserService),h(12,u.IThemeService)],E)},3787:function(o,i,n){var a=this&&this.__decorate||function(y,w,b,S){var T,R=arguments.length,E=R<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(y,w,b,S);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(E=(R<3?T(E):R>3?T(w,b,E):T(w,b))||E);return R>3&&E&&Object.defineProperty(w,b,E),E},h=this&&this.__param||function(y,w){return function(b,S){w(b,S,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;let l=n(2223),c=n(643),p=n(511),v=n(2585),g=n(8055),u=n(4725),d=n(4269),m=n(6171),f=n(3734),_=i.DomRendererRowFactory=class{constructor(y,w,b,S,T,R,E){this._document=y,this._characterJoinerService=w,this._optionsService=b,this._coreBrowserService=S,this._coreService=T,this._decorationService=R,this._themeService=E,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,w,b){this._selectionStart=y,this._selectionEnd=w,this._columnSelectMode=b}createRow(y,w,b,S,T,R,E,A,B,M,H){let z=[],j=this._characterJoinerService.getJoinedCharacters(w),C=this._themeService.colors,D,L=y.getNoBgTrimmedLength();b&&L<R+1&&(L=R+1);let k=0,U="",J=0,O=0,ee=0,N=!1,P=0,$=!1,V=0,te=[],Q=M!==-1&&H!==-1;for(let G=0;G<L;G++){y.loadCell(G,this._workCell);let oe=this._workCell.getWidth();if(oe===0)continue;let me=!1,De=G,se=this._workCell;if(j.length>0&&G===j[0][0]){me=!0;let ue=j.shift();se=new d.JoinedCellData(this._workCell,y.translateToString(!0,ue[0],ue[1]),ue[1]-ue[0]),De=ue[1]-1,oe=se.getWidth()}let Te=this._isCellInSelection(G,w),ft=b&&G===R,or=Q&&G>=M&&G<=H,Ot=!1;this._decorationService.forEachDecorationAtCell(G,w,void 0,(ue=>{Ot=!0}));let Tr=se.getChars()||c.WHITESPACE_CELL_CHAR;if(Tr===" "&&(se.isUnderline()||se.isOverline())&&(Tr="\xA0"),V=oe*A-B.get(Tr,se.isBold(),se.isItalic()),D){if(k&&(Te&&$||!Te&&!$&&se.bg===J)&&(Te&&$&&C.selectionForeground||se.fg===O)&&se.extended.ext===ee&&or===N&&V===P&&!ft&&!me&&!Ot){se.isInvisible()?U+=c.WHITESPACE_CELL_CHAR:U+=Tr,k++;continue}k&&(D.textContent=U),D=this._document.createElement("span"),k=0,U=""}else D=this._document.createElement("span");if(J=se.bg,O=se.fg,ee=se.extended.ext,N=or,P=V,$=Te,me&&R>=G&&R<=De&&(R=G),!this._coreService.isCursorHidden&&ft&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&te.push("xterm-cursor-blink"),te.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(se.isBold()&&te.push("xterm-bold"),se.isItalic()&&te.push("xterm-italic"),se.isDim()&&te.push("xterm-dim"),U=se.isInvisible()?c.WHITESPACE_CELL_CHAR:se.getChars()||c.WHITESPACE_CELL_CHAR,se.isUnderline()&&(te.push(`xterm-underline-${se.extended.underlineStyle}`),U===" "&&(U="\xA0"),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let ue=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&ue<8&&(ue+=8),D.style.textDecorationColor=C.ansi[ue].css}se.isOverline()&&(te.push("xterm-overline"),U===" "&&(U="\xA0")),se.isStrikethrough()&&te.push("xterm-strikethrough"),or&&(D.style.textDecoration="underline");let ot=se.getFgColor(),Pr=se.getFgColorMode(),kt=se.getBgColor(),Dr=se.getBgColorMode(),Is=!!se.isInverse();if(Is){let ue=ot;ot=kt,kt=ue;let mt=Pr;Pr=Dr,Dr=mt}let q,Z,ce,ve=!1;switch(this._decorationService.forEachDecorationAtCell(G,w,void 0,(ue=>{ue.options.layer!=="top"&&ve||(ue.backgroundColorRGB&&(Dr=50331648,kt=ue.backgroundColorRGB.rgba>>8&16777215,q=ue.backgroundColorRGB),ue.foregroundColorRGB&&(Pr=50331648,ot=ue.foregroundColorRGB.rgba>>8&16777215,Z=ue.foregroundColorRGB),ve=ue.options.layer==="top")})),!ve&&Te&&(q=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,kt=q.rgba>>8&16777215,Dr=50331648,ve=!0,C.selectionForeground&&(Pr=50331648,ot=C.selectionForeground.rgba>>8&16777215,Z=C.selectionForeground)),ve&&te.push("xterm-decoration-top"),Dr){case 16777216:case 33554432:ce=C.ansi[kt],te.push(`xterm-bg-${kt}`);break;case 50331648:ce=g.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(D,`background-color:#${x((kt>>>0).toString(16),"0",6)}`);break;default:Is?(ce=C.foreground,te.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):ce=C.background}switch(q||se.isDim()&&(q=g.color.multiplyOpacity(ce,.5)),Pr){case 16777216:case 33554432:se.isBold()&&ot<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ot+=8),this._applyMinimumContrast(D,ce,C.ansi[ot],se,q,void 0)||te.push(`xterm-fg-${ot}`);break;case 50331648:let ue=g.channels.toColor(ot>>16&255,ot>>8&255,255&ot);this._applyMinimumContrast(D,ce,ue,se,q,Z)||this._addStyle(D,`color:#${x(ot.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,ce,C.foreground,se,q,Z)||Is&&te.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}te.length&&(D.className=te.join(" "),te.length=0),ft||me||Ot?D.textContent=U:k++,V!==this.defaultSpacing&&(D.style.letterSpacing=`${V}px`),z.push(D),G=De}return D&&k&&(D.textContent=U),z}_applyMinimumContrast(y,w,b,S,T,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(S.getCode()))return!1;let E=this._getContrastCache(S),A;if(T||R||(A=E.getColor(w.rgba,b.rgba)),A===void 0){let B=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);A=g.color.ensureContrastRatio(T||w,R||b,B),E.setColor((T||w).rgba,(R||b).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,w){y.setAttribute("style",`${y.getAttribute("style")||""}${w};`)}_isCellInSelection(y,w){let b=this._selectionStart,S=this._selectionEnd;return!(!b||!S)&&(this._columnSelectMode?b[0]<=S[0]?y>=b[0]&&w>=b[1]&&y<S[0]&&w<=S[1]:y<b[0]&&w>=b[1]&&y>=S[0]&&w<=S[1]:w>b[1]&&w<S[1]||b[1]===S[1]&&w===b[1]&&y>=b[0]&&y<S[0]||b[1]<S[1]&&w===S[1]&&y<S[0]||b[1]<S[1]&&w===b[1]&&y>=b[0])}};function x(y,w,b){for(;y.length<b;)y=w+y;return y}i.DomRendererRowFactory=_=a([h(1,u.ICharacterJoinerService),h(2,v.IOptionsService),h(3,u.ICoreBrowserService),h(4,v.ICoreService),h(5,v.IDecorationService),h(6,u.IThemeService)],_)},2550:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(n,a){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.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let h=n.createElement("span");h.classList.add("xterm-char-measure-element");let l=n.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let c=n.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";let p=n.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[h,l,c,p],this._container.appendChild(h),this._container.appendChild(l),this._container.appendChild(c),this._container.appendChild(p),a.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,a,h,l){n===this._font&&a===this._fontSize&&h===this._weight&&l===this._weightBold||(this._font=n,this._fontSize=a,this._weight=h,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(n,a,h){let l=0;if(!a&&!h&&n.length===1&&(l=n.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let v=this._measure(n,0);return v>0&&(this._flat[l]=v),v}let c=n;a&&(c+="B"),h&&(c+="I");let p=this._holey.get(c);if(p===void 0){let v=0;a&&(v|=1),h&&(v|=2),p=this._measure(n,v),p>0&&this._holey.set(c,p)}return p}_measure(n,a){let h=this._measureElements[a];return h.textContent=n.repeat(32),h.offsetWidth/32}}},2223:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;let a=n(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(o,i)=>{function n(h){return 57508<=h&&h<=57558}function a(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},i.isPowerlineGlyph=n,i.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},i.isEmoji=a,i.allowRescaling=function(h,l,c,p){return l===1&&c>Math.ceil(1.5*p)&&h!==void 0&&h>255&&!a(h)&&!n(h)&&!(function(v){return 57344<=v&&v<=63743})(h)},i.treatGlyphAsBackgroundColor=function(h){return n(h)||(function(l){return 9472<=l&&l<=9631})(h)},i.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}}}},i.computeNextVariantOffset=function(h,l,c=0){return(h-(2*Math.round(l)-c))%(2*Math.round(l))}},6052:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,l,c,p=!1){if(this.selectionStart=l,this.selectionEnd=c,!l||!c||l[0]===c[0]&&l[1]===c[1])return void this.clear();let v=h.buffers.active.ydisp,g=l[1]-v,u=c[1]-v,d=Math.max(g,0),m=Math.min(u,h.rows-1);d>=h.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=g,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=m,this.startCol=l[0],this.endCol=c[0])}isCellSelected(h,l,c){return!!this.hasSelection&&(c-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&c>=this.viewportCappedStartRow&&l<this.endCol&&c<=this.viewportCappedEndRow:l<this.startCol&&c>=this.viewportCappedStartRow&&l>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new n}},456:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.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()){let 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]){let 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(){let n=this.selectionStart,a=this.selectionEnd;return!(!n||!a)&&(n[1]>a[1]||n[1]===a[1]&&n[0]>a[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(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;let l=n(2585),c=n(8460),p=n(844),v=i.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,f,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(m,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){let m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};i.CharSizeService=v=a([h(2,l.IOptionsService)],v);class g extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,_){f!==void 0&&f>0&&_!==void 0&&_>0&&(this._result.width=f,this._result.height=_)}}class u extends g{constructor(f,_,x){super(),this._document=f,this._parentElement=_,this._optionsService=x,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends g{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(o,i,n){var a=this&&this.__decorate||function(d,m,f,_){var x,y=arguments.length,w=y<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,f,_);else for(var b=d.length-1;b>=0;b--)(x=d[b])&&(w=(y<3?x(w):y>3?x(m,f,w):x(m,f))||w);return y>3&&w&&Object.defineProperty(m,f,w),w},h=this&&this.__param||function(d,m){return function(f,_){m(f,_,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;let l=n(3734),c=n(643),p=n(511),v=n(2585);class g extends l.AttributeData{constructor(m,f,_){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=f,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=g;let u=i.CharacterJoinerService=class _p{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(m){let f={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(f),f.id}deregister(m){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===m)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];let f=this._bufferService.buffer.lines.get(m);if(!f||f.length===0)return[];let _=[],x=f.translateToString(!0),y=0,w=0,b=0,S=f.getFg(0),T=f.getBg(0);for(let R=0;R<f.getTrimmedLength();R++)if(f.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==S||this._workCell.bg!==T){if(R-y>1){let E=this._getJoinedRanges(x,b,w,f,y);for(let A=0;A<E.length;A++)_.push(E[A])}y=R,b=w,S=this._workCell.fg,T=this._workCell.bg}w+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){let R=this._getJoinedRanges(x,b,w,f,y);for(let E=0;E<R.length;E++)_.push(R[E])}return _}_getJoinedRanges(m,f,_,x,y){let w=m.substring(f,_),b=[];try{b=this._characterJoiners[0].handler(w)}catch(S){console.error(S)}for(let S=1;S<this._characterJoiners.length;S++)try{let T=this._characterJoiners[S].handler(w);for(let R=0;R<T.length;R++)_p._mergeRanges(b,T[R])}catch(T){console.error(T)}return this._stringRangesToCellRanges(b,x,y),b}_stringRangesToCellRanges(m,f,_){let x=0,y=!1,w=0,b=m[x];if(b){for(let S=_;S<this._bufferService.cols;S++){let T=f.getWidth(S),R=f.getString(S).length||c.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&b[0]<=w&&(b[0]=S,y=!0),b[1]<=w){if(b[1]=S,b=m[++x],!b)break;b[0]<=w?(b[0]=S,y=!0):y=!1}w+=R}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(m,f){let _=!1;for(let x=0;x<m.length;x++){let y=m[x];if(_){if(f[1]<=y[0])return m[x-1][1]=f[1],m;if(f[1]<=y[1])return m[x-1][1]=Math.max(f[1],y[1]),m.splice(x,1),m;m.splice(x,1),x--}else{if(f[1]<=y[0])return m.splice(x,0,f),m;if(f[1]<=y[1])return y[0]=Math.min(f[0],y[0]),m;f[0]<y[1]&&(y[0]=Math.min(f[0],y[0]),_=!0)}}return _?m[m.length-1][1]=f[1]:m.push(f),m}};i.CharacterJoinerService=u=a([h(0,v.IBufferService)],u)},5114:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;let a=n(844),h=n(8460),l=n(3656);class c extends a.Disposable{constructor(g,u,d){super(),this._textarea=g,this._window=u,this.mainDocument=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new p(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,h.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(g){this._window!==g&&(this._window=g,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=c;class p extends a.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;let a=n(844);class h extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{let p=this.linkProviders.indexOf(c);p!==-1&&this.linkProviders.splice(p,1)}}}}i.LinkProviderService=h},8934:function(o,i,n){var a=this&&this.__decorate||function(v,g,u,d){var m,f=arguments.length,_=f<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(v,g,u,d);else for(var x=v.length-1;x>=0;x--)(m=v[x])&&(_=(f<3?m(_):f>3?m(g,u,_):m(g,u))||_);return f>3&&_&&Object.defineProperty(g,u,_),_},h=this&&this.__param||function(v,g){return function(u,d){g(u,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;let l=n(4725),c=n(9806),p=i.MouseService=class{constructor(v,g){this._renderService=v,this._charSizeService=g}getCoords(v,g,u,d,m){return(0,c.getCoords)(window,v,g,u,d,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(v,g){let u=(0,c.getCoordsRelativeToElement)(window,v,g);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};i.MouseService=p=a([h(0,l.IRenderService),h(1,l.ICharSizeService)],p)},3230:function(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;let l=n(6193),c=n(4725),p=n(8460),v=n(844),g=n(7226),u=n(2585),d=i.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,f,_,x,y,w,b,S){super(),this._rowCount=m,this._charSizeService=x,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new p.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new p.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new p.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new p.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((T,R)=>this._renderRows(T,R)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(S.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,f),this.register(b.onWindowChange((T=>this._registerIntersectionObserver(T,f))))}_registerIntersectionObserver(m,f){if("IntersectionObserver"in m){let _=new m.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});_.observe(f),this._observerDisposable.value=(0,v.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,f,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,f,this._rowCount))}_renderRows(m,f){this._renderer.value&&(m=Math.min(m,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(m,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:f}),this._onRender.fire({start:m,end:f}),this._isNextRenderRedrawOnly=!0)}resize(m,f){this._rowCount=f,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((f=>this.refreshRows(f.start,f.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,f))):this._renderer.value.handleResize(m,f),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,f,_){this._selectionState.start=m,this._selectionState.end=f,this._selectionState.columnSelectMode=_,this._renderer.value?.handleSelectionChanged(m,f,_)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};i.RenderService=d=a([h(2,u.IOptionsService),h(3,c.ICharSizeService),h(4,u.IDecorationService),h(5,u.IBufferService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],d)},9312:function(o,i,n){var a=this&&this.__decorate||function(b,S,T,R){var E,A=arguments.length,B=A<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,S,T,R);else for(var M=b.length-1;M>=0;M--)(E=b[M])&&(B=(A<3?E(B):A>3?E(S,T,B):E(S,T))||B);return A>3&&B&&Object.defineProperty(S,T,B),B},h=this&&this.__param||function(b,S){return function(T,R){S(T,R,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;let l=n(9806),c=n(9504),p=n(456),v=n(4725),g=n(8460),u=n(844),d=n(6114),m=n(4841),f=n(511),_=n(2585),x="\xA0",y=new RegExp(x,"g"),w=i.SelectionService=class extends u.Disposable{constructor(b,S,T,R,E,A,B,M,H){super(),this._element=b,this._screenElement=S,this._linkifier=T,this._bufferService=R,this._coreService=E,this._mouseService=A,this._optionsService=B,this._renderService=M,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((z=>this._handleTrim(z))),this.register(this._bufferService.buffers.onBufferActivate((z=>this._handleBufferActivate(z)))),this.enable(),this._model=new p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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(){let b=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!b||!S||b[0]===S[0]&&b[1]===S[1])}get selectionText(){let b=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!b||!S)return"";let T=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(b[0]===S[0])return"";let E=b[0]<S[0]?b[0]:S[0],A=b[0]<S[0]?S[0]:b[0];for(let B=b[1];B<=S[1];B++){let M=T.translateBufferLineToString(B,!0,E,A);R.push(M)}}else{let E=b[1]===S[1]?S[0]:void 0;R.push(T.translateBufferLineToString(b[1],!0,b[0],E));for(let A=b[1]+1;A<=S[1]-1;A++){let B=T.lines.get(A),M=T.translateBufferLineToString(A,!0);B?.isWrapped?R[R.length-1]+=M:R.push(M)}if(b[1]!==S[1]){let A=T.lines.get(S[1]),B=T.translateBufferLineToString(S[1],!0,0,S[0]);A&&A.isWrapped?R[R.length-1]+=B:R.push(B)}}return R.map((E=>E.replace(y," "))).join(d.isWindows?`\r
|
|
8
8
|
`:`
|
|
9
9
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),d.isLinux&&b&&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(b){let S=this._getMouseBufferCoords(b),T=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(T&&R&&S)&&this._areCoordsInSelection(S,T,R)}isCellInSelection(b,S){let T=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!T||!R)&&this._areCoordsInSelection([b,S],T,R)}_areCoordsInSelection(b,S,T){return b[1]>S[1]&&b[1]<T[1]||S[1]===T[1]&&b[1]===S[1]&&b[0]>=S[0]&&b[0]<T[0]||S[1]<T[1]&&b[1]===T[1]&&b[0]<T[0]||S[1]<T[1]&&b[1]===S[1]&&b[0]>=S[0]}_selectWordAtCursor(b,S){let T=this._linkifier.currentLink?.link?.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let R=this._getMouseBufferCoords(b);return!!R&&(this._selectWordAt(R,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,S){this._model.clearSelection(),b=Math.max(b,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){let S=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(b){let S=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1],T=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=T?0:(S>T&&(S-=T),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(b){return d.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){let S=this._getMouseBufferCoords(b);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(b){return b.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;let S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){let R=T.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[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});let b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){let S=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let T=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){let R=(0,c.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let b=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,T=!(!b||!S||b[0]===S[0]&&b[1]===S[1]);T?b&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,S,T)):this._oldHasSelection&&this._fireOnSelectionChange(b,S,T)}_fireOnSelectionChange(b,S,T){this._oldSelectionStart=b,this._oldSelectionEnd=S,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((S=>this._handleTrim(S)))}_convertViewportColToCharacterIndex(b,S){let T=S;for(let R=0;S>=R;R++){let E=b.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:E>1&&S!==R&&(T+=E-1)}return T}setSelection(b,S,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,S],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,S,T=!0,R=!0){if(b[0]>=this._bufferService.cols)return;let E=this._bufferService.buffer,A=E.lines.get(b[1]);if(!A)return;let B=E.translateBufferLineToString(b[1],!1),M=this._convertViewportColToCharacterIndex(A,b[0]),H=M,z=b[0]-M,j=0,C=0,D=0,L=0;if(B.charAt(M)===" "){for(;M>0&&B.charAt(M-1)===" ";)M--;for(;H<B.length&&B.charAt(H+1)===" ";)H++}else{let J=b[0],O=b[0];A.getWidth(J)===0&&(j++,J--),A.getWidth(O)===2&&(C++,O++);let ee=A.getString(O).length;for(ee>1&&(L+=ee-1,H+=ee-1);J>0&&M>0&&!this._isCharWordSeparator(A.loadCell(J-1,this._workCell));){A.loadCell(J-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,J--):N>1&&(D+=N-1,M-=N-1),M--,J--}for(;O<A.length&&H+1<B.length&&!this._isCharWordSeparator(A.loadCell(O+1,this._workCell));){A.loadCell(O+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(C++,O++):N>1&&(L+=N-1,H+=N-1),H++,O++}}H++;let k=M+z-j+D,U=Math.min(this._bufferService.cols,H-M+j+C-D-L);if(S||B.slice(M,H).trim()!==""){if(T&&k===0&&A.getCodePoint(0)!==32){let J=E.lines.get(b[1]-1);if(J&&A.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(O){let ee=this._bufferService.cols-O.start;k-=ee,U+=ee}}}if(R&&k+U===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){let J=E.lines.get(b[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){let O=this._getWordAt([0,b[1]+1],!1,!1,!0);O&&(U+=O.length)}}return{start:k,length:U}}}_selectWordAt(b,S){let T=this._getWordAt(b,S);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[T.start,b[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(b){let S=this._getWordAt(b,!0);if(S){let T=b[1];for(;S.start<0;)S.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,T]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){let S=this._bufferService.buffer.getWrappedRangeForLine(b),T={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(T,this._bufferService.cols)}};i.SelectionService=w=a([h(3,_.IBufferService),h(4,_.ICoreService),h(5,v.IMouseService),h(6,_.IOptionsService),h(7,v.IRenderService),h(8,v.ICoreBrowserService)],w)},4725:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;let a=n(8343);i.ICharSizeService=(0,a.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),i.IMouseService=(0,a.createDecorator)("MouseService"),i.IRenderService=(0,a.createDecorator)("RenderService"),i.ISelectionService=(0,a.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,a.createDecorator)("ThemeService"),i.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(o,i,n){var a=this&&this.__decorate||function(w,b,S,T){var R,E=arguments.length,A=E<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(w,b,S,T);else for(var B=w.length-1;B>=0;B--)(R=w[B])&&(A=(E<3?R(A):E>3?R(b,S,A):R(b,S))||A);return E>3&&A&&Object.defineProperty(b,S,A),A},h=this&&this.__param||function(w,b){return function(S,T){b(S,T,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;let l=n(7239),c=n(8055),p=n(8460),v=n(844),g=n(2585),u=c.css.toColor("#ffffff"),d=c.css.toColor("#000000"),m=c.css.toColor("#ffffff"),f=c.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let w=[c.css.toColor("#2e3436"),c.css.toColor("#cc0000"),c.css.toColor("#4e9a06"),c.css.toColor("#c4a000"),c.css.toColor("#3465a4"),c.css.toColor("#75507b"),c.css.toColor("#06989a"),c.css.toColor("#d3d7cf"),c.css.toColor("#555753"),c.css.toColor("#ef2929"),c.css.toColor("#8ae234"),c.css.toColor("#fce94f"),c.css.toColor("#729fcf"),c.css.toColor("#ad7fa8"),c.css.toColor("#34e2e2"),c.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let S=0;S<216;S++){let T=b[S/36%6|0],R=b[S/6%6|0],E=b[S%6];w.push({css:c.channels.toCss(T,R,E),rgba:c.channels.toRgba(T,R,E)})}for(let S=0;S<24;S++){let T=8+10*S;w.push({css:c.channels.toCss(T,T,T),rgba:c.channels.toRgba(T,T,T)})}return w})());let x=i.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:m,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:c.color.blend(d,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:c.color.blend(d,_),ansi:i.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(w={}){let b=this._colors;if(b.foreground=y(w.foreground,u),b.background=y(w.background,d),b.cursor=y(w.cursor,m),b.cursorAccent=y(w.cursorAccent,f),b.selectionBackgroundTransparent=y(w.selectionBackground,_),b.selectionBackgroundOpaque=c.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=y(w.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=c.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=w.selectionForeground?y(w.selectionForeground,c.NULL_COLOR):void 0,b.selectionForeground===c.NULL_COLOR&&(b.selectionForeground=void 0),c.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=c.color.opacity(b.selectionBackgroundTransparent,.3)),c.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=c.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=i.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=y(w.black,i.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=y(w.red,i.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=y(w.green,i.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=y(w.yellow,i.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=y(w.blue,i.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=y(w.magenta,i.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=y(w.cyan,i.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=y(w.white,i.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=y(w.brightBlack,i.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=y(w.brightRed,i.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=y(w.brightGreen,i.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=y(w.brightYellow,i.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=y(w.brightBlue,i.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=y(w.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=y(w.brightCyan,i.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=y(w.brightWhite,i.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){let S=Math.min(b.ansi.length-16,w.extendedAnsi.length);for(let T=0;T<S;T++)b.ansi[T+16]=y(w.extendedAnsi[T],i.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[w]=this._restoreColors.ansi[w]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(w){w(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(w,b){if(w!==void 0)try{return c.css.toColor(w)}catch{}return b}i.ThemeService=x=a([h(0,g.IOptionsService)],x)},6349:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;let a=n(8460),h=n(844);class l extends h.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new a.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new a.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new a.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;let v=new Array(p);for(let g=0;g<Math.min(p,this.length);g++)v[g]=this._array[this._getCyclicIndex(g)];this._array=v,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let v=this._length;v<p;v++)this._array[v]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,v){this._array[this._getCyclicIndex(p)]=v}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,v,...g){if(v){for(let u=p;u<this._length-v;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+v)];this._length-=v,this.onDeleteEmitter.fire({index:p,amount:v})}for(let u=this._length-1;u>=p;u--)this._array[this._getCyclicIndex(u+g.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<g.length;u++)this._array[this._getCyclicIndex(p+u)]=g[u];if(g.length&&this.onInsertEmitter.fire({index:p,amount:g.length}),this._length+g.length>this._maxLength){let u=this._length+g.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=g.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,v,g){if(!(v<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let d=v-1;d>=0;d--)this.set(p+d+g,this.get(p+d));let u=p+v+g-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<v;u++)this.set(p+u+g,this.get(p+u))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}i.CircularList=l},1439:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function n(a,h=5){if(typeof a!="object")return a;let l=Array.isArray(a)?[]:{};for(let c in a)l[c]=h<=1?a[c]:a[c]&&n(a[c],h-1);return l}},8055:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let n=0,a=0,h=0,l=0;var c,p,v,g,u;function d(f){let _=f.toString(16);return _.length<2?"0"+_:_}function m(f,_){return f<_?(_+.05)/(f+.05):(f+.05)/(_+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(_,x,y,w){return w!==void 0?`#${d(_)}${d(x)}${d(y)}${d(w)}`:`#${d(_)}${d(x)}${d(y)}`},f.toRgba=function(_,x,y,w=255){return(_<<24|x<<16|y<<8|w)>>>0},f.toColor=function(_,x,y,w){return{css:f.toCss(_,x,y,w),rgba:f.toRgba(_,x,y,w)}}})(c||(i.channels=c={})),(function(f){function _(x,y){return l=Math.round(255*y),[n,a,h]=u.toChannels(x.rgba),{css:c.toCss(n,a,h,l),rgba:c.toRgba(n,a,h,l)}}f.blend=function(x,y){if(l=(255&y.rgba)/255,l===1)return{css:y.css,rgba:y.rgba};let w=y.rgba>>24&255,b=y.rgba>>16&255,S=y.rgba>>8&255,T=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return n=T+Math.round((w-T)*l),a=R+Math.round((b-R)*l),h=E+Math.round((S-E)*l),{css:c.toCss(n,a,h),rgba:c.toRgba(n,a,h)}},f.isOpaque=function(x){return(255&x.rgba)==255},f.ensureContrastRatio=function(x,y,w){let b=u.ensureContrastRatio(x.rgba,y.rgba,w);if(b)return c.toColor(b>>24&255,b>>16&255,b>>8&255)},f.opaque=function(x){let y=(255|x.rgba)>>>0;return[n,a,h]=u.toChannels(y),{css:c.toCss(n,a,h),rgba:y}},f.opacity=_,f.multiplyOpacity=function(x,y){return l=255&x.rgba,_(x,l*y/255)},f.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(p||(i.color=p={})),(function(f){let _,x;try{let y=document.createElement("canvas");y.width=1,y.height=1;let w=y.getContext("2d",{willReadFrequently:!0});w&&(_=w,_.globalCompositeOperation="copy",x=_.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),c.toColor(n,a,h);case 5:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),l=parseInt(y.slice(4,5).repeat(2),16),c.toColor(n,a,h,l);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}let w=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return n=parseInt(w[1]),a=parseInt(w[2]),h=parseInt(w[3]),l=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),c.toColor(n,a,h,l);if(!_||!x)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=x,_.fillStyle=y,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[n,a,h,l]=_.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(n,a,h,l),css:y}}})(v||(i.css=v={})),(function(f){function _(x,y,w){let b=x/255,S=y/255,T=w/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}f.relativeLuminance=function(x){return _(x>>16&255,x>>8&255,255&x)},f.relativeLuminance2=_})(g||(i.rgb=g={})),(function(f){function _(y,w,b){let S=y>>24&255,T=y>>16&255,R=y>>8&255,E=w>>24&255,A=w>>16&255,B=w>>8&255,M=m(g.relativeLuminance2(E,A,B),g.relativeLuminance2(S,T,R));for(;M<b&&(E>0||A>0||B>0);)E-=Math.max(0,Math.ceil(.1*E)),A-=Math.max(0,Math.ceil(.1*A)),B-=Math.max(0,Math.ceil(.1*B)),M=m(g.relativeLuminance2(E,A,B),g.relativeLuminance2(S,T,R));return(E<<24|A<<16|B<<8|255)>>>0}function x(y,w,b){let S=y>>24&255,T=y>>16&255,R=y>>8&255,E=w>>24&255,A=w>>16&255,B=w>>8&255,M=m(g.relativeLuminance2(E,A,B),g.relativeLuminance2(S,T,R));for(;M<b&&(E<255||A<255||B<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),A=Math.min(255,A+Math.ceil(.1*(255-A))),B=Math.min(255,B+Math.ceil(.1*(255-B))),M=m(g.relativeLuminance2(E,A,B),g.relativeLuminance2(S,T,R));return(E<<24|A<<16|B<<8|255)>>>0}f.blend=function(y,w){if(l=(255&w)/255,l===1)return w;let b=w>>24&255,S=w>>16&255,T=w>>8&255,R=y>>24&255,E=y>>16&255,A=y>>8&255;return n=R+Math.round((b-R)*l),a=E+Math.round((S-E)*l),h=A+Math.round((T-A)*l),c.toRgba(n,a,h)},f.ensureContrastRatio=function(y,w,b){let S=g.relativeLuminance(y>>8),T=g.relativeLuminance(w>>8);if(m(S,T)<b){if(T<S){let A=_(y,w,b),B=m(S,g.relativeLuminance(A>>8));if(B<b){let M=x(y,w,b);return B>m(S,g.relativeLuminance(M>>8))?A:M}return A}let R=x(y,w,b),E=m(S,g.relativeLuminance(R>>8));if(E<b){let A=_(y,w,b);return E>m(S,g.relativeLuminance(A>>8))?R:A}return R}},f.reduceLuminance=_,f.increaseLuminance=x,f.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(u||(i.rgba=u={})),i.toPaddedHex=d,i.contrastRatio=m},8969:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;let a=n(844),h=n(2585),l=n(4348),c=n(7866),p=n(744),v=n(7302),g=n(6975),u=n(8460),d=n(1753),m=n(1480),f=n(7994),_=n(9282),x=n(5435),y=n(5981),w=n(2660),b=!1;class S extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((R=>{this._onScrollApi?.fire(R.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(R){for(let E in R)this.optionsService.options[E]=R[E]}constructor(R){super(),this._windowsWrappingHeuristics=this.register(new a.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new v.OptionsService(R)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(c.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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((E=>{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((E=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((E,A)=>this._inputHandler.parse(E,A)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(R,E){this._writeBuffer.write(R,E)}writeSync(R,E){this._logService.logLevel<=h.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(R,E)}input(R,E=!0){this.coreService.triggerDataEvent(R,E)}resize(R,E){isNaN(R)||isNaN(E)||(R=Math.max(R,p.MINIMUM_COLS),E=Math.max(E,p.MINIMUM_ROWS),this._bufferService.resize(R,E))}scroll(R,E=!1){this._bufferService.scroll(R,E)}scrollLines(R,E,A){this._bufferService.scrollLines(R,E,A)}scrollPages(R){this.scrollLines(R*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(R){let E=R-this._bufferService.buffer.ydisp;E!==0&&this.scrollLines(E)}registerEscHandler(R,E){return this._inputHandler.registerEscHandler(R,E)}registerDcsHandler(R,E){return this._inputHandler.registerDcsHandler(R,E)}registerCsiHandler(R,E){return this._inputHandler.registerCsiHandler(R,E)}registerOscHandler(R,E){return this._inputHandler.registerOscHandler(R,E)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let R=!1,E=this.optionsService.rawOptions.windowsPty;E&&E.buildNumber!==void 0&&E.buildNumber!==void 0?R=E.backend==="conpty"&&E.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(R=!0),R?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let R=[];R.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)((()=>{for(let E of R)E.dispose()}))}}}i.CoreTerminal=S},8460:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.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 a=0;a<this._listeners.length;a++)if(this._listeners[a]===n)return void this._listeners.splice(a,1)}}})),this._event}fire(n,a){let h=[];for(let l=0;l<this._listeners.length;l++)h.push(this._listeners[l]);for(let l=0;l<h.length;l++)h[l].call(void 0,n,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(n,a){return n((h=>a.fire(h)))},i.runAndSubscribe=function(n,a){return a(void 0),n((h=>a(h)))}},5435:function(o,i,n){var a=this&&this.__decorate||function(j,C,D,L){var k,U=arguments.length,J=U<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,D):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(j,C,D,L);else for(var O=j.length-1;O>=0;O--)(k=j[O])&&(J=(U<3?k(J):U>3?k(C,D,J):k(C,D))||J);return U>3&&J&&Object.defineProperty(C,D,J),J},h=this&&this.__param||function(j,C){return function(D,L){C(D,L,j)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;let l=n(2584),c=n(7116),p=n(2015),v=n(844),g=n(482),u=n(8437),d=n(8460),m=n(643),f=n(511),_=n(3734),x=n(2585),y=n(1480),w=n(6242),b=n(6351),S=n(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function E(j,C){if(j>24)return C.setWinLines||!1;switch(j){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var A;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(i.WindowsOptionsReportType=A={}));let B=0;class M extends v.Disposable{getAttrData(){return this._curAttrData}constructor(C,D,L,k,U,J,O,ee,N=new p.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=D,this._coreService=L,this._logService=k,this._optionsService=U,this._oscLinkService=J,this._coreMouseService=O,this._unicodeService=ee,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,$)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:$.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,$,V)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:$,data:V})})),this._parser.setDcsHandlerFallback(((P,$,V)=>{$==="HOOK"&&(V=V.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:$,payload:V})})),this._parser.setPrintHandler(((P,$,V)=>this.print(P,$,V))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new w.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new w.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new w.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new w.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new w.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new w.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new w.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new w.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new w.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new w.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(let P in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((P,$)=>this.requestStatusString(P,$))))}_preserveStack(C,D,L,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=L,this._parseStack.position=k}_logSlowResolvingAsync(C){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([C,new Promise(((D,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,D){let L,k=this._activeBuffer.x,U=this._activeBuffer.y,J=0,O=this._parseStack.paused;if(O){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(L),L;k=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>R&&(J=this._parseStack.position+R)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,(P=>String.fromCharCode(P))).join("")}"`),typeof C=="string"?C.split("").map((P=>P.charCodeAt(0))):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(C.length,R))),O||this._dirtyRowTracker.clearRange(),C.length>R)for(let P=J;P<C.length;P+=R){let $=P+R<C.length?P+R:C.length,V=typeof C=="string"?this._stringDecoder.decode(C.substring(P,$),this._parseBuffer):this._utf8Decoder.decode(C.subarray(P,$),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,V))return this._preserveStack(k,U,V,P),this._logSlowResolvingAsync(L),L}else if(!O){let P=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,P))return this._preserveStack(k,U,P,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===k&&this._activeBuffer.y===U||this._onCursorMove.fire();let ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(C,D,L){let k,U,J=this._charsetService.charset,O=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,$=this._curAttrData,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-D>0&&V.getWidth(this._activeBuffer.x-1)===2&&V.setCellFromCodepoint(this._activeBuffer.x-1,0,1,$);let te=this._parser.precedingJoinState;for(let Q=D;Q<L;++Q){if(k=C[Q],k<127&&J){let De=J[String.fromCharCode(k)];De&&(k=De.charCodeAt(0))}let G=this._unicodeService.charProperties(k,te);U=y.UnicodeService.extractWidth(G);let oe=y.UnicodeService.extractShouldJoin(G),me=oe?y.UnicodeService.extractWidth(te):0;if(te=G,O&&this._onA11yChar.fire((0,g.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-me>ee){if(N){let De=V,se=this._activeBuffer.x-me;for(this._activeBuffer.x=me,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),V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),me>0&&V instanceof u.BufferLine&&V.copyCellsFrom(De,se,0,me,!1);se<ee;)De.setCellFromCodepoint(se++,0,1,$)}else if(this._activeBuffer.x=ee-1,U===2)continue}if(oe&&this._activeBuffer.x){let De=V.getWidth(this._activeBuffer.x-1)?1:2;V.addCodepointToCell(this._activeBuffer.x-De,k,U);for(let se=U-me;--se>=0;)V.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}else if(P&&(V.insertCells(this._activeBuffer.x,U-me,this._activeBuffer.getNullCell($)),V.getWidth(ee-1)===2&&V.setCellFromCodepoint(ee-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,$)),V.setCellFromCodepoint(this._activeBuffer.x++,k,U,$),U>0)for(;--U;)V.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}this._parser.precedingJoinState=te,this._activeBuffer.x<ee&&L-D>0&&V.getWidth(this._activeBuffer.x)===0&&!V.hasContent(this._activeBuffer.x)&&V.setCellFromCodepoint(this._activeBuffer.x,0,1,$),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,D){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,D):this._parser.registerCsiHandler(C,(L=>!E(L.params[0],this._optionsService.rawOptions.windowOptions)||D(L)))}registerDcsHandler(C,D){return this._parser.registerDcsHandler(C,new b.DcsHandler(D))}registerEscHandler(C,D){return this._parser.registerEscHandler(C,D)}registerOscHandler(C,D){return this._parser.registerOscHandler(C,new w.OscHandler(D))}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(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,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(C,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=C,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+D)}cursorUp(C){let D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){let D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){let D=C.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=C.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=C.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){let D=C.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,D,L,k=!1,U=!1){let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);J.replaceCells(D,L,this._activeBuffer.getNullCell(this._eraseAttrData()),U),k&&(J.isWrapped=!1)}_resetBufferLine(C,D=!1){let L=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),L.isWrapped=!1)}eraseInDisplay(C,D=!1){let L;switch(this._restrictCursor(this._bufferService.cols),C.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,D);L<this._bufferService.rows;L++)this._resetBufferLine(L,D);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,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,D);this._dirtyRowTracker.markDirty(0);break;case 3:let k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(C,D=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let D=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;D--;)this._activeBuffer.lines.splice(U-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(C){this._restrictCursor();let D=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;D--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();let D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();let D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let D=C.params[0]||1;for(;D--;)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(C){let D=C.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let D=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let D=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let D=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let D=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();let D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){let D=this._parser.precedingJoinState;if(!D)return!0;let L=C.params[0]||1,k=y.UnicodeService.extractWidth(D),U=this._activeBuffer.x-k,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),O=new Uint32Array(J.length*L),ee=0;for(let P=0;P<J.length;){let $=J.codePointAt(P)||0;O[ee++]=$,P+=$>65535?2:1}let N=ee;for(let P=1;P<L;++P)O.copyWithin(N,0,ee),N+=ee;return this.print(O,0,N),!0}sendDeviceAttributesPrimary(C){return C.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(C){return C.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.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(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let D=0;D<C.length;D++)switch(C.params[D]){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(),C.params[D]===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(C,D){let L=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:U}=this._coreMouseService,J=this._coreService,{buffers:O,cols:ee}=this._bufferService,{active:N,alt:P}=O,$=this._optionsService.rawOptions,V=oe=>oe?1:2,te=C.params[0];return Q=te,G=D?te===2?4:te===4?V(J.modes.insertMode):te===12?3:te===20?V($.convertEol):0:te===1?V(L.applicationCursorKeys):te===3?$.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:te===6?V(L.origin):te===7?V(L.wraparound):te===8?3:te===9?V(k==="X10"):te===12?V($.cursorBlink):te===25?V(!J.isCursorHidden):te===45?V(L.reverseWraparound):te===66?V(L.applicationKeypad):te===67?4:te===1e3?V(k==="VT200"):te===1002?V(k==="DRAG"):te===1003?V(k==="ANY"):te===1004?V(L.sendFocus):te===1005?4:te===1006?V(U==="SGR"):te===1015?4:te===1016?V(U==="SGR_PIXELS"):te===1048?1:te===47||te===1047||te===1049?V(N===P):te===2004?V(L.bracketedPasteMode):0,J.triggerDataEvent(`${l.C0.ESC}[${D?"":"?"}${Q};${G}$y`),!0;var Q,G}_updateAttrColor(C,D,L,k,U){return D===2?(C|=50331648,C&=-16777216,C|=_.AttributeData.fromColorRGB([L,k,U])):D===5&&(C&=-50331904,C|=33554432|255&L),C}_extractColor(C,D,L){let k=[0,0,-1,0,0,0],U=0,J=0;do{if(k[J+U]=C.params[D+J],C.hasSubParams(D+J)){let O=C.getSubParams(D+J),ee=0;do k[1]===5&&(U=1),k[J+ee+1+U]=O[ee];while(++ee<O.length&&ee+J+1+U<k.length);break}if(k[1]===5&&J+U>=2||k[1]===2&&J+U>=5)break;k[1]&&(U=1)}while(++J+D<C.length&&J+U<k.length);for(let O=2;O<k.length;++O)k[O]===-1&&(k[O]=0);switch(k[0]){case 38:L.fg=this._updateAttrColor(L.fg,k[1],k[3],k[4],k[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,k[1],k[3],k[4],k[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,k[1],k[3],k[4],k[5])}return J}_processUnderline(C,D){D.extended=D.extended.clone(),(!~C||C>5)&&(C=1),D.extended.underlineStyle=C,D.fg|=268435456,C===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(C){C.fg=u.DEFAULT_ATTR_DATA.fg,C.bg=u.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;let D=C.length,L,k=this._curAttrData;for(let U=0;U<D;U++)L=C.params[U],L>=30&&L<=37?(k.fg&=-50331904,k.fg|=16777216|L-30):L>=40&&L<=47?(k.bg&=-50331904,k.bg|=16777216|L-40):L>=90&&L<=97?(k.fg&=-50331904,k.fg|=16777224|L-90):L>=100&&L<=107?(k.bg&=-50331904,k.bg|=16777224|L-100):L===0?this._processSGR0(k):L===1?k.fg|=134217728:L===3?k.bg|=67108864:L===4?(k.fg|=268435456,this._processUnderline(C.hasSubParams(U)?C.getSubParams(U)[0]:1,k)):L===5?k.fg|=536870912:L===7?k.fg|=67108864:L===8?k.fg|=1073741824:L===9?k.fg|=2147483648:L===2?k.bg|=134217728:L===21?this._processUnderline(2,k):L===22?(k.fg&=-134217729,k.bg&=-134217729):L===23?k.bg&=-67108865:L===24?(k.fg&=-268435457,this._processUnderline(0,k)):L===25?k.fg&=-536870913:L===27?k.fg&=-67108865:L===28?k.fg&=-1073741825:L===29?k.fg&=2147483647:L===39?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):L===49?(k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?U+=this._extractColor(C,U,k):L===53?k.bg|=1073741824:L===55?k.bg&=-1073741825:L===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):L===100?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:let D=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${D};${L}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){let D=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${D};${L}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.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(C){let D=C.params[0]||1;switch(D){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"}let L=D%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(C){let D=C.params[0]||1,L;return(C.length<2||(L=C.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(C){if(!E(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;let D=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){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(C){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(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){let D=[],L=C.split(";");for(;L.length>1;){let k=L.shift(),U=L.shift();if(/^\d+$/.exec(k)){let J=parseInt(k);if(z(J))if(U==="?")D.push({type:0,index:J});else{let O=(0,S.parseColor)(U);O&&D.push({type:1,index:J,color:O})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(C){let D=C.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(C,D){this._getCurrentLinkId()&&this._finishHyperlink();let L=C.split(":"),k,U=L.findIndex((J=>J.startsWith("id=")));return U!==-1&&(k=L[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,D){let L=C.split(";");for(let k=0;k<L.length&&!(D>=this._specialColors.length);++k,++D)if(L[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{let U=(0,S.parseColor)(L[k]);U&&this._onColor.fire([{type:1,index:this._specialColors[D],color:U}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;let D=[],L=C.split(";");for(let k=0;k<L.length;++k)if(/^\d+$/.exec(L[k])){let U=parseInt(L[k]);z(U)&&D.push({type:2,index:U})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){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,c.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(T[C[0]],c.CHARSETS[C[1]]||c.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){let C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){let C=new f.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){let L=this._activeBuffer.ybase+this._activeBuffer.y+D,k=this._activeBuffer.lines.get(L);k&&(k.fill(C),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,D){let L=this._bufferService.buffer,k=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${U}${l.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,D){this._dirtyRowTracker.markRangeDirty(C,D)}}i.InputHandler=M;let H=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,C){j>C&&(B=j,j=C,C=B),j<this.start&&(this.start=j),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(j){return 0<=j&&j<256}H=a([h(0,x.IBufferService)],H)},844:(o,i)=>{function n(a){for(let h of a)h.dispose();a.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){let h=this._disposables.indexOf(a);h!==-1&&this._disposables.splice(h,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){this._isDisposed||a===this._value||(this._value?.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},i.toDisposable=function(a){return{dispose:a}},i.disposeArray=n,i.getDisposeArrayDisposable=function(a){return{dispose:()=>n(a)}}},1505:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(h,l,c){this._data[h]||(this._data[h]={}),this._data[h][l]=c}get(h,l){return this._data[h]?this._data[h][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=n,i.FourKeyMap=class{constructor(){this._data=new n}set(a,h,l,c,p){this._data.get(a,h)||this._data.set(a,h,new n),this._data.get(a,h).set(l,c,p)}get(a,h,l,c){return this._data.get(a,h)?.get(l,c)}clear(){this._data.clear()}}},6114:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;let n=i.isNode?"node":navigator.userAgent,a=i.isNode?"node":navigator.platform;i.isFirefox=n.includes("Firefox"),i.isLegacyEdge=n.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(n),i.getSafariVersion=function(){if(!i.isSafari)return 0;let h=n.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),i.isIpad=a==="iPad",i.isIphone=a==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),i.isLinux=a.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(n)},6106:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let n=0;i.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(n=this._search(this._getKey(a)),this._array.splice(n,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;let h=this._getKey(a);if(h===void 0||(n=this._search(h),n===-1)||this._getKey(this._array[n])!==h)return!1;do if(this._array[n]===a)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===h);return!1}*getKeyIterator(a){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===a)}forEachByKey(a,h){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do h(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===a)}values(){return[...this._array].values()}_search(a){let h=0,l=this._array.length-1;for(;l>=h;){let c=h+l>>1,p=this._getKey(this._array[c]);if(p>a)l=c-1;else{if(!(p<a)){for(;c>0&&this._getKey(this._array[c-1])===a;)c--;return c}h=c+1}}return h}}},7226:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;let a=n(6114);class h{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 v=0,g=0,u=p.timeRemaining(),d=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),g=Math.max(v,g),d=p.timeRemaining(),1.5*g>d)return u-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-v))}ms`),void this._start();u=d}this.clear()}}class l extends h{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){let v=Date.now()+p;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},9282:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;let a=n(643);i.updateWindowsModeWrappedState=function(h){let l=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),c=l?.get(h.cols-1),p=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);p&&c&&(p.isWrapped=c[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&c[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){let l=new n;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=n;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){let l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,c=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=c}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=a},9092:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;let a=n(6349),h=n(7226),l=n(3734),c=n(8437),p=n(4634),v=n(511),g=n(643),u=n(4863),d=n(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(m,f,_){this._hasScrollback=m,this._optionsService=f,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=c.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,f){return new c.BufferLine(this._bufferService.cols,this.getNullCell(m),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;let f=m+this._optionsService.rawOptions.scrollback;return f>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:f}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=c.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,f){let _=this.getNullCell(c.DEFAULT_ATTR_DATA),x=0,y=this._getCorrectBufferLength(f);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<m)for(let b=0;b<this.lines.length;b++)x+=+this.lines.get(b).resize(m,_);let w=0;if(this._rows<f)for(let b=this._rows;b<f;b++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new c.BufferLine(m,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new c.BufferLine(m,_)));else for(let b=this._rows;b>f;b--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){let b=this.lines.length-y;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=y}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,f-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(m,f),this._cols>m))for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(m,_);this._cols=m,this._rows=f,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return m}get _isReflowEnabled(){let m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,f){this._cols!==m&&(m>this._cols?this._reflowLarger(m,f):this._reflowSmaller(m,f))}_reflowLarger(m,f){let _=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(c.DEFAULT_ATTR_DATA));if(_.length>0){let x=(0,p.reflowLargerCreateNewLayout)(this.lines,_);(0,p.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(m,f,x.countRemoved)}}_reflowLargerAdjustViewport(m,f,_){let x=this.getNullCell(c.DEFAULT_ATTR_DATA),y=_;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new c.BufferLine(m,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(m,f){let _=this.getNullCell(c.DEFAULT_ATTR_DATA),x=[],y=0;for(let w=this.lines.length-1;w>=0;w--){let b=this.lines.get(w);if(!b||!b.isWrapped&&b.getTrimmedLength()<=m)continue;let S=[b];for(;b.isWrapped&&w>0;)b=this.lines.get(--w),S.unshift(b);let T=this.ybase+this.y;if(T>=w&&T<w+S.length)continue;let R=S[S.length-1].getTrimmedLength(),E=(0,p.reflowSmallerGetNewLineLengths)(S,this._cols,m),A=E.length-S.length,B;B=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);let M=[];for(let L=0;L<A;L++){let k=this.getBlankLine(c.DEFAULT_ATTR_DATA,!0);M.push(k)}M.length>0&&(x.push({start:w+S.length+y,newLines:M}),y+=M.length),S.push(...M);let H=E.length-1,z=E[H];z===0&&(H--,z=E[H]);let j=S.length-A-1,C=R;for(;j>=0;){let L=Math.min(C,z);if(S[H]===void 0)break;if(S[H].copyCellsFrom(S[j],C-L,z-L,L,!0),z-=L,z===0&&(H--,z=E[H]),C-=L,C===0){j--;let k=Math.max(j,0);C=(0,p.getWrappedLineTrimmedLength)(S,k,this._cols)}}for(let L=0;L<S.length;L++)E[L]<m&&S[L].setCell(E[L],_);let D=A-B;for(;D-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+f-1)}if(x.length>0){let w=[],b=[];for(let H=0;H<this.lines.length;H++)b.push(this.lines.get(H));let S=this.lines.length,T=S-1,R=0,E=x[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let H=Math.min(this.lines.maxLength-1,S+y-1);H>=0;H--)if(E&&E.start>T+A){for(let z=E.newLines.length-1;z>=0;z--)this.lines.set(H--,E.newLines[z]);H++,w.push({index:T+1,amount:E.newLines.length}),A+=E.newLines.length,E=x[++R]}else this.lines.set(H,b[T--]);let B=0;for(let H=w.length-1;H>=0;H--)w[H].index+=B,this.lines.onInsertEmitter.fire(w[H]),B+=w[H].amount;let M=Math.max(0,S+y-this.lines.maxLength);M>0&&this.lines.onTrimEmitter.fire(M)}}translateBufferLineToString(m,f,_=0,x){let y=this.lines.get(m);return y?y.translateToString(f,_,x):""}getWrappedRangeForLine(m){let f=m,_=m;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:f,last:_}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===m&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){let f=new u.Marker(m);return this.markers.push(f),f.register(this.lines.onTrim((_=>{f.line-=_,f.line<0&&f.dispose()}))),f.register(this.lines.onInsert((_=>{f.line>=_.index&&(f.line+=_.amount)}))),f.register(this.lines.onDelete((_=>{f.line>=_.index&&f.line<_.index+_.amount&&f.dispose(),f.line>_.index&&(f.line-=_.amount)}))),f.register(f.onDispose((()=>this._removeMarker(f)))),f}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;let a=n(3734),h=n(511),l=n(643),c=n(482);i.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let p=0;class v{constructor(u,d,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);let f=d||h.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let _=0;_<u;++_)this.setCell(_,f);this.length=u}get(u){let d=this._data[3*u+0],m=2097151&d;return[this._data[3*u+1],2097152&d?this._combined[u]:m?(0,c.stringFromCodePoint)(m):"",d>>22,2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):m]}set(u,d){this._data[3*u+1]=d[l.CHAR_DATA_ATTR_INDEX],d[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=d[1],this._data[3*u+0]=2097152|u|d[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=d[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&d}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u]:2097151&d?(0,c.stringFromCodePoint)(2097151&d):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,d){return p=3*u,d.content=this._data[p+0],d.fg=this._data[p+1],d.bg=this._data[p+2],2097152&d.content&&(d.combinedData=this._combined[u]),268435456&d.bg&&(d.extended=this._extendedAttrs[u]),d}setCell(u,d){2097152&d.content&&(this._combined[u]=d.combinedData),268435456&d.bg&&(this._extendedAttrs[u]=d.extended),this._data[3*u+0]=d.content,this._data[3*u+1]=d.fg,this._data[3*u+2]=d.bg}setCellFromCodepoint(u,d,m,f){268435456&f.bg&&(this._extendedAttrs[u]=f.extended),this._data[3*u+0]=d|m<<22,this._data[3*u+1]=f.fg,this._data[3*u+2]=f.bg}addCodepointToCell(u,d,m){let f=this._data[3*u+0];2097152&f?this._combined[u]+=(0,c.stringFromCodePoint)(d):2097151&f?(this._combined[u]=(0,c.stringFromCodePoint)(2097151&f)+(0,c.stringFromCodePoint)(d),f&=-2097152,f|=2097152):f=d|4194304,m&&(f&=-12582913,f|=m<<22),this._data[3*u+0]=f}insertCells(u,d,m){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length-u){let f=new h.CellData;for(let _=this.length-u-d-1;_>=0;--_)this.setCell(u+d+_,this.loadCell(u+_,f));for(let _=0;_<d;++_)this.setCell(u+_,m)}else for(let f=u;f<this.length;++f)this.setCell(f,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(u,d,m){if(u%=this.length,d<this.length-u){let f=new h.CellData;for(let _=0;_<this.length-u-d;++_)this.setCell(u+_,this.loadCell(u+d+_,f));for(let _=this.length-d;_<this.length;++_)this.setCell(_,m)}else for(let f=u;f<this.length;++f)this.setCell(f,m);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,m)}replaceCells(u,d,m,f=!1){if(f)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&!this.isProtected(d)&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.isProtected(u)||this.setCell(u,m),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.setCell(u++,m)}resize(u,d){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let m=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{let f=new Uint32Array(m);f.set(this._data),this._data=f}for(let f=this.length;f<u;++f)this.setCell(f,d)}else{this._data=this._data.subarray(0,m);let f=Object.keys(this._combined);for(let x=0;x<f.length;x++){let y=parseInt(f[x],10);y>=u&&delete this._combined[y]}let _=Object.keys(this._extendedAttrs);for(let x=0;x<_.length;x++){let y=parseInt(_[x],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,d=!1){if(d)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,u);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(let d in u._combined)this._combined[d]=u._combined[d];this._extendedAttrs={};for(let d in u._extendedAttrs)this._extendedAttrs[d]=u._extendedAttrs[d];this.isWrapped=u.isWrapped}clone(){let u=new v(0);u._data=new Uint32Array(this._data),u.length=this.length;for(let d in this._combined)u._combined[d]=this._combined[d];for(let d in this._extendedAttrs)u._extendedAttrs[d]=this._extendedAttrs[d];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,d,m,f,_){let x=u._data;if(_)for(let w=f-1;w>=0;w--){for(let b=0;b<3;b++)this._data[3*(m+w)+b]=x[3*(d+w)+b];268435456&x[3*(d+w)+2]&&(this._extendedAttrs[m+w]=u._extendedAttrs[d+w])}else for(let w=0;w<f;w++){for(let b=0;b<3;b++)this._data[3*(m+w)+b]=x[3*(d+w)+b];268435456&x[3*(d+w)+2]&&(this._extendedAttrs[m+w]=u._extendedAttrs[d+w])}let y=Object.keys(u._combined);for(let w=0;w<y.length;w++){let b=parseInt(y[w],10);b>=d&&(this._combined[b-d+m]=u._combined[b])}}translateToString(u,d,m,f){d=d??0,m=m??this.length,u&&(m=Math.min(m,this.getTrimmedLength())),f&&(f.length=0);let _="";for(;d<m;){let x=this._data[3*d+0],y=2097151&x,w=2097152&x?this._combined[d]:y?(0,c.stringFromCodePoint)(y):l.WHITESPACE_CELL_CHAR;if(_+=w,f)for(let b=0;b<w.length;++b)f.push(d);d+=x>>22||1}return f&&f.push(d),_}}i.BufferLine=v},4841:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(n,a){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 a*(n.end.y-n.start.y)+(n.end.x-n.start.x+1)}},4634:(o,i)=>{function n(a,h,l){if(h===a.length-1)return a[h].getTrimmedLength();let c=!a[h].hasContent(l-1)&&a[h].getWidth(l-1)===1,p=a[h+1].getWidth(0)===2;return c&&p?l-1:l}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(a,h,l,c,p){let v=[];for(let g=0;g<a.length-1;g++){let u=g,d=a.get(++u);if(!d.isWrapped)continue;let m=[a.get(g)];for(;u<a.length&&d.isWrapped;)m.push(d),d=a.get(++u);if(c>=g&&c<u){g+=m.length-1;continue}let f=0,_=n(m,f,h),x=1,y=0;for(;x<m.length;){let b=n(m,x,h),S=b-y,T=l-_,R=Math.min(S,T);m[f].copyCellsFrom(m[x],y,_,R,!1),_+=R,_===l&&(f++,_=0),y+=R,y===b&&(x++,y=0),_===0&&f!==0&&m[f-1].getWidth(l-1)===2&&(m[f].copyCellsFrom(m[f-1],l-1,_++,1,!1),m[f-1].setCell(l-1,p))}m[f].replaceCells(_,l,p);let w=0;for(let b=m.length-1;b>0&&(b>f||m[b].getTrimmedLength()===0);b--)w++;w>0&&(v.push(g+m.length-w),v.push(w)),g+=m.length-1}return v},i.reflowLargerCreateNewLayout=function(a,h){let l=[],c=0,p=h[c],v=0;for(let g=0;g<a.length;g++)if(p===g){let u=h[++c];a.onDeleteEmitter.fire({index:g-v,amount:u}),g+=u-1,v+=u,p=h[++c]}else l.push(g);return{layout:l,countRemoved:v}},i.reflowLargerApplyNewLayout=function(a,h){let l=[];for(let c=0;c<h.length;c++)l.push(a.get(h[c]));for(let c=0;c<l.length;c++)a.set(c,l[c]);a.length=h.length},i.reflowSmallerGetNewLineLengths=function(a,h,l){let c=[],p=a.map(((d,m)=>n(a,m,h))).reduce(((d,m)=>d+m)),v=0,g=0,u=0;for(;u<p;){if(p-u<l){c.push(p-u);break}v+=l;let d=n(a,g,h);v>d&&(v-=d,g++);let m=a[g].getWidth(v-1)===2;m&&v--;let f=m?l-1:l;c.push(f),u+=f}return c},i.getWrappedLineTrimmedLength=n},5295:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;let a=n(8460),h=n(844),l=n(9092);class c extends h.Disposable{constructor(v,g){super(),this._optionsService=v,this._bufferService=g,this._onBufferActivate=this.register(new a.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),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(v,g){this._normal.resize(v,g),this._alt.resize(v,g),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}i.BufferSet=c},511:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;let a=n(482),h=n(643),l=n(3734);class c extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(v){let g=new c;return g.setFromCharData(v),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(v[h.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(v[h.CHAR_DATA_CHAR_INDEX].length===2){let u=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){let d=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&d<=57343?this.content=1024*(u-55296)+d-56320+65536|v[h.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[h.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=v[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=c},643:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;let a=n(8460),h=n(844);class l{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new a.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}i.Marker=l,l._nextId=1},7116:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},i.CHARSETS.A={"#":"\xA3"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},i.CHARSETS.C=i.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},i.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},i.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},i.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},i.CHARSETS.E=i.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},i.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},i.CHARSETS.H=i.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(o,i)=>{var n,a,h;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
10
10
|
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL="\x7F"})(n||(i.C0=n={})),(function(l){l.PAD="\x80",l.HOP="\x81",l.BPH="\x82",l.NBH="\x83",l.IND="\x84",l.NEL="\x85",l.SSA="\x86",l.ESA="\x87",l.HTS="\x88",l.HTJ="\x89",l.VTS="\x8A",l.PLD="\x8B",l.PLU="\x8C",l.RI="\x8D",l.SS2="\x8E",l.SS3="\x8F",l.DCS="\x90",l.PU1="\x91",l.PU2="\x92",l.STS="\x93",l.CCH="\x94",l.MW="\x95",l.SPA="\x96",l.EPA="\x97",l.SOS="\x98",l.SGCI="\x99",l.SCI="\x9A",l.CSI="\x9B",l.ST="\x9C",l.OSC="\x9D",l.PM="\x9E",l.APC="\x9F"})(a||(i.C1=a={})),(function(l){l.ST=`${n.ESC}\\`})(h||(i.C1_ESCAPED=h={}))},7399:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;let a=n(2584),h={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:["'",'"']};i.evaluateKeyboardEvent=function(l,c,p,v){let g={type:0,cancel:!1,key:void 0},u=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:g.key=l.ctrlKey?"\b":a.C0.DEL,l.altKey&&(g.key=a.C0.ESC+g.key);break;case 9:if(l.shiftKey){g.key=a.C0.ESC+"[Z";break}g.key=a.C0.HT,g.cancel=!0;break;case 13:g.key=l.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,g.cancel=!0;break;case 27:g.key=a.C0.ESC,l.altKey&&(g.key=a.C0.ESC+a.C0.ESC),g.cancel=!0;break;case 37:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"D",g.key===a.C0.ESC+"[1;3D"&&(g.key=a.C0.ESC+(p?"b":"[1;5D"))):g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"C",g.key===a.C0.ESC+"[1;3C"&&(g.key=a.C0.ESC+(p?"f":"[1;5C"))):g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"A",p||g.key!==a.C0.ESC+"[1;3A"||(g.key=a.C0.ESC+"[1;5A")):g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"B",p||g.key!==a.C0.ESC+"[1;3B"||(g.key=a.C0.ESC+"[1;5B")):g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(g.key=a.C0.ESC+"[2~");break;case 46:g.key=u?a.C0.ESC+"[3;"+(u+1)+"~":a.C0.ESC+"[3~";break;case 36:g.key=u?a.C0.ESC+"[1;"+(u+1)+"H":c?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:g.key=u?a.C0.ESC+"[1;"+(u+1)+"F":c?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:l.shiftKey?g.type=2:l.ctrlKey?g.key=a.C0.ESC+"[5;"+(u+1)+"~":g.key=a.C0.ESC+"[5~";break;case 34:l.shiftKey?g.type=3:l.ctrlKey?g.key=a.C0.ESC+"[6;"+(u+1)+"~":g.key=a.C0.ESC+"[6~";break;case 112:g.key=u?a.C0.ESC+"[1;"+(u+1)+"P":a.C0.ESC+"OP";break;case 113:g.key=u?a.C0.ESC+"[1;"+(u+1)+"Q":a.C0.ESC+"OQ";break;case 114:g.key=u?a.C0.ESC+"[1;"+(u+1)+"R":a.C0.ESC+"OR";break;case 115:g.key=u?a.C0.ESC+"[1;"+(u+1)+"S":a.C0.ESC+"OS";break;case 116:g.key=u?a.C0.ESC+"[15;"+(u+1)+"~":a.C0.ESC+"[15~";break;case 117:g.key=u?a.C0.ESC+"[17;"+(u+1)+"~":a.C0.ESC+"[17~";break;case 118:g.key=u?a.C0.ESC+"[18;"+(u+1)+"~":a.C0.ESC+"[18~";break;case 119:g.key=u?a.C0.ESC+"[19;"+(u+1)+"~":a.C0.ESC+"[19~";break;case 120:g.key=u?a.C0.ESC+"[20;"+(u+1)+"~":a.C0.ESC+"[20~";break;case 121:g.key=u?a.C0.ESC+"[21;"+(u+1)+"~":a.C0.ESC+"[21~";break;case 122:g.key=u?a.C0.ESC+"[23;"+(u+1)+"~":a.C0.ESC+"[23~";break;case 123:g.key=u?a.C0.ESC+"[24;"+(u+1)+"~":a.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(p&&!v||!l.altKey||l.metaKey)!p||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?g.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(g.key=a.C0.US),l.key==="@"&&(g.key=a.C0.NUL)):l.keyCode===65&&(g.type=1);else{let d=h[l.keyCode],m=d?.[l.shiftKey?1:0];if(m)g.key=a.C0.ESC+m;else if(l.keyCode>=65&&l.keyCode<=90){let f=l.ctrlKey?l.keyCode-64:l.keyCode+32,_=String.fromCharCode(f);l.shiftKey&&(_=_.toUpperCase()),g.key=a.C0.ESC+_}else if(l.keyCode===32)g.key=a.C0.ESC+(l.ctrlKey?a.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let f=l.code.slice(3,4);l.shiftKey||(f=f.toLowerCase()),g.key=a.C0.ESC+f,g.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?g.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?g.key=a.C0.NUL:l.keyCode>=51&&l.keyCode<=55?g.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?g.key=a.C0.DEL:l.keyCode===219?g.key=a.C0.ESC:l.keyCode===220?g.key=a.C0.FS:l.keyCode===221&&(g.key=a.C0.GS)}return g}},482:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},i.utf32ToString=function(n,a=0,h=n.length){let l="";for(let c=a;c<h;++c){let p=n[c];p>65535?(p-=65536,l+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):l+=String.fromCharCode(p)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,a){let h=n.length;if(!h)return 0;let l=0,c=0;if(this._interim){let p=n.charCodeAt(c++);56320<=p&&p<=57343?a[l++]=1024*(this._interim-55296)+p-56320+65536:(a[l++]=this._interim,a[l++]=p),this._interim=0}for(let p=c;p<h;++p){let v=n.charCodeAt(p);if(55296<=v&&v<=56319){if(++p>=h)return this._interim=v,l;let g=n.charCodeAt(p);56320<=g&&g<=57343?a[l++]=1024*(v-55296)+g-56320+65536:(a[l++]=v,a[l++]=g)}else v!==65279&&(a[l++]=v)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,a){let h=n.length;if(!h)return 0;let l,c,p,v,g=0,u=0,d=0;if(this.interim[0]){let _=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let y,w=0;for(;(y=63&this.interim[++w])&&w<4;)x<<=6,x|=y;let b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=b-w;for(;d<S;){if(d>=h)return 0;if(y=n[d++],(192&y)!=128){d--,_=!0;break}this.interim[w++]=y,x<<=6,x|=63&y}_||(b===2?x<128?d--:a[g++]=x:b===3?x<2048||x>=55296&&x<=57343||x===65279||(a[g++]=x):x<65536||x>1114111||(a[g++]=x)),this.interim.fill(0)}let m=h-4,f=d;for(;f<h;){for(;!(!(f<m)||128&(l=n[f])||128&(c=n[f+1])||128&(p=n[f+2])||128&(v=n[f+3]));)a[g++]=l,a[g++]=c,a[g++]=p,a[g++]=v,f+=4;if(l=n[f++],l<128)a[g++]=l;else if((224&l)==192){if(f>=h)return this.interim[0]=l,g;if(c=n[f++],(192&c)!=128){f--;continue}if(u=(31&l)<<6|63&c,u<128){f--;continue}a[g++]=u}else if((240&l)==224){if(f>=h)return this.interim[0]=l,g;if(c=n[f++],(192&c)!=128){f--;continue}if(f>=h)return this.interim[0]=l,this.interim[1]=c,g;if(p=n[f++],(192&p)!=128){f--;continue}if(u=(15&l)<<12|(63&c)<<6|63&p,u<2048||u>=55296&&u<=57343||u===65279)continue;a[g++]=u}else if((248&l)==240){if(f>=h)return this.interim[0]=l,g;if(c=n[f++],(192&c)!=128){f--;continue}if(f>=h)return this.interim[0]=l,this.interim[1]=c,g;if(p=n[f++],(192&p)!=128){f--;continue}if(f>=h)return this.interim[0]=l,this.interim[1]=c,this.interim[2]=p,g;if(v=n[f++],(192&v)!=128){f--;continue}if(u=(7&l)<<18|(63&c)<<12|(63&p)<<6|63&v,u<65536||u>1114111)continue;a[g++]=u}}return g}}},225:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;let a=n(1480),h=[[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]],c;i.UnicodeV6=class{constructor(){if(this.version="6",!c){c=new Uint8Array(65536),c.fill(1),c[0]=0,c.fill(0,1,32),c.fill(0,127,160),c.fill(2,4352,4448),c[9001]=2,c[9002]=2,c.fill(2,11904,42192),c[12351]=1,c.fill(2,44032,55204),c.fill(2,63744,64256),c.fill(2,65040,65050),c.fill(2,65072,65136),c.fill(2,65280,65377),c.fill(2,65504,65511);for(let p=0;p<h.length;++p)c.fill(0,h[p][0],h[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?c[p]:(function(v,g){let u,d=0,m=g.length-1;if(v<g[0][0]||v>g[m][1])return!1;for(;m>=d;)if(u=d+m>>1,v>g[u][1])d=u+1;else{if(!(v<g[u][0]))return!0;m=u-1}return!1})(p,l)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}charProperties(p,v){let g=this.wcwidth(p),u=g===0&&v!==0;if(u){let d=a.UnicodeService.extractWidth(v);d===0?u=!1:d>g&&(g=d)}return a.UnicodeService.createPropertyValue(0,g,u)}}},5981:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;let a=n(8460),h=n(844);class l extends h.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 a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,v){if(v!==void 0&&this._syncCalls>v)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 g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);let u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,v){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(v),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(v)}_innerWrite(p=0,v=!0){let g=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let u=this._writeBuffer[this._bufferOffset],d=this._action(u,v);if(d){let f=_=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(g,_);return void d.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(f)}let m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-g>=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()}}i.WriteBuffer=l},5941:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;let 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})$/,a=/^[\da-f]+$/;function h(l,c){let p=l.toString(16),v=p.length<2?"0"+p:p;switch(c){case 4:return p[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}i.parseColor=function(l){if(!l)return;let c=l.toLowerCase();if(c.indexOf("rgb:")===0){c=c.slice(4);let p=n.exec(c);if(p){let v=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/v*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/v*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/v*255)]}}else if(c.indexOf("#")===0&&(c=c.slice(1),a.exec(c)&&[3,6,9,12].includes(c.length))){let p=c.length/3,v=[0,0,0];for(let g=0;g<3;++g){let u=parseInt(c.slice(p*g,p*g+p),16);v[g]=p===1?u<<4:p===2?u:p===3?u>>4:u>>8}return v}},i.toRgbString=function(l,c=16){let[p,v,g]=l;return`rgb:${h(p,c)}/${h(v,c)}/${h(g,c)}`}},5770:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;let a=n(482),h=n(8742),l=n(5770),c=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=c,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}registerHandler(v,g){this._handlers[v]===void 0&&(this._handlers[v]=[]);let u=this._handlers[v];return u.push(g),{dispose:()=>{let d=u.indexOf(g);d!==-1&&u.splice(d,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=c,this._ident=0}hook(v,g){if(this.reset(),this._ident=v,this._active=this._handlers[v]||c,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(v,g,u){if(this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].put(v,g,u);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(v,g,u))}unhook(v,g=!0){if(this._active.length){let u=!1,d=this._active.length-1,m=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,u=g,m=this._stack.fallThrough,this._stack.paused=!1),!m&&u===!1){for(;d>=0&&(u=this._active[d].unhook(v),u!==!0);d--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,u;d--}for(;d>=0;d--)if(u=this._active[d].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",v);this._active=c,this._ident=0}};let p=new h.Params;p.addParam(0),i.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=p,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():p,this._data="",this._hitLimit=!1}put(v,g,u){this._hitLimit||(this._data+=(0,a.utf32ToString)(v,g,u),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let g=!1;if(this._hitLimit)g=!1;else if(v&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((u=>(this._params=p,this._data="",this._hitLimit=!1,u)));return this._params=p,this._data="",this._hitLimit=!1,g}}},2015:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;let a=n(844),h=n(8742),l=n(6242),c=n(6351);class p{constructor(d){this.table=new Uint8Array(d)}setDefault(d,m){this.table.fill(d<<4|m)}add(d,m,f,_){this.table[m<<8|d]=f<<4|_}addMany(d,m,f,_){for(let x=0;x<d.length;x++)this.table[m<<8|d[x]]=f<<4|_}}i.TransitionTable=p;let v=160;i.VT500_TRANSITION_TABLE=(function(){let u=new p(4095),d=Array.apply(null,Array(256)).map(((w,b)=>b)),m=(w,b)=>d.slice(w,b),f=m(32,127),_=m(0,24);_.push(25),_.push.apply(_,m(28,32));let x=m(0,14),y;for(y in u.setDefault(1,0),u.addMany(f,0,2,0),x)u.addMany([24,26,153,154],y,3,0),u.addMany(m(128,144),y,3,0),u.addMany(m(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(_,0,3,0),u.addMany(_,1,3,1),u.add(127,1,0,1),u.addMany(_,8,0,8),u.addMany(_,3,3,3),u.add(127,3,0,3),u.addMany(_,4,3,4),u.add(127,4,0,4),u.addMany(_,6,3,6),u.addMany(_,5,3,5),u.add(127,5,0,5),u.addMany(_,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(f,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(m(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(f,7,0,7),u.addMany(_,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(m(64,127),3,7,0),u.addMany(m(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(m(48,60),4,8,4),u.addMany(m(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(m(32,64),6,0,6),u.add(127,6,0,6),u.addMany(m(64,127),6,0,0),u.addMany(m(32,48),3,9,5),u.addMany(m(32,48),5,9,5),u.addMany(m(48,64),5,0,6),u.addMany(m(64,127),5,7,0),u.addMany(m(32,48),4,9,5),u.addMany(m(32,48),1,9,2),u.addMany(m(32,48),2,9,2),u.addMany(m(48,127),2,10,0),u.addMany(m(48,80),1,10,0),u.addMany(m(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(m(96,127),1,10,0),u.add(80,1,11,9),u.addMany(_,9,0,9),u.add(127,9,0,9),u.addMany(m(28,32),9,0,9),u.addMany(m(32,48),9,9,12),u.addMany(m(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(_,11,0,11),u.addMany(m(32,128),11,0,11),u.addMany(m(28,32),11,0,11),u.addMany(_,10,0,10),u.add(127,10,0,10),u.addMany(m(28,32),10,0,10),u.addMany(m(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(m(32,48),10,9,12),u.addMany(_,12,0,12),u.add(127,12,0,12),u.addMany(m(28,32),12,0,12),u.addMany(m(32,48),12,9,12),u.addMany(m(48,64),12,0,11),u.addMany(m(64,127),12,12,13),u.addMany(m(64,127),10,12,13),u.addMany(m(64,127),9,12,13),u.addMany(_,13,13,13),u.addMany(f,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(v,0,2,0),u.add(v,8,5,8),u.add(v,6,0,6),u.add(v,11,0,11),u.add(v,13,13,13),u})();class g extends a.Disposable{constructor(d=i.VT500_TRANSITION_TABLE){super(),this._transitions=d,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,f,_)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,f)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,a.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new c.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(d,m=[64,126]){let f=0;if(d.prefix){if(d.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=d.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(d.intermediates){if(d.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<d.intermediates.length;++x){let y=d.intermediates.charCodeAt(x);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=y}}if(d.final.length!==1)throw new Error("final must be a single byte");let _=d.final.charCodeAt(0);if(m[0]>_||_>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return f<<=8,f|=_,f}identToString(d){let m=[];for(;d;)m.push(String.fromCharCode(255&d)),d>>=8;return m.reverse().join("")}setPrintHandler(d){this._printHandler=d}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(d,m){let f=this._identifier(d,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);let _=this._escHandlers[f];return _.push(m),{dispose:()=>{let x=_.indexOf(m);x!==-1&&_.splice(x,1)}}}clearEscHandler(d){this._escHandlers[this._identifier(d,[48,126])]&&delete this._escHandlers[this._identifier(d,[48,126])]}setEscHandlerFallback(d){this._escHandlerFb=d}setExecuteHandler(d,m){this._executeHandlers[d.charCodeAt(0)]=m}clearExecuteHandler(d){this._executeHandlers[d.charCodeAt(0)]&&delete this._executeHandlers[d.charCodeAt(0)]}setExecuteHandlerFallback(d){this._executeHandlerFb=d}registerCsiHandler(d,m){let f=this._identifier(d);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);let _=this._csiHandlers[f];return _.push(m),{dispose:()=>{let x=_.indexOf(m);x!==-1&&_.splice(x,1)}}}clearCsiHandler(d){this._csiHandlers[this._identifier(d)]&&delete this._csiHandlers[this._identifier(d)]}setCsiHandlerFallback(d){this._csiHandlerFb=d}registerDcsHandler(d,m){return this._dcsParser.registerHandler(this._identifier(d),m)}clearDcsHandler(d){this._dcsParser.clearHandler(this._identifier(d))}setDcsHandlerFallback(d){this._dcsParser.setHandlerFallback(d)}registerOscHandler(d,m){return this._oscParser.registerHandler(d,m)}clearOscHandler(d){this._oscParser.clearHandler(d)}setOscHandlerFallback(d){this._oscParser.setHandlerFallback(d)}setErrorHandler(d){this._errorHandler=d}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(d,m,f,_,x){this._parseStack.state=d,this._parseStack.handlers=m,this._parseStack.handlerPos=f,this._parseStack.transition=_,this._parseStack.chunkPos=x}parse(d,m,f){let _,x=0,y=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let b=this._parseStack.handlers,S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&S>-1){for(;S>=0&&(_=b[S](this._params),_!==!0);S--)if(_ instanceof Promise)return this._parseStack.handlerPos=S,_}this._parseStack.handlers=[];break;case 4:if(f===!1&&S>-1){for(;S>=0&&(_=b[S](),_!==!0);S--)if(_ instanceof Promise)return this._parseStack.handlerPos=S,_}this._parseStack.handlers=[];break;case 6:if(x=d[this._parseStack.chunkPos],_=this._dcsParser.unhook(x!==24&&x!==26,f),_)return _;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=d[this._parseStack.chunkPos],_=this._oscParser.end(x!==24&&x!==26,f),_)return _;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=w;b<m;++b){switch(x=d[b],y=this._transitions.table[this.currentState<<8|(x<160?x:v)],y>>4){case 2:for(let A=b+1;;++A){if(A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,b,A),b=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,b,A),b=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,b,A),b=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,b,A),b=A-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let S=this._csiHandlers[this._collect<<8|x],T=S?S.length-1:-1;for(;T>=0&&(_=S[T](this._params),_!==!0);T--)if(_ instanceof Promise)return this._preserveStack(3,S,T,y,b),_;T<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++b<m&&(x=d[b])>47&&x<60);b--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:let R=this._escHandlers[this._collect<<8|x],E=R?R.length-1:-1;for(;E>=0&&(_=R[E](),_!==!0);E--)if(_ instanceof Promise)return this._preserveStack(4,R,E,y,b),_;E<0&&this._escHandlerFb(this._collect<<8|x),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|x,this._params);break;case 13:for(let A=b+1;;++A)if(A>=m||(x=d[A])===24||x===26||x===27||x>127&&x<v){this._dcsParser.put(d,b,A),b=A-1;break}break;case 14:if(_=this._dcsParser.unhook(x!==24&&x!==26),_)return this._preserveStack(6,[],0,y,b),_;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let A=b+1;;A++)if(A>=m||(x=d[A])<32||x>127&&x<v){this._oscParser.put(d,b,A),b=A-1;break}break;case 6:if(_=this._oscParser.end(x!==24&&x!==26),_)return this._preserveStack(5,[],0,y,b),_;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}i.EscapeSequenceParser=g},6242:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;let a=n(5770),h=n(482),l=[];i.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(c,p){this._handlers[c]===void 0&&(this._handlers[c]=[]);let v=this._handlers[c];return v.push(p),{dispose:()=>{let g=v.indexOf(p);g!==-1&&v.splice(g,1)}}}clearHandler(c){this._handlers[c]&&delete this._handlers[c]}setHandlerFallback(c){this._handlerFb=c}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let c=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;c>=0;--c)this._active[c].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].start();else this._handlerFb(this._id,"START")}_put(c,p,v){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(c,p,v);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(c,p,v))}start(){this.reset(),this._state=1}put(c,p,v){if(this._state!==3){if(this._state===1)for(;p<v;){let g=c[p++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&v-p>0&&this._put(c,p,v)}}end(c,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,g=this._active.length-1,u=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,v=p,u=this._stack.fallThrough,this._stack.paused=!1),!u&&v===!1){for(;g>=0&&(v=this._active[g].end(c),v!==!0);g--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,v;g--}for(;g>=0;g--)if(v=this._active[g].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",c);this._active=l,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(c){this._handler=c,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(c,p,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(c,p,v),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(c){let p=!1;if(this._hitLimit)p=!1;else if(c&&(p=this._handler(this._data),p instanceof Promise))return p.then((v=>(this._data="",this._hitLimit=!1,v)));return this._data="",this._hitLimit=!1,p}}},8742:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;let n=2147483647;class a{static fromArray(l){let c=new a;if(!l.length)return c;for(let p=Array.isArray(l[0])?1:0;p<l.length;++p){let v=l[p];if(Array.isArray(v))for(let g=0;g<v.length;++g)c.addSubParam(v[g]);else c.addParam(v)}return c}constructor(l=32,c=32){if(this.maxLength=l,this.maxSubParamsLength=c,c>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(c),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let l=new a(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){let l=[];for(let c=0;c<this.length;++c){l.push(this.params[c]);let p=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-p>0&&l.push(Array.prototype.slice.call(this._subParams,p,v))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>n?n:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>n?n:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){let c=this._subParamsIdx[l]>>8,p=255&this._subParamsIdx[l];return p-c>0?this._subParams.subarray(c,p):null}getSubParamsAll(){let l={};for(let c=0;c<this.length;++c){let p=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-p>0&&(l[c]=this._subParams.slice(p,v))}return l}addDigit(l){let c;if(this._rejectDigits||!(c=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let p=this._digitIsSub?this._subParams:this.params,v=p[c-1];p[c-1]=~v?Math.min(10*v+l,n):l}}i.Params=a},5741:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let n=this._addons.length-1;n>=0;n--)this._addons[n].instance.dispose()}loadAddon(n,a){let h={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(h),a.dispose=()=>this._wrappedAddonDispose(h),a.activate(n)}_wrappedAddonDispose(n){if(n.isDisposed)return;let a=-1;for(let h=0;h<this._addons.length;h++)if(this._addons[h]===n){a=h;break}if(a===-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(a,1)}}},8771:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;let a=n(3785),h=n(511);i.BufferApiView=class{constructor(l,c){this._buffer=l,this.type=c}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){let c=this._buffer.lines.get(l);if(c)return new a.BufferLineApiView(c)}getNullCell(){return new h.CellData}}},3785:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;let a=n(511);i.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,l){if(!(h<0||h>=this._line.length))return l?(this._line.loadCell(h,l),l):this._line.loadCell(h,new a.CellData)}translateToString(h,l,c){return this._line.translateToString(h,l,c)}}},8285:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;let a=n(8771),h=n(8460),l=n(844);class c extends l.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new a.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new a.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)}}i.BufferNamespaceApi=c},7975:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(n){this._core=n}registerCsiHandler(n,a){return this._core.registerCsiHandler(n,(h=>a(h.toArray())))}addCsiHandler(n,a){return this.registerCsiHandler(n,a)}registerDcsHandler(n,a){return this._core.registerDcsHandler(n,((h,l)=>a(h,l.toArray())))}addDcsHandler(n,a){return this.registerDcsHandler(n,a)}registerEscHandler(n,a){return this._core.registerEscHandler(n,a)}addEscHandler(n,a){return this.registerEscHandler(n,a)}registerOscHandler(n,a){return this._core.registerOscHandler(n,a)}addOscHandler(n,a){return this.registerOscHandler(n,a)}}},7090:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.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(o,i,n){var a=this&&this.__decorate||function(u,d,m,f){var _,x=arguments.length,y=x<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,m):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,f);else for(var w=u.length-1;w>=0;w--)(_=u[w])&&(y=(x<3?_(y):x>3?_(d,m,y):_(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,f){d(m,f,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;let l=n(8460),c=n(844),p=n(5295),v=n(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let g=i.BufferService=class extends c.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(u,this))}resize(u,d){this.cols=u,this.rows=d,this.buffers.resize(u,d),this._onResize.fire({cols:u,rows:d})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,d=!1){let m=this.buffer,f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===u.fg&&f.getBg(0)===u.bg||(f=m.getBlankLine(u,d),this._cachedBlankLine=f),f.isWrapped=d;let _=m.ybase+m.scrollTop,x=m.ybase+m.scrollBottom;if(m.scrollTop===0){let y=m.lines.isFull;x===m.lines.length-1?y?m.lines.recycle().copyFrom(f):m.lines.push(f.clone()):m.lines.splice(x+1,0,f.clone()),y?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{let y=x-_+1;m.lines.shiftElements(_+1,y-1,-1),m.lines.set(x,f.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(u,d,m){let f=this.buffer;if(u<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else u+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);let _=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+u,f.ybase),0),_!==f.ydisp&&(d||this._onScroll.fire(f.ydisp))}};i.BufferService=g=a([h(0,v.IOptionsService)],g)},7994:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.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,a){this._charsets[n]=a,this.glevel===n&&(this.charset=a)}}},1753:function(o,i,n){var a=this&&this.__decorate||function(f,_,x,y){var w,b=arguments.length,S=b<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,_,x,y);else for(var T=f.length-1;T>=0;T--)(w=f[T])&&(S=(b<3?w(S):b>3?w(_,x,S):w(_,x))||S);return b>3&&S&&Object.defineProperty(_,x,S),S},h=this&&this.__param||function(f,_){return function(x,y){_(x,y,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;let l=n(2585),c=n(8460),p=n(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function g(f,_){let x=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(x|=64,x|=f.action):(x|=3&f.button,4&f.button&&(x|=64),8&f.button&&(x|=128),f.action===32?x|=32:f.action!==0||_||(x|=3)),x}let u=String.fromCharCode,d={DEFAULT:f=>{let _=[g(f,!1)+32,f.col+32,f.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${u(_[0])}${u(_[1])}${u(_[2])}`},SGR:f=>{let _=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${g(f,!0)};${f.col};${f.row}${_}`},SGR_PIXELS:f=>{let _=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${g(f,!0)};${f.x};${f.y}${_}`}},m=i.CoreMouseService=class extends p.Disposable{constructor(f,_){super(),this._bufferService=f,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new c.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let x of Object.keys(v))this.addProtocol(x,v[x]);for(let x of Object.keys(d))this.addEncoding(x,d[x]);this.reset()}addProtocol(f,_){this._protocols[f]=_}addEncoding(f,_){this._encodings[f]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;let _=this._encodings[this._activeEncoding](f);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,_,x){if(x){if(f.x!==_.x||f.y!==_.y)return!1}else if(f.col!==_.col||f.row!==_.row)return!1;return f.button===_.button&&f.action===_.action&&f.ctrl===_.ctrl&&f.alt===_.alt&&f.shift===_.shift}};i.CoreMouseService=m=a([h(0,l.IBufferService),h(1,l.ICoreService)],m)},6975:function(o,i,n){var a=this&&this.__decorate||function(m,f,_,x){var y,w=arguments.length,b=w<3?f:x===null?x=Object.getOwnPropertyDescriptor(f,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,f,_,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(b=(w<3?y(b):w>3?y(f,_,b):y(f,_))||b);return w>3&&b&&Object.defineProperty(f,_,b),b},h=this&&this.__param||function(m,f){return function(_,x){f(_,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;let l=n(1439),c=n(8460),p=n(844),v=n(2585),g=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=i.CoreService=class extends p.Disposable{constructor(m,f,_){super(),this._bufferService=m,this._logService=f,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new c.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new c.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}reset(){this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}triggerDataEvent(m,f=!1){if(this._optionsService.rawOptions.disableStdin)return;let _=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((f=>f.charCodeAt(0))))),this._onBinary.fire(m))}};i.CoreService=d=a([h(0,v.IBufferService),h(1,v.ILogService),h(2,v.IOptionsService)],d)},9074:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;let a=n(8055),h=n(8460),l=n(844),c=n(6106),p=0,v=0;class g extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new c.SortedList((m=>m?.marker.line)),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;let f=new u(m);if(f){let _=f.marker.onDispose((()=>f.dispose()));f.onDispose((()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),_.dispose())})),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(let m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,f,_){let x=0,y=0;for(let w of this._decorations.getKeyIterator(f))x=w.options.x??0,y=x+(w.options.width??1),m>=x&&m<y&&(!_||(w.options.layer??"bottom")===_)&&(yield w)}forEachDecorationAtCell(m,f,_,x){this._decorations.forEachByKey(f,(y=>{p=y.options.x??0,v=p+(y.options.width??1),m>=p&&m<v&&(!_||(y.options.layer??"bottom")===_)&&x(y)}))}}i.DecorationService=g;class u extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=a.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=a.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;let a=n(2585),h=n(8343);class l{constructor(...p){this._entries=new Map;for(let[v,g]of p)this.set(v,g)}set(p,v){let g=this._entries.get(p);return this._entries.set(p,v),g}forEach(p){for(let[v,g]of this._entries.entries())p(v,g)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}i.ServiceCollection=l,i.InstantiationService=class{constructor(){this._services=new l,this._services.set(a.IInstantiationService,this)}setService(c,p){this._services.set(c,p)}getService(c){return this._services.get(c)}createInstance(c,...p){let v=(0,h.getServiceDependencies)(c).sort(((d,m)=>d.index-m.index)),g=[];for(let d of v){let m=this._services.get(d.id);if(!m)throw new Error(`[createInstance] ${c.name} depends on UNKNOWN service ${d.id}.`);g.push(m)}let u=v.length>0?v[0].index:p.length;if(p.length!==u)throw new Error(`[createInstance] First service dependency of ${c.name} at position ${u+1} conflicts with ${p.length} static arguments`);return new c(...p,...g)}}},7866:function(o,i,n){var a=this&&this.__decorate||function(u,d,m,f){var _,x=arguments.length,y=x<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,m):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,f);else for(var w=u.length-1;w>=0;w--)(_=u[w])&&(y=(x<3?_(y):x>3?_(d,m,y):_(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,f){d(m,f,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;let l=n(844),c=n(2585),p={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF},v,g=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),v=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let d=0;d<u.length;d++)typeof u[d]=="function"&&(u[d]=u[d]())}_log(u,d,m){this._evalLazyOptionalParams(m),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+d,...m)}trace(u,...d){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,u,d)}debug(u,...d){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,u,d)}info(u,...d){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,u,d)}warn(u,...d){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,u,d)}error(u,...d){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,u,d)}};i.LogService=g=a([h(0,c.IOptionsService)],g),i.setTraceLogger=function(u){v=u},i.traceCall=function(u,d,m){if(typeof m.value!="function")throw new Error("not supported");let f=m.value;m.value=function(..._){if(v.logLevel!==c.LogLevelEnum.TRACE)return f.apply(this,_);v.trace(`GlyphRenderer#${f.name}(${_.map((y=>JSON.stringify(y))).join(", ")})`);let x=f.apply(this,_);return v.trace(`GlyphRenderer#${f.name} return`,x),x}}},7302:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;let a=n(8460),h=n(844),l=n(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let c=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends h.Disposable{constructor(g){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;let u={...i.DEFAULT_OPTIONS};for(let d in g)if(d in u)try{let m=g[d];u[d]=this._sanitizeAndValidateOption(d,m)}catch(m){console.error(m)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,h.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,u){return this.onOptionChange((d=>{d===g&&u(this.rawOptions[g])}))}onMultipleOptionChange(g,u){return this.onOptionChange((d=>{g.indexOf(d)!==-1&&u()}))}_setupOptions(){let g=d=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);return this.rawOptions[d]},u=(d,m)=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);m=this._sanitizeAndValidateOption(d,m),this.rawOptions[d]!==m&&(this.rawOptions[d]=m,this._onOptionChange.fire(d))};for(let d in this.rawOptions){let m={get:g.bind(this,d),set:u.bind(this,d)};Object.defineProperty(this.options,d,m)}}_sanitizeAndValidateOption(g,u){switch(g){case"cursorStyle":if(u||(u=i.DEFAULT_OPTIONS[g]),!(function(d){return d==="block"||d==="underline"||d==="bar"})(u))throw new Error(`"${u}" is not a valid value for ${g}`);break;case"wordSeparator":u||(u=i.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=c.includes(u)?u:i.DEFAULT_OPTIONS[g];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${g} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${g} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}i.OptionsService=p},2660:function(o,i,n){var a=this&&this.__decorate||function(p,v,g,u){var d,m=arguments.length,f=m<3?v:u===null?u=Object.getOwnPropertyDescriptor(v,g):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(p,v,g,u);else for(var _=p.length-1;_>=0;_--)(d=p[_])&&(f=(m<3?d(f):m>3?d(v,g,f):d(v,g))||f);return m>3&&f&&Object.defineProperty(v,g,f),f},h=this&&this.__param||function(p,v){return function(g,u){v(g,u,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;let l=n(2585),c=i.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){let v=this._bufferService.buffer;if(p.id===void 0){let _=v.addMarker(v.ybase+v.y),x={data:p,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(x,_))),this._dataByLinkId.set(x.id,x),x.id}let g=p,u=this._getEntryIdKey(g),d=this._entriesWithId.get(u);if(d)return this.addLineToLink(d.id,v.ybase+v.y),d.id;let m=v.addMarker(v.ybase+v.y),f={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(f,m))),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(p,v){let g=this._dataByLinkId.get(p);if(g&&g.lines.every((u=>u.line!==v))){let u=this._bufferService.buffer.addMarker(v);g.lines.push(u),u.onDispose((()=>this._removeMarkerFromLink(g,u)))}}getLinkData(p){return this._dataByLinkId.get(p)?.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,v){let g=p.lines.indexOf(v);g!==-1&&(p.lines.splice(g,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};i.OscLinkService=c=a([h(0,l.IBufferService)],c)},8343:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;let n="di$target",a="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(h){return h[a]||[]},i.createDecorator=function(h){if(i.serviceRegistry.has(h))return i.serviceRegistry.get(h);let l=function(c,p,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,u,d){u[n]===u?u[a].push({id:g,index:d}):(u[a]=[{id:g,index:d}],u[n]=u)})(l,c,v)};return l.toString=()=>h,i.serviceRegistry.set(h,l),l}},2585:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;let a=n(8343);var h;i.IBufferService=(0,a.createDecorator)("BufferService"),i.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),i.ICoreService=(0,a.createDecorator)("CoreService"),i.ICharsetService=(0,a.createDecorator)("CharsetService"),i.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(h||(i.LogLevelEnum=h={})),i.ILogService=(0,a.createDecorator)("LogService"),i.IOptionsService=(0,a.createDecorator)("OptionsService"),i.IOscLinkService=(0,a.createDecorator)("OscLinkService"),i.IUnicodeService=(0,a.createDecorator)("UnicodeService"),i.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;let a=n(8460),h=n(225);class l{static extractShouldJoin(p){return(1&p)!=0}static extractWidth(p){return p>>1&3}static extractCharKind(p){return p>>3}static createPropertyValue(p,v,g=!1){return(16777215&p)<<3|(3&v)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;let p=new h.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let v=0,g=0,u=p.length;for(let d=0;d<u;++d){let m=p.charCodeAt(d);if(55296<=m&&m<=56319){if(++d>=u)return v+this.wcwidth(m);let x=p.charCodeAt(d);56320<=x&&x<=57343?m=1024*(m-55296)+x-56320+65536:v+=this.wcwidth(x)}let f=this.charProperties(m,g),_=l.extractWidth(f);l.extractShouldJoin(f)&&(_-=l.extractWidth(g)),v+=_,g=f}return v}charProperties(p,v){return this._activeProvider.charProperties(p,v)}}i.UnicodeService=l}},t={};function r(o){var i=t[o];if(i!==void 0)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;let i=r(9042),n=r(3236),a=r(844),h=r(5741),l=r(8285),c=r(7975),p=r(7090),v=["cols","rows"];class g extends a.Disposable{constructor(d){super(),this._core=this.register(new n.Terminal(d)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};let m=_=>this._core.options[_],f=(_,x)=>{this._checkReadonlyOptions(_),this._core.options[_]=x};for(let _ in this._core.options){let x={get:m.bind(this,_),set:f.bind(this,_)};Object.defineProperty(this._publicOptions,_,x)}}_checkReadonlyOptions(d){if(v.includes(d))throw new Error(`Option "${d}" 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 c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new p.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let d=this._core.coreService.decPrivateModes,m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:d.applicationCursorKeys,applicationKeypadMode:d.applicationKeypad,bracketedPasteMode:d.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:d.origin,reverseWraparoundMode:d.reverseWraparound,sendFocusMode:d.sendFocus,wraparoundMode:d.wraparound}}get options(){return this._publicOptions}set options(d){for(let m in d)this._publicOptions[m]=d[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(d,m=!0){this._core.input(d,m)}resize(d,m){this._verifyIntegers(d,m),this._core.resize(d,m)}open(d){this._core.open(d)}attachCustomKeyEventHandler(d){this._core.attachCustomKeyEventHandler(d)}attachCustomWheelEventHandler(d){this._core.attachCustomWheelEventHandler(d)}registerLinkProvider(d){return this._core.registerLinkProvider(d)}registerCharacterJoiner(d){return this._checkProposedApi(),this._core.registerCharacterJoiner(d)}deregisterCharacterJoiner(d){this._checkProposedApi(),this._core.deregisterCharacterJoiner(d)}registerMarker(d=0){return this._verifyIntegers(d),this._core.registerMarker(d)}registerDecoration(d){return this._checkProposedApi(),this._verifyPositiveIntegers(d.x??0,d.width??0,d.height??0),this._core.registerDecoration(d)}hasSelection(){return this._core.hasSelection()}select(d,m,f){this._verifyIntegers(d,m,f),this._core.select(d,m,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(d,m){this._verifyIntegers(d,m),this._core.selectLines(d,m)}dispose(){super.dispose()}scrollLines(d){this._verifyIntegers(d),this._core.scrollLines(d)}scrollPages(d){this._verifyIntegers(d),this._core.scrollPages(d)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(d){this._verifyIntegers(d),this._core.scrollToLine(d)}clear(){this._core.clear()}write(d,m){this._core.write(d,m)}writeln(d,m){this._core.write(d),this._core.write(`\r
|
|
11
|
-
`,m)}paste(d){this._core.paste(d)}refresh(d,m){this._verifyIntegers(d,m),this._core.refresh(d,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(d){this._addonManager.loadAddon(this,d)}static get strings(){return i}_verifyIntegers(...d){for(let m of d)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...d){for(let m of d)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}o.Terminal=g})(),s})()))});var Hx={};zn(Hx,{apply:()=>wx,inject:()=>yx});module.exports=of(Hx);var ne=require("react");var qe=require("react"),sr=require("@deepseek-ai/dsh-client-ui-primitives"),xp=Ms(Un(),1);var lr="/ssh-local/v1",ar=class extends Error{constructor(r,s,o){super(s);this.status=r;this.body=o;this.name="ApiError"}};async function ae(e,t={}){let r=t.method??"GET",s=await fetch(`${lr}${e}`,{...t,headers:{Accept:"application/json",...r==="GET"?{}:{"Content-Type":"application/json","X-DSH-SSH-Request":"1"},...t.headers}});if(s.status===204)return;let o=await s.json().catch(()=>({}));if(!s.ok)throw new ar(s.status,typeof o.error=="string"?o.error:`HTTP ${s.status}`,o);return o}function jn(){return ae("/profiles")}function Al(){return ae("/ftp-profiles")}function Il(){return ae("/file-transfer/endpoints")}function Ll(e,t,r){let s=new URLSearchParams({paneId:e,endpointId:t});return r!==void 0&&s.set("path",r),ae(`/file-transfer/directory?${s.toString()}`)}function Bs(e){return ae("/file-transfer/delete",{method:"POST",body:JSON.stringify(e)})}function Ol(e){return ae("/file-transfer/move",{method:"POST",body:JSON.stringify(e)})}function Ml(){return ae("/file-transfer/jobs")}function Fs(e){return ae("/file-transfer/jobs",{method:"POST",body:JSON.stringify(e)})}function Bl(e){return ae(`/file-transfer/jobs/${encodeURIComponent(e)}`,{method:"DELETE"})}function Fl(){return ae("/vault")}function Nl(){return ae("/proxies")}function zl(){return ae("/forwards")}function wi(e){return ae(`/injections?sessionId=${encodeURIComponent(e)}`)}function Hl(e){return ae(`/profiles/${encodeURIComponent(e)}/projects`)}function Ul(e,t){return ae(`/profiles/${encodeURIComponent(e)}/projects`,{method:"POST",body:JSON.stringify({project:t})})}function jl(e,t,r){return ae(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({project:r})})}function $l(e,t){return ae(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"DELETE"})}function Si(e){return ae(`/injections/${encodeURIComponent(e.sessionId)}`,{method:"PUT",body:JSON.stringify(e)})}function Vl(e){return ae(`/activity?sessionId=${encodeURIComponent(e)}`)}function Wl(e){return`${lr}/activity/events?sessionId=${encodeURIComponent(e)}`}function ql(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t});return r!==void 0&&s.set("path",r),ae(`/activity/files?${s.toString()}`)}function Kl(e,t){let r=new URLSearchParams({sessionId:e});return t!==void 0&&r.set("path",t),ae(`/activity/local-directory?${r.toString()}`)}function Xl(e,t){let r=new URLSearchParams({sessionId:e,path:t});return ae(`/activity/local-file?${r.toString()}`)}function Jl(e,t,r){return ae("/activity/local-delete",{method:"POST",body:JSON.stringify({sessionId:e,directory:t,paths:r})})}function Gl(e,t,r=!1){let s=new URLSearchParams({sessionId:e,path:t});return r&&s.set("inline","1"),`${lr}/activity/local-download?${s.toString()}`}function Yl(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t,path:r});return ae(`/activity/file?${s.toString()}`)}function Ql(e,t,r,s=!1){let o=new URLSearchParams({sessionId:e,profileId:t,path:r});return s&&o.set("inline","1"),`${lr}/activity/download?${o.toString()}`}function Zl(e,t="~"){let r=new URLSearchParams({path:t});return ae(`/profiles/${encodeURIComponent(e)}/sftp/directory?${r.toString()}`)}function eh(e,t){let r=new URLSearchParams({path:t});return ae(`/profiles/${encodeURIComponent(e)}/sftp/file?${r.toString()}`)}function th(e,t,r=!1){let s=new URLSearchParams({path:t});return r&&s.set("inline","1"),`${lr}/profiles/${encodeURIComponent(e)}/sftp/download?${s.toString()}`}async function $n(e,t,r,s=!1){let o=new URLSearchParams({directory:t,name:r.name});s&&o.set("overwrite","1");let i=await fetch(`${lr}/profiles/${encodeURIComponent(e)}/sftp/upload?${o.toString()}`,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/octet-stream","X-DSH-SSH-Request":"1"},body:r}),n=await i.json().catch(()=>({}));if(!i.ok)throw new ar(i.status,typeof n.error=="string"?n.error:`HTTP ${i.status}`,n);return n}function rh(e,t,r,s){return ae(`/activity/terminals/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({sessionId:e,text:r,sequence:s})})}function sh(e,t,r){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return ae(`/activity/terminals/${encodeURIComponent(t)}/output?${s.toString()}`)}function ih(e,t,r=0){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return`${lr}/activity/terminals/${encodeURIComponent(t)}/stream?${s.toString()}`}function nh(e,t=0){let r=new URLSearchParams({cursor:String(t)});return`${lr}/terminals/${encodeURIComponent(e)}/stream?${r.toString()}`}function oh(e,t,r,s){return ae(`/activity/terminals/${encodeURIComponent(t)}/resize`,{method:"POST",body:JSON.stringify({sessionId:e,cols:r,rows:s})})}function ah(e,t){let r=new URLSearchParams({sessionId:e});return ae(`/activity/terminals/${encodeURIComponent(t)}?${r.toString()}`,{method:"DELETE"})}function lh(e,t,r){return ae("/activity/directory",{method:"PUT",body:JSON.stringify({sessionId:e,profileId:t,cwd:r})})}function Kt(e){return`${e.username}@${e.host}:${e.port}`}var xe=require("react");function hh(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var af=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hf={};function ki(e,t){return((t||hf).jsx?lf:af).test(e)}var cf=/[ \t\n\f\r]/g;function Vn(e){return typeof e=="object"?e.type==="text"?ch(e.value):!1:ch(e)}function ch(e){return e.replace(cf,"")===""}var Xt=class{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}};Xt.prototype.normal={};Xt.prototype.property={};Xt.prototype.space=void 0;function Wn(e,t){let r={},s={};for(let o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Xt(r,s,t)}function Ns(e){return e.toLowerCase()}var We=class{constructor(t,r){this.attribute=r,this.property=t}};We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;var zs={};zn(zs,{boolean:()=>fe,booleanish:()=>Me,commaOrSpaceSeparated:()=>at,commaSeparated:()=>Jt,number:()=>Y,overloadedBoolean:()=>Ci,spaceSeparated:()=>Se});var df=0,fe=Ir(),Me=Ir(),Ci=Ir(),Y=Ir(),Se=Ir(),Jt=Ir(),at=Ir();function Ir(){return 2**++df}var qn=Object.keys(zs),Lr=class extends We{constructor(t,r,s,o){let i=-1;if(super(t,r),dh(this,"space",o),typeof s=="number")for(;++i<qn.length;){let n=qn[i];dh(this,qn[i],(s&zs[n])===zs[n])}}};Lr.prototype.defined=!0;function dh(e,t,r){r&&(e[t]=r)}function Ct(e){let t={},r={};for(let[s,o]of Object.entries(e.properties)){let i=new Lr(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,r[Ns(s)]=s,r[Ns(i.attribute)]=s}return new Xt(t,r,e.space)}var Kn=Ct({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Se,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:Y,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Se,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Me,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ei(e,t){return t in e?e[t]:t}function Ti(e,t){return Ei(e,t.toLowerCase())}var uh=Ct({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jt,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alpha:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:Se,autoFocus:fe,autoPlay:fe,blocking:Se,capture:null,charSet:null,checked:fe,cite:null,className:Se,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:Me,controls:fe,controlsList:Se,coords:Y|Jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Ci,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:Se,height:Y,hidden:Ci,high:Y,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:Se,itemRef:Se,itemScope:fe,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:Y,pattern:null,ping:Se,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:Se,required:fe,reversed:fe,rows:Y,rowSpan:Y,sandbox:Se,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootCustomElementRegistry:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shadowRootSerializable:fe,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:Me,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Se,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:fe,disablePictureInPicture:fe,disableRemotePlayback:fe,exportParts:Jt,part:Se,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:Ti});var ph=Ct({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:at,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Se,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jt,g2:Jt,glyphName:Jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Se,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ei});var Xn=Ct({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Jn=Ct({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ti});var Gn=Ct({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Yn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var uf=/[A-Z]/g,fh=/-[a-z]/g,pf=/^data[-\w.:]+$/i;function Qn(e,t){let r=Ns(t),s=t,o=We;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&pf.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(fh,mf);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!fh.test(i)){let n=i.replace(uf,ff);n.charAt(0)!=="-"&&(n="-"+n),t="data"+n}}o=Lr}return new o(s,t)}function ff(e){return"-"+e.toLowerCase()}function mf(e){return e.charAt(1).toUpperCase()}var mh=Wn([Kn,uh,Xn,Jn,Gn],"html"),Pi=Wn([Kn,ph,Xn,Jn,Gn],"svg");function gh(e){return e.join(" ").trim()}var Ah=Ms(Th(),1);var Ri=Ph("end"),ls=Ph("start");function Ph(e){return t;function t(r){let s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function to(e){let t=ls(e),r=Ri(e);if(t&&r)return{start:t,end:r}}function hr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dh(e.position):"start"in e||"end"in e?Dh(e):"line"in e||"column"in e?ro(e):""}function ro(e){return Rh(e&&e.line)+":"+Rh(e&&e.column)}function Dh(e){return ro(e&&e.start)+"-"+ro(e&&e.end)}function Rh(e){return e&&typeof e=="number"?e:1}var ze=class extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",i={},n=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?o=t:!i.cause&&t&&(n=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){let h=s.indexOf(":");h===-1?i.ruleId=s:(i.source=s.slice(0,h),i.ruleId=s.slice(h+1))}if(!i.place&&i.ancestors&&i.ancestors){let h=i.ancestors[i.ancestors.length-1];h&&(i.place=h.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=hr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=n&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ze.prototype.file="";ze.prototype.name="";ze.prototype.reason="";ze.prototype.message="";ze.prototype.stack="";ze.prototype.column=void 0;ze.prototype.line=void 0;ze.prototype.ancestors=void 0;ze.prototype.cause=void 0;ze.prototype.fatal=void 0;ze.prototype.place=void 0;ze.prototype.ruleId=void 0;ze.prototype.source=void 0;var so={}.hasOwnProperty,Uf=new Map,jf=/[A-Z]/g,$f=new Set(["table","tbody","thead","tfoot","tr"]),Vf=new Set(["td","th"]),Ih="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function io(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Qf(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=Yf(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pi:mh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Lh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Lh(e,t,r){if(t.type==="element")return Wf(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qf(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Xf(e,t,r);if(t.type==="mdxjsEsm")return Kf(e,t);if(t.type==="root")return Jf(e,t,r);if(t.type==="text")return Gf(e,t)}function Wf(e,t,r){let s=e.schema,o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=Mh(e,t.tagName,!1),n=Zf(e,t),a=oo(e,t);return $f.has(t.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!Vn(h):!0})),Oh(e,n,i,t),no(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function qf(e,t){if(t.data&&t.data.estree&&e.evaluater){let s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Us(e,t.position)}function Kf(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Us(e,t.position)}function Xf(e,t,r){let s=e.schema,o=s;t.name==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:Mh(e,t.name,!0),n=em(e,t),a=oo(e,t);return Oh(e,n,i,t),no(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function Jf(e,t,r){let s={};return no(s,oo(e,t)),e.create(t,e.Fragment,s,r)}function Gf(e,t){return t.value}function Oh(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function no(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function Yf(e,t,r){return s;function s(o,i,n,a){let l=Array.isArray(n.children)?r:t;return a?l(i,n,a):l(i,n)}}function Qf(e,t){return r;function r(s,o,i,n){let a=Array.isArray(i.children),h=ls(s);return t(o,i,n,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Zf(e,t){let r={},s,o;for(o in t.properties)if(o!=="children"&&so.call(t.properties,o)){let i=tm(e,o,t.properties[o]);if(i){let[n,a]=i;e.tableCellAlignToStyle&&n==="align"&&typeof a=="string"&&Vf.has(t.tagName)?s=a:r[n]=a}}if(s){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function em(e,t){let r={};for(let s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){let i=s.data.estree.body[0];i.type;let n=i.expression;n.type;let a=n.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else Us(e,t.position);else{let o=s.name,i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){let a=s.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Us(e,t.position);else i=s.value===null?!0:s.value;r[o]=i}return r}function oo(e,t){let r=[],s=-1,o=e.passKeys?new Map:Uf;for(;++s<t.children.length;){let i=t.children[s],n;if(e.passKeys){let h=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(h){let l=o.get(h)||0;n=h+"-"+l,o.set(h,l+1)}}let a=Lh(e,i,n);a!==void 0&&r.push(a)}return r}function tm(e,t,r){let s=Qn(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?hh(r):gh(r)),s.property==="style"){let o=typeof r=="object"?r:rm(e,String(r));return e.stylePropertyNameCase==="css"&&(o=sm(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?Yn[s.property]||s.property:s.attribute,r]}}function rm(e,t){try{return(0,Ah.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let s=r,o=new ze("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Ih+"#cannot-parse-style-attribute",o}}function Mh(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,n;for(;++i<o.length;){let a=ki(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};n=n?{type:"MemberExpression",object:n,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}s=n}else s=ki(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){let o=s.value;return so.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);Us(e)}function Us(e,t){let r=new ze("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ih+"#cannot-handle-mdx-estrees-without-createevaluater",r}function sm(e){let t={},r;for(r in e)so.call(e,r)&&(t[im(r)]=e[r]);return t}function im(e){let t=e.replace(jf,nm);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nm(e){return"-"+e.toLowerCase()}var js={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var us=require("react/jsx-runtime"),ld=require("react");var om={};function Mr(e,t){let r=t||om,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Fh(e,s,o)}function Fh(e,t,r){if(am(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Bh(e.children,t,r)}return Array.isArray(e)?Bh(e,t,r):""}function Bh(e,t,r){let s=[],o=-1;for(;++o<e.length;)s[o]=Fh(e[o],t,r);return s.join("")}function am(e){return!!(e&&typeof e=="object")}var Nh=document.createElement("i");function hs(e){let t="&"+e+";";Nh.innerHTML=t;let r=Nh.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function He(e,t,r,s){let o=e.length,i=0,n;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)n=Array.from(s),n.unshift(t,r),e.splice(...n);else for(r&&e.splice(t,r);i<s.length;)n=s.slice(i,i+1e4),n.unshift(t,0),e.splice(...n),i+=1e4,t+=1e4}function tt(e,t){return e.length>0?(He(e,e.length,0,t),e):t}var zh={}.hasOwnProperty;function Ai(e){let t={},r=-1;for(;++r<e.length;)lm(t,e[r]);return t}function lm(e,t){let r;for(r in t){let o=(zh.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],n;if(i)for(n in i){zh.call(o,n)||(o[n]=[]);let a=i[n];hm(o[n],Array.isArray(a)?a:a?[a]:[])}}}function hm(e,t){let r=-1,s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);He(e,0,0,s)}function Ii(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Je(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var $e=cr(/[A-Za-z]/),Be=cr(/[\dA-Za-z]/),Hh=cr(/[#-'*+\--9=?A-Z^-~]/);function Br(e){return e!==null&&(e<32||e===127)}var $s=cr(/\d/),Uh=cr(/[\dA-Fa-f]/),jh=cr(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function be(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}var Fr=cr(/\p{P}|\p{S}/u),Mt=cr(/\s/);function cr(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Et(e){let t=[],r=-1,s=0,o=0;for(;++r<e.length;){let i=e.charCodeAt(r),n="";if(i===37&&Be(e.charCodeAt(r+1))&&Be(e.charCodeAt(r+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(n=String.fromCharCode(i));else if(i>55295&&i<57344){let a=e.charCodeAt(r+1);i<56320&&a>56319&&a<57344?(n=String.fromCharCode(i,a),o=1):n="\uFFFD"}else n=String.fromCharCode(i);n&&(t.push(e.slice(s,r),encodeURIComponent(n)),s=r+o+1,n=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function le(e,t,r,s){let o=s?s-1:Number.POSITIVE_INFINITY,i=0;return n;function n(h){return de(h)?(e.enter(r),a(h)):t(h)}function a(h){return de(h)&&i++<o?(e.consume(h),a):(e.exit(r),t(h))}}var $h={tokenize:cm};function cm(e){let t=e.attempt(this.parser.constructs.contentInitial,s,o),r;return t;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){let h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,n(a)}function n(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ie(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),n)}}var Wh={tokenize:dm},Vh={tokenize:um};function dm(e){let t=this,r=[],s=0,o,i,n;return a;function a(x){if(s<r.length){let y=r[s];return t.containerState=y[1],e.attempt(y[0].continuation,h,l)(x)}return l(x)}function h(x){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();let y=t.events.length,w=y,b;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){b=t.events[w][1].end;break}f(s);let S=y;for(;S<t.events.length;)t.events[S][1].end={...b},S++;return He(t.events,w+1,0,t.events.slice(y)),t.events.length=S,l(x)}return a(x)}function l(x){if(s===r.length){if(!o)return v(x);if(o.currentConstruct&&o.currentConstruct.concrete)return u(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vh,c,p)(x)}function c(x){return o&&_(),f(s),v(x)}function p(x){return t.parser.lazy[t.now().line]=s!==r.length,n=t.now().offset,u(x)}function v(x){return t.containerState={},e.attempt(Vh,g,u)(x)}function g(x){return s++,r.push([t.currentConstruct,t.containerState]),v(x)}function u(x){if(x===null){o&&_(),f(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),d(x)}function d(x){if(x===null){m(e.exit("chunkFlow"),!0),f(0),e.consume(x);return}return ie(x)?(e.consume(x),m(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(x),d)}function m(x,y){let w=t.sliceStream(x);if(y&&w.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(w),t.parser.lazy[x.start.line]){let b=o.events.length;for(;b--;)if(o.events[b][1].start.offset<n&&(!o.events[b][1].end||o.events[b][1].end.offset>n))return;let S=t.events.length,T=S,R,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(R){E=t.events[T][1].end;break}R=!0}for(f(s),b=S;b<t.events.length;)t.events[b][1].end={...E},b++;He(t.events,T+1,0,t.events.slice(S)),t.events.length=b}}function f(x){let y=r.length;for(;y-- >x;){let w=r[y];t.containerState=w[1],w[0].exit.call(t,e)}r.length=x}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function um(e,t,r){return le(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gt(e){if(e===null||be(e)||Mt(e))return 1;if(Fr(e))return 2}function dr(e,t,r){let s=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!s.includes(i)&&(t=i(t,r),s.push(i))}return t}var Vs={name:"attention",resolveAll:pm,tokenize:fm};function pm(e,t){let r=-1,s,o,i,n,a,h,l,c;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let p={...e[s][1].end},v={...e[r][1].start};qh(p,-h),qh(v,h),n={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[s][1].end}},a={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},i={type:h>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...n.start},end:{...a.end}},e[s][1].end={...n.start},e[r][1].start={...a.end},l=[],e[s][1].end.offset-e[s][1].start.offset&&(l=tt(l,[["enter",e[s][1],t],["exit",e[s][1],t]])),l=tt(l,[["enter",o,t],["enter",n,t],["exit",n,t],["enter",i,t]]),l=tt(l,dr(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),l=tt(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,l=tt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,He(e,s-1,r-s+3,l),r=s+l.length-c-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function fm(e,t){let r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=Gt(s),i;return n;function n(h){return i=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===i)return e.consume(h),a;let l=e.exit("attentionSequence"),c=Gt(h),p=!c||c===2&&o||r.includes(h),v=!o||o===2&&c||r.includes(s);return l._open=!!(i===42?p:p&&(o||!v)),l._close=!!(i===42?v:v&&(c||!p)),t(h)}}function qh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ao={name:"autolink",tokenize:mm};function mm(e,t,r){let s=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return $e(g)?(e.consume(g),n):g===64?r(g):l(g)}function n(g){return g===43||g===45||g===46||Be(g)?(s=1,a(g)):l(g)}function a(g){return g===58?(e.consume(g),s=0,h):(g===43||g===45||g===46||Be(g))&&s++<32?(e.consume(g),a):(s=0,l(g))}function h(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Br(g)?r(g):(e.consume(g),h)}function l(g){return g===64?(e.consume(g),c):Hh(g)?(e.consume(g),l):r(g)}function c(g){return Be(g)?p(g):r(g)}function p(g){return g===46?(e.consume(g),s=0,c):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||Be(g))&&s++<63){let u=g===45?v:p;return e.consume(g),u}return r(g)}}var Bt={partial:!0,tokenize:gm};function gm(e,t,r){return s;function s(i){return de(i)?le(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ie(i)?t(i):r(i)}}var Li={continuation:{tokenize:_m},exit:bm,name:"blockQuote",tokenize:vm};function vm(e,t,r){let s=this;return o;function o(n){if(n===62){let a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(n),e.exit("blockQuoteMarker"),i}return r(n)}function i(n){return de(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function _m(e,t,r){let s=this;return o;function o(n){return de(n)?le(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):i(n)}function i(n){return e.attempt(Li,t,r)(n)}}function bm(e){e.exit("blockQuote")}var Oi={name:"characterEscape",tokenize:xm};function xm(e,t,r){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return jh(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var Mi={name:"characterReference",tokenize:ym};function ym(e,t,r){let s=this,o=0,i,n;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,n=Be,c(p))}function l(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,n=Uh,c):(e.enter("characterReferenceValue"),i=7,n=$s,c(p))}function c(p){if(p===59&&o){let v=e.exit("characterReferenceValue");return n===Be&&!hs(s.sliceSerialize(v))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return n(p)&&o++<i?(e.consume(p),c):r(p)}}var Kh={partial:!0,tokenize:Sm},Bi={concrete:!0,name:"codeFenced",tokenize:wm};function wm(e,t,r){let s=this,o={partial:!0,tokenize:w},i=0,n=0,a;return h;function h(b){return l(b)}function l(b){let S=s.events[s.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(b)}function c(b){return b===a?(n++,e.consume(b),c):n<3?r(b):(e.exit("codeFencedFenceSequence"),de(b)?le(e,p,"whitespace")(b):p(b))}function p(b){return b===null||ie(b)?(e.exit("codeFencedFence"),s.interrupt?t(b):e.check(Kh,d,y)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||ie(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(b)):de(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,g,"whitespace")(b)):b===96&&b===a?r(b):(e.consume(b),v)}function g(b){return b===null||ie(b)?p(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(b))}function u(b){return b===null||ie(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(b)):b===96&&b===a?r(b):(e.consume(b),u)}function d(b){return e.attempt(o,y,m)(b)}function m(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),f}function f(b){return i>0&&de(b)?le(e,_,"linePrefix",i+1)(b):_(b)}function _(b){return b===null||ie(b)?e.check(Kh,d,y)(b):(e.enter("codeFlowValue"),x(b))}function x(b){return b===null||ie(b)?(e.exit("codeFlowValue"),_(b)):(e.consume(b),x)}function y(b){return e.exit("codeFenced"),t(b)}function w(b,S,T){let R=0;return E;function E(z){return b.enter("lineEnding"),b.consume(z),b.exit("lineEnding"),A}function A(z){return b.enter("codeFencedFence"),de(z)?le(b,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):B(z)}function B(z){return z===a?(b.enter("codeFencedFenceSequence"),M(z)):T(z)}function M(z){return z===a?(R++,b.consume(z),M):R>=n?(b.exit("codeFencedFenceSequence"),de(z)?le(b,H,"whitespace")(z):H(z)):T(z)}function H(z){return z===null||ie(z)?(b.exit("codeFencedFence"),S(z)):T(z)}}}function Sm(e,t,r){let s=this;return o;function o(n){return n===null?r(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}var Ws={name:"codeIndented",tokenize:Cm},km={partial:!0,tokenize:Em};function Cm(e,t,r){let s=this;return o;function o(l){return e.enter("codeIndented"),le(e,i,"linePrefix",5)(l)}function i(l){let c=s.events[s.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):r(l)}function n(l){return l===null?h(l):ie(l)?e.attempt(km,n,h)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||ie(l)?(e.exit("codeFlowValue"),n(l)):(e.consume(l),a)}function h(l){return e.exit("codeIndented"),t(l)}}function Em(e,t,r){let s=this;return o;function o(n){return s.parser.lazy[s.now().line]?r(n):ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):le(e,i,"linePrefix",5)(n)}function i(n){let a=s.events[s.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):ie(n)?o(n):r(n)}}var lo={name:"codeText",previous:Pm,resolve:Tm,tokenize:Dm};function Tm(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function Pm(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Dm(e,t,r){let s=this,o=0,i,n;return a;function a(v){return e.enter("codeText"),e.enter("codeTextSequence"),h(v)}function h(v){return v===96?(e.consume(v),o++,h):(e.exit("codeTextSequence"),l(v))}function l(v){return v===null?r(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),l):v===96?(n=e.enter("codeTextSequence"),i=0,p(v)):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||ie(v)?(e.exit("codeTextData"),l(v)):(e.consume(v),c)}function p(v){return v===96?(e.consume(v),i++,p):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(n.type="codeTextData",c(v))}}var Fi=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&qs(this.left,s),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);qs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qs(this.left,r.reverse())}}};function qs(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Ni(e){let t={},r=-1,s,o,i,n,a,h,l,c=new Fi(e);for(;++r<c.length;){for(;r in t;)r=t[r];if(s=c.get(r),r&&s[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,i=0,i<h.length&&h[i][1].type==="lineEndingBlank"&&(i+=2),i<h.length&&h[i][1].type==="content"))for(;++i<h.length&&h[i][1].type!=="content";)h[i][1].type==="chunkText"&&(h[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,Rm(c,r)),r=t[r],l=!0);else if(s[1]._container){for(i=r,o=void 0;i--;)if(n=c.get(i),n[1].type==="lineEnding"||n[1].type==="lineEndingBlank")n[0]==="enter"&&(o&&(c.get(o)[1].type="lineEndingBlank"),n[1].type="lineEnding",o=i);else if(!(n[1].type==="linePrefix"||n[1].type==="listItemIndent"))break;o&&(s[1].end={...c.get(o)[1].start},a=c.slice(o,r),a.unshift(s),c.splice(o,r-o+1,a))}}return He(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Rm(e,t){let r=e.get(t)[1],s=e.get(t)[2],o=t-1,i=[],n=r._tokenizer;n||(n=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(n._contentTypeTextTrailing=!0));let a=n.events,h=[],l={},c,p,v=-1,g=r,u=0,d=0,m=[d];for(;g;){for(;e.get(++o)[1]!==g;);i.push(o),g._tokenizer||(c=s.sliceStream(g),g.next||c.push(null),p&&n.defineSkip(g.start),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=!0),n.write(c),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=r;++v<a.length;)a[v][0]==="exit"&&a[v-1][0]==="enter"&&a[v][1].type===a[v-1][1].type&&a[v][1].start.line!==a[v][1].end.line&&(d=v+1,m.push(d),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(n.events=[],g?(g._tokenizer=void 0,g.previous=void 0):m.pop(),v=m.length;v--;){let f=a.slice(m[v],m[v+1]),_=i.pop();h.push([_,_+f.length-1]),e.splice(_,2,f)}for(h.reverse(),v=-1;++v<h.length;)l[u+h[v][0]]=u+h[v][1],u+=h[v][1]-h[v][0]-1;return l}var ho={resolve:Im,tokenize:Lm},Am={partial:!0,tokenize:Om};function Im(e){return Ni(e),e}function Lm(e,t){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ie(a)?e.check(Am,n,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function n(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function Om(e,t,r){let s=this;return o;function o(n){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),le(e,i,"linePrefix")}function i(n){if(n===null||ie(n))return r(n);let a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):e.interrupt(s.parser.constructs.flow,r,t)(n)}}function zi(e,t,r,s,o,i,n,a,h){let l=h||Number.POSITIVE_INFINITY,c=0;return p;function p(f){return f===60?(e.enter(s),e.enter(o),e.enter(i),e.consume(f),e.exit(i),v):f===null||f===32||f===41||Br(f)?r(f):(e.enter(s),e.enter(n),e.enter(a),e.enter("chunkString",{contentType:"string"}),d(f))}function v(f){return f===62?(e.enter(i),e.consume(f),e.exit(i),e.exit(o),e.exit(s),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(f))}function g(f){return f===62?(e.exit("chunkString"),e.exit(a),v(f)):f===null||f===60||ie(f)?r(f):(e.consume(f),f===92?u:g)}function u(f){return f===60||f===62||f===92?(e.consume(f),g):g(f)}function d(f){return!c&&(f===null||f===41||be(f))?(e.exit("chunkString"),e.exit(a),e.exit(n),e.exit(s),t(f)):c<l&&f===40?(e.consume(f),c++,d):f===41?(e.consume(f),c--,d):f===null||f===32||f===40||Br(f)?r(f):(e.consume(f),f===92?m:d)}function m(f){return f===40||f===41||f===92?(e.consume(f),d):d(f)}}function Hi(e,t,r,s,o,i){let n=this,a=0,h;return l;function l(g){return e.enter(s),e.enter(o),e.consume(g),e.exit(o),e.enter(i),c}function c(g){return a>999||g===null||g===91||g===93&&!h||g===94&&!a&&"_hiddenFootnoteSupport"in n.parser.constructs?r(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(s),t):ie(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||ie(g)||a++>999?(e.exit("chunkString"),c(g)):(e.consume(g),h||(h=!de(g)),g===92?v:p)}function v(g){return g===91||g===92||g===93?(e.consume(g),a++,p):p(g)}}function Ui(e,t,r,s,o,i){let n;return a;function a(v){return v===34||v===39||v===40?(e.enter(s),e.enter(o),e.consume(v),e.exit(o),n=v===40?41:v,h):r(v)}function h(v){return v===n?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),t):(e.enter(i),l(v))}function l(v){return v===n?(e.exit(i),h(n)):v===null?r(v):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),le(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===n||v===null||ie(v)?(e.exit("chunkString"),l(v)):(e.consume(v),v===92?p:c)}function p(v){return v===n||v===92?(e.consume(v),c):c(v)}}function Nr(e,t){let r;return s;function s(o){return ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):de(o)?le(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}var co={name:"definition",tokenize:Bm},Mm={partial:!0,tokenize:Fm};function Bm(e,t,r){let s=this,o;return i;function i(g){return e.enter("definition"),n(g)}function n(g){return Hi.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=Je(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),h):r(g)}function h(g){return be(g)?Nr(e,l)(g):l(g)}function l(g){return zi(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function c(g){return e.attempt(Mm,p,p)(g)}function p(g){return de(g)?le(e,v,"whitespace")(g):v(g)}function v(g){return g===null||ie(g)?(e.exit("definition"),s.parser.defined.push(o),t(g)):r(g)}}function Fm(e,t,r){return s;function s(a){return be(a)?Nr(e,o)(a):r(a)}function o(a){return Ui(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return de(a)?le(e,n,"whitespace")(a):n(a)}function n(a){return a===null||ie(a)?t(a):r(a)}}var uo={name:"hardBreakEscape",tokenize:Nm};function Nm(e,t,r){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ie(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var po={name:"headingAtx",resolve:zm,tokenize:Hm};function zm(e,t){let r=e.length-2,s=3,o,i;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},i={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},He(e,s,r-s+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Hm(e,t,r){let s=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),n(c)}function n(c){return c===35&&s++<6?(e.consume(c),n):c===null||be(c)?(e.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),h(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):de(c)?le(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function h(c){return c===35?(e.consume(c),h):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||be(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var Xh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fo=["pre","script","style","textarea"];var mo={concrete:!0,name:"htmlFlow",resolveTo:$m,tokenize:Vm},Um={partial:!0,tokenize:qm},jm={partial:!0,tokenize:Wm};function $m(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Vm(e,t,r){let s=this,o,i,n,a,h;return l;function l(O){return c(O)}function c(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),i=!0,d):O===63?(e.consume(O),o=3,s.interrupt?t:k):$e(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function v(O){return O===45?(e.consume(O),o=2,g):O===91?(e.consume(O),o=5,a=0,u):$e(O)?(e.consume(O),o=4,s.interrupt?t:k):r(O)}function g(O){return O===45?(e.consume(O),s.interrupt?t:k):r(O)}function u(O){let ee="CDATA[";return O===ee.charCodeAt(a++)?(e.consume(O),a===ee.length?s.interrupt?t:B:u):r(O)}function d(O){return $e(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function m(O){if(O===null||O===47||O===62||be(O)){let ee=O===47,N=n.toLowerCase();return!ee&&!i&&fo.includes(N)?(o=1,s.interrupt?t(O):B(O)):Xh.includes(n.toLowerCase())?(o=6,ee?(e.consume(O),f):s.interrupt?t(O):B(O)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(O):i?_(O):x(O))}return O===45||Be(O)?(e.consume(O),n+=String.fromCharCode(O),m):r(O)}function f(O){return O===62?(e.consume(O),s.interrupt?t:B):r(O)}function _(O){return de(O)?(e.consume(O),_):E(O)}function x(O){return O===47?(e.consume(O),E):O===58||O===95||$e(O)?(e.consume(O),y):de(O)?(e.consume(O),x):E(O)}function y(O){return O===45||O===46||O===58||O===95||Be(O)?(e.consume(O),y):w(O)}function w(O){return O===61?(e.consume(O),b):de(O)?(e.consume(O),w):x(O)}function b(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),h=O,S):de(O)?(e.consume(O),b):T(O)}function S(O){return O===h?(e.consume(O),h=null,R):O===null||ie(O)?r(O):(e.consume(O),S)}function T(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||be(O)?w(O):(e.consume(O),T)}function R(O){return O===47||O===62||de(O)?x(O):r(O)}function E(O){return O===62?(e.consume(O),A):r(O)}function A(O){return O===null||ie(O)?B(O):de(O)?(e.consume(O),A):r(O)}function B(O){return O===45&&o===2?(e.consume(O),j):O===60&&o===1?(e.consume(O),C):O===62&&o===4?(e.consume(O),U):O===63&&o===3?(e.consume(O),k):O===93&&o===5?(e.consume(O),L):ie(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Um,J,M)(O)):O===null||ie(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),B)}function M(O){return e.check(jm,H,J)(O)}function H(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),z}function z(O){return O===null||ie(O)?M(O):(e.enter("htmlFlowData"),B(O))}function j(O){return O===45?(e.consume(O),k):B(O)}function C(O){return O===47?(e.consume(O),n="",D):B(O)}function D(O){if(O===62){let ee=n.toLowerCase();return fo.includes(ee)?(e.consume(O),U):B(O)}return $e(O)&&n.length<8?(e.consume(O),n+=String.fromCharCode(O),D):B(O)}function L(O){return O===93?(e.consume(O),k):B(O)}function k(O){return O===62?(e.consume(O),U):O===45&&o===2?(e.consume(O),k):B(O)}function U(O){return O===null||ie(O)?(e.exit("htmlFlowData"),J(O)):(e.consume(O),U)}function J(O){return e.exit("htmlFlow"),t(O)}}function Wm(e,t,r){let s=this;return o;function o(n){return ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i):r(n)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}function qm(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Bt,t,r)}}var go={name:"htmlText",tokenize:Km};function Km(e,t,r){let s=this,o,i,n;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),l):k===47?(e.consume(k),w):k===63?(e.consume(k),x):$e(k)?(e.consume(k),T):r(k)}function l(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,u):$e(k)?(e.consume(k),_):r(k)}function c(k){return k===45?(e.consume(k),g):r(k)}function p(k){return k===null?r(k):k===45?(e.consume(k),v):ie(k)?(n=p,C(k)):(e.consume(k),p)}function v(k){return k===45?(e.consume(k),g):p(k)}function g(k){return k===62?j(k):k===45?v(k):p(k)}function u(k){let U="CDATA[";return k===U.charCodeAt(i++)?(e.consume(k),i===U.length?d:u):r(k)}function d(k){return k===null?r(k):k===93?(e.consume(k),m):ie(k)?(n=d,C(k)):(e.consume(k),d)}function m(k){return k===93?(e.consume(k),f):d(k)}function f(k){return k===62?j(k):k===93?(e.consume(k),f):d(k)}function _(k){return k===null||k===62?j(k):ie(k)?(n=_,C(k)):(e.consume(k),_)}function x(k){return k===null?r(k):k===63?(e.consume(k),y):ie(k)?(n=x,C(k)):(e.consume(k),x)}function y(k){return k===62?j(k):x(k)}function w(k){return $e(k)?(e.consume(k),b):r(k)}function b(k){return k===45||Be(k)?(e.consume(k),b):S(k)}function S(k){return ie(k)?(n=S,C(k)):de(k)?(e.consume(k),S):j(k)}function T(k){return k===45||Be(k)?(e.consume(k),T):k===47||k===62||be(k)?R(k):r(k)}function R(k){return k===47?(e.consume(k),j):k===58||k===95||$e(k)?(e.consume(k),E):ie(k)?(n=R,C(k)):de(k)?(e.consume(k),R):j(k)}function E(k){return k===45||k===46||k===58||k===95||Be(k)?(e.consume(k),E):A(k)}function A(k){return k===61?(e.consume(k),B):ie(k)?(n=A,C(k)):de(k)?(e.consume(k),A):R(k)}function B(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),o=k,M):ie(k)?(n=B,C(k)):de(k)?(e.consume(k),B):(e.consume(k),H)}function M(k){return k===o?(e.consume(k),o=void 0,z):k===null?r(k):ie(k)?(n=M,C(k)):(e.consume(k),M)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||be(k)?R(k):(e.consume(k),H)}function z(k){return k===47||k===62||be(k)?R(k):r(k)}function j(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function C(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),D}function D(k){return de(k)?le(e,L,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return e.enter("htmlTextData"),n(k)}}var zr={name:"labelEnd",resolveAll:Ym,resolveTo:Qm,tokenize:Zm},Xm={tokenize:eg},Jm={tokenize:tg},Gm={tokenize:rg};function Ym(e){let t=-1,r=[];for(;++t<e.length;){let s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){let o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&He(e,0,e.length,r),e}function Qm(e,t){let r=e.length,s=0,o,i,n,a;for(;r--;)if(o=e[r][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(n){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(n=r);let h={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[n][1].end}},c={type:"labelText",start:{...e[i+s+2][1].end},end:{...e[n-2][1].start}};return a=[["enter",h,t],["enter",l,t]],a=tt(a,e.slice(i+1,i+s+3)),a=tt(a,[["enter",c,t]]),a=tt(a,dr(t.parser.constructs.insideSpan.null,e.slice(i+s+4,n-3),t)),a=tt(a,[["exit",c,t],e[n-2],e[n-1],["exit",l,t]]),a=tt(a,e.slice(n+1)),a=tt(a,[["exit",h,t]]),He(e,i,e.length,a),e}function Zm(e,t,r){let s=this,o=s.events.length,i,n;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){i=s.events[o][1];break}return a;function a(v){return i?i._inactive?p(v):(n=s.parser.defined.includes(Je(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(Xm,c,n?c:p)(v):v===91?e.attempt(Jm,c,n?l:p)(v):n?c(v):p(v)}function l(v){return e.attempt(Gm,c,p)(v)}function c(v){return t(v)}function p(v){return i._balanced=!0,r(v)}}function eg(e,t,r){return s;function s(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return be(p)?Nr(e,i)(p):i(p)}function i(p){return p===41?c(p):zi(e,n,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function n(p){return be(p)?Nr(e,h)(p):c(p)}function a(p){return r(p)}function h(p){return p===34||p===39||p===40?Ui(e,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):c(p)}function l(p){return be(p)?Nr(e,c)(p):c(p)}function c(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function tg(e,t,r){let s=this;return o;function o(a){return Hi.call(s,e,i,n,"reference","referenceMarker","referenceString")(a)}function i(a){return s.parser.defined.includes(Je(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(a):r(a)}function n(a){return r(a)}}function rg(e,t,r){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var vo={name:"labelStartImage",resolveAll:zr.resolveAll,tokenize:sg};function sg(e,t,r){let s=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),n):r(a)}function n(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):t(a)}}var _o={name:"labelStartLink",resolveAll:zr.resolveAll,tokenize:ig};function ig(e,t,r){let s=this;return o;function o(n){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelLink"),i}function i(n){return n===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(n):t(n)}}var Ks={name:"lineEnding",tokenize:ng};function ng(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),le(e,t,"linePrefix")}}var Hr={name:"thematicBreak",tokenize:og};function og(e,t,r){let s=0,o;return i;function i(l){return e.enter("thematicBreak"),n(l)}function n(l){return o=l,a(l)}function a(l){return l===o?(e.enter("thematicBreakSequence"),h(l)):s>=3&&(l===null||ie(l))?(e.exit("thematicBreak"),t(l)):r(l)}function h(l){return l===o?(e.consume(l),s++,h):(e.exit("thematicBreakSequence"),de(l)?le(e,a,"whitespace")(l):a(l))}}var Ge={continuation:{tokenize:cg},exit:ug,name:"list",tokenize:hg},ag={partial:!0,tokenize:pg},lg={partial:!0,tokenize:dg};function hg(e,t,r){let s=this,o=s.events[s.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,n=0;return a;function a(g){let u=s.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(u==="listUnordered"?!s.containerState.marker||g===s.containerState.marker:$s(g)){if(s.containerState.type||(s.containerState.type=u,e.enter(u,{_container:!0})),u==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Hr,r,l)(g):l(g);if(!s.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(g)}return r(g)}function h(g){return $s(g)&&++n<10?(e.consume(g),h):(!s.interrupt||n<2)&&(s.containerState.marker?g===s.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),l(g)):r(g)}function l(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||g,e.check(Bt,s.interrupt?r:c,e.attempt(ag,v,p))}function c(g){return s.containerState.initialBlankLine=!0,i++,v(g)}function p(g){return de(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):r(g)}function v(g){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function cg(e,t,r){let s=this;return s.containerState._closeFlow=void 0,e.check(Bt,o,i);function o(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,le(e,t,"listItemIndent",s.containerState.size+1)(a)}function i(a){return s.containerState.furtherBlankLines||!de(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(lg,t,n)(a))}function n(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,le(e,e.attempt(Ge,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function dg(e,t,r){let s=this;return le(e,o,"listItemIndent",s.containerState.size+1);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="listItemIndent"&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?t(i):r(i)}}function ug(e){e.exit(this.containerState.type)}function pg(e,t,r){let s=this;return le(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let n=s.events[s.events.length-1];return!de(i)&&n&&n[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var ji={name:"setextUnderline",resolveTo:fg,tokenize:mg};function fg(e,t){let r=e.length,s,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let n={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",n,t]),e.splice(i+1,0,["exit",e[s][1],t]),e[s][1].end={...e[i][1].end}):e[s][1]=n,e.push(["exit",n,t]),e}function mg(e,t,r){let s=this,o;return i;function i(l){let c=s.events.length,p;for(;c--;)if(s.events[c][1].type!=="lineEnding"&&s.events[c][1].type!=="linePrefix"&&s.events[c][1].type!=="content"){p=s.events[c][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||p)?(e.enter("setextHeadingLine"),o=l,n(l)):r(l)}function n(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===o?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),de(l)?le(e,h,"lineSuffix")(l):h(l))}function h(l){return l===null||ie(l)?(e.exit("setextHeadingLine"),t(l)):r(l)}}var Jh={tokenize:gg};function gg(e){let t=this,r=e.attempt(Bt,s,e.attempt(this.parser.constructs.flowInitial,o,le(e,e.attempt(this.parser.constructs.flow,o,e.attempt(ho,o)),"linePrefix")));return r;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var Gh={resolveAll:ec()},Yh=Zh("string"),Qh=Zh("text");function Zh(e){return{resolveAll:ec(e==="text"?vg:void 0),tokenize:t};function t(r){let s=this,o=this.parser.constructs[e],i=r.attempt(o,n,a);return n;function n(c){return l(c)?i(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),h}function h(c){return l(c)?(r.exit("data"),i(c)):(r.consume(c),h)}function l(c){if(c===null)return!0;let p=o[c],v=-1;if(p)for(;++v<p.length;){let g=p[v];if(!g.previous||g.previous.call(s,s.previous))return!0}return!1}}}function ec(e){return t;function t(r,s){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(r,s):r}}function vg(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let s=e[r-1][1],o=t.sliceStream(s),i=o.length,n=-1,a=0,h;for(;i--;){let l=o[i];if(typeof l=="string"){for(n=l.length;l.charCodeAt(n-1)===32;)a++,n--;if(n)break;n=-1}else if(l===-2)h=!0,a++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(a=0),a){let l={type:r===e.length||h||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?n:s.start._bufferIndex+n,_index:s.start._index+i,line:s.end.line,column:s.end.column-a,offset:s.end.offset-a},end:{...s.end}};s.end={...l.start},s.start.offset===s.end.offset?Object.assign(s,l):(e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2)}r++}return e}var bo={};zn(bo,{attentionMarkers:()=>Cg,contentInitial:()=>bg,disable:()=>Eg,document:()=>_g,flow:()=>yg,flowInitial:()=>xg,insideSpan:()=>kg,string:()=>wg,text:()=>Sg});var _g={42:Ge,43:Ge,45:Ge,48:Ge,49:Ge,50:Ge,51:Ge,52:Ge,53:Ge,54:Ge,55:Ge,56:Ge,57:Ge,62:Li},bg={91:co},xg={[-2]:Ws,[-1]:Ws,32:Ws},yg={35:po,42:Hr,45:[ji,Hr],60:mo,61:ji,95:Hr,96:Bi,126:Bi},wg={38:Mi,92:Oi},Sg={[-5]:Ks,[-4]:Ks,[-3]:Ks,33:vo,38:Mi,42:Vs,60:[ao,go],91:_o,92:[uo,Oi],93:zr,95:Vs,96:lo},kg={null:[Vs,Gh]},Cg={null:[42,95]},Eg={null:[]};function tc(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},i=[],n=[],a=[],h=!0,l={attempt:R(S),check:R(T),consume:y,enter:w,exit:b,interrupt:R(T,{interrupt:!0})},c={code:null,containerState:{},defineSkip:f,events:[],now:m,parser:e,previous:null,sliceSerialize:u,sliceStream:d,write:g},p=t.tokenize.call(c,l),v;return t.resolveAll&&i.push(t),c;function g(M){return n=tt(n,M),_(),n[n.length-1]!==null?[]:(E(t,0),c.events=dr(i,c.events,c),c.events)}function u(M,H){return Pg(d(M),H)}function d(M){return Tg(n,M)}function m(){let{_bufferIndex:M,_index:H,line:z,column:j,offset:C}=s;return{_bufferIndex:M,_index:H,line:z,column:j,offset:C}}function f(M){o[M.line]=M.column,B()}function _(){let M;for(;s._index<n.length;){let H=n[s._index];if(typeof H=="string")for(M=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===M&&s._bufferIndex<H.length;)x(H.charCodeAt(s._bufferIndex));else x(H)}}function x(M){h=void 0,v=M,p=p(M)}function y(M){ie(M)?(s.line++,s.column=1,s.offset+=M===-3?2:1,B()):M!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===n[s._index].length&&(s._bufferIndex=-1,s._index++)),c.previous=M,h=!0}function w(M,H){let z=H||{};return z.type=M,z.start=m(),c.events.push(["enter",z,c]),a.push(z),z}function b(M){let H=a.pop();return H.end=m(),c.events.push(["exit",H,c]),H}function S(M,H){E(M,H.from)}function T(M,H){H.restore()}function R(M,H){return z;function z(j,C,D){let L,k,U,J;return Array.isArray(j)?ee(j):"tokenize"in j?ee([j]):O(j);function O(V){return te;function te(Q){let G=Q!==null&&V[Q],oe=Q!==null&&V.null,me=[...Array.isArray(G)?G:G?[G]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ee(me)(Q)}}function ee(V){return L=V,k=0,V.length===0?D:N(V[k])}function N(V){return te;function te(Q){return J=A(),U=V,V.partial||(c.currentConstruct=V),V.name&&c.parser.constructs.disable.null.includes(V.name)?$(Q):V.tokenize.call(H?Object.assign(Object.create(c),H):c,l,P,$)(Q)}}function P(V){return h=!0,M(U,J),C}function $(V){return h=!0,J.restore(),++k<L.length?N(L[k]):D}}}function E(M,H){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&He(c.events,H,c.events.length-H,M.resolve(c.events.slice(H),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function A(){let M=m(),H=c.previous,z=c.currentConstruct,j=c.events.length,C=Array.from(a);return{from:j,restore:D};function D(){s=M,c.previous=H,c.currentConstruct=z,c.events.length=j,a=C,B()}}function B(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function Tg(e,t){let r=t.start._index,s=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,n;if(r===o)n=[e[r].slice(s,i)];else{if(n=e.slice(r,o),s>-1){let a=n[0];typeof a=="string"?n[0]=a.slice(s):n.shift()}i>0&&n.push(e[o].slice(0,i))}return n}function Pg(e,t){let r=-1,s=[],o;for(;++r<e.length;){let i=e[r],n;if(typeof i=="string")n=i;else switch(i){case-5:{n="\r";break}case-4:{n=`
|
|
11
|
+
`,m)}paste(d){this._core.paste(d)}refresh(d,m){this._verifyIntegers(d,m),this._core.refresh(d,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(d){this._addonManager.loadAddon(this,d)}static get strings(){return i}_verifyIntegers(...d){for(let m of d)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...d){for(let m of d)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}o.Terminal=g})(),s})()))});var Ux={};Hn(Ux,{apply:()=>Sx,inject:()=>wx});module.exports=af(Ux);var ne=require("react");var qe=require("react"),sr=require("@deepseek-ai/dsh-client-ui-primitives"),yp=Ms(jn(),1);var lr="/ssh-local/v1",ar=class extends Error{constructor(r,s,o){super(s);this.status=r;this.body=o;this.name="ApiError"}};async function ae(e,t={}){let r=t.method??"GET",s=await fetch(`${lr}${e}`,{...t,headers:{Accept:"application/json",...r==="GET"?{}:{"Content-Type":"application/json","X-DSH-SSH-Request":"1"},...t.headers}});if(s.status===204)return;let o=await s.json().catch(()=>({}));if(!s.ok)throw new ar(s.status,typeof o.error=="string"?o.error:`HTTP ${s.status}`,o);return o}function $n(){return ae("/profiles")}function Il(){return ae("/ftp-profiles")}function Ll(){return ae("/file-transfer/endpoints")}function Ol(e,t,r){let s=new URLSearchParams({paneId:e,endpointId:t});return r!==void 0&&s.set("path",r),ae(`/file-transfer/directory?${s.toString()}`)}function Bs(e){return ae("/file-transfer/delete",{method:"POST",body:JSON.stringify(e)})}function Ml(e){return ae("/file-transfer/move",{method:"POST",body:JSON.stringify(e)})}function Bl(){return ae("/file-transfer/jobs")}function Fs(e){return ae("/file-transfer/jobs",{method:"POST",body:JSON.stringify(e)})}function Fl(e){return ae(`/file-transfer/jobs/${encodeURIComponent(e)}`,{method:"DELETE"})}function Nl(){return ae("/vault")}function zl(){return ae("/proxies")}function Hl(){return ae("/forwards")}function wi(e){return ae(`/injections?sessionId=${encodeURIComponent(e)}`)}function Ul(e){return ae(`/profiles/${encodeURIComponent(e)}/projects`)}function jl(e,t){return ae(`/profiles/${encodeURIComponent(e)}/projects`,{method:"POST",body:JSON.stringify({project:t})})}function $l(e,t,r){return ae(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({project:r})})}function Vl(e,t){return ae(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"DELETE"})}function Si(e){return ae(`/injections/${encodeURIComponent(e.sessionId)}`,{method:"PUT",body:JSON.stringify(e)})}function Wl(e){return ae(`/activity?sessionId=${encodeURIComponent(e)}`)}function ql(e){return`${lr}/activity/events?sessionId=${encodeURIComponent(e)}`}function Kl(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t});return r!==void 0&&s.set("path",r),ae(`/activity/files?${s.toString()}`)}function Xl(e,t){let r=new URLSearchParams({sessionId:e});return t!==void 0&&r.set("path",t),ae(`/activity/local-directory?${r.toString()}`)}function Jl(e,t){let r=new URLSearchParams({sessionId:e,path:t});return ae(`/activity/local-file?${r.toString()}`)}function Gl(e,t,r){return ae("/activity/local-delete",{method:"POST",body:JSON.stringify({sessionId:e,directory:t,paths:r})})}function Yl(e,t,r=!1){let s=new URLSearchParams({sessionId:e,path:t});return r&&s.set("inline","1"),`${lr}/activity/local-download?${s.toString()}`}function Ql(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t,path:r});return ae(`/activity/file?${s.toString()}`)}function Zl(e,t,r,s=!1){let o=new URLSearchParams({sessionId:e,profileId:t,path:r});return s&&o.set("inline","1"),`${lr}/activity/download?${o.toString()}`}function eh(e,t="~"){let r=new URLSearchParams({path:t});return ae(`/profiles/${encodeURIComponent(e)}/sftp/directory?${r.toString()}`)}function th(e,t){let r=new URLSearchParams({path:t});return ae(`/profiles/${encodeURIComponent(e)}/sftp/file?${r.toString()}`)}function rh(e,t,r=!1){let s=new URLSearchParams({path:t});return r&&s.set("inline","1"),`${lr}/profiles/${encodeURIComponent(e)}/sftp/download?${s.toString()}`}async function Vn(e,t,r,s=!1){let o=new URLSearchParams({directory:t,name:r.name});s&&o.set("overwrite","1");let i=await fetch(`${lr}/profiles/${encodeURIComponent(e)}/sftp/upload?${o.toString()}`,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/octet-stream","X-DSH-SSH-Request":"1"},body:r}),n=await i.json().catch(()=>({}));if(!i.ok)throw new ar(i.status,typeof n.error=="string"?n.error:`HTTP ${i.status}`,n);return n}function sh(e,t,r,s){return ae(`/activity/terminals/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({sessionId:e,text:r,sequence:s})})}function ih(e,t,r){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return ae(`/activity/terminals/${encodeURIComponent(t)}/output?${s.toString()}`)}function nh(e,t,r=0){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return`${lr}/activity/terminals/${encodeURIComponent(t)}/stream?${s.toString()}`}function oh(e,t=0){let r=new URLSearchParams({cursor:String(t)});return`${lr}/terminals/${encodeURIComponent(e)}/stream?${r.toString()}`}function ah(e,t,r,s){return ae(`/activity/terminals/${encodeURIComponent(t)}/resize`,{method:"POST",body:JSON.stringify({sessionId:e,cols:r,rows:s})})}function lh(e,t){let r=new URLSearchParams({sessionId:e});return ae(`/activity/terminals/${encodeURIComponent(t)}?${r.toString()}`,{method:"DELETE"})}function hh(e,t,r){return ae("/activity/directory",{method:"PUT",body:JSON.stringify({sessionId:e,profileId:t,cwd:r})})}function Kt(e){return`${e.username}@${e.host}:${e.port}`}var xe=require("react");function ch(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var lf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cf={};function ki(e,t){return((t||cf).jsx?hf:lf).test(e)}var df=/[ \t\n\f\r]/g;function Wn(e){return typeof e=="object"?e.type==="text"?dh(e.value):!1:dh(e)}function dh(e){return e.replace(df,"")===""}var Xt=class{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}};Xt.prototype.normal={};Xt.prototype.property={};Xt.prototype.space=void 0;function qn(e,t){let r={},s={};for(let o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Xt(r,s,t)}function Ns(e){return e.toLowerCase()}var We=class{constructor(t,r){this.attribute=r,this.property=t}};We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;var zs={};Hn(zs,{boolean:()=>fe,booleanish:()=>Me,commaOrSpaceSeparated:()=>at,commaSeparated:()=>Jt,number:()=>Y,overloadedBoolean:()=>Ci,spaceSeparated:()=>Se});var uf=0,fe=Ir(),Me=Ir(),Ci=Ir(),Y=Ir(),Se=Ir(),Jt=Ir(),at=Ir();function Ir(){return 2**++uf}var Kn=Object.keys(zs),Lr=class extends We{constructor(t,r,s,o){let i=-1;if(super(t,r),uh(this,"space",o),typeof s=="number")for(;++i<Kn.length;){let n=Kn[i];uh(this,Kn[i],(s&zs[n])===zs[n])}}};Lr.prototype.defined=!0;function uh(e,t,r){r&&(e[t]=r)}function Ct(e){let t={},r={};for(let[s,o]of Object.entries(e.properties)){let i=new Lr(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,r[Ns(s)]=s,r[Ns(i.attribute)]=s}return new Xt(t,r,e.space)}var Xn=Ct({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Se,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:Y,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Se,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Me,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ei(e,t){return t in e?e[t]:t}function Ti(e,t){return Ei(e,t.toLowerCase())}var ph=Ct({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jt,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alpha:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:Se,autoFocus:fe,autoPlay:fe,blocking:Se,capture:null,charSet:null,checked:fe,cite:null,className:Se,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:Me,controls:fe,controlsList:Se,coords:Y|Jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Ci,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:Se,height:Y,hidden:Ci,high:Y,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:Se,itemRef:Se,itemScope:fe,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:Y,pattern:null,ping:Se,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:Se,required:fe,reversed:fe,rows:Y,rowSpan:Y,sandbox:Se,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootCustomElementRegistry:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shadowRootSerializable:fe,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:Me,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Se,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:fe,disablePictureInPicture:fe,disableRemotePlayback:fe,exportParts:Jt,part:Se,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:Ti});var fh=Ct({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:at,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Se,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jt,g2:Jt,glyphName:Jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Se,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ei});var Jn=Ct({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Gn=Ct({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ti});var Yn=Ct({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Qn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var pf=/[A-Z]/g,mh=/-[a-z]/g,ff=/^data[-\w.:]+$/i;function Zn(e,t){let r=Ns(t),s=t,o=We;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&ff.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(mh,gf);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!mh.test(i)){let n=i.replace(pf,mf);n.charAt(0)!=="-"&&(n="-"+n),t="data"+n}}o=Lr}return new o(s,t)}function mf(e){return"-"+e.toLowerCase()}function gf(e){return e.charAt(1).toUpperCase()}var gh=qn([Xn,ph,Jn,Gn,Yn],"html"),Pi=qn([Xn,fh,Jn,Gn,Yn],"svg");function vh(e){return e.join(" ").trim()}var Ih=Ms(Ph(),1);var Ri=Dh("end"),ls=Dh("start");function Dh(e){return t;function t(r){let s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function ro(e){let t=ls(e),r=Ri(e);if(t&&r)return{start:t,end:r}}function hr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rh(e.position):"start"in e||"end"in e?Rh(e):"line"in e||"column"in e?so(e):""}function so(e){return Ah(e&&e.line)+":"+Ah(e&&e.column)}function Rh(e){return so(e&&e.start)+"-"+so(e&&e.end)}function Ah(e){return e&&typeof e=="number"?e:1}var ze=class extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",i={},n=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?o=t:!i.cause&&t&&(n=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){let h=s.indexOf(":");h===-1?i.ruleId=s:(i.source=s.slice(0,h),i.ruleId=s.slice(h+1))}if(!i.place&&i.ancestors&&i.ancestors){let h=i.ancestors[i.ancestors.length-1];h&&(i.place=h.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=hr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=n&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ze.prototype.file="";ze.prototype.name="";ze.prototype.reason="";ze.prototype.message="";ze.prototype.stack="";ze.prototype.column=void 0;ze.prototype.line=void 0;ze.prototype.ancestors=void 0;ze.prototype.cause=void 0;ze.prototype.fatal=void 0;ze.prototype.place=void 0;ze.prototype.ruleId=void 0;ze.prototype.source=void 0;var io={}.hasOwnProperty,jf=new Map,$f=/[A-Z]/g,Vf=new Set(["table","tbody","thead","tfoot","tr"]),Wf=new Set(["td","th"]),Lh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function no(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Zf(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=Qf(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pi:gh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Oh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Oh(e,t,r){if(t.type==="element")return qf(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Kf(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jf(e,t,r);if(t.type==="mdxjsEsm")return Xf(e,t);if(t.type==="root")return Gf(e,t,r);if(t.type==="text")return Yf(e,t)}function qf(e,t,r){let s=e.schema,o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=Bh(e,t.tagName,!1),n=em(e,t),a=ao(e,t);return Vf.has(t.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!Wn(h):!0})),Mh(e,n,i,t),oo(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function Kf(e,t){if(t.data&&t.data.estree&&e.evaluater){let s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Us(e,t.position)}function Xf(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Us(e,t.position)}function Jf(e,t,r){let s=e.schema,o=s;t.name==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:Bh(e,t.name,!0),n=tm(e,t),a=ao(e,t);return Mh(e,n,i,t),oo(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function Gf(e,t,r){let s={};return oo(s,ao(e,t)),e.create(t,e.Fragment,s,r)}function Yf(e,t){return t.value}function Mh(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function oo(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function Qf(e,t,r){return s;function s(o,i,n,a){let l=Array.isArray(n.children)?r:t;return a?l(i,n,a):l(i,n)}}function Zf(e,t){return r;function r(s,o,i,n){let a=Array.isArray(i.children),h=ls(s);return t(o,i,n,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function em(e,t){let r={},s,o;for(o in t.properties)if(o!=="children"&&io.call(t.properties,o)){let i=rm(e,o,t.properties[o]);if(i){let[n,a]=i;e.tableCellAlignToStyle&&n==="align"&&typeof a=="string"&&Wf.has(t.tagName)?s=a:r[n]=a}}if(s){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function tm(e,t){let r={};for(let s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){let i=s.data.estree.body[0];i.type;let n=i.expression;n.type;let a=n.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else Us(e,t.position);else{let o=s.name,i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){let a=s.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Us(e,t.position);else i=s.value===null?!0:s.value;r[o]=i}return r}function ao(e,t){let r=[],s=-1,o=e.passKeys?new Map:jf;for(;++s<t.children.length;){let i=t.children[s],n;if(e.passKeys){let h=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(h){let l=o.get(h)||0;n=h+"-"+l,o.set(h,l+1)}}let a=Oh(e,i,n);a!==void 0&&r.push(a)}return r}function rm(e,t,r){let s=Zn(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?ch(r):vh(r)),s.property==="style"){let o=typeof r=="object"?r:sm(e,String(r));return e.stylePropertyNameCase==="css"&&(o=im(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?Qn[s.property]||s.property:s.attribute,r]}}function sm(e,t){try{return(0,Ih.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let s=r,o=new ze("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Lh+"#cannot-parse-style-attribute",o}}function Bh(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,n;for(;++i<o.length;){let a=ki(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};n=n?{type:"MemberExpression",object:n,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}s=n}else s=ki(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){let o=s.value;return io.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);Us(e)}function Us(e,t){let r=new ze("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Lh+"#cannot-handle-mdx-estrees-without-createevaluater",r}function im(e){let t={},r;for(r in e)io.call(e,r)&&(t[nm(r)]=e[r]);return t}function nm(e){let t=e.replace($f,om);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function om(e){return"-"+e.toLowerCase()}var js={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var us=require("react/jsx-runtime"),hd=require("react");var am={};function Mr(e,t){let r=t||am,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Nh(e,s,o)}function Nh(e,t,r){if(lm(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fh(e.children,t,r)}return Array.isArray(e)?Fh(e,t,r):""}function Fh(e,t,r){let s=[],o=-1;for(;++o<e.length;)s[o]=Nh(e[o],t,r);return s.join("")}function lm(e){return!!(e&&typeof e=="object")}var zh=document.createElement("i");function hs(e){let t="&"+e+";";zh.innerHTML=t;let r=zh.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function He(e,t,r,s){let o=e.length,i=0,n;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)n=Array.from(s),n.unshift(t,r),e.splice(...n);else for(r&&e.splice(t,r);i<s.length;)n=s.slice(i,i+1e4),n.unshift(t,0),e.splice(...n),i+=1e4,t+=1e4}function tt(e,t){return e.length>0?(He(e,e.length,0,t),e):t}var Hh={}.hasOwnProperty;function Ai(e){let t={},r=-1;for(;++r<e.length;)hm(t,e[r]);return t}function hm(e,t){let r;for(r in t){let o=(Hh.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],n;if(i)for(n in i){Hh.call(o,n)||(o[n]=[]);let a=i[n];cm(o[n],Array.isArray(a)?a:a?[a]:[])}}}function cm(e,t){let r=-1,s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);He(e,0,0,s)}function Ii(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Je(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var $e=cr(/[A-Za-z]/),Be=cr(/[\dA-Za-z]/),Uh=cr(/[#-'*+\--9=?A-Z^-~]/);function Br(e){return e!==null&&(e<32||e===127)}var $s=cr(/\d/),jh=cr(/[\dA-Fa-f]/),$h=cr(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function be(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}var Fr=cr(/\p{P}|\p{S}/u),Mt=cr(/\s/);function cr(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Et(e){let t=[],r=-1,s=0,o=0;for(;++r<e.length;){let i=e.charCodeAt(r),n="";if(i===37&&Be(e.charCodeAt(r+1))&&Be(e.charCodeAt(r+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(n=String.fromCharCode(i));else if(i>55295&&i<57344){let a=e.charCodeAt(r+1);i<56320&&a>56319&&a<57344?(n=String.fromCharCode(i,a),o=1):n="\uFFFD"}else n=String.fromCharCode(i);n&&(t.push(e.slice(s,r),encodeURIComponent(n)),s=r+o+1,n=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function le(e,t,r,s){let o=s?s-1:Number.POSITIVE_INFINITY,i=0;return n;function n(h){return de(h)?(e.enter(r),a(h)):t(h)}function a(h){return de(h)&&i++<o?(e.consume(h),a):(e.exit(r),t(h))}}var Vh={tokenize:dm};function dm(e){let t=e.attempt(this.parser.constructs.contentInitial,s,o),r;return t;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){let h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,n(a)}function n(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ie(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),n)}}var qh={tokenize:um},Wh={tokenize:pm};function um(e){let t=this,r=[],s=0,o,i,n;return a;function a(x){if(s<r.length){let y=r[s];return t.containerState=y[1],e.attempt(y[0].continuation,h,l)(x)}return l(x)}function h(x){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();let y=t.events.length,w=y,b;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){b=t.events[w][1].end;break}f(s);let S=y;for(;S<t.events.length;)t.events[S][1].end={...b},S++;return He(t.events,w+1,0,t.events.slice(y)),t.events.length=S,l(x)}return a(x)}function l(x){if(s===r.length){if(!o)return v(x);if(o.currentConstruct&&o.currentConstruct.concrete)return u(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wh,c,p)(x)}function c(x){return o&&_(),f(s),v(x)}function p(x){return t.parser.lazy[t.now().line]=s!==r.length,n=t.now().offset,u(x)}function v(x){return t.containerState={},e.attempt(Wh,g,u)(x)}function g(x){return s++,r.push([t.currentConstruct,t.containerState]),v(x)}function u(x){if(x===null){o&&_(),f(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),d(x)}function d(x){if(x===null){m(e.exit("chunkFlow"),!0),f(0),e.consume(x);return}return ie(x)?(e.consume(x),m(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(x),d)}function m(x,y){let w=t.sliceStream(x);if(y&&w.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(w),t.parser.lazy[x.start.line]){let b=o.events.length;for(;b--;)if(o.events[b][1].start.offset<n&&(!o.events[b][1].end||o.events[b][1].end.offset>n))return;let S=t.events.length,T=S,R,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(R){E=t.events[T][1].end;break}R=!0}for(f(s),b=S;b<t.events.length;)t.events[b][1].end={...E},b++;He(t.events,T+1,0,t.events.slice(S)),t.events.length=b}}function f(x){let y=r.length;for(;y-- >x;){let w=r[y];t.containerState=w[1],w[0].exit.call(t,e)}r.length=x}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function pm(e,t,r){return le(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gt(e){if(e===null||be(e)||Mt(e))return 1;if(Fr(e))return 2}function dr(e,t,r){let s=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!s.includes(i)&&(t=i(t,r),s.push(i))}return t}var Vs={name:"attention",resolveAll:fm,tokenize:mm};function fm(e,t){let r=-1,s,o,i,n,a,h,l,c;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let p={...e[s][1].end},v={...e[r][1].start};Kh(p,-h),Kh(v,h),n={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[s][1].end}},a={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},i={type:h>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...n.start},end:{...a.end}},e[s][1].end={...n.start},e[r][1].start={...a.end},l=[],e[s][1].end.offset-e[s][1].start.offset&&(l=tt(l,[["enter",e[s][1],t],["exit",e[s][1],t]])),l=tt(l,[["enter",o,t],["enter",n,t],["exit",n,t],["enter",i,t]]),l=tt(l,dr(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),l=tt(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,l=tt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,He(e,s-1,r-s+3,l),r=s+l.length-c-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function mm(e,t){let r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=Gt(s),i;return n;function n(h){return i=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===i)return e.consume(h),a;let l=e.exit("attentionSequence"),c=Gt(h),p=!c||c===2&&o||r.includes(h),v=!o||o===2&&c||r.includes(s);return l._open=!!(i===42?p:p&&(o||!v)),l._close=!!(i===42?v:v&&(c||!p)),t(h)}}function Kh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var lo={name:"autolink",tokenize:gm};function gm(e,t,r){let s=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return $e(g)?(e.consume(g),n):g===64?r(g):l(g)}function n(g){return g===43||g===45||g===46||Be(g)?(s=1,a(g)):l(g)}function a(g){return g===58?(e.consume(g),s=0,h):(g===43||g===45||g===46||Be(g))&&s++<32?(e.consume(g),a):(s=0,l(g))}function h(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Br(g)?r(g):(e.consume(g),h)}function l(g){return g===64?(e.consume(g),c):Uh(g)?(e.consume(g),l):r(g)}function c(g){return Be(g)?p(g):r(g)}function p(g){return g===46?(e.consume(g),s=0,c):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||Be(g))&&s++<63){let u=g===45?v:p;return e.consume(g),u}return r(g)}}var Bt={partial:!0,tokenize:vm};function vm(e,t,r){return s;function s(i){return de(i)?le(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ie(i)?t(i):r(i)}}var Li={continuation:{tokenize:bm},exit:xm,name:"blockQuote",tokenize:_m};function _m(e,t,r){let s=this;return o;function o(n){if(n===62){let a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(n),e.exit("blockQuoteMarker"),i}return r(n)}function i(n){return de(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function bm(e,t,r){let s=this;return o;function o(n){return de(n)?le(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):i(n)}function i(n){return e.attempt(Li,t,r)(n)}}function xm(e){e.exit("blockQuote")}var Oi={name:"characterEscape",tokenize:ym};function ym(e,t,r){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return $h(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var Mi={name:"characterReference",tokenize:wm};function wm(e,t,r){let s=this,o=0,i,n;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,n=Be,c(p))}function l(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,n=jh,c):(e.enter("characterReferenceValue"),i=7,n=$s,c(p))}function c(p){if(p===59&&o){let v=e.exit("characterReferenceValue");return n===Be&&!hs(s.sliceSerialize(v))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return n(p)&&o++<i?(e.consume(p),c):r(p)}}var Xh={partial:!0,tokenize:km},Bi={concrete:!0,name:"codeFenced",tokenize:Sm};function Sm(e,t,r){let s=this,o={partial:!0,tokenize:w},i=0,n=0,a;return h;function h(b){return l(b)}function l(b){let S=s.events[s.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(b)}function c(b){return b===a?(n++,e.consume(b),c):n<3?r(b):(e.exit("codeFencedFenceSequence"),de(b)?le(e,p,"whitespace")(b):p(b))}function p(b){return b===null||ie(b)?(e.exit("codeFencedFence"),s.interrupt?t(b):e.check(Xh,d,y)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||ie(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(b)):de(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,g,"whitespace")(b)):b===96&&b===a?r(b):(e.consume(b),v)}function g(b){return b===null||ie(b)?p(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(b))}function u(b){return b===null||ie(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(b)):b===96&&b===a?r(b):(e.consume(b),u)}function d(b){return e.attempt(o,y,m)(b)}function m(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),f}function f(b){return i>0&&de(b)?le(e,_,"linePrefix",i+1)(b):_(b)}function _(b){return b===null||ie(b)?e.check(Xh,d,y)(b):(e.enter("codeFlowValue"),x(b))}function x(b){return b===null||ie(b)?(e.exit("codeFlowValue"),_(b)):(e.consume(b),x)}function y(b){return e.exit("codeFenced"),t(b)}function w(b,S,T){let R=0;return E;function E(z){return b.enter("lineEnding"),b.consume(z),b.exit("lineEnding"),A}function A(z){return b.enter("codeFencedFence"),de(z)?le(b,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):B(z)}function B(z){return z===a?(b.enter("codeFencedFenceSequence"),M(z)):T(z)}function M(z){return z===a?(R++,b.consume(z),M):R>=n?(b.exit("codeFencedFenceSequence"),de(z)?le(b,H,"whitespace")(z):H(z)):T(z)}function H(z){return z===null||ie(z)?(b.exit("codeFencedFence"),S(z)):T(z)}}}function km(e,t,r){let s=this;return o;function o(n){return n===null?r(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}var Ws={name:"codeIndented",tokenize:Em},Cm={partial:!0,tokenize:Tm};function Em(e,t,r){let s=this;return o;function o(l){return e.enter("codeIndented"),le(e,i,"linePrefix",5)(l)}function i(l){let c=s.events[s.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):r(l)}function n(l){return l===null?h(l):ie(l)?e.attempt(Cm,n,h)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||ie(l)?(e.exit("codeFlowValue"),n(l)):(e.consume(l),a)}function h(l){return e.exit("codeIndented"),t(l)}}function Tm(e,t,r){let s=this;return o;function o(n){return s.parser.lazy[s.now().line]?r(n):ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):le(e,i,"linePrefix",5)(n)}function i(n){let a=s.events[s.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):ie(n)?o(n):r(n)}}var ho={name:"codeText",previous:Dm,resolve:Pm,tokenize:Rm};function Pm(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function Dm(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rm(e,t,r){let s=this,o=0,i,n;return a;function a(v){return e.enter("codeText"),e.enter("codeTextSequence"),h(v)}function h(v){return v===96?(e.consume(v),o++,h):(e.exit("codeTextSequence"),l(v))}function l(v){return v===null?r(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),l):v===96?(n=e.enter("codeTextSequence"),i=0,p(v)):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||ie(v)?(e.exit("codeTextData"),l(v)):(e.consume(v),c)}function p(v){return v===96?(e.consume(v),i++,p):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(n.type="codeTextData",c(v))}}var Fi=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&qs(this.left,s),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);qs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qs(this.left,r.reverse())}}};function qs(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Ni(e){let t={},r=-1,s,o,i,n,a,h,l,c=new Fi(e);for(;++r<c.length;){for(;r in t;)r=t[r];if(s=c.get(r),r&&s[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,i=0,i<h.length&&h[i][1].type==="lineEndingBlank"&&(i+=2),i<h.length&&h[i][1].type==="content"))for(;++i<h.length&&h[i][1].type!=="content";)h[i][1].type==="chunkText"&&(h[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,Am(c,r)),r=t[r],l=!0);else if(s[1]._container){for(i=r,o=void 0;i--;)if(n=c.get(i),n[1].type==="lineEnding"||n[1].type==="lineEndingBlank")n[0]==="enter"&&(o&&(c.get(o)[1].type="lineEndingBlank"),n[1].type="lineEnding",o=i);else if(!(n[1].type==="linePrefix"||n[1].type==="listItemIndent"))break;o&&(s[1].end={...c.get(o)[1].start},a=c.slice(o,r),a.unshift(s),c.splice(o,r-o+1,a))}}return He(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Am(e,t){let r=e.get(t)[1],s=e.get(t)[2],o=t-1,i=[],n=r._tokenizer;n||(n=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(n._contentTypeTextTrailing=!0));let a=n.events,h=[],l={},c,p,v=-1,g=r,u=0,d=0,m=[d];for(;g;){for(;e.get(++o)[1]!==g;);i.push(o),g._tokenizer||(c=s.sliceStream(g),g.next||c.push(null),p&&n.defineSkip(g.start),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=!0),n.write(c),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=r;++v<a.length;)a[v][0]==="exit"&&a[v-1][0]==="enter"&&a[v][1].type===a[v-1][1].type&&a[v][1].start.line!==a[v][1].end.line&&(d=v+1,m.push(d),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(n.events=[],g?(g._tokenizer=void 0,g.previous=void 0):m.pop(),v=m.length;v--;){let f=a.slice(m[v],m[v+1]),_=i.pop();h.push([_,_+f.length-1]),e.splice(_,2,f)}for(h.reverse(),v=-1;++v<h.length;)l[u+h[v][0]]=u+h[v][1],u+=h[v][1]-h[v][0]-1;return l}var co={resolve:Lm,tokenize:Om},Im={partial:!0,tokenize:Mm};function Lm(e){return Ni(e),e}function Om(e,t){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ie(a)?e.check(Im,n,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function n(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function Mm(e,t,r){let s=this;return o;function o(n){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),le(e,i,"linePrefix")}function i(n){if(n===null||ie(n))return r(n);let a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):e.interrupt(s.parser.constructs.flow,r,t)(n)}}function zi(e,t,r,s,o,i,n,a,h){let l=h||Number.POSITIVE_INFINITY,c=0;return p;function p(f){return f===60?(e.enter(s),e.enter(o),e.enter(i),e.consume(f),e.exit(i),v):f===null||f===32||f===41||Br(f)?r(f):(e.enter(s),e.enter(n),e.enter(a),e.enter("chunkString",{contentType:"string"}),d(f))}function v(f){return f===62?(e.enter(i),e.consume(f),e.exit(i),e.exit(o),e.exit(s),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(f))}function g(f){return f===62?(e.exit("chunkString"),e.exit(a),v(f)):f===null||f===60||ie(f)?r(f):(e.consume(f),f===92?u:g)}function u(f){return f===60||f===62||f===92?(e.consume(f),g):g(f)}function d(f){return!c&&(f===null||f===41||be(f))?(e.exit("chunkString"),e.exit(a),e.exit(n),e.exit(s),t(f)):c<l&&f===40?(e.consume(f),c++,d):f===41?(e.consume(f),c--,d):f===null||f===32||f===40||Br(f)?r(f):(e.consume(f),f===92?m:d)}function m(f){return f===40||f===41||f===92?(e.consume(f),d):d(f)}}function Hi(e,t,r,s,o,i){let n=this,a=0,h;return l;function l(g){return e.enter(s),e.enter(o),e.consume(g),e.exit(o),e.enter(i),c}function c(g){return a>999||g===null||g===91||g===93&&!h||g===94&&!a&&"_hiddenFootnoteSupport"in n.parser.constructs?r(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(s),t):ie(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||ie(g)||a++>999?(e.exit("chunkString"),c(g)):(e.consume(g),h||(h=!de(g)),g===92?v:p)}function v(g){return g===91||g===92||g===93?(e.consume(g),a++,p):p(g)}}function Ui(e,t,r,s,o,i){let n;return a;function a(v){return v===34||v===39||v===40?(e.enter(s),e.enter(o),e.consume(v),e.exit(o),n=v===40?41:v,h):r(v)}function h(v){return v===n?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),t):(e.enter(i),l(v))}function l(v){return v===n?(e.exit(i),h(n)):v===null?r(v):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),le(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===n||v===null||ie(v)?(e.exit("chunkString"),l(v)):(e.consume(v),v===92?p:c)}function p(v){return v===n||v===92?(e.consume(v),c):c(v)}}function Nr(e,t){let r;return s;function s(o){return ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):de(o)?le(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}var uo={name:"definition",tokenize:Fm},Bm={partial:!0,tokenize:Nm};function Fm(e,t,r){let s=this,o;return i;function i(g){return e.enter("definition"),n(g)}function n(g){return Hi.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=Je(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),h):r(g)}function h(g){return be(g)?Nr(e,l)(g):l(g)}function l(g){return zi(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function c(g){return e.attempt(Bm,p,p)(g)}function p(g){return de(g)?le(e,v,"whitespace")(g):v(g)}function v(g){return g===null||ie(g)?(e.exit("definition"),s.parser.defined.push(o),t(g)):r(g)}}function Nm(e,t,r){return s;function s(a){return be(a)?Nr(e,o)(a):r(a)}function o(a){return Ui(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return de(a)?le(e,n,"whitespace")(a):n(a)}function n(a){return a===null||ie(a)?t(a):r(a)}}var po={name:"hardBreakEscape",tokenize:zm};function zm(e,t,r){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ie(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var fo={name:"headingAtx",resolve:Hm,tokenize:Um};function Hm(e,t){let r=e.length-2,s=3,o,i;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},i={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},He(e,s,r-s+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Um(e,t,r){let s=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),n(c)}function n(c){return c===35&&s++<6?(e.consume(c),n):c===null||be(c)?(e.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),h(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):de(c)?le(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function h(c){return c===35?(e.consume(c),h):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||be(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var Jh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mo=["pre","script","style","textarea"];var go={concrete:!0,name:"htmlFlow",resolveTo:Vm,tokenize:Wm},jm={partial:!0,tokenize:Km},$m={partial:!0,tokenize:qm};function Vm(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Wm(e,t,r){let s=this,o,i,n,a,h;return l;function l(O){return c(O)}function c(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),i=!0,d):O===63?(e.consume(O),o=3,s.interrupt?t:k):$e(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function v(O){return O===45?(e.consume(O),o=2,g):O===91?(e.consume(O),o=5,a=0,u):$e(O)?(e.consume(O),o=4,s.interrupt?t:k):r(O)}function g(O){return O===45?(e.consume(O),s.interrupt?t:k):r(O)}function u(O){let ee="CDATA[";return O===ee.charCodeAt(a++)?(e.consume(O),a===ee.length?s.interrupt?t:B:u):r(O)}function d(O){return $e(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function m(O){if(O===null||O===47||O===62||be(O)){let ee=O===47,N=n.toLowerCase();return!ee&&!i&&mo.includes(N)?(o=1,s.interrupt?t(O):B(O)):Jh.includes(n.toLowerCase())?(o=6,ee?(e.consume(O),f):s.interrupt?t(O):B(O)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(O):i?_(O):x(O))}return O===45||Be(O)?(e.consume(O),n+=String.fromCharCode(O),m):r(O)}function f(O){return O===62?(e.consume(O),s.interrupt?t:B):r(O)}function _(O){return de(O)?(e.consume(O),_):E(O)}function x(O){return O===47?(e.consume(O),E):O===58||O===95||$e(O)?(e.consume(O),y):de(O)?(e.consume(O),x):E(O)}function y(O){return O===45||O===46||O===58||O===95||Be(O)?(e.consume(O),y):w(O)}function w(O){return O===61?(e.consume(O),b):de(O)?(e.consume(O),w):x(O)}function b(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),h=O,S):de(O)?(e.consume(O),b):T(O)}function S(O){return O===h?(e.consume(O),h=null,R):O===null||ie(O)?r(O):(e.consume(O),S)}function T(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||be(O)?w(O):(e.consume(O),T)}function R(O){return O===47||O===62||de(O)?x(O):r(O)}function E(O){return O===62?(e.consume(O),A):r(O)}function A(O){return O===null||ie(O)?B(O):de(O)?(e.consume(O),A):r(O)}function B(O){return O===45&&o===2?(e.consume(O),j):O===60&&o===1?(e.consume(O),C):O===62&&o===4?(e.consume(O),U):O===63&&o===3?(e.consume(O),k):O===93&&o===5?(e.consume(O),L):ie(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(jm,J,M)(O)):O===null||ie(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),B)}function M(O){return e.check($m,H,J)(O)}function H(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),z}function z(O){return O===null||ie(O)?M(O):(e.enter("htmlFlowData"),B(O))}function j(O){return O===45?(e.consume(O),k):B(O)}function C(O){return O===47?(e.consume(O),n="",D):B(O)}function D(O){if(O===62){let ee=n.toLowerCase();return mo.includes(ee)?(e.consume(O),U):B(O)}return $e(O)&&n.length<8?(e.consume(O),n+=String.fromCharCode(O),D):B(O)}function L(O){return O===93?(e.consume(O),k):B(O)}function k(O){return O===62?(e.consume(O),U):O===45&&o===2?(e.consume(O),k):B(O)}function U(O){return O===null||ie(O)?(e.exit("htmlFlowData"),J(O)):(e.consume(O),U)}function J(O){return e.exit("htmlFlow"),t(O)}}function qm(e,t,r){let s=this;return o;function o(n){return ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i):r(n)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}function Km(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Bt,t,r)}}var vo={name:"htmlText",tokenize:Xm};function Xm(e,t,r){let s=this,o,i,n;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),l):k===47?(e.consume(k),w):k===63?(e.consume(k),x):$e(k)?(e.consume(k),T):r(k)}function l(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,u):$e(k)?(e.consume(k),_):r(k)}function c(k){return k===45?(e.consume(k),g):r(k)}function p(k){return k===null?r(k):k===45?(e.consume(k),v):ie(k)?(n=p,C(k)):(e.consume(k),p)}function v(k){return k===45?(e.consume(k),g):p(k)}function g(k){return k===62?j(k):k===45?v(k):p(k)}function u(k){let U="CDATA[";return k===U.charCodeAt(i++)?(e.consume(k),i===U.length?d:u):r(k)}function d(k){return k===null?r(k):k===93?(e.consume(k),m):ie(k)?(n=d,C(k)):(e.consume(k),d)}function m(k){return k===93?(e.consume(k),f):d(k)}function f(k){return k===62?j(k):k===93?(e.consume(k),f):d(k)}function _(k){return k===null||k===62?j(k):ie(k)?(n=_,C(k)):(e.consume(k),_)}function x(k){return k===null?r(k):k===63?(e.consume(k),y):ie(k)?(n=x,C(k)):(e.consume(k),x)}function y(k){return k===62?j(k):x(k)}function w(k){return $e(k)?(e.consume(k),b):r(k)}function b(k){return k===45||Be(k)?(e.consume(k),b):S(k)}function S(k){return ie(k)?(n=S,C(k)):de(k)?(e.consume(k),S):j(k)}function T(k){return k===45||Be(k)?(e.consume(k),T):k===47||k===62||be(k)?R(k):r(k)}function R(k){return k===47?(e.consume(k),j):k===58||k===95||$e(k)?(e.consume(k),E):ie(k)?(n=R,C(k)):de(k)?(e.consume(k),R):j(k)}function E(k){return k===45||k===46||k===58||k===95||Be(k)?(e.consume(k),E):A(k)}function A(k){return k===61?(e.consume(k),B):ie(k)?(n=A,C(k)):de(k)?(e.consume(k),A):R(k)}function B(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),o=k,M):ie(k)?(n=B,C(k)):de(k)?(e.consume(k),B):(e.consume(k),H)}function M(k){return k===o?(e.consume(k),o=void 0,z):k===null?r(k):ie(k)?(n=M,C(k)):(e.consume(k),M)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||be(k)?R(k):(e.consume(k),H)}function z(k){return k===47||k===62||be(k)?R(k):r(k)}function j(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function C(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),D}function D(k){return de(k)?le(e,L,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return e.enter("htmlTextData"),n(k)}}var zr={name:"labelEnd",resolveAll:Qm,resolveTo:Zm,tokenize:eg},Jm={tokenize:tg},Gm={tokenize:rg},Ym={tokenize:sg};function Qm(e){let t=-1,r=[];for(;++t<e.length;){let s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){let o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&He(e,0,e.length,r),e}function Zm(e,t){let r=e.length,s=0,o,i,n,a;for(;r--;)if(o=e[r][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(n){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(n=r);let h={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[n][1].end}},c={type:"labelText",start:{...e[i+s+2][1].end},end:{...e[n-2][1].start}};return a=[["enter",h,t],["enter",l,t]],a=tt(a,e.slice(i+1,i+s+3)),a=tt(a,[["enter",c,t]]),a=tt(a,dr(t.parser.constructs.insideSpan.null,e.slice(i+s+4,n-3),t)),a=tt(a,[["exit",c,t],e[n-2],e[n-1],["exit",l,t]]),a=tt(a,e.slice(n+1)),a=tt(a,[["exit",h,t]]),He(e,i,e.length,a),e}function eg(e,t,r){let s=this,o=s.events.length,i,n;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){i=s.events[o][1];break}return a;function a(v){return i?i._inactive?p(v):(n=s.parser.defined.includes(Je(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(Jm,c,n?c:p)(v):v===91?e.attempt(Gm,c,n?l:p)(v):n?c(v):p(v)}function l(v){return e.attempt(Ym,c,p)(v)}function c(v){return t(v)}function p(v){return i._balanced=!0,r(v)}}function tg(e,t,r){return s;function s(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return be(p)?Nr(e,i)(p):i(p)}function i(p){return p===41?c(p):zi(e,n,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function n(p){return be(p)?Nr(e,h)(p):c(p)}function a(p){return r(p)}function h(p){return p===34||p===39||p===40?Ui(e,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):c(p)}function l(p){return be(p)?Nr(e,c)(p):c(p)}function c(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function rg(e,t,r){let s=this;return o;function o(a){return Hi.call(s,e,i,n,"reference","referenceMarker","referenceString")(a)}function i(a){return s.parser.defined.includes(Je(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(a):r(a)}function n(a){return r(a)}}function sg(e,t,r){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var _o={name:"labelStartImage",resolveAll:zr.resolveAll,tokenize:ig};function ig(e,t,r){let s=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),n):r(a)}function n(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):t(a)}}var bo={name:"labelStartLink",resolveAll:zr.resolveAll,tokenize:ng};function ng(e,t,r){let s=this;return o;function o(n){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelLink"),i}function i(n){return n===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(n):t(n)}}var Ks={name:"lineEnding",tokenize:og};function og(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),le(e,t,"linePrefix")}}var Hr={name:"thematicBreak",tokenize:ag};function ag(e,t,r){let s=0,o;return i;function i(l){return e.enter("thematicBreak"),n(l)}function n(l){return o=l,a(l)}function a(l){return l===o?(e.enter("thematicBreakSequence"),h(l)):s>=3&&(l===null||ie(l))?(e.exit("thematicBreak"),t(l)):r(l)}function h(l){return l===o?(e.consume(l),s++,h):(e.exit("thematicBreakSequence"),de(l)?le(e,a,"whitespace")(l):a(l))}}var Ge={continuation:{tokenize:dg},exit:pg,name:"list",tokenize:cg},lg={partial:!0,tokenize:fg},hg={partial:!0,tokenize:ug};function cg(e,t,r){let s=this,o=s.events[s.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,n=0;return a;function a(g){let u=s.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(u==="listUnordered"?!s.containerState.marker||g===s.containerState.marker:$s(g)){if(s.containerState.type||(s.containerState.type=u,e.enter(u,{_container:!0})),u==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Hr,r,l)(g):l(g);if(!s.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(g)}return r(g)}function h(g){return $s(g)&&++n<10?(e.consume(g),h):(!s.interrupt||n<2)&&(s.containerState.marker?g===s.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),l(g)):r(g)}function l(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||g,e.check(Bt,s.interrupt?r:c,e.attempt(lg,v,p))}function c(g){return s.containerState.initialBlankLine=!0,i++,v(g)}function p(g){return de(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):r(g)}function v(g){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function dg(e,t,r){let s=this;return s.containerState._closeFlow=void 0,e.check(Bt,o,i);function o(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,le(e,t,"listItemIndent",s.containerState.size+1)(a)}function i(a){return s.containerState.furtherBlankLines||!de(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(hg,t,n)(a))}function n(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,le(e,e.attempt(Ge,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ug(e,t,r){let s=this;return le(e,o,"listItemIndent",s.containerState.size+1);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="listItemIndent"&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?t(i):r(i)}}function pg(e){e.exit(this.containerState.type)}function fg(e,t,r){let s=this;return le(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let n=s.events[s.events.length-1];return!de(i)&&n&&n[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var ji={name:"setextUnderline",resolveTo:mg,tokenize:gg};function mg(e,t){let r=e.length,s,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let n={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",n,t]),e.splice(i+1,0,["exit",e[s][1],t]),e[s][1].end={...e[i][1].end}):e[s][1]=n,e.push(["exit",n,t]),e}function gg(e,t,r){let s=this,o;return i;function i(l){let c=s.events.length,p;for(;c--;)if(s.events[c][1].type!=="lineEnding"&&s.events[c][1].type!=="linePrefix"&&s.events[c][1].type!=="content"){p=s.events[c][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||p)?(e.enter("setextHeadingLine"),o=l,n(l)):r(l)}function n(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===o?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),de(l)?le(e,h,"lineSuffix")(l):h(l))}function h(l){return l===null||ie(l)?(e.exit("setextHeadingLine"),t(l)):r(l)}}var Gh={tokenize:vg};function vg(e){let t=this,r=e.attempt(Bt,s,e.attempt(this.parser.constructs.flowInitial,o,le(e,e.attempt(this.parser.constructs.flow,o,e.attempt(co,o)),"linePrefix")));return r;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var Yh={resolveAll:tc()},Qh=ec("string"),Zh=ec("text");function ec(e){return{resolveAll:tc(e==="text"?_g:void 0),tokenize:t};function t(r){let s=this,o=this.parser.constructs[e],i=r.attempt(o,n,a);return n;function n(c){return l(c)?i(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),h}function h(c){return l(c)?(r.exit("data"),i(c)):(r.consume(c),h)}function l(c){if(c===null)return!0;let p=o[c],v=-1;if(p)for(;++v<p.length;){let g=p[v];if(!g.previous||g.previous.call(s,s.previous))return!0}return!1}}}function tc(e){return t;function t(r,s){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(r,s):r}}function _g(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let s=e[r-1][1],o=t.sliceStream(s),i=o.length,n=-1,a=0,h;for(;i--;){let l=o[i];if(typeof l=="string"){for(n=l.length;l.charCodeAt(n-1)===32;)a++,n--;if(n)break;n=-1}else if(l===-2)h=!0,a++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(a=0),a){let l={type:r===e.length||h||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?n:s.start._bufferIndex+n,_index:s.start._index+i,line:s.end.line,column:s.end.column-a,offset:s.end.offset-a},end:{...s.end}};s.end={...l.start},s.start.offset===s.end.offset?Object.assign(s,l):(e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2)}r++}return e}var xo={};Hn(xo,{attentionMarkers:()=>Eg,contentInitial:()=>xg,disable:()=>Tg,document:()=>bg,flow:()=>wg,flowInitial:()=>yg,insideSpan:()=>Cg,string:()=>Sg,text:()=>kg});var bg={42:Ge,43:Ge,45:Ge,48:Ge,49:Ge,50:Ge,51:Ge,52:Ge,53:Ge,54:Ge,55:Ge,56:Ge,57:Ge,62:Li},xg={91:uo},yg={[-2]:Ws,[-1]:Ws,32:Ws},wg={35:fo,42:Hr,45:[ji,Hr],60:go,61:ji,95:Hr,96:Bi,126:Bi},Sg={38:Mi,92:Oi},kg={[-5]:Ks,[-4]:Ks,[-3]:Ks,33:_o,38:Mi,42:Vs,60:[lo,vo],91:bo,92:[po,Oi],93:zr,95:Vs,96:ho},Cg={null:[Vs,Yh]},Eg={null:[42,95]},Tg={null:[]};function rc(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},i=[],n=[],a=[],h=!0,l={attempt:R(S),check:R(T),consume:y,enter:w,exit:b,interrupt:R(T,{interrupt:!0})},c={code:null,containerState:{},defineSkip:f,events:[],now:m,parser:e,previous:null,sliceSerialize:u,sliceStream:d,write:g},p=t.tokenize.call(c,l),v;return t.resolveAll&&i.push(t),c;function g(M){return n=tt(n,M),_(),n[n.length-1]!==null?[]:(E(t,0),c.events=dr(i,c.events,c),c.events)}function u(M,H){return Dg(d(M),H)}function d(M){return Pg(n,M)}function m(){let{_bufferIndex:M,_index:H,line:z,column:j,offset:C}=s;return{_bufferIndex:M,_index:H,line:z,column:j,offset:C}}function f(M){o[M.line]=M.column,B()}function _(){let M;for(;s._index<n.length;){let H=n[s._index];if(typeof H=="string")for(M=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===M&&s._bufferIndex<H.length;)x(H.charCodeAt(s._bufferIndex));else x(H)}}function x(M){h=void 0,v=M,p=p(M)}function y(M){ie(M)?(s.line++,s.column=1,s.offset+=M===-3?2:1,B()):M!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===n[s._index].length&&(s._bufferIndex=-1,s._index++)),c.previous=M,h=!0}function w(M,H){let z=H||{};return z.type=M,z.start=m(),c.events.push(["enter",z,c]),a.push(z),z}function b(M){let H=a.pop();return H.end=m(),c.events.push(["exit",H,c]),H}function S(M,H){E(M,H.from)}function T(M,H){H.restore()}function R(M,H){return z;function z(j,C,D){let L,k,U,J;return Array.isArray(j)?ee(j):"tokenize"in j?ee([j]):O(j);function O(V){return te;function te(Q){let G=Q!==null&&V[Q],oe=Q!==null&&V.null,me=[...Array.isArray(G)?G:G?[G]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ee(me)(Q)}}function ee(V){return L=V,k=0,V.length===0?D:N(V[k])}function N(V){return te;function te(Q){return J=A(),U=V,V.partial||(c.currentConstruct=V),V.name&&c.parser.constructs.disable.null.includes(V.name)?$(Q):V.tokenize.call(H?Object.assign(Object.create(c),H):c,l,P,$)(Q)}}function P(V){return h=!0,M(U,J),C}function $(V){return h=!0,J.restore(),++k<L.length?N(L[k]):D}}}function E(M,H){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&He(c.events,H,c.events.length-H,M.resolve(c.events.slice(H),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function A(){let M=m(),H=c.previous,z=c.currentConstruct,j=c.events.length,C=Array.from(a);return{from:j,restore:D};function D(){s=M,c.previous=H,c.currentConstruct=z,c.events.length=j,a=C,B()}}function B(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function Pg(e,t){let r=t.start._index,s=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,n;if(r===o)n=[e[r].slice(s,i)];else{if(n=e.slice(r,o),s>-1){let a=n[0];typeof a=="string"?n[0]=a.slice(s):n.shift()}i>0&&n.push(e[o].slice(0,i))}return n}function Dg(e,t){let r=-1,s=[],o;for(;++r<e.length;){let i=e[r],n;if(typeof i=="string")n=i;else switch(i){case-5:{n="\r";break}case-4:{n=`
|
|
12
12
|
`;break}case-3:{n=`\r
|
|
13
|
-
`;break}case-2:{n=t?" ":" ";break}case-1:{if(!t&&o)continue;n=" ";break}default:n=String.fromCharCode(i)}o=i===-2,s.push(n)}return s.join("")}function xo(e){let s={constructs:Ai([bo,...(e||{}).extensions||[]]),content:o($h),defined:[],document:o(Wh),flow:o(Jh),lazy:{},string:o(Yh),text:o(Qh)};return s;function o(i){return n;function n(a){return tc(s,i,a)}}}function yo(e){for(;!Ni(e););return e}var rc=/[\0\t\n\r]/g;function wo(){let e=1,t="",r=!0,s;return o;function o(i,n,a){let h=[],l,c,p,v,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(n||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(rc.lastIndex=p,l=rc.exec(i),v=l&&l.index!==void 0?l.index:i.length,g=i.charCodeAt(v),!l){t=i.slice(p);break}if(g===10&&p===v&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),p<v&&(h.push(i.slice(p,v)),e+=v-p),g){case 0:{h.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,h.push(-2);e++<c;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}p=v+1}return a&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}var Dg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sc(e){return e.replace(Dg,Rg)}function Rg(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let o=r.charCodeAt(1),i=o===120||o===88;return Ii(r.slice(i?2:1),i?16:10)}return hs(r)||e}var nc={}.hasOwnProperty;function So(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),Ag(r)(yo(xo(r).document().write(wo()(e,t,!0))))}function Ag(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ot),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(se),blockQuote:i(Q),characterEscape:R,characterReference:R,codeFenced:i(G),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:i(G,n),codeText:i(oe,n),codeTextData:R,data:R,codeFlowValue:R,definition:i(me),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:i(De),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(ft,n),htmlFlowData:R,htmlText:i(ft,n),htmlTextData:R,image:i(or),label:n,link:i(Ot),listItem:i(ot),listItemValue:v,listOrdered:i(Tr,p),listUnordered:i(Tr),paragraph:i(Pr),reference:O,referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:i(se),strong:i(kt),thematicBreak:i(Is)},exit:{atxHeading:h(),atxHeadingSequence:w,autolink:h(),autolinkEmail:te,autolinkProtocol:V,blockQuote:h(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:N,characterReferenceMarkerNumeric:N,characterReferenceValue:P,characterReference:$,codeFenced:h(m),codeFencedFence:d,codeFencedFenceInfo:g,codeFencedFenceMeta:u,codeFlowValue:E,codeIndented:h(f),codeText:h(z),codeTextData:E,data:E,definition:h(),definitionDestinationString:y,definitionLabelString:_,definitionTitleString:x,emphasis:h(),hardBreakEscape:h(B),hardBreakTrailing:h(B),htmlFlow:h(M),htmlFlowData:E,htmlText:h(H),htmlTextData:E,image:h(C),label:L,labelText:D,lineEnding:A,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ee,resourceDestinationString:k,resourceTitleString:U,resource:J,setextHeading:h(T),setextHeadingLineSequence:S,setextHeadingText:b,strong:h(),thematicBreak:h()}};oc(t,(e||{}).mdastExtensions||[]);let r={};return s;function s(q){let Z={type:"root",children:[]},ce={stack:[Z],tokenStack:[],config:t,enter:a,exit:l,buffer:n,resume:c,data:r},ve=[],ue=-1;for(;++ue<q.length;)if(q[ue][1].type==="listOrdered"||q[ue][1].type==="listUnordered")if(q[ue][0]==="enter")ve.push(ue);else{let mt=ve.pop();ue=o(q,mt,ue)}for(ue=-1;++ue<q.length;){let mt=t[q[ue][0]];nc.call(mt,q[ue][1].type)&&mt[q[ue][1].type].call(Object.assign({sliceSerialize:q[ue][2].sliceSerialize},ce),q[ue][1])}if(ce.tokenStack.length>0){let mt=ce.tokenStack[ce.tokenStack.length-1];(mt[1]||ic).call(ce,void 0,mt[0])}for(Z.position={start:ur(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:ur(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)Z=t.transforms[ue](Z)||Z;return Z}function o(q,Z,ce){let ve=Z-1,ue=-1,mt=!1,Rr,Wt,Ls,Os;for(;++ve<=ce;){let gt=q[ve];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?ue++:ue--,Os=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(Rr&&!Os&&!ue&&!Ls&&(Ls=ve),Os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Os=void 0}if(!ue&>[0]==="enter"&>[1].type==="listItemPrefix"||ue===-1&>[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(Rr){let as=ve;for(Wt=void 0;as--;){let qt=q[as];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Wt&&(q[Wt][1].type="lineEndingBlank",mt=!0),qt[1].type="lineEnding",Wt=as}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}Ls&&(!Wt||Ls<Wt)&&(Rr._spread=!0),Rr.end=Object.assign({},Wt?q[Wt][1].start:gt[1].end),q.splice(Wt||ve,0,["exit",Rr,gt[2]]),ve++,ce++}if(gt[1].type==="listItemPrefix"){let as={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};Rr=as,q.splice(ve,0,["enter",as,gt[2]]),ve++,ce++,Ls=void 0,Os=!0}}}return q[Z][1]._spread=mt,ce}function i(q,Z){return ce;function ce(ve){a.call(this,q(ve),ve),Z&&Z.call(this,ve)}}function n(){this.stack.push({type:"fragment",children:[]})}function a(q,Z,ce){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([Z,ce||void 0]),q.position={start:ur(Z.start),end:void 0}}function h(q){return Z;function Z(ce){q&&q.call(this,ce),l.call(this,ce)}}function l(q,Z){let ce=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==q.type&&(Z?Z.call(this,q,ve[0]):(ve[1]||ic).call(this,q,ve[0]));else throw new Error("Cannot close `"+q.type+"` ("+hr({start:q.start,end:q.end})+"): it\u2019s not open");ce.position.end=ur(q.end)}function c(){return Mr(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){let Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function g(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=q}function u(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=q}function d(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/(\r?\n|\r)$/g,"")}function _(q){let Z=this.resume(),ce=this.stack[this.stack.length-1];ce.label=Z,ce.identifier=Je(this.sliceSerialize(q)).toLowerCase()}function x(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function y(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function w(q){let Z=this.stack[this.stack.length-1];if(!Z.depth){let ce=this.sliceSerialize(q).length;Z.depth=ce}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function S(q){let Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function R(q){let ce=this.stack[this.stack.length-1].children,ve=ce[ce.length-1];(!ve||ve.type!=="text")&&(ve=Dr(),ve.position={start:ur(q.start),end:void 0},ce.push(ve)),this.stack.push(ve)}function E(q){let Z=this.stack.pop();Z.value+=this.sliceSerialize(q),Z.position.end=ur(q.end)}function A(q){let Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){let ce=Z.children[Z.children.length-1];ce.position.end=ur(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(R.call(this,q),E.call(this,q))}function B(){this.data.atHardBreak=!0}function M(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function H(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function z(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function j(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function C(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function D(q){let Z=this.sliceSerialize(q),ce=this.stack[this.stack.length-2];ce.label=sc(Z),ce.identifier=Je(Z).toLowerCase()}function L(){let q=this.stack[this.stack.length-1],Z=this.resume(),ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,ce.type==="link"){let ve=q.children;ce.children=ve}else ce.alt=Z}function k(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function U(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function J(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(q){let Z=this.resume(),ce=this.stack[this.stack.length-1];ce.label=Z,ce.identifier=Je(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function N(q){this.data.characterReferenceType=q.type}function P(q){let Z=this.sliceSerialize(q),ce=this.data.characterReferenceType,ve;ce?(ve=Ii(Z,ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=hs(Z);let ue=this.stack[this.stack.length-1];ue.value+=ve}function $(q){let Z=this.stack.pop();Z.position.end=ur(q.end)}function V(q){E.call(this,q);let Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(q)}function te(q){E.call(this,q);let Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(q)}function Q(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function se(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function ft(){return{type:"html",value:""}}function or(){return{type:"image",title:null,url:"",alt:null}}function Ot(){return{type:"link",title:null,url:"",children:[]}}function Tr(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function ot(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Pr(){return{type:"paragraph",children:[]}}function kt(){return{type:"strong",children:[]}}function Dr(){return{type:"text",value:""}}function Is(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function oc(e,t){let r=-1;for(;++r<t.length;){let s=t[r];Array.isArray(s)?oc(e,s):Ig(e,s)}}function Ig(e,t){let r;for(r in t)if(nc.call(t,r))switch(r){case"canContainEols":{let s=t[r];s&&e[r].push(...s);break}case"transforms":{let s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{let s=t[r];s&&Object.assign(e[r],s);break}}}function ic(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is still open")}function $i(e){let t=this;t.parser=r;function r(s){return So(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ac(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function lc(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
14
|
-
`}]}function
|
|
15
|
-
`:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
13
|
+
`;break}case-2:{n=t?" ":" ";break}case-1:{if(!t&&o)continue;n=" ";break}default:n=String.fromCharCode(i)}o=i===-2,s.push(n)}return s.join("")}function yo(e){let s={constructs:Ai([xo,...(e||{}).extensions||[]]),content:o(Vh),defined:[],document:o(qh),flow:o(Gh),lazy:{},string:o(Qh),text:o(Zh)};return s;function o(i){return n;function n(a){return rc(s,i,a)}}}function wo(e){for(;!Ni(e););return e}var sc=/[\0\t\n\r]/g;function So(){let e=1,t="",r=!0,s;return o;function o(i,n,a){let h=[],l,c,p,v,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(n||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(sc.lastIndex=p,l=sc.exec(i),v=l&&l.index!==void 0?l.index:i.length,g=i.charCodeAt(v),!l){t=i.slice(p);break}if(g===10&&p===v&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),p<v&&(h.push(i.slice(p,v)),e+=v-p),g){case 0:{h.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,h.push(-2);e++<c;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}p=v+1}return a&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}var Rg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ic(e){return e.replace(Rg,Ag)}function Ag(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let o=r.charCodeAt(1),i=o===120||o===88;return Ii(r.slice(i?2:1),i?16:10)}return hs(r)||e}var oc={}.hasOwnProperty;function ko(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),Ig(r)(wo(yo(r).document().write(So()(e,t,!0))))}function Ig(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ot),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(se),blockQuote:i(Q),characterEscape:R,characterReference:R,codeFenced:i(G),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:i(G,n),codeText:i(oe,n),codeTextData:R,data:R,codeFlowValue:R,definition:i(me),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:i(De),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(ft,n),htmlFlowData:R,htmlText:i(ft,n),htmlTextData:R,image:i(or),label:n,link:i(Ot),listItem:i(ot),listItemValue:v,listOrdered:i(Tr,p),listUnordered:i(Tr),paragraph:i(Pr),reference:O,referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:i(se),strong:i(kt),thematicBreak:i(Is)},exit:{atxHeading:h(),atxHeadingSequence:w,autolink:h(),autolinkEmail:te,autolinkProtocol:V,blockQuote:h(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:N,characterReferenceMarkerNumeric:N,characterReferenceValue:P,characterReference:$,codeFenced:h(m),codeFencedFence:d,codeFencedFenceInfo:g,codeFencedFenceMeta:u,codeFlowValue:E,codeIndented:h(f),codeText:h(z),codeTextData:E,data:E,definition:h(),definitionDestinationString:y,definitionLabelString:_,definitionTitleString:x,emphasis:h(),hardBreakEscape:h(B),hardBreakTrailing:h(B),htmlFlow:h(M),htmlFlowData:E,htmlText:h(H),htmlTextData:E,image:h(C),label:L,labelText:D,lineEnding:A,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ee,resourceDestinationString:k,resourceTitleString:U,resource:J,setextHeading:h(T),setextHeadingLineSequence:S,setextHeadingText:b,strong:h(),thematicBreak:h()}};ac(t,(e||{}).mdastExtensions||[]);let r={};return s;function s(q){let Z={type:"root",children:[]},ce={stack:[Z],tokenStack:[],config:t,enter:a,exit:l,buffer:n,resume:c,data:r},ve=[],ue=-1;for(;++ue<q.length;)if(q[ue][1].type==="listOrdered"||q[ue][1].type==="listUnordered")if(q[ue][0]==="enter")ve.push(ue);else{let mt=ve.pop();ue=o(q,mt,ue)}for(ue=-1;++ue<q.length;){let mt=t[q[ue][0]];oc.call(mt,q[ue][1].type)&&mt[q[ue][1].type].call(Object.assign({sliceSerialize:q[ue][2].sliceSerialize},ce),q[ue][1])}if(ce.tokenStack.length>0){let mt=ce.tokenStack[ce.tokenStack.length-1];(mt[1]||nc).call(ce,void 0,mt[0])}for(Z.position={start:ur(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:ur(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)Z=t.transforms[ue](Z)||Z;return Z}function o(q,Z,ce){let ve=Z-1,ue=-1,mt=!1,Rr,Wt,Ls,Os;for(;++ve<=ce;){let gt=q[ve];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?ue++:ue--,Os=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(Rr&&!Os&&!ue&&!Ls&&(Ls=ve),Os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Os=void 0}if(!ue&>[0]==="enter"&>[1].type==="listItemPrefix"||ue===-1&>[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(Rr){let as=ve;for(Wt=void 0;as--;){let qt=q[as];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Wt&&(q[Wt][1].type="lineEndingBlank",mt=!0),qt[1].type="lineEnding",Wt=as}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}Ls&&(!Wt||Ls<Wt)&&(Rr._spread=!0),Rr.end=Object.assign({},Wt?q[Wt][1].start:gt[1].end),q.splice(Wt||ve,0,["exit",Rr,gt[2]]),ve++,ce++}if(gt[1].type==="listItemPrefix"){let as={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};Rr=as,q.splice(ve,0,["enter",as,gt[2]]),ve++,ce++,Ls=void 0,Os=!0}}}return q[Z][1]._spread=mt,ce}function i(q,Z){return ce;function ce(ve){a.call(this,q(ve),ve),Z&&Z.call(this,ve)}}function n(){this.stack.push({type:"fragment",children:[]})}function a(q,Z,ce){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([Z,ce||void 0]),q.position={start:ur(Z.start),end:void 0}}function h(q){return Z;function Z(ce){q&&q.call(this,ce),l.call(this,ce)}}function l(q,Z){let ce=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==q.type&&(Z?Z.call(this,q,ve[0]):(ve[1]||nc).call(this,q,ve[0]));else throw new Error("Cannot close `"+q.type+"` ("+hr({start:q.start,end:q.end})+"): it\u2019s not open");ce.position.end=ur(q.end)}function c(){return Mr(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){let Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function g(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=q}function u(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=q}function d(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/(\r?\n|\r)$/g,"")}function _(q){let Z=this.resume(),ce=this.stack[this.stack.length-1];ce.label=Z,ce.identifier=Je(this.sliceSerialize(q)).toLowerCase()}function x(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function y(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function w(q){let Z=this.stack[this.stack.length-1];if(!Z.depth){let ce=this.sliceSerialize(q).length;Z.depth=ce}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function S(q){let Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function R(q){let ce=this.stack[this.stack.length-1].children,ve=ce[ce.length-1];(!ve||ve.type!=="text")&&(ve=Dr(),ve.position={start:ur(q.start),end:void 0},ce.push(ve)),this.stack.push(ve)}function E(q){let Z=this.stack.pop();Z.value+=this.sliceSerialize(q),Z.position.end=ur(q.end)}function A(q){let Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){let ce=Z.children[Z.children.length-1];ce.position.end=ur(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(R.call(this,q),E.call(this,q))}function B(){this.data.atHardBreak=!0}function M(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function H(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function z(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function j(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function C(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function D(q){let Z=this.sliceSerialize(q),ce=this.stack[this.stack.length-2];ce.label=ic(Z),ce.identifier=Je(Z).toLowerCase()}function L(){let q=this.stack[this.stack.length-1],Z=this.resume(),ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,ce.type==="link"){let ve=q.children;ce.children=ve}else ce.alt=Z}function k(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function U(){let q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function J(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(q){let Z=this.resume(),ce=this.stack[this.stack.length-1];ce.label=Z,ce.identifier=Je(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function N(q){this.data.characterReferenceType=q.type}function P(q){let Z=this.sliceSerialize(q),ce=this.data.characterReferenceType,ve;ce?(ve=Ii(Z,ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=hs(Z);let ue=this.stack[this.stack.length-1];ue.value+=ve}function $(q){let Z=this.stack.pop();Z.position.end=ur(q.end)}function V(q){E.call(this,q);let Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(q)}function te(q){E.call(this,q);let Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(q)}function Q(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function se(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function ft(){return{type:"html",value:""}}function or(){return{type:"image",title:null,url:"",alt:null}}function Ot(){return{type:"link",title:null,url:"",children:[]}}function Tr(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function ot(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Pr(){return{type:"paragraph",children:[]}}function kt(){return{type:"strong",children:[]}}function Dr(){return{type:"text",value:""}}function Is(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function ac(e,t){let r=-1;for(;++r<t.length;){let s=t[r];Array.isArray(s)?ac(e,s):Lg(e,s)}}function Lg(e,t){let r;for(r in t)if(oc.call(t,r))switch(r){case"canContainEols":{let s=t[r];s&&e[r].push(...s);break}case"transforms":{let s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{let s=t[r];s&&Object.assign(e[r],s);break}}}function nc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is still open")}function $i(e){let t=this;t.parser=r;function r(s){return ko(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lc(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function hc(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
14
|
+
`}]}function cc(e,t){let r=t.value?t.value+`
|
|
15
|
+
`:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function dc(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function uc(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pc(e,t){let r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),o=Et(s.toLowerCase()),i=e.footnoteOrder.indexOf(s),n,a=e.footnoteCounts.get(s);a===void 0?(a=0,e.footnoteOrder.push(s),n=e.footnoteOrder.length):n=i+1,a+=1,e.footnoteCounts.set(s,a);let h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,h);let l={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,l),e.applyData(t,l)}function fc(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mc(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function Vi(e,t){let r=t.referenceType,s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];let o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});let n=o[o.length-1];return n&&n.type==="text"?n.value+=s:o.push({type:"text",value:s}),o}function gc(e,t){let r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return Vi(e,t);let o={src:Et(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(o.title=s.title);let i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function vc(e,t){let r={src:Et(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);let s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function _c(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,s),e.applyData(t,s)}function bc(e,t){let r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return Vi(e,t);let o={href:Et(s.url||"")};s.title!==null&&s.title!==void 0&&(o.title=s.title);let i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function xc(e,t){let r={href:Et(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);let s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function yc(e,t,r){let s=e.all(t),o=r?Og(r):wc(t),i={},n=[];if(typeof t.checked=="boolean"){let c=s[0],p;c&&c.type==="element"&&c.tagName==="p"?p=c:(p={type:"element",tagName:"p",properties:{},children:[]},s.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<s.length;){let c=s[a];(o||a!==0||c.type!=="element"||c.tagName!=="p")&&n.push({type:"text",value:`
|
|
16
16
|
`}),c.type==="element"&&c.tagName==="p"&&!o?n.push(...c.children):n.push(c)}let h=s[s.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&n.push({type:"text",value:`
|
|
17
|
-
`});let l={type:"element",tagName:"li",properties:i,children:n};return e.patch(t,l),e.applyData(t,l)}function
|
|
17
|
+
`});let l={type:"element",tagName:"li",properties:i,children:n};return e.patch(t,l),e.applyData(t,l)}function Og(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let r=e.children,s=-1;for(;!t&&++s<r.length;)t=wc(r[s])}return t}function wc(e){let t=e.spread;return t??e.children.length>1}function Sc(e,t){let r={},s=e.all(t),o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<s.length;){let n=s[o];if(n.type==="element"&&n.tagName==="li"&&n.properties&&Array.isArray(n.properties.className)&&n.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function kc(e,t){let r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Cc(e,t){let r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function Ec(e,t){let r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Tc(e,t){let r=e.all(t),s=r.shift(),o=[];if(s){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],n),o.push(n)}if(r.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},a=ls(t.children[1]),h=Ri(t.children[t.children.length-1]);a&&h&&(n.position={start:a,end:h}),o.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function Pc(e,t,r){let s=r?r.children:void 0,i=(s?s.indexOf(t):1)===0?"th":"td",n=r&&r.type==="table"?r.align:void 0,a=n?n.length:t.children.length,h=-1,l=[];for(;++h<a;){let p=t.children[h],v={},g=n?n[h]:void 0;g&&(v.align=g);let u={type:"element",tagName:i,properties:v,children:[]};p&&(u.children=e.all(p),e.patch(p,u),u=e.applyData(p,u)),l.push(u)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function Dc(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ac(e){let t=String(e),r=/\r?\n|\r/g,s=r.exec(t),o=0,i=[];for(;s;)i.push(Rc(t.slice(o,s.index),o>0,!0),s[0]),o=s.index+s[0].length,s=r.exec(t);return i.push(Rc(t.slice(o),o>0,!1)),i.join("")}function Rc(e,t,r){let s=0,o=e.length;if(t){let i=e.codePointAt(s);for(;i===9||i===32;)s++,i=e.codePointAt(s)}if(r){let i=e.codePointAt(o-1);for(;i===9||i===32;)o--,i=e.codePointAt(o-1)}return o>s?e.slice(s,o):""}function Ic(e,t){let r={type:"text",value:Ac(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function Lc(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}var Oc={blockquote:lc,break:hc,code:cc,delete:dc,emphasis:uc,footnoteReference:pc,heading:fc,html:mc,imageReference:gc,image:vc,inlineCode:_c,linkReference:bc,link:xc,listItem:yc,list:Sc,paragraph:kc,root:Cc,strong:Ec,table:Tc,tableCell:Dc,tableRow:Pc,text:Ic,thematicBreak:Lc,toml:Wi,yaml:Wi,definition:Wi,footnoteDefinition:Wi};function Wi(){}var Hc=typeof self=="object"?self:globalThis,Mc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Hc[e](t)},Ng=(e,t)=>{let r=(o,i)=>(e.set(i,o),o),s=o=>{if(e.has(o))return e.get(o);let[i,n]=t[o];switch(i){case 0:case-1:return r(n,o);case 1:{let a=r([],o);for(let h of n)a.push(s(h));return a}case 2:{let a=r({},o);for(let[h,l]of n)a[s(h)]=s(l);return a}case 3:return r(new Date(n),o);case 4:{let{source:a,flags:h}=n;return r(new RegExp(a,h),o)}case 5:{let a=r(new Map,o);for(let[h,l]of n)a.set(s(h),s(l));return a}case 6:{let a=r(new Set,o);for(let h of n)a.add(s(h));return a}case 7:{let{name:a,message:h}=n;return r(typeof Hc[a]=="function"?Mc(a,h):new Error(h),o)}case 8:return r(BigInt(n),o);case"BigInt":return r(Object(BigInt(n)),o);case"ArrayBuffer":return r(new Uint8Array(n).buffer,n);case"DataView":{let{buffer:a}=new Uint8Array(n);return r(new DataView(a),n)}}return r(Mc(i,n),o)};return s},To=e=>Ng(new Map,e)(0);var Ur="",{toString:zg}={},{keys:Hg}=Object,Xs=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let r=zg.call(e).slice(8,-1);switch(r){case"Array":return[1,Ur];case"Object":return[2,Ur];case"Date":return[3,Ur];case"RegExp":return[4,Ur];case"Map":return[5,Ur];case"Set":return[6,Ur];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:e instanceof Error?[7,e.name||"Error"]:[2,r]},Ki=([e,t])=>e===0&&(t==="function"||t==="symbol"),Ug=(e,t,r,s)=>{let o=(n,a)=>{let h=s.push(n)-1;return r.set(a,h),h},i=n=>{if(r.has(n))return r.get(n);let[a,h]=Xs(n);switch(a){case 0:{let c=n;switch(h){case"bigint":a=8,c=n.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);c=null;break;case"undefined":return o([-1],n)}return o([a,c],n)}case 1:{if(h){let v=n;return h==="DataView"?v=new Uint8Array(n.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(n)),o([h,[...v]],n)}let c=[],p=o([a,c],n);for(let v of n)c.push(i(v));return p}case 2:{if(h)switch(h){case"BigInt":return o([h,n.toString()],n);case"Boolean":case"Number":case"String":return o([h,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let c=[],p=o([a,c],n);for(let v of Hg(n))(e||!Ki(Xs(n[v])))&&c.push([i(v),i(n[v])]);return p}case 3:return o([a,isNaN(n.getTime())?Ur:n.toISOString()],n);case 4:{let{source:c,flags:p}=n;return o([a,{source:c,flags:p}],n)}case 5:{let c=[],p=o([a,c],n);for(let[v,g]of n)(e||!(Ki(Xs(v))||Ki(Xs(g))))&&c.push([i(v),i(g)]);return p}case 6:{let c=[],p=o([a,c],n);for(let v of n)(e||!Ki(Xs(v)))&&c.push(i(v));return p}}let{message:l}=n;return o([a,{name:h,message:l}],n)};return i},Po=(e,{json:t,lossy:r}={})=>{let s=[];return Ug(!(t||r),!!t,new Map,s)(e),s};var cs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?To(Po(e,t)):structuredClone(e):(e,t)=>To(Po(e,t));function jg(e,t){let r=[{type:"text",value:"\u21A9"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function $g(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Uc(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||jg,s=e.options.footnoteBackLabel||$g,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",n=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],h=-1;for(;++h<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[h]);if(!l)continue;let c=e.all(l),p=String(l.identifier).toUpperCase(),v=Et(p.toLowerCase()),g=0,u=[],d=e.footnoteCounts.get(p);for(;d!==void 0&&++g<=d;){u.length>0&&u.push({type:"text",value:" "});let _=typeof r=="string"?r:r(h,g);typeof _=="string"&&(_={type:"text",value:_}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(h,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}let m=c[c.length-1];if(m&&m.type==="element"&&m.tagName==="p"){let _=m.children[m.children.length-1];_&&_.type==="text"?_.value+=" ":m.children.push({type:"text",value:" "}),m.children.push(...u)}else c.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(c,!0)};e.patch(l,f),a.push(f)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...cs(n),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
18
18
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
19
|
-
`}]}}var pr=(function(e){if(e==null)return
|
|
19
|
+
`}]}}var pr=(function(e){if(e==null)return Kg;if(typeof e=="function")return Xi(e);if(typeof e=="object")return Array.isArray(e)?Vg(e):Wg(e);if(typeof e=="string")return qg(e);throw new Error("Expected function, string, or object as test")});function Vg(e){let t=[],r=-1;for(;++r<e.length;)t[r]=pr(e[r]);return Xi(s);function s(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Wg(e){let t=e;return Xi(r);function r(s){let o=s,i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function qg(e){return Xi(t);function t(r){return r&&r.type===e}}function Xi(e){return t;function t(r,s,o){return!!(Xg(r)&&e.call(this,r,typeof s=="number"?s:void 0,o||void 0))}}function Kg(){return!0}function Xg(e){return e!==null&&typeof e=="object"&&"type"in e}var jc=[],Ji=!0,jr=!1,Gi="skip";function Js(e,t,r,s){let o;typeof t=="function"&&typeof r!="function"?(s=r,r=t):o=t;let i=pr(o),n=s?-1:1;a(e,void 0,[])();function a(h,l,c){let p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){let g=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(g?"<"+g+">":""))+")"})}return v;function v(){let g=jc,u,d,m;if((!t||i(h,l,c[c.length-1]||void 0))&&(g=Jg(r(h,c)),g[0]===jr))return g;if("children"in h&&h.children){let f=h;if(f.children&&g[0]!==Gi)for(d=(s?f.children.length:-1)+n,m=c.concat(f);d>-1&&d<f.children.length;){let _=f.children[d];if(u=a(_,d,m)(),u[0]===jr)return u;d=typeof u[1]=="number"?u[1]:d+n}}return g}}}function Jg(e){return Array.isArray(e)?e:typeof e=="number"?[Ji,e]:e==null?jc:[e]}function $r(e,t,r,s){let o,i,n;typeof t=="function"&&typeof r!="function"?(i=void 0,n=t,o=r):(i=t,n=r,o=s),Js(e,i,a,o);function a(h,l){let c=l[l.length-1],p=c?c.children.indexOf(h):void 0;return n(h,p,c)}}var Do={}.hasOwnProperty,Gg={};function Vc(e,t){let r=t||Gg,s=new Map,o=new Map,i=new Map,n={...Oc,...r.handlers},a={all:l,applyData:Qg,definitionById:s,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:n,one:h,options:r,patch:Yg,wrap:ev};return $r(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let p=c.type==="definition"?s:o,v=String(c.identifier).toUpperCase();p.has(v)||p.set(v,c)}}),a;function h(c,p){let v=c.type,g=a.handlers[v];if(Do.call(a.handlers,v)&&g)return g(a,c,p);if(a.options.passThrough&&a.options.passThrough.includes(v)){if("children"in c){let{children:d,...m}=c,f=cs(m);return f.children=a.all(c),f}return cs(c)}return(a.options.unknownHandler||Zg)(a,c,p)}function l(c){let p=[];if("children"in c){let v=c.children,g=-1;for(;++g<v.length;){let u=a.one(v[g],c);if(u){if(g&&v[g-1].type==="break"&&(!Array.isArray(u)&&u.type==="text"&&(u.value=$c(u.value)),!Array.isArray(u)&&u.type==="element")){let d=u.children[0];d&&d.type==="text"&&(d.value=$c(d.value))}Array.isArray(u)?p.push(...u):p.push(u)}}}return p}}function Yg(e,t){e.position&&(t.position=ro(e))}function Qg(e,t){let r=t;if(e&&e.data){let s=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{let n="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:n}}r.type==="element"&&i&&Object.assign(r.properties,cs(i)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function Zg(e,t){let r=t.data||{},s="value"in t&&!(Do.call(r,"hProperties")||Do.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function ev(e,t){let r=[],s=-1;for(t&&r.push({type:"text",value:`
|
|
20
20
|
`});++s<e.length;)s&&r.push({type:"text",value:`
|
|
21
21
|
`}),r.push(e[s]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
22
|
-
`}),r}function
|
|
23
|
-
`},o)),i}function Qi(e,t){return e&&"run"in e?async function(r,s){let o=Yi(r,{file:s,...t});await e.run(o,s)}:function(r,s){return Yi(r,{file:s,...e||t})}}function Do(e){if(e)throw e}var tn=Ms(Qc(),1);function Gs(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ro(){let e=[],t={run:r,use:s};return t;function r(...o){let i=-1,n=o.pop();if(typeof n!="function")throw new TypeError("Expected function as last argument, not "+n);a(null,...o);function a(h,...l){let c=e[++i],p=-1;if(h){n(h);return}for(;++p<o.length;)(l[p]===null||l[p]===void 0)&&(l[p]=o[p]);o=l,c?Zc(c,a)(...l):n(null,...l)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Zc(e,t){let r;return s;function s(...n){let a=e.length>n.length,h;a&&n.push(o);try{h=e.apply(this,n)}catch(l){let c=l;if(a&&r)throw c;return o(c)}a||(h&&h.then&&typeof h.then=="function"?h.then(i,o):h instanceof Error?o(h):i(h))}function o(n,...a){r||(r=!0,t(n,...a))}function i(n){o(null,n)}}var It={basename:ev,dirname:tv,extname:rv,join:sv,sep:"/"};function ev(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ys(e);let r=0,s=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else s<0&&(i=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let n=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(s=o):(a=-1,s=n));return r===s?s=n:s<0&&(s=e.length),e.slice(r,s)}function tv(e){if(Ys(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function rv(e){Ys(e);let t=e.length,r=-1,s=0,o=-1,i=0,n;for(;t--;){let a=e.codePointAt(t);if(a===47){if(n){s=t+1;break}continue}r<0&&(n=!0,r=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function sv(...e){let t=-1,r;for(;++t<e.length;)Ys(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":iv(r)}function iv(e){Ys(e);let t=e.codePointAt(0)===47,r=nv(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function nv(e,t){let r="",s=0,o=-1,i=0,n=-1,a,h;for(;++n<=e.length;){if(n<e.length)a=e.codePointAt(n);else{if(a===47)break;a=47}if(a===47){if(!(o===n-1||i===1))if(o!==n-1&&i===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),o=n,i=0;continue}}else if(r.length>0){r="",s=0,o=n,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,n):r=e.slice(o+1,n),s=n-o-1;o=n,i=0}else a===46&&i>-1?i++:i=-1}return r}function Ys(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var ed={cwd:ov};function ov(){return"/"}function ds(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function td(e){if(typeof e=="string")e=new URL(e);else if(!ds(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return av(e)}function av(e){if(e.hostname!==""){let s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}let t=e.pathname,r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){let s=t.codePointAt(r+2);if(s===70||s===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var Ao=["history","path","basename","stem","extname","dirname"],Vr=class{constructor(t){let r;t?ds(t)?r={path:t}:typeof t=="string"||lv(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ed.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Ao.length;){let i=Ao[s];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let o;for(o in r)Ao.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Lo(t,"basename"),Io(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){rd(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(Io(t,"extname"),rd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ds(t)&&(t=td(t)),Lo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Lo(t,"stem"),Io(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){let o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){let o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){let o=new ze(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Io(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Lo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function lv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var sd=(function(e){let s=this.constructor.prototype,o=s[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,s),i});var hv={}.hasOwnProperty,Fo=class e extends sd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ro()}copy(){let t=new e,r=-1;for(;++r<this.attachers.length;){let s=this.attachers[r];t.use(...s)}return t.data((0,tn.default)(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Bo("data",this.frozen),this.namespace[t]=r,this):hv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);let o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let r=en(t),s=this.parser||this.Parser;return Oo("parse",s),s(String(r),r)}process(t,r){let s=this;return this.freeze(),Oo("process",this.parser||this.Parser),Mo("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(i,n){let a=en(t),h=s.parse(a);s.run(h,a,function(c,p,v){if(c||!p||!v)return l(c);let g=p,u=s.stringify(g,v);dv(u)?v.value=u:v.result=u,l(c,v)});function l(c,p){c||!p?n(c):i?i(p):r(void 0,p)}}}processSync(t){let r=!1,s;return this.freeze(),Oo("processSync",this.parser||this.Parser),Mo("processSync",this.compiler||this.Compiler),this.process(t,o),nd("processSync","process",r),s;function o(i,n){r=!0,Do(i),s=n}}run(t,r,s){id(t),this.freeze();let o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?i(void 0,s):new Promise(i);function i(n,a){let h=en(r);o.run(t,h,l);function l(c,p,v){let g=p||t;c?a(c):n?n(g):s(void 0,g,v)}}}runSync(t,r){let s=!1,o;return this.run(t,r,i),nd("runSync","run",s),o;function i(n,a){Do(n),o=a,s=!0}}stringify(t,r){this.freeze();let s=en(r),o=this.compiler||this.Compiler;return Mo("stringify",o),id(t),o(t,s)}use(t,...r){let s=this.attachers,o=this.namespace;if(Bo("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?a(t):n(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(l){if(typeof l=="function")h(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...p]=l;h(c,p)}else n(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function n(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(o.settings=(0,tn.default)(!0,o.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let p=l[c];i(p)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function h(l,c){let p=-1,v=-1;for(;++p<s.length;)if(s[p][0]===l){v=p;break}if(v===-1)s.push([l,...c]);else if(c.length>0){let[g,...u]=c,d=s[v][1];Gs(d)&&Gs(g)&&(g=(0,tn.default)(!0,d,g)),s[v]=[l,g,...u]}}}},No=new Fo().freeze();function Oo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function id(e){if(!Gs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nd(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function en(e){return cv(e)?e:new Vr(e)}function cv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dv(e){return typeof e=="string"||uv(e)}function uv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var pv="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",od=[],ad={allowDangerousHtml:!0},fv=/^(https?|ircs?|mailto|xmpp)$/i,mv=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zo(e){let t=gv(e),r=vv(e);return _v(t.runSync(t.parse(r),r),e)}function gv(e){let t=e.rehypePlugins||od,r=e.remarkPlugins||od,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ad}:ad;return No().use($i).use(r).use(Qi,s).use(t)}function vv(e){let t=e.children||"",r=new Vr;return typeof t=="string"?r.value=t:(""+t,void 0),r}function _v(e,t){let r=t.allowedElements,s=t.allowElement,o=t.components,i=t.disallowedElements,n=t.skipHtml,a=t.unwrapDisallowed,h=t.urlTransform||hd;for(let c of mv)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+pv+c.id,void 0);return r&&i&&void 0,$r(e,l),io(e,{Fragment:us.Fragment,components:o,ignoreInvalidStyle:!0,jsx:us.jsx,jsxs:us.jsxs,passKeys:!0,passNode:!0});function l(c,p,v){if(c.type==="raw"&&v&&typeof p=="number")return n?v.children.splice(p,1):v.children[p]={type:"text",value:c.value},p;if(c.type==="element"){let g;for(g in js)if(Object.hasOwn(js,g)&&Object.hasOwn(c.properties,g)){let u=c.properties[g],d=js[g];(d===null||d.includes(c.tagName))&&(c.properties[g]=h(String(u||""),g,c))}}if(c.type==="element"){let g=r?!r.includes(c.tagName):i?i.includes(c.tagName):!1;if(!g&&s&&typeof p=="number"&&(g=!s(c,p,v)),g&&v&&typeof p=="number")return a&&c.children?v.children.splice(p,1,...c.children):v.children.splice(p,1),p}}}function hd(e){let t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||fv.test(e.slice(0,t))?e:""}function Ho(e,t){let r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=r.indexOf(t);for(;o!==-1;)s++,o=r.indexOf(t,o+t.length);return s}function Uo(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jo(e,t,r){let o=pr((r||{}).ignore||[]),i=bv(t),n=-1;for(;++n<i.length;)Js(e,"text",a);function a(l,c){let p=-1,v;for(;++p<c.length;){let g=c[p],u=v?v.children:void 0;if(o(g,u?u.indexOf(g):void 0,v))return;v=g}if(v)return h(l,c)}function h(l,c){let p=c[c.length-1],v=i[n][0],g=i[n][1],u=0,m=p.children.indexOf(l),f=!1,_=[];v.lastIndex=0;let x=v.exec(l.value);for(;x;){let y=x.index,w={index:x.index,input:x.input,stack:[...c,l]},b=g(...x,w);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?v.lastIndex=y+1:(u!==y&&_.push({type:"text",value:l.value.slice(u,y)}),Array.isArray(b)?_.push(...b):b&&_.push(b),u=y+x[0].length,f=!0),!v.global)break;x=v.exec(l.value)}return f?(u<l.value.length&&_.push({type:"text",value:l.value.slice(u)}),p.children.splice(m,1,..._)):_=[l],m+_.length}}function bv(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],s=-1;for(;++s<r.length;){let o=r[s];t.push([xv(o[0]),yv(o[1])])}return t}function xv(e){return typeof e=="string"?new RegExp(Uo(e),"g"):e}function yv(e){return typeof e=="function"?e:function(){return e}}var $o="phrasing",Vo=["autolink","link","image","label"];function qo(){return{transforms:[Tv],enter:{literalAutolink:wv,literalAutolinkEmail:Wo,literalAutolinkHttp:Wo,literalAutolinkWww:Wo},exit:{literalAutolink:Ev,literalAutolinkEmail:Cv,literalAutolinkHttp:Sv,literalAutolinkWww:kv}}}function Ko(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$o,notInConstruct:Vo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$o,notInConstruct:Vo},{character:":",before:"[ps]",after:"\\/",inConstruct:$o,notInConstruct:Vo}]}}function wv(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wo(e){this.config.enter.autolinkProtocol.call(this,e)}function Sv(e){this.config.exit.autolinkProtocol.call(this,e)}function kv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Cv(e){this.config.exit.autolinkEmail.call(this,e)}function Ev(e){this.exit(e)}function Tv(e){jo(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Pv],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Dv]],{ignore:["link","linkReference"]})}function Pv(e,t,r,s,o){let i="";if(!cd(o)||(/^w/i.test(t)&&(r=t+r,t="",i="http://"),!Rv(r)))return!1;let n=Av(r+s);if(!n[0])return!1;let a={type:"link",title:null,url:i+t+n[0],children:[{type:"text",value:t+n[0]}]};return n[1]?[a,{type:"text",value:n[1]}]:a}function Dv(e,t,r,s){return!cd(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function Rv(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Av(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],s=r.indexOf(")"),o=Ho(e,"("),i=Ho(e,")");for(;s!==-1&&o>i;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),i++;return[e,r]}function cd(e,t){let r=e.input.charCodeAt(e.index-1);return(e.index===0||Mt(r)||Fr(r))&&(!t||r!==47)}dd.peek=Hv;function Iv(){this.buffer()}function Lv(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ov(){this.buffer()}function Mv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Je(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Fv(e){this.exit(e)}function Nv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Je(this.sliceSerialize(e)).toLowerCase(),r.label=t}function zv(e){this.exit(e)}function Hv(){return"["}function dd(e,t,r,s){let o=r.createTracker(s),i=o.move("[^"),n=r.enter("footnoteReference"),a=r.enter("reference");return i+=o.move(r.safe(r.associationId(e),{after:"]",before:i})),a(),n(),i+=o.move("]"),i}function Xo(){return{enter:{gfmFootnoteCallString:Iv,gfmFootnoteCall:Lv,gfmFootnoteDefinitionLabelString:Ov,gfmFootnoteDefinition:Mv},exit:{gfmFootnoteCallString:Bv,gfmFootnoteCall:Fv,gfmFootnoteDefinitionLabelString:Nv,gfmFootnoteDefinition:zv}}}function Jo(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:dd},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,o,i,n){let a=i.createTracker(n),h=a.move("[^"),l=i.enter("footnoteDefinition"),c=i.enter("label");return h+=a.move(i.safe(i.associationId(s),{before:h,after:"]"})),c(),h+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),h+=a.move((t?`
|
|
24
|
-
`:" ")+i.indentLines(i.containerFlow(s,a.current()),t?
|
|
25
|
-
`)}function
|
|
26
|
-
`&&
|
|
27
|
-
`}function
|
|
22
|
+
`}),r}function $c(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Yi(e,t){let r=Vc(e,t),s=r.one(e,void 0),o=Uc(r),i=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&("children"in i,i.children.push({type:"text",value:`
|
|
23
|
+
`},o)),i}function Qi(e,t){return e&&"run"in e?async function(r,s){let o=Yi(r,{file:s,...t});await e.run(o,s)}:function(r,s){return Yi(r,{file:s,...e||t})}}function Ro(e){if(e)throw e}var tn=Ms(Zc(),1);function Gs(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ao(){let e=[],t={run:r,use:s};return t;function r(...o){let i=-1,n=o.pop();if(typeof n!="function")throw new TypeError("Expected function as last argument, not "+n);a(null,...o);function a(h,...l){let c=e[++i],p=-1;if(h){n(h);return}for(;++p<o.length;)(l[p]===null||l[p]===void 0)&&(l[p]=o[p]);o=l,c?ed(c,a)(...l):n(null,...l)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function ed(e,t){let r;return s;function s(...n){let a=e.length>n.length,h;a&&n.push(o);try{h=e.apply(this,n)}catch(l){let c=l;if(a&&r)throw c;return o(c)}a||(h&&h.then&&typeof h.then=="function"?h.then(i,o):h instanceof Error?o(h):i(h))}function o(n,...a){r||(r=!0,t(n,...a))}function i(n){o(null,n)}}var It={basename:tv,dirname:rv,extname:sv,join:iv,sep:"/"};function tv(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ys(e);let r=0,s=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else s<0&&(i=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let n=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(s=o):(a=-1,s=n));return r===s?s=n:s<0&&(s=e.length),e.slice(r,s)}function rv(e){if(Ys(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sv(e){Ys(e);let t=e.length,r=-1,s=0,o=-1,i=0,n;for(;t--;){let a=e.codePointAt(t);if(a===47){if(n){s=t+1;break}continue}r<0&&(n=!0,r=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function iv(...e){let t=-1,r;for(;++t<e.length;)Ys(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":nv(r)}function nv(e){Ys(e);let t=e.codePointAt(0)===47,r=ov(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function ov(e,t){let r="",s=0,o=-1,i=0,n=-1,a,h;for(;++n<=e.length;){if(n<e.length)a=e.codePointAt(n);else{if(a===47)break;a=47}if(a===47){if(!(o===n-1||i===1))if(o!==n-1&&i===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),o=n,i=0;continue}}else if(r.length>0){r="",s=0,o=n,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,n):r=e.slice(o+1,n),s=n-o-1;o=n,i=0}else a===46&&i>-1?i++:i=-1}return r}function Ys(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var td={cwd:av};function av(){return"/"}function ds(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rd(e){if(typeof e=="string")e=new URL(e);else if(!ds(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lv(e)}function lv(e){if(e.hostname!==""){let s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}let t=e.pathname,r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){let s=t.codePointAt(r+2);if(s===70||s===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var Io=["history","path","basename","stem","extname","dirname"],Vr=class{constructor(t){let r;t?ds(t)?r={path:t}:typeof t=="string"||hv(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":td.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Io.length;){let i=Io[s];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let o;for(o in r)Io.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Oo(t,"basename"),Lo(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){sd(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(Lo(t,"extname"),sd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ds(t)&&(t=rd(t)),Oo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Oo(t,"stem"),Lo(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){let o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){let o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){let o=new ze(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Lo(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Oo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var id=(function(e){let s=this.constructor.prototype,o=s[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,s),i});var cv={}.hasOwnProperty,No=class e extends id{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ao()}copy(){let t=new e,r=-1;for(;++r<this.attachers.length;){let s=this.attachers[r];t.use(...s)}return t.data((0,tn.default)(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Fo("data",this.frozen),this.namespace[t]=r,this):cv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);let o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let r=en(t),s=this.parser||this.Parser;return Mo("parse",s),s(String(r),r)}process(t,r){let s=this;return this.freeze(),Mo("process",this.parser||this.Parser),Bo("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(i,n){let a=en(t),h=s.parse(a);s.run(h,a,function(c,p,v){if(c||!p||!v)return l(c);let g=p,u=s.stringify(g,v);uv(u)?v.value=u:v.result=u,l(c,v)});function l(c,p){c||!p?n(c):i?i(p):r(void 0,p)}}}processSync(t){let r=!1,s;return this.freeze(),Mo("processSync",this.parser||this.Parser),Bo("processSync",this.compiler||this.Compiler),this.process(t,o),od("processSync","process",r),s;function o(i,n){r=!0,Ro(i),s=n}}run(t,r,s){nd(t),this.freeze();let o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?i(void 0,s):new Promise(i);function i(n,a){let h=en(r);o.run(t,h,l);function l(c,p,v){let g=p||t;c?a(c):n?n(g):s(void 0,g,v)}}}runSync(t,r){let s=!1,o;return this.run(t,r,i),od("runSync","run",s),o;function i(n,a){Ro(n),o=a,s=!0}}stringify(t,r){this.freeze();let s=en(r),o=this.compiler||this.Compiler;return Bo("stringify",o),nd(t),o(t,s)}use(t,...r){let s=this.attachers,o=this.namespace;if(Fo("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?a(t):n(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(l){if(typeof l=="function")h(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...p]=l;h(c,p)}else n(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function n(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(o.settings=(0,tn.default)(!0,o.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let p=l[c];i(p)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function h(l,c){let p=-1,v=-1;for(;++p<s.length;)if(s[p][0]===l){v=p;break}if(v===-1)s.push([l,...c]);else if(c.length>0){let[g,...u]=c,d=s[v][1];Gs(d)&&Gs(g)&&(g=(0,tn.default)(!0,d,g)),s[v]=[l,g,...u]}}}},zo=new No().freeze();function Mo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nd(e){if(!Gs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function od(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function en(e){return dv(e)?e:new Vr(e)}function dv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uv(e){return typeof e=="string"||pv(e)}function pv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var fv="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ad=[],ld={allowDangerousHtml:!0},mv=/^(https?|ircs?|mailto|xmpp)$/i,gv=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ho(e){let t=vv(e),r=_v(e);return bv(t.runSync(t.parse(r),r),e)}function vv(e){let t=e.rehypePlugins||ad,r=e.remarkPlugins||ad,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ld}:ld;return zo().use($i).use(r).use(Qi,s).use(t)}function _v(e){let t=e.children||"",r=new Vr;return typeof t=="string"?r.value=t:(""+t,void 0),r}function bv(e,t){let r=t.allowedElements,s=t.allowElement,o=t.components,i=t.disallowedElements,n=t.skipHtml,a=t.unwrapDisallowed,h=t.urlTransform||cd;for(let c of gv)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+fv+c.id,void 0);return r&&i&&void 0,$r(e,l),no(e,{Fragment:us.Fragment,components:o,ignoreInvalidStyle:!0,jsx:us.jsx,jsxs:us.jsxs,passKeys:!0,passNode:!0});function l(c,p,v){if(c.type==="raw"&&v&&typeof p=="number")return n?v.children.splice(p,1):v.children[p]={type:"text",value:c.value},p;if(c.type==="element"){let g;for(g in js)if(Object.hasOwn(js,g)&&Object.hasOwn(c.properties,g)){let u=c.properties[g],d=js[g];(d===null||d.includes(c.tagName))&&(c.properties[g]=h(String(u||""),g,c))}}if(c.type==="element"){let g=r?!r.includes(c.tagName):i?i.includes(c.tagName):!1;if(!g&&s&&typeof p=="number"&&(g=!s(c,p,v)),g&&v&&typeof p=="number")return a&&c.children?v.children.splice(p,1,...c.children):v.children.splice(p,1),p}}}function cd(e){let t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||mv.test(e.slice(0,t))?e:""}function Uo(e,t){let r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=r.indexOf(t);for(;o!==-1;)s++,o=r.indexOf(t,o+t.length);return s}function jo(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $o(e,t,r){let o=pr((r||{}).ignore||[]),i=xv(t),n=-1;for(;++n<i.length;)Js(e,"text",a);function a(l,c){let p=-1,v;for(;++p<c.length;){let g=c[p],u=v?v.children:void 0;if(o(g,u?u.indexOf(g):void 0,v))return;v=g}if(v)return h(l,c)}function h(l,c){let p=c[c.length-1],v=i[n][0],g=i[n][1],u=0,m=p.children.indexOf(l),f=!1,_=[];v.lastIndex=0;let x=v.exec(l.value);for(;x;){let y=x.index,w={index:x.index,input:x.input,stack:[...c,l]},b=g(...x,w);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?v.lastIndex=y+1:(u!==y&&_.push({type:"text",value:l.value.slice(u,y)}),Array.isArray(b)?_.push(...b):b&&_.push(b),u=y+x[0].length,f=!0),!v.global)break;x=v.exec(l.value)}return f?(u<l.value.length&&_.push({type:"text",value:l.value.slice(u)}),p.children.splice(m,1,..._)):_=[l],m+_.length}}function xv(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],s=-1;for(;++s<r.length;){let o=r[s];t.push([yv(o[0]),wv(o[1])])}return t}function yv(e){return typeof e=="string"?new RegExp(jo(e),"g"):e}function wv(e){return typeof e=="function"?e:function(){return e}}var Vo="phrasing",Wo=["autolink","link","image","label"];function Ko(){return{transforms:[Pv],enter:{literalAutolink:Sv,literalAutolinkEmail:qo,literalAutolinkHttp:qo,literalAutolinkWww:qo},exit:{literalAutolink:Tv,literalAutolinkEmail:Ev,literalAutolinkHttp:kv,literalAutolinkWww:Cv}}}function Xo(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vo,notInConstruct:Wo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vo,notInConstruct:Wo},{character:":",before:"[ps]",after:"\\/",inConstruct:Vo,notInConstruct:Wo}]}}function Sv(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qo(e){this.config.enter.autolinkProtocol.call(this,e)}function kv(e){this.config.exit.autolinkProtocol.call(this,e)}function Cv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Ev(e){this.config.exit.autolinkEmail.call(this,e)}function Tv(e){this.exit(e)}function Pv(e){$o(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Dv],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Rv]],{ignore:["link","linkReference"]})}function Dv(e,t,r,s,o){let i="";if(!dd(o)||(/^w/i.test(t)&&(r=t+r,t="",i="http://"),!Av(r)))return!1;let n=Iv(r+s);if(!n[0])return!1;let a={type:"link",title:null,url:i+t+n[0],children:[{type:"text",value:t+n[0]}]};return n[1]?[a,{type:"text",value:n[1]}]:a}function Rv(e,t,r,s){return!dd(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function Av(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Iv(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],s=r.indexOf(")"),o=Uo(e,"("),i=Uo(e,")");for(;s!==-1&&o>i;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),i++;return[e,r]}function dd(e,t){let r=e.input.charCodeAt(e.index-1);return(e.index===0||Mt(r)||Fr(r))&&(!t||r!==47)}ud.peek=Uv;function Lv(){this.buffer()}function Ov(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Mv(){this.buffer()}function Bv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Fv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Je(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Nv(e){this.exit(e)}function zv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Je(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Hv(e){this.exit(e)}function Uv(){return"["}function ud(e,t,r,s){let o=r.createTracker(s),i=o.move("[^"),n=r.enter("footnoteReference"),a=r.enter("reference");return i+=o.move(r.safe(r.associationId(e),{after:"]",before:i})),a(),n(),i+=o.move("]"),i}function Jo(){return{enter:{gfmFootnoteCallString:Lv,gfmFootnoteCall:Ov,gfmFootnoteDefinitionLabelString:Mv,gfmFootnoteDefinition:Bv},exit:{gfmFootnoteCallString:Fv,gfmFootnoteCall:Nv,gfmFootnoteDefinitionLabelString:zv,gfmFootnoteDefinition:Hv}}}function Go(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:ud},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,o,i,n){let a=i.createTracker(n),h=a.move("[^"),l=i.enter("footnoteDefinition"),c=i.enter("label");return h+=a.move(i.safe(i.associationId(s),{before:h,after:"]"})),c(),h+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),h+=a.move((t?`
|
|
24
|
+
`:" ")+i.indentLines(i.containerFlow(s,a.current()),t?pd:jv))),l(),h}}function jv(e,t,r){return t===0?e:pd(e,t,r)}function pd(e,t,r){return(r?"":" ")+e}var $v=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fd.peek=qv;function Yo(){return{canContainEols:["delete"],enter:{strikethrough:Vv},exit:{strikethrough:Wv}}}function Qo(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$v}],handlers:{delete:fd}}}function Vv(e){this.enter({type:"delete",children:[]},e)}function Wv(e){this.exit(e)}function fd(e,t,r,s){let o=r.createTracker(s),i=r.enter("strikethrough"),n=o.move("~~");return n+=r.containerPhrasing(e,{...o.current(),before:n,after:"~"}),n+=o.move("~~"),i(),n}function qv(){return"~"}function Kv(e){return e.length}function gd(e,t){let r=t||{},s=(r.align||[]).concat(),o=r.stringLength||Kv,i=[],n=[],a=[],h=[],l=0,c=-1;for(;++c<e.length;){let d=[],m=[],f=-1;for(e[c].length>l&&(l=e[c].length);++f<e[c].length;){let _=Xv(e[c][f]);if(r.alignDelimiters!==!1){let x=o(_);m[f]=x,(h[f]===void 0||x>h[f])&&(h[f]=x)}d.push(_)}n[c]=d,a[c]=m}let p=-1;if(typeof s=="object"&&"length"in s)for(;++p<l;)i[p]=md(s[p]);else{let d=md(s);for(;++p<l;)i[p]=d}p=-1;let v=[],g=[];for(;++p<l;){let d=i[p],m="",f="";d===99?(m=":",f=":"):d===108?m=":":d===114&&(f=":");let _=r.alignDelimiters===!1?1:Math.max(1,h[p]-m.length-f.length),x=m+"-".repeat(_)+f;r.alignDelimiters!==!1&&(_=m.length+_+f.length,_>h[p]&&(h[p]=_),g[p]=_),v[p]=x}n.splice(1,0,v),a.splice(1,0,g),c=-1;let u=[];for(;++c<n.length;){let d=n[c],m=a[c];p=-1;let f=[];for(;++p<l;){let _=d[p]||"",x="",y="";if(r.alignDelimiters!==!1){let w=h[p]-(m[p]||0),b=i[p];b===114?x=" ".repeat(w):b===99?w%2?(x=" ".repeat(w/2+.5),y=" ".repeat(w/2-.5)):(x=" ".repeat(w/2),y=x):y=" ".repeat(w)}r.delimiterStart!==!1&&!p&&f.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&_==="")&&(r.delimiterStart!==!1||p)&&f.push(" "),r.alignDelimiters!==!1&&f.push(x),f.push(_),r.alignDelimiters!==!1&&f.push(y),r.padding!==!1&&f.push(" "),(r.delimiterEnd!==!1||p!==l-1)&&f.push("|")}u.push(r.delimiterEnd===!1?f.join("").replace(/ +$/,""):f.join(""))}return u.join(`
|
|
25
|
+
`)}function Xv(e){return e==null?"":String(e)}function md(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function vd(e,t,r,s){let o=r.enter("blockquote"),i=r.createTracker(s);i.move("> "),i.shift(2);let n=r.indentLines(r.containerFlow(e,i.current()),Jv);return o(),n}function Jv(e,t,r){return">"+(r?"":" ")+e}function bd(e,t){return _d(e,t.inConstruct,!0)&&!_d(e,t.notInConstruct,!1)}function _d(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function Zo(e,t,r,s){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
|
|
26
|
+
`&&bd(r.stack,r.unsafe[o]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
27
|
+
`}function xd(e,t){let r=String(e),s=r.indexOf(t),o=s,i=0,n=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===o?++i>n&&(n=i):i=1,o=s+t.length,s=r.indexOf(t,o);return n}function yd(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function wd(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Sd(e,t,r,s){let o=wd(r),i=e.value||"",n=o==="`"?"GraveAccent":"Tilde";if(yd(e,r)){let p=r.enter("codeIndented"),v=r.indentLines(i,Gv);return p(),v}let a=r.createTracker(s),h=o.repeat(Math.max(xd(i,o)+1,3)),l=r.enter("codeFenced"),c=a.move(h);if(e.lang){let p=r.enter(`codeFencedLang${n}`);c+=a.move(r.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),p()}if(e.lang&&e.meta){let p=r.enter(`codeFencedMeta${n}`);c+=a.move(" "),c+=a.move(r.safe(e.meta,{before:c,after:`
|
|
28
28
|
`,encode:["`"],...a.current()})),p()}return c+=a.move(`
|
|
29
29
|
`),i&&(c+=a.move(i+`
|
|
30
|
-
`)),c+=a.move(h),l(),c}function
|
|
31
|
-
`,...h.current()}))),a(),e.title&&(a=r.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(r.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),n(),l}function
|
|
30
|
+
`)),c+=a.move(h),l(),c}function Gv(e,t,r){return(r?"":" ")+e}function ps(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function kd(e,t,r,s){let o=ps(r),i=o==='"'?"Quote":"Apostrophe",n=r.enter("definition"),a=r.enter("label"),h=r.createTracker(s),l=h.move("[");return l+=h.move(r.safe(r.associationId(e),{before:l,after:"]",...h.current()})),l+=h.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),l+=h.move("<"),l+=h.move(r.safe(e.url,{before:l,after:">",...h.current()})),l+=h.move(">")):(a=r.enter("destinationRaw"),l+=h.move(r.safe(e.url,{before:l,after:e.title?" ":`
|
|
31
|
+
`,...h.current()}))),a(),e.title&&(a=r.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(r.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),n(),l}function Cd(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fs(e,t,r){let s=Gt(e),o=Gt(t);return s===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ea.peek=Yv;function ea(e,t,r,s){let o=Cd(r),i=r.enter("emphasis"),n=r.createTracker(s),a=n.move(o),h=n.move(r.containerPhrasing(e,{after:o,before:a,...n.current()})),l=h.charCodeAt(0),c=fs(s.before.charCodeAt(s.before.length-1),l,o);c.inside&&(h=fr(l)+h.slice(1));let p=h.charCodeAt(h.length-1),v=fs(s.after.charCodeAt(0),p,o);v.inside&&(h=h.slice(0,-1)+fr(p));let g=n.move(o);return i(),r.attentionEncodeSurroundingInfo={after:v.outside,before:c.outside},a+h+g}function Yv(e,t,r){return r.options.emphasis||"*"}function Ed(e,t){let r=!1;return $r(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return r=!0,jr}),!!((!e.depth||e.depth<3)&&Mr(e)&&(t.options.setext||r))}function Td(e,t,r,s){let o=Math.max(Math.min(6,e.depth||1),1),i=r.createTracker(s);if(Ed(e,r)){let c=r.enter("headingSetext"),p=r.enter("phrasing"),v=r.containerPhrasing(e,{...i.current(),before:`
|
|
32
32
|
`,after:`
|
|
33
33
|
`});return p(),c(),v+`
|
|
34
34
|
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
35
35
|
`))+1))}let n="#".repeat(o),a=r.enter("headingAtx"),h=r.enter("phrasing");i.move(n+" ");let l=r.containerPhrasing(e,{before:"# ",after:`
|
|
36
|
-
`,...i.current()});return/^[\t ]/.test(l)&&(l=fr(l.charCodeAt(0))+l.slice(1)),l=l?n+" "+l:n,r.options.closeAtx&&(l+=" "+n),h(),a(),l}
|
|
36
|
+
`,...i.current()});return/^[\t ]/.test(l)&&(l=fr(l.charCodeAt(0))+l.slice(1)),l=l?n+" "+l:n,r.options.closeAtx&&(l+=" "+n),h(),a(),l}ta.peek=Qv;function ta(e){return e.value||""}function Qv(){return"<"}ra.peek=Zv;function ra(e,t,r,s){let o=ps(r),i=o==='"'?"Quote":"Apostrophe",n=r.enter("image"),a=r.enter("label"),h=r.createTracker(s),l=h.move("![");return l+=h.move(r.safe(e.alt,{before:l,after:"]",...h.current()})),l+=h.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),l+=h.move("<"),l+=h.move(r.safe(e.url,{before:l,after:">",...h.current()})),l+=h.move(">")):(a=r.enter("destinationRaw"),l+=h.move(r.safe(e.url,{before:l,after:e.title?" ":")",...h.current()}))),a(),e.title&&(a=r.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(r.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),l+=h.move(")"),n(),l}function Zv(){return"!"}sa.peek=e_;function sa(e,t,r,s){let o=e.referenceType,i=r.enter("imageReference"),n=r.enter("label"),a=r.createTracker(s),h=a.move("!["),l=r.safe(e.alt,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=r.stack;r.stack=[],n=r.enter("reference");let p=r.safe(r.associationId(e),{before:h,after:"]",...a.current()});return n(),r.stack=c,i(),o==="full"||!l||l!==p?h+=a.move(p+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function e_(){return"!"}ia.peek=t_;function ia(e,t,r){let s=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(s);)o+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++i<r.unsafe.length;){let n=r.unsafe[i],a=r.compilePattern(n),h;if(n.atBreak)for(;h=a.exec(s);){let l=h.index;s.charCodeAt(l)===10&&s.charCodeAt(l-1)===13&&l--,s=s.slice(0,l)+" "+s.slice(h.index+1)}}return o+s+o}function t_(){return"`"}function na(e,t){let r=Mr(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}oa.peek=r_;function oa(e,t,r,s){let o=ps(r),i=o==='"'?"Quote":"Apostrophe",n=r.createTracker(s),a,h;if(na(e,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let p=n.move("<");return p+=n.move(r.containerPhrasing(e,{before:p,after:">",...n.current()})),p+=n.move(">"),a(),r.stack=c,p}a=r.enter("link"),h=r.enter("label");let l=n.move("[");return l+=n.move(r.containerPhrasing(e,{before:l,after:"](",...n.current()})),l+=n.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),l+=n.move("<"),l+=n.move(r.safe(e.url,{before:l,after:">",...n.current()})),l+=n.move(">")):(h=r.enter("destinationRaw"),l+=n.move(r.safe(e.url,{before:l,after:e.title?" ":")",...n.current()}))),h(),e.title&&(h=r.enter(`title${i}`),l+=n.move(" "+o),l+=n.move(r.safe(e.title,{before:l,after:o,...n.current()})),l+=n.move(o),h()),l+=n.move(")"),a(),l}function r_(e,t,r){return na(e,r)?"<":"["}aa.peek=s_;function aa(e,t,r,s){let o=e.referenceType,i=r.enter("linkReference"),n=r.enter("label"),a=r.createTracker(s),h=a.move("["),l=r.containerPhrasing(e,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=r.stack;r.stack=[],n=r.enter("reference");let p=r.safe(r.associationId(e),{before:h,after:"]",...a.current()});return n(),r.stack=c,i(),o==="full"||!l||l!==p?h+=a.move(p+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function s_(){return"["}function ms(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Pd(e){let t=ms(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Dd(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function rn(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Rd(e,t,r,s){let o=r.enter("list"),i=r.bulletCurrent,n=e.ordered?Dd(r):ms(r),a=e.ordered?n==="."?")":".":Pd(r),h=t&&r.bulletLastUsed?n===r.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((n==="*"||n==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),rn(r)===n&&c){let p=-1;for(;++p<e.children.length;){let v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(n=a),r.bulletCurrent=n;let l=r.containerFlow(e,s);return r.bulletLastUsed=n,r.bulletCurrent=i,o(),l}function Ad(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Id(e,t,r,s){let o=Ad(r),i=r.bulletCurrent||ms(r);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let n=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(n=Math.ceil(n/4)*4);let a=r.createTracker(s);a.move(i+" ".repeat(n-i.length)),a.shift(n);let h=r.enter("listItem"),l=r.indentLines(r.containerFlow(e,a.current()),c);return h(),l;function c(p,v,g){return v?(g?"":" ".repeat(n))+p:(g?i:i+" ".repeat(n-i.length))+p}}function Ld(e,t,r,s){let o=r.enter("paragraph"),i=r.enter("phrasing"),n=r.containerPhrasing(e,s);return i(),o(),n}var la=pr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Od(e,t,r,s){return(e.children.some(function(n){return la(n)})?r.containerPhrasing:r.containerFlow).call(r,e,s)}function Md(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ha.peek=i_;function ha(e,t,r,s){let o=Md(r),i=r.enter("strong"),n=r.createTracker(s),a=n.move(o+o),h=n.move(r.containerPhrasing(e,{after:o,before:a,...n.current()})),l=h.charCodeAt(0),c=fs(s.before.charCodeAt(s.before.length-1),l,o);c.inside&&(h=fr(l)+h.slice(1));let p=h.charCodeAt(h.length-1),v=fs(s.after.charCodeAt(0),p,o);v.inside&&(h=h.slice(0,-1)+fr(p));let g=n.move(o+o);return i(),r.attentionEncodeSurroundingInfo={after:v.outside,before:c.outside},a+h+g}function i_(e,t,r){return r.options.strong||"*"}function Bd(e,t,r,s){return r.safe(e.value,s)}function Fd(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Nd(e,t,r){let s=(rn(r)+(r.options.ruleSpaces?" ":"")).repeat(Fd(r));return r.options.ruleSpaces?s.slice(0,-1):s}var Qs={blockquote:vd,break:Zo,code:Sd,definition:kd,emphasis:ea,hardBreak:Zo,heading:Td,html:ta,image:ra,imageReference:sa,inlineCode:ia,link:oa,linkReference:aa,list:Rd,listItem:Id,paragraph:Ld,root:Od,strong:ha,text:Bd,thematicBreak:Nd};function da(){return{enter:{table:n_,tableData:zd,tableHeader:zd,tableRow:a_},exit:{codeText:l_,table:o_,tableData:ca,tableHeader:ca,tableRow:ca}}}function n_(e){let t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function o_(e){this.exit(e),this.data.inTable=void 0}function a_(e){this.enter({type:"tableRow",children:[]},e)}function ca(e){this.exit(e)}function zd(e){this.enter({type:"tableCell",children:[]},e)}function l_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,h_));let r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function h_(e,t){return t==="|"?t:e}function ua(e){let t=e||{},r=t.tableCellPadding,s=t.tablePipeAlign,o=t.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
37
37
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:n,tableCell:h,tableRow:a}};function n(g,u,d,m){return l(c(g,d,m),g.align)}function a(g,u,d,m){let f=p(g,d,m),_=l([f]);return _.slice(0,_.indexOf(`
|
|
38
|
-
`))}function h(g,u,d,m){let f=d.enter("tableCell"),_=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return _(),f(),x}function l(g,u){return md(g,{align:u,alignDelimiters:s,padding:r,stringLength:o})}function c(g,u,d){let m=g.children,f=-1,_=[],x=u.enter("table");for(;++f<m.length;)_[f]=p(m[f],u,d);return x(),_}function p(g,u,d){let m=g.children,f=-1,_=[],x=u.enter("tableRow");for(;++f<m.length;)_[f]=h(m[f],g,u,d);return x(),_}function v(g,u,d){let m=Qs.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function ua(){return{exit:{taskListCheckValueChecked:zd,taskListCheckValueUnchecked:zd,paragraph:h_}}}function pa(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c_}}}function zd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function h_(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let s=r.children[0];if(s&&s.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function c_(e,t,r,s){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);i&&a.move(n);let h=Qs.listItem(e,t,r,{...s,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function fa(){return[qo(),Xo(),Go(),ca(),ua()]}function ma(e){return{extensions:[Ko(),Jo(e),Yo(),da(e),pa()]}}var d_={tokenize:g_,partial:!0},Hd={tokenize:v_,partial:!0},Ud={tokenize:__,partial:!0},jd={tokenize:b_,partial:!0},u_={tokenize:x_,partial:!0},$d={name:"wwwAutolink",tokenize:f_,previous:Wd},Vd={name:"protocolAutolink",tokenize:m_,previous:qd},Yt={name:"emailAutolink",tokenize:p_,previous:Kd},Ft={};function va(){return{text:Ft}}var Wr=48;for(;Wr<123;)Ft[Wr]=Yt,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);Ft[43]=Yt;Ft[45]=Yt;Ft[46]=Yt;Ft[95]=Yt;Ft[72]=[Yt,Vd];Ft[104]=[Yt,Vd];Ft[87]=[Yt,$d];Ft[119]=[Yt,$d];function p_(e,t,r){let s=this,o,i;return n;function n(p){return!ga(p)||!Kd.call(s,s.previous)||_a(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(p))}function a(p){return ga(p)?(e.consume(p),a):p===64?(e.consume(p),h):r(p)}function h(p){return p===46?e.check(u_,c,l)(p):p===45||p===95||Be(p)?(i=!0,e.consume(p),h):c(p)}function l(p){return e.consume(p),o=!0,h}function c(p){return i&&o&&$e(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):r(p)}}function f_(e,t,r){let s=this;return o;function o(n){return n!==87&&n!==119||!Wd.call(s,s.previous)||_a(s.events)?r(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(d_,e.attempt(Hd,e.attempt(Ud,i),r),r)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function m_(e,t,r){let s=this,o="",i=!1;return n;function n(p){return(p===72||p===104)&&qd.call(s,s.previous)&&!_a(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),a):r(p)}function a(p){if($e(p)&&o.length<5)return o+=String.fromCodePoint(p),e.consume(p),a;if(p===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return r(p)}function h(p){return p===47?(e.consume(p),i?l:(i=!0,h)):r(p)}function l(p){return p===null||Br(p)||be(p)||Mt(p)||Fr(p)?r(p):e.attempt(Hd,e.attempt(Ud,c),r)(p)}function c(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function g_(e,t,r){let s=0;return o;function o(n){return(n===87||n===119)&&s<3?(s++,e.consume(n),o):n===46&&s===3?(e.consume(n),i):r(n)}function i(n){return n===null?r(n):t(n)}}function v_(e,t,r){let s,o,i;return n;function n(l){return l===46||l===95?e.check(jd,h,a)(l):l===null||be(l)||Mt(l)||l!==45&&Fr(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?s=!0:(o=s,s=void 0),e.consume(l),n}function h(l){return o||s||!i?r(l):t(l)}}function __(e,t){let r=0,s=0;return o;function o(n){return n===40?(r++,e.consume(n),o):n===41&&s<r?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(jd,t,i)(n):n===null||be(n)||Mt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&s++,e.consume(n),o}}function b_(e,t,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||be(a)||Mt(a)?t(a):r(a)}function o(a){return a===null||a===40||a===91||be(a)||Mt(a)?t(a):s(a)}function i(a){return $e(a)?n(a):r(a)}function n(a){return a===59?(e.consume(a),s):$e(a)?(e.consume(a),n):r(a)}}function x_(e,t,r){return s;function s(i){return e.consume(i),o}function o(i){return Be(i)?r(i):t(i)}}function Wd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||be(e)}function qd(e){return!$e(e)}function Kd(e){return!(e===47||ga(e))}function ga(e){return e===43||e===45||e===46||e===95||Be(e)}function _a(e){let t=e.length,r=!1;for(;t--;){let s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var y_={tokenize:P_,partial:!0};function ba(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:C_,continuation:{tokenize:E_},exit:T_}},text:{91:{name:"gfmFootnoteCall",tokenize:k_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:w_,resolveTo:S_}}}}function w_(e,t,r){let s=this,o=s.events.length,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),n;for(;o--;){let h=s.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return r(h);let l=Je(s.sliceSerialize({start:n.end,end:s.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function S_(e,t){let r=e.length,s;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){s=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...h),e}function k_(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i=0,n;return a;function a(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?r(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(p){if(i>999||p===93&&!n||p===null||p===91||be(p))return r(p);if(p===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Je(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(p)}return be(p)||(n=!0),i++,e.consume(p),p===92?c:l}function c(p){return p===91||p===92||p===93?(e.consume(p),i++,l):l(p)}}function C_(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):r(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||be(u))return r(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Je(s.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return be(u)||(a=!0),n++,e.consume(u),u===92?p:c}function p(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),le(e,g,"gfmFootnoteDefinitionWhitespace")):r(u)}function g(u){return t(u)}}function E_(e,t,r){return e.check(Bt,t,e.attempt(y_,t,r))}function T_(e){e.exit("gfmFootnoteDefinition")}function P_(e,t,r){let s=this;return le(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):r(i)}}function xa(e){let r=(e||{}).singleTilde,s={name:"strikethrough",tokenize:i,resolveAll:o};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},p={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",p,a]],g=a.parser.constructs.insideSpan.null;g&&He(v,v.length,0,dr(g,n.slice(l+1,h),a)),He(v,v.length,0,[["exit",p,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),He(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,p=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=Gt(l);if(u===126)return p>1?h(u):(n.consume(u),p++,g);if(p<2&&!r)return h(u);let m=n.exit("strikethroughSequenceTemporary"),f=Gt(u);return m._open=!f||f===2&&!!d,m._close=!d||d===2&&!!f,a(u)}}}var sn=class{constructor(){this.map=[]}add(t,r,s){D_(this,t,r,s)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let r=this.map.length,s=[];for(;r>0;)r-=1,s.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];s.push(t.slice()),t.length=0;let o=s.pop();for(;o;){for(let i of o)t.push(i);o=s.pop()}this.map.length=0}};function D_(e,t,r,s){let o=0;if(!(r===0&&s.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=r,e.map[o][2].push(...s);return}o+=1}e.map.push([t,r,s])}}function Xd(e,t){let r=!1,s=[];for(;t<e.length;){let o=e[t];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return s}function ya(){return{flow:{null:{name:"table",tokenize:R_,resolveAll:A_}}}}function R_(e,t,r){let s=this,o=0,i=0,n;return a;function a(E){let A=s.events.length-1;for(;A>-1;){let H=s.events[A][1].type;if(H==="lineEnding"||H==="linePrefix")A--;else break}let B=A>-1?s.events[A][1].type:null,M=B==="tableHead"||B==="tableRow"?b:h;return M===b&&s.parser.lazy[s.now().line]?r(E):M(E)}function h(E){return e.enter("tableHead"),e.enter("tableRow"),l(E)}function l(E){return E===124||(n=!0,i+=1),c(E)}function c(E){return E===null?r(E):ie(E)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g):r(E):de(E)?le(e,c,"whitespace")(E):(i+=1,n&&(n=!1,o+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),p(E)))}function p(E){return E===null||E===124||be(E)?(e.exit("data"),c(E)):(e.consume(E),E===92?v:p)}function v(E){return E===92||E===124?(e.consume(E),p):p(E)}function g(E){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(E):(e.enter("tableDelimiterRow"),n=!1,de(E)?le(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):u(E))}function u(E){return E===45||E===58?m(E):E===124?(n=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),d):w(E)}function d(E){return de(E)?le(e,m,"whitespace")(E):m(E)}function m(E){return E===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),f):E===45?(i+=1,f(E)):E===null||ie(E)?y(E):w(E)}function f(E){return E===45?(e.enter("tableDelimiterFiller"),_(E)):w(E)}function _(E){return E===45?(e.consume(E),_):E===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(E))}function x(E){return de(E)?le(e,y,"whitespace")(E):y(E)}function y(E){return E===124?u(E):E===null||ie(E)?!n||o!==i?w(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):w(E)}function w(E){return r(E)}function b(E){return e.enter("tableRow"),S(E)}function S(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),S):E===null||ie(E)?(e.exit("tableRow"),t(E)):de(E)?le(e,S,"whitespace")(E):(e.enter("data"),T(E))}function T(E){return E===null||E===124||be(E)?(e.exit("data"),S(E)):(e.consume(E),E===92?R:T)}function R(E){return E===92||E===124?(e.consume(E),T):T(E)}}function A_(e,t){let r=-1,s=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,p,v=new sn;for(;++r<e.length;){let g=e[r],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(Jd(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(s=!0,p=void 0,i=[0,0,0,0],n=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(s=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],p=nn(v,t,i,o,void 0,p),i=[0,0,0,0]),n[2]=r)):u.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(n[0]=n[1],p=nn(v,t,i,o,void 0,p)),i=n,n=[i[1],r,0,0])):u.type==="tableHead"?(a=!0,h=r):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=r,i[1]!==0?(n[0]=n[1],p=nn(v,t,i,o,r,p)):n[1]!==0&&(p=nn(v,t,n,o,r,p)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=r)}for(h!==0&&Jd(v,t,h,l,c),v.consume(t.events),r=-1;++r<t.events.length;){let g=t.events[r];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=Xd(t.events,r))}return e}function nn(e,t,r,s,o,i){let n=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(i.end=Object.assign({},gs(t.events,r[0])),e.add(r[0],0,[["exit",i,t]]));let h=gs(t.events,r[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",i,t]]),r[2]!==0){let l=gs(t.events,r[2]),c=gs(t.events,r[3]),p={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(r[2],0,[["enter",p,t]]),s!==2){let v=t.events[r[2]],g=t.events[r[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){let u=r[2]+1,d=r[3]-r[2]-1;e.add(u,d,[])}}e.add(r[3]+1,0,[["exit",p,t]])}return o!==void 0&&(i.end=Object.assign({},gs(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Jd(e,t,r,s,o){let i=[],n=gs(t.events,r);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),s.end=Object.assign({},n),i.push(["exit",s,t]),e.add(r+1,0,i)}function gs(e,t){let r=e[t],s=r[0]==="enter"?"start":"end";return r[1][s]}var I_={name:"tasklistCheck",tokenize:L_};function wa(){return{text:{91:I_}}}function L_(e,t,r){let s=this;return o;function o(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return be(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):r(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(h)}function a(h){return ie(h)?t(h):de(h)?e.check({tokenize:O_},t,r)(h):r(h)}}function O_(e,t,r){return le(e,s,"whitespace");function s(o){return o===null?r(o):t(o)}}function Gd(e){return Ai([va(),ba(),xa(e),ya(),wa()])}var M_={};function on(e){let t=this,r=e||M_,s=t.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),n=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push(Gd(r)),i.push(fa()),n.push(ma(r))}var ke=require("@deepseek-ai/dsh-client-ui-primitives");var Lt="application/x-dsh-remote-files";function Zs(e,t){return e.endpointId===t.endpointId&&an(e.directory)===an(t.directory)}function ei(e,t,r){if(e.endpointId!==r.endpointId)return!0;let s=an(r.directory);return!t.some(o=>{let i=an(o);return s===i||s.startsWith(`${i}/`)})}function ti(e,t){return Zs(e,t)?"none":ei(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function vs(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(r=>typeof r=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function an(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function ln(e,t){let r=ti(e,t);if(r==="none")return{operation:r};if(r==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(r==="move")return await Ol({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:r};let s=await Fs({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:r,job:s}}var _l=require("react"),Rs=require("@deepseek-ai/dsh-client-ui-primitives");var ss=require("react"),Ds=require("@deepseek-ai/dsh-client-ui-primitives");var Nt=require("react"),ri=require("react/jsx-runtime"),B_=28;function Sa(e,t,r){return Math.min(Math.max(e,t),r)}function _s(){let e=(0,Nt.useRef)(null),t=(0,Nt.useRef)(void 0),r=(0,Nt.useRef)(void 0),s=(0,Nt.useCallback)(()=>{t.current=void 0;let n=e.current,a=r.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=Sa(a.clientX-h.left,0,h.width),c=Sa(a.clientY-h.top,0,h.height),p=Math.min(l,h.width-l,c,h.height-c),v=Sa(1-p/B_,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,Nt.useCallback)(n=>{r.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(s))},[s]),i=(0,Nt.useCallback)(()=>{r.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,Nt.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function Yd({children:e,className:t}){let r=_s();return(0,ri.jsxs)("div",{ref:r.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:r.onPointerMove,onPointerLeave:r.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var ka=require("react/jsx-runtime");function F_(e,t){let r=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(r)){let[s="0",o="0",i="0"]=r;return`rgba(${parseInt(s+s,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(r)?`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function Qd({children:e,className:t,glareColor:r="#ffffff",glareOpacity:s=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":F_(r,s),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,ka.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,ka.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var vl=require("react");function Qt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function au(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var dt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},li={duration:.5,overwrite:!1,delay:0},ja,Ke,Re,Pt=1e8,Ee=1/Pt,Ia=Math.PI*2,N_=Ia/4,z_=0,lu=Math.sqrt,H_=Math.cos,U_=Math.sin,Ve=function(t){return typeof t=="string"},Fe=function(t){return typeof t=="function"},er=function(t){return typeof t=="number"},_n=function(t){return typeof t>"u"},Ut=function(t){return typeof t=="object"},ct=function(t){return t!==!1},$a=function(){return typeof window<"u"},hn=function(t){return Fe(t)||Ve(t)},hu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qe=Array.isArray,j_=/random\([^)]+\)/g,$_=/,\s*/g,Zd=/(?:-?\.?\d|\.)+/gi,Va=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Jr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ca=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Wa=/[+-]=-?[.\d]+/,V_=/[^,'"\[\]\s]+/gi,W_=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ie,zt,La,qa,_t={},pn={},cu,du=function(t){return(pn=xs(t,_t))&&Ze},bn=function(t,r){return console.warn("Invalid property",t,"set to",r,"Missing plugin? gsap.registerPlugin()")},hi=function(t,r){return!r&&console.warn(t)},uu=function(t,r){return t&&(_t[t]=r)&&pn&&(pn[t]=r)||_t},ci=function(){return 0},q_={suppressEvents:!0,isStart:!0,kill:!1},cn={suppressEvents:!0,kill:!1},K_={suppressEvents:!0},Ka={},gr=[],Oa={},pu,lt={},Ea={},eu=30,dn=[],Xa="",Ja=function(t){var r=t[0],s,o;if(Ut(r)||Fe(r)||(t=[t]),!(s=(r._gsap||{}).harness)){for(o=dn.length;o--&&!dn[o].targetTest(r););s=dn[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new Za(t[o],s)))||t.splice(o,1);return t},vr=function(t){return t._gsap||Ja(Dt(t))[0]._gsap},Ga=function(t,r,s){return(s=t[r])&&Fe(s)?t[r]():_n(s)&&t.getAttribute&&t.getAttribute(r)||s},rt=function(t,r){return(t=t.split(",")).forEach(r)||t},Ne=function(t){return Math.round(t*1e5)/1e5||0},Ae=function(t){return Math.round(t*1e7)/1e7||0},Gr=function(t,r){var s=r.charAt(0),o=parseFloat(r.substr(2));return t=parseFloat(t),s==="+"?t+o:s==="-"?t-o:s==="*"?t*o:t/o},X_=function(t,r){for(var s=r.length,o=0;t.indexOf(r[o])<0&&++o<s;);return o<s},fn=function(){var t=gr.length,r=gr.slice(0),s,o;for(Oa={},gr.length=0,s=0;s<t;s++)o=r[s],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Ya=function(t){return!!(t._initted||t._startAt||t.add)},fu=function(t,r,s,o){gr.length&&!Ke&&fn(),t.render(r,s,o||!!(Ke&&r<0&&Ya(t))),gr.length&&!Ke&&fn()},mu=function(t){var r=parseFloat(t);return(r||r===0)&&(t+"").match(V_).length<2?r:Ve(t)?t.trim():t},gu=function(t){return t},bt=function(t,r){for(var s in r)s in t||(t[s]=r[s]);return t},J_=function(t){return function(r,s){for(var o in s)o in r||o==="duration"&&t||o==="ease"||(r[o]=s[o])}},xs=function(t,r){for(var s in r)t[s]=r[s];return t},tu=function e(t,r){for(var s in r)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(t[s]=Ut(r[s])?e(t[s]||(t[s]={}),r[s]):r[s]);return t},mn=function(t,r){var s={},o;for(o in t)o in r||(s[o]=t[o]);return s},ni=function(t){var r=t.parent||Ie,s=t.keyframes?J_(Qe(t.keyframes)):bt;if(ct(t.inherit))for(;r;)s(t,r.vars.defaults),r=r.parent||r._dp;return t},G_=function(t,r){for(var s=t.length,o=s===r.length;o&&s--&&t[s]===r[s];);return s<0},vu=function(t,r,s,o,i){s===void 0&&(s="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=r[i];n&&n[i]>a;)n=n._prev;return n?(r._next=n._next,n._next=r):(r._next=t[s],t[s]=r),r._next?r._next._prev=r:t[o]=r,r._prev=n,r.parent=r._dp=t,r},xn=function(t,r,s,o){s===void 0&&(s="_first"),o===void 0&&(o="_last");var i=r._prev,n=r._next;i?i._next=n:t[s]===r&&(t[s]=n),n?n._prev=i:t[o]===r&&(t[o]=i),r._next=r._prev=r.parent=null},_r=function(t,r){t.parent&&(!r||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},qr=function(t,r){if(t&&(!r||r._end>t._dur||r._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},Y_=function(t){for(var r=t.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return t},Ma=function(t,r,s,o){return t._startAt&&(Ke?t._startAt.revert(cn):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(r,!0,o))},Q_=function e(t){return!t||t._ts&&e(t.parent)},ru=function(t){return t._repeat?ys(t._tTime,t=t.duration()+t._rDelay)*t:0},ys=function(t,r){var s=Math.floor(t=Ae(t/r));return t&&s===t?s-1:s},gn=function(t,r){return(t-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},yn=function(t){return t._end=Ae(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ee)||0))},wn=function(t,r){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=Ae(s._time-(t._ts>0?r/t._ts:((t._dirty?t.totalDuration():t._tDur)-r)/-t._ts)),yn(t),s._dirty||qr(s,t)),t},_u=function(t,r){var s;if((r._time||!r._dur&&r._initted||r._start<t._time&&(r._dur||!r.add))&&(s=gn(t.rawTime(),r),(!r._dur||pi(0,r.totalDuration(),s)-r._tTime>Ee)&&r.render(s,!0)),qr(t,r)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(s=t;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ee}},Ht=function(t,r,s,o){return r.parent&&_r(r),r._start=Ae((er(s)?s:s||t!==Ie?Tt(t,s,r):t._time)+r._delay),r._end=Ae(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),vu(t,r,"_first","_last",t._sort?"_start":0),Ba(r)||(t._recent=r),o||_u(t,r),t._ts<0&&wn(t,t._tTime),t},bu=function(t,r){return(_t.ScrollTrigger||bn("scrollTrigger",r))&&_t.ScrollTrigger.create(r,t)},xu=function(t,r,s,o,i){if(rl(t,r,i),!t._initted)return 1;if(!s&&t._pt&&!Ke&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&pu!==ht.frame)return gr.push(t),t._lazy=[i,o],1},Z_=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},Ba=function(t){var r=t.data;return r==="isFromStart"||r==="isStart"},eb=function(t,r,s,o){var i=t.ratio,n=r<0||!r&&(!t._start&&Z_(t)&&!(!t._initted&&Ba(t))||(t._ts<0||t._dp._ts<0)&&!Ba(t))?0:1,a=t._rDelay,h=0,l,c,p;if(a&&t._repeat&&(h=pi(0,t._tDur,r),c=ys(h,a),t._yoyo&&c&1&&(n=1-n),c!==ys(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Ke||o||t._zTime===Ee||!r&&t._zTime){if(!t._initted&&xu(t,r,o,s,h))return;for(p=t._zTime,t._zTime=r||(s?Ee:0),s||(s=r&&!p),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;r<0&&Ma(t,r,s,!0),t._onUpdate&&!s&&vt(t,"onUpdate"),h&&t._repeat&&!s&&t.parent&&vt(t,"onRepeat"),(r>=t._tDur||r<0)&&t.ratio===n&&(n&&_r(t,1),!s&&!Ke&&(vt(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=r)},tb=function(t,r,s){var o;if(s>r)for(o=t._first;o&&o._start<=s;){if(o.data==="isPause"&&o._start>r)return o;o=o._next}else for(o=t._last;o&&o._start>=s;){if(o.data==="isPause"&&o._start<r)return o;o=o._prev}},ws=function(t,r,s,o){var i=t._repeat,n=Ae(r)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ae(n*(i+1)+t._rDelay*i):n,a>0&&!o&&wn(t,t._tTime=t._tDur*a),t.parent&&yn(t),s||qr(t.parent,t),t},su=function(t){return t instanceof Ye?qr(t):ws(t,t._dur)},rb={_start:0,endTime:ci,totalDuration:ci},Tt=function e(t,r,s){var o=t.labels,i=t._recent||rb,n=t.duration()>=Pt?i.endTime(!1):t._dur,a,h,l;return Ve(r)&&(isNaN(r)||r in o)?(h=r.charAt(0),l=r.substr(-1)==="%",a=r.indexOf("="),h==="<"||h===">"?(a>=0&&(r=r.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(r.substr(1))||0)*(l?(a<0?i:s).totalDuration()/100:1)):a<0?(r in o||(o[r]=n),o[r]):(h=parseFloat(r.charAt(a-1)+r.substr(a+1)),l&&s&&(h=h/100*(Qe(s)?s[0]:s).totalDuration()),a>1?e(t,r.substr(0,a-1),s)+h:n+h)):r==null?n:+r},oi=function(t,r,s){var o=er(r[1]),i=(o?2:1)+(t<2?0:1),n=r[i],a,h;if(o&&(n.duration=r[1]),n.parent=s,t){for(a=n,h=s;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=ct(h.vars.inherit)&&h.parent;n.immediateRender=ct(a.immediateRender),t<2?n.runBackwards=1:n.startAt=r[i-1]}return new Ue(r[0],n,r[i+1])},br=function(t,r){return t||t===0?r(t):r},pi=function(t,r,s){return s<t?t:s>r?r:s},Xe=function(t,r){return!Ve(t)||!(r=W_.exec(t))?"":r[1]},sb=function(t,r,s){return br(s,function(o){return pi(t,r,o)})},Fa=[].slice,yu=function(t,r){return t&&Ut(t)&&"length"in t&&(!r&&!t.length||t.length-1 in t&&Ut(t[0]))&&!t.nodeType&&t!==zt},ib=function(t,r,s){return s===void 0&&(s=[]),t.forEach(function(o){var i;return Ve(o)&&!r||yu(o,1)?(i=s).push.apply(i,Dt(o)):s.push(o)})||s},Dt=function(t,r,s){return Re&&!r&&Re.selector?Re.selector(t):Ve(t)&&!s&&(La||!Ss())?Fa.call((r||qa).querySelectorAll(t),0):Qe(t)?ib(t,s):yu(t)?Fa.call(t,0):t?[t]:[]},Na=function(t){return t=Dt(t)[0]||hi("Invalid scope")||{},function(r){var s=t.current||t.nativeElement||t;return Dt(r,s.querySelectorAll?s:s===t?hi("Invalid scope")||qa.createElement("div"):t)}},wu=function(t){return t.sort(function(){return .5-Math.random()})},Su=function(t){if(Fe(t))return t;var r=Ut(t)?t:{each:t},s=Kr(r.ease),o=r.from||0,i=parseFloat(r.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=r.axis,c=o,p=o;return Ve(o)?c=p={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],p=o[1]),function(v,g,u){var d=(u||r).length,m=n[d],f,_,x,y,w,b,S,T,R;if(!m){if(R=r.grid==="auto"?0:(r.grid||[1,Pt])[1],!R){for(S=-Pt;S<(S=u[R++].getBoundingClientRect().left)&&R<d;);R<d&&R--}for(m=n[d]=[],f=h?Math.min(R,d)*c-.5:o%R,_=R===Pt?0:h?d*p/R-.5:o/R|0,S=0,T=Pt,b=0;b<d;b++)x=b%R-f,y=_-(b/R|0),m[b]=w=l?Math.abs(l==="y"?y:x):lu(x*x+y*y),w>S&&(S=w),w<T&&(T=w);o==="random"&&wu(m),m.max=S-T,m.min=T,m.v=d=(parseFloat(r.amount)||parseFloat(r.each)*(R>d?d-1:l?l==="y"?d/R:R:Math.max(R,d/R))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Xe(r.amount||r.each)||0,s=s&&d<0?vb(s):s}return d=(m[v]-m.min)/m.max||0,Ae(m.b+(s?s(d):d)*m.v)+m.u}},za=function(t){var r=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var o=Ae(Math.round(parseFloat(s)/t)*t*r);return(o-o%1)/r+(er(s)?0:Xe(s))}},ku=function(t,r){var s=Qe(t),o,i;return!s&&Ut(t)&&(o=s=t.radius||Pt,t.values?(t=Dt(t.values),(i=!er(t[0]))&&(o*=o)):t=za(t.increment)),br(r,s?Fe(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Pt,c=0,p=t.length,v,g;p--;)i?(v=t[p].x-a,g=t[p].y-h,v=v*v+g*g):v=Math.abs(t[p]-a),v<l&&(l=v,c=p);return c=!o||l<=o?t[c]:n,i||c===n||er(n)?c:c+Xe(n)}:za(t))},Cu=function(t,r,s,o){return br(Qe(t)?!r:s===!0?!!(s=0):!o,function(){return Qe(t)?t[~~(Math.random()*t.length)]:(s=s||1e-5)&&(o=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((t-s/2+Math.random()*(r-t+s*.99))/s)*s*o)/o})},nb=function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return function(o){return r.reduce(function(i,n){return n(i)},o)}},ob=function(t,r){return function(s){return t(parseFloat(s))+(r||Xe(s))}},ab=function(t,r,s){return Tu(t,r,0,1,s)},Eu=function(t,r,s){return br(s,function(o){return t[~~r(o)]})},lb=function e(t,r,s){var o=r-t;return Qe(t)?Eu(t,e(0,t.length),r):br(s,function(i){return(o+(i-t)%o)%o+t})},hb=function e(t,r,s){var o=r-t,i=o*2;return Qe(t)?Eu(t,e(0,t.length-1),r):br(s,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},ks=function(t){return t.replace(j_,function(r){var s=r.indexOf("[")+1,o=r.substring(s||7,s?r.indexOf("]"):r.length-1).split($_);return Cu(s?o:+o[0],s?0:+o[1],+o[2]||1e-5)})},Tu=function(t,r,s,o,i){var n=r-t,a=o-s;return br(i,function(h){return s+((h-t)/n*a||0)})},cb=function e(t,r,s,o){var i=isNaN(t+r)?0:function(g){return(1-g)*t+g*r};if(!i){var n=Ve(t),a={},h,l,c,p,v;if(s===!0&&(o=1)&&(s=null),n)t={p:t},r={p:r};else if(Qe(t)&&!Qe(r)){for(c=[],p=t.length,v=p-2,l=1;l<p;l++)c.push(e(t[l-1],t[l]));p--,i=function(u){u*=p;var d=Math.min(v,~~u);return c[d](u-d)},s=r}else o||(t=xs(Qe(t)?[]:{},t));if(!c){for(h in r)el.call(a,t,h,"get",r[h]);i=function(u){return nl(u,a)||(n?t.p:t)}}}return br(s,i)},iu=function(t,r,s){var o=t.labels,i=Pt,n,a,h;for(n in o)a=o[n]-r,a<0==!!s&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},vt=function(t,r,s){var o=t.vars,i=o[r],n=Re,a=t._ctx,h,l,c;if(i)return h=o[r+"Params"],l=o.callbackScope||t,s&&gr.length&&fn(),a&&(Re=a),c=h?i.apply(l,h):i.call(l),Re=n,c},si=function(t){return _r(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Ke),t.progress()<1&&vt(t,"onInterrupt"),t},bs,Pu=[],Du=function(t){if(t)if(t=!t.name&&t.default||t,$a()||t.headless){var r=t.name,s=Fe(t),o=r&&!s&&t.init?function(){this._props=[]}:t,i={init:ci,render:nl,add:el,kill:Tb,modifier:Eb,rawVars:0},n={targetTest:0,get:0,getSetter:Sn,aliases:{},register:0};if(Ss(),t!==o){if(lt[r])return;bt(o,bt(mn(t,i),n)),xs(o.prototype,xs(i,mn(t,n))),lt[o.prop=r]=o,t.targetTest&&(dn.push(o),Ka[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}uu(r,o),t.register&&t.register(Ze,o,st)}else Pu.push(t)},Ce=255,ii={aqua:[0,Ce,Ce],lime:[0,Ce,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ce],navy:[0,0,128],white:[Ce,Ce,Ce],olive:[128,128,0],yellow:[Ce,Ce,0],orange:[Ce,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ce,0,0],pink:[Ce,192,203],cyan:[0,Ce,Ce],transparent:[Ce,Ce,Ce,0]},Ta=function(t,r,s){return t+=t<0?1:t>1?-1:0,(t*6<1?r+(s-r)*t*6:t<.5?s:t*3<2?r+(s-r)*(2/3-t)*6:r)*Ce+.5|0},Ru=function(t,r,s){var o=t?er(t)?[t>>16,t>>8&Ce,t&Ce]:0:ii.black,i,n,a,h,l,c,p,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ii[t])o=ii[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ce,o&Ce,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ce,t&Ce]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(Zd),!r)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Ta(h+1/3,i,n),o[1]=Ta(h,i,n),o[2]=Ta(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(Va),s&&o.length<4&&(o[3]=1),o}else o=t.match(Zd)||ii.transparent;o=o.map(Number)}return r&&!u&&(i=o[0]/Ce,n=o[1]/Ce,a=o[2]/Ce,p=Math.max(i,n,a),v=Math.min(i,n,a),c=(p+v)/2,p===v?h=l=0:(g=p-v,l=c>.5?g/(2-p-v):g/(p+v),h=p===i?(n-a)/g+(n<a?6:0):p===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),s&&o.length<4&&(o[3]=1),o},Au=function(t){var r=[],s=[],o=-1;return t.split(Zt).forEach(function(i){var n=i.match(Jr)||[];r.push.apply(r,n),s.push(o+=n.length+1)}),r.c=s,r},nu=function(t,r,s){var o="",i=(t+o).match(Zt),n=r?"hsla(":"rgba(",a=0,h,l,c,p;if(!i)return t;if(i=i.map(function(v){return(v=Ru(v,r,1))&&n+(r?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),s&&(c=Au(t),h=s.c,h.join(o)!==c.c.join(o)))for(l=t.replace(Zt,"1").split(Jr),p=l.length-1;a<p;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:s).shift());if(!l)for(l=t.split(Zt),p=l.length-1;a<p;a++)o+=l[a]+i[a];return o+l[p]},Zt=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ii)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),db=/hsl[a]?\(/,Qa=function(t){var r=t.join(" "),s;if(Zt.lastIndex=0,Zt.test(r))return s=db.test(r),t[1]=nu(t[1],s),t[0]=nu(t[0],s,Au(t[1])),!0},di,ht=(function(){var e=Date.now,t=500,r=33,s=e(),o=s,i=1e3/240,n=i,a=[],h,l,c,p,v,g,u=function d(m){var f=e()-o,_=m===!0,x,y,w,b;if((f>t||f<0)&&(s+=f-r),o+=f,w=o-s,x=w-n,(x>0||_)&&(b=++p.frame,v=w-p.time*1e3,p.time=w=w/1e3,n+=x+(x>=i?4:i-x),y=1),_||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](w,v,b,m)};return p={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){cu&&(!La&&$a()&&(zt=La=window,qa=zt.document||{},_t.gsap=Ze,(zt.gsapVersions||(zt.gsapVersions=[])).push(Ze.version),du(pn||zt.GreenSockGlobals||!zt.gsap&&zt||{}),Pu.forEach(Du)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&p.sleep(),l=c||function(m){return setTimeout(m,n-p.time*1e3+1|0)},di=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),di=0,l=ci},lagSmoothing:function(m,f){t=m||1/0,r=Math.min(f||33,t)},fps:function(m){i=1e3/(m||240),n=p.time*1e3+i},add:function(m,f,_){var x=f?function(y,w,b,S){m(y,w,b,S),p.remove(x)}:m;return p.remove(m),a[_?"unshift":"push"](x),Ss(),x},remove:function(m,f){~(f=a.indexOf(m))&&a.splice(f,1)&&g>=f&&g--},_listeners:a},p})(),Ss=function(){return!di&&ht.wake()},we={},ub=/^[\d.\-M][\d.\-,\s]/,pb=/["']/g,fb=function(t){for(var r={},s=t.substr(1,t.length-3).split(":"),o=s[0],i=1,n=s.length,a,h,l;i<n;i++)h=s[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),r[o]=isNaN(l)?l.replace(pb,"").trim():+l,o=h.substr(a+1).trim();return r},mb=function(t){var r=t.indexOf("(")+1,s=t.indexOf(")"),o=t.indexOf("(",r);return t.substring(r,~o&&o<s?t.indexOf(")",s+1):s)},gb=function(t){var r=(t+"").split("("),s=we[r[0]];return s&&r.length>1&&s.config?s.config.apply(null,~t.indexOf("{")?[fb(r[1])]:mb(t).split(",").map(mu)):we._CE&&ub.test(t)?we._CE("",t):s},vb=function(t){return function(r){return 1-t(1-r)}},Kr=function(t,r){return t&&(Fe(t)?t:we[t]||gb(t))||r},Yr=function(t,r,s,o){s===void 0&&(s=function(h){return 1-r(1-h)}),o===void 0&&(o=function(h){return h<.5?r(h*2)/2:1-r((1-h)*2)/2});var i={easeIn:r,easeOut:s,easeInOut:o},n;return rt(t,function(a){we[a]=_t[a]=i,we[n=a.toLowerCase()]=s;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Iu=function(t){return function(r){return r<.5?(1-t(1-r*2))/2:.5+t((r-.5)*2)/2}},Pa=function e(t,r,s){var o=r>=1?r:1,i=(s||(t?.3:.45))/(r<1?r:1),n=i/Ia*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*U_((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Iu(a);return i=Ia/i,h.config=function(l,c){return e(t,l,c)},h},Da=function e(t,r){r===void 0&&(r=1.70158);var s=function(n){return n?--n*n*((r+1)*n+r)+1:0},o=t==="out"?s:t==="in"?function(i){return 1-s(1-i)}:Iu(s);return o.config=function(i){return e(t,i)},o};rt("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var r=t<5?t+1:t;Yr(e+",Power"+(r-1),t?function(s){return Math.pow(s,r)}:function(s){return s},function(s){return 1-Math.pow(1-s,r)},function(s){return s<.5?Math.pow(s*2,r)/2:1-Math.pow((1-s)*2,r)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Yr("Elastic",Pa("in"),Pa("out"),Pa());(function(e,t){var r=1/t,s=2*r,o=2.5*r,i=function(a){return a<r?e*a*a:a<s?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Yr("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Yr("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Yr("Circ",function(e){return-(lu(1-e*e)-1)});Yr("Sine",function(e){return e===1?1:-H_(e*N_)+1});Yr("Back",Da("in"),Da("out"),Da());we.SteppedEase=we.steps=_t.SteppedEase={config:function(t,r){t===void 0&&(t=1);var s=1/t,o=t+(r?0:1),i=r?1:0,n=1-Ee;return function(a){return((o*pi(0,n,a)|0)+i)*s}}};li.ease=we["quad.out"];rt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Xa+=e+","+e+"Params,"});var Za=function(t,r){this.id=z_++,t._gsap=this,this.target=t,this.harness=r,this.get=r?r.get:Ga,this.set=r?r.getSetter:Sn},ui=(function(){function e(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,ws(this,+r.duration,1,1),this.data=r.data,Re&&(this._ctx=Re,Re.data.push(this)),di||ht.wake()}var t=e.prototype;return t.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},t.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,ws(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,o){if(Ss(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(wn(this,s),!i._dp||i.parent||_u(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&Ht(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Ee||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),fu(this,s,o)),this},t.time=function(s,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+ru(this))%(this._dur+this._rDelay)||(s?this._dur:0),o):this._time},t.totalProgress=function(s,o){return arguments.length?this.totalTime(this.totalDuration()*s,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(s,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+ru(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,o):this._repeat?ys(this._tTime,i)+1:1},t.timeScale=function(s,o){if(!arguments.length)return this._rts===-Ee?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?gn(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ee?0:this._rts,this.totalTime(pi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),yn(this),Y_(this)},t.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ss(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ee&&(this._tTime-=Ee)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=Ae(s);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Ht(o,this,this._start-this._delay),this}return this._start},t.endTime=function(s){return this._start+(ct(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var o=this.parent||this._dp;return o?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?gn(o.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=K_);var o=Ke;return Ke=s,Ya(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Ke=o,this},t.globalTime=function(s){for(var o=this,i=arguments.length?s:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,su(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var o=this._time;return this._rDelay=s,su(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,o){return this.totalTime(Tt(this,s),ct(o))},t.restart=function(s,o){return this.play().totalTime(s?-this._delay:0,ct(o)),this._dur||(this._zTime=-Ee),this},t.play=function(s,o){return s!=null&&this.seek(s,o),this.reversed(!1).paused(!1)},t.reverse=function(s,o){return s!=null&&this.seek(s||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(s,o){return s!=null&&this.seek(s,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ee:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ee,this},t.isActive=function(){var s=this.parent||this._dp,o=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=o&&i<this.endTime(!0)-Ee)},t.eventCallback=function(s,o,i){var n=this.vars;return arguments.length>1?(o?(n[s]=o,i&&(n[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=o)):delete n[s],this):n[s]},t.then=function(s){var o=this,i=o._prom;return new Promise(function(n){var a=Fe(s)?s:gu,h=function(){var c=o.then;o.then=null,i&&i(),Fe(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){si(this)},e})();bt(ui.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ee,_prom:0,_ps:!1,_rts:1});var Ye=(function(e){au(t,e);function t(s,o){var i;return s===void 0&&(s={}),i=e.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=ct(s.sortChildren),Ie&&Ht(s.parent||Ie,Qt(i),o),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&bu(Qt(i),s.scrollTrigger),i}var r=t.prototype;return r.to=function(o,i,n){return oi(0,arguments,this),this},r.from=function(o,i,n){return oi(1,arguments,this),this},r.fromTo=function(o,i,n,a){return oi(2,arguments,this),this},r.set=function(o,i,n){return i.duration=0,i.parent=this,ni(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Tt(this,n),1),this},r.call=function(o,i,n){return Ht(this,Ue.delayedCall(0,o,i),n)},r.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Tt(this,h)),this},r.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,ni(n).immediateRender=ct(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},r.staggerFromTo=function(o,i,n,a,h,l,c,p){return a.startAt=n,ni(a).immediateRender=ct(a.immediateRender),this.staggerTo(o,i,a,h,l,c,p)},r.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ae(o),p=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,f,_,x,y,w,b,S;if(this!==Ie&&c>h&&o>=0&&(c=h),c!==this._tTime||n||p){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,f=!x,p&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(b=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ae(c%m),c===h?(d=this._repeat,v=l):(w=Ae(c/m),d=~~w,d&&d===w&&(v=l,d--),v>l&&(v=l)),w=ys(this._tTime,m),!a&&this._tTime&&w!==d&&this._tTime-w*m-this._dur<=0&&(w=d),b&&d&1&&(v=l-v,S=1),d!==w&&!this._lock){var T=b&&w&1,R=T===(b&&d&1);if(d<w&&(T=!T),a=T?0:c%l?l:c,this._lock=1,this.render(a||(S?0:Ae(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&vt(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1,w=d),a&&a!==this._time||f!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,R&&(this._lock=2,a=T?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!f)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=tb(this,Ae(a),Ae(v)),_&&(c-=v-(v=_._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!w&&(vt(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&_!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!f){_=0,u&&(c+=this._zTime=-Ee);break}}g=u}else{g=this._last;for(var E=o<0?o:v;g;){if(u=g._prev,(g._act||E<=g._end)&&g._ts&&_!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(E-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(E-g._start)*g._ts,i,n||Ke&&Ya(g)),v!==this._time||!this._ts&&!f){_=0,u&&(c+=this._zTime=E?-Ee:Ee);break}}g=u}}if(_&&!i&&(this.pause(),_.render(v>=a?0:-Ee)._zTime=v>=a?1:-1,this._ts))return this._start=y,yn(this),this.render(o,i,n);this._onUpdate&&!i&&vt(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&_r(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(vt(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(o,i){var n=this;if(er(i)||(i=Tt(this,i,o)),!(o instanceof ui)){if(Qe(o))return o.forEach(function(a){return n.add(a,i)}),this;if(Ve(o))return this.addLabel(o,i);if(Fe(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Ht(this,o,i):this},r.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Pt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},r.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},r.remove=function(o){return Ve(o)?this.removeLabel(o):Fe(o)?this.killTweensOf(o):(o.parent===this&&xn(this,o),o===this._recent&&(this._recent=this._last),qr(this))},r.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ae(ht.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},r.addLabel=function(o,i){return this.labels[o]=Tt(this,i),this},r.removeLabel=function(o){return delete this.labels[o],this},r.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||ci,n);return a.data="isPause",this._hasPause=1,Ht(this,a,Tt(this,o))},r.removePause=function(o){var i=this._first;for(o=Tt(this,o);i;)i._start===o&&i.data==="isPause"&&_r(i),i=i._next},r.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)mr!==a[h]&&a[h].kill(o,i);return this},r.getTweensOf=function(o,i){for(var n=[],a=Dt(o),h=this._first,l=er(i),c;h;)h instanceof Ue?X_(h._targets,a)&&(l?(!mr||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},r.tweenTo=function(o,i){i=i||{};var n=this,a=Tt(n,o),h=i,l=h.startAt,c=h.onStart,p=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,bt({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Ee,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&ws(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,p||[])}},i));return v?u.render(0):u},r.tweenFromTo=function(o,i,n){return this.tweenTo(i,bt({startAt:{time:Tt(this,o)}},n))},r.recent=function(){return this._recent},r.nextLabel=function(o){return o===void 0&&(o=this._time),iu(this,Tt(this,o))},r.previousLabel=function(o){return o===void 0&&(o=this._time),iu(this,Tt(this,o),1)},r.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Ee)},r.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ae(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return qr(this)},r.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},r.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),qr(this)},r.totalDuration=function(o){var i=0,n=this,a=n._last,h=Pt,l,c,p;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(p=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Ht(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!p&&!n._dp||p&&p.smoothChildTiming)&&(n._start+=Ae(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;ws(n,n===Ie&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Ie._ts&&(fu(Ie,gn(o,Ie)),pu=ht.frame),ht.frame>=eu){eu+=dt.autoSleep||120;var i=Ie._first;if((!i||!i._ts)&&dt.autoSleep&&ht._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ht.sleep()}}},t})(ui);bt(Ye.prototype,{_lock:0,_hasPause:0,_forcing:0});var _b=function(t,r,s,o,i,n,a){var h=new st(this._pt,t,r,0,1,il,null,i),l=0,c=0,p,v,g,u,d,m,f,_;for(h.b=s,h.e=o,s+="",o+="",(f=~o.indexOf("random("))&&(o=ks(o)),n&&(_=[s,o],n(_,t,r),s=_[0],o=_[1]),v=s.match(Ca)||[];p=Ca.exec(o);)u=p[0],d=o.substring(l,p.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Gr(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ca.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(Wa.test(o)||f)&&(h.e=0),this._pt=h,h},el=function(t,r,s,o,i,n,a,h,l,c){Fe(o)&&(o=o(i||0,t,n));var p=t[r],v=s!=="get"?s:Fe(p)?l?t[r.indexOf("set")||!Fe(t["get"+r.substr(3)])?r:"get"+r.substr(3)](l):t[r]():p,g=Fe(p)?l?Sb:Mu:sl,u;if(Ve(o)&&(~o.indexOf("random(")&&(o=ks(o)),o.charAt(1)==="="&&(u=Gr(v,o)+(Xe(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ha)return!isNaN(v*o)&&o!==""?(u=new st(this._pt,t,r,+v||0,o-(v||0),typeof p=="boolean"?Cb:Bu,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!p&&!(r in t)&&bn(r,o),_b.call(this,t,r,v,o,g,h||dt.stringFilter,l))},bb=function(t,r,s,o,i){if(Fe(t)&&(t=ai(t,i,r,s,o)),!Ut(t)||t.style&&t.nodeType||Qe(t)||hu(t))return Ve(t)?ai(t,i,r,s,o):t;var n={},a;for(a in t)n[a]=ai(t[a],i,r,s,o);return n},tl=function(t,r,s,o,i,n){var a,h,l,c;if(lt[t]&&(a=new lt[t]).init(i,a.rawVars?r[t]:bb(r[t],o,i,n,s),s,o,n)!==!1&&(s._pt=h=new st(s._pt,i,t,0,1,a.render,a,0,a.priority),s!==bs))for(l=s._ptLookup[s._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},mr,Ha,rl=function e(t,r,s){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,p=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,f=t.parent,_=f&&f.data==="nested"?f.vars.targets:m,x=t._overwrite==="auto"&&!ja,y=t.timeline,w=o.easeReverse||p,b,S,T,R,E,A,B,M,H,z,j,C,D;if(y&&(!v||!i)&&(i="none"),t._ease=Kr(i,li.ease),t._rEase=w&&(Kr(w)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(M=m[0]?vr(m[0]).harness:0,C=M&&o[M.prop],b=mn(o,Ka),d&&(d._zTime<0&&d.progress(1),r<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?cn:q_),d._lazy=0),n){if(_r(t._startAt=Ue.set(m,bt({data:"isStart",overwrite:!1,parent:f,immediateRender:!0,lazy:!d&&ct(h),startAt:null,delay:0,onUpdate:l&&function(){return vt(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ke||!a&&!g)&&t._startAt.revert(cn),a&&u&&r<=0&&s<=0){r&&(t._zTime=r);return}}else if(c&&u&&!d){if(r&&(a=!1),T=bt({overwrite:!1,data:"isFromStart",lazy:a&&!d&&ct(h),immediateRender:a,stagger:0,parent:f},b),C&&(T[M.prop]=C),_r(t._startAt=Ue.set(m,T)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ke?t._startAt.revert(cn):t._startAt.render(-1,!0)),t._zTime=r,!a)e(t._startAt,Ee,Ee);else if(!r)return}for(t._pt=t._ptCache=0,h=u&&ct(h)||h&&!u,S=0;S<m.length;S++){if(E=m[S],B=E._gsap||Ja(m)[S]._gsap,t._ptLookup[S]=z={},Oa[B.id]&&gr.length&&fn(),j=_===m?S:_.indexOf(E),M&&(H=new M).init(E,C||b,t,j,_)!==!1&&(t._pt=R=new st(t._pt,E,H.name,0,1,H.render,H,0,H.priority),H._props.forEach(function(L){z[L]=R}),H.priority&&(A=1)),!M||C)for(T in b)lt[T]&&(H=tl(T,b,t,j,E,_))?H.priority&&(A=1):z[T]=R=el.call(t,E,T,"get",b[T],j,_,0,o.stringFilter);t._op&&t._op[S]&&t.kill(E,t._op[S]),x&&t._pt&&(mr=t,Ie.killTweensOf(E,z,t.globalTime(r)),D=!t.parent,mr=0),t._pt&&h&&(Oa[B.id]=1)}A&&ol(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!D,v&&r<=0&&y.render(Pt,!0,!0)},xb=function(t,r,s,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[r],c,p,v,g;if(!l)for(l=t._ptCache[r]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return Ha=1,t.vars[r]="+=0",rl(t,a),Ha=0,h?hi(r+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)p=l[g],c=p._pt||p,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=s-c.s,p.e&&(p.e=Ne(s)+Xe(p.e)),p.b&&(p.b=c.s+Xe(p.b))},yb=function(t,r){var s=t[0]?vr(t[0]).harness:0,o=s&&s.aliases,i,n,a,h;if(!o)return r;i=xs({},r);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},wb=function(t,r,s,o){var i=r.ease||o||"power1.inOut",n,a;if(Qe(r))a=s[t]||(s[t]=[]),r.forEach(function(h,l){return a.push({t:l/(r.length-1)*100,v:h,e:i})});else for(n in r)a=s[n]||(s[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:r[n],e:i})},ai=function(t,r,s,o,i){return Fe(t)?t.call(r,s,o,i):Ve(t)&&~t.indexOf("random(")?ks(t):t},Lu=Xa+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Ou={};rt(Lu+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Ou[e]=1});var Ue=(function(e){au(t,e);function t(s,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:ni(o))||this;var h=a.vars,l=h.duration,c=h.delay,p=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,f=o.parent||Ie,_=(Qe(s)||hu(s)?er(s[0]):"length"in o)?[s]:Dt(s),x,y,w,b,S,T,R,E;if(a._targets=_.length?Ja(_):hi("GSAP target "+s+" not found. https://gsap.com",!dt.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||hn(l)||hn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new Ye({data:"nested",defaults:d||{},targets:f&&f.data==="nested"?f.vars.targets:_}),x.kill(),x.parent=x._dp=Qt(a),x._start=0,v||hn(l)||hn(c)){if(b=_.length,R=v&&Su(v),Ut(v))for(S in v)~Lu.indexOf(S)&&(E||(E={}),E[S]=v[S]);for(y=0;y<b;y++)w=mn(o,Ou),w.stagger=0,A&&(w.easeReverse=A),E&&xs(w,E),T=_[y],w.duration=+ai(l,Qt(a),y,T,_),w.delay=(+ai(c,Qt(a),y,T,_)||0)-a._delay,!v&&b===1&&w.delay&&(a._delay=c=w.delay,a._start+=c,w.delay=0),x.to(T,w,R?R(y,T,_):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){ni(bt(x.vars.defaults,{ease:"none"})),x._ease=Kr(u.ease||o.ease||"none");var B=0,M,H,z;if(Qe(u))u.forEach(function(j){return x.to(_,j,">")}),x.duration();else{w={};for(S in u)S==="ease"||S==="easeEach"||wb(S,u[S],w,u.easeEach);for(S in w)for(M=w[S].sort(function(j,C){return j.t-C.t}),B=0,y=0;y<M.length;y++)H=M[y],z={ease:H.e,duration:(H.t-(y?M[y-1].t:0))/100*l},z[S]=H.v,x.to(_,z,B),B+=z.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!ja&&(mr=Qt(a),Ie.killTweensOf(_),mr=0),Ht(f,Qt(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(p||!l&&!u&&a._start===Ae(f._time)&&ct(p)&&Q_(Qt(a))&&f.data!=="nested")&&(a._tTime=-Ee,a.render(Math.max(0,-c)||0)),m&&bu(Qt(a),m),a}var r=t.prototype;return r.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,p=o>h-Ee&&!c?h:o<Ee?0:o,v,g,u,d,m,f,_,x;if(!l)eb(this,o,i,n);else if(p!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=p,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ae(p%d),p===h?(u=this._repeat,v=l):(m=Ae(p/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),f=this._yoyo&&u&1,f&&(v=l-v),m=ys(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=p,this;u!==m&&this.vars.repeatRefresh&&!f&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ae(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(xu(this,c?o:v,n,i,p))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var w=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=w?(y?-1:1)/w:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=_=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=_=this._ease(v/l);if(this._from&&(this.ratio=_=1-_),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&p&&!i&&!m&&(vt(this,"onStart"),this._tTime!==p))return this;for(g=this._pt;g;)g.r(_,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Ma(this,o,i,n),vt(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&vt(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(c&&!this._onUpdate&&Ma(this,o,!0,!0),(o||!l)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&_r(this,1),!i&&!(c&&!a)&&(p||a||f)&&(vt(this,p===h?"onComplete":"onReverseComplete",!0),this._prom&&!(p<h&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},r.resetTo=function(o,i,n,a,h){di||ht.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||rl(this,l),c=this._ease(l/this._dur),xb(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(wn(this,0),this.parent||vu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?si(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ke),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,mr&&mr.vars.overwrite!==!0)._first||si(this),this.parent&&n!==this.timeline.totalDuration()&&ws(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?Dt(o):a,l=this._ptLookup,c=this._pt,p,v,g,u,d,m,f;if((!i||i==="all")&&G_(a,h))return i==="all"&&(this._pt=0),si(this);for(p=this._op=this._op||[],i!=="all"&&(Ve(i)&&(d={},rt(i,function(_){return d[_]=1}),i=d),i=yb(a,i)),f=a.length;f--;)if(~h.indexOf(a[f])){v=l[f],i==="all"?(p[f]=i,u=v,g={}):(g=p[f]=p[f]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&xn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&si(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return oi(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return oi(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Ie.killTweensOf(o,i,n)},t})(ui);bt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});rt("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new Ye,r=Fa.call(arguments,0);return r.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,r)}});var sl=function(t,r,s){return t[r]=s},Mu=function(t,r,s){return t[r](s)},Sb=function(t,r,s,o){return t[r](o.fp,s)},kb=function(t,r,s){return t.setAttribute(r,s)},Sn=function(t,r){return Fe(t[r])?Mu:_n(t[r])&&t.setAttribute?kb:sl},Bu=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e6)/1e6,r)},Cb=function(t,r){return r.set(r.t,r.p,!!(r.s+r.c*t),r)},il=function(t,r){var s=r._pt,o="";if(!t&&r.b)o=r.b;else if(t===1&&r.e)o=r.e;else{for(;s;)o=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+o,s=s._next;o+=r.c}r.set(r.t,r.p,o,r)},nl=function(t,r){for(var s=r._pt;s;)s.r(t,s.d),s=s._next},Eb=function(t,r,s,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,r,s),i=n},Tb=function(t){for(var r=this._pt,s,o;r;)o=r._next,r.p===t&&!r.op||r.op===t?xn(this,r,"_pt"):r.dep||(s=1),r=o;return!s},Pb=function(t,r,s,o){o.mSet(t,r,o.m.call(o.tween,s,o.mt),o)},ol=function(t){for(var r=t._pt,s,o,i,n;r;){for(s=r._next,o=i;o&&o.pr>r.pr;)o=o._next;(r._prev=o?o._prev:n)?r._prev._next=r:i=r,(r._next=o)?o._prev=r:n=r,r=s}t._pt=i},st=(function(){function e(r,s,o,i,n,a,h,l,c){this.t=s,this.s=i,this.c=n,this.p=o,this.r=a||Bu,this.d=h||this,this.set=l||sl,this.pr=c||0,this._next=r,r&&(r._prev=this)}var t=e.prototype;return t.modifier=function(s,o,i){this.mSet=this.mSet||this.set,this.set=Pb,this.m=s,this.mt=i,this.tween=o},e})();rt(Xa+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Ka[e]=1});_t.TweenMax=_t.TweenLite=Ue;_t.TimelineLite=_t.TimelineMax=Ye;Ie=new Ye({sortChildren:!1,defaults:li,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});dt.stringFilter=Qa;var Xr=[],un={},Db=[],ou=0,Rb=0,Ra=function(t){return(un[t]||Db).map(function(r){return r()})},Ua=function(){var t=Date.now(),r=[];t-ou>2&&(Ra("matchMediaInit"),Xr.forEach(function(s){var o=s.queries,i=s.conditions,n,a,h,l;for(a in o)n=zt.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(s.revert(),h&&r.push(s))}),Ra("matchMediaRevert"),r.forEach(function(s){return s.onMatch(s,function(o){return s.add(null,o)})}),ou=t,Ra("matchMedia"))},Fu=(function(){function e(r,s){this.selector=s&&Na(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Rb++,r&&this.add(r)}var t=e.prototype;return t.add=function(s,o,i){Fe(s)&&(i=o,o=s,s=Fe);var n=this,a=function(){var l=Re,c=n.selector,p;return l&&l!==n&&l.data.push(n),i&&(n.selector=Na(i)),Re=n,p=o.apply(n,arguments),Fe(p)&&n._r.push(p),Re=l,n.selector=c,n.isReverted=!1,p};return n.last=a,s===Fe?a(n,function(h){return n.add(null,h)}):s?n[s]=a:a},t.ignore=function(s){var o=Re;Re=null,s(this),Re=o},t.getTweens=function(){var s=[];return this.data.forEach(function(o){return o instanceof e?s.push.apply(s,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&s.push(o)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,o){var i=this;if(s?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,p){return p.g-c.g||-1/0}).forEach(function(c){return c.t.revert(s)}),h=i.data.length;h--;)l=i.data[h],l instanceof Ye?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(s);i._r.forEach(function(c){return c(s,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Xr.length;n--;)Xr[n].id===this.id&&Xr.splice(n,1)},t.revert=function(s){this.kill(s||{})},e})(),Ab=(function(){function e(r){this.contexts=[],this.scope=r,Re&&Re.data.push(this)}var t=e.prototype;return t.add=function(s,o,i){Ut(s)||(s={matches:s});var n=new Fu(0,i||this.scope),a=n.conditions={},h,l,c;Re&&!n.selector&&(n.selector=Re.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=s;for(l in s)l==="all"?c=1:(h=zt.matchMedia(s[l]),h&&(Xr.indexOf(n)<0&&Xr.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(Ua):h.addEventListener("change",Ua)));return c&&o(n,function(p){return n.add(null,p)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(o){return o.kill(s,!0)})},e})(),vn={registerPlugin:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];r.forEach(function(o){return Du(o)})},timeline:function(t){return new Ye(t)},getTweensOf:function(t,r){return Ie.getTweensOf(t,r)},getProperty:function(t,r,s,o){Ve(t)&&(t=Dt(t)[0]);var i=vr(t||{}).get,n=s?gu:mu;return s==="native"&&(s=""),t&&(r?n((lt[r]&<[r].get||i)(t,r,s,o)):function(a,h,l){return n((lt[a]&<[a].get||i)(t,a,h,l))})},quickSetter:function(t,r,s){if(t=Dt(t),t.length>1){var o=t.map(function(c){return Ze.quickSetter(c,r,s)}),i=o.length;return function(c){for(var p=i;p--;)o[p](c)}}t=t[0]||{};var n=lt[r],a=vr(t),h=a.harness&&(a.harness.aliases||{})[r]||r,l=n?function(c){var p=new n;bs._pt=0,p.init(t,s?c+s:c,bs,0,[t]),p.render(1,p),bs._pt&&nl(1,bs)}:a.set(t,h);return n?l:function(c){return l(t,h,s?c+s:c,a,1)}},quickTo:function(t,r,s){var o,i=Ze.to(t,bt((o={},o[r]="+=0.1",o.paused=!0,o.stagger=0,o),s||{})),n=function(h,l,c){return i.resetTo(r,h,l,c)};return n.tween=i,n},isTweening:function(t){return Ie.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Kr(t.ease,li.ease)),tu(li,t||{})},config:function(t){return tu(dt,t||{})},registerEffect:function(t){var r=t.name,s=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!lt[a]&&!_t[a]&&hi(r+" effect requires "+a+" plugin.")}),Ea[r]=function(a,h,l){return s(Dt(a),bt(h||{},i),l)},n&&(Ye.prototype[r]=function(a,h,l){return this.add(Ea[r](a,Ut(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,r){we[t]=Kr(r)},parseEase:function(t,r){return arguments.length?Kr(t,r):we},getById:function(t){return Ie.getById(t)},exportRoot:function(t,r){t===void 0&&(t={});var s=new Ye(t),o,i;for(s.smoothChildTiming=ct(t.smoothChildTiming),Ie.remove(s),s._dp=0,s._time=s._tTime=Ie._time,o=Ie._first;o;)i=o._next,(r||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Ht(s,o,o._start-o._delay),o=i;return Ht(Ie,s,0),s},context:function(t,r){return t?new Fu(t,r):Re},matchMedia:function(t){return new Ab(t)},matchMediaRefresh:function(){return Xr.forEach(function(t){var r=t.conditions,s,o;for(o in r)r[o]&&(r[o]=!1,s=1);s&&t.revert()})||Ua()},addEventListener:function(t,r){var s=un[t]||(un[t]=[]);~s.indexOf(r)||s.push(r)},removeEventListener:function(t,r){var s=un[t],o=s&&s.indexOf(r);o>=0&&s.splice(o,1)},utils:{wrap:lb,wrapYoyo:hb,distribute:Su,random:Cu,snap:ku,normalize:ab,getUnit:Xe,clamp:sb,splitColor:Ru,toArray:Dt,selector:Na,mapRange:Tu,pipe:nb,unitize:ob,interpolate:cb,shuffle:wu},install:du,effects:Ea,ticker:ht,updateRoot:Ye.updateRoot,plugins:lt,globalTimeline:Ie,core:{PropTween:st,globals:uu,Tween:Ue,Timeline:Ye,Animation:ui,getCache:vr,_removeLinkedListItem:xn,reverting:function(){return Ke},context:function(t){return t&&Re&&(Re.data.push(t),t._ctx=Re),Re},suppressOverwrites:function(t){return ja=t}}};rt("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return vn[e]=Ue[e]});ht.add(Ye.updateRoot);bs=vn.to({},{duration:0});var Ib=function(t,r){for(var s=t._pt;s&&s.p!==r&&s.op!==r&&s.fp!==r;)s=s._next;return s},Lb=function(t,r){var s=t._targets,o,i,n;for(o in r)for(i=s.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=Ib(n,o)),n&&n.modifier&&n.modifier(r[o],t,s[i],o))},Aa=function(t,r){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(Ve(i)&&(h={},rt(i,function(c){return h[c]=1}),i=h),r){h={};for(l in i)h[l]=r(i[l]);i=h}Lb(a,i)}}}},Ze=vn.registerPlugin({name:"attr",init:function(t,r,s,o,i){var n,a,h;this.tween=s;for(n in r)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",r[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,r){for(var s=r._pt;s;)Ke?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",headless:1,init:function(t,r){for(var s=r.length;s--;)this.add(t,s,t[s]||0,r[s],0,0,0,0,0,1)}},Aa("roundProps",za),Aa("modifiers"),Aa("snap",ku))||vn;Ue.version=Ye.version=Ze.version="3.15.0";cu=1;$a()&&Ss();var Ob=we.Power0,Mb=we.Power1,Bb=we.Power2,Fb=we.Power3,Nb=we.Power4,zb=we.Linear,Hb=we.Quad,Ub=we.Cubic,jb=we.Quart,$b=we.Quint,Vb=we.Strong,Wb=we.Elastic,qb=we.Back,Kb=we.SteppedEase,Xb=we.Bounce,Jb=we.Sine,Gb=we.Expo,Yb=we.Circ;var Nu,xr,Es,ul,ts,Qb,zu,pl,Zb=function(){return typeof window<"u"},rr={},es=180/Math.PI,Ts=Math.PI/180,Cs=Math.atan2,Hu=1e8,fl=/([A-Z])/g,e0=/(left|right|width|margin|padding|x)/i,t0=/[\s,\(]\S/,jt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ll=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},r0=function(t,r){return r.set(r.t,r.p,t===1?r.e:Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},s0=function(t,r){return r.set(r.t,r.p,t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},i0=function(t,r){return r.set(r.t,r.p,t===1?r.e:t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},n0=function(t,r){var s=r.s+r.c*t;r.set(r.t,r.p,~~(s+(s<0?-.5:.5))+r.u,r)},Xu=function(t,r){return r.set(r.t,r.p,t?r.e:r.b,r)},Ju=function(t,r){return r.set(r.t,r.p,t!==1?r.b:r.e,r)},o0=function(t,r,s){return t.style[r]=s},a0=function(t,r,s){return t.style.setProperty(r,s)},l0=function(t,r,s){return t._gsap[r]=s},h0=function(t,r,s){return t._gsap.scaleX=t._gsap.scaleY=s},c0=function(t,r,s,o,i){var n=t._gsap;n.scaleX=n.scaleY=s,n.renderTransform(i,n)},d0=function(t,r,s,o,i){var n=t._gsap;n[r]=s,n.renderTransform(i,n)},Le="transform",ut=Le+"Origin",u0=function e(t,r){var s=this,o=this.target,i=o.style,n=o._gsap;if(t in rr&&i){if(this.tfm=this.tfm||{},t!=="transform")t=jt[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=tr(o,a)}):this.tfm[t]=n.x?n[t]:tr(o,t),t===ut&&(this.tfm.zOrigin=n.zOrigin);else return jt.transform.split(",").forEach(function(a){return e.call(s,a,r)});if(this.props.indexOf(Le)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(ut,r,"")),t=Le}(i||r)&&this.props.push(t,r,i[t])},Gu=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},p0=function(){var t=this.props,r=this.target,s=r.style,o=r._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?r[t[i]](t[i+2]):r[t[i]]=t[i+2]:t[i+2]?s[t[i]]=t[i+2]:s.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(fl,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),i=pl(),(!i||!i.isStart)&&!s[Le]&&(Gu(s),o.zOrigin&&s[ut]&&(s[ut]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},Yu=function(t,r){var s={target:t,props:[],revert:p0,save:u0};return t._gsap||Ze.core.getCache(t),r&&t.style&&t.nodeType&&r.split(",").forEach(function(o){return s.save(o)}),s},Qu,hl=function(t,r){var s=xr.createElementNS?xr.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):xr.createElement(t);return s&&s.style?s:xr.createElement(t)},xt=function e(t,r,s){var o=getComputedStyle(t);return o[r]||o.getPropertyValue(r.replace(fl,"-$1").toLowerCase())||o.getPropertyValue(r)||!s&&e(t,Ps(r)||r,1)||""},Uu="O,Moz,ms,Ms,Webkit".split(","),Ps=function(t,r,s){var o=r||ts,i=o.style,n=5;if(t in i&&!s)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(Uu[n]+t in i););return n<0?null:(n===3?"ms":n>=0?Uu[n]:"")+t},cl=function(){Zb()&&window.document&&(Nu=window,xr=Nu.document,Es=xr.documentElement,ts=hl("div")||{style:{}},Qb=hl("div"),Le=Ps(Le),ut=Le+"Origin",ts.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Qu=!!Ps("perspective"),pl=Ze.core.reverting,ul=1)},ju=function(t){var r=t.ownerSVGElement,s=hl("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",s.appendChild(o),Es.appendChild(s);try{i=o.getBBox()}catch{}return s.removeChild(o),Es.removeChild(s),i},$u=function(t,r){for(var s=r.length;s--;)if(t.hasAttribute(r[s]))return t.getAttribute(r[s])},Zu=function(t){var r,s;try{r=t.getBBox()}catch{r=ju(t),s=1}return r&&(r.width||r.height)||s||(r=ju(t)),r&&!r.width&&!r.x&&!r.y?{x:+$u(t,["x","cx","x1"])||0,y:+$u(t,["y","cy","y1"])||0,width:0,height:0}:r},ep=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Zu(t))},wr=function(t,r){if(r){var s=t.style,o;r in rr&&r!==ut&&(r=Le),s.removeProperty?(o=r.substr(0,2),(o==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),s.removeProperty(o==="--"?r:r.replace(fl,"-$1").toLowerCase())):s.removeAttribute(r)}},yr=function(t,r,s,o,i,n){var a=new st(t._pt,r,s,0,1,n?Ju:Xu);return t._pt=a,a.b=o,a.e=i,t._props.push(s),a},Vu={deg:1,rad:1,turn:1},f0={grid:1,flex:1},Sr=function e(t,r,s,o){var i=parseFloat(s)||0,n=(s+"").trim().substr((i+"").length)||"px",a=ts.style,h=e0.test(r),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),p=100,v=o==="px",g=o==="%",u,d,m,f;if(o===n||!i||Vu[o]||Vu[n])return i;if(n!=="px"&&!v&&(i=e(t,r,s,"px")),f=t.getCTM&&ep(t),(g||n==="%")&&(rr[r]||~r.indexOf("adius")))return u=f?t.getBBox()[h?"width":"height"]:t[c],Ne(g?i/u*p:i/100*u);if(a[h?"width":"height"]=p+(v?n:o),d=o!=="rem"&&~r.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,f&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===xr||!d.appendChild)&&(d=xr.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ht.time&&!m.uncache)return Ne(i/m.width*p);if(g&&(r==="height"||r==="width")){var _=t.style[r];t.style[r]=p+o,u=t[c],_?t.style[r]=_:wr(t,r)}else(g||n==="%")&&!f0[xt(d,"display")]&&(a.position=xt(t,"position")),d===t&&(a.position="static"),d.appendChild(ts),u=ts[c],d.removeChild(ts),a.position="absolute";return h&&g&&(m=vr(d),m.time=ht.time,m.width=d[c]),Ne(v?u*i/p:u&&i?p/u*i:0)},tr=function(t,r,s,o){var i;return ul||cl(),r in jt&&r!=="transform"&&(r=jt[r],~r.indexOf(",")&&(r=r.split(",")[0])),rr[r]&&r!=="transform"?(i=gi(t,o),i=r!=="transformOrigin"?i[r]:i.svg?i.origin:Cn(xt(t,ut))+" "+i.zOrigin+"px"):(i=t.style[r],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=kn[r]&&kn[r](t,r,s)||xt(t,r)||Ga(t,r)||(r==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?Sr(t,r,i,s)+s:i},m0=function(t,r,s,o){if(!s||s==="none"){var i=Ps(r,t,1),n=i&&xt(t,i,1);n&&n!==s?(r=i,s=n):r==="borderColor"&&(s=xt(t,"borderTopColor"))}var a=new st(this._pt,t.style,r,0,1,il),h=0,l=0,c,p,v,g,u,d,m,f,_,x,y,w;if(a.b=s,a.e=o,s+="",o+="",o.substring(0,6)==="var(--"&&(o=xt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[r],t.style[r]=o,o=xt(t,r)||o,d?t.style[r]=d:wr(t,r)),c=[s,o],Qa(c),s=c[0],o=c[1],v=s.match(Jr)||[],w=o.match(Jr)||[],w.length){for(;p=Jr.exec(o);)m=p[0],_=o.substring(h,p.index),u?u=(u+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Gr(g,m)+y),f=parseFloat(m),x=m.substr((f+"").length),h=Jr.lastIndex-x.length,x||(x=x||dt.units[r]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Sr(t,r,d,x)||0),a._pt={_next:a._pt,p:_||l===1?_:",",s:g,c:f-g,m:u&&u<4||r==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=r==="display"&&o==="none"?Ju:Xu;return Wa.test(o)&&(a.e=0),this._pt=a,a},Wu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},g0=function(t){var r=t.split(" "),s=r[0],o=r[1]||"50%";return(s==="top"||s==="bottom"||o==="left"||o==="right")&&(t=s,s=o,o=t),r[0]=Wu[s]||s,r[1]=Wu[o]||o,r.join(" ")},v0=function(t,r){if(r.tween&&r.tween._time===r.tween._dur){var s=r.t,o=s.style,i=r.u,n=s._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],rr[a]&&(h=1,a=a==="transformOrigin"?ut:Le),wr(s,a);h&&(wr(s,Le),n&&(n.svg&&s.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",gi(s,1),n.uncache=1,Gu(o)))}},kn={clearProps:function(t,r,s,o,i){if(i.data!=="isFromStart"){var n=t._pt=new st(t._pt,r,s,0,0,v0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(s),1}}},mi=[1,0,0,1,0,0],tp={},rp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},qu=function(t){var r=xt(t,Le);return rp(r)?mi:r.substr(7).match(Va).map(Ne)},ml=function(t,r){var s=t._gsap||vr(t),o=t.style,i=qu(t),n,a,h,l;return s.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?mi:i):(i===mi&&!t.offsetParent&&t!==Es&&!s.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Es.appendChild(t)),i=qu(t),h?o.display=h:wr(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Es.removeChild(t))),r&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},dl=function(t,r,s,o,i,n){var a=t._gsap,h=i||ml(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,p=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],f=h[4],_=h[5],x=r.split(" "),y=parseFloat(x[0])||0,w=parseFloat(x[1])||0,b,S,T,R;s?h!==mi&&(S=g*m-u*d)&&(T=y*(m/S)+w*(-d/S)+(d*_-m*f)/S,R=y*(-u/S)+w*(g/S)-(g*_-u*f)/S,y=T,w=R):(b=Zu(t),y=b.x+(~x[0].indexOf("%")?y/100*b.width:y),w=b.y+(~(x[1]||x[0]).indexOf("%")?w/100*b.height:w)),o||o!==!1&&a.smooth?(f=y-l,_=w-c,a.xOffset=p+(f*g+_*d)-f,a.yOffset=v+(f*u+_*m)-_):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=w,a.smooth=!!o,a.origin=r,a.originIsAbsolute=!!s,t.style[ut]="0px 0px",n&&(yr(n,a,"xOrigin",l,y),yr(n,a,"yOrigin",c,w),yr(n,a,"xOffset",p,a.xOffset),yr(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+w)},gi=function(t,r){var s=t._gsap||new Za(t);if("x"in s&&!r&&!s.uncache)return s;var o=t.style,i=s.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=xt(t,ut)||"0",c,p,v,g,u,d,m,f,_,x,y,w,b,S,T,R,E,A,B,M,H,z,j,C,D,L,k,U,J,O,ee,N;return c=p=v=d=m=f=_=x=y=0,g=u=1,s.svg=!!(t.getCTM&&ep(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Le]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Le]!=="none"?h[Le]:"")),o.scale=o.rotate=o.translate="none"),S=ml(t,s.svg),s.svg&&(s.uncache?(D=t.getBBox(),l=s.xOrigin-D.x+"px "+(s.yOrigin-D.y)+"px",C=""):C=!r&&t.getAttribute("data-svg-origin"),dl(t,C||l,!!C||s.originIsAbsolute,s.smooth!==!1,S)),w=s.xOrigin||0,b=s.yOrigin||0,S!==mi&&(A=S[0],B=S[1],M=S[2],H=S[3],c=z=S[4],p=j=S[5],S.length===6?(g=Math.sqrt(A*A+B*B),u=Math.sqrt(H*H+M*M),d=A||B?Cs(B,A)*es:0,_=M||H?Cs(M,H)*es+d:0,_&&(u*=Math.abs(Math.cos(_*Ts))),s.svg&&(c-=w-(w*A+b*M),p-=b-(w*B+b*H))):(N=S[6],O=S[7],k=S[8],U=S[9],J=S[10],ee=S[11],c=S[12],p=S[13],v=S[14],T=Cs(N,J),m=T*es,T&&(R=Math.cos(-T),E=Math.sin(-T),C=z*R+k*E,D=j*R+U*E,L=N*R+J*E,k=z*-E+k*R,U=j*-E+U*R,J=N*-E+J*R,ee=O*-E+ee*R,z=C,j=D,N=L),T=Cs(-M,J),f=T*es,T&&(R=Math.cos(-T),E=Math.sin(-T),C=A*R-k*E,D=B*R-U*E,L=M*R-J*E,ee=H*E+ee*R,A=C,B=D,M=L),T=Cs(B,A),d=T*es,T&&(R=Math.cos(T),E=Math.sin(T),C=A*R+B*E,D=z*R+j*E,B=B*R-A*E,j=j*R-z*E,A=C,z=D),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,f=180-f),g=Ne(Math.sqrt(A*A+B*B+M*M)),u=Ne(Math.sqrt(j*j+N*N)),T=Cs(z,j),_=Math.abs(T)>2e-4?T*es:0,y=ee?1/(ee<0?-ee:ee):0),s.svg&&(C=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!rp(xt(t,Le)),C&&t.setAttribute("transform",C))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(g*=-1,_+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,_+=_<=0?180:-180)),r=r||s.uncache,s.x=c-((s.xPercent=c&&(!r&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+n,s.y=p-((s.yPercent=p&&(!r&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-p)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+n,s.z=v+n,s.scaleX=Ne(g),s.scaleY=Ne(u),s.rotation=Ne(d)+a,s.rotationX=Ne(m)+a,s.rotationY=Ne(f)+a,s.skewX=_+a,s.skewY=x+a,s.transformPerspective=y+n,(s.zOrigin=parseFloat(l.split(" ")[2])||!r&&s.zOrigin||0)&&(o[ut]=Cn(l)),s.xOffset=s.yOffset=0,s.force3D=dt.force3D,s.renderTransform=s.svg?b0:Qu?sp:_0,s.uncache=0,s},Cn=function(t){return(t=t.split(" "))[0]+" "+t[1]},al=function(t,r,s){var o=Xe(r);return Ne(parseFloat(r)+parseFloat(Sr(t,"x",s+"px",o)))+o},_0=function(t,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,sp(t,r)},Qr="0deg",fi="0px",Zr=") ",sp=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.z,l=s.rotation,c=s.rotationY,p=s.rotationX,v=s.skewX,g=s.skewY,u=s.scaleX,d=s.scaleY,m=s.transformPerspective,f=s.force3D,_=s.target,x=s.zOrigin,y="",w=f==="auto"&&t&&t!==1||f===!0;if(x&&(p!==Qr||c!==Qr)){var b=parseFloat(c)*Ts,S=Math.sin(b),T=Math.cos(b),R;b=parseFloat(p)*Ts,R=Math.cos(b),n=al(_,n,S*R*-x),a=al(_,a,-Math.sin(b)*-x),h=al(_,h,T*R*-x+x)}m!==fi&&(y+="perspective("+m+Zr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(w||n!==fi||a!==fi||h!==fi)&&(y+=h!==fi||w?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+Zr),l!==Qr&&(y+="rotate("+l+Zr),c!==Qr&&(y+="rotateY("+c+Zr),p!==Qr&&(y+="rotateX("+p+Zr),(v!==Qr||g!==Qr)&&(y+="skew("+v+", "+g+Zr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+Zr),_.style[Le]=y||"translate(0, 0)"},b0=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.rotation,l=s.skewX,c=s.skewY,p=s.scaleX,v=s.scaleY,g=s.target,u=s.xOrigin,d=s.yOrigin,m=s.xOffset,f=s.yOffset,_=s.forceCSS,x=parseFloat(n),y=parseFloat(a),w,b,S,T,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Ts,l*=Ts,w=Math.cos(h)*p,b=Math.sin(h)*p,S=Math.sin(h-l)*-v,T=Math.cos(h-l)*v,l&&(c*=Ts,R=Math.tan(l-c),R=Math.sqrt(1+R*R),S*=R,T*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),w*=R,b*=R)),w=Ne(w),b=Ne(b),S=Ne(S),T=Ne(T)):(w=p,T=v,b=S=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Sr(g,"x",n,"px"),y=Sr(g,"y",a,"px")),(u||d||m||f)&&(x=Ne(x+u-(u*w+d*S)+m),y=Ne(y+d-(u*b+d*T)+f)),(o||i)&&(R=g.getBBox(),x=Ne(x+o/100*R.width),y=Ne(y+i/100*R.height)),R="matrix("+w+","+b+","+S+","+T+","+x+","+y+")",g.setAttribute("transform",R),_&&(g.style[Le]=R)},x0=function(t,r,s,o,i){var n=360,a=Ve(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?es:1),l=h-o,c=o+l+"deg",p,v;return a&&(p=i.split("_")[1],p==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),p==="cw"&&l<0?l=(l+n*Hu)%n-~~(l/n)*n:p==="ccw"&&l>0&&(l=(l-n*Hu)%n-~~(l/n)*n)),t._pt=v=new st(t._pt,r,s,o,l,r0),v.e=c,v.u="deg",t._props.push(s),v},Ku=function(t,r){for(var s in r)t[s]=r[s];return t},y0=function(t,r,s){var o=Ku({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=s.style,a,h,l,c,p,v,g,u;o.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),n[Le]=r,a=gi(s,1),wr(s,Le),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Le],n[Le]=r,a=gi(s,1),n[Le]=l);for(h in rr)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Xe(l),u=Xe(c),p=g!==u?Sr(s,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new st(t._pt,a,h,p,v-p,ll),t._pt.u=u||0,t._props.push(h));Ku(a,o)};rt("padding,margin,Width,Radius",function(e,t){var r="Top",s="Right",o="Bottom",i="Left",n=(t<3?[r,s,o,i]:[r+i,r+s,o+s,o+i]).map(function(a){return t<2?e+a:"border"+a+e});kn[t>1?"border"+e:e]=function(a,h,l,c,p){var v,g;if(arguments.length<4)return v=n.map(function(u){return tr(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,p)}});var gl={name:"css",register:cl,targetTest:function(t){return t.style&&t.nodeType},init:function(t,r,s,o,i){var n=this._props,a=t.style,h=s.vars.startAt,l,c,p,v,g,u,d,m,f,_,x,y,w,b,S,T,R;ul||cl(),this.styles=this.styles||Yu(t),T=this.styles.props,this.tween=s;for(d in r)if(d!=="autoRound"&&(c=r[d],!(lt[d]&&tl(d,r,s,o,t,i)))){if(g=typeof c,u=kn[d],g==="function"&&(c=c.call(s,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=ks(c)),u)u(this,t,d,c,s)&&(S=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",Zt.lastIndex=0,Zt.test(l)||(m=Xe(l),f=Xe(c),f?m!==f&&(l=Sr(t,d,l,f)+f):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),T.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(s,o,t,i):h[d],Ve(l)&&~l.indexOf("random(")&&(l=ks(l)),Xe(l+"")||l==="auto"||(l+=dt.units[d]||Xe(tr(t,d))||""),(l+"").charAt(1)==="="&&(l=tr(t,d))):l=tr(t,d),v=parseFloat(l),_=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),_&&(c=c.substr(2)),p=parseFloat(c),d in jt&&(d==="autoAlpha"&&(v===1&&tr(t,"visibility")==="hidden"&&p&&(v=0),T.push("visibility",0,a.visibility),yr(this,a,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),d!=="scale"&&d!=="transform"&&(d=jt[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in rr,x){if(this.styles.save(d),R=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=xt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var E=t.style.perspective;t.style.perspective=c,c=xt(t,"perspective"),E?t.style.perspective=E:wr(t,"perspective")}p=parseFloat(c)}if(y||(w=t._gsap,w.renderTransform&&!r.parseTransform||gi(t,r.parseTransform),b=r.smoothOrigin!==!1&&w.smooth,y=this._pt=new st(this._pt,a,Le,0,1,w.renderTransform,w,0,-1),y.dep=1),d==="scale")this._pt=new st(this._pt,w,"scaleY",w.scaleY,(_?Gr(w.scaleY,_+p):p)-w.scaleY||0,ll),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){T.push(ut,0,a[ut]),c=g0(c),w.svg?dl(t,c,0,b,0,this):(f=parseFloat(c.split(" ")[2])||0,f!==w.zOrigin&&yr(this,w,"zOrigin",w.zOrigin,f),yr(this,a,d,Cn(l),Cn(c)));continue}else if(d==="svgOrigin"){dl(t,c,1,b,0,this);continue}else if(d in tp){x0(this,w,d,v,_?Gr(v,_+c):c);continue}else if(d==="smoothOrigin"){yr(this,w,"smooth",w.smooth,c);continue}else if(d==="force3D"){w[d]=c;continue}else if(d==="transform"){y0(this,c,t);continue}}else d in a||(d=Ps(d)||d);if(x||(p||p===0)&&(v||v===0)&&!t0.test(c)&&d in a)m=(l+"").substr((v+"").length),p||(p=0),f=Xe(c)||(d in dt.units?dt.units[d]:m),m!==f&&(v=Sr(t,d,l,f)),this._pt=new st(this._pt,x?w:a,d,v,(_?Gr(v,_+p):p)-v,!x&&(f==="px"||d==="zIndex")&&r.autoRound!==!1?n0:ll),this._pt.u=f||0,x&&R!==c?(this._pt.b=l,this._pt.e=R,this._pt.r=i0):m!==f&&f!=="%"&&(this._pt.b=l,this._pt.r=s0);else if(d in a)m0.call(this,t,d,l,_?_+c:c);else if(d in t)this.add(t,d,l||t[d],_?_+c:c,o,i);else if(d!=="parseTransform"){bn(d,c);continue}x||(d in a?T.push(d,0,a[d]):typeof t[d]=="function"?T.push(d,2,t[d]()):T.push(d,1,l||t[d])),n.push(d)}}S&&ol(this)},render:function(t,r){if(r.tween._time||!pl())for(var s=r._pt;s;)s.r(t,s.d),s=s._next;else r.styles.revert()},get:tr,aliases:jt,getSetter:function(t,r,s){var o=jt[r];return o&&o.indexOf(",")<0&&(r=o),r in rr&&r!==ut&&(t._gsap.x||tr(t,"x"))?s&&zu===s?r==="scale"?h0:l0:(zu=s||{})&&(r==="scale"?c0:d0):t.style&&!_n(t.style[r])?o0:~r.indexOf("-")?a0:Sn(t,r)},core:{_removeProperty:wr,_getMatrix:ml}};Ze.utils.checkPrefix=Ps;Ze.core.getStyleSaver=Yu;(function(e,t,r,s){var o=rt(e+","+t+","+r,function(i){rr[i]=1});rt(t,function(i){dt.units[i]="deg",tp[i]=1}),jt[o[13]]=e+","+t,rt(s,function(i){var n=i.split(":");jt[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");rt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){dt.units[e]="px"});Ze.registerPlugin(gl);var $t=Ze.registerPlugin(gl)||Ze,zD=$t.core.Tween;var kr=require("react");var ip=typeof document<"u"?kr.useLayoutEffect:kr.useEffect,np=e=>e&&!Array.isArray(e)&&typeof e=="object",En=[],w0={},op=$t,rs=(e,t=En)=>{let r=w0;np(e)?(r=e,e=null,t="dependencies"in r?r.dependencies:En):np(t)&&(r=t,t="dependencies"in r?r.dependencies:En),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:s,revertOnUpdate:o}=r,i=(0,kr.useRef)(!1),n=(0,kr.useRef)(op.context(()=>{},s)),a=(0,kr.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&ip(()=>(i.current=!0,()=>n.current.revert()),En),ip(()=>{if(e&&n.current.add(e,s),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};rs.register=e=>{op=e};rs.headless=!0;$t.registerPlugin(rs);var S0="(prefers-reduced-motion: reduce)";function Tn(){return!window.matchMedia(S0).matches}function ap(e,t){let r=(0,vl.useRef)(t),s=(0,vl.useRef)(!1);r.current=t;let{contextSafe:o}=rs(()=>{let i=e.current;if(i===null||!Tn())return;let n=Array.from(i.children),a=$t.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(s.current)return;let i=e.current;if(i===null||!Tn()){r.current();return}s.current=!0;let n=Array.from(i.children);$t.killTweensOf([i,...n]),$t.timeline({defaults:{ease:"power1.in"},onComplete:()=>{r.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function lp(e,t){rs(()=>{let r=e.current;!t||r===null||!Tn()||$t.fromTo(r,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function hp(e,t=":scope > *"){rs(()=>{let r=e.current;if(r===null||!Tn())return;let s=r.querySelectorAll(t);$t.fromTo(s,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Oe=require("react/jsx-runtime");function et({title:e,subtitle:t,className:r,onClose:s,children:o}){let i=(0,ss.useId)(),n=(0,ss.useId)(),a=(0,ss.useRef)(null),h=ap(a,s),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Oe.jsx)(Ds.Modal,{open:!0,onClose:h,title:e,closeLabel:"\u5173\u95ED",headless:!0,className:`dsh-ssh-dialog-modal${r===void 0?"":` ${r}-modal`}`,children:(0,Oe.jsx)(Yd,{children:(0,Oe.jsx)(Qd,{children:(0,Oe.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${r===void 0?"":` ${r}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Oe.jsxs)("header",{children:[(0,Oe.jsxs)("span",{children:[(0,Oe.jsx)("h2",{id:i,children:e}),t&&(0,Oe.jsx)("p",{id:n,children:t})]}),(0,Oe.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Oe.jsx)(Ds.IconCloseOutline16,{size:16})})]}),o]})})})})}function pe({label:e,hint:t,children:r}){return(0,Oe.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Oe.jsx)("span",{children:e}),r,t&&(0,Oe.jsx)("small",{children:t})]})}function is({active:e,onClick:t,children:r}){let s=(0,ss.useRef)(null);return lp(s,e),(0,Oe.jsx)("button",{ref:s,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:r})}function cp(){let e=(0,ss.useRef)(null);return hp(e),(0,Oe.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Oe.jsx)("span",{children:(0,Oe.jsx)(Cr,{})}),(0,Oe.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Oe.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Cr(){return(0,Oe.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Oe.jsx)(Ds.IconDataOutline16,{size:17})})}function Pe(e){return e instanceof Error?e.message:String(e)}function dp(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}var je=require("react/jsx-runtime");function Pn({locationName:e,locationKind:t,entries:r,onClose:s,onDelete:o}){let[i,n]=(0,_l.useState)(!1),[a,h]=(0,_l.useState)(),l=r.filter(p=>p.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),s()}catch(p){h(Pe(p)),n(!1)}};return(0,je.jsxs)(et,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${r.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||s()},children:[(0,je.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,je.jsx)("span",{children:(0,je.jsx)(Rs.IconTrashOutline16,{size:18})}),(0,je.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,je.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[r.slice(0,6).map(p=>(0,je.jsxs)("div",{children:[p.kind==="directory"?(0,je.jsx)(Rs.IconFolderClose16,{size:17}):(0,je.jsx)(Rs.IconDataOutline16,{size:17}),(0,je.jsxs)("span",{children:[(0,je.jsx)("strong",{children:p.name}),(0,je.jsx)("small",{title:p.path,children:p.path})]})]},p.path)),r.length>6&&(0,je.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",r.length-6," \u9879"]})]}),a&&(0,je.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,je.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,je.jsx)("span",{}),(0,je.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:s,children:"\u53D6\u6D88"}),(0,je.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var X=require("react/jsx-runtime"),k0=512*1024*1024;function pp({sessionId:e}){let t=(0,xe.useCallback)(i=>Kl(e,i||void 0),[e]),r=(0,xe.useCallback)(i=>Xl(e,i),[e]),s=(0,xe.useCallback)((i,n=!1)=>Gl(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>Jl(e,i,n),[e]);return(0,X.jsx)(xl,{initialPath:"",loadDirectory:t,loadPreview:r,fileUrl:s,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function fp({sessionId:e,profile:t,profiles:r,onProfile:s,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await lh(e,t.id,g)).cwd:g,m=await ql(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>Yl(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>Ql(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>$n(t.id,g,u,d),[t.id]),l=gp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,p=(0,xe.useCallback)((g,u)=>Bs({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,X.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,X.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,X.jsxs)("label",{children:[(0,X.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,X.jsx)("select",{value:t.id,onChange:g=>s(g.target.value),children:r.map(g=>(0,X.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,X.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,X.jsx)(xl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:p}})}function mp({profile:e,initialPath:t="~",onEdit:r,onDelete:s,embedded:o=!1}){let i=(0,xe.useCallback)(v=>Zl(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>eh(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>th(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>$n(e.id,v,g,u),[e.id]),l=gp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,p=(0,xe.useCallback)((v,g)=>Bs({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,X.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,X.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,X.jsxs)("div",{children:[(0,X.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,X.jsx)("p",{children:o?t:`${Kt(e)} \xB7 ${t}`})]}),(0,X.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[s&&(0,X.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,X.jsx)(ke.IconTrashOutline16,{size:16})}),r&&(0,X.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,X.jsx)(ke.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,X.jsx)(xl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:p}})]})}function xl({initialPath:e,header:t,workspace:r=!1,loadDirectory:s,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[p,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[f,_]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[w,b]=(0,xe.useState)(),[S,T]=(0,xe.useState)(!1),[R,E]=(0,xe.useState)(),[A,B]=(0,xe.useState)(),[M,H]=(0,xe.useState)(),[z,j]=(0,xe.useState)(),[C,D]=(0,xe.useState)(),L=(0,xe.useCallback)(async(G,oe)=>{_(!0),D(void 0),u(void 0),b(void 0);try{let me=await s(G,oe);v(me),m(me.path)}catch(me){D(Dn(me))}finally{_(!1)}},[s]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=G=>{G.preventDefault(),L(d,!0)},U=async(G,oe=p?.path,me=!1)=>{if(n===void 0||oe===void 0||G.length===0)return;let De=G.filter(Te=>Te.size<=k0),se=G.length-De.length;if(De.length===0){D("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}b(void 0),D(void 0);for(let Te=0;Te<De.length;Te+=1){let ft=De[Te],or=me&&Te===0;y(ft.name);try{await n(oe,ft,or)}catch(Ot){!or&&Ot instanceof ar&&Ot.status===409?b({file:ft,remaining:De.slice(Te+1),directory:oe}):D(Dn(Ot)),y(void 0);return}}y(void 0),await L(oe,!1),se>0&&D(`\u5DF2\u8DF3\u8FC7 ${se} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},J=n!==void 0&&p!==void 0&&x===void 0&&w===void 0,O=G=>Array.from(G.dataTransfer.types).includes("Files"),ee=G=>Array.from(G.dataTransfer.types).includes(Lt),N=G=>{!J||!O(G)||(G.preventDefault(),c.current+=1,T(!0))},P=G=>{if(J&&O(G)){G.preventDefault(),G.dataTransfer.dropEffect="copy";return}if(a===void 0||p===void 0||!ee(G))return;let oe=R===void 0?"copy":ti(R,{endpointId:a.endpointId,directory:p.path});oe==="none"||oe==="invalid"||(G.preventDefault(),G.dataTransfer.dropEffect=oe)},$=G=>{O(G)&&(c.current=Math.max(0,c.current-1),c.current===0&&T(!1))},V=G=>{if(c.current=0,T(!1),J&&O(G)){G.preventDefault();let me=Array.from(G.dataTransfer.files);me.length>0&&U(me);return}if(a===void 0||p===void 0||!ee(G))return;G.preventDefault();let oe=vs(G.dataTransfer.getData(Lt));oe!==void 0&&te(oe,p.path)},te=async(G,oe)=>{if(a!==void 0){B(void 0),E(void 0),j(void 0),D(void 0);try{let me=await ln(G,{paneId:a.paneId,endpointId:a.endpointId,directory:oe});me.operation==="move"&&(j("\u5DF2\u79FB\u52A8"),await L(p?.path??oe,!1)),me.operation==="copy"&&j("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){D(Dn(me))}}},Q=async()=>{h===void 0||p===void 0||M===void 0||(await h.remove(p.path,[M.path]),await L(p.path,!1))};return(0,X.jsxs)("div",{className:`dsh-ssh-sftp${r?" is-workspace":""}${S?" is-dragging-files":""}`,onDragEnter:N,onDragOver:P,onDragLeave:$,onDrop:V,children:[t,g?(0,X.jsx)(C0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,X.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:p?.parent==null||f,onClick:()=>{p?.parent&&L(p.parent,!0)},children:(0,X.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,X.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:G=>m(G.target.value)}),(0,X.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:f,onClick:()=>{L(p?.path??d,!1)},children:(0,X.jsx)(ke.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:G=>{let oe=Array.from(G.target.files??[]);G.target.value="",oe.length>0&&U(oe)}}),(0,X.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:p===void 0||x!==void 0||w!==void 0,onClick:()=>l.current?.click(),children:[(0,X.jsx)(ke.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),w!==void 0&&(0,X.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,X.jsx)("small",{children:w.file.name})]}),(0,X.jsxs)("span",{children:[(0,X.jsx)("button",{type:"button",onClick:()=>{let G=w;b(void 0),U(G.remaining,G.directory)},children:"\u8DF3\u8FC7"}),(0,X.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let G=w;U([G.file,...G.remaining],G.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),z&&(0,X.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,X.jsx)("span",{children:z}),(0,X.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>j(void 0),children:(0,X.jsx)(ke.IconCloseOutline16,{size:14})})]}),C&&(0,X.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:C}),(0,X.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":f,children:[(0,X.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,X.jsx)("span",{children:"\u540D\u79F0"}),(0,X.jsx)("span",{children:"\u5927\u5C0F"}),(0,X.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,X.jsx)("span",{"aria-hidden":"true"})]}),f&&p===void 0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):p?.entries.length===0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):p?.entries.map(G=>{let oe=G.kind==="directory"||G.navigable===!0,me=R===void 0||a===void 0?void 0:ti(R,{endpointId:a.endpointId,directory:G.path}),De=oe&&me!=="none"&&me!=="invalid";return(0,X.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${G.name}${oe?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(G.kind==="file"||G.kind==="directory"),className:`dsh-ssh-sftp-row is-${oe?"directory":G.kind}${A===G.path?" is-drop-target":""}`,onClick:()=>{oe?L(G.path,!0):u(G)},onKeyDown:se=>{se.target===se.currentTarget&&se.key==="Enter"&&(oe?L(G.path,!0):u(G))},onDragStart:se=>{if(a===void 0||p===void 0)return;let Te={paneId:a.paneId,endpointId:a.endpointId,directory:p.path,paths:[G.path]};E(Te),se.dataTransfer.effectAllowed="copyMove",se.dataTransfer.setData(Lt,JSON.stringify(Te))},onDragEnd:()=>{E(void 0),B(void 0)},onDragOver:se=>{let Te=J&&O(se);!oe||!Te&&!ee(se)||!Te&&!De||(se.preventDefault(),se.stopPropagation(),se.dataTransfer.dropEffect=Te||me!=="move"?"copy":"move",B(G.path))},onDragLeave:se=>{se.currentTarget.contains(se.relatedTarget)||B(void 0)},onDrop:se=>{if(!oe)return;if(se.preventDefault(),se.stopPropagation(),B(void 0),J&&O(se)){let ft=Array.from(se.dataTransfer.files);ft.length>0&&U(ft,G.path);return}let Te=vs(se.dataTransfer.getData(Lt));Te!==void 0&&te(Te,G.path)},children:[(0,X.jsxs)("span",{children:[oe?(0,X.jsx)(ke.IconFolderClose16,{size:16}):(0,X.jsx)(ke.IconDataOutline16,{size:16}),(0,X.jsx)("strong",{title:G.name,children:G.name})]}),(0,X.jsx)("small",{children:oe?"-":bl(G.size)}),(0,X.jsx)("small",{children:E0(G.modifiedAt)}),h!==void 0&&(0,X.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${G.name}`,title:`\u5220\u9664 ${G.name}`,onClick:se=>{se.stopPropagation(),H(G)},children:(0,X.jsx)(ke.IconTrashOutline16,{size:14})})]},G.path)})]})]}),S&&(0,X.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,X.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",p?.path??d]})]})}),M!==void 0&&h!==void 0&&(0,X.jsx)(Pn,{locationName:h.locationName,locationKind:h.locationKind,entries:[M],onClose:()=>H(void 0),onDelete:Q})]})}function C0({entry:e,loadPreview:t,fileUrl:r,onBack:s}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let p=!1;return i(void 0),a(void 0),t(e.path).then(v=>{p||i(v)}).catch(v=>{p||a(Dn(v))}),()=>{p=!0}},[e.path,t]);let c=r(e.path);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,X.jsxs)("header",{children:[(0,X.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:s,children:(0,X.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,X.jsx)("strong",{title:e.name,children:e.name}),(0,X.jsx)("small",{children:bl(e.size)})]}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,X.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,X.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,X.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,X.jsx)(ke.IconFullscreenOutline16,{size:16})})]})]}),(0,X.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,X.jsx)(up,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]}),(0,X.jsx)(ke.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,closeLabel:"\u5173\u95ED\u9884\u89C8",headless:!0,className:"dsh-ssh-preview-modal",children:(0,X.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,X.jsxs)("header",{children:[(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{title:e.name,children:e.name}),(0,X.jsx)("small",{children:bl(e.size)})]}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,X.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,X.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,X.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,X.jsx)(ke.IconCloseOutline16,{size:16})})]})]}),(0,X.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,X.jsx)(up,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]})})]})}function up({entry:e,preview:t,error:r,fileUrl:s,downloadUrl:o}){return r?(0,X.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:r}):t===void 0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,X.jsx)(zo,{remarkPlugins:[on],components:{a:i=>(0,X.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,X.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("pre",{children:t.text||""}),t.truncated&&(0,X.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,X.jsx)("img",{src:s(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,X.jsx)("iframe",{src:s(e.path,!0),title:e.name}):(0,X.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,X.jsx)(ke.IconDataOutline16,{size:24}),(0,X.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,X.jsx)("p",{children:t.mimeType}),(0,X.jsxs)("a",{href:o,children:[(0,X.jsx)(ke.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function bl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],r=e/1024,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;return`${r>=10?r.toFixed(0):r.toFixed(1)} ${t[s]}`}function E0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function Dn(e){return e instanceof Error?e.message:String(e)}function gp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var As=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,r){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let s=this.input;if(this.input="",!s)return;let o=this.inputSequence++;this.deliverInput(s,o,r)})))}observe(t){let r=!1,s=0,o,i,n,a=!1,h=()=>{r||(r=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{r||(s=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!r)try{let v=await this.endpoints.read(s);l(v),r||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(r)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},p=()=>{r||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(p(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=T0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),p()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&p()},i=window.setTimeout(()=>{a||p()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,r,s,o=0){this.endpoints.send(t,r).catch(i=>{if(!this.disposed){if(o<2&&P0(i)){window.setTimeout(()=>this.deliverInput(t,r,s,o+1),60*(o+1));return}s(i)}})}};function T0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function P0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var bp=Ms(_p(),1),D0={background:"#1c1c1e",foreground:"#f2f2f7",cursor:"#f2f2f7",cursorAccent:"#1c1c1e",selectionBackground:"#8e8e9366",black:"#1c1c1e",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#a5a5aa",magenta:"#bf5af2",cyan:"#64d2ff",white:"#e5e5ea",brightBlack:"#8e8e93",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#d1d1d6",brightMagenta:"#da8fff",brightCyan:"#8be0ff",brightWhite:"#ffffff"};function An(e){return new bp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:D0})}function In(e,t,r,s){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;r.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,s?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var he=require("react/jsx-runtime");function yp(e){let t=String(e.sessionId),[r,s]=(0,qe.useState)(),[o,i]=(0,qe.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,qe.useState)();(0,qe.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,qe.useCallback)(async()=>{try{let l=await Vl(t);s(l),l.injection?.permission!=="terminal"&&i(c=>c==="terminals"?"local-directory":c),a(void 0)}catch(l){a(Pe(l))}},[t]);return(0,qe.useEffect)(()=>{let l=!1,c,p=!1,v=async()=>{if(p||(p=!0,await h(),p=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,he.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,he.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,he.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,he.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,he.jsx)(Cr,{})}),(0,he.jsxs)("span",{children:[(0,he.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,he.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",dp(t)]})]})]}),(0,he.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,he.jsx)(sr.IconCloseOutline16,{size:16})})]}),r&&(0,he.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>i("local-directory"),children:[(0,he.jsx)(sr.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),r.profiles.length>0&&(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>i("remote-directory"),children:[(0,he.jsx)(Cr,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),r.injection?.permission==="terminal"&&(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>i("terminals"),children:[(0,he.jsx)(sr.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",r.terminals.length>0&&(0,he.jsx)("em",{children:r.terminals.length})]})]}),(0,he.jsxs)("div",{className:"dsh-ssh-activity-body",children:[r===void 0?(0,he.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,he.jsx)(pp,{sessionId:t}):o==="remote-directory"?(0,he.jsx)(R0,{sessionId:t,profiles:r.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,he.jsx)(A0,{sessionId:t,terminals:r.terminals,onClosed:h}),n&&(0,he.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function R0({sessionId:e,profiles:t,selectedProfileId:r,onProfile:s,onSaved:o}){let i=t.find(n=>n.id===r)??t[0];return i===void 0?(0,he.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,he.jsx)(sr.IconFolderOpenOutline16,{size:22}),(0,he.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,he.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,he.jsx)(fp,{sessionId:e,profile:i,profiles:t,onProfile:s,onSaved:o},i.id)}function A0({sessionId:e,terminals:t,onClosed:r}){let s=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,qe.useState)(s?.terminalId),[n,a]=(0,qe.useState)(),[h,l]=(0,qe.useState)(),c=t.find(g=>g.terminalId===o)??s;if((0,qe.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(s?.terminalId)},[s?.terminalId,o,t]),c===void 0)return(0,he.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,he.jsx)(sr.IconCodeOutline16,{size:22}),(0,he.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,he.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let p=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await ah(e,c.terminalId),await r()}catch(g){l(Pe(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,he.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,he.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,he.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,he.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,he.jsxs)("span",{children:[(0,he.jsx)("strong",{children:c.name}),(0,he.jsx)("small",{children:c.cwd})]}),(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,he.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,he.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{p()},children:[(0,he.jsx)(sr.IconCloseOutline16,{size:14}),(0,he.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,he.jsx)(I0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,he.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function I0({sessionId:e,terminal:t,onError:r}){let s=(0,qe.useRef)(null),o=(0,qe.useRef)();return(0,qe.useEffect)(()=>{let i=s.current;if(i===null)return;let n=An({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new xp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new As({streamUrl:ih(e,t.terminalId),read:v=>sh(e,t.terminalId,v),send:(v,g)=>rh(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>r(Pe(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),r(void 0)},error:v=>r(Pe(v))}),p=In(i,n,a,(v,g)=>{oh(e,t.terminalId,v,g).catch(u=>r(Pe(u)))});return()=>{c(),h.dispose(),l.dispose(),p.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,r,e]),(0,qe.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,he.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,he.jsx)("div",{ref:s,className:"dsh-ssh-terminal-viewport"})})}var Er=require("react"),yt=require("react/jsx-runtime");function Sp({className:e,toolbar:t,notice:r,navigation:s,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,p]=(0,Er.useState)(),v=(0,Er.useRef)(null),g=(0,Er.useRef)(null),u=(0,Er.useRef)(null),d=()=>{p(void 0),window.requestAnimationFrame(()=>{let f=u.current;f?.isConnected&&f.focus()})},m={closePanel:d,openPanel:f=>p(f)};return(0,Er.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let _=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>_?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,yt.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,r,(0,yt.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():p("navigation"),children:[i,(0,yt.jsx)("span",{children:o})]}),n!==void 0&&(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():p("inspector"),children:[h,(0,yt.jsx)("span",{children:a})]})]}),(0,yt.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,yt.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:wp(s,m)}),(0,yt.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,yt.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:wp(n,m)}),(0,yt.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function wp(e,t){return typeof e=="function"?e(t):e}var kp=`.dsh-ssh-adaptive-workspace {
|
|
38
|
+
`))}function h(g,u,d,m){let f=d.enter("tableCell"),_=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return _(),f(),x}function l(g,u){return gd(g,{align:u,alignDelimiters:s,padding:r,stringLength:o})}function c(g,u,d){let m=g.children,f=-1,_=[],x=u.enter("table");for(;++f<m.length;)_[f]=p(m[f],u,d);return x(),_}function p(g,u,d){let m=g.children,f=-1,_=[],x=u.enter("tableRow");for(;++f<m.length;)_[f]=h(m[f],g,u,d);return x(),_}function v(g,u,d){let m=Qs.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function pa(){return{exit:{taskListCheckValueChecked:Hd,taskListCheckValueUnchecked:Hd,paragraph:c_}}}function fa(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:d_}}}function Hd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function c_(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let s=r.children[0];if(s&&s.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function d_(e,t,r,s){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);i&&a.move(n);let h=Qs.listItem(e,t,r,{...s,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function ma(){return[Ko(),Jo(),Yo(),da(),pa()]}function ga(e){return{extensions:[Xo(),Go(e),Qo(),ua(e),fa()]}}var u_={tokenize:v_,partial:!0},Ud={tokenize:__,partial:!0},jd={tokenize:b_,partial:!0},$d={tokenize:x_,partial:!0},p_={tokenize:y_,partial:!0},Vd={name:"wwwAutolink",tokenize:m_,previous:qd},Wd={name:"protocolAutolink",tokenize:g_,previous:Kd},Yt={name:"emailAutolink",tokenize:f_,previous:Xd},Ft={};function _a(){return{text:Ft}}var Wr=48;for(;Wr<123;)Ft[Wr]=Yt,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);Ft[43]=Yt;Ft[45]=Yt;Ft[46]=Yt;Ft[95]=Yt;Ft[72]=[Yt,Wd];Ft[104]=[Yt,Wd];Ft[87]=[Yt,Vd];Ft[119]=[Yt,Vd];function f_(e,t,r){let s=this,o,i;return n;function n(p){return!va(p)||!Xd.call(s,s.previous)||ba(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(p))}function a(p){return va(p)?(e.consume(p),a):p===64?(e.consume(p),h):r(p)}function h(p){return p===46?e.check(p_,c,l)(p):p===45||p===95||Be(p)?(i=!0,e.consume(p),h):c(p)}function l(p){return e.consume(p),o=!0,h}function c(p){return i&&o&&$e(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):r(p)}}function m_(e,t,r){let s=this;return o;function o(n){return n!==87&&n!==119||!qd.call(s,s.previous)||ba(s.events)?r(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(u_,e.attempt(Ud,e.attempt(jd,i),r),r)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function g_(e,t,r){let s=this,o="",i=!1;return n;function n(p){return(p===72||p===104)&&Kd.call(s,s.previous)&&!ba(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),a):r(p)}function a(p){if($e(p)&&o.length<5)return o+=String.fromCodePoint(p),e.consume(p),a;if(p===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return r(p)}function h(p){return p===47?(e.consume(p),i?l:(i=!0,h)):r(p)}function l(p){return p===null||Br(p)||be(p)||Mt(p)||Fr(p)?r(p):e.attempt(Ud,e.attempt(jd,c),r)(p)}function c(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function v_(e,t,r){let s=0;return o;function o(n){return(n===87||n===119)&&s<3?(s++,e.consume(n),o):n===46&&s===3?(e.consume(n),i):r(n)}function i(n){return n===null?r(n):t(n)}}function __(e,t,r){let s,o,i;return n;function n(l){return l===46||l===95?e.check($d,h,a)(l):l===null||be(l)||Mt(l)||l!==45&&Fr(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?s=!0:(o=s,s=void 0),e.consume(l),n}function h(l){return o||s||!i?r(l):t(l)}}function b_(e,t){let r=0,s=0;return o;function o(n){return n===40?(r++,e.consume(n),o):n===41&&s<r?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check($d,t,i)(n):n===null||be(n)||Mt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&s++,e.consume(n),o}}function x_(e,t,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||be(a)||Mt(a)?t(a):r(a)}function o(a){return a===null||a===40||a===91||be(a)||Mt(a)?t(a):s(a)}function i(a){return $e(a)?n(a):r(a)}function n(a){return a===59?(e.consume(a),s):$e(a)?(e.consume(a),n):r(a)}}function y_(e,t,r){return s;function s(i){return e.consume(i),o}function o(i){return Be(i)?r(i):t(i)}}function qd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||be(e)}function Kd(e){return!$e(e)}function Xd(e){return!(e===47||va(e))}function va(e){return e===43||e===45||e===46||e===95||Be(e)}function ba(e){let t=e.length,r=!1;for(;t--;){let s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var w_={tokenize:D_,partial:!0};function xa(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:E_,continuation:{tokenize:T_},exit:P_}},text:{91:{name:"gfmFootnoteCall",tokenize:C_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:S_,resolveTo:k_}}}}function S_(e,t,r){let s=this,o=s.events.length,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),n;for(;o--;){let h=s.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return r(h);let l=Je(s.sliceSerialize({start:n.end,end:s.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function k_(e,t){let r=e.length,s;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){s=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...h),e}function C_(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i=0,n;return a;function a(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?r(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(p){if(i>999||p===93&&!n||p===null||p===91||be(p))return r(p);if(p===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Je(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(p)}return be(p)||(n=!0),i++,e.consume(p),p===92?c:l}function c(p){return p===91||p===92||p===93?(e.consume(p),i++,l):l(p)}}function E_(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):r(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||be(u))return r(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Je(s.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return be(u)||(a=!0),n++,e.consume(u),u===92?p:c}function p(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),le(e,g,"gfmFootnoteDefinitionWhitespace")):r(u)}function g(u){return t(u)}}function T_(e,t,r){return e.check(Bt,t,e.attempt(w_,t,r))}function P_(e){e.exit("gfmFootnoteDefinition")}function D_(e,t,r){let s=this;return le(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):r(i)}}function ya(e){let r=(e||{}).singleTilde,s={name:"strikethrough",tokenize:i,resolveAll:o};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},p={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",p,a]],g=a.parser.constructs.insideSpan.null;g&&He(v,v.length,0,dr(g,n.slice(l+1,h),a)),He(v,v.length,0,[["exit",p,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),He(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,p=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=Gt(l);if(u===126)return p>1?h(u):(n.consume(u),p++,g);if(p<2&&!r)return h(u);let m=n.exit("strikethroughSequenceTemporary"),f=Gt(u);return m._open=!f||f===2&&!!d,m._close=!d||d===2&&!!f,a(u)}}}var sn=class{constructor(){this.map=[]}add(t,r,s){R_(this,t,r,s)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let r=this.map.length,s=[];for(;r>0;)r-=1,s.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];s.push(t.slice()),t.length=0;let o=s.pop();for(;o;){for(let i of o)t.push(i);o=s.pop()}this.map.length=0}};function R_(e,t,r,s){let o=0;if(!(r===0&&s.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=r,e.map[o][2].push(...s);return}o+=1}e.map.push([t,r,s])}}function Jd(e,t){let r=!1,s=[];for(;t<e.length;){let o=e[t];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return s}function wa(){return{flow:{null:{name:"table",tokenize:A_,resolveAll:I_}}}}function A_(e,t,r){let s=this,o=0,i=0,n;return a;function a(E){let A=s.events.length-1;for(;A>-1;){let H=s.events[A][1].type;if(H==="lineEnding"||H==="linePrefix")A--;else break}let B=A>-1?s.events[A][1].type:null,M=B==="tableHead"||B==="tableRow"?b:h;return M===b&&s.parser.lazy[s.now().line]?r(E):M(E)}function h(E){return e.enter("tableHead"),e.enter("tableRow"),l(E)}function l(E){return E===124||(n=!0,i+=1),c(E)}function c(E){return E===null?r(E):ie(E)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g):r(E):de(E)?le(e,c,"whitespace")(E):(i+=1,n&&(n=!1,o+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),p(E)))}function p(E){return E===null||E===124||be(E)?(e.exit("data"),c(E)):(e.consume(E),E===92?v:p)}function v(E){return E===92||E===124?(e.consume(E),p):p(E)}function g(E){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(E):(e.enter("tableDelimiterRow"),n=!1,de(E)?le(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):u(E))}function u(E){return E===45||E===58?m(E):E===124?(n=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),d):w(E)}function d(E){return de(E)?le(e,m,"whitespace")(E):m(E)}function m(E){return E===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),f):E===45?(i+=1,f(E)):E===null||ie(E)?y(E):w(E)}function f(E){return E===45?(e.enter("tableDelimiterFiller"),_(E)):w(E)}function _(E){return E===45?(e.consume(E),_):E===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(E))}function x(E){return de(E)?le(e,y,"whitespace")(E):y(E)}function y(E){return E===124?u(E):E===null||ie(E)?!n||o!==i?w(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):w(E)}function w(E){return r(E)}function b(E){return e.enter("tableRow"),S(E)}function S(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),S):E===null||ie(E)?(e.exit("tableRow"),t(E)):de(E)?le(e,S,"whitespace")(E):(e.enter("data"),T(E))}function T(E){return E===null||E===124||be(E)?(e.exit("data"),S(E)):(e.consume(E),E===92?R:T)}function R(E){return E===92||E===124?(e.consume(E),T):T(E)}}function I_(e,t){let r=-1,s=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,p,v=new sn;for(;++r<e.length;){let g=e[r],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(Gd(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(s=!0,p=void 0,i=[0,0,0,0],n=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(s=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],p=nn(v,t,i,o,void 0,p),i=[0,0,0,0]),n[2]=r)):u.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(n[0]=n[1],p=nn(v,t,i,o,void 0,p)),i=n,n=[i[1],r,0,0])):u.type==="tableHead"?(a=!0,h=r):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=r,i[1]!==0?(n[0]=n[1],p=nn(v,t,i,o,r,p)):n[1]!==0&&(p=nn(v,t,n,o,r,p)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=r)}for(h!==0&&Gd(v,t,h,l,c),v.consume(t.events),r=-1;++r<t.events.length;){let g=t.events[r];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=Jd(t.events,r))}return e}function nn(e,t,r,s,o,i){let n=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(i.end=Object.assign({},gs(t.events,r[0])),e.add(r[0],0,[["exit",i,t]]));let h=gs(t.events,r[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",i,t]]),r[2]!==0){let l=gs(t.events,r[2]),c=gs(t.events,r[3]),p={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(r[2],0,[["enter",p,t]]),s!==2){let v=t.events[r[2]],g=t.events[r[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){let u=r[2]+1,d=r[3]-r[2]-1;e.add(u,d,[])}}e.add(r[3]+1,0,[["exit",p,t]])}return o!==void 0&&(i.end=Object.assign({},gs(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Gd(e,t,r,s,o){let i=[],n=gs(t.events,r);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),s.end=Object.assign({},n),i.push(["exit",s,t]),e.add(r+1,0,i)}function gs(e,t){let r=e[t],s=r[0]==="enter"?"start":"end";return r[1][s]}var L_={name:"tasklistCheck",tokenize:O_};function Sa(){return{text:{91:L_}}}function O_(e,t,r){let s=this;return o;function o(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return be(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):r(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(h)}function a(h){return ie(h)?t(h):de(h)?e.check({tokenize:M_},t,r)(h):r(h)}}function M_(e,t,r){return le(e,s,"whitespace");function s(o){return o===null?r(o):t(o)}}function Yd(e){return Ai([_a(),xa(),ya(e),wa(),Sa()])}var B_={};function on(e){let t=this,r=e||B_,s=t.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),n=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push(Yd(r)),i.push(ma()),n.push(ga(r))}var ke=require("@deepseek-ai/dsh-client-ui-primitives");var Lt="application/x-dsh-remote-files";function ln(e){return e.kind==="directory"||e.navigable===!0}function Zs(e,t){return e.endpointId===t.endpointId&&an(e.directory)===an(t.directory)}function ei(e,t,r){if(e.endpointId!==r.endpointId)return!0;let s=an(r.directory);return!t.some(o=>{let i=an(o);return s===i||s.startsWith(`${i}/`)})}function ti(e,t){return Zs(e,t)?"none":ei(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function vs(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(r=>typeof r=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function an(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function hn(e,t){let r=ti(e,t);if(r==="none")return{operation:r};if(r==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(r==="move")return await Ml({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:r};let s=await Fs({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:r,job:s}}var bl=require("react"),Rs=require("@deepseek-ai/dsh-client-ui-primitives");var ss=require("react"),Ds=require("@deepseek-ai/dsh-client-ui-primitives");var Nt=require("react"),ri=require("react/jsx-runtime"),F_=28;function ka(e,t,r){return Math.min(Math.max(e,t),r)}function _s(){let e=(0,Nt.useRef)(null),t=(0,Nt.useRef)(void 0),r=(0,Nt.useRef)(void 0),s=(0,Nt.useCallback)(()=>{t.current=void 0;let n=e.current,a=r.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=ka(a.clientX-h.left,0,h.width),c=ka(a.clientY-h.top,0,h.height),p=Math.min(l,h.width-l,c,h.height-c),v=ka(1-p/F_,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,Nt.useCallback)(n=>{r.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(s))},[s]),i=(0,Nt.useCallback)(()=>{r.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,Nt.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function Qd({children:e,className:t}){let r=_s();return(0,ri.jsxs)("div",{ref:r.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:r.onPointerMove,onPointerLeave:r.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var Ca=require("react/jsx-runtime");function N_(e,t){let r=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(r)){let[s="0",o="0",i="0"]=r;return`rgba(${parseInt(s+s,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(r)?`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function Zd({children:e,className:t,glareColor:r="#ffffff",glareOpacity:s=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":N_(r,s),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,Ca.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,Ca.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var _l=require("react");function Qt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var dt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},li={duration:.5,overwrite:!1,delay:0},$a,Ke,Re,Pt=1e8,Ee=1/Pt,La=Math.PI*2,z_=La/4,H_=0,hu=Math.sqrt,U_=Math.cos,j_=Math.sin,Ve=function(t){return typeof t=="string"},Fe=function(t){return typeof t=="function"},er=function(t){return typeof t=="number"},bn=function(t){return typeof t>"u"},Ut=function(t){return typeof t=="object"},ct=function(t){return t!==!1},Va=function(){return typeof window<"u"},cn=function(t){return Fe(t)||Ve(t)},cu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qe=Array.isArray,$_=/random\([^)]+\)/g,V_=/,\s*/g,eu=/(?:-?\.?\d|\.)+/gi,Wa=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Jr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ea=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,qa=/[+-]=-?[.\d]+/,W_=/[^,'"\[\]\s]+/gi,q_=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ie,zt,Oa,Ka,_t={},fn={},du,uu=function(t){return(fn=xs(t,_t))&&Ze},xn=function(t,r){return console.warn("Invalid property",t,"set to",r,"Missing plugin? gsap.registerPlugin()")},hi=function(t,r){return!r&&console.warn(t)},pu=function(t,r){return t&&(_t[t]=r)&&fn&&(fn[t]=r)||_t},ci=function(){return 0},K_={suppressEvents:!0,isStart:!0,kill:!1},dn={suppressEvents:!0,kill:!1},X_={suppressEvents:!0},Xa={},gr=[],Ma={},fu,lt={},Ta={},tu=30,un=[],Ja="",Ga=function(t){var r=t[0],s,o;if(Ut(r)||Fe(r)||(t=[t]),!(s=(r._gsap||{}).harness)){for(o=un.length;o--&&!un[o].targetTest(r););s=un[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new el(t[o],s)))||t.splice(o,1);return t},vr=function(t){return t._gsap||Ga(Dt(t))[0]._gsap},Ya=function(t,r,s){return(s=t[r])&&Fe(s)?t[r]():bn(s)&&t.getAttribute&&t.getAttribute(r)||s},rt=function(t,r){return(t=t.split(",")).forEach(r)||t},Ne=function(t){return Math.round(t*1e5)/1e5||0},Ae=function(t){return Math.round(t*1e7)/1e7||0},Gr=function(t,r){var s=r.charAt(0),o=parseFloat(r.substr(2));return t=parseFloat(t),s==="+"?t+o:s==="-"?t-o:s==="*"?t*o:t/o},J_=function(t,r){for(var s=r.length,o=0;t.indexOf(r[o])<0&&++o<s;);return o<s},mn=function(){var t=gr.length,r=gr.slice(0),s,o;for(Ma={},gr.length=0,s=0;s<t;s++)o=r[s],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Qa=function(t){return!!(t._initted||t._startAt||t.add)},mu=function(t,r,s,o){gr.length&&!Ke&&mn(),t.render(r,s,o||!!(Ke&&r<0&&Qa(t))),gr.length&&!Ke&&mn()},gu=function(t){var r=parseFloat(t);return(r||r===0)&&(t+"").match(W_).length<2?r:Ve(t)?t.trim():t},vu=function(t){return t},bt=function(t,r){for(var s in r)s in t||(t[s]=r[s]);return t},G_=function(t){return function(r,s){for(var o in s)o in r||o==="duration"&&t||o==="ease"||(r[o]=s[o])}},xs=function(t,r){for(var s in r)t[s]=r[s];return t},ru=function e(t,r){for(var s in r)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(t[s]=Ut(r[s])?e(t[s]||(t[s]={}),r[s]):r[s]);return t},gn=function(t,r){var s={},o;for(o in t)o in r||(s[o]=t[o]);return s},ni=function(t){var r=t.parent||Ie,s=t.keyframes?G_(Qe(t.keyframes)):bt;if(ct(t.inherit))for(;r;)s(t,r.vars.defaults),r=r.parent||r._dp;return t},Y_=function(t,r){for(var s=t.length,o=s===r.length;o&&s--&&t[s]===r[s];);return s<0},_u=function(t,r,s,o,i){s===void 0&&(s="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=r[i];n&&n[i]>a;)n=n._prev;return n?(r._next=n._next,n._next=r):(r._next=t[s],t[s]=r),r._next?r._next._prev=r:t[o]=r,r._prev=n,r.parent=r._dp=t,r},yn=function(t,r,s,o){s===void 0&&(s="_first"),o===void 0&&(o="_last");var i=r._prev,n=r._next;i?i._next=n:t[s]===r&&(t[s]=n),n?n._prev=i:t[o]===r&&(t[o]=i),r._next=r._prev=r.parent=null},_r=function(t,r){t.parent&&(!r||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},qr=function(t,r){if(t&&(!r||r._end>t._dur||r._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},Q_=function(t){for(var r=t.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return t},Ba=function(t,r,s,o){return t._startAt&&(Ke?t._startAt.revert(dn):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(r,!0,o))},Z_=function e(t){return!t||t._ts&&e(t.parent)},su=function(t){return t._repeat?ys(t._tTime,t=t.duration()+t._rDelay)*t:0},ys=function(t,r){var s=Math.floor(t=Ae(t/r));return t&&s===t?s-1:s},vn=function(t,r){return(t-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},wn=function(t){return t._end=Ae(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ee)||0))},Sn=function(t,r){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=Ae(s._time-(t._ts>0?r/t._ts:((t._dirty?t.totalDuration():t._tDur)-r)/-t._ts)),wn(t),s._dirty||qr(s,t)),t},bu=function(t,r){var s;if((r._time||!r._dur&&r._initted||r._start<t._time&&(r._dur||!r.add))&&(s=vn(t.rawTime(),r),(!r._dur||pi(0,r.totalDuration(),s)-r._tTime>Ee)&&r.render(s,!0)),qr(t,r)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(s=t;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ee}},Ht=function(t,r,s,o){return r.parent&&_r(r),r._start=Ae((er(s)?s:s||t!==Ie?Tt(t,s,r):t._time)+r._delay),r._end=Ae(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),_u(t,r,"_first","_last",t._sort?"_start":0),Fa(r)||(t._recent=r),o||bu(t,r),t._ts<0&&Sn(t,t._tTime),t},xu=function(t,r){return(_t.ScrollTrigger||xn("scrollTrigger",r))&&_t.ScrollTrigger.create(r,t)},yu=function(t,r,s,o,i){if(sl(t,r,i),!t._initted)return 1;if(!s&&t._pt&&!Ke&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&fu!==ht.frame)return gr.push(t),t._lazy=[i,o],1},eb=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},Fa=function(t){var r=t.data;return r==="isFromStart"||r==="isStart"},tb=function(t,r,s,o){var i=t.ratio,n=r<0||!r&&(!t._start&&eb(t)&&!(!t._initted&&Fa(t))||(t._ts<0||t._dp._ts<0)&&!Fa(t))?0:1,a=t._rDelay,h=0,l,c,p;if(a&&t._repeat&&(h=pi(0,t._tDur,r),c=ys(h,a),t._yoyo&&c&1&&(n=1-n),c!==ys(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Ke||o||t._zTime===Ee||!r&&t._zTime){if(!t._initted&&yu(t,r,o,s,h))return;for(p=t._zTime,t._zTime=r||(s?Ee:0),s||(s=r&&!p),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;r<0&&Ba(t,r,s,!0),t._onUpdate&&!s&&vt(t,"onUpdate"),h&&t._repeat&&!s&&t.parent&&vt(t,"onRepeat"),(r>=t._tDur||r<0)&&t.ratio===n&&(n&&_r(t,1),!s&&!Ke&&(vt(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=r)},rb=function(t,r,s){var o;if(s>r)for(o=t._first;o&&o._start<=s;){if(o.data==="isPause"&&o._start>r)return o;o=o._next}else for(o=t._last;o&&o._start>=s;){if(o.data==="isPause"&&o._start<r)return o;o=o._prev}},ws=function(t,r,s,o){var i=t._repeat,n=Ae(r)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ae(n*(i+1)+t._rDelay*i):n,a>0&&!o&&Sn(t,t._tTime=t._tDur*a),t.parent&&wn(t),s||qr(t.parent,t),t},iu=function(t){return t instanceof Ye?qr(t):ws(t,t._dur)},sb={_start:0,endTime:ci,totalDuration:ci},Tt=function e(t,r,s){var o=t.labels,i=t._recent||sb,n=t.duration()>=Pt?i.endTime(!1):t._dur,a,h,l;return Ve(r)&&(isNaN(r)||r in o)?(h=r.charAt(0),l=r.substr(-1)==="%",a=r.indexOf("="),h==="<"||h===">"?(a>=0&&(r=r.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(r.substr(1))||0)*(l?(a<0?i:s).totalDuration()/100:1)):a<0?(r in o||(o[r]=n),o[r]):(h=parseFloat(r.charAt(a-1)+r.substr(a+1)),l&&s&&(h=h/100*(Qe(s)?s[0]:s).totalDuration()),a>1?e(t,r.substr(0,a-1),s)+h:n+h)):r==null?n:+r},oi=function(t,r,s){var o=er(r[1]),i=(o?2:1)+(t<2?0:1),n=r[i],a,h;if(o&&(n.duration=r[1]),n.parent=s,t){for(a=n,h=s;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=ct(h.vars.inherit)&&h.parent;n.immediateRender=ct(a.immediateRender),t<2?n.runBackwards=1:n.startAt=r[i-1]}return new Ue(r[0],n,r[i+1])},br=function(t,r){return t||t===0?r(t):r},pi=function(t,r,s){return s<t?t:s>r?r:s},Xe=function(t,r){return!Ve(t)||!(r=q_.exec(t))?"":r[1]},ib=function(t,r,s){return br(s,function(o){return pi(t,r,o)})},Na=[].slice,wu=function(t,r){return t&&Ut(t)&&"length"in t&&(!r&&!t.length||t.length-1 in t&&Ut(t[0]))&&!t.nodeType&&t!==zt},nb=function(t,r,s){return s===void 0&&(s=[]),t.forEach(function(o){var i;return Ve(o)&&!r||wu(o,1)?(i=s).push.apply(i,Dt(o)):s.push(o)})||s},Dt=function(t,r,s){return Re&&!r&&Re.selector?Re.selector(t):Ve(t)&&!s&&(Oa||!Ss())?Na.call((r||Ka).querySelectorAll(t),0):Qe(t)?nb(t,s):wu(t)?Na.call(t,0):t?[t]:[]},za=function(t){return t=Dt(t)[0]||hi("Invalid scope")||{},function(r){var s=t.current||t.nativeElement||t;return Dt(r,s.querySelectorAll?s:s===t?hi("Invalid scope")||Ka.createElement("div"):t)}},Su=function(t){return t.sort(function(){return .5-Math.random()})},ku=function(t){if(Fe(t))return t;var r=Ut(t)?t:{each:t},s=Kr(r.ease),o=r.from||0,i=parseFloat(r.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=r.axis,c=o,p=o;return Ve(o)?c=p={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],p=o[1]),function(v,g,u){var d=(u||r).length,m=n[d],f,_,x,y,w,b,S,T,R;if(!m){if(R=r.grid==="auto"?0:(r.grid||[1,Pt])[1],!R){for(S=-Pt;S<(S=u[R++].getBoundingClientRect().left)&&R<d;);R<d&&R--}for(m=n[d]=[],f=h?Math.min(R,d)*c-.5:o%R,_=R===Pt?0:h?d*p/R-.5:o/R|0,S=0,T=Pt,b=0;b<d;b++)x=b%R-f,y=_-(b/R|0),m[b]=w=l?Math.abs(l==="y"?y:x):hu(x*x+y*y),w>S&&(S=w),w<T&&(T=w);o==="random"&&Su(m),m.max=S-T,m.min=T,m.v=d=(parseFloat(r.amount)||parseFloat(r.each)*(R>d?d-1:l?l==="y"?d/R:R:Math.max(R,d/R))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Xe(r.amount||r.each)||0,s=s&&d<0?_b(s):s}return d=(m[v]-m.min)/m.max||0,Ae(m.b+(s?s(d):d)*m.v)+m.u}},Ha=function(t){var r=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var o=Ae(Math.round(parseFloat(s)/t)*t*r);return(o-o%1)/r+(er(s)?0:Xe(s))}},Cu=function(t,r){var s=Qe(t),o,i;return!s&&Ut(t)&&(o=s=t.radius||Pt,t.values?(t=Dt(t.values),(i=!er(t[0]))&&(o*=o)):t=Ha(t.increment)),br(r,s?Fe(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Pt,c=0,p=t.length,v,g;p--;)i?(v=t[p].x-a,g=t[p].y-h,v=v*v+g*g):v=Math.abs(t[p]-a),v<l&&(l=v,c=p);return c=!o||l<=o?t[c]:n,i||c===n||er(n)?c:c+Xe(n)}:Ha(t))},Eu=function(t,r,s,o){return br(Qe(t)?!r:s===!0?!!(s=0):!o,function(){return Qe(t)?t[~~(Math.random()*t.length)]:(s=s||1e-5)&&(o=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((t-s/2+Math.random()*(r-t+s*.99))/s)*s*o)/o})},ob=function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return function(o){return r.reduce(function(i,n){return n(i)},o)}},ab=function(t,r){return function(s){return t(parseFloat(s))+(r||Xe(s))}},lb=function(t,r,s){return Pu(t,r,0,1,s)},Tu=function(t,r,s){return br(s,function(o){return t[~~r(o)]})},hb=function e(t,r,s){var o=r-t;return Qe(t)?Tu(t,e(0,t.length),r):br(s,function(i){return(o+(i-t)%o)%o+t})},cb=function e(t,r,s){var o=r-t,i=o*2;return Qe(t)?Tu(t,e(0,t.length-1),r):br(s,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},ks=function(t){return t.replace($_,function(r){var s=r.indexOf("[")+1,o=r.substring(s||7,s?r.indexOf("]"):r.length-1).split(V_);return Eu(s?o:+o[0],s?0:+o[1],+o[2]||1e-5)})},Pu=function(t,r,s,o,i){var n=r-t,a=o-s;return br(i,function(h){return s+((h-t)/n*a||0)})},db=function e(t,r,s,o){var i=isNaN(t+r)?0:function(g){return(1-g)*t+g*r};if(!i){var n=Ve(t),a={},h,l,c,p,v;if(s===!0&&(o=1)&&(s=null),n)t={p:t},r={p:r};else if(Qe(t)&&!Qe(r)){for(c=[],p=t.length,v=p-2,l=1;l<p;l++)c.push(e(t[l-1],t[l]));p--,i=function(u){u*=p;var d=Math.min(v,~~u);return c[d](u-d)},s=r}else o||(t=xs(Qe(t)?[]:{},t));if(!c){for(h in r)tl.call(a,t,h,"get",r[h]);i=function(u){return ol(u,a)||(n?t.p:t)}}}return br(s,i)},nu=function(t,r,s){var o=t.labels,i=Pt,n,a,h;for(n in o)a=o[n]-r,a<0==!!s&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},vt=function(t,r,s){var o=t.vars,i=o[r],n=Re,a=t._ctx,h,l,c;if(i)return h=o[r+"Params"],l=o.callbackScope||t,s&&gr.length&&mn(),a&&(Re=a),c=h?i.apply(l,h):i.call(l),Re=n,c},si=function(t){return _r(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Ke),t.progress()<1&&vt(t,"onInterrupt"),t},bs,Du=[],Ru=function(t){if(t)if(t=!t.name&&t.default||t,Va()||t.headless){var r=t.name,s=Fe(t),o=r&&!s&&t.init?function(){this._props=[]}:t,i={init:ci,render:ol,add:tl,kill:Pb,modifier:Tb,rawVars:0},n={targetTest:0,get:0,getSetter:kn,aliases:{},register:0};if(Ss(),t!==o){if(lt[r])return;bt(o,bt(gn(t,i),n)),xs(o.prototype,xs(i,gn(t,n))),lt[o.prop=r]=o,t.targetTest&&(un.push(o),Xa[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}pu(r,o),t.register&&t.register(Ze,o,st)}else Du.push(t)},Ce=255,ii={aqua:[0,Ce,Ce],lime:[0,Ce,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ce],navy:[0,0,128],white:[Ce,Ce,Ce],olive:[128,128,0],yellow:[Ce,Ce,0],orange:[Ce,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ce,0,0],pink:[Ce,192,203],cyan:[0,Ce,Ce],transparent:[Ce,Ce,Ce,0]},Pa=function(t,r,s){return t+=t<0?1:t>1?-1:0,(t*6<1?r+(s-r)*t*6:t<.5?s:t*3<2?r+(s-r)*(2/3-t)*6:r)*Ce+.5|0},Au=function(t,r,s){var o=t?er(t)?[t>>16,t>>8&Ce,t&Ce]:0:ii.black,i,n,a,h,l,c,p,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ii[t])o=ii[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ce,o&Ce,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ce,t&Ce]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(eu),!r)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Pa(h+1/3,i,n),o[1]=Pa(h,i,n),o[2]=Pa(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(Wa),s&&o.length<4&&(o[3]=1),o}else o=t.match(eu)||ii.transparent;o=o.map(Number)}return r&&!u&&(i=o[0]/Ce,n=o[1]/Ce,a=o[2]/Ce,p=Math.max(i,n,a),v=Math.min(i,n,a),c=(p+v)/2,p===v?h=l=0:(g=p-v,l=c>.5?g/(2-p-v):g/(p+v),h=p===i?(n-a)/g+(n<a?6:0):p===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),s&&o.length<4&&(o[3]=1),o},Iu=function(t){var r=[],s=[],o=-1;return t.split(Zt).forEach(function(i){var n=i.match(Jr)||[];r.push.apply(r,n),s.push(o+=n.length+1)}),r.c=s,r},ou=function(t,r,s){var o="",i=(t+o).match(Zt),n=r?"hsla(":"rgba(",a=0,h,l,c,p;if(!i)return t;if(i=i.map(function(v){return(v=Au(v,r,1))&&n+(r?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),s&&(c=Iu(t),h=s.c,h.join(o)!==c.c.join(o)))for(l=t.replace(Zt,"1").split(Jr),p=l.length-1;a<p;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:s).shift());if(!l)for(l=t.split(Zt),p=l.length-1;a<p;a++)o+=l[a]+i[a];return o+l[p]},Zt=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ii)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),ub=/hsl[a]?\(/,Za=function(t){var r=t.join(" "),s;if(Zt.lastIndex=0,Zt.test(r))return s=ub.test(r),t[1]=ou(t[1],s),t[0]=ou(t[0],s,Iu(t[1])),!0},di,ht=(function(){var e=Date.now,t=500,r=33,s=e(),o=s,i=1e3/240,n=i,a=[],h,l,c,p,v,g,u=function d(m){var f=e()-o,_=m===!0,x,y,w,b;if((f>t||f<0)&&(s+=f-r),o+=f,w=o-s,x=w-n,(x>0||_)&&(b=++p.frame,v=w-p.time*1e3,p.time=w=w/1e3,n+=x+(x>=i?4:i-x),y=1),_||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](w,v,b,m)};return p={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){du&&(!Oa&&Va()&&(zt=Oa=window,Ka=zt.document||{},_t.gsap=Ze,(zt.gsapVersions||(zt.gsapVersions=[])).push(Ze.version),uu(fn||zt.GreenSockGlobals||!zt.gsap&&zt||{}),Du.forEach(Ru)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&p.sleep(),l=c||function(m){return setTimeout(m,n-p.time*1e3+1|0)},di=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),di=0,l=ci},lagSmoothing:function(m,f){t=m||1/0,r=Math.min(f||33,t)},fps:function(m){i=1e3/(m||240),n=p.time*1e3+i},add:function(m,f,_){var x=f?function(y,w,b,S){m(y,w,b,S),p.remove(x)}:m;return p.remove(m),a[_?"unshift":"push"](x),Ss(),x},remove:function(m,f){~(f=a.indexOf(m))&&a.splice(f,1)&&g>=f&&g--},_listeners:a},p})(),Ss=function(){return!di&&ht.wake()},we={},pb=/^[\d.\-M][\d.\-,\s]/,fb=/["']/g,mb=function(t){for(var r={},s=t.substr(1,t.length-3).split(":"),o=s[0],i=1,n=s.length,a,h,l;i<n;i++)h=s[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),r[o]=isNaN(l)?l.replace(fb,"").trim():+l,o=h.substr(a+1).trim();return r},gb=function(t){var r=t.indexOf("(")+1,s=t.indexOf(")"),o=t.indexOf("(",r);return t.substring(r,~o&&o<s?t.indexOf(")",s+1):s)},vb=function(t){var r=(t+"").split("("),s=we[r[0]];return s&&r.length>1&&s.config?s.config.apply(null,~t.indexOf("{")?[mb(r[1])]:gb(t).split(",").map(gu)):we._CE&&pb.test(t)?we._CE("",t):s},_b=function(t){return function(r){return 1-t(1-r)}},Kr=function(t,r){return t&&(Fe(t)?t:we[t]||vb(t))||r},Yr=function(t,r,s,o){s===void 0&&(s=function(h){return 1-r(1-h)}),o===void 0&&(o=function(h){return h<.5?r(h*2)/2:1-r((1-h)*2)/2});var i={easeIn:r,easeOut:s,easeInOut:o},n;return rt(t,function(a){we[a]=_t[a]=i,we[n=a.toLowerCase()]=s;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Lu=function(t){return function(r){return r<.5?(1-t(1-r*2))/2:.5+t((r-.5)*2)/2}},Da=function e(t,r,s){var o=r>=1?r:1,i=(s||(t?.3:.45))/(r<1?r:1),n=i/La*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*j_((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Lu(a);return i=La/i,h.config=function(l,c){return e(t,l,c)},h},Ra=function e(t,r){r===void 0&&(r=1.70158);var s=function(n){return n?--n*n*((r+1)*n+r)+1:0},o=t==="out"?s:t==="in"?function(i){return 1-s(1-i)}:Lu(s);return o.config=function(i){return e(t,i)},o};rt("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var r=t<5?t+1:t;Yr(e+",Power"+(r-1),t?function(s){return Math.pow(s,r)}:function(s){return s},function(s){return 1-Math.pow(1-s,r)},function(s){return s<.5?Math.pow(s*2,r)/2:1-Math.pow((1-s)*2,r)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Yr("Elastic",Da("in"),Da("out"),Da());(function(e,t){var r=1/t,s=2*r,o=2.5*r,i=function(a){return a<r?e*a*a:a<s?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Yr("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Yr("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Yr("Circ",function(e){return-(hu(1-e*e)-1)});Yr("Sine",function(e){return e===1?1:-U_(e*z_)+1});Yr("Back",Ra("in"),Ra("out"),Ra());we.SteppedEase=we.steps=_t.SteppedEase={config:function(t,r){t===void 0&&(t=1);var s=1/t,o=t+(r?0:1),i=r?1:0,n=1-Ee;return function(a){return((o*pi(0,n,a)|0)+i)*s}}};li.ease=we["quad.out"];rt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Ja+=e+","+e+"Params,"});var el=function(t,r){this.id=H_++,t._gsap=this,this.target=t,this.harness=r,this.get=r?r.get:Ya,this.set=r?r.getSetter:kn},ui=(function(){function e(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,ws(this,+r.duration,1,1),this.data=r.data,Re&&(this._ctx=Re,Re.data.push(this)),di||ht.wake()}var t=e.prototype;return t.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},t.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,ws(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,o){if(Ss(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Sn(this,s),!i._dp||i.parent||bu(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&Ht(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Ee||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),mu(this,s,o)),this},t.time=function(s,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+su(this))%(this._dur+this._rDelay)||(s?this._dur:0),o):this._time},t.totalProgress=function(s,o){return arguments.length?this.totalTime(this.totalDuration()*s,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(s,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+su(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,o):this._repeat?ys(this._tTime,i)+1:1},t.timeScale=function(s,o){if(!arguments.length)return this._rts===-Ee?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?vn(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ee?0:this._rts,this.totalTime(pi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),wn(this),Q_(this)},t.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ss(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ee&&(this._tTime-=Ee)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=Ae(s);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Ht(o,this,this._start-this._delay),this}return this._start},t.endTime=function(s){return this._start+(ct(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var o=this.parent||this._dp;return o?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?vn(o.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=X_);var o=Ke;return Ke=s,Qa(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Ke=o,this},t.globalTime=function(s){for(var o=this,i=arguments.length?s:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,iu(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var o=this._time;return this._rDelay=s,iu(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,o){return this.totalTime(Tt(this,s),ct(o))},t.restart=function(s,o){return this.play().totalTime(s?-this._delay:0,ct(o)),this._dur||(this._zTime=-Ee),this},t.play=function(s,o){return s!=null&&this.seek(s,o),this.reversed(!1).paused(!1)},t.reverse=function(s,o){return s!=null&&this.seek(s||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(s,o){return s!=null&&this.seek(s,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ee:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ee,this},t.isActive=function(){var s=this.parent||this._dp,o=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=o&&i<this.endTime(!0)-Ee)},t.eventCallback=function(s,o,i){var n=this.vars;return arguments.length>1?(o?(n[s]=o,i&&(n[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=o)):delete n[s],this):n[s]},t.then=function(s){var o=this,i=o._prom;return new Promise(function(n){var a=Fe(s)?s:vu,h=function(){var c=o.then;o.then=null,i&&i(),Fe(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){si(this)},e})();bt(ui.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ee,_prom:0,_ps:!1,_rts:1});var Ye=(function(e){lu(t,e);function t(s,o){var i;return s===void 0&&(s={}),i=e.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=ct(s.sortChildren),Ie&&Ht(s.parent||Ie,Qt(i),o),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&xu(Qt(i),s.scrollTrigger),i}var r=t.prototype;return r.to=function(o,i,n){return oi(0,arguments,this),this},r.from=function(o,i,n){return oi(1,arguments,this),this},r.fromTo=function(o,i,n,a){return oi(2,arguments,this),this},r.set=function(o,i,n){return i.duration=0,i.parent=this,ni(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Tt(this,n),1),this},r.call=function(o,i,n){return Ht(this,Ue.delayedCall(0,o,i),n)},r.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Tt(this,h)),this},r.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,ni(n).immediateRender=ct(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},r.staggerFromTo=function(o,i,n,a,h,l,c,p){return a.startAt=n,ni(a).immediateRender=ct(a.immediateRender),this.staggerTo(o,i,a,h,l,c,p)},r.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ae(o),p=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,f,_,x,y,w,b,S;if(this!==Ie&&c>h&&o>=0&&(c=h),c!==this._tTime||n||p){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,f=!x,p&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(b=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ae(c%m),c===h?(d=this._repeat,v=l):(w=Ae(c/m),d=~~w,d&&d===w&&(v=l,d--),v>l&&(v=l)),w=ys(this._tTime,m),!a&&this._tTime&&w!==d&&this._tTime-w*m-this._dur<=0&&(w=d),b&&d&1&&(v=l-v,S=1),d!==w&&!this._lock){var T=b&&w&1,R=T===(b&&d&1);if(d<w&&(T=!T),a=T?0:c%l?l:c,this._lock=1,this.render(a||(S?0:Ae(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&vt(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1,w=d),a&&a!==this._time||f!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,R&&(this._lock=2,a=T?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!f)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=rb(this,Ae(a),Ae(v)),_&&(c-=v-(v=_._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!w&&(vt(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&_!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!f){_=0,u&&(c+=this._zTime=-Ee);break}}g=u}else{g=this._last;for(var E=o<0?o:v;g;){if(u=g._prev,(g._act||E<=g._end)&&g._ts&&_!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(E-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(E-g._start)*g._ts,i,n||Ke&&Qa(g)),v!==this._time||!this._ts&&!f){_=0,u&&(c+=this._zTime=E?-Ee:Ee);break}}g=u}}if(_&&!i&&(this.pause(),_.render(v>=a?0:-Ee)._zTime=v>=a?1:-1,this._ts))return this._start=y,wn(this),this.render(o,i,n);this._onUpdate&&!i&&vt(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&_r(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(vt(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(o,i){var n=this;if(er(i)||(i=Tt(this,i,o)),!(o instanceof ui)){if(Qe(o))return o.forEach(function(a){return n.add(a,i)}),this;if(Ve(o))return this.addLabel(o,i);if(Fe(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Ht(this,o,i):this},r.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Pt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},r.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},r.remove=function(o){return Ve(o)?this.removeLabel(o):Fe(o)?this.killTweensOf(o):(o.parent===this&&yn(this,o),o===this._recent&&(this._recent=this._last),qr(this))},r.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ae(ht.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},r.addLabel=function(o,i){return this.labels[o]=Tt(this,i),this},r.removeLabel=function(o){return delete this.labels[o],this},r.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||ci,n);return a.data="isPause",this._hasPause=1,Ht(this,a,Tt(this,o))},r.removePause=function(o){var i=this._first;for(o=Tt(this,o);i;)i._start===o&&i.data==="isPause"&&_r(i),i=i._next},r.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)mr!==a[h]&&a[h].kill(o,i);return this},r.getTweensOf=function(o,i){for(var n=[],a=Dt(o),h=this._first,l=er(i),c;h;)h instanceof Ue?J_(h._targets,a)&&(l?(!mr||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},r.tweenTo=function(o,i){i=i||{};var n=this,a=Tt(n,o),h=i,l=h.startAt,c=h.onStart,p=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,bt({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Ee,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&ws(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,p||[])}},i));return v?u.render(0):u},r.tweenFromTo=function(o,i,n){return this.tweenTo(i,bt({startAt:{time:Tt(this,o)}},n))},r.recent=function(){return this._recent},r.nextLabel=function(o){return o===void 0&&(o=this._time),nu(this,Tt(this,o))},r.previousLabel=function(o){return o===void 0&&(o=this._time),nu(this,Tt(this,o),1)},r.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Ee)},r.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ae(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return qr(this)},r.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},r.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),qr(this)},r.totalDuration=function(o){var i=0,n=this,a=n._last,h=Pt,l,c,p;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(p=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Ht(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!p&&!n._dp||p&&p.smoothChildTiming)&&(n._start+=Ae(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;ws(n,n===Ie&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Ie._ts&&(mu(Ie,vn(o,Ie)),fu=ht.frame),ht.frame>=tu){tu+=dt.autoSleep||120;var i=Ie._first;if((!i||!i._ts)&&dt.autoSleep&&ht._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ht.sleep()}}},t})(ui);bt(Ye.prototype,{_lock:0,_hasPause:0,_forcing:0});var bb=function(t,r,s,o,i,n,a){var h=new st(this._pt,t,r,0,1,nl,null,i),l=0,c=0,p,v,g,u,d,m,f,_;for(h.b=s,h.e=o,s+="",o+="",(f=~o.indexOf("random("))&&(o=ks(o)),n&&(_=[s,o],n(_,t,r),s=_[0],o=_[1]),v=s.match(Ea)||[];p=Ea.exec(o);)u=p[0],d=o.substring(l,p.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Gr(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ea.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(qa.test(o)||f)&&(h.e=0),this._pt=h,h},tl=function(t,r,s,o,i,n,a,h,l,c){Fe(o)&&(o=o(i||0,t,n));var p=t[r],v=s!=="get"?s:Fe(p)?l?t[r.indexOf("set")||!Fe(t["get"+r.substr(3)])?r:"get"+r.substr(3)](l):t[r]():p,g=Fe(p)?l?kb:Bu:il,u;if(Ve(o)&&(~o.indexOf("random(")&&(o=ks(o)),o.charAt(1)==="="&&(u=Gr(v,o)+(Xe(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ua)return!isNaN(v*o)&&o!==""?(u=new st(this._pt,t,r,+v||0,o-(v||0),typeof p=="boolean"?Eb:Fu,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!p&&!(r in t)&&xn(r,o),bb.call(this,t,r,v,o,g,h||dt.stringFilter,l))},xb=function(t,r,s,o,i){if(Fe(t)&&(t=ai(t,i,r,s,o)),!Ut(t)||t.style&&t.nodeType||Qe(t)||cu(t))return Ve(t)?ai(t,i,r,s,o):t;var n={},a;for(a in t)n[a]=ai(t[a],i,r,s,o);return n},rl=function(t,r,s,o,i,n){var a,h,l,c;if(lt[t]&&(a=new lt[t]).init(i,a.rawVars?r[t]:xb(r[t],o,i,n,s),s,o,n)!==!1&&(s._pt=h=new st(s._pt,i,t,0,1,a.render,a,0,a.priority),s!==bs))for(l=s._ptLookup[s._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},mr,Ua,sl=function e(t,r,s){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,p=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,f=t.parent,_=f&&f.data==="nested"?f.vars.targets:m,x=t._overwrite==="auto"&&!$a,y=t.timeline,w=o.easeReverse||p,b,S,T,R,E,A,B,M,H,z,j,C,D;if(y&&(!v||!i)&&(i="none"),t._ease=Kr(i,li.ease),t._rEase=w&&(Kr(w)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(M=m[0]?vr(m[0]).harness:0,C=M&&o[M.prop],b=gn(o,Xa),d&&(d._zTime<0&&d.progress(1),r<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?dn:K_),d._lazy=0),n){if(_r(t._startAt=Ue.set(m,bt({data:"isStart",overwrite:!1,parent:f,immediateRender:!0,lazy:!d&&ct(h),startAt:null,delay:0,onUpdate:l&&function(){return vt(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ke||!a&&!g)&&t._startAt.revert(dn),a&&u&&r<=0&&s<=0){r&&(t._zTime=r);return}}else if(c&&u&&!d){if(r&&(a=!1),T=bt({overwrite:!1,data:"isFromStart",lazy:a&&!d&&ct(h),immediateRender:a,stagger:0,parent:f},b),C&&(T[M.prop]=C),_r(t._startAt=Ue.set(m,T)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ke?t._startAt.revert(dn):t._startAt.render(-1,!0)),t._zTime=r,!a)e(t._startAt,Ee,Ee);else if(!r)return}for(t._pt=t._ptCache=0,h=u&&ct(h)||h&&!u,S=0;S<m.length;S++){if(E=m[S],B=E._gsap||Ga(m)[S]._gsap,t._ptLookup[S]=z={},Ma[B.id]&&gr.length&&mn(),j=_===m?S:_.indexOf(E),M&&(H=new M).init(E,C||b,t,j,_)!==!1&&(t._pt=R=new st(t._pt,E,H.name,0,1,H.render,H,0,H.priority),H._props.forEach(function(L){z[L]=R}),H.priority&&(A=1)),!M||C)for(T in b)lt[T]&&(H=rl(T,b,t,j,E,_))?H.priority&&(A=1):z[T]=R=tl.call(t,E,T,"get",b[T],j,_,0,o.stringFilter);t._op&&t._op[S]&&t.kill(E,t._op[S]),x&&t._pt&&(mr=t,Ie.killTweensOf(E,z,t.globalTime(r)),D=!t.parent,mr=0),t._pt&&h&&(Ma[B.id]=1)}A&&al(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!D,v&&r<=0&&y.render(Pt,!0,!0)},yb=function(t,r,s,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[r],c,p,v,g;if(!l)for(l=t._ptCache[r]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return Ua=1,t.vars[r]="+=0",sl(t,a),Ua=0,h?hi(r+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)p=l[g],c=p._pt||p,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=s-c.s,p.e&&(p.e=Ne(s)+Xe(p.e)),p.b&&(p.b=c.s+Xe(p.b))},wb=function(t,r){var s=t[0]?vr(t[0]).harness:0,o=s&&s.aliases,i,n,a,h;if(!o)return r;i=xs({},r);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},Sb=function(t,r,s,o){var i=r.ease||o||"power1.inOut",n,a;if(Qe(r))a=s[t]||(s[t]=[]),r.forEach(function(h,l){return a.push({t:l/(r.length-1)*100,v:h,e:i})});else for(n in r)a=s[n]||(s[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:r[n],e:i})},ai=function(t,r,s,o,i){return Fe(t)?t.call(r,s,o,i):Ve(t)&&~t.indexOf("random(")?ks(t):t},Ou=Ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Mu={};rt(Ou+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Mu[e]=1});var Ue=(function(e){lu(t,e);function t(s,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:ni(o))||this;var h=a.vars,l=h.duration,c=h.delay,p=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,f=o.parent||Ie,_=(Qe(s)||cu(s)?er(s[0]):"length"in o)?[s]:Dt(s),x,y,w,b,S,T,R,E;if(a._targets=_.length?Ga(_):hi("GSAP target "+s+" not found. https://gsap.com",!dt.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||cn(l)||cn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new Ye({data:"nested",defaults:d||{},targets:f&&f.data==="nested"?f.vars.targets:_}),x.kill(),x.parent=x._dp=Qt(a),x._start=0,v||cn(l)||cn(c)){if(b=_.length,R=v&&ku(v),Ut(v))for(S in v)~Ou.indexOf(S)&&(E||(E={}),E[S]=v[S]);for(y=0;y<b;y++)w=gn(o,Mu),w.stagger=0,A&&(w.easeReverse=A),E&&xs(w,E),T=_[y],w.duration=+ai(l,Qt(a),y,T,_),w.delay=(+ai(c,Qt(a),y,T,_)||0)-a._delay,!v&&b===1&&w.delay&&(a._delay=c=w.delay,a._start+=c,w.delay=0),x.to(T,w,R?R(y,T,_):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){ni(bt(x.vars.defaults,{ease:"none"})),x._ease=Kr(u.ease||o.ease||"none");var B=0,M,H,z;if(Qe(u))u.forEach(function(j){return x.to(_,j,">")}),x.duration();else{w={};for(S in u)S==="ease"||S==="easeEach"||Sb(S,u[S],w,u.easeEach);for(S in w)for(M=w[S].sort(function(j,C){return j.t-C.t}),B=0,y=0;y<M.length;y++)H=M[y],z={ease:H.e,duration:(H.t-(y?M[y-1].t:0))/100*l},z[S]=H.v,x.to(_,z,B),B+=z.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!$a&&(mr=Qt(a),Ie.killTweensOf(_),mr=0),Ht(f,Qt(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(p||!l&&!u&&a._start===Ae(f._time)&&ct(p)&&Z_(Qt(a))&&f.data!=="nested")&&(a._tTime=-Ee,a.render(Math.max(0,-c)||0)),m&&xu(Qt(a),m),a}var r=t.prototype;return r.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,p=o>h-Ee&&!c?h:o<Ee?0:o,v,g,u,d,m,f,_,x;if(!l)tb(this,o,i,n);else if(p!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=p,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ae(p%d),p===h?(u=this._repeat,v=l):(m=Ae(p/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),f=this._yoyo&&u&1,f&&(v=l-v),m=ys(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=p,this;u!==m&&this.vars.repeatRefresh&&!f&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ae(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(yu(this,c?o:v,n,i,p))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var w=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=w?(y?-1:1)/w:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=_=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=_=this._ease(v/l);if(this._from&&(this.ratio=_=1-_),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&p&&!i&&!m&&(vt(this,"onStart"),this._tTime!==p))return this;for(g=this._pt;g;)g.r(_,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Ba(this,o,i,n),vt(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&vt(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(c&&!this._onUpdate&&Ba(this,o,!0,!0),(o||!l)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&_r(this,1),!i&&!(c&&!a)&&(p||a||f)&&(vt(this,p===h?"onComplete":"onReverseComplete",!0),this._prom&&!(p<h&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},r.resetTo=function(o,i,n,a,h){di||ht.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||sl(this,l),c=this._ease(l/this._dur),yb(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(Sn(this,0),this.parent||_u(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?si(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ke),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,mr&&mr.vars.overwrite!==!0)._first||si(this),this.parent&&n!==this.timeline.totalDuration()&&ws(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?Dt(o):a,l=this._ptLookup,c=this._pt,p,v,g,u,d,m,f;if((!i||i==="all")&&Y_(a,h))return i==="all"&&(this._pt=0),si(this);for(p=this._op=this._op||[],i!=="all"&&(Ve(i)&&(d={},rt(i,function(_){return d[_]=1}),i=d),i=wb(a,i)),f=a.length;f--;)if(~h.indexOf(a[f])){v=l[f],i==="all"?(p[f]=i,u=v,g={}):(g=p[f]=p[f]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&yn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&si(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return oi(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return oi(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Ie.killTweensOf(o,i,n)},t})(ui);bt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});rt("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new Ye,r=Na.call(arguments,0);return r.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,r)}});var il=function(t,r,s){return t[r]=s},Bu=function(t,r,s){return t[r](s)},kb=function(t,r,s,o){return t[r](o.fp,s)},Cb=function(t,r,s){return t.setAttribute(r,s)},kn=function(t,r){return Fe(t[r])?Bu:bn(t[r])&&t.setAttribute?Cb:il},Fu=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e6)/1e6,r)},Eb=function(t,r){return r.set(r.t,r.p,!!(r.s+r.c*t),r)},nl=function(t,r){var s=r._pt,o="";if(!t&&r.b)o=r.b;else if(t===1&&r.e)o=r.e;else{for(;s;)o=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+o,s=s._next;o+=r.c}r.set(r.t,r.p,o,r)},ol=function(t,r){for(var s=r._pt;s;)s.r(t,s.d),s=s._next},Tb=function(t,r,s,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,r,s),i=n},Pb=function(t){for(var r=this._pt,s,o;r;)o=r._next,r.p===t&&!r.op||r.op===t?yn(this,r,"_pt"):r.dep||(s=1),r=o;return!s},Db=function(t,r,s,o){o.mSet(t,r,o.m.call(o.tween,s,o.mt),o)},al=function(t){for(var r=t._pt,s,o,i,n;r;){for(s=r._next,o=i;o&&o.pr>r.pr;)o=o._next;(r._prev=o?o._prev:n)?r._prev._next=r:i=r,(r._next=o)?o._prev=r:n=r,r=s}t._pt=i},st=(function(){function e(r,s,o,i,n,a,h,l,c){this.t=s,this.s=i,this.c=n,this.p=o,this.r=a||Fu,this.d=h||this,this.set=l||il,this.pr=c||0,this._next=r,r&&(r._prev=this)}var t=e.prototype;return t.modifier=function(s,o,i){this.mSet=this.mSet||this.set,this.set=Db,this.m=s,this.mt=i,this.tween=o},e})();rt(Ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Xa[e]=1});_t.TweenMax=_t.TweenLite=Ue;_t.TimelineLite=_t.TimelineMax=Ye;Ie=new Ye({sortChildren:!1,defaults:li,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});dt.stringFilter=Za;var Xr=[],pn={},Rb=[],au=0,Ab=0,Aa=function(t){return(pn[t]||Rb).map(function(r){return r()})},ja=function(){var t=Date.now(),r=[];t-au>2&&(Aa("matchMediaInit"),Xr.forEach(function(s){var o=s.queries,i=s.conditions,n,a,h,l;for(a in o)n=zt.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(s.revert(),h&&r.push(s))}),Aa("matchMediaRevert"),r.forEach(function(s){return s.onMatch(s,function(o){return s.add(null,o)})}),au=t,Aa("matchMedia"))},Nu=(function(){function e(r,s){this.selector=s&&za(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Ab++,r&&this.add(r)}var t=e.prototype;return t.add=function(s,o,i){Fe(s)&&(i=o,o=s,s=Fe);var n=this,a=function(){var l=Re,c=n.selector,p;return l&&l!==n&&l.data.push(n),i&&(n.selector=za(i)),Re=n,p=o.apply(n,arguments),Fe(p)&&n._r.push(p),Re=l,n.selector=c,n.isReverted=!1,p};return n.last=a,s===Fe?a(n,function(h){return n.add(null,h)}):s?n[s]=a:a},t.ignore=function(s){var o=Re;Re=null,s(this),Re=o},t.getTweens=function(){var s=[];return this.data.forEach(function(o){return o instanceof e?s.push.apply(s,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&s.push(o)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,o){var i=this;if(s?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,p){return p.g-c.g||-1/0}).forEach(function(c){return c.t.revert(s)}),h=i.data.length;h--;)l=i.data[h],l instanceof Ye?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(s);i._r.forEach(function(c){return c(s,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Xr.length;n--;)Xr[n].id===this.id&&Xr.splice(n,1)},t.revert=function(s){this.kill(s||{})},e})(),Ib=(function(){function e(r){this.contexts=[],this.scope=r,Re&&Re.data.push(this)}var t=e.prototype;return t.add=function(s,o,i){Ut(s)||(s={matches:s});var n=new Nu(0,i||this.scope),a=n.conditions={},h,l,c;Re&&!n.selector&&(n.selector=Re.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=s;for(l in s)l==="all"?c=1:(h=zt.matchMedia(s[l]),h&&(Xr.indexOf(n)<0&&Xr.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(ja):h.addEventListener("change",ja)));return c&&o(n,function(p){return n.add(null,p)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(o){return o.kill(s,!0)})},e})(),_n={registerPlugin:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];r.forEach(function(o){return Ru(o)})},timeline:function(t){return new Ye(t)},getTweensOf:function(t,r){return Ie.getTweensOf(t,r)},getProperty:function(t,r,s,o){Ve(t)&&(t=Dt(t)[0]);var i=vr(t||{}).get,n=s?vu:gu;return s==="native"&&(s=""),t&&(r?n((lt[r]&<[r].get||i)(t,r,s,o)):function(a,h,l){return n((lt[a]&<[a].get||i)(t,a,h,l))})},quickSetter:function(t,r,s){if(t=Dt(t),t.length>1){var o=t.map(function(c){return Ze.quickSetter(c,r,s)}),i=o.length;return function(c){for(var p=i;p--;)o[p](c)}}t=t[0]||{};var n=lt[r],a=vr(t),h=a.harness&&(a.harness.aliases||{})[r]||r,l=n?function(c){var p=new n;bs._pt=0,p.init(t,s?c+s:c,bs,0,[t]),p.render(1,p),bs._pt&&ol(1,bs)}:a.set(t,h);return n?l:function(c){return l(t,h,s?c+s:c,a,1)}},quickTo:function(t,r,s){var o,i=Ze.to(t,bt((o={},o[r]="+=0.1",o.paused=!0,o.stagger=0,o),s||{})),n=function(h,l,c){return i.resetTo(r,h,l,c)};return n.tween=i,n},isTweening:function(t){return Ie.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Kr(t.ease,li.ease)),ru(li,t||{})},config:function(t){return ru(dt,t||{})},registerEffect:function(t){var r=t.name,s=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!lt[a]&&!_t[a]&&hi(r+" effect requires "+a+" plugin.")}),Ta[r]=function(a,h,l){return s(Dt(a),bt(h||{},i),l)},n&&(Ye.prototype[r]=function(a,h,l){return this.add(Ta[r](a,Ut(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,r){we[t]=Kr(r)},parseEase:function(t,r){return arguments.length?Kr(t,r):we},getById:function(t){return Ie.getById(t)},exportRoot:function(t,r){t===void 0&&(t={});var s=new Ye(t),o,i;for(s.smoothChildTiming=ct(t.smoothChildTiming),Ie.remove(s),s._dp=0,s._time=s._tTime=Ie._time,o=Ie._first;o;)i=o._next,(r||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Ht(s,o,o._start-o._delay),o=i;return Ht(Ie,s,0),s},context:function(t,r){return t?new Nu(t,r):Re},matchMedia:function(t){return new Ib(t)},matchMediaRefresh:function(){return Xr.forEach(function(t){var r=t.conditions,s,o;for(o in r)r[o]&&(r[o]=!1,s=1);s&&t.revert()})||ja()},addEventListener:function(t,r){var s=pn[t]||(pn[t]=[]);~s.indexOf(r)||s.push(r)},removeEventListener:function(t,r){var s=pn[t],o=s&&s.indexOf(r);o>=0&&s.splice(o,1)},utils:{wrap:hb,wrapYoyo:cb,distribute:ku,random:Eu,snap:Cu,normalize:lb,getUnit:Xe,clamp:ib,splitColor:Au,toArray:Dt,selector:za,mapRange:Pu,pipe:ob,unitize:ab,interpolate:db,shuffle:Su},install:uu,effects:Ta,ticker:ht,updateRoot:Ye.updateRoot,plugins:lt,globalTimeline:Ie,core:{PropTween:st,globals:pu,Tween:Ue,Timeline:Ye,Animation:ui,getCache:vr,_removeLinkedListItem:yn,reverting:function(){return Ke},context:function(t){return t&&Re&&(Re.data.push(t),t._ctx=Re),Re},suppressOverwrites:function(t){return $a=t}}};rt("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return _n[e]=Ue[e]});ht.add(Ye.updateRoot);bs=_n.to({},{duration:0});var Lb=function(t,r){for(var s=t._pt;s&&s.p!==r&&s.op!==r&&s.fp!==r;)s=s._next;return s},Ob=function(t,r){var s=t._targets,o,i,n;for(o in r)for(i=s.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=Lb(n,o)),n&&n.modifier&&n.modifier(r[o],t,s[i],o))},Ia=function(t,r){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(Ve(i)&&(h={},rt(i,function(c){return h[c]=1}),i=h),r){h={};for(l in i)h[l]=r(i[l]);i=h}Ob(a,i)}}}},Ze=_n.registerPlugin({name:"attr",init:function(t,r,s,o,i){var n,a,h;this.tween=s;for(n in r)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",r[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,r){for(var s=r._pt;s;)Ke?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",headless:1,init:function(t,r){for(var s=r.length;s--;)this.add(t,s,t[s]||0,r[s],0,0,0,0,0,1)}},Ia("roundProps",Ha),Ia("modifiers"),Ia("snap",Cu))||_n;Ue.version=Ye.version=Ze.version="3.15.0";du=1;Va()&&Ss();var Mb=we.Power0,Bb=we.Power1,Fb=we.Power2,Nb=we.Power3,zb=we.Power4,Hb=we.Linear,Ub=we.Quad,jb=we.Cubic,$b=we.Quart,Vb=we.Quint,Wb=we.Strong,qb=we.Elastic,Kb=we.Back,Xb=we.SteppedEase,Jb=we.Bounce,Gb=we.Sine,Yb=we.Expo,Qb=we.Circ;var zu,xr,Es,pl,ts,Zb,Hu,fl,e0=function(){return typeof window<"u"},rr={},es=180/Math.PI,Ts=Math.PI/180,Cs=Math.atan2,Uu=1e8,ml=/([A-Z])/g,t0=/(left|right|width|margin|padding|x)/i,r0=/[\s,\(]\S/,jt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},hl=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},s0=function(t,r){return r.set(r.t,r.p,t===1?r.e:Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},i0=function(t,r){return r.set(r.t,r.p,t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},n0=function(t,r){return r.set(r.t,r.p,t===1?r.e:t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},o0=function(t,r){var s=r.s+r.c*t;r.set(r.t,r.p,~~(s+(s<0?-.5:.5))+r.u,r)},Ju=function(t,r){return r.set(r.t,r.p,t?r.e:r.b,r)},Gu=function(t,r){return r.set(r.t,r.p,t!==1?r.b:r.e,r)},a0=function(t,r,s){return t.style[r]=s},l0=function(t,r,s){return t.style.setProperty(r,s)},h0=function(t,r,s){return t._gsap[r]=s},c0=function(t,r,s){return t._gsap.scaleX=t._gsap.scaleY=s},d0=function(t,r,s,o,i){var n=t._gsap;n.scaleX=n.scaleY=s,n.renderTransform(i,n)},u0=function(t,r,s,o,i){var n=t._gsap;n[r]=s,n.renderTransform(i,n)},Le="transform",ut=Le+"Origin",p0=function e(t,r){var s=this,o=this.target,i=o.style,n=o._gsap;if(t in rr&&i){if(this.tfm=this.tfm||{},t!=="transform")t=jt[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=tr(o,a)}):this.tfm[t]=n.x?n[t]:tr(o,t),t===ut&&(this.tfm.zOrigin=n.zOrigin);else return jt.transform.split(",").forEach(function(a){return e.call(s,a,r)});if(this.props.indexOf(Le)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(ut,r,"")),t=Le}(i||r)&&this.props.push(t,r,i[t])},Yu=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},f0=function(){var t=this.props,r=this.target,s=r.style,o=r._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?r[t[i]](t[i+2]):r[t[i]]=t[i+2]:t[i+2]?s[t[i]]=t[i+2]:s.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(ml,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),i=fl(),(!i||!i.isStart)&&!s[Le]&&(Yu(s),o.zOrigin&&s[ut]&&(s[ut]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},Qu=function(t,r){var s={target:t,props:[],revert:f0,save:p0};return t._gsap||Ze.core.getCache(t),r&&t.style&&t.nodeType&&r.split(",").forEach(function(o){return s.save(o)}),s},Zu,cl=function(t,r){var s=xr.createElementNS?xr.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):xr.createElement(t);return s&&s.style?s:xr.createElement(t)},xt=function e(t,r,s){var o=getComputedStyle(t);return o[r]||o.getPropertyValue(r.replace(ml,"-$1").toLowerCase())||o.getPropertyValue(r)||!s&&e(t,Ps(r)||r,1)||""},ju="O,Moz,ms,Ms,Webkit".split(","),Ps=function(t,r,s){var o=r||ts,i=o.style,n=5;if(t in i&&!s)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(ju[n]+t in i););return n<0?null:(n===3?"ms":n>=0?ju[n]:"")+t},dl=function(){e0()&&window.document&&(zu=window,xr=zu.document,Es=xr.documentElement,ts=cl("div")||{style:{}},Zb=cl("div"),Le=Ps(Le),ut=Le+"Origin",ts.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Zu=!!Ps("perspective"),fl=Ze.core.reverting,pl=1)},$u=function(t){var r=t.ownerSVGElement,s=cl("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",s.appendChild(o),Es.appendChild(s);try{i=o.getBBox()}catch{}return s.removeChild(o),Es.removeChild(s),i},Vu=function(t,r){for(var s=r.length;s--;)if(t.hasAttribute(r[s]))return t.getAttribute(r[s])},ep=function(t){var r,s;try{r=t.getBBox()}catch{r=$u(t),s=1}return r&&(r.width||r.height)||s||(r=$u(t)),r&&!r.width&&!r.x&&!r.y?{x:+Vu(t,["x","cx","x1"])||0,y:+Vu(t,["y","cy","y1"])||0,width:0,height:0}:r},tp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ep(t))},wr=function(t,r){if(r){var s=t.style,o;r in rr&&r!==ut&&(r=Le),s.removeProperty?(o=r.substr(0,2),(o==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),s.removeProperty(o==="--"?r:r.replace(ml,"-$1").toLowerCase())):s.removeAttribute(r)}},yr=function(t,r,s,o,i,n){var a=new st(t._pt,r,s,0,1,n?Gu:Ju);return t._pt=a,a.b=o,a.e=i,t._props.push(s),a},Wu={deg:1,rad:1,turn:1},m0={grid:1,flex:1},Sr=function e(t,r,s,o){var i=parseFloat(s)||0,n=(s+"").trim().substr((i+"").length)||"px",a=ts.style,h=t0.test(r),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),p=100,v=o==="px",g=o==="%",u,d,m,f;if(o===n||!i||Wu[o]||Wu[n])return i;if(n!=="px"&&!v&&(i=e(t,r,s,"px")),f=t.getCTM&&tp(t),(g||n==="%")&&(rr[r]||~r.indexOf("adius")))return u=f?t.getBBox()[h?"width":"height"]:t[c],Ne(g?i/u*p:i/100*u);if(a[h?"width":"height"]=p+(v?n:o),d=o!=="rem"&&~r.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,f&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===xr||!d.appendChild)&&(d=xr.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ht.time&&!m.uncache)return Ne(i/m.width*p);if(g&&(r==="height"||r==="width")){var _=t.style[r];t.style[r]=p+o,u=t[c],_?t.style[r]=_:wr(t,r)}else(g||n==="%")&&!m0[xt(d,"display")]&&(a.position=xt(t,"position")),d===t&&(a.position="static"),d.appendChild(ts),u=ts[c],d.removeChild(ts),a.position="absolute";return h&&g&&(m=vr(d),m.time=ht.time,m.width=d[c]),Ne(v?u*i/p:u&&i?p/u*i:0)},tr=function(t,r,s,o){var i;return pl||dl(),r in jt&&r!=="transform"&&(r=jt[r],~r.indexOf(",")&&(r=r.split(",")[0])),rr[r]&&r!=="transform"?(i=gi(t,o),i=r!=="transformOrigin"?i[r]:i.svg?i.origin:En(xt(t,ut))+" "+i.zOrigin+"px"):(i=t.style[r],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=Cn[r]&&Cn[r](t,r,s)||xt(t,r)||Ya(t,r)||(r==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?Sr(t,r,i,s)+s:i},g0=function(t,r,s,o){if(!s||s==="none"){var i=Ps(r,t,1),n=i&&xt(t,i,1);n&&n!==s?(r=i,s=n):r==="borderColor"&&(s=xt(t,"borderTopColor"))}var a=new st(this._pt,t.style,r,0,1,nl),h=0,l=0,c,p,v,g,u,d,m,f,_,x,y,w;if(a.b=s,a.e=o,s+="",o+="",o.substring(0,6)==="var(--"&&(o=xt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[r],t.style[r]=o,o=xt(t,r)||o,d?t.style[r]=d:wr(t,r)),c=[s,o],Za(c),s=c[0],o=c[1],v=s.match(Jr)||[],w=o.match(Jr)||[],w.length){for(;p=Jr.exec(o);)m=p[0],_=o.substring(h,p.index),u?u=(u+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Gr(g,m)+y),f=parseFloat(m),x=m.substr((f+"").length),h=Jr.lastIndex-x.length,x||(x=x||dt.units[r]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Sr(t,r,d,x)||0),a._pt={_next:a._pt,p:_||l===1?_:",",s:g,c:f-g,m:u&&u<4||r==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=r==="display"&&o==="none"?Gu:Ju;return qa.test(o)&&(a.e=0),this._pt=a,a},qu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},v0=function(t){var r=t.split(" "),s=r[0],o=r[1]||"50%";return(s==="top"||s==="bottom"||o==="left"||o==="right")&&(t=s,s=o,o=t),r[0]=qu[s]||s,r[1]=qu[o]||o,r.join(" ")},_0=function(t,r){if(r.tween&&r.tween._time===r.tween._dur){var s=r.t,o=s.style,i=r.u,n=s._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],rr[a]&&(h=1,a=a==="transformOrigin"?ut:Le),wr(s,a);h&&(wr(s,Le),n&&(n.svg&&s.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",gi(s,1),n.uncache=1,Yu(o)))}},Cn={clearProps:function(t,r,s,o,i){if(i.data!=="isFromStart"){var n=t._pt=new st(t._pt,r,s,0,0,_0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(s),1}}},mi=[1,0,0,1,0,0],rp={},sp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Ku=function(t){var r=xt(t,Le);return sp(r)?mi:r.substr(7).match(Wa).map(Ne)},gl=function(t,r){var s=t._gsap||vr(t),o=t.style,i=Ku(t),n,a,h,l;return s.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?mi:i):(i===mi&&!t.offsetParent&&t!==Es&&!s.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Es.appendChild(t)),i=Ku(t),h?o.display=h:wr(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Es.removeChild(t))),r&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},ul=function(t,r,s,o,i,n){var a=t._gsap,h=i||gl(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,p=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],f=h[4],_=h[5],x=r.split(" "),y=parseFloat(x[0])||0,w=parseFloat(x[1])||0,b,S,T,R;s?h!==mi&&(S=g*m-u*d)&&(T=y*(m/S)+w*(-d/S)+(d*_-m*f)/S,R=y*(-u/S)+w*(g/S)-(g*_-u*f)/S,y=T,w=R):(b=ep(t),y=b.x+(~x[0].indexOf("%")?y/100*b.width:y),w=b.y+(~(x[1]||x[0]).indexOf("%")?w/100*b.height:w)),o||o!==!1&&a.smooth?(f=y-l,_=w-c,a.xOffset=p+(f*g+_*d)-f,a.yOffset=v+(f*u+_*m)-_):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=w,a.smooth=!!o,a.origin=r,a.originIsAbsolute=!!s,t.style[ut]="0px 0px",n&&(yr(n,a,"xOrigin",l,y),yr(n,a,"yOrigin",c,w),yr(n,a,"xOffset",p,a.xOffset),yr(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+w)},gi=function(t,r){var s=t._gsap||new el(t);if("x"in s&&!r&&!s.uncache)return s;var o=t.style,i=s.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=xt(t,ut)||"0",c,p,v,g,u,d,m,f,_,x,y,w,b,S,T,R,E,A,B,M,H,z,j,C,D,L,k,U,J,O,ee,N;return c=p=v=d=m=f=_=x=y=0,g=u=1,s.svg=!!(t.getCTM&&tp(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Le]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Le]!=="none"?h[Le]:"")),o.scale=o.rotate=o.translate="none"),S=gl(t,s.svg),s.svg&&(s.uncache?(D=t.getBBox(),l=s.xOrigin-D.x+"px "+(s.yOrigin-D.y)+"px",C=""):C=!r&&t.getAttribute("data-svg-origin"),ul(t,C||l,!!C||s.originIsAbsolute,s.smooth!==!1,S)),w=s.xOrigin||0,b=s.yOrigin||0,S!==mi&&(A=S[0],B=S[1],M=S[2],H=S[3],c=z=S[4],p=j=S[5],S.length===6?(g=Math.sqrt(A*A+B*B),u=Math.sqrt(H*H+M*M),d=A||B?Cs(B,A)*es:0,_=M||H?Cs(M,H)*es+d:0,_&&(u*=Math.abs(Math.cos(_*Ts))),s.svg&&(c-=w-(w*A+b*M),p-=b-(w*B+b*H))):(N=S[6],O=S[7],k=S[8],U=S[9],J=S[10],ee=S[11],c=S[12],p=S[13],v=S[14],T=Cs(N,J),m=T*es,T&&(R=Math.cos(-T),E=Math.sin(-T),C=z*R+k*E,D=j*R+U*E,L=N*R+J*E,k=z*-E+k*R,U=j*-E+U*R,J=N*-E+J*R,ee=O*-E+ee*R,z=C,j=D,N=L),T=Cs(-M,J),f=T*es,T&&(R=Math.cos(-T),E=Math.sin(-T),C=A*R-k*E,D=B*R-U*E,L=M*R-J*E,ee=H*E+ee*R,A=C,B=D,M=L),T=Cs(B,A),d=T*es,T&&(R=Math.cos(T),E=Math.sin(T),C=A*R+B*E,D=z*R+j*E,B=B*R-A*E,j=j*R-z*E,A=C,z=D),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,f=180-f),g=Ne(Math.sqrt(A*A+B*B+M*M)),u=Ne(Math.sqrt(j*j+N*N)),T=Cs(z,j),_=Math.abs(T)>2e-4?T*es:0,y=ee?1/(ee<0?-ee:ee):0),s.svg&&(C=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!sp(xt(t,Le)),C&&t.setAttribute("transform",C))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(g*=-1,_+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,_+=_<=0?180:-180)),r=r||s.uncache,s.x=c-((s.xPercent=c&&(!r&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+n,s.y=p-((s.yPercent=p&&(!r&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-p)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+n,s.z=v+n,s.scaleX=Ne(g),s.scaleY=Ne(u),s.rotation=Ne(d)+a,s.rotationX=Ne(m)+a,s.rotationY=Ne(f)+a,s.skewX=_+a,s.skewY=x+a,s.transformPerspective=y+n,(s.zOrigin=parseFloat(l.split(" ")[2])||!r&&s.zOrigin||0)&&(o[ut]=En(l)),s.xOffset=s.yOffset=0,s.force3D=dt.force3D,s.renderTransform=s.svg?x0:Zu?ip:b0,s.uncache=0,s},En=function(t){return(t=t.split(" "))[0]+" "+t[1]},ll=function(t,r,s){var o=Xe(r);return Ne(parseFloat(r)+parseFloat(Sr(t,"x",s+"px",o)))+o},b0=function(t,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,ip(t,r)},Qr="0deg",fi="0px",Zr=") ",ip=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.z,l=s.rotation,c=s.rotationY,p=s.rotationX,v=s.skewX,g=s.skewY,u=s.scaleX,d=s.scaleY,m=s.transformPerspective,f=s.force3D,_=s.target,x=s.zOrigin,y="",w=f==="auto"&&t&&t!==1||f===!0;if(x&&(p!==Qr||c!==Qr)){var b=parseFloat(c)*Ts,S=Math.sin(b),T=Math.cos(b),R;b=parseFloat(p)*Ts,R=Math.cos(b),n=ll(_,n,S*R*-x),a=ll(_,a,-Math.sin(b)*-x),h=ll(_,h,T*R*-x+x)}m!==fi&&(y+="perspective("+m+Zr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(w||n!==fi||a!==fi||h!==fi)&&(y+=h!==fi||w?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+Zr),l!==Qr&&(y+="rotate("+l+Zr),c!==Qr&&(y+="rotateY("+c+Zr),p!==Qr&&(y+="rotateX("+p+Zr),(v!==Qr||g!==Qr)&&(y+="skew("+v+", "+g+Zr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+Zr),_.style[Le]=y||"translate(0, 0)"},x0=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.rotation,l=s.skewX,c=s.skewY,p=s.scaleX,v=s.scaleY,g=s.target,u=s.xOrigin,d=s.yOrigin,m=s.xOffset,f=s.yOffset,_=s.forceCSS,x=parseFloat(n),y=parseFloat(a),w,b,S,T,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Ts,l*=Ts,w=Math.cos(h)*p,b=Math.sin(h)*p,S=Math.sin(h-l)*-v,T=Math.cos(h-l)*v,l&&(c*=Ts,R=Math.tan(l-c),R=Math.sqrt(1+R*R),S*=R,T*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),w*=R,b*=R)),w=Ne(w),b=Ne(b),S=Ne(S),T=Ne(T)):(w=p,T=v,b=S=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Sr(g,"x",n,"px"),y=Sr(g,"y",a,"px")),(u||d||m||f)&&(x=Ne(x+u-(u*w+d*S)+m),y=Ne(y+d-(u*b+d*T)+f)),(o||i)&&(R=g.getBBox(),x=Ne(x+o/100*R.width),y=Ne(y+i/100*R.height)),R="matrix("+w+","+b+","+S+","+T+","+x+","+y+")",g.setAttribute("transform",R),_&&(g.style[Le]=R)},y0=function(t,r,s,o,i){var n=360,a=Ve(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?es:1),l=h-o,c=o+l+"deg",p,v;return a&&(p=i.split("_")[1],p==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),p==="cw"&&l<0?l=(l+n*Uu)%n-~~(l/n)*n:p==="ccw"&&l>0&&(l=(l-n*Uu)%n-~~(l/n)*n)),t._pt=v=new st(t._pt,r,s,o,l,s0),v.e=c,v.u="deg",t._props.push(s),v},Xu=function(t,r){for(var s in r)t[s]=r[s];return t},w0=function(t,r,s){var o=Xu({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=s.style,a,h,l,c,p,v,g,u;o.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),n[Le]=r,a=gi(s,1),wr(s,Le),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Le],n[Le]=r,a=gi(s,1),n[Le]=l);for(h in rr)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Xe(l),u=Xe(c),p=g!==u?Sr(s,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new st(t._pt,a,h,p,v-p,hl),t._pt.u=u||0,t._props.push(h));Xu(a,o)};rt("padding,margin,Width,Radius",function(e,t){var r="Top",s="Right",o="Bottom",i="Left",n=(t<3?[r,s,o,i]:[r+i,r+s,o+s,o+i]).map(function(a){return t<2?e+a:"border"+a+e});Cn[t>1?"border"+e:e]=function(a,h,l,c,p){var v,g;if(arguments.length<4)return v=n.map(function(u){return tr(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,p)}});var vl={name:"css",register:dl,targetTest:function(t){return t.style&&t.nodeType},init:function(t,r,s,o,i){var n=this._props,a=t.style,h=s.vars.startAt,l,c,p,v,g,u,d,m,f,_,x,y,w,b,S,T,R;pl||dl(),this.styles=this.styles||Qu(t),T=this.styles.props,this.tween=s;for(d in r)if(d!=="autoRound"&&(c=r[d],!(lt[d]&&rl(d,r,s,o,t,i)))){if(g=typeof c,u=Cn[d],g==="function"&&(c=c.call(s,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=ks(c)),u)u(this,t,d,c,s)&&(S=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",Zt.lastIndex=0,Zt.test(l)||(m=Xe(l),f=Xe(c),f?m!==f&&(l=Sr(t,d,l,f)+f):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),T.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(s,o,t,i):h[d],Ve(l)&&~l.indexOf("random(")&&(l=ks(l)),Xe(l+"")||l==="auto"||(l+=dt.units[d]||Xe(tr(t,d))||""),(l+"").charAt(1)==="="&&(l=tr(t,d))):l=tr(t,d),v=parseFloat(l),_=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),_&&(c=c.substr(2)),p=parseFloat(c),d in jt&&(d==="autoAlpha"&&(v===1&&tr(t,"visibility")==="hidden"&&p&&(v=0),T.push("visibility",0,a.visibility),yr(this,a,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),d!=="scale"&&d!=="transform"&&(d=jt[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in rr,x){if(this.styles.save(d),R=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=xt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var E=t.style.perspective;t.style.perspective=c,c=xt(t,"perspective"),E?t.style.perspective=E:wr(t,"perspective")}p=parseFloat(c)}if(y||(w=t._gsap,w.renderTransform&&!r.parseTransform||gi(t,r.parseTransform),b=r.smoothOrigin!==!1&&w.smooth,y=this._pt=new st(this._pt,a,Le,0,1,w.renderTransform,w,0,-1),y.dep=1),d==="scale")this._pt=new st(this._pt,w,"scaleY",w.scaleY,(_?Gr(w.scaleY,_+p):p)-w.scaleY||0,hl),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){T.push(ut,0,a[ut]),c=v0(c),w.svg?ul(t,c,0,b,0,this):(f=parseFloat(c.split(" ")[2])||0,f!==w.zOrigin&&yr(this,w,"zOrigin",w.zOrigin,f),yr(this,a,d,En(l),En(c)));continue}else if(d==="svgOrigin"){ul(t,c,1,b,0,this);continue}else if(d in rp){y0(this,w,d,v,_?Gr(v,_+c):c);continue}else if(d==="smoothOrigin"){yr(this,w,"smooth",w.smooth,c);continue}else if(d==="force3D"){w[d]=c;continue}else if(d==="transform"){w0(this,c,t);continue}}else d in a||(d=Ps(d)||d);if(x||(p||p===0)&&(v||v===0)&&!r0.test(c)&&d in a)m=(l+"").substr((v+"").length),p||(p=0),f=Xe(c)||(d in dt.units?dt.units[d]:m),m!==f&&(v=Sr(t,d,l,f)),this._pt=new st(this._pt,x?w:a,d,v,(_?Gr(v,_+p):p)-v,!x&&(f==="px"||d==="zIndex")&&r.autoRound!==!1?o0:hl),this._pt.u=f||0,x&&R!==c?(this._pt.b=l,this._pt.e=R,this._pt.r=n0):m!==f&&f!=="%"&&(this._pt.b=l,this._pt.r=i0);else if(d in a)g0.call(this,t,d,l,_?_+c:c);else if(d in t)this.add(t,d,l||t[d],_?_+c:c,o,i);else if(d!=="parseTransform"){xn(d,c);continue}x||(d in a?T.push(d,0,a[d]):typeof t[d]=="function"?T.push(d,2,t[d]()):T.push(d,1,l||t[d])),n.push(d)}}S&&al(this)},render:function(t,r){if(r.tween._time||!fl())for(var s=r._pt;s;)s.r(t,s.d),s=s._next;else r.styles.revert()},get:tr,aliases:jt,getSetter:function(t,r,s){var o=jt[r];return o&&o.indexOf(",")<0&&(r=o),r in rr&&r!==ut&&(t._gsap.x||tr(t,"x"))?s&&Hu===s?r==="scale"?c0:h0:(Hu=s||{})&&(r==="scale"?d0:u0):t.style&&!bn(t.style[r])?a0:~r.indexOf("-")?l0:kn(t,r)},core:{_removeProperty:wr,_getMatrix:gl}};Ze.utils.checkPrefix=Ps;Ze.core.getStyleSaver=Qu;(function(e,t,r,s){var o=rt(e+","+t+","+r,function(i){rr[i]=1});rt(t,function(i){dt.units[i]="deg",rp[i]=1}),jt[o[13]]=e+","+t,rt(s,function(i){var n=i.split(":");jt[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");rt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){dt.units[e]="px"});Ze.registerPlugin(vl);var $t=Ze.registerPlugin(vl)||Ze,HD=$t.core.Tween;var kr=require("react");var np=typeof document<"u"?kr.useLayoutEffect:kr.useEffect,op=e=>e&&!Array.isArray(e)&&typeof e=="object",Tn=[],S0={},ap=$t,rs=(e,t=Tn)=>{let r=S0;op(e)?(r=e,e=null,t="dependencies"in r?r.dependencies:Tn):op(t)&&(r=t,t="dependencies"in r?r.dependencies:Tn),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:s,revertOnUpdate:o}=r,i=(0,kr.useRef)(!1),n=(0,kr.useRef)(ap.context(()=>{},s)),a=(0,kr.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&np(()=>(i.current=!0,()=>n.current.revert()),Tn),np(()=>{if(e&&n.current.add(e,s),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};rs.register=e=>{ap=e};rs.headless=!0;$t.registerPlugin(rs);var k0="(prefers-reduced-motion: reduce)";function Pn(){return!window.matchMedia(k0).matches}function lp(e,t){let r=(0,_l.useRef)(t),s=(0,_l.useRef)(!1);r.current=t;let{contextSafe:o}=rs(()=>{let i=e.current;if(i===null||!Pn())return;let n=Array.from(i.children),a=$t.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(s.current)return;let i=e.current;if(i===null||!Pn()){r.current();return}s.current=!0;let n=Array.from(i.children);$t.killTweensOf([i,...n]),$t.timeline({defaults:{ease:"power1.in"},onComplete:()=>{r.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function hp(e,t){rs(()=>{let r=e.current;!t||r===null||!Pn()||$t.fromTo(r,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function cp(e,t=":scope > *"){rs(()=>{let r=e.current;if(r===null||!Pn())return;let s=r.querySelectorAll(t);$t.fromTo(s,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Oe=require("react/jsx-runtime");function et({title:e,subtitle:t,className:r,onClose:s,children:o}){let i=(0,ss.useId)(),n=(0,ss.useId)(),a=(0,ss.useRef)(null),h=lp(a,s),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Oe.jsx)(Ds.Modal,{open:!0,onClose:h,title:e,closeLabel:"\u5173\u95ED",headless:!0,className:`dsh-ssh-dialog-modal${r===void 0?"":` ${r}-modal`}`,children:(0,Oe.jsx)(Qd,{children:(0,Oe.jsx)(Zd,{children:(0,Oe.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${r===void 0?"":` ${r}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Oe.jsxs)("header",{children:[(0,Oe.jsxs)("span",{children:[(0,Oe.jsx)("h2",{id:i,children:e}),t&&(0,Oe.jsx)("p",{id:n,children:t})]}),(0,Oe.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Oe.jsx)(Ds.IconCloseOutline16,{size:16})})]}),o]})})})})}function pe({label:e,hint:t,children:r}){return(0,Oe.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Oe.jsx)("span",{children:e}),r,t&&(0,Oe.jsx)("small",{children:t})]})}function is({active:e,onClick:t,children:r}){let s=(0,ss.useRef)(null);return hp(s,e),(0,Oe.jsx)("button",{ref:s,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:r})}function dp(){let e=(0,ss.useRef)(null);return cp(e),(0,Oe.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Oe.jsx)("span",{children:(0,Oe.jsx)(Cr,{})}),(0,Oe.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Oe.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Cr(){return(0,Oe.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Oe.jsx)(Ds.IconDataOutline16,{size:17})})}function Pe(e){return e instanceof Error?e.message:String(e)}function up(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}var je=require("react/jsx-runtime");function Dn({locationName:e,locationKind:t,entries:r,onClose:s,onDelete:o}){let[i,n]=(0,bl.useState)(!1),[a,h]=(0,bl.useState)(),l=r.filter(p=>p.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),s()}catch(p){h(Pe(p)),n(!1)}};return(0,je.jsxs)(et,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${r.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||s()},children:[(0,je.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,je.jsx)("span",{children:(0,je.jsx)(Rs.IconTrashOutline16,{size:18})}),(0,je.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,je.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[r.slice(0,6).map(p=>(0,je.jsxs)("div",{children:[p.kind==="directory"?(0,je.jsx)(Rs.IconFolderClose16,{size:17}):(0,je.jsx)(Rs.IconDataOutline16,{size:17}),(0,je.jsxs)("span",{children:[(0,je.jsx)("strong",{children:p.name}),(0,je.jsx)("small",{title:p.path,children:p.path})]})]},p.path)),r.length>6&&(0,je.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",r.length-6," \u9879"]})]}),a&&(0,je.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,je.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,je.jsx)("span",{}),(0,je.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:s,children:"\u53D6\u6D88"}),(0,je.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var X=require("react/jsx-runtime"),C0=512*1024*1024;function fp({sessionId:e}){let t=(0,xe.useCallback)(i=>Xl(e,i||void 0),[e]),r=(0,xe.useCallback)(i=>Jl(e,i),[e]),s=(0,xe.useCallback)((i,n=!1)=>Yl(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>Gl(e,i,n),[e]);return(0,X.jsx)(yl,{initialPath:"",loadDirectory:t,loadPreview:r,fileUrl:s,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function mp({sessionId:e,profile:t,profiles:r,onProfile:s,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await hh(e,t.id,g)).cwd:g,m=await Kl(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>Ql(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>Zl(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>Vn(t.id,g,u,d),[t.id]),l=vp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,p=(0,xe.useCallback)((g,u)=>Bs({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,X.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,X.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,X.jsxs)("label",{children:[(0,X.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,X.jsx)("select",{value:t.id,onChange:g=>s(g.target.value),children:r.map(g=>(0,X.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,X.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,X.jsx)(yl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:p}})}function gp({profile:e,initialPath:t="~",onEdit:r,onDelete:s,embedded:o=!1}){let i=(0,xe.useCallback)(v=>eh(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>th(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>rh(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>Vn(e.id,v,g,u),[e.id]),l=vp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,p=(0,xe.useCallback)((v,g)=>Bs({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,X.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,X.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,X.jsxs)("div",{children:[(0,X.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,X.jsx)("p",{children:o?t:`${Kt(e)} \xB7 ${t}`})]}),(0,X.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[s&&(0,X.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,X.jsx)(ke.IconTrashOutline16,{size:16})}),r&&(0,X.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,X.jsx)(ke.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,X.jsx)(yl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:p}})]})}function yl({initialPath:e,header:t,workspace:r=!1,loadDirectory:s,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[p,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[f,_]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[w,b]=(0,xe.useState)(),[S,T]=(0,xe.useState)(!1),[R,E]=(0,xe.useState)(),[A,B]=(0,xe.useState)(),[M,H]=(0,xe.useState)(),[z,j]=(0,xe.useState)(),[C,D]=(0,xe.useState)(),L=(0,xe.useCallback)(async(G,oe)=>{_(!0),D(void 0),u(void 0),b(void 0);try{let me=await s(G,oe);v(me),m(me.path)}catch(me){D(Rn(me))}finally{_(!1)}},[s]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=G=>{G.preventDefault(),L(d,!0)},U=async(G,oe=p?.path,me=!1)=>{if(n===void 0||oe===void 0||G.length===0)return;let De=G.filter(Te=>Te.size<=C0),se=G.length-De.length;if(De.length===0){D("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}b(void 0),D(void 0);for(let Te=0;Te<De.length;Te+=1){let ft=De[Te],or=me&&Te===0;y(ft.name);try{await n(oe,ft,or)}catch(Ot){!or&&Ot instanceof ar&&Ot.status===409?b({file:ft,remaining:De.slice(Te+1),directory:oe}):D(Rn(Ot)),y(void 0);return}}y(void 0),await L(oe,!1),se>0&&D(`\u5DF2\u8DF3\u8FC7 ${se} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},J=n!==void 0&&p!==void 0&&x===void 0&&w===void 0,O=G=>Array.from(G.dataTransfer.types).includes("Files"),ee=G=>Array.from(G.dataTransfer.types).includes(Lt),N=G=>{!J||!O(G)||(G.preventDefault(),c.current+=1,T(!0))},P=G=>{if(J&&O(G)){G.preventDefault(),G.dataTransfer.dropEffect="copy";return}if(a===void 0||p===void 0||!ee(G))return;let oe=R===void 0?"copy":ti(R,{endpointId:a.endpointId,directory:p.path});oe==="none"||oe==="invalid"||(G.preventDefault(),G.dataTransfer.dropEffect=oe)},$=G=>{O(G)&&(c.current=Math.max(0,c.current-1),c.current===0&&T(!1))},V=G=>{if(c.current=0,T(!1),J&&O(G)){G.preventDefault();let me=Array.from(G.dataTransfer.files);me.length>0&&U(me);return}if(a===void 0||p===void 0||!ee(G))return;G.preventDefault();let oe=vs(G.dataTransfer.getData(Lt));oe!==void 0&&te(oe,p.path)},te=async(G,oe)=>{if(a!==void 0){B(void 0),E(void 0),j(void 0),D(void 0);try{let me=await hn(G,{paneId:a.paneId,endpointId:a.endpointId,directory:oe});me.operation==="move"&&(j("\u5DF2\u79FB\u52A8"),await L(p?.path??oe,!1)),me.operation==="copy"&&j("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){D(Rn(me))}}},Q=async()=>{h===void 0||p===void 0||M===void 0||(await h.remove(p.path,[M.path]),await L(p.path,!1))};return(0,X.jsxs)("div",{className:`dsh-ssh-sftp${r?" is-workspace":""}${S?" is-dragging-files":""}`,onDragEnter:N,onDragOver:P,onDragLeave:$,onDrop:V,children:[t,g?(0,X.jsx)(E0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,X.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:p?.parent==null||f,onClick:()=>{p?.parent&&L(p.parent,!0)},children:(0,X.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,X.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:G=>m(G.target.value)}),(0,X.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:f,onClick:()=>{L(p?.path??d,!1)},children:(0,X.jsx)(ke.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:G=>{let oe=Array.from(G.target.files??[]);G.target.value="",oe.length>0&&U(oe)}}),(0,X.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:p===void 0||x!==void 0||w!==void 0,onClick:()=>l.current?.click(),children:[(0,X.jsx)(ke.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),w!==void 0&&(0,X.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,X.jsx)("small",{children:w.file.name})]}),(0,X.jsxs)("span",{children:[(0,X.jsx)("button",{type:"button",onClick:()=>{let G=w;b(void 0),U(G.remaining,G.directory)},children:"\u8DF3\u8FC7"}),(0,X.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let G=w;U([G.file,...G.remaining],G.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),z&&(0,X.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,X.jsx)("span",{children:z}),(0,X.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>j(void 0),children:(0,X.jsx)(ke.IconCloseOutline16,{size:14})})]}),C&&(0,X.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:C}),(0,X.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":f,children:[(0,X.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,X.jsx)("span",{children:"\u540D\u79F0"}),(0,X.jsx)("span",{children:"\u5927\u5C0F"}),(0,X.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,X.jsx)("span",{"aria-hidden":"true"})]}),f&&p===void 0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):p?.entries.length===0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):p?.entries.map(G=>{let oe=ln(G),me=R===void 0||a===void 0?void 0:ti(R,{endpointId:a.endpointId,directory:G.path}),De=oe&&me!=="none"&&me!=="invalid";return(0,X.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${G.name}${oe?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(G.kind==="file"||oe),className:`dsh-ssh-sftp-row is-${oe?"directory":G.kind}${A===G.path?" is-drop-target":""}`,onClick:()=>{oe?L(G.path,!0):u(G)},onKeyDown:se=>{se.target===se.currentTarget&&se.key==="Enter"&&(oe?L(G.path,!0):u(G))},onDragStart:se=>{if(a===void 0||p===void 0)return;let Te={paneId:a.paneId,endpointId:a.endpointId,directory:p.path,paths:[G.path]};E(Te),se.dataTransfer.effectAllowed="copyMove",se.dataTransfer.setData(Lt,JSON.stringify(Te))},onDragEnd:()=>{E(void 0),B(void 0)},onDragOver:se=>{let Te=J&&O(se);!oe||!Te&&!ee(se)||!Te&&!De||(se.preventDefault(),se.stopPropagation(),se.dataTransfer.dropEffect=Te||me!=="move"?"copy":"move",B(G.path))},onDragLeave:se=>{se.currentTarget.contains(se.relatedTarget)||B(void 0)},onDrop:se=>{if(!oe)return;if(se.preventDefault(),se.stopPropagation(),B(void 0),J&&O(se)){let ft=Array.from(se.dataTransfer.files);ft.length>0&&U(ft,G.path);return}let Te=vs(se.dataTransfer.getData(Lt));Te!==void 0&&te(Te,G.path)},children:[(0,X.jsxs)("span",{children:[oe?(0,X.jsx)(ke.IconFolderClose16,{size:16}):(0,X.jsx)(ke.IconDataOutline16,{size:16}),(0,X.jsx)("strong",{title:G.name,children:G.name})]}),(0,X.jsx)("small",{children:oe?"-":xl(G.size)}),(0,X.jsx)("small",{children:T0(G.modifiedAt)}),h!==void 0&&(0,X.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${G.name}`,title:`\u5220\u9664 ${G.name}`,onClick:se=>{se.stopPropagation(),H(G)},children:(0,X.jsx)(ke.IconTrashOutline16,{size:14})})]},G.path)})]})]}),S&&(0,X.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,X.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",p?.path??d]})]})}),M!==void 0&&h!==void 0&&(0,X.jsx)(Dn,{locationName:h.locationName,locationKind:h.locationKind,entries:[M],onClose:()=>H(void 0),onDelete:Q})]})}function E0({entry:e,loadPreview:t,fileUrl:r,onBack:s}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let p=!1;return i(void 0),a(void 0),t(e.path).then(v=>{p||i(v)}).catch(v=>{p||a(Rn(v))}),()=>{p=!0}},[e.path,t]);let c=r(e.path);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,X.jsxs)("header",{children:[(0,X.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:s,children:(0,X.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,X.jsx)("strong",{title:e.name,children:e.name}),(0,X.jsx)("small",{children:xl(e.size)})]}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,X.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,X.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,X.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,X.jsx)(ke.IconFullscreenOutline16,{size:16})})]})]}),(0,X.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,X.jsx)(pp,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]}),(0,X.jsx)(ke.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,closeLabel:"\u5173\u95ED\u9884\u89C8",headless:!0,className:"dsh-ssh-preview-modal",children:(0,X.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,X.jsxs)("header",{children:[(0,X.jsxs)("span",{children:[(0,X.jsx)("strong",{title:e.name,children:e.name}),(0,X.jsx)("small",{children:xl(e.size)})]}),(0,X.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,X.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,X.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,X.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,X.jsx)(ke.IconCloseOutline16,{size:16})})]})]}),(0,X.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,X.jsx)(pp,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]})})]})}function pp({entry:e,preview:t,error:r,fileUrl:s,downloadUrl:o}){return r?(0,X.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:r}):t===void 0?(0,X.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,X.jsx)(Ho,{remarkPlugins:[on],components:{a:i=>(0,X.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,X.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("pre",{children:t.text||""}),t.truncated&&(0,X.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,X.jsx)("img",{src:s(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,X.jsx)("iframe",{src:s(e.path,!0),title:e.name}):(0,X.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,X.jsx)(ke.IconDataOutline16,{size:24}),(0,X.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,X.jsx)("p",{children:t.mimeType}),(0,X.jsxs)("a",{href:o,children:[(0,X.jsx)(ke.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function xl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],r=e/1024,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;return`${r>=10?r.toFixed(0):r.toFixed(1)} ${t[s]}`}function T0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function Rn(e){return e instanceof Error?e.message:String(e)}function vp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var As=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,r){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let s=this.input;if(this.input="",!s)return;let o=this.inputSequence++;this.deliverInput(s,o,r)})))}observe(t){let r=!1,s=0,o,i,n,a=!1,h=()=>{r||(r=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{r||(s=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!r)try{let v=await this.endpoints.read(s);l(v),r||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(r)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},p=()=>{r||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(p(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=P0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),p()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&p()},i=window.setTimeout(()=>{a||p()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,r,s,o=0){this.endpoints.send(t,r).catch(i=>{if(!this.disposed){if(o<2&&D0(i)){window.setTimeout(()=>this.deliverInput(t,r,s,o+1),60*(o+1));return}s(i)}})}};function P0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function D0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var xp=Ms(bp(),1),R0={background:"#1c1c1e",foreground:"#f2f2f7",cursor:"#f2f2f7",cursorAccent:"#1c1c1e",selectionBackground:"#8e8e9366",black:"#1c1c1e",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#a5a5aa",magenta:"#bf5af2",cyan:"#64d2ff",white:"#e5e5ea",brightBlack:"#8e8e93",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#d1d1d6",brightMagenta:"#da8fff",brightCyan:"#8be0ff",brightWhite:"#ffffff"};function In(e){return new xp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:R0})}function Ln(e,t,r,s){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;r.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,s?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var he=require("react/jsx-runtime");function wp(e){let t=String(e.sessionId),[r,s]=(0,qe.useState)(),[o,i]=(0,qe.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,qe.useState)();(0,qe.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,qe.useCallback)(async()=>{try{let l=await Wl(t);s(l),l.injection?.permission!=="terminal"&&i(c=>c==="terminals"?"local-directory":c),a(void 0)}catch(l){a(Pe(l))}},[t]);return(0,qe.useEffect)(()=>{let l=!1,c,p=!1,v=async()=>{if(p||(p=!0,await h(),p=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,he.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,he.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,he.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,he.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,he.jsx)(Cr,{})}),(0,he.jsxs)("span",{children:[(0,he.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,he.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",up(t)]})]})]}),(0,he.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,he.jsx)(sr.IconCloseOutline16,{size:16})})]}),r&&(0,he.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>i("local-directory"),children:[(0,he.jsx)(sr.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),r.profiles.length>0&&(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>i("remote-directory"),children:[(0,he.jsx)(Cr,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),r.injection?.permission==="terminal"&&(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>i("terminals"),children:[(0,he.jsx)(sr.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",r.terminals.length>0&&(0,he.jsx)("em",{children:r.terminals.length})]})]}),(0,he.jsxs)("div",{className:"dsh-ssh-activity-body",children:[r===void 0?(0,he.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,he.jsx)(fp,{sessionId:t}):o==="remote-directory"?(0,he.jsx)(A0,{sessionId:t,profiles:r.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,he.jsx)(I0,{sessionId:t,terminals:r.terminals,onClosed:h}),n&&(0,he.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function A0({sessionId:e,profiles:t,selectedProfileId:r,onProfile:s,onSaved:o}){let i=t.find(n=>n.id===r)??t[0];return i===void 0?(0,he.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,he.jsx)(sr.IconFolderOpenOutline16,{size:22}),(0,he.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,he.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,he.jsx)(mp,{sessionId:e,profile:i,profiles:t,onProfile:s,onSaved:o},i.id)}function I0({sessionId:e,terminals:t,onClosed:r}){let s=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,qe.useState)(s?.terminalId),[n,a]=(0,qe.useState)(),[h,l]=(0,qe.useState)(),c=t.find(g=>g.terminalId===o)??s;if((0,qe.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(s?.terminalId)},[s?.terminalId,o,t]),c===void 0)return(0,he.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,he.jsx)(sr.IconCodeOutline16,{size:22}),(0,he.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,he.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let p=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await lh(e,c.terminalId),await r()}catch(g){l(Pe(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,he.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,he.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,he.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,he.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,he.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,he.jsxs)("span",{children:[(0,he.jsx)("strong",{children:c.name}),(0,he.jsx)("small",{children:c.cwd})]}),(0,he.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,he.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,he.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{p()},children:[(0,he.jsx)(sr.IconCloseOutline16,{size:14}),(0,he.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,he.jsx)(L0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,he.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function L0({sessionId:e,terminal:t,onError:r}){let s=(0,qe.useRef)(null),o=(0,qe.useRef)();return(0,qe.useEffect)(()=>{let i=s.current;if(i===null)return;let n=In({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new yp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new As({streamUrl:nh(e,t.terminalId),read:v=>ih(e,t.terminalId,v),send:(v,g)=>sh(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>r(Pe(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),r(void 0)},error:v=>r(Pe(v))}),p=Ln(i,n,a,(v,g)=>{ah(e,t.terminalId,v,g).catch(u=>r(Pe(u)))});return()=>{c(),h.dispose(),l.dispose(),p.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,r,e]),(0,qe.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,he.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,he.jsx)("div",{ref:s,className:"dsh-ssh-terminal-viewport"})})}var Er=require("react"),yt=require("react/jsx-runtime");function kp({className:e,toolbar:t,notice:r,navigation:s,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,p]=(0,Er.useState)(),v=(0,Er.useRef)(null),g=(0,Er.useRef)(null),u=(0,Er.useRef)(null),d=()=>{p(void 0),window.requestAnimationFrame(()=>{let f=u.current;f?.isConnected&&f.focus()})},m={closePanel:d,openPanel:f=>p(f)};return(0,Er.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let _=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>_?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,yt.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,r,(0,yt.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():p("navigation"),children:[i,(0,yt.jsx)("span",{children:o})]}),n!==void 0&&(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():p("inspector"),children:[h,(0,yt.jsx)("span",{children:a})]})]}),(0,yt.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,yt.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:Sp(s,m)}),(0,yt.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,yt.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:Sp(n,m)}),(0,yt.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function Sp(e,t){return typeof e=="function"?e(t):e}var Cp=`.dsh-ssh-adaptive-workspace {
|
|
39
39
|
container: dsh-ssh-workspace/inline-size;
|
|
40
40
|
position: relative;
|
|
41
41
|
display: flex;
|
|
@@ -71,6 +71,11 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
71
71
|
.dsh-ssh-adaptive-content {
|
|
72
72
|
position: relative;
|
|
73
73
|
z-index: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
background: var(--ssh-surface);
|
|
76
|
+
-webkit-backdrop-filter: var(--ssh-content-filter);
|
|
77
|
+
backdrop-filter: var(--ssh-content-filter);
|
|
78
|
+
box-shadow: inset 0 1px 0 var(--ssh-card-highlight);
|
|
74
79
|
}
|
|
75
80
|
.dsh-ssh-mobile-actions,
|
|
76
81
|
.dsh-ssh-adaptive-backdrop {
|
|
@@ -84,7 +89,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
84
89
|
min-height: 46px;
|
|
85
90
|
padding: 5px max(10px, env(safe-area-inset-left)) 5px max(10px, env(safe-area-inset-right));
|
|
86
91
|
border-bottom: 1px solid var(--ssh-adaptive-border, color-mix(in srgb, currentColor 10%, transparent));
|
|
87
|
-
background: var(--ssh-adaptive-toolbar-surface, var(--ssh-
|
|
92
|
+
background: var(--ssh-adaptive-toolbar-surface, var(--ssh-chrome-surface));
|
|
88
93
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
89
94
|
backdrop-filter: var(--ssh-glass-filter);
|
|
90
95
|
overflow-x: auto;
|
|
@@ -154,7 +159,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
154
159
|
inset: 0;
|
|
155
160
|
display: block;
|
|
156
161
|
border: 0;
|
|
157
|
-
background:
|
|
162
|
+
background: color-mix(in srgb, black 24%, transparent);
|
|
158
163
|
opacity: 0;
|
|
159
164
|
visibility: hidden;
|
|
160
165
|
transition: opacity 170ms ease, visibility 170ms;
|
|
@@ -182,6 +187,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
@media (prefers-reduced-transparency: reduce) {
|
|
190
|
+
.dsh-ssh-adaptive-content,
|
|
185
191
|
.dsh-ssh-mobile-actions,
|
|
186
192
|
.dsh-ssh-adaptive-navigation,
|
|
187
193
|
.dsh-ssh-adaptive-inspector {
|
|
@@ -189,7 +195,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
189
195
|
backdrop-filter: none;
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
|
-
`;var
|
|
198
|
+
`;var Ep=`.dsh-ssh-border-glow {
|
|
193
199
|
--ssh-border-glow-proximity: 0;
|
|
194
200
|
--ssh-border-glow-angle: 0deg;
|
|
195
201
|
position: relative;
|
|
@@ -303,7 +309,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
303
309
|
display: none;
|
|
304
310
|
}
|
|
305
311
|
}
|
|
306
|
-
`;var
|
|
312
|
+
`;var Tp=`.dsh-ssh-glare-hover {
|
|
307
313
|
position: relative;
|
|
308
314
|
display: grid;
|
|
309
315
|
width: 100%;
|
|
@@ -364,7 +370,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
364
370
|
display: none;
|
|
365
371
|
}
|
|
366
372
|
}
|
|
367
|
-
`;var
|
|
373
|
+
`;var Pp=`/*
|
|
368
374
|
* Shared interaction contract for the whole plugin.
|
|
369
375
|
* Components declare intent only; this file owns neutral hover, selection,
|
|
370
376
|
* edge reflection and reduced-motion behavior so host-theme colors cannot
|
|
@@ -560,7 +566,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
560
566
|
}
|
|
561
567
|
.dsh-ssh-context-action { transition: none; }
|
|
562
568
|
}
|
|
563
|
-
`;var
|
|
569
|
+
`;var Sl="@lemoncat7/dsh-plugin-ui/workspace-activate";function kl(e){window.dispatchEvent(new CustomEvent(Sl,{detail:{pluginId:e}}))}function Dp(e,t){let r=s=>{s.detail?.pluginId!==e&&t()};return window.addEventListener(Sl,r),()=>window.removeEventListener(Sl,r)}var ye=require("@deepseek-ai/dsh-client-ui-primitives"),Zp=Ms(jn(),1);var Rp=`/**
|
|
564
570
|
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
565
571
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
566
572
|
* https://github.com/chjj/term.js
|
|
@@ -778,7 +784,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
778
784
|
z-index: 2;
|
|
779
785
|
position: relative;
|
|
780
786
|
}
|
|
781
|
-
`;var
|
|
787
|
+
`;var Ap=`.sr-only {
|
|
782
788
|
position: absolute;
|
|
783
789
|
width: 1px;
|
|
784
790
|
height: 1px;
|
|
@@ -800,63 +806,65 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
800
806
|
"Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
|
|
801
807
|
--ssh-font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono",
|
|
802
808
|
"Noto Sans Mono CJK SC", monospace;
|
|
803
|
-
--ssh-type-caption:
|
|
804
|
-
--ssh-type-label:
|
|
809
|
+
--ssh-type-caption: 12px;
|
|
810
|
+
--ssh-type-label: 13px;
|
|
805
811
|
--ssh-type-body: 13px;
|
|
806
|
-
--ssh-type-title:
|
|
812
|
+
--ssh-type-title: 18px;
|
|
807
813
|
--ssh-leading-compact: 1.35;
|
|
808
814
|
--ssh-leading-body: 1.5;
|
|
809
|
-
--ssh-control-height:
|
|
810
|
-
--ssh-control-height-compact:
|
|
815
|
+
--ssh-control-height: 36px;
|
|
816
|
+
--ssh-control-height-compact: 32px;
|
|
811
817
|
--ssh-control-padding: 15px;
|
|
812
|
-
--ssh-control-padding-compact:
|
|
813
|
-
--ssh-canvas:
|
|
814
|
-
--ssh-panel: rgba(
|
|
818
|
+
--ssh-control-padding-compact: 12px;
|
|
819
|
+
--ssh-canvas: transparent;
|
|
820
|
+
--ssh-panel: rgba(255, 255, 255, 0.16);
|
|
815
821
|
--ssh-text: #1d1d1f;
|
|
816
822
|
--ssh-text-muted: #515154;
|
|
817
|
-
--ssh-text-subtle: #
|
|
818
|
-
--ssh-
|
|
819
|
-
--ssh-hover: rgba(118, 118, 128, 0.1);
|
|
823
|
+
--ssh-text-subtle: #747478;
|
|
824
|
+
--ssh-hover: rgba(118, 118, 128, 0.09);
|
|
820
825
|
--ssh-selected: rgba(60, 60, 67, 0.085);
|
|
821
|
-
--ssh-control: rgba(255, 255, 255, 0.
|
|
822
|
-
--ssh-accent: #
|
|
823
|
-
--ssh-accent-strong: #
|
|
826
|
+
--ssh-control: rgba(255, 255, 255, 0.27);
|
|
827
|
+
--ssh-accent: #6e6e73;
|
|
828
|
+
--ssh-accent-strong: #2c2c2e;
|
|
824
829
|
--ssh-on-accent: #ffffff;
|
|
825
830
|
--ssh-success: #248a3d;
|
|
826
831
|
--ssh-danger: #d70015;
|
|
827
832
|
--ssh-warning: #c93400;
|
|
828
|
-
--ssh-surface:
|
|
829
|
-
--ssh-surface-raised:
|
|
833
|
+
--ssh-surface: rgba(246, 247, 250, 0.17);
|
|
834
|
+
--ssh-surface-raised: rgba(255, 255, 255, 0.38);
|
|
835
|
+
--ssh-chrome-surface: var(--ssh-panel);
|
|
836
|
+
--ssh-card-surface: rgba(255, 255, 255, 0.24);
|
|
837
|
+
--ssh-card-highlight: rgba(255, 255, 255, 0.58);
|
|
838
|
+
--ssh-control-surface: var(--ssh-control);
|
|
830
839
|
--ssh-tab-selected: color-mix(in srgb, var(--ssh-surface-raised) 84%, var(--ssh-text) 16%);
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
--ssh-
|
|
834
|
-
--ssh-
|
|
835
|
-
--ssh-
|
|
836
|
-
--ssh-
|
|
837
|
-
--ssh-
|
|
838
|
-
--ssh-focus-ring: rgba(60, 60, 67, 0.
|
|
840
|
+
--ssh-modal-surface: rgba(246, 247, 250, 0.88);
|
|
841
|
+
--ssh-modal-surface-raised: rgba(255, 255, 255, 0.54);
|
|
842
|
+
--ssh-activity-surface: rgba(246, 247, 250, 0.82);
|
|
843
|
+
--ssh-activity-surface-raised: rgba(255, 255, 255, 0.72);
|
|
844
|
+
--ssh-border: rgba(60, 60, 67, 0.14);
|
|
845
|
+
--ssh-host-border: var(--ssh-border);
|
|
846
|
+
--ssh-separator: rgba(60, 60, 67, 0.11);
|
|
847
|
+
--ssh-focus-ring: rgba(60, 60, 67, 0.46);
|
|
839
848
|
--ssh-scrollbar-thumb: rgba(60, 60, 67, 0.32);
|
|
840
849
|
--ssh-scrollbar-hover: rgba(60, 60, 67, 0.5);
|
|
841
|
-
--ssh-glass-clear: rgba(255, 255, 255, 0.
|
|
842
|
-
--ssh-glass-regular: rgba(255, 255, 255, 0.
|
|
843
|
-
--ssh-glass-thick: rgba(255, 255, 255, 0.
|
|
844
|
-
--ssh-glass-border:
|
|
845
|
-
--ssh-glass-separator:
|
|
846
|
-
--ssh-glass-highlight:
|
|
847
|
-
--ssh-glass-rim-light: rgba(255, 255, 255, 0.
|
|
848
|
-
--ssh-glass-rim-shadow: rgba(60, 60, 67, 0.
|
|
850
|
+
--ssh-glass-clear: rgba(255, 255, 255, 0.11);
|
|
851
|
+
--ssh-glass-regular: rgba(255, 255, 255, 0.24);
|
|
852
|
+
--ssh-glass-thick: rgba(255, 255, 255, 0.42);
|
|
853
|
+
--ssh-glass-border: var(--ssh-border);
|
|
854
|
+
--ssh-glass-separator: var(--ssh-separator);
|
|
855
|
+
--ssh-glass-highlight: var(--ssh-card-highlight);
|
|
856
|
+
--ssh-glass-rim-light: rgba(255, 255, 255, 0.7);
|
|
857
|
+
--ssh-glass-rim-shadow: rgba(60, 60, 67, 0.11);
|
|
849
858
|
--ssh-border-glow-core: rgba(255, 255, 255, 1);
|
|
850
859
|
--ssh-border-glow-soft: rgba(142, 142, 147, 0.5);
|
|
851
860
|
--ssh-border-glow-shadow: rgba(44, 44, 46, 0.64);
|
|
852
861
|
--ssh-border-glow-haze: rgba(255, 255, 255, 0.72);
|
|
853
|
-
--ssh-
|
|
854
|
-
--ssh-
|
|
855
|
-
--ssh-ambient-shadow: rgba(60, 60, 67, 0.09);
|
|
862
|
+
--ssh-content-filter: saturate(1.08) contrast(1.015) blur(18px);
|
|
863
|
+
--ssh-glass-filter: saturate(1.22) contrast(1.03) blur(32px);
|
|
856
864
|
--ssh-glass-shadow:
|
|
857
865
|
inset 0 1px 0 var(--ssh-glass-rim-light),
|
|
858
866
|
inset 0 -1px 0 var(--ssh-glass-rim-shadow),
|
|
859
|
-
0 10px 28px rgba(
|
|
867
|
+
0 10px 28px rgba(31, 31, 35, 0.085);
|
|
860
868
|
--ssh-control-shadow:
|
|
861
869
|
0 1px 2px rgba(0, 0, 0, 0.08),
|
|
862
870
|
0 4px 12px rgba(0, 0, 0, 0.055);
|
|
@@ -864,7 +872,8 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
864
872
|
0 2px 4px rgba(0, 0, 0, 0.09),
|
|
865
873
|
0 8px 18px rgba(0, 0, 0, 0.075);
|
|
866
874
|
--ssh-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
|
|
867
|
-
--ssh-shadow-
|
|
875
|
+
--ssh-shadow-md: 0 10px 28px rgba(31, 31, 35, 0.085);
|
|
876
|
+
--ssh-shadow-lg: 0 24px 64px rgba(31, 31, 35, 0.14);
|
|
868
877
|
--ssh-terminal-surface: #1c1c1e;
|
|
869
878
|
--ssh-terminal-raised: #242426;
|
|
870
879
|
--ssh-terminal-border: rgba(255, 255, 255, 0.12);
|
|
@@ -894,47 +903,51 @@ body[data-ds-dark-theme] :is(
|
|
|
894
903
|
.dsh-ssh-preview-modal,
|
|
895
904
|
.dsh-ssh-session-create-modal
|
|
896
905
|
) {
|
|
897
|
-
--ssh-canvas:
|
|
898
|
-
--ssh-panel: rgba(
|
|
906
|
+
--ssh-canvas: transparent;
|
|
907
|
+
--ssh-panel: rgba(8, 10, 12, 0.18);
|
|
899
908
|
--ssh-text: #f5f5f7;
|
|
900
909
|
--ssh-text-muted: #d1d1d6;
|
|
901
910
|
--ssh-text-subtle: #98989d;
|
|
902
|
-
--ssh-
|
|
903
|
-
--ssh-hover: rgba(255, 255, 255, 0.08);
|
|
911
|
+
--ssh-hover: rgba(255, 255, 255, 0.075);
|
|
904
912
|
--ssh-selected: rgba(255, 255, 255, 0.09);
|
|
905
|
-
--ssh-control:
|
|
906
|
-
--ssh-accent: #
|
|
907
|
-
--ssh-accent-strong: #
|
|
913
|
+
--ssh-control: rgba(8, 10, 12, 0.3);
|
|
914
|
+
--ssh-accent: #aeaeb2;
|
|
915
|
+
--ssh-accent-strong: #f5f5f7;
|
|
908
916
|
--ssh-on-accent: #1d1d1f;
|
|
909
917
|
--ssh-success: #30d158;
|
|
910
918
|
--ssh-danger: #ff453a;
|
|
911
919
|
--ssh-warning: #ff9f0a;
|
|
912
|
-
--ssh-surface:
|
|
913
|
-
--ssh-surface-raised:
|
|
920
|
+
--ssh-surface: rgba(8, 10, 12, 0.19);
|
|
921
|
+
--ssh-surface-raised: rgba(8, 10, 12, 0.42);
|
|
922
|
+
--ssh-chrome-surface: var(--ssh-panel);
|
|
923
|
+
--ssh-card-surface: rgba(7, 9, 11, 0.22);
|
|
924
|
+
--ssh-card-highlight: rgba(255, 255, 255, 0.11);
|
|
925
|
+
--ssh-control-surface: var(--ssh-control);
|
|
914
926
|
--ssh-tab-selected: color-mix(in srgb, var(--ssh-surface-raised) 84%, var(--ssh-text) 16%);
|
|
915
|
-
--ssh-modal-surface:
|
|
916
|
-
--ssh-modal-surface-raised:
|
|
917
|
-
--ssh-activity-surface:
|
|
918
|
-
--ssh-activity-surface-raised:
|
|
919
|
-
--ssh-border: rgba(
|
|
920
|
-
--ssh-
|
|
927
|
+
--ssh-modal-surface: rgba(18, 20, 22, 0.92);
|
|
928
|
+
--ssh-modal-surface-raised: rgba(28, 30, 32, 0.88);
|
|
929
|
+
--ssh-activity-surface: rgba(8, 10, 12, 0.88);
|
|
930
|
+
--ssh-activity-surface-raised: rgba(20, 22, 24, 0.84);
|
|
931
|
+
--ssh-border: rgba(255, 255, 255, 0.105);
|
|
932
|
+
--ssh-host-border: var(--ssh-border);
|
|
933
|
+
--ssh-separator: rgba(255, 255, 255, 0.08);
|
|
934
|
+
--ssh-focus-ring: rgba(255, 255, 255, 0.52);
|
|
921
935
|
--ssh-scrollbar-thumb: rgba(235, 235, 245, 0.28);
|
|
922
936
|
--ssh-scrollbar-hover: rgba(235, 235, 245, 0.46);
|
|
923
|
-
--ssh-glass-clear: rgba(
|
|
924
|
-
--ssh-glass-regular: rgba(
|
|
925
|
-
--ssh-glass-thick: rgba(
|
|
926
|
-
--ssh-glass-border:
|
|
927
|
-
--ssh-glass-separator:
|
|
928
|
-
--ssh-glass-highlight:
|
|
929
|
-
--ssh-glass-rim-light: rgba(255, 255, 255, 0.
|
|
937
|
+
--ssh-glass-clear: rgba(0, 0, 0, 0.1);
|
|
938
|
+
--ssh-glass-regular: rgba(0, 0, 0, 0.16);
|
|
939
|
+
--ssh-glass-thick: rgba(0, 0, 0, 0.26);
|
|
940
|
+
--ssh-glass-border: var(--ssh-border);
|
|
941
|
+
--ssh-glass-separator: var(--ssh-separator);
|
|
942
|
+
--ssh-glass-highlight: var(--ssh-card-highlight);
|
|
943
|
+
--ssh-glass-rim-light: rgba(255, 255, 255, 0.16);
|
|
930
944
|
--ssh-glass-rim-shadow: rgba(0, 0, 0, 0.3);
|
|
931
945
|
--ssh-border-glow-core: rgba(255, 255, 255, 0.6);
|
|
932
946
|
--ssh-border-glow-soft: rgba(209, 209, 214, 0.24);
|
|
933
947
|
--ssh-border-glow-shadow: rgba(0, 0, 0, 0.46);
|
|
934
948
|
--ssh-border-glow-haze: rgba(235, 235, 245, 0.22);
|
|
935
|
-
--ssh-
|
|
936
|
-
--ssh-
|
|
937
|
-
--ssh-ambient-shadow: rgba(0, 0, 0, 0.3);
|
|
949
|
+
--ssh-content-filter: saturate(1.04) contrast(1.02) blur(18px);
|
|
950
|
+
--ssh-glass-filter: saturate(1.22) contrast(1.03) blur(32px);
|
|
938
951
|
--ssh-glass-shadow:
|
|
939
952
|
inset 0 1px 0 var(--ssh-glass-rim-light),
|
|
940
953
|
inset 0 -1px 0 var(--ssh-glass-rim-shadow),
|
|
@@ -946,6 +959,7 @@ body[data-ds-dark-theme] :is(
|
|
|
946
959
|
0 2px 5px rgba(0, 0, 0, 0.28),
|
|
947
960
|
0 9px 20px rgba(0, 0, 0, 0.24);
|
|
948
961
|
--ssh-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
|
|
962
|
+
--ssh-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.34);
|
|
949
963
|
--ssh-shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.48);
|
|
950
964
|
color-scheme: dark;
|
|
951
965
|
}
|
|
@@ -1127,7 +1141,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1127
1141
|
}
|
|
1128
1142
|
.dsh-ssh-sidebar-copy small {
|
|
1129
1143
|
color: var(--ssh-text-subtle);
|
|
1130
|
-
font-size:
|
|
1144
|
+
font-size: var(--ssh-type-caption);
|
|
1131
1145
|
}
|
|
1132
1146
|
.dsh-ssh-injected-mark {
|
|
1133
1147
|
display: inline-flex;
|
|
@@ -1138,7 +1152,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1138
1152
|
border-radius: 6px;
|
|
1139
1153
|
color: var(--ssh-success);
|
|
1140
1154
|
background: color-mix(in srgb, var(--ssh-success) 8%, transparent);
|
|
1141
|
-
font-size:
|
|
1155
|
+
font-size: var(--ssh-type-caption);
|
|
1142
1156
|
font-weight: 650;
|
|
1143
1157
|
line-height: 1;
|
|
1144
1158
|
white-space: nowrap;
|
|
@@ -1184,9 +1198,9 @@ body[data-ds-dark-theme] :is(
|
|
|
1184
1198
|
--ssh-adaptive-border: var(--ssh-border);
|
|
1185
1199
|
--ssh-adaptive-accent: var(--ssh-accent);
|
|
1186
1200
|
--ssh-adaptive-accent-strong: var(--ssh-accent-strong);
|
|
1187
|
-
--ssh-adaptive-raised-surface: var(--ssh-surface
|
|
1188
|
-
--ssh-adaptive-toolbar-surface: var(--ssh-
|
|
1189
|
-
--ssh-adaptive-drawer-surface: var(--ssh-
|
|
1201
|
+
--ssh-adaptive-raised-surface: var(--ssh-card-surface);
|
|
1202
|
+
--ssh-adaptive-toolbar-surface: var(--ssh-chrome-surface);
|
|
1203
|
+
--ssh-adaptive-drawer-surface: var(--ssh-activity-surface);
|
|
1190
1204
|
}
|
|
1191
1205
|
.dsh-ssh-workspace *,
|
|
1192
1206
|
.dsh-ssh-workspace *::before,
|
|
@@ -1395,11 +1409,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1395
1409
|
min-width: 0;
|
|
1396
1410
|
min-height: 0;
|
|
1397
1411
|
color: var(--ssh-text);
|
|
1398
|
-
background:
|
|
1399
|
-
radial-gradient(circle at 8% 0%, var(--ssh-ambient-light), transparent 34%),
|
|
1400
|
-
radial-gradient(circle at 96% 6%, var(--ssh-ambient-shadow), transparent 31%),
|
|
1401
|
-
linear-gradient(145deg, color-mix(in srgb, var(--ssh-surface-raised) 32%, transparent), transparent 58%),
|
|
1402
|
-
var(--ssh-canvas);
|
|
1412
|
+
background: var(--ssh-canvas);
|
|
1403
1413
|
font-family: var(--ssh-font-sans);
|
|
1404
1414
|
}
|
|
1405
1415
|
.dsh-ssh-toolbar {
|
|
@@ -1412,7 +1422,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1412
1422
|
padding: 0 20px;
|
|
1413
1423
|
border: 1px solid var(--ssh-glass-border);
|
|
1414
1424
|
border-radius: 18px;
|
|
1415
|
-
background: var(--ssh-
|
|
1425
|
+
background: var(--ssh-chrome-surface);
|
|
1416
1426
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
1417
1427
|
backdrop-filter: var(--ssh-glass-filter);
|
|
1418
1428
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -1443,7 +1453,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1443
1453
|
}
|
|
1444
1454
|
.dsh-ssh-brand small {
|
|
1445
1455
|
color: var(--ssh-text-subtle);
|
|
1446
|
-
font-size:
|
|
1456
|
+
font-size: var(--ssh-type-caption);
|
|
1447
1457
|
}
|
|
1448
1458
|
.dsh-ssh-segments {
|
|
1449
1459
|
display: flex;
|
|
@@ -1617,7 +1627,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1617
1627
|
border-radius: 8px;
|
|
1618
1628
|
outline: 0;
|
|
1619
1629
|
color: var(--ssh-text);
|
|
1620
|
-
background:
|
|
1630
|
+
background: var(--ssh-control-surface);
|
|
1621
1631
|
font: 400 12px/1.35 var(--ssh-font-sans);
|
|
1622
1632
|
}
|
|
1623
1633
|
.dsh-ssh-search input {
|
|
@@ -1640,8 +1650,8 @@ body[data-ds-dark-theme] :is(
|
|
|
1640
1650
|
border: 1px solid var(--ssh-border);
|
|
1641
1651
|
border-radius: 8px;
|
|
1642
1652
|
color: var(--ssh-text-muted);
|
|
1643
|
-
background: var(--ssh-surface
|
|
1644
|
-
font-size:
|
|
1653
|
+
background: var(--ssh-card-surface);
|
|
1654
|
+
font-size: var(--ssh-type-caption);
|
|
1645
1655
|
font-weight: 650;
|
|
1646
1656
|
}
|
|
1647
1657
|
.dsh-ssh-terminal-pane,
|
|
@@ -1670,7 +1680,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1670
1680
|
.dsh-ssh-content-heading p {
|
|
1671
1681
|
margin: 4px 0 0;
|
|
1672
1682
|
color: var(--ssh-text-subtle);
|
|
1673
|
-
font-size:
|
|
1683
|
+
font-size: var(--ssh-type-caption);
|
|
1674
1684
|
}
|
|
1675
1685
|
.dsh-ssh-heading-actions {
|
|
1676
1686
|
display: flex;
|
|
@@ -1710,7 +1720,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1710
1720
|
border: 1px solid var(--ssh-terminal-border);
|
|
1711
1721
|
border-radius: 12px;
|
|
1712
1722
|
background: var(--ssh-terminal-surface);
|
|
1713
|
-
box-shadow:
|
|
1723
|
+
box-shadow: var(--ssh-shadow-md);
|
|
1714
1724
|
}
|
|
1715
1725
|
.dsh-ssh-xterm {
|
|
1716
1726
|
box-sizing: border-box;
|
|
@@ -1763,8 +1773,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1763
1773
|
border-top: 1px solid var(--ssh-terminal-border);
|
|
1764
1774
|
color: var(--ssh-terminal-muted);
|
|
1765
1775
|
background: var(--ssh-terminal-raised);
|
|
1766
|
-
font:
|
|
1767
|
-
10px/1 var(--ssh-font-mono),
|
|
1776
|
+
font: var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
1768
1777
|
monospace;
|
|
1769
1778
|
}
|
|
1770
1779
|
.dsh-ssh-banner {
|
|
@@ -1774,7 +1783,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1774
1783
|
gap: 16px;
|
|
1775
1784
|
padding: 8px 18px;
|
|
1776
1785
|
border-bottom: 1px solid transparent;
|
|
1777
|
-
font-size:
|
|
1786
|
+
font-size: var(--ssh-type-caption);
|
|
1778
1787
|
}
|
|
1779
1788
|
.dsh-ssh-banner > span {
|
|
1780
1789
|
display: flex;
|
|
@@ -1811,7 +1820,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1811
1820
|
border-radius: 7px;
|
|
1812
1821
|
color: var(--ssh-danger);
|
|
1813
1822
|
background: color-mix(in srgb, var(--ssh-danger) 7%, transparent);
|
|
1814
|
-
font-size:
|
|
1823
|
+
font-size: var(--ssh-type-caption);
|
|
1815
1824
|
}
|
|
1816
1825
|
.dsh-ssh-empty-state {
|
|
1817
1826
|
display: grid;
|
|
@@ -1830,7 +1839,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1830
1839
|
border: 1px solid var(--ssh-border);
|
|
1831
1840
|
border-radius: 14px;
|
|
1832
1841
|
color: var(--ssh-accent);
|
|
1833
|
-
background: var(--ssh-surface
|
|
1842
|
+
background: var(--ssh-card-surface);
|
|
1834
1843
|
}
|
|
1835
1844
|
.dsh-ssh-empty-state h1 {
|
|
1836
1845
|
margin: 0;
|
|
@@ -1853,18 +1862,19 @@ body[data-ds-dark-theme] :is(
|
|
|
1853
1862
|
padding: 7px 10px;
|
|
1854
1863
|
border: 1px solid var(--ssh-border);
|
|
1855
1864
|
border-radius: 10px;
|
|
1865
|
+
background: var(--ssh-card-surface);
|
|
1856
1866
|
}
|
|
1857
1867
|
.dsh-ssh-switch-row > span {
|
|
1858
1868
|
display: grid;
|
|
1859
1869
|
gap: 3px;
|
|
1860
1870
|
}
|
|
1861
1871
|
.dsh-ssh-switch-row strong {
|
|
1862
|
-
font-size:
|
|
1872
|
+
font-size: var(--ssh-type-caption);
|
|
1863
1873
|
font-weight: 550;
|
|
1864
1874
|
}
|
|
1865
1875
|
.dsh-ssh-switch-row small {
|
|
1866
1876
|
color: var(--ssh-text-subtle);
|
|
1867
|
-
font-size:
|
|
1877
|
+
font-size: var(--ssh-type-caption);
|
|
1868
1878
|
line-height: 1.35;
|
|
1869
1879
|
}
|
|
1870
1880
|
.dsh-ssh-switch-row input {
|
|
@@ -1885,7 +1895,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1885
1895
|
padding: 6px 10px;
|
|
1886
1896
|
border: 1px solid var(--ssh-border);
|
|
1887
1897
|
border-radius: 10px;
|
|
1888
|
-
background:
|
|
1898
|
+
background: var(--ssh-card-surface);
|
|
1889
1899
|
}
|
|
1890
1900
|
.dsh-ssh-forward-kind {
|
|
1891
1901
|
display: grid;
|
|
@@ -1895,8 +1905,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1895
1905
|
border: 1px solid var(--ssh-border);
|
|
1896
1906
|
border-radius: 8px;
|
|
1897
1907
|
color: var(--ssh-accent-strong);
|
|
1898
|
-
font:
|
|
1899
|
-
600 11px/1 var(--ssh-font-mono),
|
|
1908
|
+
font: 600 var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
1900
1909
|
monospace;
|
|
1901
1910
|
}
|
|
1902
1911
|
.dsh-ssh-forward-copy {
|
|
@@ -1910,8 +1919,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1910
1919
|
.dsh-ssh-forward-copy small {
|
|
1911
1920
|
overflow: hidden;
|
|
1912
1921
|
color: var(--ssh-text-subtle);
|
|
1913
|
-
font:
|
|
1914
|
-
10px/1 var(--ssh-font-mono),
|
|
1922
|
+
font: var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
1915
1923
|
monospace;
|
|
1916
1924
|
text-overflow: ellipsis;
|
|
1917
1925
|
white-space: nowrap;
|
|
@@ -1925,7 +1933,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1925
1933
|
var(--ssh-text) 5%,
|
|
1926
1934
|
transparent
|
|
1927
1935
|
);
|
|
1928
|
-
font-size:
|
|
1936
|
+
font-size: var(--ssh-type-caption);
|
|
1929
1937
|
}
|
|
1930
1938
|
.dsh-ssh-state-label.is-running {
|
|
1931
1939
|
color: var(--ssh-success);
|
|
@@ -1961,18 +1969,18 @@ body[data-ds-dark-theme] :is(
|
|
|
1961
1969
|
padding: 6px 10px;
|
|
1962
1970
|
border: 1px solid var(--ssh-border);
|
|
1963
1971
|
border-radius: 10px;
|
|
1964
|
-
background:
|
|
1972
|
+
background: var(--ssh-card-surface);
|
|
1965
1973
|
}
|
|
1966
1974
|
.dsh-ssh-number-row > span {
|
|
1967
1975
|
display: grid;
|
|
1968
1976
|
gap: 3px;
|
|
1969
1977
|
}
|
|
1970
1978
|
.dsh-ssh-number-row strong {
|
|
1971
|
-
font-size:
|
|
1979
|
+
font-size: var(--ssh-type-caption);
|
|
1972
1980
|
}
|
|
1973
1981
|
.dsh-ssh-number-row small {
|
|
1974
1982
|
color: var(--ssh-text-subtle);
|
|
1975
|
-
font-size:
|
|
1983
|
+
font-size: var(--ssh-type-caption);
|
|
1976
1984
|
}
|
|
1977
1985
|
.dsh-ssh-number-row input {
|
|
1978
1986
|
height: 30px;
|
|
@@ -1980,7 +1988,7 @@ body[data-ds-dark-theme] :is(
|
|
|
1980
1988
|
}
|
|
1981
1989
|
.dsh-ssh-number-row em {
|
|
1982
1990
|
color: var(--ssh-text-subtle);
|
|
1983
|
-
font-size:
|
|
1991
|
+
font-size: var(--ssh-type-caption);
|
|
1984
1992
|
font-style: normal;
|
|
1985
1993
|
}
|
|
1986
1994
|
.dsh-ssh-dialog-modal {
|
|
@@ -2008,7 +2016,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2008
2016
|
border: 1px solid var(--ssh-glass-border);
|
|
2009
2017
|
border-radius: 14px;
|
|
2010
2018
|
color: var(--ssh-text);
|
|
2011
|
-
background: var(--ssh-
|
|
2019
|
+
background: var(--ssh-modal-surface);
|
|
2012
2020
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
2013
2021
|
backdrop-filter: var(--ssh-glass-filter);
|
|
2014
2022
|
box-shadow: var(--ssh-glass-shadow), var(--ssh-shadow-lg);
|
|
@@ -2032,7 +2040,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2032
2040
|
--ssh-border,
|
|
2033
2041
|
color-mix(in srgb, var(--ssh-text) 10%, transparent)
|
|
2034
2042
|
);
|
|
2035
|
-
background: color-mix(in srgb, var(--ssh-
|
|
2043
|
+
background: color-mix(in srgb, var(--ssh-modal-surface-raised) 88%, transparent);
|
|
2036
2044
|
-webkit-backdrop-filter: saturate(1.25) blur(20px);
|
|
2037
2045
|
backdrop-filter: saturate(1.25) blur(20px);
|
|
2038
2046
|
}
|
|
@@ -2045,7 +2053,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2045
2053
|
.dsh-ssh-dialog header p {
|
|
2046
2054
|
margin: 3px 0 0;
|
|
2047
2055
|
color: var(--ssh-text-subtle);
|
|
2048
|
-
font-size:
|
|
2056
|
+
font-size: var(--ssh-type-caption);
|
|
2049
2057
|
}
|
|
2050
2058
|
.dsh-ssh-form {
|
|
2051
2059
|
--ssh-border: color-mix(
|
|
@@ -2063,7 +2071,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2063
2071
|
padding: 14px;
|
|
2064
2072
|
border: 1px solid color-mix(in srgb, var(--ssh-border) 78%, transparent);
|
|
2065
2073
|
border-radius: var(--ssh-radius-surface);
|
|
2066
|
-
background: var(--ssh-modal-surface-raised);
|
|
2074
|
+
background: color-mix(in srgb, var(--ssh-modal-surface-raised) 74%, transparent);
|
|
2067
2075
|
}
|
|
2068
2076
|
.dsh-ssh-form-section-heading {
|
|
2069
2077
|
display: grid;
|
|
@@ -2077,7 +2085,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2077
2085
|
}
|
|
2078
2086
|
.dsh-ssh-form-section-heading small {
|
|
2079
2087
|
color: var(--ssh-text-subtle);
|
|
2080
|
-
font-size:
|
|
2088
|
+
font-size: var(--ssh-type-caption);
|
|
2081
2089
|
line-height: 1.4;
|
|
2082
2090
|
}
|
|
2083
2091
|
.dsh-ssh-form-grid {
|
|
@@ -2111,7 +2119,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2111
2119
|
}
|
|
2112
2120
|
.dsh-ssh-field small {
|
|
2113
2121
|
color: var(--ssh-text-subtle);
|
|
2114
|
-
font-size:
|
|
2122
|
+
font-size: var(--ssh-type-caption);
|
|
2115
2123
|
line-height: 1.4;
|
|
2116
2124
|
font-weight: 400;
|
|
2117
2125
|
}
|
|
@@ -2121,7 +2129,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2121
2129
|
gap: 10px;
|
|
2122
2130
|
margin-top: 2px;
|
|
2123
2131
|
color: var(--ssh-text-subtle);
|
|
2124
|
-
font-size:
|
|
2132
|
+
font-size: var(--ssh-type-caption);
|
|
2125
2133
|
font-weight: 600;
|
|
2126
2134
|
}
|
|
2127
2135
|
.dsh-ssh-form-divider:after {
|
|
@@ -2161,7 +2169,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2161
2169
|
.dsh-ssh-delete-profile > div:nth-child(2) { min-width: 0; }
|
|
2162
2170
|
.dsh-ssh-delete-profile > div:nth-child(2) strong { font-size: 13px; }
|
|
2163
2171
|
.dsh-ssh-delete-profile > div:nth-child(2) p,
|
|
2164
|
-
.dsh-ssh-delete-profile-block p { margin: 4px 0 0; color: var(--ssh-text-subtle); font-size:
|
|
2172
|
+
.dsh-ssh-delete-profile-block p { margin: 4px 0 0; color: var(--ssh-text-subtle); font-size: var(--ssh-type-caption); line-height: 1.55; }
|
|
2165
2173
|
.dsh-ssh-delete-profile-block,
|
|
2166
2174
|
.dsh-ssh-delete-profile > .dsh-ssh-inline-error,
|
|
2167
2175
|
.dsh-ssh-delete-profile > .dsh-ssh-dialog-actions { grid-column: 1 / -1; }
|
|
@@ -2171,7 +2179,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2171
2179
|
padding: 10px 11px;
|
|
2172
2180
|
background: color-mix(in srgb, var(--ssh-warning) 7%, transparent);
|
|
2173
2181
|
}
|
|
2174
|
-
.dsh-ssh-delete-profile-block strong { color: color-mix(in srgb, var(--ssh-warning) 82%, var(--ssh-text)); font-size:
|
|
2182
|
+
.dsh-ssh-delete-profile-block strong { color: color-mix(in srgb, var(--ssh-warning) 82%, var(--ssh-text)); font-size: var(--ssh-type-caption); }
|
|
2175
2183
|
.dsh-ssh-form .dsh-ssh-switch-row {
|
|
2176
2184
|
margin: 0;
|
|
2177
2185
|
}
|
|
@@ -2333,7 +2341,18 @@ body[data-ds-dark-theme] :is(
|
|
|
2333
2341
|
.dsh-ssh-dialog-modal,
|
|
2334
2342
|
.dsh-ssh-preview-modal,
|
|
2335
2343
|
.dsh-ssh-session-create-modal {
|
|
2336
|
-
--ssh-
|
|
2344
|
+
--ssh-canvas: #e9e9ed;
|
|
2345
|
+
--ssh-panel: #f2f3f7;
|
|
2346
|
+
--ssh-surface: #f2f3f7;
|
|
2347
|
+
--ssh-surface-raised: #f8f8fa;
|
|
2348
|
+
--ssh-card-surface: #f8f8fa;
|
|
2349
|
+
--ssh-control: #ffffff;
|
|
2350
|
+
--ssh-control-surface: #ffffff;
|
|
2351
|
+
--ssh-chrome-surface: #f2f3f7;
|
|
2352
|
+
--ssh-modal-surface: #f8f8fa;
|
|
2353
|
+
--ssh-modal-surface-raised: #ffffff;
|
|
2354
|
+
--ssh-activity-surface: #f2f3f7;
|
|
2355
|
+
--ssh-activity-surface-raised: #ffffff;
|
|
2337
2356
|
}
|
|
2338
2357
|
body[data-ds-dark-theme] :is(
|
|
2339
2358
|
.dsh-ssh-sidebar,
|
|
@@ -2343,7 +2362,18 @@ body[data-ds-dark-theme] :is(
|
|
|
2343
2362
|
.dsh-ssh-preview-modal,
|
|
2344
2363
|
.dsh-ssh-session-create-modal
|
|
2345
2364
|
) {
|
|
2365
|
+
--ssh-canvas: #1c1c1e;
|
|
2346
2366
|
--ssh-panel: #2c2c2e;
|
|
2367
|
+
--ssh-surface: #2c2c2e;
|
|
2368
|
+
--ssh-surface-raised: #323235;
|
|
2369
|
+
--ssh-card-surface: #323235;
|
|
2370
|
+
--ssh-control: #3a3a3c;
|
|
2371
|
+
--ssh-control-surface: #3a3a3c;
|
|
2372
|
+
--ssh-chrome-surface: #2c2c2e;
|
|
2373
|
+
--ssh-modal-surface: #2c2c2e;
|
|
2374
|
+
--ssh-modal-surface-raised: #3a3a3c;
|
|
2375
|
+
--ssh-activity-surface: #1c1c1e;
|
|
2376
|
+
--ssh-activity-surface-raised: #2c2c2e;
|
|
2347
2377
|
}
|
|
2348
2378
|
.dsh-ssh-dialog > header,
|
|
2349
2379
|
.dsh-ssh-toolbar,
|
|
@@ -2407,7 +2437,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2407
2437
|
min-height: 0;
|
|
2408
2438
|
flex-direction: column;
|
|
2409
2439
|
color: var(--ssh-text);
|
|
2410
|
-
background: var(--ssh-
|
|
2440
|
+
background: var(--ssh-activity-surface);
|
|
2411
2441
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
2412
2442
|
backdrop-filter: var(--ssh-glass-filter);
|
|
2413
2443
|
box-shadow: inset 1px 0 0 var(--ssh-glass-border);
|
|
@@ -2423,7 +2453,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2423
2453
|
padding: 0 14px 0 16px;
|
|
2424
2454
|
border: 1px solid var(--ssh-glass-border);
|
|
2425
2455
|
border-radius: 17px;
|
|
2426
|
-
background: var(--ssh-
|
|
2456
|
+
background: var(--ssh-chrome-surface);
|
|
2427
2457
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
2428
2458
|
backdrop-filter: var(--ssh-glass-filter);
|
|
2429
2459
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -2457,8 +2487,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2457
2487
|
.dsh-ssh-activity-header small {
|
|
2458
2488
|
overflow: hidden;
|
|
2459
2489
|
color: var(--ssh-text-subtle);
|
|
2460
|
-
font:
|
|
2461
|
-
10px/1.25 var(--ssh-font-mono),
|
|
2490
|
+
font: var(--ssh-type-caption)/1.25 var(--ssh-font-mono),
|
|
2462
2491
|
monospace;
|
|
2463
2492
|
text-overflow: ellipsis;
|
|
2464
2493
|
white-space: nowrap;
|
|
@@ -2490,7 +2519,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2490
2519
|
border-radius: 7px;
|
|
2491
2520
|
color: var(--ssh-text-muted);
|
|
2492
2521
|
background: transparent;
|
|
2493
|
-
font: 550
|
|
2522
|
+
font: 550 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
2494
2523
|
cursor: pointer;
|
|
2495
2524
|
}
|
|
2496
2525
|
.dsh-ssh-activity-tabs button:hover {
|
|
@@ -2518,7 +2547,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2518
2547
|
.dsh-ssh-activity-state {
|
|
2519
2548
|
margin: 20px 4px;
|
|
2520
2549
|
color: var(--ssh-text-subtle);
|
|
2521
|
-
font-size:
|
|
2550
|
+
font-size: var(--ssh-type-caption);
|
|
2522
2551
|
}
|
|
2523
2552
|
.dsh-ssh-sftp {
|
|
2524
2553
|
position: relative;
|
|
@@ -2559,7 +2588,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2559
2588
|
.dsh-ssh-sftp-dropzone small {
|
|
2560
2589
|
overflow: hidden;
|
|
2561
2590
|
color: var(--ssh-text-subtle);
|
|
2562
|
-
font:
|
|
2591
|
+
font: var(--ssh-type-caption)/1.4 var(--ssh-font-mono), monospace;
|
|
2563
2592
|
text-overflow: ellipsis;
|
|
2564
2593
|
white-space: nowrap;
|
|
2565
2594
|
}
|
|
@@ -2597,8 +2626,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2597
2626
|
.dsh-ssh-sftp-hostbar small {
|
|
2598
2627
|
overflow: hidden;
|
|
2599
2628
|
color: var(--ssh-text-subtle);
|
|
2600
|
-
font:
|
|
2601
|
-
10px/1.2 var(--ssh-font-mono),
|
|
2629
|
+
font: var(--ssh-type-caption)/1.2 var(--ssh-font-mono),
|
|
2602
2630
|
monospace;
|
|
2603
2631
|
text-overflow: ellipsis;
|
|
2604
2632
|
white-space: nowrap;
|
|
@@ -2635,8 +2663,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2635
2663
|
min-width: 0;
|
|
2636
2664
|
padding: 0 10px;
|
|
2637
2665
|
outline: 0;
|
|
2638
|
-
font:
|
|
2639
|
-
10px/1 var(--ssh-font-mono),
|
|
2666
|
+
font: var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
2640
2667
|
monospace;
|
|
2641
2668
|
}
|
|
2642
2669
|
.dsh-ssh-sftp-pathbar .dsh-ssh-sftp-upload-button {
|
|
@@ -2646,7 +2673,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2646
2673
|
padding: 0 10px;
|
|
2647
2674
|
color: var(--ssh-on-accent);
|
|
2648
2675
|
background: var(--ssh-accent);
|
|
2649
|
-
font: 550
|
|
2676
|
+
font: 550 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
2650
2677
|
}
|
|
2651
2678
|
.dsh-ssh-directory-error {
|
|
2652
2679
|
margin: 0 0 8px;
|
|
@@ -2654,7 +2681,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2654
2681
|
border-radius: 7px;
|
|
2655
2682
|
color: var(--ssh-danger);
|
|
2656
2683
|
background: color-mix(in srgb, var(--ssh-danger) 7%, transparent);
|
|
2657
|
-
font-size:
|
|
2684
|
+
font-size: var(--ssh-type-caption);
|
|
2658
2685
|
line-height: 1.4;
|
|
2659
2686
|
}
|
|
2660
2687
|
.dsh-ssh-sftp-table {
|
|
@@ -2682,7 +2709,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2682
2709
|
border-bottom: 1px solid var(--ssh-activity-border);
|
|
2683
2710
|
color: var(--ssh-text-subtle);
|
|
2684
2711
|
background: var(--ssh-activity-surface);
|
|
2685
|
-
font-size:
|
|
2712
|
+
font-size: var(--ssh-type-caption);
|
|
2686
2713
|
}
|
|
2687
2714
|
.dsh-ssh-sftp-row {
|
|
2688
2715
|
box-sizing: border-box;
|
|
@@ -2730,7 +2757,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2730
2757
|
}
|
|
2731
2758
|
.dsh-ssh-sftp-row strong {
|
|
2732
2759
|
overflow: hidden;
|
|
2733
|
-
font-size:
|
|
2760
|
+
font-size: var(--ssh-type-caption);
|
|
2734
2761
|
font-weight: 500;
|
|
2735
2762
|
line-height: 1.3;
|
|
2736
2763
|
text-overflow: ellipsis;
|
|
@@ -2739,8 +2766,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2739
2766
|
.dsh-ssh-sftp-row small {
|
|
2740
2767
|
overflow: hidden;
|
|
2741
2768
|
color: var(--ssh-text-subtle);
|
|
2742
|
-
font:
|
|
2743
|
-
10px/1.25 var(--ssh-font-mono),
|
|
2769
|
+
font: var(--ssh-type-caption)/1.25 var(--ssh-font-mono),
|
|
2744
2770
|
monospace;
|
|
2745
2771
|
text-overflow: ellipsis;
|
|
2746
2772
|
white-space: nowrap;
|
|
@@ -2749,7 +2775,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2749
2775
|
.dsh-ssh-sftp-row-delete:hover { color: var(--ssh-danger); background: color-mix(in srgb, var(--ssh-danger) 8%, transparent); }
|
|
2750
2776
|
.dsh-ssh-sftp-row-delete:active { transform: scale(.94); }
|
|
2751
2777
|
.dsh-ssh-sftp-row-delete:focus-visible { outline: 2px solid color-mix(in srgb, var(--ssh-danger) 42%, transparent); outline-offset: 1px; }
|
|
2752
|
-
.dsh-ssh-sftp-operation-status { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 0 8px 0 10px; border: 1px solid var(--ssh-activity-border); border-radius: 8px; color: var(--ssh-text-muted); background: var(--ssh-activity-surface-raised); font-size:
|
|
2778
|
+
.dsh-ssh-sftp-operation-status { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 0 8px 0 10px; border: 1px solid var(--ssh-activity-border); border-radius: 8px; color: var(--ssh-text-muted); background: var(--ssh-activity-surface-raised); font-size: var(--ssh-type-caption); }
|
|
2753
2779
|
.dsh-ssh-sftp-operation-status button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; border: 0; border-radius: 6px; color: var(--ssh-text-subtle); background: transparent; cursor: pointer; }
|
|
2754
2780
|
.dsh-ssh-sftp-operation-status button:hover { color: var(--ssh-text); background: var(--ssh-hover); }
|
|
2755
2781
|
.dsh-ssh-sftp-state {
|
|
@@ -2758,7 +2784,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2758
2784
|
min-height: 160px;
|
|
2759
2785
|
margin: 0;
|
|
2760
2786
|
color: var(--ssh-text-subtle);
|
|
2761
|
-
font-size:
|
|
2787
|
+
font-size: var(--ssh-type-caption);
|
|
2762
2788
|
}
|
|
2763
2789
|
.dsh-ssh-activity-empty {
|
|
2764
2790
|
display: grid;
|
|
@@ -2779,7 +2805,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2779
2805
|
max-width: 260px;
|
|
2780
2806
|
margin: 7px 0 0;
|
|
2781
2807
|
color: var(--ssh-text-subtle);
|
|
2782
|
-
font-size:
|
|
2808
|
+
font-size: var(--ssh-type-caption);
|
|
2783
2809
|
line-height: 1.5;
|
|
2784
2810
|
}
|
|
2785
2811
|
.dsh-ssh-terminal-observer {
|
|
@@ -2791,7 +2817,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2791
2817
|
border: 1px solid var(--ssh-terminal-border);
|
|
2792
2818
|
border-radius: 12px;
|
|
2793
2819
|
background: var(--ssh-terminal-surface);
|
|
2794
|
-
box-shadow:
|
|
2820
|
+
box-shadow: var(--ssh-shadow-md);
|
|
2795
2821
|
}
|
|
2796
2822
|
.dsh-ssh-terminal-observer-heading {
|
|
2797
2823
|
display: flex;
|
|
@@ -2820,14 +2846,13 @@ body[data-ds-dark-theme] :is(
|
|
|
2820
2846
|
}
|
|
2821
2847
|
.dsh-ssh-terminal-observer-heading small {
|
|
2822
2848
|
color: var(--ssh-terminal-muted);
|
|
2823
|
-
font:
|
|
2824
|
-
10px/1.2 var(--ssh-font-mono),
|
|
2849
|
+
font: var(--ssh-type-caption)/1.2 var(--ssh-font-mono),
|
|
2825
2850
|
monospace;
|
|
2826
2851
|
}
|
|
2827
2852
|
.dsh-ssh-terminal-state {
|
|
2828
2853
|
flex: none;
|
|
2829
2854
|
color: var(--ssh-terminal-muted);
|
|
2830
|
-
font-size:
|
|
2855
|
+
font-size: var(--ssh-type-caption);
|
|
2831
2856
|
}
|
|
2832
2857
|
.dsh-ssh-terminal-state.is-running {
|
|
2833
2858
|
color: var(--ssh-success);
|
|
@@ -2849,14 +2874,14 @@ body[data-ds-dark-theme] :is(
|
|
|
2849
2874
|
border: 1px solid var(--ssh-terminal-border);
|
|
2850
2875
|
border-radius: 7px;
|
|
2851
2876
|
color: var(--ssh-terminal-muted);
|
|
2852
|
-
background:
|
|
2853
|
-
font: 550
|
|
2877
|
+
background: color-mix(in srgb, var(--ssh-terminal-text) 3%, transparent);
|
|
2878
|
+
font: 550 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
2854
2879
|
cursor: pointer;
|
|
2855
2880
|
transition: color 120ms ease, border-color 120ms ease, background 120ms ease, transform 120ms ease;
|
|
2856
2881
|
}
|
|
2857
2882
|
.dsh-ssh-terminal-close:hover:not(:disabled) {
|
|
2858
2883
|
border-color: color-mix(in srgb, var(--ssh-danger) 34%, transparent);
|
|
2859
|
-
color:
|
|
2884
|
+
color: var(--ssh-danger);
|
|
2860
2885
|
background: color-mix(in srgb, var(--ssh-danger) 10%, transparent);
|
|
2861
2886
|
}
|
|
2862
2887
|
.dsh-ssh-terminal-close:active:not(:disabled) { transform: scale(.97); }
|
|
@@ -2906,11 +2931,11 @@ body[data-ds-dark-theme] :is(
|
|
|
2906
2931
|
white-space: nowrap;
|
|
2907
2932
|
}
|
|
2908
2933
|
.dsh-ssh-file-preview-title strong {
|
|
2909
|
-
font-size:
|
|
2934
|
+
font-size: var(--ssh-type-caption);
|
|
2910
2935
|
}
|
|
2911
2936
|
.dsh-ssh-file-preview-title small {
|
|
2912
2937
|
color: var(--ssh-text-subtle);
|
|
2913
|
-
font-size:
|
|
2938
|
+
font-size: var(--ssh-type-caption);
|
|
2914
2939
|
}
|
|
2915
2940
|
.dsh-ssh-file-preview-actions {
|
|
2916
2941
|
display: flex;
|
|
@@ -2950,8 +2975,7 @@ body[data-ds-dark-theme] :is(
|
|
|
2950
2975
|
padding: 12px;
|
|
2951
2976
|
color: var(--ssh-text);
|
|
2952
2977
|
background: transparent;
|
|
2953
|
-
font:
|
|
2954
|
-
10px/1.55 var(--ssh-font-mono),
|
|
2978
|
+
font: var(--ssh-type-caption)/1.55 var(--ssh-font-mono),
|
|
2955
2979
|
monospace;
|
|
2956
2980
|
white-space: pre-wrap;
|
|
2957
2981
|
overflow-wrap: anywhere;
|
|
@@ -3027,7 +3051,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3027
3051
|
.dsh-ssh-markdown-preview pre code {
|
|
3028
3052
|
padding: 0;
|
|
3029
3053
|
background: transparent;
|
|
3030
|
-
font-size:
|
|
3054
|
+
font-size: var(--ssh-type-caption);
|
|
3031
3055
|
}
|
|
3032
3056
|
.dsh-ssh-markdown-preview a {
|
|
3033
3057
|
color: var(--ssh-accent-strong);
|
|
@@ -3068,7 +3092,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3068
3092
|
.dsh-ssh-file-preview-body > small {
|
|
3069
3093
|
padding: 8px 12px;
|
|
3070
3094
|
color: var(--ssh-text-subtle);
|
|
3071
|
-
font-size:
|
|
3095
|
+
font-size: var(--ssh-type-caption);
|
|
3072
3096
|
}
|
|
3073
3097
|
.dsh-ssh-file-preview-body > img {
|
|
3074
3098
|
display: block;
|
|
@@ -3082,7 +3106,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3082
3106
|
height: 100%;
|
|
3083
3107
|
min-height: 420px;
|
|
3084
3108
|
border: 0;
|
|
3085
|
-
background:
|
|
3109
|
+
background: var(--ssh-modal-surface-raised);
|
|
3086
3110
|
}
|
|
3087
3111
|
.dsh-ssh-preview-modal {
|
|
3088
3112
|
--ssh-surface: var(--ssh-modal-surface);
|
|
@@ -3095,7 +3119,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3095
3119
|
border-color: var(--ssh-glass-border);
|
|
3096
3120
|
border-radius: 16px;
|
|
3097
3121
|
color: var(--ssh-text);
|
|
3098
|
-
background: var(--ssh-
|
|
3122
|
+
background: var(--ssh-modal-surface);
|
|
3099
3123
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
3100
3124
|
backdrop-filter: var(--ssh-glass-filter);
|
|
3101
3125
|
box-shadow: var(--ssh-glass-shadow), var(--ssh-shadow-lg);
|
|
@@ -3119,7 +3143,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3119
3143
|
gap: 16px;
|
|
3120
3144
|
padding: 0 14px 0 18px;
|
|
3121
3145
|
border-bottom: 1px solid var(--ssh-glass-separator);
|
|
3122
|
-
background: var(--ssh-
|
|
3146
|
+
background: var(--ssh-modal-surface-raised);
|
|
3123
3147
|
}
|
|
3124
3148
|
.dsh-ssh-preview-modal-shell > header > span:first-child {
|
|
3125
3149
|
display: grid;
|
|
@@ -3132,7 +3156,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3132
3156
|
}
|
|
3133
3157
|
.dsh-ssh-preview-modal-shell > header small {
|
|
3134
3158
|
color: var(--ssh-text-subtle);
|
|
3135
|
-
font-size:
|
|
3159
|
+
font-size: var(--ssh-type-caption);
|
|
3136
3160
|
}
|
|
3137
3161
|
.dsh-ssh-file-preview-body.is-modal > pre {
|
|
3138
3162
|
padding: 22px 24px 40px;
|
|
@@ -3158,12 +3182,12 @@ body[data-ds-dark-theme] :is(
|
|
|
3158
3182
|
color: var(--ssh-text-subtle);
|
|
3159
3183
|
}
|
|
3160
3184
|
.dsh-ssh-file-binary strong {
|
|
3161
|
-
font-size:
|
|
3185
|
+
font-size: var(--ssh-type-caption);
|
|
3162
3186
|
}
|
|
3163
3187
|
.dsh-ssh-file-binary p {
|
|
3164
3188
|
margin: 5px 0 12px;
|
|
3165
3189
|
color: var(--ssh-text-subtle);
|
|
3166
|
-
font-size:
|
|
3190
|
+
font-size: var(--ssh-type-caption);
|
|
3167
3191
|
}
|
|
3168
3192
|
.dsh-ssh-file-binary a {
|
|
3169
3193
|
display: inline-flex;
|
|
@@ -3175,7 +3199,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3175
3199
|
border-radius: 8px;
|
|
3176
3200
|
color: var(--ssh-text);
|
|
3177
3201
|
background: var(--ssh-control);
|
|
3178
|
-
font-size:
|
|
3202
|
+
font-size: var(--ssh-type-caption);
|
|
3179
3203
|
text-decoration: none;
|
|
3180
3204
|
}
|
|
3181
3205
|
.dsh-ssh-terminal-workbench {
|
|
@@ -3206,7 +3230,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3206
3230
|
border-radius: 7px;
|
|
3207
3231
|
color: var(--ssh-text-muted);
|
|
3208
3232
|
background: transparent;
|
|
3209
|
-
font: 500
|
|
3233
|
+
font: 500 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
3210
3234
|
white-space: nowrap;
|
|
3211
3235
|
cursor: pointer;
|
|
3212
3236
|
flex: 0 0 min(120px, 42%);
|
|
@@ -3255,9 +3279,9 @@ body[data-ds-dark-theme] :is(
|
|
|
3255
3279
|
margin: 0;
|
|
3256
3280
|
padding: 6px 8px;
|
|
3257
3281
|
border-radius: 6px;
|
|
3258
|
-
color:
|
|
3259
|
-
background:
|
|
3260
|
-
font-size:
|
|
3282
|
+
color: var(--ssh-danger);
|
|
3283
|
+
background: color-mix(in srgb, var(--ssh-danger) 14%, transparent);
|
|
3284
|
+
font-size: var(--ssh-type-caption);
|
|
3261
3285
|
}
|
|
3262
3286
|
|
|
3263
3287
|
.dsh-ssh-sftp-row:active,
|
|
@@ -3291,7 +3315,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3291
3315
|
padding: 5px 8px;
|
|
3292
3316
|
border: 1px solid var(--ssh-border);
|
|
3293
3317
|
border-radius: 10px;
|
|
3294
|
-
background:
|
|
3318
|
+
background: var(--ssh-card-surface);
|
|
3295
3319
|
transition:
|
|
3296
3320
|
background 140ms ease,
|
|
3297
3321
|
border-color 140ms ease;
|
|
@@ -3333,21 +3357,21 @@ body[data-ds-dark-theme] :is(
|
|
|
3333
3357
|
.dsh-ssh-vault-row small,
|
|
3334
3358
|
.dsh-ssh-proxy-row small {
|
|
3335
3359
|
color: var(--ssh-text-subtle);
|
|
3336
|
-
font-size:
|
|
3360
|
+
font-size: var(--ssh-type-caption);
|
|
3337
3361
|
}
|
|
3338
3362
|
.dsh-ssh-proxy-kind {
|
|
3339
3363
|
padding: 3px 7px;
|
|
3340
3364
|
border-radius: 6px;
|
|
3341
3365
|
color: var(--ssh-accent-strong);
|
|
3342
3366
|
background: color-mix(in srgb, var(--ssh-accent) 9%, transparent);
|
|
3343
|
-
font: 600
|
|
3367
|
+
font: 600 var(--ssh-type-caption)/1 var(--ssh-font-mono), monospace;
|
|
3344
3368
|
}
|
|
3345
3369
|
.dsh-ssh-vault-state {
|
|
3346
3370
|
padding: 3px 7px;
|
|
3347
3371
|
border-radius: 6px;
|
|
3348
3372
|
color: var(--ssh-danger);
|
|
3349
3373
|
background: color-mix(in srgb, var(--ssh-danger) 7%, transparent);
|
|
3350
|
-
font-size:
|
|
3374
|
+
font-size: var(--ssh-type-caption);
|
|
3351
3375
|
}
|
|
3352
3376
|
.dsh-ssh-vault-state.is-ready {
|
|
3353
3377
|
color: var(--ssh-accent-strong);
|
|
@@ -3380,7 +3404,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3380
3404
|
max-width: 360px;
|
|
3381
3405
|
margin: 7px 0 16px;
|
|
3382
3406
|
color: var(--ssh-text-muted);
|
|
3383
|
-
font-size:
|
|
3407
|
+
font-size: var(--ssh-type-caption);
|
|
3384
3408
|
line-height: 1.55;
|
|
3385
3409
|
}
|
|
3386
3410
|
.dsh-ssh-credential-reference {
|
|
@@ -3412,15 +3436,15 @@ body[data-ds-dark-theme] :is(
|
|
|
3412
3436
|
gap: 3px;
|
|
3413
3437
|
}
|
|
3414
3438
|
.dsh-ssh-credential-reference strong {
|
|
3415
|
-
font-size:
|
|
3439
|
+
font-size: var(--ssh-type-caption);
|
|
3416
3440
|
}
|
|
3417
3441
|
.dsh-ssh-credential-reference small {
|
|
3418
3442
|
color: var(--ssh-text-subtle);
|
|
3419
|
-
font-size:
|
|
3443
|
+
font-size: var(--ssh-type-caption);
|
|
3420
3444
|
}
|
|
3421
3445
|
.dsh-ssh-credential-reference em {
|
|
3422
3446
|
color: var(--ssh-accent-strong);
|
|
3423
|
-
font-size:
|
|
3447
|
+
font-size: var(--ssh-type-caption);
|
|
3424
3448
|
font-style: normal;
|
|
3425
3449
|
}
|
|
3426
3450
|
.dsh-ssh-jump-chain {
|
|
@@ -3430,18 +3454,18 @@ body[data-ds-dark-theme] :is(
|
|
|
3430
3454
|
padding: 10px;
|
|
3431
3455
|
border: 1px solid var(--ssh-border);
|
|
3432
3456
|
border-radius: 10px;
|
|
3433
|
-
background:
|
|
3457
|
+
background: var(--ssh-card-surface);
|
|
3434
3458
|
}
|
|
3435
3459
|
.dsh-ssh-jump-chain legend {
|
|
3436
3460
|
padding: 0 5px;
|
|
3437
3461
|
color: var(--ssh-text-muted);
|
|
3438
|
-
font-size:
|
|
3462
|
+
font-size: var(--ssh-type-caption);
|
|
3439
3463
|
font-weight: 600;
|
|
3440
3464
|
}
|
|
3441
3465
|
.dsh-ssh-jump-chain > p {
|
|
3442
3466
|
margin: 0;
|
|
3443
3467
|
color: var(--ssh-text-subtle);
|
|
3444
|
-
font-size:
|
|
3468
|
+
font-size: var(--ssh-type-caption);
|
|
3445
3469
|
}
|
|
3446
3470
|
.dsh-ssh-jump-chain > div {
|
|
3447
3471
|
display: grid;
|
|
@@ -3461,8 +3485,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3461
3485
|
border-radius: 6px;
|
|
3462
3486
|
color: var(--ssh-accent-strong);
|
|
3463
3487
|
background: color-mix(in srgb, var(--ssh-accent) 9%, transparent);
|
|
3464
|
-
font:
|
|
3465
|
-
600 10px/1 var(--ssh-font-mono),
|
|
3488
|
+
font: 600 var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
3466
3489
|
monospace;
|
|
3467
3490
|
font-style: normal;
|
|
3468
3491
|
}
|
|
@@ -3595,7 +3618,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3595
3618
|
border-radius: 8px;
|
|
3596
3619
|
color: var(--ssh-text-muted);
|
|
3597
3620
|
background: transparent;
|
|
3598
|
-
font: 550
|
|
3621
|
+
font: 550 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
3599
3622
|
text-align: left;
|
|
3600
3623
|
cursor: pointer;
|
|
3601
3624
|
}
|
|
@@ -3631,7 +3654,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3631
3654
|
box-sizing: border-box;
|
|
3632
3655
|
margin: 0;
|
|
3633
3656
|
border-radius: 10px;
|
|
3634
|
-
font-size:
|
|
3657
|
+
font-size: var(--ssh-type-caption);
|
|
3635
3658
|
}
|
|
3636
3659
|
.dsh-ssh-test-result.is-warning {
|
|
3637
3660
|
display: flex;
|
|
@@ -3654,8 +3677,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3654
3677
|
}
|
|
3655
3678
|
.dsh-ssh-test-result.is-warning code {
|
|
3656
3679
|
overflow: hidden;
|
|
3657
|
-
font:
|
|
3658
|
-
10px/1.3 var(--ssh-font-mono),
|
|
3680
|
+
font: var(--ssh-type-caption)/1.3 var(--ssh-font-mono),
|
|
3659
3681
|
monospace;
|
|
3660
3682
|
text-overflow: ellipsis;
|
|
3661
3683
|
white-space: nowrap;
|
|
@@ -3674,7 +3696,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3674
3696
|
margin: 0;
|
|
3675
3697
|
padding: 8px 10px;
|
|
3676
3698
|
color: var(--ssh-text-subtle);
|
|
3677
|
-
font:
|
|
3699
|
+
font: var(--ssh-type-caption)/1.4 var(--ssh-font-sans);
|
|
3678
3700
|
}
|
|
3679
3701
|
.dsh-ssh-profile-sftp-pane {
|
|
3680
3702
|
box-sizing: border-box;
|
|
@@ -3702,7 +3724,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3702
3724
|
.dsh-ssh-sftp.is-workspace .dsh-ssh-sftp-columns {
|
|
3703
3725
|
min-height: 34px;
|
|
3704
3726
|
padding: 0 12px;
|
|
3705
|
-
font-size:
|
|
3727
|
+
font-size: var(--ssh-type-caption);
|
|
3706
3728
|
}
|
|
3707
3729
|
.dsh-ssh-sftp.is-workspace .dsh-ssh-sftp-row {
|
|
3708
3730
|
min-height: 40px;
|
|
@@ -3713,10 +3735,10 @@ body[data-ds-dark-theme] :is(
|
|
|
3713
3735
|
background: var(--ssh-hover);
|
|
3714
3736
|
}
|
|
3715
3737
|
.dsh-ssh-sftp.is-workspace .dsh-ssh-sftp-row strong {
|
|
3716
|
-
font-size:
|
|
3738
|
+
font-size: var(--ssh-type-caption);
|
|
3717
3739
|
}
|
|
3718
3740
|
.dsh-ssh-sftp.is-workspace .dsh-ssh-sftp-row small {
|
|
3719
|
-
font-size:
|
|
3741
|
+
font-size: var(--ssh-type-caption);
|
|
3720
3742
|
}
|
|
3721
3743
|
.dsh-ssh-upload-conflict {
|
|
3722
3744
|
display: flex;
|
|
@@ -3740,14 +3762,13 @@ body[data-ds-dark-theme] :is(
|
|
|
3740
3762
|
min-width: 0;
|
|
3741
3763
|
}
|
|
3742
3764
|
.dsh-ssh-upload-conflict strong {
|
|
3743
|
-
font-size:
|
|
3765
|
+
font-size: var(--ssh-type-caption);
|
|
3744
3766
|
}
|
|
3745
3767
|
.dsh-ssh-upload-conflict small {
|
|
3746
3768
|
overflow: hidden;
|
|
3747
3769
|
max-width: 240px;
|
|
3748
3770
|
color: var(--ssh-text-subtle);
|
|
3749
|
-
font:
|
|
3750
|
-
10px/1 var(--ssh-font-mono),
|
|
3771
|
+
font: var(--ssh-type-caption)/1 var(--ssh-font-mono),
|
|
3751
3772
|
monospace;
|
|
3752
3773
|
text-overflow: ellipsis;
|
|
3753
3774
|
white-space: nowrap;
|
|
@@ -3759,7 +3780,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3759
3780
|
border-radius: 7px;
|
|
3760
3781
|
color: var(--ssh-text-muted);
|
|
3761
3782
|
background: var(--ssh-surface-raised);
|
|
3762
|
-
font-size:
|
|
3783
|
+
font-size: var(--ssh-type-caption);
|
|
3763
3784
|
cursor: pointer;
|
|
3764
3785
|
}
|
|
3765
3786
|
.dsh-ssh-upload-conflict button.is-primary {
|
|
@@ -3767,7 +3788,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3767
3788
|
color: var(--ssh-on-accent);
|
|
3768
3789
|
background: var(--ssh-accent-strong);
|
|
3769
3790
|
}
|
|
3770
|
-
`;var
|
|
3791
|
+
`;var Ip=`.dsh-ssh-workspace {
|
|
3771
3792
|
--ssh-adaptive-navigation-width: 304px;
|
|
3772
3793
|
}
|
|
3773
3794
|
|
|
@@ -3780,7 +3801,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3780
3801
|
margin: 10px 0 10px 10px;
|
|
3781
3802
|
border: 1px solid var(--ssh-glass-border);
|
|
3782
3803
|
border-radius: 18px;
|
|
3783
|
-
background: var(--ssh-
|
|
3804
|
+
background: var(--ssh-chrome-surface);
|
|
3784
3805
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
3785
3806
|
backdrop-filter: var(--ssh-glass-filter);
|
|
3786
3807
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -3812,7 +3833,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3812
3833
|
.dsh-ssh-tree-header small,
|
|
3813
3834
|
.dsh-ssh-access-heading small {
|
|
3814
3835
|
color: var(--ssh-text-subtle);
|
|
3815
|
-
font-size:
|
|
3836
|
+
font-size: var(--ssh-type-caption);
|
|
3816
3837
|
}
|
|
3817
3838
|
|
|
3818
3839
|
.dsh-ssh-remote-tree > .dsh-ssh-search {
|
|
@@ -3840,7 +3861,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3840
3861
|
margin: 0;
|
|
3841
3862
|
padding: 0 8px;
|
|
3842
3863
|
color: var(--ssh-text-subtle);
|
|
3843
|
-
font-size:
|
|
3864
|
+
font-size: var(--ssh-type-caption);
|
|
3844
3865
|
font-weight: 600;
|
|
3845
3866
|
}
|
|
3846
3867
|
|
|
@@ -3851,7 +3872,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3851
3872
|
place-items: center;
|
|
3852
3873
|
border-radius: 6px;
|
|
3853
3874
|
background: color-mix(in srgb, var(--ssh-text) 5%, transparent);
|
|
3854
|
-
font-size:
|
|
3875
|
+
font-size: var(--ssh-type-caption);
|
|
3855
3876
|
}
|
|
3856
3877
|
|
|
3857
3878
|
.dsh-ssh-tree-host {
|
|
@@ -3954,7 +3975,7 @@ body[data-ds-dark-theme] :is(
|
|
|
3954
3975
|
border-radius: 7px;
|
|
3955
3976
|
color: var(--ssh-text-subtle);
|
|
3956
3977
|
background: color-mix(in srgb, var(--ssh-surface-raised) 64%, transparent);
|
|
3957
|
-
font-size:
|
|
3978
|
+
font-size: var(--ssh-type-caption);
|
|
3958
3979
|
font-weight: 620;
|
|
3959
3980
|
line-height: 1;
|
|
3960
3981
|
white-space: nowrap;
|
|
@@ -4009,7 +4030,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4009
4030
|
|
|
4010
4031
|
.dsh-ssh-tree-host-main small {
|
|
4011
4032
|
color: var(--ssh-text-subtle);
|
|
4012
|
-
font:
|
|
4033
|
+
font: var(--ssh-type-caption)/1.25 var(--ssh-font-mono);
|
|
4013
4034
|
}
|
|
4014
4035
|
|
|
4015
4036
|
.dsh-ssh-tree-add,
|
|
@@ -4125,19 +4146,19 @@ body[data-ds-dark-theme] :is(
|
|
|
4125
4146
|
}
|
|
4126
4147
|
|
|
4127
4148
|
.dsh-ssh-tree-project-main strong {
|
|
4128
|
-
font-size:
|
|
4149
|
+
font-size: var(--ssh-type-caption);
|
|
4129
4150
|
font-weight: 570;
|
|
4130
4151
|
}
|
|
4131
4152
|
|
|
4132
4153
|
.dsh-ssh-tree-project-main small {
|
|
4133
4154
|
color: var(--ssh-text-subtle);
|
|
4134
|
-
font:
|
|
4155
|
+
font: var(--ssh-type-caption)/1.2 var(--ssh-font-mono);
|
|
4135
4156
|
}
|
|
4136
4157
|
|
|
4137
4158
|
.dsh-ssh-tree-project-main em {
|
|
4138
4159
|
overflow: hidden;
|
|
4139
4160
|
color: var(--ssh-accent-strong);
|
|
4140
|
-
font-size:
|
|
4161
|
+
font-size: var(--ssh-type-caption);
|
|
4141
4162
|
font-style: normal;
|
|
4142
4163
|
font-weight: 620;
|
|
4143
4164
|
line-height: 1.2;
|
|
@@ -4149,7 +4170,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4149
4170
|
.dsh-ssh-tree-state,
|
|
4150
4171
|
.dsh-ssh-tree-no-results {
|
|
4151
4172
|
color: var(--ssh-text-subtle);
|
|
4152
|
-
font-size:
|
|
4173
|
+
font-size: var(--ssh-type-caption);
|
|
4153
4174
|
}
|
|
4154
4175
|
|
|
4155
4176
|
.dsh-ssh-tree-empty {
|
|
@@ -4191,13 +4212,13 @@ body[data-ds-dark-theme] :is(
|
|
|
4191
4212
|
}
|
|
4192
4213
|
|
|
4193
4214
|
.dsh-ssh-access-heading strong {
|
|
4194
|
-
font-size:
|
|
4215
|
+
font-size: var(--ssh-type-caption);
|
|
4195
4216
|
font-weight: 620;
|
|
4196
4217
|
}
|
|
4197
4218
|
|
|
4198
4219
|
.dsh-ssh-access-heading em {
|
|
4199
4220
|
color: var(--ssh-text-subtle);
|
|
4200
|
-
font-size:
|
|
4221
|
+
font-size: var(--ssh-type-caption);
|
|
4201
4222
|
font-style: normal;
|
|
4202
4223
|
}
|
|
4203
4224
|
|
|
@@ -4220,7 +4241,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4220
4241
|
color: var(--ssh-text-subtle);
|
|
4221
4242
|
background: transparent;
|
|
4222
4243
|
background-image: none;
|
|
4223
|
-
font-size:
|
|
4244
|
+
font-size: var(--ssh-type-caption);
|
|
4224
4245
|
font-weight: 550;
|
|
4225
4246
|
cursor: pointer;
|
|
4226
4247
|
transition:
|
|
@@ -4266,13 +4287,13 @@ body[data-ds-dark-theme] :is(
|
|
|
4266
4287
|
}
|
|
4267
4288
|
|
|
4268
4289
|
.dsh-ssh-access-approval strong {
|
|
4269
|
-
font-size:
|
|
4290
|
+
font-size: var(--ssh-type-caption);
|
|
4270
4291
|
font-weight: 560;
|
|
4271
4292
|
}
|
|
4272
4293
|
|
|
4273
4294
|
.dsh-ssh-access-approval small {
|
|
4274
4295
|
color: var(--ssh-text-subtle);
|
|
4275
|
-
font-size:
|
|
4296
|
+
font-size: var(--ssh-type-caption);
|
|
4276
4297
|
}
|
|
4277
4298
|
|
|
4278
4299
|
.dsh-ssh-access-approval > i {
|
|
@@ -4370,7 +4391,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4370
4391
|
|
|
4371
4392
|
.dsh-ssh-session-create-shell header p {
|
|
4372
4393
|
color: var(--ssh-text-subtle);
|
|
4373
|
-
font-size:
|
|
4394
|
+
font-size: var(--ssh-type-caption);
|
|
4374
4395
|
}
|
|
4375
4396
|
|
|
4376
4397
|
.dsh-ssh-session-create-shell > form {
|
|
@@ -4408,7 +4429,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4408
4429
|
|
|
4409
4430
|
.dsh-ssh-session-create-target dt {
|
|
4410
4431
|
color: var(--ssh-text-subtle);
|
|
4411
|
-
font-size:
|
|
4432
|
+
font-size: var(--ssh-type-caption);
|
|
4412
4433
|
font-weight: 560;
|
|
4413
4434
|
}
|
|
4414
4435
|
|
|
@@ -4423,7 +4444,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4423
4444
|
.dsh-ssh-session-create-target dd small {
|
|
4424
4445
|
overflow: hidden;
|
|
4425
4446
|
color: var(--ssh-text-subtle);
|
|
4426
|
-
font:
|
|
4447
|
+
font: var(--ssh-type-caption)/1.35 var(--ssh-font-mono);
|
|
4427
4448
|
text-overflow: ellipsis;
|
|
4428
4449
|
white-space: nowrap;
|
|
4429
4450
|
}
|
|
@@ -4446,7 +4467,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4446
4467
|
.dsh-ssh-workspace-picker > p {
|
|
4447
4468
|
margin: 4px 0 10px;
|
|
4448
4469
|
color: var(--ssh-text-subtle);
|
|
4449
|
-
font-size:
|
|
4470
|
+
font-size: var(--ssh-type-caption);
|
|
4450
4471
|
line-height: 1.5;
|
|
4451
4472
|
}
|
|
4452
4473
|
|
|
@@ -4526,7 +4547,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4526
4547
|
|
|
4527
4548
|
.dsh-ssh-workspace-option-copy small {
|
|
4528
4549
|
color: var(--ssh-text-subtle);
|
|
4529
|
-
font:
|
|
4550
|
+
font: var(--ssh-type-caption)/1.3 var(--ssh-font-mono);
|
|
4530
4551
|
}
|
|
4531
4552
|
|
|
4532
4553
|
.dsh-ssh-workspace-option em {
|
|
@@ -4534,7 +4555,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4534
4555
|
border-radius: 6px;
|
|
4535
4556
|
color: var(--ssh-text-subtle);
|
|
4536
4557
|
background: color-mix(in srgb, var(--ssh-text) 5%, transparent);
|
|
4537
|
-
font-size:
|
|
4558
|
+
font-size: var(--ssh-type-caption);
|
|
4538
4559
|
font-style: normal;
|
|
4539
4560
|
font-weight: 560;
|
|
4540
4561
|
white-space: nowrap;
|
|
@@ -4587,11 +4608,11 @@ body[data-ds-dark-theme] :is(
|
|
|
4587
4608
|
|
|
4588
4609
|
.dsh-ssh-workspace-picker-empty strong {
|
|
4589
4610
|
color: var(--ssh-text-muted);
|
|
4590
|
-
font-size:
|
|
4611
|
+
font-size: var(--ssh-type-caption);
|
|
4591
4612
|
}
|
|
4592
4613
|
|
|
4593
4614
|
.dsh-ssh-workspace-picker-empty small {
|
|
4594
|
-
font-size:
|
|
4615
|
+
font-size: var(--ssh-type-caption);
|
|
4595
4616
|
line-height: 1.4;
|
|
4596
4617
|
}
|
|
4597
4618
|
|
|
@@ -4653,7 +4674,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4653
4674
|
background: var(--ssh-panel);
|
|
4654
4675
|
}
|
|
4655
4676
|
}
|
|
4656
|
-
`;var
|
|
4677
|
+
`;var Lp=`.dsh-ssh-host-workbench {
|
|
4657
4678
|
display: flex;
|
|
4658
4679
|
width: 100%;
|
|
4659
4680
|
height: 100%;
|
|
@@ -4674,7 +4695,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4674
4695
|
padding: 8px 16px;
|
|
4675
4696
|
border: 1px solid var(--ssh-glass-border);
|
|
4676
4697
|
border-radius: 17px;
|
|
4677
|
-
background: var(--ssh-
|
|
4698
|
+
background: var(--ssh-chrome-surface);
|
|
4678
4699
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
4679
4700
|
backdrop-filter: var(--ssh-glass-filter);
|
|
4680
4701
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -4710,7 +4731,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4710
4731
|
|
|
4711
4732
|
.dsh-ssh-workbench-heading p {
|
|
4712
4733
|
color: var(--ssh-text-subtle);
|
|
4713
|
-
font:
|
|
4734
|
+
font: var(--ssh-type-caption)/1.25 var(--ssh-font-mono);
|
|
4714
4735
|
}
|
|
4715
4736
|
|
|
4716
4737
|
.dsh-ssh-workbench-split {
|
|
@@ -4815,7 +4836,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4815
4836
|
border-radius: 7px;
|
|
4816
4837
|
color: var(--ssh-text-muted);
|
|
4817
4838
|
background: color-mix(in srgb, var(--ssh-surface-raised) 68%, transparent);
|
|
4818
|
-
font: 600
|
|
4839
|
+
font: 600 var(--ssh-type-caption)/1 var(--ssh-font-mono);
|
|
4819
4840
|
letter-spacing: .08em;
|
|
4820
4841
|
}
|
|
4821
4842
|
|
|
@@ -4828,7 +4849,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4828
4849
|
.dsh-ssh-sftp-deferred p {
|
|
4829
4850
|
margin: 5px 0 0;
|
|
4830
4851
|
color: var(--ssh-text-subtle);
|
|
4831
|
-
font-size:
|
|
4852
|
+
font-size: var(--ssh-type-caption);
|
|
4832
4853
|
}
|
|
4833
4854
|
|
|
4834
4855
|
.dsh-ssh-terminal-pane.is-embedded,
|
|
@@ -4860,7 +4881,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4860
4881
|
.dsh-ssh-terminal-pane.is-embedded .dsh-ssh-terminal-frame {
|
|
4861
4882
|
min-height: 0;
|
|
4862
4883
|
border-radius: 10px;
|
|
4863
|
-
box-shadow:
|
|
4884
|
+
box-shadow: var(--ssh-shadow-md);
|
|
4864
4885
|
}
|
|
4865
4886
|
|
|
4866
4887
|
.dsh-ssh-profile-sftp-pane.is-embedded .dsh-ssh-sftp.is-workspace {
|
|
@@ -4918,18 +4939,14 @@ body[data-ds-dark-theme] :is(
|
|
|
4918
4939
|
background: var(--ssh-surface-raised);
|
|
4919
4940
|
}
|
|
4920
4941
|
}
|
|
4921
|
-
`;var Lp=require("react");function Op(e){(0,Lp.useEffect)(()=>{let t=e.current,r=t?.parentElement;if(t==null||r===null||r===void 0)return;let s=r,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&s.isConnected&&s.append(t)}},[e])}var pt=require("react"),wt=require("@deepseek-ai/dsh-client-ui-primitives");var ir=require("react"),ns=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function Mp({profile:e,project:t,workspaces:r,currentWorkspaceId:s,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=r.some(x=>String(x.workspaceId)===s)?s:r.some(x=>String(x.workspaceId)===o)?o:r[0]===void 0?void 0:String(r[0].workspaceId),[l,c]=(0,ir.useState)(h),[p,v]=(0,ir.useState)(!1),[g,u]=(0,ir.useState)(),d=(0,ir.useRef)(null),m=(0,ir.useRef)(null);(0,ir.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let f=()=>{p||n()},_=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u(j0(y)),v(!1)}}};return(0,ge.jsx)(ns.Modal,{open:!0,onClose:f,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",closeLabel:"\u5173\u95ED",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:U0,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:p,onClick:f,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(ns.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{_(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),r.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(ns.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:r.map(x=>{let y=String(x.workspaceId),w=y===s?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:p,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(ns.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),w&&(0,ge.jsx)("em",{children:w}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:p,onClick:f,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:p||l===void 0,children:p?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function U0(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),r=t[0],s=t[t.length-1];r===void 0||s===void 0||(e.shiftKey&&document.activeElement===r?(e.preventDefault(),s.focus()):!e.shiftKey&&document.activeElement===s&&(e.preventDefault(),r.focus()))}function j0(e){return e instanceof Error?e.message:String(e)}var re=require("react/jsx-runtime");function Bp(e){let t=_s(),[r,s]=(0,pt.useState)(""),[o,i]=(0,pt.useState)(()=>new Set),[n,a]=(0,pt.useState)({}),[h,l]=(0,pt.useState)(),[c,p]=(0,pt.useState)(),[v,g]=(0,pt.useState)(),[u,d]=(0,pt.useState)(),m=r.trim().toLocaleLowerCase(),f=(0,pt.useMemo)(()=>W0(e.profiles.filter(w=>q0(w).includes(m))),[m,e.profiles]),_=async w=>{l(w);try{let b=await Hl(w);a(S=>({...S,[w]:b})),d(void 0)}catch(b){d(kl(b))}finally{l(b=>b===w?void 0:b)}},x=w=>{i(new Set([w])),n[w]===void 0&&_(w),e.onSelect({profileId:w,path:"~"})},y=w=>{let b=e.access?.profileIds??[],S=b.includes(w);e.onProfiles(S?b.filter(T=>T!==w):[...b,w]),S&&e.onDirectory(w,void 0)};return(0,re.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,re.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,re.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,re.jsx)(wt.IconPlusOutline16,{size:16})})]}),(0,re.jsxs)("label",{className:"dsh-ssh-search",children:[(0,re.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,re.jsx)("input",{value:r,onChange:w=>s(w.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[f.map(w=>(0,re.jsxs)("section",{className:"dsh-ssh-tree-group",children:[(0,re.jsxs)("h3",{children:[(0,re.jsx)("span",{children:w.name}),(0,re.jsx)("small",{children:w.profiles.length})]}),w.profiles.map(b=>{let S=o.has(b.id),T=e.access?.profileIds.includes(b.id)===!0,R=n[b.id]??[],E=e.selected?.profileId===b.id&&e.selected.projectId===void 0;return(0,re.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":S,children:[(0,re.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${T?" is-authorized":""}${E?" is-active":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":E,"aria-expanded":S,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${b.name}`,onClick:()=>x(b.id),children:[(0,re.jsx)("span",{className:"dsh-ssh-host-monogram",children:b.name.slice(0,1).toUpperCase()}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:b.name}),(0,re.jsxs)("small",{children:[b.username,"@",b.host]})]})]}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${T?" is-mounted":""}`,"aria-label":`${T?"\u5378\u8F7D":"\u6302\u8F7D"} ${b.name}`,"aria-pressed":T,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":T?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>y(b.id),children:T?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${b.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>p({profile:b}),children:(0,re.jsx)(wt.IconPlusOutline16,{size:14})})]}),S&&(0,re.jsx)("div",{className:"dsh-ssh-tree-branches",children:h===b.id&&n[b.id]===void 0?(0,re.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):R.length===0?(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>p({profile:b}),children:[(0,re.jsx)(wt.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):R.map(A=>{let B=e.selected?.projectId===A.id,M=e.access?.workingProjectIds[b.id]===A.id;return(0,re.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,re.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${B?" is-active":""}${M?" is-bound":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:M,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":T?M?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{T&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(b.id,M?void 0:A.path,M?void 0:A.id),e.onSelect(M?{profileId:b.id,path:"~"}:{profileId:b.id,path:A.path,projectId:A.id}))},children:[(0,re.jsx)("span",{children:M?(0,re.jsx)(wt.IconFolderOpenOutline16,{size:15}):(0,re.jsx)(wt.IconFolderClose16,{size:15})}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:A.name}),(0,re.jsx)("small",{children:A.path}),M&&(0,re.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${A.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:H=>{d(void 0),g({profile:b,project:A,returnFocus:H.currentTarget})},children:(0,re.jsx)(wt.IconPlusOutline16,{size:13})}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${A.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>p({profile:b,project:A}),children:(0,re.jsx)(wt.IconEditOutline16,{size:13})})]})},A.id)})})]},b.id)})]},w.name)),f.length===0&&(0,re.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,re.jsx)($0,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??u,onPermission:e.onPermission,onApproval:e.onApproval}),c!==void 0&&(0,re.jsx)(V0,{profile:c.profile,project:c.project,onClose:()=>p(void 0),onSaved:async()=>{let w=c.profile.id;p(void 0),await _(w)}}),v!==void 0&&(0,re.jsx)(Mp,{...v,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>g(void 0),onCreate:e.onCreateSession})]})}function $0({access:e,loading:t,saving:r,error:s,onPermission:o,onApproval:i}){return(0,re.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,re.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,re.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,re.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":r?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,re.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,re.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,re.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,re.jsx)("i",{"aria-hidden":"true"})]}),s&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:s})]})}function V0({profile:e,project:t,onClose:r,onSaved:s}){let[o,i]=(0,pt.useState)(t?.name??""),[n,a]=(0,pt.useState)(t?.path??""),[h,l]=(0,pt.useState)(!1),[c,p]=(0,pt.useState)(),v=async u=>{u.preventDefault(),l(!0),p(void 0);try{t===void 0?await Ul(e.id,{name:o,path:n}):await jl(e.id,t.id,{name:o,path:n}),await s()}catch(d){p(kl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),p(void 0);try{await $l(e.id,t.id),await s()}catch(u){p(kl(u)),l(!1)}}};return(0,re.jsx)(et,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:r,children:(0,re.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u540D\u79F0"}),(0,re.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,re.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,re.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,re.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,re.jsx)(wt.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,re.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:r,children:"\u53D6\u6D88"}),(0,re.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function W0(e){let t=new Map;for(let r of e){let s=r.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(s);o===void 0?t.set(s,[r]):o.push(r)}return[...t].map(([r,s])=>({name:r,profiles:s}))}function q0(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function kl(e){return e instanceof Error?e.message:String(e)}var it=require("react");var Cl=new Set;function Ln(e){for(let t of Cl)t(e)}function Fp(e){return Cl.add(e),()=>Cl.delete(e)}function zp(e){let[t,r]=(0,it.useState)(null),[s,o]=(0,it.useState)(e!==void 0),[i,n]=(0,it.useState)(!1),[a,h]=(0,it.useState)(),l=(0,it.useRef)(null),c=(0,it.useRef)(e),p=(0,it.useRef)(Promise.resolve()),v=(0,it.useRef)(0);c.current=e,(0,it.useEffect)(()=>{let d=!1;return l.current=null,r(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(wi(e).then(m=>{if(d)return;let f=m??vi(e);l.current=f,r(f),Ln(f)}).catch(m=>{d||h(Np(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,it.useCallback)(async d=>{l.current=d,r(d),Ln(d),h(void 0),v.current+=1,n(!0);let m=p.current.catch(()=>{}).then(()=>Si(d));p.current=m;try{let f=await m;return c.current===f.sessionId&&l.current===d&&(l.current=f,r(f),Ln(f)),f}catch(f){throw c.current===d.sessionId&&h(Np(f)),f}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,it.useCallback)(d=>{let m=c.current;if(m===void 0)return;let f=l.current??vi(m);g({...f,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:s,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,f)=>{let _=c.current;if(_===void 0)return;let x=l.current??vi(_),y={...x.workingDirectories},w={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,f===void 0?delete w[d]:w[d]=f,u({workingDirectories:y,workingProjectIds:w})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function vi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function Np(e){return e instanceof Error?e.message:String(e)}var os=require("react"),Mn=require("react/jsx-runtime"),On=38,_i=28,bi=66,K0=320,X0=280,J0=7;function Hp(e,t,r){return Math.min(r,Math.max(t,e))}function G0(e){if(typeof window>"u")return On;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?Hp(t,_i,bi):On}catch{return On}}function El(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function Y0(e){if(e<=0)return{min:_i,max:bi};let t=X0/e*100,r=(e-K0-J0)/e*100,s=Math.max(_i,t),o=Math.max(s,Math.min(bi,r));return{min:s,max:o}}function Up({primary:e,secondary:t,storageKey:r,label:s}){let[o,i]=(0,os.useState)(()=>G0(r)),n=(0,os.useRef)(null),a=(0,os.useRef)(null),h=(0,os.useRef)(o),l=(0,os.useRef)(),c=f=>{let _=n.current;if(_===null)return f;let x=Y0(_.getBoundingClientRect().width),y=Hp(f,x.min,x.max);return _.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},p=f=>{if(l.current===void 0)return;let _=a.current;l.current=void 0,f!==void 0&&_?.hasPointerCapture(f)&&_.releasePointerCapture(f),n.current?.classList.remove("is-resizing");let x=h.current;i(x),El(r,x)},v=f=>{f.button===0&&(l.current=f.pointerId,h.current=o,f.currentTarget.setPointerCapture(f.pointerId),n.current?.classList.add("is-resizing"),f.preventDefault())},g=f=>{if(l.current!==f.pointerId)return;let _=n.current?.getBoundingClientRect();_===void 0||_.width===0||(c((_.right-f.clientX)/_.width*100),f.preventDefault())},u=f=>{let _=f.shiftKey?5:2,x;if(f.key==="ArrowLeft"&&(x=o+_),f.key==="ArrowRight"&&(x=o-_),f.key==="Home"&&(x=_i),f.key==="End"&&(x=bi),x===void 0)return;let y=c(x);i(y),El(r,y),f.preventDefault()},d=()=>{let f=c(On);i(f),El(r,f)},m={"--ssh-sftp-width":`${o}%`};return(0,Mn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Mn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":s,"aria-orientation":"vertical","aria-valuemin":_i,"aria-valuemax":bi,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:f=>p(f.pointerId),onPointerCancel:f=>p(f.pointerId),onLostPointerCapture:()=>p()}),t]})}var nr=require("react"),St=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function jp({profile:e,dependents:t,onClose:r,onDeleted:s}){let[o,i]=(0,nr.useState)(!1),[n,a]=(0,nr.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await ae(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),s()}catch(l){a(Pe(l))}finally{i(!1)}}};return(0,K.jsx)(et,{title:`\u5220\u9664 ${e.name}`,subtitle:Kt(e),onClose:r,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(St.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:r,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function $p({profile:e,profiles:t,vaultEntries:r,proxyEntries:s,onClose:o,onSaved:i}){let[n,a]=(0,nr.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,nr.useState)(!1),[c,p]=(0,nr.useState)(!1),[v,g]=(0,nr.useState)(),[u,d]=(0,nr.useState)(),[m,f]=(0,nr.useState)(),_=S=>({value:n[S],onChange:T=>{a(R=>({...R,[S]:T.target.value})),g(void 0),d(void 0)}}),x=r.find(S=>S.id===n.credentialId),y=(S=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...S?{hostFingerprint:S}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(R=>R.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async S=>{p(!0),f(void 0),g(void 0),d(void 0);try{await ae("/profiles/test-draft",{method:"POST",body:JSON.stringify({...y(S),...e===void 0?{}:{profileId:e.id}})}),S!==void 0&&a(T=>({...T,hostFingerprint:S})),g("success")}catch(T){T instanceof ar&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):f(Pe(T))}finally{p(!1)}},b=async S=>{S.preventDefault(),l(!0),f(void 0);try{await ae(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(y())}),i()}catch(T){f(Pe(T))}finally{l(!1)}};return(0,K.jsx)(et,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:S=>{b(S)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",..._("name")})}),(0,K.jsx)(pe,{label:"\u5206\u7EC4",children:(0,K.jsx)("input",{maxLength:64,placeholder:"\u4F8B\u5982\uFF1A\u751F\u4EA7\u73AF\u5883",..._("group")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(pe,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,..._("host")})}),(0,K.jsx)(pe,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",..._("port")})})]}),(0,K.jsx)(pe,{label:"\u6807\u7B7E",hint:"\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u82F1\u6587\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)("input",{placeholder:"production, linux",..._("tags")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(pe,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{..._("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),r.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.username]},S.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(St.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",..._("username")})}),(0,K.jsx)(pe,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{..._("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",..._("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(pe,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,..._("privateKey")})}),(0,K.jsx)(pe,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",..._("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(pe,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{..._("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(pe,{label:"\u5E38\u7528\u4EE3\u7406",hint:s.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,..._("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),s.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",S.host,":",S.port]},S.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(pe,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,..._("proxyHost")})}),(0,K.jsx)(pe,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",..._("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",..._("proxyUsername")})}),(0,K.jsx)(pe,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",..._("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(Q0,{profiles:t.filter(S=>S.id!==e?.id),value:n.jumpProfileIds,onChange:S=>a(T=>({...T,jumpProfileIds:S}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(St.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:S=>{S.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function Q0({profiles:e,value:t,onChange:r}){let s=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&r([...t,n.id])},o=(n,a)=>r(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],r(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(St.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(St.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>r(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(St.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:s,children:[(0,K.jsx)(St.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var _e=require("react"),At=require("@deepseek-ai/dsh-client-ui-primitives");var Vt=require("react"),Rt=require("@deepseek-ai/dsh-client-ui-primitives");var W=require("react/jsx-runtime");function Vp({profiles:e,vaultEntries:t,proxyEntries:r,onClose:s,onChanged:o}){let[i,n]=(0,Vt.useState)(),[a,h]=(0,Vt.useState)(),[l,c]=(0,Vt.useState)(),p=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await ae(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(f){c(Pe(f))}};return(0,W.jsx)(et,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:s,children:(0,W.jsxs)("div",{className:`dsh-ssh-ftp-manager${p?" has-detail":""}`,children:[(0,W.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,W.jsxs)("header",{children:[(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:"FTP / FTPS"}),(0,W.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,W.jsx)(Rt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,W.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,W.jsx)("span",{children:(0,W.jsx)(Rt.IconDataOutline16,{size:20})}),(0,W.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,W.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,W.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let f=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,W.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":f,className:f?"is-active":"",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,W.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:tx(m.protocol)}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{title:m.name,children:m.name}),(0,W.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,W.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,W.jsx)(Rt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,W.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,W.jsx)(Z0,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,W.jsx)(ex,{value:i==="new"?void 0:i,vaultEntries:t,proxyEntries:r,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,W.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,W.jsx)("span",{children:(0,W.jsx)(Rt.IconDataOutline16,{size:22})}),(0,W.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,W.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,W.jsxs)("dl",{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"FTPS"}),(0,W.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"FTP"}),(0,W.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"SFTP"}),(0,W.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function Z0({profile:e,error:t,onBack:r,onDelete:s}){let[o,i]=(0,Vt.useState)(!1);return(0,W.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:r,children:[(0,W.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,W.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,W.jsx)(Rt.IconWarningOutline16,{size:20})}),(0,W.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,W.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,W.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,W.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,W.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,disabled:o,children:"\u53D6\u6D88"}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),s().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function ex({value:e,vaultEntries:t,proxyEntries:r,onBack:s,onSaved:o}){let i=t.filter(y=>y.authType==="password"),[n,a]=(0,Vt.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??""}),[h,l]=(0,Vt.useState)(!1),[c,p]=(0,Vt.useState)(!1),[v,g]=(0,Vt.useState)(),[u,d]=(0,Vt.useState)(),m=()=>({profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},protocol:n.protocol,host:n.host,port:Number(n.port),username:n.username,...n.credentialId?{credentialId:n.credentialId}:{},proxy:n.proxyId?{type:"saved",proxyId:n.proxyId}:{type:"none"},initialPath:n.initialPath,connectTimeoutMs:Number(n.connectTimeoutMs),...n.tlsServerName.trim()?{tlsServerName:n.tlsServerName.trim()}:{}},secrets:{password:n.password}}),f=async y=>{y.preventDefault(),l(!0),d(void 0),g(void 0);try{await ae(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(m())}),o()}catch(w){d(Pe(w))}finally{l(!1)}},_=async()=>{p(!0),d(void 0),g(void 0);try{await ae("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...m(),...e===void 0?{}:{profileId:e.id}})}),g("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(y){d(Pe(y))}finally{p(!1)}},x=y=>a(w=>({...w,protocol:y,port:w.port==="21"||w.port==="990"?String(y==="ftps-implicit"?990:21):w.port}));return(0,W.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:y=>{f(y)},children:[(0,W.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,W.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,W.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,W.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,W.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,W.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(y=>(0,W.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":n.protocol===y[0],className:n.protocol===y[0]?"is-active":"",onClick:()=>x(y[0]),children:[(0,W.jsx)("span",{className:`dsh-ssh-protocol-badge is-${y[0]}`,children:y[1]}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:y[1]}),(0,W.jsx)("small",{children:y[2]})]})]},y[0]))}),n.protocol==="ftp"&&(0,W.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,W.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u7528\u4E8E\u533A\u5206\u73AF\u5883\u6216\u7528\u9014"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,W.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:n.name,onChange:y=>a({...n,name:y.target.value})})}),(0,W.jsx)(pe,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,W.jsx)("input",{maxLength:64,value:n.group,onChange:y=>a({...n,group:y.target.value})})})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,W.jsx)(pe,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,W.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:n.host,onChange:y=>a({...n,host:y.target.value})})}),(0,W.jsx)(pe,{label:"\u7AEF\u53E3",children:(0,W.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:n.port,onChange:y=>a({...n,port:y.target.value})})})]})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,W.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,W.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:n.username,onChange:y=>a({...n,username:y.target.value})})}),(0,W.jsx)(pe,{label:"\u51ED\u636E\u6765\u6E90",children:(0,W.jsxs)("select",{value:n.credentialId,onChange:y=>a({...n,credentialId:y.target.value}),children:[(0,W.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),i.map(y=>(0,W.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.username]},y.id))]})})]}),!n.credentialId&&(0,W.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,W.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:n.password,onChange:y=>a({...n,password:y.target.value})})})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,W.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,W.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:n.initialPath,onChange:y=>a({...n,initialPath:y.target.value})})}),(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,W.jsxs)("select",{value:n.proxyId,onChange:y=>a({...n,proxyId:y.target.value}),children:[(0,W.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(y=>(0,W.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.proxyType.toUpperCase()]},y.id))]})})]}),(0,W.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,W.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,W.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:n.connectTimeoutMs,onChange:y=>a({...n,connectTimeoutMs:y.target.value})})}),(0,W.jsx)(pe,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,W.jsx)("input",{maxLength:253,spellCheck:!1,value:n.tlsServerName,onChange:y=>a({...n,tlsServerName:y.target.value})})})]})]})]}),v&&(0,W.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:v}),u&&(0,W.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:u})]}),(0,W.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{_()},disabled:c||h,children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,W.jsx)("span",{}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:h||c,children:"\u53D6\u6D88"}),(0,W.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function tx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}var F=require("react/jsx-runtime"),qp="dsh-ssh:file-transfer:tabs:v2",Tl=38;function Kp({ftpProfiles:e,vaultEntries:t,proxyEntries:r,access:s,onProfilesChanged:o}){let[i,n]=(0,_e.useState)([]),[a,h]=(0,_e.useState)([]),[l,c]=(0,_e.useState)(()=>dx()),[p,v]=(0,_e.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,_e.useState)(!1),[d,m]=(0,_e.useState)(!1),[f,_]=(0,_e.useState)(),[x,y]=(0,_e.useState)(),[w,b]=(0,_e.useState)(),[S,T]=(0,_e.useState)({}),R=(0,_e.useRef)(new Map),E=(0,_e.useCallback)(async()=>{try{let D=await Il();n(D),c(L=>ux(L,D))}catch(D){b(Pe(D))}},[]);(0,_e.useEffect)(()=>{E()},[E,e]),(0,_e.useEffect)(()=>{try{localStorage.setItem(qp,JSON.stringify(l))}catch{}},[l]),(0,_e.useEffect)(()=>{let D=R.current,L=a.filter(k=>Wp(k.state)&&D.has(k.id)&&!Wp(D.get(k.id)));R.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&T(k=>{let U={...k};for(let J of L){let O=Bn(J.request.destinationEndpointId,J.request.destinationDirectory);U[O]=(U[O]??0)+1}return U})},[a]),(0,_e.useEffect)(()=>{let D=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let U=await Ml();D||h(U)}catch{}D||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{D=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(D=>D.id===p)??l[0],B=D=>c(L=>L.map(k=>k.id===A?.id?D(k):k)),M=()=>{let D=`transfer-${Date.now().toString(36)}`,L=Pl(D,l.length+1);c(k=>[...k,L]),v(D)},H=D=>{if(l.length===1)return;let L=l.findIndex(U=>U.id===D),k=l.filter(U=>U.id!==D);c(k),p===D&&v(k[Math.max(0,L-1)].id)},z=D=>B(L=>({...L,panes:Array.from({length:D},(k,U)=>L.panes[U]??Fn(`${L.id}-pane-${U}`))})),j=async(D,L,k,U,J)=>{let O={endpointId:D,directory:L},ee={endpointId:U,directory:J};if(!(Zs(O,ee)||!ei(O,k,ee)))try{b(void 0);let N=await Fs({sourceEndpointId:D,sourcePaths:k,destinationEndpointId:U,destinationDirectory:J,conflictPolicy:"fail"});h(P=>[N,...P.filter($=>$.id!==N.id)])}catch(N){b(Pe(N))}},C=async(D,L,k)=>{try{b(void 0);let U=await ln(D,{paneId:L.id,endpointId:L.endpointId,directory:k});U.job!==void 0&&h(J=>[U.job,...J.filter(O=>O.id!==U.job.id)]),U.operation==="move"&&T(J=>{let O={...J};for(let ee of[Bn(D.endpointId,D.directory),Bn(L.endpointId,k)])O[ee]=(O[ee]??0)+1;return O})}catch(U){b(Pe(U))}};return(0,F.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,F.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,F.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,F.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",s.value?.fileEndpointIds.length??0]}),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),w&&(0,F.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,F.jsx)("span",{children:w}),(0,F.jsx)("button",{type:"button",onClick:()=>b(void 0),"aria-label":"\u5173\u95ED",children:(0,F.jsx)(At.IconCloseOutline16,{size:16})})]}),(0,F.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,F.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(D=>(0,F.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${D.id===A?.id?" is-active":""}`,children:[(0,F.jsx)("button",{type:"button",role:"tab","aria-selected":D.id===A?.id,onClick:()=>v(D.id),children:D.name}),l.length>1&&(0,F.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${D.name}`,onClick:()=>H(D.id),children:(0,F.jsx)(At.IconCloseOutline16,{size:13})})]},D.id)),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:M,children:(0,F.jsx)(At.IconPlusOutline16,{size:15})})]}),(0,F.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(D=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===D,className:A?.panes.length===D?"is-active":"",onClick:()=>z(D),children:[D," \u680F"]},D))})]}),i.length===0?(0,F.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,F.jsx)(At.IconDataOutline16,{size:24}),(0,F.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,F.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,F.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((D,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,F.jsx)(rx,{pane:D,endpoints:i,dragSource:x,refreshRevision:S[Bn(D.endpointId,D.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:U=>B(J=>({...J,panes:J.panes.map(O=>O.id===D.id?{...O,...U}:O)})),onTransfer:(U,J)=>{j(D.endpointId,D.path,U,J.endpointId,J.path)},onExternalDrop:(U,J)=>{C(U,D,J)}},D.id)})}),(0,F.jsx)(ix,{jobs:a,endpoints:i,onCancel:async D=>{try{await Bl(D),h(L=>L.map(k=>k.id===D?{...k,state:"cancelled"}:k))}catch(L){b(Pe(L))}},onConflict:_}),g&&(0,F.jsx)(Vp,{profiles:e,vaultEntries:t,proxyEntries:r,onClose:()=>u(!1),onChanged:()=>{o(),E()}}),d&&(0,F.jsx)(ox,{endpoints:i,access:s,onClose:()=>m(!1)}),f&&(0,F.jsx)(nx,{job:f,onClose:()=>_(void 0),onRetry:async D=>{try{let L=await Fs({...f.request,conflictPolicy:D});h(k=>[L,...k]),_(void 0)}catch(L){b(Pe(L))}}})]})}function rx({pane:e,endpoints:t,destination:r,dragSource:s,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,p]=(0,_e.useState)(),[v,g]=(0,_e.useState)([]),[u,d]=(0,_e.useState)(e.path),[m,f]=(0,_e.useState)(!1),[_,x]=(0,_e.useState)(0),[y,w]=(0,_e.useState)(!1),[b,S]=(0,_e.useState)(),[T,R]=(0,_e.useState)(),[E,A]=(0,_e.useState)(),B=(0,_e.useRef)(null),M=(0,_e.useRef)(0),H=t.find(P=>P.id===e.endpointId),z=c?.entries??[],j=z.length>200,C=j?Math.max(0,Math.floor(_/Tl)-8):0,D=(0,_e.useMemo)(()=>j?z.slice(C,Math.min(z.length,C+56)):z,[z,C,j]),L=(0,_e.useCallback)(async(P=e.path)=>{if(H===void 0)return;let $=++M.current;f(!0),A(void 0);try{let V=await Ll(e.id,H.id,P);if($!==M.current)return;p(V),d(V.path),g([]),x(0),B.current&&(B.current.scrollTop=0),i({endpointId:H.id,path:V.path})}catch(V){$===M.current&&A(Pe(V))}finally{$===M.current&&f(!1)}},[H?.id,e.path]);(0,_e.useEffect)(()=>{H!==void 0&&L(e.path)},[H?.id,o]),(0,_e.useEffect)(()=>{s===void 0&&(w(!1),S(void 0))},[s]);let k=P=>{P.preventDefault(),L(u)},U=P=>{M.current+=1,i({endpointId:P.id,path:P.initialPath}),d(P.initialPath),p(void 0),A(void 0)},J=()=>{M.current+=1,i({endpointId:"",path:"/"}),p(void 0),g([]),A(void 0),f(!1)},O=(P,$)=>g(V=>$?V.includes(P.path)?V.filter(te=>te!==P.path):[...V,P.path]:[P.path]),ee=async()=>{if(!(T===void 0||c===void 0||H===void 0))try{await Bs({paneId:e.id,endpointId:H.id,directory:c.path,paths:T.map(P=>P.path)}),g([])}finally{await L(c.path)}},N=P=>{P.preventDefault(),w(!1);let $=vs(P.dataTransfer.getData(Lt));h(void 0),!($===void 0||$.paneId===e.id||Zs($,{endpointId:e.endpointId,directory:e.path}))&&a($,e.path)};return H===void 0?(0,F.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,F.jsxs)("header",{children:[(0,F.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,F.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,F.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,F.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(P=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>U(P),children:[(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${P.protocol}`,children:Dl(P.protocol)}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{title:P.name,children:P.name}),(0,F.jsx)("small",{title:P.address,children:P.address})]}),(0,F.jsxs)("span",{children:[(0,F.jsx)("i",{className:`dsh-ssh-protocol-dot is-${P.protocol}`,"aria-hidden":"true"}),P.group??(P.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},P.id))}),(0,F.jsxs)("footer",{children:[(0,F.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,F.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,F.jsxs)("section",{className:`dsh-ssh-file-pane${y?" is-drop-target":""}`,onDragOver:P=>{P.dataTransfer.types.includes(Lt)&&fx(s,e)?(P.preventDefault(),P.dataTransfer.dropEffect=s?.endpointId===e.endpointId?"move":"copy",S(void 0),w(!0)):y&&w(!1)},onDragLeave:P=>{P.currentTarget.contains(P.relatedTarget)||(w(!1),S(void 0))},onDrop:N,children:[(0,F.jsxs)("header",{children:[(0,F.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:J,children:(0,F.jsx)(At.IconChevronLeftOutline14,{size:14})}),(0,F.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,F.jsx)("strong",{children:H.name}),(0,F.jsx)("small",{title:H.address,children:H.address})]}),(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Dl(H.protocol)})]}),(0,F.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:k,children:[(0,F.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&L(c.parent)},children:(0,F.jsx)(vx,{})}),(0,F.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{L()},children:(0,F.jsx)(_x,{})}),(0,F.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:P=>d(P.target.value)}),(0,F.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,F.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,F.jsx)("span",{children:"\u540D\u79F0"}),(0,F.jsx)("span",{children:"\u5927\u5C0F"}),(0,F.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,F.jsx)("span",{"aria-hidden":"true"})]}),(0,F.jsx)("div",{ref:B,className:"dsh-ssh-file-table-body",onScroll:P=>{j&&x(P.currentTarget.scrollTop)},children:m&&!c?(0,F.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):E?(0,F.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,F.jsx)("span",{children:E}),(0,F.jsx)("button",{type:"button",onClick:()=>{L()},children:"\u91CD\u8BD5"})]}):z.length===0?(0,F.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,F.jsx)("div",{className:j?"dsh-ssh-file-virtual-list":void 0,style:j?{height:`${z.length*Tl}px`}:void 0,children:D.map((P,$)=>(0,F.jsx)(sx,{entry:P,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:s,dropTarget:b===P.path,selected:v.includes(P.path),selectedPaths:v,...j?{style:{position:"absolute",insetInline:0,transform:`translateY(${(C+$)*Tl}px)`}}:{},onDelete:()=>R([P]),onDirectoryTarget:V=>{w(!1),S(V)},onDropIntoDirectory:(V,te)=>{S(void 0),h(void 0),a(V,te)},onDragSourceChange:h,onSelect:V=>O(P,V),onOpen:()=>{P.kind==="directory"&&L(P.path)}},P.path))})})]}),(0,F.jsxs)("footer",{children:[(0,F.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,F.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||r===void 0||!r.endpointId||m,onClick:()=>{r?.endpointId&&n(v,r)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,F.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),y&&(0,F.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,F.jsx)("strong",{children:s?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,F.jsx)("span",{children:c?.path??e.path})]}),T!==void 0&&(0,F.jsx)(Pn,{locationName:H.name,locationKind:"remote",entries:T,onClose:()=>R(void 0),onDelete:ee})]})}function sx({entry:e,paneId:t,endpointId:r,sourceDirectory:s,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:p,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=e.kind==="directory"||e.navigable===!0,m=d&&(o===void 0||ei(o,o.paths,{endpointId:r,directory:e.path})),f=_=>{if(!d)return;_.preventDefault(),_.stopPropagation(),v(void 0);let x=vs(_.dataTransfer.getData(Lt));x!==void 0&&ei(x,x.paths,{endpointId:r,directory:e.path})&&g(x,e.path)};return(0,F.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||e.kind==="directory",className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:_=>{d&&!_.ctrlKey&&!_.metaKey&&!_.shiftKey?c():l(_.ctrlKey||_.metaKey)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key==="Enter"&&d&&c(),_.key===" "&&(_.preventDefault(),l(_.ctrlKey||_.metaKey)))},onDragStart:_=>{let x=n?a:[e.path],y={paneId:t,endpointId:r,directory:s,paths:x};u(y),_.dataTransfer.effectAllowed="copyMove",_.dataTransfer.setData(Lt,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:_=>{_.dataTransfer.types.includes(Lt)&&m&&(_.preventDefault(),_.stopPropagation(),_.dataTransfer.dropEffect=o?.endpointId===r?"move":"copy",v(e.path))},onDragLeave:_=>{i&&!_.currentTarget.contains(_.relatedTarget)&&v(void 0)},onDrop:f,children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(bx,{directory:d}),(0,F.jsx)("i",{title:e.name,children:e.name})]}),(0,F.jsx)("span",{children:d?"\u2014":Jp(e.size)}),(0,F.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:_=>{_.stopPropagation(),p()},children:(0,F.jsx)(At.IconTrashOutline16,{size:14})})]})}function ix({jobs:e,endpoints:t,onCancel:r,onConflict:s}){let[o,i]=(0,_e.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,F.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,F.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,F.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,F.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,F.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,F.jsxs)("article",{children:[(0,F.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,F.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,F.jsxs)("strong",{children:[Xp(a.request.sourcePaths)," ",(0,F.jsx)("i",{children:"\u2192"})," ",px(t,a.request.destinationEndpointId)]}),(0,F.jsx)("small",{children:a.error??mx(a,h)}),(0,F.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,F.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,F.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{r(a.id)},children:(0,F.jsx)(At.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,F.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>s(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function nx({job:e,onClose:t,onRetry:r}){let[s,o]=(0,_e.useState)("rename"),[i,n]=(0,_e.useState)(!1);return(0,F.jsxs)(et,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,F.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,F.jsx)("strong",{children:Xp(e.request.sourcePaths)}),(0,F.jsx)("span",{children:e.request.destinationDirectory})]}),(0,F.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":s===a[0],className:s===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,F.jsx)("i",{"aria-hidden":"true"}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:a[1]}),(0,F.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,F.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,F.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),r(s).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function ox({endpoints:e,access:t,onClose:r}){let s=t.value,o=e.filter(n=>s?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(s?.fileEndpointIds.includes(n)?s.fileEndpointIds.filter(a=>a!==n):[...s?.fileEndpointIds??[],n]);return(0,F.jsxs)(et,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:r,children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,F.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,F.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,F.jsxs)("header",{children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,F.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,F.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,F.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,F.jsx)(lx,{}):e.length===0?(0,F.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,F.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,F.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,F.jsx)(ax,{endpoint:n,enabled:s?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,F.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,F.jsx)("header",{children:(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,F.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,F.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,F.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,F.jsx)(hx,{value:s?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,F.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,F.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,F.jsx)(cx,{checked:s?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,F.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,F.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,F.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:r,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function ax({endpoint:e,enabled:t,onToggle:r}){return(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:r,children:[(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Dl(e.protocol)}),(0,F.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,F.jsx)("strong",{title:e.name,children:e.name}),(0,F.jsx)("small",{title:e.address,children:e.address})]}),(0,F.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,F.jsx)("i",{"aria-hidden":"true",children:(0,F.jsx)("b",{})}),(0,F.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function lx(){return(0,F.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,F.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,F.jsx)("i",{}),(0,F.jsxs)("b",{children:[(0,F.jsx)("i",{}),(0,F.jsx)("i",{})]}),(0,F.jsx)("em",{})]},e))})}function hx({value:e,onChange:t}){return(0,F.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([r,s])=>(0,F.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===r,className:e===r?"is-active":"",onClick:()=>t(r),children:s},r))})}function cx({checked:e,onChange:t}){return(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,F.jsx)("i",{"aria-hidden":"true",children:(0,F.jsx)("b",{})}),(0,F.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function dx(){try{let e=JSON.parse(localStorage.getItem(qp)??"[]");if(!Array.isArray(e))return[Pl("transfer-1",1)];let t=e.slice(0,8).flatMap(r=>{if(typeof r!="object"||r===null)return[];let s=r;if(typeof s.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||typeof s.name!="string"||!Array.isArray(s.panes))return[];let o=s.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:s.id,name:s.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Pl("transfer-1",1)]}function Pl(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[Fn(`${e}-a`),Fn(`${e}-b`)]}}function Fn(e){return{id:e,endpointId:"",path:"/"}}function ux(e,t){return e.map(r=>({...r,panes:r.panes.map(s=>!s.endpointId||t.some(o=>o.id===s.endpointId)?s:Fn(s.id))}))}function px(e,t){return e.find(r=>r.id===t)?.name??t}function Xp(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Dl(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Bn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function fx(e,t){return e===void 0||e.paneId!==t.id&&!Zs(e,{endpointId:t.endpointId,directory:t.path})}function Wp(e){return e==="completed"||e==="failed"||e==="cancelled"}function Jp(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function mx(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let r=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),s=e.transferredBytes/r,o=s>0?Math.max(0,(e.totalBytes-e.transferredBytes)/s):0;return`${t.toFixed(0)}% \xB7 ${Jp(s)}/s${o>1?` \xB7 \u7EA6 ${gx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function gx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function vx(){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,F.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function _x(){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,F.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function bx({directory:e}){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,F.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,F.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var Gp=`.dsh-ssh-transfer-workspace {
|
|
4942
|
+
`;var Op=require("react");function Mp(e){(0,Op.useEffect)(()=>{let t=e.current,r=t?.parentElement;if(t==null||r===null||r===void 0)return;let s=r,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&s.isConnected&&s.append(t)}},[e])}var pt=require("react"),wt=require("@deepseek-ai/dsh-client-ui-primitives");var ir=require("react"),ns=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function Bp({profile:e,project:t,workspaces:r,currentWorkspaceId:s,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=r.some(x=>String(x.workspaceId)===s)?s:r.some(x=>String(x.workspaceId)===o)?o:r[0]===void 0?void 0:String(r[0].workspaceId),[l,c]=(0,ir.useState)(h),[p,v]=(0,ir.useState)(!1),[g,u]=(0,ir.useState)(),d=(0,ir.useRef)(null),m=(0,ir.useRef)(null);(0,ir.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let f=()=>{p||n()},_=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u($0(y)),v(!1)}}};return(0,ge.jsx)(ns.Modal,{open:!0,onClose:f,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",closeLabel:"\u5173\u95ED",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:j0,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:p,onClick:f,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(ns.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{_(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),r.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(ns.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:r.map(x=>{let y=String(x.workspaceId),w=y===s?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:p,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(ns.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),w&&(0,ge.jsx)("em",{children:w}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:p,onClick:f,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:p||l===void 0,children:p?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function j0(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),r=t[0],s=t[t.length-1];r===void 0||s===void 0||(e.shiftKey&&document.activeElement===r?(e.preventDefault(),s.focus()):!e.shiftKey&&document.activeElement===s&&(e.preventDefault(),r.focus()))}function $0(e){return e instanceof Error?e.message:String(e)}var re=require("react/jsx-runtime");function Fp(e){let t=_s(),[r,s]=(0,pt.useState)(""),[o,i]=(0,pt.useState)(()=>new Set),[n,a]=(0,pt.useState)({}),[h,l]=(0,pt.useState)(),[c,p]=(0,pt.useState)(),[v,g]=(0,pt.useState)(),[u,d]=(0,pt.useState)(),m=r.trim().toLocaleLowerCase(),f=(0,pt.useMemo)(()=>q0(e.profiles.filter(w=>K0(w).includes(m))),[m,e.profiles]),_=async w=>{l(w);try{let b=await Ul(w);a(S=>({...S,[w]:b})),d(void 0)}catch(b){d(Cl(b))}finally{l(b=>b===w?void 0:b)}},x=w=>{i(new Set([w])),n[w]===void 0&&_(w),e.onSelect({profileId:w,path:"~"})},y=w=>{let b=e.access?.profileIds??[],S=b.includes(w);e.onProfiles(S?b.filter(T=>T!==w):[...b,w]),S&&e.onDirectory(w,void 0)};return(0,re.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,re.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,re.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,re.jsx)(wt.IconPlusOutline16,{size:16})})]}),(0,re.jsxs)("label",{className:"dsh-ssh-search",children:[(0,re.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,re.jsx)("input",{value:r,onChange:w=>s(w.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[f.map(w=>(0,re.jsxs)("section",{className:"dsh-ssh-tree-group",children:[(0,re.jsxs)("h3",{children:[(0,re.jsx)("span",{children:w.name}),(0,re.jsx)("small",{children:w.profiles.length})]}),w.profiles.map(b=>{let S=o.has(b.id),T=e.access?.profileIds.includes(b.id)===!0,R=n[b.id]??[],E=e.selected?.profileId===b.id&&e.selected.projectId===void 0;return(0,re.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":S,children:[(0,re.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${T?" is-authorized":""}${E?" is-active":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":E,"aria-expanded":S,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${b.name}`,onClick:()=>x(b.id),children:[(0,re.jsx)("span",{className:"dsh-ssh-host-monogram",children:b.name.slice(0,1).toUpperCase()}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:b.name}),(0,re.jsxs)("small",{children:[b.username,"@",b.host]})]})]}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${T?" is-mounted":""}`,"aria-label":`${T?"\u5378\u8F7D":"\u6302\u8F7D"} ${b.name}`,"aria-pressed":T,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":T?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>y(b.id),children:T?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${b.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>p({profile:b}),children:(0,re.jsx)(wt.IconPlusOutline16,{size:14})})]}),S&&(0,re.jsx)("div",{className:"dsh-ssh-tree-branches",children:h===b.id&&n[b.id]===void 0?(0,re.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):R.length===0?(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>p({profile:b}),children:[(0,re.jsx)(wt.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):R.map(A=>{let B=e.selected?.projectId===A.id,M=e.access?.workingProjectIds[b.id]===A.id;return(0,re.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,re.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${B?" is-active":""}${M?" is-bound":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:M,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":T?M?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{T&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(b.id,M?void 0:A.path,M?void 0:A.id),e.onSelect(M?{profileId:b.id,path:"~"}:{profileId:b.id,path:A.path,projectId:A.id}))},children:[(0,re.jsx)("span",{children:M?(0,re.jsx)(wt.IconFolderOpenOutline16,{size:15}):(0,re.jsx)(wt.IconFolderClose16,{size:15})}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:A.name}),(0,re.jsx)("small",{children:A.path}),M&&(0,re.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${A.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:H=>{d(void 0),g({profile:b,project:A,returnFocus:H.currentTarget})},children:(0,re.jsx)(wt.IconPlusOutline16,{size:13})}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${A.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>p({profile:b,project:A}),children:(0,re.jsx)(wt.IconEditOutline16,{size:13})})]})},A.id)})})]},b.id)})]},w.name)),f.length===0&&(0,re.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,re.jsx)(V0,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??u,onPermission:e.onPermission,onApproval:e.onApproval}),c!==void 0&&(0,re.jsx)(W0,{profile:c.profile,project:c.project,onClose:()=>p(void 0),onSaved:async()=>{let w=c.profile.id;p(void 0),await _(w)}}),v!==void 0&&(0,re.jsx)(Bp,{...v,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>g(void 0),onCreate:e.onCreateSession})]})}function V0({access:e,loading:t,saving:r,error:s,onPermission:o,onApproval:i}){return(0,re.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,re.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,re.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,re.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":r?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,re.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,re.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,re.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,re.jsx)("i",{"aria-hidden":"true"})]}),s&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:s})]})}function W0({profile:e,project:t,onClose:r,onSaved:s}){let[o,i]=(0,pt.useState)(t?.name??""),[n,a]=(0,pt.useState)(t?.path??""),[h,l]=(0,pt.useState)(!1),[c,p]=(0,pt.useState)(),v=async u=>{u.preventDefault(),l(!0),p(void 0);try{t===void 0?await jl(e.id,{name:o,path:n}):await $l(e.id,t.id,{name:o,path:n}),await s()}catch(d){p(Cl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),p(void 0);try{await Vl(e.id,t.id),await s()}catch(u){p(Cl(u)),l(!1)}}};return(0,re.jsx)(et,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:r,children:(0,re.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u540D\u79F0"}),(0,re.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,re.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,re.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,re.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,re.jsx)(wt.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,re.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:r,children:"\u53D6\u6D88"}),(0,re.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function q0(e){let t=new Map;for(let r of e){let s=r.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(s);o===void 0?t.set(s,[r]):o.push(r)}return[...t].map(([r,s])=>({name:r,profiles:s}))}function K0(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function Cl(e){return e instanceof Error?e.message:String(e)}var it=require("react");var El=new Set;function On(e){for(let t of El)t(e)}function Np(e){return El.add(e),()=>El.delete(e)}function Hp(e){let[t,r]=(0,it.useState)(null),[s,o]=(0,it.useState)(e!==void 0),[i,n]=(0,it.useState)(!1),[a,h]=(0,it.useState)(),l=(0,it.useRef)(null),c=(0,it.useRef)(e),p=(0,it.useRef)(Promise.resolve()),v=(0,it.useRef)(0);c.current=e,(0,it.useEffect)(()=>{let d=!1;return l.current=null,r(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(wi(e).then(m=>{if(d)return;let f=m??vi(e);l.current=f,r(f),On(f)}).catch(m=>{d||h(zp(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,it.useCallback)(async d=>{l.current=d,r(d),On(d),h(void 0),v.current+=1,n(!0);let m=p.current.catch(()=>{}).then(()=>Si(d));p.current=m;try{let f=await m;return c.current===f.sessionId&&l.current===d&&(l.current=f,r(f),On(f)),f}catch(f){throw c.current===d.sessionId&&h(zp(f)),f}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,it.useCallback)(d=>{let m=c.current;if(m===void 0)return;let f=l.current??vi(m);g({...f,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:s,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,f)=>{let _=c.current;if(_===void 0)return;let x=l.current??vi(_),y={...x.workingDirectories},w={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,f===void 0?delete w[d]:w[d]=f,u({workingDirectories:y,workingProjectIds:w})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function vi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function zp(e){return e instanceof Error?e.message:String(e)}var os=require("react"),Bn=require("react/jsx-runtime"),Mn=38,_i=28,bi=66,X0=320,J0=280,G0=7;function Up(e,t,r){return Math.min(r,Math.max(t,e))}function Y0(e){if(typeof window>"u")return Mn;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?Up(t,_i,bi):Mn}catch{return Mn}}function Tl(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function Q0(e){if(e<=0)return{min:_i,max:bi};let t=J0/e*100,r=(e-X0-G0)/e*100,s=Math.max(_i,t),o=Math.max(s,Math.min(bi,r));return{min:s,max:o}}function jp({primary:e,secondary:t,storageKey:r,label:s}){let[o,i]=(0,os.useState)(()=>Y0(r)),n=(0,os.useRef)(null),a=(0,os.useRef)(null),h=(0,os.useRef)(o),l=(0,os.useRef)(),c=f=>{let _=n.current;if(_===null)return f;let x=Q0(_.getBoundingClientRect().width),y=Up(f,x.min,x.max);return _.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},p=f=>{if(l.current===void 0)return;let _=a.current;l.current=void 0,f!==void 0&&_?.hasPointerCapture(f)&&_.releasePointerCapture(f),n.current?.classList.remove("is-resizing");let x=h.current;i(x),Tl(r,x)},v=f=>{f.button===0&&(l.current=f.pointerId,h.current=o,f.currentTarget.setPointerCapture(f.pointerId),n.current?.classList.add("is-resizing"),f.preventDefault())},g=f=>{if(l.current!==f.pointerId)return;let _=n.current?.getBoundingClientRect();_===void 0||_.width===0||(c((_.right-f.clientX)/_.width*100),f.preventDefault())},u=f=>{let _=f.shiftKey?5:2,x;if(f.key==="ArrowLeft"&&(x=o+_),f.key==="ArrowRight"&&(x=o-_),f.key==="Home"&&(x=_i),f.key==="End"&&(x=bi),x===void 0)return;let y=c(x);i(y),Tl(r,y),f.preventDefault()},d=()=>{let f=c(Mn);i(f),Tl(r,f)},m={"--ssh-sftp-width":`${o}%`};return(0,Bn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Bn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":s,"aria-orientation":"vertical","aria-valuemin":_i,"aria-valuemax":bi,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:f=>p(f.pointerId),onPointerCancel:f=>p(f.pointerId),onLostPointerCapture:()=>p()}),t]})}var nr=require("react"),St=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function $p({profile:e,dependents:t,onClose:r,onDeleted:s}){let[o,i]=(0,nr.useState)(!1),[n,a]=(0,nr.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await ae(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),s()}catch(l){a(Pe(l))}finally{i(!1)}}};return(0,K.jsx)(et,{title:`\u5220\u9664 ${e.name}`,subtitle:Kt(e),onClose:r,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(St.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:r,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function Vp({profile:e,profiles:t,vaultEntries:r,proxyEntries:s,onClose:o,onSaved:i}){let[n,a]=(0,nr.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,nr.useState)(!1),[c,p]=(0,nr.useState)(!1),[v,g]=(0,nr.useState)(),[u,d]=(0,nr.useState)(),[m,f]=(0,nr.useState)(),_=S=>({value:n[S],onChange:T=>{a(R=>({...R,[S]:T.target.value})),g(void 0),d(void 0)}}),x=r.find(S=>S.id===n.credentialId),y=(S=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...S?{hostFingerprint:S}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(R=>R.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async S=>{p(!0),f(void 0),g(void 0),d(void 0);try{await ae("/profiles/test-draft",{method:"POST",body:JSON.stringify({...y(S),...e===void 0?{}:{profileId:e.id}})}),S!==void 0&&a(T=>({...T,hostFingerprint:S})),g("success")}catch(T){T instanceof ar&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):f(Pe(T))}finally{p(!1)}},b=async S=>{S.preventDefault(),l(!0),f(void 0);try{await ae(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(y())}),i()}catch(T){f(Pe(T))}finally{l(!1)}};return(0,K.jsx)(et,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:S=>{b(S)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",..._("name")})}),(0,K.jsx)(pe,{label:"\u5206\u7EC4",children:(0,K.jsx)("input",{maxLength:64,placeholder:"\u4F8B\u5982\uFF1A\u751F\u4EA7\u73AF\u5883",..._("group")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(pe,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,..._("host")})}),(0,K.jsx)(pe,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",..._("port")})})]}),(0,K.jsx)(pe,{label:"\u6807\u7B7E",hint:"\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u82F1\u6587\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)("input",{placeholder:"production, linux",..._("tags")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(pe,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{..._("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),r.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.username]},S.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(St.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",..._("username")})}),(0,K.jsx)(pe,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{..._("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",..._("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(pe,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,..._("privateKey")})}),(0,K.jsx)(pe,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",..._("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(pe,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{..._("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(pe,{label:"\u5E38\u7528\u4EE3\u7406",hint:s.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,..._("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),s.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",S.host,":",S.port]},S.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(pe,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,..._("proxyHost")})}),(0,K.jsx)(pe,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",..._("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(pe,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",..._("proxyUsername")})}),(0,K.jsx)(pe,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",..._("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(Z0,{profiles:t.filter(S=>S.id!==e?.id),value:n.jumpProfileIds,onChange:S=>a(T=>({...T,jumpProfileIds:S}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(St.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:S=>{S.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function Z0({profiles:e,value:t,onChange:r}){let s=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&r([...t,n.id])},o=(n,a)=>r(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],r(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(St.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(St.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>r(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(St.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:s,children:[(0,K.jsx)(St.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var _e=require("react"),At=require("@deepseek-ai/dsh-client-ui-primitives");var Vt=require("react"),Rt=require("@deepseek-ai/dsh-client-ui-primitives");var W=require("react/jsx-runtime");function Wp({profiles:e,vaultEntries:t,proxyEntries:r,onClose:s,onChanged:o}){let[i,n]=(0,Vt.useState)(),[a,h]=(0,Vt.useState)(),[l,c]=(0,Vt.useState)(),p=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await ae(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(f){c(Pe(f))}};return(0,W.jsx)(et,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:s,children:(0,W.jsxs)("div",{className:`dsh-ssh-ftp-manager${p?" has-detail":""}`,children:[(0,W.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,W.jsxs)("header",{children:[(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:"FTP / FTPS"}),(0,W.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,W.jsx)(Rt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,W.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,W.jsx)("span",{children:(0,W.jsx)(Rt.IconDataOutline16,{size:20})}),(0,W.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,W.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,W.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let f=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,W.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":f,className:f?"is-active":"",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,W.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:rx(m.protocol)}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{title:m.name,children:m.name}),(0,W.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,W.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,W.jsx)(Rt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,W.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,W.jsx)(ex,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,W.jsx)(tx,{value:i==="new"?void 0:i,vaultEntries:t,proxyEntries:r,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,W.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,W.jsx)("span",{children:(0,W.jsx)(Rt.IconDataOutline16,{size:22})}),(0,W.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,W.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,W.jsxs)("dl",{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"FTPS"}),(0,W.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"FTP"}),(0,W.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("dt",{children:"SFTP"}),(0,W.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function ex({profile:e,error:t,onBack:r,onDelete:s}){let[o,i]=(0,Vt.useState)(!1);return(0,W.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:r,children:[(0,W.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,W.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,W.jsx)(Rt.IconWarningOutline16,{size:20})}),(0,W.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,W.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,W.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,W.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,W.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,disabled:o,children:"\u53D6\u6D88"}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),s().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function tx({value:e,vaultEntries:t,proxyEntries:r,onBack:s,onSaved:o}){let i=t.filter(y=>y.authType==="password"),[n,a]=(0,Vt.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??""}),[h,l]=(0,Vt.useState)(!1),[c,p]=(0,Vt.useState)(!1),[v,g]=(0,Vt.useState)(),[u,d]=(0,Vt.useState)(),m=()=>({profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},protocol:n.protocol,host:n.host,port:Number(n.port),username:n.username,...n.credentialId?{credentialId:n.credentialId}:{},proxy:n.proxyId?{type:"saved",proxyId:n.proxyId}:{type:"none"},initialPath:n.initialPath,connectTimeoutMs:Number(n.connectTimeoutMs),...n.tlsServerName.trim()?{tlsServerName:n.tlsServerName.trim()}:{}},secrets:{password:n.password}}),f=async y=>{y.preventDefault(),l(!0),d(void 0),g(void 0);try{await ae(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(m())}),o()}catch(w){d(Pe(w))}finally{l(!1)}},_=async()=>{p(!0),d(void 0),g(void 0);try{await ae("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...m(),...e===void 0?{}:{profileId:e.id}})}),g("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(y){d(Pe(y))}finally{p(!1)}},x=y=>a(w=>({...w,protocol:y,port:w.port==="21"||w.port==="990"?String(y==="ftps-implicit"?990:21):w.port}));return(0,W.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:y=>{f(y)},children:[(0,W.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,W.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,W.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,W.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,W.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,W.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,W.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(y=>(0,W.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":n.protocol===y[0],className:n.protocol===y[0]?"is-active":"",onClick:()=>x(y[0]),children:[(0,W.jsx)("span",{className:`dsh-ssh-protocol-badge is-${y[0]}`,children:y[1]}),(0,W.jsxs)("span",{children:[(0,W.jsx)("strong",{children:y[1]}),(0,W.jsx)("small",{children:y[2]})]})]},y[0]))}),n.protocol==="ftp"&&(0,W.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,W.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u7528\u4E8E\u533A\u5206\u73AF\u5883\u6216\u7528\u9014"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,W.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:n.name,onChange:y=>a({...n,name:y.target.value})})}),(0,W.jsx)(pe,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,W.jsx)("input",{maxLength:64,value:n.group,onChange:y=>a({...n,group:y.target.value})})})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,W.jsx)(pe,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,W.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:n.host,onChange:y=>a({...n,host:y.target.value})})}),(0,W.jsx)(pe,{label:"\u7AEF\u53E3",children:(0,W.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:n.port,onChange:y=>a({...n,port:y.target.value})})})]})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,W.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,W.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:n.username,onChange:y=>a({...n,username:y.target.value})})}),(0,W.jsx)(pe,{label:"\u51ED\u636E\u6765\u6E90",children:(0,W.jsxs)("select",{value:n.credentialId,onChange:y=>a({...n,credentialId:y.target.value}),children:[(0,W.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),i.map(y=>(0,W.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.username]},y.id))]})})]}),!n.credentialId&&(0,W.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,W.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:n.password,onChange:y=>a({...n,password:y.target.value})})})]}),(0,W.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,W.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,W.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,W.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,W.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:n.initialPath,onChange:y=>a({...n,initialPath:y.target.value})})}),(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,W.jsxs)("select",{value:n.proxyId,onChange:y=>a({...n,proxyId:y.target.value}),children:[(0,W.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(y=>(0,W.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.proxyType.toUpperCase()]},y.id))]})})]}),(0,W.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,W.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,W.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,W.jsx)(pe,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,W.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:n.connectTimeoutMs,onChange:y=>a({...n,connectTimeoutMs:y.target.value})})}),(0,W.jsx)(pe,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,W.jsx)("input",{maxLength:253,spellCheck:!1,value:n.tlsServerName,onChange:y=>a({...n,tlsServerName:y.target.value})})})]})]})]}),v&&(0,W.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:v}),u&&(0,W.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:u})]}),(0,W.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{_()},disabled:c||h,children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,W.jsx)("span",{}),(0,W.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:h||c,children:"\u53D6\u6D88"}),(0,W.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function rx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}var F=require("react/jsx-runtime"),Kp="dsh-ssh:file-transfer:tabs:v2",Pl=38;function Xp({ftpProfiles:e,vaultEntries:t,proxyEntries:r,access:s,onProfilesChanged:o}){let[i,n]=(0,_e.useState)([]),[a,h]=(0,_e.useState)([]),[l,c]=(0,_e.useState)(()=>ux()),[p,v]=(0,_e.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,_e.useState)(!1),[d,m]=(0,_e.useState)(!1),[f,_]=(0,_e.useState)(),[x,y]=(0,_e.useState)(),[w,b]=(0,_e.useState)(),[S,T]=(0,_e.useState)({}),R=(0,_e.useRef)(new Map),E=(0,_e.useCallback)(async()=>{try{let D=await Ll();n(D),c(L=>px(L,D))}catch(D){b(Pe(D))}},[]);(0,_e.useEffect)(()=>{E()},[E,e]),(0,_e.useEffect)(()=>{try{localStorage.setItem(Kp,JSON.stringify(l))}catch{}},[l]),(0,_e.useEffect)(()=>{let D=R.current,L=a.filter(k=>qp(k.state)&&D.has(k.id)&&!qp(D.get(k.id)));R.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&T(k=>{let U={...k};for(let J of L){let O=Fn(J.request.destinationEndpointId,J.request.destinationDirectory);U[O]=(U[O]??0)+1}return U})},[a]),(0,_e.useEffect)(()=>{let D=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let U=await Bl();D||h(U)}catch{}D||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{D=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(D=>D.id===p)??l[0],B=D=>c(L=>L.map(k=>k.id===A?.id?D(k):k)),M=()=>{let D=`transfer-${Date.now().toString(36)}`,L=Dl(D,l.length+1);c(k=>[...k,L]),v(D)},H=D=>{if(l.length===1)return;let L=l.findIndex(U=>U.id===D),k=l.filter(U=>U.id!==D);c(k),p===D&&v(k[Math.max(0,L-1)].id)},z=D=>B(L=>({...L,panes:Array.from({length:D},(k,U)=>L.panes[U]??Nn(`${L.id}-pane-${U}`))})),j=async(D,L,k,U,J)=>{let O={endpointId:D,directory:L},ee={endpointId:U,directory:J};if(!(Zs(O,ee)||!ei(O,k,ee)))try{b(void 0);let N=await Fs({sourceEndpointId:D,sourcePaths:k,destinationEndpointId:U,destinationDirectory:J,conflictPolicy:"fail"});h(P=>[N,...P.filter($=>$.id!==N.id)])}catch(N){b(Pe(N))}},C=async(D,L,k)=>{try{b(void 0);let U=await hn(D,{paneId:L.id,endpointId:L.endpointId,directory:k});U.job!==void 0&&h(J=>[U.job,...J.filter(O=>O.id!==U.job.id)]),U.operation==="move"&&T(J=>{let O={...J};for(let ee of[Fn(D.endpointId,D.directory),Fn(L.endpointId,k)])O[ee]=(O[ee]??0)+1;return O})}catch(U){b(Pe(U))}};return(0,F.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,F.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,F.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,F.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",s.value?.fileEndpointIds.length??0]}),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),w&&(0,F.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,F.jsx)("span",{children:w}),(0,F.jsx)("button",{type:"button",onClick:()=>b(void 0),"aria-label":"\u5173\u95ED",children:(0,F.jsx)(At.IconCloseOutline16,{size:16})})]}),(0,F.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,F.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(D=>(0,F.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${D.id===A?.id?" is-active":""}`,children:[(0,F.jsx)("button",{type:"button",role:"tab","aria-selected":D.id===A?.id,onClick:()=>v(D.id),children:D.name}),l.length>1&&(0,F.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${D.name}`,onClick:()=>H(D.id),children:(0,F.jsx)(At.IconCloseOutline16,{size:13})})]},D.id)),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:M,children:(0,F.jsx)(At.IconPlusOutline16,{size:15})})]}),(0,F.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(D=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===D,className:A?.panes.length===D?"is-active":"",onClick:()=>z(D),children:[D," \u680F"]},D))})]}),i.length===0?(0,F.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,F.jsx)(At.IconDataOutline16,{size:24}),(0,F.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,F.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,F.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((D,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,F.jsx)(sx,{pane:D,endpoints:i,dragSource:x,refreshRevision:S[Fn(D.endpointId,D.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:U=>B(J=>({...J,panes:J.panes.map(O=>O.id===D.id?{...O,...U}:O)})),onTransfer:(U,J)=>{j(D.endpointId,D.path,U,J.endpointId,J.path)},onExternalDrop:(U,J)=>{C(U,D,J)}},D.id)})}),(0,F.jsx)(nx,{jobs:a,endpoints:i,onCancel:async D=>{try{await Fl(D),h(L=>L.map(k=>k.id===D?{...k,state:"cancelled"}:k))}catch(L){b(Pe(L))}},onConflict:_}),g&&(0,F.jsx)(Wp,{profiles:e,vaultEntries:t,proxyEntries:r,onClose:()=>u(!1),onChanged:()=>{o(),E()}}),d&&(0,F.jsx)(ax,{endpoints:i,access:s,onClose:()=>m(!1)}),f&&(0,F.jsx)(ox,{job:f,onClose:()=>_(void 0),onRetry:async D=>{try{let L=await Fs({...f.request,conflictPolicy:D});h(k=>[L,...k]),_(void 0)}catch(L){b(Pe(L))}}})]})}function sx({pane:e,endpoints:t,destination:r,dragSource:s,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,p]=(0,_e.useState)(),[v,g]=(0,_e.useState)([]),[u,d]=(0,_e.useState)(e.path),[m,f]=(0,_e.useState)(!1),[_,x]=(0,_e.useState)(0),[y,w]=(0,_e.useState)(!1),[b,S]=(0,_e.useState)(),[T,R]=(0,_e.useState)(),[E,A]=(0,_e.useState)(),B=(0,_e.useRef)(null),M=(0,_e.useRef)(0),H=t.find(P=>P.id===e.endpointId),z=c?.entries??[],j=z.length>200,C=j?Math.max(0,Math.floor(_/Pl)-8):0,D=(0,_e.useMemo)(()=>j?z.slice(C,Math.min(z.length,C+56)):z,[z,C,j]),L=(0,_e.useCallback)(async(P=e.path)=>{if(H===void 0)return;let $=++M.current;f(!0),A(void 0);try{let V=await Ol(e.id,H.id,P);if($!==M.current)return;p(V),d(V.path),g([]),x(0),B.current&&(B.current.scrollTop=0),i({endpointId:H.id,path:V.path})}catch(V){$===M.current&&A(Pe(V))}finally{$===M.current&&f(!1)}},[H?.id,e.path]);(0,_e.useEffect)(()=>{H!==void 0&&L(e.path)},[H?.id,o]),(0,_e.useEffect)(()=>{s===void 0&&(w(!1),S(void 0))},[s]);let k=P=>{P.preventDefault(),L(u)},U=P=>{M.current+=1,i({endpointId:P.id,path:P.initialPath}),d(P.initialPath),p(void 0),A(void 0)},J=()=>{M.current+=1,i({endpointId:"",path:"/"}),p(void 0),g([]),A(void 0),f(!1)},O=(P,$)=>g(V=>$?V.includes(P.path)?V.filter(te=>te!==P.path):[...V,P.path]:[P.path]),ee=async()=>{if(!(T===void 0||c===void 0||H===void 0))try{await Bs({paneId:e.id,endpointId:H.id,directory:c.path,paths:T.map(P=>P.path)}),g([])}finally{await L(c.path)}},N=P=>{P.preventDefault(),w(!1);let $=vs(P.dataTransfer.getData(Lt));h(void 0),!($===void 0||$.paneId===e.id||Zs($,{endpointId:e.endpointId,directory:e.path}))&&a($,e.path)};return H===void 0?(0,F.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,F.jsxs)("header",{children:[(0,F.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,F.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,F.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,F.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,F.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(P=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>U(P),children:[(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${P.protocol}`,children:Rl(P.protocol)}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{title:P.name,children:P.name}),(0,F.jsx)("small",{title:P.address,children:P.address})]}),(0,F.jsxs)("span",{children:[(0,F.jsx)("i",{className:`dsh-ssh-protocol-dot is-${P.protocol}`,"aria-hidden":"true"}),P.group??(P.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},P.id))}),(0,F.jsxs)("footer",{children:[(0,F.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,F.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,F.jsxs)("section",{className:`dsh-ssh-file-pane${y?" is-drop-target":""}`,onDragOver:P=>{P.dataTransfer.types.includes(Lt)&&mx(s,e)?(P.preventDefault(),P.dataTransfer.dropEffect=s?.endpointId===e.endpointId?"move":"copy",S(void 0),w(!0)):y&&w(!1)},onDragLeave:P=>{P.currentTarget.contains(P.relatedTarget)||(w(!1),S(void 0))},onDrop:N,children:[(0,F.jsxs)("header",{children:[(0,F.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:J,children:(0,F.jsx)(At.IconChevronLeftOutline14,{size:14})}),(0,F.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,F.jsx)("strong",{children:H.name}),(0,F.jsx)("small",{title:H.address,children:H.address})]}),(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Rl(H.protocol)})]}),(0,F.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:k,children:[(0,F.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&L(c.parent)},children:(0,F.jsx)(_x,{})}),(0,F.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{L()},children:(0,F.jsx)(bx,{})}),(0,F.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:P=>d(P.target.value)}),(0,F.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,F.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,F.jsx)("span",{children:"\u540D\u79F0"}),(0,F.jsx)("span",{children:"\u5927\u5C0F"}),(0,F.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,F.jsx)("span",{"aria-hidden":"true"})]}),(0,F.jsx)("div",{ref:B,className:"dsh-ssh-file-table-body",onScroll:P=>{j&&x(P.currentTarget.scrollTop)},children:m&&!c?(0,F.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):E?(0,F.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,F.jsx)("span",{children:E}),(0,F.jsx)("button",{type:"button",onClick:()=>{L()},children:"\u91CD\u8BD5"})]}):z.length===0?(0,F.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,F.jsx)("div",{className:j?"dsh-ssh-file-virtual-list":void 0,style:j?{height:`${z.length*Pl}px`}:void 0,children:D.map((P,$)=>(0,F.jsx)(ix,{entry:P,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:s,dropTarget:b===P.path,selected:v.includes(P.path),selectedPaths:v,...j?{style:{position:"absolute",insetInline:0,transform:`translateY(${(C+$)*Pl}px)`}}:{},onDelete:()=>R([P]),onDirectoryTarget:V=>{w(!1),S(V)},onDropIntoDirectory:(V,te)=>{S(void 0),h(void 0),a(V,te)},onDragSourceChange:h,onSelect:V=>O(P,V),onOpen:()=>{L(P.path)}},P.path))})})]}),(0,F.jsxs)("footer",{children:[(0,F.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,F.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||r===void 0||!r.endpointId||m,onClick:()=>{r?.endpointId&&n(v,r)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,F.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),y&&(0,F.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,F.jsx)("strong",{children:s?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,F.jsx)("span",{children:c?.path??e.path})]}),T!==void 0&&(0,F.jsx)(Dn,{locationName:H.name,locationKind:"remote",entries:T,onClose:()=>R(void 0),onDelete:ee})]})}function ix({entry:e,paneId:t,endpointId:r,sourceDirectory:s,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:p,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=ln(e),m=d&&(o===void 0||ei(o,o.paths,{endpointId:r,directory:e.path})),f=_=>{if(!d)return;_.preventDefault(),_.stopPropagation(),v(void 0);let x=vs(_.dataTransfer.getData(Lt));x!==void 0&&ei(x,x.paths,{endpointId:r,directory:e.path})&&g(x,e.path)};return(0,F.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||d,className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:_=>{d&&!_.ctrlKey&&!_.metaKey&&!_.shiftKey?c():l(_.ctrlKey||_.metaKey)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key==="Enter"&&d&&c(),_.key===" "&&(_.preventDefault(),l(_.ctrlKey||_.metaKey)))},onDragStart:_=>{let x=n?a:[e.path],y={paneId:t,endpointId:r,directory:s,paths:x};u(y),_.dataTransfer.effectAllowed="copyMove",_.dataTransfer.setData(Lt,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:_=>{_.dataTransfer.types.includes(Lt)&&m&&(_.preventDefault(),_.stopPropagation(),_.dataTransfer.dropEffect=o?.endpointId===r?"move":"copy",v(e.path))},onDragLeave:_=>{i&&!_.currentTarget.contains(_.relatedTarget)&&v(void 0)},onDrop:f,children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(xx,{directory:d}),(0,F.jsx)("i",{title:e.name,children:e.name})]}),(0,F.jsx)("span",{children:d?"\u2014":Gp(e.size)}),(0,F.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:_=>{_.stopPropagation(),p()},children:(0,F.jsx)(At.IconTrashOutline16,{size:14})})]})}function nx({jobs:e,endpoints:t,onCancel:r,onConflict:s}){let[o,i]=(0,_e.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,F.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,F.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,F.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,F.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,F.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,F.jsxs)("article",{children:[(0,F.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,F.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,F.jsxs)("strong",{children:[Jp(a.request.sourcePaths)," ",(0,F.jsx)("i",{children:"\u2192"})," ",fx(t,a.request.destinationEndpointId)]}),(0,F.jsx)("small",{children:a.error??gx(a,h)}),(0,F.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,F.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,F.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{r(a.id)},children:(0,F.jsx)(At.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,F.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>s(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function ox({job:e,onClose:t,onRetry:r}){let[s,o]=(0,_e.useState)("rename"),[i,n]=(0,_e.useState)(!1);return(0,F.jsxs)(et,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,F.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,F.jsx)("strong",{children:Jp(e.request.sourcePaths)}),(0,F.jsx)("span",{children:e.request.destinationDirectory})]}),(0,F.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":s===a[0],className:s===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,F.jsx)("i",{"aria-hidden":"true"}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:a[1]}),(0,F.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,F.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,F.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),r(s).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function ax({endpoints:e,access:t,onClose:r}){let s=t.value,o=e.filter(n=>s?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(s?.fileEndpointIds.includes(n)?s.fileEndpointIds.filter(a=>a!==n):[...s?.fileEndpointIds??[],n]);return(0,F.jsxs)(et,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:r,children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,F.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,F.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,F.jsxs)("header",{children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,F.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,F.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,F.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,F.jsx)(hx,{}):e.length===0?(0,F.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,F.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,F.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,F.jsx)(lx,{endpoint:n,enabled:s?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,F.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,F.jsx)("header",{children:(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,F.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,F.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,F.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,F.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,F.jsx)(cx,{value:s?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,F.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,F.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,F.jsx)(dx,{checked:s?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,F.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,F.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,F.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,F.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:r,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function lx({endpoint:e,enabled:t,onToggle:r}){return(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:r,children:[(0,F.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Rl(e.protocol)}),(0,F.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,F.jsx)("strong",{title:e.name,children:e.name}),(0,F.jsx)("small",{title:e.address,children:e.address})]}),(0,F.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,F.jsx)("i",{"aria-hidden":"true",children:(0,F.jsx)("b",{})}),(0,F.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function hx(){return(0,F.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,F.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,F.jsx)("i",{}),(0,F.jsxs)("b",{children:[(0,F.jsx)("i",{}),(0,F.jsx)("i",{})]}),(0,F.jsx)("em",{})]},e))})}function cx({value:e,onChange:t}){return(0,F.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([r,s])=>(0,F.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===r,className:e===r?"is-active":"",onClick:()=>t(r),children:s},r))})}function dx({checked:e,onChange:t}){return(0,F.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,F.jsx)("i",{"aria-hidden":"true",children:(0,F.jsx)("b",{})}),(0,F.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function ux(){try{let e=JSON.parse(localStorage.getItem(Kp)??"[]");if(!Array.isArray(e))return[Dl("transfer-1",1)];let t=e.slice(0,8).flatMap(r=>{if(typeof r!="object"||r===null)return[];let s=r;if(typeof s.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||typeof s.name!="string"||!Array.isArray(s.panes))return[];let o=s.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:s.id,name:s.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Dl("transfer-1",1)]}function Dl(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[Nn(`${e}-a`),Nn(`${e}-b`)]}}function Nn(e){return{id:e,endpointId:"",path:"/"}}function px(e,t){return e.map(r=>({...r,panes:r.panes.map(s=>!s.endpointId||t.some(o=>o.id===s.endpointId)?s:Nn(s.id))}))}function fx(e,t){return e.find(r=>r.id===t)?.name??t}function Jp(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Rl(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Fn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function mx(e,t){return e===void 0||e.paneId!==t.id&&!Zs(e,{endpointId:t.endpointId,directory:t.path})}function qp(e){return e==="completed"||e==="failed"||e==="cancelled"}function Gp(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function gx(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let r=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),s=e.transferredBytes/r,o=s>0?Math.max(0,(e.totalBytes-e.transferredBytes)/s):0;return`${t.toFixed(0)}% \xB7 ${Gp(s)}/s${o>1?` \xB7 \u7EA6 ${vx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function vx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function _x(){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,F.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function bx(){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,F.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function xx({directory:e}){return(0,F.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,F.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,F.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var Yp=`.dsh-ssh-transfer-workspace {
|
|
4922
4943
|
display: grid;
|
|
4923
4944
|
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
4924
4945
|
width: 100%;
|
|
4925
4946
|
height: 100%;
|
|
4926
4947
|
min-height: 0;
|
|
4927
4948
|
overflow: hidden;
|
|
4928
|
-
background:
|
|
4929
|
-
radial-gradient(circle at 8% 0%, var(--ssh-ambient-light), transparent 34%),
|
|
4930
|
-
radial-gradient(circle at 96% 6%, var(--ssh-ambient-shadow), transparent 31%),
|
|
4931
|
-
linear-gradient(145deg, color-mix(in srgb, var(--ssh-surface-raised) 32%, transparent), transparent 58%),
|
|
4932
|
-
color-mix(in srgb, var(--ssh-surface) 28%, transparent);
|
|
4949
|
+
background: var(--ssh-canvas);
|
|
4933
4950
|
}
|
|
4934
4951
|
.dsh-ssh-transfer-header {
|
|
4935
4952
|
display: flex;
|
|
@@ -4941,7 +4958,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4941
4958
|
padding: 10px 16px;
|
|
4942
4959
|
border: 1px solid var(--ssh-glass-border);
|
|
4943
4960
|
border-radius: 18px;
|
|
4944
|
-
background: var(--ssh-
|
|
4961
|
+
background: var(--ssh-chrome-surface);
|
|
4945
4962
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
4946
4963
|
backdrop-filter: var(--ssh-glass-filter);
|
|
4947
4964
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -4960,7 +4977,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4960
4977
|
padding: 5px 12px;
|
|
4961
4978
|
border: 1px solid var(--ssh-glass-border);
|
|
4962
4979
|
border-radius: 14px;
|
|
4963
|
-
background: var(--ssh-
|
|
4980
|
+
background: var(--ssh-chrome-surface);
|
|
4964
4981
|
-webkit-backdrop-filter: saturate(1.25) blur(20px);
|
|
4965
4982
|
backdrop-filter: saturate(1.25) blur(20px);
|
|
4966
4983
|
box-shadow: var(--ssh-glass-shadow);
|
|
@@ -5016,7 +5033,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5016
5033
|
min-width: 0;
|
|
5017
5034
|
min-height: 0;
|
|
5018
5035
|
overflow: hidden;
|
|
5019
|
-
background: var(--ssh-surface
|
|
5036
|
+
background: var(--ssh-card-surface);
|
|
5020
5037
|
transition: box-shadow var(--ssh-motion-fast) ease;
|
|
5021
5038
|
}
|
|
5022
5039
|
.dsh-ssh-file-pane > header {
|
|
@@ -5117,7 +5134,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5117
5134
|
.dsh-ssh-file-pane.is-drop-target { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ssh-accent) 55%, transparent); }
|
|
5118
5135
|
.dsh-ssh-file-drop-overlay { position: absolute; z-index: 3; inset: 88px 8px 50px; display: grid; place-content: center; gap: 4px; border: 1px dashed color-mix(in srgb, var(--ssh-accent) 58%, transparent); border-radius: 10px; color: var(--ssh-text); background: color-mix(in srgb, var(--ssh-surface-raised) 90%, transparent); backdrop-filter: blur(3px); text-align: center; pointer-events: none; }
|
|
5119
5136
|
.dsh-ssh-file-drop-overlay span { max-width: 260px; overflow: hidden; color: var(--ssh-text-muted); font: var(--ssh-type-caption)/1.4 var(--ssh-font-mono); text-overflow: ellipsis; white-space: nowrap; }
|
|
5120
|
-
.dsh-ssh-transfer-queue { border-top: 1px solid var(--ssh-border); background: var(--ssh-surface
|
|
5137
|
+
.dsh-ssh-transfer-queue { border-top: 1px solid var(--ssh-border); background: var(--ssh-card-surface); }
|
|
5121
5138
|
.dsh-ssh-transfer-queue-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 6px 12px; border: 0; color: var(--ssh-text-muted); background: transparent; font: 500 var(--ssh-type-label)/1.3 var(--ssh-font-sans); cursor: pointer; }
|
|
5122
5139
|
.dsh-ssh-transfer-queue-heading > span:first-child { display: flex; align-items: baseline; gap: 8px; }
|
|
5123
5140
|
.dsh-ssh-transfer-queue-heading strong { color: var(--ssh-text); font-size: var(--ssh-type-body); }
|
|
@@ -5183,7 +5200,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5183
5200
|
.dsh-ssh-ftp-list-empty > span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ssh-border); border-radius: 12px; background: var(--ssh-surface-raised); }
|
|
5184
5201
|
.dsh-ssh-ftp-list-empty strong { color: var(--ssh-text); font-size: var(--ssh-type-body); }
|
|
5185
5202
|
.dsh-ssh-ftp-list-empty p { max-width: 240px; margin: 0 0 6px; font-size: var(--ssh-type-label); line-height: var(--ssh-leading-body); }
|
|
5186
|
-
.dsh-ssh-ftp-manager-detail { min-width: 0; min-height: 0; overflow: hidden; background: var(--ssh-surface
|
|
5203
|
+
.dsh-ssh-ftp-manager-detail { min-width: 0; min-height: 0; overflow: hidden; background: var(--ssh-card-surface); }
|
|
5187
5204
|
.dsh-ssh-ftp-manager-overview { display: grid; place-items: center; align-content: center; height: 100%; padding: 38px; color: var(--ssh-text-subtle); text-align: center; }
|
|
5188
5205
|
.dsh-ssh-ftp-manager-overview > span { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 11px; border: 1px solid var(--ssh-border); border-radius: 14px; background: var(--ssh-surface); }
|
|
5189
5206
|
.dsh-ssh-ftp-manager-overview h3 { margin: 0; color: var(--ssh-text); font-size: 15px; }
|
|
@@ -5221,8 +5238,8 @@ body[data-ds-dark-theme] :is(
|
|
|
5221
5238
|
.dsh-ssh-file-access-dialog-modal {
|
|
5222
5239
|
--ssh-access-edge: var(--ssh-border);
|
|
5223
5240
|
--ssh-access-divider: color-mix(in srgb, var(--ssh-border) 76%, transparent);
|
|
5224
|
-
--ssh-access-surface: var(--ssh-
|
|
5225
|
-
--ssh-access-subtle: var(--ssh-
|
|
5241
|
+
--ssh-access-surface: var(--ssh-modal-surface);
|
|
5242
|
+
--ssh-access-subtle: var(--ssh-modal-surface-raised);
|
|
5226
5243
|
--ssh-access-hover: var(--ssh-hover);
|
|
5227
5244
|
--ssh-access-selected: var(--ssh-selected);
|
|
5228
5245
|
--ssh-access-control: var(--ssh-control);
|
|
@@ -5257,7 +5274,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5257
5274
|
overflow: hidden;
|
|
5258
5275
|
border: 1px solid var(--ssh-glass-border);
|
|
5259
5276
|
border-radius: 14px;
|
|
5260
|
-
background: var(--ssh-
|
|
5277
|
+
background: var(--ssh-modal-surface);
|
|
5261
5278
|
-webkit-backdrop-filter: var(--ssh-glass-filter);
|
|
5262
5279
|
backdrop-filter: var(--ssh-glass-filter);
|
|
5263
5280
|
box-shadow: var(--ssh-glass-shadow), var(--ssh-shadow-lg);
|
|
@@ -5344,7 +5361,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5344
5361
|
flex: none;
|
|
5345
5362
|
padding-bottom: 2px;
|
|
5346
5363
|
color: var(--ssh-text-subtle);
|
|
5347
|
-
font: 570
|
|
5364
|
+
font: 570 var(--ssh-type-caption)/1 var(--ssh-font-mono);
|
|
5348
5365
|
font-style: normal;
|
|
5349
5366
|
font-variant-numeric: tabular-nums;
|
|
5350
5367
|
letter-spacing: .055em;
|
|
@@ -5429,7 +5446,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5429
5446
|
}
|
|
5430
5447
|
.dsh-ssh-file-access-endpoint-copy small {
|
|
5431
5448
|
color: var(--ssh-text-subtle);
|
|
5432
|
-
font:
|
|
5449
|
+
font: var(--ssh-type-caption)/1.35 var(--ssh-font-mono);
|
|
5433
5450
|
}
|
|
5434
5451
|
.dsh-ssh-file-access-state {
|
|
5435
5452
|
display: inline-grid;
|
|
@@ -5464,7 +5481,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5464
5481
|
transform 260ms cubic-bezier(.22, 1, .36, 1);
|
|
5465
5482
|
}
|
|
5466
5483
|
.dsh-ssh-file-access-state > em {
|
|
5467
|
-
font-size:
|
|
5484
|
+
font-size: var(--ssh-type-caption);
|
|
5468
5485
|
font-style: normal;
|
|
5469
5486
|
white-space: nowrap;
|
|
5470
5487
|
}
|
|
@@ -5641,7 +5658,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5641
5658
|
height: 10px;
|
|
5642
5659
|
border-radius: 50%;
|
|
5643
5660
|
background: var(--ssh-text-subtle);
|
|
5644
|
-
box-shadow:
|
|
5661
|
+
box-shadow: var(--ssh-shadow-sm);
|
|
5645
5662
|
transition:
|
|
5646
5663
|
background-color 180ms cubic-bezier(.22, 1, .36, 1),
|
|
5647
5664
|
transform 220ms cubic-bezier(.22, 1, .36, 1);
|
|
@@ -5842,19 +5859,19 @@ body[data-ds-dark-theme] :is(
|
|
|
5842
5859
|
background: var(--ssh-modal-surface);
|
|
5843
5860
|
}
|
|
5844
5861
|
}
|
|
5845
|
-
`;var I=require("react/jsx-runtime"),Nn="@lemoncat7/dsh-ssh",Yp=`${Nn}/client`,yx=["slots","layout","sessions","workspaces"];function wx(e){e.effect(zx,"dsh-ssh: styles");let t=kx(e),r=Sx(e,()=>t.close());e.effect(()=>Pp(Nn,()=>{r.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{r.close(),t.close()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},s=>(0,I.jsx)(Cx,{...s,controller:r,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function Sx(e,t){let r=e,s=new Set,o,i,n=()=>{for(let h of s)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(Sl(Nn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,I.jsx)(Ex,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return s.add(h),()=>s.delete(h)},async createProjectSession(h,l,c,p){let v=await r.workspaces.connectWorkspace(h);return await Si({...vi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:p,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),r.sessions.open(v),String(v)}};return a}function kx(e){let t=new Set,r,s,o,i,n=()=>{for(let h of t)h()},a={open(h,l,c){let p=c??(l===void 0?"local-directory":"remote-directory");if(i!==void 0&&r===h){l!==void 0&&(s=l),o=p,e.layout.openDetails(),n();return}a.close(),Sl(Nn),r=h,s=l,o=p,i=e.slots.register({name:"details",priority:-2},v=>(0,I.jsx)(yp,{...v,controller:a})),e.layout.openDetails(),n()},toggle(h){if(i!==void 0&&r===h)return a.close(h);a.open(h)},close(h){if(h!==void 0&&h!==r)return;let l=i;i=void 0,r=void 0,s=void 0,o=void 0,l?.(),l!==void 0&&e.layout.closeDetails(),n()},isOpen:h=>i!==void 0&&r===h,selected:h=>r===h?s:void 0,requestedView:h=>r===h?o:void 0,subscribe(h){return t.add(h),()=>t.delete(h)}};return a}function Cx(e){let t=(0,ne.useRef)(null);Op(t);let r=e.useSessions(f=>f.current),s=r===void 0?void 0:String(r),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),p=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>s!==void 0&&e.activityController.isOpen(s));(0,ne.useEffect)(()=>Fp(f=>{f.sessionId===s&&a(f)}),[s]);let v=(0,ne.useCallback)(async()=>{let f=await jn().catch(()=>[]);i(f),a(r===void 0?null:await wi(String(r)).catch(()=>null))},[r]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(f=>o.find(_=>_.id===f)).filter(f=>f!==void 0);(0,ne.useEffect)(()=>{if(s===void 0||n?.permission!=="terminal")return;let f=new EventSource(Wl(s)),_=x=>{let y=Bx(x);y===void 0||y.sessionId!==s||(e.controller.close(),e.activityController.open(s,y.profileId,"terminals"))};return f.addEventListener("terminal-opened",_),()=>{f.removeEventListener("terminal-opened",_),f.close()}},[s,n?.permission,e.activityController,e.controller]);let u=f=>{s!==void 0&&(e.controller.close(),e.activityController.open(s,f,f===void 0?"local-directory":"remote-directory"))},d=()=>{s!==void 0&&(p?e.activityController.close(s):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,I.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,I.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(f=>!f),children:[(0,I.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,I.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,I.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,I.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${p?" is-active":""}`,"aria-label":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":p,disabled:s===void 0,onClick:d,children:(0,I.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,I.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,I.jsx)(Cr,{}),(0,I.jsx)("span",{children:"SSH \u9762\u677F"})]}),s===void 0?(0,I.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,I.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(f=>(0,I.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":p&&e.activityController.selected(s)===f.id,className:`dsh-ssh-sidebar-row${p&&e.activityController.selected(s)===f.id?" is-active":""}`,onClick:()=>u(f.id),children:[(0,I.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,I.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,I.jsx)("strong",{children:f.name}),(0,I.jsx)("small",{children:f.host})]}),(0,I.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},f.id)),g.length>6&&(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,I.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,I.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${p?" is-active":""}`,title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":p,disabled:s===void 0,onClick:d,children:(0,I.jsx)(Cr,{})})})}function Ex(e){let t=_s(),r=e.useSessions(z=>z.current),s=e.useWorkspaces(z=>z),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,p]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,f]=(0,ne.useState)(),[_,x]=(0,ne.useState)(),[y,w]=(0,ne.useState)(0),[b,S]=(0,ne.useState)(),T=zp(r===void 0?void 0:String(r)),R=(0,ne.useRef)(r),E=(0,ne.useCallback)(async()=>{try{let[z,j,C,D]=await Promise.all([jn(),Al(),Fl(),Nl()]);i(z),p(j),a(C),l(D),g(L=>L!==null&&z.some(k=>k.id===L.profileId)?L:z[0]===void 0?null:{profileId:z[0].id,path:"~"}),S(void 0)}catch(z){S(nt(z))}},[]);(0,ne.useEffect)(()=>{let z=()=>{let j=e.controller.selected();j!==void 0&&g(C=>({profileId:j,path:C?.profileId===j?C.path:"~"}))};return z(),e.controller.subscribe(z)},[e.controller]),(0,ne.useEffect)(()=>{E()},[E,y]),(0,ne.useEffect)(()=>{R.current!==r&&e.controller.close()},[e.controller,r]);let A=o.find(z=>z.id===v?.profileId),B=s.items.find(z=>r!==void 0&&z.sessionIds.includes(r))?.workspaceId,M=(0,I.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,I.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,I.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,I.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,I.jsx)(Cr,{})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,I.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,I.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,I.jsx)(is,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,I.jsx)(is,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,I.jsx)(is,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,I.jsx)(is,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,I.jsx)(is,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,I.jsx)(is,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Sp,{className:"dsh-ssh-workspace",toolbar:M,notice:b&&(0,I.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,I.jsx)("span",{children:b}),(0,I.jsx)("button",{onClick:()=>S(void 0),"aria-label":"\u5173\u95ED",children:(0,I.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,I.jsx)(ye.IconDataOutline16,{size:15}),navigation:z=>(0,I.jsx)(Bp,{profiles:o,access:T.value,accessLoading:T.loading,accessSaving:T.saving,accessError:T.error,workspaces:s.items,currentWorkspaceId:B===void 0?void 0:String(B),recentWorkspaceId:s.recentWorkspaceId===void 0?void 0:String(s.recentWorkspaceId),selected:v,onSelect:j=>{g(j),d("workspace"),e.controller.open(j.profileId),z.closePanel()},onProfiles:T.setProfiles,onDirectory:(j,C,D)=>{T.setDirectory(j,C,D),C!==void 0&&(g({profileId:j,path:C,...D===void 0?{}:{projectId:D}}),d("workspace"))},onPermission:T.setPermission,onApproval:T.setRequireCommandApproval,onCreateSession:async(j,C)=>{await e.controller.createProjectSession(C,j,T.value?.permission??"exec",T.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{f("new"),z.closePanel()}}),children:(0,I.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,I.jsx)(Kp,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:T,onProfilesChanged:()=>w(z=>z+1)}):u==="vault"?(0,I.jsx)(Rx,{entries:n,onChanged:()=>w(z=>z+1)}):u==="proxies"?(0,I.jsx)(Ix,{entries:h,onChanged:()=>w(z=>z+1)}):A===void 0?(0,I.jsx)(cp,{}):u==="workspace"?(0,I.jsx)(Tx,{profile:A,initialPath:v?.path??"~",onEdit:()=>f(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,I.jsx)(Dx,{profiles:o,selected:A}):(0,I.jsx)(Ox,{})})}),m!==void 0&&(0,I.jsx)($p,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>f(void 0),onSaved:()=>{f(void 0),w(z=>z+1)}}),_!==void 0&&(0,I.jsx)(jp,{profile:_,dependents:o.filter(z=>z.id!==_.id&&z.proxy.type==="jump"&&z.proxy.profileIds.includes(_.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),f(void 0),w(z=>z+1)}})]})}function Tx({profile:e,initialPath:t,onEdit:r,onDelete:s}){let[o,i]=(0,ne.useState)(!1),n=_s();return(0,I.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,I.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,I.jsxs)("span",{children:[(0,I.jsx)("h1",{children:e.name}),(0,I.jsxs)("p",{children:[Kt(e)," \xB7 ",Zp(e)]})]})]}),(0,I.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,I.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,I.jsx)(Up,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,I.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,I.jsx)(Px,{profile:e,onEdit:r,onDelete:s,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,I.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,I.jsx)(mp,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,I.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,I.jsx)("span",{children:"SFTP"}),(0,I.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,I.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function Px({profile:e,onEdit:t,onDelete:r,onConnected:s,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[p,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let f=i.current;if(f===null)return;let _=An({scrollback:5e3}),x=new Qp.FitAddon;_.loadAddon(x),_.open(f),n.current=_,a.current=x;let y=In(f,_,x,(w,b)=>{let S=h.current;S!==void 0&&ae(`/terminals/${S}/resize`,{method:"POST",body:JSON.stringify({cols:w,rows:b})}).catch(()=>{})});return()=>{y.dispose(),_.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let f=n.current;if(f===void 0)return;let _=new As({streamUrl:nh(l),read:w=>ae(`/terminals/${l}/output?cursor=${w}`),send:(w,b)=>ae(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:w,sequence:b})})}),x=f.onData(w=>_.sendInput(w,b=>u(nt(b)))),y=_.observe({output:w=>{w.truncated&&f.write(`\r
|
|
5862
|
+
`;var I=require("react/jsx-runtime"),zn="@lemoncat7/dsh-ssh",Qp=`${zn}/client`,wx=["slots","layout","sessions","workspaces"];function Sx(e){e.effect(Hx,"dsh-ssh: styles");let t=Cx(e),r=kx(e,()=>t.close());e.effect(()=>Dp(zn,()=>{r.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{r.close(),t.close()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},s=>(0,I.jsx)(Ex,{...s,controller:r,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function kx(e,t){let r=e,s=new Set,o,i,n=()=>{for(let h of s)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(kl(zn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,I.jsx)(Tx,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return s.add(h),()=>s.delete(h)},async createProjectSession(h,l,c,p){let v=await r.workspaces.connectWorkspace(h);return await Si({...vi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:p,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),r.sessions.open(v),String(v)}};return a}function Cx(e){let t=new Set,r,s,o,i,n=()=>{for(let h of t)h()},a={open(h,l,c){let p=c??(l===void 0?"local-directory":"remote-directory");if(i!==void 0&&r===h){l!==void 0&&(s=l),o=p,e.layout.openDetails(),n();return}a.close(),kl(zn),r=h,s=l,o=p,i=e.slots.register({name:"details",priority:-2},v=>(0,I.jsx)(wp,{...v,controller:a})),e.layout.openDetails(),n()},toggle(h){if(i!==void 0&&r===h)return a.close(h);a.open(h)},close(h){if(h!==void 0&&h!==r)return;let l=i;i=void 0,r=void 0,s=void 0,o=void 0,l?.(),l!==void 0&&e.layout.closeDetails(),n()},isOpen:h=>i!==void 0&&r===h,selected:h=>r===h?s:void 0,requestedView:h=>r===h?o:void 0,subscribe(h){return t.add(h),()=>t.delete(h)}};return a}function Ex(e){let t=(0,ne.useRef)(null);Mp(t);let r=e.useSessions(f=>f.current),s=r===void 0?void 0:String(r),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),p=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>s!==void 0&&e.activityController.isOpen(s));(0,ne.useEffect)(()=>Np(f=>{f.sessionId===s&&a(f)}),[s]);let v=(0,ne.useCallback)(async()=>{let f=await $n().catch(()=>[]);i(f),a(r===void 0?null:await wi(String(r)).catch(()=>null))},[r]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(f=>o.find(_=>_.id===f)).filter(f=>f!==void 0);(0,ne.useEffect)(()=>{if(s===void 0||n?.permission!=="terminal")return;let f=new EventSource(ql(s)),_=x=>{let y=Fx(x);y===void 0||y.sessionId!==s||(e.controller.close(),e.activityController.open(s,y.profileId,"terminals"))};return f.addEventListener("terminal-opened",_),()=>{f.removeEventListener("terminal-opened",_),f.close()}},[s,n?.permission,e.activityController,e.controller]);let u=f=>{s!==void 0&&(e.controller.close(),e.activityController.open(s,f,f===void 0?"local-directory":"remote-directory"))},d=()=>{s!==void 0&&(p?e.activityController.close(s):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,I.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,I.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(f=>!f),children:[(0,I.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,I.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,I.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,I.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${p?" is-active":""}`,"aria-label":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":p,disabled:s===void 0,onClick:d,children:(0,I.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,I.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,I.jsx)(Cr,{}),(0,I.jsx)("span",{children:"SSH \u9762\u677F"})]}),s===void 0?(0,I.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,I.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(f=>(0,I.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":p&&e.activityController.selected(s)===f.id,className:`dsh-ssh-sidebar-row${p&&e.activityController.selected(s)===f.id?" is-active":""}`,onClick:()=>u(f.id),children:[(0,I.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,I.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,I.jsx)("strong",{children:f.name}),(0,I.jsx)("small",{children:f.host})]}),(0,I.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},f.id)),g.length>6&&(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,I.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,I.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${p?" is-active":""}`,title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":p?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":p,disabled:s===void 0,onClick:d,children:(0,I.jsx)(Cr,{})})})}function Tx(e){let t=_s(),r=e.useSessions(z=>z.current),s=e.useWorkspaces(z=>z),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,p]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,f]=(0,ne.useState)(),[_,x]=(0,ne.useState)(),[y,w]=(0,ne.useState)(0),[b,S]=(0,ne.useState)(),T=Hp(r===void 0?void 0:String(r)),R=(0,ne.useRef)(r),E=(0,ne.useCallback)(async()=>{try{let[z,j,C,D]=await Promise.all([$n(),Il(),Nl(),zl()]);i(z),p(j),a(C),l(D),g(L=>L!==null&&z.some(k=>k.id===L.profileId)?L:z[0]===void 0?null:{profileId:z[0].id,path:"~"}),S(void 0)}catch(z){S(nt(z))}},[]);(0,ne.useEffect)(()=>{let z=()=>{let j=e.controller.selected();j!==void 0&&g(C=>({profileId:j,path:C?.profileId===j?C.path:"~"}))};return z(),e.controller.subscribe(z)},[e.controller]),(0,ne.useEffect)(()=>{E()},[E,y]),(0,ne.useEffect)(()=>{R.current!==r&&e.controller.close()},[e.controller,r]);let A=o.find(z=>z.id===v?.profileId),B=s.items.find(z=>r!==void 0&&z.sessionIds.includes(r))?.workspaceId,M=(0,I.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,I.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,I.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,I.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,I.jsx)(Cr,{})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,I.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,I.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,I.jsx)(is,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,I.jsx)(is,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,I.jsx)(is,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,I.jsx)(is,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,I.jsx)(is,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,I.jsx)(is,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(kp,{className:"dsh-ssh-workspace",toolbar:M,notice:b&&(0,I.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,I.jsx)("span",{children:b}),(0,I.jsx)("button",{onClick:()=>S(void 0),"aria-label":"\u5173\u95ED",children:(0,I.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,I.jsx)(ye.IconDataOutline16,{size:15}),navigation:z=>(0,I.jsx)(Fp,{profiles:o,access:T.value,accessLoading:T.loading,accessSaving:T.saving,accessError:T.error,workspaces:s.items,currentWorkspaceId:B===void 0?void 0:String(B),recentWorkspaceId:s.recentWorkspaceId===void 0?void 0:String(s.recentWorkspaceId),selected:v,onSelect:j=>{g(j),d("workspace"),e.controller.open(j.profileId),z.closePanel()},onProfiles:T.setProfiles,onDirectory:(j,C,D)=>{T.setDirectory(j,C,D),C!==void 0&&(g({profileId:j,path:C,...D===void 0?{}:{projectId:D}}),d("workspace"))},onPermission:T.setPermission,onApproval:T.setRequireCommandApproval,onCreateSession:async(j,C)=>{await e.controller.createProjectSession(C,j,T.value?.permission??"exec",T.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{f("new"),z.closePanel()}}),children:(0,I.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,I.jsx)(Xp,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:T,onProfilesChanged:()=>w(z=>z+1)}):u==="vault"?(0,I.jsx)(Ax,{entries:n,onChanged:()=>w(z=>z+1)}):u==="proxies"?(0,I.jsx)(Lx,{entries:h,onChanged:()=>w(z=>z+1)}):A===void 0?(0,I.jsx)(dp,{}):u==="workspace"?(0,I.jsx)(Px,{profile:A,initialPath:v?.path??"~",onEdit:()=>f(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,I.jsx)(Rx,{profiles:o,selected:A}):(0,I.jsx)(Mx,{})})}),m!==void 0&&(0,I.jsx)(Vp,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>f(void 0),onSaved:()=>{f(void 0),w(z=>z+1)}}),_!==void 0&&(0,I.jsx)($p,{profile:_,dependents:o.filter(z=>z.id!==_.id&&z.proxy.type==="jump"&&z.proxy.profileIds.includes(_.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),f(void 0),w(z=>z+1)}})]})}function Px({profile:e,initialPath:t,onEdit:r,onDelete:s}){let[o,i]=(0,ne.useState)(!1),n=_s();return(0,I.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,I.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,I.jsxs)("span",{children:[(0,I.jsx)("h1",{children:e.name}),(0,I.jsxs)("p",{children:[Kt(e)," \xB7 ",ef(e)]})]})]}),(0,I.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,I.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,I.jsx)(jp,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,I.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,I.jsx)(Dx,{profile:e,onEdit:r,onDelete:s,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,I.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,I.jsx)(gp,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,I.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,I.jsx)("span",{children:"SFTP"}),(0,I.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,I.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function Dx({profile:e,onEdit:t,onDelete:r,onConnected:s,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[p,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let f=i.current;if(f===null)return;let _=In({scrollback:5e3}),x=new Zp.FitAddon;_.loadAddon(x),_.open(f),n.current=_,a.current=x;let y=Ln(f,_,x,(w,b)=>{let S=h.current;S!==void 0&&ae(`/terminals/${S}/resize`,{method:"POST",body:JSON.stringify({cols:w,rows:b})}).catch(()=>{})});return()=>{y.dispose(),_.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let f=n.current;if(f===void 0)return;let _=new As({streamUrl:oh(l),read:w=>ae(`/terminals/${l}/output?cursor=${w}`),send:(w,b)=>ae(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:w,sequence:b})})}),x=f.onData(w=>_.sendInput(w,b=>u(nt(b)))),y=_.observe({output:w=>{w.truncated&&f.write(`\r
|
|
5846
5863
|
\x1B[33m[\u8F83\u65E9\u8F93\u51FA\u5DF2\u622A\u65AD]\x1B[0m\r
|
|
5847
5864
|
`),w.data&&f.write(w.data),w.closed&&(v("idle"),c(void 0))},error:w=>{u(nt(w)),v("error")}});return()=>{y(),_.dispose(),x.dispose()}},[l]),(0,ne.useEffect)(()=>()=>{l!==void 0&&ae(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{})},[l]),(0,ne.useEffect)(()=>{c(void 0),v("idle"),n.current?.clear()},[e.id]);let d=async()=>{let f=n.current;if(f!==void 0){v("connecting"),u(void 0),f.clear(),f.write(`\x1B[2m\u6B63\u5728\u8FDE\u63A5 ${Kt(e)}\u2026\x1B[0m\r
|
|
5848
5865
|
`);try{a.current?.fit();let _=await ae("/terminals",{method:"POST",body:JSON.stringify({profileId:e.id,cols:f.cols,rows:f.rows})});c(_.id),v("connected"),s?.(),f.focus()}catch(_){v("error"),u(nt(_)),f.write(`\r
|
|
5849
5866
|
\x1B[31m${nt(_)}\x1B[0m\r
|
|
5850
|
-
`)}}},m=async()=>{l!==void 0&&await ae(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{}),c(void 0),v("idle")};return(0,I.jsxs)("div",{className:`dsh-ssh-terminal-pane${o?" is-embedded":""}`,children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsxs)("div",{className:"dsh-ssh-title-line",children:[(0,I.jsx)("span",{className:`dsh-ssh-live-dot is-${p}`})," ",(0,I.jsx)("h1",{children:o?"\u7EC8\u7AEF":e.name})]}),(0,I.jsx)("p",{children:o?Kt(e):`${Kt(e)} \xB7 ${Zp(e)}`})]}),(0,I.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[!o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:t,children:[(0,I.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91"]})]}),p==="connected"?(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",onClick:()=>{m()},children:[(0,I.jsx)(ye.IconStopFill16,{size:16}),"\u65AD\u5F00"]}):(0,I.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:p==="connecting",onClick:()=>{d()},children:p==="connecting"?"\u8FDE\u63A5\u4E2D\u2026":"\u6253\u5F00\u7EC8\u7AEF"})]})]}),g&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,I.jsxs)("div",{className:"dsh-ssh-terminal-frame",children:[(0,I.jsx)("div",{className:"dsh-ssh-xterm",children:(0,I.jsx)("div",{ref:i,className:"dsh-ssh-terminal-viewport"})}),(0,I.jsxs)("div",{className:"dsh-ssh-terminal-status",children:[(0,I.jsx)("span",{children:p==="connected"?"\u5DF2\u8FDE\u63A5":p==="connecting"?"\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u8FDE\u63A5":"\u7EC8\u7AEF\u672A\u8FDE\u63A5"}),(0,I.jsxs)("span",{children:["UTF-8 \xB7 ",e.terminalType]})]})]})]})}function Dx({profiles:e,selected:t}){let[r,s]=(0,ne.useState)([]),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(),[h,l]=(0,ne.useState)(),c=(0,ne.useCallback)(async()=>{try{let u=await zl();s(u.rules),i(u.statuses)}catch(u){l(nt(u))}},[]);(0,ne.useEffect)(()=>{let u=!1,d,m=async()=>{await c(),u||(d=window.setTimeout(()=>{m()},document.visibilityState==="hidden"?15e3:4e3))};return m(),()=>{u=!0,d!==void 0&&window.clearTimeout(d)}},[c]);let p=r.filter(u=>u.profileId===t.id),v=async(u,d)=>{try{await ae(`/forwards/${u}/${d}`,{method:"POST",body:"{}"}),await c()}catch(m){l(nt(m))}},g=async u=>{try{await ae(`/forwards/${u}`,{method:"DELETE"}),await c()}catch(d){l(nt(d))}};return(0,I.jsxs)("div",{className:"dsh-ssh-forward-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,I.jsxs)("p",{children:[t.name," \xB7 \u672C\u5730\u3001\u8FDC\u7A0B\u4E0E\u52A8\u6001 SOCKS5"]})]}),(0,I.jsxs)("button",{className:"dsh-ssh-primary-button",onClick:()=>a("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u89C4\u5219"]})]}),h&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:h}),(0,I.jsx)("div",{className:"dsh-ssh-forward-list",children:p.length===0?(0,I.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u53F0\u4E3B\u673A\u8FD8\u6CA1\u6709\u7AEF\u53E3\u8F6C\u53D1\u89C4\u5219\u3002"}):p.map(u=>{let d=o.find(m=>m.ruleId===u.id);return(0,I.jsxs)("article",{className:"dsh-ssh-forward-row",children:[(0,I.jsx)("span",{className:`dsh-ssh-forward-kind is-${u.kind}`,children:u.kind==="local"?"L":u.kind==="remote"?"R":"D"}),(0,I.jsxs)("span",{className:"dsh-ssh-forward-copy",children:[(0,I.jsx)("strong",{children:u.name}),(0,I.jsx)("small",{children:Fx(u,d)})]}),(0,I.jsx)("span",{className:`dsh-ssh-state-label is-${d?.state??"stopped"}`,children:Nx(d)}),(0,I.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>a(u),"aria-label":"\u7F16\u8F91",children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),d?.state==="running"?(0,I.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>{v(u.id,"stop")},"aria-label":"\u505C\u6B62",children:(0,I.jsx)(ye.IconStopFill16,{size:16})}):(0,I.jsx)("button",{className:"dsh-ssh-small-primary",onClick:()=>{v(u.id,"start")},children:"\u542F\u52A8"}),(0,I.jsx)("button",{className:"dsh-ssh-icon-button is-danger",onClick:()=>{g(u.id)},"aria-label":"\u5220\u9664",children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},u.id)})}),n!==void 0&&(0,I.jsx)(Mx,{profile:t,value:n==="new"?void 0:n,profiles:e,onClose:()=>a(void 0),onSaved:()=>{a(void 0),c()}})]})}function Rx({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u5BC6\u94A5\u5E93\u6761\u76EE\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await ae(`/vault/${a.id}`,{method:"DELETE"}),t()}catch(h){i(nt(h))}};return(0,I.jsxs)("div",{className:"dsh-ssh-vault-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u5BC6\u94A5\u5E93"}),(0,I.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528\u8D26\u53F7\uFF0C\u8FDE\u63A5\u914D\u7F6E\u53EA\u5F15\u7528\u51ED\u636E\u3002"})]}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u51ED\u636E"]})]}),o&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,I.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,I.jsx)("span",{children:(0,I.jsx)(ye.IconUserOutline16,{size:20})}),(0,I.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u51ED\u636E"}),(0,I.jsx)("p",{children:"\u5BC6\u7801\u548C\u79C1\u94A5\u53EA\u4FDD\u5B58\u5728 DSH \u51ED\u636E\u670D\u52A1\u4E2D\uFF0C\u4E0D\u5199\u5165 SSH \u914D\u7F6E\u6587\u4EF6\u3002"}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u51ED\u636E"]})]}):(0,I.jsx)("div",{className:"dsh-ssh-vault-list",children:e.map(a=>(0,I.jsxs)("article",{className:"dsh-ssh-vault-row",children:[(0,I.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,I.jsx)(ye.IconUserOutline16,{size:16})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:a.name}),(0,I.jsxs)("small",{children:[a.username," \xB7 ",a.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,I.jsx)("span",{className:`dsh-ssh-vault-state${a.credential.configured?" is-ready":""}`,children:a.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u51ED\u636E"}),(0,I.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u51ED\u636E",onClick:()=>{n(a)},children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,I.jsx)(Ax,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Ax({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",username:e?.username??"",authType:e?.authType??"password",password:"",privateKey:"",passphrase:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await ae(e===void 0?"/vault":`/vault/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,username:s.username,authType:s.authType},secrets:{password:s.password,privateKey:s.privateKey,passphrase:s.passphrase}})}),r()}catch(p){h(nt(p))}finally{n(!1)}};return(0,I.jsx)(et,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u51ED\u636E":`\u7F16\u8F91 ${e.name}`,subtitle:"\u5BC6\u7801\u548C\u79C1\u94A5\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u751F\u4EA7\u73AF\u5883\u8FD0\u7EF4"})}),(0,I.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,I.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:s.username,onChange:c=>o({...s,username:c.target.value})})})]}),(0,I.jsx)(pe,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,I.jsxs)("select",{value:s.authType,onChange:c=>o({...s,authType:c.target.value}),children:[(0,I.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,I.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"})]})}),s.authType==="password"?(0,I.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u5FC5\u586B\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,I.jsx)("input",{required:e===void 0||!e.credential.fields.includes("password"),type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(pe,{label:"\u79C1\u94A5",hint:e?.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH \u6216 PEM \u79C1\u94A5",children:(0,I.jsx)("textarea",{required:e===void 0||!e.credential.fields.includes("privateKey"),rows:7,spellCheck:!1,value:s.privateKey,onChange:c=>o({...s,privateKey:c.target.value})})}),(0,I.jsx)(pe,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,I.jsx)("input",{type:"password",autoComplete:"new-password",value:s.passphrase,onChange:c=>o({...s,passphrase:c.target.value})})})]}),a&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u51ED\u636E"})]})]})})}function Ix({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u4EE3\u7406\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await ae(`/proxies/${a.id}`,{method:"DELETE"}),t()}catch(h){i(nt(h))}};return(0,I.jsxs)("div",{className:"dsh-ssh-proxy-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u4EE3\u7406\u5E93"}),(0,I.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528 HTTP \u4E0E SOCKS5 \u4EE3\u7406\uFF0C\u4E3B\u673A\u914D\u7F6E\u53EA\u4FDD\u7559\u5F15\u7528\u3002"})]}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u4EE3\u7406"]})]}),o&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,I.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,I.jsx)("span",{children:(0,I.jsx)(ye.IconDataOutline16,{size:20})}),(0,I.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u4EE3\u7406"}),(0,I.jsx)("p",{children:"\u4FDD\u5B58\u4E00\u6B21\u540E\uFF0C\u591A\u53F0 SSH \u4E3B\u673A\u53EF\u4EE5\u5171\u7528\u540C\u4E00\u6761\u8FDE\u63A5\u8DEF\u5F84\u3002"}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u4EE3\u7406"]})]}):(0,I.jsx)("div",{className:"dsh-ssh-proxy-list",children:e.map(a=>(0,I.jsxs)("article",{className:"dsh-ssh-proxy-row",children:[(0,I.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,I.jsx)(ye.IconDataOutline16,{size:16})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:a.name}),(0,I.jsxs)("small",{children:[a.host,":",a.port,a.username?` \xB7 ${a.username}`:""]})]}),(0,I.jsx)("span",{className:"dsh-ssh-proxy-kind",children:a.proxyType==="http"?"HTTP":"SOCKS5"}),(0,I.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u4EE3\u7406",onClick:()=>{n(a)},children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,I.jsx)(Lx,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Lx({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",proxyType:e?.proxyType??"socks5",host:e?.host??"",port:String(e?.port??1080),username:e?.username??"",password:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await ae(e===void 0?"/proxies":`/proxies/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,proxyType:s.proxyType,host:s.host,port:Number(s.port),...s.username.trim()?{username:s.username.trim()}:{}},secrets:{proxyPassword:s.password}})}),r()}catch(p){h(nt(p))}finally{n(!1)}};return(0,I.jsx)(et,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u4EE3\u7406":`\u7F16\u8F91 ${e.name}`,subtitle:"\u4EE3\u7406\u5BC6\u7801\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u529E\u516C\u5BA4 SOCKS5"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7C7B\u578B",children:(0,I.jsxs)("select",{value:s.proxyType,onChange:c=>o({...s,proxyType:c.target.value}),children:[(0,I.jsx)("option",{value:"socks5",children:"SOCKS5"}),(0,I.jsx)("option",{value:"http",children:"HTTP CONNECT"})]})})]}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,I.jsx)("input",{required:!0,maxLength:253,value:s.host,onChange:c=>o({...s,host:c.target.value}),placeholder:"127.0.0.1"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,I.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:s.port,onChange:c=>o({...s,port:c.target.value})})})]}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,I.jsx)("input",{maxLength:128,value:s.username,onChange:c=>o({...s,username:c.target.value}),autoComplete:"username"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u5BC6\u7801",hint:e?.credential.fields.includes("proxyPassword")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u53EF\u9009\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,I.jsx)("input",{type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})})]}),a&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u4EE3\u7406"})]})]})})}function Ox(){let[e,t]=(0,ne.useState)(),[r,s]=(0,ne.useState)();(0,ne.useEffect)(()=>{ae("/settings").then(t).catch(i=>s(nt(i)))},[]);let o=async i=>{try{t(await ae("/settings",{method:"PUT",body:JSON.stringify(i)}))}catch(n){s(nt(n))}};return(0,I.jsxs)("div",{className:"dsh-ssh-settings-pane",children:[(0,I.jsx)("div",{className:"dsh-ssh-content-heading",children:(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"SSH \u8BBE\u7F6E"}),(0,I.jsx)("p",{children:"\u5B89\u5168\u8FB9\u754C\u548C AI \u547D\u4EE4\u8F93\u51FA\u9650\u5236"})]})}),e&&(0,I.jsxs)("div",{className:"dsh-ssh-settings-group",children:[(0,I.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u5141\u8BB8\u516C\u5F00\u7AEF\u53E3\u7ED1\u5B9A"}),(0,I.jsx)("small",{children:"\u5141\u8BB8\u8F6C\u53D1\u76D1\u542C 0.0.0.0 \u6216\u5176\u4ED6\u975E\u56DE\u73AF\u5730\u5740\u3002\u4EC5\u5728\u660E\u786E\u914D\u7F6E\u9632\u706B\u5899\u540E\u5F00\u542F\u3002"})]}),(0,I.jsx)("input",{type:"checkbox",checked:e.allowPublicBind,onChange:i=>{o({...e,allowPublicBind:i.target.checked})}})]}),(0,I.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u9ED8\u8BA4\u547D\u4EE4\u8D85\u65F6"}),(0,I.jsx)("small",{children:"AI \u7684 ssh_exec \u6700\u957F\u7B49\u5F85\u65F6\u95F4"})]}),(0,I.jsx)("input",{type:"number",min:"1000",max:"300000",step:"1000",value:e.defaultCommandTimeoutMs,onChange:i=>t({...e,defaultCommandTimeoutMs:Number(i.target.value)}),onBlur:()=>{o(e)}}),(0,I.jsx)("em",{children:"\u6BEB\u79D2"})]}),(0,I.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u6700\u5927\u547D\u4EE4\u8F93\u51FA"}),(0,I.jsx)("small",{children:"\u8D85\u51FA\u540E\u4FDD\u7559\u6700\u65B0\u8F93\u51FA\uFF0C\u907F\u514D\u6324\u5360\u4E0A\u4E0B\u6587"})]}),(0,I.jsx)("input",{type:"number",min:"1000",max:"1000000",step:"1000",value:e.maxOutputChars,onChange:i=>t({...e,maxOutputChars:Number(i.target.value)}),onBlur:()=>{o(e)}}),(0,I.jsx)("em",{children:"\u5B57\u7B26"})]})]}),r&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:r})]})}function Mx({profile:e,value:t,onClose:r,onSaved:s}){let[o,i]=(0,ne.useState)({name:t?.name??"",kind:t?.kind??"local",bindHost:t?.bindHost??"127.0.0.1",bindPort:String(t?.bindPort??0),targetHost:t?.targetHost??"127.0.0.1",targetPort:String(t?.targetPort??80),autoStart:t?.autoStart??!1}),[n,a]=(0,ne.useState)(),h=async l=>{l.preventDefault();try{await ae(t===void 0?"/forwards":`/forwards/${t.id}`,{method:t===void 0?"POST":"PUT",body:JSON.stringify({rule:{profileId:e.id,name:o.name,kind:o.kind,bindHost:o.bindHost,bindPort:Number(o.bindPort),...o.kind==="dynamic"?{}:{targetHost:o.targetHost,targetPort:Number(o.targetPort)},autoStart:o.autoStart}})}),s()}catch(c){a(nt(c))}};return(0,I.jsx)(et,{title:t===void 0?"\u65B0\u5EFA\u7AEF\u53E3\u8F6C\u53D1":`\u7F16\u8F91 ${t.name}`,subtitle:e.name,onClose:r,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:l=>{h(l)},children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,value:o.name,onChange:l=>i({...o,name:l.target.value})})}),(0,I.jsx)(pe,{label:"\u7C7B\u578B",children:(0,I.jsxs)("select",{value:o.kind,onChange:l=>i({...o,kind:l.target.value}),children:[(0,I.jsx)("option",{value:"local",children:"\u672C\u5730\u8F6C\u53D1\uFF08L\uFF09"}),(0,I.jsx)("option",{value:"remote",children:"\u8FDC\u7A0B\u8F6C\u53D1\uFF08R\uFF09"}),(0,I.jsx)("option",{value:"dynamic",children:"\u52A8\u6001 SOCKS5\uFF08D\uFF09"})]})}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u76D1\u542C\u5730\u5740",children:(0,I.jsx)("input",{required:!0,value:o.bindHost,onChange:l=>i({...o,bindHost:l.target.value})})}),(0,I.jsx)(pe,{label:"\u76D1\u542C\u7AEF\u53E3",hint:"0 \u8868\u793A\u81EA\u52A8\u9009\u62E9",children:(0,I.jsx)("input",{required:!0,type:"number",min:"0",max:"65535",value:o.bindPort,onChange:l=>i({...o,bindPort:l.target.value})})})]}),o.kind!=="dynamic"&&(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u76EE\u6807\u4E3B\u673A",children:(0,I.jsx)("input",{required:!0,value:o.targetHost,onChange:l=>i({...o,targetHost:l.target.value})})}),(0,I.jsx)(pe,{label:"\u76EE\u6807\u7AEF\u53E3",children:(0,I.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:o.targetPort,onChange:l=>i({...o,targetPort:l.target.value})})})]}),(0,I.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u81EA\u52A8\u542F\u52A8"}),(0,I.jsx)("small",{children:"DSH \u542F\u52A8\u65F6\u6062\u590D\u6B64\u8F6C\u53D1"})]}),(0,I.jsx)("input",{type:"checkbox",checked:o.autoStart,onChange:l=>i({...o,autoStart:l.target.checked})})]}),n&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:n}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:r,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",children:"\u4FDD\u5B58\u89C4\u5219"})]})]})})}function Zp(e){return e.proxy.type==="none"?"\u76F4\u8FDE":e.proxy.type==="saved"?"\u5E38\u7528\u4EE3\u7406":e.proxy.type==="jump"?"SSH \u8DF3\u677F":e.proxy.type==="http"?"HTTP \u4EE3\u7406":"SOCKS5 \u4EE3\u7406"}var nt=Pe;function Bx(e){if(!(!(e instanceof MessageEvent)||typeof e.data!="string"))try{let t=JSON.parse(e.data);return t.type!=="terminal-opened"||typeof t.sessionId!="string"||typeof t.terminalId!="string"||typeof t.profileId!="string"||typeof t.createdAt!="number"?void 0:t}catch{return}}function Fx(e,t){let r=`${e.bindHost}:${t?.bindPort??e.bindPort}`;return e.kind==="dynamic"?`${r} \u2192 SOCKS5`:`${r} \u2192 ${e.targetHost}:${e.targetPort}`}function Nx(e){return e?.state==="running"?`\u8FD0\u884C\u4E2D \xB7 ${e.connections}`:e?.state==="starting"?"\u542F\u52A8\u4E2D":e?.state==="error"?"\u5931\u8D25":"\u5DF2\u505C\u6B62"}function zx(){if(document.getElementById(Yp)!==null)return()=>{};let t=document.createElement("style");return t.id=Yp,t.textContent=`${Dp}
|
|
5851
|
-
${kp}
|
|
5867
|
+
`)}}},m=async()=>{l!==void 0&&await ae(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{}),c(void 0),v("idle")};return(0,I.jsxs)("div",{className:`dsh-ssh-terminal-pane${o?" is-embedded":""}`,children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsxs)("div",{className:"dsh-ssh-title-line",children:[(0,I.jsx)("span",{className:`dsh-ssh-live-dot is-${p}`})," ",(0,I.jsx)("h1",{children:o?"\u7EC8\u7AEF":e.name})]}),(0,I.jsx)("p",{children:o?Kt(e):`${Kt(e)} \xB7 ${ef(e)}`})]}),(0,I.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[!o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:t,children:[(0,I.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91"]})]}),p==="connected"?(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",onClick:()=>{m()},children:[(0,I.jsx)(ye.IconStopFill16,{size:16}),"\u65AD\u5F00"]}):(0,I.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:p==="connecting",onClick:()=>{d()},children:p==="connecting"?"\u8FDE\u63A5\u4E2D\u2026":"\u6253\u5F00\u7EC8\u7AEF"})]})]}),g&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,I.jsxs)("div",{className:"dsh-ssh-terminal-frame",children:[(0,I.jsx)("div",{className:"dsh-ssh-xterm",children:(0,I.jsx)("div",{ref:i,className:"dsh-ssh-terminal-viewport"})}),(0,I.jsxs)("div",{className:"dsh-ssh-terminal-status",children:[(0,I.jsx)("span",{children:p==="connected"?"\u5DF2\u8FDE\u63A5":p==="connecting"?"\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u8FDE\u63A5":"\u7EC8\u7AEF\u672A\u8FDE\u63A5"}),(0,I.jsxs)("span",{children:["UTF-8 \xB7 ",e.terminalType]})]})]})]})}function Rx({profiles:e,selected:t}){let[r,s]=(0,ne.useState)([]),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(),[h,l]=(0,ne.useState)(),c=(0,ne.useCallback)(async()=>{try{let u=await Hl();s(u.rules),i(u.statuses)}catch(u){l(nt(u))}},[]);(0,ne.useEffect)(()=>{let u=!1,d,m=async()=>{await c(),u||(d=window.setTimeout(()=>{m()},document.visibilityState==="hidden"?15e3:4e3))};return m(),()=>{u=!0,d!==void 0&&window.clearTimeout(d)}},[c]);let p=r.filter(u=>u.profileId===t.id),v=async(u,d)=>{try{await ae(`/forwards/${u}/${d}`,{method:"POST",body:"{}"}),await c()}catch(m){l(nt(m))}},g=async u=>{try{await ae(`/forwards/${u}`,{method:"DELETE"}),await c()}catch(d){l(nt(d))}};return(0,I.jsxs)("div",{className:"dsh-ssh-forward-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,I.jsxs)("p",{children:[t.name," \xB7 \u672C\u5730\u3001\u8FDC\u7A0B\u4E0E\u52A8\u6001 SOCKS5"]})]}),(0,I.jsxs)("button",{className:"dsh-ssh-primary-button",onClick:()=>a("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u89C4\u5219"]})]}),h&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:h}),(0,I.jsx)("div",{className:"dsh-ssh-forward-list",children:p.length===0?(0,I.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u53F0\u4E3B\u673A\u8FD8\u6CA1\u6709\u7AEF\u53E3\u8F6C\u53D1\u89C4\u5219\u3002"}):p.map(u=>{let d=o.find(m=>m.ruleId===u.id);return(0,I.jsxs)("article",{className:"dsh-ssh-forward-row",children:[(0,I.jsx)("span",{className:`dsh-ssh-forward-kind is-${u.kind}`,children:u.kind==="local"?"L":u.kind==="remote"?"R":"D"}),(0,I.jsxs)("span",{className:"dsh-ssh-forward-copy",children:[(0,I.jsx)("strong",{children:u.name}),(0,I.jsx)("small",{children:Nx(u,d)})]}),(0,I.jsx)("span",{className:`dsh-ssh-state-label is-${d?.state??"stopped"}`,children:zx(d)}),(0,I.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>a(u),"aria-label":"\u7F16\u8F91",children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),d?.state==="running"?(0,I.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>{v(u.id,"stop")},"aria-label":"\u505C\u6B62",children:(0,I.jsx)(ye.IconStopFill16,{size:16})}):(0,I.jsx)("button",{className:"dsh-ssh-small-primary",onClick:()=>{v(u.id,"start")},children:"\u542F\u52A8"}),(0,I.jsx)("button",{className:"dsh-ssh-icon-button is-danger",onClick:()=>{g(u.id)},"aria-label":"\u5220\u9664",children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},u.id)})}),n!==void 0&&(0,I.jsx)(Bx,{profile:t,value:n==="new"?void 0:n,profiles:e,onClose:()=>a(void 0),onSaved:()=>{a(void 0),c()}})]})}function Ax({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u5BC6\u94A5\u5E93\u6761\u76EE\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await ae(`/vault/${a.id}`,{method:"DELETE"}),t()}catch(h){i(nt(h))}};return(0,I.jsxs)("div",{className:"dsh-ssh-vault-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u5BC6\u94A5\u5E93"}),(0,I.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528\u8D26\u53F7\uFF0C\u8FDE\u63A5\u914D\u7F6E\u53EA\u5F15\u7528\u51ED\u636E\u3002"})]}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u51ED\u636E"]})]}),o&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,I.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,I.jsx)("span",{children:(0,I.jsx)(ye.IconUserOutline16,{size:20})}),(0,I.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u51ED\u636E"}),(0,I.jsx)("p",{children:"\u5BC6\u7801\u548C\u79C1\u94A5\u53EA\u4FDD\u5B58\u5728 DSH \u51ED\u636E\u670D\u52A1\u4E2D\uFF0C\u4E0D\u5199\u5165 SSH \u914D\u7F6E\u6587\u4EF6\u3002"}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u51ED\u636E"]})]}):(0,I.jsx)("div",{className:"dsh-ssh-vault-list",children:e.map(a=>(0,I.jsxs)("article",{className:"dsh-ssh-vault-row",children:[(0,I.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,I.jsx)(ye.IconUserOutline16,{size:16})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:a.name}),(0,I.jsxs)("small",{children:[a.username," \xB7 ",a.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,I.jsx)("span",{className:`dsh-ssh-vault-state${a.credential.configured?" is-ready":""}`,children:a.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u51ED\u636E"}),(0,I.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u51ED\u636E",onClick:()=>{n(a)},children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,I.jsx)(Ix,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Ix({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",username:e?.username??"",authType:e?.authType??"password",password:"",privateKey:"",passphrase:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await ae(e===void 0?"/vault":`/vault/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,username:s.username,authType:s.authType},secrets:{password:s.password,privateKey:s.privateKey,passphrase:s.passphrase}})}),r()}catch(p){h(nt(p))}finally{n(!1)}};return(0,I.jsx)(et,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u51ED\u636E":`\u7F16\u8F91 ${e.name}`,subtitle:"\u5BC6\u7801\u548C\u79C1\u94A5\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u751F\u4EA7\u73AF\u5883\u8FD0\u7EF4"})}),(0,I.jsx)(pe,{label:"\u7528\u6237\u540D",children:(0,I.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:s.username,onChange:c=>o({...s,username:c.target.value})})})]}),(0,I.jsx)(pe,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,I.jsxs)("select",{value:s.authType,onChange:c=>o({...s,authType:c.target.value}),children:[(0,I.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,I.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"})]})}),s.authType==="password"?(0,I.jsx)(pe,{label:"\u5BC6\u7801",hint:e?.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u5FC5\u586B\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,I.jsx)("input",{required:e===void 0||!e.credential.fields.includes("password"),type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(pe,{label:"\u79C1\u94A5",hint:e?.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH \u6216 PEM \u79C1\u94A5",children:(0,I.jsx)("textarea",{required:e===void 0||!e.credential.fields.includes("privateKey"),rows:7,spellCheck:!1,value:s.privateKey,onChange:c=>o({...s,privateKey:c.target.value})})}),(0,I.jsx)(pe,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,I.jsx)("input",{type:"password",autoComplete:"new-password",value:s.passphrase,onChange:c=>o({...s,passphrase:c.target.value})})})]}),a&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u51ED\u636E"})]})]})})}function Lx({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u4EE3\u7406\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await ae(`/proxies/${a.id}`,{method:"DELETE"}),t()}catch(h){i(nt(h))}};return(0,I.jsxs)("div",{className:"dsh-ssh-proxy-pane",children:[(0,I.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"\u4EE3\u7406\u5E93"}),(0,I.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528 HTTP \u4E0E SOCKS5 \u4EE3\u7406\uFF0C\u4E3B\u673A\u914D\u7F6E\u53EA\u4FDD\u7559\u5F15\u7528\u3002"})]}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u4EE3\u7406"]})]}),o&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,I.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,I.jsx)("span",{children:(0,I.jsx)(ye.IconDataOutline16,{size:20})}),(0,I.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u4EE3\u7406"}),(0,I.jsx)("p",{children:"\u4FDD\u5B58\u4E00\u6B21\u540E\uFF0C\u591A\u53F0 SSH \u4E3B\u673A\u53EF\u4EE5\u5171\u7528\u540C\u4E00\u6761\u8FDE\u63A5\u8DEF\u5F84\u3002"}),(0,I.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,I.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u4EE3\u7406"]})]}):(0,I.jsx)("div",{className:"dsh-ssh-proxy-list",children:e.map(a=>(0,I.jsxs)("article",{className:"dsh-ssh-proxy-row",children:[(0,I.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,I.jsx)(ye.IconDataOutline16,{size:16})}),(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:a.name}),(0,I.jsxs)("small",{children:[a.host,":",a.port,a.username?` \xB7 ${a.username}`:""]})]}),(0,I.jsx)("span",{className:"dsh-ssh-proxy-kind",children:a.proxyType==="http"?"HTTP":"SOCKS5"}),(0,I.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,I.jsx)(ye.IconEditOutline16,{size:16})}),(0,I.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u4EE3\u7406",onClick:()=>{n(a)},children:(0,I.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,I.jsx)(Ox,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Ox({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",proxyType:e?.proxyType??"socks5",host:e?.host??"",port:String(e?.port??1080),username:e?.username??"",password:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await ae(e===void 0?"/proxies":`/proxies/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,proxyType:s.proxyType,host:s.host,port:Number(s.port),...s.username.trim()?{username:s.username.trim()}:{}},secrets:{proxyPassword:s.password}})}),r()}catch(p){h(nt(p))}finally{n(!1)}};return(0,I.jsx)(et,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u4EE3\u7406":`\u7F16\u8F91 ${e.name}`,subtitle:"\u4EE3\u7406\u5BC6\u7801\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u529E\u516C\u5BA4 SOCKS5"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7C7B\u578B",children:(0,I.jsxs)("select",{value:s.proxyType,onChange:c=>o({...s,proxyType:c.target.value}),children:[(0,I.jsx)("option",{value:"socks5",children:"SOCKS5"}),(0,I.jsx)("option",{value:"http",children:"HTTP CONNECT"})]})})]}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,I.jsx)("input",{required:!0,maxLength:253,value:s.host,onChange:c=>o({...s,host:c.target.value}),placeholder:"127.0.0.1"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,I.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:s.port,onChange:c=>o({...s,port:c.target.value})})})]}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,I.jsx)(pe,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,I.jsx)("input",{maxLength:128,value:s.username,onChange:c=>o({...s,username:c.target.value}),autoComplete:"username"})}),(0,I.jsx)(pe,{label:"\u4EE3\u7406\u5BC6\u7801",hint:e?.credential.fields.includes("proxyPassword")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u53EF\u9009\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,I.jsx)("input",{type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})})]}),a&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u4EE3\u7406"})]})]})})}function Mx(){let[e,t]=(0,ne.useState)(),[r,s]=(0,ne.useState)();(0,ne.useEffect)(()=>{ae("/settings").then(t).catch(i=>s(nt(i)))},[]);let o=async i=>{try{t(await ae("/settings",{method:"PUT",body:JSON.stringify(i)}))}catch(n){s(nt(n))}};return(0,I.jsxs)("div",{className:"dsh-ssh-settings-pane",children:[(0,I.jsx)("div",{className:"dsh-ssh-content-heading",children:(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"SSH \u8BBE\u7F6E"}),(0,I.jsx)("p",{children:"\u5B89\u5168\u8FB9\u754C\u548C AI \u547D\u4EE4\u8F93\u51FA\u9650\u5236"})]})}),e&&(0,I.jsxs)("div",{className:"dsh-ssh-settings-group",children:[(0,I.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u5141\u8BB8\u516C\u5F00\u7AEF\u53E3\u7ED1\u5B9A"}),(0,I.jsx)("small",{children:"\u5141\u8BB8\u8F6C\u53D1\u76D1\u542C 0.0.0.0 \u6216\u5176\u4ED6\u975E\u56DE\u73AF\u5730\u5740\u3002\u4EC5\u5728\u660E\u786E\u914D\u7F6E\u9632\u706B\u5899\u540E\u5F00\u542F\u3002"})]}),(0,I.jsx)("input",{type:"checkbox",checked:e.allowPublicBind,onChange:i=>{o({...e,allowPublicBind:i.target.checked})}})]}),(0,I.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u9ED8\u8BA4\u547D\u4EE4\u8D85\u65F6"}),(0,I.jsx)("small",{children:"AI \u7684 ssh_exec \u6700\u957F\u7B49\u5F85\u65F6\u95F4"})]}),(0,I.jsx)("input",{type:"number",min:"1000",max:"300000",step:"1000",value:e.defaultCommandTimeoutMs,onChange:i=>t({...e,defaultCommandTimeoutMs:Number(i.target.value)}),onBlur:()=>{o(e)}}),(0,I.jsx)("em",{children:"\u6BEB\u79D2"})]}),(0,I.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u6700\u5927\u547D\u4EE4\u8F93\u51FA"}),(0,I.jsx)("small",{children:"\u8D85\u51FA\u540E\u4FDD\u7559\u6700\u65B0\u8F93\u51FA\uFF0C\u907F\u514D\u6324\u5360\u4E0A\u4E0B\u6587"})]}),(0,I.jsx)("input",{type:"number",min:"1000",max:"1000000",step:"1000",value:e.maxOutputChars,onChange:i=>t({...e,maxOutputChars:Number(i.target.value)}),onBlur:()=>{o(e)}}),(0,I.jsx)("em",{children:"\u5B57\u7B26"})]})]}),r&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:r})]})}function Bx({profile:e,value:t,onClose:r,onSaved:s}){let[o,i]=(0,ne.useState)({name:t?.name??"",kind:t?.kind??"local",bindHost:t?.bindHost??"127.0.0.1",bindPort:String(t?.bindPort??0),targetHost:t?.targetHost??"127.0.0.1",targetPort:String(t?.targetPort??80),autoStart:t?.autoStart??!1}),[n,a]=(0,ne.useState)(),h=async l=>{l.preventDefault();try{await ae(t===void 0?"/forwards":`/forwards/${t.id}`,{method:t===void 0?"POST":"PUT",body:JSON.stringify({rule:{profileId:e.id,name:o.name,kind:o.kind,bindHost:o.bindHost,bindPort:Number(o.bindPort),...o.kind==="dynamic"?{}:{targetHost:o.targetHost,targetPort:Number(o.targetPort)},autoStart:o.autoStart}})}),s()}catch(c){a(nt(c))}};return(0,I.jsx)(et,{title:t===void 0?"\u65B0\u5EFA\u7AEF\u53E3\u8F6C\u53D1":`\u7F16\u8F91 ${t.name}`,subtitle:e.name,onClose:r,children:(0,I.jsxs)("form",{className:"dsh-ssh-form",onSubmit:l=>{h(l)},children:[(0,I.jsx)(pe,{label:"\u540D\u79F0",children:(0,I.jsx)("input",{required:!0,value:o.name,onChange:l=>i({...o,name:l.target.value})})}),(0,I.jsx)(pe,{label:"\u7C7B\u578B",children:(0,I.jsxs)("select",{value:o.kind,onChange:l=>i({...o,kind:l.target.value}),children:[(0,I.jsx)("option",{value:"local",children:"\u672C\u5730\u8F6C\u53D1\uFF08L\uFF09"}),(0,I.jsx)("option",{value:"remote",children:"\u8FDC\u7A0B\u8F6C\u53D1\uFF08R\uFF09"}),(0,I.jsx)("option",{value:"dynamic",children:"\u52A8\u6001 SOCKS5\uFF08D\uFF09"})]})}),(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u76D1\u542C\u5730\u5740",children:(0,I.jsx)("input",{required:!0,value:o.bindHost,onChange:l=>i({...o,bindHost:l.target.value})})}),(0,I.jsx)(pe,{label:"\u76D1\u542C\u7AEF\u53E3",hint:"0 \u8868\u793A\u81EA\u52A8\u9009\u62E9",children:(0,I.jsx)("input",{required:!0,type:"number",min:"0",max:"65535",value:o.bindPort,onChange:l=>i({...o,bindPort:l.target.value})})})]}),o.kind!=="dynamic"&&(0,I.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,I.jsx)(pe,{label:"\u76EE\u6807\u4E3B\u673A",children:(0,I.jsx)("input",{required:!0,value:o.targetHost,onChange:l=>i({...o,targetHost:l.target.value})})}),(0,I.jsx)(pe,{label:"\u76EE\u6807\u7AEF\u53E3",children:(0,I.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:o.targetPort,onChange:l=>i({...o,targetPort:l.target.value})})})]}),(0,I.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,I.jsxs)("span",{children:[(0,I.jsx)("strong",{children:"\u81EA\u52A8\u542F\u52A8"}),(0,I.jsx)("small",{children:"DSH \u542F\u52A8\u65F6\u6062\u590D\u6B64\u8F6C\u53D1"})]}),(0,I.jsx)("input",{type:"checkbox",checked:o.autoStart,onChange:l=>i({...o,autoStart:l.target.checked})})]}),n&&(0,I.jsx)("p",{className:"dsh-ssh-inline-error",children:n}),(0,I.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,I.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:r,children:"\u53D6\u6D88"}),(0,I.jsx)("button",{className:"dsh-ssh-primary-button",children:"\u4FDD\u5B58\u89C4\u5219"})]})]})})}function ef(e){return e.proxy.type==="none"?"\u76F4\u8FDE":e.proxy.type==="saved"?"\u5E38\u7528\u4EE3\u7406":e.proxy.type==="jump"?"SSH \u8DF3\u677F":e.proxy.type==="http"?"HTTP \u4EE3\u7406":"SOCKS5 \u4EE3\u7406"}var nt=Pe;function Fx(e){if(!(!(e instanceof MessageEvent)||typeof e.data!="string"))try{let t=JSON.parse(e.data);return t.type!=="terminal-opened"||typeof t.sessionId!="string"||typeof t.terminalId!="string"||typeof t.profileId!="string"||typeof t.createdAt!="number"?void 0:t}catch{return}}function Nx(e,t){let r=`${e.bindHost}:${t?.bindPort??e.bindPort}`;return e.kind==="dynamic"?`${r} \u2192 SOCKS5`:`${r} \u2192 ${e.targetHost}:${e.targetPort}`}function zx(e){return e?.state==="running"?`\u8FD0\u884C\u4E2D \xB7 ${e.connections}`:e?.state==="starting"?"\u542F\u52A8\u4E2D":e?.state==="error"?"\u5931\u8D25":"\u5DF2\u505C\u6B62"}function Hx(){if(document.getElementById(Qp)!==null)return()=>{};let t=document.createElement("style");return t.id=Qp,t.textContent=`${Rp}
|
|
5852
5868
|
${Cp}
|
|
5853
5869
|
${Ep}
|
|
5854
|
-
${
|
|
5870
|
+
${Tp}
|
|
5855
5871
|
${Ap}
|
|
5856
5872
|
${Ip}
|
|
5857
|
-
${
|
|
5858
|
-
${
|
|
5873
|
+
${Lp}
|
|
5874
|
+
${Yp}
|
|
5875
|
+
${Pp}`,document.head.append(t),()=>t.remove()}
|
|
5859
5876
|
return module.exports; } });
|
|
5860
5877
|
//# sourceMappingURL=client.js.map
|