import{g as f}from"./index-CYs6TkOv.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};
