(self.webpackChunk_retrolab_lab_extension=self.webpackChunk_retrolab_lab_extension||[]).push([[568],{568:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>b});var r,n=o(678),a=o(493),l=o(40),c=o(275),d=o(465),i=o(899),u=o(310);!function(e){e.openRetro="retrolab:open",e.launchRetroTree="retrolab:launchtree"}(r||(r={}));class s{constructor(e){this._commands=e}createNew(e){const t=new a.ToolbarButton({tooltip:"Open with RetroLab",icon:u.retroSunIcon,onClick:()=>{this._commands.execute(r.openRetro)}});return e.toolbar.insertAfter("cellType","retro",t),t}}const m={id:"@retrolab/lab-extension:open-retro",autoStart:!0,optional:[i.INotebookTracker,a.ICommandPalette,c.IMainMenu,n.ILabShell],activate:(e,t,o,n,a)=>{if(!t||!a)return;const{commands:c,docRegistry:d,shell:i}=e,u=l.PageConfig.getBaseUrl();c.addCommand(r.openRetro,{label:"Open in RetroLab",execute:()=>{const e=t.currentWidget;if(!e)return;const{context:o}=e;window.open(`${u}retro/notebooks/${o.path}`)},isEnabled:()=>null!==t.currentWidget&&t.currentWidget===i.currentWidget}),o&&o.addItem({command:r.openRetro,category:"Other"}),n&&n.viewMenu.addGroup([{command:r.openRetro}],1);const m=new s(c);d.addWidgetExtension("Notebook",m)}},b=[{id:"@retrolab/lab-extension:launch-retrotree",autoStart:!0,requires:[d.ITranslator],optional:[c.IMainMenu,a.ICommandPalette],activate:(e,t,o,n)=>{const{commands:a}=e,c=t.load("jupyterlab"),d=c.__("Help");a.addCommand(r.launchRetroTree,{label:c.__("Launch RetroLab File Browser"),execute:()=>{window.open(l.PageConfig.getBaseUrl()+"retro/tree")}}),o&&o.helpMenu.addGroup([{command:r.launchRetroTree}],1),n&&n.addItem({command:r.launchRetroTree,category:d})}},m]}}]);