import{VBox}from"./Widget.js";import{ZoomManager}from"./ZoomManager.js";export class RootView extends VBox{constructor(){super(),this.markAsRoot(),this.element.classList.add("root-view"),this.registerRequiredCSS("ui/rootView.css",{enableLegacyPatching:!1}),this.element.setAttribute("spellcheck","false")}attachToDocument(e){e.defaultView&&e.defaultView.addEventListener("resize",this.doResize.bind(this),!1),this._window=e.defaultView,this.doResize(),this.show(e.body)}doResize(){if(this._window){const e=this.constraints().minimum,t=ZoomManager.instance().zoomFactor(),i=Math.min(0,this._window.innerWidth-e.width/t);this.element.style.marginRight=i+"px";const s=Math.min(0,this._window.innerHeight-e.height/t);this.element.style.marginBottom=s+"px"}super.doResize()}}