// 0.12.0-beta.285
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(globalThis,()=>(()=>{"use strict";var e={};return(()=>{var t=e;function i(e){return(t=e,t?.ownerDocument?.defaultView?t.ownerDocument.defaultView:window).getComputedStyle(e,null);var t}Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();e&&this._terminal&&!isNaN(e.cols)&&!isNaN(e.rows)&&this._terminal.resize(e.cols,e.rows)}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal.dimensions;if(!e||0===e.css.cell.width||0===e.css.cell.height)return;const t=this._terminal.options.scrollbar?.showScrollbar??!0,r=0!==this._terminal.options.scrollback&&t?this._terminal.options.scrollbar?.width??14:0,o=i(this._terminal.element.parentElement),n=Math.max(0,parseInt(o.getPropertyValue("height"),10)||0),s=Math.max(0,parseInt(o.getPropertyValue("width"),10)||0),l=i(this._terminal.element),a=n-((parseInt(l.getPropertyValue("padding-top"),10)||0)+(parseInt(l.getPropertyValue("padding-bottom"),10)||0)),p=s-((parseInt(l.getPropertyValue("padding-right"),10)||0)+(parseInt(l.getPropertyValue("padding-left"),10)||0))-r;return{cols:Math.max(2,Math.floor(p/e.css.cell.width)),rows:Math.max(1,Math.floor(a/e.css.cell.height))}}}})(),e})());
