"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[153,2534],{62534:(e,t,i)=>{i.r(t),i.d(t,{Application:()=>u});var s=i(446),n=i(75178),r=i(78625);class u{constructor(e){var t;this._delegate=new n.PromiseDelegate,this._started=!1,this._bubblingKeydown=!1,this.pluginRegistry=null!==(t=e.pluginRegistry)&&void 0!==t?t:new n.PluginRegistry(e),this.pluginRegistry.application=this,this.commands=new s.CommandRegistry,this.contextMenu=new r.ContextMenu({commands:this.commands,renderer:e.contextMenuRenderer}),this.shell=e.shell}get deferredPlugins(){return this.pluginRegistry.deferredPlugins}get started(){return this._delegate.promise}async activateDeferredPlugins(){await this.pluginRegistry.activatePlugins("defer")}async activatePlugin(e){return this.pluginRegistry.activatePlugin(e)}async deactivatePlugin(e){return this.pluginRegistry.deactivatePlugin(e)}deregisterPlugin(e,t){this.pluginRegistry.deregisterPlugin(e,t)}getPluginDescription(e){return this.pluginRegistry.getPluginDescription(e)}hasPlugin(e){return this.pluginRegistry.hasPlugin(e)}isPluginActivated(e){return this.pluginRegistry.isPluginActivated(e)}listPlugins(){return this.pluginRegistry.listPlugins()}registerPlugin(e){this.pluginRegistry.registerPlugin(e)}registerPlugins(e){this.pluginRegistry.registerPlugins(e)}async resolveOptionalService(e){return this.pluginRegistry.resolveOptionalService(e)}async resolveRequiredService(e){return this.pluginRegistry.resolveRequiredService(e)}async start(e={}){var t,i;if(this._started)return this._delegate.promise;this._started=!0,this._bubblingKeydown=null!==(t=e.bubblingKeydown)&&void 0!==t&&t;const s=null!==(i=e.hostID)&&void 0!==i?i:"";await this.pluginRegistry.activatePlugins("startUp",e),this.attachShell(s),this.addEventListeners(),this._delegate.resolve()}handleEvent(e){switch(e.type){case"resize":this.evtResize(e);break;case"keydown":this.evtKeydown(e);break;case"keyup":this.evtKeyup(e);break;case"contextmenu":this.evtContextMenu(e)}}attachShell(e){r.Widget.attach(this.shell,e&&document.getElementById(e)||document.body)}addEventListeners(){document.addEventListener("contextmenu",this),document.addEventListener("keydown",this,!this._bubblingKeydown),document.addEventListener("keyup",this,!this._bubblingKeydown),window.addEventListener("resize",this)}evtKeydown(e){this.commands.processKeydownEvent(e)}evtKeyup(e){this.commands.processKeyupEvent(e)}evtContextMenu(e){e.shiftKey||this.contextMenu.open(e)&&(e.preventDefault(),e.stopPropagation())}evtResize(e){this.shell.update()}}}}]);
//# sourceMappingURL=153.js.map