notebook 7.1.1__py3-none-any.whl → 7.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (173) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/1198.bundle.js +1 -1
  3. notebook/static/131.bundle.js +1 -1
  4. notebook/static/1337.bundle.js +1 -1
  5. notebook/static/134.bundle.js +1 -1
  6. notebook/static/1408.bundle.js +1 -1
  7. notebook/static/1496.bundle.js +1 -1
  8. notebook/static/1647.bundle.js +1 -1
  9. notebook/static/1650.bundle.js +1 -1
  10. notebook/static/1664.bundle.js +17 -17
  11. notebook/static/1682.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1809.bundle.js +1 -1
  14. notebook/static/1827.bundle.js +1 -1
  15. notebook/static/1833.bundle.js +1 -1
  16. notebook/static/1835.bundle.js +1 -1
  17. notebook/static/1950.bundle.js +1 -1
  18. notebook/static/1958.bundle.js +1 -1
  19. notebook/static/2007.bundle.js +1 -1
  20. notebook/static/2067.bundle.js +1 -1
  21. notebook/static/2088.bundle.js +1 -1
  22. notebook/static/2089.bundle.js +1 -1
  23. notebook/static/2122.bundle.js +1 -1
  24. notebook/static/2167.bundle.js +1 -1
  25. notebook/static/2184.bundle.js +1 -1
  26. notebook/static/2311.bundle.js +1 -1
  27. notebook/static/2401.bundle.js +1 -1
  28. notebook/static/2479.bundle.js +1 -1
  29. notebook/static/2489.bundle.js +1 -1
  30. notebook/static/2512.bundle.js +1 -1
  31. notebook/static/2577.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2615.bundle.js +1 -1
  34. notebook/static/2682.bundle.js +1 -1
  35. notebook/static/2866.bundle.js +1 -1
  36. notebook/static/2924.bundle.js +1 -1
  37. notebook/static/2944.bundle.js +1 -1
  38. notebook/static/3129.bundle.js +1 -1
  39. notebook/static/3146.bundle.js +1 -1
  40. notebook/static/3187.bundle.js +1 -1
  41. notebook/static/3213.bundle.js +1 -1
  42. notebook/static/3301.bundle.js +1 -1
  43. notebook/static/3340.bundle.js +1 -1
  44. notebook/static/3360.bundle.js +1 -1
  45. notebook/static/3466.bundle.js +1 -1
  46. notebook/static/3512.bundle.js +1 -1
  47. notebook/static/3654.bundle.js +1 -1
  48. notebook/static/3676.bundle.js +1 -1
  49. notebook/static/3680.bundle.js +1 -1
  50. notebook/static/3768.bundle.js +1 -1
  51. notebook/static/377.bundle.js +1 -1
  52. notebook/static/3863.bundle.js +1 -1
  53. notebook/static/3881.bundle.js +1 -1
  54. notebook/static/4042.bundle.js +1 -1
  55. notebook/static/4212.bundle.js +1 -1
  56. notebook/static/4382.bundle.js +1 -1
  57. notebook/static/4558.bundle.js +1 -1
  58. notebook/static/4645.bundle.js +1 -1
  59. notebook/static/4811.bundle.js +1 -1
  60. notebook/static/4837.bundle.js +1 -0
  61. notebook/static/5088.bundle.js +1 -1
  62. notebook/static/5099.bundle.js +1 -1
  63. notebook/static/5135.bundle.js +1 -1
  64. notebook/static/514.bundle.js +1 -1
  65. notebook/static/5263.bundle.js +1 -0
  66. notebook/static/5313.bundle.js +1 -1
  67. notebook/static/5325.bundle.js +1 -1
  68. notebook/static/5346.bundle.js +1 -1
  69. notebook/static/5426.bundle.js +1 -1
  70. notebook/static/5573.bundle.js +1 -1
  71. notebook/static/5601.bundle.js +1 -1
  72. notebook/static/5649.bundle.js +3 -3
  73. notebook/static/5733.bundle.js +1 -1
  74. notebook/static/5912.bundle.js +1 -1
  75. notebook/static/5921.bundle.js +1 -1
  76. notebook/static/6017.bundle.js +1 -1
  77. notebook/static/6139.bundle.js +1 -1
  78. notebook/static/62.bundle.js +1 -1
  79. notebook/static/6256.bundle.js +1 -1
  80. notebook/static/6345.bundle.js +1 -1
  81. notebook/static/6604.bundle.js +1 -1
  82. notebook/static/6621.bundle.js +1 -1
  83. notebook/static/6627.bundle.js +1 -1
  84. notebook/static/6815.bundle.js +1 -1
  85. notebook/static/6893.bundle.js +1 -1
  86. notebook/static/690.bundle.js +1 -1
  87. notebook/static/6962.bundle.js +1 -1
  88. notebook/static/6999.bundle.js +1 -1
  89. notebook/static/7226.bundle.js +1 -1
  90. notebook/static/7252.bundle.js +1 -1
  91. notebook/static/7302.bundle.js +1 -1
  92. notebook/static/7386.bundle.js +1 -1
  93. notebook/static/7391.bundle.js +1 -1
  94. notebook/static/7394.bundle.js +1 -1
  95. notebook/static/755.bundle.js +1 -1
  96. notebook/static/7603.bundle.js +1 -1
  97. notebook/static/7639.bundle.js +1 -1
  98. notebook/static/7684.bundle.js +1 -1
  99. notebook/static/7812.bundle.js +1 -1
  100. notebook/static/7819.bundle.js +1 -1
  101. notebook/static/7900.bundle.js +1 -1
  102. notebook/static/7906.bundle.js +1 -1
  103. notebook/static/7995.bundle.js +1 -1
  104. notebook/static/853.bundle.js +1 -0
  105. notebook/static/8579.bundle.js +1 -1
  106. notebook/static/8633.bundle.js +1 -1
  107. notebook/static/8771.bundle.js +1 -1
  108. notebook/static/8781.bundle.js +1 -1
  109. notebook/static/8875.bundle.js +1 -1
  110. notebook/static/8907.bundle.js +1 -1
  111. notebook/static/8928.bundle.js +1 -1
  112. notebook/static/8929.bundle.js +1 -1
  113. notebook/static/893.bundle.js +1 -1
  114. notebook/static/901.bundle.js +1 -1
  115. notebook/static/9068.bundle.js +1 -1
  116. notebook/static/911.bundle.js +1 -1
  117. notebook/static/9151.bundle.js +1 -1
  118. notebook/static/9161.bundle.js +1 -1
  119. notebook/static/9268.bundle.js +1 -1
  120. notebook/static/9335.bundle.js +1 -1
  121. notebook/static/9341.bundle.js +1 -1
  122. notebook/static/9380.bundle.js +1 -1
  123. notebook/static/9605.bundle.js +1 -1
  124. notebook/static/9638.bundle.js +1 -1
  125. notebook/static/9680.bundle.js +1 -1
  126. notebook/static/9685.bundle.js +1 -1
  127. notebook/static/9752.bundle.js +1 -1
  128. notebook/static/9821.bundle.js +1 -1
  129. notebook/static/9852.bundle.js +1 -1
  130. notebook/static/bundle.js +1 -1
  131. notebook/static/third-party-licenses.json +99 -99
  132. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  133. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  134. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  135. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  136. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  137. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  138. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  139. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/355.1213f16419258c4671ec.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/246.7bfc2ac5bb3d27d6e0b9.js +1 -1
  140. notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6e8d43b976f4be45b3d2.js +1 -0
  141. notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.65b9457e7bb7d428c0a7.js +1 -0
  142. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.d3d4e56f2f961c2c2a13.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +1 -1
  143. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.330dffb5180b5b71100a.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.832d780237fca436ff92.js +1 -1
  144. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  145. {notebook-7.1.1.dist-info → notebook-7.1.2.dist-info}/METADATA +1 -1
  146. {notebook-7.1.1.dist-info → notebook-7.1.2.dist-info}/RECORD +168 -168
  147. notebook/static/4131.bundle.js +0 -1
  148. notebook/static/6853.bundle.js +0 -1
  149. notebook/static/771.bundle.js +0 -1
  150. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.c74a681c6a303d4da718.js +0 -1
  151. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.32f48ad22cd5f6a8da04.js +0 -1
  152. {notebook-7.1.1.data → notebook-7.1.2.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  153. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  154. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  155. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  156. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  157. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  158. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  159. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  160. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  161. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  162. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  163. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  164. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  165. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  166. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  167. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  168. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  169. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  170. {notebook-7.1.1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  171. {notebook-7.1.1.dist-info → notebook-7.1.2.dist-info}/WHEEL +0 -0
  172. {notebook-7.1.1.dist-info → notebook-7.1.2.dist-info}/entry_points.txt +0 -0
  173. {notebook-7.1.1.dist-info → notebook-7.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3881],{92871:(e,t,a)=>{a.r(t),a.d(t,{DEFAULT_CONTEXT_ITEM_RANK:()=>f,default:()=>D});var o=a(49880),i=a(57797),n=a(74787),r=a(14837),l=a(6312),s=a(78956),d=a(22629),c=a(11523),u=a(52018),p=a(33625),g=a(20998),m=a(32895),b=a(2549),h=a(31516),v=a(78156);const y={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:!0,requires:[l.ISettingRegistry,i.IToolbarWidgetRegistry],optional:[c.ITranslator],activate:(e,t,a,o)=>{const n=new u.Toolbar;n.id="jp-top-bar",(0,i.setToolbar)(n,(0,i.createToolbarFactory)(a,t,"TopBar",y.id,null!=o?o:c.nullTranslator),n),e.shell.add(n,"top",{rank:900})}},f=100;var _;!function(e){e.activateNextTab="application:activate-next-tab",e.activatePreviousTab="application:activate-previous-tab",e.activateNextTabBar="application:activate-next-tab-bar",e.activatePreviousTabBar="application:activate-previous-tab-bar",e.close="application:close",e.closeOtherTabs="application:close-other-tabs",e.closeRightTabs="application:close-right-tabs",e.closeAll="application:close-all",e.setMode="application:set-mode",e.showPropertyPanel="property-inspector:show-panel",e.resetLayout="application:reset-layout",e.toggleHeader="application:toggle-header",e.toggleMode="application:toggle-mode",e.toggleLeftArea="application:toggle-left-area",e.toggleRightArea="application:toggle-right-area",e.toggleSideTabBar="application:toggle-side-tabbar",e.toggleSidebarWidget="application:toggle-sidebar-widget",e.togglePresentationMode="application:toggle-presentation-mode",e.tree="router:tree",e.switchSidebar="sidebar:switch"}(_||(_={}));const x={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:!0,requires:[c.ITranslator],optional:[o.ILabShell,i.ICommandPalette],activate:(e,t,a,i)=>{const{commands:r,shell:l}=e,s=t.load("jupyterlab"),d=s.__("Main Area");r.addCommand(o.JupyterFrontEndContextMenu.contextMenu,{label:s.__("Shift+Right Click for Browser Menu"),isEnabled:()=>!1,execute:()=>{}});const c=()=>{const t=e.contextMenuHitTest((e=>!!e.dataset.id));return t&&(0,p.find)(l.widgets("main"),(e=>e.id===t.dataset.id))||l.currentWidget},u=(e,t)=>{if("tab-area"===e.type)return e.widgets.includes(t)?e:null;if("split-area"===e.type)for(const a of e.children){const e=u(a,t);if(e)return e}return null},g=e=>{const{id:t}=e,o=(e=>{var t;const o=null==a?void 0:a.saveLayout(),i=null==o?void 0:o.mainArea;if(!i||"multiple-document"!==n.PageConfig.getOption("mode"))return null;const r=null===(t=i.dock)||void 0===t?void 0:t.main;return r?u(r,e):null})(e),i=o&&o.widgets||[],r=i.findIndex((e=>e.id===t));return r<0?[]:i.slice(r+1)};function m(e){e&&e.focus()}r.addCommand(_.close,{label:()=>s.__("Close Tab"),isEnabled:()=>{const e=c();return!!e&&e.title.closable},execute:()=>{const e=c();e&&e.close()}}),r.addCommand(_.closeOtherTabs,{label:()=>s.__("Close All Other Tabs"),isEnabled:()=>(0,p.some)(l.widgets("main"),((e,t)=>1===t)),execute:()=>{const e=c();if(!e)return;const{id:t}=e;for(const e of l.widgets("main"))e.id!==t&&e.close()}}),r.addCommand(_.closeRightTabs,{label:()=>s.__("Close Tabs to Right"),isEnabled:()=>!!c()&&g(c()).length>0,execute:()=>{const e=c();e&&g(e).forEach((e=>e.close()))}}),a&&(r.addCommand(_.activateNextTab,{label:s.__("Activate Next Tab"),execute:()=>{a.activateNextTab()}}),r.addCommand(_.activatePreviousTab,{label:s.__("Activate Previous Tab"),execute:()=>{a.activatePreviousTab()}}),r.addCommand(_.activateNextTabBar,{label:s.__("Activate Next Tab Bar"),execute:()=>{a.activateNextTabBar()}}),r.addCommand(_.activatePreviousTabBar,{label:s.__("Activate Previous Tab Bar"),execute:()=>{a.activatePreviousTabBar()}}),r.addCommand(_.closeAll,{label:s.__("Close All Tabs"),execute:()=>{a.closeAll()}}),r.addCommand(_.toggleHeader,{label:s.__("Show Header"),execute:()=>{"single-document"===a.mode&&a.toggleTopInSimpleModeVisibility()},isToggled:()=>a.isTopInSimpleModeVisible(),isVisible:()=>"single-document"===a.mode}),r.addCommand(_.toggleLeftArea,{label:s.__("Show Left Sidebar"),execute:()=>{a.leftCollapsed?a.expandLeft():(a.collapseLeft(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.leftCollapsed,isEnabled:()=>!a.isEmpty("left")}),r.addCommand(_.toggleRightArea,{label:s.__("Show Right Sidebar"),execute:()=>{a.rightCollapsed?a.expandRight():(a.collapseRight(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.rightCollapsed,isEnabled:()=>!a.isEmpty("right")}),r.addCommand(_.toggleSidebarWidget,{label:s.__("Toggle Sidebar Element"),execute:e=>{const t=parseInt(e.index,10);if("left"!=e.side&&"right"!=e.side)throw Error(`Unsupported sidebar: ${e.side}`);const o=Array.from(a.widgets(e.side));if(t>=o.length)return;const i=o[t].id,n=document.querySelector("[data-id='"+i+"']");(e=>{let t;if("left"!=e&&"right"!=e)throw Error(`Unsupported sidebar: ${e}`);if("left"===e)t=document.querySelector(".lm-TabBar-tab.lm-mod-current");else{const e=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");t=e[e.length-1]}const a=null==t?void 0:t.getAttribute("data-id");return a?null==a?void 0:a.toString():""})(e.side)===i?("left"==e.side&&(a.collapseLeft(),m(n)),"right"==e.side&&(a.collapseRight(),m(n))):(a.activateById(i),m(n))}}),r.addCommand(_.toggleSideTabBar,{label:e=>"right"===e.side?s.__("Show Right Activity Bar"):s.__("Show Left Activity Bar"),execute:e=>{"right"===e.side?a.toggleSideTabBarVisibility("right"):a.toggleSideTabBarVisibility("left")},isToggled:e=>"right"===e.side?a.isSideTabBarVisible("right"):a.isSideTabBarVisible("left"),isEnabled:e=>"right"===e.side?!a.isEmpty("right"):!a.isEmpty("left")}),r.addCommand(_.togglePresentationMode,{label:()=>s.__("Presentation Mode"),execute:()=>{a.presentationMode=!a.presentationMode},isToggled:()=>a.presentationMode,isVisible:()=>!0}),r.addCommand(_.setMode,{label:e=>e.mode?s.__("Set %1 mode.",e.mode):s.__("Set the layout `mode`."),caption:s.__('The layout `mode` can be "single-document" or "multiple-document".'),isVisible:e=>{const t=e.mode;return"single-document"===t||"multiple-document"===t},execute:e=>{const t=e.mode;if("single-document"!==t&&"multiple-document"!==t)throw new Error(`Unsupported application shell mode: ${t}`);a.mode=t}}),r.addCommand(_.toggleMode,{label:s.__("Simple Interface"),isToggled:()=>"single-document"===a.mode,execute:()=>{const e="multiple-document"===a.mode?{mode:"single-document"}:{mode:"multiple-document"};return r.execute(_.setMode,e)}}),r.addCommand(_.resetLayout,{label:s.__("Reset Default Layout"),execute:()=>{a.presentationMode&&r.execute(_.togglePresentationMode).catch((e=>{console.error("Failed to undo presentation mode.",e)})),"single-document"!==a.mode||a.isTopInSimpleModeVisible()||r.execute(_.toggleHeader).catch((e=>{console.error("Failed to display title header.",e)})),["left","right"].forEach((e=>{a.isSideTabBarVisible(e)||a.isEmpty(e)||r.execute(_.toggleSideTabBar,{side:e}).catch((t=>{console.error(`Failed to show ${e} activity bar.`,t)}))}))}})),i&&([_.activateNextTab,_.activatePreviousTab,_.activateNextTabBar,_.activatePreviousTabBar,_.close,_.closeAll,_.closeOtherTabs,_.closeRightTabs,_.toggleHeader,_.toggleLeftArea,_.toggleRightArea,_.togglePresentationMode,_.toggleMode,_.resetLayout].forEach((e=>i.addItem({command:e,category:d}))),["right","left"].forEach((e=>{i.addItem({command:_.toggleSideTabBar,category:d,args:{side:e}})})))}},S={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[o.IRouter,i.IWindowResolver,c.ITranslator,o.JupyterFrontEnd.ITreeResolver],optional:[o.IConnectionLost],provides:o.ITreePathUpdater,activate:(e,t,a,r,l,s)=>{const d=r.load("jupyterlab");if(!(e instanceof o.JupyterLab))throw new Error(`${S.id} must be activated in JupyterLab.`);let c="",u="";const p=a.name;if(console.debug(`Starting application in workspace: "${p}"`),0!==e.registerPluginErrors.length){const t=v.createElement("pre",null,e.registerPluginErrors.map((e=>e.message)).join("\n"));(0,i.showErrorMessage)(d.__("Error Registering Plugins"),{message:t})}e.shell.layoutModified.connect((()=>{e.commands.notifyCommandChanged()})),e.shell.modeChanged.connect(((e,a)=>{const o=n.PageConfig.getUrl({mode:a}),i=n.URLExt.parse(o).pathname;t.navigate(i,{skipRouting:!0}),n.PageConfig.setOption("mode",a)})),l.paths.then((()=>{e.shell.currentPathChanged.connect(((e,a)=>{const o=a.newValue,i=o||u,r=n.PageConfig.getUrl({treePath:i}),l=n.URLExt.parse(r).pathname;t.navigate(l,{skipRouting:!0}),n.PageConfig.setOption("treePath",i),c=o}))})),s=s||o.ConnectionLost,e.serviceManager.connectionFailure.connect(((e,t)=>s(e,t,r)));const g=e.serviceManager.builder,m=()=>g.build().then((()=>(0,i.showDialog)({title:d.__("Build Complete"),body:v.createElement("div",null,d.__("Build successfully completed, reload page?"),v.createElement("br",null),d.__("You will lose any unsaved changes.")),buttons:[i.Dialog.cancelButton({label:d.__("Reload Without Saving"),actions:["reload"]}),i.Dialog.okButton({label:d.__("Save and Reload")})],hasClose:!0}))).then((({button:{accept:a,actions:o}})=>{a?e.commands.execute("docmanager:save").then((()=>{t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Save Failed"),{message:v.createElement("pre",null,e.message)})})):o.includes("reload")&&t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Build Failed"),{message:v.createElement("pre",null,e.message)})}));return g.isAvailable&&g.shouldCheck&&g.getStatus().then((e=>{if("building"===e.status)return m();if("needed"!==e.status)return;const t=v.createElement("div",null,d.__("JupyterLab build is suggested:"),v.createElement("br",null),v.createElement("pre",null,e.message));(0,i.showDialog)({title:d.__("Build Recommended"),body:t,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:d.__("Build")})]}).then((e=>e.button.accept?m():void 0))})),function(e){l.paths.then((()=>{if(u=e,!c){const a=n.PageConfig.getUrl({treePath:e}),o=n.URLExt.parse(a).pathname;t.navigate(o,{skipRouting:!0}),n.PageConfig.setOption("treePath",e)}}))}},autoStart:!0},w={id:"@jupyterlab/application-extension:context-menu",description:"Populates the context menu.",autoStart:!0,requires:[l.ISettingRegistry,c.ITranslator],activate:(e,t,a)=>{const o=a.load("jupyterlab");function i(t){const a=new u.RankedMenu({...t,commands:e.commands});return t.label&&(a.title.label=o.__(t.label)),a}e.started.then((()=>O.loadSettingsContextMenu(e.contextMenu,t,i,a))).catch((e=>{console.error("Failed to load context menu items from settings registry.",e)}))}},T={id:"@jupyterlab/application-extension:dirty",description:"Adds safeguard dialog when closing the browser tab with unsaved modifications.",autoStart:!0,requires:[c.ITranslator],activate:(e,t)=>{if(!(e instanceof o.JupyterLab))throw new Error(`${T.id} must be activated in JupyterLab.`);const a=t.load("jupyterlab").__("Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.");window.addEventListener("beforeunload",(t=>{if(e.status.isDirty)return t.returnValue=a}))}},I={id:"@jupyterlab/application-extension:layout",description:"Provides the shell layout restorer.",requires:[s.IStateDB,o.ILabShell,l.ISettingRegistry],optional:[c.ITranslator],activate:(e,t,a,r,l)=>{const s=(null!=l?l:c.nullTranslator).load("jupyterlab"),d=e.started,u=e.commands,p=n.PageConfig.getOption("mode"),m=new o.LayoutRestorer({connector:t,first:d,registry:u,mode:p});return r.load(R.id).then((t=>{var o,i;const n=t.composite.layout;a.restoreLayout(p,m,{"multiple-document":null!==(o=n.multiple)&&void 0!==o?o:{},"single-document":null!==(i=n.single)&&void 0!==i?i:{}}).then((()=>{a.layoutModified.connect((()=>{m.save(a.saveLayout())})),t.changed.connect(b),O.activateSidebarSwitcher(e,a,t,s)}))})).catch((e=>{console.error("Fail to load settings for the layout restorer."),console.error(e)})),m;async function b(e){g.JSONExt.deepEqual(e.composite.layout,{single:a.userLayout["single-document"],multiple:a.userLayout["multiple-document"]})||(await(0,i.showDialog)({title:s.__("Information"),body:s.__("User layout customization has changed. You may need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Reload")})]})).button.accept&&location.reload()}},autoStart:!0,provides:o.ILayoutRestorer},E={id:"@jupyterlab/application-extension:router",description:"Provides the URL router",requires:[o.JupyterFrontEnd.IPaths],activate:(e,t)=>{const{commands:a}=e,i=t.urls.base,n=new o.Router({base:i,commands:a});return e.started.then((()=>{n.route(),window.addEventListener("popstate",(()=>{n.route()}))})),n},autoStart:!0,provides:o.IRouter},C={id:"@jupyterlab/application-extension:tree-resolver",description:"Provides the tree route resolver",autoStart:!0,requires:[o.IRouter],provides:o.JupyterFrontEnd.ITreeResolver,activate:(e,t)=>{const{commands:a}=e,o=new b.DisposableSet,i=new g.PromiseDelegate,r=new RegExp("/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?");o.add(a.addCommand(_.tree,{execute:async e=>{var t;if(o.isDisposed)return;const a=n.URLExt.queryStringToObject(null!==(t=e.search)&&void 0!==t?t:""),r=a["file-browser-path"]||"";delete a["file-browser-path"],o.dispose(),i.resolve({browser:r,file:n.PageConfig.getOption("treePath")})}})),o.add(t.register({command:_.tree,pattern:r}));const l=()=>{o.isDisposed||(o.dispose(),i.resolve(null))};return t.routed.connect(l),o.add(new b.DisposableDelegate((()=>{t.routed.disconnect(l)}))),{paths:i.promise}}},P={id:"@jupyterlab/application-extension:notfound",description:"Defines the behavior for not found URL (aka route).",requires:[o.JupyterFrontEnd.IPaths,o.IRouter,c.ITranslator],activate:(e,t,a,o)=>{const n=o.load("jupyterlab"),r=t.urls.notFound;if(!r)return;const l=a.base,s=n.__("The path: %1 was not found. JupyterLab redirected to: %2",r,l);a.navigate(""),(0,i.showErrorMessage)(n.__("Path Not Found"),{message:s})},autoStart:!0},L={id:"@jupyterlab/application-extension:faviconbusy",description:"Handles the favicon depending on the application status.",requires:[o.ILabStatus],activate:async(e,t)=>{t.busySignal.connect(((e,t)=>{const a=document.querySelector('link[rel="icon"]'+(t?".idle.favicon":".busy.favicon"));if(!a)return;const o=document.querySelector("link"+(t?".busy.favicon":".idle.favicon"));o&&a!==o&&(a.rel="",o.rel="icon",o.parentNode.replaceChild(o,o))}))},autoStart:!0},R={id:"@jupyterlab/application-extension:shell",description:"Provides the JupyterLab shell. It has an extended API compared to `app.shell`.",optional:[l.ISettingRegistry],activate:(e,t)=>{if(!(e.shell instanceof o.LabShell))throw new Error(`${R.id} did not find a LabShell instance.`);return t&&t.load(R.id).then((t=>{e.shell.updateConfig(t.composite),t.changed.connect((()=>{e.shell.updateConfig(t.composite)}))})),e.shell},autoStart:!0,provides:o.ILabShell},B={id:"@jupyterlab/application-extension:status",description:"Provides the application status.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${B.id} must be activated in JupyterLab.`);return e.status},autoStart:!0,provides:o.ILabStatus},M={id:"@jupyterlab/application-extension:info",description:"Provides the application information.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${M.id} must be activated in JupyterLab.`);return e.info},autoStart:!0,provides:o.JupyterLab.IInfo},j={id:"@jupyterlab/application-extension:paths",description:"Provides the application paths.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${j.id} must be activated in JupyterLab.`);return e.paths},autoStart:!0,provides:o.JupyterFrontEnd.IPaths},A={id:"@jupyterlab/application-extension:property-inspector",description:"Provides the property inspector.",autoStart:!0,requires:[o.ILabShell,c.ITranslator],optional:[o.ILayoutRestorer],provides:r.IPropertyInspectorProvider,activate:(e,t,a,o)=>{const i=a.load("jupyterlab"),n=new r.SideBarPropertyInspectorProvider({shell:t,translator:a});return n.title.icon=u.buildIcon,n.title.caption=i.__("Property Inspector"),n.id="jp-property-inspector",t.add(n,"right",{rank:100,type:"Property Inspector"}),e.commands.addCommand(_.showPropertyPanel,{label:i.__("Property Inspector"),execute:()=>{t.activateById(n.id)}}),o&&o.add(n,"jp-property-inspector"),n}},k={id:"@jupyterlab/application-extension:logo",description:"Sets the application logo.",autoStart:!0,requires:[o.ILabShell],activate:(e,t)=>{const a=new h.Widget;u.jupyterIcon.element({container:a.node,elementPosition:"center",margin:"2px 2px 2px 8px",height:"auto",width:"16px"}),a.id="jp-MainLogo",t.add(a,"top",{rank:0})}},J={id:"@jupyterlab/application-extension:mode-switch",description:"Adds the interface mode switch",requires:[o.ILabShell,c.ITranslator],optional:[d.IStatusBar,l.ISettingRegistry],activate:(e,t,a,o,i)=>{if(null===o)return;const n=a.load("jupyterlab"),r=new u.Switch;if(r.id="jp-single-document-mode",r.valueChanged.connect(((e,a)=>{t.mode=a.newValue?"single-document":"multiple-document"})),t.modeChanged.connect(((e,t)=>{r.value="single-document"===t})),i){const a=i.load(R.id),o=e=>{const a=e.get("startMode").composite;a&&(t.mode="single"===a?"single-document":"multiple-document")};Promise.all([a,e.restored]).then((([e])=>{o(e)})).catch((e=>{console.error(e.message)}))}const l=()=>{const t=e.commands.keyBindings.find((e=>"application:toggle-mode"===e.command));if(t){const e=t.keys.map(m.CommandRegistry.formatKeystroke).join(", ");r.caption=n.__("Simple Interface (%1)",e)}else r.caption=n.__("Simple Interface")};l(),e.commands.keyBindingChanged.connect((()=>{l()})),r.label=n.__("Simple"),o.registerStatusItem(J.id,{priority:1,item:r,align:"left",rank:-1})},autoStart:!0},D=[w,T,S,x,I,E,C,P,L,R,B,M,J,j,A,k,y];var O;!function(e){async function t(e){(await(0,i.showDialog)({title:e.__("Information"),body:e.__("Context menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsContextMenu=async function(e,a,o,n){var r;const s=n.load("jupyterlab"),d=w.id;let c=null,u={};function p(e){var t,o;u={};const i=Object.keys(a.plugins).map((e=>{var t,o;const i=null!==(o=null===(t=a.plugins[e].schema["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[];return u[e]=i,i})).concat([null!==(o=null===(t=e["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[]]).reduceRight(((e,t)=>l.SettingRegistry.reconcileItems(e,t,!0)),[]);e.properties.contextMenu.default=l.SettingRegistry.reconcileItems(i,e.properties.contextMenu.default,!0).sort(((e,t)=>{var a,o;return(null!==(a=e.rank)&&void 0!==a?a:1/0)-(null!==(o=t.rank)&&void 0!==o?o:1/0)}))}a.transform(d,{compose:e=>{var t,a,o,i;c||(c=g.JSONExt.deepCopy(e.schema),p(c));const n=null!==(o=null===(a=null===(t=c.properties)||void 0===t?void 0:t.contextMenu)||void 0===a?void 0:a.default)&&void 0!==o?o:[],r={...e.data.user,contextMenu:null!==(i=e.data.user.contextMenu)&&void 0!==i?i:[]},s={...e.data.composite,contextMenu:l.SettingRegistry.reconcileItems(n,r.contextMenu,!1)};return e.data={composite:s,user:r},e},fetch:e=>(c||(c=g.JSONExt.deepCopy(e.schema),p(c)),{data:e.data,id:e.id,raw:e.raw,schema:c,version:e.version})});const m=await a.load(d),b=null!==(r=m.composite.contextMenu)&&void 0!==r?r:[];l.SettingRegistry.filterDisabledItems(b).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)})),m.changed.connect((()=>{var e;const a=null!==(e=m.composite.contextMenu)&&void 0!==e?e:[];g.JSONExt.deepEqual(b,a)||t(s)})),a.pluginChanged.connect((async(n,r)=>{var c,p,m,h;if(r!==d){const n=null!==(c=u[r])&&void 0!==c?c:[],d=null!==(m=null===(p=a.plugins[r].schema["jupyter.lab.menus"])||void 0===p?void 0:p.context)&&void 0!==m?m:[];if(!g.JSONExt.deepEqual(n,d))if(u[r])await t(s);else{u[r]=g.JSONExt.deepCopy(d);const t=null!==(h=l.SettingRegistry.reconcileItems(d,b,!1,!1))&&void 0!==h?h:[];l.SettingRegistry.filterDisabledItems(t).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)}))}}}))},e.activateSidebarSwitcher=function(e,t,a,o){e.commands.addCommand(_.switchSidebar,{label:o.__("Switch Sidebar Side"),execute:()=>{const o=e.contextMenuHitTest((e=>!!e.dataset.id));if(!o)return;const i=o.dataset.id,n=document.getElementById("jp-left-stack"),r=document.getElementById(i);let l=null;if(n&&r&&n.contains(r)){const e=(0,p.find)(t.widgets("left"),(e=>e.id===i));e&&(l=t.move(e,"right"),t.activateById(e.id))}else{const e=(0,p.find)(t.widgets("right"),(e=>e.id===i));e&&(l=t.move(e,"left"),t.activateById(e.id))}l&&a.set("layout",{single:l["single-document"],multiple:l["multiple-document"]}).catch((e=>{console.error("Failed to save user layout customization.",e)}))}}),e.commands.commandExecuted.connect(((e,t)=>{t.id===_.resetLayout&&a.remove("layout").catch((e=>{console.error("Failed to remove user layout customization.",e)}))}))}}(O||(O={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3881],{92871:(e,t,a)=>{a.r(t),a.d(t,{DEFAULT_CONTEXT_ITEM_RANK:()=>f,default:()=>D});var o=a(3053),i=a(12982),n=a(38639),r=a(98037),l=a(36768),s=a(66853),d=a(34276),c=a(71677),u=a(68239),p=a(33625),g=a(20998),m=a(32895),b=a(2549),h=a(31516),v=a(78156);const y={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:!0,requires:[l.ISettingRegistry,i.IToolbarWidgetRegistry],optional:[c.ITranslator],activate:(e,t,a,o)=>{const n=new u.Toolbar;n.id="jp-top-bar",(0,i.setToolbar)(n,(0,i.createToolbarFactory)(a,t,"TopBar",y.id,null!=o?o:c.nullTranslator),n),e.shell.add(n,"top",{rank:900})}},f=100;var _;!function(e){e.activateNextTab="application:activate-next-tab",e.activatePreviousTab="application:activate-previous-tab",e.activateNextTabBar="application:activate-next-tab-bar",e.activatePreviousTabBar="application:activate-previous-tab-bar",e.close="application:close",e.closeOtherTabs="application:close-other-tabs",e.closeRightTabs="application:close-right-tabs",e.closeAll="application:close-all",e.setMode="application:set-mode",e.showPropertyPanel="property-inspector:show-panel",e.resetLayout="application:reset-layout",e.toggleHeader="application:toggle-header",e.toggleMode="application:toggle-mode",e.toggleLeftArea="application:toggle-left-area",e.toggleRightArea="application:toggle-right-area",e.toggleSideTabBar="application:toggle-side-tabbar",e.toggleSidebarWidget="application:toggle-sidebar-widget",e.togglePresentationMode="application:toggle-presentation-mode",e.tree="router:tree",e.switchSidebar="sidebar:switch"}(_||(_={}));const x={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:!0,requires:[c.ITranslator],optional:[o.ILabShell,i.ICommandPalette],activate:(e,t,a,i)=>{const{commands:r,shell:l}=e,s=t.load("jupyterlab"),d=s.__("Main Area");r.addCommand(o.JupyterFrontEndContextMenu.contextMenu,{label:s.__("Shift+Right Click for Browser Menu"),isEnabled:()=>!1,execute:()=>{}});const c=()=>{const t=e.contextMenuHitTest((e=>!!e.dataset.id));return t&&(0,p.find)(l.widgets("main"),(e=>e.id===t.dataset.id))||l.currentWidget},u=(e,t)=>{if("tab-area"===e.type)return e.widgets.includes(t)?e:null;if("split-area"===e.type)for(const a of e.children){const e=u(a,t);if(e)return e}return null},g=e=>{const{id:t}=e,o=(e=>{var t;const o=null==a?void 0:a.saveLayout(),i=null==o?void 0:o.mainArea;if(!i||"multiple-document"!==n.PageConfig.getOption("mode"))return null;const r=null===(t=i.dock)||void 0===t?void 0:t.main;return r?u(r,e):null})(e),i=o&&o.widgets||[],r=i.findIndex((e=>e.id===t));return r<0?[]:i.slice(r+1)};function m(e){e&&e.focus()}r.addCommand(_.close,{label:()=>s.__("Close Tab"),isEnabled:()=>{const e=c();return!!e&&e.title.closable},execute:()=>{const e=c();e&&e.close()}}),r.addCommand(_.closeOtherTabs,{label:()=>s.__("Close All Other Tabs"),isEnabled:()=>(0,p.some)(l.widgets("main"),((e,t)=>1===t)),execute:()=>{const e=c();if(!e)return;const{id:t}=e;for(const e of l.widgets("main"))e.id!==t&&e.close()}}),r.addCommand(_.closeRightTabs,{label:()=>s.__("Close Tabs to Right"),isEnabled:()=>!!c()&&g(c()).length>0,execute:()=>{const e=c();e&&g(e).forEach((e=>e.close()))}}),a&&(r.addCommand(_.activateNextTab,{label:s.__("Activate Next Tab"),execute:()=>{a.activateNextTab()}}),r.addCommand(_.activatePreviousTab,{label:s.__("Activate Previous Tab"),execute:()=>{a.activatePreviousTab()}}),r.addCommand(_.activateNextTabBar,{label:s.__("Activate Next Tab Bar"),execute:()=>{a.activateNextTabBar()}}),r.addCommand(_.activatePreviousTabBar,{label:s.__("Activate Previous Tab Bar"),execute:()=>{a.activatePreviousTabBar()}}),r.addCommand(_.closeAll,{label:s.__("Close All Tabs"),execute:()=>{a.closeAll()}}),r.addCommand(_.toggleHeader,{label:s.__("Show Header"),execute:()=>{"single-document"===a.mode&&a.toggleTopInSimpleModeVisibility()},isToggled:()=>a.isTopInSimpleModeVisible(),isVisible:()=>"single-document"===a.mode}),r.addCommand(_.toggleLeftArea,{label:s.__("Show Left Sidebar"),execute:()=>{a.leftCollapsed?a.expandLeft():(a.collapseLeft(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.leftCollapsed,isEnabled:()=>!a.isEmpty("left")}),r.addCommand(_.toggleRightArea,{label:s.__("Show Right Sidebar"),execute:()=>{a.rightCollapsed?a.expandRight():(a.collapseRight(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.rightCollapsed,isEnabled:()=>!a.isEmpty("right")}),r.addCommand(_.toggleSidebarWidget,{label:s.__("Toggle Sidebar Element"),execute:e=>{const t=parseInt(e.index,10);if("left"!=e.side&&"right"!=e.side)throw Error(`Unsupported sidebar: ${e.side}`);const o=Array.from(a.widgets(e.side));if(t>=o.length)return;const i=o[t].id,n=document.querySelector("[data-id='"+i+"']");(e=>{let t;if("left"!=e&&"right"!=e)throw Error(`Unsupported sidebar: ${e}`);if("left"===e)t=document.querySelector(".lm-TabBar-tab.lm-mod-current");else{const e=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");t=e[e.length-1]}const a=null==t?void 0:t.getAttribute("data-id");return a?null==a?void 0:a.toString():""})(e.side)===i?("left"==e.side&&(a.collapseLeft(),m(n)),"right"==e.side&&(a.collapseRight(),m(n))):(a.activateById(i),m(n))}}),r.addCommand(_.toggleSideTabBar,{label:e=>"right"===e.side?s.__("Show Right Activity Bar"):s.__("Show Left Activity Bar"),execute:e=>{"right"===e.side?a.toggleSideTabBarVisibility("right"):a.toggleSideTabBarVisibility("left")},isToggled:e=>"right"===e.side?a.isSideTabBarVisible("right"):a.isSideTabBarVisible("left"),isEnabled:e=>"right"===e.side?!a.isEmpty("right"):!a.isEmpty("left")}),r.addCommand(_.togglePresentationMode,{label:()=>s.__("Presentation Mode"),execute:()=>{a.presentationMode=!a.presentationMode},isToggled:()=>a.presentationMode,isVisible:()=>!0}),r.addCommand(_.setMode,{label:e=>e.mode?s.__("Set %1 mode.",e.mode):s.__("Set the layout `mode`."),caption:s.__('The layout `mode` can be "single-document" or "multiple-document".'),isVisible:e=>{const t=e.mode;return"single-document"===t||"multiple-document"===t},execute:e=>{const t=e.mode;if("single-document"!==t&&"multiple-document"!==t)throw new Error(`Unsupported application shell mode: ${t}`);a.mode=t}}),r.addCommand(_.toggleMode,{label:s.__("Simple Interface"),isToggled:()=>"single-document"===a.mode,execute:()=>{const e="multiple-document"===a.mode?{mode:"single-document"}:{mode:"multiple-document"};return r.execute(_.setMode,e)}}),r.addCommand(_.resetLayout,{label:s.__("Reset Default Layout"),execute:()=>{a.presentationMode&&r.execute(_.togglePresentationMode).catch((e=>{console.error("Failed to undo presentation mode.",e)})),"single-document"!==a.mode||a.isTopInSimpleModeVisible()||r.execute(_.toggleHeader).catch((e=>{console.error("Failed to display title header.",e)})),["left","right"].forEach((e=>{a.isSideTabBarVisible(e)||a.isEmpty(e)||r.execute(_.toggleSideTabBar,{side:e}).catch((t=>{console.error(`Failed to show ${e} activity bar.`,t)}))}))}})),i&&([_.activateNextTab,_.activatePreviousTab,_.activateNextTabBar,_.activatePreviousTabBar,_.close,_.closeAll,_.closeOtherTabs,_.closeRightTabs,_.toggleHeader,_.toggleLeftArea,_.toggleRightArea,_.togglePresentationMode,_.toggleMode,_.resetLayout].forEach((e=>i.addItem({command:e,category:d}))),["right","left"].forEach((e=>{i.addItem({command:_.toggleSideTabBar,category:d,args:{side:e}})})))}},S={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[o.IRouter,i.IWindowResolver,c.ITranslator,o.JupyterFrontEnd.ITreeResolver],optional:[o.IConnectionLost],provides:o.ITreePathUpdater,activate:(e,t,a,r,l,s)=>{const d=r.load("jupyterlab");if(!(e instanceof o.JupyterLab))throw new Error(`${S.id} must be activated in JupyterLab.`);let c="",u="";const p=a.name;if(console.debug(`Starting application in workspace: "${p}"`),0!==e.registerPluginErrors.length){const t=v.createElement("pre",null,e.registerPluginErrors.map((e=>e.message)).join("\n"));(0,i.showErrorMessage)(d.__("Error Registering Plugins"),{message:t})}e.shell.layoutModified.connect((()=>{e.commands.notifyCommandChanged()})),e.shell.modeChanged.connect(((e,a)=>{const o=n.PageConfig.getUrl({mode:a}),i=n.URLExt.parse(o).pathname;t.navigate(i,{skipRouting:!0}),n.PageConfig.setOption("mode",a)})),l.paths.then((()=>{e.shell.currentPathChanged.connect(((e,a)=>{const o=a.newValue,i=o||u,r=n.PageConfig.getUrl({treePath:i}),l=n.URLExt.parse(r).pathname;t.navigate(l,{skipRouting:!0}),n.PageConfig.setOption("treePath",i),c=o}))})),s=s||o.ConnectionLost,e.serviceManager.connectionFailure.connect(((e,t)=>s(e,t,r)));const g=e.serviceManager.builder,m=()=>g.build().then((()=>(0,i.showDialog)({title:d.__("Build Complete"),body:v.createElement("div",null,d.__("Build successfully completed, reload page?"),v.createElement("br",null),d.__("You will lose any unsaved changes.")),buttons:[i.Dialog.cancelButton({label:d.__("Reload Without Saving"),actions:["reload"]}),i.Dialog.okButton({label:d.__("Save and Reload")})],hasClose:!0}))).then((({button:{accept:a,actions:o}})=>{a?e.commands.execute("docmanager:save").then((()=>{t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Save Failed"),{message:v.createElement("pre",null,e.message)})})):o.includes("reload")&&t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Build Failed"),{message:v.createElement("pre",null,e.message)})}));return g.isAvailable&&g.shouldCheck&&g.getStatus().then((e=>{if("building"===e.status)return m();if("needed"!==e.status)return;const t=v.createElement("div",null,d.__("JupyterLab build is suggested:"),v.createElement("br",null),v.createElement("pre",null,e.message));(0,i.showDialog)({title:d.__("Build Recommended"),body:t,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:d.__("Build")})]}).then((e=>e.button.accept?m():void 0))})),function(e){l.paths.then((()=>{if(u=e,!c){const a=n.PageConfig.getUrl({treePath:e}),o=n.URLExt.parse(a).pathname;t.navigate(o,{skipRouting:!0}),n.PageConfig.setOption("treePath",e)}}))}},autoStart:!0},w={id:"@jupyterlab/application-extension:context-menu",description:"Populates the context menu.",autoStart:!0,requires:[l.ISettingRegistry,c.ITranslator],activate:(e,t,a)=>{const o=a.load("jupyterlab");function i(t){const a=new u.RankedMenu({...t,commands:e.commands});return t.label&&(a.title.label=o.__(t.label)),a}e.started.then((()=>O.loadSettingsContextMenu(e.contextMenu,t,i,a))).catch((e=>{console.error("Failed to load context menu items from settings registry.",e)}))}},T={id:"@jupyterlab/application-extension:dirty",description:"Adds safeguard dialog when closing the browser tab with unsaved modifications.",autoStart:!0,requires:[c.ITranslator],activate:(e,t)=>{if(!(e instanceof o.JupyterLab))throw new Error(`${T.id} must be activated in JupyterLab.`);const a=t.load("jupyterlab").__("Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.");window.addEventListener("beforeunload",(t=>{if(e.status.isDirty)return t.returnValue=a}))}},I={id:"@jupyterlab/application-extension:layout",description:"Provides the shell layout restorer.",requires:[s.IStateDB,o.ILabShell,l.ISettingRegistry],optional:[c.ITranslator],activate:(e,t,a,r,l)=>{const s=(null!=l?l:c.nullTranslator).load("jupyterlab"),d=e.started,u=e.commands,p=n.PageConfig.getOption("mode"),m=new o.LayoutRestorer({connector:t,first:d,registry:u,mode:p});return r.load(R.id).then((t=>{var o,i;const n=t.composite.layout;a.restoreLayout(p,m,{"multiple-document":null!==(o=n.multiple)&&void 0!==o?o:{},"single-document":null!==(i=n.single)&&void 0!==i?i:{}}).then((()=>{a.layoutModified.connect((()=>{m.save(a.saveLayout())})),t.changed.connect(b),O.activateSidebarSwitcher(e,a,t,s)}))})).catch((e=>{console.error("Fail to load settings for the layout restorer."),console.error(e)})),m;async function b(e){g.JSONExt.deepEqual(e.composite.layout,{single:a.userLayout["single-document"],multiple:a.userLayout["multiple-document"]})||(await(0,i.showDialog)({title:s.__("Information"),body:s.__("User layout customization has changed. You may need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Reload")})]})).button.accept&&location.reload()}},autoStart:!0,provides:o.ILayoutRestorer},E={id:"@jupyterlab/application-extension:router",description:"Provides the URL router",requires:[o.JupyterFrontEnd.IPaths],activate:(e,t)=>{const{commands:a}=e,i=t.urls.base,n=new o.Router({base:i,commands:a});return e.started.then((()=>{n.route(),window.addEventListener("popstate",(()=>{n.route()}))})),n},autoStart:!0,provides:o.IRouter},C={id:"@jupyterlab/application-extension:tree-resolver",description:"Provides the tree route resolver",autoStart:!0,requires:[o.IRouter],provides:o.JupyterFrontEnd.ITreeResolver,activate:(e,t)=>{const{commands:a}=e,o=new b.DisposableSet,i=new g.PromiseDelegate,r=new RegExp("/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?");o.add(a.addCommand(_.tree,{execute:async e=>{var t;if(o.isDisposed)return;const a=n.URLExt.queryStringToObject(null!==(t=e.search)&&void 0!==t?t:""),r=a["file-browser-path"]||"";delete a["file-browser-path"],o.dispose(),i.resolve({browser:r,file:n.PageConfig.getOption("treePath")})}})),o.add(t.register({command:_.tree,pattern:r}));const l=()=>{o.isDisposed||(o.dispose(),i.resolve(null))};return t.routed.connect(l),o.add(new b.DisposableDelegate((()=>{t.routed.disconnect(l)}))),{paths:i.promise}}},P={id:"@jupyterlab/application-extension:notfound",description:"Defines the behavior for not found URL (aka route).",requires:[o.JupyterFrontEnd.IPaths,o.IRouter,c.ITranslator],activate:(e,t,a,o)=>{const n=o.load("jupyterlab"),r=t.urls.notFound;if(!r)return;const l=a.base,s=n.__("The path: %1 was not found. JupyterLab redirected to: %2",r,l);a.navigate(""),(0,i.showErrorMessage)(n.__("Path Not Found"),{message:s})},autoStart:!0},L={id:"@jupyterlab/application-extension:faviconbusy",description:"Handles the favicon depending on the application status.",requires:[o.ILabStatus],activate:async(e,t)=>{t.busySignal.connect(((e,t)=>{const a=document.querySelector('link[rel="icon"]'+(t?".idle.favicon":".busy.favicon"));if(!a)return;const o=document.querySelector("link"+(t?".busy.favicon":".idle.favicon"));o&&a!==o&&(a.rel="",o.rel="icon",o.parentNode.replaceChild(o,o))}))},autoStart:!0},R={id:"@jupyterlab/application-extension:shell",description:"Provides the JupyterLab shell. It has an extended API compared to `app.shell`.",optional:[l.ISettingRegistry],activate:(e,t)=>{if(!(e.shell instanceof o.LabShell))throw new Error(`${R.id} did not find a LabShell instance.`);return t&&t.load(R.id).then((t=>{e.shell.updateConfig(t.composite),t.changed.connect((()=>{e.shell.updateConfig(t.composite)}))})),e.shell},autoStart:!0,provides:o.ILabShell},B={id:"@jupyterlab/application-extension:status",description:"Provides the application status.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${B.id} must be activated in JupyterLab.`);return e.status},autoStart:!0,provides:o.ILabStatus},M={id:"@jupyterlab/application-extension:info",description:"Provides the application information.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${M.id} must be activated in JupyterLab.`);return e.info},autoStart:!0,provides:o.JupyterLab.IInfo},j={id:"@jupyterlab/application-extension:paths",description:"Provides the application paths.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${j.id} must be activated in JupyterLab.`);return e.paths},autoStart:!0,provides:o.JupyterFrontEnd.IPaths},A={id:"@jupyterlab/application-extension:property-inspector",description:"Provides the property inspector.",autoStart:!0,requires:[o.ILabShell,c.ITranslator],optional:[o.ILayoutRestorer],provides:r.IPropertyInspectorProvider,activate:(e,t,a,o)=>{const i=a.load("jupyterlab"),n=new r.SideBarPropertyInspectorProvider({shell:t,translator:a});return n.title.icon=u.buildIcon,n.title.caption=i.__("Property Inspector"),n.id="jp-property-inspector",t.add(n,"right",{rank:100,type:"Property Inspector"}),e.commands.addCommand(_.showPropertyPanel,{label:i.__("Property Inspector"),execute:()=>{t.activateById(n.id)}}),o&&o.add(n,"jp-property-inspector"),n}},k={id:"@jupyterlab/application-extension:logo",description:"Sets the application logo.",autoStart:!0,requires:[o.ILabShell],activate:(e,t)=>{const a=new h.Widget;u.jupyterIcon.element({container:a.node,elementPosition:"center",margin:"2px 2px 2px 8px",height:"auto",width:"16px"}),a.id="jp-MainLogo",t.add(a,"top",{rank:0})}},J={id:"@jupyterlab/application-extension:mode-switch",description:"Adds the interface mode switch",requires:[o.ILabShell,c.ITranslator],optional:[d.IStatusBar,l.ISettingRegistry],activate:(e,t,a,o,i)=>{if(null===o)return;const n=a.load("jupyterlab"),r=new u.Switch;if(r.id="jp-single-document-mode",r.valueChanged.connect(((e,a)=>{t.mode=a.newValue?"single-document":"multiple-document"})),t.modeChanged.connect(((e,t)=>{r.value="single-document"===t})),i){const a=i.load(R.id),o=e=>{const a=e.get("startMode").composite;a&&(t.mode="single"===a?"single-document":"multiple-document")};Promise.all([a,e.restored]).then((([e])=>{o(e)})).catch((e=>{console.error(e.message)}))}const l=()=>{const t=e.commands.keyBindings.find((e=>"application:toggle-mode"===e.command));if(t){const e=t.keys.map(m.CommandRegistry.formatKeystroke).join(", ");r.caption=n.__("Simple Interface (%1)",e)}else r.caption=n.__("Simple Interface")};l(),e.commands.keyBindingChanged.connect((()=>{l()})),r.label=n.__("Simple"),o.registerStatusItem(J.id,{priority:1,item:r,align:"left",rank:-1})},autoStart:!0},D=[w,T,S,x,I,E,C,P,L,R,B,M,J,j,A,k,y];var O;!function(e){async function t(e){(await(0,i.showDialog)({title:e.__("Information"),body:e.__("Context menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsContextMenu=async function(e,a,o,n){var r;const s=n.load("jupyterlab"),d=w.id;let c=null,u={};function p(e){var t,o;u={};const i=Object.keys(a.plugins).map((e=>{var t,o;const i=null!==(o=null===(t=a.plugins[e].schema["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[];return u[e]=i,i})).concat([null!==(o=null===(t=e["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[]]).reduceRight(((e,t)=>l.SettingRegistry.reconcileItems(e,t,!0)),[]);e.properties.contextMenu.default=l.SettingRegistry.reconcileItems(i,e.properties.contextMenu.default,!0).sort(((e,t)=>{var a,o;return(null!==(a=e.rank)&&void 0!==a?a:1/0)-(null!==(o=t.rank)&&void 0!==o?o:1/0)}))}a.transform(d,{compose:e=>{var t,a,o,i;c||(c=g.JSONExt.deepCopy(e.schema),p(c));const n=null!==(o=null===(a=null===(t=c.properties)||void 0===t?void 0:t.contextMenu)||void 0===a?void 0:a.default)&&void 0!==o?o:[],r={...e.data.user,contextMenu:null!==(i=e.data.user.contextMenu)&&void 0!==i?i:[]},s={...e.data.composite,contextMenu:l.SettingRegistry.reconcileItems(n,r.contextMenu,!1)};return e.data={composite:s,user:r},e},fetch:e=>(c||(c=g.JSONExt.deepCopy(e.schema),p(c)),{data:e.data,id:e.id,raw:e.raw,schema:c,version:e.version})});const m=await a.load(d),b=null!==(r=m.composite.contextMenu)&&void 0!==r?r:[];l.SettingRegistry.filterDisabledItems(b).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)})),m.changed.connect((()=>{var e;const a=null!==(e=m.composite.contextMenu)&&void 0!==e?e:[];g.JSONExt.deepEqual(b,a)||t(s)})),a.pluginChanged.connect((async(n,r)=>{var c,p,m,h;if(r!==d){const n=null!==(c=u[r])&&void 0!==c?c:[],d=null!==(m=null===(p=a.plugins[r].schema["jupyter.lab.menus"])||void 0===p?void 0:p.context)&&void 0!==m?m:[];if(!g.JSONExt.deepEqual(n,d))if(u[r])await t(s);else{u[r]=g.JSONExt.deepCopy(d);const t=null!==(h=l.SettingRegistry.reconcileItems(d,b,!1,!1))&&void 0!==h?h:[];l.SettingRegistry.filterDisabledItems(t).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)}))}}}))},e.activateSidebarSwitcher=function(e,t,a,o){e.commands.addCommand(_.switchSidebar,{label:o.__("Switch Sidebar Side"),execute:()=>{const o=e.contextMenuHitTest((e=>!!e.dataset.id));if(!o)return;const i=o.dataset.id,n=document.getElementById("jp-left-stack"),r=document.getElementById(i);let l=null;if(n&&r&&n.contains(r)){const e=(0,p.find)(t.widgets("left"),(e=>e.id===i));e&&(l=t.move(e,"right"),t.activateById(e.id))}else{const e=(0,p.find)(t.widgets("right"),(e=>e.id===i));e&&(l=t.move(e,"left"),t.activateById(e.id))}l&&a.set("layout",{single:l["single-document"],multiple:l["multiple-document"]}).catch((e=>{console.error("Failed to save user layout customization.",e)}))}}),e.commands.commandExecuted.connect(((e,t)=>{t.id===_.resetLayout&&a.remove("layout").catch((e=>{console.error("Failed to remove user layout customization.",e)}))}))}}(O||(O={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4042,134],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(50892),n=s(56761),i=s(81997);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4042,134],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(11351),n=s(70856),i=s(81997);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4212],{24212:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var i=n(49880),c=n(57797),s=n(11404),a=n(6312),d=n(11523),o=n(31516);const r="jp-mod-searchable",l="jp-mod-search-active";var h;!function(e){e.search="documentsearch:start",e.searchAndReplace="documentsearch:startWithReplace",e.findNext="documentsearch:highlightNext",e.findPrevious="documentsearch:highlightPrevious",e.end="documentsearch:end",e.toggleSearchInSelection="documentsearch:toggleSearchInSelection"}(h||(h={}));const u={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[i.ILabShell,s.ISearchProviderRegistry],autoStart:!0,activate:(e,t,n)=>{const i=e=>{e&&(n.hasProvider(e)?e.addClass(r):e.removeClass(r))};n.changed.connect((()=>i(t.activeWidget))),t.activeChanged.connect(((e,t)=>{const n=t.oldValue;n&&n.removeClass(r),i(t.newValue)}))}};class g{constructor(e){this._commandRegistry=e,this._cache=this._buildCache(),this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){return{next:this._commandRegistry.keyBindings.find((e=>e.command===h.findNext)),previous:this._commandRegistry.keyBindings.find((e=>e.command===h.findPrevious)),toggleSearchInSelection:this._commandRegistry.keyBindings.find((e=>e.command===h.toggleSearchInSelection))}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const m={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:s.ISearchProviderRegistry,requires:[d.ITranslator],optional:[c.ICommandPalette,a.ISettingRegistry],autoStart:!0,activate:(e,t,n,i)=>{const a=t.load("jupyterlab");let d=500,r="never";const u=new s.SearchProviderRegistry(t),v=new Map;if(i){const t=i.load(m.id),n=e=>{d=e.get("searchDebounceTime").composite,r=e.get("autoSearchInSelection").composite};Promise.all([t,e.restored]).then((([e])=>{n(e),e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const p=()=>{const t=e.shell.currentWidget;return!!t&&u.hasProvider(t)},S=n=>{if(!n)return;const i=n.id;let a=v.get(i);if(!a){const c=u.getProvider(n);if(!c)return;const o=new s.SearchDocumentModel(c,d),r=new g(e.commands),m=new s.SearchDocumentView(o,t,r);v.set(i,m),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)})),m.closed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l))})),m.disposed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l)),v.delete(i),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n.disposed.connect((()=>{m.dispose(),o.dispose(),c.dispose(),r.dispose()})),a=m}return a.isAttached||(o.Widget.attach(a,n.node),n.addClass(l),n instanceof c.MainAreaWidget&&(a.node.style.top=`${n.toolbar.node.getBoundingClientRect().height+n.contentHeader.node.getBoundingClientRect().height}px`),a.model.searchExpression&&a.model.refresh()),a};return e.commands.addCommand(h.search,{label:a.__("Find…"),isEnabled:p,execute:async t=>{const n=S(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=n.model.selectionState;let c=!1;switch(r){case"multiple-selected":c="multiple"===i;break;case"any-selected":c="multiple"===i||"single"===i}c&&await n.model.setFilter("selection",!0),n.focusSearchInput()}}}),e.commands.addCommand(h.searchAndReplace,{label:a.__("Find and Replace…"),isEnabled:p,execute:t=>{const n=S(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=t.replaceText;i&&n.setReplaceText(i),n.showReplace(),n.focusSearchInput()}}}),e.commands.addCommand(h.findNext,{label:a.__("Find Next"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=v.get(n.id))||void 0===t?void 0:t.model.highlightNext())}}),e.commands.addCommand(h.findPrevious,{label:a.__("Find Previous"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=v.get(n.id))||void 0===t?void 0:t.model.highlightPrevious())}}),e.commands.addCommand(h.end,{label:a.__("End Search"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&(null===(t=v.get(n.id))||void 0===t||t.close())}}),e.commands.addCommand(h.toggleSearchInSelection,{label:a.__("Search in Selection"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id)&&"selection"in v.get(e.shell.currentWidget.id).model.filtersDefinition,execute:async()=>{var t;const n=e.shell.currentWidget;if(!n)return;const i=null===(t=v.get(n.id))||void 0===t?void 0:t.model;if(!i)return;const c=i.filters.selection;return i.setFilter("selection",!c)}}),n&&[h.search,h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((e=>{n.addItem({command:e,category:a.__("Main Area")})})),u}},v=[m,u]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4212],{24212:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var i=n(3053),c=n(12982),s=n(3486),a=n(36768),d=n(71677),o=n(31516);const r="jp-mod-searchable",l="jp-mod-search-active";var h;!function(e){e.search="documentsearch:start",e.searchAndReplace="documentsearch:startWithReplace",e.findNext="documentsearch:highlightNext",e.findPrevious="documentsearch:highlightPrevious",e.end="documentsearch:end",e.toggleSearchInSelection="documentsearch:toggleSearchInSelection"}(h||(h={}));const u={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[i.ILabShell,s.ISearchProviderRegistry],autoStart:!0,activate:(e,t,n)=>{const i=e=>{e&&(n.hasProvider(e)?e.addClass(r):e.removeClass(r))};n.changed.connect((()=>i(t.activeWidget))),t.activeChanged.connect(((e,t)=>{const n=t.oldValue;n&&n.removeClass(r),i(t.newValue)}))}};class g{constructor(e){this._commandRegistry=e,this._cache=this._buildCache(),this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){return{next:this._commandRegistry.keyBindings.find((e=>e.command===h.findNext)),previous:this._commandRegistry.keyBindings.find((e=>e.command===h.findPrevious)),toggleSearchInSelection:this._commandRegistry.keyBindings.find((e=>e.command===h.toggleSearchInSelection))}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const m={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:s.ISearchProviderRegistry,requires:[d.ITranslator],optional:[c.ICommandPalette,a.ISettingRegistry],autoStart:!0,activate:(e,t,n,i)=>{const a=t.load("jupyterlab");let d=500,r="never";const u=new s.SearchProviderRegistry(t),v=new Map;if(i){const t=i.load(m.id),n=e=>{d=e.get("searchDebounceTime").composite,r=e.get("autoSearchInSelection").composite};Promise.all([t,e.restored]).then((([e])=>{n(e),e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const p=()=>{const t=e.shell.currentWidget;return!!t&&u.hasProvider(t)},S=n=>{if(!n)return;const i=n.id;let a=v.get(i);if(!a){const c=u.getProvider(n);if(!c)return;const o=new s.SearchDocumentModel(c,d),r=new g(e.commands),m=new s.SearchDocumentView(o,t,r);v.set(i,m),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)})),m.closed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l))})),m.disposed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l)),v.delete(i),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n.disposed.connect((()=>{m.dispose(),o.dispose(),c.dispose(),r.dispose()})),a=m}return a.isAttached||(o.Widget.attach(a,n.node),n.addClass(l),n instanceof c.MainAreaWidget&&(a.node.style.top=`${n.toolbar.node.getBoundingClientRect().height+n.contentHeader.node.getBoundingClientRect().height}px`),a.model.searchExpression&&a.model.refresh()),a};return e.commands.addCommand(h.search,{label:a.__("Find…"),isEnabled:p,execute:async t=>{const n=S(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=n.model.selectionState;let c=!1;switch(r){case"multiple-selected":c="multiple"===i;break;case"any-selected":c="multiple"===i||"single"===i}c&&await n.model.setFilter("selection",!0),n.focusSearchInput()}}}),e.commands.addCommand(h.searchAndReplace,{label:a.__("Find and Replace…"),isEnabled:p,execute:t=>{const n=S(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=t.replaceText;i&&n.setReplaceText(i),n.showReplace(),n.focusSearchInput()}}}),e.commands.addCommand(h.findNext,{label:a.__("Find Next"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=v.get(n.id))||void 0===t?void 0:t.model.highlightNext())}}),e.commands.addCommand(h.findPrevious,{label:a.__("Find Previous"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=v.get(n.id))||void 0===t?void 0:t.model.highlightPrevious())}}),e.commands.addCommand(h.end,{label:a.__("End Search"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&(null===(t=v.get(n.id))||void 0===t||t.close())}}),e.commands.addCommand(h.toggleSearchInSelection,{label:a.__("Search in Selection"),isEnabled:()=>!!e.shell.currentWidget&&v.has(e.shell.currentWidget.id)&&"selection"in v.get(e.shell.currentWidget.id).model.filtersDefinition,execute:async()=>{var t;const n=e.shell.currentWidget;if(!n)return;const i=null===(t=v.get(n.id))||void 0===t?void 0:t.model;if(!i)return;const c=i.filters.selection;return i.setFilter("selection",!c)}}),n&&[h.search,h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((e=>{n.addItem({command:e,category:a.__("Main Area")})})),u}},v=[m,u]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4382,7906],{54382:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var n=r(11404),o=r(21024);const c="jp-mod-searchable",a=[{id:"@jupyter-notebook/documentsearch-extension:notebookShellWidgetListener",requires:[o.INotebookShell,n.ISearchProviderRegistry],autoStart:!0,description:"A plugin to add document search functionalities",activate:(e,t,r)=>{const n=e=>{e&&(r.hasProvider(e)?e.addClass(c):e.removeClass(c))};r.changed.connect((()=>n(t.currentWidget))),t.currentChanged.connect(((e,r)=>{t.currentWidget&&n(t.currentWidget)}))}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4382,7906],{54382:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var n=r(3486),o=r(42266);const c="jp-mod-searchable",a=[{id:"@jupyter-notebook/documentsearch-extension:notebookShellWidgetListener",requires:[o.INotebookShell,n.ISearchProviderRegistry],autoStart:!0,description:"A plugin to add document search functionalities",activate:(e,t,r)=>{const n=e=>{e&&(r.hasProvider(e)?e.addClass(c):e.removeClass(c))};r.changed.connect((()=>n(t.currentWidget))),t.currentChanged.connect(((e,r)=>{t.currentWidget&&n(t.currentWidget)}))}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4558],{94558:(t,e,s)=>{s.r(e),s.d(e,{DocumentManager:()=>x,DocumentWidgetManager:()=>P,IDocumentManager:()=>A,IDocumentWidgetOpener:()=>O,PathStatus:()=>W,SaveHandler:()=>f,SavingStatus:()=>E,isValidFileName:()=>d,renameDialog:()=>l,renameFile:()=>h,shouldOverwrite:()=>c});var i,n=s(57797),a=s(74787),o=s(11523),r=s(31516);function l(t,e,s){const i=(s=s||o.nullTranslator).load("jupyterlab"),a=e.localPath.split("/").pop()||e.localPath;return(0,n.showDialog)({title:i.__("Rename File"),body:new g(a),focusNodeSelector:"input",buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:i.__("Rename"),ariaLabel:i.__("Rename File")})]}).then((t=>t.value?d(t.value)?e.rename(t.value):((0,n.showErrorMessage)(i.__("Rename Error"),Error(i.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',t.value))),null):null))}function h(t,e,s){return t.rename(e,s).catch((i=>{if(409!==i.response.status)throw i;return c(s).then((i=>i?t.overwrite(e,s):Promise.reject("File not renamed")))}))}function c(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i={title:s.__("Overwrite file?"),body:s.__('"%1" already exists, overwrite?',t),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s.__("Overwrite"),ariaLabel:s.__("Overwrite Existing File")})]};return(0,n.showDialog)(i).then((t=>Promise.resolve(t.button.accept)))}function d(t){return t.length>0&&!/[\/\\:]/.test(t)}class g extends r.Widget{constructor(t){super({node:i.createRenameNode(t)}),this.addClass("jp-FileDialog");const e=a.PathExt.extname(t),s=this.inputNode.value=a.PathExt.basename(t);this.inputNode.setSelectionRange(0,s.length-e.length)}get inputNode(){return this.node.getElementsByTagName("input")[0]}getValue(){return this.inputNode.value}}!function(t){t.createRenameNode=function(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i=document.createElement("div"),n=document.createElement("label");n.textContent=s.__("File Path");const a=document.createElement("span");a.textContent=t;const r=document.createElement("label");r.textContent=s.__("New Name"),r.className="jp-new-name-title";const l=document.createElement("input");return i.appendChild(n),i.appendChild(a),i.appendChild(r),i.appendChild(l),i}}(i||(i={}));var u=s(3771),_=s(33625),m=s(20998),p=s(14421),v=s(81997);class f{constructor(t){this._autosaveTimer=-1,this._minInterval=-1,this._interval=-1,this._isActive=!1,this._inDialog=!1,this._isDisposed=!1,this._multiplier=10,this._context=t.context,this._isConnectedCallback=t.isConnectedCallback||(()=>!0);const e=t.saveInterval||120;this._minInterval=1e3*e,this._interval=this._minInterval,this._context.fileChanged.connect(this._setTimer,this),this._context.disposed.connect(this.dispose,this)}get saveInterval(){return this._interval/1e3}set saveInterval(t){this._minInterval=this._interval=1e3*t,this._isActive&&this._setTimer()}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,clearTimeout(this._autosaveTimer),v.Signal.clearData(this))}start(){this._isActive=!0,this._setTimer()}stop(){this._isActive=!1,clearTimeout(this._autosaveTimer)}_setTimer(){clearTimeout(this._autosaveTimer),this._isActive&&(this._autosaveTimer=window.setTimeout((()=>{this._isConnectedCallback()&&this._save()}),this._interval))}_save(){const t=this._context;if(this._setTimer(),!t)return;if(!t.contentsModel||!t.contentsModel.writable||!t.model.dirty||this._inDialog)return;const e=(new Date).getTime();t.save().then((()=>{if(this.isDisposed)return;const t=(new Date).getTime()-e;this._interval=Math.max(this._multiplier*t,this._minInterval),this._setTimer()})).catch((t=>{const{name:e}=t;"ModalCancelError"!==e&&"ModalDuplicateError"!==e&&console.error("Error in Auto-Save",t.message)}))}}var w,C,y=s(2549),D=s(49503);class P{constructor(t){this._activateRequested=new v.Signal(this),this._confirmClosingTab=!1,this._isDisposed=!1,this._stateChanged=new v.Signal(this),this._registry=t.registry,this.translator=t.translator||o.nullTranslator}get activateRequested(){return this._activateRequested}get confirmClosingDocument(){return this._confirmClosingTab}set confirmClosingDocument(t){if(this._confirmClosingTab!==t){const e=this._confirmClosingTab;this._confirmClosingTab=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.disconnectReceiver(this))}createWidget(t,e){const s=t.createNew(e);return this._initializeWidget(s,t,e),s}_initializeWidget(t,e,s){w.factoryProperty.set(t,e);const i=new y.DisposableSet;for(const n of this._registry.widgetExtensions(e.name)){const e=n.createNew(t,s);e&&i.add(e)}w.disposablesProperty.set(t,i),t.disposed.connect(this._onWidgetDisposed,this),this.adoptWidget(s,t),s.fileChanged.connect(this._onFileChanged,this),s.pathChanged.connect(this._onPathChanged,this),s.ready.then((()=>{this.setCaption(t)}))}adoptWidget(t,e){w.widgetsProperty.get(t).push(e),D.MessageLoop.installMessageHook(e,this),e.addClass("jp-Document"),e.title.closable=!0,e.disposed.connect(this._widgetDisposed,this),w.contextProperty.set(e,t)}findWidget(t,e){const s=w.widgetsProperty.get(t);if(s)return(0,_.find)(s,(t=>{const s=w.factoryProperty.get(t);return!!s&&s.name===e}))}contextForWidget(t){return w.contextProperty.get(t)}cloneWidget(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.factoryProperty.get(t);if(!s)return;const i=s.createNew(e,t);return this._initializeWidget(i,s,e),i}closeWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onClose(t)))).then((()=>{}))}deleteWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onDelete(t)))).then((()=>{}))}messageHook(t,e){switch(e.type){case"close-request":return this.onClose(t),!1;case"activate-request":{const e=this.contextForWidget(t);e&&this._activateRequested.emit(e.path);break}}return!0}async setCaption(t){const e=this.translator.load("jupyterlab"),s=w.contextProperty.get(t);if(!s)return;const i=s.contentsModel;if(i)return s.listCheckpoints().then((n=>{if(t.isDisposed)return;const o=n[n.length-1],r=o?a.Time.format(o.last_modified):"None";let l=e.__("Name: %1\nPath: %2\n",i.name,i.path);s.model.readOnly?l+=e.__("Read-only"):l+=e.__("Last Saved: %1\n",a.Time.format(i.last_modified))+e.__("Last Checkpoint: %1",r),t.title.caption=l}));t.title.caption=""}async onClose(t){var e;const[s,i]=await this._maybeClose(t,this.translator);if(t.isDisposed)return!0;if(s){if(!i){const s=w.contextProperty.get(t);if(!s)return!0;(null===(e=s.contentsModel)||void 0===e?void 0:e.writable)?await s.save():await s.saveAs()}if(t.isDisposed)return!0;t.dispose()}return s}onDelete(t){return t.dispose(),Promise.resolve(void 0)}async _maybeClose(t,e){var s,i;const a=(e=e||o.nullTranslator).load("jupyterlab"),r=w.contextProperty.get(t);if(!r)return Promise.resolve([!0,!0]);let l=w.widgetsProperty.get(r);if(!l)return Promise.resolve([!0,!0]);l=l.filter((t=>{const e=w.factoryProperty.get(t);return!!e&&!1===e.readOnly}));const h=t.title.label,c=w.factoryProperty.get(t),d=r.model.dirty&&l.length<=1&&!(null===(s=null==c?void 0:c.readOnly)||void 0===s||s);if(this.confirmClosingDocument){const t=[n.Dialog.cancelButton(),n.Dialog.okButton({label:d?a.__("Close and save"):a.__("Close"),ariaLabel:d?a.__("Close and save Document"):a.__("Close Document")})];d&&t.splice(1,0,n.Dialog.warnButton({label:a.__("Close without saving"),ariaLabel:a.__("Close Document without saving")}));const e=await(0,n.showDialog)({title:a.__("Confirmation"),body:a.__('Please confirm you want to close "%1".',h),checkbox:d?null:{label:a.__("Do not ask me again."),caption:a.__("If checked, no confirmation to close a document will be asked in the future.")},buttons:t});return e.isChecked&&(this.confirmClosingDocument=!1),Promise.resolve([e.button.accept,!d||"warn"===e.button.displayType])}{if(!d)return Promise.resolve([!0,!0]);const t=(null===(i=r.contentsModel)||void 0===i?void 0:i.writable)?a.__("Save"):a.__("Save as"),e=await(0,n.showDialog)({title:a.__("Save your work"),body:a.__('Save changes in "%1" before closing?',h),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:a.__("Discard"),ariaLabel:a.__("Discard changes to file")}),n.Dialog.okButton({label:t})]});return[e.button.accept,"warn"===e.button.displayType]}}_widgetDisposed(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.widgetsProperty.get(e);s&&(_.ArrayExt.removeFirstOf(s,t),s.length||e.dispose())}_onWidgetDisposed(t){w.disposablesProperty.get(t).dispose()}_onFileChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}_onPathChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}}!function(t){t.contextProperty=new p.AttachedProperty({name:"context",create:()=>{}}),t.factoryProperty=new p.AttachedProperty({name:"factory",create:()=>{}}),t.widgetsProperty=new p.AttachedProperty({name:"widgets",create:()=>[]}),t.disposablesProperty=new p.AttachedProperty({name:"disposables",create:()=>new y.DisposableSet})}(w||(w={}));class x{constructor(t){var e;this._activateRequested=new v.Signal(this),this._contexts=[],this._isDisposed=!1,this._autosave=!0,this._autosaveInterval=120,this._lastModifiedCheckMargin=500,this._renameUntitledFileOnSave=!0,this._stateChanged=new v.Signal(this),this.translator=t.translator||o.nullTranslator,this.registry=t.registry,this.services=t.manager,this._dialogs=null!==(e=t.sessionDialogs)&&void 0!==e?e:new n.SessionContextDialogs({translator:t.translator}),this._isConnectedCallback=t.isConnectedCallback||(()=>!0),this._opener=t.opener,this._when=t.when||t.manager.ready;const s=new P({registry:this.registry,translator:this.translator});s.activateRequested.connect(this._onActivateRequested,this),s.stateChanged.connect(this._onWidgetStateChanged,this),this._widgetManager=s,this._setBusy=t.setBusy}get activateRequested(){return this._activateRequested}get autosave(){return this._autosave}set autosave(t){if(this._autosave!==t){const e=this._autosave;this._autosave=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(!0!==t||s.isActive?!1===t&&s.isActive&&s.stop():s.start())})),this._stateChanged.emit({name:"autosave",oldValue:e,newValue:t})}}get autosaveInterval(){return this._autosaveInterval}set autosaveInterval(t){if(this._autosaveInterval!==t){const e=this._autosaveInterval;this._autosaveInterval=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(s.saveInterval=t||120)})),this._stateChanged.emit({name:"autosaveInterval",oldValue:e,newValue:t})}}get confirmClosingDocument(){return this._widgetManager.confirmClosingDocument}set confirmClosingDocument(t){if(this._widgetManager.confirmClosingDocument!==t){const e=this._widgetManager.confirmClosingDocument;this._widgetManager.confirmClosingDocument=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(t){if(this._lastModifiedCheckMargin!==t){const e=this._lastModifiedCheckMargin;this._lastModifiedCheckMargin=t,this._contexts.forEach((e=>{e.lastModifiedCheckMargin=t})),this._stateChanged.emit({name:"lastModifiedCheckMargin",oldValue:e,newValue:t})}}get renameUntitledFileOnSave(){return this._renameUntitledFileOnSave}set renameUntitledFileOnSave(t){if(this._renameUntitledFileOnSave!==t){const e=this._renameUntitledFileOnSave;this._renameUntitledFileOnSave=t,this._stateChanged.emit({name:"renameUntitledFileOnSave",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.clearData(this),this._contexts.forEach((t=>this._widgetManager.closeWidgets(t))),this._widgetManager.dispose(),this._contexts.length=0)}cloneWidget(t){return this._widgetManager.cloneWidget(t)}closeAll(){return Promise.all(this._contexts.map((t=>this._widgetManager.closeWidgets(t)))).then((()=>{}))}closeFile(t){const e=this._contextsForPath(t).map((t=>this._widgetManager.closeWidgets(t)));return Promise.all(e).then((t=>{}))}contextForWidget(t){return this._widgetManager.contextForWidget(t)}copy(t,e){return this.services.contents.copy(t,e)}createNew(t,e="default",s){return this._createOrOpenDocument("create",t,e,s)}deleteFile(t){return this.services.sessions.stopIfNeeded(t).then((()=>this.services.contents.delete(t))).then((()=>(this._contextsForPath(t).forEach((t=>this._widgetManager.deleteWidgets(t))),Promise.resolve(void 0))))}duplicate(t){const e=a.PathExt.dirname(t);return this.services.contents.copy(t,e)}findWidget(t,e="default"){const s=a.PathExt.normalize(t);let i=[e];if("default"===e){const t=this.registry.defaultWidgetFactory(s);if(!t)return;i=[t.name]}else null===e&&(i=this.registry.preferredWidgetFactories(s).map((t=>t.name)));for(const t of this._contextsForPath(s))for(const e of i)if(null!==e){const s=this._widgetManager.findWidget(t,e);if(s)return s}}newUntitled(t){return"file"===t.type&&(t.ext=t.ext||".txt"),this.services.contents.newUntitled(t)}open(t,e="default",s,i){return this._createOrOpenDocument("open",t,e,s,i)}openOrReveal(t,e="default",s,i){const n=this.findWidget(t,e);return n?(this._opener.open(n,{type:e,...i}),n):this.open(t,e,s,null!=i?i:{})}overwrite(t,e){const s=`${e}.${m.UUID.uuid4()}`,i=()=>this.rename(s,e);return this.rename(t,s).then((()=>this.deleteFile(e))).then(i,i)}rename(t,e){return this.services.contents.rename(t,e)}_findContext(t,e){const s=this.services.contents.normalize(t);return(0,_.find)(this._contexts,(t=>t.path===s&&t.factoryName===e))}_contextsForPath(t){const e=this.services.contents.normalize(t);return this._contexts.filter((t=>t.path===e))}_createContext(t,e,s){const i=new u.Context({opener:(t,e)=>{this._widgetManager.adoptWidget(i,t),this._opener.open(t,e)},manager:this.services,factory:e,path:t,kernelPreference:s,setBusy:this._setBusy,sessionDialogs:this._dialogs,lastModifiedCheckMargin:this._lastModifiedCheckMargin,translator:this.translator}),n=new f({context:i,isConnectedCallback:this._isConnectedCallback,saveInterval:this.autosaveInterval});return C.saveHandlerProperty.set(i,n),i.ready.then((()=>{this.autosave&&n.start()})),i.disposed.connect(this._onContextDisposed,this),this._contexts.push(i),i}_onContextDisposed(t){_.ArrayExt.removeFirstOf(this._contexts,t)}_widgetFactoryFor(t,e){const{registry:s}=this;if("default"===e){const i=s.defaultWidgetFactory(t);if(!i)return;e=i.name}return s.getWidgetFactory(e)}_createOrOpenDocument(t,e,s="default",i,n){const a=this._widgetFactoryFor(e,s);if(!a)return;const o=a.modelName||"text",r=this.registry.getModelFactory(o);if(!r)return;const l=this.registry.getKernelPreference(e,a.name,i);let h,c=Promise.resolve(void 0);if("open"===t)h=this._findContext(e,r.name)||null,h||(h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!1))));else{if("create"!==t)throw new Error(`Invalid argument 'which': ${t}`);h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!0)))}const d=this._widgetManager.createWidget(a,h);return this._opener.open(d,{type:a.name,...n}),c.catch((t=>{console.error(`Failed to initialize the context with '${r.name}' for ${e}`,t),d.close()})),d}_onActivateRequested(t,e){this._activateRequested.emit(e)}_onWidgetStateChanged(t,e){"confirmClosingDocument"===e.name&&this._stateChanged.emit(e)}}!function(t){t.saveHandlerProperty=new p.AttachedProperty({name:"saveHandler",create:()=>{}})}(C||(C={}));var b=s(22629),M=s(52018),S=s(78156),T=s.n(S);function F(t){return T().createElement(b.TextItem,{source:t.name,title:t.fullPath})}class W extends M.VDomRenderer{constructor(t){super(new W.Model(t.docManager)),this.node.title=this.model.path}render(){return T().createElement(F,{fullPath:this.model.path,name:this.model.name})}}function k(t){return T().createElement(b.TextItem,{source:t.fileStatus})}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onTitleChange=t=>{const e=this._getAllState();this._name=t.label,this._triggerChange(e,this._getAllState())},this._onPathChange=(t,e)=>{const s=this._getAllState();this._path=e,this._name=a.PathExt.basename(e),this._triggerChange(s,this._getAllState())},this._path="",this._name="",this._widget=null,this._docManager=t}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(t){const e=this._widget;if(null!==e){const t=this._docManager.contextForWidget(e);t?t.pathChanged.disconnect(this._onPathChange):e.title.changed.disconnect(this._onTitleChange)}const s=this._getAllState();if(this._widget=t,null===this._widget)this._path="",this._name="";else{const t=this._docManager.contextForWidget(this._widget);t?(this._path=t.path,this._name=a.PathExt.basename(t.path),t.pathChanged.connect(this._onPathChange)):(this._path="",this._name=this._widget.title.label,this._widget.title.changed.connect(this._onTitleChange))}this._triggerChange(s,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(t,e){t[0]===e[0]&&t[1]===e[1]||this.stateChanged.emit(void 0)}}t.Model=e}(W||(W={}));class E extends M.VDomRenderer{constructor(t){super(new E.Model(t.docManager));const e=(t.translator||o.nullTranslator).load("jupyterlab");this._statusMap={completed:e.__("Saving completed"),started:e.__("Saving started"),failed:e.__("Saving failed")}}render(){return null===this.model||null===this.model.status?null:T().createElement(k,{fileStatus:this._statusMap[this.model.status]})}}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onStatusChange=(t,e)=>{this._status=e,"completed"===this._status?(setTimeout((()=>{this._status=null,this.stateChanged.emit(void 0)}),2e3),this.stateChanged.emit(void 0)):this.stateChanged.emit(void 0)},this._status=null,this._widget=null,this._status=null,this.widget=null,this._docManager=t}get status(){return this._status}get widget(){return this._widget}set widget(t){var e,s;const i=this._widget;if(null!==i){const t=this._docManager.contextForWidget(i);t?t.saveState.disconnect(this._onStatusChange):(null===(e=this._widget.content)||void 0===e?void 0:e.saveStateChanged)&&this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}if(this._widget=t,null===this._widget)this._status=null;else{const t=this._docManager.contextForWidget(this._widget);t?t.saveState.connect(this._onStatusChange):(null===(s=this._widget.content)||void 0===s?void 0:s.saveStateChanged)&&this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}t.Model=e}(E||(E={}));const A=new m.Token("@jupyterlab/docmanager:IDocumentManager","A service for the manager for all\n documents used by the application. Use this if you want to open and close documents,\n create and delete files, and otherwise interact with the file system."),O=new m.Token("@jupyterlab/docmanager:IDocumentWidgetOpener","A service to open a widget.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4558],{94558:(t,e,s)=>{s.r(e),s.d(e,{DocumentManager:()=>x,DocumentWidgetManager:()=>P,IDocumentManager:()=>A,IDocumentWidgetOpener:()=>O,PathStatus:()=>W,SaveHandler:()=>f,SavingStatus:()=>E,isValidFileName:()=>d,renameDialog:()=>l,renameFile:()=>h,shouldOverwrite:()=>c});var i,n=s(12982),a=s(38639),o=s(71677),r=s(31516);function l(t,e,s){const i=(s=s||o.nullTranslator).load("jupyterlab"),a=e.localPath.split("/").pop()||e.localPath;return(0,n.showDialog)({title:i.__("Rename File"),body:new g(a),focusNodeSelector:"input",buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:i.__("Rename"),ariaLabel:i.__("Rename File")})]}).then((t=>t.value?d(t.value)?e.rename(t.value):((0,n.showErrorMessage)(i.__("Rename Error"),Error(i.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',t.value))),null):null))}function h(t,e,s){return t.rename(e,s).catch((i=>{if(409!==i.response.status)throw i;return c(s).then((i=>i?t.overwrite(e,s):Promise.reject("File not renamed")))}))}function c(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i={title:s.__("Overwrite file?"),body:s.__('"%1" already exists, overwrite?',t),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s.__("Overwrite"),ariaLabel:s.__("Overwrite Existing File")})]};return(0,n.showDialog)(i).then((t=>Promise.resolve(t.button.accept)))}function d(t){return t.length>0&&!/[\/\\:]/.test(t)}class g extends r.Widget{constructor(t){super({node:i.createRenameNode(t)}),this.addClass("jp-FileDialog");const e=a.PathExt.extname(t),s=this.inputNode.value=a.PathExt.basename(t);this.inputNode.setSelectionRange(0,s.length-e.length)}get inputNode(){return this.node.getElementsByTagName("input")[0]}getValue(){return this.inputNode.value}}!function(t){t.createRenameNode=function(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i=document.createElement("div"),n=document.createElement("label");n.textContent=s.__("File Path");const a=document.createElement("span");a.textContent=t;const r=document.createElement("label");r.textContent=s.__("New Name"),r.className="jp-new-name-title";const l=document.createElement("input");return i.appendChild(n),i.appendChild(a),i.appendChild(r),i.appendChild(l),i}}(i||(i={}));var u=s(35312),_=s(33625),m=s(20998),p=s(14421),v=s(81997);class f{constructor(t){this._autosaveTimer=-1,this._minInterval=-1,this._interval=-1,this._isActive=!1,this._inDialog=!1,this._isDisposed=!1,this._multiplier=10,this._context=t.context,this._isConnectedCallback=t.isConnectedCallback||(()=>!0);const e=t.saveInterval||120;this._minInterval=1e3*e,this._interval=this._minInterval,this._context.fileChanged.connect(this._setTimer,this),this._context.disposed.connect(this.dispose,this)}get saveInterval(){return this._interval/1e3}set saveInterval(t){this._minInterval=this._interval=1e3*t,this._isActive&&this._setTimer()}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,clearTimeout(this._autosaveTimer),v.Signal.clearData(this))}start(){this._isActive=!0,this._setTimer()}stop(){this._isActive=!1,clearTimeout(this._autosaveTimer)}_setTimer(){clearTimeout(this._autosaveTimer),this._isActive&&(this._autosaveTimer=window.setTimeout((()=>{this._isConnectedCallback()&&this._save()}),this._interval))}_save(){const t=this._context;if(this._setTimer(),!t)return;if(!t.contentsModel||!t.contentsModel.writable||!t.model.dirty||this._inDialog)return;const e=(new Date).getTime();t.save().then((()=>{if(this.isDisposed)return;const t=(new Date).getTime()-e;this._interval=Math.max(this._multiplier*t,this._minInterval),this._setTimer()})).catch((t=>{const{name:e}=t;"ModalCancelError"!==e&&"ModalDuplicateError"!==e&&console.error("Error in Auto-Save",t.message)}))}}var w,C,y=s(2549),D=s(49503);class P{constructor(t){this._activateRequested=new v.Signal(this),this._confirmClosingTab=!1,this._isDisposed=!1,this._stateChanged=new v.Signal(this),this._registry=t.registry,this.translator=t.translator||o.nullTranslator}get activateRequested(){return this._activateRequested}get confirmClosingDocument(){return this._confirmClosingTab}set confirmClosingDocument(t){if(this._confirmClosingTab!==t){const e=this._confirmClosingTab;this._confirmClosingTab=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.disconnectReceiver(this))}createWidget(t,e){const s=t.createNew(e);return this._initializeWidget(s,t,e),s}_initializeWidget(t,e,s){w.factoryProperty.set(t,e);const i=new y.DisposableSet;for(const n of this._registry.widgetExtensions(e.name)){const e=n.createNew(t,s);e&&i.add(e)}w.disposablesProperty.set(t,i),t.disposed.connect(this._onWidgetDisposed,this),this.adoptWidget(s,t),s.fileChanged.connect(this._onFileChanged,this),s.pathChanged.connect(this._onPathChanged,this),s.ready.then((()=>{this.setCaption(t)}))}adoptWidget(t,e){w.widgetsProperty.get(t).push(e),D.MessageLoop.installMessageHook(e,this),e.addClass("jp-Document"),e.title.closable=!0,e.disposed.connect(this._widgetDisposed,this),w.contextProperty.set(e,t)}findWidget(t,e){const s=w.widgetsProperty.get(t);if(s)return(0,_.find)(s,(t=>{const s=w.factoryProperty.get(t);return!!s&&s.name===e}))}contextForWidget(t){return w.contextProperty.get(t)}cloneWidget(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.factoryProperty.get(t);if(!s)return;const i=s.createNew(e,t);return this._initializeWidget(i,s,e),i}closeWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onClose(t)))).then((()=>{}))}deleteWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onDelete(t)))).then((()=>{}))}messageHook(t,e){switch(e.type){case"close-request":return this.onClose(t),!1;case"activate-request":{const e=this.contextForWidget(t);e&&this._activateRequested.emit(e.path);break}}return!0}async setCaption(t){const e=this.translator.load("jupyterlab"),s=w.contextProperty.get(t);if(!s)return;const i=s.contentsModel;if(i)return s.listCheckpoints().then((n=>{if(t.isDisposed)return;const o=n[n.length-1],r=o?a.Time.format(o.last_modified):"None";let l=e.__("Name: %1\nPath: %2\n",i.name,i.path);s.model.readOnly?l+=e.__("Read-only"):l+=e.__("Last Saved: %1\n",a.Time.format(i.last_modified))+e.__("Last Checkpoint: %1",r),t.title.caption=l}));t.title.caption=""}async onClose(t){var e;const[s,i]=await this._maybeClose(t,this.translator);if(t.isDisposed)return!0;if(s){if(!i){const s=w.contextProperty.get(t);if(!s)return!0;(null===(e=s.contentsModel)||void 0===e?void 0:e.writable)?await s.save():await s.saveAs()}if(t.isDisposed)return!0;t.dispose()}return s}onDelete(t){return t.dispose(),Promise.resolve(void 0)}async _maybeClose(t,e){var s,i;const a=(e=e||o.nullTranslator).load("jupyterlab"),r=w.contextProperty.get(t);if(!r)return Promise.resolve([!0,!0]);let l=w.widgetsProperty.get(r);if(!l)return Promise.resolve([!0,!0]);l=l.filter((t=>{const e=w.factoryProperty.get(t);return!!e&&!1===e.readOnly}));const h=t.title.label,c=w.factoryProperty.get(t),d=r.model.dirty&&l.length<=1&&!(null===(s=null==c?void 0:c.readOnly)||void 0===s||s);if(this.confirmClosingDocument){const t=[n.Dialog.cancelButton(),n.Dialog.okButton({label:d?a.__("Close and save"):a.__("Close"),ariaLabel:d?a.__("Close and save Document"):a.__("Close Document")})];d&&t.splice(1,0,n.Dialog.warnButton({label:a.__("Close without saving"),ariaLabel:a.__("Close Document without saving")}));const e=await(0,n.showDialog)({title:a.__("Confirmation"),body:a.__('Please confirm you want to close "%1".',h),checkbox:d?null:{label:a.__("Do not ask me again."),caption:a.__("If checked, no confirmation to close a document will be asked in the future.")},buttons:t});return e.isChecked&&(this.confirmClosingDocument=!1),Promise.resolve([e.button.accept,!d||"warn"===e.button.displayType])}{if(!d)return Promise.resolve([!0,!0]);const t=(null===(i=r.contentsModel)||void 0===i?void 0:i.writable)?a.__("Save"):a.__("Save as"),e=await(0,n.showDialog)({title:a.__("Save your work"),body:a.__('Save changes in "%1" before closing?',h),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:a.__("Discard"),ariaLabel:a.__("Discard changes to file")}),n.Dialog.okButton({label:t})]});return[e.button.accept,"warn"===e.button.displayType]}}_widgetDisposed(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.widgetsProperty.get(e);s&&(_.ArrayExt.removeFirstOf(s,t),s.length||e.dispose())}_onWidgetDisposed(t){w.disposablesProperty.get(t).dispose()}_onFileChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}_onPathChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}}!function(t){t.contextProperty=new p.AttachedProperty({name:"context",create:()=>{}}),t.factoryProperty=new p.AttachedProperty({name:"factory",create:()=>{}}),t.widgetsProperty=new p.AttachedProperty({name:"widgets",create:()=>[]}),t.disposablesProperty=new p.AttachedProperty({name:"disposables",create:()=>new y.DisposableSet})}(w||(w={}));class x{constructor(t){var e;this._activateRequested=new v.Signal(this),this._contexts=[],this._isDisposed=!1,this._autosave=!0,this._autosaveInterval=120,this._lastModifiedCheckMargin=500,this._renameUntitledFileOnSave=!0,this._stateChanged=new v.Signal(this),this.translator=t.translator||o.nullTranslator,this.registry=t.registry,this.services=t.manager,this._dialogs=null!==(e=t.sessionDialogs)&&void 0!==e?e:new n.SessionContextDialogs({translator:t.translator}),this._isConnectedCallback=t.isConnectedCallback||(()=>!0),this._opener=t.opener,this._when=t.when||t.manager.ready;const s=new P({registry:this.registry,translator:this.translator});s.activateRequested.connect(this._onActivateRequested,this),s.stateChanged.connect(this._onWidgetStateChanged,this),this._widgetManager=s,this._setBusy=t.setBusy}get activateRequested(){return this._activateRequested}get autosave(){return this._autosave}set autosave(t){if(this._autosave!==t){const e=this._autosave;this._autosave=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(!0!==t||s.isActive?!1===t&&s.isActive&&s.stop():s.start())})),this._stateChanged.emit({name:"autosave",oldValue:e,newValue:t})}}get autosaveInterval(){return this._autosaveInterval}set autosaveInterval(t){if(this._autosaveInterval!==t){const e=this._autosaveInterval;this._autosaveInterval=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(s.saveInterval=t||120)})),this._stateChanged.emit({name:"autosaveInterval",oldValue:e,newValue:t})}}get confirmClosingDocument(){return this._widgetManager.confirmClosingDocument}set confirmClosingDocument(t){if(this._widgetManager.confirmClosingDocument!==t){const e=this._widgetManager.confirmClosingDocument;this._widgetManager.confirmClosingDocument=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(t){if(this._lastModifiedCheckMargin!==t){const e=this._lastModifiedCheckMargin;this._lastModifiedCheckMargin=t,this._contexts.forEach((e=>{e.lastModifiedCheckMargin=t})),this._stateChanged.emit({name:"lastModifiedCheckMargin",oldValue:e,newValue:t})}}get renameUntitledFileOnSave(){return this._renameUntitledFileOnSave}set renameUntitledFileOnSave(t){if(this._renameUntitledFileOnSave!==t){const e=this._renameUntitledFileOnSave;this._renameUntitledFileOnSave=t,this._stateChanged.emit({name:"renameUntitledFileOnSave",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.clearData(this),this._contexts.forEach((t=>this._widgetManager.closeWidgets(t))),this._widgetManager.dispose(),this._contexts.length=0)}cloneWidget(t){return this._widgetManager.cloneWidget(t)}closeAll(){return Promise.all(this._contexts.map((t=>this._widgetManager.closeWidgets(t)))).then((()=>{}))}closeFile(t){const e=this._contextsForPath(t).map((t=>this._widgetManager.closeWidgets(t)));return Promise.all(e).then((t=>{}))}contextForWidget(t){return this._widgetManager.contextForWidget(t)}copy(t,e){return this.services.contents.copy(t,e)}createNew(t,e="default",s){return this._createOrOpenDocument("create",t,e,s)}deleteFile(t){return this.services.sessions.stopIfNeeded(t).then((()=>this.services.contents.delete(t))).then((()=>(this._contextsForPath(t).forEach((t=>this._widgetManager.deleteWidgets(t))),Promise.resolve(void 0))))}duplicate(t){const e=a.PathExt.dirname(t);return this.services.contents.copy(t,e)}findWidget(t,e="default"){const s=a.PathExt.normalize(t);let i=[e];if("default"===e){const t=this.registry.defaultWidgetFactory(s);if(!t)return;i=[t.name]}else null===e&&(i=this.registry.preferredWidgetFactories(s).map((t=>t.name)));for(const t of this._contextsForPath(s))for(const e of i)if(null!==e){const s=this._widgetManager.findWidget(t,e);if(s)return s}}newUntitled(t){return"file"===t.type&&(t.ext=t.ext||".txt"),this.services.contents.newUntitled(t)}open(t,e="default",s,i){return this._createOrOpenDocument("open",t,e,s,i)}openOrReveal(t,e="default",s,i){const n=this.findWidget(t,e);return n?(this._opener.open(n,{type:e,...i}),n):this.open(t,e,s,null!=i?i:{})}overwrite(t,e){const s=`${e}.${m.UUID.uuid4()}`,i=()=>this.rename(s,e);return this.rename(t,s).then((()=>this.deleteFile(e))).then(i,i)}rename(t,e){return this.services.contents.rename(t,e)}_findContext(t,e){const s=this.services.contents.normalize(t);return(0,_.find)(this._contexts,(t=>t.path===s&&t.factoryName===e))}_contextsForPath(t){const e=this.services.contents.normalize(t);return this._contexts.filter((t=>t.path===e))}_createContext(t,e,s){const i=new u.Context({opener:(t,e)=>{this._widgetManager.adoptWidget(i,t),this._opener.open(t,e)},manager:this.services,factory:e,path:t,kernelPreference:s,setBusy:this._setBusy,sessionDialogs:this._dialogs,lastModifiedCheckMargin:this._lastModifiedCheckMargin,translator:this.translator}),n=new f({context:i,isConnectedCallback:this._isConnectedCallback,saveInterval:this.autosaveInterval});return C.saveHandlerProperty.set(i,n),i.ready.then((()=>{this.autosave&&n.start()})),i.disposed.connect(this._onContextDisposed,this),this._contexts.push(i),i}_onContextDisposed(t){_.ArrayExt.removeFirstOf(this._contexts,t)}_widgetFactoryFor(t,e){const{registry:s}=this;if("default"===e){const i=s.defaultWidgetFactory(t);if(!i)return;e=i.name}return s.getWidgetFactory(e)}_createOrOpenDocument(t,e,s="default",i,n){const a=this._widgetFactoryFor(e,s);if(!a)return;const o=a.modelName||"text",r=this.registry.getModelFactory(o);if(!r)return;const l=this.registry.getKernelPreference(e,a.name,i);let h,c=Promise.resolve(void 0);if("open"===t)h=this._findContext(e,r.name)||null,h||(h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!1))));else{if("create"!==t)throw new Error(`Invalid argument 'which': ${t}`);h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!0)))}const d=this._widgetManager.createWidget(a,h);return this._opener.open(d,{type:a.name,...n}),c.catch((t=>{console.error(`Failed to initialize the context with '${r.name}' for ${e}`,t),d.close()})),d}_onActivateRequested(t,e){this._activateRequested.emit(e)}_onWidgetStateChanged(t,e){"confirmClosingDocument"===e.name&&this._stateChanged.emit(e)}}!function(t){t.saveHandlerProperty=new p.AttachedProperty({name:"saveHandler",create:()=>{}})}(C||(C={}));var b=s(34276),M=s(68239),S=s(78156),T=s.n(S);function F(t){return T().createElement(b.TextItem,{source:t.name,title:t.fullPath})}class W extends M.VDomRenderer{constructor(t){super(new W.Model(t.docManager)),this.node.title=this.model.path}render(){return T().createElement(F,{fullPath:this.model.path,name:this.model.name})}}function k(t){return T().createElement(b.TextItem,{source:t.fileStatus})}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onTitleChange=t=>{const e=this._getAllState();this._name=t.label,this._triggerChange(e,this._getAllState())},this._onPathChange=(t,e)=>{const s=this._getAllState();this._path=e,this._name=a.PathExt.basename(e),this._triggerChange(s,this._getAllState())},this._path="",this._name="",this._widget=null,this._docManager=t}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(t){const e=this._widget;if(null!==e){const t=this._docManager.contextForWidget(e);t?t.pathChanged.disconnect(this._onPathChange):e.title.changed.disconnect(this._onTitleChange)}const s=this._getAllState();if(this._widget=t,null===this._widget)this._path="",this._name="";else{const t=this._docManager.contextForWidget(this._widget);t?(this._path=t.path,this._name=a.PathExt.basename(t.path),t.pathChanged.connect(this._onPathChange)):(this._path="",this._name=this._widget.title.label,this._widget.title.changed.connect(this._onTitleChange))}this._triggerChange(s,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(t,e){t[0]===e[0]&&t[1]===e[1]||this.stateChanged.emit(void 0)}}t.Model=e}(W||(W={}));class E extends M.VDomRenderer{constructor(t){super(new E.Model(t.docManager));const e=(t.translator||o.nullTranslator).load("jupyterlab");this._statusMap={completed:e.__("Saving completed"),started:e.__("Saving started"),failed:e.__("Saving failed")}}render(){return null===this.model||null===this.model.status?null:T().createElement(k,{fileStatus:this._statusMap[this.model.status]})}}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onStatusChange=(t,e)=>{this._status=e,"completed"===this._status?(setTimeout((()=>{this._status=null,this.stateChanged.emit(void 0)}),2e3),this.stateChanged.emit(void 0)):this.stateChanged.emit(void 0)},this._status=null,this._widget=null,this._status=null,this.widget=null,this._docManager=t}get status(){return this._status}get widget(){return this._widget}set widget(t){var e,s;const i=this._widget;if(null!==i){const t=this._docManager.contextForWidget(i);t?t.saveState.disconnect(this._onStatusChange):(null===(e=this._widget.content)||void 0===e?void 0:e.saveStateChanged)&&this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}if(this._widget=t,null===this._widget)this._status=null;else{const t=this._docManager.contextForWidget(this._widget);t?t.saveState.connect(this._onStatusChange):(null===(s=this._widget.content)||void 0===s?void 0:s.saveStateChanged)&&this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}t.Model=e}(E||(E={}));const A=new m.Token("@jupyterlab/docmanager:IDocumentManager","A service for the manager for all\n documents used by the application. Use this if you want to open and close documents,\n create and delete files, and otherwise interact with the file system."),O=new m.Token("@jupyterlab/docmanager:IDocumentWidgetOpener","A service to open a widget.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4645,6345],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(49880),s=o(1879),a=o(74787),r=o(21024),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4645,6345],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(3053),s=o(46122),a=o(38639),r=o(42266),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4811,7386],{37386:(e,t,o)=>{o.r(t),o.d(t,{CellBarExtension:()=>u,CellToolbarTracker:()=>c});var l=o(57797),n=o(50892),a=o(52018),i=o(33625),s=o(81997);const r=["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],d="jp-toolbar-overlap";class c{constructor(e,t,o){if(this._isDisposed=!1,this._toolbar=null,this._toolbarItems=null,this._toolbarFactory=null,this._panel=e,this._previousActiveCell=this._panel.content.activeCell,this._toolbarItems=null!=t?t:null,this._toolbarFactory=null!=o?o:null,null===this._toolbarItems&&null===this._toolbarFactory)throw Error("You must provide the toolbarFactory or the toolbar items.");!this._toolbarFactory&&this._toolbarItems&&(this._onToolbarChanged(),this._toolbarItems.changed.connect(this._onToolbarChanged,this)),e.revealed.then((()=>{requestAnimationFrame((()=>{const t=e.content;this._onActiveCellChanged(t),t.activeCellChanged.connect(this._onActiveCellChanged,this),t.renderingLayoutChanged.connect(this._onActiveCellChanged,this),t.disposed.connect((()=>{t.activeCellChanged.disconnect(this._onActiveCellChanged)}))}))}))}_onMetadataChanged(e,t){"jupyter"===t.key&&("object"!=typeof t.newValue||!0!==t.newValue.source_hidden||"add"!==t.type&&"change"!==t.type?"object"==typeof t.oldValue&&!0===t.oldValue.source_hidden&&this._addToolbar(e):this._removeToolbar(e))}_onActiveCellChanged(e){this._previousActiveCell&&!this._previousActiveCell.isDisposed&&(this._removeToolbar(this._previousActiveCell.model),this._previousActiveCell.model.metadataChanged.disconnect(this._onMetadataChanged));const t=e.activeCell;this._previousActiveCell=t,null===t||t.inputHidden||(t.model.metadataChanged.connect(this._onMetadataChanged,this),this._addToolbar(t.model))}get isDisposed(){return this._isDisposed}dispose(){var e,t;this.isDisposed||(this._isDisposed=!0,null===(e=this._toolbarItems)||void 0===e||e.changed.disconnect(this._onToolbarChanged,this),null===(t=this._toolbar)||void 0===t||t.dispose(),this._panel=null,s.Signal.clearData(this))}_addToolbar(e){const t=this._getCell(e);if(t&&!t.isDisposed){const e=this._toolbar=new a.Toolbar;e.addClass("jp-cell-menu"),e.addClass("jp-cell-toolbar");const o=[t.ready];if(this._toolbarFactory)(0,l.setToolbar)(t,this._toolbarFactory,e),e.layout.widgets.forEach((e=>{e.update()}));else for(const{name:t,widget:l}of this._toolbarItems)e.addItem(t,l),l instanceof a.ReactWidget&&void 0!==l.renderPromise&&(l.update(),o.push(l.renderPromise));Promise.all(o).then((()=>{var o;t.isDisposed||(null===(o=this._panel)||void 0===o?void 0:o.content.activeCell)!==t?e.dispose():(t.layout.insertWidget(0,e),t.displayChanged.connect(this._resizeEventCallback,this),t.model.contentChanged.connect(this._changedEventCallback,this),this._updateCellForToolbarOverlap(t))})).catch((e=>{console.error("Error rendering buttons of the cell toolbar: ",e)}))}}_getCell(e){var t;return null===(t=this._panel)||void 0===t?void 0:t.content.widgets.find((t=>t.model===e))}_removeToolbar(e){var t,o;const l=this._getCell(e);l&&!l.isDisposed&&l.displayChanged.disconnect(this._resizeEventCallback,this),e.contentChanged.disconnect(this._changedEventCallback,this),(null===(t=this._toolbar)||void 0===t?void 0:t.parent)===l&&!1===(null===(o=this._toolbar)||void 0===o?void 0:o.isDisposed)&&this._toolbar.dispose()}_onToolbarChanged(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;t&&(this._removeToolbar(t.model),this._addToolbar(t.model))}_changedEventCallback(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;null!=t&&this._updateCellForToolbarOverlap(t)}_resizeEventCallback(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;null!=t&&this._updateCellForToolbarOverlap(t)}_updateCellForToolbarOverlap(e){requestAnimationFrame((()=>{const t=e.node;t.classList.remove(d),this._cellToolbarOverlapsContents(e)&&t.classList.add(d)}))}_cellToolbarOverlapsContents(e){var t,o,l,n;const a=e.model.type,i=null===(t=e.editorWidget)||void 0===t?void 0:t.node.getBoundingClientRect(),s=null!==(o=null==i?void 0:i.left)&&void 0!==o?o:0,r=null!==(l=null==i?void 0:i.right)&&void 0!==l?l:0,d=this._cellToolbarLeft(e);return null!==d&&((s+r)/2>d||("markdown"===a&&e.rendered?this._markdownOverlapsToolbar(e):"default"===(null===(n=this._panel)||void 0===n?void 0:n.content.renderingLayout)?this._codeOverlapsToolbar(e):this._outputOverlapsToolbar(e)))}_markdownOverlapsToolbar(e){const t=e.inputArea;if(!t)return!1;const o=t.renderedInput.node.firstElementChild;if(null===o)return!1;const l=o.style.maxWidth;o.style.maxWidth="max-content";const n=o.getBoundingClientRect().right;o.style.maxWidth=l;const a=this._cellToolbarLeft(e);return null!==a&&n>a}_outputOverlapsToolbar(e){const t=e.outputArea.node;if(t){const o=t.querySelectorAll("[data-mime-type]"),l=this._cellToolbarRect(e);if(l){const{left:e,bottom:t}=l;return(0,i.some)(o,(o=>{const l=o.firstElementChild;if(l){const n=new Range;r.includes(o.getAttribute("data-mime-type")||"")?n.selectNodeContents(l):n.selectNode(l);const{right:a,top:i}=n.getBoundingClientRect();return a>e&&i<t}return!1}))}}return!1}_codeOverlapsToolbar(e){const t=e.editorWidget,o=e.editor;if(!t||!o)return!1;if(o.lineCount<1)return!1;const l=t.node.getElementsByClassName("cm-line");if(l.length<1)return!1;let n=l[0].getBoundingClientRect().left;const a=document.createRange();a.selectNodeContents(l[0]),n+=a.getBoundingClientRect().width;const i=this._cellToolbarLeft(e);return null!==i&&n>i}_cellToolbarRect(e){var t;return(null===(t=this._toolbar)||void 0===t?void 0:t.parent)!==e?null:this._toolbar.node.getBoundingClientRect()}_cellToolbarLeft(e){var t;return(null===(t=this._cellToolbarRect(e))||void 0===t?void 0:t.left)||null}}const h=[{command:"notebook:duplicate-below",name:"duplicate-cell"},{command:"notebook:move-cell-up",name:"move-cell-up"},{command:"notebook:move-cell-down",name:"move-cell-down"},{command:"notebook:insert-cell-above",name:"insert-cell-above"},{command:"notebook:insert-cell-below",name:"insert-cell-below"},{command:"notebook:delete-cell",name:"delete-cell"}];class u{constructor(e,t){this._commands=e,this._toolbarFactory=null!=t?t:this.defaultToolbarFactory}get defaultToolbarFactory(){const e=(0,l.createDefaultFactory)(this._commands);return t=>new n.ObservableList({values:h.map((o=>({name:o.name,widget:e(u.FACTORY_NAME,t,o)})))})}createNew(e){return new c(e,void 0,this._toolbarFactory)}}u.FACTORY_NAME="Cell"}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4811,7386],{37386:(e,t,o)=>{o.r(t),o.d(t,{CellBarExtension:()=>u,CellToolbarTracker:()=>c});var l=o(12982),n=o(11351),a=o(68239),i=o(33625),s=o(81997);const r=["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],d="jp-toolbar-overlap";class c{constructor(e,t,o){if(this._isDisposed=!1,this._toolbar=null,this._toolbarItems=null,this._toolbarFactory=null,this._panel=e,this._previousActiveCell=this._panel.content.activeCell,this._toolbarItems=null!=t?t:null,this._toolbarFactory=null!=o?o:null,null===this._toolbarItems&&null===this._toolbarFactory)throw Error("You must provide the toolbarFactory or the toolbar items.");!this._toolbarFactory&&this._toolbarItems&&(this._onToolbarChanged(),this._toolbarItems.changed.connect(this._onToolbarChanged,this)),e.revealed.then((()=>{requestAnimationFrame((()=>{const t=e.content;this._onActiveCellChanged(t),t.activeCellChanged.connect(this._onActiveCellChanged,this),t.renderingLayoutChanged.connect(this._onActiveCellChanged,this),t.disposed.connect((()=>{t.activeCellChanged.disconnect(this._onActiveCellChanged)}))}))}))}_onMetadataChanged(e,t){"jupyter"===t.key&&("object"!=typeof t.newValue||!0!==t.newValue.source_hidden||"add"!==t.type&&"change"!==t.type?"object"==typeof t.oldValue&&!0===t.oldValue.source_hidden&&this._addToolbar(e):this._removeToolbar(e))}_onActiveCellChanged(e){this._previousActiveCell&&!this._previousActiveCell.isDisposed&&(this._removeToolbar(this._previousActiveCell.model),this._previousActiveCell.model.metadataChanged.disconnect(this._onMetadataChanged));const t=e.activeCell;this._previousActiveCell=t,null===t||t.inputHidden||(t.model.metadataChanged.connect(this._onMetadataChanged,this),this._addToolbar(t.model))}get isDisposed(){return this._isDisposed}dispose(){var e,t;this.isDisposed||(this._isDisposed=!0,null===(e=this._toolbarItems)||void 0===e||e.changed.disconnect(this._onToolbarChanged,this),null===(t=this._toolbar)||void 0===t||t.dispose(),this._panel=null,s.Signal.clearData(this))}_addToolbar(e){const t=this._getCell(e);if(t&&!t.isDisposed){const e=this._toolbar=new a.Toolbar;e.addClass("jp-cell-menu"),e.addClass("jp-cell-toolbar");const o=[t.ready];if(this._toolbarFactory)(0,l.setToolbar)(t,this._toolbarFactory,e),e.layout.widgets.forEach((e=>{e.update()}));else for(const{name:t,widget:l}of this._toolbarItems)e.addItem(t,l),l instanceof a.ReactWidget&&void 0!==l.renderPromise&&(l.update(),o.push(l.renderPromise));Promise.all(o).then((()=>{var o;t.isDisposed||(null===(o=this._panel)||void 0===o?void 0:o.content.activeCell)!==t?e.dispose():(t.layout.insertWidget(0,e),t.displayChanged.connect(this._resizeEventCallback,this),t.model.contentChanged.connect(this._changedEventCallback,this),this._updateCellForToolbarOverlap(t))})).catch((e=>{console.error("Error rendering buttons of the cell toolbar: ",e)}))}}_getCell(e){var t;return null===(t=this._panel)||void 0===t?void 0:t.content.widgets.find((t=>t.model===e))}_removeToolbar(e){var t,o;const l=this._getCell(e);l&&!l.isDisposed&&l.displayChanged.disconnect(this._resizeEventCallback,this),e.contentChanged.disconnect(this._changedEventCallback,this),(null===(t=this._toolbar)||void 0===t?void 0:t.parent)===l&&!1===(null===(o=this._toolbar)||void 0===o?void 0:o.isDisposed)&&this._toolbar.dispose()}_onToolbarChanged(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;t&&(this._removeToolbar(t.model),this._addToolbar(t.model))}_changedEventCallback(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;null!=t&&this._updateCellForToolbarOverlap(t)}_resizeEventCallback(){var e;const t=null===(e=this._panel)||void 0===e?void 0:e.content.activeCell;null!=t&&this._updateCellForToolbarOverlap(t)}_updateCellForToolbarOverlap(e){requestAnimationFrame((()=>{const t=e.node;t.classList.remove(d),this._cellToolbarOverlapsContents(e)&&t.classList.add(d)}))}_cellToolbarOverlapsContents(e){var t,o,l,n;const a=e.model.type,i=null===(t=e.editorWidget)||void 0===t?void 0:t.node.getBoundingClientRect(),s=null!==(o=null==i?void 0:i.left)&&void 0!==o?o:0,r=null!==(l=null==i?void 0:i.right)&&void 0!==l?l:0,d=this._cellToolbarLeft(e);return null!==d&&((s+r)/2>d||("markdown"===a&&e.rendered?this._markdownOverlapsToolbar(e):"default"===(null===(n=this._panel)||void 0===n?void 0:n.content.renderingLayout)?this._codeOverlapsToolbar(e):this._outputOverlapsToolbar(e)))}_markdownOverlapsToolbar(e){const t=e.inputArea;if(!t)return!1;const o=t.renderedInput.node.firstElementChild;if(null===o)return!1;const l=o.style.maxWidth;o.style.maxWidth="max-content";const n=o.getBoundingClientRect().right;o.style.maxWidth=l;const a=this._cellToolbarLeft(e);return null!==a&&n>a}_outputOverlapsToolbar(e){const t=e.outputArea.node;if(t){const o=t.querySelectorAll("[data-mime-type]"),l=this._cellToolbarRect(e);if(l){const{left:e,bottom:t}=l;return(0,i.some)(o,(o=>{const l=o.firstElementChild;if(l){const n=new Range;r.includes(o.getAttribute("data-mime-type")||"")?n.selectNodeContents(l):n.selectNode(l);const{right:a,top:i}=n.getBoundingClientRect();return a>e&&i<t}return!1}))}}return!1}_codeOverlapsToolbar(e){const t=e.editorWidget,o=e.editor;if(!t||!o)return!1;if(o.lineCount<1)return!1;const l=t.node.getElementsByClassName("cm-line");if(l.length<1)return!1;let n=l[0].getBoundingClientRect().left;const a=document.createRange();a.selectNodeContents(l[0]),n+=a.getBoundingClientRect().width;const i=this._cellToolbarLeft(e);return null!==i&&n>i}_cellToolbarRect(e){var t;return(null===(t=this._toolbar)||void 0===t?void 0:t.parent)!==e?null:this._toolbar.node.getBoundingClientRect()}_cellToolbarLeft(e){var t;return(null===(t=this._cellToolbarRect(e))||void 0===t?void 0:t.left)||null}}const h=[{command:"notebook:duplicate-below",name:"duplicate-cell"},{command:"notebook:move-cell-up",name:"move-cell-up"},{command:"notebook:move-cell-down",name:"move-cell-down"},{command:"notebook:insert-cell-above",name:"insert-cell-above"},{command:"notebook:insert-cell-below",name:"insert-cell-below"},{command:"notebook:delete-cell",name:"delete-cell"}];class u{constructor(e,t){this._commands=e,this._toolbarFactory=null!=t?t:this.defaultToolbarFactory}get defaultToolbarFactory(){const e=(0,l.createDefaultFactory)(this._commands);return t=>new n.ObservableList({values:h.map((o=>({name:o.name,widget:e(u.FACTORY_NAME,t,o)})))})}createNew(e){return new c(e,void 0,this._toolbarFactory)}}u.FACTORY_NAME="Cell"}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4837,3146],{73146:(e,t,o)=>{o.r(t),o.d(t,{INotebookTree:()=>n,NotebookTreeWidget:()=>s});var r=o(68239),a=o(31516);class s extends a.TabPanel{constructor(){super({tabPlacement:"top",tabsMovable:!0,renderer:r.TabBarSvg.defaultRenderer}),this.addClass("jp-TreePanel")}}const n=new(o(20998).Token)("@jupyter-notebook/tree:INotebookTree")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5088],{45088:(e,n,t)=>{t.r(n),t.d(n,{CommandIDs:()=>b,default:()=>g});var a=t(49880),o=t(57797),l=t(74787),r=t(34127),d=t(5390),i=t(6312),u=t(11523),s=t(52018),c=t(33625),m=t(20998),p=t(31516);const _="@jupyterlab/mainmenu-extension:plugin";var b;!function(e){e.openEdit="editmenu:open",e.undo="editmenu:undo",e.redo="editmenu:redo",e.clearCurrent="editmenu:clear-current",e.clearAll="editmenu:clear-all",e.find="editmenu:find",e.goToLine="editmenu:go-to-line",e.openFile="filemenu:open",e.closeAndCleanup="filemenu:close-and-cleanup",e.createConsole="filemenu:create-console",e.shutdown="filemenu:shutdown",e.logout="filemenu:logout",e.openKernel="kernelmenu:open",e.interruptKernel="kernelmenu:interrupt",e.reconnectToKernel="kernelmenu:reconnect-to-kernel",e.restartKernel="kernelmenu:restart",e.restartKernelAndClear="kernelmenu:restart-and-clear",e.changeKernel="kernelmenu:change",e.shutdownKernel="kernelmenu:shutdown",e.shutdownAllKernels="kernelmenu:shutdownAll",e.openView="viewmenu:open",e.wordWrap="viewmenu:word-wrap",e.lineNumbering="viewmenu:line-numbering",e.matchBrackets="viewmenu:match-brackets",e.openRun="runmenu:open",e.run="runmenu:run",e.runAll="runmenu:run-all",e.restartAndRunAll="runmenu:restart-and-run-all",e.runAbove="runmenu:run-above",e.runBelow="runmenu:run-below",e.openTabs="tabsmenu:open",e.activateById="tabsmenu:activate-by-id",e.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",e.openSettings="settingsmenu:open",e.openHelp="helpmenu:open",e.getKernel="helpmenu:get-kernel",e.openFirst="mainmenu:open-first"}(b||(b={}));const g={id:_,description:"Adds and provides the application main menu.",requires:[a.IRouter,u.ITranslator],optional:[o.ICommandPalette,a.ILabShell,i.ISettingRegistry],provides:r.IMainMenu,activate:async(e,n,t,i,u,m)=>{const{commands:_}=e,g=t.load("jupyterlab"),C=new r.MainMenu(_);C.id="jp-MainMenu",C.addClass("jp-scrollbar-tiny"),m&&(await h.loadSettingsMenu(m,(e=>{C.addMenu(e,!1,{rank:e.rank})}),(e=>r.MainMenu.generateMenu(_,e,g)),t),C.update());const v=l.PageConfig.getOption("quitButton").toLowerCase();C.fileMenu.quitEntry="true"===v,function(e,n,t){const o=e.commands;o.addCommand(b.undo,(0,a.createSemanticCommand)(e,n.undoers.undo,{label:t.__("Undo")},t)),o.addCommand(b.redo,(0,a.createSemanticCommand)(e,n.undoers.redo,{label:t.__("Redo")},t)),o.addCommand(b.clearCurrent,(0,a.createSemanticCommand)(e,n.clearers.clearCurrent,{label:t.__("Clear")},t)),o.addCommand(b.clearAll,(0,a.createSemanticCommand)(e,n.clearers.clearAll,{label:t.__("Clear All")},t)),o.addCommand(b.goToLine,(0,a.createSemanticCommand)(e,n.goToLiners,{label:t.__("Go to Line…")},t))}(e,C.editMenu,g),function(e,n,t,r){const i=e.commands;i.addCommand(b.closeAndCleanup,{...(0,a.createSemanticCommand)(e,n.closeAndCleaners,{execute:"application:close",label:r.__("Close and Shut Down"),isEnabled:!0},r),isEnabled:()=>!!e.shell.currentWidget&&!!e.shell.currentWidget.title.closable}),i.addCommand(b.createConsole,(0,a.createSemanticCommand)(e,n.consoleCreators,{label:r.__("New Console for Activity")},r)),i.addCommand(b.shutdown,{label:r.__("Shut Down"),caption:r.__("Shut down JupyterLab"),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>(0,o.showDialog)({title:r.__("Shutdown confirmation"),body:r.__("Please confirm you want to shut down JupyterLab."),buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:r.__("Shut Down")})]}).then((async n=>{if(n.button.accept){const n=d.ServerConnection.makeSettings(),t=l.URLExt.join(n.baseUrl,"api/shutdown");try{await Promise.all([e.serviceManager.sessions.shutdownAll(),e.serviceManager.terminals.shutdownAll()])}catch(e){console.log(`Failed to shutdown sessions and terminals: ${e}`)}return d.ServerConnection.makeRequest(t,{method:"POST"},n).then((e=>{if(!e.ok)throw new d.ServerConnection.ResponseError(e);{const e=document.createElement("div"),n=document.createElement("p");n.textContent=r.__("You have shut down the Jupyter server. You can now close this tab.");const t=document.createElement("p");t.textContent=r.__("To use JupyterLab again, you will need to relaunch it."),e.appendChild(n),e.appendChild(t),(0,o.showDialog)({title:r.__("Server stopped"),body:new p.Widget({node:e}),buttons:[]}),window.close()}})).catch((e=>{throw new d.ServerConnection.NetworkError(e)}))}}))}),i.addCommand(b.logout,{label:r.__("Log Out"),caption:r.__("Log out of JupyterLab"),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>{t.navigate("/logout",{hard:!0})}})}(e,C.fileMenu,n,g),function(e,n,t){const l=e.commands;l.addCommand(b.interruptKernel,{...(0,a.createSemanticCommand)(e,n.kernelUsers.interruptKernel,{label:t.__("Interrupt Kernel"),caption:t.__("Interrupt the kernel")},t),icon:e=>e.toolbar?s.stopIcon:void 0}),l.addCommand(b.reconnectToKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.reconnectToKernel,{label:t.__("Reconnect to Kernel")},t)),l.addCommand(b.restartKernel,{...(0,a.createSemanticCommand)(e,n.kernelUsers.restartKernel,{label:t.__("Restart Kernel…"),caption:t.__("Restart the kernel")},t),icon:e=>e.toolbar?s.refreshIcon:void 0}),l.addCommand(b.restartKernelAndClear,(0,a.createSemanticCommand)(e,[n.kernelUsers.restartKernel,n.kernelUsers.clearWidget],{label:t.__("Restart Kernel and Clear…")},t)),l.addCommand(b.changeKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.changeKernel,{label:t.__("Change Kernel…")},t)),l.addCommand(b.shutdownKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.shutdownKernel,{label:t.__("Shut Down Kernel"),caption:t.__("Shut down kernel")},t)),l.addCommand(b.shutdownAllKernels,{label:t.__("Shut Down All Kernels…"),isEnabled:()=>!e.serviceManager.sessions.running().next().done,execute:()=>(0,o.showDialog)({title:t.__("Shut Down All?"),body:t.__("Shut down all kernels?"),buttons:[o.Dialog.cancelButton({label:t.__("Dismiss")}),o.Dialog.warnButton({label:t.__("Shut Down All")})]}).then((n=>{if(n.button.accept)return e.serviceManager.sessions.shutdownAll()}))})}(e,C.kernelMenu,g),function(e,n,t){const o=e.commands;o.addCommand(b.run,{...(0,a.createSemanticCommand)(e,n.codeRunners.run,{label:t.__("Run Selected"),caption:t.__("Run Selected")},t),icon:e=>e.toolbar?s.runIcon:void 0}),o.addCommand(b.runAll,(0,a.createSemanticCommand)(e,n.codeRunners.runAll,{label:t.__("Run All"),caption:t.__("Run All")},t)),o.addCommand(b.restartAndRunAll,{...(0,a.createSemanticCommand)(e,[n.codeRunners.restart,n.codeRunners.runAll],{label:t.__("Restart Kernel and Run All"),caption:t.__("Restart Kernel and Run All")},t),icon:e=>e.toolbar?s.fastForwardIcon:void 0})}(e,C.runMenu,g),function(e,n,t){const o=e.commands;o.addCommand(b.lineNumbering,(0,a.createSemanticCommand)(e,n.editorViewers.toggleLineNumbers,{label:t.__("Show Line Numbers")},t)),o.addCommand(b.matchBrackets,(0,a.createSemanticCommand)(e,n.editorViewers.toggleMatchBrackets,{label:t.__("Match Brackets")},t)),o.addCommand(b.wordWrap,(0,a.createSemanticCommand)(e,n.editorViewers.toggleWordWrap,{label:t.__("Wrap Words")},t))}(e,C.viewMenu,g),function(e,n,t){e.commands.addCommand(b.getKernel,(0,a.createSemanticCommand)(e,n.getKernel,{label:t.__("Get Kernel"),isVisible:!1},t))}(e,C.helpMenu,g),u&&function(e,n,t,a){const o=e.commands,l=[];let r;o.addCommand(b.activateById,{label:n=>{if(void 0===n.id)return a.__("Activate a widget by its `id`.");const t=n.id||"",o=(0,c.find)(e.shell.widgets("main"),(e=>e.id===t));return o&&o.title.label||""},isToggled:n=>{const t=n.id||"";return!!e.shell.currentWidget&&e.shell.currentWidget.id===t},execute:n=>e.shell.activateById(n.id||"")});let d="";o.addCommand(b.activatePreviouslyUsedTab,{label:a.__("Activate Previously Used Tab"),isEnabled:()=>!!d,execute:()=>o.execute(b.activateById,{id:d})}),t&&e.restored.then((()=>{const a=()=>{r&&!r.isDisposed&&r.dispose(),l.length=0;let t=!1;for(const n of e.shell.widgets("main"))n.id===d&&(t=!0),l.push({command:b.activateById,args:{id:n.id}});r=n.addGroup(l,1),d=t?d:""};a(),t.layoutModified.connect((()=>{a()})),t.currentChanged.connect(((e,n)=>{const t=n.oldValue;t&&(d=t.id)}))}))}(e,C.tabsMenu,u,g);const w=e=>{C.activeMenu=e,C.openActiveMenu()};return _.addCommand(b.openEdit,{label:g.__("Open Edit Menu"),execute:()=>w(C.editMenu)}),_.addCommand(b.openFile,{label:g.__("Open File Menu"),execute:()=>w(C.fileMenu)}),_.addCommand(b.openKernel,{label:g.__("Open Kernel Menu"),execute:()=>w(C.kernelMenu)}),_.addCommand(b.openRun,{label:g.__("Open Run Menu"),execute:()=>w(C.runMenu)}),_.addCommand(b.openView,{label:g.__("Open View Menu"),execute:()=>w(C.viewMenu)}),_.addCommand(b.openSettings,{label:g.__("Open Settings Menu"),execute:()=>w(C.settingsMenu)}),_.addCommand(b.openTabs,{label:g.__("Open Tabs Menu"),execute:()=>w(C.tabsMenu)}),_.addCommand(b.openHelp,{label:g.__("Open Help Menu"),execute:()=>w(C.helpMenu)}),_.addCommand(b.openFirst,{label:g.__("Open First Menu"),execute:()=>{C.activeIndex=0,C.openActiveMenu()}}),i&&(i.addItem({command:b.shutdown,category:g.__("Main Area")}),i.addItem({command:b.logout,category:g.__("Main Area")}),i.addItem({command:b.shutdownAllKernels,category:g.__("Kernel Operations")}),i.addItem({command:b.activatePreviouslyUsedTab,category:g.__("Main Area")})),e.shell.add(C,"menu",{rank:100}),C}};var h;!function(e){async function n(e){(await(0,o.showDialog)({title:e.__("Information"),body:e.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[o.Dialog.cancelButton(),o.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsMenu=async function(e,t,a,l){var r;const d=l.load("jupyterlab");let u=null,s={};function c(n){var t,a;s={};const o=Object.keys(e.plugins).map((n=>{var t,a;const o=null!==(a=null===(t=e.plugins[n].schema["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[];return s[n]=o,o})).concat([null!==(a=null===(t=n["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[]]).reduceRight(((e,n)=>i.SettingRegistry.reconcileMenus(e,n,!0)),n.properties.menus.default);n.properties.menus.default=i.SettingRegistry.reconcileMenus(o,n.properties.menus.default,!0).sort(((e,n)=>{var t,a;return(null!==(t=e.rank)&&void 0!==t?t:1/0)-(null!==(a=n.rank)&&void 0!==a?a:1/0)}))}e.transform(_,{compose:e=>{var n,t,a,o;u||(u=m.JSONExt.deepCopy(e.schema),c(u));const l=null!==(a=null===(t=null===(n=u.properties)||void 0===n?void 0:n.menus)||void 0===t?void 0:t.default)&&void 0!==a?a:[],r={...e.data.user,menus:null!==(o=e.data.user.menus)&&void 0!==o?o:[]},d={...e.data.composite,menus:i.SettingRegistry.reconcileMenus(l,r.menus)};return e.data={composite:d,user:r},e},fetch:e=>(u||(u=m.JSONExt.deepCopy(e.schema),c(u)),{data:e.data,id:e.id,raw:e.raw,schema:u,version:e.version})});const p=await e.load(_),b=null!==(r=m.JSONExt.deepCopy(p.composite.menus))&&void 0!==r?r:[],g=new Array;o.MenuFactory.createMenus(b.filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}})),a).forEach((e=>{g.push(e),t(e)})),p.changed.connect((()=>{var e;const t=null!==(e=p.composite.menus)&&void 0!==e?e:[];m.JSONExt.deepEqual(b,t)||n(d)})),e.pluginChanged.connect((async(l,r)=>{var u,c,p;if(r!==_){const l=null!==(u=s[r])&&void 0!==u?u:[],_=null!==(p=null===(c=e.plugins[r].schema["jupyter.lab.menus"])||void 0===c?void 0:c.main)&&void 0!==p?p:[];if(!m.JSONExt.deepEqual(l,_))if(s[r])await n(d);else{s[r]=m.JSONExt.deepCopy(_);const e=i.SettingRegistry.reconcileMenus(_,b,!1,!1).filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}}));o.MenuFactory.updateMenus(g,e,a).forEach((e=>{t(e)}))}}}))}}(h||(h={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5088],{45088:(e,n,t)=>{t.r(n),t.d(n,{CommandIDs:()=>b,default:()=>g});var a=t(3053),o=t(12982),l=t(38639),r=t(97104),d=t(16954),i=t(36768),u=t(71677),s=t(68239),c=t(33625),m=t(20998),p=t(31516);const _="@jupyterlab/mainmenu-extension:plugin";var b;!function(e){e.openEdit="editmenu:open",e.undo="editmenu:undo",e.redo="editmenu:redo",e.clearCurrent="editmenu:clear-current",e.clearAll="editmenu:clear-all",e.find="editmenu:find",e.goToLine="editmenu:go-to-line",e.openFile="filemenu:open",e.closeAndCleanup="filemenu:close-and-cleanup",e.createConsole="filemenu:create-console",e.shutdown="filemenu:shutdown",e.logout="filemenu:logout",e.openKernel="kernelmenu:open",e.interruptKernel="kernelmenu:interrupt",e.reconnectToKernel="kernelmenu:reconnect-to-kernel",e.restartKernel="kernelmenu:restart",e.restartKernelAndClear="kernelmenu:restart-and-clear",e.changeKernel="kernelmenu:change",e.shutdownKernel="kernelmenu:shutdown",e.shutdownAllKernels="kernelmenu:shutdownAll",e.openView="viewmenu:open",e.wordWrap="viewmenu:word-wrap",e.lineNumbering="viewmenu:line-numbering",e.matchBrackets="viewmenu:match-brackets",e.openRun="runmenu:open",e.run="runmenu:run",e.runAll="runmenu:run-all",e.restartAndRunAll="runmenu:restart-and-run-all",e.runAbove="runmenu:run-above",e.runBelow="runmenu:run-below",e.openTabs="tabsmenu:open",e.activateById="tabsmenu:activate-by-id",e.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",e.openSettings="settingsmenu:open",e.openHelp="helpmenu:open",e.getKernel="helpmenu:get-kernel",e.openFirst="mainmenu:open-first"}(b||(b={}));const g={id:_,description:"Adds and provides the application main menu.",requires:[a.IRouter,u.ITranslator],optional:[o.ICommandPalette,a.ILabShell,i.ISettingRegistry],provides:r.IMainMenu,activate:async(e,n,t,i,u,m)=>{const{commands:_}=e,g=t.load("jupyterlab"),C=new r.MainMenu(_);C.id="jp-MainMenu",C.addClass("jp-scrollbar-tiny"),m&&(await h.loadSettingsMenu(m,(e=>{C.addMenu(e,!1,{rank:e.rank})}),(e=>r.MainMenu.generateMenu(_,e,g)),t),C.update());const v=l.PageConfig.getOption("quitButton").toLowerCase();C.fileMenu.quitEntry="true"===v,function(e,n,t){const o=e.commands;o.addCommand(b.undo,(0,a.createSemanticCommand)(e,n.undoers.undo,{label:t.__("Undo")},t)),o.addCommand(b.redo,(0,a.createSemanticCommand)(e,n.undoers.redo,{label:t.__("Redo")},t)),o.addCommand(b.clearCurrent,(0,a.createSemanticCommand)(e,n.clearers.clearCurrent,{label:t.__("Clear")},t)),o.addCommand(b.clearAll,(0,a.createSemanticCommand)(e,n.clearers.clearAll,{label:t.__("Clear All")},t)),o.addCommand(b.goToLine,(0,a.createSemanticCommand)(e,n.goToLiners,{label:t.__("Go to Line…")},t))}(e,C.editMenu,g),function(e,n,t,r){const i=e.commands;i.addCommand(b.closeAndCleanup,{...(0,a.createSemanticCommand)(e,n.closeAndCleaners,{execute:"application:close",label:r.__("Close and Shut Down"),isEnabled:!0},r),isEnabled:()=>!!e.shell.currentWidget&&!!e.shell.currentWidget.title.closable}),i.addCommand(b.createConsole,(0,a.createSemanticCommand)(e,n.consoleCreators,{label:r.__("New Console for Activity")},r)),i.addCommand(b.shutdown,{label:r.__("Shut Down"),caption:r.__("Shut down JupyterLab"),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>(0,o.showDialog)({title:r.__("Shutdown confirmation"),body:r.__("Please confirm you want to shut down JupyterLab."),buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:r.__("Shut Down")})]}).then((async n=>{if(n.button.accept){const n=d.ServerConnection.makeSettings(),t=l.URLExt.join(n.baseUrl,"api/shutdown");try{await Promise.all([e.serviceManager.sessions.shutdownAll(),e.serviceManager.terminals.shutdownAll()])}catch(e){console.log(`Failed to shutdown sessions and terminals: ${e}`)}return d.ServerConnection.makeRequest(t,{method:"POST"},n).then((e=>{if(!e.ok)throw new d.ServerConnection.ResponseError(e);{const e=document.createElement("div"),n=document.createElement("p");n.textContent=r.__("You have shut down the Jupyter server. You can now close this tab.");const t=document.createElement("p");t.textContent=r.__("To use JupyterLab again, you will need to relaunch it."),e.appendChild(n),e.appendChild(t),(0,o.showDialog)({title:r.__("Server stopped"),body:new p.Widget({node:e}),buttons:[]}),window.close()}})).catch((e=>{throw new d.ServerConnection.NetworkError(e)}))}}))}),i.addCommand(b.logout,{label:r.__("Log Out"),caption:r.__("Log out of JupyterLab"),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>{t.navigate("/logout",{hard:!0})}})}(e,C.fileMenu,n,g),function(e,n,t){const l=e.commands;l.addCommand(b.interruptKernel,{...(0,a.createSemanticCommand)(e,n.kernelUsers.interruptKernel,{label:t.__("Interrupt Kernel"),caption:t.__("Interrupt the kernel")},t),icon:e=>e.toolbar?s.stopIcon:void 0}),l.addCommand(b.reconnectToKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.reconnectToKernel,{label:t.__("Reconnect to Kernel")},t)),l.addCommand(b.restartKernel,{...(0,a.createSemanticCommand)(e,n.kernelUsers.restartKernel,{label:t.__("Restart Kernel…"),caption:t.__("Restart the kernel")},t),icon:e=>e.toolbar?s.refreshIcon:void 0}),l.addCommand(b.restartKernelAndClear,(0,a.createSemanticCommand)(e,[n.kernelUsers.restartKernel,n.kernelUsers.clearWidget],{label:t.__("Restart Kernel and Clear…")},t)),l.addCommand(b.changeKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.changeKernel,{label:t.__("Change Kernel…")},t)),l.addCommand(b.shutdownKernel,(0,a.createSemanticCommand)(e,n.kernelUsers.shutdownKernel,{label:t.__("Shut Down Kernel"),caption:t.__("Shut down kernel")},t)),l.addCommand(b.shutdownAllKernels,{label:t.__("Shut Down All Kernels…"),isEnabled:()=>!e.serviceManager.sessions.running().next().done,execute:()=>(0,o.showDialog)({title:t.__("Shut Down All?"),body:t.__("Shut down all kernels?"),buttons:[o.Dialog.cancelButton({label:t.__("Dismiss")}),o.Dialog.warnButton({label:t.__("Shut Down All")})]}).then((n=>{if(n.button.accept)return e.serviceManager.sessions.shutdownAll()}))})}(e,C.kernelMenu,g),function(e,n,t){const o=e.commands;o.addCommand(b.run,{...(0,a.createSemanticCommand)(e,n.codeRunners.run,{label:t.__("Run Selected"),caption:t.__("Run Selected")},t),icon:e=>e.toolbar?s.runIcon:void 0}),o.addCommand(b.runAll,(0,a.createSemanticCommand)(e,n.codeRunners.runAll,{label:t.__("Run All"),caption:t.__("Run All")},t)),o.addCommand(b.restartAndRunAll,{...(0,a.createSemanticCommand)(e,[n.codeRunners.restart,n.codeRunners.runAll],{label:t.__("Restart Kernel and Run All"),caption:t.__("Restart Kernel and Run All")},t),icon:e=>e.toolbar?s.fastForwardIcon:void 0})}(e,C.runMenu,g),function(e,n,t){const o=e.commands;o.addCommand(b.lineNumbering,(0,a.createSemanticCommand)(e,n.editorViewers.toggleLineNumbers,{label:t.__("Show Line Numbers")},t)),o.addCommand(b.matchBrackets,(0,a.createSemanticCommand)(e,n.editorViewers.toggleMatchBrackets,{label:t.__("Match Brackets")},t)),o.addCommand(b.wordWrap,(0,a.createSemanticCommand)(e,n.editorViewers.toggleWordWrap,{label:t.__("Wrap Words")},t))}(e,C.viewMenu,g),function(e,n,t){e.commands.addCommand(b.getKernel,(0,a.createSemanticCommand)(e,n.getKernel,{label:t.__("Get Kernel"),isVisible:!1},t))}(e,C.helpMenu,g),u&&function(e,n,t,a){const o=e.commands,l=[];let r;o.addCommand(b.activateById,{label:n=>{if(void 0===n.id)return a.__("Activate a widget by its `id`.");const t=n.id||"",o=(0,c.find)(e.shell.widgets("main"),(e=>e.id===t));return o&&o.title.label||""},isToggled:n=>{const t=n.id||"";return!!e.shell.currentWidget&&e.shell.currentWidget.id===t},execute:n=>e.shell.activateById(n.id||"")});let d="";o.addCommand(b.activatePreviouslyUsedTab,{label:a.__("Activate Previously Used Tab"),isEnabled:()=>!!d,execute:()=>o.execute(b.activateById,{id:d})}),t&&e.restored.then((()=>{const a=()=>{r&&!r.isDisposed&&r.dispose(),l.length=0;let t=!1;for(const n of e.shell.widgets("main"))n.id===d&&(t=!0),l.push({command:b.activateById,args:{id:n.id}});r=n.addGroup(l,1),d=t?d:""};a(),t.layoutModified.connect((()=>{a()})),t.currentChanged.connect(((e,n)=>{const t=n.oldValue;t&&(d=t.id)}))}))}(e,C.tabsMenu,u,g);const w=e=>{C.activeMenu=e,C.openActiveMenu()};return _.addCommand(b.openEdit,{label:g.__("Open Edit Menu"),execute:()=>w(C.editMenu)}),_.addCommand(b.openFile,{label:g.__("Open File Menu"),execute:()=>w(C.fileMenu)}),_.addCommand(b.openKernel,{label:g.__("Open Kernel Menu"),execute:()=>w(C.kernelMenu)}),_.addCommand(b.openRun,{label:g.__("Open Run Menu"),execute:()=>w(C.runMenu)}),_.addCommand(b.openView,{label:g.__("Open View Menu"),execute:()=>w(C.viewMenu)}),_.addCommand(b.openSettings,{label:g.__("Open Settings Menu"),execute:()=>w(C.settingsMenu)}),_.addCommand(b.openTabs,{label:g.__("Open Tabs Menu"),execute:()=>w(C.tabsMenu)}),_.addCommand(b.openHelp,{label:g.__("Open Help Menu"),execute:()=>w(C.helpMenu)}),_.addCommand(b.openFirst,{label:g.__("Open First Menu"),execute:()=>{C.activeIndex=0,C.openActiveMenu()}}),i&&(i.addItem({command:b.shutdown,category:g.__("Main Area")}),i.addItem({command:b.logout,category:g.__("Main Area")}),i.addItem({command:b.shutdownAllKernels,category:g.__("Kernel Operations")}),i.addItem({command:b.activatePreviouslyUsedTab,category:g.__("Main Area")})),e.shell.add(C,"menu",{rank:100}),C}};var h;!function(e){async function n(e){(await(0,o.showDialog)({title:e.__("Information"),body:e.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[o.Dialog.cancelButton(),o.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsMenu=async function(e,t,a,l){var r;const d=l.load("jupyterlab");let u=null,s={};function c(n){var t,a;s={};const o=Object.keys(e.plugins).map((n=>{var t,a;const o=null!==(a=null===(t=e.plugins[n].schema["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[];return s[n]=o,o})).concat([null!==(a=null===(t=n["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[]]).reduceRight(((e,n)=>i.SettingRegistry.reconcileMenus(e,n,!0)),n.properties.menus.default);n.properties.menus.default=i.SettingRegistry.reconcileMenus(o,n.properties.menus.default,!0).sort(((e,n)=>{var t,a;return(null!==(t=e.rank)&&void 0!==t?t:1/0)-(null!==(a=n.rank)&&void 0!==a?a:1/0)}))}e.transform(_,{compose:e=>{var n,t,a,o;u||(u=m.JSONExt.deepCopy(e.schema),c(u));const l=null!==(a=null===(t=null===(n=u.properties)||void 0===n?void 0:n.menus)||void 0===t?void 0:t.default)&&void 0!==a?a:[],r={...e.data.user,menus:null!==(o=e.data.user.menus)&&void 0!==o?o:[]},d={...e.data.composite,menus:i.SettingRegistry.reconcileMenus(l,r.menus)};return e.data={composite:d,user:r},e},fetch:e=>(u||(u=m.JSONExt.deepCopy(e.schema),c(u)),{data:e.data,id:e.id,raw:e.raw,schema:u,version:e.version})});const p=await e.load(_),b=null!==(r=m.JSONExt.deepCopy(p.composite.menus))&&void 0!==r?r:[],g=new Array;o.MenuFactory.createMenus(b.filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}})),a).forEach((e=>{g.push(e),t(e)})),p.changed.connect((()=>{var e;const t=null!==(e=p.composite.menus)&&void 0!==e?e:[];m.JSONExt.deepEqual(b,t)||n(d)})),e.pluginChanged.connect((async(l,r)=>{var u,c,p;if(r!==_){const l=null!==(u=s[r])&&void 0!==u?u:[],_=null!==(p=null===(c=e.plugins[r].schema["jupyter.lab.menus"])||void 0===c?void 0:c.main)&&void 0!==p?p:[];if(!m.JSONExt.deepEqual(l,_))if(s[r])await n(d);else{s[r]=m.JSONExt.deepCopy(_);const e=i.SettingRegistry.reconcileMenus(_,b,!1,!1).filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}}));o.MenuFactory.updateMenus(g,e,a).forEach((e=>{t(e)}))}}}))}}(h||(h={}))}}]);