"use strict";(self.webpackChunk_retrolab_lab_extension=self.webpackChunk_retrolab_lab_extension||[]).push([[568],{568:(e,a,t)=>{t.r(a),t.d(a,{default:()=>s});var r,o=t(994),n=t(547),l=t(740),c=t(503),d=t(708),i=t(904),b=t(433),u=t(577);!function(e){e.launchRetroTree="retrolab:launch-tree",e.openRetro="retrolab:open-retro",e.openClassic="retrolab:open-classic",e.openLab="retrolab:open-lab"}(r||(r={}));const m={id:"@retrolab/lab-extension:interface-switcher",autoStart:!0,requires:[i.ITranslator],optional:[d.INotebookTracker,n.ICommandPalette,c.IMainMenu,u.IRetroShell,o.ILabShell,n.IToolbarWidgetRegistry],activate:(e,a,t,r,o,n,c,d)=>{if(!t)return;const{commands:i,shell:u}=e,m=l.PageConfig.getBaseUrl(),s=a.load("retrolab"),p=new b.MenuBar,h=new b.Menu({commands:i});h.title.label=s.__("Interface"),p.addMenu(h);const _=()=>null!==t.currentWidget&&t.currentWidget===u.currentWidget,f=e=>{const{command:a,commandLabel:n,urlPrefix:l}=e;i.addCommand(a,{label:e=>e.noLabel?"":n,caption:n,execute:()=>{const e=t.currentWidget;e&&window.open(`${l}${e.context.path}`)},isEnabled:_}),r&&r.addItem({command:a,category:"Other"}),o&&o.viewMenu.addGroup([{command:a}],1),h.addItem({command:a})};f({command:"retrolab:open-classic",commandLabel:s.__("Open With %1","Classic Notebook"),buttonLabel:"openClassic",urlPrefix:`${m}tree/`}),n||f({command:"retrolab:open-retro",commandLabel:s.__("Open With %1","RetroLab"),buttonLabel:"openRetro",urlPrefix:`${m}retro/tree/`}),c||f({command:"retrolab:open-lab",commandLabel:s.__("Open With %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${m}doc/tree/`}),d&&d.registerFactory("Notebook","interfaceSwitcher",(e=>{const a=new b.MenuBar;return a.addMenu(h),a.addClass("jp-InterfaceSwitcher"),a}))}},s=[{id:"@retrolab/lab-extension:launch-retrotree",autoStart:!0,requires:[i.ITranslator],optional:[c.IMainMenu,n.ICommandPalette],activate:(e,a,t,o)=>{const{commands:n}=e,c=a.load("retrolab"),d=c.__("Help");n.addCommand(r.launchRetroTree,{label:c.__("Launch RetroLab File Browser"),execute:()=>{window.open(l.PageConfig.getBaseUrl()+"retro/tree")}}),t&&t.helpMenu.addGroup([{command:r.launchRetroTree}],1),o&&o.addItem({command:r.launchRetroTree,category:d})}},m]}}]);