@regression-io/claude-config 0.38.4 → 0.38.5
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/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regression-io/claude-config",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.5",
|
|
4
4
|
"description": "Configuration management UI for Claude Code and Antigravity - manage MCPs, rules, commands, memory, and project folders",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -545,7 +545,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
|
|
|
545
545
|
`:`
|
|
546
546
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&N&&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(N){const L=this._getMouseBufferCoords(N),B=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(B&&I&&L)&&this._areCoordsInSelection(L,B,I)}isCellInSelection(N,L){const B=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!B||!I)&&this._areCoordsInSelection([N,L],B,I)}_areCoordsInSelection(N,L,B){return N[1]>L[1]&&N[1]<B[1]||L[1]===B[1]&&N[1]===L[1]&&N[0]>=L[0]&&N[0]<B[0]||L[1]<B[1]&&N[1]===B[1]&&N[0]<B[0]||L[1]<B[1]&&N[1]===L[1]&&N[0]>=L[0]}_selectWordAtCursor(N,L){var F,z;const B=(z=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:z.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(N);return!!I&&(this._selectWordAt(I,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,L){this._model.clearSelection(),N=Math.max(N,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const L=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(N){let L=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=B?0:(L>B&&(L-=B),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(N){return b.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),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(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const L=this._getMouseBufferCoords(N);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(N){return N.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!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(N),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const I=B.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const N=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const L=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const I=(0,g.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,B=!(!N||!L||N[0]===L[0]&&N[1]===L[1]);B?N&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,L,B)):this._oldHasSelection&&this._fireOnSelectionChange(N,L,B)}_fireOnSelectionChange(N,L,B){this._oldSelectionStart=N,this._oldSelectionEnd=L,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(N,L){let B=L;for(let I=0;L>=I;I++){const F=N.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:F>1&&L!==I&&(B+=F-1)}return B}setSelection(N,L,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,L],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,L,B=!0,I=!0){if(N[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,z=F.lines.get(N[1]);if(!z)return;const q=F.translateBufferLineToString(N[1],!1);let U=this._convertViewportColToCharacterIndex(z,N[0]),Y=U;const K=N[0]-U;let V=0,D=0,R=0,O=0;if(q.charAt(U)===" "){for(;U>0&&q.charAt(U-1)===" ";)U--;for(;Y<q.length&&q.charAt(Y+1)===" ";)Y++}else{let oe=N[0],me=N[0];z.getWidth(oe)===0&&(V++,oe--),z.getWidth(me)===2&&(D++,me++);const he=z.getString(me).length;for(he>1&&(O+=he-1,Y+=he-1);oe>0&&U>0&&!this._isCharWordSeparator(z.loadCell(oe-1,this._workCell));){z.loadCell(oe-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,oe--):X>1&&(R+=X-1,U-=X-1),U--,oe--}for(;me<z.length&&Y+1<q.length&&!this._isCharWordSeparator(z.loadCell(me+1,this._workCell));){z.loadCell(me+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,me++):X>1&&(O+=X-1,Y+=X-1),Y++,me++}}Y++;let G=U+K-V+R,$=Math.min(this._bufferService.cols,Y-U+V+D-R-O);if(L||q.slice(U,Y).trim()!==""){if(B&&G===0&&z.getCodePoint(0)!==32){const oe=F.lines.get(N[1]-1);if(oe&&z.isWrapped&&oe.getCodePoint(this._bufferService.cols-1)!==32){const me=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(me){const he=this._bufferService.cols-me.start;G-=he,$+=he}}}if(I&&G+$===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){const oe=F.lines.get(N[1]+1);if(oe!=null&&oe.isWrapped&&oe.getCodePoint(0)!==32){const me=this._getWordAt([0,N[1]+1],!1,!1,!0);me&&($+=me.length)}}return{start:G,length:$}}}_selectWordAt(N,L){const B=this._getWordAt(N,L);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[B.start,N[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(N){const L=this._getWordAt(N,!0);if(L){let B=N[1];for(;L.start<0;)L.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,B]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const L=this._bufferService.buffer.getWrappedRangeForLine(N),B={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(B,this._bufferService.cols)}};l.SelectionService=P=f([m(3,j.IBufferService),m(4,j.ICoreService),m(5,k.IMouseService),m(6,j.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],P)},4725:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=c(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,l,c){var f=this&&this.__decorate||function(P,N,L,B){var I,F=arguments.length,z=F<3?N:B===null?B=Object.getOwnPropertyDescriptor(N,L):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,N,L,B);else for(var q=P.length-1;q>=0;q--)(I=P[q])&&(z=(F<3?I(z):F>3?I(N,L,z):I(N,L))||z);return F>3&&z&&Object.defineProperty(N,L,z),z},m=this&&this.__param||function(P,N){return function(L,B){N(L,B,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),g=c(8055),w=c(8460),k=c(844),_=c(2585),x=g.css.toColor("#ffffff"),b=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),j={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const P=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let L=0;L<216;L++){const B=N[L/36%6|0],I=N[L/6%6|0],F=N[L%6];P.push({css:g.channels.toCss(B,I,F),rgba:g.channels.toRgba(B,I,F)})}for(let L=0;L<24;L++){const B=8+10*L;P.push({css:g.channels.toCss(B,B,B),rgba:g.channels.toRgba(B,B,B)})}return P})());let E=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(P){super(),this._optionsService=P,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:b,cursor:v,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:j,selectionBackgroundOpaque:g.color.blend(b,j),selectionInactiveBackgroundTransparent:j,selectionInactiveBackgroundOpaque:g.color.blend(b,j),ansi:l.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(P={}){const N=this._colors;if(N.foreground=A(P.foreground,x),N.background=A(P.background,b),N.cursor=A(P.cursor,v),N.cursorAccent=A(P.cursorAccent,y),N.selectionBackgroundTransparent=A(P.selectionBackground,j),N.selectionBackgroundOpaque=g.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=A(P.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=g.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=P.selectionForeground?A(P.selectionForeground,g.NULL_COLOR):void 0,N.selectionForeground===g.NULL_COLOR&&(N.selectionForeground=void 0),g.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=g.color.opacity(N.selectionBackgroundTransparent,.3)),g.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=g.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=l.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=A(P.black,l.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=A(P.red,l.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=A(P.green,l.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=A(P.yellow,l.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=A(P.blue,l.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=A(P.magenta,l.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=A(P.cyan,l.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=A(P.white,l.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=A(P.brightBlack,l.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=A(P.brightRed,l.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=A(P.brightGreen,l.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=A(P.brightYellow,l.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=A(P.brightBlue,l.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=A(P.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=A(P.brightCyan,l.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=A(P.brightWhite,l.DEFAULT_ANSI_COLORS[15]),P.extendedAnsi){const L=Math.min(N.ansi.length-16,P.extendedAnsi.length);for(let B=0;B<L;B++)N.ansi[B+16]=A(P.extendedAnsi[B],l.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(P){this._restoreColor(P),this._onChangeColors.fire(this.colors)}_restoreColor(P){if(P!==void 0)switch(P){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[P]=this._restoreColors.ansi[P]}else for(let N=0;N<this._restoreColors.ansi.length;++N)this._colors.ansi[N]=this._restoreColors.ansi[N]}modifyColors(P){P(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 A(P,N){if(P!==void 0)try{return g.css.toColor(P)}catch{}return N}l.ThemeService=E=f([m(0,_.IOptionsService)],E)},6349:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(w){if(this._maxLength===w)return;const k=new Array(w);for(let _=0;_<Math.min(w,this.length);_++)k[_]=this._array[this._getCyclicIndex(_)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,k,..._){if(k){for(let x=w;x<this._length-k;x++)this._array[this._getCyclicIndex(x)]=this._array[this._getCyclicIndex(x+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let x=this._length-1;x>=w;x--)this._array[this._getCyclicIndex(x+_.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;x<_.length;x++)this._array[this._getCyclicIndex(w+x)]=_[x];if(_.length&&this.onInsertEmitter.fire({index:w,amount:_.length}),this._length+_.length>this._maxLength){const x=this._length+_.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=_.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,_){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let b=k-1;b>=0;b--)this.set(w+b+_,this.get(w+b));const x=w+k+_-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x<k;x++)this.set(w+x+_,this.get(w+x))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}l.CircularList=h},1439:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(f,m=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const g in f)h[g]=m<=1?f[g]:f[g]&&c(f[g],m-1);return h}},8055:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,f=0,m=0,h=0;var g,w,k,_,x;function b(y){const j=y.toString(16);return j.length<2?"0"+j:j}function v(y,j){return y<j?(j+.05)/(y+.05):(y+.05)/(j+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(j,E,A,P){return P!==void 0?`#${b(j)}${b(E)}${b(A)}${b(P)}`:`#${b(j)}${b(E)}${b(A)}`},y.toRgba=function(j,E,A,P=255){return(j<<24|E<<16|A<<8|P)>>>0},y.toColor=function(j,E,A,P){return{css:y.toCss(j,E,A,P),rgba:y.toRgba(j,E,A,P)}}})(g||(l.channels=g={})),(function(y){function j(E,A){return h=Math.round(255*A),[c,f,m]=x.toChannels(E.rgba),{css:g.toCss(c,f,m,h),rgba:g.toRgba(c,f,m,h)}}y.blend=function(E,A){if(h=(255&A.rgba)/255,h===1)return{css:A.css,rgba:A.rgba};const P=A.rgba>>24&255,N=A.rgba>>16&255,L=A.rgba>>8&255,B=E.rgba>>24&255,I=E.rgba>>16&255,F=E.rgba>>8&255;return c=B+Math.round((P-B)*h),f=I+Math.round((N-I)*h),m=F+Math.round((L-F)*h),{css:g.toCss(c,f,m),rgba:g.toRgba(c,f,m)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,A,P){const N=x.ensureContrastRatio(E.rgba,A.rgba,P);if(N)return g.toColor(N>>24&255,N>>16&255,N>>8&255)},y.opaque=function(E){const A=(255|E.rgba)>>>0;return[c,f,m]=x.toChannels(A),{css:g.toCss(c,f,m),rgba:A}},y.opacity=j,y.multiplyOpacity=function(E,A){return h=255&E.rgba,j(E,h*A/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(w||(l.color=w={})),(function(y){let j,E;try{const A=document.createElement("canvas");A.width=1,A.height=1;const P=A.getContext("2d",{willReadFrequently:!0});P&&(j=P,j.globalCompositeOperation="copy",E=j.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return c=parseInt(A.slice(1,2).repeat(2),16),f=parseInt(A.slice(2,3).repeat(2),16),m=parseInt(A.slice(3,4).repeat(2),16),g.toColor(c,f,m);case 5:return c=parseInt(A.slice(1,2).repeat(2),16),f=parseInt(A.slice(2,3).repeat(2),16),m=parseInt(A.slice(3,4).repeat(2),16),h=parseInt(A.slice(4,5).repeat(2),16),g.toColor(c,f,m,h);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const P=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(P)return c=parseInt(P[1]),f=parseInt(P[2]),m=parseInt(P[3]),h=Math.round(255*(P[5]===void 0?1:parseFloat(P[5]))),g.toColor(c,f,m,h);if(!j||!E)throw new Error("css.toColor: Unsupported css format");if(j.fillStyle=E,j.fillStyle=A,typeof j.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(j.fillRect(0,0,1,1),[c,f,m,h]=j.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,f,m,h),css:A}}})(k||(l.css=k={})),(function(y){function j(E,A,P){const N=E/255,L=A/255,B=P/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(E){return j(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=j})(_||(l.rgb=_={})),(function(y){function j(A,P,N){const L=A>>24&255,B=A>>16&255,I=A>>8&255;let F=P>>24&255,z=P>>16&255,q=P>>8&255,U=v(_.relativeLuminance2(F,z,q),_.relativeLuminance2(L,B,I));for(;U<N&&(F>0||z>0||q>0);)F-=Math.max(0,Math.ceil(.1*F)),z-=Math.max(0,Math.ceil(.1*z)),q-=Math.max(0,Math.ceil(.1*q)),U=v(_.relativeLuminance2(F,z,q),_.relativeLuminance2(L,B,I));return(F<<24|z<<16|q<<8|255)>>>0}function E(A,P,N){const L=A>>24&255,B=A>>16&255,I=A>>8&255;let F=P>>24&255,z=P>>16&255,q=P>>8&255,U=v(_.relativeLuminance2(F,z,q),_.relativeLuminance2(L,B,I));for(;U<N&&(F<255||z<255||q<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),z=Math.min(255,z+Math.ceil(.1*(255-z))),q=Math.min(255,q+Math.ceil(.1*(255-q))),U=v(_.relativeLuminance2(F,z,q),_.relativeLuminance2(L,B,I));return(F<<24|z<<16|q<<8|255)>>>0}y.blend=function(A,P){if(h=(255&P)/255,h===1)return P;const N=P>>24&255,L=P>>16&255,B=P>>8&255,I=A>>24&255,F=A>>16&255,z=A>>8&255;return c=I+Math.round((N-I)*h),f=F+Math.round((L-F)*h),m=z+Math.round((B-z)*h),g.toRgba(c,f,m)},y.ensureContrastRatio=function(A,P,N){const L=_.relativeLuminance(A>>8),B=_.relativeLuminance(P>>8);if(v(L,B)<N){if(B<L){const z=j(A,P,N),q=v(L,_.relativeLuminance(z>>8));if(q<N){const U=E(A,P,N);return q>v(L,_.relativeLuminance(U>>8))?z:U}return z}const I=E(A,P,N),F=v(L,_.relativeLuminance(I>>8));if(F<N){const z=j(A,P,N);return F>v(L,_.relativeLuminance(z>>8))?I:z}return I}},y.reduceLuminance=j,y.increaseLuminance=E,y.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(x||(l.rgba=x={})),l.toPaddedHex=b,l.contrastRatio=v},8969:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=c(844),m=c(2585),h=c(4348),g=c(7866),w=c(744),k=c(7302),_=c(6975),x=c(8460),b=c(1753),v=c(1480),y=c(7994),j=c(9282),E=c(5435),A=c(5981),P=c(2660);let N=!1;class L extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event((I=>{var F;(F=this._onScrollApi)==null||F.fire(I.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(I){for(const F in I)this.optionsService.options[F]=I[F]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new k.OptionsService(I)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(P.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((F=>{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((F=>{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 A.WriteBuffer(((F,z)=>this._inputHandler.parse(F,z)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,F){this._writeBuffer.write(I,F)}writeSync(I,F){this._logService.logLevel<=m.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(I,F)}input(I,F=!0){this.coreService.triggerDataEvent(I,F)}resize(I,F){isNaN(I)||isNaN(F)||(I=Math.max(I,w.MINIMUM_COLS),F=Math.max(F,w.MINIMUM_ROWS),this._bufferService.resize(I,F))}scroll(I,F=!1){this._bufferService.scroll(I,F)}scrollLines(I,F,z){this._bufferService.scrollLines(I,F,z)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const F=I-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(I,F){return this._inputHandler.registerEscHandler(I,F)}registerDcsHandler(I,F){return this._inputHandler.registerDcsHandler(I,F)}registerCsiHandler(I,F){return this._inputHandler.registerCsiHandler(I,F)}registerOscHandler(I,F){return this._inputHandler.registerOscHandler(I,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?I=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(j.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,j.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const F of I)F.dispose()}))}}}l.CoreTerminal=L},8460:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,f){return c((m=>f.fire(m)))},l.runAndSubscribe=function(c,f){return f(void 0),c((m=>f(m)))}},5435:function(u,l,c){var f=this&&this.__decorate||function(V,D,R,O){var G,$=arguments.length,oe=$<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")oe=Reflect.decorate(V,D,R,O);else for(var me=V.length-1;me>=0;me--)(G=V[me])&&(oe=($<3?G(oe):$>3?G(D,R,oe):G(D,R))||oe);return $>3&&oe&&Object.defineProperty(D,R,oe),oe},m=this&&this.__param||function(V,D){return function(R,O){D(R,O,V)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),g=c(7116),w=c(2015),k=c(844),_=c(482),x=c(8437),b=c(8460),v=c(643),y=c(511),j=c(3734),E=c(2585),A=c(1480),P=c(6242),N=c(6351),L=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function F(V,D){if(V>24)return D.setWinLines||!1;switch(V){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var z;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(l.WindowsOptionsReportType=z={}));let q=0;class U extends k.Disposable{getAttrData(){return this._curAttrData}constructor(D,R,O,G,$,oe,me,he,X=new w.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=R,this._coreService=O,this._logService=G,this._optionsService=$,this._oscLinkService=oe,this._coreMouseService=me,this._unicodeService=he,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ae.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ae,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ae,data:ne})})),this._parser.setDcsHandlerFallback(((H,ae,ne)=>{ae==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ae,payload:ne})})),this._parser.setPrintHandler(((H,ae,ne)=>this.print(H,ae,ne))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new P.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new P.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new P.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new P.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new P.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new P.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new P.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new P.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new P.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new P.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new P.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new P.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((H,ae)=>this.requestStatusString(H,ae))))}_preserveStack(D,R,O,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=O,this._parseStack.position=G}_logSlowResolvingAsync(D){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([D,new Promise(((R,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,R){let O,G=this._activeBuffer.x,$=this._activeBuffer.y,oe=0;const me=this._parseStack.paused;if(me){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(O),O;G=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>I&&(oe=this._parseStack.position+I)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(H=>String.fromCharCode(H))).join("")}"`),typeof D=="string"?D.split("").map((H=>H.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(D.length,I))),me||this._dirtyRowTracker.clearRange(),D.length>I)for(let H=oe;H<D.length;H+=I){const ae=H+I<D.length?H+I:D.length,ne=typeof D=="string"?this._stringDecoder.decode(D.substring(H,ae),this._parseBuffer):this._utf8Decoder.decode(D.subarray(H,ae),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(G,$,ne,H),this._logSlowResolvingAsync(O),O}else if(!me){const H=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,H))return this._preserveStack(G,$,H,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===G&&this._activeBuffer.y===$||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(D,R,O){let G,$;const oe=this._charsetService.charset,me=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ae=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-R>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let J=this._parser.precedingJoinState;for(let se=R;se<O;++se){if(G=D[se],G<127&&oe){const ee=oe[String.fromCharCode(G)];ee&&(G=ee.charCodeAt(0))}const xe=this._unicodeService.charProperties(G,J);$=A.UnicodeService.extractWidth(xe);const Be=A.UnicodeService.extractShouldJoin(xe),Ve=Be?A.UnicodeService.extractWidth(J):0;if(J=xe,me&&this._onA11yChar.fire((0,_.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+$-Ve>he){if(X){const ee=ne;let de=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof x.BufferLine&&ne.copyCellsFrom(ee,de,0,Ve,!1);de<he;)ee.setCellFromCodepoint(de++,0,1,ae)}else if(this._activeBuffer.x=he-1,$===2)continue}if(Be&&this._activeBuffer.x){const ee=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-ee,G,$);for(let de=$-Ve;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(H&&(ne.insertCells(this._activeBuffer.x,$-Ve,this._activeBuffer.getNullCell(ae)),ne.getWidth(he-1)===2&&ne.setCellFromCodepoint(he-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,ae)),ne.setCellFromCodepoint(this._activeBuffer.x++,G,$,ae),$>0)for(;--$;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=J,this._activeBuffer.x<he&&O-R>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,R){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,R):this._parser.registerCsiHandler(D,(O=>!F(O.params[0],this._optionsService.rawOptions.windowOptions)||R(O)))}registerDcsHandler(D,R){return this._parser.registerDcsHandler(D,new N.DcsHandler(R))}registerEscHandler(D,R){return this._parser.registerEscHandler(D,R)}registerOscHandler(D,R){return this._parser.registerOscHandler(D,new P.OscHandler(R))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=D,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+R)}cursorUp(D){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const R=D.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=D.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=D.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const R=D.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,R,O,G=!1,$=!1){const oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);oe.replaceCells(R,O,this._activeBuffer.getNullCell(this._eraseAttrData()),$),G&&(oe.isWrapped=!1)}_resetBufferLine(D,R=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),O.isWrapped=!1)}eraseInDisplay(D,R=!1){let O;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);O<this._bufferService.rows;O++)this._resetBufferLine(O,R);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,R);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(D,R=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let R=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;R--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let R=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;R--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(G,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let R=D.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(D){let R=D.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(x.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);G.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);G.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);G.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);G.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const R=this._parser.precedingJoinState;if(!R)return!0;const O=D.params[0]||1,G=A.UnicodeService.extractWidth(R),$=this._activeBuffer.x-G,oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString($),me=new Uint32Array(oe.length*O);let he=0;for(let H=0;H<oe.length;){const ae=oe.codePointAt(H)||0;me[he++]=ae,H+=ae>65535?2:1}let X=he;for(let H=1;H<O;++H)me.copyWithin(X,0,he),X+=he;return this.print(me,0,X),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let R=0;R<D.length;R++)switch(D.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let R=0;R<D.length;R++)switch(D.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(D){for(let R=0;R<D.length;R++)switch(D.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let R=0;R<D.length;R++)switch(D.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),D.params[R]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(D,R){const O=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:$}=this._coreMouseService,oe=this._coreService,{buffers:me,cols:he}=this._bufferService,{active:X,alt:H}=me,ae=this._optionsService.rawOptions,ne=Be=>Be?1:2,J=D.params[0];return se=J,xe=R?J===2?4:J===4?ne(oe.modes.insertMode):J===12?3:J===20?ne(ae.convertEol):0:J===1?ne(O.applicationCursorKeys):J===3?ae.windowOptions.setWinLines?he===80?2:he===132?1:0:0:J===6?ne(O.origin):J===7?ne(O.wraparound):J===8?3:J===9?ne(G==="X10"):J===12?ne(ae.cursorBlink):J===25?ne(!oe.isCursorHidden):J===45?ne(O.reverseWraparound):J===66?ne(O.applicationKeypad):J===67?4:J===1e3?ne(G==="VT200"):J===1002?ne(G==="DRAG"):J===1003?ne(G==="ANY"):J===1004?ne(O.sendFocus):J===1005?4:J===1006?ne($==="SGR"):J===1015?4:J===1016?ne($==="SGR_PIXELS"):J===1048?1:J===47||J===1047||J===1049?ne(X===H):J===2004?ne(O.bracketedPasteMode):0,oe.triggerDataEvent(`${h.C0.ESC}[${R?"":"?"}${se};${xe}$y`),!0;var se,xe}_updateAttrColor(D,R,O,G,$){return R===2?(D|=50331648,D&=-16777216,D|=j.AttributeData.fromColorRGB([O,G,$])):R===5&&(D&=-50331904,D|=33554432|255&O),D}_extractColor(D,R,O){const G=[0,0,-1,0,0,0];let $=0,oe=0;do{if(G[oe+$]=D.params[R+oe],D.hasSubParams(R+oe)){const me=D.getSubParams(R+oe);let he=0;do G[1]===5&&($=1),G[oe+he+1+$]=me[he];while(++he<me.length&&he+oe+1+$<G.length);break}if(G[1]===5&&oe+$>=2||G[1]===2&&oe+$>=5)break;G[1]&&($=1)}while(++oe+R<D.length&&oe+$<G.length);for(let me=2;me<G.length;++me)G[me]===-1&&(G[me]=0);switch(G[0]){case 38:O.fg=this._updateAttrColor(O.fg,G[1],G[3],G[4],G[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,G[1],G[3],G[4],G[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,G[1],G[3],G[4],G[5])}return oe}_processUnderline(D,R){R.extended=R.extended.clone(),(!~D||D>5)&&(D=1),R.extended.underlineStyle=D,R.fg|=268435456,D===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(D){D.fg=x.DEFAULT_ATTR_DATA.fg,D.bg=x.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=D.length;let O;const G=this._curAttrData;for(let $=0;$<R;$++)O=D.params[$],O>=30&&O<=37?(G.fg&=-50331904,G.fg|=16777216|O-30):O>=40&&O<=47?(G.bg&=-50331904,G.bg|=16777216|O-40):O>=90&&O<=97?(G.fg&=-50331904,G.fg|=16777224|O-90):O>=100&&O<=107?(G.bg&=-50331904,G.bg|=16777224|O-100):O===0?this._processSGR0(G):O===1?G.fg|=134217728:O===3?G.bg|=67108864:O===4?(G.fg|=268435456,this._processUnderline(D.hasSubParams($)?D.getSubParams($)[0]:1,G)):O===5?G.fg|=536870912:O===7?G.fg|=67108864:O===8?G.fg|=1073741824:O===9?G.fg|=2147483648:O===2?G.bg|=134217728:O===21?this._processUnderline(2,G):O===22?(G.fg&=-134217729,G.bg&=-134217729):O===23?G.bg&=-67108865:O===24?(G.fg&=-268435457,this._processUnderline(0,G)):O===25?G.fg&=-536870913:O===27?G.fg&=-67108865:O===28?G.fg&=-1073741825:O===29?G.fg&=2147483647:O===39?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):O===49?(G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?$+=this._extractColor(D,$,G):O===53?G.bg|=1073741824:O===55?G.bg&=-1073741825:O===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):O===100?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${R};${O}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const R=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${R};${O}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(D){const R=D.params[0]||1;switch(R){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=R%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(D){const R=D.params[0]||1;let O;return(D.length<2||(O=D.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(D){if(!F(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const R=[],O=D.split(";");for(;O.length>1;){const G=O.shift(),$=O.shift();if(/^\d+$/.exec(G)){const oe=parseInt(G);if(K(oe))if($==="?")R.push({type:0,index:oe});else{const me=(0,L.parseColor)($);me&&R.push({type:1,index:oe,color:me})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(D){const R=D.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(D,R){this._getCurrentLinkId()&&this._finishHyperlink();const O=D.split(":");let G;const $=O.findIndex((oe=>oe.startsWith("id=")));return $!==-1&&(G=O[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,R){const O=D.split(";");for(let G=0;G<O.length&&!(R>=this._specialColors.length);++G,++R)if(O[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const $=(0,L.parseColor)(O[G]);$&&this._onColor.fire([{type:1,index:this._specialColors[R],color:$}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const R=[],O=D.split(";");for(let G=0;G<O.length;++G)if(/^\d+$/.exec(O[G])){const $=parseInt(O[G]);K($)&&R.push({type:2,index:$})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,g.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(B[D[0]],g.CHARSETS[D[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new y.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const O=this._activeBuffer.ybase+this._activeBuffer.y+R,G=this._activeBuffer.lines.get(O);G&&(G.fill(D),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,R){const O=this._bufferService.buffer,G=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${$}${h.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,R){this._dirtyRowTracker.markRangeDirty(D,R)}}l.InputHandler=U;let Y=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,D){V>D&&(q=V,V=D,D=q),V<this.start&&(this.start=V),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(V){return 0<=V&&V<256}Y=f([m(0,E.IBufferService)],Y)},844:(u,l)=>{function c(f){for(const m of f)m.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const m=this._disposables.indexOf(f);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var m;this._isDisposed||f===this._value||((m=this._value)==null||m.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=c,l.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,h,g){this._data[m]||(this._data[m]={}),this._data[m][h]=g}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(f,m,h,g,w){this._data.get(f,m)||this._data.set(f,m,new c),this._data.get(f,m).set(h,g,w)}get(f,m,h,g){var w;return(w=this._data.get(f,m))==null?void 0:w.get(h,g)}clear(){this._data.clear()}}},6114:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const m=this._getKey(f);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,m){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let m=0,h=this._array.length-1;for(;h>=m;){let g=m+h>>1;const w=this._getKey(this._array[g]);if(w>f)h=g-1;else{if(!(w<f)){for(;g>0&&this._getKey(this._array[g-1])===f;)g--;return g}m=g+1}}return m}}},7226:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let k=0,_=0,x=w.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),_=Math.max(k,_),b=w.timeRemaining(),1.5*_>b)return x-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-k))}ms`),void this._start();x=b}this.clear()}}class h extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=c(643);l.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=h==null?void 0:h.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&g&&(w.isWrapped=g[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&g[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,g=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=g}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=c(6349),m=c(7226),h=c(3734),g=c(8437),w=c(4634),k=c(511),_=c(643),x=c(4863),b=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(v,y,j){this._hasScrollback=v,this._optionsService=y,this._bufferService=j,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const y=v+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,y){const j=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=0;const A=this._getCorrectBufferLength(y);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<v)for(let N=0;N<this.lines.length;N++)E+=+this.lines.get(N).resize(v,j);let P=0;if(this._rows<y)for(let N=this._rows;N<y;N++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(v,j)):this.ybase>0&&this.lines.length<=this.ybase+this.y+P+1?(this.ybase--,P++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(v,j)));else for(let N=this._rows;N>y;N--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const N=this.lines.length-A;N>0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=A}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,y-1),P&&(this.y+=P),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(v,y),this._cols>v))for(let P=0;P<this.lines.length;P++)E+=+this.lines.get(P).resize(v,j);this._cols=v,this._rows=y,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,y){this._cols!==v&&(v>this._cols?this._reflowLarger(v,y):this._reflowSmaller(v,y))}_reflowLarger(v,y){const j=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(j.length>0){const E=(0,w.reflowLargerCreateNewLayout)(this.lines,j);(0,w.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(v,y,E.countRemoved)}}_reflowLargerAdjustViewport(v,y,j){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=j;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new g.BufferLine(v,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-j,0)}_reflowSmaller(v,y){const j=this.getNullCell(g.DEFAULT_ATTR_DATA),E=[];let A=0;for(let P=this.lines.length-1;P>=0;P--){let N=this.lines.get(P);if(!N||!N.isWrapped&&N.getTrimmedLength()<=v)continue;const L=[N];for(;N.isWrapped&&P>0;)N=this.lines.get(--P),L.unshift(N);const B=this.ybase+this.y;if(B>=P&&B<P+L.length)continue;const I=L[L.length-1].getTrimmedLength(),F=(0,w.reflowSmallerGetNewLineLengths)(L,this._cols,v),z=F.length-L.length;let q;q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const U=[];for(let O=0;O<z;O++){const G=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);U.push(G)}U.length>0&&(E.push({start:P+L.length+A,newLines:U}),A+=U.length),L.push(...U);let Y=F.length-1,K=F[Y];K===0&&(Y--,K=F[Y]);let V=L.length-z-1,D=I;for(;V>=0;){const O=Math.min(D,K);if(L[Y]===void 0)break;if(L[Y].copyCellsFrom(L[V],D-O,K-O,O,!0),K-=O,K===0&&(Y--,K=F[Y]),D-=O,D===0){V--;const G=Math.max(V,0);D=(0,w.getWrappedLineTrimmedLength)(L,G,this._cols)}}for(let O=0;O<L.length;O++)F[O]<v&&L[O].setCell(F[O],j);let R=z-q;for(;R-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+z,this.ybase+y-1)}if(E.length>0){const P=[],N=[];for(let Y=0;Y<this.lines.length;Y++)N.push(this.lines.get(Y));const L=this.lines.length;let B=L-1,I=0,F=E[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let z=0;for(let Y=Math.min(this.lines.maxLength-1,L+A-1);Y>=0;Y--)if(F&&F.start>B+z){for(let K=F.newLines.length-1;K>=0;K--)this.lines.set(Y--,F.newLines[K]);Y++,P.push({index:B+1,amount:F.newLines.length}),z+=F.newLines.length,F=E[++I]}else this.lines.set(Y,N[B--]);let q=0;for(let Y=P.length-1;Y>=0;Y--)P[Y].index+=q,this.lines.onInsertEmitter.fire(P[Y]),q+=P[Y].amount;const U=Math.max(0,L+A-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(v,y,j=0,E){const A=this.lines.get(v);return A?A.translateToString(y,j,E):""}getWrappedRangeForLine(v){let y=v,j=v;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;j+1<this.lines.length&&this.lines.get(j+1).isWrapped;)j++;return{first:y,last:j}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===v&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const y=new x.Marker(v);return this.markers.push(y),y.register(this.lines.onTrim((j=>{y.line-=j,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((j=>{y.line>=j.index&&(y.line+=j.amount)}))),y.register(this.lines.onDelete((j=>{y.line>=j.index&&y.line<j.index+j.amount&&y.dispose(),y.line>j.index&&(y.line-=j.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=c(3734),m=c(511),h=c(643),g=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let w=0;class k{constructor(x,b,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const y=b||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let j=0;j<x;++j)this.setCell(j,y);this.length=x}get(x){const b=this._data[3*x+0],v=2097151&b;return[this._data[3*x+1],2097152&b?this._combined[x]:v?(0,g.stringFromCodePoint)(v):"",b>>22,2097152&b?this._combined[x].charCodeAt(this._combined[x].length-1):v]}set(x,b){this._data[3*x+1]=b[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=b[1],this._data[3*x+0]=2097152|x|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const b=this._data[3*x+0];return 2097152&b?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&b}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const b=this._data[3*x+0];return 2097152&b?this._combined[x]:2097151&b?(0,g.stringFromCodePoint)(2097151&b):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,b){return w=3*x,b.content=this._data[w+0],b.fg=this._data[w+1],b.bg=this._data[w+2],2097152&b.content&&(b.combinedData=this._combined[x]),268435456&b.bg&&(b.extended=this._extendedAttrs[x]),b}setCell(x,b){2097152&b.content&&(this._combined[x]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[x]=b.extended),this._data[3*x+0]=b.content,this._data[3*x+1]=b.fg,this._data[3*x+2]=b.bg}setCellFromCodepoint(x,b,v,y){268435456&y.bg&&(this._extendedAttrs[x]=y.extended),this._data[3*x+0]=b|v<<22,this._data[3*x+1]=y.fg,this._data[3*x+2]=y.bg}addCodepointToCell(x,b,v){let y=this._data[3*x+0];2097152&y?this._combined[x]+=(0,g.stringFromCodePoint)(b):2097151&y?(this._combined[x]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,v&&(y&=-12582913,y|=v<<22),this._data[3*x+0]=y}insertCells(x,b,v){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,v),b<this.length-x){const y=new m.CellData;for(let j=this.length-x-b-1;j>=0;--j)this.setCell(x+b+j,this.loadCell(x+j,y));for(let j=0;j<b;++j)this.setCell(x+j,v)}else for(let y=x;y<this.length;++y)this.setCell(y,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(x,b,v){if(x%=this.length,b<this.length-x){const y=new m.CellData;for(let j=0;j<this.length-x-b;++j)this.setCell(x+j,this.loadCell(x+b+j,y));for(let j=this.length-b;j<this.length;++j)this.setCell(j,v)}else for(let y=x;y<this.length;++y)this.setCell(y,v);x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,v),this.getWidth(x)!==0||this.hasContent(x)||this.setCellFromCodepoint(x,0,1,v)}replaceCells(x,b,v,y=!1){if(y)for(x&&this.getWidth(x-1)===2&&!this.isProtected(x-1)&&this.setCellFromCodepoint(x-1,0,1,v),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,v);x<b&&x<this.length;)this.isProtected(x)||this.setCell(x,v),x++;else for(x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,v),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,v);x<b&&x<this.length;)this.setCell(x++,v)}resize(x,b){if(x===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*x;if(x>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const y=new Uint32Array(v);y.set(this._data),this._data=y}for(let y=this.length;y<x;++y)this.setCell(y,b)}else{this._data=this._data.subarray(0,v);const y=Object.keys(this._combined);for(let E=0;E<y.length;E++){const A=parseInt(y[E],10);A>=x&&delete this._combined[A]}const j=Object.keys(this._extendedAttrs);for(let E=0;E<j.length;E++){const A=parseInt(j[E],10);A>=x&&delete this._extendedAttrs[A]}}return this.length=x,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const x=new Uint32Array(this._data.length);return x.set(this._data),this._data=x,1}return 0}fill(x,b=!1){if(b)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,x);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,x)}}copyFrom(x){this.length!==x.length?this._data=new Uint32Array(x._data):this._data.set(x._data),this.length=x.length,this._combined={};for(const b in x._combined)this._combined[b]=x._combined[b];this._extendedAttrs={};for(const b in x._extendedAttrs)this._extendedAttrs[b]=x._extendedAttrs[b];this.isWrapped=x.isWrapped}clone(){const x=new k(0);x._data=new Uint32Array(this._data),x.length=this.length;for(const b in this._combined)x._combined[b]=this._combined[b];for(const b in this._extendedAttrs)x._extendedAttrs[b]=this._extendedAttrs[b];return x.isWrapped=this.isWrapped,x}getTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,b,v,y,j){const E=x._data;if(j)for(let P=y-1;P>=0;P--){for(let N=0;N<3;N++)this._data[3*(v+P)+N]=E[3*(b+P)+N];268435456&E[3*(b+P)+2]&&(this._extendedAttrs[v+P]=x._extendedAttrs[b+P])}else for(let P=0;P<y;P++){for(let N=0;N<3;N++)this._data[3*(v+P)+N]=E[3*(b+P)+N];268435456&E[3*(b+P)+2]&&(this._extendedAttrs[v+P]=x._extendedAttrs[b+P])}const A=Object.keys(x._combined);for(let P=0;P<A.length;P++){const N=parseInt(A[P],10);N>=b&&(this._combined[N-b+v]=x._combined[N])}}translateToString(x,b,v,y){b=b??0,v=v??this.length,x&&(v=Math.min(v,this.getTrimmedLength())),y&&(y.length=0);let j="";for(;b<v;){const E=this._data[3*b+0],A=2097151&E,P=2097152&E?this._combined[b]:A?(0,g.stringFromCodePoint)(A):h.WHITESPACE_CELL_CHAR;if(j+=P,y)for(let N=0;N<P.length;++N)y.push(b);b+=E>>22||1}return y&&y.push(b),j}}l.BufferLine=k},4841:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,l)=>{function c(f,m,h){if(m===f.length-1)return f[m].getTrimmedLength();const g=!f[m].hasContent(h-1)&&f[m].getWidth(h-1)===1,w=f[m+1].getWidth(0)===2;return g&&w?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,m,h,g,w){const k=[];for(let _=0;_<f.length-1;_++){let x=_,b=f.get(++x);if(!b.isWrapped)continue;const v=[f.get(_)];for(;x<f.length&&b.isWrapped;)v.push(b),b=f.get(++x);if(g>=_&&g<x){_+=v.length-1;continue}let y=0,j=c(v,y,m),E=1,A=0;for(;E<v.length;){const N=c(v,E,m),L=N-A,B=h-j,I=Math.min(L,B);v[y].copyCellsFrom(v[E],A,j,I,!1),j+=I,j===h&&(y++,j=0),A+=I,A===N&&(E++,A=0),j===0&&y!==0&&v[y-1].getWidth(h-1)===2&&(v[y].copyCellsFrom(v[y-1],h-1,j++,1,!1),v[y-1].setCell(h-1,w))}v[y].replaceCells(j,h,w);let P=0;for(let N=v.length-1;N>0&&(N>y||v[N].getTrimmedLength()===0);N--)P++;P>0&&(k.push(_+v.length-P),k.push(P)),_+=v.length-1}return k},l.reflowLargerCreateNewLayout=function(f,m){const h=[];let g=0,w=m[g],k=0;for(let _=0;_<f.length;_++)if(w===_){const x=m[++g];f.onDeleteEmitter.fire({index:_-k,amount:x}),_+=x-1,k+=x,w=m[++g]}else h.push(_);return{layout:h,countRemoved:k}},l.reflowLargerApplyNewLayout=function(f,m){const h=[];for(let g=0;g<m.length;g++)h.push(f.get(m[g]));for(let g=0;g<h.length;g++)f.set(g,h[g]);f.length=m.length},l.reflowSmallerGetNewLineLengths=function(f,m,h){const g=[],w=f.map(((b,v)=>c(f,v,m))).reduce(((b,v)=>b+v));let k=0,_=0,x=0;for(;x<w;){if(w-x<h){g.push(w-x);break}k+=h;const b=c(f,_,m);k>b&&(k-=b,_++);const v=f[_].getWidth(k-1)===2;v&&k--;const y=v?h-1:h;g.push(y),x+=y}return g},l.getWrappedLineTrimmedLength=c},5295:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=c(8460),m=c(844),h=c(9092);class g extends m.Disposable{constructor(k,_){super(),this._optionsService=k,this._bufferService=_,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,_){this._normal.resize(k,_),this._alt.resize(k,_),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=g},511:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=c(482),m=c(643),h=c(3734);class g extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const _=new g;return _.setFromCharData(k),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const x=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const b=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(x-55296)+b-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=c(8460),m=c(844);class h{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}l.Marker=h,h._nextId=1},7116:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,l)=>{var c,f,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
547
547
|
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(l.C0=c={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(f||(l.C1=f={})),(function(h){h.ST=`${c.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=c(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(h,g,w,k){const _={type:0,cancel:!1,key:void 0},x=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?_.key=g?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?_.key=g?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?_.key=g?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(_.key=g?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:_.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(_.key=f.C0.ESC+_.key);break;case 9:if(h.shiftKey){_.key=f.C0.ESC+"[Z";break}_.key=f.C0.HT,_.cancel=!0;break;case 13:_.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,_.cancel=!0;break;case 27:_.key=f.C0.ESC,h.altKey&&(_.key=f.C0.ESC+f.C0.ESC),_.cancel=!0;break;case 37:if(h.metaKey)break;x?(_.key=f.C0.ESC+"[1;"+(x+1)+"D",_.key===f.C0.ESC+"[1;3D"&&(_.key=f.C0.ESC+(w?"b":"[1;5D"))):_.key=g?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;x?(_.key=f.C0.ESC+"[1;"+(x+1)+"C",_.key===f.C0.ESC+"[1;3C"&&(_.key=f.C0.ESC+(w?"f":"[1;5C"))):_.key=g?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;x?(_.key=f.C0.ESC+"[1;"+(x+1)+"A",w||_.key!==f.C0.ESC+"[1;3A"||(_.key=f.C0.ESC+"[1;5A")):_.key=g?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;x?(_.key=f.C0.ESC+"[1;"+(x+1)+"B",w||_.key!==f.C0.ESC+"[1;3B"||(_.key=f.C0.ESC+"[1;5B")):_.key=g?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(_.key=f.C0.ESC+"[2~");break;case 46:_.key=x?f.C0.ESC+"[3;"+(x+1)+"~":f.C0.ESC+"[3~";break;case 36:_.key=x?f.C0.ESC+"[1;"+(x+1)+"H":g?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:_.key=x?f.C0.ESC+"[1;"+(x+1)+"F":g?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?_.type=2:h.ctrlKey?_.key=f.C0.ESC+"[5;"+(x+1)+"~":_.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?_.type=3:h.ctrlKey?_.key=f.C0.ESC+"[6;"+(x+1)+"~":_.key=f.C0.ESC+"[6~";break;case 112:_.key=x?f.C0.ESC+"[1;"+(x+1)+"P":f.C0.ESC+"OP";break;case 113:_.key=x?f.C0.ESC+"[1;"+(x+1)+"Q":f.C0.ESC+"OQ";break;case 114:_.key=x?f.C0.ESC+"[1;"+(x+1)+"R":f.C0.ESC+"OR";break;case 115:_.key=x?f.C0.ESC+"[1;"+(x+1)+"S":f.C0.ESC+"OS";break;case 116:_.key=x?f.C0.ESC+"[15;"+(x+1)+"~":f.C0.ESC+"[15~";break;case 117:_.key=x?f.C0.ESC+"[17;"+(x+1)+"~":f.C0.ESC+"[17~";break;case 118:_.key=x?f.C0.ESC+"[18;"+(x+1)+"~":f.C0.ESC+"[18~";break;case 119:_.key=x?f.C0.ESC+"[19;"+(x+1)+"~":f.C0.ESC+"[19~";break;case 120:_.key=x?f.C0.ESC+"[20;"+(x+1)+"~":f.C0.ESC+"[20~";break;case 121:_.key=x?f.C0.ESC+"[21;"+(x+1)+"~":f.C0.ESC+"[21~";break;case 122:_.key=x?f.C0.ESC+"[23;"+(x+1)+"~":f.C0.ESC+"[23~";break;case 123:_.key=x?f.C0.ESC+"[24;"+(x+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(w&&!k||!h.altKey||h.metaKey)!w||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?_.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(_.key=f.C0.US),h.key==="@"&&(_.key=f.C0.NUL)):h.keyCode===65&&(_.type=1);else{const b=m[h.keyCode],v=b==null?void 0:b[h.shiftKey?1:0];if(v)_.key=f.C0.ESC+v;else if(h.keyCode>=65&&h.keyCode<=90){const y=h.ctrlKey?h.keyCode-64:h.keyCode+32;let j=String.fromCharCode(y);h.shiftKey&&(j=j.toUpperCase()),_.key=f.C0.ESC+j}else if(h.keyCode===32)_.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let y=h.code.slice(3,4);h.shiftKey||(y=y.toLowerCase()),_.key=f.C0.ESC+y,_.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?_.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?_.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?_.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?_.key=f.C0.DEL:h.keyCode===219?_.key=f.C0.ESC:h.keyCode===220?_.key=f.C0.FS:h.keyCode===221&&(_.key=f.C0.GS)}return _}},482:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,f=0,m=c.length){let h="";for(let g=f;g<m;++g){let w=c[g];w>65535?(w-=65536,h+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):h+=String.fromCharCode(w)}return h},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const m=c.length;if(!m)return 0;let h=0,g=0;if(this._interim){const w=c.charCodeAt(g++);56320<=w&&w<=57343?f[h++]=1024*(this._interim-55296)+w-56320+65536:(f[h++]=this._interim,f[h++]=w),this._interim=0}for(let w=g;w<m;++w){const k=c.charCodeAt(w);if(55296<=k&&k<=56319){if(++w>=m)return this._interim=k,h;const _=c.charCodeAt(w);56320<=_&&_<=57343?f[h++]=1024*(k-55296)+_-56320+65536:(f[h++]=k,f[h++]=_)}else k!==65279&&(f[h++]=k)}return h}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const m=c.length;if(!m)return 0;let h,g,w,k,_=0,x=0,b=0;if(this.interim[0]){let j=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let A,P=0;for(;(A=63&this.interim[++P])&&P<4;)E<<=6,E|=A;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=N-P;for(;b<L;){if(b>=m)return 0;if(A=c[b++],(192&A)!=128){b--,j=!0;break}this.interim[P++]=A,E<<=6,E|=63&A}j||(N===2?E<128?b--:f[_++]=E:N===3?E<2048||E>=55296&&E<=57343||E===65279||(f[_++]=E):E<65536||E>1114111||(f[_++]=E)),this.interim.fill(0)}const v=m-4;let y=b;for(;y<m;){for(;!(!(y<v)||128&(h=c[y])||128&(g=c[y+1])||128&(w=c[y+2])||128&(k=c[y+3]));)f[_++]=h,f[_++]=g,f[_++]=w,f[_++]=k,y+=4;if(h=c[y++],h<128)f[_++]=h;else if((224&h)==192){if(y>=m)return this.interim[0]=h,_;if(g=c[y++],(192&g)!=128){y--;continue}if(x=(31&h)<<6|63&g,x<128){y--;continue}f[_++]=x}else if((240&h)==224){if(y>=m)return this.interim[0]=h,_;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=g,_;if(w=c[y++],(192&w)!=128){y--;continue}if(x=(15&h)<<12|(63&g)<<6|63&w,x<2048||x>=55296&&x<=57343||x===65279)continue;f[_++]=x}else if((248&h)==240){if(y>=m)return this.interim[0]=h,_;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=g,_;if(w=c[y++],(192&w)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=g,this.interim[2]=w,_;if(k=c[y++],(192&k)!=128){y--;continue}if(x=(7&h)<<18|(63&g)<<12|(63&w)<<6|63&k,x<65536||x>1114111)continue;f[_++]=x}}return _}}},225:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let w=0;w<m.length;++w)g.fill(0,m[w][0],m[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?g[w]:(function(k,_){let x,b=0,v=_.length-1;if(k<_[0][0]||k>_[v][1])return!1;for(;v>=b;)if(x=b+v>>1,k>_[x][1])b=x+1;else{if(!(k<_[x][0]))return!0;v=x-1}return!1})(w,h)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,k){let _=this.wcwidth(w),x=_===0&&k!==0;if(x){const b=f.UnicodeService.extractWidth(k);b===0?x=!1:b>_&&(_=b)}return f.UnicodeService.createPropertyValue(0,_,x)}}},5981:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,k){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+=w.length,this._writeBuffer.push(w),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k)}_innerWrite(w=0,k=!0){const _=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],b=this._action(x,k);if(b){const y=j=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,j))):this._innerWrite(_,j);return void b.catch((j=>(queueMicrotask((()=>{throw j})),Promise.resolve(!1)))).then(y)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-_>=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()}}l.WriteBuffer=h},5941:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function m(h,g){const w=h.toString(16),k=w.length<2?"0"+w:w;switch(g){case 4:return w[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(h){if(!h)return;let g=h.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const w=c.exec(g);if(w){const k=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/k*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/k*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/k*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),f.exec(g)&&[3,6,9,12].includes(g.length))){const w=g.length/3,k=[0,0,0];for(let _=0;_<3;++_){const x=parseInt(g.slice(w*_,w*_+w),16);k[_]=w===1?x<<4:w===2?x:w===3?x>>4:x>>8}return k}},l.toRgbString=function(h,g=16){const[w,k,_]=h;return`rgb:${m(w,g)}/${m(k,g)}/${m(_,g)}`}},5770:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=c(482),m=c(8742),h=c(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(k,_){this._handlers[k]===void 0&&(this._handlers[k]=[]);const x=this._handlers[k];return x.push(_),{dispose:()=>{const b=x.indexOf(_);b!==-1&&x.splice(b,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(k,_){if(this.reset(),this._ident=k,this._active=this._handlers[k]||g,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(k,_,x){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(k,_,x);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(k,_,x))}unhook(k,_=!0){if(this._active.length){let x=!1,b=this._active.length-1,v=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,x=_,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;b>=0&&(x=this._active[b].unhook(k),x!==!0);b--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,x;b--}for(;b>=0;b--)if(x=this._active[b].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",k);this._active=g,this._ident=0}};const w=new m.Params;w.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=w,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():w,this._data="",this._hitLimit=!1}put(k,_,x){this._hitLimit||(this._data+=(0,f.utf32ToString)(k,_,x),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let _=!1;if(this._hitLimit)_=!1;else if(k&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((x=>(this._params=w,this._data="",this._hitLimit=!1,x)));return this._params=w,this._data="",this._hitLimit=!1,_}}},2015:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=c(844),m=c(8742),h=c(6242),g=c(6351);class w{constructor(b){this.table=new Uint8Array(b)}setDefault(b,v){this.table.fill(b<<4|v)}add(b,v,y,j){this.table[v<<8|b]=y<<4|j}addMany(b,v,y,j){for(let E=0;E<b.length;E++)this.table[v<<8|b[E]]=y<<4|j}}l.TransitionTable=w;const k=160;l.VT500_TRANSITION_TABLE=(function(){const x=new w(4095),b=Array.apply(null,Array(256)).map(((P,N)=>N)),v=(P,N)=>b.slice(P,N),y=v(32,127),j=v(0,24);j.push(25),j.push.apply(j,v(28,32));const E=v(0,14);let A;for(A in x.setDefault(1,0),x.addMany(y,0,2,0),E)x.addMany([24,26,153,154],A,3,0),x.addMany(v(128,144),A,3,0),x.addMany(v(144,152),A,3,0),x.add(156,A,0,0),x.add(27,A,11,1),x.add(157,A,4,8),x.addMany([152,158,159],A,0,7),x.add(155,A,11,3),x.add(144,A,11,9);return x.addMany(j,0,3,0),x.addMany(j,1,3,1),x.add(127,1,0,1),x.addMany(j,8,0,8),x.addMany(j,3,3,3),x.add(127,3,0,3),x.addMany(j,4,3,4),x.add(127,4,0,4),x.addMany(j,6,3,6),x.addMany(j,5,3,5),x.add(127,5,0,5),x.addMany(j,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(y,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(v(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(y,7,0,7),x.addMany(j,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(v(64,127),3,7,0),x.addMany(v(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(v(48,60),4,8,4),x.addMany(v(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(v(32,64),6,0,6),x.add(127,6,0,6),x.addMany(v(64,127),6,0,0),x.addMany(v(32,48),3,9,5),x.addMany(v(32,48),5,9,5),x.addMany(v(48,64),5,0,6),x.addMany(v(64,127),5,7,0),x.addMany(v(32,48),4,9,5),x.addMany(v(32,48),1,9,2),x.addMany(v(32,48),2,9,2),x.addMany(v(48,127),2,10,0),x.addMany(v(48,80),1,10,0),x.addMany(v(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(v(96,127),1,10,0),x.add(80,1,11,9),x.addMany(j,9,0,9),x.add(127,9,0,9),x.addMany(v(28,32),9,0,9),x.addMany(v(32,48),9,9,12),x.addMany(v(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(j,11,0,11),x.addMany(v(32,128),11,0,11),x.addMany(v(28,32),11,0,11),x.addMany(j,10,0,10),x.add(127,10,0,10),x.addMany(v(28,32),10,0,10),x.addMany(v(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(v(32,48),10,9,12),x.addMany(j,12,0,12),x.add(127,12,0,12),x.addMany(v(28,32),12,0,12),x.addMany(v(32,48),12,9,12),x.addMany(v(48,64),12,0,11),x.addMany(v(64,127),12,12,13),x.addMany(v(64,127),10,12,13),x.addMany(v(64,127),9,12,13),x.addMany(j,13,13,13),x.addMany(y,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(k,0,2,0),x.add(k,8,5,8),x.add(k,6,0,6),x.add(k,11,0,11),x.add(k,13,13,13),x})();class _ extends f.Disposable{constructor(b=l.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,y,j)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,y)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,v=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<b.intermediates.length;++E){const A=b.intermediates.charCodeAt(E);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=A}}if(b.final.length!==1)throw new Error("final must be a single byte");const j=b.final.charCodeAt(0);if(v[0]>j||j>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return y<<=8,y|=j,y}identToString(b){const v=[];for(;b;)v.push(String.fromCharCode(255&b)),b>>=8;return v.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,v){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const j=this._escHandlers[y];return j.push(v),{dispose:()=>{const E=j.indexOf(v);E!==-1&&j.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,v){this._executeHandlers[b.charCodeAt(0)]=v}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,v){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const j=this._csiHandlers[y];return j.push(v),{dispose:()=>{const E=j.indexOf(v);E!==-1&&j.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,v){return this._dcsParser.registerHandler(this._identifier(b),v)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,v){return this._oscParser.registerHandler(b,v)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,v,y,j,E){this._parseStack.state=b,this._parseStack.handlers=v,this._parseStack.handlerPos=y,this._parseStack.transition=j,this._parseStack.chunkPos=E}parse(b,v,y){let j,E=0,A=0,P=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,P=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const N=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&L>-1){for(;L>=0&&(j=N[L](this._params),j!==!0);L--)if(j instanceof Promise)return this._parseStack.handlerPos=L,j}this._parseStack.handlers=[];break;case 4:if(y===!1&&L>-1){for(;L>=0&&(j=N[L](),j!==!0);L--)if(j instanceof Promise)return this._parseStack.handlerPos=L,j}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],j=this._dcsParser.unhook(E!==24&&E!==26,y),j)return j;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],j=this._oscParser.end(E!==24&&E!==26,y),j)return j;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,P=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=P;N<v;++N){switch(E=b[N],A=this._transitions.table[this.currentState<<8|(E<160?E:k)],A>>4){case 2:for(let z=N+1;;++z){if(z>=v||(E=b[z])<32||E>126&&E<k){this._printHandler(b,N,z),N=z-1;break}if(++z>=v||(E=b[z])<32||E>126&&E<k){this._printHandler(b,N,z),N=z-1;break}if(++z>=v||(E=b[z])<32||E>126&&E<k){this._printHandler(b,N,z),N=z-1;break}if(++z>=v||(E=b[z])<32||E>126&&E<k){this._printHandler(b,N,z),N=z-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:N,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|E];let B=L?L.length-1:-1;for(;B>=0&&(j=L[B](this._params),j!==!0);B--)if(j instanceof Promise)return this._preserveStack(3,L,B,A,N),j;B<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++N<v&&(E=b[N])>47&&E<60);N--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const I=this._escHandlers[this._collect<<8|E];let F=I?I.length-1:-1;for(;F>=0&&(j=I[F](),j!==!0);F--)if(j instanceof Promise)return this._preserveStack(4,I,F,A,N),j;F<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let z=N+1;;++z)if(z>=v||(E=b[z])===24||E===26||E===27||E>127&&E<k){this._dcsParser.put(b,N,z),N=z-1;break}break;case 14:if(j=this._dcsParser.unhook(E!==24&&E!==26),j)return this._preserveStack(6,[],0,A,N),j;E===27&&(A|=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 z=N+1;;z++)if(z>=v||(E=b[z])<32||E>127&&E<k){this._oscParser.put(b,N,z),N=z-1;break}break;case 6:if(j=this._oscParser.end(E!==24&&E!==26),j)return this._preserveStack(5,[],0,A,N),j;E===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}l.EscapeSequenceParser=_},6242:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=c(5770),m=c(482),h=[];l.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,w){this._handlers[g]===void 0&&(this._handlers[g]=[]);const k=this._handlers[g];return k.push(w),{dispose:()=>{const _=k.indexOf(w);_!==-1&&k.splice(_,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,w,k){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(g,w,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,w,k))}start(){this.reset(),this._state=1}put(g,w,k){if(this._state!==3){if(this._state===1)for(;w<k;){const _=g[w++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&k-w>0&&this._put(g,w,k)}}end(g,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,_=this._active.length-1,x=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,k=w,x=this._stack.fallThrough,this._stack.paused=!1),!x&&k===!1){for(;_>=0&&(k=this._active[_].end(g),k!==!0);_--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,k;_--}for(;_>=0;_--)if(k=this._active[_].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",g);this._active=h,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,w,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,w,k),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let w=!1;if(this._hitLimit)w=!1;else if(g&&(w=this._handler(this._data),w instanceof Promise))return w.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,w}}},8742:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class f{static fromArray(h){const g=new f;if(!h.length)return g;for(let w=Array.isArray(h[0])?1:0;w<h.length;++w){const k=h[w];if(Array.isArray(k))for(let _=0;_<k.length;++_)g.addSubParam(k[_]);else g.addParam(k)}return g}constructor(h=32,g=32){if(this.maxLength=h,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let g=0;g<this.length;++g){h.push(this.params[g]);const w=this._subParamsIdx[g]>>8,k=255&this._subParamsIdx[g];k-w>0&&h.push(Array.prototype.slice.call(this._subParams,w,k))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const g=this._subParamsIdx[h]>>8,w=255&this._subParamsIdx[h];return w-g>0?this._subParams.subarray(g,w):null}getSubParamsAll(){const h={};for(let g=0;g<this.length;++g){const w=this._subParamsIdx[g]>>8,k=255&this._subParamsIdx[g];k-w>0&&(h[g]=this._subParams.slice(w,k))}return h}addDigit(h){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,k=w[g-1];w[g-1]=~k?Math.min(10*k+h,c):h}}l.Params=f},5741:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const m={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(m),f.dispose=()=>this._wrappedAddonDispose(m),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){f=m;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=c(3785),m=c(511);l.BufferApiView=class{constructor(h,g){this._buffer=h,this.type=g}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const g=this._buffer.lines.get(h);if(g)return new f.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=c(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new f.CellData)}translateToString(m,h,g){return this._line.translateToString(m,h,g)}}},8285:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=c(8771),m=c(8460),h=c(844);class g extends h.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}l.BufferNamespaceApi=g},7975:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(m=>f(m.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((m,h)=>f(m,h.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,l,c){var f=this&&this.__decorate||function(x,b,v,y){var j,E=arguments.length,A=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,b,v,y);else for(var P=x.length-1;P>=0;P--)(j=x[P])&&(A=(E<3?j(A):E>3?j(b,v,A):j(b,v))||A);return E>3&&A&&Object.defineProperty(b,v,A),A},m=this&&this.__param||function(x,b){return function(v,y){b(v,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const h=c(8460),g=c(844),w=c(5295),k=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let _=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(x,this))}resize(x,b){this.cols=x,this.rows=b,this.buffers.resize(x,b),this._onResize.fire({cols:x,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,b=!1){const v=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===x.fg&&y.getBg(0)===x.bg||(y=v.getBlankLine(x,b),this._cachedBlankLine=y),y.isWrapped=b;const j=v.ybase+v.scrollTop,E=v.ybase+v.scrollBottom;if(v.scrollTop===0){const A=v.lines.isFull;E===v.lines.length-1?A?v.lines.recycle().copyFrom(y):v.lines.push(y.clone()):v.lines.splice(E+1,0,y.clone()),A?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const A=E-j+1;v.lines.shiftElements(j+1,A-1,-1),v.lines.set(E,y.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(x,b,v){const y=this.buffer;if(x<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else x+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const j=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+x,y.ybase),0),j!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};l.BufferService=_=f([m(0,k.IOptionsService)],_)},7994:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,l,c){var f=this&&this.__decorate||function(y,j,E,A){var P,N=arguments.length,L=N<3?j:A===null?A=Object.getOwnPropertyDescriptor(j,E):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,j,E,A);else for(var B=y.length-1;B>=0;B--)(P=y[B])&&(L=(N<3?P(L):N>3?P(j,E,L):P(j,E))||L);return N>3&&L&&Object.defineProperty(j,E,L),L},m=this&&this.__param||function(y,j){return function(E,A){j(E,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const h=c(2585),g=c(8460),w=c(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function _(y,j){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||j||(E|=3)),E}const x=String.fromCharCode,b={DEFAULT:y=>{const j=[_(y,!1)+32,y.col+32,y.row+32];return j[0]>255||j[1]>255||j[2]>255?"":`\x1B[M${x(j[0])}${x(j[1])}${x(j[2])}`},SGR:y=>{const j=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.col};${y.row}${j}`},SGR_PIXELS:y=>{const j=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.x};${y.y}${j}`}};let v=l.CoreMouseService=class extends w.Disposable{constructor(y,j){super(),this._bufferService=y,this._coreService=j,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(k))this.addProtocol(E,k[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,j){this._protocols[y]=j}addEncoding(y,j){this._encodings[y]=j}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const j=this._encodings[this._activeEncoding](y);return j&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(j):this._coreService.triggerDataEvent(j,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,j,E){if(E){if(y.x!==j.x||y.y!==j.y)return!1}else if(y.col!==j.col||y.row!==j.row)return!1;return y.button===j.button&&y.action===j.action&&y.ctrl===j.ctrl&&y.alt===j.alt&&y.shift===j.shift}};l.CoreMouseService=v=f([m(0,h.IBufferService),m(1,h.ICoreService)],v)},6975:function(u,l,c){var f=this&&this.__decorate||function(v,y,j,E){var A,P=arguments.length,N=P<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,y,j,E);else for(var L=v.length-1;L>=0;L--)(A=v[L])&&(N=(P<3?A(N):P>3?A(y,j,N):A(y,j))||N);return P>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(v,y){return function(j,E){y(j,E,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const h=c(1439),g=c(8460),w=c(844),k=c(2585),_=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=l.CoreService=class extends w.Disposable{constructor(v,y,j){super(),this._bufferService=v,this._logService=y,this._optionsService=j,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(x)}reset(){this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(x)}triggerDataEvent(v,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const j=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&j.ybase!==j.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(v))}};l.CoreService=b=f([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],b)},9074:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=c(8055),m=c(8460),h=c(844),g=c(6106);let w=0,k=0;class _ extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((v=>v==null?void 0:v.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const y=new x(v);if(y){const j=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),j.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,y,j){let E=0,A=0;for(const P of this._decorations.getKeyIterator(y))E=P.options.x??0,A=E+(P.options.width??1),v>=E&&v<A&&(!j||(P.options.layer??"bottom")===j)&&(yield P)}forEachDecorationAtCell(v,y,j,E){this._decorations.forEachByKey(y,(A=>{w=A.options.x??0,k=w+(A.options.width??1),v>=w&&v<k&&(!j||(A.options.layer??"bottom")===j)&&E(A)}))}}l.DecorationService=_;class x extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=c(2585),m=c(8343);class h{constructor(...w){this._entries=new Map;for(const[k,_]of w)this.set(k,_)}set(w,k){const _=this._entries.get(w);return this._entries.set(w,k),_}forEach(w){for(const[k,_]of this._entries.entries())w(k,_)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}l.ServiceCollection=h,l.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(g,w){this._services.set(g,w)}getService(g){return this._services.get(g)}createInstance(g,...w){const k=(0,m.getServiceDependencies)(g).sort(((b,v)=>b.index-v.index)),_=[];for(const b of k){const v=this._services.get(b.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${b.id}.`);_.push(v)}const x=k.length>0?k[0].index:w.length;if(w.length!==x)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${x+1} conflicts with ${w.length} static arguments`);return new g(...w,..._)}}},7866:function(u,l,c){var f=this&&this.__decorate||function(x,b,v,y){var j,E=arguments.length,A=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,b,v,y);else for(var P=x.length-1;P>=0;P--)(j=x[P])&&(A=(E<3?j(A):E>3?j(b,v,A):j(b,v))||A);return E>3&&A&&Object.defineProperty(b,v,A),A},m=this&&this.__param||function(x,b){return function(v,y){b(v,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const h=c(844),g=c(2585),w={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let k,_=l.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let b=0;b<x.length;b++)typeof x[b]=="function"&&(x[b]=x[b]())}_log(x,b,v){this._evalLazyOptionalParams(v),x.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...v)}trace(x,...b){var v;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))??console.log,x,b)}debug(x,...b){var v;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))??console.log,x,b)}info(x,...b){var v;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))??console.info,x,b)}warn(x,...b){var v;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))??console.warn,x,b)}error(x,...b){var v;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))??console.error,x,b)}};l.LogService=_=f([m(0,g.IOptionsService)],_),l.setTraceLogger=function(x){k=x},l.traceCall=function(x,b,v){if(typeof v.value!="function")throw new Error("not supported");const y=v.value;v.value=function(...j){if(k.logLevel!==g.LogLevelEnum.TRACE)return y.apply(this,j);k.trace(`GlyphRenderer#${y.name}(${j.map((A=>JSON.stringify(A))).join(", ")})`);const E=y.apply(this,j);return k.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=c(8460),m=c(844),h=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends m.Disposable{constructor(_){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...l.DEFAULT_OPTIONS};for(const b in _)if(b in x)try{const v=_[b];x[b]=this._sanitizeAndValidateOption(b,v)}catch(v){console.error(v)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,x){return this.onOptionChange((b=>{b===_&&x(this.rawOptions[_])}))}onMultipleOptionChange(_,x){return this.onOptionChange((b=>{_.indexOf(b)!==-1&&x()}))}_setupOptions(){const _=b=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},x=(b,v)=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);v=this._sanitizeAndValidateOption(b,v),this.rawOptions[b]!==v&&(this.rawOptions[b]=v,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const v={get:_.bind(this,b),set:x.bind(this,b)};Object.defineProperty(this.options,b,v)}}_sanitizeAndValidateOption(_,x){switch(_){case"cursorStyle":if(x||(x=l.DEFAULT_OPTIONS[_]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${_}`);break;case"wordSeparator":x||(x=l.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=g.includes(x)?x:l.DEFAULT_OPTIONS[_];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${_} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${_} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}l.OptionsService=w},2660:function(u,l,c){var f=this&&this.__decorate||function(w,k,_,x){var b,v=arguments.length,y=v<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,k,_,x);else for(var j=w.length-1;j>=0;j--)(b=w[j])&&(y=(v<3?b(y):v>3?b(k,_,y):b(k,_))||y);return v>3&&y&&Object.defineProperty(k,_,y),y},m=this&&this.__param||function(w,k){return function(_,x){k(_,x,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const h=c(2585);let g=l.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const k=this._bufferService.buffer;if(w.id===void 0){const j=k.addMarker(k.ybase+k.y),E={data:w,id:this._nextId++,lines:[j]};return j.onDispose((()=>this._removeMarkerFromLink(E,j))),this._dataByLinkId.set(E.id,E),E.id}const _=w,x=this._getEntryIdKey(_),b=this._entriesWithId.get(x);if(b)return this.addLineToLink(b.id,k.ybase+k.y),b.id;const v=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(y,v))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(w,k){const _=this._dataByLinkId.get(w);if(_&&_.lines.every((x=>x.line!==k))){const x=this._bufferService.buffer.addMarker(k);_.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(_,x)))}}getLinkData(w){var k;return(k=this._dataByLinkId.get(w))==null?void 0:k.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,k){const _=w.lines.indexOf(k);_!==-1&&(w.lines.splice(_,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};l.OscLinkService=g=f([m(0,h.IBufferService)],g)},8343:(u,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[f]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const h=function(g,w,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,x,b){x[c]===x?x[f].push({id:_,index:b}):(x[f]=[{id:_,index:b}],x[c]=x)})(h,g,k)};return h.toString=()=>m,l.serviceRegistry.set(m,h),h}},2585:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=c(8343);var m;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=c(8460),m=c(225);class h{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,k,_=!1){return(16777215&w)<<3|(3&k)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const w=new m.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let k=0,_=0;const x=w.length;for(let b=0;b<x;++b){let v=w.charCodeAt(b);if(55296<=v&&v<=56319){if(++b>=x)return k+this.wcwidth(v);const E=w.charCodeAt(b);56320<=E&&E<=57343?v=1024*(v-55296)+E-56320+65536:k+=this.wcwidth(E)}const y=this.charProperties(v,_);let j=h.extractWidth(y);h.extractShouldJoin(y)&&(j-=h.extractWidth(_)),k+=j,_=y}return k}charProperties(w,k){return this._activeProvider.charProperties(w,k)}}l.UnicodeService=h}},s={};function o(u){var l=s[u];if(l!==void 0)return l.exports;var c=s[u]={exports:{}};return r[u].call(c.exports,c,c.exports,o),c.exports}var d={};return(()=>{var u=d;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const l=o(9042),c=o(3236),f=o(844),m=o(5741),h=o(8285),g=o(7975),w=o(7090),k=["cols","rows"];class _ extends f.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const v=j=>this._core.options[j],y=(j,E)=>{this._checkReadonlyOptions(j),this._core.options[j]=E};for(const j in this._core.options){const E={get:v.bind(this,j),set:y.bind(this,j)};Object.defineProperty(this._publicOptions,j,E)}}_checkReadonlyOptions(b){if(k.includes(b))throw new Error(`Option "${b}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const v in b)this._publicOptions[v]=b[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,v=!0){this._core.input(b,v)}resize(b,v){this._verifyIntegers(b,v),this._core.resize(b,v)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,v,y){this._verifyIntegers(b,v,y),this._core.select(b,v,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,v){this._verifyIntegers(b,v),this._core.selectLines(b,v)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,v){this._core.write(b,v)}writeln(b,v){this._core.write(b),this._core.write(`\r
|
|
548
|
-
`,v)}paste(b){this._core.paste(b)}refresh(b,v){this._verifyIntegers(b,v),this._core.refresh(b,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return l}_verifyIntegers(...b){for(const v of b)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const v of b)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}u.Terminal=_})(),d})()))})(Vf)),Vf.exports}var DB=MB(),Gf={exports:{}},Hb;function LB(){return Hb||(Hb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const d=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(d._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,d=o._renderService.dimensions;if(d.css.cell.width===0||d.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),h=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(g/d.css.cell.width)),rows:Math.max(1,Math.floor(h/d.css.cell.height))}}}})(),r})()))})(Gf)),Gf.exports}var IB=LB(),Kf={exports:{}},Wb;function OB(){return Wb||(Wb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(u,l)=>{function c(m){try{const h=new URL(m),g=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(m,h,g,w={}){this._terminal=m,this._regex=h,this._handler=g,this._options=w}provideLinks(m,h){const g=f.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(g))}_addCallbacks(m){return m.map((h=>(h.leave=this._options.leave,h.hover=(g,w)=>{if(this._options.hover){const{range:k}=h;this._options.hover(g,w,k)}},h)))}};class f{static computeLink(h,g,w,k){const _=new RegExp(g.source,(g.flags||"")+"g"),[x,b]=f._getWindowedLineStrings(h-1,w),v=x.join("");let y;const j=[];for(;y=_.exec(v);){const E=y[0];if(!c(E))continue;const[A,P]=f._mapStrIdx(w,b,0,y.index),[N,L]=f._mapStrIdx(w,A,P,E.length);if(A===-1||P===-1||N===-1||L===-1)continue;const B={start:{x:P+1,y:A+1},end:{x:L,y:N+1}};j.push({range:B,text:E,activate:k})}return j}static _getWindowedLineStrings(h,g){let w,k=h,_=h,x=0,b="";const v=[];if(w=g.buffer.active.getLine(h)){const y=w.translateToString(!0);if(w.isWrapped&&y[0]!==" "){for(x=0;(w=g.buffer.active.getLine(--k))&&x<2048&&(b=w.translateToString(!0),x+=b.length,v.push(b),w.isWrapped&&b.indexOf(" ")===-1););v.reverse()}for(v.push(y),x=0;(w=g.buffer.active.getLine(++_))&&w.isWrapped&&x<2048&&(b=w.translateToString(!0),x+=b.length,v.push(b),b.indexOf(" ")===-1););}return[v,k]}static _mapStrIdx(h,g,w,k){const _=h.buffer.active,x=_.getNullCell();let b=w;for(;k;){const v=_.getLine(g);if(!v)return[-1,-1];for(let y=b;y<v.length;++y){v.getCell(y,x);const j=x.getChars();if(x.getWidth()&&(k-=j.length||1,y===v.length-1&&j==="")){const E=_.getLine(g+1);E&&E.isWrapped&&(E.getCell(0,x),x.getWidth()===2&&(k+=1))}if(k<0)return[g,y]}g++,b=0}return[g,b]}}l.LinkComputer=f}},s={};function o(u){var l=s[u];if(l!==void 0)return l.exports;var c=s[u]={exports:{}};return r[u](c,c.exports,o),c.exports}var d={};return(()=>{var u=d;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const l=o(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(m,h){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(m=f,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,g=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,g,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),d})()))})(Kf)),Kf.exports}var BB=OB();function _d({cwd:e,initialCommand:t,onExit:r,onReady:s,className:o="",height:d="400px"}){const u=C.useRef(null),l=C.useRef(null),c=C.useRef(null),f=C.useRef(null),[m,h]=C.useState(!1),[g,w]=C.useState(null);C.useEffect(()=>{if(!u.current||l.current)return;const b=new DB.Terminal({cursorBlink:!0,cursorStyle:"block",fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"},allowProposedApi:!0}),v=new IB.FitAddon;b.loadAddon(v),c.current=v;const y=new BB.WebLinksAddon;return b.loadAddon(y),b.open(u.current),l.current=b,setTimeout(()=>{v.fit()},0),k(b),()=>{f.current&&f.current.close(),b.dispose(),l.current=null}},[]);const k=C.useCallback(b=>{const v=window.location.protocol==="https:"?"wss:":"ws:",y=window.location.hostname,j=3333,E=new URLSearchParams;e&&E.set("cwd",e),t&&E.set("cmd",t);const A=`${v}//${y}:${j}/ws/terminal?${E.toString()}`;console.log("Connecting to terminal WebSocket:",A);const P=new WebSocket(A);f.current=P,P.onopen=()=>{console.log("Terminal WebSocket connected"),h(!0)},P.onmessage=N=>{try{const L=JSON.parse(N.data);switch(L.type){case"session":w(L.sessionId),s&&s(L.sessionId);break;case"output":b.write(L.data);break;case"exit":b.write(`\r
|
|
548
|
+
`,v)}paste(b){this._core.paste(b)}refresh(b,v){this._verifyIntegers(b,v),this._core.refresh(b,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return l}_verifyIntegers(...b){for(const v of b)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const v of b)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}u.Terminal=_})(),d})()))})(Vf)),Vf.exports}var DB=MB(),Gf={exports:{}},Hb;function LB(){return Hb||(Hb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const d=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(d._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,d=o._renderService.dimensions;if(d.css.cell.width===0||d.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),h=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(g/d.css.cell.width)),rows:Math.max(1,Math.floor(h/d.css.cell.height))}}}})(),r})()))})(Gf)),Gf.exports}var IB=LB(),Kf={exports:{}},Wb;function OB(){return Wb||(Wb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(u,l)=>{function c(m){try{const h=new URL(m),g=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(m,h,g,w={}){this._terminal=m,this._regex=h,this._handler=g,this._options=w}provideLinks(m,h){const g=f.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(g))}_addCallbacks(m){return m.map((h=>(h.leave=this._options.leave,h.hover=(g,w)=>{if(this._options.hover){const{range:k}=h;this._options.hover(g,w,k)}},h)))}};class f{static computeLink(h,g,w,k){const _=new RegExp(g.source,(g.flags||"")+"g"),[x,b]=f._getWindowedLineStrings(h-1,w),v=x.join("");let y;const j=[];for(;y=_.exec(v);){const E=y[0];if(!c(E))continue;const[A,P]=f._mapStrIdx(w,b,0,y.index),[N,L]=f._mapStrIdx(w,A,P,E.length);if(A===-1||P===-1||N===-1||L===-1)continue;const B={start:{x:P+1,y:A+1},end:{x:L,y:N+1}};j.push({range:B,text:E,activate:k})}return j}static _getWindowedLineStrings(h,g){let w,k=h,_=h,x=0,b="";const v=[];if(w=g.buffer.active.getLine(h)){const y=w.translateToString(!0);if(w.isWrapped&&y[0]!==" "){for(x=0;(w=g.buffer.active.getLine(--k))&&x<2048&&(b=w.translateToString(!0),x+=b.length,v.push(b),w.isWrapped&&b.indexOf(" ")===-1););v.reverse()}for(v.push(y),x=0;(w=g.buffer.active.getLine(++_))&&w.isWrapped&&x<2048&&(b=w.translateToString(!0),x+=b.length,v.push(b),b.indexOf(" ")===-1););}return[v,k]}static _mapStrIdx(h,g,w,k){const _=h.buffer.active,x=_.getNullCell();let b=w;for(;k;){const v=_.getLine(g);if(!v)return[-1,-1];for(let y=b;y<v.length;++y){v.getCell(y,x);const j=x.getChars();if(x.getWidth()&&(k-=j.length||1,y===v.length-1&&j==="")){const E=_.getLine(g+1);E&&E.isWrapped&&(E.getCell(0,x),x.getWidth()===2&&(k+=1))}if(k<0)return[g,y]}g++,b=0}return[g,b]}}l.LinkComputer=f}},s={};function o(u){var l=s[u];if(l!==void 0)return l.exports;var c=s[u]={exports:{}};return r[u](c,c.exports,o),c.exports}var d={};return(()=>{var u=d;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const l=o(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(m,h){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(m=f,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,g=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,g,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),d})()))})(Kf)),Kf.exports}var BB=OB();function _d({cwd:e,initialCommand:t,onExit:r,onReady:s,className:o="",height:d="400px"}){const u=C.useRef(null),l=C.useRef(null),c=C.useRef(null),f=C.useRef(null),[m,h]=C.useState(!1),[g,w]=C.useState(null);C.useEffect(()=>{if(!u.current||l.current)return;const b=new DB.Terminal({cursorBlink:!0,cursorStyle:"block",fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"},allowProposedApi:!0}),v=new IB.FitAddon;b.loadAddon(v),c.current=v;const y=new BB.WebLinksAddon;return b.loadAddon(y),b.open(u.current),l.current=b,setTimeout(()=>{v.fit(),b.focus()},0),k(b),()=>{f.current&&f.current.close(),b.dispose(),l.current=null}},[]);const k=C.useCallback(b=>{const v=window.location.protocol==="https:"?"wss:":"ws:",y=window.location.hostname,j=3333,E=new URLSearchParams;e&&E.set("cwd",e),t&&E.set("cmd",t);const A=`${v}//${y}:${j}/ws/terminal?${E.toString()}`;console.log("Connecting to terminal WebSocket:",A);const P=new WebSocket(A);f.current=P,P.onopen=()=>{console.log("Terminal WebSocket connected"),h(!0)},P.onmessage=N=>{try{const L=JSON.parse(N.data);switch(L.type){case"session":w(L.sessionId),s&&s(L.sessionId);break;case"output":b.write(L.data);break;case"exit":b.write(`\r
|
|
549
549
|
\x1B[33m[Process exited]\x1B[0m\r
|
|
550
550
|
`),r&&r(L.exitCode,L.signal);break;case"error":b.write(`\r
|
|
551
551
|
\x1B[31m[Error: ${L.message}]\x1B[0m\r
|
|
@@ -555,7 +555,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
|
|
|
555
555
|
`)},P.onerror=N=>{console.error("Terminal WebSocket error:",N),b.write(`\r
|
|
556
556
|
\x1B[31m[Connection error]\x1B[0m\r
|
|
557
557
|
`)},b.onData(N=>{P.readyState===WebSocket.OPEN&&P.send(JSON.stringify({type:"input",data:N}))}),b.onResize(({cols:N,rows:L})=>{P.readyState===WebSocket.OPEN&&P.send(JSON.stringify({type:"resize",cols:N,rows:L}))})},[e,t,s,r]);C.useEffect(()=>{const b=()=>{c.current&&l.current&&c.current.fit()};window.addEventListener("resize",b);const v=new ResizeObserver(b);return u.current&&v.observe(u.current),()=>{window.removeEventListener("resize",b),v.disconnect()}},[]),C.useCallback(b=>{f.current&&f.current.readyState===WebSocket.OPEN&&f.current.send(JSON.stringify({type:"input",data:b+"\r"}))},[]),C.useCallback(()=>{f.current&&f.current.readyState===WebSocket.OPEN&&f.current.send(JSON.stringify({type:"kill"}))},[]);const _=C.useCallback(()=>{l.current&&l.current.focus()},[]);C.useCallback(()=>{l.current&&l.current.clear()},[]);const x=C.useCallback(()=>{if(l.current){const v=l.current.buffer.active;let y="";for(let j=0;j<v.length;j++){const E=v.getLine(j);E&&(y+=E.translateToString(!0)+`
|
|
558
|
-
`)}navigator.clipboard.writeText(y.trim()).then(()=>{const j=document.getElementById("terminal-copy-btn");j&&(j.classList.add("bg-green-600"),setTimeout(()=>j.classList.remove("bg-green-600"),500))})}},[]);return n.jsxs("div",{className:`relative ${o}`,style:{height:d},children:[n.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-2",children:[n.jsx("button",{id:"terminal-copy-btn",onClick:x,className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",title:"Copy terminal output",children:"Copy"}),n.jsx("div",{className:`w-2 h-2 rounded-full ${m?"bg-green-500":"bg-red-500"}`}),n.jsx("span",{className:"text-xs text-gray-400",children:m?"Connected":"Disconnected"})]}),n.jsx("div",{ref:u,className:"w-full h-full rounded-lg overflow-hidden",style:{backgroundColor:"#1e1e1e"},onClick:_})]})}_d.sendCommand=(e,t)=>{e&&e.sendCommand&&e.sendCommand(t)};function FB({open:e,onOpenChange:t,title:r="Terminal",description:s,cwd:o,initialCommand:d,onExit:u}){const l=C.useRef(null),c=(g,w)=>{u&&u(g,w)},f=C.useCallback(g=>{g.preventDefault()},[]),m=C.useCallback(g=>{},[]),h=C.useCallback(g=>{g.key!=="Escape"&&g.stopPropagation()},[]);return n.jsx(DS,{open:e,onOpenChange:t,children:n.jsxs(Qp,{children:[n.jsx(id,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.jsxs(od,{className:Pe("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]","max-w-4xl w-full h-[600px] flex flex-col p-0 gap-0","border bg-background shadow-lg sm:rounded-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),onOpenAutoFocus:f,onEscapeKeyDown:m,onKeyDown:h,children:[n.jsx("div",{className:"px-4 py-3 border-b flex-shrink-0",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx(ad,{className:"text-lg font-semibold leading-none tracking-tight",children:r}),s&&n.jsx(ld,{className:"text-sm text-muted-foreground mt-1",children:s})]}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>t(!1),tabIndex:-1,children:n.jsx(ri,{className:"h-4 w-4"})})]})}),n.jsx("div",{ref:l,className:"flex-1 p-2 min-h-0",children:e&&n.jsx(_d,{cwd:o,initialCommand:d,onExit:c,height:"100%",className:"h-full"})})]})]})})}const cl={mcps:{icon:Ss,color:"text-blue-600",bgColor:"bg-blue-50",label:"MCP Servers"},settings:{icon:Dn,color:"text-gray-600 dark:text-slate-400",bgColor:"bg-gray-50 dark:bg-slate-800",label:"Settings"},command:{icon:Jt,color:"text-green-600",bgColor:"bg-green-50",label:"Command"},rule:{icon:Li,color:"text-purple-600",bgColor:"bg-purple-50",label:"Rule"},workflow:{icon:_1,color:"text-cyan-600",bgColor:"bg-cyan-50",label:"Workflow"},claudemd:{icon:xr,color:"text-orange-600",bgColor:"bg-orange-50",label:"CLAUDE.md"},geminimd:{icon:xr,color:"text-blue-600",bgColor:"bg-blue-50",label:"GEMINI.md"},env:{icon:qu,color:"text-yellow-600",bgColor:"bg-yellow-50",label:".env"},memory:{icon:Ii,color:"text-pink-600",bgColor:"bg-pink-50",label:"Memory"},folder:{icon:pr,color:"text-yellow-600",bgColor:"bg-yellow-50",label:"Folder"}};function hu({item:e,level:t=0,selectedPath:r,onSelect:s,onContextMenu:o,expandedFolders:d,onToggleFolder:u}){const l=cl[e.type]||cl.folder,c=l.icon,f=r===e.path,m=e.type==="folder",h=d[e.path];return n.jsxs("div",{children:[n.jsxs("div",{className:Pe("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",f&&"bg-blue-100 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/30"),style:{paddingLeft:`${t*16+8}px`},onClick:()=>m?u(e.path):s(e),onContextMenu:g=>o(g,e),children:[m&&n.jsx("span",{className:"w-4 h-4 flex items-center justify-center",children:h?n.jsx(Nr,{className:"w-3 h-3"}):n.jsx(tn,{className:"w-3 h-3"})}),!m&&n.jsx("span",{className:"w-4"}),n.jsx(c,{className:Pe("w-4 h-4",l.color)}),n.jsx("span",{className:"flex-1 truncate",children:e.name}),e.mcpCount>0&&n.jsx(st,{variant:"secondary",className:"text-xs px-1.5 py-0",children:e.mcpCount})]}),m&&h&&e.children&&n.jsx("div",{children:e.children.map(g=>n.jsx(hu,{item:g,level:t+1,selectedPath:r,onSelect:s,onContextMenu:o,expandedFolders:d,onToggleFolder:u},g.path))})]})}function $B({folder:e,isExpanded:t,isHome:r,isProject:s,isSubproject:o,depth:d=0,onToggle:u,onCreateFile:l,onInstallPlugin:c,onSelectItem:f,selectedPath:m,onContextMenu:h,expandedFolders:g,onToggleFolder:w,hasSubprojects:k,onAddSubproject:_,onRemoveSubproject:x,onHideSubproject:b}){var F,z,q,U,Y,K,V;const v=(F=e.files)==null?void 0:F.some(D=>D.name==="mcps.json"),y=(z=e.files)==null?void 0:z.some(D=>D.name==="settings.json"),j=(q=e.files)==null?void 0:q.some(D=>D.name==="CLAUDE.md"||D.name==="CLAUDE.md (root)"),E=(U=e.files)==null?void 0:U.some(D=>D.name===".env"),A=()=>r?"bg-indigo-50 dark:bg-indigo-900/20 hover:bg-indigo-100 dark:hover:bg-indigo-900/30":o&&d>1?"bg-gray-50 dark:bg-slate-800 hover:bg-gray-100 dark:hover:bg-slate-700":o?"bg-amber-50 dark:bg-amber-900/20 hover:bg-amber-100 dark:hover:bg-amber-900/30":s?"bg-green-50 dark:bg-green-900/20 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-gray-50 dark:bg-slate-800 hover:bg-gray-100 dark:hover:bg-slate-700",P=()=>r?"text-indigo-700 dark:text-indigo-400":o&&d>1?"text-gray-600 dark:text-slate-400":o?"text-amber-700 dark:text-amber-400":s?"text-green-700 dark:text-green-400":"text-gray-700 dark:text-slate-300",L=r?$p:t?oi:pr,B=r?"Home":e.label,I=(((Y=e.files)==null?void 0:Y.length)||0)+(((K=e.geminiFiles)==null?void 0:K.length)||0)+(((V=e.agentFiles)==null?void 0:V.length)||0);return n.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:Pe("flex items-center gap-2 py-2 cursor-pointer transition-colors",A()),style:{paddingLeft:`${12+d*16}px`,paddingRight:"24px"},onClick:u,children:[n.jsx("span",{className:"w-4 h-4 flex items-center justify-center text-gray-500",children:t?n.jsx(Nr,{className:"w-4 h-4"}):n.jsx(tn,{className:"w-4 h-4"})}),n.jsx(L,{className:Pe("w-4 h-4",P())}),n.jsx("span",{className:Pe("flex-1 min-w-0 font-medium text-sm truncate",P()),children:B}),n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,onClick:D=>D.stopPropagation(),children:n.jsx(ce,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 flex-shrink-0 mr-1 hover:bg-white/50 dark:hover:bg-slate-900/50",children:n.jsx(Ct,{className:"w-4 h-4"})})}),n.jsxs(ss,{align:"end",className:"w-48",children:[n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b mb-1",children:[s&&k&&n.jsx(st,{variant:"outline",className:"text-[10px] px-1 py-0 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 border-green-300 dark:border-green-700",children:"root"}),!e.exists&&!r&&n.jsx(st,{variant:"outline",className:"text-[10px] px-1 py-0",children:"no config"}),!o&&e.exists&&I===0&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:"configured"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"mcps")},disabled:v,className:v?"opacity-50":"",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"mcps.json",v&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"settings")},disabled:y,className:y?"opacity-50":"",children:[n.jsx(Dn,{className:"w-4 h-4 mr-2"}),"settings.json",y&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"env")},disabled:E,className:E?"opacity-50":"",children:[n.jsx(qu,{className:"w-4 h-4 mr-2"}),".env",E&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"command")},children:[n.jsx(Jt,{className:"w-4 h-4 mr-2"}),"New Command"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"rule")},children:[n.jsx(Li,{className:"w-4 h-4 mr-2"}),"New Rule"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"workflow")},children:[n.jsx(_1,{className:"w-4 h-4 mr-2"}),"New Workflow"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"memory")},children:[n.jsx(Ii,{className:"w-4 h-4 mr-2"}),"New Memory"]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),c(e.dir,e.name||e.dir.split("/").pop())},children:[n.jsx(Bi,{className:"w-4 h-4 mr-2"}),"Install Plugins"]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"claudemd")},disabled:j,className:j?"opacity-50":"",children:[n.jsx(xr,{className:"w-4 h-4 mr-2"}),"CLAUDE.md",j&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),(s||o)&&_&&n.jsxs(n.Fragment,{children:[n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),_(e.dir)},children:[n.jsx(ti,{className:"w-4 h-4 mr-2"}),"Add Sub-project"]})]}),o&&b&&n.jsxs(St,{onClick:D=>{D.stopPropagation(),b(e.dir)},children:[n.jsx(y1,{className:"w-4 h-4 mr-2"}),"Hide"]}),e.isManual&&x&&n.jsxs(St,{onClick:D=>{D.stopPropagation(),x(e.dir)},className:"text-destructive focus:text-destructive",children:[n.jsx(ts,{className:"w-4 h-4 mr-2"}),"Remove"]})]})]})]}),t&&n.jsxs("div",{className:"bg-white dark:bg-slate-950 py-1",children:[e.files&&e.files.length>0&&n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-orange-600 dark:text-orange-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Claude Code"]}),e.files.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),e.geminiFiles&&e.geminiFiles.length>0&&n.jsxs("div",{className:"mb-1 border-t border-dashed border-gray-200 dark:border-slate-700 pt-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Gemini CLI"]}),e.geminiFiles.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),e.agentFiles&&e.agentFiles.length>0&&n.jsxs("div",{className:"mb-1 border-t border-dashed border-gray-200 dark:border-slate-700 pt-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-purple-600 dark:text-purple-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Antigravity"]}),e.agentFiles.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),(!e.files||e.files.length===0)&&(!e.geminiFiles||e.geminiFiles.length===0)&&(!e.agentFiles||e.agentFiles.length===0)&&n.jsx("div",{className:"px-4 py-3 text-sm text-gray-400 dark:text-slate-500 italic text-center",children:"No config files. Use + to create."})]})]})}const vt=C.forwardRef(({className:e,...t},r)=>n.jsx("textarea",{className:Pe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));vt.displayName="Textarea";var Sd="Tabs",[zB]=Kr(Sd,[xd]),rj=xd(),[HB,jg]=zB(Sd),nj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:u="horizontal",dir:l,activationMode:c="automatic",...f}=e,m=_l(l),[h,g]=rs({prop:s,onChange:o,defaultProp:d??"",caller:Sd});return n.jsx(HB,{scope:r,baseId:wn(),value:h,onValueChange:g,orientation:u,dir:m,activationMode:c,children:n.jsx(Je.div,{dir:m,"data-orientation":u,...f,ref:t})})});nj.displayName=Sd;var sj="TabsList",ij=C.forwardRef((e,t)=>{const{__scopeTabs:r,loop:s=!0,...o}=e,d=jg(sj,r),u=rj(r);return n.jsx(ok,{asChild:!0,...u,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(Je.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:t})})});ij.displayName=sj;var oj="TabsTrigger",aj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,disabled:o=!1,...d}=e,u=jg(oj,r),l=rj(r),c=uj(u.baseId,s),f=dj(u.baseId,s),m=s===u.value;return n.jsx(ak,{asChild:!0,...l,focusable:!o,active:m,children:n.jsx(Je.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?u.onValueChange(s):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&u.onValueChange(s)}),onFocus:Re(e.onFocus,()=>{const h=u.activationMode!=="manual";!m&&!o&&h&&u.onValueChange(s)})})})});aj.displayName=oj;var lj="TabsContent",cj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,forceMount:o,children:d,...u}=e,l=jg(lj,r),c=uj(l.baseId,s),f=dj(l.baseId,s),m=s===l.value,h=C.useRef(m);return C.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),n.jsx(yr,{present:o||m,children:({present:g})=>n.jsx(Je.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:f,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&d})})});cj.displayName=lj;function uj(e,t){return`${e}-trigger-${t}`}function dj(e,t){return`${e}-content-${t}`}var WB=nj,hj=ij,fj=aj,mj=cj;const Cd=WB,Al=C.forwardRef(({className:e,...t},r)=>n.jsx(hj,{ref:r,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Al.displayName=hj.displayName;const Mn=C.forwardRef(({className:e,...t},r)=>n.jsx(fj,{ref:r,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Mn.displayName=fj.displayName;const vs=C.forwardRef(({className:e,...t},r)=>n.jsx(mj,{ref:r,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vs.displayName=mj.displayName;function UB({content:e,parsed:t,onSave:r,registry:s}){const[o,d]=C.useState(t||{include:[],mcpServers:{}}),[u,l]=C.useState("rich"),[c,f]=C.useState(JSON.stringify(t||{},null,2)),[m,h]=C.useState(!1),[g,w]=C.useState({open:!1,json:""});C.useEffect(()=>{d(t||{include:[],mcpServers:{}}),f(JSON.stringify(t||{},null,2))},[t]);const k=async y=>{h(!0);try{await r(JSON.stringify(y,null,2))}catch(j){Z.error("Failed to save: "+j.message)}finally{h(!1)}},_=y=>{var A;const j=(A=o.include)!=null&&A.includes(y)?o.include.filter(P=>P!==y):[...o.include||[],y],E={...o,include:j};d(E),f(JSON.stringify(E,null,2)),k(E)},x=()=>{try{const y=JSON.parse(c);d(y),k(y)}catch{Z.error("Invalid JSON")}},b=()=>{if(!g.json.trim()){Z.error("Please paste the MCP JSON configuration");return}try{let y;try{y=JSON.parse(g.json)}catch{Z.error("Invalid JSON format");return}let j={};if(y.mcpServers&&typeof y.mcpServers=="object")j=y.mcpServers;else if(typeof y=="object"&&!Array.isArray(y)){if(Object.keys(y).includes("command")){Z.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}j=y}if(Object.keys(j).length===0){Z.error("No MCP configurations found in the JSON");return}for(const[N,L]of Object.entries(j))if(!L.command){Z.error(`MCP "${N}" is missing required "command" field`);return}const E={...o.mcpServers||{},...j},A={...o,mcpServers:E};d(A),f(JSON.stringify(A,null,2)),k(A);const P=Object.keys(j).length;Z.success(`Added ${P} MCP${P>1?"s":""}`),w({open:!1,json:""})}catch(y){Z.error("Failed to add: "+y.message)}},v=s!=null&&s.mcpServers?Object.keys(s.mcpServers):[];return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[n.jsx(Cd,{value:u,onValueChange:l,children:n.jsxs(Al,{className:"h-8",children:[n.jsx(Mn,{value:"rich",className:"text-xs px-3",children:"Rich Editor"}),n.jsx(Mn,{value:"json",className:"text-xs px-3",children:"JSON"})]})}),n.jsxs("div",{className:"flex gap-2 items-center",children:[m&&n.jsx(st,{variant:"outline",className:"text-xs text-blue-600",children:"Saving..."}),n.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>w({open:!0,json:""}),children:[n.jsx(Ct,{className:"w-4 h-4 mr-1"}),"Add MCP"]}),u==="json"&&n.jsxs(ce,{size:"sm",onClick:x,disabled:m,children:[n.jsx(Ui,{className:"w-4 h-4 mr-1"}),"Apply JSON"]})]})]}),n.jsx(Ln,{className:"flex-1",children:u==="rich"?n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Registry MCPs"}),n.jsx("div",{className:"space-y-2",children:v.length===0?n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No MCPs in registry"}):v.map(y=>{var j;return n.jsxs("div",{className:"flex items-center justify-between p-2 rounded border bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ss,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"text-sm",children:y})]}),n.jsx(wt,{checked:(j=o.include)==null?void 0:j.includes(y),onCheckedChange:()=>_(y)})]},y)})})]}),Object.keys(o.mcpServers||{}).length>0&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Inline MCPs"}),n.jsx("div",{className:"space-y-2",children:Object.entries(o.mcpServers).map(([y,j])=>{var E;return n.jsxs("div",{className:"p-2 rounded border bg-white dark:bg-slate-950 group",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-sm font-medium",children:y}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(st,{variant:"outline",className:"text-xs",children:"inline"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>{const{[y]:A,...P}=o.mcpServers,N={...o,mcpServers:P};d(N),f(JSON.stringify(N,null,2)),k(N),Z.success(`Removed ${y}`)},children:n.jsx(ts,{className:"w-3.5 h-3.5"})})]})]}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 font-mono",children:[j.command," ",(E=j.args)==null?void 0:E.join(" ")]})]},y)})})]})]}):n.jsx(vt,{className:"w-full h-full min-h-[400px] font-mono text-sm border-0 rounded-none resize-none",value:c,onChange:y=>f(y.target.value)})}),n.jsx(zt,{open:g.open,onOpenChange:y=>w({...g,open:y}),children:n.jsxs(Dt,{className:"bg-white dark:bg-slate-950 max-w-2xl",children:[n.jsxs(Lt,{children:[n.jsx(It,{children:"Add MCP to Config"}),n.jsx(ur,{children:"Paste the MCP JSON configuration to add to this config file."})]}),n.jsxs("div",{className:"py-4",children:[n.jsx(vt,{value:g.json,onChange:y=>w({...g,json:y.target.value}),placeholder:`{
|
|
558
|
+
`)}navigator.clipboard.writeText(y.trim()).then(()=>{const j=document.getElementById("terminal-copy-btn");j&&(j.classList.add("bg-green-600"),setTimeout(()=>j.classList.remove("bg-green-600"),500))})}},[]);return n.jsxs("div",{className:`relative ${o}`,style:{height:d},children:[n.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-2",children:[n.jsx("button",{id:"terminal-copy-btn",onClick:x,className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",title:"Copy terminal output",children:"Copy"}),n.jsx("div",{className:`w-2 h-2 rounded-full ${m?"bg-green-500":"bg-red-500"}`}),n.jsx("span",{className:"text-xs text-gray-400",children:m?"Connected":"Disconnected"})]}),n.jsx("div",{ref:u,className:"w-full h-full rounded-lg overflow-hidden",style:{backgroundColor:"#1e1e1e"},onClick:_})]})}_d.sendCommand=(e,t)=>{e&&e.sendCommand&&e.sendCommand(t)};function FB({open:e,onOpenChange:t,title:r="Terminal",description:s,cwd:o,initialCommand:d,onExit:u,autoCloseOnExit:l=!1,autoCloseDelay:c=1500}){const f=C.useRef(null),[m,h]=C.useState(!1);C.useEffect(()=>{e&&h(!1)},[e]);const g=C.useCallback((x,b)=>{h(!0),u&&u(x,b),l&&setTimeout(()=>{t(!1)},c)},[u,l,c,t]),w=C.useCallback(x=>{x.preventDefault()},[]),k=C.useCallback(x=>{},[]),_=C.useCallback(x=>{x.key!=="Escape"&&x.stopPropagation()},[]);return n.jsx(DS,{open:e,onOpenChange:t,children:n.jsxs(Qp,{children:[n.jsx(id,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.jsxs(od,{className:Pe("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]","max-w-4xl w-full h-[600px] flex flex-col p-0 gap-0","border bg-background shadow-lg sm:rounded-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),onOpenAutoFocus:w,onEscapeKeyDown:k,onKeyDown:_,children:[n.jsx("div",{className:"px-4 py-3 border-b flex-shrink-0",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx(ad,{className:"text-lg font-semibold leading-none tracking-tight",children:r}),s&&n.jsx(ld,{className:"text-sm text-muted-foreground mt-1",children:s})]}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>t(!1),tabIndex:-1,children:n.jsx(ri,{className:"h-4 w-4"})})]})}),n.jsx("div",{ref:f,className:"flex-1 p-2 min-h-0",children:e&&n.jsx(_d,{cwd:o,initialCommand:d,onExit:g,height:"100%",className:"h-full"})})]})]})})}const cl={mcps:{icon:Ss,color:"text-blue-600",bgColor:"bg-blue-50",label:"MCP Servers"},settings:{icon:Dn,color:"text-gray-600 dark:text-slate-400",bgColor:"bg-gray-50 dark:bg-slate-800",label:"Settings"},command:{icon:Jt,color:"text-green-600",bgColor:"bg-green-50",label:"Command"},rule:{icon:Li,color:"text-purple-600",bgColor:"bg-purple-50",label:"Rule"},workflow:{icon:_1,color:"text-cyan-600",bgColor:"bg-cyan-50",label:"Workflow"},claudemd:{icon:xr,color:"text-orange-600",bgColor:"bg-orange-50",label:"CLAUDE.md"},geminimd:{icon:xr,color:"text-blue-600",bgColor:"bg-blue-50",label:"GEMINI.md"},env:{icon:qu,color:"text-yellow-600",bgColor:"bg-yellow-50",label:".env"},memory:{icon:Ii,color:"text-pink-600",bgColor:"bg-pink-50",label:"Memory"},folder:{icon:pr,color:"text-yellow-600",bgColor:"bg-yellow-50",label:"Folder"}};function hu({item:e,level:t=0,selectedPath:r,onSelect:s,onContextMenu:o,expandedFolders:d,onToggleFolder:u}){const l=cl[e.type]||cl.folder,c=l.icon,f=r===e.path,m=e.type==="folder",h=d[e.path];return n.jsxs("div",{children:[n.jsxs("div",{className:Pe("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",f&&"bg-blue-100 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/30"),style:{paddingLeft:`${t*16+8}px`},onClick:()=>m?u(e.path):s(e),onContextMenu:g=>o(g,e),children:[m&&n.jsx("span",{className:"w-4 h-4 flex items-center justify-center",children:h?n.jsx(Nr,{className:"w-3 h-3"}):n.jsx(tn,{className:"w-3 h-3"})}),!m&&n.jsx("span",{className:"w-4"}),n.jsx(c,{className:Pe("w-4 h-4",l.color)}),n.jsx("span",{className:"flex-1 truncate",children:e.name}),e.mcpCount>0&&n.jsx(st,{variant:"secondary",className:"text-xs px-1.5 py-0",children:e.mcpCount})]}),m&&h&&e.children&&n.jsx("div",{children:e.children.map(g=>n.jsx(hu,{item:g,level:t+1,selectedPath:r,onSelect:s,onContextMenu:o,expandedFolders:d,onToggleFolder:u},g.path))})]})}function $B({folder:e,isExpanded:t,isHome:r,isProject:s,isSubproject:o,depth:d=0,onToggle:u,onCreateFile:l,onInstallPlugin:c,onSelectItem:f,selectedPath:m,onContextMenu:h,expandedFolders:g,onToggleFolder:w,hasSubprojects:k,onAddSubproject:_,onRemoveSubproject:x,onHideSubproject:b}){var F,z,q,U,Y,K,V;const v=(F=e.files)==null?void 0:F.some(D=>D.name==="mcps.json"),y=(z=e.files)==null?void 0:z.some(D=>D.name==="settings.json"),j=(q=e.files)==null?void 0:q.some(D=>D.name==="CLAUDE.md"||D.name==="CLAUDE.md (root)"),E=(U=e.files)==null?void 0:U.some(D=>D.name===".env"),A=()=>r?"bg-indigo-50 dark:bg-indigo-900/20 hover:bg-indigo-100 dark:hover:bg-indigo-900/30":o&&d>1?"bg-gray-50 dark:bg-slate-800 hover:bg-gray-100 dark:hover:bg-slate-700":o?"bg-amber-50 dark:bg-amber-900/20 hover:bg-amber-100 dark:hover:bg-amber-900/30":s?"bg-green-50 dark:bg-green-900/20 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-gray-50 dark:bg-slate-800 hover:bg-gray-100 dark:hover:bg-slate-700",P=()=>r?"text-indigo-700 dark:text-indigo-400":o&&d>1?"text-gray-600 dark:text-slate-400":o?"text-amber-700 dark:text-amber-400":s?"text-green-700 dark:text-green-400":"text-gray-700 dark:text-slate-300",L=r?$p:t?oi:pr,B=r?"Home":e.label,I=(((Y=e.files)==null?void 0:Y.length)||0)+(((K=e.geminiFiles)==null?void 0:K.length)||0)+(((V=e.agentFiles)==null?void 0:V.length)||0);return n.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:Pe("flex items-center gap-2 py-2 cursor-pointer transition-colors",A()),style:{paddingLeft:`${12+d*16}px`,paddingRight:"24px"},onClick:u,children:[n.jsx("span",{className:"w-4 h-4 flex items-center justify-center text-gray-500",children:t?n.jsx(Nr,{className:"w-4 h-4"}):n.jsx(tn,{className:"w-4 h-4"})}),n.jsx(L,{className:Pe("w-4 h-4",P())}),n.jsx("span",{className:Pe("flex-1 min-w-0 font-medium text-sm truncate",P()),children:B}),n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,onClick:D=>D.stopPropagation(),children:n.jsx(ce,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 flex-shrink-0 mr-1 hover:bg-white/50 dark:hover:bg-slate-900/50",children:n.jsx(Ct,{className:"w-4 h-4"})})}),n.jsxs(ss,{align:"end",className:"w-48",children:[n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b mb-1",children:[s&&k&&n.jsx(st,{variant:"outline",className:"text-[10px] px-1 py-0 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 border-green-300 dark:border-green-700",children:"root"}),!e.exists&&!r&&n.jsx(st,{variant:"outline",className:"text-[10px] px-1 py-0",children:"no config"}),!o&&e.exists&&I===0&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:"configured"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"mcps")},disabled:v,className:v?"opacity-50":"",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"mcps.json",v&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"settings")},disabled:y,className:y?"opacity-50":"",children:[n.jsx(Dn,{className:"w-4 h-4 mr-2"}),"settings.json",y&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"env")},disabled:E,className:E?"opacity-50":"",children:[n.jsx(qu,{className:"w-4 h-4 mr-2"}),".env",E&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"command")},children:[n.jsx(Jt,{className:"w-4 h-4 mr-2"}),"New Command"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"rule")},children:[n.jsx(Li,{className:"w-4 h-4 mr-2"}),"New Rule"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"workflow")},children:[n.jsx(_1,{className:"w-4 h-4 mr-2"}),"New Workflow"]}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"memory")},children:[n.jsx(Ii,{className:"w-4 h-4 mr-2"}),"New Memory"]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),c(e.dir,e.name||e.dir.split("/").pop())},children:[n.jsx(Bi,{className:"w-4 h-4 mr-2"}),"Install Plugins"]}),n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),l(e.dir,"claudemd")},disabled:j,className:j?"opacity-50":"",children:[n.jsx(xr,{className:"w-4 h-4 mr-2"}),"CLAUDE.md",j&&n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"exists"})]}),(s||o)&&_&&n.jsxs(n.Fragment,{children:[n.jsx(vr,{}),n.jsxs(St,{onClick:D=>{D.stopPropagation(),_(e.dir)},children:[n.jsx(ti,{className:"w-4 h-4 mr-2"}),"Add Sub-project"]})]}),o&&b&&n.jsxs(St,{onClick:D=>{D.stopPropagation(),b(e.dir)},children:[n.jsx(y1,{className:"w-4 h-4 mr-2"}),"Hide"]}),e.isManual&&x&&n.jsxs(St,{onClick:D=>{D.stopPropagation(),x(e.dir)},className:"text-destructive focus:text-destructive",children:[n.jsx(ts,{className:"w-4 h-4 mr-2"}),"Remove"]})]})]})]}),t&&n.jsxs("div",{className:"bg-white dark:bg-slate-950 py-1",children:[e.files&&e.files.length>0&&n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-orange-600 dark:text-orange-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Claude Code"]}),e.files.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),e.geminiFiles&&e.geminiFiles.length>0&&n.jsxs("div",{className:"mb-1 border-t border-dashed border-gray-200 dark:border-slate-700 pt-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Gemini CLI"]}),e.geminiFiles.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),e.agentFiles&&e.agentFiles.length>0&&n.jsxs("div",{className:"mb-1 border-t border-dashed border-gray-200 dark:border-slate-700 pt-1",children:[n.jsxs("div",{className:"px-4 py-1 text-[10px] font-medium text-purple-600 dark:text-purple-400 uppercase tracking-wide flex items-center gap-1",children:[n.jsx(Ut,{className:"w-3 h-3"}),"Antigravity"]}),e.agentFiles.map(D=>n.jsx(hu,{item:D,selectedPath:m,onSelect:f,onContextMenu:h,expandedFolders:g,onToggleFolder:w},D.path))]}),(!e.files||e.files.length===0)&&(!e.geminiFiles||e.geminiFiles.length===0)&&(!e.agentFiles||e.agentFiles.length===0)&&n.jsx("div",{className:"px-4 py-3 text-sm text-gray-400 dark:text-slate-500 italic text-center",children:"No config files. Use + to create."})]})]})}const vt=C.forwardRef(({className:e,...t},r)=>n.jsx("textarea",{className:Pe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));vt.displayName="Textarea";var Sd="Tabs",[zB]=Kr(Sd,[xd]),rj=xd(),[HB,jg]=zB(Sd),nj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:u="horizontal",dir:l,activationMode:c="automatic",...f}=e,m=_l(l),[h,g]=rs({prop:s,onChange:o,defaultProp:d??"",caller:Sd});return n.jsx(HB,{scope:r,baseId:wn(),value:h,onValueChange:g,orientation:u,dir:m,activationMode:c,children:n.jsx(Je.div,{dir:m,"data-orientation":u,...f,ref:t})})});nj.displayName=Sd;var sj="TabsList",ij=C.forwardRef((e,t)=>{const{__scopeTabs:r,loop:s=!0,...o}=e,d=jg(sj,r),u=rj(r);return n.jsx(ok,{asChild:!0,...u,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(Je.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:t})})});ij.displayName=sj;var oj="TabsTrigger",aj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,disabled:o=!1,...d}=e,u=jg(oj,r),l=rj(r),c=uj(u.baseId,s),f=dj(u.baseId,s),m=s===u.value;return n.jsx(ak,{asChild:!0,...l,focusable:!o,active:m,children:n.jsx(Je.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?u.onValueChange(s):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&u.onValueChange(s)}),onFocus:Re(e.onFocus,()=>{const h=u.activationMode!=="manual";!m&&!o&&h&&u.onValueChange(s)})})})});aj.displayName=oj;var lj="TabsContent",cj=C.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,forceMount:o,children:d,...u}=e,l=jg(lj,r),c=uj(l.baseId,s),f=dj(l.baseId,s),m=s===l.value,h=C.useRef(m);return C.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),n.jsx(yr,{present:o||m,children:({present:g})=>n.jsx(Je.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:f,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&d})})});cj.displayName=lj;function uj(e,t){return`${e}-trigger-${t}`}function dj(e,t){return`${e}-content-${t}`}var WB=nj,hj=ij,fj=aj,mj=cj;const Cd=WB,Al=C.forwardRef(({className:e,...t},r)=>n.jsx(hj,{ref:r,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Al.displayName=hj.displayName;const Mn=C.forwardRef(({className:e,...t},r)=>n.jsx(fj,{ref:r,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Mn.displayName=fj.displayName;const vs=C.forwardRef(({className:e,...t},r)=>n.jsx(mj,{ref:r,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vs.displayName=mj.displayName;function UB({content:e,parsed:t,onSave:r,registry:s}){const[o,d]=C.useState(t||{include:[],mcpServers:{}}),[u,l]=C.useState("rich"),[c,f]=C.useState(JSON.stringify(t||{},null,2)),[m,h]=C.useState(!1),[g,w]=C.useState({open:!1,json:""});C.useEffect(()=>{d(t||{include:[],mcpServers:{}}),f(JSON.stringify(t||{},null,2))},[t]);const k=async y=>{h(!0);try{await r(JSON.stringify(y,null,2))}catch(j){Z.error("Failed to save: "+j.message)}finally{h(!1)}},_=y=>{var A;const j=(A=o.include)!=null&&A.includes(y)?o.include.filter(P=>P!==y):[...o.include||[],y],E={...o,include:j};d(E),f(JSON.stringify(E,null,2)),k(E)},x=()=>{try{const y=JSON.parse(c);d(y),k(y)}catch{Z.error("Invalid JSON")}},b=()=>{if(!g.json.trim()){Z.error("Please paste the MCP JSON configuration");return}try{let y;try{y=JSON.parse(g.json)}catch{Z.error("Invalid JSON format");return}let j={};if(y.mcpServers&&typeof y.mcpServers=="object")j=y.mcpServers;else if(typeof y=="object"&&!Array.isArray(y)){if(Object.keys(y).includes("command")){Z.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}j=y}if(Object.keys(j).length===0){Z.error("No MCP configurations found in the JSON");return}for(const[N,L]of Object.entries(j))if(!L.command){Z.error(`MCP "${N}" is missing required "command" field`);return}const E={...o.mcpServers||{},...j},A={...o,mcpServers:E};d(A),f(JSON.stringify(A,null,2)),k(A);const P=Object.keys(j).length;Z.success(`Added ${P} MCP${P>1?"s":""}`),w({open:!1,json:""})}catch(y){Z.error("Failed to add: "+y.message)}},v=s!=null&&s.mcpServers?Object.keys(s.mcpServers):[];return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[n.jsx(Cd,{value:u,onValueChange:l,children:n.jsxs(Al,{className:"h-8",children:[n.jsx(Mn,{value:"rich",className:"text-xs px-3",children:"Rich Editor"}),n.jsx(Mn,{value:"json",className:"text-xs px-3",children:"JSON"})]})}),n.jsxs("div",{className:"flex gap-2 items-center",children:[m&&n.jsx(st,{variant:"outline",className:"text-xs text-blue-600",children:"Saving..."}),n.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>w({open:!0,json:""}),children:[n.jsx(Ct,{className:"w-4 h-4 mr-1"}),"Add MCP"]}),u==="json"&&n.jsxs(ce,{size:"sm",onClick:x,disabled:m,children:[n.jsx(Ui,{className:"w-4 h-4 mr-1"}),"Apply JSON"]})]})]}),n.jsx(Ln,{className:"flex-1",children:u==="rich"?n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Registry MCPs"}),n.jsx("div",{className:"space-y-2",children:v.length===0?n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No MCPs in registry"}):v.map(y=>{var j;return n.jsxs("div",{className:"flex items-center justify-between p-2 rounded border bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ss,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"text-sm",children:y})]}),n.jsx(wt,{checked:(j=o.include)==null?void 0:j.includes(y),onCheckedChange:()=>_(y)})]},y)})})]}),Object.keys(o.mcpServers||{}).length>0&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Inline MCPs"}),n.jsx("div",{className:"space-y-2",children:Object.entries(o.mcpServers).map(([y,j])=>{var E;return n.jsxs("div",{className:"p-2 rounded border bg-white dark:bg-slate-950 group",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-sm font-medium",children:y}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(st,{variant:"outline",className:"text-xs",children:"inline"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>{const{[y]:A,...P}=o.mcpServers,N={...o,mcpServers:P};d(N),f(JSON.stringify(N,null,2)),k(N),Z.success(`Removed ${y}`)},children:n.jsx(ts,{className:"w-3.5 h-3.5"})})]})]}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 font-mono",children:[j.command," ",(E=j.args)==null?void 0:E.join(" ")]})]},y)})})]})]}):n.jsx(vt,{className:"w-full h-full min-h-[400px] font-mono text-sm border-0 rounded-none resize-none",value:c,onChange:y=>f(y.target.value)})}),n.jsx(zt,{open:g.open,onOpenChange:y=>w({...g,open:y}),children:n.jsxs(Dt,{className:"bg-white dark:bg-slate-950 max-w-2xl",children:[n.jsxs(Lt,{children:[n.jsx(It,{children:"Add MCP to Config"}),n.jsx(ur,{children:"Paste the MCP JSON configuration to add to this config file."})]}),n.jsxs("div",{className:"py-4",children:[n.jsx(vt,{value:g.json,onChange:y=>w({...g,json:y.target.value}),placeholder:`{
|
|
559
559
|
"my-mcp": {
|
|
560
560
|
"command": "npx",
|
|
561
561
|
"args": ["-y", "@example/mcp-server"],
|
|
@@ -571,7 +571,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
|
|
|
571
571
|
}`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}const $F=[{id:"Default",name:"Default"},{id:"GitHub",name:"GitHub"},{id:"Monokai",name:"Monokai"},{id:"SolarizedDark",name:"Solarized Dark"},{id:"SolarizedLight",name:"Solarized Light"}],zF=[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Most capable"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",description:"Fast and efficient"},{id:"gemini-2.0-pro",name:"Gemini 2.0 Pro",description:"Previous generation"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",description:"Previous generation fast"}];function Tj({settings:e,onSave:t,loading:r,settingsPath:s}){var P,N,L,B;const[o,d]=C.useState(e||{}),[u,l]=C.useState(!1),[c,f]=C.useState("rich"),[m,h]=C.useState(JSON.stringify(e||{},null,2)),[g,w]=C.useState({open:!1,name:"",json:""}),[k,_]=C.useState({}),x=async()=>{l(!0);try{if(c==="json")try{const I=JSON.parse(m);await t(I),d(I)}catch{Z.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));Z.success("Settings saved")}finally{l(!1)}},b=(I,F,z)=>{d(q=>({...q,[I]:{...q[I],[F]:z}}))},v=(I,F,z=!1)=>{var q;return((q=o==null?void 0:o[I])==null?void 0:q[F])??z},y=o.mcpServers||{},j=()=>{const{name:I,json:F}=g;if(!I.trim()){Z.error("Please enter a name for the MCP");return}let z;try{z=JSON.parse(F)}catch{Z.error("Invalid JSON configuration");return}if(!z.command){Z.error('MCP config must have a "command" field');return}d(q=>({...q,mcpServers:{...q.mcpServers,[I.trim()]:z}})),w({open:!1,name:"",json:""}),Z.success(`Added MCP: ${I}`)},E=I=>{d(F=>{const{[I]:z,...q}=F.mcpServers||{};return{...F,mcpServers:q}}),Z.success(`Removed MCP: ${I}`)},A=I=>{_(F=>({...F,[I]:!F[I]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:n.jsx(Jt,{className:"w-5 h-5 text-blue-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Gemini CLI Settings",n.jsxs(st,{variant:"outline",className:"text-xs font-normal text-blue-600 border-blue-300 dark:border-blue-700",children:[n.jsx(Ut,{className:"w-3 h-3 mr-1"}),"Google"]})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),n.jsxs(ce,{onClick:x,disabled:u||r,children:[u?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(Ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(vt,{value:m,onChange:I=>h(I.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Ss,{className:"w-4 h-4 text-blue-500"}),"MCP Servers",n.jsx(st,{variant:"secondary",className:"text-xs",children:Object.keys(y).length})]}),n.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
572
572
|
"command": "npx",
|
|
573
573
|
"args": ["-y", "@example/mcp-server"]
|
|
574
|
-
}`}),children:[n.jsx(Ct,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([I,F])=>n.jsxs(Rg,{open:k[I],onOpenChange:()=>A(I),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Mg,{className:"flex items-center gap-2 flex-1 text-left",children:[k[I]?n.jsx(Nr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(tn,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Ss,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:I}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:F.command})]}),n.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(I),children:n.jsx(ts,{className:"w-4 h-4"})})]}),n.jsx(Dg,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(F,null,2)})})})]},I))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ut,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(rn,{value:v("model","name",""),onValueChange:I=>b("model","name",I),children:[n.jsx(Ur,{className:"w-48",children:n.jsx(nn,{placeholder:"Select model"})}),n.jsx(Vr,{children:zF.map(I=>n.jsx(Et,{value:I.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:I.name})})},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(wt,{checked:v("general","previewFeatures",!1),onCheckedChange:I=>b("general","previewFeatures",I)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(rn,{value:v("ui","theme","Default"),onValueChange:I=>b("ui","theme",I),children:[n.jsx(Ur,{className:"w-40",children:n.jsx(nn,{})}),n.jsx(Vr,{children:$F.map(I=>n.jsx(Et,{value:I.id,children:I.name},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(rn,{value:v("output","format","text"),onValueChange:I=>b("output","format",I),children:[n.jsx(Ur,{className:"w-40",children:n.jsx(nn,{})}),n.jsxs(Vr,{children:[n.jsx(Et,{value:"text",children:"Text"}),n.jsx(Et,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(C1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(wt,{checked:v("ui","dynamicWindowTitle",!0),onCheckedChange:I=>b("ui","dynamicWindowTitle",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(wt,{checked:v("ui","showLineNumbers",!0),onCheckedChange:I=>b("ui","showLineNumbers",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(wt,{checked:v("ui","showCitations",!1),onCheckedChange:I=>b("ui","showCitations",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(wt,{checked:v("ui","hideContextSummary",!1),onCheckedChange:I=>b("ui","hideContextSummary",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(wt,{checked:v("ui","hideFooter",!1),onCheckedChange:I=>b("ui","hideFooter",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(wt,{checked:((N=(P=o==null?void 0:o.ui)==null?void 0:P.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:I=>d(F=>{var z;return{...F,ui:{...F.ui,accessibility:{...(z=F.ui)==null?void 0:z.accessibility,screenReader:I}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Dn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(wt,{checked:v("general","vimMode",!1),onCheckedChange:I=>b("general","vimMode",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(wt,{checked:v("general","enableAutoUpdate",!0),onCheckedChange:I=>b("general","enableAutoUpdate",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(wt,{checked:((B=(L=o==null?void 0:o.general)==null?void 0:L.checkpointing)==null?void 0:B.enabled)??!1,onCheckedChange:I=>d(F=>{var z;return{...F,general:{...F.general,checkpointing:{...(z=F.general)==null?void 0:z.checkpointing,enabled:I}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(wt,{checked:v("general","respectGitignore",!0),onCheckedChange:I=>b("general","respectGitignore",I)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(ui,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(wt,{checked:v("privacy","usageStatisticsEnabled",!0),onCheckedChange:I=>b("privacy","usageStatisticsEnabled",I)})]})})]})]}),n.jsx(zt,{open:g.open,onOpenChange:I=>w({...g,open:I}),children:n.jsxs(Dt,{className:"bg-card",children:[n.jsxs(Lt,{children:[n.jsx(It,{children:"Add MCP Server"}),n.jsx(ur,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(dt,{value:g.name,onChange:I=>w({...g,name:I.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(vt,{value:g.json,onChange:I=>w({...g,json:I.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(ce,{onClick:j,children:[n.jsx(Ct,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},d=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),u=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return d&&!u?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Aj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[d,u]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,g]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){Z.error("Please select or enter a target path");return}o(r.path,k,d,h)};return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"max-w-md",children:[n.jsxs(Lt,{children:[n.jsxs(It,{children:[d==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(ur,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(ce,{variant:d==="copy"?"default":"outline",size:"sm",onClick:()=>u("copy"),children:[n.jsx(wu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(ce,{variant:d==="move"?"default":"outline",size:"sm",onClick:()=>u("move"),children:[n.jsx(k1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:Pe("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx($p,{className:"w-4 h-4"}):n.jsx(pr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(st,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(dt,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wt,{checked:h,onCheckedChange:g}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:w,children:d==="copy"?"Copy":"Move"})]})]})})}function UF({open:e,onClose:t,item:r,onRename:s}){const[o,d]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&d(r.name.replace(/\.md$/,""))},[r,e]);const u=()=>{if(!o.trim()){Z.error("Please enter a name");return}s(r,o.trim())};return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"sm:max-w-md",children:[n.jsx(Lt,{children:n.jsxs(It,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(dt,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>d(l.target.value),onKeyDown:l=>l.key==="Enter"&&u()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:u,children:"Rename"})]})]})})}function VF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[d,u]=C.useState("");C.useEffect(()=>{u("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!d.trim()){Z.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?d.endsWith(".md")?d:`${d}.md`:d;o(r,m,s)},c=cl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"max-w-sm",children:[n.jsx(Lt,{children:n.jsxs(It,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(dt,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:d,onChange:m=>u(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var Ie,Me,rt;const[r,s]=C.useState([]),[o,d]=C.useState([]),[u,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[g,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[x,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[A,P]=C.useState({open:!1,item:null}),[N,L]=C.useState(!1),[B,I]=C.useState({open:!1,projectDir:null}),[F,z]=C.useState({open:!1,dir:null,name:null}),[q,U]=C.useState({open:!1,dir:null}),[Y,K]=C.useState({x:0,y:0,item:null}),[V,D]=C.useState(["claude"]),R=C.useCallback(async()=>{var Ce;try{b(!0);const[ge,De,mt,kt]=await Promise.all([Se.getClaudeFolders(),Se.getIntermediatePaths(),Se.getRegistry(),Se.getConfig()]);if(s(ge),d(De),l(mt),D(((Ce=kt.config)==null?void 0:Ce.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Fe=be.length>1?be[be.length-1]:be[0],qe=(Fe==null?void 0:Fe.dir)||ge[0].dir;w(qe);try{localStorage.setItem("claude-config-expanded-folder",qe)}catch{}}}}catch(ge){Z.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{R(),f(null),h(null)},[R,e==null?void 0:e.dir]);const O=Ce=>{const ge=g===Ce?null:Ce;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},G=async Ce=>{f(Ce);try{const ge=await Se.getClaudeFile(Ce.path);h(ge)}catch(ge){Z.error("Failed to load file: "+ge.message)}},$=async Ce=>{if(c)try{await Se.saveClaudeFile(c.path,Ce),Z.success("Saved");const ge=await Se.getClaudeFile(c.path);h(ge),R()}catch(ge){Z.error("Failed to save: "+ge.message)}},oe=Ce=>{_(ge=>({...ge,[Ce]:!ge[Ce]}))},me=(Ce,ge)=>{Ce.preventDefault(),K({x:Ce.clientX,y:Ce.clientY,item:ge})},he=async(Ce,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Ce,type:ge}):ge==="claudemd"?U({open:!0,dir:Ce}):X(Ce,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Ce,ge,De)=>{try{const mt=await Se.createClaudeFile(Ce,ge,De);if(Z.success("Created"),E({open:!1,dir:null,type:null}),await R(),mt.path){const kt={path:mt.path,name:ge,type:De==="command"?"command":De==="rule"?"rule":De==="workflow"?"workflow":"file"};f(kt),h(mt.content||"")}}catch(mt){Z.error("Failed to create: "+mt.message)}},H=async(Ce,ge)=>{try{const De=await Se.renameClaudeFile(Ce.path,ge);De.success?(Z.success("Renamed"),P({open:!1,item:null}),await R(),f({...Ce,path:De.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):Z.error(De.error||"Failed to rename")}catch(De){Z.error("Failed to rename: "+De.message)}},ae=async Ce=>{if(confirm(`Delete ${Ce.name}?`))try{await Se.deleteClaudeFile(Ce.path),Z.success("Deleted"),(c==null?void 0:c.path)===Ce.path&&(f(null),h(null)),R()}catch(ge){Z.error("Failed to delete: "+ge.message)}},ne=async(Ce,ge,De,mt)=>{try{await Se.moveClaudeItem(Ce,ge,De,mt),Z.success(De==="copy"?"Copied":"Moved"),y({open:!1,item:null}),R()}catch(kt){Z.error("Failed: "+kt.message)}},J=async Ce=>{if(Ce)try{const ge=await Se.addManualSubproject(B.projectDir,Ce);ge.success?(Z.success(`Added sub-project: ${Ce.split("/").pop()}`),I({open:!1,projectDir:null}),R()):Z.error(ge.error||"Failed to add sub-project")}catch(ge){Z.error("Failed to add sub-project: "+ge.message)}},se=async Ce=>{const ge=r.find(De=>!De.isSubproject&&!De.isHome);if(ge)try{const De=await Se.removeManualSubproject(ge.dir,Ce);De.success?(Z.success("Removed sub-project"),R()):Z.error(De.error||"Failed to remove sub-project")}catch(De){Z.error("Failed to remove sub-project: "+De.message)}},xe=async Ce=>{const ge=r.find(De=>!De.isSubproject&&!De.isHome);if(ge)try{const De=await Se.hideSubproject(ge.dir,Ce);De.success?(Z.success("Sub-project hidden"),R()):Z.error(De.error||"Failed to hide sub-project")}catch(De){Z.error("Failed to hide sub-project: "+De.message)}},Be=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Nm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(UB,{content:m.content,parsed:m.parsed,onSave:$,registry:u});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:$,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Ub,{content:m.content,onSave:$,fileType:c.type});default:return n.jsx(Ub,{content:m.content,onSave:$,fileType:"claudemd"})}};if(x)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Er,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Ce=>Ce.isSubproject),ee=(Ce,ge)=>ge===0,de=(Ce,ge)=>{const De=r.findIndex(mt=>mt.isSubproject);return!Ce.isSubproject&&(De>=0?ge===De-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[V.includes("claude")&&V.includes("antigravity")&&n.jsxs(ce,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>L(!0),title:"Sync rules between tools",children:[n.jsx(J4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:R,children:n.jsx(Er,{className:"w-4 h-4"})})]})]}),n.jsx(Ln,{className:"flex-1",children:r.map((Ce,ge)=>n.jsx($B,{folder:Ce,isExpanded:g===Ce.dir,isHome:ee(Ce,ge),isProject:de(Ce,ge),isSubproject:Ce.isSubproject,depth:Ce.depth||0,onToggle:()=>O(Ce.dir),onCreateFile:he,onInstallPlugin:(De,mt)=>z({open:!0,dir:De,name:mt}),onSelectItem:G,selectedPath:c==null?void 0:c.path,onContextMenu:me,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:De=>I({open:!0,projectDir:De}),onRemoveSubproject:se,onHideSubproject:xe},Ce.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(wu,{className:"w-4 h-4"})}),n.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(ts,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Be()})]}),Y.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>K({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:Y.x,top:Y.y},children:[(((Ie=Y.item)==null?void 0:Ie.type)==="rule"||((Me=Y.item)==null?void 0:Me.type)==="command"||((rt=Y.item)==null?void 0:rt.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{P({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(wu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(k1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(Y.item),K({x:0,y:0,item:null})},children:[n.jsx(ts,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:o,onMove:ne}),n.jsx(VF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(UF,{open:A.open,onClose:()=>P({open:!1,item:null}),item:A.item,onRename:H}),n.jsx(JO,{open:N,onOpenChange:L,projectDir:e==null?void 0:e.dir,onSynced:R}),n.jsx(RB,{open:F.open,onOpenChange:Ce=>z({...F,open:Ce}),projectDir:F.dir,projectName:F.name}),n.jsx(xg,{open:B.open,onOpenChange:Ce=>I({...B,open:Ce}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:B.projectDir||"~"}),n.jsx(FB,{open:q.open,onOpenChange:Ce=>{U({...q,open:Ce}),Ce||R()},title:"Initialize CLAUDE.md",description:"Running claude /init to generate project-aware CLAUDE.md",cwd:q.dir,initialCommand:"claude /init"})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:d=!1}){const u=(t==null?void 0:t.name)||"No Project";return n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:d,children:[n.jsx(oi,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:u}),n.jsx(Nr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ss,{align:"start",className:"w-72",children:[n.jsx(Fo,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(vr,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(pr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(St,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx($t,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(pr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Yu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(vr,{}),n.jsxs(St,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(Ct,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(St,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(E1,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function qF({onManageClick:e}){const[t,r]=C.useState([]),[s,o]=C.useState(null),[d,u]=C.useState(!0),[l,c]=C.useState(!1);C.useEffect(()=>{f()},[]);const f=async()=>{try{const g=await Se.getWorkstreams();r(g.workstreams||[]),o(g.activeId)}catch(g){console.error("Failed to load workstreams:",g)}finally{u(!1)}},m=async g=>{if(g!==s){c(!0);try{const w=await Se.setActiveWorkstream(g);w.success?(o(g),Z.success(`Switched to: ${w.workstream.name}`)):Z.error(w.error||"Failed to switch workstream")}catch{Z.error("Failed to switch workstream")}finally{c(!1)}}},h=t.find(g=>g.id===s);return!d&&t.length===0?null:n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"outline",className:"gap-2 max-w-[180px] h-9 border-purple-200 dark:border-purple-800 hover:border-purple-300 dark:hover:border-purple-700",disabled:d||l,children:[d||l?n.jsx(ut,{className:"w-4 h-4 animate-spin text-purple-500"}):n.jsx(qa,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium text-purple-700 dark:text-purple-400",children:(h==null?void 0:h.name)||"No Workstream"}),n.jsx(Nr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ss,{align:"start",className:"w-64",children:[n.jsx(Fo,{className:"text-xs text-gray-500 dark:text-slate-400 font-normal",children:"Workstreams"}),n.jsx(vr,{}),t.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 dark:text-slate-400 text-center",children:[n.jsx(qa,{className:"w-8 h-8 mx-auto mb-2 text-gray-300 dark:text-slate-600"}),n.jsx("p",{children:"No workstreams yet"}),n.jsx("p",{className:"text-xs mt-1",children:"Create one to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.map(g=>{var w;return n.jsxs(St,{onClick:()=>m(g.id),className:`flex items-start gap-2 py-2 cursor-pointer ${g.id===s?"bg-purple-50 dark:bg-purple-950/30":""}`,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:g.id===s?n.jsx($t,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"}):n.jsx(qa,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${g.id===s?"text-purple-700 dark:text-purple-400":"text-gray-900 dark:text-white"}`,children:g.name}),((w=g.projects)==null?void 0:w.length)>0&&n.jsxs("div",{className:"truncate text-xs text-gray-400 dark:text-slate-500",children:[g.projects.length," project",g.projects.length!==1?"s":""]})]}),g.rules&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-400",title:"Has rules defined"})})]},g.id)})}),n.jsx(vr,{}),n.jsxs(St,{onClick:e,className:"gap-2 cursor-pointer",children:[n.jsx(E1,{className:"w-4 h-4"}),"Manage Workstreams"]})]})]})}function YF({enabled:e=!0,pollInterval:t=3e4,onWorkstreamChange:r}){var g;const[s,o]=C.useState(null),[d,u]=C.useState(!1),[l,c]=C.useState([]),f=C.useCallback(async()=>{var w;if(e)try{const k=await Se.getSmartSyncStatus();if(!k.enabled||!((w=k.recentProjects)!=null&&w.length))return;c(k.recentProjects);const _=await Se.smartSyncCheckNudge(k.recentProjects);if(_&&_.type){if(_.autoSwitch&&_.type==="switch"){await Se.setActiveWorkstream(_.workstream.id),r==null||r(_.workstream),Z.success(`Auto-switched to "${_.workstream.name}"`,{description:`${_.confidence}% activity match`,duration:3e3});return}o(_)}}catch(k){console.debug("Smart sync check failed:",k.message)}},[e,r]);C.useEffect(()=>{if(!e)return;const w=setTimeout(f,5e3),k=setInterval(f,t);return()=>{clearTimeout(w),clearInterval(k)}},[e,t,f]);const m=async w=>{var k;if(s){u(!0);try{const _={workstreamId:(k=s.workstream)==null?void 0:k.id,projectPath:s.projectPath,projects:l};switch(await Se.smartSyncHandleAction(s.key,w,_),w){case"switch":Z.success(`Switched to "${s.workstream.name}"`),r==null||r(s.workstream);break;case"add":Z.success(`Added project to "${s.workstream.name}"`);break;case"always":Z.success(`Will always use "${s.workstream.name}" for these projects`),r==null||r(s.workstream);break;case"never":Z.info("Got it, won't suggest this again");break;case"dismiss":break}o(null)}catch{Z.error("Failed to process action")}finally{u(!1)}}},h=()=>{m("dismiss")};return s?n.jsx(lp,{children:n.jsx(Di.div,{initial:{opacity:0,y:50,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},className:"fixed bottom-6 right-6 z-50 max-w-sm",children:n.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-xl shadow-2xl border border-purple-200 dark:border-purple-800 overflow-hidden",children:[n.jsxs("div",{className:"bg-gradient-to-r from-purple-500 to-indigo-500 px-4 py-2 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 text-white",children:[n.jsx(Ut,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Smart Sync"}),s.confidence&&n.jsxs("span",{className:"text-xs bg-white/20 px-1.5 py-0.5 rounded",children:[s.confidence,"% match"]})]}),n.jsx("button",{onClick:h,className:"text-white/80 hover:text-white transition-colors",children:n.jsx(ri,{className:"w-4 h-4"})})]}),n.jsxs("div",{className:"p-4",children:[n.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${s.type==="switch"?"bg-purple-100 dark:bg-purple-900/50":"bg-blue-100 dark:bg-blue-900/50"}`,children:s.type==="switch"?n.jsx(Ku,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}):n.jsx(ti,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm text-gray-900 dark:text-white font-medium",children:s.message}),s.workstream&&n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[((g=s.workstream.projects)==null?void 0:g.length)||0," projects in workstream"]})]})]}),n.jsx("div",{className:"flex items-center gap-2",children:s.type==="switch"?n.jsxs(n.Fragment,{children:[n.jsxs(ce,{size:"sm",onClick:()=>m("switch"),disabled:d,className:"bg-purple-600 hover:bg-purple-700 flex-1",children:[n.jsx($t,{className:"w-4 h-4 mr-1"}),"Yes"]}),n.jsx(ce,{size:"sm",variant:"outline",onClick:()=>m("dismiss"),disabled:d,className:"flex-1",children:"No"}),n.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>m("always"),disabled:d,title:"Always switch to this workstream for these projects",className:"text-purple-600 dark:text-purple-400",children:n.jsx(Xu,{className:"w-4 h-4"})})]}):n.jsxs(n.Fragment,{children:[n.jsxs(ce,{size:"sm",onClick:()=>m("add"),disabled:d,className:"bg-blue-600 hover:bg-blue-700 flex-1",children:[n.jsx($t,{className:"w-4 h-4 mr-1"}),"Add"]}),n.jsx(ce,{size:"sm",variant:"outline",onClick:()=>m("dismiss"),disabled:d,className:"flex-1",children:"No"}),n.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>m("never"),disabled:d,title:"Never suggest adding this project",className:"text-gray-500",children:n.jsx(au,{className:"w-4 h-4"})})]})})]})]})})}):null}const qf="claude-config-welcome-seen";function XF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(qf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const d=()=>{s&&localStorage.setItem(qf,"true"),r(!1)},u=()=>{s&&localStorage.setItem(qf,"true"),r(!1),e==null||e()};return n.jsx(zt,{open:t,onOpenChange:r,children:n.jsxs(Dt,{className:"sm:max-w-lg",children:[n.jsxs(Lt,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(Dn,{className:"w-6 h-6 text-white"})}),n.jsx(It,{className:"text-2xl",children:"Welcome to Claude Config"})]}),n.jsx(ur,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Claude Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(es,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ui,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ut,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(kl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Yt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(Gt,{className:"flex gap-2 sm:gap-2",children:[n.jsx(ce,{variant:"ghost",onClick:d,children:"Skip for now"}),n.jsxs(ce,{onClick:u,className:"gap-2",children:[n.jsx(_u,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Ku,{className:"w-4 h-4"})]})]})]})})}const Yf="claude-config:claude-init-preference";function Rj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[d,u]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,g]=C.useState(!0);C.useEffect(()=>{const x=localStorage.getItem(Yf);x==="never"?g(!1):x==="always"&&g(!0)},[]),C.useEffect(()=>{if(e){o(""),u("");const x=localStorage.getItem(Yf);g(x!=="never")}},[e]),C.useEffect(()=>{if(s&&!d){const x=s.split("/").pop();u(x||"")}},[s]);const w=x=>{o(x),c(!1)},k=async()=>{if(!s){Z.error("Please select a project path");return}m(!0);try{const x=await Se.addProject(s,d||void 0,h);x.error?Z.error(x.error):(x.claudeInitRan?Z.success(`Added project: ${x.project.name} (initialized with Claude Code)`):x.claudeInitError?(Z.success(`Added project: ${x.project.name}`),Z.warning("Could not run claude /init - is Claude Code installed?")):Z.success(`Added project: ${x.project.name}`),r==null||r(x.project),t(!1))}catch(x){Z.error("Failed to add project: "+x.message)}finally{m(!1)}},_=x=>{localStorage.setItem(Yf,x),x==="never"?g(!1):x==="always"&&g(!0),Z.success(`Preference saved: ${x==="always"?"Always":x==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"sm:max-w-md",children:[n.jsxs(Lt,{children:[n.jsxs(It,{className:"flex items-center gap-2",children:[n.jsx(oi,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(ur,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Yt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(dt,{id:"path",value:s,onChange:x=>o(x.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(ce,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(oi,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Yt,{htmlFor:"name",children:"Display Name"}),n.jsx(dt,{id:"name",value:d,onChange:x=>u(x.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(kl,{id:"claudeInit",checked:h,onCheckedChange:g,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Yt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ut,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(ce,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(xg,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Mj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function JF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const u=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?u.classList.add("dark"):u.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const d=u=>{r(u);try{localStorage.setItem("claude-config-theme",u)}catch{}};return n.jsx(Mj.Provider,{value:{theme:t,setTheme:d,resolvedTheme:s},children:e})}function QF(){return C.useContext(Mj)}function ZF(){const{theme:e,setTheme:t,resolvedTheme:r}=QF(),s=r==="dark"?rb:ib;return n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ss,{align:"end",children:[n.jsxs(St,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(St,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(St,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(C1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var e8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t8=e8.reduce((e,t)=>{const r=Ju(`Primitive.${t}`),s=C.forwardRef((o,d)=>{const{asChild:u,...l}=o,c=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:d})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),r8="Separator",qb="horizontal",n8=["horizontal","vertical"],Dj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,d=s8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return n.jsx(t8.div,{"data-orientation":d,...l,...o,ref:t})});Dj.displayName=r8;function s8(e){return n8.includes(e)}var Lj=Dj;const Ij=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Lj,{ref:o,decorative:r,orientation:t,className:Pe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Ij.displayName=Lj.displayName;function i8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const o8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l8={};function Yb(e,t){return(l8.jsx?a8:o8).test(e)}const c8=/[ \t\n\f\r]/g;function u8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(c8,"")===""}class Rl{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Rl.prototype.normal={};Rl.prototype.property={};Rl.prototype.space=void 0;function Oj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Rl(r,s,t)}function Gm(e){return e.toLowerCase()}class qr{constructor(t,r){this.attribute=r,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let d8=0;const ot=Ki(),rr=Ki(),Km=Ki(),je=Ki(),Nt=Ki(),Ao=Ki(),Zr=Ki();function Ki(){return 2**++d8}const qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:rr,commaOrSpaceSeparated:Zr,commaSeparated:Ao,number:je,overloadedBoolean:Km,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),Xf=Object.keys(qm);class Lg extends qr{constructor(t,r,s,o){let d=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++d<Xf.length;){const u=Xf[d];Jb(this,Xf[d],(s&qm[u])===qm[u])}}}Lg.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Yo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const d=new Lg(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(d.mustUseProperty=!0),t[s]=d,r[Gm(s)]=s,r[Gm(d.attribute)]=s}return new Rl(t,r,e.space)}const Bj=Yo({properties:{ariaActiveDescendant:null,ariaAtomic:rr,ariaAutoComplete:null,ariaBusy:rr,ariaChecked:rr,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:rr,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:rr,ariaFlowTo:Nt,ariaGrabbed:rr,ariaHasPopup:null,ariaHidden:rr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:je,ariaLive:null,ariaModal:rr,ariaMultiLine:rr,ariaMultiSelectable:rr,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:rr,ariaReadOnly:rr,ariaRelevant:null,ariaRequired:rr,ariaRoleDescription:Nt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:rr,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Fj(e,t){return t in e?e[t]:t}function $j(e,t){return Fj(e,t.toLowerCase())}const h8=Yo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ao,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Nt,autoFocus:ot,autoPlay:ot,blocking:Nt,capture:null,charSet:null,checked:ot,cite:null,className:Nt,cols:je,colSpan:null,content:null,contentEditable:rr,controls:ot,controlsList:Nt,coords:je|Ao,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Km,draggable:rr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Nt,height:je,hidden:Km,high:je,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:ot,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,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:ot,optimum:je,pattern:null,ping:Nt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Nt,required:ot,reversed:ot,rows:je,rowSpan:je,sandbox:Nt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:rr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:rr,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:rr,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:$j}),f8=Yo({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",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:Zr,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Nt,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:Ao,g2:Ao,glyphName:Ao,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zr,rev:Zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zr,requiredFeatures:Zr,requiredFonts:Zr,requiredFormats:Zr,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zr,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Fj}),zj=Yo({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()}}),Hj=Yo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$j}),Wj=Yo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m8={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"},p8=/[A-Z]/g,Qb=/-[a-z]/g,g8=/^data[-\w.:]+$/i;function v8(e,t){const r=Gm(t);let s=t,o=qr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&g8.test(t)){if(t.charAt(4)==="-"){const d=t.slice(5).replace(Qb,y8);s="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=t.slice(4);if(!Qb.test(d)){let u=d.replace(p8,x8);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=Lg}return new o(s,t)}function x8(e){return"-"+e.toLowerCase()}function y8(e){return e.charAt(1).toUpperCase()}const b8=Oj([Bj,h8,zj,Hj,Wj],"html"),Ig=Oj([Bj,f8,zj,Hj,Wj],"svg");function w8(e){return e.join(" ").trim()}var wo={},Jf,Zb;function _8(){if(Zb)return Jf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
574
|
+
}`}),children:[n.jsx(Ct,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([I,F])=>n.jsxs(Rg,{open:k[I],onOpenChange:()=>A(I),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Mg,{className:"flex items-center gap-2 flex-1 text-left",children:[k[I]?n.jsx(Nr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(tn,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Ss,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:I}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:F.command})]}),n.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(I),children:n.jsx(ts,{className:"w-4 h-4"})})]}),n.jsx(Dg,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(F,null,2)})})})]},I))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ut,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(rn,{value:v("model","name",""),onValueChange:I=>b("model","name",I),children:[n.jsx(Ur,{className:"w-48",children:n.jsx(nn,{placeholder:"Select model"})}),n.jsx(Vr,{children:zF.map(I=>n.jsx(Et,{value:I.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:I.name})})},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(wt,{checked:v("general","previewFeatures",!1),onCheckedChange:I=>b("general","previewFeatures",I)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(rn,{value:v("ui","theme","Default"),onValueChange:I=>b("ui","theme",I),children:[n.jsx(Ur,{className:"w-40",children:n.jsx(nn,{})}),n.jsx(Vr,{children:$F.map(I=>n.jsx(Et,{value:I.id,children:I.name},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(rn,{value:v("output","format","text"),onValueChange:I=>b("output","format",I),children:[n.jsx(Ur,{className:"w-40",children:n.jsx(nn,{})}),n.jsxs(Vr,{children:[n.jsx(Et,{value:"text",children:"Text"}),n.jsx(Et,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(C1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(wt,{checked:v("ui","dynamicWindowTitle",!0),onCheckedChange:I=>b("ui","dynamicWindowTitle",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(wt,{checked:v("ui","showLineNumbers",!0),onCheckedChange:I=>b("ui","showLineNumbers",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(wt,{checked:v("ui","showCitations",!1),onCheckedChange:I=>b("ui","showCitations",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(wt,{checked:v("ui","hideContextSummary",!1),onCheckedChange:I=>b("ui","hideContextSummary",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(wt,{checked:v("ui","hideFooter",!1),onCheckedChange:I=>b("ui","hideFooter",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(wt,{checked:((N=(P=o==null?void 0:o.ui)==null?void 0:P.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:I=>d(F=>{var z;return{...F,ui:{...F.ui,accessibility:{...(z=F.ui)==null?void 0:z.accessibility,screenReader:I}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Dn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(wt,{checked:v("general","vimMode",!1),onCheckedChange:I=>b("general","vimMode",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(wt,{checked:v("general","enableAutoUpdate",!0),onCheckedChange:I=>b("general","enableAutoUpdate",I)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(wt,{checked:((B=(L=o==null?void 0:o.general)==null?void 0:L.checkpointing)==null?void 0:B.enabled)??!1,onCheckedChange:I=>d(F=>{var z;return{...F,general:{...F.general,checkpointing:{...(z=F.general)==null?void 0:z.checkpointing,enabled:I}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(wt,{checked:v("general","respectGitignore",!0),onCheckedChange:I=>b("general","respectGitignore",I)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(ui,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(wt,{checked:v("privacy","usageStatisticsEnabled",!0),onCheckedChange:I=>b("privacy","usageStatisticsEnabled",I)})]})})]})]}),n.jsx(zt,{open:g.open,onOpenChange:I=>w({...g,open:I}),children:n.jsxs(Dt,{className:"bg-card",children:[n.jsxs(Lt,{children:[n.jsx(It,{children:"Add MCP Server"}),n.jsx(ur,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(dt,{value:g.name,onChange:I=>w({...g,name:I.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(vt,{value:g.json,onChange:I=>w({...g,json:I.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(ce,{onClick:j,children:[n.jsx(Ct,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},d=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),u=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return d&&!u?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Aj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[d,u]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,g]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){Z.error("Please select or enter a target path");return}o(r.path,k,d,h)};return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"max-w-md",children:[n.jsxs(Lt,{children:[n.jsxs(It,{children:[d==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(ur,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(ce,{variant:d==="copy"?"default":"outline",size:"sm",onClick:()=>u("copy"),children:[n.jsx(wu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(ce,{variant:d==="move"?"default":"outline",size:"sm",onClick:()=>u("move"),children:[n.jsx(k1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:Pe("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx($p,{className:"w-4 h-4"}):n.jsx(pr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(st,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(dt,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wt,{checked:h,onCheckedChange:g}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:w,children:d==="copy"?"Copy":"Move"})]})]})})}function UF({open:e,onClose:t,item:r,onRename:s}){const[o,d]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&d(r.name.replace(/\.md$/,""))},[r,e]);const u=()=>{if(!o.trim()){Z.error("Please enter a name");return}s(r,o.trim())};return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"sm:max-w-md",children:[n.jsx(Lt,{children:n.jsxs(It,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(dt,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>d(l.target.value),onKeyDown:l=>l.key==="Enter"&&u()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:u,children:"Rename"})]})]})})}function VF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[d,u]=C.useState("");C.useEffect(()=>{u("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!d.trim()){Z.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?d.endsWith(".md")?d:`${d}.md`:d;o(r,m,s)},c=cl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"max-w-sm",children:[n.jsx(Lt,{children:n.jsxs(It,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(dt,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:d,onChange:m=>u(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(ce,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var Ie,Me,rt;const[r,s]=C.useState([]),[o,d]=C.useState([]),[u,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[g,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[x,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[A,P]=C.useState({open:!1,item:null}),[N,L]=C.useState(!1),[B,I]=C.useState({open:!1,projectDir:null}),[F,z]=C.useState({open:!1,dir:null,name:null}),[q,U]=C.useState({open:!1,dir:null}),[Y,K]=C.useState({x:0,y:0,item:null}),[V,D]=C.useState(["claude"]),R=C.useCallback(async()=>{var Ce;try{b(!0);const[ge,De,mt,kt]=await Promise.all([Se.getClaudeFolders(),Se.getIntermediatePaths(),Se.getRegistry(),Se.getConfig()]);if(s(ge),d(De),l(mt),D(((Ce=kt.config)==null?void 0:Ce.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Fe=be.length>1?be[be.length-1]:be[0],qe=(Fe==null?void 0:Fe.dir)||ge[0].dir;w(qe);try{localStorage.setItem("claude-config-expanded-folder",qe)}catch{}}}}catch(ge){Z.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{R(),f(null),h(null)},[R,e==null?void 0:e.dir]);const O=Ce=>{const ge=g===Ce?null:Ce;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},G=async Ce=>{f(Ce);try{const ge=await Se.getClaudeFile(Ce.path);h(ge)}catch(ge){Z.error("Failed to load file: "+ge.message)}},$=async Ce=>{if(c)try{await Se.saveClaudeFile(c.path,Ce),Z.success("Saved");const ge=await Se.getClaudeFile(c.path);h(ge),R()}catch(ge){Z.error("Failed to save: "+ge.message)}},oe=Ce=>{_(ge=>({...ge,[Ce]:!ge[Ce]}))},me=(Ce,ge)=>{Ce.preventDefault(),K({x:Ce.clientX,y:Ce.clientY,item:ge})},he=async(Ce,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Ce,type:ge}):ge==="claudemd"?U({open:!0,dir:Ce}):X(Ce,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Ce,ge,De)=>{try{const mt=await Se.createClaudeFile(Ce,ge,De);if(Z.success("Created"),E({open:!1,dir:null,type:null}),await R(),mt.path){const kt={path:mt.path,name:ge,type:De==="command"?"command":De==="rule"?"rule":De==="workflow"?"workflow":"file"};f(kt),h(mt.content||"")}}catch(mt){Z.error("Failed to create: "+mt.message)}},H=async(Ce,ge)=>{try{const De=await Se.renameClaudeFile(Ce.path,ge);De.success?(Z.success("Renamed"),P({open:!1,item:null}),await R(),f({...Ce,path:De.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):Z.error(De.error||"Failed to rename")}catch(De){Z.error("Failed to rename: "+De.message)}},ae=async Ce=>{if(confirm(`Delete ${Ce.name}?`))try{await Se.deleteClaudeFile(Ce.path),Z.success("Deleted"),(c==null?void 0:c.path)===Ce.path&&(f(null),h(null)),R()}catch(ge){Z.error("Failed to delete: "+ge.message)}},ne=async(Ce,ge,De,mt)=>{try{await Se.moveClaudeItem(Ce,ge,De,mt),Z.success(De==="copy"?"Copied":"Moved"),y({open:!1,item:null}),R()}catch(kt){Z.error("Failed: "+kt.message)}},J=async Ce=>{if(Ce)try{const ge=await Se.addManualSubproject(B.projectDir,Ce);ge.success?(Z.success(`Added sub-project: ${Ce.split("/").pop()}`),I({open:!1,projectDir:null}),R()):Z.error(ge.error||"Failed to add sub-project")}catch(ge){Z.error("Failed to add sub-project: "+ge.message)}},se=async Ce=>{const ge=r.find(De=>!De.isSubproject&&!De.isHome);if(ge)try{const De=await Se.removeManualSubproject(ge.dir,Ce);De.success?(Z.success("Removed sub-project"),R()):Z.error(De.error||"Failed to remove sub-project")}catch(De){Z.error("Failed to remove sub-project: "+De.message)}},xe=async Ce=>{const ge=r.find(De=>!De.isSubproject&&!De.isHome);if(ge)try{const De=await Se.hideSubproject(ge.dir,Ce);De.success?(Z.success("Sub-project hidden"),R()):Z.error(De.error||"Failed to hide sub-project")}catch(De){Z.error("Failed to hide sub-project: "+De.message)}},Be=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Nm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(UB,{content:m.content,parsed:m.parsed,onSave:$,registry:u});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:$,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Ub,{content:m.content,onSave:$,fileType:c.type});default:return n.jsx(Ub,{content:m.content,onSave:$,fileType:"claudemd"})}};if(x)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Er,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Ce=>Ce.isSubproject),ee=(Ce,ge)=>ge===0,de=(Ce,ge)=>{const De=r.findIndex(mt=>mt.isSubproject);return!Ce.isSubproject&&(De>=0?ge===De-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[V.includes("claude")&&V.includes("antigravity")&&n.jsxs(ce,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>L(!0),title:"Sync rules between tools",children:[n.jsx(J4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(ce,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:R,children:n.jsx(Er,{className:"w-4 h-4"})})]})]}),n.jsx(Ln,{className:"flex-1",children:r.map((Ce,ge)=>n.jsx($B,{folder:Ce,isExpanded:g===Ce.dir,isHome:ee(Ce,ge),isProject:de(Ce,ge),isSubproject:Ce.isSubproject,depth:Ce.depth||0,onToggle:()=>O(Ce.dir),onCreateFile:he,onInstallPlugin:(De,mt)=>z({open:!0,dir:De,name:mt}),onSelectItem:G,selectedPath:c==null?void 0:c.path,onContextMenu:me,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:De=>I({open:!0,projectDir:De}),onRemoveSubproject:se,onHideSubproject:xe},Ce.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(wu,{className:"w-4 h-4"})}),n.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(ts,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Be()})]}),Y.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>K({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:Y.x,top:Y.y},children:[(((Ie=Y.item)==null?void 0:Ie.type)==="rule"||((Me=Y.item)==null?void 0:Me.type)==="command"||((rt=Y.item)==null?void 0:rt.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{P({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(wu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:Y.item}),K({x:0,y:0,item:null})},children:[n.jsx(k1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(Y.item),K({x:0,y:0,item:null})},children:[n.jsx(ts,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:o,onMove:ne}),n.jsx(VF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(UF,{open:A.open,onClose:()=>P({open:!1,item:null}),item:A.item,onRename:H}),n.jsx(JO,{open:N,onOpenChange:L,projectDir:e==null?void 0:e.dir,onSynced:R}),n.jsx(RB,{open:F.open,onOpenChange:Ce=>z({...F,open:Ce}),projectDir:F.dir,projectName:F.name}),n.jsx(xg,{open:B.open,onOpenChange:Ce=>I({...B,open:Ce}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:B.projectDir||"~"}),n.jsx(FB,{open:q.open,onOpenChange:Ce=>{U({...q,open:Ce}),Ce||R()},title:"Initialize CLAUDE.md",description:"Running claude /init to generate project-aware CLAUDE.md",cwd:q.dir,initialCommand:"claude /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:d=!1}){const u=(t==null?void 0:t.name)||"No Project";return n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:d,children:[n.jsx(oi,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:u}),n.jsx(Nr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ss,{align:"start",className:"w-72",children:[n.jsx(Fo,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(vr,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(pr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(St,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx($t,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(pr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Yu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(vr,{}),n.jsxs(St,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(Ct,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(St,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(E1,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function qF({onManageClick:e}){const[t,r]=C.useState([]),[s,o]=C.useState(null),[d,u]=C.useState(!0),[l,c]=C.useState(!1);C.useEffect(()=>{f()},[]);const f=async()=>{try{const g=await Se.getWorkstreams();r(g.workstreams||[]),o(g.activeId)}catch(g){console.error("Failed to load workstreams:",g)}finally{u(!1)}},m=async g=>{if(g!==s){c(!0);try{const w=await Se.setActiveWorkstream(g);w.success?(o(g),Z.success(`Switched to: ${w.workstream.name}`)):Z.error(w.error||"Failed to switch workstream")}catch{Z.error("Failed to switch workstream")}finally{c(!1)}}},h=t.find(g=>g.id===s);return!d&&t.length===0?null:n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"outline",className:"gap-2 max-w-[180px] h-9 border-purple-200 dark:border-purple-800 hover:border-purple-300 dark:hover:border-purple-700",disabled:d||l,children:[d||l?n.jsx(ut,{className:"w-4 h-4 animate-spin text-purple-500"}):n.jsx(qa,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium text-purple-700 dark:text-purple-400",children:(h==null?void 0:h.name)||"No Workstream"}),n.jsx(Nr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ss,{align:"start",className:"w-64",children:[n.jsx(Fo,{className:"text-xs text-gray-500 dark:text-slate-400 font-normal",children:"Workstreams"}),n.jsx(vr,{}),t.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 dark:text-slate-400 text-center",children:[n.jsx(qa,{className:"w-8 h-8 mx-auto mb-2 text-gray-300 dark:text-slate-600"}),n.jsx("p",{children:"No workstreams yet"}),n.jsx("p",{className:"text-xs mt-1",children:"Create one to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.map(g=>{var w;return n.jsxs(St,{onClick:()=>m(g.id),className:`flex items-start gap-2 py-2 cursor-pointer ${g.id===s?"bg-purple-50 dark:bg-purple-950/30":""}`,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:g.id===s?n.jsx($t,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"}):n.jsx(qa,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${g.id===s?"text-purple-700 dark:text-purple-400":"text-gray-900 dark:text-white"}`,children:g.name}),((w=g.projects)==null?void 0:w.length)>0&&n.jsxs("div",{className:"truncate text-xs text-gray-400 dark:text-slate-500",children:[g.projects.length," project",g.projects.length!==1?"s":""]})]}),g.rules&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-400",title:"Has rules defined"})})]},g.id)})}),n.jsx(vr,{}),n.jsxs(St,{onClick:e,className:"gap-2 cursor-pointer",children:[n.jsx(E1,{className:"w-4 h-4"}),"Manage Workstreams"]})]})]})}function YF({enabled:e=!0,pollInterval:t=3e4,onWorkstreamChange:r}){var g;const[s,o]=C.useState(null),[d,u]=C.useState(!1),[l,c]=C.useState([]),f=C.useCallback(async()=>{var w;if(e)try{const k=await Se.getSmartSyncStatus();if(!k.enabled||!((w=k.recentProjects)!=null&&w.length))return;c(k.recentProjects);const _=await Se.smartSyncCheckNudge(k.recentProjects);if(_&&_.type){if(_.autoSwitch&&_.type==="switch"){await Se.setActiveWorkstream(_.workstream.id),r==null||r(_.workstream),Z.success(`Auto-switched to "${_.workstream.name}"`,{description:`${_.confidence}% activity match`,duration:3e3});return}o(_)}}catch(k){console.debug("Smart sync check failed:",k.message)}},[e,r]);C.useEffect(()=>{if(!e)return;const w=setTimeout(f,5e3),k=setInterval(f,t);return()=>{clearTimeout(w),clearInterval(k)}},[e,t,f]);const m=async w=>{var k;if(s){u(!0);try{const _={workstreamId:(k=s.workstream)==null?void 0:k.id,projectPath:s.projectPath,projects:l};switch(await Se.smartSyncHandleAction(s.key,w,_),w){case"switch":Z.success(`Switched to "${s.workstream.name}"`),r==null||r(s.workstream);break;case"add":Z.success(`Added project to "${s.workstream.name}"`);break;case"always":Z.success(`Will always use "${s.workstream.name}" for these projects`),r==null||r(s.workstream);break;case"never":Z.info("Got it, won't suggest this again");break;case"dismiss":break}o(null)}catch{Z.error("Failed to process action")}finally{u(!1)}}},h=()=>{m("dismiss")};return s?n.jsx(lp,{children:n.jsx(Di.div,{initial:{opacity:0,y:50,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},className:"fixed bottom-6 right-6 z-50 max-w-sm",children:n.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-xl shadow-2xl border border-purple-200 dark:border-purple-800 overflow-hidden",children:[n.jsxs("div",{className:"bg-gradient-to-r from-purple-500 to-indigo-500 px-4 py-2 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 text-white",children:[n.jsx(Ut,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Smart Sync"}),s.confidence&&n.jsxs("span",{className:"text-xs bg-white/20 px-1.5 py-0.5 rounded",children:[s.confidence,"% match"]})]}),n.jsx("button",{onClick:h,className:"text-white/80 hover:text-white transition-colors",children:n.jsx(ri,{className:"w-4 h-4"})})]}),n.jsxs("div",{className:"p-4",children:[n.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${s.type==="switch"?"bg-purple-100 dark:bg-purple-900/50":"bg-blue-100 dark:bg-blue-900/50"}`,children:s.type==="switch"?n.jsx(Ku,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}):n.jsx(ti,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm text-gray-900 dark:text-white font-medium",children:s.message}),s.workstream&&n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[((g=s.workstream.projects)==null?void 0:g.length)||0," projects in workstream"]})]})]}),n.jsx("div",{className:"flex items-center gap-2",children:s.type==="switch"?n.jsxs(n.Fragment,{children:[n.jsxs(ce,{size:"sm",onClick:()=>m("switch"),disabled:d,className:"bg-purple-600 hover:bg-purple-700 flex-1",children:[n.jsx($t,{className:"w-4 h-4 mr-1"}),"Yes"]}),n.jsx(ce,{size:"sm",variant:"outline",onClick:()=>m("dismiss"),disabled:d,className:"flex-1",children:"No"}),n.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>m("always"),disabled:d,title:"Always switch to this workstream for these projects",className:"text-purple-600 dark:text-purple-400",children:n.jsx(Xu,{className:"w-4 h-4"})})]}):n.jsxs(n.Fragment,{children:[n.jsxs(ce,{size:"sm",onClick:()=>m("add"),disabled:d,className:"bg-blue-600 hover:bg-blue-700 flex-1",children:[n.jsx($t,{className:"w-4 h-4 mr-1"}),"Add"]}),n.jsx(ce,{size:"sm",variant:"outline",onClick:()=>m("dismiss"),disabled:d,className:"flex-1",children:"No"}),n.jsx(ce,{size:"sm",variant:"ghost",onClick:()=>m("never"),disabled:d,title:"Never suggest adding this project",className:"text-gray-500",children:n.jsx(au,{className:"w-4 h-4"})})]})})]})]})})}):null}const qf="claude-config-welcome-seen";function XF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(qf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const d=()=>{s&&localStorage.setItem(qf,"true"),r(!1)},u=()=>{s&&localStorage.setItem(qf,"true"),r(!1),e==null||e()};return n.jsx(zt,{open:t,onOpenChange:r,children:n.jsxs(Dt,{className:"sm:max-w-lg",children:[n.jsxs(Lt,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(Dn,{className:"w-6 h-6 text-white"})}),n.jsx(It,{className:"text-2xl",children:"Welcome to Claude Config"})]}),n.jsx(ur,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Claude Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(es,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ui,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ut,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(kl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Yt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(Gt,{className:"flex gap-2 sm:gap-2",children:[n.jsx(ce,{variant:"ghost",onClick:d,children:"Skip for now"}),n.jsxs(ce,{onClick:u,className:"gap-2",children:[n.jsx(_u,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Ku,{className:"w-4 h-4"})]})]})]})})}const Yf="claude-config:claude-init-preference";function Rj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[d,u]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,g]=C.useState(!0);C.useEffect(()=>{const x=localStorage.getItem(Yf);x==="never"?g(!1):x==="always"&&g(!0)},[]),C.useEffect(()=>{if(e){o(""),u("");const x=localStorage.getItem(Yf);g(x!=="never")}},[e]),C.useEffect(()=>{if(s&&!d){const x=s.split("/").pop();u(x||"")}},[s]);const w=x=>{o(x),c(!1)},k=async()=>{if(!s){Z.error("Please select a project path");return}m(!0);try{const x=await Se.addProject(s,d||void 0,h);x.error?Z.error(x.error):(x.claudeInitRan?Z.success(`Added project: ${x.project.name} (initialized with Claude Code)`):x.claudeInitError?(Z.success(`Added project: ${x.project.name}`),Z.warning("Could not run claude /init - is Claude Code installed?")):Z.success(`Added project: ${x.project.name}`),r==null||r(x.project),t(!1))}catch(x){Z.error("Failed to add project: "+x.message)}finally{m(!1)}},_=x=>{localStorage.setItem(Yf,x),x==="never"?g(!1):x==="always"&&g(!0),Z.success(`Preference saved: ${x==="always"?"Always":x==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(zt,{open:e,onOpenChange:t,children:n.jsxs(Dt,{className:"sm:max-w-md",children:[n.jsxs(Lt,{children:[n.jsxs(It,{className:"flex items-center gap-2",children:[n.jsx(oi,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(ur,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Yt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(dt,{id:"path",value:s,onChange:x=>o(x.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(ce,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(oi,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Yt,{htmlFor:"name",children:"Display Name"}),n.jsx(dt,{id:"name",value:d,onChange:x=>u(x.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(kl,{id:"claudeInit",checked:h,onCheckedChange:g,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Yt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ut,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(ce,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(Gt,{children:[n.jsx(ce,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(ce,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(xg,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Mj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function JF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const u=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?u.classList.add("dark"):u.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const d=u=>{r(u);try{localStorage.setItem("claude-config-theme",u)}catch{}};return n.jsx(Mj.Provider,{value:{theme:t,setTheme:d,resolvedTheme:s},children:e})}function QF(){return C.useContext(Mj)}function ZF(){const{theme:e,setTheme:t,resolvedTheme:r}=QF(),s=r==="dark"?rb:ib;return n.jsxs(js,{children:[n.jsx(Ns,{asChild:!0,children:n.jsxs(ce,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ss,{align:"end",children:[n.jsxs(St,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(St,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(St,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(C1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var e8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t8=e8.reduce((e,t)=>{const r=Ju(`Primitive.${t}`),s=C.forwardRef((o,d)=>{const{asChild:u,...l}=o,c=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:d})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),r8="Separator",qb="horizontal",n8=["horizontal","vertical"],Dj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,d=s8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return n.jsx(t8.div,{"data-orientation":d,...l,...o,ref:t})});Dj.displayName=r8;function s8(e){return n8.includes(e)}var Lj=Dj;const Ij=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Lj,{ref:o,decorative:r,orientation:t,className:Pe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Ij.displayName=Lj.displayName;function i8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const o8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l8={};function Yb(e,t){return(l8.jsx?a8:o8).test(e)}const c8=/[ \t\n\f\r]/g;function u8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(c8,"")===""}class Rl{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Rl.prototype.normal={};Rl.prototype.property={};Rl.prototype.space=void 0;function Oj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Rl(r,s,t)}function Gm(e){return e.toLowerCase()}class qr{constructor(t,r){this.attribute=r,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let d8=0;const ot=Ki(),rr=Ki(),Km=Ki(),je=Ki(),Nt=Ki(),Ao=Ki(),Zr=Ki();function Ki(){return 2**++d8}const qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:rr,commaOrSpaceSeparated:Zr,commaSeparated:Ao,number:je,overloadedBoolean:Km,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),Xf=Object.keys(qm);class Lg extends qr{constructor(t,r,s,o){let d=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++d<Xf.length;){const u=Xf[d];Jb(this,Xf[d],(s&qm[u])===qm[u])}}}Lg.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Yo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const d=new Lg(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(d.mustUseProperty=!0),t[s]=d,r[Gm(s)]=s,r[Gm(d.attribute)]=s}return new Rl(t,r,e.space)}const Bj=Yo({properties:{ariaActiveDescendant:null,ariaAtomic:rr,ariaAutoComplete:null,ariaBusy:rr,ariaChecked:rr,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:rr,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:rr,ariaFlowTo:Nt,ariaGrabbed:rr,ariaHasPopup:null,ariaHidden:rr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:je,ariaLive:null,ariaModal:rr,ariaMultiLine:rr,ariaMultiSelectable:rr,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:rr,ariaReadOnly:rr,ariaRelevant:null,ariaRequired:rr,ariaRoleDescription:Nt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:rr,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Fj(e,t){return t in e?e[t]:t}function $j(e,t){return Fj(e,t.toLowerCase())}const h8=Yo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ao,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Nt,autoFocus:ot,autoPlay:ot,blocking:Nt,capture:null,charSet:null,checked:ot,cite:null,className:Nt,cols:je,colSpan:null,content:null,contentEditable:rr,controls:ot,controlsList:Nt,coords:je|Ao,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Km,draggable:rr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Nt,height:je,hidden:Km,high:je,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:ot,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,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:ot,optimum:je,pattern:null,ping:Nt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Nt,required:ot,reversed:ot,rows:je,rowSpan:je,sandbox:Nt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:rr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:rr,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:rr,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:$j}),f8=Yo({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",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:Zr,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Nt,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:Ao,g2:Ao,glyphName:Ao,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zr,rev:Zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zr,requiredFeatures:Zr,requiredFonts:Zr,requiredFormats:Zr,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zr,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Fj}),zj=Yo({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()}}),Hj=Yo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$j}),Wj=Yo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m8={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"},p8=/[A-Z]/g,Qb=/-[a-z]/g,g8=/^data[-\w.:]+$/i;function v8(e,t){const r=Gm(t);let s=t,o=qr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&g8.test(t)){if(t.charAt(4)==="-"){const d=t.slice(5).replace(Qb,y8);s="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=t.slice(4);if(!Qb.test(d)){let u=d.replace(p8,x8);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=Lg}return new o(s,t)}function x8(e){return"-"+e.toLowerCase()}function y8(e){return e.charAt(1).toUpperCase()}const b8=Oj([Bj,h8,zj,Hj,Wj],"html"),Ig=Oj([Bj,f8,zj,Hj,Wj],"svg");function w8(e){return e.join(" ").trim()}var wo={},Jf,Zb;function _8(){if(Zb)return Jf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
575
575
|
`,f="/",m="*",h="",g="comment",w="declaration";function k(x,b){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];b=b||{};var v=1,y=1;function j(q){var U=q.match(t);U&&(v+=U.length);var Y=q.lastIndexOf(c);y=~Y?q.length-Y:y+q.length}function E(){var q={line:v,column:y};return function(U){return U.position=new A(q),L(),U}}function A(q){this.start=q,this.end={line:v,column:y},this.source=b.source}A.prototype.content=x;function P(q){var U=new Error(b.source+":"+v+":"+y+": "+q);if(U.reason=q,U.filename=b.source,U.line=v,U.column=y,U.source=x,!b.silent)throw U}function N(q){var U=q.exec(x);if(U){var Y=U[0];return j(Y),x=x.slice(Y.length),U}}function L(){N(r)}function B(q){var U;for(q=q||[];U=I();)U!==!1&&q.push(U);return q}function I(){var q=E();if(!(f!=x.charAt(0)||m!=x.charAt(1))){for(var U=2;h!=x.charAt(U)&&(m!=x.charAt(U)||f!=x.charAt(U+1));)++U;if(U+=2,h===x.charAt(U-1))return P("End of comment missing");var Y=x.slice(2,U-2);return y+=2,j(Y),x=x.slice(U),y+=2,q({type:g,comment:Y})}}function F(){var q=E(),U=N(s);if(U){if(I(),!N(o))return P("property missing ':'");var Y=N(d),K=q({type:w,property:_(U[0].replace(e,h)),value:Y?_(Y[0].replace(e,h)):h});return N(u),K}}function z(){var q=[];B(q);for(var U;U=F();)U!==!1&&(q.push(U),B(q));return q}return L(),z()}function _(x){return x?x.replace(l,h):h}return Jf=k,Jf}var ew;function S8(){if(ew)return wo;ew=1;var e=wo&&wo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(wo,"__esModule",{value:!0}),wo.default=r;const t=e(_8());function r(s,o){let d=null;if(!s||typeof s!="string")return d;const u=(0,t.default)(s),l=typeof o=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:m}=c;l?o(f,m,c):m&&(d=d||{},d[f]=m)}),d}return wo}var Da={},tw;function C8(){if(tw)return Da;tw=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,d=function(f){return!f||r.test(f)||e.test(f)},u=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},c=function(f,m){return m===void 0&&(m={}),d(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,l):f=f.replace(s,l),f.replace(t,u))};return Da.camelCase=c,Da}var La,rw;function k8(){if(rw)return La;rw=1;var e=La&&La.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(S8()),r=C8();function s(o,d){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(l,c){l&&c&&(u[(0,r.camelCase)(l,d)]=c)}),u}return s.default=s,La=s,La}var j8=k8();const N8=fl(j8),Uj=Vj("end"),Og=Vj("start");function Vj(e){return t;function t(r){const 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 E8(e){const t=Og(e),r=Uj(e);if(t&&r)return{start:t,end:r}}function Ya(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nw(e.position):"start"in e||"end"in e?nw(e):"line"in e||"column"in e?Ym(e):""}function Ym(e){return sw(e&&e.line)+":"+sw(e&&e.column)}function nw(e){return Ym(e&&e.start)+"-"+Ym(e&&e.end)}function sw(e){return e&&typeof e=="number"?e:1}class Pr extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",d={},u=!1;if(r&&("line"in r&&"column"in r?d={place:r}:"start"in r&&"end"in r?d={place:r}:"type"in r?d={ancestors:[r],place:r.position}:d={...r}),typeof t=="string"?o=t:!d.cause&&t&&(u=!0,o=t.message,d.cause=t),!d.ruleId&&!d.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?d.ruleId=s:(d.source=s.slice(0,c),d.ruleId=s.slice(c+1))}if(!d.place&&d.ancestors&&d.ancestors){const c=d.ancestors[d.ancestors.length-1];c&&(d.place=c.position)}const l=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=Ya(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=u&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pr.prototype.file="";Pr.prototype.name="";Pr.prototype.reason="";Pr.prototype.message="";Pr.prototype.stack="";Pr.prototype.column=void 0;Pr.prototype.line=void 0;Pr.prototype.ancestors=void 0;Pr.prototype.cause=void 0;Pr.prototype.fatal=void 0;Pr.prototype.place=void 0;Pr.prototype.ruleId=void 0;Pr.prototype.source=void 0;const Bg={}.hasOwnProperty,P8=new Map,A8=/[A-Z]/g,T8=new Set(["table","tbody","thead","tfoot","tr"]),R8=new Set(["td","th"]),Gj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=z8(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=$8(r,t.jsx,t.jsxs)}const 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"?Ig:b8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},d=Kj(o,e,void 0);return d&&typeof d!="string"?d:o.create(e,o.Fragment,{children:d||void 0},void 0)}function Kj(e,t,r){if(t.type==="element")return D8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return L8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return O8(e,t,r);if(t.type==="mdxjsEsm")return I8(e,t);if(t.type==="root")return B8(e,t,r);if(t.type==="text")return F8(e,t)}function D8(e,t,r){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Ig,e.schema=o),e.ancestors.push(t);const d=Yj(e,t.tagName,!1),u=H8(e,t);let l=$g(e,t);return T8.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!u8(c):!0})),qj(e,u,d,t),Fg(u,l),e.ancestors.pop(),e.schema=s,e.create(t,d,u,r)}function L8(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}hl(e,t.position)}function I8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hl(e,t.position)}function O8(e,t,r){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=Ig,e.schema=o),e.ancestors.push(t);const d=t.name===null?e.Fragment:Yj(e,t.name,!0),u=W8(e,t),l=$g(e,t);return qj(e,u,d,t),Fg(u,l),e.ancestors.pop(),e.schema=s,e.create(t,d,u,r)}function B8(e,t,r){const s={};return Fg(s,$g(e,t)),e.create(t,e.Fragment,s,r)}function F8(e,t){return t.value}function qj(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function Fg(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function $8(e,t,r){return s;function s(o,d,u,l){const f=Array.isArray(u.children)?r:t;return l?f(d,u,l):f(d,u)}}function z8(e,t){return r;function r(s,o,d,u){const l=Array.isArray(d.children),c=Og(s);return t(o,d,u,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function H8(e,t){const r={};let s,o;for(o in t.properties)if(o!=="children"&&Bg.call(t.properties,o)){const d=U8(e,o,t.properties[o]);if(d){const[u,l]=d;e.tableCellAlignToStyle&&u==="align"&&typeof l=="string"&&R8.has(t.tagName)?s=l:r[u]=l}}if(s){const d=r.style||(r.style={});d[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function W8(e,t){const r={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const d=s.data.estree.body[0];d.type;const u=d.expression;u.type;const l=u.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else hl(e,t.position);else{const o=s.name;let d;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,d=e.evaluater.evaluateExpression(l.expression)}else hl(e,t.position);else d=s.value===null?!0:s.value;r[o]=d}return r}function $g(e,t){const r=[];let s=-1;const o=e.passKeys?new Map:P8;for(;++s<t.children.length;){const d=t.children[s];let u;if(e.passKeys){const c=d.type==="element"?d.tagName:d.type==="mdxJsxFlowElement"||d.type==="mdxJsxTextElement"?d.name:void 0;if(c){const f=o.get(c)||0;u=c+"-"+f,o.set(c,f+1)}}const l=Kj(e,d,u);l!==void 0&&r.push(l)}return r}function U8(e,t,r){const s=v8(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?i8(r):w8(r)),s.property==="style"){let o=typeof r=="object"?r:V8(e,String(r));return e.stylePropertyNameCase==="css"&&(o=G8(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?m8[s.property]||s.property:s.attribute,r]}}function V8(e,t){try{return N8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,o=new Pr("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=Gj+"#cannot-parse-style-attribute",o}}function Yj(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let d=-1,u;for(;++d<o.length;){const l=Yb(o[d])?{type:"Identifier",name:o[d]}:{type:"Literal",value:o[d]};u=u?{type:"MemberExpression",object:u,property:l,computed:!!(d&&l.type==="Literal"),optional:!1}:l}s=u}else s=Yb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return Bg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);hl(e)}function hl(e,t){const r=new Pr("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=Gj+"#cannot-handle-mdx-estrees-without-createevaluater",r}function G8(e){const t={};let r;for(r in e)Bg.call(e,r)&&(t[K8(r)]=e[r]);return t}function K8(e){let t=e.replace(A8,q8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function q8(e){return"-"+e.toLowerCase()}const Qf={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"]},Y8={};function X8(e,t){const r=Y8,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Xj(e,s,o)}function Xj(e,t,r){if(J8(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 iw(e.children,t,r)}return Array.isArray(e)?iw(e,t,r):""}function iw(e,t,r){const s=[];let o=-1;for(;++o<e.length;)s[o]=Xj(e[o],t,r);return s.join("")}function J8(e){return!!(e&&typeof e=="object")}const ow=document.createElement("i");function zg(e){const t="&"+e+";";ow.innerHTML=t;const r=ow.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function is(e,t,r,s){const o=e.length;let d=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)u=Array.from(s),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);d<s.length;)u=s.slice(d,d+1e4),u.unshift(t,0),e.splice(...u),d+=1e4,t+=1e4}function bn(e,t){return e.length>0?(is(e,e.length,0,t),e):t}const aw={}.hasOwnProperty;function Q8(e){const t={};let r=-1;for(;++r<e.length;)Z8(t,e[r]);return t}function Z8(e,t){let r;for(r in t){const o=(aw.call(e,r)?e[r]:void 0)||(e[r]={}),d=t[r];let u;if(d)for(u in d){aw.call(o,u)||(o[u]=[]);const l=d[u];e7(o[u],Array.isArray(l)?l:l?[l]:[])}}}function e7(e,t){let r=-1;const s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);is(e,0,0,s)}function Jj(e,t){const 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?"�":String.fromCodePoint(r)}function To(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kn=fi(/[A-Za-z]/),sn=fi(/[\dA-Za-z]/),t7=fi(/[#-'*+\--9=?A-Z^-~]/);function Xm(e){return e!==null&&(e<32||e===127)}const Jm=fi(/\d/),r7=fi(/[\dA-Fa-f]/),n7=fi(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function Gr(e){return e!==null&&(e<0||e===32)}function xt(e){return e===-2||e===-1||e===32}const s7=fi(new RegExp("\\p{P}|\\p{S}","u")),i7=fi(/\s/);function fi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Xo(e){const t=[];let r=-1,s=0,o=0;for(;++r<e.length;){const d=e.charCodeAt(r);let u="";if(d===37&&sn(e.charCodeAt(r+1))&&sn(e.charCodeAt(r+2)))o=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(u=String.fromCharCode(d));else if(d>55295&&d<57344){const l=e.charCodeAt(r+1);d<56320&&l>56319&&l<57344?(u=String.fromCharCode(d,l),o=1):u="�"}else u=String.fromCharCode(d);u&&(t.push(e.slice(s,r),encodeURIComponent(u)),s=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function Pt(e,t,r,s){const o=s?s-1:Number.POSITIVE_INFINITY;let d=0;return u;function u(c){return xt(c)?(e.enter(r),l(c)):t(c)}function l(c){return xt(c)&&d++<o?(e.consume(c),l):(e.exit(r),t(c))}}const o7={tokenize:a7};function a7(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let r;return t;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),d(l)}function d(l){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,u(l)}function u(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return tt(l)?(e.consume(l),e.exit("chunkText"),d):(e.consume(l),u)}}const l7={tokenize:c7},lw={tokenize:u7};function c7(e){const t=this,r=[];let s=0,o,d,u;return l;function l(y){if(s<r.length){const j=r[s];return t.containerState=j[1],e.attempt(j[0].continuation,c,f)(y)}return f(y)}function c(y){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&v();const j=t.events.length;let E=j,A;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){A=t.events[E][1].end;break}b(s);let P=j;for(;P<t.events.length;)t.events[P][1].end={...A},P++;return is(t.events,E+1,0,t.events.slice(j)),t.events.length=P,f(y)}return l(y)}function f(y){if(s===r.length){if(!o)return g(y);if(o.currentConstruct&&o.currentConstruct.concrete)return k(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lw,m,h)(y)}function m(y){return o&&v(),b(s),g(y)}function h(y){return t.parser.lazy[t.now().line]=s!==r.length,u=t.now().offset,k(y)}function g(y){return t.containerState={},e.attempt(lw,w,k)(y)}function w(y){return s++,r.push([t.currentConstruct,t.containerState]),g(y)}function k(y){if(y===null){o&&v(),b(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:d}),_(y)}function _(y){if(y===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(y);return}return tt(y)?(e.consume(y),x(e.exit("chunkFlow")),s=0,t.interrupt=void 0,l):(e.consume(y),_)}function x(y,j){const E=t.sliceStream(y);if(j&&E.push(null),y.previous=d,d&&(d.next=y),d=y,o.defineSkip(y.start),o.write(E),t.parser.lazy[y.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<u&&(!o.events[A][1].end||o.events[A][1].end.offset>u))return;const P=t.events.length;let N=P,L,B;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(L){B=t.events[N][1].end;break}L=!0}for(b(s),A=P;A<t.events.length;)t.events[A][1].end={...B},A++;is(t.events,N+1,0,t.events.slice(P)),t.events.length=A}}function b(y){let j=r.length;for(;j-- >y;){const E=r[j];t.containerState=E[1],E[0].exit.call(t,e)}r.length=y}function v(){o.write([null]),d=void 0,o=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,r){return Pt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cw(e){if(e===null||Gr(e)||i7(e))return 1;if(s7(e))return 2}function Hg(e,t,r){const s=[];let o=-1;for(;++o<e.length;){const d=e[o].resolveAll;d&&!s.includes(d)&&(t=d(t,r),s.push(d))}return t}const Qm={name:"attention",resolveAll:d7,tokenize:h7};function d7(e,t){let r=-1,s,o,d,u,l,c,f,m;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;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const h={...e[s][1].end},g={...e[r][1].start};uw(h,-c),uw(g,c),u={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[s][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:g},d={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:c>1?"strong":"emphasis",start:{...u.start},end:{...l.end}},e[s][1].end={...u.start},e[r][1].start={...l.end},f=[],e[s][1].end.offset-e[s][1].start.offset&&(f=bn(f,[["enter",e[s][1],t],["exit",e[s][1],t]])),f=bn(f,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",d,t]]),f=bn(f,Hg(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),f=bn(f,[["exit",d,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,f=bn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,is(e,s-1,r-s+3,f),r=s+f.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function h7(e,t){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=cw(s);let d;return u;function u(c){return d=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===d)return e.consume(c),l;const f=e.exit("attentionSequence"),m=cw(c),h=!m||m===2&&o||r.includes(c),g=!o||o===2&&m||r.includes(s);return f._open=!!(d===42?h:h&&(o||!g)),f._close=!!(d===42?g:g&&(m||!h)),t(c)}}function uw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const f7={name:"autolink",tokenize:m7};function m7(e,t,r){let s=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),d}function d(w){return Kn(w)?(e.consume(w),u):w===64?r(w):f(w)}function u(w){return w===43||w===45||w===46||sn(w)?(s=1,l(w)):f(w)}function l(w){return w===58?(e.consume(w),s=0,c):(w===43||w===45||w===46||sn(w))&&s++<32?(e.consume(w),l):(s=0,f(w))}function c(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||Xm(w)?r(w):(e.consume(w),c)}function f(w){return w===64?(e.consume(w),m):t7(w)?(e.consume(w),f):r(w)}function m(w){return sn(w)?h(w):r(w)}function h(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):g(w)}function g(w){if((w===45||sn(w))&&s++<63){const k=w===45?g:h;return e.consume(w),k}return r(w)}}const Pd={partial:!0,tokenize:p7};function p7(e,t,r){return s;function s(d){return xt(d)?Pt(e,o,"linePrefix")(d):o(d)}function o(d){return d===null||tt(d)?t(d):r(d)}}const Qj={continuation:{tokenize:v7},exit:x7,name:"blockQuote",tokenize:g7};function g7(e,t,r){const s=this;return o;function o(u){if(u===62){const l=s.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),d}return r(u)}function d(u){return xt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function v7(e,t,r){const s=this;return o;function o(u){return xt(u)?Pt(e,d,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):d(u)}function d(u){return e.attempt(Qj,t,r)(u)}}function x7(e){e.exit("blockQuote")}const Zj={name:"characterEscape",tokenize:y7};function y7(e,t,r){return s;function s(d){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(d),e.exit("escapeMarker"),o}function o(d){return n7(d)?(e.enter("characterEscapeValue"),e.consume(d),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(d)}}const e2={name:"characterReference",tokenize:b7};function b7(e,t,r){const s=this;let o=0,d,u;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),d=31,u=sn,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),d=6,u=r7,m):(e.enter("characterReferenceValue"),d=7,u=Jm,m(h))}function m(h){if(h===59&&o){const g=e.exit("characterReferenceValue");return u===sn&&!zg(s.sliceSerialize(g))?r(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(h)&&o++<d?(e.consume(h),m):r(h)}}const dw={partial:!0,tokenize:_7},hw={concrete:!0,name:"codeFenced",tokenize:w7};function w7(e,t,r){const s=this,o={partial:!0,tokenize:E};let d=0,u=0,l;return c;function c(A){return f(A)}function f(A){const P=s.events[s.events.length-1];return d=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,l=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===l?(u++,e.consume(A),m):u<3?r(A):(e.exit("codeFencedFenceSequence"),xt(A)?Pt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||tt(A)?(e.exit("codeFencedFence"),s.interrupt?t(A):e.check(dw,_,j)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):xt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,w,"whitespace")(A)):A===96&&A===l?r(A):(e.consume(A),g)}function w(A){return A===null||tt(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(A))}function k(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===l?r(A):(e.consume(A),k)}function _(A){return e.attempt(o,j,x)(A)}function x(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),b}function b(A){return d>0&&xt(A)?Pt(e,v,"linePrefix",d+1)(A):v(A)}function v(A){return A===null||tt(A)?e.check(dw,_,j)(A):(e.enter("codeFlowValue"),y(A))}function y(A){return A===null||tt(A)?(e.exit("codeFlowValue"),v(A)):(e.consume(A),y)}function j(A){return e.exit("codeFenced"),t(A)}function E(A,P,N){let L=0;return B;function B(U){return A.enter("lineEnding"),A.consume(U),A.exit("lineEnding"),I}function I(U){return A.enter("codeFencedFence"),xt(U)?Pt(A,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===l?(A.enter("codeFencedFenceSequence"),z(U)):N(U)}function z(U){return U===l?(L++,A.consume(U),z):L>=u?(A.exit("codeFencedFenceSequence"),xt(U)?Pt(A,q,"whitespace")(U):q(U)):N(U)}function q(U){return U===null||tt(U)?(A.exit("codeFencedFence"),P(U)):N(U)}}}function _7(e,t,r){const s=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d)}function d(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}const Zf={name:"codeIndented",tokenize:C7},S7={partial:!0,tokenize:k7};function C7(e,t,r){const s=this;return o;function o(f){return e.enter("codeIndented"),Pt(e,d,"linePrefix",5)(f)}function d(f){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(f):r(f)}function u(f){return f===null?c(f):tt(f)?e.attempt(S7,u,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||tt(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function k7(e,t,r){const s=this;return o;function o(u){return s.parser.lazy[s.now().line]?r(u):tt(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Pt(e,d,"linePrefix",5)(u)}function d(u){const l=s.events[s.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):tt(u)?o(u):r(u)}}const j7={name:"codeText",previous:E7,resolve:N7,tokenize:P7};function N7(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 E7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function P7(e,t,r){let s=0,o,d;return u;function u(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),s++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?r(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(d=e.enter("codeTextSequence"),o=0,m(h)):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||tt(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),o++,m):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(d.type="codeTextData",f(h))}}class A7{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){const 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){const o=r||0;this.setCursor(Math.trunc(t));const d=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&Ia(this.left,s),d.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),Ia(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ia(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){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Ia(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ia(this.left,r.reverse())}}}function Ia(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 t2(e){const t={};let r=-1,s,o,d,u,l,c,f;const m=new A7(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,d=0,d<c.length&&c[d][1].type==="lineEndingBlank"&&(d+=2),d<c.length&&c[d][1].type==="content"))for(;++d<c.length&&c[d][1].type!=="content";)c[d][1].type==="chunkText"&&(c[d][1]._isInFirstContentOfListItem=!0,d++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,T7(m,r)),r=t[r],f=!0);else if(s[1]._container){for(d=r,o=void 0;d--;)if(u=m.get(d),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=d);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(s[1].end={...m.get(o)[1].start},l=m.slice(o,r),l.unshift(s),m.splice(o,r-o+1,l))}}return is(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function T7(e,t){const r=e.get(t)[1],s=e.get(t)[2];let o=t-1;const d=[];let u=r._tokenizer;u||(u=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const l=u.events,c=[],f={};let m,h,g=-1,w=r,k=0,_=0;const x=[_];for(;w;){for(;e.get(++o)[1]!==w;);d.push(o),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),h&&u.defineSkip(w.start),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=r;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(_=g+1,x.push(_),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(u.events=[],w?(w._tokenizer=void 0,w.previous=void 0):x.pop(),g=x.length;g--;){const b=l.slice(x[g],x[g+1]),v=d.pop();c.push([v,v+b.length-1]),e.splice(v,2,b)}for(c.reverse(),g=-1;++g<c.length;)f[k+c[g][0]]=k+c[g][1],k+=c[g][1]-c[g][0]-1;return f}const R7={resolve:D7,tokenize:L7},M7={partial:!0,tokenize:I7};function D7(e){return t2(e),e}function L7(e,t){let r;return s;function s(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?d(l):tt(l)?e.check(M7,u,d)(l):(e.consume(l),o)}function d(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function u(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function I7(e,t,r){const s=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pt(e,d,"linePrefix")}function d(u){if(u===null||tt(u))return r(u);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):e.interrupt(s.parser.constructs.flow,r,t)(u)}}function r2(e,t,r,s,o,d,u,l,c){const f=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(b){return b===60?(e.enter(s),e.enter(o),e.enter(d),e.consume(b),e.exit(d),g):b===null||b===32||b===41||Xm(b)?r(b):(e.enter(s),e.enter(u),e.enter(l),e.enter("chunkString",{contentType:"string"}),_(b))}function g(b){return b===62?(e.enter(d),e.consume(b),e.exit(d),e.exit(o),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),w(b))}function w(b){return b===62?(e.exit("chunkString"),e.exit(l),g(b)):b===null||b===60||tt(b)?r(b):(e.consume(b),b===92?k:w)}function k(b){return b===60||b===62||b===92?(e.consume(b),w):w(b)}function _(b){return!m&&(b===null||b===41||Gr(b))?(e.exit("chunkString"),e.exit(l),e.exit(u),e.exit(s),t(b)):m<f&&b===40?(e.consume(b),m++,_):b===41?(e.consume(b),m--,_):b===null||b===32||b===40||Xm(b)?r(b):(e.consume(b),b===92?x:_)}function x(b){return b===40||b===41||b===92?(e.consume(b),_):_(b)}}function n2(e,t,r,s,o,d){const u=this;let l=0,c;return f;function f(w){return e.enter(s),e.enter(o),e.consume(w),e.exit(o),e.enter(d),m}function m(w){return l>999||w===null||w===91||w===93&&!c||w===94&&!l&&"_hiddenFootnoteSupport"in u.parser.constructs?r(w):w===93?(e.exit(d),e.enter(o),e.consume(w),e.exit(o),e.exit(s),t):tt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||tt(w)||l++>999?(e.exit("chunkString"),m(w)):(e.consume(w),c||(c=!xt(w)),w===92?g:h)}function g(w){return w===91||w===92||w===93?(e.consume(w),l++,h):h(w)}}function s2(e,t,r,s,o,d){let u;return l;function l(g){return g===34||g===39||g===40?(e.enter(s),e.enter(o),e.consume(g),e.exit(o),u=g===40?41:g,c):r(g)}function c(g){return g===u?(e.enter(o),e.consume(g),e.exit(o),e.exit(s),t):(e.enter(d),f(g))}function f(g){return g===u?(e.exit(d),c(u)):g===null?r(g):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Pt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===u||g===null||tt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?h:m)}function h(g){return g===u||g===92?(e.consume(g),m):m(g)}}function Xa(e,t){let r;return s;function s(o){return tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):xt(o)?Pt(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}const O7={name:"definition",tokenize:F7},B7={partial:!0,tokenize:$7};function F7(e,t,r){const s=this;let o;return d;function d(w){return e.enter("definition"),u(w)}function u(w){return n2.call(s,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function l(w){return o=To(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),c):r(w)}function c(w){return Gr(w)?Xa(e,f)(w):f(w)}function f(w){return r2(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(B7,h,h)(w)}function h(w){return xt(w)?Pt(e,g,"whitespace")(w):g(w)}function g(w){return w===null||tt(w)?(e.exit("definition"),s.parser.defined.push(o),t(w)):r(w)}}function $7(e,t,r){return s;function s(l){return Gr(l)?Xa(e,o)(l):r(l)}function o(l){return s2(e,d,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function d(l){return xt(l)?Pt(e,u,"whitespace")(l):u(l)}function u(l){return l===null||tt(l)?t(l):r(l)}}const z7={name:"hardBreakEscape",tokenize:H7};function H7(e,t,r){return s;function s(d){return e.enter("hardBreakEscape"),e.consume(d),o}function o(d){return tt(d)?(e.exit("hardBreakEscape"),t(d)):r(d)}}const W7={name:"headingAtx",resolve:U7,tokenize:V7};function U7(e,t){let r=e.length-2,s=3,o,d;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},d={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},is(e,s,r-s+1,[["enter",o,t],["enter",d,t],["exit",d,t],["exit",o,t]])),e}function V7(e,t,r){let s=0;return o;function o(m){return e.enter("atxHeading"),d(m)}function d(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&s++<6?(e.consume(m),u):m===null||Gr(m)?(e.exit("atxHeadingSequence"),l(m)):r(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||tt(m)?(e.exit("atxHeading"),t(m)):xt(m)?Pt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Gr(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const G7=["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"],fw=["pre","script","style","textarea"],K7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:J7},q7={partial:!0,tokenize:Z7},Y7={partial:!0,tokenize:Q7};function X7(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 J7(e,t,r){const s=this;let o,d,u,l,c;return f;function f($){return m($)}function m($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),h}function h($){return $===33?(e.consume($),g):$===47?(e.consume($),d=!0,_):$===63?(e.consume($),o=3,s.interrupt?t:R):Kn($)?(e.consume($),u=String.fromCharCode($),x):r($)}function g($){return $===45?(e.consume($),o=2,w):$===91?(e.consume($),o=5,l=0,k):Kn($)?(e.consume($),o=4,s.interrupt?t:R):r($)}function w($){return $===45?(e.consume($),s.interrupt?t:R):r($)}function k($){const oe="CDATA[";return $===oe.charCodeAt(l++)?(e.consume($),l===oe.length?s.interrupt?t:F:k):r($)}function _($){return Kn($)?(e.consume($),u=String.fromCharCode($),x):r($)}function x($){if($===null||$===47||$===62||Gr($)){const oe=$===47,me=u.toLowerCase();return!oe&&!d&&fw.includes(me)?(o=1,s.interrupt?t($):F($)):G7.includes(u.toLowerCase())?(o=6,oe?(e.consume($),b):s.interrupt?t($):F($)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r($):d?v($):y($))}return $===45||sn($)?(e.consume($),u+=String.fromCharCode($),x):r($)}function b($){return $===62?(e.consume($),s.interrupt?t:F):r($)}function v($){return xt($)?(e.consume($),v):B($)}function y($){return $===47?(e.consume($),B):$===58||$===95||Kn($)?(e.consume($),j):xt($)?(e.consume($),y):B($)}function j($){return $===45||$===46||$===58||$===95||sn($)?(e.consume($),j):E($)}function E($){return $===61?(e.consume($),A):xt($)?(e.consume($),E):y($)}function A($){return $===null||$===60||$===61||$===62||$===96?r($):$===34||$===39?(e.consume($),c=$,P):xt($)?(e.consume($),A):N($)}function P($){return $===c?(e.consume($),c=null,L):$===null||tt($)?r($):(e.consume($),P)}function N($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Gr($)?E($):(e.consume($),N)}function L($){return $===47||$===62||xt($)?y($):r($)}function B($){return $===62?(e.consume($),I):r($)}function I($){return $===null||tt($)?F($):xt($)?(e.consume($),I):r($)}function F($){return $===45&&o===2?(e.consume($),Y):$===60&&o===1?(e.consume($),K):$===62&&o===4?(e.consume($),O):$===63&&o===3?(e.consume($),R):$===93&&o===5?(e.consume($),D):tt($)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(q7,G,z)($)):$===null||tt($)?(e.exit("htmlFlowData"),z($)):(e.consume($),F)}function z($){return e.check(Y7,q,G)($)}function q($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),U}function U($){return $===null||tt($)?z($):(e.enter("htmlFlowData"),F($))}function Y($){return $===45?(e.consume($),R):F($)}function K($){return $===47?(e.consume($),u="",V):F($)}function V($){if($===62){const oe=u.toLowerCase();return fw.includes(oe)?(e.consume($),O):F($)}return Kn($)&&u.length<8?(e.consume($),u+=String.fromCharCode($),V):F($)}function D($){return $===93?(e.consume($),R):F($)}function R($){return $===62?(e.consume($),O):$===45&&o===2?(e.consume($),R):F($)}function O($){return $===null||tt($)?(e.exit("htmlFlowData"),G($)):(e.consume($),O)}function G($){return e.exit("htmlFlow"),t($)}}function Q7(e,t,r){const s=this;return o;function o(u){return tt(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d):r(u)}function d(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}function Z7(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Pd,t,r)}}const e9={name:"htmlText",tokenize:t9};function t9(e,t,r){const s=this;let o,d,u;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),E):R===63?(e.consume(R),y):Kn(R)?(e.consume(R),N):r(R)}function f(R){return R===45?(e.consume(R),m):R===91?(e.consume(R),d=0,k):Kn(R)?(e.consume(R),v):r(R)}function m(R){return R===45?(e.consume(R),w):r(R)}function h(R){return R===null?r(R):R===45?(e.consume(R),g):tt(R)?(u=h,K(R)):(e.consume(R),h)}function g(R){return R===45?(e.consume(R),w):h(R)}function w(R){return R===62?Y(R):R===45?g(R):h(R)}function k(R){const O="CDATA[";return R===O.charCodeAt(d++)?(e.consume(R),d===O.length?_:k):r(R)}function _(R){return R===null?r(R):R===93?(e.consume(R),x):tt(R)?(u=_,K(R)):(e.consume(R),_)}function x(R){return R===93?(e.consume(R),b):_(R)}function b(R){return R===62?Y(R):R===93?(e.consume(R),b):_(R)}function v(R){return R===null||R===62?Y(R):tt(R)?(u=v,K(R)):(e.consume(R),v)}function y(R){return R===null?r(R):R===63?(e.consume(R),j):tt(R)?(u=y,K(R)):(e.consume(R),y)}function j(R){return R===62?Y(R):y(R)}function E(R){return Kn(R)?(e.consume(R),A):r(R)}function A(R){return R===45||sn(R)?(e.consume(R),A):P(R)}function P(R){return tt(R)?(u=P,K(R)):xt(R)?(e.consume(R),P):Y(R)}function N(R){return R===45||sn(R)?(e.consume(R),N):R===47||R===62||Gr(R)?L(R):r(R)}function L(R){return R===47?(e.consume(R),Y):R===58||R===95||Kn(R)?(e.consume(R),B):tt(R)?(u=L,K(R)):xt(R)?(e.consume(R),L):Y(R)}function B(R){return R===45||R===46||R===58||R===95||sn(R)?(e.consume(R),B):I(R)}function I(R){return R===61?(e.consume(R),F):tt(R)?(u=I,K(R)):xt(R)?(e.consume(R),I):L(R)}function F(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),o=R,z):tt(R)?(u=F,K(R)):xt(R)?(e.consume(R),F):(e.consume(R),q)}function z(R){return R===o?(e.consume(R),o=void 0,U):R===null?r(R):tt(R)?(u=z,K(R)):(e.consume(R),z)}function q(R){return R===null||R===34||R===39||R===60||R===61||R===96?r(R):R===47||R===62||Gr(R)?L(R):(e.consume(R),q)}function U(R){return R===47||R===62||Gr(R)?L(R):r(R)}function Y(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):r(R)}function K(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return xt(R)?Pt(e,D,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):D(R)}function D(R){return e.enter("htmlTextData"),u(R)}}const Wg={name:"labelEnd",resolveAll:i9,resolveTo:o9,tokenize:a9},r9={tokenize:l9},n9={tokenize:c9},s9={tokenize:u9};function i9(e){let t=-1;const r=[];for(;++t<e.length;){const s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&is(e,0,e.length,r),e}function o9(e,t){let r=e.length,s=0,o,d,u,l;for(;r--;)if(o=e[r][1],d){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(d=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(u=r);const c={type:e[d][1].type==="labelLink"?"link":"image",start:{...e[d][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[d][1].start},end:{...e[u][1].end}},m={type:"labelText",start:{...e[d+s+2][1].end},end:{...e[u-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=bn(l,e.slice(d+1,d+s+3)),l=bn(l,[["enter",m,t]]),l=bn(l,Hg(t.parser.constructs.insideSpan.null,e.slice(d+s+4,u-3),t)),l=bn(l,[["exit",m,t],e[u-2],e[u-1],["exit",f,t]]),l=bn(l,e.slice(u+1)),l=bn(l,[["exit",c,t]]),is(e,d,e.length,l),e}function a9(e,t,r){const s=this;let o=s.events.length,d,u;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){d=s.events[o][1];break}return l;function l(g){return d?d._inactive?h(g):(u=s.parser.defined.includes(To(s.sliceSerialize({start:d.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),c):r(g)}function c(g){return g===40?e.attempt(r9,m,u?m:h)(g):g===91?e.attempt(n9,m,u?f:h)(g):u?m(g):h(g)}function f(g){return e.attempt(s9,m,h)(g)}function m(g){return t(g)}function h(g){return d._balanced=!0,r(g)}}function l9(e,t,r){return s;function s(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Gr(h)?Xa(e,d)(h):d(h)}function d(h){return h===41?m(h):r2(e,u,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function u(h){return Gr(h)?Xa(e,c)(h):m(h)}function l(h){return r(h)}function c(h){return h===34||h===39||h===40?s2(e,f,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Gr(h)?Xa(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):r(h)}}function c9(e,t,r){const s=this;return o;function o(l){return n2.call(s,e,d,u,"reference","referenceMarker","referenceString")(l)}function d(l){return s.parser.defined.includes(To(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function u(l){return r(l)}}function u9(e,t,r){return s;function s(d){return e.enter("reference"),e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),o}function o(d){return d===93?(e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),e.exit("reference"),t):r(d)}}const d9={name:"labelStartImage",resolveAll:Wg.resolveAll,tokenize:h9};function h9(e,t,r){const s=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),d}function d(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),u):r(l)}function u(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(l):t(l)}}const f9={name:"labelStartLink",resolveAll:Wg.resolveAll,tokenize:m9};function m9(e,t,r){const s=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),d}function d(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):t(u)}}const em={name:"lineEnding",tokenize:p9};function p9(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const fu={name:"thematicBreak",tokenize:g9};function g9(e,t,r){let s=0,o;return d;function d(f){return e.enter("thematicBreak"),u(f)}function u(f){return o=f,l(f)}function l(f){return f===o?(e.enter("thematicBreakSequence"),c(f)):s>=3&&(f===null||tt(f))?(e.exit("thematicBreak"),t(f)):r(f)}function c(f){return f===o?(e.consume(f),s++,c):(e.exit("thematicBreakSequence"),xt(f)?Pt(e,l,"whitespace")(f):l(f))}}const Hr={continuation:{tokenize:b9},exit:_9,name:"list",tokenize:y9},v9={partial:!0,tokenize:S9},x9={partial:!0,tokenize:w9};function y9(e,t,r){const s=this,o=s.events[s.events.length-1];let d=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return l;function l(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:Jm(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(fu,r,f)(w):f(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(w)}return r(w)}function c(w){return Jm(w)&&++u<10?(e.consume(w),c):(!s.interrupt||u<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):r(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(Pd,s.interrupt?r:m,e.attempt(v9,g,h))}function m(w){return s.containerState.initialBlankLine=!0,d++,g(w)}function h(w){return xt(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),g):r(w)}function g(w){return s.containerState.size=d+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function b9(e,t,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Pd,o,d);function o(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Pt(e,t,"listItemIndent",s.containerState.size+1)(l)}function d(l){return s.containerState.furtherBlankLines||!xt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(x9,t,u)(l))}function u(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,Pt(e,e.attempt(Hr,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function w9(e,t,r){const s=this;return Pt(e,o,"listItemIndent",s.containerState.size+1);function o(d){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?t(d):r(d)}}function _9(e){e.exit(this.containerState.type)}function S9(e,t,r){const s=this;return Pt(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(d){const u=s.events[s.events.length-1];return!xt(d)&&u&&u[1].type==="listItemPrefixWhitespace"?t(d):r(d)}}const mw={name:"setextUnderline",resolveTo:C9,tokenize:k9};function C9(e,t){let r=e.length,s,o,d;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),!d&&e[r][1].type==="definition"&&(d=r);const u={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",d?(e.splice(o,0,["enter",u,t]),e.splice(d+1,0,["exit",e[s][1],t]),e[s][1].end={...e[d][1].end}):e[s][1]=u,e.push(["exit",u,t]),e}function k9(e,t,r){const s=this;let o;return d;function d(f){let m=s.events.length,h;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){h=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||h)?(e.enter("setextHeadingLine"),o=f,u(f)):r(f)}function u(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),xt(f)?Pt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||tt(f)?(e.exit("setextHeadingLine"),t(f)):r(f)}}const j9={tokenize:N9};function N9(e){const t=this,r=e.attempt(Pd,s,e.attempt(this.parser.constructs.flowInitial,o,Pt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(R7,o)),"linePrefix")));return r;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEndingBlank"),e.consume(d),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const E9={resolveAll:o2()},P9=i2("string"),A9=i2("text");function i2(e){return{resolveAll:o2(e==="text"?T9:void 0),tokenize:t};function t(r){const s=this,o=this.parser.constructs[e],d=r.attempt(o,u,l);return u;function u(m){return f(m)?d(m):l(m)}function l(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),c}function c(m){return f(m)?(r.exit("data"),d(m)):(r.consume(m),c)}function f(m){if(m===null)return!0;const h=o[m];let g=-1;if(h)for(;++g<h.length;){const w=h[g];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function o2(e){return t;function t(r,s){let o=-1,d;for(;++o<=r.length;)d===void 0?r[o]&&r[o][1].type==="data"&&(d=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==d+2&&(r[d][1].end=r[o-1][1].end,r.splice(d+2,o-d-2),o=d+2),d=void 0);return e?e(r,s):r}}function T9(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],o=t.sliceStream(s);let d=o.length,u=-1,l=0,c;for(;d--;){const f=o[d];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)l++,u--;if(u)break;u=-1}else if(f===-2)c=!0,l++;else if(f!==-1){d++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const f={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?u:s.start._bufferIndex+u,_index:s.start._index+d,line:s.end.line,column:s.end.column-l,offset:s.end.offset-l},end:{...s.end}};s.end={...f.start},s.start.offset===s.end.offset?Object.assign(s,f):(e.splice(r,0,["enter",f,t],["exit",f,t]),r+=2)}r++}return e}const R9={42:Hr,43:Hr,45:Hr,48:Hr,49:Hr,50:Hr,51:Hr,52:Hr,53:Hr,54:Hr,55:Hr,56:Hr,57:Hr,62:Qj},M9={91:O7},D9={[-2]:Zf,[-1]:Zf,32:Zf},L9={35:W7,42:fu,45:[mw,fu],60:K7,61:mw,95:fu,96:hw,126:hw},I9={38:e2,92:Zj},O9={[-5]:em,[-4]:em,[-3]:em,33:d9,38:e2,42:Qm,60:[f7,e9],91:f9,92:[z7,Zj],93:Wg,95:Qm,96:j7},B9={null:[Qm,E9]},F9={null:[42,95]},$9={null:[]},z9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F9,contentInitial:M9,disable:$9,document:R9,flow:L9,flowInitial:D9,insideSpan:B9,string:I9,text:O9},Symbol.toStringTag,{value:"Module"}));function H9(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},d=[];let u=[],l=[];const c={attempt:P(E),check:P(A),consume:v,enter:y,exit:j,interrupt:P(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:_,events:[],now:k,parser:e,previous:null,sliceSerialize:g,sliceStream:w,write:h};let m=t.tokenize.call(f,c);return t.resolveAll&&d.push(t),f;function h(I){return u=bn(u,I),x(),u[u.length-1]!==null?[]:(N(t,0),f.events=Hg(d,f.events,f),f.events)}function g(I,F){return U9(w(I),F)}function w(I){return W9(u,I)}function k(){const{_bufferIndex:I,_index:F,line:z,column:q,offset:U}=s;return{_bufferIndex:I,_index:F,line:z,column:q,offset:U}}function _(I){o[I.line]=I.column,B()}function x(){let I;for(;s._index<u.length;){const F=u[s._index];if(typeof F=="string")for(I=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===I&&s._bufferIndex<F.length;)b(F.charCodeAt(s._bufferIndex));else b(F)}}function b(I){m=m(I)}function v(I){tt(I)?(s.line++,s.column=1,s.offset+=I===-3?2:1,B()):I!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),f.previous=I}function y(I,F){const z=F||{};return z.type=I,z.start=k(),f.events.push(["enter",z,f]),l.push(z),z}function j(I){const F=l.pop();return F.end=k(),f.events.push(["exit",F,f]),F}function E(I,F){N(I,F.from)}function A(I,F){F.restore()}function P(I,F){return z;function z(q,U,Y){let K,V,D,R;return Array.isArray(q)?G(q):"tokenize"in q?G([q]):O(q);function O(he){return X;function X(H){const ae=H!==null&&he[H],ne=H!==null&&he.null,J=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return G(J)(H)}}function G(he){return K=he,V=0,he.length===0?Y:$(he[V])}function $(he){return X;function X(H){return R=L(),D=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?me():he.tokenize.call(F?Object.assign(Object.create(f),F):f,c,oe,me)(H)}}function oe(he){return I(D,R),U}function me(he){return R.restore(),++V<K.length?$(K[V]):Y}}}function N(I,F){I.resolveAll&&!d.includes(I)&&d.push(I),I.resolve&&is(f.events,F,f.events.length-F,I.resolve(f.events.slice(F),f)),I.resolveTo&&(f.events=I.resolveTo(f.events,f))}function L(){const I=k(),F=f.previous,z=f.currentConstruct,q=f.events.length,U=Array.from(l);return{from:q,restore:Y};function Y(){s=I,f.previous=F,f.currentConstruct=z,f.events.length=q,l=U,B()}}function B(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function W9(e,t){const r=t.start._index,s=t.start._bufferIndex,o=t.end._index,d=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(s,d)];else{if(u=e.slice(r,o),s>-1){const l=u[0];typeof l=="string"?u[0]=l.slice(s):u.shift()}d>0&&u.push(e[o].slice(0,d))}return u}function U9(e,t){let r=-1;const s=[];let o;for(;++r<e.length;){const d=e[r];let u;if(typeof d=="string")u=d;else switch(d){case-5:{u="\r";break}case-4:{u=`
|
|
576
576
|
`;break}case-3:{u=`\r
|
|
577
577
|
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(d)}o=d===-2,s.push(u)}return s.join("")}function V9(e){const s={constructs:Q8([z9,...(e||{}).extensions||[]]),content:o(o7),defined:[],document:o(l7),flow:o(j9),lazy:{},string:o(P9),text:o(A9)};return s;function o(d){return u;function u(l){return H9(s,d,l)}}}function G9(e){for(;!t2(e););return e}const pw=/[\0\t\n\r]/g;function K9(){let e=1,t="",r=!0,s;return o;function o(d,u,l){const c=[];let f,m,h,g,w;for(d=t+(typeof d=="string"?d.toString():new TextDecoder(u||void 0).decode(d)),h=0,t="",r&&(d.charCodeAt(0)===65279&&h++,r=void 0);h<d.length;){if(pw.lastIndex=h,f=pw.exec(d),g=f&&f.index!==void 0?f.index:d.length,w=d.charCodeAt(g),!f){t=d.slice(h);break}if(w===10&&h===g&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),h<g&&(c.push(d.slice(h,g)),e+=g-h),w){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}h=g+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const q9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Y9(e){return e.replace(q9,X9)}function X9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),d=o===120||o===88;return Jj(r.slice(d?2:1),d?16:10)}return zg(r)||e}const a2={}.hasOwnProperty;function J9(e,t,r){return typeof t!="string"&&(r=t,t=void 0),Q9(r)(G9(V9(r).document().write(K9()(e,t,!0))))}function Q9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(Me),autolinkProtocol:L,autolinkEmail:L,atxHeading:d(Ve),blockQuote:d(ne),characterEscape:L,characterReference:L,codeFenced:d(J),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:d(J,u),codeText:d(se,u),codeTextData:L,data:L,codeFlowValue:L,definition:d(xe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:d(Be),hardBreakEscape:d(ee),hardBreakTrailing:d(ee),htmlFlow:d(de,u),htmlFlowData:L,htmlText:d(de,u),htmlTextData:L,image:d(Ie),label:u,link:d(Me),listItem:d(Ce),listItemValue:g,listOrdered:d(rt,h),listUnordered:d(rt),paragraph:d(ge),reference:$,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:d(Ve),strong:d(De),thematicBreak:d(kt)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:ae,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:he,characterReference:X,codeFenced:c(x),codeFencedFence:_,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:B,codeIndented:c(b),codeText:c(U),codeTextData:B,data:B,definition:c(),definitionDestinationString:j,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(z),htmlFlowData:B,htmlText:c(q),htmlTextData:B,image:c(K),label:D,labelText:V,lineEnding:I,link:c(Y),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:R,resourceTitleString:O,resource:G,setextHeading:c(N),setextHeadingLineSequence:P,setextHeadingText:A,strong:c(),thematicBreak:c()}};l2(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(pe){let be={type:"root",children:[]};const Fe={stack:[be],tokenStack:[],config:t,enter:l,exit:f,buffer:u,resume:m,data:r},qe=[];let Ke=-1;for(;++Ke<pe.length;)if(pe[Ke][1].type==="listOrdered"||pe[Ke][1].type==="listUnordered")if(pe[Ke][0]==="enter")qe.push(Ke);else{const _t=qe.pop();Ke=o(pe,_t,Ke)}for(Ke=-1;++Ke<pe.length;){const _t=t[pe[Ke][0]];a2.call(_t,pe[Ke][1].type)&&_t[pe[Ke][1].type].call(Object.assign({sliceSerialize:pe[Ke][2].sliceSerialize},Fe),pe[Ke][1])}if(Fe.tokenStack.length>0){const _t=Fe.tokenStack[Fe.tokenStack.length-1];(_t[1]||gw).call(Fe,void 0,_t[0])}for(be.position={start:Js(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Js(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)be=t.transforms[Ke](be)||be;return be}function o(pe,be,Fe){let qe=be-1,Ke=-1,_t=!1,nt,nr,cn,un;for(;++qe<=Fe;){const Kt=pe[qe];switch(Kt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Kt[0]==="enter"?Ke++:Ke--,un=void 0;break}case"lineEndingBlank":{Kt[0]==="enter"&&(nt&&!un&&!Ke&&!cn&&(cn=qe),un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:un=void 0}if(!Ke&&Kt[0]==="enter"&&Kt[1].type==="listItemPrefix"||Ke===-1&&Kt[0]==="exit"&&(Kt[1].type==="listUnordered"||Kt[1].type==="listOrdered")){if(nt){let Lr=qe;for(nr=void 0;Lr--;){const Ot=pe[Lr];if(Ot[1].type==="lineEnding"||Ot[1].type==="lineEndingBlank"){if(Ot[0]==="exit")continue;nr&&(pe[nr][1].type="lineEndingBlank",_t=!0),Ot[1].type="lineEnding",nr=Lr}else if(!(Ot[1].type==="linePrefix"||Ot[1].type==="blockQuotePrefix"||Ot[1].type==="blockQuotePrefixWhitespace"||Ot[1].type==="blockQuoteMarker"||Ot[1].type==="listItemIndent"))break}cn&&(!nr||cn<nr)&&(nt._spread=!0),nt.end=Object.assign({},nr?pe[nr][1].start:Kt[1].end),pe.splice(nr||qe,0,["exit",nt,Kt[2]]),qe++,Fe++}if(Kt[1].type==="listItemPrefix"){const Lr={type:"listItem",_spread:!1,start:Object.assign({},Kt[1].start),end:void 0};nt=Lr,pe.splice(qe,0,["enter",Lr,Kt[2]]),qe++,Fe++,cn=void 0,un=!0}}}return pe[be][1]._spread=_t,Fe}function d(pe,be){return Fe;function Fe(qe){l.call(this,pe(qe),qe),be&&be.call(this,qe)}}function u(){this.stack.push({type:"fragment",children:[]})}function l(pe,be,Fe){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([be,Fe||void 0]),pe.position={start:Js(be.start),end:void 0}}function c(pe){return be;function be(Fe){pe&&pe.call(this,Fe),f.call(this,Fe)}}function f(pe,be){const Fe=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==pe.type&&(be?be.call(this,pe,qe[0]):(qe[1]||gw).call(this,pe,qe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Ya({start:pe.start,end:pe.end})+"): it’s not open");Fe.position.end=Js(pe.end)}function m(){return X8(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(pe){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.lang=pe}function k(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.meta=pe}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/(\r?\n|\r)$/g,"")}function v(pe){const be=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=be,Fe.identifier=To(this.sliceSerialize(pe)).toLowerCase()}function y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function j(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function E(pe){const be=this.stack[this.stack.length-1];if(!be.depth){const Fe=this.sliceSerialize(pe).length;be.depth=Fe}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function P(pe){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function L(pe){const Fe=this.stack[this.stack.length-1].children;let qe=Fe[Fe.length-1];(!qe||qe.type!=="text")&&(qe=mt(),qe.position={start:Js(pe.start),end:void 0},Fe.push(qe)),this.stack.push(qe)}function B(pe){const be=this.stack.pop();be.value+=this.sliceSerialize(pe),be.position.end=Js(pe.end)}function I(pe){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=be.children[be.children.length-1];Fe.position.end=Js(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(L.call(this,pe),B.call(this,pe))}function F(){this.data.atHardBreak=!0}function z(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function q(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function U(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function Y(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function V(pe){const be=this.sliceSerialize(pe),Fe=this.stack[this.stack.length-2];Fe.label=Y9(be),Fe.identifier=To(be).toLowerCase()}function D(){const pe=this.stack[this.stack.length-1],be=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const qe=pe.children;Fe.children=qe}else Fe.alt=be}function R(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function O(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function G(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function oe(pe){const be=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=be,Fe.identifier=To(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function me(pe){this.data.characterReferenceType=pe.type}function he(pe){const be=this.sliceSerialize(pe),Fe=this.data.characterReferenceType;let qe;Fe?(qe=Jj(be,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=zg(be);const Ke=this.stack[this.stack.length-1];Ke.value+=qe}function X(pe){const be=this.stack.pop();be.position.end=Js(pe.end)}function H(pe){B.call(this,pe);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(pe)}function ae(pe){B.call(this,pe);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(pe)}function ne(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function ee(){return{type:"break"}}function de(){return{type:"html",value:""}}function Ie(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function rt(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Ce(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function De(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function kt(){return{type:"thematicBreak"}}}function Js(e){return{line:e.line,column:e.column,offset:e.offset}}function l2(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?l2(e,s):Z9(e,s)}}function Z9(e,t){let r;for(r in t)if(a2.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function gw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ya({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ya({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ya({start:t.start,end:t.end})+") is still open")}function e$(e){const t=this;t.parser=r;function r(s){return J9(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function t$(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function r$(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
package/ui/dist/index.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<!-- PWA Manifest -->
|
|
21
21
|
<link rel="manifest" href="/manifest.json">
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-EFNq85tx.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-DBqrH3A_.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|