notebook 7.1.0rc1__py3-none-any.whl → 7.1.2__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (192) hide show
  1. notebook/__init__.py +1 -1
  2. notebook/_version.py +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/131.bundle.js +1 -1
  5. notebook/static/1337.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1388.bundle.js +1 -1
  8. notebook/static/1408.bundle.js +1 -1
  9. notebook/static/1495.bundle.js +1 -1
  10. notebook/static/1496.bundle.js +1 -1
  11. notebook/static/1647.bundle.js +1 -1
  12. notebook/static/1650.bundle.js +1 -1
  13. notebook/static/1664.bundle.js +17 -17
  14. notebook/static/1682.bundle.js +1 -1
  15. notebook/static/1684.bundle.js +1 -1
  16. notebook/static/1809.bundle.js +1 -1
  17. notebook/static/1827.bundle.js +1 -1
  18. notebook/static/1833.bundle.js +1 -1
  19. notebook/static/1835.bundle.js +1 -1
  20. notebook/static/1846.bundle.js +1 -1
  21. notebook/static/1950.bundle.js +1 -1
  22. notebook/static/1958.bundle.js +1 -1
  23. notebook/static/2007.bundle.js +1 -1
  24. notebook/static/2067.bundle.js +1 -1
  25. notebook/static/2088.bundle.js +1 -1
  26. notebook/static/2089.bundle.js +1 -1
  27. notebook/static/2122.bundle.js +1 -1
  28. notebook/static/214.bundle.js +1 -1
  29. notebook/static/2167.bundle.js +1 -1
  30. notebook/static/2184.bundle.js +1 -1
  31. notebook/static/2241.bundle.js +1 -1
  32. notebook/static/2311.bundle.js +1 -1
  33. notebook/static/2324.bundle.js +1 -1
  34. notebook/static/2401.bundle.js +1 -1
  35. notebook/static/2479.bundle.js +1 -1
  36. notebook/static/2489.bundle.js +1 -1
  37. notebook/static/2512.bundle.js +1 -1
  38. notebook/static/2520.bundle.js +1 -1
  39. notebook/static/2577.bundle.js +1 -1
  40. notebook/static/2607.bundle.js +1 -1
  41. notebook/static/261.bundle.js +1 -1
  42. notebook/static/2615.bundle.js +1 -1
  43. notebook/static/2692.bundle.js +1 -1
  44. notebook/static/2924.bundle.js +1 -1
  45. notebook/static/2944.bundle.js +1 -1
  46. notebook/static/3129.bundle.js +1 -1
  47. notebook/static/3146.bundle.js +1 -1
  48. notebook/static/3154.bundle.js +1 -1
  49. notebook/static/3187.bundle.js +1 -1
  50. notebook/static/3213.bundle.js +1 -1
  51. notebook/static/3340.bundle.js +1 -1
  52. notebook/static/3360.bundle.js +1 -1
  53. notebook/static/3466.bundle.js +1 -1
  54. notebook/static/3488.bundle.js +1 -1
  55. notebook/static/3512.bundle.js +1 -1
  56. notebook/static/3654.bundle.js +1 -1
  57. notebook/static/3676.bundle.js +1 -1
  58. notebook/static/3680.bundle.js +1 -1
  59. notebook/static/3768.bundle.js +1 -1
  60. notebook/static/377.bundle.js +1 -1
  61. notebook/static/3863.bundle.js +1 -1
  62. notebook/static/3881.bundle.js +1 -1
  63. notebook/static/4035.bundle.js +1 -1
  64. notebook/static/4042.bundle.js +1 -1
  65. notebook/static/4212.bundle.js +1 -1
  66. notebook/static/4382.bundle.js +1 -1
  67. notebook/static/4558.bundle.js +1 -1
  68. notebook/static/4630.bundle.js +1 -1
  69. notebook/static/4645.bundle.js +1 -1
  70. notebook/static/4811.bundle.js +1 -1
  71. notebook/static/4837.bundle.js +1 -1
  72. notebook/static/5088.bundle.js +1 -1
  73. notebook/static/5099.bundle.js +1 -1
  74. notebook/static/5135.bundle.js +1 -1
  75. notebook/static/514.bundle.js +1 -1
  76. notebook/static/5263.bundle.js +1 -0
  77. notebook/static/5313.bundle.js +1 -1
  78. notebook/static/5325.bundle.js +1 -1
  79. notebook/static/5346.bundle.js +1 -1
  80. notebook/static/5426.bundle.js +1 -1
  81. notebook/static/5573.bundle.js +1 -1
  82. notebook/static/5601.bundle.js +1 -1
  83. notebook/static/5649.bundle.js +3 -3
  84. notebook/static/5733.bundle.js +1 -1
  85. notebook/static/5912.bundle.js +1 -1
  86. notebook/static/5921.bundle.js +1 -1
  87. notebook/static/6017.bundle.js +1 -1
  88. notebook/static/6139.bundle.js +1 -1
  89. notebook/static/62.bundle.js +1 -1
  90. notebook/static/6256.bundle.js +1 -1
  91. notebook/static/6281.bundle.js +1 -1
  92. notebook/static/6345.bundle.js +1 -1
  93. notebook/static/6417.bundle.js +1 -1
  94. notebook/static/6604.bundle.js +1 -1
  95. notebook/static/6621.bundle.js +1 -1
  96. notebook/static/6627.bundle.js +1 -1
  97. notebook/static/6640.bundle.js +1 -1
  98. notebook/static/6667.bundle.js +1 -1
  99. notebook/static/6815.bundle.js +1 -1
  100. notebook/static/6893.bundle.js +1 -1
  101. notebook/static/690.bundle.js +1 -1
  102. notebook/static/6962.bundle.js +1 -1
  103. notebook/static/6999.bundle.js +1 -1
  104. notebook/static/{1608.bundle.js → 7005.bundle.js} +1 -1
  105. notebook/static/7097.bundle.js +1 -1
  106. notebook/static/7153.bundle.js +1 -1
  107. notebook/static/7226.bundle.js +1 -1
  108. notebook/static/7252.bundle.js +1 -1
  109. notebook/static/7302.bundle.js +1 -1
  110. notebook/static/7386.bundle.js +1 -1
  111. notebook/static/7391.bundle.js +1 -1
  112. notebook/static/7394.bundle.js +1 -1
  113. notebook/static/7427.bundle.js +1 -1
  114. notebook/static/755.bundle.js +1 -1
  115. notebook/static/7603.bundle.js +1 -1
  116. notebook/static/7639.bundle.js +1 -1
  117. notebook/static/7684.bundle.js +1 -1
  118. notebook/static/7811.bundle.js +1 -1
  119. notebook/static/7812.bundle.js +1 -1
  120. notebook/static/7819.bundle.js +1 -1
  121. notebook/static/7900.bundle.js +1 -1
  122. notebook/static/7906.bundle.js +1 -1
  123. notebook/static/7995.bundle.js +1 -1
  124. notebook/static/853.bundle.js +1 -0
  125. notebook/static/8579.bundle.js +1 -1
  126. notebook/static/8633.bundle.js +1 -1
  127. notebook/static/8768.bundle.js +1 -1
  128. notebook/static/8771.bundle.js +1 -1
  129. notebook/static/8781.bundle.js +1 -1
  130. notebook/static/8801.bundle.js +1 -1
  131. notebook/static/8875.bundle.js +1 -1
  132. notebook/static/8907.bundle.js +1 -1
  133. notebook/static/8928.bundle.js +1 -1
  134. notebook/static/893.bundle.js +1 -1
  135. notebook/static/901.bundle.js +1 -1
  136. notebook/static/9068.bundle.js +1 -1
  137. notebook/static/9151.bundle.js +1 -1
  138. notebook/static/9161.bundle.js +1 -1
  139. notebook/static/9268.bundle.js +1 -1
  140. notebook/static/9335.bundle.js +1 -1
  141. notebook/static/9341.bundle.js +1 -1
  142. notebook/static/9380.bundle.js +1 -1
  143. notebook/static/9605.bundle.js +1 -1
  144. notebook/static/9638.bundle.js +1 -1
  145. notebook/static/9680.bundle.js +1 -1
  146. notebook/static/9685.bundle.js +1 -1
  147. notebook/static/9752.bundle.js +1 -1
  148. notebook/static/9821.bundle.js +1 -1
  149. notebook/static/9852.bundle.js +1 -1
  150. notebook/static/9866.bundle.js +1 -1
  151. notebook/static/bundle.js +1 -1
  152. notebook/static/third-party-licenses.json +99 -99
  153. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  154. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  155. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  156. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  157. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  158. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  159. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  160. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/913.ed31b967ed65df80c2cf.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/246.7bfc2ac5bb3d27d6e0b9.js +1 -1
  161. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.7c69f17d842172804b2c.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6e8d43b976f4be45b3d2.js +1 -1
  162. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.bf68c8ab6c905f205d45.js → notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.65b9457e7bb7d428c0a7.js +1 -1
  163. notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.832d780237fca436ff92.js +1 -0
  164. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  165. {notebook-7.1.0rc1.dist-info → notebook-7.1.2.dist-info}/METADATA +2 -2
  166. {notebook-7.1.0rc1.dist-info → notebook-7.1.2.dist-info}/RECORD +189 -189
  167. notebook/static/4131.bundle.js +0 -1
  168. notebook/static/6853.bundle.js +0 -1
  169. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.de9e68f80570f96cb86a.js +0 -1
  170. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  171. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  172. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  173. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  174. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  175. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  176. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  177. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  178. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  179. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  180. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  181. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  182. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  183. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  184. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  185. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  186. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  187. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  188. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  189. {notebook-7.1.0rc1.data → notebook-7.1.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  190. {notebook-7.1.0rc1.dist-info → notebook-7.1.2.dist-info}/WHEEL +0 -0
  191. {notebook-7.1.0rc1.dist-info → notebook-7.1.2.dist-info}/entry_points.txt +0 -0
  192. {notebook-7.1.0rc1.dist-info → notebook-7.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1682,5135],{21682:(n,e,t)=>{t.r(e),t.d(e,{CommandIDs:()=>h,default:()=>p});var s=t(17260),o=t(47005),i=t(42539),l=t(70397),a=t(70788),r=t(97934),d=t(81997);const c="jp-mod-kernel";var u;!function(n){n.RunningKernel=class{constructor(n){this.className=c,this.commands=n.commands,this.kernel=n.kernel,this.context=this.kernel.id,this.kernels=n.kernels,this.sessions=n.sessions,this.spec=n.spec||null,this.trans=n.trans}get children(){var n;const e=[],t=h.kernelOpenSession,{commands:s}=this;for(const o of this.sessions.running())if(this.kernel.id===(null===(n=o.kernel)||void 0===n?void 0:n.id)){const{name:n,path:i,type:a}=o;e.push({className:c,context:this.kernel.id,open:()=>{s.execute(t,{name:n,path:i,type:a})},icon:()=>"console"===a?l.consoleIcon:"notebook"===a?l.notebookIcon:l.jupyterIcon,label:()=>n,labelTitle:()=>i})}return e}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){const{spec:n}=this;return n&&n.resources?n.resources["logo-svg"]||n.resources["logo-64x64"]||n.resources["logo-32x32"]:l.jupyterIcon}label(){const{kernel:n,spec:e}=this;return(null==e?void 0:e.display_name)||n.name}labelTitle(){var n;const{trans:e}=this,{id:t}=this.kernel,s=[`${this.label()}: ${t}`];for(const t of this.sessions.running())if(this.kernel.id===(null===(n=t.kernel)||void 0===n?void 0:n.id)){const{path:n,type:o}=t;s.push(e.__("%1\nPath: %2",o,n))}return s.join("\n\n")}},n.runningChanged=new d.Signal({})}(u||(u={}));var h,g=t(57526);class m{constructor(n){this._tabsChanged=new d.Signal(this),this._widgets=[],this._labShell=n,this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(n){n.title.changed.connect(this._emitTabsChanged,this),this._widgets.push(n)}_emitTabsChanged(){this._widgets.forEach((n=>{n.title.changed.disconnect(this._emitTabsChanged,this)})),this._widgets=[],this._tabsChanged.emit(void 0)}}!function(n){n.kernelNewConsole="running:kernel-new-console",n.kernelNewNotebook="running:kernel-new-notebook",n.kernelOpenSession="running:kernel-open-session",n.kernelShutDown="running:kernel-shut-down",n.showPanel="running:show-panel"}(h||(h={}));const p={activate:function(n,e,t,s){const i=e.load("jupyterlab"),d=new o.RunningSessionManagers,p=new o.RunningSessions(d,e);return p.id="jp-running-sessions",p.title.caption=i.__("Running Terminals and Kernels"),p.title.icon=l.runningIcon,p.node.setAttribute("role","region"),p.node.setAttribute("aria-label",i.__("Running Sessions section")),t&&t.add(p,"running-sessions"),s&&function(n,e,t){const s=new m(t),o=e.load("jupyterlab");n.add({name:o.__("Open Tabs"),running:()=>Array.from(t.widgets("main")).map((n=>(s.addWidget(n),new i(n)))),shutdownAll:()=>{for(const n of t.widgets("main"))n.close()},refreshRunning:()=>{},runningChanged:s.tabsChanged,shutdownLabel:o.__("Close"),shutdownAllLabel:o.__("Close All"),shutdownAllConfirmationText:o.__("Are you sure you want to close all open tabs?")});class i{constructor(n){this._widget=n}open(){t.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const n=this._widget.title.icon;return n instanceof l.LabIcon?n:l.fileIcon}label(){return this._widget.title.label}labelTitle(){let n;return n=this._widget instanceof g.DocumentWidget?this._widget.context.path:this._widget.title.label,n}}}(d,e,s),async function(n,e,t){const{commands:s,contextMenu:o,serviceManager:i}=t,{kernels:d,kernelspecs:g,sessions:m}=i,{runningChanged:p,RunningKernel:w}=u,_=new r.Throttler((()=>p.emit(void 0)),100),b=e.load("jupyterlab");d.runningChanged.connect((()=>{_.invoke()})),m.runningChanged.connect((()=>{_.invoke()})),await Promise.all([d.ready,g.ready,m.ready]),n.add({name:b.__("Kernels"),running:()=>Array.from(d.running()).map((n=>{var e;return new w({commands:s,kernel:n,kernels:d,sessions:m,spec:null===(e=g.specs)||void 0===e?void 0:e.kernelspecs[n.name],trans:b})})),shutdownAll:()=>d.shutdownAll(),refreshRunning:()=>Promise.all([d.refreshRunning(),m.refreshRunning()]),runningChanged:p,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:b.__("Are you sure you want to permanently shut down all running kernels?")});const k=n=>n.classList.contains(c);s.addCommand(h.kernelNewConsole,{icon:l.consoleIcon,label:b.__("New Console for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("console:create",{kernelPreference:{id:i}})}}),s.addCommand(h.kernelNewNotebook,{icon:l.notebookIcon,label:b.__("New Notebook for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("notebook:create-new",{kernelId:i})}}),s.addCommand(h.kernelOpenSession,{icon:n=>"console"===n.type?l.consoleIcon:"notebook"===n.type?l.notebookIcon:void 0,isEnabled:({path:n,type:e})=>!!e||void 0!==n,label:({name:n,path:e})=>n||a.PathExt.basename(e||b.__("Unknown Session")),execute:({path:n,type:e})=>{if(!e||void 0===n)return;const t="console"===e?"console:open":"docmanager:open";return s.execute(t,{path:n})}}),s.addCommand(h.kernelShutDown,{icon:l.closeIcon,label:b.__("Shut Down Kernel"),execute:n=>{var e;const s=t.contextMenuHitTest(k),o=null!==(e=n.id)&&void 0!==e?e:null==s?void 0:s.dataset.context;if(o)return d.shutdown(o)}});const v=[];o.opened.connect((async()=>{var n,e,s;const i=null!==(e=null===(n=o.menu.items.find((n=>{var e;return"submenu"===n.type&&"jp-contextmenu-connected-sessions"===(null===(e=n.submenu)||void 0===e?void 0:e.id)})))||void 0===n?void 0:n.submenu)&&void 0!==e?e:null;if(!i)return;v.forEach((n=>n.dispose())),v.length=0,i.clearItems();const l=t.contextMenuHitTest(k),a=null==l?void 0:l.dataset.context;if(!a)return;const r=h.kernelOpenSession;for(const n of m.running())if(a===(null===(s=n.kernel)||void 0===s?void 0:s.id)){const{name:e,path:t,type:s}=n;v.push(i.addItem({command:r,args:{name:e,path:t,type:s}}))}}))}(d,e,n),n.shell.add(p,"left",{rank:200,type:"Sessions and Tabs"}),n.commands.addCommand(h.showPanel,{label:i.__("Sessions and Tabs"),execute:()=>{n.shell.activateById(p.id)}}),d},id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[i.ITranslator],optional:[s.ILayoutRestorer,s.ILabShell],autoStart:!0}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1682,5135],{21682:(n,e,t)=>{t.r(e),t.d(e,{CommandIDs:()=>h,default:()=>p});var s=t(3053),o=t(13589),i=t(71677),l=t(68239),a=t(38639),r=t(97934),d=t(81997);const c="jp-mod-kernel";var u;!function(n){n.RunningKernel=class{constructor(n){this.className=c,this.commands=n.commands,this.kernel=n.kernel,this.context=this.kernel.id,this.kernels=n.kernels,this.sessions=n.sessions,this.spec=n.spec||null,this.trans=n.trans}get children(){var n;const e=[],t=h.kernelOpenSession,{commands:s}=this;for(const o of this.sessions.running())if(this.kernel.id===(null===(n=o.kernel)||void 0===n?void 0:n.id)){const{name:n,path:i,type:a}=o;e.push({className:c,context:this.kernel.id,open:()=>{s.execute(t,{name:n,path:i,type:a})},icon:()=>"console"===a?l.consoleIcon:"notebook"===a?l.notebookIcon:l.jupyterIcon,label:()=>n,labelTitle:()=>i})}return e}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){const{spec:n}=this;return n&&n.resources?n.resources["logo-svg"]||n.resources["logo-64x64"]||n.resources["logo-32x32"]:l.jupyterIcon}label(){const{kernel:n,spec:e}=this;return(null==e?void 0:e.display_name)||n.name}labelTitle(){var n;const{trans:e}=this,{id:t}=this.kernel,s=[`${this.label()}: ${t}`];for(const t of this.sessions.running())if(this.kernel.id===(null===(n=t.kernel)||void 0===n?void 0:n.id)){const{path:n,type:o}=t;s.push(e.__("%1\nPath: %2",o,n))}return s.join("\n\n")}},n.runningChanged=new d.Signal({})}(u||(u={}));var h,g=t(35312);class m{constructor(n){this._tabsChanged=new d.Signal(this),this._widgets=[],this._labShell=n,this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(n){n.title.changed.connect(this._emitTabsChanged,this),this._widgets.push(n)}_emitTabsChanged(){this._widgets.forEach((n=>{n.title.changed.disconnect(this._emitTabsChanged,this)})),this._widgets=[],this._tabsChanged.emit(void 0)}}!function(n){n.kernelNewConsole="running:kernel-new-console",n.kernelNewNotebook="running:kernel-new-notebook",n.kernelOpenSession="running:kernel-open-session",n.kernelShutDown="running:kernel-shut-down",n.showPanel="running:show-panel"}(h||(h={}));const p={activate:function(n,e,t,s){const i=e.load("jupyterlab"),d=new o.RunningSessionManagers,p=new o.RunningSessions(d,e);return p.id="jp-running-sessions",p.title.caption=i.__("Running Terminals and Kernels"),p.title.icon=l.runningIcon,p.node.setAttribute("role","region"),p.node.setAttribute("aria-label",i.__("Running Sessions section")),t&&t.add(p,"running-sessions"),s&&function(n,e,t){const s=new m(t),o=e.load("jupyterlab");n.add({name:o.__("Open Tabs"),running:()=>Array.from(t.widgets("main")).map((n=>(s.addWidget(n),new i(n)))),shutdownAll:()=>{for(const n of t.widgets("main"))n.close()},refreshRunning:()=>{},runningChanged:s.tabsChanged,shutdownLabel:o.__("Close"),shutdownAllLabel:o.__("Close All"),shutdownAllConfirmationText:o.__("Are you sure you want to close all open tabs?")});class i{constructor(n){this._widget=n}open(){t.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const n=this._widget.title.icon;return n instanceof l.LabIcon?n:l.fileIcon}label(){return this._widget.title.label}labelTitle(){let n;return n=this._widget instanceof g.DocumentWidget?this._widget.context.path:this._widget.title.label,n}}}(d,e,s),async function(n,e,t){const{commands:s,contextMenu:o,serviceManager:i}=t,{kernels:d,kernelspecs:g,sessions:m}=i,{runningChanged:p,RunningKernel:w}=u,_=new r.Throttler((()=>p.emit(void 0)),100),b=e.load("jupyterlab");d.runningChanged.connect((()=>{_.invoke()})),m.runningChanged.connect((()=>{_.invoke()})),await Promise.all([d.ready,g.ready,m.ready]),n.add({name:b.__("Kernels"),running:()=>Array.from(d.running()).map((n=>{var e;return new w({commands:s,kernel:n,kernels:d,sessions:m,spec:null===(e=g.specs)||void 0===e?void 0:e.kernelspecs[n.name],trans:b})})),shutdownAll:()=>d.shutdownAll(),refreshRunning:()=>Promise.all([d.refreshRunning(),m.refreshRunning()]),runningChanged:p,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:b.__("Are you sure you want to permanently shut down all running kernels?")});const k=n=>n.classList.contains(c);s.addCommand(h.kernelNewConsole,{icon:l.consoleIcon,label:b.__("New Console for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("console:create",{kernelPreference:{id:i}})}}),s.addCommand(h.kernelNewNotebook,{icon:l.notebookIcon,label:b.__("New Notebook for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("notebook:create-new",{kernelId:i})}}),s.addCommand(h.kernelOpenSession,{icon:n=>"console"===n.type?l.consoleIcon:"notebook"===n.type?l.notebookIcon:void 0,isEnabled:({path:n,type:e})=>!!e||void 0!==n,label:({name:n,path:e})=>n||a.PathExt.basename(e||b.__("Unknown Session")),execute:({path:n,type:e})=>{if(!e||void 0===n)return;const t="console"===e?"console:open":"docmanager:open";return s.execute(t,{path:n})}}),s.addCommand(h.kernelShutDown,{icon:l.closeIcon,label:b.__("Shut Down Kernel"),execute:n=>{var e;const s=t.contextMenuHitTest(k),o=null!==(e=n.id)&&void 0!==e?e:null==s?void 0:s.dataset.context;if(o)return d.shutdown(o)}});const v=[];o.opened.connect((async()=>{var n,e,s;const i=null!==(e=null===(n=o.menu.items.find((n=>{var e;return"submenu"===n.type&&"jp-contextmenu-connected-sessions"===(null===(e=n.submenu)||void 0===e?void 0:e.id)})))||void 0===n?void 0:n.submenu)&&void 0!==e?e:null;if(!i)return;v.forEach((n=>n.dispose())),v.length=0,i.clearItems();const l=t.contextMenuHitTest(k),a=null==l?void 0:l.dataset.context;if(!a)return;const r=h.kernelOpenSession;for(const n of m.running())if(a===(null===(s=n.kernel)||void 0===s?void 0:s.id)){const{name:e,path:t,type:s}=n;v.push(i.addItem({command:r,args:{name:e,path:t,type:s}}))}}))}(d,e,n),n.shell.add(p,"left",{rank:200,type:"Sessions and Tabs"}),n.commands.addCommand(h.showPanel,{label:i.__("Sessions and Tabs"),execute:()=>{n.shell.activateById(p.id)}}),d},id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[i.ITranslator],optional:[s.ILayoutRestorer,s.ILabShell],autoStart:!0}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(17260),o=n(70788),i=n(38847),r=n(30679),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(3053),o=n(38639),i=n(33673),r=n(42266),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809,1337],{1809:(n,e,t)=>{t.r(e),t.d(e,{IRunningSessionManagers:()=>p,RunningSessionManagers:()=>b,RunningSessions:()=>E});var s=t(98244),a=t(42539),i=t(70397),o=t(20998),l=t(2549),r=t(81997),d=t(78156);const u="jp-RunningSessions-sectionList",c="jp-RunningSessions-item",h="jp-RunningSessions-itemLabel",m="jp-RunningSessions-itemDetail",g="jp-RunningSessions-itemShutdown",p=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers.");class b{constructor(){this._added=new r.Signal(this),this._managers=[]}get added(){return this._added}add(n){return this._managers.push(n),this._added.emit(n),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(n);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function _(n){var e,t;const{runningItem:s}=n,o=[c],l=null===(e=s.detail)||void 0===e?void 0:e.call(s),r=s.icon(),u=s.labelTitle?s.labelTitle():"",p=n.translator||a.nullTranslator,b=p.load("jupyterlab");let _=!1;const I=n.shutdownItemIcon||i.closeIcon,S=n.shutdownLabel||b.__("Shut Down"),[E,R]=d.useState(!1),j=!!(null===(t=s.children)||void 0===t?void 0:t.length),f=j?()=>!_&&R(!E):void 0;return s.className&&o.push(s.className),n.child&&o.push("jp-mod-running-child"),d.createElement(d.Fragment,null,d.createElement("li",null,d.createElement("div",{className:o.join(" "),onClick:f,"data-context":s.context||""},j&&(E?d.createElement(i.caretRightIcon.react,{tag:"span",stylesheet:"runningItem"}):d.createElement(i.caretDownIcon.react,{tag:"span",stylesheet:"runningItem"})),r?"string"==typeof r?d.createElement("img",{src:r}):d.createElement(r.react,{tag:"span",stylesheet:"runningItem"}):void 0,d.createElement("span",{className:h,title:u,onClick:s.open&&(()=>s.open())},s.label()),l&&d.createElement("span",{className:m},l),s.shutdown&&d.createElement(i.ToolbarButtonComponent,{className:g,icon:I,onClick:()=>{var n;_=!0,null===(n=s.shutdown)||void 0===n||n.call(s)},tooltip:S})),j&&!E&&d.createElement(w,{child:!0,runningItems:s.children,shutdownItemIcon:I,translator:p})))}function w(n){return d.createElement("ul",{className:u},n.runningItems.map(((e,t)=>d.createElement(_,{child:n.child,key:t,runningItem:e,shutdownLabel:n.shutdownLabel,shutdownItemIcon:n.shutdownItemIcon,translator:n.translator}))))}class I extends i.ReactWidget{constructor(n){super(),this._options=n,this._update=new r.Signal(this),n.manager.runningChanged.connect(this._emitUpdate,this)}dispose(){this._options.manager.runningChanged.disconnect(this._emitUpdate,this),super.dispose()}onBeforeShow(n){super.onBeforeShow(n),this._update.emit()}render(){const n=this._options;let e=!0;return d.createElement(i.UseSignal,{signal:this._update},(()=>(e?e=!1:n.runningItems=n.manager.running(),d.createElement("div",{className:"jp-RunningSessions-sectionContainer"},d.createElement(w,{runningItems:n.runningItems,shutdownLabel:n.manager.shutdownLabel,shutdownAllLabel:n.shutdownAllLabel,shutdownItemIcon:n.manager.shutdownItemIcon,translator:n.translator})))))}_isAnyHidden(){let n=this.isHidden;if(n)return n;let e=this.parent;for(;null!=e;){if(e.isHidden){n=!0;break}e=e.parent}return n}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class S extends i.PanelWithToolbar{constructor(n){super(),this._manager=n.manager;const e=(n.translator||a.nullTranslator).load("jupyterlab"),t=n.manager.shutdownAllLabel||e.__("Shut Down All"),o=`${t}?`,l=n.manager.shutdownAllConfirmationText||`${t} ${n.manager.name}`;this.addClass("jp-RunningSessions-section"),this.title.label=n.manager.name;let r=n.manager.running();const d=r.length>0;this._button=new i.ToolbarButton({label:t,className:"jp-RunningSessions-shutdownAll"+(d?"":" jp-mod-disabled"),enabled:d,onClick:function(){(0,s.showDialog)({title:o,body:l,buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:t})]}).then((e=>{e.button.accept&&n.manager.shutdownAll()}))}}),this._manager.runningChanged.connect(this._updateButton,this),this.toolbar.addItem("shutdown-all",this._button),this.addWidget(new I({runningItems:r,shutdownAllLabel:t,...n}))}dispose(){this.isDisposed||(this._manager.runningChanged.disconnect(this._updateButton,this),super.dispose())}_updateButton(){var n,e;const t=this._button;t.enabled=this._manager.running().length>0,t.enabled?null===(n=t.node.querySelector("jp-button"))||void 0===n||n.classList.remove("jp-mod-disabled"):null===(e=t.node.querySelector("jp-button"))||void 0===e||e.classList.add("jp-mod-disabled")}}class E extends i.SidePanel{constructor(n,e){super(),this.managers=n,this.translator=null!=e?e:a.nullTranslator;const t=this.translator.load("jupyterlab");this.addClass("jp-RunningSessions"),this.toolbar.addItem("refresh",new i.ToolbarButton({tooltip:t.__("Refresh List"),icon:i.refreshIcon,onClick:()=>n.items().forEach((n=>n.refreshRunning()))})),n.items().forEach((e=>this.addSection(n,e))),n.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}addSection(n,e){this.addWidget(new S({manager:e,translator:this.translator}))}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809,1337],{1809:(n,e,t)=>{t.r(e),t.d(e,{IRunningSessionManagers:()=>p,RunningSessionManagers:()=>b,RunningSessions:()=>E});var s=t(12982),a=t(71677),i=t(68239),o=t(20998),l=t(2549),r=t(81997),d=t(78156);const u="jp-RunningSessions-sectionList",c="jp-RunningSessions-item",h="jp-RunningSessions-itemLabel",m="jp-RunningSessions-itemDetail",g="jp-RunningSessions-itemShutdown",p=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers.");class b{constructor(){this._added=new r.Signal(this),this._managers=[]}get added(){return this._added}add(n){return this._managers.push(n),this._added.emit(n),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(n);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function _(n){var e,t;const{runningItem:s}=n,o=[c],l=null===(e=s.detail)||void 0===e?void 0:e.call(s),r=s.icon(),u=s.labelTitle?s.labelTitle():"",p=n.translator||a.nullTranslator,b=p.load("jupyterlab");let _=!1;const I=n.shutdownItemIcon||i.closeIcon,S=n.shutdownLabel||b.__("Shut Down"),[E,R]=d.useState(!1),j=!!(null===(t=s.children)||void 0===t?void 0:t.length),f=j?()=>!_&&R(!E):void 0;return s.className&&o.push(s.className),n.child&&o.push("jp-mod-running-child"),d.createElement(d.Fragment,null,d.createElement("li",null,d.createElement("div",{className:o.join(" "),onClick:f,"data-context":s.context||""},j&&(E?d.createElement(i.caretRightIcon.react,{tag:"span",stylesheet:"runningItem"}):d.createElement(i.caretDownIcon.react,{tag:"span",stylesheet:"runningItem"})),r?"string"==typeof r?d.createElement("img",{src:r}):d.createElement(r.react,{tag:"span",stylesheet:"runningItem"}):void 0,d.createElement("span",{className:h,title:u,onClick:s.open&&(()=>s.open())},s.label()),l&&d.createElement("span",{className:m},l),s.shutdown&&d.createElement(i.ToolbarButtonComponent,{className:g,icon:I,onClick:()=>{var n;_=!0,null===(n=s.shutdown)||void 0===n||n.call(s)},tooltip:S})),j&&!E&&d.createElement(w,{child:!0,runningItems:s.children,shutdownItemIcon:I,translator:p})))}function w(n){return d.createElement("ul",{className:u},n.runningItems.map(((e,t)=>d.createElement(_,{child:n.child,key:t,runningItem:e,shutdownLabel:n.shutdownLabel,shutdownItemIcon:n.shutdownItemIcon,translator:n.translator}))))}class I extends i.ReactWidget{constructor(n){super(),this._options=n,this._update=new r.Signal(this),n.manager.runningChanged.connect(this._emitUpdate,this)}dispose(){this._options.manager.runningChanged.disconnect(this._emitUpdate,this),super.dispose()}onBeforeShow(n){super.onBeforeShow(n),this._update.emit()}render(){const n=this._options;let e=!0;return d.createElement(i.UseSignal,{signal:this._update},(()=>(e?e=!1:n.runningItems=n.manager.running(),d.createElement("div",{className:"jp-RunningSessions-sectionContainer"},d.createElement(w,{runningItems:n.runningItems,shutdownLabel:n.manager.shutdownLabel,shutdownAllLabel:n.shutdownAllLabel,shutdownItemIcon:n.manager.shutdownItemIcon,translator:n.translator})))))}_isAnyHidden(){let n=this.isHidden;if(n)return n;let e=this.parent;for(;null!=e;){if(e.isHidden){n=!0;break}e=e.parent}return n}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class S extends i.PanelWithToolbar{constructor(n){super(),this._manager=n.manager;const e=(n.translator||a.nullTranslator).load("jupyterlab"),t=n.manager.shutdownAllLabel||e.__("Shut Down All"),o=`${t}?`,l=n.manager.shutdownAllConfirmationText||`${t} ${n.manager.name}`;this.addClass("jp-RunningSessions-section"),this.title.label=n.manager.name;let r=n.manager.running();const d=r.length>0;this._button=new i.ToolbarButton({label:t,className:"jp-RunningSessions-shutdownAll"+(d?"":" jp-mod-disabled"),enabled:d,onClick:function(){(0,s.showDialog)({title:o,body:l,buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:t})]}).then((e=>{e.button.accept&&n.manager.shutdownAll()}))}}),this._manager.runningChanged.connect(this._updateButton,this),this.toolbar.addItem("shutdown-all",this._button),this.addWidget(new I({runningItems:r,shutdownAllLabel:t,...n}))}dispose(){this.isDisposed||(this._manager.runningChanged.disconnect(this._updateButton,this),super.dispose())}_updateButton(){var n,e;const t=this._button;t.enabled=this._manager.running().length>0,t.enabled?null===(n=t.node.querySelector("jp-button"))||void 0===n||n.classList.remove("jp-mod-disabled"):null===(e=t.node.querySelector("jp-button"))||void 0===e||e.classList.add("jp-mod-disabled")}}class E extends i.SidePanel{constructor(n,e){super(),this.managers=n,this.translator=null!=e?e:a.nullTranslator;const t=this.translator.load("jupyterlab");this.addClass("jp-RunningSessions"),this.toolbar.addItem("refresh",new i.ToolbarButton({tooltip:t.__("Refresh List"),icon:i.refreshIcon,onClick:()=>n.items().forEach((n=>n.refreshRunning()))})),n.items().forEach((e=>this.addSection(n,e))),n.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}addSection(n,e){this.addWidget(new S({manager:e,translator:this.translator}))}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,r)=>{r.r(t),r.d(t,{default:()=>w});var i=r(17260),n=r(98244),o=r(21058),a=r(40930),s=r(91298),d=r(59012),l=r(80864),c=r(42539);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,i,s,d,l,c,u){const{commands:m,shell:w}=e;let p;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,n.createToolbarFactory)(u,c,h,_.id,t)));const C=t.load("jupyterlab"),T=new o.LT({name:h,label:C.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new n.WidgetTracker({namespace:"csvviewer"});let f=y.LIGHT_STYLE,b=y.LIGHT_TEXT_CONFIG;i&&i.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("csv");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 r.e(6017).then(r.bind(r,36017));l.add("csv",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?y.LIGHT_STYLE:y.DARK_STYLE,b=e?y.LIGHT_TEXT_CONFIG:y.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===w.currentWidget;m.addCommand(g.CSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await n.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.CSVGoToLine,isEnabled:F})},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[i.ILayoutRestorer,n.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,n.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,i,s,d,l,c,h){const{commands:_,shell:w}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,n.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 n.WidgetTracker({namespace:"tsvviewer"});let f=y.LIGHT_STYLE,b=y.LIGHT_TEXT_CONFIG;i&&i.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 r.e(6017).then(r.bind(r,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?y.LIGHT_STYLE:y.DARK_STYLE,b=e?y.LIGHT_TEXT_CONFIG:y.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===w.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await n.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})},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[i.ILayoutRestorer,n.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,n.IToolbarWidgetRegistry],autoStart:!0},w=[_,m];var y;!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"}}(y||(y={}))},40930:(e,t,r)=>{r.d(t,{p:()=>s});var i,n=r(42539),o=r(70397),a=r(31516);class s extends a.Widget{constructor(e){super({node:i.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 r=null==(t=t||n.nullTranslator)?void 0:t.load("jupyterlab"),i=[[",",","],[";",";"],["\t",r.__("tab")],["|",r.__("pipe")],["#",r.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=r.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,r]of i){const i=document.createElement("option");i.value=t,i.textContent=r,t===e&&(i.selected=!0),d.appendChild(i)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(i||(i={}))},21058:(e,t,r)=>{r.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var i,n=r(70788),o=r(57526),a=r(20998),s=r(81997),d=r(31516),l=r(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:r,column:i})=>this._query&&t.match(this._query)?this._row===r&&this._column===i?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const r=this._grid.dataModel,i=r.rowCount("body"),n=r.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<i;o+=c){for(let i=this._column;t?i>=0:i<n;i+=c)if(r.data("body",o,i).match(e))return this._changed.emit(void 0),l(o,i)||this._grid.scrollToRow(o),this._row=o,this._column=i,!0;this._column=t?n-1:0}if(this._looping){this._looping=!1,this._row=t?0:i-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,r=t.rowCount("body"),i=t.columnCount("body");e&&this._row<=0?(this._row=r-1,this._column=i):!e&&this._row>=r-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:r,DataGrid:o}=await i.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 r,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 n.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 i.ensureDataGrid(),{DSVModel:t}=await i.ensureDSVModel(),r=this._context.model.toString(),n=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:r,delimiter:n});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await i.ensureDataGrid(),t=this._baseRenderer,r=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:r,"column-header":r,"corner-header":r,"row-header":r})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:r,delimiter:n,reveal:o,...a}=e;t=t||i.createContent(r),o=Promise.all([o,t.revealed]),super({content:t,context:r,reveal:o,...a}),n&&(t.delimiter=n)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let r=t[1].split(";")[0];r=r.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(r))}))}}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,i=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await r.e(5585).then(r.t.bind(r,95585,23)))),t.promise},e.ensureDSVModel=async function(){return null==i&&(i=new a.PromiseDelegate,i.resolve(await Promise.all([r.e(8032),r.e(5585)]).then(r.bind(r,18032)))),i.promise},e.createContent=function(e){return new u({context:e})}}(i||(i={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,r)=>{r.r(t),r.d(t,{default:()=>w});var i=r(3053),n=r(12982),o=r(21058),a=r(40930),s=r(3486),d=r(97104),l=r(36768),c=r(71677);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,i,s,d,l,c,u){const{commands:m,shell:w}=e;let p;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,n.createToolbarFactory)(u,c,h,_.id,t)));const C=t.load("jupyterlab"),T=new o.LT({name:h,label:C.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new n.WidgetTracker({namespace:"csvviewer"});let f=y.LIGHT_STYLE,b=y.LIGHT_TEXT_CONFIG;i&&i.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("csv");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 r.e(6017).then(r.bind(r,36017));l.add("csv",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?y.LIGHT_STYLE:y.DARK_STYLE,b=e?y.LIGHT_TEXT_CONFIG:y.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===w.currentWidget;m.addCommand(g.CSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await n.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.CSVGoToLine,isEnabled:F})},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[i.ILayoutRestorer,n.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,n.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,i,s,d,l,c,h){const{commands:_,shell:w}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,n.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 n.WidgetTracker({namespace:"tsvviewer"});let f=y.LIGHT_STYLE,b=y.LIGHT_TEXT_CONFIG;i&&i.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 r.e(6017).then(r.bind(r,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?y.LIGHT_STYLE:y.DARK_STYLE,b=e?y.LIGHT_TEXT_CONFIG:y.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===w.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await n.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})},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[i.ILayoutRestorer,n.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,n.IToolbarWidgetRegistry],autoStart:!0},w=[_,m];var y;!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"}}(y||(y={}))},40930:(e,t,r)=>{r.d(t,{p:()=>s});var i,n=r(71677),o=r(68239),a=r(31516);class s extends a.Widget{constructor(e){super({node:i.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 r=null==(t=t||n.nullTranslator)?void 0:t.load("jupyterlab"),i=[[",",","],[";",";"],["\t",r.__("tab")],["|",r.__("pipe")],["#",r.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=r.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,r]of i){const i=document.createElement("option");i.value=t,i.textContent=r,t===e&&(i.selected=!0),d.appendChild(i)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(i||(i={}))},21058:(e,t,r)=>{r.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var i,n=r(38639),o=r(35312),a=r(20998),s=r(81997),d=r(31516),l=r(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:r,column:i})=>this._query&&t.match(this._query)?this._row===r&&this._column===i?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const r=this._grid.dataModel,i=r.rowCount("body"),n=r.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<i;o+=c){for(let i=this._column;t?i>=0:i<n;i+=c)if(r.data("body",o,i).match(e))return this._changed.emit(void 0),l(o,i)||this._grid.scrollToRow(o),this._row=o,this._column=i,!0;this._column=t?n-1:0}if(this._looping){this._looping=!1,this._row=t?0:i-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,r=t.rowCount("body"),i=t.columnCount("body");e&&this._row<=0?(this._row=r-1,this._column=i):!e&&this._row>=r-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:r,DataGrid:o}=await i.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 r,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 n.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 i.ensureDataGrid(),{DSVModel:t}=await i.ensureDSVModel(),r=this._context.model.toString(),n=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:r,delimiter:n});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await i.ensureDataGrid(),t=this._baseRenderer,r=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:r,"column-header":r,"corner-header":r,"row-header":r})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:r,delimiter:n,reveal:o,...a}=e;t=t||i.createContent(r),o=Promise.all([o,t.revealed]),super({content:t,context:r,reveal:o,...a}),n&&(t.delimiter=n)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let r=t[1].split(";")[0];r=r.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(r))}))}}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,i=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await r.e(5585).then(r.t.bind(r,95585,23)))),t.promise},e.ensureDSVModel=async function(){return null==i&&(i=new a.PromiseDelegate,i.resolve(await Promise.all([r.e(8032),r.e(5585)]).then(r.bind(r,18032)))),i.promise},e.createContent=function(e){return new u({context:e})}}(i||(i={}))}}]);
@@ -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(69319),o=i(59105),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()})).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.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(98244),d=i(88546),l=i(57526),c=i(70397),h=i(31516);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(80890),f=i(42539),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(94972);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(31536),o=i(12729),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(12982),d=i(52337),l=i(35312),c=i(68239),h=i(31516);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(34276),v=i(71677),_=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(87749);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 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1835],{11835:(e,t,n)=>{n.r(t),n.d(t,{ToolbarItems:()=>F,default:()=>W,downloadPlugin:()=>D,openBrowserTabPlugin:()=>k,pathStatusPlugin:()=>x,savingStatusPlugin:()=>C});var o,a=n(17260),r=n(98244),i=n(70788),l=n(91919),d=n(80864),s=n(80890),c=n(42539),u=n(70397),m=n(33625),g=n(20998),p=n(81997),h=n(31516),v=n(78156);!function(e){e.clone="docmanager:clone",e.deleteFile="docmanager:delete-file",e.newUntitled="docmanager:new-untitled",e.open="docmanager:open",e.openBrowserTab="docmanager:open-browser-tab",e.reload="docmanager:reload",e.rename="docmanager:rename",e.del="docmanager:delete",e.duplicate="docmanager:duplicate",e.restoreCheckpoint="docmanager:restore-checkpoint",e.save="docmanager:save",e.saveAll="docmanager:save-all",e.saveAs="docmanager:save-as",e.download="docmanager:download",e.toggleAutosave="docmanager:toggle-autosave",e.showInFileBrowser="docmanager:show-in-file-browser"}(o||(o={}));const f="@jupyterlab/docmanager-extension:plugin",w={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:l.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){e.id||(e.id="document-manager-"+ ++S.id),e.title.dataset={type:"document-title",...e.title.dataset},e.isAttached||t.add(e,"main",n||{}),t.activateById(e.id),this._opened.emit(e)}get opened(){return this._opened}}}},_={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener],optional:[a.ILabStatus],activate:(e,t,n,o)=>{const a=new WeakSet;n.opened.connect(((e,n)=>{const r=t.contextForWidget(n);r&&!a.has(r)&&(o&&function(e,t){let n=null;const o=(t,o)=>{"dirty"===o.name&&(!0===o.newValue?n||(n=e.setDirty()):n&&(n.dispose(),n=null))};t.ready.then((()=>{t.model.stateChanged.connect(o),t.model.dirty&&(n=e.setDirty())})),t.disposed.connect((()=>{n&&n.dispose()}))}(o,r),a.add(r))}))}},b={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:l.IDocumentManager,requires:[l.IDocumentWidgetOpener],optional:[c.ITranslator,a.ILabStatus,r.ISessionContextDialogs,a.JupyterLab.IInfo],activate:(e,t,n,o,a,i)=>{var d;const{serviceManager:s,docRegistry:u}=e,m=null!=n?n:c.nullTranslator,g=null!=a?a:new r.SessionContextDialogs({translator:m}),p=e.restored.then((()=>{}));return new l.DocumentManager({registry:u,manager:s,opener:t,when:p,setBusy:null!==(d=o&&(()=>o.setBusy()))&&void 0!==d?d:void 0,sessionDialogs:g,translator:null!=m?m:c.nullTranslator,isConnectedCallback:()=>!i||i.isConnected})}},y={id:f,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener,d.ISettingRegistry],optional:[c.ITranslator,r.ICommandPalette,a.ILabShell],activate:(e,t,n,a,d,s,p)=>{const h=(d=null!=d?d:c.nullTranslator).load("jupyterlab"),v=e.docRegistry;!function(e,t,n,a,d,s,c){const g=d.load("jupyterlab"),{commands:p,shell:h}=e,v=g.__("File Operations"),w=()=>{const{currentWidget:e}=h;return!(!e||!t.contextForWidget(e))},_=()=>{var e;const{currentWidget:n}=h;if(!n)return!1;const o=t.contextForWidget(n);return!!(null===(e=null==o?void 0:o.contentsModel)||void 0===e?void 0:e.writable)},b=e=>r.Notification.warning(g.__('%1 is permissioned as read-only. Use "save as..." instead.',e),{autoClose:5e3});s&&function(e,t,n,a,i){const d=i.load("jupyterlab"),{commands:s}=e,c=()=>{var o;const a=/[Pp]ath:\s?(.*)\n?/,r=e.contextMenuHitTest((e=>{var t;return!!(null===(t=e.title)||void 0===t?void 0:t.match(a))})),i=null==r?void 0:r.title.match(a);return null!==(o=i&&t.findWidget(i[1],null))&&void 0!==o?o:n.currentWidget},u=()=>{const{currentWidget:e}=n;return!(!e||!t.contextForWidget(e))};s.addCommand(o.clone,{label:()=>d.__("New View for %1",T(c(),t)),isEnabled:u,execute:e=>{const n=c(),o=e.options||{mode:"split-right"};if(!n)return;const r=t.cloneWidget(n);r&&a.open(r,o)}}),s.addCommand(o.rename,{label:()=>{let e=T(c(),t);return e&&(e=" "+e),d.__("Rename%1…",e)},isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());return(0,l.renameDialog)(t,e)}}}),s.addCommand(o.duplicate,{label:()=>d.__("Duplicate %1",T(c(),t)),isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());if(!e)return;return t.duplicate(e.path)}}}),s.addCommand(o.del,{label:()=>d.__("Delete %1",T(c(),t)),isEnabled:u,execute:async()=>{if(u()){const n=t.contextForWidget(c());if(!n)return;(await(0,r.showDialog)({title:d.__("Delete"),body:d.__("Are you sure you want to delete %1",n.path),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:d.__("Delete")})]})).button.accept&&await e.commands.execute("docmanager:delete-file",{path:n.path})}}}),s.addCommand(o.showInFileBrowser,{label:()=>d.__("Show in File Browser"),isEnabled:u,execute:async()=>{const e=c(),n=e&&t.contextForWidget(e);n&&(await s.execute("filebrowser:activate",{path:n.path}),await s.execute("filebrowser:go-to-path",{path:n.path}))}})}(e,t,s,n,d),p.addCommand(o.deleteFile,{label:()=>`Delete ${T(h.currentWidget,t)}`,execute:e=>{const n=void 0===e.path?"":e.path;if(!n){const e=o.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}}),p.addCommand(o.newUntitled,{execute:e=>{const n=e.error||g.__("Error"),o=void 0===e.path?"":e.path,a={type:e.type,path:o};return"file"===e.type&&(a.ext=e.ext||".txt"),t.services.contents.newUntitled(a).catch((e=>(0,r.showErrorMessage)(n,e)))},label:e=>e.label||`New ${e.type}`}),p.addCommand(o.open,{execute:e=>{const n=void 0===e.path?"":e.path,o=e.factory||void 0,a=null==e?void 0:e.kernel,r=e.options||void 0;return t.services.contents.get(n,{content:!1}).then((()=>t.openOrReveal(n,o,a,r)))},iconClass:e=>e.icon||"",label:e=>{var t;return null!==(t=e.label||e.factory)&&void 0!==t?t:g.__("Open the provided `path`.")},mnemonic:e=>e.mnemonic||-1}),p.addCommand(o.reload,{label:()=>g.__("Reload %1 from Disk",T(h.currentWidget,t)),caption:g.__("Reload contents from disk"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget),n=T(h.currentWidget,t);return e?e.model.dirty?(0,r.showDialog)({title:g.__("Reload %1 from Disk",n),body:g.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed)return e.revert()})):e.isDisposed?void 0:e.revert():(0,r.showDialog)({title:g.__("Cannot Reload"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}),p.addCommand(o.restoreCheckpoint,{label:()=>g.__("Revert %1 to Checkpoint…",T(h.currentWidget,t)),caption:g.__("Revert contents to previous checkpoint"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget);return e?e.listCheckpoints().then((async n=>{const o=T(h.currentWidget,t);if(n.length<1)return void await(0,r.showErrorMessage)(g.__("No checkpoints"),g.__("No checkpoints are available for this %1.",o));const a=1===n.length?n[0]:await S.getTargetCheckpoint(n.reverse(),g);return a?(0,r.showDialog)({title:g.__("Revert %1 to checkpoint",o),body:new I(a,g,o),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Revert"),ariaLabel:g.__("Revert to Checkpoint")})]}).then((t=>{if(!e.isDisposed)return t.button.accept?e.model.readOnly?e.revert():e.restoreCheckpoint(a.id).then((()=>e.revert())):void 0})):void 0})):(0,r.showDialog)({title:g.__("Cannot Revert"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}});const y=new WeakSet;p.addCommand(o.save,{label:()=>g.__("Save %1",T(h.currentWidget,t)),caption:()=>{if(h.currentWidget){const e=t.contextForWidget(h.currentWidget);if(null==e?void 0:e.model.collaborative)return g.__("In collaborative mode, the document is saved automatically after every change");if(!_())return g.__('document is permissioned readonly; "save" is disabled, use "save as..." instead')}return g.__("Save and create checkpoint")},icon:e=>e.toolbar?u.saveIcon:void 0,isEnabled:e=>e._luminoEvent&&"keybinding"===e._luminoEvent.type||_(),execute:async e=>{var n,o,l,d,s;const c=h.currentWidget,u=t.contextForWidget(c);if(w()){if(!u)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});{if(y.has(u))return;if(!(null===(n=u.contentsModel)||void 0===n?void 0:n.writable)&&!u.model.collaborative){let t=null===(o=e._luminoEvent)||void 0===o?void 0:o.type;return e._luminoEvent&&"keybinding"===t?void b(u.path):(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("Document is read-only"),buttons:[r.Dialog.okButton()]})}y.add(u);const m=i.PathExt.basename(null!==(d=null===(l=u.contentsModel)||void 0===l?void 0:l.path)&&void 0!==d?d:"");let p=m;if(t.renameUntitledFileOnSave&&!0===c.isUntitled){const e=await r.InputDialog.getText({title:g.__("Rename file"),okLabel:g.__("Rename"),placeholder:g.__("File name"),text:m,selectionRange:m.length-i.PathExt.extname(m).length,checkbox:{label:g.__("Do not ask me again."),caption:g.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept&&(p=null!==(s=e.value)&&void 0!==s?s:m,c.isUntitled=!1,"boolean"==typeof e.isChecked)){const t=(await a.get(f,"renameUntitledFileOnSave")).composite;e.isChecked===t&&a.set(f,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}try{if(await u.save(),!(null==c?void 0:c.isDisposed))return u.createCheckpoint()}catch(e){if("ModalCancelError"===e.name)return;throw e}finally{y.delete(u),p!==m&&await u.rename(p)}}}}}),p.addCommand(o.saveAll,{label:()=>g.__("Save All"),caption:g.__("Save all open documents"),isEnabled:()=>(0,m.some)(h.widgets("main"),(e=>{var n,o,a;return null!==(a=null===(o=null===(n=t.contextForWidget(e))||void 0===n?void 0:n.contentsModel)||void 0===o?void 0:o.writable)&&void 0!==a&&a})),execute:()=>{var e;const n=[],o=new Set;for(const a of h.widgets("main")){const r=t.contextForWidget(a);r&&!o.has(r.path)&&((null===(e=r.contentsModel)||void 0===e?void 0:e.writable)?(o.add(r.path),n.push(r.save())):b(r.path))}return Promise.all(n)}}),p.addCommand(o.saveAs,{label:()=>g.__("Save %1 As…",T(h.currentWidget,t)),caption:g.__("Save with new path"),isEnabled:w,execute:()=>{if(w()){const e=t.contextForWidget(h.currentWidget);if(!e)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});const n=(n,a)=>{"save"===a.type&&a.newValue&&a.newValue.path!==e.path&&(t.closeFile(e.path),p.execute(o.open,{path:a.newValue.path}))};t.services.contents.fileChanged.connect(n),e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}}),p.addCommand(o.toggleAutosave,{label:g.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave,n="autosave";return a.set(f,n,e).catch((e=>{console.error(`Failed to set ${f}:${n} - ${e.message}`)}))}}),c&&[o.reload,o.restoreCheckpoint,o.save,o.saveAs,o.toggleAutosave,o.duplicate].forEach((e=>{c.addItem({command:e,category:v})}))}(e,t,n,a,d,p,s);const w=n=>{const a=n.get("autosave").composite;t.autosave=!0!==a&&!1!==a||a,e.commands.notifyCommandChanged(o.toggleAutosave);const r=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=null==r||r;const i=n.get("autosaveInterval").composite;t.autosaveInterval=i||120;const l=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=l||500;const d=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=null==d||d;const s=n.get("defaultViewers").composite,c={};Object.keys(s).forEach((e=>{v.getFileType(e)?(v.getWidgetFactory(s[e])||console.warn(`Document viewer ${s[e]} not found`),c[e]=s[e]):console.warn(`File Type ${e} not found`)}));for(const e of v.fileTypes())try{v.setDefaultWidgetFactory(e.name,c[e.name])}catch(t){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}};Promise.all([a.load(f),e.restored]).then((([e])=>{e.changed.connect(w),w(e),t.stateChanged.connect(((t,n)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue&&e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}))})).catch((e=>{console.error(e.message)})),a.transform(f,{fetch:e=>{const t=Array.from(v.fileTypes()).map((e=>e.name)).join(" \n"),n=Array.from(v.widgetFactories()).map((e=>e.name)).join(" \n"),o=h.__('Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2',n,t),a=g.JSONExt.deepCopy(e.schema);return a.properties.defaultViewers.description=o,{...e,schema:a}}}),v.changed.connect((()=>a.load(f,!0)))}},C={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[c.ITranslator,s.IStatusBar],activate:(e,t,n,o,a)=>{if(!a)return;const r=new l.SavingStatus({docManager:t,translator:null!=o?o:c.nullTranslator});r.model.widget=n.currentWidget,n.currentChanged.connect((()=>{r.model.widget=n.currentWidget})),a.registerStatusItem(C.id,{item:r,align:"middle",isActive:()=>null!==r.model&&null!==r.model.status,activeStateChanged:r.model.stateChanged})}},x={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[s.IStatusBar],activate:(e,t,n,o)=>{if(!o)return;const a=new l.PathStatus({docManager:t});a.model.widget=n.currentWidget,n.currentChanged.connect((()=>{a.model.widget=n.currentWidget})),o.registerStatusItem(x.id,{item:a,align:"right",rank:0})}},D={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator,r.ICommandPalette],activate:(e,t,n,a)=>{const i=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:l,shell:d}=e,s=()=>{const{currentWidget:e}=d;return!(!e||!t.contextForWidget(e))};l.addCommand(o.download,{label:i.__("Download"),caption:i.__("Download the file to your computer"),isEnabled:s,execute:()=>{if(s()){const e=t.contextForWidget(d.currentWidget);return e?e.download():(0,r.showDialog)({title:i.__("Cannot Download"),body:i.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}});const u=i.__("File Operations");a&&a.addItem({command:o.download,category:u})}},k={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator],activate:(e,t,n)=>{const a=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:r}=e;r.addCommand(o.openBrowserTab,{execute:e=>{const n=void 0===e.path?"":e.path;if(n)return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(!t)throw new Error("Failed to open new browser tab.");t.opener=null,t.location.href=e}))},iconClass:e=>e.icon||"",label:()=>a.__("Open in New Browser Tab")})}},W=[b,y,_,x,C,D,k,w];var F,S;!function(e){e.createSaveButton=function(e,t){return(0,r.addCommandToolbarButtonClass)(r.ReactWidget.create(v.createElement(r.UseSignal,{signal:t},(()=>v.createElement(r.CommandToolbarButtonComponent,{commands:e,id:o.save,label:"",args:{toolbar:!0}})))))}}(F||(F={}));class I extends h.Widget{constructor(e,t,n="notebook"){super({node:S.createRevertConfirmNode(e,n,t)})}}function T(e,t){if(!e)return"File";const n=t.contextForWidget(e);if(!n)return"";const o=t.registry.getFileTypesForPath(n.path);return o.length&&o[0].displayName?o[0].displayName:"File"}!function(e){e.id=0,e.createRevertConfirmNode=function(e,t,n){const o=document.createElement("div"),a=document.createElement("p"),r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t)),l=document.createElement("strong");l.textContent=n.__("This cannot be undone."),a.appendChild(r),a.appendChild(l);const d=document.createElement("p"),s=document.createTextNode(n.__("The checkpoint was last updated at: ")),c=document.createElement("p"),u=new Date(e.last_modified);return c.style.textAlign="center",c.textContent=i.Time.format(u)+" ("+i.Time.formatHuman(u)+")",d.appendChild(s),d.appendChild(c),o.appendChild(a),o.appendChild(d),o},e.getTargetCheckpoint=async function(e,t){const n=e.map(((e,t)=>`${t}. ${i.Time.format(e.last_modified)} (${i.Time.formatHuman(e.last_modified)})`)),o=(await r.InputDialog.getItem({items:n,title:t.__("Choose a checkpoint")})).value;if(!o)return;const a=o.split(".",1)[0];return e[parseInt(a,10)]}}(S||(S={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1835],{11835:(e,t,n)=>{n.r(t),n.d(t,{ToolbarItems:()=>F,default:()=>W,downloadPlugin:()=>D,openBrowserTabPlugin:()=>k,pathStatusPlugin:()=>x,savingStatusPlugin:()=>C});var o,a=n(3053),r=n(12982),i=n(38639),l=n(90157),d=n(36768),s=n(34276),c=n(71677),u=n(68239),m=n(33625),g=n(20998),p=n(81997),h=n(31516),v=n(78156);!function(e){e.clone="docmanager:clone",e.deleteFile="docmanager:delete-file",e.newUntitled="docmanager:new-untitled",e.open="docmanager:open",e.openBrowserTab="docmanager:open-browser-tab",e.reload="docmanager:reload",e.rename="docmanager:rename",e.del="docmanager:delete",e.duplicate="docmanager:duplicate",e.restoreCheckpoint="docmanager:restore-checkpoint",e.save="docmanager:save",e.saveAll="docmanager:save-all",e.saveAs="docmanager:save-as",e.download="docmanager:download",e.toggleAutosave="docmanager:toggle-autosave",e.showInFileBrowser="docmanager:show-in-file-browser"}(o||(o={}));const f="@jupyterlab/docmanager-extension:plugin",w={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:l.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){e.id||(e.id="document-manager-"+ ++S.id),e.title.dataset={type:"document-title",...e.title.dataset},e.isAttached||t.add(e,"main",n||{}),t.activateById(e.id),this._opened.emit(e)}get opened(){return this._opened}}}},_={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener],optional:[a.ILabStatus],activate:(e,t,n,o)=>{const a=new WeakSet;n.opened.connect(((e,n)=>{const r=t.contextForWidget(n);r&&!a.has(r)&&(o&&function(e,t){let n=null;const o=(t,o)=>{"dirty"===o.name&&(!0===o.newValue?n||(n=e.setDirty()):n&&(n.dispose(),n=null))};t.ready.then((()=>{t.model.stateChanged.connect(o),t.model.dirty&&(n=e.setDirty())})),t.disposed.connect((()=>{n&&n.dispose()}))}(o,r),a.add(r))}))}},b={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:l.IDocumentManager,requires:[l.IDocumentWidgetOpener],optional:[c.ITranslator,a.ILabStatus,r.ISessionContextDialogs,a.JupyterLab.IInfo],activate:(e,t,n,o,a,i)=>{var d;const{serviceManager:s,docRegistry:u}=e,m=null!=n?n:c.nullTranslator,g=null!=a?a:new r.SessionContextDialogs({translator:m}),p=e.restored.then((()=>{}));return new l.DocumentManager({registry:u,manager:s,opener:t,when:p,setBusy:null!==(d=o&&(()=>o.setBusy()))&&void 0!==d?d:void 0,sessionDialogs:g,translator:null!=m?m:c.nullTranslator,isConnectedCallback:()=>!i||i.isConnected})}},y={id:f,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener,d.ISettingRegistry],optional:[c.ITranslator,r.ICommandPalette,a.ILabShell],activate:(e,t,n,a,d,s,p)=>{const h=(d=null!=d?d:c.nullTranslator).load("jupyterlab"),v=e.docRegistry;!function(e,t,n,a,d,s,c){const g=d.load("jupyterlab"),{commands:p,shell:h}=e,v=g.__("File Operations"),w=()=>{const{currentWidget:e}=h;return!(!e||!t.contextForWidget(e))},_=()=>{var e;const{currentWidget:n}=h;if(!n)return!1;const o=t.contextForWidget(n);return!!(null===(e=null==o?void 0:o.contentsModel)||void 0===e?void 0:e.writable)},b=e=>r.Notification.warning(g.__('%1 is permissioned as read-only. Use "save as..." instead.',e),{autoClose:5e3});s&&function(e,t,n,a,i){const d=i.load("jupyterlab"),{commands:s}=e,c=()=>{var o;const a=/[Pp]ath:\s?(.*)\n?/,r=e.contextMenuHitTest((e=>{var t;return!!(null===(t=e.title)||void 0===t?void 0:t.match(a))})),i=null==r?void 0:r.title.match(a);return null!==(o=i&&t.findWidget(i[1],null))&&void 0!==o?o:n.currentWidget},u=()=>{const{currentWidget:e}=n;return!(!e||!t.contextForWidget(e))};s.addCommand(o.clone,{label:()=>d.__("New View for %1",T(c(),t)),isEnabled:u,execute:e=>{const n=c(),o=e.options||{mode:"split-right"};if(!n)return;const r=t.cloneWidget(n);r&&a.open(r,o)}}),s.addCommand(o.rename,{label:()=>{let e=T(c(),t);return e&&(e=" "+e),d.__("Rename%1…",e)},isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());return(0,l.renameDialog)(t,e)}}}),s.addCommand(o.duplicate,{label:()=>d.__("Duplicate %1",T(c(),t)),isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());if(!e)return;return t.duplicate(e.path)}}}),s.addCommand(o.del,{label:()=>d.__("Delete %1",T(c(),t)),isEnabled:u,execute:async()=>{if(u()){const n=t.contextForWidget(c());if(!n)return;(await(0,r.showDialog)({title:d.__("Delete"),body:d.__("Are you sure you want to delete %1",n.path),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:d.__("Delete")})]})).button.accept&&await e.commands.execute("docmanager:delete-file",{path:n.path})}}}),s.addCommand(o.showInFileBrowser,{label:()=>d.__("Show in File Browser"),isEnabled:u,execute:async()=>{const e=c(),n=e&&t.contextForWidget(e);n&&(await s.execute("filebrowser:activate",{path:n.path}),await s.execute("filebrowser:go-to-path",{path:n.path}))}})}(e,t,s,n,d),p.addCommand(o.deleteFile,{label:()=>`Delete ${T(h.currentWidget,t)}`,execute:e=>{const n=void 0===e.path?"":e.path;if(!n){const e=o.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}}),p.addCommand(o.newUntitled,{execute:e=>{const n=e.error||g.__("Error"),o=void 0===e.path?"":e.path,a={type:e.type,path:o};return"file"===e.type&&(a.ext=e.ext||".txt"),t.services.contents.newUntitled(a).catch((e=>(0,r.showErrorMessage)(n,e)))},label:e=>e.label||`New ${e.type}`}),p.addCommand(o.open,{execute:e=>{const n=void 0===e.path?"":e.path,o=e.factory||void 0,a=null==e?void 0:e.kernel,r=e.options||void 0;return t.services.contents.get(n,{content:!1}).then((()=>t.openOrReveal(n,o,a,r)))},iconClass:e=>e.icon||"",label:e=>{var t;return null!==(t=e.label||e.factory)&&void 0!==t?t:g.__("Open the provided `path`.")},mnemonic:e=>e.mnemonic||-1}),p.addCommand(o.reload,{label:()=>g.__("Reload %1 from Disk",T(h.currentWidget,t)),caption:g.__("Reload contents from disk"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget),n=T(h.currentWidget,t);return e?e.model.dirty?(0,r.showDialog)({title:g.__("Reload %1 from Disk",n),body:g.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed)return e.revert()})):e.isDisposed?void 0:e.revert():(0,r.showDialog)({title:g.__("Cannot Reload"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}),p.addCommand(o.restoreCheckpoint,{label:()=>g.__("Revert %1 to Checkpoint…",T(h.currentWidget,t)),caption:g.__("Revert contents to previous checkpoint"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget);return e?e.listCheckpoints().then((async n=>{const o=T(h.currentWidget,t);if(n.length<1)return void await(0,r.showErrorMessage)(g.__("No checkpoints"),g.__("No checkpoints are available for this %1.",o));const a=1===n.length?n[0]:await S.getTargetCheckpoint(n.reverse(),g);return a?(0,r.showDialog)({title:g.__("Revert %1 to checkpoint",o),body:new I(a,g,o),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Revert"),ariaLabel:g.__("Revert to Checkpoint")})]}).then((t=>{if(!e.isDisposed)return t.button.accept?e.model.readOnly?e.revert():e.restoreCheckpoint(a.id).then((()=>e.revert())):void 0})):void 0})):(0,r.showDialog)({title:g.__("Cannot Revert"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}});const y=new WeakSet;p.addCommand(o.save,{label:()=>g.__("Save %1",T(h.currentWidget,t)),caption:()=>{if(h.currentWidget){const e=t.contextForWidget(h.currentWidget);if(null==e?void 0:e.model.collaborative)return g.__("In collaborative mode, the document is saved automatically after every change");if(!_())return g.__('document is permissioned readonly; "save" is disabled, use "save as..." instead')}return g.__("Save and create checkpoint")},icon:e=>e.toolbar?u.saveIcon:void 0,isEnabled:e=>e._luminoEvent&&"keybinding"===e._luminoEvent.type||_(),execute:async e=>{var n,o,l,d,s;const c=h.currentWidget,u=t.contextForWidget(c);if(w()){if(!u)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});{if(y.has(u))return;if(!(null===(n=u.contentsModel)||void 0===n?void 0:n.writable)&&!u.model.collaborative){let t=null===(o=e._luminoEvent)||void 0===o?void 0:o.type;return e._luminoEvent&&"keybinding"===t?void b(u.path):(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("Document is read-only"),buttons:[r.Dialog.okButton()]})}y.add(u);const m=i.PathExt.basename(null!==(d=null===(l=u.contentsModel)||void 0===l?void 0:l.path)&&void 0!==d?d:"");let p=m;if(t.renameUntitledFileOnSave&&!0===c.isUntitled){const e=await r.InputDialog.getText({title:g.__("Rename file"),okLabel:g.__("Rename"),placeholder:g.__("File name"),text:m,selectionRange:m.length-i.PathExt.extname(m).length,checkbox:{label:g.__("Do not ask me again."),caption:g.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept&&(p=null!==(s=e.value)&&void 0!==s?s:m,c.isUntitled=!1,"boolean"==typeof e.isChecked)){const t=(await a.get(f,"renameUntitledFileOnSave")).composite;e.isChecked===t&&a.set(f,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}try{if(await u.save(),!(null==c?void 0:c.isDisposed))return u.createCheckpoint()}catch(e){if("ModalCancelError"===e.name)return;throw e}finally{y.delete(u),p!==m&&await u.rename(p)}}}}}),p.addCommand(o.saveAll,{label:()=>g.__("Save All"),caption:g.__("Save all open documents"),isEnabled:()=>(0,m.some)(h.widgets("main"),(e=>{var n,o,a;return null!==(a=null===(o=null===(n=t.contextForWidget(e))||void 0===n?void 0:n.contentsModel)||void 0===o?void 0:o.writable)&&void 0!==a&&a})),execute:()=>{var e;const n=[],o=new Set;for(const a of h.widgets("main")){const r=t.contextForWidget(a);r&&!o.has(r.path)&&((null===(e=r.contentsModel)||void 0===e?void 0:e.writable)?(o.add(r.path),n.push(r.save())):b(r.path))}return Promise.all(n)}}),p.addCommand(o.saveAs,{label:()=>g.__("Save %1 As…",T(h.currentWidget,t)),caption:g.__("Save with new path"),isEnabled:w,execute:()=>{if(w()){const e=t.contextForWidget(h.currentWidget);if(!e)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});const n=(n,a)=>{"save"===a.type&&a.newValue&&a.newValue.path!==e.path&&(t.closeFile(e.path),p.execute(o.open,{path:a.newValue.path}))};t.services.contents.fileChanged.connect(n),e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}}),p.addCommand(o.toggleAutosave,{label:g.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave,n="autosave";return a.set(f,n,e).catch((e=>{console.error(`Failed to set ${f}:${n} - ${e.message}`)}))}}),c&&[o.reload,o.restoreCheckpoint,o.save,o.saveAs,o.toggleAutosave,o.duplicate].forEach((e=>{c.addItem({command:e,category:v})}))}(e,t,n,a,d,p,s);const w=n=>{const a=n.get("autosave").composite;t.autosave=!0!==a&&!1!==a||a,e.commands.notifyCommandChanged(o.toggleAutosave);const r=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=null==r||r;const i=n.get("autosaveInterval").composite;t.autosaveInterval=i||120;const l=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=l||500;const d=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=null==d||d;const s=n.get("defaultViewers").composite,c={};Object.keys(s).forEach((e=>{v.getFileType(e)?(v.getWidgetFactory(s[e])||console.warn(`Document viewer ${s[e]} not found`),c[e]=s[e]):console.warn(`File Type ${e} not found`)}));for(const e of v.fileTypes())try{v.setDefaultWidgetFactory(e.name,c[e.name])}catch(t){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}};Promise.all([a.load(f),e.restored]).then((([e])=>{e.changed.connect(w),w(e),t.stateChanged.connect(((t,n)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue&&e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}))})).catch((e=>{console.error(e.message)})),a.transform(f,{fetch:e=>{const t=Array.from(v.fileTypes()).map((e=>e.name)).join(" \n"),n=Array.from(v.widgetFactories()).map((e=>e.name)).join(" \n"),o=h.__('Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2',n,t),a=g.JSONExt.deepCopy(e.schema);return a.properties.defaultViewers.description=o,{...e,schema:a}}}),v.changed.connect((()=>a.load(f,!0)))}},C={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[c.ITranslator,s.IStatusBar],activate:(e,t,n,o,a)=>{if(!a)return;const r=new l.SavingStatus({docManager:t,translator:null!=o?o:c.nullTranslator});r.model.widget=n.currentWidget,n.currentChanged.connect((()=>{r.model.widget=n.currentWidget})),a.registerStatusItem(C.id,{item:r,align:"middle",isActive:()=>null!==r.model&&null!==r.model.status,activeStateChanged:r.model.stateChanged})}},x={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[s.IStatusBar],activate:(e,t,n,o)=>{if(!o)return;const a=new l.PathStatus({docManager:t});a.model.widget=n.currentWidget,n.currentChanged.connect((()=>{a.model.widget=n.currentWidget})),o.registerStatusItem(x.id,{item:a,align:"right",rank:0})}},D={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator,r.ICommandPalette],activate:(e,t,n,a)=>{const i=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:l,shell:d}=e,s=()=>{const{currentWidget:e}=d;return!(!e||!t.contextForWidget(e))};l.addCommand(o.download,{label:i.__("Download"),caption:i.__("Download the file to your computer"),isEnabled:s,execute:()=>{if(s()){const e=t.contextForWidget(d.currentWidget);return e?e.download():(0,r.showDialog)({title:i.__("Cannot Download"),body:i.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}});const u=i.__("File Operations");a&&a.addItem({command:o.download,category:u})}},k={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator],activate:(e,t,n)=>{const a=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:r}=e;r.addCommand(o.openBrowserTab,{execute:e=>{const n=void 0===e.path?"":e.path;if(n)return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(!t)throw new Error("Failed to open new browser tab.");t.opener=null,t.location.href=e}))},iconClass:e=>e.icon||"",label:()=>a.__("Open in New Browser Tab")})}},W=[b,y,_,x,C,D,k,w];var F,S;!function(e){e.createSaveButton=function(e,t){return(0,r.addCommandToolbarButtonClass)(r.ReactWidget.create(v.createElement(r.UseSignal,{signal:t},(()=>v.createElement(r.CommandToolbarButtonComponent,{commands:e,id:o.save,label:"",args:{toolbar:!0}})))))}}(F||(F={}));class I extends h.Widget{constructor(e,t,n="notebook"){super({node:S.createRevertConfirmNode(e,n,t)})}}function T(e,t){if(!e)return"File";const n=t.contextForWidget(e);if(!n)return"";const o=t.registry.getFileTypesForPath(n.path);return o.length&&o[0].displayName?o[0].displayName:"File"}!function(e){e.id=0,e.createRevertConfirmNode=function(e,t,n){const o=document.createElement("div"),a=document.createElement("p"),r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t)),l=document.createElement("strong");l.textContent=n.__("This cannot be undone."),a.appendChild(r),a.appendChild(l);const d=document.createElement("p"),s=document.createTextNode(n.__("The checkpoint was last updated at: ")),c=document.createElement("p"),u=new Date(e.last_modified);return c.style.textAlign="center",c.textContent=i.Time.format(u)+" ("+i.Time.formatHuman(u)+")",d.appendChild(s),d.appendChild(c),o.appendChild(a),o.appendChild(d),o},e.getTargetCheckpoint=async function(e,t){const n=e.map(((e,t)=>`${t}. ${i.Time.format(e.last_modified)} (${i.Time.formatHuman(e.last_modified)})`)),o=(await r.InputDialog.getItem({items:n,title:t.__("Choose a checkpoint")})).value;if(!o)return;const a=o.split(".",1)[0];return e[parseInt(a,10)]}}(S||(S={}))}}]);
@@ -1 +1 @@
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(86599),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(58038);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([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I,lineColItem:()=>b});var o=r(17260),i=r(69319),n=r(80890),a=r(42539),s=r(7201),d=r(88546),l=r(80864),c=r(70397),u=r(20998),g=r(27478),m=r.n(g),p=r(78156),h=r.n(p);const y="@jupyterlab/codemirror-extension:plugin",f={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:d.IEditorLanguageRegistry,optional:[a.ITranslator],activate:(e,t)=>{const o=new d.EditorLanguageRegistry;for(const e of d.EditorLanguageRegistry.getDefaultLanguages(t))o.addLanguage(e);return o.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[e,t]=await Promise.all([r.e(252).then(r.t.bind(r,252,23)),r.e(311).then(r.bind(r,60311))]);return e.markdown({base:e.markdownLanguage,codeLanguages:e=>o.findBest(e),extensions:[(0,d.parseMathIPython)(s.StreamLanguage.define(t.stexMath).parser)]})}}),o}},v={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:d.IEditorThemeRegistry,optional:[a.ITranslator],activate:(e,t)=>{const r=new d.EditorThemeRegistry;for(const e of d.EditorThemeRegistry.getDefaultThemes(t))r.addTheme(e);return r}},E={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:d.IEditorExtensionRegistry,requires:[d.IEditorThemeRegistry],optional:[a.ITranslator,l.ISettingRegistry,c.IFormRendererRegistry],activate:(e,t,r,o,i)=>{const n=new d.EditorExtensionRegistry;for(const e of d.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:r}))n.addExtension(e);if(o){const t=e=>{var t;n.baseConfiguration=null!==(t=e.get("defaultConfig").composite)&&void 0!==t?t:{}};Promise.all([o.load(y),e.restored]).then((([e])=>{t(e),e.changed.connect(t)})),null==i||i.addRenderer(`${y}.defaultConfig`,{fieldRenderer:e=>{const t=h().useMemo((()=>n.settingsSchema),[]),o={};for(const[e,r]of Object.entries(n.defaultConfiguration))void 0!==t[e]&&(o[e]=r);return h().createElement("div",{className:"jp-FormGroup-contentNormal"},h().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&h().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),h().createElement(c.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:!1},validator:m(),formData:{...o,...e.formData},formContext:{defaultFormData:o},liveValidate:!0,onChange:t=>{var r;const i={};for(const[e,n]of Object.entries(null!==(r=t.formData)&&void 0!==r?r:{})){const t=o[e];void 0!==t&&u.JSONExt.deepEqual(n,t)||(i[e]=n)}e.onChange(i)},tagName:"div",translator:null!=r?r:a.nullTranslator}))}})}return n}},x={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[d.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"shared-model-binding",factory:e=>{var t;const r=e.model.sharedModel;return d.EditorExtensionRegistry.createImmutableExtension((0,d.ybinding)({ytext:r.ysource,undoManager:null!==(t=r.undoManager)&&void 0!==t?t:void 0}))}})}},R={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:i.IEditorServices,requires:[d.IEditorLanguageRegistry,d.IEditorExtensionRegistry],optional:[a.ITranslator],activate:(e,t,r,o)=>({factoryService:new d.CodeMirrorEditorFactory({extensions:r,languages:t,translator:null!=o?o:a.nullTranslator}),mimeTypeService:new d.CodeMirrorMimeTypeService(t)})},b={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[a.ITranslator],optional:[o.ILabShell,n.IStatusBar],provides:i.IPositionModel,activate:(e,t,r,o)=>{const n=new i.LineCol(t),a=new Set;function s(e,t){Promise.all([...a].map((e=>e(t.newValue)))).then((e=>{var t;n.model.editor=null!==(t=e.filter((e=>null!==e))[0])&&void 0!==t?t:null})).catch((e=>{console.error("Get editors",e)}))}return o&&o.registerStatusItem(b.id,{priority:1,item:n,align:"right",rank:2,isActive:()=>!!n.model.editor}),r&&r.currentChanged.connect(s),{addEditorProvider:t=>{a.add(t),e.shell.currentWidget&&s(e.shell,{newValue:e.shell.currentWidget,oldValue:null})},update:()=>{s(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})}}}},I=[f,v,x,E,R,b]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I,lineColItem:()=>R});var o=r(3053),i=r(31536),n=r(34276),a=r(71677),s=r(7201),d=r(52337),l=r(36768),c=r(68239),u=r(20998),g=r(27478),m=r.n(g),p=r(78156),h=r.n(p);const y="@jupyterlab/codemirror-extension:plugin",f={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:d.IEditorLanguageRegistry,optional:[a.ITranslator],activate:(e,t)=>{const o=new d.EditorLanguageRegistry;for(const e of d.EditorLanguageRegistry.getDefaultLanguages(t))o.addLanguage(e);return o.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[e,t,i]=await Promise.all([r.e(252).then(r.t.bind(r,252,23)),Promise.all([r.e(9799),r.e(2552),r.e(890),r.e(459),r.e(3887),r.e(6361)]).then(r.bind(r,12552)),r.e(311).then(r.bind(r,60311))]),n=e.markdown({base:e.markdownLanguage,codeLanguages:e=>o.findBest(e),extensions:[(0,d.parseMathIPython)(s.StreamLanguage.define(i.stexMath).parser)]});return new s.LanguageSupport(n.language,[n.support,(0,d.pythonBuiltin)(t.pythonLanguage)])}}),o}},v={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:d.IEditorThemeRegistry,optional:[a.ITranslator],activate:(e,t)=>{const r=new d.EditorThemeRegistry;for(const e of d.EditorThemeRegistry.getDefaultThemes(t))r.addTheme(e);return r}},E={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:d.IEditorExtensionRegistry,requires:[d.IEditorThemeRegistry],optional:[a.ITranslator,l.ISettingRegistry,c.IFormRendererRegistry],activate:(e,t,r,o,i)=>{const n=new d.EditorExtensionRegistry;for(const e of d.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:r}))n.addExtension(e);if(o){const t=e=>{var t;n.baseConfiguration=null!==(t=e.get("defaultConfig").composite)&&void 0!==t?t:{}};Promise.all([o.load(y),e.restored]).then((([e])=>{t(e),e.changed.connect(t)})),null==i||i.addRenderer(`${y}.defaultConfig`,{fieldRenderer:e=>{const t=h().useMemo((()=>n.settingsSchema),[]),o={};for(const[e,r]of Object.entries(n.defaultConfiguration))void 0!==t[e]&&(o[e]=r);return h().createElement("div",{className:"jp-FormGroup-contentNormal"},h().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&h().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),h().createElement(c.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:!1},validator:m(),formData:{...o,...e.formData},formContext:{defaultFormData:o},liveValidate:!0,onChange:t=>{var r;const i={};for(const[e,n]of Object.entries(null!==(r=t.formData)&&void 0!==r?r:{})){const t=o[e];void 0!==t&&u.JSONExt.deepEqual(n,t)||(i[e]=n)}e.onChange(i)},tagName:"div",translator:null!=r?r:a.nullTranslator}))}})}return n}},x={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[d.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"shared-model-binding",factory:e=>{var t;const r=e.model.sharedModel;return d.EditorExtensionRegistry.createImmutableExtension((0,d.ybinding)({ytext:r.ysource,undoManager:null!==(t=r.undoManager)&&void 0!==t?t:void 0}))}})}},b={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:i.IEditorServices,requires:[d.IEditorLanguageRegistry,d.IEditorExtensionRegistry],optional:[a.ITranslator],activate:(e,t,r,o)=>({factoryService:new d.CodeMirrorEditorFactory({extensions:r,languages:t,translator:null!=o?o:a.nullTranslator}),mimeTypeService:new d.CodeMirrorMimeTypeService(t)})},R={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[a.ITranslator],optional:[o.ILabShell,n.IStatusBar],provides:i.IPositionModel,activate:(e,t,r,o)=>{const n=new i.LineCol(t),a=new Set;function s(e,t){Promise.all([...a].map((e=>e(t.newValue)))).then((e=>{var t;n.model.editor=null!==(t=e.filter((e=>null!==e))[0])&&void 0!==t?t:null})).catch((e=>{console.error("Get editors",e)}))}return o&&o.registerStatusItem(R.id,{priority:1,item:n,align:"right",rank:2,isActive:()=>!!n.model.editor}),r&&r.currentChanged.connect(s),{addEditorProvider:t=>{a.add(t),e.shell.currentWidget&&s(e.shell,{newValue:e.shell.currentWidget,oldValue:null})},update:()=>{s(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})}}}},I=[f,v,x,E,b,R]}}]);
@@ -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(95585),s=a(81997),n=a(31516),l=a(42539),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(95585),s=a(81997),n=a(31516),l=a(71677),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([[2007,2607],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(70397),i=s(33625),a=s(31516),u=s(98244);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2007,2607],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(68239),i=s(33625),a=s(31516),u=s(12982);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2067],{32067:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>l,ConsolePanel:()=>S,ForeignHandler:()=>i,IConsoleTracker:()=>k});var o,n=s(81997);class i{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,n.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class l{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,n.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(o.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(o||(o={}));var r=s(98244),a=s(70788),h=s(8627),d=s(42539),c=s(70397),u=s(20998),p=s(31516),_=s(17811),C=s(30890),m=s(23781),g=s(58601),y=s(50007),f=s(99615);const v="jp-Console-cell",w="jp-CodeConsole-promptCell";class x extends p.Widget{constructor(e){var t,s;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new n.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new n.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:d.nullTranslator,this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.tabIndex=-1;const o=this.layout=new p.PanelLayout;this._cells=new y.ObservableList,this._content=new p.Panel,this._input=new p.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(s=e.modelFactory)&&void 0!==s?s:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),o.addWidget(this._content),o.addWidget(this._input),this._history=new l({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(v),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new g.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,g.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let o=e.target;const n=e=>e.classList.contains(v);let i=g.CellDragUtils.findCell(o,this._cells,n);if(-1===i&&(o=document.elementFromPoint(e.clientX,e.clientY),i=g.CellDragUtils.findCell(o,this._cells,n)),-1===i)return;const l=this._cells.get(i);"prompt"===g.CellDragUtils.detectTargetArea(l,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:i},this._focusedCell=l,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&g.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const o=this._focusedCell.model,n=[o.toJSON()],i=g.CellDragUtils.createCellDragImage(this._focusedCell,n);this._drag=new f.Drag({mimeData:new u.MimeData,dragImage:i,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",n);const l=o.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",l),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;t&&(t.readOnly=!0,t.removeClass(w),n.Signal.clearData(t.editor),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t));const o=this.contentFactory,i=this._createCodeCellOptions();t=o.createCodeCell(i),t.model.mimeType=this._mimetype,t.addClass(w),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){D.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_execute(e){const t=e.model.sharedModel.getSource();return this._history.push(t),"clear"===t||"%clear"===t?(this.clear(),Promise.resolve(void 0)):(e.model.contentChanged.connect(this.update,this),g.CodeCell.execute(e,this.sessionContext).then((t=>{if(!this.isDisposed){if(t&&"ok"===t.content.status){const s=t.content;if(s.payload&&s.payload.length){const t=s.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}}else if(t&&"error"===t.content.status)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("");e.model.contentChanged.disconnect(this.update,this),this.update(),this._executed.emit(new Date)}}),(()=>{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())})))}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const e=this.contentFactory,t=this.modelFactory.createCodeCell({}),s=this.rendermime,o=this.editorConfig,n=C.EditorView.domEventHandlers({keydown:(e,t)=>13===e.keyCode&&(e.preventDefault(),!0)});return{model:t,rendermime:s,contentFactory:e,editorConfig:o,editorExtensions:[_.Prec.high(n)],placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}}var D,b;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends g.Cell.ContentFactory{createCodeCell(e){return new g.CodeCell(e).initializeState()}createRawCell(e){return new g.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||g.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new g.CodeCellModel(e)}createRawCell(e){return new g.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(D||(D={}));class S extends r.MainAreaWidget{constructor(e){super({content:new p.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{rendermime:t,mimeTypeService:s,path:o,basePath:n,name:i,manager:l,modelFactory:_,sessionContext:C,translator:m}=e;this.translator=null!=m?m:d.nullTranslator;const g=this.translator.load("jupyterlab"),y=this.contentFactory=e.contentFactory,f=b.count++;o||(o=a.PathExt.join(n||"",`console-${f}-${u.UUID.uuid4()}`)),C=this._sessionContext=null!=C?C:new r.SessionContext({sessionManager:l.sessions,specsManager:l.kernelspecs,path:l.contents.localPath(o),name:i||g.__("Console %1",f),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const v=new h.RenderMimeRegistry.UrlResolver({path:o,contents:l.contents});t=t.clone({resolver:v}),this.console=y.createConsole({rendermime:t,sessionContext:C,mimeTypeService:s,contentFactory:y,modelFactory:_,translator:m}),this.content.addWidget(this.console),C.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new r.SessionContextDialogs({translator:m})).selectKernel(C),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),C.kernelChanged.connect(this._updateTitlePanel,this),C.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=c.consoleIcon,this.title.closable=!0,this.id=`console-${f}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){b.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new u.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(S||(S={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||d.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",a.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",a.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(b||(b={}));const k=new u.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2067],{32067:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>l,ConsolePanel:()=>k,ForeignHandler:()=>i,IConsoleTracker:()=>S});var o,n=s(81997);class i{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,n.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class l{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,n.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(o.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(o||(o={}));var r=s(12982),a=s(38639),h=s(70856),d=s(71677),c=s(68239),u=s(20998),p=s(31516),_=s(17811),C=s(30890),m=s(23781),g=s(24912),y=s(11351),f=s(99615);const v="jp-Console-cell",w="jp-CodeConsole-promptCell";class x extends p.Widget{constructor(e){var t,s;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new n.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new n.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:d.nullTranslator,this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.dataset.jpUndoer="true",this.node.tabIndex=-1;const o=this.layout=new p.PanelLayout;this._cells=new y.ObservableList,this._content=new p.Panel,this._input=new p.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(s=e.modelFactory)&&void 0!==s?s:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),o.addWidget(this._content),o.addWidget(this._input),this._history=new l({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(v),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new g.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,g.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let o=e.target;const n=e=>e.classList.contains(v);let i=g.CellDragUtils.findCell(o,this._cells,n);if(-1===i&&(o=document.elementFromPoint(e.clientX,e.clientY),i=g.CellDragUtils.findCell(o,this._cells,n)),-1===i)return;const l=this._cells.get(i);"prompt"===g.CellDragUtils.detectTargetArea(l,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:i},this._focusedCell=l,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&g.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const o=this._focusedCell.model,n=[o.toJSON()],i=g.CellDragUtils.createCellDragImage(this._focusedCell,n);this._drag=new f.Drag({mimeData:new u.MimeData,dragImage:i,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",n);const l=o.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",l),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),t.addEventListener("focusin",this),t.addEventListener("focusout",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this),t.removeEventListener("focusin",this),t.removeEventListener("focusout",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;if(t){t.readOnly=!0,t.removeClass(w);const o=t;requestIdleCallback((()=>{n.Signal.clearData(o.editor)})),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t)}const o=this.contentFactory,i=this._createCodeCellOptions();t=o.createCodeCell(i),t.model.mimeType=this._mimetype,t.addClass(w),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){D.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_evtFocusIn(e){this._updateReadWrite()}_evtFocusOut(e){this._updateReadWrite()}_execute(e){const t=e.model.sharedModel.getSource();return this._history.push(t),"clear"===t||"%clear"===t?(this.clear(),Promise.resolve(void 0)):(e.model.contentChanged.connect(this.update,this),g.CodeCell.execute(e,this.sessionContext).then((t=>{if(!this.isDisposed){if(t&&"ok"===t.content.status){const s=t.content;if(s.payload&&s.payload.length){const t=s.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}}else if(t&&"error"===t.content.status)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("");e.model.contentChanged.disconnect(this.update,this),this.update(),this._executed.emit(new Date)}}),(()=>{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())})))}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const{node:e}=this,t=this.contentFactory,s=this.modelFactory.createCodeCell({}),o=this.rendermime,n=this.editorConfig,i=C.EditorView.domEventHandlers({keydown:(t,s)=>13===t.keyCode&&"terminal"===e.dataset.jpInteractionMode&&(t.preventDefault(),!0)});return{model:s,rendermime:o,contentFactory:t,editorConfig:n,editorExtensions:[_.Prec.high(i)],placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}_updateReadWrite(){const e=r.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle("jp-mod-readWrite",e)}}var D,b;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends g.Cell.ContentFactory{createCodeCell(e){return new g.CodeCell(e).initializeState()}createRawCell(e){return new g.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||g.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new g.CodeCellModel(e)}createRawCell(e){return new g.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(D||(D={}));class k extends r.MainAreaWidget{constructor(e){super({content:new p.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{rendermime:t,mimeTypeService:s,path:o,basePath:n,name:i,manager:l,modelFactory:_,sessionContext:C,translator:m}=e;this.translator=null!=m?m:d.nullTranslator;const g=this.translator.load("jupyterlab"),y=this.contentFactory=e.contentFactory,f=b.count++;o||(o=a.PathExt.join(n||"",`console-${f}-${u.UUID.uuid4()}`)),C=this._sessionContext=null!=C?C:new r.SessionContext({sessionManager:l.sessions,specsManager:l.kernelspecs,path:l.contents.localPath(o),name:i||g.__("Console %1",f),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const v=new h.RenderMimeRegistry.UrlResolver({path:o,contents:l.contents});t=t.clone({resolver:v}),this.console=y.createConsole({rendermime:t,sessionContext:C,mimeTypeService:s,contentFactory:y,modelFactory:_,translator:m}),this.content.addWidget(this.console),C.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new r.SessionContextDialogs({translator:m})).selectKernel(C),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),C.kernelChanged.connect(this._updateTitlePanel,this),C.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=c.consoleIcon,this.title.closable=!0,this.id=`console-${f}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){b.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new u.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(k||(k={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||d.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",a.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",a.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(b||(b={}));const S=new u.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2088,6604],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(57978),r=t(70788),l=t(41960),s=t(87718),a=t(8627),d=t(49341),c=t(42539),u=t(33625),p=t(31516);!function(e){e.dismiss="tooltip:dismiss",e.launchConsole="tooltip:launch-console",e.launchNotebook="tooltip:launch-notebook",e.launchFile="tooltip:launch-file"}(n||(n={}));const m={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:!0,optional:[c.ITranslator],provides:d.ITooltipManager,activate:(e,o)=>{const t=(null!=o?o:c.nullTranslator).load("jupyterlab");let i=null;return e.commands.addCommand(n.dismiss,{label:t.__("Dismiss the tooltip"),execute:()=>{i&&(i.dispose(),i=null)}}),{invoke(e){const{anchor:o,editor:t,kernel:n,rendermime:r}=e;return i&&(i.dispose(),i=null),T.fetch({detail:0,editor:t,kernel:n}).then((e=>{i=new d.Tooltip({anchor:o,bundle:e,editor:t,rendermime:r}),p.Widget.attach(i,document.body)})).catch((()=>{}))}}}},h={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,i.IConsoleTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchConsole,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.console,l=null===(e=r.promptCell)||void 0===e?void 0:e.editor,s=null===(n=r.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},v={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,s.INotebookTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchNotebook,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.content,l=null===(e=r.activeCell)||void 0===e?void 0:e.editor,s=null===(n=i.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,l.IEditorTracker,a.IRenderMimeRegistry],activate:(e,o,t,i,r)=>{const l=(null!=r?r:c.nullTranslator).load("jupyterlab"),s={},a=e.serviceManager.sessions,d=(e,o)=>{t.forEach((e=>{const t=(0,u.find)(o,(o=>e.context.path===o.path));if(t){const o=s[e.id];if(o&&o.id===t.id)return;o&&(delete s[e.id],o.dispose());const n=a.connectTo({model:t});s[e.id]=n}else{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}}))};d(0,a.running()),a.runningChanged.connect(d),t.widgetAdded.connect(((e,o)=>{o.disposed.connect((e=>{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}))})),e.commands.addCommand(n.launchFile,{label:l.__("Open the tooltip"),execute:async()=>{const e=t.currentWidget,n=e&&s[e.id]&&s[e.id].kernel;if(!n)return;const r=e.content,l=null==r?void 0:r.editor;return l&&n&&i?o.invoke({anchor:r,editor:l,kernel:n,rendermime:i}):void 0}})}},b=[m,h,v,k];var T;!function(e){let o=0;e.fetch=function(e){const{detail:t,editor:n,kernel:i}=e,l=n.model.sharedModel.getSource(),s=n.getCursorPosition(),a=r.Text.jsIndexToCharIndex(n.getOffsetAt(s),l);if(!l||!i)return Promise.reject(void 0);const d={code:l,cursor_pos:a,detail_level:t||0},c=++o;return i.requestInspect(d).then((e=>{const t=e.content;return c!==o?Promise.reject(void 0):"ok"===t.status&&t.found?Promise.resolve(t.data):Promise.reject(void 0)}))}}(T||(T={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2088,6604],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(46122),r=t(38639),l=t(89421),s=t(43833),a=t(70856),d=t(53757),c=t(71677),u=t(33625),p=t(31516);!function(e){e.dismiss="tooltip:dismiss",e.launchConsole="tooltip:launch-console",e.launchNotebook="tooltip:launch-notebook",e.launchFile="tooltip:launch-file"}(n||(n={}));const m={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:!0,optional:[c.ITranslator],provides:d.ITooltipManager,activate:(e,o)=>{const t=(null!=o?o:c.nullTranslator).load("jupyterlab");let i=null;return e.commands.addCommand(n.dismiss,{label:t.__("Dismiss the tooltip"),execute:()=>{i&&(i.dispose(),i=null)}}),{invoke(e){const{anchor:o,editor:t,kernel:n,rendermime:r}=e;return i&&(i.dispose(),i=null),T.fetch({detail:0,editor:t,kernel:n}).then((e=>{i=new d.Tooltip({anchor:o,bundle:e,editor:t,rendermime:r}),p.Widget.attach(i,document.body)})).catch((()=>{}))}}}},h={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,i.IConsoleTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchConsole,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.console,l=null===(e=r.promptCell)||void 0===e?void 0:e.editor,s=null===(n=r.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},v={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,s.INotebookTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchNotebook,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.content,l=null===(e=r.activeCell)||void 0===e?void 0:e.editor,s=null===(n=i.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,l.IEditorTracker,a.IRenderMimeRegistry],activate:(e,o,t,i,r)=>{const l=(null!=r?r:c.nullTranslator).load("jupyterlab"),s={},a=e.serviceManager.sessions,d=(e,o)=>{t.forEach((e=>{const t=(0,u.find)(o,(o=>e.context.path===o.path));if(t){const o=s[e.id];if(o&&o.id===t.id)return;o&&(delete s[e.id],o.dispose());const n=a.connectTo({model:t});s[e.id]=n}else{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}}))};d(0,a.running()),a.runningChanged.connect(d),t.widgetAdded.connect(((e,o)=>{o.disposed.connect((e=>{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}))})),e.commands.addCommand(n.launchFile,{label:l.__("Open the tooltip"),execute:async()=>{const e=t.currentWidget,n=e&&s[e.id]&&s[e.id].kernel;if(!n)return;const r=e.content,l=null==r?void 0:r.editor;return l&&n&&i?o.invoke({anchor:r,editor:l,kernel:n,rendermime:i}):void 0}})}},b=[m,h,v,k];var T;!function(e){let o=0;e.fetch=function(e){const{detail:t,editor:n,kernel:i}=e,l=n.model.sharedModel.getSource(),s=n.getCursorPosition(),a=r.Text.jsIndexToCharIndex(n.getOffsetAt(s),l);if(!l||!i)return Promise.reject(void 0);const d={code:l,cursor_pos:a,detail_level:t||0},c=++o;return i.requestInspect(d).then((e=>{const t=e.content;return c!==o?Promise.reject(void 0):"ok"===t.status&&t.found?Promise.resolve(t.data):Promise.reject(void 0)}))}}(T||(T={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2089],{2089:(e,t,s)=>{s.r(t),s.d(t,{ILoggerRegistry:()=>d,LogConsolePanel:()=>w,LogOutputModel:()=>a,Logger:()=>u,LoggerOutputAreaModel:()=>l,LoggerRegistry:()=>g,ScrollingWidget:()=>v});var i,r=s(12226),n=s(8627),o=s(81997);class a extends n.OutputModel{constructor(e){super(e),this.timestamp=new Date(e.value.timestamp),this.level=e.value.level}}class h extends r.OutputAreaModel.ContentFactory{createOutputModel(e){return new a(e)}}class l extends r.OutputAreaModel{constructor({maxLength:e,...t}){super(t),this.maxLength=e}add(e){return super.add(e),this._applyMaxLength(),this.length}shouldCombine(e){const{value:t,lastModel:s}=e;return Math.trunc(s.timestamp.getTime()/1e3)===Math.trunc(t.timestamp/1e3)}get(e){return super.get(e)}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._applyMaxLength()}_applyMaxLength(){this.list.length>this._maxLength&&this.list.removeRange(0,this.list.length-this._maxLength)}}class u{constructor(e){this._isDisposed=!1,this._contentChanged=new o.Signal(this),this._stateChanged=new o.Signal(this),this._rendermime=null,this._version=0,this._level="warning",this.source=e.source,this.outputAreaModel=new l({contentFactory:new h,maxLength:e.maxLength})}get maxLength(){return this.outputAreaModel.maxLength}set maxLength(e){this.outputAreaModel.maxLength=e}get level(){return this._level}set level(e){const t=this._level;t!==e&&(this._level=e,this._log({output:{output_type:"display_data",data:{"text/plain":`Log level set to ${e}`}},level:"metadata"}),this._stateChanged.emit({name:"level",oldValue:t,newValue:e}))}get length(){return this.outputAreaModel.length}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get rendermime(){return this._rendermime}set rendermime(e){if(e!==this._rendermime){const t=this._rendermime,s=this._rendermime=e;this._stateChanged.emit({name:"rendermime",oldValue:t,newValue:s})}}get version(){return this._version}log(e){if(i.LogLevel[e.level]<i.LogLevel[this._level])return;let t=null;switch(e.type){case"text":t={output_type:"display_data",data:{"text/plain":e.data}};break;case"html":t={output_type:"display_data",data:{"text/html":e.data}};break;case"output":t=e.data}t&&this._log({output:t,level:e.level})}clear(){this.outputAreaModel.clear(!1),this._contentChanged.emit("clear")}checkpoint(){this._log({output:{output_type:"display_data",data:{"text/html":"<hr/>"}},level:"metadata"})}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.clear(),this._rendermime=null,o.Signal.clearData(this))}_log(e){this._version++,this.outputAreaModel.add({...e.output,timestamp:Date.now(),level:e.level}),this._contentChanged.emit("append")}}!function(e){let t;!function(e){e[e.debug=0]="debug",e[e.info=1]="info",e[e.warning=2]="warning",e[e.error=3]="error",e[e.critical=4]="critical",e[e.metadata=5]="metadata"}(t=e.LogLevel||(e.LogLevel={}))}(i||(i={}));class g{constructor(e){this._loggers=new Map,this._registryChanged=new o.Signal(this),this._isDisposed=!1,this._defaultRendermime=e.defaultRendermime,this._maxLength=e.maxLength}getLogger(e){const t=this._loggers;let s=t.get(e);return s||(s=new u({source:e,maxLength:this.maxLength}),s.rendermime=this._defaultRendermime,t.set(e,s),this._registryChanged.emit("append"),s)}getLoggers(){return Array.from(this._loggers.values())}get registryChanged(){return this._registryChanged}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._loggers.forEach((t=>{t.maxLength=e}))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._loggers.forEach((e=>e.dispose())),o.Signal.clearData(this))}}const d=new(s(20998).Token)("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure.");var c=s(42539),_=s(31516);class p extends _.Widget{constructor(){super(),this._timestampNode=document.createElement("div"),this.node.append(this._timestampNode)}set timestamp(e){this._timestamp=e,this._timestampNode.innerHTML=this._timestamp.toLocaleTimeString(),this.update()}set level(e){this._level=e,this.node.dataset.logLevel=e,this.update()}update(){var e;void 0!==this._level&&void 0!==this._timestamp&&(this.node.title=`${this._timestamp.toLocaleString()}; ${e=this._level,0===e.length?e:e[0].toUpperCase()+e.slice(1)} level`)}}class m extends r.OutputArea{createOutputItem(e){const t=super.createOutputItem(e);if(null===t)return null;const s=t.widgets[0];return s.timestamp=e.timestamp,s.level=e.level,t}onInputRequest(e,t){}}class L extends r.OutputArea.ContentFactory{createOutputPrompt(){return new p}}class v extends _.Widget{constructor({content:e,...t}){super(t),this._observer=null,this.addClass("jp-Scrolling"),(this.layout=new _.PanelLayout).addWidget(e),this._content=e,this._sentinel=document.createElement("div"),this.node.appendChild(this._sentinel)}get content(){return this._content}onAfterAttach(e){super.onAfterAttach(e),requestAnimationFrame((()=>{this._sentinel.scrollIntoView(),this._scrollHeight=this.node.scrollHeight})),"undefined"!=typeof IntersectionObserver&&(this._observer=new IntersectionObserver((e=>{this._handleScroll(e)}),{root:this.node,threshold:1}),this._observer.observe(this._sentinel))}onBeforeDetach(e){this._observer&&this._observer.disconnect()}onAfterShow(e){this._tracking&&this._sentinel.scrollIntoView()}_handleScroll([e]){if(e.isIntersecting)this._tracking=!0;else if(this.isVisible){const e=this.node.scrollHeight;e===this._scrollHeight?this._tracking=!1:(this._sentinel.scrollIntoView(),this._scrollHeight=e,this._tracking=!0)}}}class w extends _.StackedPanel{constructor(e,t){super(),this._outputAreas=new Map,this._source=null,this._sourceChanged=new o.Signal(this),this._sourceDisplayed=new o.Signal(this),this._loggersWatched=new Set,this.translator=t||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._loggerRegistry=e,this.addClass("jp-LogConsolePanel"),e.registryChanged.connect(((e,t)=>{this._bindLoggerSignals()}),this),this._bindLoggerSignals(),this._placeholder=new _.Widget,this._placeholder.addClass("jp-LogConsoleListPlaceholder"),this.addWidget(this._placeholder)}get loggerRegistry(){return this._loggerRegistry}get logger(){return null===this.source?null:this.loggerRegistry.getLogger(this.source)}get source(){return this._source}set source(e){if(e===this._source)return;const t=this._source,s=this._source=e;this._showOutputFromSource(s),this._handlePlaceholder(),this._sourceChanged.emit({oldValue:t,newValue:s,name:"source"})}get sourceVersion(){const e=this.source;return null!==e?this._loggerRegistry.getLogger(e).version:null}get sourceChanged(){return this._sourceChanged}get sourceDisplayed(){return this._sourceDisplayed}onAfterAttach(e){super.onAfterAttach(e),this._updateOutputAreas(),this._showOutputFromSource(this._source),this._handlePlaceholder()}onAfterShow(e){super.onAfterShow(e),null!==this.source&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}_bindLoggerSignals(){const e=this._loggerRegistry.getLoggers();for(const t of e)this._loggersWatched.has(t.source)||(t.contentChanged.connect(((e,t)=>{this._updateOutputAreas(),this._handlePlaceholder()}),this),t.stateChanged.connect(((e,t)=>{if("rendermime"!==t.name)return;const s=`source:${e.source}`,i=this._outputAreas.get(s);i&&(t.newValue?i.rendermime=t.newValue:i.dispose())}),this),this._loggersWatched.add(t.source))}_showOutputFromSource(e){const t=null===e?"null source":`source:${e}`;this._outputAreas.forEach(((e,s)=>{var i,r;e.id===t?(null===(i=e.parent)||void 0===i||i.show(),e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})):null===(r=e.parent)||void 0===r||r.hide()}));const s=null===e?this._trans.__("Log Console"):this._trans.__("Log: %1",e);this.title.label=s,this.title.caption=s}_handlePlaceholder(){null===this.source?(this._placeholder.node.textContent=this._trans.__("No source selected."),this._placeholder.show()):0===this._loggerRegistry.getLogger(this.source).length?(this._placeholder.node.textContent=this._trans.__("No log messages."),this._placeholder.show()):(this._placeholder.hide(),this._placeholder.node.textContent="")}_updateOutputAreas(){const e=new Set,t=this._loggerRegistry.getLoggers();for(const s of t){const t=s.source,i=`source:${t}`;if(e.add(i),!this._outputAreas.has(i)){const e=new m({rendermime:s.rendermime,contentFactory:new L,model:s.outputAreaModel});e.id=i;const r=new v({content:e});this.addWidget(r),this._outputAreas.set(i,e);const n=e=>{this.source===t&&e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})};e.outputLengthChanged.connect(n,this),n(e)}}const s=this._outputAreas.keys();for(const t of s)if(!e.has(t)){const e=this._outputAreas.get(t);null==e||e.dispose(),this._outputAreas.delete(t)}}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2089],{2089:(e,t,s)=>{s.r(t),s.d(t,{ILoggerRegistry:()=>d,LogConsolePanel:()=>w,LogOutputModel:()=>a,Logger:()=>u,LoggerOutputAreaModel:()=>l,LoggerRegistry:()=>g,ScrollingWidget:()=>v});var i,r=s(51099),n=s(70856),o=s(81997);class a extends n.OutputModel{constructor(e){super(e),this.timestamp=new Date(e.value.timestamp),this.level=e.value.level}}class h extends r.OutputAreaModel.ContentFactory{createOutputModel(e){return new a(e)}}class l extends r.OutputAreaModel{constructor({maxLength:e,...t}){super(t),this.maxLength=e}add(e){return super.add(e),this._applyMaxLength(),this.length}shouldCombine(e){const{value:t,lastModel:s}=e;return Math.trunc(s.timestamp.getTime()/1e3)===Math.trunc(t.timestamp/1e3)}get(e){return super.get(e)}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._applyMaxLength()}_applyMaxLength(){this.list.length>this._maxLength&&this.list.removeRange(0,this.list.length-this._maxLength)}}class u{constructor(e){this._isDisposed=!1,this._contentChanged=new o.Signal(this),this._stateChanged=new o.Signal(this),this._rendermime=null,this._version=0,this._level="warning",this.source=e.source,this.outputAreaModel=new l({contentFactory:new h,maxLength:e.maxLength})}get maxLength(){return this.outputAreaModel.maxLength}set maxLength(e){this.outputAreaModel.maxLength=e}get level(){return this._level}set level(e){const t=this._level;t!==e&&(this._level=e,this._log({output:{output_type:"display_data",data:{"text/plain":`Log level set to ${e}`}},level:"metadata"}),this._stateChanged.emit({name:"level",oldValue:t,newValue:e}))}get length(){return this.outputAreaModel.length}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get rendermime(){return this._rendermime}set rendermime(e){if(e!==this._rendermime){const t=this._rendermime,s=this._rendermime=e;this._stateChanged.emit({name:"rendermime",oldValue:t,newValue:s})}}get version(){return this._version}log(e){if(i.LogLevel[e.level]<i.LogLevel[this._level])return;let t=null;switch(e.type){case"text":t={output_type:"display_data",data:{"text/plain":e.data}};break;case"html":t={output_type:"display_data",data:{"text/html":e.data}};break;case"output":t=e.data}t&&this._log({output:t,level:e.level})}clear(){this.outputAreaModel.clear(!1),this._contentChanged.emit("clear")}checkpoint(){this._log({output:{output_type:"display_data",data:{"text/html":"<hr/>"}},level:"metadata"})}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.clear(),this._rendermime=null,o.Signal.clearData(this))}_log(e){this._version++,this.outputAreaModel.add({...e.output,timestamp:Date.now(),level:e.level}),this._contentChanged.emit("append")}}!function(e){let t;!function(e){e[e.debug=0]="debug",e[e.info=1]="info",e[e.warning=2]="warning",e[e.error=3]="error",e[e.critical=4]="critical",e[e.metadata=5]="metadata"}(t=e.LogLevel||(e.LogLevel={}))}(i||(i={}));class g{constructor(e){this._loggers=new Map,this._registryChanged=new o.Signal(this),this._isDisposed=!1,this._defaultRendermime=e.defaultRendermime,this._maxLength=e.maxLength}getLogger(e){const t=this._loggers;let s=t.get(e);return s||(s=new u({source:e,maxLength:this.maxLength}),s.rendermime=this._defaultRendermime,t.set(e,s),this._registryChanged.emit("append"),s)}getLoggers(){return Array.from(this._loggers.values())}get registryChanged(){return this._registryChanged}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._loggers.forEach((t=>{t.maxLength=e}))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._loggers.forEach((e=>e.dispose())),o.Signal.clearData(this))}}const d=new(s(20998).Token)("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure.");var c=s(71677),_=s(31516);class p extends _.Widget{constructor(){super(),this._timestampNode=document.createElement("div"),this.node.append(this._timestampNode)}set timestamp(e){this._timestamp=e,this._timestampNode.innerHTML=this._timestamp.toLocaleTimeString(),this.update()}set level(e){this._level=e,this.node.dataset.logLevel=e,this.update()}update(){var e;void 0!==this._level&&void 0!==this._timestamp&&(this.node.title=`${this._timestamp.toLocaleString()}; ${e=this._level,0===e.length?e:e[0].toUpperCase()+e.slice(1)} level`)}}class m extends r.OutputArea{createOutputItem(e){const t=super.createOutputItem(e);if(null===t)return null;const s=t.widgets[0];return s.timestamp=e.timestamp,s.level=e.level,t}onInputRequest(e,t){}}class L extends r.OutputArea.ContentFactory{createOutputPrompt(){return new p}}class v extends _.Widget{constructor({content:e,...t}){super(t),this._observer=null,this.addClass("jp-Scrolling"),(this.layout=new _.PanelLayout).addWidget(e),this._content=e,this._sentinel=document.createElement("div"),this.node.appendChild(this._sentinel)}get content(){return this._content}onAfterAttach(e){super.onAfterAttach(e),requestAnimationFrame((()=>{this._sentinel.scrollIntoView(),this._scrollHeight=this.node.scrollHeight})),"undefined"!=typeof IntersectionObserver&&(this._observer=new IntersectionObserver((e=>{this._handleScroll(e)}),{root:this.node,threshold:1}),this._observer.observe(this._sentinel))}onBeforeDetach(e){this._observer&&this._observer.disconnect()}onAfterShow(e){this._tracking&&this._sentinel.scrollIntoView()}_handleScroll([e]){if(e.isIntersecting)this._tracking=!0;else if(this.isVisible){const e=this.node.scrollHeight;e===this._scrollHeight?this._tracking=!1:(this._sentinel.scrollIntoView(),this._scrollHeight=e,this._tracking=!0)}}}class w extends _.StackedPanel{constructor(e,t){super(),this._outputAreas=new Map,this._source=null,this._sourceChanged=new o.Signal(this),this._sourceDisplayed=new o.Signal(this),this._loggersWatched=new Set,this.translator=t||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._loggerRegistry=e,this.addClass("jp-LogConsolePanel"),e.registryChanged.connect(((e,t)=>{this._bindLoggerSignals()}),this),this._bindLoggerSignals(),this._placeholder=new _.Widget,this._placeholder.addClass("jp-LogConsoleListPlaceholder"),this.addWidget(this._placeholder)}get loggerRegistry(){return this._loggerRegistry}get logger(){return null===this.source?null:this.loggerRegistry.getLogger(this.source)}get source(){return this._source}set source(e){if(e===this._source)return;const t=this._source,s=this._source=e;this._showOutputFromSource(s),this._handlePlaceholder(),this._sourceChanged.emit({oldValue:t,newValue:s,name:"source"})}get sourceVersion(){const e=this.source;return null!==e?this._loggerRegistry.getLogger(e).version:null}get sourceChanged(){return this._sourceChanged}get sourceDisplayed(){return this._sourceDisplayed}onAfterAttach(e){super.onAfterAttach(e),this._updateOutputAreas(),this._showOutputFromSource(this._source),this._handlePlaceholder()}onAfterShow(e){super.onAfterShow(e),null!==this.source&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}_bindLoggerSignals(){const e=this._loggerRegistry.getLoggers();for(const t of e)this._loggersWatched.has(t.source)||(t.contentChanged.connect(((e,t)=>{this._updateOutputAreas(),this._handlePlaceholder()}),this),t.stateChanged.connect(((e,t)=>{if("rendermime"!==t.name)return;const s=`source:${e.source}`,i=this._outputAreas.get(s);i&&(t.newValue?i.rendermime=t.newValue:i.dispose())}),this),this._loggersWatched.add(t.source))}_showOutputFromSource(e){const t=null===e?"null source":`source:${e}`;this._outputAreas.forEach(((e,s)=>{var i,r;e.id===t?(null===(i=e.parent)||void 0===i||i.show(),e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})):null===(r=e.parent)||void 0===r||r.hide()}));const s=null===e?this._trans.__("Log Console"):this._trans.__("Log: %1",e);this.title.label=s,this.title.caption=s}_handlePlaceholder(){null===this.source?(this._placeholder.node.textContent=this._trans.__("No source selected."),this._placeholder.show()):0===this._loggerRegistry.getLogger(this.source).length?(this._placeholder.node.textContent=this._trans.__("No log messages."),this._placeholder.show()):(this._placeholder.hide(),this._placeholder.node.textContent="")}_updateOutputAreas(){const e=new Set,t=this._loggerRegistry.getLoggers();for(const s of t){const t=s.source,i=`source:${t}`;if(e.add(i),!this._outputAreas.has(i)){const e=new m({rendermime:s.rendermime,contentFactory:new L,model:s.outputAreaModel});e.id=i;const r=new v({content:e});this.addWidget(r),this._outputAreas.set(i,e);const n=e=>{this.source===t&&e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})};e.outputLengthChanged.connect(n,this),n(e)}}const s=this._outputAreas.keys();for(const t of s)if(!e.has(t)){const e=this._outputAreas.get(t);null==e||e.dispose(),this._outputAreas.delete(t)}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2122],{92122:(t,e,o)=>{o.r(e),o.d(e,{default:()=>i});var a=o(80864),l=o(36665),n=o(98244),r=o(42539);const s={id:"@jupyterlab/cell-toolbar-extension:plugin",description:"Add the cells toolbar.",autoStart:!0,activate:async(t,e,o,a)=>{const i=e&&o?(0,n.createToolbarFactory)(o,e,l.CellBarExtension.FACTORY_NAME,s.id,null!=a?a:r.nullTranslator):void 0;t.docRegistry.addWidgetExtension("Notebook",new l.CellBarExtension(t.commands,i))},optional:[a.ISettingRegistry,n.IToolbarWidgetRegistry,r.ITranslator]},i=s}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2122],{92122:(t,e,o)=>{o.r(e),o.d(e,{default:()=>i});var a=o(36768),l=o(35526),n=o(12982),r=o(71677);const s={id:"@jupyterlab/cell-toolbar-extension:plugin",description:"Add the cells toolbar.",autoStart:!0,activate:async(t,e,o,a)=>{const i=e&&o?(0,n.createToolbarFactory)(o,e,l.CellBarExtension.FACTORY_NAME,s.id,null!=a?a:r.nullTranslator):void 0;t.docRegistry.addWidgetExtension("Notebook",new l.CellBarExtension(t.commands,i))},optional:[a.ISettingRegistry,n.IToolbarWidgetRegistry,r.ITranslator]},i=s}}]);