notebook 7.2.0rc1__py3-none-any.whl → 7.2.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 (171) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/{6078.bundle.js → 1053.bundle.js} +1 -1
  3. notebook/static/113.bundle.js +1 -1
  4. notebook/static/1198.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/1684.bundle.js +1 -1
  11. notebook/static/1809.bundle.js +1 -1
  12. notebook/static/1827.bundle.js +1 -1
  13. notebook/static/1833.bundle.js +1 -1
  14. notebook/static/1846.bundle.js +1 -1
  15. notebook/static/1958.bundle.js +1 -1
  16. notebook/static/1962.bundle.js +1 -1
  17. notebook/static/2007.bundle.js +1 -1
  18. notebook/static/2088.bundle.js +1 -1
  19. notebook/static/2089.bundle.js +1 -1
  20. notebook/static/2122.bundle.js +1 -1
  21. notebook/static/2167.bundle.js +1 -1
  22. notebook/static/2184.bundle.js +1 -1
  23. notebook/static/2311.bundle.js +1 -1
  24. notebook/static/2401.bundle.js +1 -1
  25. notebook/static/2479.bundle.js +1 -1
  26. notebook/static/2489.bundle.js +1 -1
  27. notebook/static/2607.bundle.js +1 -1
  28. notebook/static/2615.bundle.js +1 -1
  29. notebook/static/2636.bundle.js +1 -1
  30. notebook/static/2924.bundle.js +1 -1
  31. notebook/static/2944.bundle.js +1 -1
  32. notebook/static/3129.bundle.js +1 -1
  33. notebook/static/3146.bundle.js +1 -1
  34. notebook/static/3187.bundle.js +1 -1
  35. notebook/static/3213.bundle.js +1 -1
  36. notebook/static/3340.bundle.js +1 -1
  37. notebook/static/3360.bundle.js +1 -1
  38. notebook/static/3466.bundle.js +1 -1
  39. notebook/static/3512.bundle.js +1 -1
  40. notebook/static/3676.bundle.js +1 -1
  41. notebook/static/3680.bundle.js +1 -1
  42. notebook/static/374.bundle.js +1 -1
  43. notebook/static/3768.bundle.js +1 -1
  44. notebook/static/377.bundle.js +1 -1
  45. notebook/static/3863.bundle.js +1 -1
  46. notebook/static/3881.bundle.js +1 -1
  47. notebook/static/4042.bundle.js +1 -1
  48. notebook/static/4212.bundle.js +1 -1
  49. notebook/static/4382.bundle.js +1 -1
  50. notebook/static/4630.bundle.js +1 -1
  51. notebook/static/4645.bundle.js +1 -1
  52. notebook/static/4811.bundle.js +1 -1
  53. notebook/static/4837.bundle.js +1 -1
  54. notebook/static/5099.bundle.js +1 -1
  55. notebook/static/5135.bundle.js +1 -1
  56. notebook/static/5254.bundle.js +1 -1
  57. notebook/static/5263.bundle.js +1 -1
  58. notebook/static/5313.bundle.js +1 -1
  59. notebook/static/5325.bundle.js +1 -1
  60. notebook/static/5346.bundle.js +1 -1
  61. notebook/static/5425.bundle.js +1 -1
  62. notebook/static/5426.bundle.js +1 -1
  63. notebook/static/545.bundle.js +1 -1
  64. notebook/static/5573.bundle.js +1 -1
  65. notebook/static/5601.bundle.js +1 -1
  66. notebook/static/5733.bundle.js +1 -1
  67. notebook/static/5912.bundle.js +1 -1
  68. notebook/static/5921.bundle.js +1 -1
  69. notebook/static/6017.bundle.js +1 -1
  70. notebook/static/6139.bundle.js +1 -1
  71. notebook/static/62.bundle.js +1 -1
  72. notebook/static/6281.bundle.js +1 -1
  73. notebook/static/6345.bundle.js +1 -1
  74. notebook/static/{2756.bundle.js → 6593.bundle.js} +1 -1
  75. notebook/static/6604.bundle.js +1 -1
  76. notebook/static/6621.bundle.js +1 -1
  77. notebook/static/6627.bundle.js +1 -1
  78. notebook/static/6748.bundle.js +1 -1
  79. notebook/static/6815.bundle.js +1 -1
  80. notebook/static/6853.bundle.js +1 -1
  81. notebook/static/6893.bundle.js +1 -1
  82. notebook/static/690.bundle.js +1 -1
  83. notebook/static/6962.bundle.js +1 -1
  84. notebook/static/6999.bundle.js +1 -1
  85. notebook/static/7226.bundle.js +1 -1
  86. notebook/static/7252.bundle.js +1 -1
  87. notebook/static/7259.bundle.js +1 -1
  88. notebook/static/7302.bundle.js +1 -1
  89. notebook/static/7386.bundle.js +1 -1
  90. notebook/static/7391.bundle.js +1 -1
  91. notebook/static/7506.bundle.js +2 -2
  92. notebook/static/7543.bundle.js +1 -1
  93. notebook/static/755.bundle.js +1 -1
  94. notebook/static/7603.bundle.js +1 -1
  95. notebook/static/7639.bundle.js +1 -1
  96. notebook/static/7655.bundle.js +1 -1
  97. notebook/static/7684.bundle.js +1 -1
  98. notebook/static/7812.bundle.js +1 -1
  99. notebook/static/7819.bundle.js +1 -1
  100. notebook/static/7854.bundle.js +1 -1
  101. notebook/static/7900.bundle.js +1 -1
  102. notebook/static/7906.bundle.js +1 -1
  103. notebook/static/8471.bundle.js +1 -1
  104. notebook/static/8579.bundle.js +1 -1
  105. notebook/static/8633.bundle.js +1 -1
  106. notebook/static/8771.bundle.js +1 -1
  107. notebook/static/8781.bundle.js +1 -1
  108. notebook/static/8845.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/893.bundle.js +1 -1
  113. notebook/static/901.bundle.js +1 -1
  114. notebook/static/9068.bundle.js +1 -1
  115. notebook/static/9136.bundle.js +1 -1
  116. notebook/static/9151.bundle.js +1 -1
  117. notebook/static/9161.bundle.js +1 -1
  118. notebook/static/9268.bundle.js +1 -1
  119. notebook/static/9335.bundle.js +1 -1
  120. notebook/static/9341.bundle.js +1 -1
  121. notebook/static/9380.bundle.js +1 -1
  122. notebook/static/9605.bundle.js +1 -1
  123. notebook/static/9638.bundle.js +1 -1
  124. notebook/static/9680.bundle.js +1 -1
  125. notebook/static/9685.bundle.js +1 -1
  126. notebook/static/9752.bundle.js +1 -1
  127. notebook/static/9821.bundle.js +1 -1
  128. notebook/static/9852.bundle.js +1 -1
  129. notebook/static/bundle.js +1 -1
  130. notebook/static/third-party-licenses.json +101 -101
  131. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  132. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  133. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  134. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  135. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  136. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  137. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  138. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/42.33f638f0a4239bed9676.js +1 -0
  139. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.3dd58d88e32a98358776.js +1 -0
  140. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.bf5955f09ff1e05edfbb.js +1 -0
  141. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.04dfa589925e7e7c6a3d.js +1 -0
  142. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  143. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/METADATA +1 -1
  144. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/RECORD +167 -167
  145. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/WHEEL +1 -1
  146. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/302.8a8d0af0376cb309e580.js +0 -1
  147. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1176453d31b84477bbd4.js +0 -1
  148. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.76f40c4b4ee1c8583ca3.js +0 -1
  149. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.a5e570ba118d1d45c877.js +0 -1
  150. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  151. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  152. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  153. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  154. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  155. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  156. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  157. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  158. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  159. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  160. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  161. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  162. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  163. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  164. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  165. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  166. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  167. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  168. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  169. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  170. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/entry_points.txt +0 -0
  171. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>C,IRunningSessionSidebar:()=>y,RunningSessionManagers:()=>I,RunningSessions:()=>L,SearchableSessions:()=>D,SearchableSessionsList:()=>B});var n=s(53312),i=s(12030),a=s(35613),o=s(20998),l=s(2549),r=s(18395),d=s(81997),h=s(63485),c=s(78156),u=s.n(c);const g="jp-RunningSessions",p="jp-RunningSessions-sectionList",_="jp-RunningSessions-item",m="jp-RunningSessions-itemLabel",w="jp-RunningSessions-itemDetail",b="jp-RunningSessions-itemShutdown",f="jp-RunningSessions-caret",S="jp-RunningSessions-icon",v="jp-running-sessions",C=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),y=new o.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class I{constructor(){this._added=new d.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function T(t){var e,s;const{runningItem:n}=t,o=[_],l=null===(e=n.detail)||void 0===e?void 0:e.call(n),r=n.icon(),d=n.labelTitle?n.labelTitle():"",h=t.translator||i.nullTranslator,c=h.load("jupyterlab");let g=!1;const p=t.shutdownItemIcon||a.closeIcon,v=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(n):t.shutdownLabel)&&void 0!==s?s:c.__("Shut Down"),C=n.children,[y,I]=u().useState(!1),T=!!(null==C?void 0:C.length),E=T?()=>!g&&I(!y):void 0;return t.collapseToggled.connect(((t,e)=>I(e))),n.className&&o.push(n.className),t.child&&o.push("jp-mod-running-child"),t.child&&!C&&o.push("jp-mod-running-leaf"),u().createElement(u().Fragment,null,u().createElement("li",null,u().createElement("div",{className:o.join(" "),onClick:E,"data-context":n.context||""},T&&(y?u().createElement(a.caretRightIcon.react,{tag:"span",className:f}):u().createElement(a.caretDownIcon.react,{tag:"span",className:f})),r?"string"==typeof r?u().createElement("img",{src:r,className:S}):u().createElement(r.react,{tag:"span",className:S}):void 0,u().createElement("span",{className:m,title:d,onClick:n.open&&(()=>n.open())},n.label()),l&&u().createElement("span",{className:w},l),n.shutdown&&u().createElement(a.ToolbarButtonComponent,{className:b,icon:p,onClick:()=>{var t;g=!0,null===(t=n.shutdown)||void 0===t||t.call(n)},tooltip:v})),T&&!y&&u().createElement(j,{child:!0,runningItems:C,shutdownItemIcon:p,translator:h,collapseToggled:t.collapseToggled})))}function j(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return u().createElement("ul",{className:p},s.map(((e,s)=>u().createElement(T,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends a.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new d.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return u().createElement(a.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,c.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class x extends a.ReactWidget{constructor(t){super(),this._options=t,this._update=new d.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}dispose(){d.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return u().createElement(a.UseSignal,{signal:this._update},(()=>{var s;return e?e=!1:t.runningItems=t.manager.running(),u().createElement("div",{className:"jp-RunningSessions-sectionContainer"},u().createElement(j,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled}))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class A extends a.PanelWithToolbar{constructor(t){super(),this._buttons=null,this._listView=!1,this._collapseToggled=new d.Signal(this),this._viewChanged=new d.Signal(this),this._manager=t.manager,this._filterProvider=t.filterProvider;const e=t.translator||i.nullTranslator;this._trans=e.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();let s=t.manager.running();!1!==t.showToolbar&&this._initializeToolbar(s),this.addWidget(new x({runningItems:s,collapseToggled:this._collapseToggled,...t}))}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,i=`${s}?`,o=this._manager.shutdownAllConfirmationText||`${s} ${this._manager.name}`,l=new a.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{(0,n.showDialog)({title:i,body:o,buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),r=new a.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:a.tableRowsIcon,pressedIcon:a.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),d=new a.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:a.collapseAllIcon,pressedIcon:a.expandAllIcon,onClick:()=>{const t=!d.pressed;this._collapseToggled.emit(t),d.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":r,"collapse-expand":d,"shutdown-all":l},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this);for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running().filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running();const e=t.length>0,s=0!==t.filter((t=>t.children)).length,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"block":"none",this._buttons["collapse-expand"].node.style.display=n?"block":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class L extends a.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:i.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(g),this.toolbar.addItem("refresh",new a.ToolbarButton({tooltip:n.__("Refresh List"),icon:a.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new A({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(v,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(v))&&void 0!==t?t:{}}}class R extends A{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends h.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class D extends h.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:i.nullTranslator,this.addClass(g),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new B(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+m)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+_)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),r.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class B extends h.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:i.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>C,IRunningSessionSidebar:()=>y,RunningSessionManagers:()=>I,RunningSessions:()=>L,SearchableSessions:()=>D,SearchableSessionsList:()=>B});var n=s(20005),i=s(90646),a=s(14576),o=s(20998),l=s(2549),r=s(18395),d=s(81997),h=s(63485),c=s(78156),u=s.n(c);const g="jp-RunningSessions",p="jp-RunningSessions-sectionList",_="jp-RunningSessions-item",m="jp-RunningSessions-itemLabel",w="jp-RunningSessions-itemDetail",b="jp-RunningSessions-itemShutdown",f="jp-RunningSessions-caret",S="jp-RunningSessions-icon",v="jp-running-sessions",C=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),y=new o.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class I{constructor(){this._added=new d.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function T(t){var e,s;const{runningItem:n}=t,o=[_],l=null===(e=n.detail)||void 0===e?void 0:e.call(n),r=n.icon(),d=n.labelTitle?n.labelTitle():"",h=t.translator||i.nullTranslator,c=h.load("jupyterlab");let g=!1;const p=t.shutdownItemIcon||a.closeIcon,v=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(n):t.shutdownLabel)&&void 0!==s?s:c.__("Shut Down"),C=n.children,[y,I]=u().useState(!1),T=!!(null==C?void 0:C.length),E=T?()=>!g&&I(!y):void 0;return t.collapseToggled.connect(((t,e)=>I(e))),n.className&&o.push(n.className),t.child&&o.push("jp-mod-running-child"),t.child&&!C&&o.push("jp-mod-running-leaf"),u().createElement(u().Fragment,null,u().createElement("li",null,u().createElement("div",{className:o.join(" "),onClick:E,"data-context":n.context||""},T&&(y?u().createElement(a.caretRightIcon.react,{tag:"span",className:f}):u().createElement(a.caretDownIcon.react,{tag:"span",className:f})),r?"string"==typeof r?u().createElement("img",{src:r,className:S}):u().createElement(r.react,{tag:"span",className:S}):void 0,u().createElement("span",{className:m,title:d,onClick:n.open&&(()=>n.open())},n.label()),l&&u().createElement("span",{className:w},l),n.shutdown&&u().createElement(a.ToolbarButtonComponent,{className:b,icon:p,onClick:()=>{var t;g=!0,null===(t=n.shutdown)||void 0===t||t.call(n)},tooltip:v})),T&&!y&&u().createElement(j,{child:!0,runningItems:C,shutdownItemIcon:p,translator:h,collapseToggled:t.collapseToggled})))}function j(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return u().createElement("ul",{className:p},s.map(((e,s)=>u().createElement(T,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends a.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new d.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return u().createElement(a.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,c.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class x extends a.ReactWidget{constructor(t){super(),this._options=t,this._update=new d.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}dispose(){d.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return u().createElement(a.UseSignal,{signal:this._update},(()=>{var s;return e?e=!1:t.runningItems=t.manager.running(),u().createElement("div",{className:"jp-RunningSessions-sectionContainer"},u().createElement(j,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled}))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class A extends a.PanelWithToolbar{constructor(t){super(),this._buttons=null,this._listView=!1,this._collapseToggled=new d.Signal(this),this._viewChanged=new d.Signal(this),this._manager=t.manager,this._filterProvider=t.filterProvider;const e=t.translator||i.nullTranslator;this._trans=e.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();let s=t.manager.running();!1!==t.showToolbar&&this._initializeToolbar(s),this.addWidget(new x({runningItems:s,collapseToggled:this._collapseToggled,...t}))}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,i=`${s}?`,o=this._manager.shutdownAllConfirmationText||`${s} ${this._manager.name}`,l=new a.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{(0,n.showDialog)({title:i,body:o,buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),r=new a.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:a.tableRowsIcon,pressedIcon:a.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),d=new a.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:a.collapseAllIcon,pressedIcon:a.expandAllIcon,onClick:()=>{const t=!d.pressed;this._collapseToggled.emit(t),d.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":r,"collapse-expand":d,"shutdown-all":l},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this);for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running().filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running();const e=t.length>0,s=0!==t.filter((t=>t.children)).length,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"block":"none",this._buttons["collapse-expand"].node.style.display=n?"block":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class L extends a.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:i.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(g),this.toolbar.addItem("refresh",new a.ToolbarButton({tooltip:n.__("Refresh List"),icon:a.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new A({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(v,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(v))&&void 0!==t?t:{}}}class R extends A{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends h.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class D extends h.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:i.nullTranslator,this.addClass(g),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new B(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+m)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+_)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),r.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class B extends h.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:i.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(44604),i=n(53312),o=n(21058),a=n(40930),s=n(95183),d=n(29879),l=n(23295),c=n(12030);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(12030),o=n(35613),a=n(63485);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(68722),o=n(65903),a=n(20998),s=n(81997),d=n(63485),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9072).then(n.t.bind(n,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9072)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(2756),i=n(20005),o=n(21058),a=n(40930),s=n(11523),d=n(98979),l=n(3339),c=n(90646);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(90646),o=n(14576),a=n(63485);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(64145),o=n(87973),a=n(20998),s=n(81997),d=n(63485),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9072).then(n.t.bind(n,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9072)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(51429),o=i(61907),s=i(20998);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(53312),d=i(30525),l=i(65903),c=i(35613),h=i(63485);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(71098),v=i(12030),_=i(78156),f=i.n(_);function C(e){return f().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?f().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||v.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return f().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||v.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return f().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(79426);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(68481),o=i(23184),s=i(20998);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(20005),d=i(75536),l=i(87973),c=i(14576),h=i(63485);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(47652),f=i(90646),v=i(78156),_=i.n(v);function C(e){return _().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:f.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?_().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||f.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return _().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||f.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return _().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(27333);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |async def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |async def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1846],{72647:(e,t,l)=>{l.d(t,{diagram:()=>f});var n=l(17010),a=l(23617),o=l(67406),i=l(24028),s=l(86281);l(27693),l(7608),l(31699),l(7259),l(81779);const d=e=>i.e.sanitizeText(e,(0,i.c)());let r={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const c=function(e,t,l,n,a){const o=Object.keys(e);i.l.info("keys:",o),i.l.info(e),o.filter((t=>e[t].parent==a)).forEach((function(l){var o,s;const r=e[l],c=r.cssClasses.join(" "),p=(0,i.k)(r.styles),b=r.label??r.id,f={labelStyle:p.labelStyle,shape:"class_box",labelText:d(b),classData:r,rx:0,ry:0,class:c,style:p.style,id:r.id,domId:r.domId,tooltip:n.db.getTooltip(r.id,a)||"",haveCallback:r.haveCallback,link:r.link,width:"group"===r.type?500:void 0,type:r.type,padding:(null==(o=(0,i.c)().flowchart)?void 0:o.padding)??(null==(s=(0,i.c)().class)?void 0:s.padding)};t.setNode(r.id,f),a&&t.setParent(r.id,a),i.l.info("setNode",f)}))};function p(e){let t;switch(e){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const b={setConf:function(e){r={...r,...e}},draw:async function(e,t,l,n){i.l.info("Drawing class - ",t);const b=(0,i.c)().flowchart??(0,i.c)().class,f=(0,i.c)().securityLevel;i.l.info("config:",b);const y=(null==b?void 0:b.nodeSpacing)??50,u=(null==b?void 0:b.rankSpacing)??50,g=new o.k({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:y,ranksep:u,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),h=n.db.getNamespaces(),v=n.db.getClasses(),w=n.db.getRelations(),k=n.db.getNotes();let T;i.l.info(w),function(e,t,l,n){const a=Object.keys(e);i.l.info("keys:",a),i.l.info(e),a.forEach((function(l){var a,o;const s=e[l],r={shape:"rect",id:s.id,domId:s.domId,labelText:d(s.id),labelStyle:"",style:"fill: none; stroke: black",padding:(null==(a=(0,i.c)().flowchart)?void 0:a.padding)??(null==(o=(0,i.c)().class)?void 0:o.padding)};t.setNode(s.id,r),c(s.classes,t,0,n,s.id),i.l.info("setNode",r)}))}(h,g,0,n),c(v,g,0,n),function(e,t){const l=(0,i.c)().flowchart;let n=0;e.forEach((function(e){var o;n++;const s={classes:"relation",pattern:1==e.relation.lineType?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${n}`,arrowhead:"arrow_open"===e.type?"none":"normal",startLabelRight:"none"===e.relationTitle1?"":e.relationTitle1,endLabelLeft:"none"===e.relationTitle2?"":e.relationTitle2,arrowTypeStart:p(e.relation.type1),arrowTypeEnd:p(e.relation.type2),style:"fill:none",labelStyle:"",curve:(0,i.n)(null==l?void 0:l.curve,a.c_6)};if(i.l.info(s,e),void 0!==e.style){const t=(0,i.k)(e.style);s.style=t.style,s.labelStyle=t.labelStyle}e.text=e.title,void 0===e.text?void 0!==e.style&&(s.arrowheadStyle="fill: #333"):(s.arrowheadStyle="fill: #333",s.labelpos="c",(null==(o=(0,i.c)().flowchart)?void 0:o.htmlLabels)??(0,i.c)().htmlLabels?(s.labelType="html",s.label='<span class="edgeLabel">'+e.text+"</span>"):(s.labelType="text",s.label=e.text.replace(i.e.lineBreakRegex,"\n"),void 0===e.style&&(s.style=s.style||"stroke: #333; stroke-width: 1.5px;fill:none"),s.labelStyle=s.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,s,n)}))}(w,g),function(e,t,l,n){i.l.info(e),e.forEach((function(e,o){var s,c;const p=e,b=p.text,f={labelStyle:"",shape:"note",labelText:d(b),noteData:p,rx:0,ry:0,class:"",style:"",id:p.id,domId:p.id,tooltip:"",type:"note",padding:(null==(s=(0,i.c)().flowchart)?void 0:s.padding)??(null==(c=(0,i.c)().class)?void 0:c.padding)};if(t.setNode(p.id,f),i.l.info("setNode",f),!p.class||!(p.class in n))return;const y=l+o,u={id:`edgeNote${y}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:(0,i.n)(r.curve,a.c_6)};t.setEdge(p.id,p.class,u,y)}))}(k,g,w.length+1,v),"sandbox"===f&&(T=(0,a.Ys)("#i"+t));const x="sandbox"===f?(0,a.Ys)(T.nodes()[0].contentDocument.body):(0,a.Ys)("body"),m=x.select(`[id="${t}"]`),S=x.select("#"+t+" g");if(await(0,s.r)(S,g,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),i.u.insertTitle(m,"classTitleText",(null==b?void 0:b.titleTopMargin)??5,n.db.getDiagramTitle()),(0,i.o)(g,m,null==b?void 0:b.diagramPadding,null==b?void 0:b.useMaxWidth),!(null==b?void 0:b.htmlLabels)){const e="sandbox"===f?T.nodes()[0].contentDocument:document,l=e.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of l){const l=t.getBBox(),n=e.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",l.width),n.setAttribute("height",l.height),t.insertBefore(n,t.firstChild)}}}},f={parser:n.p,db:n.d,renderer:b,styles:n.s,init:e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute,n.d.clear()}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1846],{11846:(e,t,l)=>{l.d(t,{diagram:()=>f});var n=l(17010),a=l(23617),o=l(67406),i=l(24028),s=l(86281);l(27693),l(7608),l(31699),l(7259),l(81779);const d=e=>i.e.sanitizeText(e,(0,i.c)());let r={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const c=function(e,t,l,n,a){const o=Object.keys(e);i.l.info("keys:",o),i.l.info(e),o.filter((t=>e[t].parent==a)).forEach((function(l){var o,s;const r=e[l],c=r.cssClasses.join(" "),p=(0,i.k)(r.styles),b=r.label??r.id,f={labelStyle:p.labelStyle,shape:"class_box",labelText:d(b),classData:r,rx:0,ry:0,class:c,style:p.style,id:r.id,domId:r.domId,tooltip:n.db.getTooltip(r.id,a)||"",haveCallback:r.haveCallback,link:r.link,width:"group"===r.type?500:void 0,type:r.type,padding:(null==(o=(0,i.c)().flowchart)?void 0:o.padding)??(null==(s=(0,i.c)().class)?void 0:s.padding)};t.setNode(r.id,f),a&&t.setParent(r.id,a),i.l.info("setNode",f)}))};function p(e){let t;switch(e){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const b={setConf:function(e){r={...r,...e}},draw:async function(e,t,l,n){i.l.info("Drawing class - ",t);const b=(0,i.c)().flowchart??(0,i.c)().class,f=(0,i.c)().securityLevel;i.l.info("config:",b);const y=(null==b?void 0:b.nodeSpacing)??50,u=(null==b?void 0:b.rankSpacing)??50,g=new o.k({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:y,ranksep:u,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),h=n.db.getNamespaces(),v=n.db.getClasses(),w=n.db.getRelations(),k=n.db.getNotes();let T;i.l.info(w),function(e,t,l,n){const a=Object.keys(e);i.l.info("keys:",a),i.l.info(e),a.forEach((function(l){var a,o;const s=e[l],r={shape:"rect",id:s.id,domId:s.domId,labelText:d(s.id),labelStyle:"",style:"fill: none; stroke: black",padding:(null==(a=(0,i.c)().flowchart)?void 0:a.padding)??(null==(o=(0,i.c)().class)?void 0:o.padding)};t.setNode(s.id,r),c(s.classes,t,0,n,s.id),i.l.info("setNode",r)}))}(h,g,0,n),c(v,g,0,n),function(e,t){const l=(0,i.c)().flowchart;let n=0;e.forEach((function(e){var o;n++;const s={classes:"relation",pattern:1==e.relation.lineType?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${n}`,arrowhead:"arrow_open"===e.type?"none":"normal",startLabelRight:"none"===e.relationTitle1?"":e.relationTitle1,endLabelLeft:"none"===e.relationTitle2?"":e.relationTitle2,arrowTypeStart:p(e.relation.type1),arrowTypeEnd:p(e.relation.type2),style:"fill:none",labelStyle:"",curve:(0,i.n)(null==l?void 0:l.curve,a.c_6)};if(i.l.info(s,e),void 0!==e.style){const t=(0,i.k)(e.style);s.style=t.style,s.labelStyle=t.labelStyle}e.text=e.title,void 0===e.text?void 0!==e.style&&(s.arrowheadStyle="fill: #333"):(s.arrowheadStyle="fill: #333",s.labelpos="c",(null==(o=(0,i.c)().flowchart)?void 0:o.htmlLabels)??(0,i.c)().htmlLabels?(s.labelType="html",s.label='<span class="edgeLabel">'+e.text+"</span>"):(s.labelType="text",s.label=e.text.replace(i.e.lineBreakRegex,"\n"),void 0===e.style&&(s.style=s.style||"stroke: #333; stroke-width: 1.5px;fill:none"),s.labelStyle=s.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,s,n)}))}(w,g),function(e,t,l,n){i.l.info(e),e.forEach((function(e,o){var s,c;const p=e,b=p.text,f={labelStyle:"",shape:"note",labelText:d(b),noteData:p,rx:0,ry:0,class:"",style:"",id:p.id,domId:p.id,tooltip:"",type:"note",padding:(null==(s=(0,i.c)().flowchart)?void 0:s.padding)??(null==(c=(0,i.c)().class)?void 0:c.padding)};if(t.setNode(p.id,f),i.l.info("setNode",f),!p.class||!(p.class in n))return;const y=l+o,u={id:`edgeNote${y}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:(0,i.n)(r.curve,a.c_6)};t.setEdge(p.id,p.class,u,y)}))}(k,g,w.length+1,v),"sandbox"===f&&(T=(0,a.Ys)("#i"+t));const x="sandbox"===f?(0,a.Ys)(T.nodes()[0].contentDocument.body):(0,a.Ys)("body"),m=x.select(`[id="${t}"]`),S=x.select("#"+t+" g");if(await(0,s.r)(S,g,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),i.u.insertTitle(m,"classTitleText",(null==b?void 0:b.titleTopMargin)??5,n.db.getDiagramTitle()),(0,i.o)(g,m,null==b?void 0:b.diagramPadding,null==b?void 0:b.useMaxWidth),!(null==b?void 0:b.htmlLabels)){const e="sandbox"===f?T.nodes()[0].contentDocument:document,l=e.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of l){const l=t.getBBox(),n=e.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",l.width),n.setAttribute("height",l.height),t.insertBefore(n,t.firstChild)}}}},f={parser:n.p,db:n.d,renderer:b,styles:n.s,init:e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute,n.d.clear()}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(59072),s=a(81997),n=a(63485),l=a(12030),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(59072),s=a(81997),n=a(63485),l=a(90646),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1962],{51962:(e,t,o)=>{o.r(t),o.d(t,{commandEditItem:()=>G,default:()=>me,executionIndicator:()=>X,exportPlugin:()=>Q,notebookTrustItem:()=>Z});var n=o(44604),l=o(53312),a=o(73166),r=o(51429),d=o(68722),i=o(30525),s=o(81002),c=o(5094),u=o(97708),b=o(95183),m=o(71427),p=o(86810),g=o(61907),C=o(29879),k=o(12077),v=o(25460),h=o(77872),f=o(81221),w=o(23295),x=o(41053),_=o(71098),A=o(79426),y=o(12030),S=o(35613),E=o(33625),N=o(20998),I=o(2549),M=o(49503),T=o(63485);const R={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:v.INotebookCellExecutor,activate:()=>Object.freeze({runCell:v.runCell})};var O=o(44182),B=o(87408);const P={activate:function(e,t,o){function n(e){function t(t,n,l){if(B.KernelMessage.isDisplayDataMsg(t)||B.KernelMessage.isStreamMsg(t)||B.KernelMessage.isErrorMsg(t)||B.KernelMessage.isExecuteResultMsg(t)){const a=o.getLogger(e.context.path);a.rendermime=e.content.rendermime;const r={...t.content,output_type:t.header.msg_type};let d=n;(B.KernelMessage.isErrorMsg(t)||B.KernelMessage.isStreamMsg(t)&&"stderr"===t.content.name)&&(d=l),a.log({type:"output",data:r,level:d})}}e.context.sessionContext.iopubMessage.connect(((e,o)=>t(o,"info","info"))),e.context.sessionContext.unhandledMessage.connect(((e,o)=>t(o,"warning","error")))}o&&(t.forEach((e=>n(e))),t.widgetAdded.connect(((e,t)=>n(t))))},id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[v.INotebookTracker],optional:[O.ILoggerRegistry],autoStart:!0};var H=o(78156),j=o.n(H),L=o(97934);class D extends v.NotebookTools.Tool{constructor(e){super();const{languages:t}=e;this._tracker=e.tracker,this.addClass("jp-ActiveCellTool"),this.layout=new T.PanelLayout,this._inputPrompt=new a.InputPrompt,this.layout.addWidget(this._inputPrompt);const o=document.createElement("div");o.classList.add("jp-ActiveCellTool-Content");const n=o.appendChild(document.createElement("div")),l=n.appendChild(document.createElement("pre"));n.className="jp-ActiveCellTool-CellContent",this._editorEl=l,this.layout.addWidget(new T.Widget({node:o})),this._refreshDebouncer=new L.Debouncer((async()=>{var e,o;this._editorEl.innerHTML="","code"===(null===(e=this._cellModel)||void 0===e?void 0:e.type)?(this._inputPrompt.executionCount=`${null!==(o=this._cellModel.executionCount)&&void 0!==o?o:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide()),this._cellModel&&await t.highlight(this._cellModel.sharedModel.getSource().split("\n")[0],t.findByMIME(this._cellModel.mimeType),this._editorEl)}),150)}render(e){var t,o;const n=this._tracker.activeCell;return n&&(this._cellModel=(null==n?void 0:n.model)||null),(null===(t=this._cellModel)||void 0===t?void 0:t.sharedModel).changed.connect(this.refresh,this),null===(o=this._cellModel)||void 0===o||o.mimeTypeChanged.connect(this.refresh,this),this.refresh().then((()=>{})).catch((()=>{})),j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)})}async refresh(){await this._refreshDebouncer.invoke()}}var W,K=o(31231);class F extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e;this.editor.source&&(null===(e=this._tracker.activeCell)||void 0===e||e.model.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t;const o=this._tracker.activeCell;return this.editor.source=o?new K.ObservableJSON({values:o.model.metadata}):null,null===(t=this.editor.source)||void 0===t||t.changed.connect(this._onSourceChanged,this),j().createElement("div",{className:"jp-CellMetadataEditor"},j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}class U extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,t;this.editor.source&&(null===(t=null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.model)||void 0===t||t.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t,o;const n=this._tracker.currentWidget;return this.editor.source=n?new K.ObservableJSON({values:null===(t=n.model)||void 0===t?void 0:t.metadata}):null,null===(o=this.editor.source)||void 0===o||o.changed.connect(this._onSourceChanged,this),j().createElement("div",{className:"jp-NotebookMetadataEditor"},j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}!function(e){e.createNew="notebook:create-new",e.interrupt="notebook:interrupt-kernel",e.restart="notebook:restart-kernel",e.restartClear="notebook:restart-clear-output",e.restartAndRunToSelected="notebook:restart-and-run-to-selected",e.restartRunAll="notebook:restart-run-all",e.reconnectToKernel="notebook:reconnect-to-kernel",e.changeKernel="notebook:change-kernel",e.getKernel="notebook:get-kernel",e.createConsole="notebook:create-console",e.createOutputView="notebook:create-output-view",e.clearAllOutputs="notebook:clear-all-cell-outputs",e.shutdown="notebook:shutdown-kernel",e.closeAndShutdown="notebook:close-and-shutdown",e.trust="notebook:trust",e.exportToFormat="notebook:export-to-format",e.run="notebook:run-cell",e.runAndAdvance="notebook:run-cell-and-select-next",e.runAndInsert="notebook:run-cell-and-insert-below",e.runInConsole="notebook:run-in-console",e.runAll="notebook:run-all-cells",e.runAllAbove="notebook:run-all-above",e.runAllBelow="notebook:run-all-below",e.renderAllMarkdown="notebook:render-all-markdown",e.toCode="notebook:change-cell-to-code",e.toMarkdown="notebook:change-cell-to-markdown",e.toRaw="notebook:change-cell-to-raw",e.cut="notebook:cut-cell",e.copy="notebook:copy-cell",e.pasteAbove="notebook:paste-cell-above",e.pasteBelow="notebook:paste-cell-below",e.duplicateBelow="notebook:duplicate-below",e.pasteAndReplace="notebook:paste-and-replace-cell",e.moveUp="notebook:move-cell-up",e.moveDown="notebook:move-cell-down",e.clearOutputs="notebook:clear-cell-output",e.deleteCell="notebook:delete-cell",e.insertAbove="notebook:insert-cell-above",e.insertBelow="notebook:insert-cell-below",e.selectAbove="notebook:move-cursor-up",e.selectBelow="notebook:move-cursor-down",e.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",e.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",e.insertHeadingAbove="notebook:insert-heading-above",e.insertHeadingBelow="notebook:insert-heading-below",e.extendAbove="notebook:extend-marked-cells-above",e.extendTop="notebook:extend-marked-cells-top",e.extendBelow="notebook:extend-marked-cells-below",e.extendBottom="notebook:extend-marked-cells-bottom",e.selectAll="notebook:select-all",e.deselectAll="notebook:deselect-all",e.editMode="notebook:enter-edit-mode",e.merge="notebook:merge-cells",e.mergeAbove="notebook:merge-cell-above",e.mergeBelow="notebook:merge-cell-below",e.split="notebook:split-cell-at-cursor",e.commandMode="notebook:enter-command-mode",e.toggleAllLines="notebook:toggle-all-cell-line-numbers",e.undoCellAction="notebook:undo-cell-action",e.redoCellAction="notebook:redo-cell-action",e.redo="notebook:redo",e.undo="notebook:undo",e.markdown1="notebook:change-cell-to-heading-1",e.markdown2="notebook:change-cell-to-heading-2",e.markdown3="notebook:change-cell-to-heading-3",e.markdown4="notebook:change-cell-to-heading-4",e.markdown5="notebook:change-cell-to-heading-5",e.markdown6="notebook:change-cell-to-heading-6",e.hideCode="notebook:hide-cell-code",e.showCode="notebook:show-cell-code",e.hideAllCode="notebook:hide-all-cell-code",e.showAllCode="notebook:show-all-cell-code",e.hideOutput="notebook:hide-cell-outputs",e.showOutput="notebook:show-cell-outputs",e.hideAllOutputs="notebook:hide-all-cell-outputs",e.showAllOutputs="notebook:show-all-cell-outputs",e.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",e.setSideBySideRatio="notebook:set-side-by-side-ratio",e.enableOutputScrolling="notebook:enable-output-scrolling",e.disableOutputScrolling="notebook:disable-output-scrolling",e.selectLastRunCell="notebook:select-last-run-cell",e.replaceSelection="notebook:replace-selection",e.autoClosingBrackets="notebook:toggle-autoclosing-brackets",e.toggleCollapseCmd="notebook:toggle-heading-collapse",e.collapseAllCmd="notebook:collapse-all-headings",e.expandAllCmd="notebook:expand-all-headings",e.copyToClipboard="notebook:copy-to-clipboard",e.invokeCompleter="completer:invoke-notebook",e.selectCompleter="completer:select-notebook",e.tocRunCells="toc:run-cells",e.accessPreviousHistory="notebook:access-previous-history-entry",e.accessNextHistory="notebook:access-next-history-entry",e.virtualScrollbar="notebook:toggle-virtual-scrollbar"}(W||(W={}));const q="Notebook",V=["notebook","python","custom"],$="jp-NotebookExtension-sideBySideMargins",z={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:v.INotebookTracker,requires:[v.INotebookWidgetFactory,i.IEditorExtensionRegistry,v.INotebookCellExecutor],optional:[l.ICommandPalette,m.IDefaultFileBrowser,p.ILauncher,n.ILayoutRestorer,C.IMainMenu,n.IRouter,w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator,S.IFormRendererRegistry,m.IFileBrowserFactory],activate:function(e,t,o,n,a,r,d,i,s,c,u,b,m,p,g){(0,v.setCellExecutor)(n);const C=null!=m?m:y.nullTranslator,k=null!=b?b:new l.SessionContextDialogs({translator:C}),h=C.load("jupyterlab"),f=e.serviceManager,{commands:w,shell:x}=e,_=new v.NotebookTracker({namespace:"notebook"});null==c||c.routed.connect((function(e,t){t.hash&&_.currentWidget&&_.currentWidget.setFragment(t.hash)}));const A=()=>Ce.isEnabled(x,_),E=e=>document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`);if((u?u.load(z.id):Promise.reject(new Error(`No setting registry for ${z.id}`))).then((t=>{P(t),t.changed.connect((()=>{P(t),w.notifyCommandChanged(W.virtualScrollbar)}));const n=(e,o)=>{const{newValue:n,oldValue:l}=o,a=n.autoStartDefault;"boolean"==typeof a&&a!==l.autoStartDefault&&a!==t.get("autoStartDefaultKernel").composite&&t.set("autoStartDefaultKernel",a).catch((e=>{console.error(`Failed to set ${t.id}.autoStartDefaultKernel`)}))},a=new WeakSet,r=e=>{const t=e.context.sessionContext;t.isDisposed||a.has(t)||(a.add(t),t.kernelPreferenceChanged.connect(n),t.disposed.connect((()=>{t.kernelPreferenceChanged.disconnect(n)})))};_.forEach(r),_.widgetAdded.connect(((e,t)=>{r(t)})),w.addCommand(W.autoClosingBrackets,{execute:e=>{var o;const n=t.get("codeCellConfig").composite,l=t.get("markdownCellConfig").composite,a=t.get("rawCellConfig").composite,r=n.autoClosingBrackets||l.autoClosingBrackets||a.autoClosingBrackets,d=!!(null!==(o=e.force)&&void 0!==o?o:!r);[n.autoClosingBrackets,l.autoClosingBrackets,a.autoClosingBrackets]=[d,d,d],t.set("codeCellConfig",n),t.set("markdownCellConfig",l),t.set("rawCellConfig",a)},label:h.__("Auto Close Brackets for All Notebook Cell Types"),isToggled:()=>["codeCellConfig","markdownCellConfig","rawCellConfig"].some((e=>{var n;return!0===(null!==(n=t.get(e).composite.autoClosingBrackets)&&void 0!==n?n:o.baseConfiguration.autoClosingBrackets)}))}),w.addCommand(W.setSideBySideRatio,{label:h.__("Set side-by-side ratio"),execute:e=>{l.InputDialog.getNumber({title:h.__("Width of the output in side-by-side mode"),value:t.get("sideBySideOutputRatio").composite}).then((e=>{E(e.value),e.value&&t.set("sideBySideOutputRatio",e.value)})).catch(console.error)}}),ge(e,_,C,k,t,A)})).catch((o=>{console.warn(o.message),B({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault}),ge(e,_,C,k,null,A)})),p){const e=p.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&(p.addRenderer("@jupyterlab/notebook-extension:tracker.codeCellConfig",e),p.addRenderer("@jupyterlab/notebook-extension:tracker.markdownCellConfig",e),p.addRenderer("@jupyterlab/notebook-extension:tracker.rawCellConfig",e))}i&&i.restore(_,{command:"docmanager:open",args:e=>({path:e.context.path,factory:q}),name:e=>e.context.path,when:f.ready});const M=e.docRegistry,T=new v.NotebookModelFactory({disableDocumentWideUndoRedo:t.notebookConfig.disableDocumentWideUndoRedo,collaborative:!0});M.addModelFactory(T),a&&function(e,t){const o=t.load("jupyterlab");let n=o.__("Notebook Operations");[W.interrupt,W.restart,W.restartClear,W.restartRunAll,W.runAll,W.renderAllMarkdown,W.runAllAbove,W.runAllBelow,W.restartAndRunToSelected,W.selectAll,W.deselectAll,W.clearAllOutputs,W.toggleAllLines,W.editMode,W.commandMode,W.changeKernel,W.reconnectToKernel,W.createConsole,W.closeAndShutdown,W.trust,W.toggleCollapseCmd,W.collapseAllCmd,W.expandAllCmd,W.accessPreviousHistory,W.accessNextHistory].forEach((t=>{e.addItem({command:t,category:n})})),e.addItem({command:W.createNew,category:n,args:{isPalette:!0}}),n=o.__("Notebook Cell Operations"),[W.run,W.runAndAdvance,W.runAndInsert,W.runInConsole,W.clearOutputs,W.toCode,W.toMarkdown,W.toRaw,W.cut,W.copy,W.pasteBelow,W.pasteAbove,W.pasteAndReplace,W.deleteCell,W.split,W.merge,W.mergeAbove,W.mergeBelow,W.insertAbove,W.insertBelow,W.selectAbove,W.selectBelow,W.selectHeadingAboveOrCollapse,W.selectHeadingBelowOrExpand,W.insertHeadingAbove,W.insertHeadingBelow,W.extendAbove,W.extendTop,W.extendBelow,W.extendBottom,W.moveDown,W.moveUp,W.undoCellAction,W.redoCellAction,W.markdown1,W.markdown2,W.markdown3,W.markdown4,W.markdown5,W.markdown6,W.hideCode,W.showCode,W.hideAllCode,W.showAllCode,W.hideOutput,W.showOutput,W.hideAllOutputs,W.showAllOutputs,W.toggleRenderSideBySideCurrentNotebook,W.setSideBySideRatio,W.enableOutputScrolling,W.disableOutputScrolling].forEach((t=>{e.addItem({command:t,category:n})}))}(a,C);let R=0;const O=e.docRegistry.getFileType("notebook");function B(e){_.forEach((t=>{t.setConfig(e)})),"full"!==e.notebookConfig.windowingMode&&_.forEach((e=>{e.content.scrollbar&&(e.content.scrollbar=!1)}))}function P(e){const o={...v.StaticNotebook.defaultEditorConfig.code,...e.get("codeCellConfig").composite},n={...v.StaticNotebook.defaultEditorConfig.markdown,...e.get("markdownCellConfig").composite},l={...v.StaticNotebook.defaultEditorConfig.raw,...e.get("rawCellConfig").composite};t.editorConfig={code:o,markdown:n,raw:l},t.notebookConfig={enableKernelInitNotification:e.get("enableKernelInitNotification").composite,showHiddenCellsButton:e.get("showHiddenCellsButton").composite,scrollPastEnd:e.get("scrollPastEnd").composite,defaultCell:e.get("defaultCell").composite,recordTiming:e.get("recordTiming").composite,overscanCount:e.get("overscanCount").composite,inputHistoryScope:e.get("inputHistoryScope").composite,maxNumberOutputs:e.get("maxNumberOutputs").composite,showEditorForReadOnlyMarkdown:e.get("showEditorForReadOnlyMarkdown").composite,disableDocumentWideUndoRedo:!e.get("documentWideUndoRedo").composite,renderingLayout:e.get("renderingLayout").composite,sideBySideLeftMarginOverride:e.get("sideBySideLeftMarginOverride").composite,sideBySideRightMarginOverride:e.get("sideBySideRightMarginOverride").composite,sideBySideOutputRatio:e.get("sideBySideOutputRatio").composite,windowingMode:e.get("windowingMode").composite,accessKernelHistory:e.get("accessKernelHistory").composite},E(t.notebookConfig.sideBySideOutputRatio);const a=`.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {\n margin-left: ${t.notebookConfig.sideBySideLeftMarginOverride} !important;\n margin-right: ${t.notebookConfig.sideBySideRightMarginOverride} !important;`,r=document.getElementById($);r?r.innerText=a:document.head.insertAdjacentHTML("beforeend",`<style id="${$}">${a}}</style>`),t.autoStartDefault=e.get("autoStartDefaultKernel").composite,t.shutdownOnClose=e.get("kernelShutdown").composite,T.disableDocumentWideUndoRedo=!e.get("documentWideUndoRedo").composite,B({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault})}return t.widgetCreated.connect(((e,t)=>{var o,n;t.id=t.id||"notebook-"+ ++R,t.title.icon=null==O?void 0:O.icon,t.title.iconClass=null!==(o=null==O?void 0:O.iconClass)&&void 0!==o?o:"",t.title.iconLabel=null!==(n=null==O?void 0:O.iconLabel)&&void 0!==n?n:"",t.context.pathChanged.connect((()=>{_.save(t)})),_.add(t)})),s&&function(e,t){e.editMenu.undoers.redo.add({id:W.redo,isEnabled:t}),e.editMenu.undoers.undo.add({id:W.undo,isEnabled:t}),e.editMenu.clearers.clearAll.add({id:W.clearAllOutputs,isEnabled:t}),e.editMenu.clearers.clearCurrent.add({id:W.clearOutputs,isEnabled:t}),e.fileMenu.consoleCreators.add({id:W.createConsole,isEnabled:t}),e.fileMenu.closeAndCleaners.add({id:W.closeAndShutdown,isEnabled:t}),e.kernelMenu.kernelUsers.changeKernel.add({id:W.changeKernel,isEnabled:t}),e.kernelMenu.kernelUsers.clearWidget.add({id:W.clearAllOutputs,isEnabled:t}),e.kernelMenu.kernelUsers.interruptKernel.add({id:W.interrupt,isEnabled:t}),e.kernelMenu.kernelUsers.reconnectToKernel.add({id:W.reconnectToKernel,isEnabled:t}),e.kernelMenu.kernelUsers.restartKernel.add({id:W.restart,isEnabled:t}),e.kernelMenu.kernelUsers.shutdownKernel.add({id:W.shutdown,isEnabled:t}),e.viewMenu.editorViewers.toggleLineNumbers.add({id:W.toggleAllLines,isEnabled:t}),e.runMenu.codeRunners.restart.add({id:W.restart,isEnabled:t}),e.runMenu.codeRunners.run.add({id:W.runAndAdvance,isEnabled:t}),e.runMenu.codeRunners.runAll.add({id:W.runAll,isEnabled:t}),e.helpMenu.getKernel.add({id:W.getKernel,isEnabled:t})}(s,A),w.addCommand(W.createNew,{label:e=>{var t,o,n;const l=e.kernelName||"";return e.isLauncher&&e.kernelName&&f.kernelspecs?null!==(n=null===(o=null===(t=f.kernelspecs.specs)||void 0===t?void 0:t.kernelspecs[l])||void 0===o?void 0:o.display_name)&&void 0!==n?n:"":e.isPalette||e.isContextMenu?h.__("New Notebook"):h.__("Notebook")},caption:h.__("Create a new notebook"),icon:e=>e.isPalette?void 0:S.notebookIcon,execute:e=>{var t,o;const n=null!==(t=null==g?void 0:g.tracker.currentWidget)&&void 0!==t?t:r;return(async(e,t,o)=>{const n=await w.execute("docmanager:new-untitled",{path:e,type:"notebook"});if(void 0!==n){const e=await w.execute("docmanager:open",{path:n.path,factory:q,kernel:{id:t,name:o}});return e.isUntitled=!0,e}})(e.cwd||(null!==(o=null==n?void 0:n.model.path)&&void 0!==o?o:""),e.kernelId||"",e.kernelName||"")}}),d&&f.ready.then((()=>{let e=null;const t=()=>{e&&(e.dispose(),e=null);const t=f.kernelspecs.specs;if(t){e=new I.DisposableSet;for(const o in t.kernelspecs){const n=o===t.default?0:1/0,l=t.kernelspecs[o],a=l.resources["logo-svg"]||l.resources["logo-64x64"];e.add(d.add({command:W.createNew,args:{isLauncher:!0,kernelName:o},category:h.__("Notebook"),rank:n,kernelIconUrl:a,metadata:{kernel:N.JSONExt.deepCopy(l.metadata||{})}}))}}};t(),f.kernelspecs.specsChanged.connect(t)})),_},autoStart:!0},J={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook cell factory.",provides:v.NotebookPanel.IContentFactory,requires:[r.IEditorServices],autoStart:!0,activate:(e,t)=>{const o=t.factoryService.newInlineEditor;return new v.NotebookPanel.ContentFactory({editorFactory:o})}},Y={activate:function(e,t,o,n,l,a,r){const d=a.load("jupyterlab"),i="notebook-tools",s=new v.NotebookTools({tracker:t,translator:a});return s.title.icon=S.buildIcon,s.title.caption=d.__("Notebook Tools"),s.id=i,M.MessageLoop.installMessageHook(s,((e,t)=>{switch(t.type){case"activate-request":l.save(i,{open:!0});break;case"after-hide":case"close-request":l.remove(i)}return!0})),r&&t.widgetAdded.connect(((e,t)=>{r.register(t).render(s)})),s},provides:v.INotebookTools,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,i.IEditorLanguageRegistry,x.IStateDB,y.ITranslator],optional:[h.IPropertyInspectorProvider]},G={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.CommandEditStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:a,align:"right",rank:4,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},X={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[v.INotebookTracker,n.ILabShell,y.ITranslator],optional:[_.IStatusBar,w.ISettingRegistry],activate:(e,t,o,n,l,a)=>{let r,d,i;const s=e=>{var a,s;let{showOnToolBar:c,showProgress:u}=e;if(c)i&&(o.currentChanged.disconnect(d),i.dispose());else{if(!l)return;(null==r?void 0:r.model)||(r=new v.ExecutionIndicator(n),d=(e,o)=>{const{newValue:n}=o;if(n&&t.has(n)){const e=n;r.model.attachNotebook({content:e.content,context:e.sessionContext})}},i=l.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:r,align:"left",rank:3,isActive:()=>{const e=o.currentWidget;return!!e&&t.has(e)}}),r.model.attachNotebook({content:null===(a=t.currentWidget)||void 0===a?void 0:a.content,context:null===(s=t.currentWidget)||void 0===s?void 0:s.sessionContext}),o.currentChanged.connect(d),r.disposed.connect((()=>{o.currentChanged.disconnect(d)}))),r.model.displayOption={showOnToolBar:c,showProgress:u}}};if(a){const t=a.load(z.id);Promise.all([t,e.restored]).then((([e])=>{s(v.ExecutionIndicator.getSettingValue(e)),e.changed.connect((e=>s(v.ExecutionIndicator.getSettingValue(e))))})).catch((e=>{console.error(e.message)}))}}},Q={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[y.ITranslator,v.INotebookTracker],optional:[C.IMainMenu,l.ICommandPalette],activate:(e,t,o,n,l)=>{var a;const r=t.load("jupyterlab"),{commands:i,shell:s}=e,c=e.serviceManager;let u;i.addCommand(W.exportToFormat,{label:e=>{if(void 0===e.label)return r.__("Save and Export Notebook to the given `format`.");const t=e.label;return e.isPalette?r.__("Save and Export Notebook: %1",t):t},execute:e=>{const t=pe(o,s,e);if(!t)return;const n=d.PageConfig.getNBConvertURL({format:e.format,download:!0,path:t.context.path}),{context:l}=t;return l.model.dirty&&!l.model.readOnly?l.save().then((()=>{window.open(n,"_blank","noopener")})):new Promise((e=>{window.open(n,"_blank","noopener"),e(void 0)}))},isEnabled:()=>Ce.isEnabled(s,o)}),n&&(u=null===(a=n.fileMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-file-notebookexport"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===a?void 0:a.submenu);let b=!1;const m=async()=>{if(b)return;o.widgetAdded.disconnect(m),b=!0;const e=await c.nbconvert.getExportFormats(!1);if(!e)return;const n=Ce.getFormatLabels(t);Object.keys(e).forEach((function(e){const t=r.__(e[0].toUpperCase()+e.substr(1)),o=n[e]?n[e]:t;let a={format:e,label:o,isPalette:!1};if(-1===V.indexOf(e)&&(u&&u.addItem({command:W.exportToFormat,args:a}),l)){a={format:e,label:o,isPalette:!0};const t=r.__("Notebook Operations");l.addItem({command:W.exportToFormat,category:t,args:a})}}))};o.widgetAdded.connect(m)}},Z={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.NotebookTrustStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:a,align:"right",rank:3,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},ee={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:v.INotebookWidgetFactory,requires:[v.NotebookPanel.IContentFactory,r.IEditorServices,f.IRenderMimeRegistry,l.IToolbarWidgetRegistry],optional:[w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator],activate:function(e,t,o,n,a,r,i,s){const c=null!=s?s:y.nullTranslator,b=null!=i?i:new l.SessionContextDialogs({translator:c}),m=d.PageConfig.getOption("notebookStartsKernel"),p=""===m||"true"===m.toLowerCase(),{commands:g}=e;let C;a.addFactory(q,"save",(e=>u.ToolbarItems.createSaveButton(g,e.context.fileChanged))),a.addFactory(q,"cellType",(e=>v.ToolbarItems.createCellTypeItem(e,c))),a.addFactory(q,"kernelName",(e=>l.Toolbar.createKernelNameItem(e.sessionContext,b,c))),a.addFactory(q,"executionProgress",(e=>{const t=null==r?void 0:r.load(z.id),o=v.ExecutionIndicator.createExecutionIndicatorItem(e,c,t);return null==t||t.then((t=>{e.disposed.connect((()=>{t.dispose()}))})),o})),r&&(C=(0,l.createToolbarFactory)(a,r,q,"@jupyterlab/notebook-extension:panel",c));const k=c.load("jupyterlab"),h=new v.NotebookWidgetFactory({name:q,label:k.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:p,canStartKernel:!0,rendermime:n,contentFactory:t,editorConfig:v.StaticNotebook.defaultEditorConfig,notebookConfig:v.StaticNotebook.defaultNotebookConfig,mimeTypeService:o.mimeTypeService,toolbarFactory:C,translator:c});return e.docRegistry.addWidgetFactory(h),h},autoStart:!0},te={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[c.IDocumentManager,v.INotebookTracker,y.ITranslator],optional:[n.ILayoutRestorer],activate:function(e,t,o,n,a){const r=n.load("jupyterlab"),d=new l.WidgetTracker({namespace:"cloned-outputs"});a&&a.restore(d,{command:W.createOutputView,args:e=>({path:e.content.path,index:e.content.index}),name:e=>`${e.content.path}:${e.content.index}`,when:o.restored});const{commands:i,shell:s}=e;i.addCommand(W.createOutputView,{label:r.__("Create New View for Cell Output"),execute:async e=>{var a;let r,i;const s=e.path;let c=e.index;if(s&&null!=c){if(i=t.findWidget(s,q),!i)return}else{if(i=o.currentWidget,!i)return;r=i.content.activeCell,c=i.content.activeCellIndex}const u=new Ce.ClonedOutputArea({notebook:i,cell:r,index:c,translator:n}),b=new l.MainAreaWidget({content:u});i.context.addSibling(b,{ref:i.id,mode:"split-bottom",type:"Cloned Output"});const m=()=>{d.save(b)};i.context.pathChanged.connect(m),null===(a=i.context.model)||void 0===a||a.cells.changed.connect(m),d.add(b),i.content.disposed.connect((()=>{var e;i.context.pathChanged.disconnect(m),null===(e=i.context.model)||void 0===e||e.cells.changed.disconnect(m),b.dispose()}))},isEnabled:()=>Ce.isEnabledAndSingleSelected(s,o)})},autoStart:!0},oe={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[v.INotebookTracker,y.ITranslator],activate:function(e,t,o){const n=o.load("jupyterlab"),{commands:l,shell:a}=e,r=()=>Ce.isEnabled(a,t);l.addCommand(W.createConsole,{label:n.__("New Console for Notebook"),execute:e=>{const o=t.currentWidget;if(o)return Ce.createConsole(l,o,e.activate)},isEnabled:r}),l.addCommand(W.runInConsole,{label:n.__("Run Selected Text or Current Line in Console"),execute:async e=>{var o,n;const a=t.currentWidget;if(!a)return;const{context:r,content:d}=a,i=d.activeCell,s=null==i?void 0:i.model.metadata,c=r.path;if(!i||"code"!==i.model.type)return;let u;const b=i.editor;if(!b)return;const m=b.getSelection(),{start:p,end:g}=m;if(p.column!==g.column||p.line!==g.line){const e=b.getOffsetAt(m.start),t=b.getOffsetAt(m.end);u=b.model.sharedModel.getSource().substring(e,t)}else{const e=b.getCursorPosition(),t=b.model.sharedModel.getSource().split("\n");let l=m.start.line;for(;l<b.lineCount&&!t[l].replace(/\s/g,"").length;)l+=1;let r=l>0,d=0,i=d+1;for(;;){u=t.slice(d,i).join("\n");const s=await(null===(n=null===(o=a.context.sessionContext.session)||void 0===o?void 0:o.kernel)||void 0===n?void 0:n.requestIsComplete({code:u+"\n\n"}));if("complete"===(null==s?void 0:s.content.status)){if(l<i){for(;i<b.lineCount&&!t[i].replace(/\s/g,"").length;)i+=1;b.setCursorPosition({line:i,column:e.column});break}d=i,i=d+1}else if(i<b.lineCount)i+=1;else{if(!r){for(u=t[l];l+1<b.lineCount&&!t[l+1].replace(/\s/g,"").length;)l+=1;b.setCursorPosition({line:l+1,column:e.column});break}d=l,i=l+1,r=!1}}}u&&(await l.execute("console:open",{activate:!1,insertMode:"split-bottom",path:c}),await l.execute("console:inject",{activate:!1,code:u,path:c,metadata:s}))},isEnabled:r})},autoStart:!0},ne={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:function(e,t,o){const n=t.load("jupyterlab");e.commands.addCommand(W.copyToClipboard,{label:n.__("Copy Output to Clipboard"),execute:e=>{var t;const n=null===(t=o.currentWidget)||void 0===t?void 0:t.content.activeCell;if(null==n)return;const l=n.outputArea.outputTracker.currentWidget;if(null==l)return;const a=l.node.getElementsByClassName("jp-OutputArea-output");a.length>0&&function(e){const t=window.getSelection();if(null==t)return;const o=[];for(let e=0;e<t.rangeCount;++e)o[e]=t.getRangeAt(e).cloneRange();const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),o.forEach((e=>t.addRange(e)))}(a[0])}}),e.contextMenu.addItem({command:W.copyToClipboard,selector:".jp-OutputArea-child",rank:0})},requires:[y.ITranslator,v.INotebookTracker],autoStart:!0},le={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(e,t,o)=>{o.addSessionProvider((e=>e&&t.has(e)?e.sessionContext:null))},requires:[v.INotebookTracker,l.IKernelStatusModel],autoStart:!0},ae={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(e,t,o)=>{let n=null;o.addEditorProvider((async e=>{let l=null;if(e!==n){if(null==n||n.content.activeCellChanged.disconnect(o.update),n=null,e&&t.has(e)){e.content.activeCellChanged.connect(o.update);const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor),n=e}}else if(e){const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor)}return l}))},requires:[v.INotebookTracker,r.IPositionModel],autoStart:!0},re={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[v.INotebookTracker],optional:[s.ICompletionProviderManager,y.ITranslator,l.ISanitizer],activate:function(e,t,o,n,a){if(!o)return;const r=(null!=n?n:y.nullTranslator).load("jupyterlab"),d=null!=a?a:new l.Sanitizer;e.commands.addCommand(W.invokeCompleter,{label:r.__("Display the completion helper."),execute:e=>{var n;const l=t.currentWidget;l&&"code"===(null===(n=l.content.activeCell)||void 0===n?void 0:n.model.type)&&o.invoke(l.id)}}),e.commands.addCommand(W.selectCompleter,{label:r.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:W.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const i=async(e,t)=>{var n,l;const a={editor:null!==(l=null===(n=t.content.activeCell)||void 0===n?void 0:n.editor)&&void 0!==l?l:null,session:t.sessionContext.session,widget:t,sanitizer:d};await o.updateCompleter(a),t.content.activeCellChanged.connect(((e,n)=>{null==n||n.ready.then((()=>{const e={editor:n.editor,session:t.sessionContext.session,widget:t,sanitizer:d};return o.updateCompleter(e)})).catch(console.error)})),t.sessionContext.sessionChanged.connect((()=>{var e;null===(e=t.content.activeCell)||void 0===e||e.ready.then((()=>{var e,n;const l={editor:null!==(n=null===(e=t.content.activeCell)||void 0===e?void 0:e.editor)&&void 0!==n?n:null,session:t.sessionContext.session,widget:t};return o.updateCompleter(l)})).catch(console.error)}))};t.widgetAdded.connect(i),o.activeProvidersChanged.connect((()=>{t.forEach((e=>{i(0,e).catch((e=>console.error(e)))}))}))},autoStart:!0},de={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[b.ISearchProviderRegistry],autoStart:!0,activate:(e,t)=>{t.add("jp-notebookSearchProvider",v.NotebookSearchProvider)}},ie={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[v.INotebookTracker,A.ITableOfContentsRegistry,l.ISanitizer],optional:[f.IMarkdownParser,w.ISettingRegistry],autoStart:!0,activate:(e,t,o,n,l,a)=>{const r=new v.NotebookToCFactory(t,l,n);o.add(r),a&&Promise.all([e.restored,a.load(z.id)]).then((([e,t])=>{const o=()=>{var e;r.scrollToTop=null===(e=t.composite.scrollHeadingToTop)||void 0===e||e};o(),t.changed.connect(o)})).catch((e=>{console.error("Failed to load notebook table of content settings.",e)}))}},se={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[v.INotebookTracker,g.ILSPDocumentConnectionManager,g.ILSPFeatureManager,g.ILSPCodeExtractorsManager,g.IWidgetLSPAdapterTracker],activate:function(e,t,o,n,l,a){t.widgetAdded.connect((async(e,t)=>{const r=new v.NotebookAdapter(t,{connectionManager:o,featureManager:n,foreignCodeExtractorsManager:l});a.add(r)}))},autoStart:!0},ce={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[v.INotebookTracker,k.IMetadataFormProvider,y.ITranslator],activate:(e,t,o,n)=>{const l=n.load("jupyterlab");let a=!1;t.widgetAdded.connect((async function r(){if(a)return;if(!o.get("commonToolsSection"))return;const d=o.get("commonToolsSection").getProperties("/raw_mimetype");if(!d)return;t.widgetAdded.disconnect(r),a=!0;const i=e.serviceManager,s=await i.nbconvert.getExportFormats(!1);if(!s)return;const c=Object.keys(s),u=Ce.getFormatLabels(n);c.forEach((function(e){var t;if(!((null===(t=d.oneOf)||void 0===t?void 0:t.filter((t=>t.const===e)).length)>0)){const t=l.__(e[0].toUpperCase()+e.substr(1)),o=u[e]?u[e]:t,n=s[e].output_mimetype;d.oneOf.push({const:n,title:o})}})),o.get("commonToolsSection").setProperties("/raw_mimetype",d)}))}},ue={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,S.IFormRendererRegistry],optional:[y.ITranslator],activate:(e,t,o,n,l)=>{const a=e=>o.factoryService.newInlineEditor(e),r={fieldRenderer:e=>new F({editorFactory:a,tracker:t,label:"Cell metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",r);const d={fieldRenderer:e=>new U({editorFactory:a,tracker:t,label:"Notebook metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},be={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[v.INotebookTracker,S.IFormRendererRegistry,i.IEditorLanguageRegistry],activate:(e,t,o,n)=>{const l={fieldRenderer:e=>new D({tracker:t,languages:n}).render(e)};o.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},me=[R,J,z,X,Q,Y,G,Z,ee,P,te,oe,ne,le,ae,re,de,ie,se,ce,ue,be];function pe(e,t,o){const n=e.currentWidget;return!1!==o.activate&&n&&t.activateById(n.id),n}function ge(e,t,o,n,r,d){var i;const s=o.load("jupyterlab"),{commands:c,shell:u}=e,b=()=>Ce.isEnabledAndSingleSelected(u,t);t.currentChanged.connect(((e,t)=>{var o,n;(null===(n=null===(o=null==t?void 0:t.content)||void 0===o?void 0:o.model)||void 0===n?void 0:n.cells)&&(t.content.model.cells.changed.connect(((e,o)=>{(e=>{var t,o;for(const n of e.widgets)n instanceof a.MarkdownCell&&n.headingCollapsed&&v.NotebookActions.setHeadingCollapse(n,!0,e),n.model.id===(null===(o=null===(t=e.activeCell)||void 0===t?void 0:t.model)||void 0===o?void 0:o.id)&&v.NotebookActions.expandParent(n,e)})(t.content)})),t.content.activeCellChanged.connect(((e,t)=>{v.NotebookActions.expandParent(t,e)})))})),t.selectionChanged.connect((()=>{c.notifyCommandChanged(W.duplicateBelow),c.notifyCommandChanged(W.deleteCell),c.notifyCommandChanged(W.copy),c.notifyCommandChanged(W.cut),c.notifyCommandChanged(W.pasteBelow),c.notifyCommandChanged(W.pasteAbove),c.notifyCommandChanged(W.pasteAndReplace),c.notifyCommandChanged(W.moveUp),c.notifyCommandChanged(W.moveDown),c.notifyCommandChanged(W.run),c.notifyCommandChanged(W.runAll),c.notifyCommandChanged(W.runAndAdvance),c.notifyCommandChanged(W.runAndInsert)})),t.activeCellChanged.connect((()=>{c.notifyCommandChanged(W.moveUp),c.notifyCommandChanged(W.moveDown)})),c.addCommand(W.runAndAdvance,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell","Run Selected Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run this cell and advance","Run these %1 cells and advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndAdvance(t,e.sessionContext,n,o)}},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.runIcon:void 0}),c.addCommand(W.run,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.run(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAndInsert,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndInsert(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAll,{label:s.__("Run All Cells"),caption:s.__("Run all cells"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAll(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAllAbove,{label:s.__("Run All Above Selected Cell"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllAbove(t,e.sessionContext,n,o)}},isEnabled:()=>b()&&0!==t.currentWidget.content.activeCellIndex}),c.addCommand(W.runAllBelow,{label:s.__("Run Selected Cell and All Below"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllBelow(t,e.sessionContext,n,o)}},isEnabled:()=>b()&&t.currentWidget.content.activeCellIndex!==t.currentWidget.content.widgets.length-1}),c.addCommand(W.renderAllMarkdown,{label:s.__("Render All Markdown Cells"),execute:e=>{const o=pe(t,u,e);if(o){const{content:e}=o;return v.NotebookActions.renderAllMarkdown(e)}},isEnabled:d}),c.addCommand(W.restart,{label:s.__("Restart Kernel…"),caption:s.__("Restart the kernel"),execute:e=>{const o=pe(t,u,e);if(o)return n.restart(o.sessionContext)},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.refreshIcon:void 0}),c.addCommand(W.shutdown,{label:s.__("Shut Down Kernel"),execute:e=>{const o=pe(t,u,e);if(o)return o.context.sessionContext.shutdown()},isEnabled:d}),c.addCommand(W.closeAndShutdown,{label:s.__("Close and Shut Down Notebook…"),execute:e=>{const o=pe(t,u,e);if(!o)return;const n=o.title.label;return(0,l.showDialog)({title:s.__("Shut down the notebook?"),body:s.__('Are you sure you want to close "%1"?',n),buttons:[l.Dialog.cancelButton(),l.Dialog.warnButton()]}).then((e=>{if(e.button.accept)return c.execute(W.shutdown,{activate:!1}).then((()=>{o.dispose()}))}))},isEnabled:d}),c.addCommand(W.trust,{label:()=>s.__("Trust Notebook"),execute:e=>{const o=pe(t,u,e);if(o){const{context:e,content:t}=o;return v.NotebookActions.trust(t).then((()=>e.save()))}},isEnabled:d}),c.addCommand(W.restartClear,{label:s.__("Restart Kernel and Clear Outputs of All Cells…"),caption:s.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{await c.execute(W.restart,{activate:!1})&&await c.execute(W.clearAllOutputs)},isEnabled:d}),c.addCommand(W.restartAndRunToSelected,{label:s.__("Restart Kernel and Run up to Selected Cell…"),execute:async e=>{const l=pe(t,u,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets.slice(0,r.activeCellIndex+1);return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:b}),c.addCommand(W.restartRunAll,{label:s.__("Restart Kernel and Run All Cells…"),caption:s.__("Restart the kernel and run all cells"),execute:async e=>{const l=pe(t,u,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets;return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.fastForwardIcon:void 0}),c.addCommand(W.clearAllOutputs,{label:s.__("Clear Outputs of All Cells"),caption:s.__("Clear all outputs of all cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.clearAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.clearOutputs,{label:s.__("Clear Cell Output"),caption:s.__("Clear outputs for the selected cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.clearOutputs(o.content)},isEnabled:d}),c.addCommand(W.interrupt,{label:s.__("Interrupt Kernel"),caption:s.__("Interrupt the kernel"),execute:e=>{var o;const n=pe(t,u,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.interrupt():void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.stopIcon:void 0}),c.addCommand(W.toCode,{label:s.__("Change to Code Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"code",o)},isEnabled:d}),c.addCommand(W.toMarkdown,{label:s.__("Change to Markdown Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"markdown",o)},isEnabled:d}),c.addCommand(W.toRaw,{label:s.__("Change to Raw Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"raw",o)},isEnabled:d}),c.addCommand(W.cut,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Cut Cell","Cut Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Cut this cell","Cut these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.cut(o.content)},icon:e=>e.toolbar?S.cutIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.copy,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Copy Cell","Copy Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Copy this cell","Copy these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.copy(o.content)},icon:e=>e.toolbar?S.copyIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteBelow,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell Below","Paste Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"below")},icon:e=>e.toolbar?S.pasteIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteAbove,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell Above","Paste Cells Above",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"above")},isEnabled:d}),c.addCommand(W.duplicateBelow,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Duplicate Cell Below","Duplicate Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&v.NotebookActions.duplicate(o.content,"belowSelected")},icon:e=>e.toolbar?S.duplicateIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteAndReplace,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell and Replace","Paste Cells and Replace",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"replace")},isEnabled:d}),c.addCommand(W.deleteCell,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Delete Cell","Delete Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Delete this cell","Delete these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.deleteCells(o.content)},isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.split,{label:s.__("Split Cell"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.splitCell(o.content)},isEnabled:d}),c.addCommand(W.merge,{label:s.__("Merge Selected Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content)},isEnabled:d}),c.addCommand(W.mergeAbove,{label:s.__("Merge Cell Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content,!0)},isEnabled:d}),c.addCommand(W.mergeBelow,{label:s.__("Merge Cell Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content,!1)},isEnabled:d}),c.addCommand(W.insertAbove,{label:s.__("Insert Cell Above"),caption:s.__("Insert a cell above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertAbove(o.content)},icon:e=>e.toolbar?S.addAboveIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.insertBelow,{label:s.__("Insert Cell Below"),caption:s.__("Insert a cell below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertBelow(o.content)},icon:e=>e.toolbar?S.addBelowIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.selectAbove,{label:s.__("Select Cell Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectAbove(o.content)},isEnabled:d}),c.addCommand(W.selectBelow,{label:s.__("Select Cell Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectBelow(o.content)},isEnabled:d}),c.addCommand(W.insertHeadingAbove,{label:s.__("Insert Heading Above Current Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertSameLevelHeadingAbove(o.content)},isEnabled:d}),c.addCommand(W.insertHeadingBelow,{label:s.__("Insert Heading Below Current Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertSameLevelHeadingBelow(o.content)},isEnabled:d}),c.addCommand(W.selectHeadingAboveOrCollapse,{label:s.__("Select Heading Above or Collapse Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectHeadingAboveOrCollapseHeading(o.content)},isEnabled:d}),c.addCommand(W.selectHeadingBelowOrExpand,{label:s.__("Select Heading Below or Expand Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectHeadingBelowOrExpandHeading(o.content)},isEnabled:d}),c.addCommand(W.extendAbove,{label:s.__("Extend Selection Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content)},isEnabled:d}),c.addCommand(W.extendTop,{label:s.__("Extend Selection to Top"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content,!0)},isEnabled:d}),c.addCommand(W.extendBelow,{label:s.__("Extend Selection Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content)},isEnabled:d}),c.addCommand(W.extendBottom,{label:s.__("Extend Selection to Bottom"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content,!0)},isEnabled:d}),c.addCommand(W.selectAll,{label:s.__("Select All Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectAll(o.content)},isEnabled:d}),c.addCommand(W.deselectAll,{label:s.__("Deselect All Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.deselectAll(o.content)},isEnabled:d}),c.addCommand(W.moveUp,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move Cell Up","Move Cells Up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move this cell up","Move these %1 cells up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&(v.NotebookActions.moveUp(o.content),Ce.raiseSilentNotification(s.__("Notebook cell shifted up successfully"),o.node))},isEnabled:e=>{const o=pe(t,u,{...e,activate:!1});return!!o&&o.content.activeCellIndex>=1},icon:e=>e.toolbar?S.moveUpIcon:void 0}),c.addCommand(W.moveDown,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move Cell Down","Move Cells Down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move this cell down","Move these %1 cells down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&(v.NotebookActions.moveDown(o.content),Ce.raiseSilentNotification(s.__("Notebook cell shifted down successfully"),o.node))},isEnabled:e=>{const o=pe(t,u,{...e,activate:!1});if(!o||!o.content.model)return!1;const n=o.content.model.cells.length;return o.content.activeCellIndex<n-1},icon:e=>e.toolbar?S.moveDownIcon:void 0}),c.addCommand(W.toggleAllLines,{label:s.__("Show Line Numbers"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.toggleAllLineNumbers(o.content)},isEnabled:d,isToggled:e=>{const o=pe(t,u,{...e,activate:!1});if(o){const e=o.content.editorConfig;return!!(e.code.lineNumbers&&e.markdown.lineNumbers&&e.raw.lineNumbers)}return!1}}),c.addCommand(W.commandMode,{label:s.__("Enter Command Mode"),execute:e=>{const o=pe(t,u,e);o&&(o.content.mode="command")},isEnabled:d}),c.addCommand(W.editMode,{label:s.__("Enter Edit Mode"),execute:e=>{const o=pe(t,u,e);o&&(o.content.mode="edit")},isEnabled:d}),c.addCommand(W.undoCellAction,{label:s.__("Undo Cell Operation"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.undo(o.content)},isEnabled:d}),c.addCommand(W.redoCellAction,{label:s.__("Redo Cell Operation"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.redo(o.content)},isEnabled:d}),c.addCommand(W.redo,{label:s.__("Redo"),execute:e=>{var o;const n=pe(t,u,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.redo()}}}),c.addCommand(W.undo,{label:s.__("Undo"),execute:e=>{var o;const n=pe(t,u,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.undo()}}}),c.addCommand(W.changeKernel,{label:s.__("Change Kernel…"),execute:e=>{const o=pe(t,u,e);if(o)return n.selectKernel(o.context.sessionContext)},isEnabled:d}),c.addCommand(W.getKernel,{label:s.__("Get Kernel"),execute:e=>{var o;const n=pe(t,u,{activate:!1,...e});if(n)return null===(o=n.sessionContext.session)||void 0===o?void 0:o.kernel},isEnabled:d}),c.addCommand(W.reconnectToKernel,{label:s.__("Reconnect to Kernel"),execute:e=>{var o;const n=pe(t,u,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.reconnect():void 0},isEnabled:d}),c.addCommand(W.markdown1,{label:s.__("Change to Heading 1"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,1,o)},isEnabled:d}),c.addCommand(W.markdown2,{label:s.__("Change to Heading 2"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,2,o)},isEnabled:d}),c.addCommand(W.markdown3,{label:s.__("Change to Heading 3"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,3,o)},isEnabled:d}),c.addCommand(W.markdown4,{label:s.__("Change to Heading 4"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,4,o)},isEnabled:d}),c.addCommand(W.markdown5,{label:s.__("Change to Heading 5"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,5,o)},isEnabled:d}),c.addCommand(W.markdown6,{label:s.__("Change to Heading 6"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,6,o)},isEnabled:d}),c.addCommand(W.hideCode,{label:s.__("Collapse Selected Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideCode(o.content)},isEnabled:d}),c.addCommand(W.showCode,{label:s.__("Expand Selected Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showCode(o.content)},isEnabled:d}),c.addCommand(W.hideAllCode,{label:s.__("Collapse All Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideAllCode(o.content)},isEnabled:d}),c.addCommand(W.showAllCode,{label:s.__("Expand All Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showAllCode(o.content)},isEnabled:d}),c.addCommand(W.hideOutput,{label:s.__("Collapse Selected Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideOutput(o.content)},isEnabled:d}),c.addCommand(W.showOutput,{label:s.__("Expand Selected Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showOutput(o.content)},isEnabled:d}),c.addCommand(W.hideAllOutputs,{label:s.__("Collapse All Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.toggleRenderSideBySideCurrentNotebook,{label:s.__("Render Side-by-Side"),execute:e=>{const o=pe(t,u,e);if(o)return"side-by-side"===o.content.renderingLayout?v.NotebookActions.renderDefault(o.content):v.NotebookActions.renderSideBySide(o.content)},isEnabled:d,isToggled:e=>{const o=pe(t,u,{...e,activate:!1});return!!o&&"side-by-side"===o.content.renderingLayout}}),c.addCommand(W.showAllOutputs,{label:s.__("Expand All Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.enableOutputScrolling,{label:s.__("Enable Scrolling for Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.enableOutputScrolling(o.content)},isEnabled:d}),c.addCommand(W.disableOutputScrolling,{label:s.__("Disable Scrolling for Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.disableOutputScrolling(o.content)},isEnabled:d}),c.addCommand(W.selectLastRunCell,{label:s.__("Select current running or last run cell"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectLastRunCell(o.content)},isEnabled:d}),c.addCommand(W.replaceSelection,{label:s.__("Replace Selection in Notebook Cell"),execute:e=>{const o=pe(t,u,e),n=e.text||"";if(o)return v.NotebookActions.replaceSelection(o.content,n)},isEnabled:d}),c.addCommand(W.toggleCollapseCmd,{label:s.__("Toggle Collapse Notebook Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.toggleCurrentHeadingCollapse(o.content)},isEnabled:()=>Ce.isEnabledAndHeadingSelected(u,t)}),c.addCommand(W.collapseAllCmd,{label:s.__("Collapse All Headings"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.collapseAllHeadings(o.content)}}),c.addCommand(W.expandAllCmd,{label:s.__("Expand All Headings"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.expandAllHeadings(o.content)}}),c.addCommand(W.tocRunCells,{label:s.__("Select and Run Cell(s) for this Heading"),execute:e=>{const l=pe(t,u,{activate:!1,...e});if(null===l)return;const r=l.content.activeCell;let d=l.content.activeCellIndex;if(r instanceof a.MarkdownCell){const e=l.content.widgets,t=r.headingInfo.level;for(let o=l.content.activeCellIndex+1;o<e.length;o++){const n=e[o];if(n instanceof a.MarkdownCell&&n.headingInfo.level>=0&&n.headingInfo.level<=t)break;d=o}}l.content.extendContiguousSelectionTo(d),v.NotebookActions.run(l.content,l.sessionContext,n,o)}}),c.addCommand(W.accessPreviousHistory,{label:s.__("Access Previous Kernel History Entry"),execute:async e=>{const o=pe(t,u,e);if(o)return await v.NotebookActions.accessPreviousHistory(o.content)}}),c.addCommand(W.accessNextHistory,{label:s.__("Access Next Kernel History Entry"),execute:async e=>{const o=pe(t,u,e);if(o)return await v.NotebookActions.accessNextHistory(o.content)}}),c.addCommand(W.virtualScrollbar,{label:s.__("Virtual Scrollbar"),caption:s.__("Toggle virtual scrollbar (enabled with windowing mode: full)"),execute:e=>{const o=pe(t,u,e);o&&(o.content.scrollbar=!o.content.scrollbar)},icon:e=>e.toolbar?S.tableRowsIcon:void 0,isEnabled:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t},isVisible:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t}});const m=[W.createNew,W.createOutputView],p=()=>{Object.values(W).filter((t=>!m.includes(t)&&e.commands.hasCommand(t))).forEach((t=>e.commands.notifyCommandChanged(t)))};t.currentChanged.connect(p),null===(i=u.currentChanged)||void 0===i||i.connect(p)}var Ce;!function(e){e.createConsole=function(e,t,o){const n={path:t.context.path,preferredLanguage:t.context.model.defaultKernelLanguage,activate:o,ref:t.id,insertMode:"split-bottom",type:"Linked Console"};return e.execute("console:create",n)},e.isEnabled=function(e,t){return null!==t.currentWidget&&t.currentWidget===e.currentWidget},e.isEnabledAndSingleSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.isEnabledAndHeadingSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;if(!(n.activeCell instanceof a.MarkdownCell))return!1;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.getFormatLabels=function(e){const t=(e=e||y.nullTranslator).load("jupyterlab");return{html:t.__("HTML"),latex:t.__("LaTeX"),markdown:t.__("Markdown"),pdf:t.__("PDF"),rst:t.__("ReStructured Text"),script:t.__("Executable Script"),slides:t.__("Reveal.js Slides")}},e.raiseSilentNotification=function(e,t){const o=`sr-message-container-${t.id}`,n=document.getElementById(o)||document.createElement("div");n.getAttribute("id")!==o&&(n.classList.add("sr-only"),n.setAttribute("id",o),n.setAttribute("role","alert"),n.hidden=!0,t.appendChild(n)),n.innerText=e};class t extends T.Panel{constructor(e){super(),this._cell=null;const t=(e.translator||y.nullTranslator).load("jupyterlab");this._notebook=e.notebook,this._index=void 0!==e.index?e.index:-1,this._cell=e.cell||null,this.id=`LinkedOutputView-${N.UUID.uuid4()}`,this.title.label="Output View",this.title.icon=S.notebookIcon,this.title.caption=this._notebook.title.label?t.__("For Notebook: %1",this._notebook.title.label):t.__("For Notebook:"),this.addClass("jp-LinkedOutputView"),this._notebook.context.ready.then((()=>{if(this._cell||(this._cell=this._notebook.content.widgets[this._index]),!this._cell||"code"!==this._cell.model.type)return void this.dispose();const e=this._cell.cloneOutputArea();this.addWidget(e)}))}get index(){return this._cell?E.ArrayExt.findFirstIndex(this._notebook.content.widgets,(e=>e===this._cell)):this._index}get path(){return this._notebook.context.path}}e.ClonedOutputArea=t}(Ce||(Ce={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1962],{51962:(e,t,o)=>{o.r(t),o.d(t,{commandEditItem:()=>G,default:()=>me,executionIndicator:()=>X,exportPlugin:()=>Q,notebookTrustItem:()=>Z});var n=o(2756),l=o(20005),a=o(98987),r=o(68481),d=o(64145),i=o(75536),s=o(18101),c=o(50712),u=o(60965),b=o(11523),m=o(42150),p=o(30688),g=o(23184),C=o(98979),k=o(3185),v=o(564),h=o(94253),f=o(1323),w=o(3339),x=o(48218),_=o(47652),A=o(27333),y=o(90646),S=o(14576),E=o(33625),N=o(20998),I=o(2549),M=o(49503),T=o(63485);const R={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:v.INotebookCellExecutor,activate:()=>Object.freeze({runCell:v.runCell})};var O=o(51737),B=o(50558);const P={activate:function(e,t,o){function n(e){function t(t,n,l){if(B.KernelMessage.isDisplayDataMsg(t)||B.KernelMessage.isStreamMsg(t)||B.KernelMessage.isErrorMsg(t)||B.KernelMessage.isExecuteResultMsg(t)){const a=o.getLogger(e.context.path);a.rendermime=e.content.rendermime;const r={...t.content,output_type:t.header.msg_type};let d=n;(B.KernelMessage.isErrorMsg(t)||B.KernelMessage.isStreamMsg(t)&&"stderr"===t.content.name)&&(d=l),a.log({type:"output",data:r,level:d})}}e.context.sessionContext.iopubMessage.connect(((e,o)=>t(o,"info","info"))),e.context.sessionContext.unhandledMessage.connect(((e,o)=>t(o,"warning","error")))}o&&(t.forEach((e=>n(e))),t.widgetAdded.connect(((e,t)=>n(t))))},id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[v.INotebookTracker],optional:[O.ILoggerRegistry],autoStart:!0};var H=o(78156),j=o.n(H),L=o(97934);class D extends v.NotebookTools.Tool{constructor(e){super();const{languages:t}=e;this._tracker=e.tracker,this.addClass("jp-ActiveCellTool"),this.layout=new T.PanelLayout,this._inputPrompt=new a.InputPrompt,this.layout.addWidget(this._inputPrompt);const o=document.createElement("div");o.classList.add("jp-ActiveCellTool-Content");const n=o.appendChild(document.createElement("div")),l=n.appendChild(document.createElement("pre"));n.className="jp-ActiveCellTool-CellContent",this._editorEl=l,this.layout.addWidget(new T.Widget({node:o})),this._refreshDebouncer=new L.Debouncer((async()=>{var e,o;this._editorEl.innerHTML="","code"===(null===(e=this._cellModel)||void 0===e?void 0:e.type)?(this._inputPrompt.executionCount=`${null!==(o=this._cellModel.executionCount)&&void 0!==o?o:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide()),this._cellModel&&await t.highlight(this._cellModel.sharedModel.getSource().split("\n")[0],t.findByMIME(this._cellModel.mimeType),this._editorEl)}),150)}render(e){var t,o;const n=this._tracker.activeCell;return n&&(this._cellModel=(null==n?void 0:n.model)||null),(null===(t=this._cellModel)||void 0===t?void 0:t.sharedModel).changed.connect(this.refresh,this),null===(o=this._cellModel)||void 0===o||o.mimeTypeChanged.connect(this.refresh,this),this.refresh().then((()=>{})).catch((()=>{})),j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)})}async refresh(){await this._refreshDebouncer.invoke()}}var W,K=o(42503);class F extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e;this.editor.source&&(null===(e=this._tracker.activeCell)||void 0===e||e.model.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t;const o=this._tracker.activeCell;return this.editor.source=o?new K.ObservableJSON({values:o.model.metadata}):null,null===(t=this.editor.source)||void 0===t||t.changed.connect(this._onSourceChanged,this),j().createElement("div",{className:"jp-CellMetadataEditor"},j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}class U extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,t;this.editor.source&&(null===(t=null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.model)||void 0===t||t.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t,o;const n=this._tracker.currentWidget;return this.editor.source=n?new K.ObservableJSON({values:null===(t=n.model)||void 0===t?void 0:t.metadata}):null,null===(o=this.editor.source)||void 0===o||o.changed.connect(this._onSourceChanged,this),j().createElement("div",{className:"jp-NotebookMetadataEditor"},j().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}!function(e){e.createNew="notebook:create-new",e.interrupt="notebook:interrupt-kernel",e.restart="notebook:restart-kernel",e.restartClear="notebook:restart-clear-output",e.restartAndRunToSelected="notebook:restart-and-run-to-selected",e.restartRunAll="notebook:restart-run-all",e.reconnectToKernel="notebook:reconnect-to-kernel",e.changeKernel="notebook:change-kernel",e.getKernel="notebook:get-kernel",e.createConsole="notebook:create-console",e.createOutputView="notebook:create-output-view",e.clearAllOutputs="notebook:clear-all-cell-outputs",e.shutdown="notebook:shutdown-kernel",e.closeAndShutdown="notebook:close-and-shutdown",e.trust="notebook:trust",e.exportToFormat="notebook:export-to-format",e.run="notebook:run-cell",e.runAndAdvance="notebook:run-cell-and-select-next",e.runAndInsert="notebook:run-cell-and-insert-below",e.runInConsole="notebook:run-in-console",e.runAll="notebook:run-all-cells",e.runAllAbove="notebook:run-all-above",e.runAllBelow="notebook:run-all-below",e.renderAllMarkdown="notebook:render-all-markdown",e.toCode="notebook:change-cell-to-code",e.toMarkdown="notebook:change-cell-to-markdown",e.toRaw="notebook:change-cell-to-raw",e.cut="notebook:cut-cell",e.copy="notebook:copy-cell",e.pasteAbove="notebook:paste-cell-above",e.pasteBelow="notebook:paste-cell-below",e.duplicateBelow="notebook:duplicate-below",e.pasteAndReplace="notebook:paste-and-replace-cell",e.moveUp="notebook:move-cell-up",e.moveDown="notebook:move-cell-down",e.clearOutputs="notebook:clear-cell-output",e.deleteCell="notebook:delete-cell",e.insertAbove="notebook:insert-cell-above",e.insertBelow="notebook:insert-cell-below",e.selectAbove="notebook:move-cursor-up",e.selectBelow="notebook:move-cursor-down",e.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",e.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",e.insertHeadingAbove="notebook:insert-heading-above",e.insertHeadingBelow="notebook:insert-heading-below",e.extendAbove="notebook:extend-marked-cells-above",e.extendTop="notebook:extend-marked-cells-top",e.extendBelow="notebook:extend-marked-cells-below",e.extendBottom="notebook:extend-marked-cells-bottom",e.selectAll="notebook:select-all",e.deselectAll="notebook:deselect-all",e.editMode="notebook:enter-edit-mode",e.merge="notebook:merge-cells",e.mergeAbove="notebook:merge-cell-above",e.mergeBelow="notebook:merge-cell-below",e.split="notebook:split-cell-at-cursor",e.commandMode="notebook:enter-command-mode",e.toggleAllLines="notebook:toggle-all-cell-line-numbers",e.undoCellAction="notebook:undo-cell-action",e.redoCellAction="notebook:redo-cell-action",e.redo="notebook:redo",e.undo="notebook:undo",e.markdown1="notebook:change-cell-to-heading-1",e.markdown2="notebook:change-cell-to-heading-2",e.markdown3="notebook:change-cell-to-heading-3",e.markdown4="notebook:change-cell-to-heading-4",e.markdown5="notebook:change-cell-to-heading-5",e.markdown6="notebook:change-cell-to-heading-6",e.hideCode="notebook:hide-cell-code",e.showCode="notebook:show-cell-code",e.hideAllCode="notebook:hide-all-cell-code",e.showAllCode="notebook:show-all-cell-code",e.hideOutput="notebook:hide-cell-outputs",e.showOutput="notebook:show-cell-outputs",e.hideAllOutputs="notebook:hide-all-cell-outputs",e.showAllOutputs="notebook:show-all-cell-outputs",e.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",e.setSideBySideRatio="notebook:set-side-by-side-ratio",e.enableOutputScrolling="notebook:enable-output-scrolling",e.disableOutputScrolling="notebook:disable-output-scrolling",e.selectLastRunCell="notebook:select-last-run-cell",e.replaceSelection="notebook:replace-selection",e.autoClosingBrackets="notebook:toggle-autoclosing-brackets",e.toggleCollapseCmd="notebook:toggle-heading-collapse",e.collapseAllCmd="notebook:collapse-all-headings",e.expandAllCmd="notebook:expand-all-headings",e.copyToClipboard="notebook:copy-to-clipboard",e.invokeCompleter="completer:invoke-notebook",e.selectCompleter="completer:select-notebook",e.tocRunCells="toc:run-cells",e.accessPreviousHistory="notebook:access-previous-history-entry",e.accessNextHistory="notebook:access-next-history-entry",e.virtualScrollbar="notebook:toggle-virtual-scrollbar"}(W||(W={}));const q="Notebook",V=["notebook","python","custom"],$="jp-NotebookExtension-sideBySideMargins",z={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:v.INotebookTracker,requires:[v.INotebookWidgetFactory,i.IEditorExtensionRegistry,v.INotebookCellExecutor],optional:[l.ICommandPalette,m.IDefaultFileBrowser,p.ILauncher,n.ILayoutRestorer,C.IMainMenu,n.IRouter,w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator,S.IFormRendererRegistry,m.IFileBrowserFactory],activate:function(e,t,o,n,a,r,d,i,s,c,u,b,m,p,g){(0,v.setCellExecutor)(n);const C=null!=m?m:y.nullTranslator,k=null!=b?b:new l.SessionContextDialogs({translator:C}),h=C.load("jupyterlab"),f=e.serviceManager,{commands:w,shell:x}=e,_=new v.NotebookTracker({namespace:"notebook"});null==c||c.routed.connect((function(e,t){t.hash&&_.currentWidget&&_.currentWidget.setFragment(t.hash)}));const A=()=>Ce.isEnabled(x,_),E=e=>document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`);if((u?u.load(z.id):Promise.reject(new Error(`No setting registry for ${z.id}`))).then((t=>{P(t),t.changed.connect((()=>{P(t),w.notifyCommandChanged(W.virtualScrollbar)}));const n=(e,o)=>{const{newValue:n,oldValue:l}=o,a=n.autoStartDefault;"boolean"==typeof a&&a!==l.autoStartDefault&&a!==t.get("autoStartDefaultKernel").composite&&t.set("autoStartDefaultKernel",a).catch((e=>{console.error(`Failed to set ${t.id}.autoStartDefaultKernel`)}))},a=new WeakSet,r=e=>{const t=e.context.sessionContext;t.isDisposed||a.has(t)||(a.add(t),t.kernelPreferenceChanged.connect(n),t.disposed.connect((()=>{t.kernelPreferenceChanged.disconnect(n)})))};_.forEach(r),_.widgetAdded.connect(((e,t)=>{r(t)})),w.addCommand(W.autoClosingBrackets,{execute:e=>{var o;const n=t.get("codeCellConfig").composite,l=t.get("markdownCellConfig").composite,a=t.get("rawCellConfig").composite,r=n.autoClosingBrackets||l.autoClosingBrackets||a.autoClosingBrackets,d=!!(null!==(o=e.force)&&void 0!==o?o:!r);[n.autoClosingBrackets,l.autoClosingBrackets,a.autoClosingBrackets]=[d,d,d],t.set("codeCellConfig",n),t.set("markdownCellConfig",l),t.set("rawCellConfig",a)},label:h.__("Auto Close Brackets for All Notebook Cell Types"),isToggled:()=>["codeCellConfig","markdownCellConfig","rawCellConfig"].some((e=>{var n;return!0===(null!==(n=t.get(e).composite.autoClosingBrackets)&&void 0!==n?n:o.baseConfiguration.autoClosingBrackets)}))}),w.addCommand(W.setSideBySideRatio,{label:h.__("Set side-by-side ratio"),execute:e=>{l.InputDialog.getNumber({title:h.__("Width of the output in side-by-side mode"),value:t.get("sideBySideOutputRatio").composite}).then((e=>{E(e.value),e.value&&t.set("sideBySideOutputRatio",e.value)})).catch(console.error)}}),ge(e,_,C,k,t,A)})).catch((o=>{console.warn(o.message),B({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault}),ge(e,_,C,k,null,A)})),p){const e=p.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&(p.addRenderer("@jupyterlab/notebook-extension:tracker.codeCellConfig",e),p.addRenderer("@jupyterlab/notebook-extension:tracker.markdownCellConfig",e),p.addRenderer("@jupyterlab/notebook-extension:tracker.rawCellConfig",e))}i&&i.restore(_,{command:"docmanager:open",args:e=>({path:e.context.path,factory:q}),name:e=>e.context.path,when:f.ready});const M=e.docRegistry,T=new v.NotebookModelFactory({disableDocumentWideUndoRedo:t.notebookConfig.disableDocumentWideUndoRedo,collaborative:!0});M.addModelFactory(T),a&&function(e,t){const o=t.load("jupyterlab");let n=o.__("Notebook Operations");[W.interrupt,W.restart,W.restartClear,W.restartRunAll,W.runAll,W.renderAllMarkdown,W.runAllAbove,W.runAllBelow,W.restartAndRunToSelected,W.selectAll,W.deselectAll,W.clearAllOutputs,W.toggleAllLines,W.editMode,W.commandMode,W.changeKernel,W.reconnectToKernel,W.createConsole,W.closeAndShutdown,W.trust,W.toggleCollapseCmd,W.collapseAllCmd,W.expandAllCmd,W.accessPreviousHistory,W.accessNextHistory].forEach((t=>{e.addItem({command:t,category:n})})),e.addItem({command:W.createNew,category:n,args:{isPalette:!0}}),n=o.__("Notebook Cell Operations"),[W.run,W.runAndAdvance,W.runAndInsert,W.runInConsole,W.clearOutputs,W.toCode,W.toMarkdown,W.toRaw,W.cut,W.copy,W.pasteBelow,W.pasteAbove,W.pasteAndReplace,W.deleteCell,W.split,W.merge,W.mergeAbove,W.mergeBelow,W.insertAbove,W.insertBelow,W.selectAbove,W.selectBelow,W.selectHeadingAboveOrCollapse,W.selectHeadingBelowOrExpand,W.insertHeadingAbove,W.insertHeadingBelow,W.extendAbove,W.extendTop,W.extendBelow,W.extendBottom,W.moveDown,W.moveUp,W.undoCellAction,W.redoCellAction,W.markdown1,W.markdown2,W.markdown3,W.markdown4,W.markdown5,W.markdown6,W.hideCode,W.showCode,W.hideAllCode,W.showAllCode,W.hideOutput,W.showOutput,W.hideAllOutputs,W.showAllOutputs,W.toggleRenderSideBySideCurrentNotebook,W.setSideBySideRatio,W.enableOutputScrolling,W.disableOutputScrolling].forEach((t=>{e.addItem({command:t,category:n})}))}(a,C);let R=0;const O=e.docRegistry.getFileType("notebook");function B(e){_.forEach((t=>{t.setConfig(e)})),"full"!==e.notebookConfig.windowingMode&&_.forEach((e=>{e.content.scrollbar&&(e.content.scrollbar=!1)}))}function P(e){const o={...v.StaticNotebook.defaultEditorConfig.code,...e.get("codeCellConfig").composite},n={...v.StaticNotebook.defaultEditorConfig.markdown,...e.get("markdownCellConfig").composite},l={...v.StaticNotebook.defaultEditorConfig.raw,...e.get("rawCellConfig").composite};t.editorConfig={code:o,markdown:n,raw:l},t.notebookConfig={enableKernelInitNotification:e.get("enableKernelInitNotification").composite,showHiddenCellsButton:e.get("showHiddenCellsButton").composite,scrollPastEnd:e.get("scrollPastEnd").composite,defaultCell:e.get("defaultCell").composite,recordTiming:e.get("recordTiming").composite,overscanCount:e.get("overscanCount").composite,inputHistoryScope:e.get("inputHistoryScope").composite,maxNumberOutputs:e.get("maxNumberOutputs").composite,showEditorForReadOnlyMarkdown:e.get("showEditorForReadOnlyMarkdown").composite,disableDocumentWideUndoRedo:!e.get("documentWideUndoRedo").composite,renderingLayout:e.get("renderingLayout").composite,sideBySideLeftMarginOverride:e.get("sideBySideLeftMarginOverride").composite,sideBySideRightMarginOverride:e.get("sideBySideRightMarginOverride").composite,sideBySideOutputRatio:e.get("sideBySideOutputRatio").composite,windowingMode:e.get("windowingMode").composite,accessKernelHistory:e.get("accessKernelHistory").composite},E(t.notebookConfig.sideBySideOutputRatio);const a=`.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {\n margin-left: ${t.notebookConfig.sideBySideLeftMarginOverride} !important;\n margin-right: ${t.notebookConfig.sideBySideRightMarginOverride} !important;`,r=document.getElementById($);r?r.innerText=a:document.head.insertAdjacentHTML("beforeend",`<style id="${$}">${a}}</style>`),t.autoStartDefault=e.get("autoStartDefaultKernel").composite,t.shutdownOnClose=e.get("kernelShutdown").composite,T.disableDocumentWideUndoRedo=!e.get("documentWideUndoRedo").composite,B({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault})}return t.widgetCreated.connect(((e,t)=>{var o,n;t.id=t.id||"notebook-"+ ++R,t.title.icon=null==O?void 0:O.icon,t.title.iconClass=null!==(o=null==O?void 0:O.iconClass)&&void 0!==o?o:"",t.title.iconLabel=null!==(n=null==O?void 0:O.iconLabel)&&void 0!==n?n:"",t.context.pathChanged.connect((()=>{_.save(t)})),_.add(t)})),s&&function(e,t){e.editMenu.undoers.redo.add({id:W.redo,isEnabled:t}),e.editMenu.undoers.undo.add({id:W.undo,isEnabled:t}),e.editMenu.clearers.clearAll.add({id:W.clearAllOutputs,isEnabled:t}),e.editMenu.clearers.clearCurrent.add({id:W.clearOutputs,isEnabled:t}),e.fileMenu.consoleCreators.add({id:W.createConsole,isEnabled:t}),e.fileMenu.closeAndCleaners.add({id:W.closeAndShutdown,isEnabled:t}),e.kernelMenu.kernelUsers.changeKernel.add({id:W.changeKernel,isEnabled:t}),e.kernelMenu.kernelUsers.clearWidget.add({id:W.clearAllOutputs,isEnabled:t}),e.kernelMenu.kernelUsers.interruptKernel.add({id:W.interrupt,isEnabled:t}),e.kernelMenu.kernelUsers.reconnectToKernel.add({id:W.reconnectToKernel,isEnabled:t}),e.kernelMenu.kernelUsers.restartKernel.add({id:W.restart,isEnabled:t}),e.kernelMenu.kernelUsers.shutdownKernel.add({id:W.shutdown,isEnabled:t}),e.viewMenu.editorViewers.toggleLineNumbers.add({id:W.toggleAllLines,isEnabled:t}),e.runMenu.codeRunners.restart.add({id:W.restart,isEnabled:t}),e.runMenu.codeRunners.run.add({id:W.runAndAdvance,isEnabled:t}),e.runMenu.codeRunners.runAll.add({id:W.runAll,isEnabled:t}),e.helpMenu.getKernel.add({id:W.getKernel,isEnabled:t})}(s,A),w.addCommand(W.createNew,{label:e=>{var t,o,n;const l=e.kernelName||"";return e.isLauncher&&e.kernelName&&f.kernelspecs?null!==(n=null===(o=null===(t=f.kernelspecs.specs)||void 0===t?void 0:t.kernelspecs[l])||void 0===o?void 0:o.display_name)&&void 0!==n?n:"":e.isPalette||e.isContextMenu?h.__("New Notebook"):h.__("Notebook")},caption:h.__("Create a new notebook"),icon:e=>e.isPalette?void 0:S.notebookIcon,execute:e=>{var t,o;const n=null!==(t=null==g?void 0:g.tracker.currentWidget)&&void 0!==t?t:r;return(async(e,t,o)=>{const n=await w.execute("docmanager:new-untitled",{path:e,type:"notebook"});if(void 0!==n){const e=await w.execute("docmanager:open",{path:n.path,factory:q,kernel:{id:t,name:o}});return e.isUntitled=!0,e}})(e.cwd||(null!==(o=null==n?void 0:n.model.path)&&void 0!==o?o:""),e.kernelId||"",e.kernelName||"")}}),d&&f.ready.then((()=>{let e=null;const t=()=>{e&&(e.dispose(),e=null);const t=f.kernelspecs.specs;if(t){e=new I.DisposableSet;for(const o in t.kernelspecs){const n=o===t.default?0:1/0,l=t.kernelspecs[o],a=l.resources["logo-svg"]||l.resources["logo-64x64"];e.add(d.add({command:W.createNew,args:{isLauncher:!0,kernelName:o},category:h.__("Notebook"),rank:n,kernelIconUrl:a,metadata:{kernel:N.JSONExt.deepCopy(l.metadata||{})}}))}}};t(),f.kernelspecs.specsChanged.connect(t)})),_},autoStart:!0},J={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook cell factory.",provides:v.NotebookPanel.IContentFactory,requires:[r.IEditorServices],autoStart:!0,activate:(e,t)=>{const o=t.factoryService.newInlineEditor;return new v.NotebookPanel.ContentFactory({editorFactory:o})}},Y={activate:function(e,t,o,n,l,a,r){const d=a.load("jupyterlab"),i="notebook-tools",s=new v.NotebookTools({tracker:t,translator:a});return s.title.icon=S.buildIcon,s.title.caption=d.__("Notebook Tools"),s.id=i,M.MessageLoop.installMessageHook(s,((e,t)=>{switch(t.type){case"activate-request":l.save(i,{open:!0});break;case"after-hide":case"close-request":l.remove(i)}return!0})),r&&t.widgetAdded.connect(((e,t)=>{r.register(t).render(s)})),s},provides:v.INotebookTools,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,i.IEditorLanguageRegistry,x.IStateDB,y.ITranslator],optional:[h.IPropertyInspectorProvider]},G={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.CommandEditStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:a,align:"right",rank:4,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},X={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[v.INotebookTracker,n.ILabShell,y.ITranslator],optional:[_.IStatusBar,w.ISettingRegistry],activate:(e,t,o,n,l,a)=>{let r,d,i;const s=e=>{var a,s;let{showOnToolBar:c,showProgress:u}=e;if(c)i&&(o.currentChanged.disconnect(d),i.dispose());else{if(!l)return;(null==r?void 0:r.model)||(r=new v.ExecutionIndicator(n),d=(e,o)=>{const{newValue:n}=o;if(n&&t.has(n)){const e=n;r.model.attachNotebook({content:e.content,context:e.sessionContext})}},i=l.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:r,align:"left",rank:3,isActive:()=>{const e=o.currentWidget;return!!e&&t.has(e)}}),r.model.attachNotebook({content:null===(a=t.currentWidget)||void 0===a?void 0:a.content,context:null===(s=t.currentWidget)||void 0===s?void 0:s.sessionContext}),o.currentChanged.connect(d),r.disposed.connect((()=>{o.currentChanged.disconnect(d)}))),r.model.displayOption={showOnToolBar:c,showProgress:u}}};if(a){const t=a.load(z.id);Promise.all([t,e.restored]).then((([e])=>{s(v.ExecutionIndicator.getSettingValue(e)),e.changed.connect((e=>s(v.ExecutionIndicator.getSettingValue(e))))})).catch((e=>{console.error(e.message)}))}}},Q={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[y.ITranslator,v.INotebookTracker],optional:[C.IMainMenu,l.ICommandPalette],activate:(e,t,o,n,l)=>{var a;const r=t.load("jupyterlab"),{commands:i,shell:s}=e,c=e.serviceManager;let u;i.addCommand(W.exportToFormat,{label:e=>{if(void 0===e.label)return r.__("Save and Export Notebook to the given `format`.");const t=e.label;return e.isPalette?r.__("Save and Export Notebook: %1",t):t},execute:e=>{const t=pe(o,s,e);if(!t)return;const n=d.PageConfig.getNBConvertURL({format:e.format,download:!0,path:t.context.path}),{context:l}=t;return l.model.dirty&&!l.model.readOnly?l.save().then((()=>{window.open(n,"_blank","noopener")})):new Promise((e=>{window.open(n,"_blank","noopener"),e(void 0)}))},isEnabled:()=>Ce.isEnabled(s,o)}),n&&(u=null===(a=n.fileMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-file-notebookexport"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===a?void 0:a.submenu);let b=!1;const m=async()=>{if(b)return;o.widgetAdded.disconnect(m),b=!0;const e=await c.nbconvert.getExportFormats(!1);if(!e)return;const n=Ce.getFormatLabels(t);Object.keys(e).forEach((function(e){const t=r.__(e[0].toUpperCase()+e.substr(1)),o=n[e]?n[e]:t;let a={format:e,label:o,isPalette:!1};if(-1===V.indexOf(e)&&(u&&u.addItem({command:W.exportToFormat,args:a}),l)){a={format:e,label:o,isPalette:!0};const t=r.__("Notebook Operations");l.addItem({command:W.exportToFormat,category:t,args:a})}}))};o.widgetAdded.connect(m)}},Z={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.NotebookTrustStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:a,align:"right",rank:3,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},ee={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:v.INotebookWidgetFactory,requires:[v.NotebookPanel.IContentFactory,r.IEditorServices,f.IRenderMimeRegistry,l.IToolbarWidgetRegistry],optional:[w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator],activate:function(e,t,o,n,a,r,i,s){const c=null!=s?s:y.nullTranslator,b=null!=i?i:new l.SessionContextDialogs({translator:c}),m=d.PageConfig.getOption("notebookStartsKernel"),p=""===m||"true"===m.toLowerCase(),{commands:g}=e;let C;a.addFactory(q,"save",(e=>u.ToolbarItems.createSaveButton(g,e.context.fileChanged))),a.addFactory(q,"cellType",(e=>v.ToolbarItems.createCellTypeItem(e,c))),a.addFactory(q,"kernelName",(e=>l.Toolbar.createKernelNameItem(e.sessionContext,b,c))),a.addFactory(q,"executionProgress",(e=>{const t=null==r?void 0:r.load(z.id),o=v.ExecutionIndicator.createExecutionIndicatorItem(e,c,t);return null==t||t.then((t=>{e.disposed.connect((()=>{t.dispose()}))})),o})),r&&(C=(0,l.createToolbarFactory)(a,r,q,"@jupyterlab/notebook-extension:panel",c));const k=c.load("jupyterlab"),h=new v.NotebookWidgetFactory({name:q,label:k.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:p,canStartKernel:!0,rendermime:n,contentFactory:t,editorConfig:v.StaticNotebook.defaultEditorConfig,notebookConfig:v.StaticNotebook.defaultNotebookConfig,mimeTypeService:o.mimeTypeService,toolbarFactory:C,translator:c});return e.docRegistry.addWidgetFactory(h),h},autoStart:!0},te={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[c.IDocumentManager,v.INotebookTracker,y.ITranslator],optional:[n.ILayoutRestorer],activate:function(e,t,o,n,a){const r=n.load("jupyterlab"),d=new l.WidgetTracker({namespace:"cloned-outputs"});a&&a.restore(d,{command:W.createOutputView,args:e=>({path:e.content.path,index:e.content.index}),name:e=>`${e.content.path}:${e.content.index}`,when:o.restored});const{commands:i,shell:s}=e;i.addCommand(W.createOutputView,{label:r.__("Create New View for Cell Output"),execute:async e=>{var a;let r,i;const s=e.path;let c=e.index;if(s&&null!=c){if(i=t.findWidget(s,q),!i)return}else{if(i=o.currentWidget,!i)return;r=i.content.activeCell,c=i.content.activeCellIndex}const u=new Ce.ClonedOutputArea({notebook:i,cell:r,index:c,translator:n}),b=new l.MainAreaWidget({content:u});i.context.addSibling(b,{ref:i.id,mode:"split-bottom",type:"Cloned Output"});const m=()=>{d.save(b)};i.context.pathChanged.connect(m),null===(a=i.context.model)||void 0===a||a.cells.changed.connect(m),d.add(b),i.content.disposed.connect((()=>{var e;i.context.pathChanged.disconnect(m),null===(e=i.context.model)||void 0===e||e.cells.changed.disconnect(m),b.dispose()}))},isEnabled:()=>Ce.isEnabledAndSingleSelected(s,o)})},autoStart:!0},oe={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[v.INotebookTracker,y.ITranslator],activate:function(e,t,o){const n=o.load("jupyterlab"),{commands:l,shell:a}=e,r=()=>Ce.isEnabled(a,t);l.addCommand(W.createConsole,{label:n.__("New Console for Notebook"),execute:e=>{const o=t.currentWidget;if(o)return Ce.createConsole(l,o,e.activate)},isEnabled:r}),l.addCommand(W.runInConsole,{label:n.__("Run Selected Text or Current Line in Console"),execute:async e=>{var o,n;const a=t.currentWidget;if(!a)return;const{context:r,content:d}=a,i=d.activeCell,s=null==i?void 0:i.model.metadata,c=r.path;if(!i||"code"!==i.model.type)return;let u;const b=i.editor;if(!b)return;const m=b.getSelection(),{start:p,end:g}=m;if(p.column!==g.column||p.line!==g.line){const e=b.getOffsetAt(m.start),t=b.getOffsetAt(m.end);u=b.model.sharedModel.getSource().substring(e,t)}else{const e=b.getCursorPosition(),t=b.model.sharedModel.getSource().split("\n");let l=m.start.line;for(;l<b.lineCount&&!t[l].replace(/\s/g,"").length;)l+=1;let r=l>0,d=0,i=d+1;for(;;){u=t.slice(d,i).join("\n");const s=await(null===(n=null===(o=a.context.sessionContext.session)||void 0===o?void 0:o.kernel)||void 0===n?void 0:n.requestIsComplete({code:u+"\n\n"}));if("complete"===(null==s?void 0:s.content.status)){if(l<i){for(;i<b.lineCount&&!t[i].replace(/\s/g,"").length;)i+=1;b.setCursorPosition({line:i,column:e.column});break}d=i,i=d+1}else if(i<b.lineCount)i+=1;else{if(!r){for(u=t[l];l+1<b.lineCount&&!t[l+1].replace(/\s/g,"").length;)l+=1;b.setCursorPosition({line:l+1,column:e.column});break}d=l,i=l+1,r=!1}}}u&&(await l.execute("console:open",{activate:!1,insertMode:"split-bottom",path:c}),await l.execute("console:inject",{activate:!1,code:u,path:c,metadata:s}))},isEnabled:r})},autoStart:!0},ne={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:function(e,t,o){const n=t.load("jupyterlab");e.commands.addCommand(W.copyToClipboard,{label:n.__("Copy Output to Clipboard"),execute:e=>{var t;const n=null===(t=o.currentWidget)||void 0===t?void 0:t.content.activeCell;if(null==n)return;const l=n.outputArea.outputTracker.currentWidget;if(null==l)return;const a=l.node.getElementsByClassName("jp-OutputArea-output");a.length>0&&function(e){const t=window.getSelection();if(null==t)return;const o=[];for(let e=0;e<t.rangeCount;++e)o[e]=t.getRangeAt(e).cloneRange();const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),o.forEach((e=>t.addRange(e)))}(a[0])}}),e.contextMenu.addItem({command:W.copyToClipboard,selector:".jp-OutputArea-child",rank:0})},requires:[y.ITranslator,v.INotebookTracker],autoStart:!0},le={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(e,t,o)=>{o.addSessionProvider((e=>e&&t.has(e)?e.sessionContext:null))},requires:[v.INotebookTracker,l.IKernelStatusModel],autoStart:!0},ae={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(e,t,o)=>{let n=null;o.addEditorProvider((async e=>{let l=null;if(e!==n){if(null==n||n.content.activeCellChanged.disconnect(o.update),n=null,e&&t.has(e)){e.content.activeCellChanged.connect(o.update);const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor),n=e}}else if(e){const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor)}return l}))},requires:[v.INotebookTracker,r.IPositionModel],autoStart:!0},re={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[v.INotebookTracker],optional:[s.ICompletionProviderManager,y.ITranslator,l.ISanitizer],activate:function(e,t,o,n,a){if(!o)return;const r=(null!=n?n:y.nullTranslator).load("jupyterlab"),d=null!=a?a:new l.Sanitizer;e.commands.addCommand(W.invokeCompleter,{label:r.__("Display the completion helper."),execute:e=>{var n;const l=t.currentWidget;l&&"code"===(null===(n=l.content.activeCell)||void 0===n?void 0:n.model.type)&&o.invoke(l.id)}}),e.commands.addCommand(W.selectCompleter,{label:r.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:W.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const i=async(e,t)=>{var n,l;const a={editor:null!==(l=null===(n=t.content.activeCell)||void 0===n?void 0:n.editor)&&void 0!==l?l:null,session:t.sessionContext.session,widget:t,sanitizer:d};await o.updateCompleter(a),t.content.activeCellChanged.connect(((e,n)=>{null==n||n.ready.then((()=>{const e={editor:n.editor,session:t.sessionContext.session,widget:t,sanitizer:d};return o.updateCompleter(e)})).catch(console.error)})),t.sessionContext.sessionChanged.connect((()=>{var e;null===(e=t.content.activeCell)||void 0===e||e.ready.then((()=>{var e,n;const l={editor:null!==(n=null===(e=t.content.activeCell)||void 0===e?void 0:e.editor)&&void 0!==n?n:null,session:t.sessionContext.session,widget:t};return o.updateCompleter(l)})).catch(console.error)}))};t.widgetAdded.connect(i),o.activeProvidersChanged.connect((()=>{t.forEach((e=>{i(0,e).catch((e=>console.error(e)))}))}))},autoStart:!0},de={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[b.ISearchProviderRegistry],autoStart:!0,activate:(e,t)=>{t.add("jp-notebookSearchProvider",v.NotebookSearchProvider)}},ie={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[v.INotebookTracker,A.ITableOfContentsRegistry,l.ISanitizer],optional:[f.IMarkdownParser,w.ISettingRegistry],autoStart:!0,activate:(e,t,o,n,l,a)=>{const r=new v.NotebookToCFactory(t,l,n);o.add(r),a&&Promise.all([e.restored,a.load(z.id)]).then((([e,t])=>{const o=()=>{var e;r.scrollToTop=null===(e=t.composite.scrollHeadingToTop)||void 0===e||e};o(),t.changed.connect(o)})).catch((e=>{console.error("Failed to load notebook table of content settings.",e)}))}},se={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[v.INotebookTracker,g.ILSPDocumentConnectionManager,g.ILSPFeatureManager,g.ILSPCodeExtractorsManager,g.IWidgetLSPAdapterTracker],activate:function(e,t,o,n,l,a){t.widgetAdded.connect((async(e,t)=>{const r=new v.NotebookAdapter(t,{connectionManager:o,featureManager:n,foreignCodeExtractorsManager:l});a.add(r)}))},autoStart:!0},ce={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[v.INotebookTracker,k.IMetadataFormProvider,y.ITranslator],activate:(e,t,o,n)=>{const l=n.load("jupyterlab");let a=!1;t.widgetAdded.connect((async function r(){if(a)return;if(!o.get("commonToolsSection"))return;const d=o.get("commonToolsSection").getProperties("/raw_mimetype");if(!d)return;t.widgetAdded.disconnect(r),a=!0;const i=e.serviceManager,s=await i.nbconvert.getExportFormats(!1);if(!s)return;const c=Object.keys(s),u=Ce.getFormatLabels(n);c.forEach((function(e){var t;if(!((null===(t=d.oneOf)||void 0===t?void 0:t.filter((t=>t.const===e)).length)>0)){const t=l.__(e[0].toUpperCase()+e.substr(1)),o=u[e]?u[e]:t,n=s[e].output_mimetype;d.oneOf.push({const:n,title:o})}})),o.get("commonToolsSection").setProperties("/raw_mimetype",d)}))}},ue={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,S.IFormRendererRegistry],optional:[y.ITranslator],activate:(e,t,o,n,l)=>{const a=e=>o.factoryService.newInlineEditor(e),r={fieldRenderer:e=>new F({editorFactory:a,tracker:t,label:"Cell metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",r);const d={fieldRenderer:e=>new U({editorFactory:a,tracker:t,label:"Notebook metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},be={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[v.INotebookTracker,S.IFormRendererRegistry,i.IEditorLanguageRegistry],activate:(e,t,o,n)=>{const l={fieldRenderer:e=>new D({tracker:t,languages:n}).render(e)};o.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},me=[R,J,z,X,Q,Y,G,Z,ee,P,te,oe,ne,le,ae,re,de,ie,se,ce,ue,be];function pe(e,t,o){const n=e.currentWidget;return!1!==o.activate&&n&&t.activateById(n.id),n}function ge(e,t,o,n,r,d){var i;const s=o.load("jupyterlab"),{commands:c,shell:u}=e,b=()=>Ce.isEnabledAndSingleSelected(u,t);t.currentChanged.connect(((e,t)=>{var o,n;(null===(n=null===(o=null==t?void 0:t.content)||void 0===o?void 0:o.model)||void 0===n?void 0:n.cells)&&(t.content.model.cells.changed.connect(((e,o)=>{(e=>{var t,o;for(const n of e.widgets)n instanceof a.MarkdownCell&&n.headingCollapsed&&v.NotebookActions.setHeadingCollapse(n,!0,e),n.model.id===(null===(o=null===(t=e.activeCell)||void 0===t?void 0:t.model)||void 0===o?void 0:o.id)&&v.NotebookActions.expandParent(n,e)})(t.content)})),t.content.activeCellChanged.connect(((e,t)=>{v.NotebookActions.expandParent(t,e)})))})),t.selectionChanged.connect((()=>{c.notifyCommandChanged(W.duplicateBelow),c.notifyCommandChanged(W.deleteCell),c.notifyCommandChanged(W.copy),c.notifyCommandChanged(W.cut),c.notifyCommandChanged(W.pasteBelow),c.notifyCommandChanged(W.pasteAbove),c.notifyCommandChanged(W.pasteAndReplace),c.notifyCommandChanged(W.moveUp),c.notifyCommandChanged(W.moveDown),c.notifyCommandChanged(W.run),c.notifyCommandChanged(W.runAll),c.notifyCommandChanged(W.runAndAdvance),c.notifyCommandChanged(W.runAndInsert)})),t.activeCellChanged.connect((()=>{c.notifyCommandChanged(W.moveUp),c.notifyCommandChanged(W.moveDown)})),c.addCommand(W.runAndAdvance,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell","Run Selected Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run this cell and advance","Run these %1 cells and advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndAdvance(t,e.sessionContext,n,o)}},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.runIcon:void 0}),c.addCommand(W.run,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.run(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAndInsert,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndInsert(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAll,{label:s.__("Run All Cells"),caption:s.__("Run all cells"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAll(t,e.sessionContext,n,o)}},isEnabled:d}),c.addCommand(W.runAllAbove,{label:s.__("Run All Above Selected Cell"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllAbove(t,e.sessionContext,n,o)}},isEnabled:()=>b()&&0!==t.currentWidget.content.activeCellIndex}),c.addCommand(W.runAllBelow,{label:s.__("Run Selected Cell and All Below"),execute:e=>{const l=pe(t,u,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllBelow(t,e.sessionContext,n,o)}},isEnabled:()=>b()&&t.currentWidget.content.activeCellIndex!==t.currentWidget.content.widgets.length-1}),c.addCommand(W.renderAllMarkdown,{label:s.__("Render All Markdown Cells"),execute:e=>{const o=pe(t,u,e);if(o){const{content:e}=o;return v.NotebookActions.renderAllMarkdown(e)}},isEnabled:d}),c.addCommand(W.restart,{label:s.__("Restart Kernel…"),caption:s.__("Restart the kernel"),execute:e=>{const o=pe(t,u,e);if(o)return n.restart(o.sessionContext)},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.refreshIcon:void 0}),c.addCommand(W.shutdown,{label:s.__("Shut Down Kernel"),execute:e=>{const o=pe(t,u,e);if(o)return o.context.sessionContext.shutdown()},isEnabled:d}),c.addCommand(W.closeAndShutdown,{label:s.__("Close and Shut Down Notebook…"),execute:e=>{const o=pe(t,u,e);if(!o)return;const n=o.title.label;return(0,l.showDialog)({title:s.__("Shut down the notebook?"),body:s.__('Are you sure you want to close "%1"?',n),buttons:[l.Dialog.cancelButton(),l.Dialog.warnButton()]}).then((e=>{if(e.button.accept)return c.execute(W.shutdown,{activate:!1}).then((()=>{o.dispose()}))}))},isEnabled:d}),c.addCommand(W.trust,{label:()=>s.__("Trust Notebook"),execute:e=>{const o=pe(t,u,e);if(o){const{context:e,content:t}=o;return v.NotebookActions.trust(t).then((()=>e.save()))}},isEnabled:d}),c.addCommand(W.restartClear,{label:s.__("Restart Kernel and Clear Outputs of All Cells…"),caption:s.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{await c.execute(W.restart,{activate:!1})&&await c.execute(W.clearAllOutputs)},isEnabled:d}),c.addCommand(W.restartAndRunToSelected,{label:s.__("Restart Kernel and Run up to Selected Cell…"),execute:async e=>{const l=pe(t,u,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets.slice(0,r.activeCellIndex+1);return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:b}),c.addCommand(W.restartRunAll,{label:s.__("Restart Kernel and Run All Cells…"),caption:s.__("Restart the kernel and run all cells"),execute:async e=>{const l=pe(t,u,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets;return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.fastForwardIcon:void 0}),c.addCommand(W.clearAllOutputs,{label:s.__("Clear Outputs of All Cells"),caption:s.__("Clear all outputs of all cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.clearAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.clearOutputs,{label:s.__("Clear Cell Output"),caption:s.__("Clear outputs for the selected cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.clearOutputs(o.content)},isEnabled:d}),c.addCommand(W.interrupt,{label:s.__("Interrupt Kernel"),caption:s.__("Interrupt the kernel"),execute:e=>{var o;const n=pe(t,u,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.interrupt():void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.stopIcon:void 0}),c.addCommand(W.toCode,{label:s.__("Change to Code Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"code",o)},isEnabled:d}),c.addCommand(W.toMarkdown,{label:s.__("Change to Markdown Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"markdown",o)},isEnabled:d}),c.addCommand(W.toRaw,{label:s.__("Change to Raw Cell Type"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.changeCellType(n.content,"raw",o)},isEnabled:d}),c.addCommand(W.cut,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Cut Cell","Cut Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Cut this cell","Cut these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.cut(o.content)},icon:e=>e.toolbar?S.cutIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.copy,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Copy Cell","Copy Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Copy this cell","Copy these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.copy(o.content)},icon:e=>e.toolbar?S.copyIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteBelow,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell Below","Paste Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"below")},icon:e=>e.toolbar?S.pasteIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteAbove,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell Above","Paste Cells Above",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"above")},isEnabled:d}),c.addCommand(W.duplicateBelow,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Duplicate Cell Below","Duplicate Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&v.NotebookActions.duplicate(o.content,"belowSelected")},icon:e=>e.toolbar?S.duplicateIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.pasteAndReplace,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Paste Cell and Replace","Paste Cells and Replace",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.paste(o.content,"replace")},isEnabled:d}),c.addCommand(W.deleteCell,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Delete Cell","Delete Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Delete this cell","Delete these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.deleteCells(o.content)},isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.split,{label:s.__("Split Cell"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.splitCell(o.content)},isEnabled:d}),c.addCommand(W.merge,{label:s.__("Merge Selected Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content)},isEnabled:d}),c.addCommand(W.mergeAbove,{label:s.__("Merge Cell Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content,!0)},isEnabled:d}),c.addCommand(W.mergeBelow,{label:s.__("Merge Cell Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.mergeCells(o.content,!1)},isEnabled:d}),c.addCommand(W.insertAbove,{label:s.__("Insert Cell Above"),caption:s.__("Insert a cell above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertAbove(o.content)},icon:e=>e.toolbar?S.addAboveIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.insertBelow,{label:s.__("Insert Cell Below"),caption:s.__("Insert a cell below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertBelow(o.content)},icon:e=>e.toolbar?S.addBelowIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),c.addCommand(W.selectAbove,{label:s.__("Select Cell Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectAbove(o.content)},isEnabled:d}),c.addCommand(W.selectBelow,{label:s.__("Select Cell Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectBelow(o.content)},isEnabled:d}),c.addCommand(W.insertHeadingAbove,{label:s.__("Insert Heading Above Current Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertSameLevelHeadingAbove(o.content)},isEnabled:d}),c.addCommand(W.insertHeadingBelow,{label:s.__("Insert Heading Below Current Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.insertSameLevelHeadingBelow(o.content)},isEnabled:d}),c.addCommand(W.selectHeadingAboveOrCollapse,{label:s.__("Select Heading Above or Collapse Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectHeadingAboveOrCollapseHeading(o.content)},isEnabled:d}),c.addCommand(W.selectHeadingBelowOrExpand,{label:s.__("Select Heading Below or Expand Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectHeadingBelowOrExpandHeading(o.content)},isEnabled:d}),c.addCommand(W.extendAbove,{label:s.__("Extend Selection Above"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content)},isEnabled:d}),c.addCommand(W.extendTop,{label:s.__("Extend Selection to Top"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content,!0)},isEnabled:d}),c.addCommand(W.extendBelow,{label:s.__("Extend Selection Below"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content)},isEnabled:d}),c.addCommand(W.extendBottom,{label:s.__("Extend Selection to Bottom"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content,!0)},isEnabled:d}),c.addCommand(W.selectAll,{label:s.__("Select All Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectAll(o.content)},isEnabled:d}),c.addCommand(W.deselectAll,{label:s.__("Deselect All Cells"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.deselectAll(o.content)},isEnabled:d}),c.addCommand(W.moveUp,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move Cell Up","Move Cells Up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move this cell up","Move these %1 cells up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&(v.NotebookActions.moveUp(o.content),Ce.raiseSilentNotification(s.__("Notebook cell shifted up successfully"),o.node))},isEnabled:e=>{const o=pe(t,u,{...e,activate:!1});return!!o&&o.content.activeCellIndex>=1},icon:e=>e.toolbar?S.moveUpIcon:void 0}),c.addCommand(W.moveDown,{label:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move Cell Down","Move Cells Down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=pe(t,u,{...e,activate:!1});return s._n("Move this cell down","Move these %1 cells down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=pe(t,u,e);o&&(v.NotebookActions.moveDown(o.content),Ce.raiseSilentNotification(s.__("Notebook cell shifted down successfully"),o.node))},isEnabled:e=>{const o=pe(t,u,{...e,activate:!1});if(!o||!o.content.model)return!1;const n=o.content.model.cells.length;return o.content.activeCellIndex<n-1},icon:e=>e.toolbar?S.moveDownIcon:void 0}),c.addCommand(W.toggleAllLines,{label:s.__("Show Line Numbers"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.toggleAllLineNumbers(o.content)},isEnabled:d,isToggled:e=>{const o=pe(t,u,{...e,activate:!1});if(o){const e=o.content.editorConfig;return!!(e.code.lineNumbers&&e.markdown.lineNumbers&&e.raw.lineNumbers)}return!1}}),c.addCommand(W.commandMode,{label:s.__("Enter Command Mode"),execute:e=>{const o=pe(t,u,e);o&&(o.content.mode="command")},isEnabled:d}),c.addCommand(W.editMode,{label:s.__("Enter Edit Mode"),execute:e=>{const o=pe(t,u,e);o&&(o.content.mode="edit")},isEnabled:d}),c.addCommand(W.undoCellAction,{label:s.__("Undo Cell Operation"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.undo(o.content)},isEnabled:d}),c.addCommand(W.redoCellAction,{label:s.__("Redo Cell Operation"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.redo(o.content)},isEnabled:d}),c.addCommand(W.redo,{label:s.__("Redo"),execute:e=>{var o;const n=pe(t,u,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.redo()}}}),c.addCommand(W.undo,{label:s.__("Undo"),execute:e=>{var o;const n=pe(t,u,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.undo()}}}),c.addCommand(W.changeKernel,{label:s.__("Change Kernel…"),execute:e=>{const o=pe(t,u,e);if(o)return n.selectKernel(o.context.sessionContext)},isEnabled:d}),c.addCommand(W.getKernel,{label:s.__("Get Kernel"),execute:e=>{var o;const n=pe(t,u,{activate:!1,...e});if(n)return null===(o=n.sessionContext.session)||void 0===o?void 0:o.kernel},isEnabled:d}),c.addCommand(W.reconnectToKernel,{label:s.__("Reconnect to Kernel"),execute:e=>{var o;const n=pe(t,u,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.reconnect():void 0},isEnabled:d}),c.addCommand(W.markdown1,{label:s.__("Change to Heading 1"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,1,o)},isEnabled:d}),c.addCommand(W.markdown2,{label:s.__("Change to Heading 2"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,2,o)},isEnabled:d}),c.addCommand(W.markdown3,{label:s.__("Change to Heading 3"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,3,o)},isEnabled:d}),c.addCommand(W.markdown4,{label:s.__("Change to Heading 4"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,4,o)},isEnabled:d}),c.addCommand(W.markdown5,{label:s.__("Change to Heading 5"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,5,o)},isEnabled:d}),c.addCommand(W.markdown6,{label:s.__("Change to Heading 6"),execute:e=>{const n=pe(t,u,e);if(n)return v.NotebookActions.setMarkdownHeader(n.content,6,o)},isEnabled:d}),c.addCommand(W.hideCode,{label:s.__("Collapse Selected Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideCode(o.content)},isEnabled:d}),c.addCommand(W.showCode,{label:s.__("Expand Selected Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showCode(o.content)},isEnabled:d}),c.addCommand(W.hideAllCode,{label:s.__("Collapse All Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideAllCode(o.content)},isEnabled:d}),c.addCommand(W.showAllCode,{label:s.__("Expand All Code"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showAllCode(o.content)},isEnabled:d}),c.addCommand(W.hideOutput,{label:s.__("Collapse Selected Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideOutput(o.content)},isEnabled:d}),c.addCommand(W.showOutput,{label:s.__("Expand Selected Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showOutput(o.content)},isEnabled:d}),c.addCommand(W.hideAllOutputs,{label:s.__("Collapse All Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.hideAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.toggleRenderSideBySideCurrentNotebook,{label:s.__("Render Side-by-Side"),execute:e=>{const o=pe(t,u,e);if(o)return"side-by-side"===o.content.renderingLayout?v.NotebookActions.renderDefault(o.content):v.NotebookActions.renderSideBySide(o.content)},isEnabled:d,isToggled:e=>{const o=pe(t,u,{...e,activate:!1});return!!o&&"side-by-side"===o.content.renderingLayout}}),c.addCommand(W.showAllOutputs,{label:s.__("Expand All Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.showAllOutputs(o.content)},isEnabled:d}),c.addCommand(W.enableOutputScrolling,{label:s.__("Enable Scrolling for Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.enableOutputScrolling(o.content)},isEnabled:d}),c.addCommand(W.disableOutputScrolling,{label:s.__("Disable Scrolling for Outputs"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.disableOutputScrolling(o.content)},isEnabled:d}),c.addCommand(W.selectLastRunCell,{label:s.__("Select current running or last run cell"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.selectLastRunCell(o.content)},isEnabled:d}),c.addCommand(W.replaceSelection,{label:s.__("Replace Selection in Notebook Cell"),execute:e=>{const o=pe(t,u,e),n=e.text||"";if(o)return v.NotebookActions.replaceSelection(o.content,n)},isEnabled:d}),c.addCommand(W.toggleCollapseCmd,{label:s.__("Toggle Collapse Notebook Heading"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.toggleCurrentHeadingCollapse(o.content)},isEnabled:()=>Ce.isEnabledAndHeadingSelected(u,t)}),c.addCommand(W.collapseAllCmd,{label:s.__("Collapse All Headings"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.collapseAllHeadings(o.content)}}),c.addCommand(W.expandAllCmd,{label:s.__("Expand All Headings"),execute:e=>{const o=pe(t,u,e);if(o)return v.NotebookActions.expandAllHeadings(o.content)}}),c.addCommand(W.tocRunCells,{label:s.__("Select and Run Cell(s) for this Heading"),execute:e=>{const l=pe(t,u,{activate:!1,...e});if(null===l)return;const r=l.content.activeCell;let d=l.content.activeCellIndex;if(r instanceof a.MarkdownCell){const e=l.content.widgets,t=r.headingInfo.level;for(let o=l.content.activeCellIndex+1;o<e.length;o++){const n=e[o];if(n instanceof a.MarkdownCell&&n.headingInfo.level>=0&&n.headingInfo.level<=t)break;d=o}}l.content.extendContiguousSelectionTo(d),v.NotebookActions.run(l.content,l.sessionContext,n,o)}}),c.addCommand(W.accessPreviousHistory,{label:s.__("Access Previous Kernel History Entry"),execute:async e=>{const o=pe(t,u,e);if(o)return await v.NotebookActions.accessPreviousHistory(o.content)}}),c.addCommand(W.accessNextHistory,{label:s.__("Access Next Kernel History Entry"),execute:async e=>{const o=pe(t,u,e);if(o)return await v.NotebookActions.accessNextHistory(o.content)}}),c.addCommand(W.virtualScrollbar,{label:s.__("Virtual Scrollbar"),caption:s.__("Toggle virtual scrollbar (enabled with windowing mode: full)"),execute:e=>{const o=pe(t,u,e);o&&(o.content.scrollbar=!o.content.scrollbar)},icon:e=>e.toolbar?S.tableRowsIcon:void 0,isEnabled:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t},isVisible:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t}});const m=[W.createNew,W.createOutputView],p=()=>{Object.values(W).filter((t=>!m.includes(t)&&e.commands.hasCommand(t))).forEach((t=>e.commands.notifyCommandChanged(t)))};t.currentChanged.connect(p),null===(i=u.currentChanged)||void 0===i||i.connect(p)}var Ce;!function(e){e.createConsole=function(e,t,o){const n={path:t.context.path,preferredLanguage:t.context.model.defaultKernelLanguage,activate:o,ref:t.id,insertMode:"split-bottom",type:"Linked Console"};return e.execute("console:create",n)},e.isEnabled=function(e,t){return null!==t.currentWidget&&t.currentWidget===e.currentWidget},e.isEnabledAndSingleSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.isEnabledAndHeadingSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;if(!(n.activeCell instanceof a.MarkdownCell))return!1;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.getFormatLabels=function(e){const t=(e=e||y.nullTranslator).load("jupyterlab");return{html:t.__("HTML"),latex:t.__("LaTeX"),markdown:t.__("Markdown"),pdf:t.__("PDF"),rst:t.__("ReStructured Text"),script:t.__("Executable Script"),slides:t.__("Reveal.js Slides")}},e.raiseSilentNotification=function(e,t){const o=`sr-message-container-${t.id}`,n=document.getElementById(o)||document.createElement("div");n.getAttribute("id")!==o&&(n.classList.add("sr-only"),n.setAttribute("id",o),n.setAttribute("role","alert"),n.hidden=!0,t.appendChild(n)),n.innerText=e};class t extends T.Panel{constructor(e){super(),this._cell=null;const t=(e.translator||y.nullTranslator).load("jupyterlab");this._notebook=e.notebook,this._index=void 0!==e.index?e.index:-1,this._cell=e.cell||null,this.id=`LinkedOutputView-${N.UUID.uuid4()}`,this.title.label="Output View",this.title.icon=S.notebookIcon,this.title.caption=this._notebook.title.label?t.__("For Notebook: %1",this._notebook.title.label):t.__("For Notebook:"),this.addClass("jp-LinkedOutputView"),this._notebook.context.ready.then((()=>{if(this._cell||(this._cell=this._notebook.content.widgets[this._index]),!this._cell||"code"!==this._cell.model.type)return void this.dispose();const e=this._cell.cloneOutputArea();this.addWidget(e)}))}get index(){return this._cell?E.ArrayExt.findFirstIndex(this._notebook.content.widgets,(e=>e===this._cell)):this._index}get path(){return this._notebook.context.path}}e.ClonedOutputArea=t}(Ce||(Ce={}))}}]);