(self.webpackChunk_retrolab_lab_extension=self.webpackChunk_retrolab_lab_extension||[]).push([[568],{568:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>u});var r,o=t(380),n=t(56),l=t(922),c=t(383),d=t(170),i=t(337),b=t(706),m=t(526);!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 s={id:"@retrolab/lab-extension:interface-switcher",autoStart:!0,requires:[i.ITranslator],optional:[d.INotebookTracker,n.ICommandPalette,c.IMainMenu,m.IRetroShell,o.ILabShell,n.IToolbarWidgetRegistry],activate:(e,a,t,r,o,n,c,d)=>{if(!t)return;const{commands:i,shell:m}=e,s=l.PageConfig.getBaseUrl(),u=a.load("retrolab"),p=new b.Menu({commands:i});p.title.label=u.__("Interface");const h=()=>null!==t.currentWidget&&t.currentWidget===m.currentWidget,_=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:h}),r&&r.addItem({command:a,category:"Other"}),o&&o.viewMenu.addGroup([{command:a}],1),p.addItem({command:a})};_({command:"retrolab:open-classic",commandLabel:u.__("Open With %1","Classic Notebook"),buttonLabel:"openClassic",urlPrefix:`${s}tree/`}),n||_({command:"retrolab:open-retro",commandLabel:u.__("Open With %1","RetroLab"),buttonLabel:"openRetro",urlPrefix:`${s}retro/tree/`}),c||_({command:"retrolab:open-lab",commandLabel:u.__("Open With %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${s}doc/tree/`}),d&&d.registerFactory("Notebook","interfaceSwitcher",(e=>{const a=new b.MenuBar;return a.addMenu(p),a.addClass("jp-InterfaceSwitcher"),a}))}},u=[{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})}},s]}}]);