"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(323),l=t(676),i=t(215),b=t(144),c=t(828),d=t(660),p=t(129),s=t(482);(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 u={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,p.INotebookPathOpener,p.INotebookShell,r.ILabShell,l.IToolbarWidgetRegistry],activate:(e,o,t,n,r,l,b,c)=>{let u;if(!t)return;let{commands:m,shell:h}=e,k=i.PageConfig.getBaseUrl(),_=o.load("notebook"),g="true"===i.PageConfig.getOption("nbclassic_enabled"),y=new d.Menu({commands:m}),N=[],f=null!=r?r:p.defaultNotebookPathOpener;l||N.push({command:a.openNotebook,commandLabel:_.__("Notebook"),commandDescription:_.__("Open in %1","Jupyter Notebook"),buttonLabel:"openNotebook",urlPrefix:`${k}tree`}),b||N.push({command:a.openLab,commandLabel:_.__("JupyterLab"),commandDescription:_.__("Open in %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${k}doc/tree`}),g&&N.push({command:a.openNbClassic,commandLabel:_.__("NbClassic"),commandDescription:_.__("Open in %1","NbClassic"),buttonLabel:"openNbClassic",urlPrefix:`${k}nbclassic/notebooks`});let C=()=>null!==t.currentWidget&&t.currentWidget===h.currentWidget;if(N.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&&f.open({prefix:l,path:e.context.path})},isEnabled:C,describedBy:{args:{type:"object",properties:{noLabel:{type:"boolean",description:"Whether to hide the command label."},isMenu:{type:"boolean",description:"Whether the command is rendered in a menu."},isPalette:{type:"boolean",description:"Whether the command is rendered in the command palette."}}}}}),n&&n.addItem({command:o,category:"Other",args:{isPalette:!0}})})(e),y.addItem({command:o})}),1===N.length)u=e=>{let o=new s.CommandToolbarButton({commands:m,id:N[0].command,label:N[0].commandLabel,icon:s.launchIcon});return o.addClass("jp-nb-interface-switcher-button"),o};else{let e={overflowMenuOptions:{isVisible:!1}},o=new d.MenuBar(e);y.title.label=_.__("Open in..."),y.title.icon=s.caretDownIcon,o.addMenu(y),u=o=>{let t=new d.MenuBar(e);return t.addMenu(y),t.addClass("jp-InterfaceSwitcher"),t}}c&&c.addFactory("Notebook","interfaceSwitcher",u)}},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)},describedBy:{args:{type:"object",properties:{}}}}),t&&t.addItem({command:a.launchNotebookTree,category:l})}},u]}}]);