Files
yakpanel-core/YakPanel/static/vite/js/xterm-addon-canvas-DELv9KNm.js

2 lines
92 KiB
JavaScript
Raw Permalink Normal View History

2026-04-07 02:04:22 +05:30
var ce={exports:{}},ve;function we(){return ve||(ve=1,(function(pe,be){(function(de,se){pe.exports=se()})(self,(()=>(()=>{var de={903:(k,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRenderLayer=void 0;const _=l(274),a=l(627),r=l(237),c=l(860),C=l(374),f=l(296),i=l(345),t=l(859),u=l(399),d=l(855);class n extends t.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var s;return(s=this._charAtlas)===null||s===void 0?void 0:s.pages[0].canvas}constructor(s,g,o,p,M,h,v,w,L,S){super(),this._terminal=s,this._container=g,this._alpha=M,this._themeService=h,this._bufferService=v,this._optionsService=w,this._decorationService=L,this._coreBrowserService=S,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,f.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new t.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new i.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new _.CellColorResolver(this._terminal,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-".concat(o,"-layer")),this._canvas.style.zIndex=p.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((b=>{this._refreshCharAtlas(b),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,t.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,C.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(s,g){}handleSelectionChanged(s,g,o=!1){this._selectionModel.update(this._terminal,s,g,o)}_setTransparency(s){if(s===this._alpha)return;const g=this._canvas;this._alpha=s,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,g),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(s){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,a.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,s,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,i.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let g=0;g<this._charAtlas.pages.length;g++)this._bitmapGenerator[g]=new x(this._charAtlas.pages[g].canvas)}}resize(s){this._deviceCellWidth=s.device.cell.width,this._deviceCellHeight=s.device.cell.height,this._deviceCharWidth=s.device.char.width,this._deviceCharHeight=s.device.char.height,this._deviceCharLeft=s.device.char.left,this._deviceCharTop=s.device.char.top,this._canvas.width=s.device.canvas.width,this._canvas.height=s.device.canvas.height,this._canvas.style.width="".concat(s.css.canvas.width,"px"),this._canvas.style.height="".concat(s.css.canvas.height,"px"),this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var s;(s=this._charAtlas)===null||s===void 0||s.clearTexture()}_fillCells(s,g,o,p){this._ctx.fillRect(s*this._deviceCellWidth,g*this._deviceCellHeight,o*this._deviceCellWidth,p*this._deviceCellHeight)}_fillMiddleLineAtCells(s,g,o=1){const p=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(s*this._deviceCellWidth,(g+1)*this._deviceCellHeight-p-this._coreBrowserService.dpr,o*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(s,g,o=1,p=0){this._ctx.fillRect(s*this._deviceCellWidth,(g+1)*this._deviceCellHeight+p-this._coreBrowserService.dpr-1,o*this._deviceCellWidth,this._coreBro