"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3768,7302],{83768:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var r=o(97126),a=o(17207),n=o(42098),i=o(89045),s=o(26618),l=o(6661),d=o(34276),c=o(31392),u=o(81997),m=o(9267),b=o(99069),g=o(78156),f=o.n(g);const w=({commands:e,browser:t,translator:o})=>{const a=o.load("notebook"),n=Array.from(t.selectedItems()),i=n.some((e=>"directory"===e.type)),s=n.filter((e=>"file"===e.type)).length>1;if(0===n.length)return f().createElement("div",null,a.__("Select items to perform actions on them."));{const t=["delete"];return i?1===n.length&&t.unshift("rename"):(t.unshift("duplicate"),s||t.unshift("rename"),t.unshift("download"),t.unshift("open")),f().createElement(f().Fragment,null,t.map((t=>f().createElement(r.CommandToolbarButtonComponent,{key:t,commands:e,id:`filebrowser:${t}`,args:{toolbar:!0},icon:void 0}))))}},h=({commands:e,browser:t,selectionChanged:o,translator:a})=>f().createElement(r.UseSignal,{signal:o,shouldUpdate:()=>!0},(()=>f().createElement(w,{commands:e,browser:t,translator:a})));var p;!function(e){e.create=({commands:e,browser:t,selectionChanged:o,translator:a})=>{const n=r.ReactWidget.create(f().createElement(h,{commands:e,browser:t,selectionChanged:o,translator:a}));return n.addClass("jp-FileActions"),n}}(p||(p={}));const y="FileBrowser";var k;!function(e){e.activate="filebrowser:activate"}(k||(k={}));const F={id:"@jupyter-notebook/tree-extension:new",requires:[d.ITranslator],optional:[r.IToolbarWidgetRegistry],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e,a=t.load("notebook"),n={overflowMenuOptions:{isVisible:!1}},i=new m.MenuBar(n),s=new m.Menu({commands:r});s.title.label=a.__("New"),s.title.icon=c.caretDownIcon,i.addMenu(s),["notebook:create-new","terminal:create-new","console:create","filebrowser:create-new-file","filebrowser:create-new-directory"].forEach((e=>{s.addItem({command:e})})),o&&o.addFactory(y,"new-dropdown",(e=>{const t=new m.MenuBar(n);return t.addMenu(s),t.addClass("jp-DropdownMenu"),t}))}},S={id:"@jupyter-notebook/tree-extension:file-actions",autoStart:!0,requires:[n.IDefaultFileBrowser,r.IToolbarWidgetRegistry,d.ITranslator],activate:(e,t,o,r)=>{const a=new u.Signal(t);["_selectItem","_handleMultiSelect","handleFileSelect"].forEach((e=>{const o=t.listing[e];t.listing[e]=(...e)=>{o.call(t.listing,...e),a.emit(void 0)}})),o.addFactory(y,"fileActions",(t=>{const{commands:o}=e;return p.create({commands:o,browser:t,selectionChanged:a,translator:r})}))}},T={id:"@jupyter-notebook/tree-extension:load-plugins",autoStart:!0,requires:[i.ISettingRegistry],activate(e,t){const{isDisabled:o}=a.PageConfig.Extension,r=t.connector,n=a.PageConfig.getOption("allPlugins");if(!n)return;const i=JSON.parse(n),s=new Set;Object.keys(i).forEach((e=>{const t=i[e];Object.keys(t).forEach((e=>{const o=t[e];"boolean"==typeof o&&o?s.add(e):Array.isArray(o)&&o.forEach((e=>{s.add(e)}))}))})),e.restored.then((async()=>{(await r.list("all")).ids.forEach((async e=>{const[r]=e.split(":");if((s.has(r)||s.has(e))&&!o(e)&&!(e in t.plugins))try{await t.load(e)}catch(t){console.warn(`Settings failed to load for (${e})`,t)}}))}))}},I={id:"@jupyter-notebook/tree-extension:open-file-browser",requires:[b.INotebookTree,n.IDefaultFileBrowser],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e;r.addCommand(k.activate,{execute:()=>{t.currentWidget=o}})}},_={id:"@jupyter-notebook/tree-extension:widget",requires:[n.IDefaultFileBrowser,d.ITranslator,i.ISettingRegistry,r.IToolbarWidgetRegistry],optional:[s.IRunningSessionManagers,l.ISettingEditorTracker,l.IJSONSettingEditorTracker],autoStart:!0,provides:b.INotebookTree,activate:(e,t,o,a,i,l,d,u)=>{const m=new b.NotebookTreeWidget,g=o.load("notebook");if(t.title.label=g.__("Files"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",g.__("File Browser Section")),t.title.icon=c.folderIcon,m.addWidget(t),m.tabBar.addTab(t.title),m.tabsMovable=!1,i.addFactory(y,"uploader",(e=>new n.Uploader({model:e.model,translator:o,label:g.__("Upload")}))),i.addFactory(y,"fileNameSearcher",(e=>{const t=(0,c.FilenameSearcher)({updateFilter:(t,o)=>{e.model.setFilter((e=>t(e.name.toLowerCase())))},useFuzzyFilter:!0,placeholder:g.__("Filter files by name"),forceRefresh:!0});return t.addClass("jp-FileBrowser-filterBox"),t})),(0,r.setToolbar)(t,(0,r.createToolbarFactory)(i,a,y,_.id,o)),l){const e=new s.RunningSessions(l,o);e.id="jp-running-sessions-tree",e.title.label=g.__("Running"),e.title.icon=c.runningIcon,m.addWidget(e),m.tabBar.addTab(e.title)}const f=a.load("@jupyterlab/filebrowser-extension:browser");return Promise.all([f,e.restored]).then((([e])=>{["showFileCheckboxes","showFileSizeColumn","sortNotebooksFirst"].forEach((t=>{void 0===e.user[t]&&e.set(t,!0)}))})).catch((e=>{console.error(e.message)})),e.shell.add(m,"main",{rank:100}),[d,u].forEach((e=>{e&&e.widgetAdded.connect(((e,t)=>{m.addWidget(t),m.tabBar.addTab(t.title),m.currentWidget=t}))})),m}},E=[F,S,T,I,_]}}]);