"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([["590"],{509(e,o,t){t.r(o),t.d(o,{default:()=>m});var n,a,r=t(758),l=t(485),i=t(370),b=t(481),c=t(866),u=t(660),d=t(724),p=t(223);(n=a||(a={})).launchNotebookTree="jupyter-notebook:launch-tree",n.openNotebook="jupyter-notebook:open-notebook",n.openLab="jupyter-notebook:open-lab",n.openNbClassic="jupyter-notebook:open-nbclassic";let s={id:"@jupyter-notebook/lab-extension:interface-switcher",description:"A plugin to add custom toolbar items to the notebook page.",autoStart:!0,requires:[c.ITranslator],optional:[b.INotebookTracker,l.ICommandPalette,d.INotebookPathOpener,d.INotebookShell,r.ILabShell,l.IToolbarWidgetRegistry],activate:(e,o,t,n,r,l,b,c)=>{let s;if(!t)return;let{commands:m,shell:k}=e,h=i.PageConfig.getBaseUrl(),_=o.load("notebook"),g="true"===i.PageConfig.getOption("nbclassic_enabled"),N=new u.Menu({commands:m}),f=[],C=null!=r?r:d.defaultNotebookPathOpener;l||f.push({command:a.openNotebook,commandLabel:_.__("Notebook"),commandDescription:_.__("Open in %1","Jupyter Notebook"),buttonLabel:"openNotebook",urlPrefix:`${h}tree`}),b||f.push({command:a.openLab,commandLabel:_.__("JupyterLab"),commandDescription:_.__("Open in %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${h}doc/tree`}),g&&f.push({command:a.openNbClassic,commandLabel:_.__("NbClassic"),commandDescription:_.__("Open in %1","NbClassic"),buttonLabel:"openNbClassic",urlPrefix:`${h}nbclassic/notebooks`});let y=()=>null!==t.currentWidget&&t.currentWidget===k.currentWidget;if(f.forEach(e=>{let{command:o}=e;(e=>{let{command:o,commandLabel:a,commandDescription:r,urlPrefix:l}=e;m.addCommand(o,{label:e=>e.noLabel?"":e.isMenu||e.isPalette?r:a,caption:a,execute:()=>{let e=t.currentWidget;e&&C.open({prefix:l,path:e.context.path})},isEnabled:y}),n&&n.addItem({command:o,category:"Other",args:{isPalette:!0}})})(e),N.addItem({command:o})}),1===f.length)s=e=>{let o=new p.CommandToolbarButton({commands:m,id:f[0].command,label:f[0].commandLabel,icon:p.launchIcon});return o.addClass("jp-nb-interface-switcher-button"),o};else{let e={overflowMenuOptions:{isVisible:!1}},o=new u.MenuBar(e);N.title.label=_.__("Open in..."),N.title.icon=p.caretDownIcon,o.addMenu(N),s=o=>{let t=new u.MenuBar(e);return t.addMenu(N),t.addClass("jp-InterfaceSwitcher"),t}}c&&c.addFactory("Notebook","interfaceSwitcher",s)}},m=[{id:"@jupyter-notebook/lab-extension:launch-tree",description:"A plugin to add a command to open the Jupyter Notebook Tree.",autoStart:!0,requires:[c.ITranslator],optional:[l.ICommandPalette],activate:(e,o,t)=>{let{commands:n}=e,r=o.load("notebook"),l=r.__("Help");n.addCommand(a.launchNotebookTree,{label:r.__("Launch Jupyter Notebook File Browser"),execute:()=>{let e=i.URLExt.join(i.PageConfig.getBaseUrl(),"tree");window.open(e)}}),t&&t.addItem({command:a.launchNotebookTree,category:l})}},s]}}]);