notebook 7.3.0a0__py3-none-any.whl → 7.3.0a1__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 (183) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/113.bundle.js +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/1226.bundle.js +1 -1
  5. notebook/static/131.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1408.bundle.js +1 -1
  8. notebook/static/1496.bundle.js +1 -1
  9. notebook/static/1584.bundle.js +1 -1
  10. notebook/static/1647.bundle.js +1 -1
  11. notebook/static/1650.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1809.bundle.js +1 -1
  14. notebook/static/1827.bundle.js +1 -1
  15. notebook/static/1833.bundle.js +1 -1
  16. notebook/static/1958.bundle.js +1 -1
  17. notebook/static/1962.bundle.js +1 -1
  18. notebook/static/2007.bundle.js +1 -1
  19. notebook/static/2065.bundle.js +1 -1
  20. notebook/static/2088.bundle.js +1 -1
  21. notebook/static/2089.bundle.js +1 -1
  22. notebook/static/2122.bundle.js +1 -1
  23. notebook/static/2167.bundle.js +1 -1
  24. notebook/static/2184.bundle.js +1 -1
  25. notebook/static/2311.bundle.js +1 -1
  26. notebook/static/2401.bundle.js +1 -1
  27. notebook/static/2479.bundle.js +1 -1
  28. notebook/static/2489.bundle.js +1 -1
  29. notebook/static/2607.bundle.js +1 -1
  30. notebook/static/2615.bundle.js +1 -1
  31. notebook/static/2636.bundle.js +1 -1
  32. notebook/static/2924.bundle.js +1 -1
  33. notebook/static/2944.bundle.js +1 -1
  34. notebook/static/{2323.bundle.js → 3030.bundle.js} +1 -1
  35. notebook/static/3129.bundle.js +1 -1
  36. notebook/static/3146.bundle.js +1 -1
  37. notebook/static/3187.bundle.js +1 -1
  38. notebook/static/3213.bundle.js +1 -1
  39. notebook/static/3340.bundle.js +1 -1
  40. notebook/static/3360.bundle.js +1 -1
  41. notebook/static/3466.bundle.js +1 -1
  42. notebook/static/3512.bundle.js +1 -1
  43. notebook/static/3676.bundle.js +1 -1
  44. notebook/static/3680.bundle.js +1 -1
  45. notebook/static/374.bundle.js +1 -1
  46. notebook/static/3768.bundle.js +1 -1
  47. notebook/static/377.bundle.js +1 -1
  48. notebook/static/3863.bundle.js +1 -1
  49. notebook/static/3881.bundle.js +1 -1
  50. notebook/static/4042.bundle.js +1 -1
  51. notebook/static/4058.bundle.js +1 -1
  52. notebook/static/4212.bundle.js +1 -1
  53. notebook/static/4382.bundle.js +1 -1
  54. notebook/static/4526.bundle.js +1 -1
  55. notebook/static/4588.bundle.js +1 -1
  56. notebook/static/4645.bundle.js +1 -1
  57. notebook/static/4811.bundle.js +1 -1
  58. notebook/static/4837.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5135.bundle.js +1 -1
  61. notebook/static/5254.bundle.js +1 -1
  62. notebook/static/5261.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/545.bundle.js +1 -1
  68. notebook/static/5573.bundle.js +1 -1
  69. notebook/static/5601.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5828.bundle.js +1 -1
  72. notebook/static/5850.bundle.js +1 -1
  73. notebook/static/5912.bundle.js +1 -1
  74. notebook/static/5921.bundle.js +1 -1
  75. notebook/static/6017.bundle.js +1 -1
  76. notebook/static/6139.bundle.js +1 -1
  77. notebook/static/62.bundle.js +1 -1
  78. notebook/static/6271.bundle.js +1 -1
  79. notebook/static/6318.bundle.js +1 -1
  80. notebook/static/6345.bundle.js +1 -1
  81. notebook/static/6604.bundle.js +1 -1
  82. notebook/static/6621.bundle.js +1 -1
  83. notebook/static/6627.bundle.js +1 -1
  84. notebook/static/6748.bundle.js +1 -1
  85. notebook/static/677.bundle.js +1 -1
  86. notebook/static/6815.bundle.js +1 -1
  87. notebook/static/6853.bundle.js +1 -1
  88. notebook/static/6893.bundle.js +1 -1
  89. notebook/static/6898.bundle.js +1 -1
  90. notebook/static/690.bundle.js +1 -1
  91. notebook/static/6962.bundle.js +1 -1
  92. notebook/static/6999.bundle.js +1 -1
  93. notebook/static/7226.bundle.js +1 -1
  94. notebook/static/7252.bundle.js +1 -1
  95. notebook/static/7302.bundle.js +1 -1
  96. notebook/static/7369.bundle.js +1 -1
  97. notebook/static/7386.bundle.js +1 -1
  98. notebook/static/7391.bundle.js +1 -1
  99. notebook/static/7450.bundle.js +1 -1
  100. notebook/static/7506.bundle.js +2 -2
  101. notebook/static/7543.bundle.js +1 -1
  102. notebook/static/755.bundle.js +1 -1
  103. notebook/static/7603.bundle.js +1 -1
  104. notebook/static/7639.bundle.js +1 -1
  105. notebook/static/7655.bundle.js +1 -1
  106. notebook/static/{4427.bundle.js → 7674.bundle.js} +1 -1
  107. notebook/static/7684.bundle.js +1 -1
  108. notebook/static/7812.bundle.js +1 -1
  109. notebook/static/7819.bundle.js +1 -1
  110. notebook/static/7854.bundle.js +1 -1
  111. notebook/static/7900.bundle.js +1 -1
  112. notebook/static/7906.bundle.js +1 -1
  113. notebook/static/7995.bundle.js +1 -1
  114. notebook/static/8054.bundle.js +1 -1
  115. notebook/static/8285.bundle.js +1 -1
  116. notebook/static/8471.bundle.js +1 -1
  117. notebook/static/8579.bundle.js +1 -1
  118. notebook/static/8633.bundle.js +1 -1
  119. notebook/static/8771.bundle.js +1 -1
  120. notebook/static/8781.bundle.js +1 -1
  121. notebook/static/8875.bundle.js +1 -1
  122. notebook/static/8907.bundle.js +1 -1
  123. notebook/static/8928.bundle.js +1 -1
  124. notebook/static/893.bundle.js +1 -1
  125. notebook/static/901.bundle.js +1 -1
  126. notebook/static/9068.bundle.js +1 -1
  127. notebook/static/9136.bundle.js +1 -1
  128. notebook/static/9151.bundle.js +1 -1
  129. notebook/static/9161.bundle.js +1 -1
  130. notebook/static/9268.bundle.js +1 -1
  131. notebook/static/9335.bundle.js +1 -1
  132. notebook/static/9341.bundle.js +1 -1
  133. notebook/static/9380.bundle.js +1 -1
  134. notebook/static/9605.bundle.js +1 -1
  135. notebook/static/9638.bundle.js +1 -1
  136. notebook/static/9680.bundle.js +1 -1
  137. notebook/static/9685.bundle.js +1 -1
  138. notebook/static/9752.bundle.js +1 -1
  139. notebook/static/9821.bundle.js +1 -1
  140. notebook/static/9852.bundle.js +1 -1
  141. notebook/static/bundle.js +1 -1
  142. notebook/static/third-party-licenses.json +104 -104
  143. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  144. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  145. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  146. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  147. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  148. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  149. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  150. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +1 -0
  151. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/646.57a345a80ce9f0e64830.js → notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js +1 -1
  152. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js +1 -0
  153. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +1 -0
  154. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  155. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/METADATA +2 -2
  156. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/RECORD +179 -180
  157. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/WHEEL +1 -1
  158. notebook/static/9092.bundle.js +0 -1
  159. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6d49b092e49dc147dc54.js +0 -1
  160. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.7bcc163b9139ecb2b25b.js +0 -1
  161. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.9381fdb35e72f41d8af1.js +0 -1
  162. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  163. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  164. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  165. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  166. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  167. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  168. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  169. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  170. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  171. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  172. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  173. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  174. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  175. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  176. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  177. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  178. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  179. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  180. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  181. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  182. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/entry_points.txt +0 -0
  183. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -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(50225),r=t(65848),l=t(6859),s=t(38855),a=t(62514),d=t(78359),c=t(70858),u=t(33625),p=t(63485);!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(97040),r=t(44548),l=t(33882),s=t(30754),a=t(50102),d=t(90895),c=t(25291),u=t(33625),p=t(63485);!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(1761),n=s(62514),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(70858),_=s(63485);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(43648),n=s(50102),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(25291),_=s(63485);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(89150),l=o(77245),n=o(72703),r=o(70858);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(87844),l=o(27130),n=o(15465),r=o(25291);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 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2167,1647],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(95291),n=o(62514),r=o(63485);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2167,1647],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(12668),n=o(50102),r=o(63485);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2184],{42184:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var a=n(94535),o=n(72703),i=n(19816),r=n(63242),s=n(50225),l=n(65848),d=n(71743),c=n(89945),u=n(6859),g=n(4576),b=n(38855),p=n(62514),v=n(89150),m=n(70858);function h(e){Object.values(d.Debugger.CommandIDs).forEach((t=>{e.commands.hasCommand(t)&&e.commands.notifyCommandChanged(t)}))}const I={id:"@jupyterlab/debugger-extension:consoles",description:"Add debugger capability to the consoles.",autoStart:!0,requires:[d.IDebugger,s.IConsoleTracker],optional:[a.ILabShell],activate:(e,t,n,a)=>{const o=new d.Debugger.Handler({type:"console",shell:e.shell,service:t}),i=async t=>{const{sessionContext:n}=t;await n.ready,await o.updateContext(t,n),h(e)};a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;n instanceof s.ConsolePanel&&i(n)})):n.currentChanged.connect(((e,t)=>{t&&i(t)}))}},f={id:"@jupyterlab/debugger-extension:files",description:"Adds debugger capabilities to files.",autoStart:!0,requires:[d.IDebugger,u.IEditorTracker],optional:[a.ILabShell],activate:(e,t,n,a)=>{const o=new d.Debugger.Handler({type:"file",shell:e.shell,service:t}),i={},r=async t=>{const n=e.serviceManager.sessions;try{const a=await n.findByPath(t.context.path);if(!a)return;let r=i[a.id];r||(r=n.connectTo({model:a}),i[a.id]=r),await o.update(t,r),h(e)}catch(e){return}};a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;if(n instanceof c.DocumentWidget){const{content:e}=n;e instanceof u.FileEditor&&r(n)}})):n.currentChanged.connect(((e,t)=>{t&&r(t)}))}},y={id:"@jupyterlab/debugger-extension:notebooks",description:"Adds debugger capability to notebooks and provides the debugger notebook handler.",autoStart:!0,requires:[d.IDebugger,b.INotebookTracker],optional:[a.ILabShell,o.ICommandPalette,o.ISessionContextDialogs,m.ITranslator],provides:d.IDebuggerHandler,activate:(e,t,n,a,i,r,s)=>{const l=null!=s?s:m.nullTranslator,c=null!=r?r:new o.SessionContextDialogs({translator:l}),u=new d.Debugger.Handler({type:"notebook",shell:e.shell,service:t}),g=l.load("jupyterlab");e.commands.addCommand(d.Debugger.CommandIDs.restartDebug,{label:g.__("Restart Kernel and Debug…"),caption:g.__("Restart Kernel and Debug…"),isEnabled:()=>t.isStarted,execute:async()=>{const e=t.getDebuggerState();await t.stop();const a=n.currentWidget;if(!a)return;const{content:o,sessionContext:i}=a;await c.restart(i)&&(await t.restoreDebuggerState(e),await u.updateWidget(a,i.session),await b.NotebookActions.runAll(o,i,c,l))}});const p=async t=>{if(t){const{sessionContext:e}=t;await e.ready,await u.updateContext(t,e)}h(e)};return a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;n instanceof b.NotebookPanel&&p(n)})):n.currentChanged.connect(((e,t)=>{t&&p(t)})),i&&i.addItem({category:"Notebook Operations",command:d.Debugger.CommandIDs.restartDebug}),u}},C={id:"@jupyterlab/debugger-extension:service",description:"Provides the debugger service.",autoStart:!0,provides:d.IDebugger,requires:[d.IDebuggerConfig],optional:[d.IDebuggerSources,m.ITranslator],activate:(e,t,n,a)=>new d.Debugger.Service({config:t,debuggerSources:n,specsManager:e.serviceManager.kernelspecs,translator:a})},_={id:"@jupyterlab/debugger-extension:config",description:"Provides the debugger configuration",provides:d.IDebuggerConfig,autoStart:!0,activate:()=>new d.Debugger.Config},D={id:"@jupyterlab/debugger-extension:sources",description:"Provides the source feature for debugging",autoStart:!0,provides:d.IDebuggerSources,requires:[d.IDebuggerConfig,r.IEditorServices],optional:[b.INotebookTracker,s.IConsoleTracker,u.IEditorTracker],activate:(e,t,n,a,o,i)=>new d.Debugger.Sources({config:t,shell:e.shell,editorServices:n,notebookTracker:a,consoleTracker:o,editorTracker:i})},S={id:"@jupyterlab/debugger-extension:variables",description:"Adds variables renderer and inspection in the debugger variable panel.",autoStart:!0,requires:[d.IDebugger,d.IDebuggerHandler,m.ITranslator],optional:[o.IThemeManager,p.IRenderMimeRegistry],activate:(e,t,n,a,i,r)=>{const s=a.load("jupyterlab"),{commands:l,shell:c}=e,u=new o.WidgetTracker({namespace:"debugger/inspect-variable"}),g=new o.WidgetTracker({namespace:"debugger/render-variable"}),p=d.Debugger.CommandIDs;l.addCommand(p.inspectVariable,{label:s.__("Inspect Variable"),caption:s.__("Inspect Variable"),isEnabled:e=>{var n,a,o,i;return!!(null===(n=t.session)||void 0===n?void 0:n.isStarted)&&Number(null!==(i=null!==(a=e.variableReference)&&void 0!==a?a:null===(o=t.model.variables.selectedVariable)||void 0===o?void 0:o.variablesReference)&&void 0!==i?i:0)>0},execute:async e=>{var n,a,r,s;let{variableReference:g,name:b}=e;g||(g=null===(n=t.model.variables.selectedVariable)||void 0===n?void 0:n.variablesReference),b||(b=null===(a=t.model.variables.selectedVariable)||void 0===a?void 0:a.name);const p=`jp-debugger-variable-${b}`;if(!b||!g||u.find((e=>e.id===p)))return;const v=await t.inspectVariable(g);if(!v||0===v.length)return;const m=t.model.variables,h=new o.MainAreaWidget({content:new d.Debugger.VariablesGrid({model:m,commands:l,scopes:[{name:b,variables:v}],themeManager:i})});h.addClass("jp-DebuggerVariables"),h.id=p,h.title.icon=d.Debugger.Icons.variableIcon,h.title.label=`${null===(s=null===(r=t.session)||void 0===r?void 0:r.connection)||void 0===s?void 0:s.name} - ${b}`,u.add(h);const I=()=>{h.dispose(),m.changed.disconnect(I)};m.changed.connect(I),c.add(h,"main",{mode:u.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(p.renderMimeVariable,{label:s.__("Render Variable"),caption:s.__("Render variable according to its mime type"),isEnabled:()=>{var e;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>t.model.hasRichVariableRendering&&(null!==r||n.activeWidget instanceof b.NotebookPanel),execute:e=>{var o,i,s,l,u,p,v,m;let{name:h,frameId:I}=e;h||(h=null===(o=t.model.variables.selectedVariable)||void 0===o?void 0:o.name),I||(I=null===(i=t.model.callstack.frame)||void 0===i?void 0:i.id);const f=n.activeWidget;let y=f instanceof b.NotebookPanel?f.content.rendermime:r;if(!y)return;const C=`jp-debugger-variable-mime-${h}-${null===(l=null===(s=t.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path.replace("/","-")}`;if(!h||g.find((e=>e.id===C))||!I&&t.hasStoppedThreads())return;const _=t.model.variables,D=new d.Debugger.VariableRenderer({dataLoader:()=>t.inspectRichVariable(h,I),rendermime:y,translator:a});D.addClass("jp-DebuggerRichVariable"),D.id=C,D.title.icon=d.Debugger.Icons.variableIcon,D.title.label=`${h} - ${null===(p=null===(u=t.session)||void 0===u?void 0:u.connection)||void 0===p?void 0:p.name}`,D.title.caption=`${h} - ${null===(m=null===(v=t.session)||void 0===v?void 0:v.connection)||void 0===m?void 0:m.path}`,g.add(D);const S=()=>{D.dispose(),_.changed.disconnect(w),null==f||f.disposed.disconnect(S)},w=()=>{n.activeWidget===f&&D.refresh()};D.disposed.connect(S),_.changed.connect(w),null==f||f.disposed.connect(S),c.add(D,"main",{mode:g.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(p.copyToClipboard,{label:s.__("Copy to Clipboard"),caption:s.__("Copy text representation of the value to clipboard"),isEnabled:()=>{var e,n;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)&&!!(null===(n=t.model.variables.selectedVariable)||void 0===n?void 0:n.value)},isVisible:()=>n.activeWidget instanceof b.NotebookPanel,execute:async()=>{const e=t.model.variables.selectedVariable.value;e&&o.Clipboard.copyToSystem(e)}}),l.addCommand(p.copyToGlobals,{label:s.__("Copy Variable to Globals"),caption:s.__("Copy variable to globals scope"),isEnabled:()=>{var e;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>n.activeWidget instanceof b.NotebookPanel&&t.model.supportCopyToGlobals,execute:async e=>{const n=t.model.variables.selectedVariable.name;await t.copyToGlobals(n)}})}},w={id:"@jupyterlab/debugger-extension:sidebar",description:"Provides the debugger sidebar.",provides:d.IDebuggerSidebar,requires:[d.IDebugger,r.IEditorServices,m.ITranslator],optional:[o.IThemeManager,v.ISettingRegistry],autoStart:!0,activate:async(e,t,n,a,o,i)=>{const{commands:r}=e,s=d.Debugger.CommandIDs,l={registry:r,continue:s.debugContinue,terminate:s.terminate,next:s.next,stepIn:s.stepIn,stepOut:s.stepOut,evaluate:s.evaluate},c={registry:r,pauseOnExceptions:s.pauseOnExceptions},u=new d.Debugger.Sidebar({service:t,callstackCommands:l,breakpointsCommands:c,editorServices:n,themeManager:o,translator:a});if(i){const e=await i.load(k.id),n=()=>{var n,a,o,i;const r=e.get("variableFilters").composite,s=null!==(i=null===(o=null===(a=null===(n=t.session)||void 0===n?void 0:n.connection)||void 0===a?void 0:a.kernel)||void 0===o?void 0:o.name)&&void 0!==i?i:"";s&&r[s]&&(u.variables.filter=new Set(r[s]));const l=e.get("defaultKernelSourcesFilter").composite;u.kernelSources.filter=l};n(),e.changed.connect(n),t.sessionChanged.connect(n)}return u}},x={id:"@jupyterlab/debugger-extension:source-viewer",description:"Initialize the debugger sources viewer.",requires:[d.IDebugger,r.IEditorServices,d.IDebuggerSources,m.ITranslator],provides:d.IDebuggerSourceViewer,autoStart:!0,activate:async(e,t,n,a,i)=>{const r=new d.Debugger.ReadOnlyEditorFactory({editorServices:n}),{model:s}=t;s.callstack.currentFrameChanged.connect(((e,n)=>{var o,i,r,s,l,c,u,g,b;a.find({focus:!0,kernel:null!==(s=null===(r=null===(i=null===(o=t.session)||void 0===o?void 0:o.connection)||void 0===i?void 0:i.kernel)||void 0===r?void 0:r.name)&&void 0!==s?s:"",path:null!==(u=null===(c=null===(l=t.session)||void 0===l?void 0:l.connection)||void 0===c?void 0:c.path)&&void 0!==u?u:"",source:null!==(b=null===(g=null==n?void 0:n.source)||void 0===g?void 0:g.path)&&void 0!==b?b:""}).forEach((e=>{requestAnimationFrame((()=>{e.reveal().then((()=>{const t=e.get();t&&d.Debugger.EditorHandler.showCurrentLine(t,n.line)}))}))}))}));const c=(e,n)=>{var o,i,s,c,u,g,b;if(!e)return;const{content:p,mimeType:v,path:m}=e,h=a.find({focus:!0,kernel:null!==(c=null===(s=null===(i=null===(o=t.session)||void 0===o?void 0:o.connection)||void 0===i?void 0:i.kernel)||void 0===s?void 0:s.name)&&void 0!==c?c:"",path:null!==(b=null===(g=null===(u=t.session)||void 0===u?void 0:u.connection)||void 0===g?void 0:g.path)&&void 0!==b?b:"",source:m});if(h.length>0)return void(n&&void 0!==n.line&&h.forEach((e=>{e.reveal().then((()=>{var t;null===(t=e.get())||void 0===t||t.revealPosition({line:n.line-1,column:n.column||0})}))})));const I=r.createNewEditor({content:p,mimeType:v,path:m}),f=I.editor,y=new d.Debugger.EditorHandler({debuggerService:t,editorReady:()=>Promise.resolve(f),getEditor:()=>f,path:m,src:f.model.sharedModel});I.disposed.connect((()=>y.dispose())),a.open({label:l.PathExt.basename(m),caption:m,editorWrapper:I});const C=t.model.callstack.frame;C&&d.Debugger.EditorHandler.showCurrentLine(f,C.line)},u=i.load("jupyterlab");return e.commands.addCommand(d.Debugger.CommandIDs.openSource,{label:u.__("Open Source"),caption:u.__("Open Source"),isEnabled:()=>!!x,execute:async e=>{const n=e.path||"";if(!n)throw Error("Path to open is needed");if(!t.isStarted){if(!(await(0,o.showDialog)({title:u.__("Start debugger?"),body:u.__("The debugger service is needed to open the source %1",n),buttons:[o.Dialog.cancelButton({label:u.__("Cancel")}),o.Dialog.okButton({label:u.__("Start debugger")})]})).button.accept)return;await t.start()}const a=await t.getSource({path:n});return c(a)}}),Object.freeze({open:c})}},k={id:"@jupyterlab/debugger-extension:main",description:"Initialize the debugger user interface.",requires:[d.IDebugger,d.IDebuggerSidebar,r.IEditorServices,m.ITranslator],optional:[o.ICommandPalette,d.IDebuggerSourceViewer,a.ILabShell,a.ILayoutRestorer,g.ILoggerRegistry,v.ISettingRegistry],autoStart:!0,activate:async(e,t,n,a,r,s,c,u,g,b,v)=>{var m;const I=r.load("jupyterlab"),{commands:f,shell:y,serviceManager:C}=e,{kernelspecs:_}=C,D=d.Debugger.CommandIDs;if("true"!==l.PageConfig.getOption("alwaysShowDebuggerExtension").toLowerCase()){await _.ready;const e=null===(m=_.specs)||void 0===m?void 0:m.kernelspecs;if(!e)return;const t=Object.keys(e).some((t=>{var n,a,o;return!(null===(o=null===(a=null===(n=e[t])||void 0===n?void 0:n.metadata)||void 0===a?void 0:a.debugger)||void 0===o||!o)}));if(!t)return}const S=new p.RenderMimeRegistry({initialFactories:p.standardRendererFactories});f.addCommand(D.evaluate,{label:I.__("Evaluate Code"),caption:I.__("Evaluate Code"),icon:d.Debugger.Icons.evaluateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{var e,n,o;const r=await(async()=>{var e,n,o;const i=null===(n=null===(e=t.session)||void 0===e?void 0:e.connection)||void 0===n?void 0:n.kernel;if(!i)return"";const r=(await i.info).language_info.name;return null!==(o=a.mimeTypeService.getMimeTypeByLanguage({name:r}))&&void 0!==o?o:""})(),s=await d.Debugger.Dialogs.getCode({title:I.__("Evaluate Code"),okLabel:I.__("Evaluate"),cancelLabel:I.__("Cancel"),mimeType:r,contentFactory:new i.CodeCell.ContentFactory({editorFactory:e=>a.factoryService.newInlineEditor(e)}),rendermime:S}),l=s.value;if(!s.button.accept||!l)return;const c=await t.evaluate(l);if(c){const a=c.result,i=null===(n=null===(e=null==t?void 0:t.session)||void 0===e?void 0:e.connection)||void 0===n?void 0:n.path,r=i?null===(o=null==b?void 0:b.getLogger)||void 0===o?void 0:o.call(b,i):void 0;r?r.log({type:"text",data:a,level:r.level}):console.debug(a)}}}),f.addCommand(D.debugContinue,{label:()=>t.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),caption:()=>t.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),icon:()=>t.hasStoppedThreads()?d.Debugger.Icons.continueIcon:d.Debugger.Icons.pauseIcon,isEnabled:()=>{var e,n;return null!==(n=null===(e=t.session)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n},execute:async()=>{t.hasStoppedThreads()?await t.continue():await t.pause(),f.notifyCommandChanged(D.debugContinue)}}),f.addCommand(D.terminate,{label:I.__("Terminate"),caption:I.__("Terminate"),icon:d.Debugger.Icons.terminateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.restart(),h(e)}}),f.addCommand(D.next,{label:I.__("Next"),caption:I.__("Next"),icon:d.Debugger.Icons.stepOverIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.next()}}),f.addCommand(D.stepIn,{label:I.__("Step In"),caption:I.__("Step In"),icon:d.Debugger.Icons.stepIntoIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepIn()}}),f.addCommand(D.stepOut,{label:I.__("Step Out"),caption:I.__("Step Out"),icon:d.Debugger.Icons.stepOutIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepOut()}}),f.addCommand(D.pauseOnExceptions,{label:e=>e.filter||"Breakpoints on exception",caption:e=>e.description,isToggled:e=>{var n;return(null===(n=t.session)||void 0===n?void 0:n.isPausingOnException(e.filter))||!1},isEnabled:()=>t.pauseOnExceptionsIsValid(),execute:async e=>{var n,a,i;if(null==e?void 0:e.filter){let n=e.filter;await t.pauseOnExceptionsFilter(n)}else{let e=[];null===(a=null===(n=t.session)||void 0===n?void 0:n.exceptionBreakpointFilters)||void 0===a||a.forEach((t=>{e.push(t.filter)}));const r=await o.InputDialog.getMultipleItems({title:I.__("Select a filter for breakpoints on exception"),items:e,defaults:(null===(i=t.session)||void 0===i?void 0:i.currentExceptionFilters)||[]});let s=r.button.accept?r.value:null;null!==s&&await t.pauseOnExceptions(s)}}});let w=!1;if(v){const e=await v.load(k.id),t=()=>{w=e.get("autoCollapseDebuggerSidebar").composite};t(),e.changed.connect(t)}if(t.eventMessage.connect(((t,a)=>{h(e),u&&"initialized"===a.event?u.activateById(n.id):u&&n.isVisible&&"terminated"===a.event&&w&&u.collapseRight()})),t.sessionChanged.connect((t=>{h(e)})),g&&g.add(n,"debugger-sidebar"),n.node.setAttribute("role","region"),n.node.setAttribute("aria-label",I.__("Debugger section")),n.title.caption=I.__("Debugger"),y.add(n,"right",{type:"Debugger"}),f.addCommand(D.showPanel,{label:I.__("Debugger Panel"),execute:()=>{y.activateById(n.id)}}),s){const e=I.__("Debugger");[D.debugContinue,D.terminate,D.next,D.stepIn,D.stepOut,D.evaluate,D.pauseOnExceptions].forEach((t=>{s.addItem({command:t,category:e})}))}if(c){const{model:e}=t,n=(e,t,n)=>{t&&c.open(t,n)};e.sources.currentSourceOpened.connect(((e,t)=>{c.open(t)})),e.kernelSources.kernelSourceOpened.connect(n),e.breakpoints.clicked.connect((async(e,n)=>{var a;const o=null===(a=n.source)||void 0===a?void 0:a.path,i=await t.getSource({sourceReference:0,path:o});c.open(i,n)}))}}},E=[C,I,f,y,S,w,k,D,x,_]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2184],{42184:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var a=n(27961),o=n(15465),i=n(688),r=n(52712),s=n(97040),l=n(44548),d=n(82323),c=n(71120),u=n(33882),g=n(54560),b=n(30754),p=n(50102),v=n(87844),m=n(25291);function h(e){Object.values(d.Debugger.CommandIDs).forEach((t=>{e.commands.hasCommand(t)&&e.commands.notifyCommandChanged(t)}))}const I={id:"@jupyterlab/debugger-extension:consoles",description:"Add debugger capability to the consoles.",autoStart:!0,requires:[d.IDebugger,s.IConsoleTracker],optional:[a.ILabShell],activate:(e,t,n,a)=>{const o=new d.Debugger.Handler({type:"console",shell:e.shell,service:t}),i=async t=>{const{sessionContext:n}=t;await n.ready,await o.updateContext(t,n),h(e)};a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;n instanceof s.ConsolePanel&&i(n)})):n.currentChanged.connect(((e,t)=>{t&&i(t)}))}},f={id:"@jupyterlab/debugger-extension:files",description:"Adds debugger capabilities to files.",autoStart:!0,requires:[d.IDebugger,u.IEditorTracker],optional:[a.ILabShell],activate:(e,t,n,a)=>{const o=new d.Debugger.Handler({type:"file",shell:e.shell,service:t}),i={},r=async t=>{const n=e.serviceManager.sessions;try{const a=await n.findByPath(t.context.path);if(!a)return;let r=i[a.id];r||(r=n.connectTo({model:a}),i[a.id]=r),await o.update(t,r),h(e)}catch(e){return}};a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;if(n instanceof c.DocumentWidget){const{content:e}=n;e instanceof u.FileEditor&&r(n)}})):n.currentChanged.connect(((e,t)=>{t&&r(t)}))}},y={id:"@jupyterlab/debugger-extension:notebooks",description:"Adds debugger capability to notebooks and provides the debugger notebook handler.",autoStart:!0,requires:[d.IDebugger,b.INotebookTracker],optional:[a.ILabShell,o.ICommandPalette,o.ISessionContextDialogs,m.ITranslator],provides:d.IDebuggerHandler,activate:(e,t,n,a,i,r,s)=>{const l=null!=s?s:m.nullTranslator,c=null!=r?r:new o.SessionContextDialogs({translator:l}),u=new d.Debugger.Handler({type:"notebook",shell:e.shell,service:t}),g=l.load("jupyterlab");e.commands.addCommand(d.Debugger.CommandIDs.restartDebug,{label:g.__("Restart Kernel and Debug…"),caption:g.__("Restart Kernel and Debug…"),isEnabled:()=>t.isStarted,execute:async()=>{const e=t.getDebuggerState();await t.stop();const a=n.currentWidget;if(!a)return;const{content:o,sessionContext:i}=a;await c.restart(i)&&(await t.restoreDebuggerState(e),await u.updateWidget(a,i.session),await b.NotebookActions.runAll(o,i,c,l))}});const p=async t=>{if(t){const{sessionContext:e}=t;await e.ready,await u.updateContext(t,e)}h(e)};return a?a.currentChanged.connect(((e,t)=>{const n=t.newValue;n instanceof b.NotebookPanel&&p(n)})):n.currentChanged.connect(((e,t)=>{t&&p(t)})),i&&i.addItem({category:"Notebook Operations",command:d.Debugger.CommandIDs.restartDebug}),u}},C={id:"@jupyterlab/debugger-extension:service",description:"Provides the debugger service.",autoStart:!0,provides:d.IDebugger,requires:[d.IDebuggerConfig],optional:[d.IDebuggerSources,m.ITranslator],activate:(e,t,n,a)=>new d.Debugger.Service({config:t,debuggerSources:n,specsManager:e.serviceManager.kernelspecs,translator:a})},_={id:"@jupyterlab/debugger-extension:config",description:"Provides the debugger configuration",provides:d.IDebuggerConfig,autoStart:!0,activate:()=>new d.Debugger.Config},D={id:"@jupyterlab/debugger-extension:sources",description:"Provides the source feature for debugging",autoStart:!0,provides:d.IDebuggerSources,requires:[d.IDebuggerConfig,r.IEditorServices],optional:[b.INotebookTracker,s.IConsoleTracker,u.IEditorTracker],activate:(e,t,n,a,o,i)=>new d.Debugger.Sources({config:t,shell:e.shell,editorServices:n,notebookTracker:a,consoleTracker:o,editorTracker:i})},S={id:"@jupyterlab/debugger-extension:variables",description:"Adds variables renderer and inspection in the debugger variable panel.",autoStart:!0,requires:[d.IDebugger,d.IDebuggerHandler,m.ITranslator],optional:[o.IThemeManager,p.IRenderMimeRegistry],activate:(e,t,n,a,i,r)=>{const s=a.load("jupyterlab"),{commands:l,shell:c}=e,u=new o.WidgetTracker({namespace:"debugger/inspect-variable"}),g=new o.WidgetTracker({namespace:"debugger/render-variable"}),p=d.Debugger.CommandIDs;l.addCommand(p.inspectVariable,{label:s.__("Inspect Variable"),caption:s.__("Inspect Variable"),isEnabled:e=>{var n,a,o,i;return!!(null===(n=t.session)||void 0===n?void 0:n.isStarted)&&Number(null!==(i=null!==(a=e.variableReference)&&void 0!==a?a:null===(o=t.model.variables.selectedVariable)||void 0===o?void 0:o.variablesReference)&&void 0!==i?i:0)>0},execute:async e=>{var n,a,r,s;let{variableReference:g,name:b}=e;g||(g=null===(n=t.model.variables.selectedVariable)||void 0===n?void 0:n.variablesReference),b||(b=null===(a=t.model.variables.selectedVariable)||void 0===a?void 0:a.name);const p=`jp-debugger-variable-${b}`;if(!b||!g||u.find((e=>e.id===p)))return;const v=await t.inspectVariable(g);if(!v||0===v.length)return;const m=t.model.variables,h=new o.MainAreaWidget({content:new d.Debugger.VariablesGrid({model:m,commands:l,scopes:[{name:b,variables:v}],themeManager:i})});h.addClass("jp-DebuggerVariables"),h.id=p,h.title.icon=d.Debugger.Icons.variableIcon,h.title.label=`${null===(s=null===(r=t.session)||void 0===r?void 0:r.connection)||void 0===s?void 0:s.name} - ${b}`,u.add(h);const I=()=>{h.dispose(),m.changed.disconnect(I)};m.changed.connect(I),c.add(h,"main",{mode:u.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(p.renderMimeVariable,{label:s.__("Render Variable"),caption:s.__("Render variable according to its mime type"),isEnabled:()=>{var e;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>t.model.hasRichVariableRendering&&(null!==r||n.activeWidget instanceof b.NotebookPanel),execute:e=>{var o,i,s,l,u,p,v,m;let{name:h,frameId:I}=e;h||(h=null===(o=t.model.variables.selectedVariable)||void 0===o?void 0:o.name),I||(I=null===(i=t.model.callstack.frame)||void 0===i?void 0:i.id);const f=n.activeWidget;let y=f instanceof b.NotebookPanel?f.content.rendermime:r;if(!y)return;const C=`jp-debugger-variable-mime-${h}-${null===(l=null===(s=t.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path.replace("/","-")}`;if(!h||g.find((e=>e.id===C))||!I&&t.hasStoppedThreads())return;const _=t.model.variables,D=new d.Debugger.VariableRenderer({dataLoader:()=>t.inspectRichVariable(h,I),rendermime:y,translator:a});D.addClass("jp-DebuggerRichVariable"),D.id=C,D.title.icon=d.Debugger.Icons.variableIcon,D.title.label=`${h} - ${null===(p=null===(u=t.session)||void 0===u?void 0:u.connection)||void 0===p?void 0:p.name}`,D.title.caption=`${h} - ${null===(m=null===(v=t.session)||void 0===v?void 0:v.connection)||void 0===m?void 0:m.path}`,g.add(D);const S=()=>{D.dispose(),_.changed.disconnect(w),null==f||f.disposed.disconnect(S)},w=()=>{n.activeWidget===f&&D.refresh()};D.disposed.connect(S),_.changed.connect(w),null==f||f.disposed.connect(S),c.add(D,"main",{mode:g.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(p.copyToClipboard,{label:s.__("Copy to Clipboard"),caption:s.__("Copy text representation of the value to clipboard"),isEnabled:()=>{var e,n;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)&&!!(null===(n=t.model.variables.selectedVariable)||void 0===n?void 0:n.value)},isVisible:()=>n.activeWidget instanceof b.NotebookPanel,execute:async()=>{const e=t.model.variables.selectedVariable.value;e&&o.Clipboard.copyToSystem(e)}}),l.addCommand(p.copyToGlobals,{label:s.__("Copy Variable to Globals"),caption:s.__("Copy variable to globals scope"),isEnabled:()=>{var e;return!!(null===(e=t.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>n.activeWidget instanceof b.NotebookPanel&&t.model.supportCopyToGlobals,execute:async e=>{const n=t.model.variables.selectedVariable.name;await t.copyToGlobals(n)}})}},w={id:"@jupyterlab/debugger-extension:sidebar",description:"Provides the debugger sidebar.",provides:d.IDebuggerSidebar,requires:[d.IDebugger,r.IEditorServices,m.ITranslator],optional:[o.IThemeManager,v.ISettingRegistry],autoStart:!0,activate:async(e,t,n,a,o,i)=>{const{commands:r}=e,s=d.Debugger.CommandIDs,l={registry:r,continue:s.debugContinue,terminate:s.terminate,next:s.next,stepIn:s.stepIn,stepOut:s.stepOut,evaluate:s.evaluate},c={registry:r,pauseOnExceptions:s.pauseOnExceptions},u=new d.Debugger.Sidebar({service:t,callstackCommands:l,breakpointsCommands:c,editorServices:n,themeManager:o,translator:a});if(i){const e=await i.load(k.id),n=()=>{var n,a,o,i;const r=e.get("variableFilters").composite,s=null!==(i=null===(o=null===(a=null===(n=t.session)||void 0===n?void 0:n.connection)||void 0===a?void 0:a.kernel)||void 0===o?void 0:o.name)&&void 0!==i?i:"";s&&r[s]&&(u.variables.filter=new Set(r[s]));const l=e.get("defaultKernelSourcesFilter").composite;u.kernelSources.filter=l};n(),e.changed.connect(n),t.sessionChanged.connect(n)}return u}},x={id:"@jupyterlab/debugger-extension:source-viewer",description:"Initialize the debugger sources viewer.",requires:[d.IDebugger,r.IEditorServices,d.IDebuggerSources,m.ITranslator],provides:d.IDebuggerSourceViewer,autoStart:!0,activate:async(e,t,n,a,i)=>{const r=new d.Debugger.ReadOnlyEditorFactory({editorServices:n}),{model:s}=t;s.callstack.currentFrameChanged.connect(((e,n)=>{var o,i,r,s,l,c,u,g,b;a.find({focus:!0,kernel:null!==(s=null===(r=null===(i=null===(o=t.session)||void 0===o?void 0:o.connection)||void 0===i?void 0:i.kernel)||void 0===r?void 0:r.name)&&void 0!==s?s:"",path:null!==(u=null===(c=null===(l=t.session)||void 0===l?void 0:l.connection)||void 0===c?void 0:c.path)&&void 0!==u?u:"",source:null!==(b=null===(g=null==n?void 0:n.source)||void 0===g?void 0:g.path)&&void 0!==b?b:""}).forEach((e=>{requestAnimationFrame((()=>{e.reveal().then((()=>{const t=e.get();t&&d.Debugger.EditorHandler.showCurrentLine(t,n.line)}))}))}))}));const c=(e,n)=>{var o,i,s,c,u,g,b;if(!e)return;const{content:p,mimeType:v,path:m}=e,h=a.find({focus:!0,kernel:null!==(c=null===(s=null===(i=null===(o=t.session)||void 0===o?void 0:o.connection)||void 0===i?void 0:i.kernel)||void 0===s?void 0:s.name)&&void 0!==c?c:"",path:null!==(b=null===(g=null===(u=t.session)||void 0===u?void 0:u.connection)||void 0===g?void 0:g.path)&&void 0!==b?b:"",source:m});if(h.length>0)return void(n&&void 0!==n.line&&h.forEach((e=>{e.reveal().then((()=>{var t;null===(t=e.get())||void 0===t||t.revealPosition({line:n.line-1,column:n.column||0})}))})));const I=r.createNewEditor({content:p,mimeType:v,path:m}),f=I.editor,y=new d.Debugger.EditorHandler({debuggerService:t,editorReady:()=>Promise.resolve(f),getEditor:()=>f,path:m,src:f.model.sharedModel});I.disposed.connect((()=>y.dispose())),a.open({label:l.PathExt.basename(m),caption:m,editorWrapper:I});const C=t.model.callstack.frame;C&&d.Debugger.EditorHandler.showCurrentLine(f,C.line)},u=i.load("jupyterlab");return e.commands.addCommand(d.Debugger.CommandIDs.openSource,{label:u.__("Open Source"),caption:u.__("Open Source"),isEnabled:()=>!!x,execute:async e=>{const n=e.path||"";if(!n)throw Error("Path to open is needed");if(!t.isStarted){if(!(await(0,o.showDialog)({title:u.__("Start debugger?"),body:u.__("The debugger service is needed to open the source %1",n),buttons:[o.Dialog.cancelButton({label:u.__("Cancel")}),o.Dialog.okButton({label:u.__("Start debugger")})]})).button.accept)return;await t.start()}const a=await t.getSource({path:n});return c(a)}}),Object.freeze({open:c})}},k={id:"@jupyterlab/debugger-extension:main",description:"Initialize the debugger user interface.",requires:[d.IDebugger,d.IDebuggerSidebar,r.IEditorServices,m.ITranslator],optional:[o.ICommandPalette,d.IDebuggerSourceViewer,a.ILabShell,a.ILayoutRestorer,g.ILoggerRegistry,v.ISettingRegistry],autoStart:!0,activate:async(e,t,n,a,r,s,c,u,g,b,v)=>{var m;const I=r.load("jupyterlab"),{commands:f,shell:y,serviceManager:C}=e,{kernelspecs:_}=C,D=d.Debugger.CommandIDs;if("true"!==l.PageConfig.getOption("alwaysShowDebuggerExtension").toLowerCase()){await _.ready;const e=null===(m=_.specs)||void 0===m?void 0:m.kernelspecs;if(!e)return;const t=Object.keys(e).some((t=>{var n,a,o;return!(null===(o=null===(a=null===(n=e[t])||void 0===n?void 0:n.metadata)||void 0===a?void 0:a.debugger)||void 0===o||!o)}));if(!t)return}const S=new p.RenderMimeRegistry({initialFactories:p.standardRendererFactories});f.addCommand(D.evaluate,{label:I.__("Evaluate Code"),caption:I.__("Evaluate Code"),icon:d.Debugger.Icons.evaluateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{var e,n,o;const r=await(async()=>{var e,n,o;const i=null===(n=null===(e=t.session)||void 0===e?void 0:e.connection)||void 0===n?void 0:n.kernel;if(!i)return"";const r=(await i.info).language_info.name;return null!==(o=a.mimeTypeService.getMimeTypeByLanguage({name:r}))&&void 0!==o?o:""})(),s=await d.Debugger.Dialogs.getCode({title:I.__("Evaluate Code"),okLabel:I.__("Evaluate"),cancelLabel:I.__("Cancel"),mimeType:r,contentFactory:new i.CodeCell.ContentFactory({editorFactory:e=>a.factoryService.newInlineEditor(e)}),rendermime:S}),l=s.value;if(!s.button.accept||!l)return;const c=await t.evaluate(l);if(c){const a=c.result,i=null===(n=null===(e=null==t?void 0:t.session)||void 0===e?void 0:e.connection)||void 0===n?void 0:n.path,r=i?null===(o=null==b?void 0:b.getLogger)||void 0===o?void 0:o.call(b,i):void 0;r?r.log({type:"text",data:a,level:r.level}):console.debug(a)}}}),f.addCommand(D.debugContinue,{label:()=>t.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),caption:()=>t.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),icon:()=>t.hasStoppedThreads()?d.Debugger.Icons.continueIcon:d.Debugger.Icons.pauseIcon,isEnabled:()=>{var e,n;return null!==(n=null===(e=t.session)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n},execute:async()=>{t.hasStoppedThreads()?await t.continue():await t.pause(),f.notifyCommandChanged(D.debugContinue)}}),f.addCommand(D.terminate,{label:I.__("Terminate"),caption:I.__("Terminate"),icon:d.Debugger.Icons.terminateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.restart(),h(e)}}),f.addCommand(D.next,{label:I.__("Next"),caption:I.__("Next"),icon:d.Debugger.Icons.stepOverIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.next()}}),f.addCommand(D.stepIn,{label:I.__("Step In"),caption:I.__("Step In"),icon:d.Debugger.Icons.stepIntoIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepIn()}}),f.addCommand(D.stepOut,{label:I.__("Step Out"),caption:I.__("Step Out"),icon:d.Debugger.Icons.stepOutIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepOut()}}),f.addCommand(D.pauseOnExceptions,{label:e=>e.filter||"Breakpoints on exception",caption:e=>e.description,isToggled:e=>{var n;return(null===(n=t.session)||void 0===n?void 0:n.isPausingOnException(e.filter))||!1},isEnabled:()=>t.pauseOnExceptionsIsValid(),execute:async e=>{var n,a,i;if(null==e?void 0:e.filter){let n=e.filter;await t.pauseOnExceptionsFilter(n)}else{let e=[];null===(a=null===(n=t.session)||void 0===n?void 0:n.exceptionBreakpointFilters)||void 0===a||a.forEach((t=>{e.push(t.filter)}));const r=await o.InputDialog.getMultipleItems({title:I.__("Select a filter for breakpoints on exception"),items:e,defaults:(null===(i=t.session)||void 0===i?void 0:i.currentExceptionFilters)||[]});let s=r.button.accept?r.value:null;null!==s&&await t.pauseOnExceptions(s)}}});let w=!1;if(v){const e=await v.load(k.id),t=()=>{w=e.get("autoCollapseDebuggerSidebar").composite};t(),e.changed.connect(t)}if(t.eventMessage.connect(((t,a)=>{h(e),u&&"initialized"===a.event?u.activateById(n.id):u&&n.isVisible&&"terminated"===a.event&&w&&u.collapseRight()})),t.sessionChanged.connect((t=>{h(e)})),g&&g.add(n,"debugger-sidebar"),n.node.setAttribute("role","region"),n.node.setAttribute("aria-label",I.__("Debugger section")),n.title.caption=I.__("Debugger"),y.add(n,"right",{type:"Debugger"}),f.addCommand(D.showPanel,{label:I.__("Debugger Panel"),execute:()=>{y.activateById(n.id)}}),s){const e=I.__("Debugger");[D.debugContinue,D.terminate,D.next,D.stepIn,D.stepOut,D.evaluate,D.pauseOnExceptions].forEach((t=>{s.addItem({command:t,category:e})}))}if(c){const{model:e}=t,n=(e,t,n)=>{t&&c.open(t,n)};e.sources.currentSourceOpened.connect(((e,t)=>{c.open(t)})),e.kernelSources.kernelSourceOpened.connect(n),e.breakpoints.clicked.connect((async(e,n)=>{var a;const o=null===(a=n.source)||void 0===a?void 0:a.path,i=await t.getSource({sourceReference:0,path:o});c.open(i,n)}))}}},E=[C,I,f,y,S,w,k,D,x,_]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2311],{22311:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var a=t(94535),i=t(72703),o=t(92243),s=t(89150),l=t(70858),d=t(95291);const r="@jupyterlab/extensionmanager-extension:plugin";var c;!function(e){e.showPanel="extensionmanager:show-panel",e.toggle="extensionmanager:toggle"}(c||(c={}));const g={id:r,description:"Adds the extension manager plugin.",autoStart:!0,requires:[s.ISettingRegistry],optional:[l.ITranslator,a.ILayoutRestorer,i.ICommandPalette],activate:async(e,n,t,a,i)=>{const{commands:s,shell:m,serviceManager:b}=e,h=(t=null!=t?t:l.nullTranslator).load("jupyterlab"),p=new o.ListModel(b,t),_=()=>{const e=new o.ExtensionsPanel({model:p,translator:t});return e.id="extensionmanager.main-view",e.title.icon=d.extensionIcon,e.title.caption=h.__("Extension Manager"),e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",h.__("Extension Manager section")),a&&a.add(e,e.id),m.add(e,"left",{rank:1e3}),e};let E=_();Promise.all([e.restored,n.load(r)]).then((([,n])=>{p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,p.stateChanged.connect((()=>{p.isDisclaimed!==n.get("disclaimed").composite&&n.set("disclaimed",p.isDisclaimed).catch((e=>{console.error(`Failed to set setting 'disclaimed'.\n${e}`)})),p.isEnabled!==n.get("enabled").composite&&n.set("enabled",p.isEnabled).catch((e=>{console.error(`Failed to set setting 'enabled'.\n${e}`)}))})),p.isEnabled?E=null!=E?E:_():(null==E||E.dispose(),E=null),n.changed.connect((async()=>{if(p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,e.commands.notifyCommandChanged(c.toggle),p.isEnabled){if(!(null!==E&&E.isAttached||await u.showWarning(h)))return void n.set("enabled",!1);E=null!=E?E:_()}else null==E||E.dispose(),E=null}))})).catch((e=>{console.error(`Something went wrong when reading the settings.\n${e}`)})),s.addCommand(c.showPanel,{label:h.__("Extension Manager"),execute:()=>{E&&m.activateById(E.id)},isVisible:()=>p.isEnabled}),s.addCommand(c.toggle,{label:h.__("Enable Extension Manager"),execute:()=>{n&&n.set(g.id,"enabled",!p.isEnabled)},isToggled:()=>p.isEnabled}),i&&i.addItem({command:c.toggle,category:h.__("Extension Manager")})}},m=g;var u;!function(e){e.showWarning=async function(e){return(await(0,i.showDialog)({title:e.__("Enable Extension Manager?"),body:e.__("Thanks for trying out JupyterLab's extension manager.\nThe JupyterLab development team is excited to have a robust\nthird-party extension community.\nHowever, we cannot vouch for every extension,\nand some may introduce security risks.\nDo you want to continue?"),buttons:[i.Dialog.cancelButton({label:e.__("Disable")}),i.Dialog.warnButton({label:e.__("Enable")})]})).button.accept}}(u||(u={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2311],{22311:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var a=t(27961),i=t(15465),o=t(60090),s=t(87844),l=t(25291),d=t(12668);const r="@jupyterlab/extensionmanager-extension:plugin";var c;!function(e){e.showPanel="extensionmanager:show-panel",e.toggle="extensionmanager:toggle"}(c||(c={}));const g={id:r,description:"Adds the extension manager plugin.",autoStart:!0,requires:[s.ISettingRegistry],optional:[l.ITranslator,a.ILayoutRestorer,i.ICommandPalette],activate:async(e,n,t,a,i)=>{const{commands:s,shell:m,serviceManager:b}=e,h=(t=null!=t?t:l.nullTranslator).load("jupyterlab"),p=new o.ListModel(b,t),_=()=>{const e=new o.ExtensionsPanel({model:p,translator:t});return e.id="extensionmanager.main-view",e.title.icon=d.extensionIcon,e.title.caption=h.__("Extension Manager"),e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",h.__("Extension Manager section")),a&&a.add(e,e.id),m.add(e,"left",{rank:1e3}),e};let E=_();Promise.all([e.restored,n.load(r)]).then((([,n])=>{p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,p.stateChanged.connect((()=>{p.isDisclaimed!==n.get("disclaimed").composite&&n.set("disclaimed",p.isDisclaimed).catch((e=>{console.error(`Failed to set setting 'disclaimed'.\n${e}`)})),p.isEnabled!==n.get("enabled").composite&&n.set("enabled",p.isEnabled).catch((e=>{console.error(`Failed to set setting 'enabled'.\n${e}`)}))})),p.isEnabled?E=null!=E?E:_():(null==E||E.dispose(),E=null),n.changed.connect((async()=>{if(p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,e.commands.notifyCommandChanged(c.toggle),p.isEnabled){if(!(null!==E&&E.isAttached||await u.showWarning(h)))return void n.set("enabled",!1);E=null!=E?E:_()}else null==E||E.dispose(),E=null}))})).catch((e=>{console.error(`Something went wrong when reading the settings.\n${e}`)})),s.addCommand(c.showPanel,{label:h.__("Extension Manager"),execute:()=>{E&&m.activateById(E.id)},isVisible:()=>p.isEnabled}),s.addCommand(c.toggle,{label:h.__("Enable Extension Manager"),execute:()=>{n&&n.set(g.id,"enabled",!p.isEnabled)},isToggled:()=>p.isEnabled}),i&&i.addItem({command:c.toggle,category:h.__("Extension Manager")})}},m=g;var u;!function(e){e.showWarning=async function(e){return(await(0,i.showDialog)({title:e.__("Enable Extension Manager?"),body:e.__("Thanks for trying out JupyterLab's extension manager.\nThe JupyterLab development team is excited to have a robust\nthird-party extension community.\nHowever, we cannot vouch for every extension,\nand some may introduce security risks.\nDo you want to continue?"),buttons:[i.Dialog.cancelButton({label:e.__("Disable")}),i.Dialog.warnButton({label:e.__("Enable")})]})).button.accept}}(u||(u={}))}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r,s=n(83978),a=n(20998),i=n(81997);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=r.getData(e.value);this._data=new s.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=r.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=r.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),r=Object.keys(t);for(const t of n)-1===r.indexOf(t)&&e.delete(t);for(const n of r){const r=e.get(n),s=t[n];r!==s&&e.set(n,s)}}}!function(e){e.getData=function(e){return r.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const r in e)t[r]=n(e,r);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(r||(r={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,Dq:()=>c,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>h,vy:()=>s,xr:()=>o});var r=n(28182);const s={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new r.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new r.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new r.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new r.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new r.zt(e)},c={safe:!0,mimeTypes:["application/vnd.jupyter.stderr"],defaultRank:110,createRenderer:e=>new r.Hw(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout"],defaultRank:120,createRenderer:e=>new r.lH(e)},h={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new r.ND(e)},u=[s,o,i,l,a,h,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>u._y,IMarkdownParser:()=>u.sc,IRenderMimeRegistry:()=>u.ZD,MimeModel:()=>l.a,OutputModel:()=>c.M,RenderMimeRegistry:()=>d.D,RenderedCommon:()=>p.pY,RenderedError:()=>p.Hw,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,errorRendererFactory:()=>i.Dq,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderError:()=>h.Op,renderHTML:()=>h.NN,renderImage:()=>h.co,renderLatex:()=>h.K3,renderMarkdown:()=>h.ap,renderSVG:()=>h.KB,renderText:()=>h.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var r=n(52037),s={};for(const e in r)"default"!==e&&(s[e]=()=>r[e]);n.d(t,s);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),c=n(4800),d=n(32549),h=n(3328),u=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const r="$",s=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,c=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":r))):n=e=>e;let d=e.replace(/\r\n?/g,"\n").split(s);for(let e=1,s=d.length;e<s;e+=2){const s=d[e];"@"===s.charAt(0)?(d[e]="@@"+t.length+"@@",t.push(s)):null!==a?s===i?c?l=e:(d=o(a,e,n,t,d),a=null,i=null,l=null):s.match(/\n.*\n/)?(null!==l&&(e=l,d=o(a,e,n,t,d)),a=null,i=null,l=null,c=0):"{"===s?c++:"}"===s&&c&&c--:s===r||"$$"===s?(a=e,i=s,c=0):"\\\\("===s||"\\\\["===s?(a=e,i="("===s.slice(-1)?"\\\\)":"\\\\]",c=0):"begin"===s.substr(1,5)&&(a=e,i="\\end"+s.substr(6),c=0)}return null!==a&&null!==l&&(d=o(a,l,n,t,d),a=null,i=null,l=null),{text:n(d.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let r=t[n];return"\\\\("===r.substr(0,3)&&"\\\\)"===r.substr(r.length-3)?r="\\("+r.substring(3,r.length-3)+"\\)":"\\\\["===r.substr(0,3)&&"\\\\]"===r.substr(r.length-3)&&(r="\\["+r.substring(3,r.length-3)+"\\]"),r}))}function o(e,t,n,r,s){let a=s.slice(e,t+1).join("").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)s[t]="",t--;return s[e]="@@"+r.length+"@@",n&&(a=n(a)),r.push(a),s}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});class r{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||s.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var s;!function(e){e.noOp=function(){}}(s||(s={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var r,s=n(67241),a=n(83978),i=n(20998),o=n(81997);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=r.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=r.extract(l,e)}this.type=l.output_type,s.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=r.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),r=Object.keys(t);for(const t of n)-1===r.indexOf(t)&&e.delete(t);for(const n of r){const r=e.get(n),s=t[n];r!==s&&e.set(n,s)}}}!function(e){e.getData=function(e){return r.getData(e)},e.getMetadata=function(e){return r.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(s.isExecuteResult(e)||s.isDisplayData(e)||s.isDisplayUpdate(e))t=e.data;else if(s.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(s.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=r(e,n);return t}(t)}function n(e){const t=Object.create(null);if(s.isExecuteResult(e)||s.isDisplayData(e))for(const n in e.metadata)t[n]=r(e.metadata,n);return t}function r(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=r}(r||(r={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var r,s=n(72703),a=n(65848),i=n(70858),o=n(32021);class l{constructor(e={}){var t,n,r,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(r=e.linkHandler)&&void 0!==r?r:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new s.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=r.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,r,s,a,i,o,c,d,h;const u=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(s=null!==(r=e.sanitizer)&&void 0!==r?r:this.sanitizer)&&void 0!==s?s:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(c=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==c?c:void 0,markdownParser:null!==(h=null!==(d=e.markdownParser)&&void 0!==d?d:this.markdownParser)&&void 0!==h?h:void 0,translator:this.translator});return u._factories={...this._factories},u._ranks={...this._ranks},u._id=this._id,u}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e,t=!1){return!this.isMalformed(e)&&(a.URLExt.isLocal(e,t)||!!this._contents.driveName(decodeURI(e)))}async resolvePath(e){const t=a.PageConfig.getOption("rootUri").replace("file://","");if(e.startsWith("~/")&&t.startsWith("/home/")&&(e=t.split("/").slice(0,3).join("/")+e.substring(1)),e.startsWith(t)||e.startsWith("./"))try{const n=e.replace(t,"");return{path:(await this._contents.get(n,{content:!1})).path,scope:"server"}}catch(t){return console.warn(`Could not resolve location of ${e} on server`),null}return{path:e,scope:"kernel"}}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const r=e[t],s=e[n];return r.rank!==s.rank?r.rank-s.rank:r.id-s.id}))}}(r||(r={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>w,K3:()=>u,KB:()=>f,NN:()=>d,Op:()=>T,ap:()=>p,co:()=>h});var r,s,a=n(65848),i=n(70858),o=n(8872),l=n.n(o),c=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:a,resolver:o,linkHandler:l,shouldTypeset:c,latexTypesetter:d,translator:h}=e;h=h||i.nullTranslator;const u=null==h?void 0:h.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=a.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=u.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=u.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{c&&d&&d.typeset(t)}))}function h(e){const{host:t,mimeType:n,source:r,width:s,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${r}`,"number"==typeof a&&(l.height=a),"number"==typeof s&&(l.width=s),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:r,latexTypesetter:s}=e;return t.textContent=n,r&&s&&s.typeset(t),Promise.resolve(void 0)}async function p(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,c.D)(n);i=await r.render(e.text),i=(0,c.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function f(e){let{host:t,source:n,trusted:r,unconfined:s}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!r)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===s&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(p||(p={})),function(e){const t="\\u0000-\\u0020\\u007f-\\u009f";e.webLinkRegex=new RegExp("(?<path>(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?])","ug");const n=new RegExp(`(${/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/.source}|${/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/.source})`),r=navigator.userAgent.indexOf("Windows")>=0;e.pathLinkRegex=new RegExp(`(?<path>${r?n.source:/((?:\~|\.)?(?:\/[\w\.-]*)+)/.source})${/(?:(?:\:|", line )(?<line>[\d]+))?(?:\:(?<column>[\d]+))?/.source}`,"g")}(r||(r={}));class m{constructor(){this.regex=r.webLinkRegex}createAnchor(e,t){const n=document.createElement("a");return n.href=e.startsWith("www.")?"https://"+e:e,n.rel="noopener",n.target="_blank",n.appendChild(document.createTextNode(t)),n}processPath(e){const t=e.slice(-1),n=-1!==[">","<"].indexOf(t)?e.length-1:e.length;return e.slice(0,n)}processLabel(e){return this.processPath(e)}}class g{constructor(){this.regex=r.pathLinkRegex}createAnchor(e,t,n){const r=document.createElement("a");r.dataset.path=e;const s=parseInt(n.line,10);let a=isNaN(s)?"":"line="+(s-1);return r.dataset.locator=a,r.appendChild(document.createTextNode(t)),r}}function y(e,t){const n=[];t.checkWeb&&n.push(new m),t.checkPaths&&n.push(new g);const r=[],s=(e,t)=>{if(t>=n.length)return void r.push(document.createTextNode(e));const a=n[t];let i,o=0;const l=a.regex;for(l.lastIndex=0;null!=(i=l.exec(e));){const n=e.substring(o,i.index);n&&s(n,t+1);const{path:l,...c}=i.groups,d=a.processPath?a.processPath(l):l,h=a.processLabel?a.processLabel(i[0]):i[0];r.push(a.createAnchor(d,h,c)),o=i.index+h.length}const c=e.substring(o);c&&s(c,t+1)};return s(e,0),r}function v(e,t){var n,r;const s=e.cloneNode();s.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(r=e.textContent)||void 0===r?void 0:r.slice(t),{pre:s,post:a}}function*x(e){var t;let n,r=0;for(let s of e)n=r+((null===(t=s.textContent)||void 0===t?void 0:t.length)||0),yield{node:s,start:r,end:n,isText:s.nodeType===Node.TEXT_NODE},r=n}function w(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre");l.innerHTML=o;const c=l.textContent;let d;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?y(c,{checkWeb:!0,checkPaths:!1}):[document.createTextNode(o)];d=b(Array.from(l.childNodes),e)}else d=document.createElement("pre");return r.appendChild(d),Promise.resolve(void 0)}function T(e){var t,n;const{host:r,linkHandler:a,sanitizer:i,resolver:o,source:l}=e,c=i.sanitize(s.ansiSpan(l),{allowedTags:["span"]}),d=document.createElement("pre");d.innerHTML=c;const h=d.textContent;let u,p;if(h){const e=null===(n=null===(t=i.getAutolink)||void 0===t?void 0:t.call(i))||void 0===n||n?y(h,{checkWeb:!0,checkPaths:!0}):[document.createTextNode(c)];u=b(Array.from(d.childNodes),e)}else u=document.createElement("pre");return r.appendChild(u),p=o?s.handlePaths(r,o,a):Promise.resolve(void 0),p}function b(e,t){const n=document.createElement("pre");let r=!1;const s=[];for(let n of function*(e,t){var n,r;let s=x(e),a=x(t),i=s.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=s.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=s.next(),o=a.next();else if(e.end>t.end){let{pre:r,post:s}=v(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[r,t.node],e.node=s,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=v(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(r=e.node.textContent)||void 0===r?void 0:r.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=s.next()}}}}(e,t)){if(!n[0]){s.push(n[1]),r=n[1].nodeType!==Node.TEXT_NODE;continue}if(!n[1]){s.push(n[0]),r=!1;continue}let[e,t]=n;const a=s[s.length-1];r&&t.href===a.href?a.appendChild(e):t.nodeType!==Node.TEXT_NODE?(t.textContent="",t.appendChild(e),s.push(t),r=!0):(s.push(e),r=!1)}for(const e of s)n.appendChild(e);return n}!function(e){async function t(e,t,n){const r=e.getAttribute(t)||"",s=n.isLocal?n.isLocal(r):a.URLExt.isLocal(r);if(r&&s)try{const s=await n.resolveUrl(r);let i=await n.getDownloadUrl(s);"data:"!==a.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let r=e.getAttribute("href")||"";const s=t.isLocal?t.isLocal(r):a.URLExt.isLocal(r);if(!r||!s)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===r)return e.target="_self",Promise.resolve(void 0);r=r.replace(i,"")}return t.resolveUrl(r).then((r=>{const s=decodeURIComponent(r);return n&&n.handleLink(e,s,i),t.getDownloadUrl(r)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}async function r(e,t,n){let r=e.dataset.path||"",s=e.dataset.locator?"#"+e.dataset.locator:"";delete e.dataset.path,delete e.dataset.locator;const i=t.isLocal?t.isLocal(r,!0):a.URLExt.isLocal(r,!0);if(!(r&&i&&t.resolvePath&&n&&n.handlePath))return e.replaceWith(...e.childNodes),Promise.resolve(void 0);try{const a=await t.resolvePath(r);if(!a)return console.log("Path resolution bailing: does not exist"),Promise.resolve(void 0);n.handlePath(e,a.path,a.scope,s),e.href=a.path+s}catch(t){console.warn("Path anchor error:",t),e.href="#linking-failed-see-console"}}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,r=n.length;e<r;++e){const{name:r,value:s}=n[e];t.setAttribute(r,s)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const r=n[e];if(!(r instanceof HTMLAnchorElement))continue;const s=r.href,i=t&&t.isLocal?t.isLocal(s):a.URLExt.isLocal(s);r.target||(r.target=i?"_self":"_blank"),i||(r.rel="noopener")}const r=e.getElementsByTagName("img");for(let e=0;e<r.length;e++)r[e].alt||(r[e].alt="Image")},e.handleUrls=function(e,r,s){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",r));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],r,s));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",r));return Promise.all(a).then((()=>{}))},e.handlePaths=async function(e,t,n){const s=e.getElementsByTagName("a");for(let e=0;e<s.length;e++)await r(s[e],t,n)},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=p.createHeaderId(n);const r=document.createElement("a");r.target="_self",r.textContent="¶",r.href="#"+n.id,r.classList.add("jp-InternalAnchorLink"),n.appendChild(r)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function i(e,t,n,r,a,i,o){if(e){const l=[],c=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?c.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?c.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||c.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),c.length&&o.push(` style="${c.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function o(e){let t,n,r;const s=e.shift();if(2===s&&e.length>=3){if(t=e.shift(),n=e.shift(),r=e.shift(),[t,n,r].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===s&&e.length>=1))throw new RangeError("Invalid extended color specification");{const s=e.shift();if(s<0)throw new RangeError("Color index must be >= 0");if(s<16)return s;if(s<232)t=Math.floor((s-16)/36),t=t>0?55+40*t:0,n=Math.floor((s-16)%36/6),n=n>0?55+40*n:0,r=(s-16)%6,r=r>0?55+40*r:0;else{if(!(s<256))throw new RangeError("Color index must be < 256");t=n=r=10*(s-232)+8}}}return[t,n,r]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,r=[],s=[],a=!1,c=!1,d=!1;const h=[],u=[];let p=0;for(e=l()(e),e+="";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)u.push(0);else{if(-1===n.search(/^\d+$/)){u.length=0;break}u.push(parseInt(n,10))}}}for(i(e.substring(p,n.index),r,s,a,c,d,h),p=t.lastIndex;u.length;){const e=u.shift();switch(e){case 0:r=s=[],a=!1,c=!1,d=!1;break;case 1:case 5:a=!0;break;case 4:c=!0;break;case 7:d=!0;break;case 21:case 22:a=!1;break;case 24:c=!1;break;case 27:d=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:r=e-30;break;case 38:try{r=o(u)}catch(e){u.length=0}break;case 39:r=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:s=e-40;break;case 48:try{s=o(u)}catch(e){u.length=0}break;case 49:s=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:r=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:s=e-100+8}}}return h.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>s,_y:()=>a,sc:()=>i});var r=n(20998);const s=new r.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new r.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new r.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>c,Hw:()=>f,ND:()=>m,UH:()=>d,cw:()=>h,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>u});var r=n(70858),s=n(63485),a=n(3328);class i extends s.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:r.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedHTML")}render(e){return this._rendered=a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class c extends i{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedLatex")}render(e){return this._rendered=a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class h extends o{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedMarkdown")}render(e){return this._rendered=a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class u extends i{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return this._rendered=a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.Op({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),linkHandler:this.linkHandler,resolver:this.resolver,translator:this.translator})}}class m extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var r,s=/[&<>"'`]/g,a=RegExp(s.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),c=(r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==r?void 0:r[e]}),d=Object.prototype.toString,h=l.Symbol,u=h?h.prototype:void 0,p=u?u.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(s,c):e}}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r,s=n(81417),a=n(20998),i=n(81997);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=r.getData(e.value);this._data=new s.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=r.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=r.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),r=Object.keys(t);for(const t of n)-1===r.indexOf(t)&&e.delete(t);for(const n of r){const r=e.get(n),s=t[n];r!==s&&e.set(n,s)}}}!function(e){e.getData=function(e){return r.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const r in e)t[r]=n(e,r);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(r||(r={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,Dq:()=>c,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>h,vy:()=>s,xr:()=>o});var r=n(28182);const s={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new r.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new r.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new r.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new r.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new r.zt(e)},c={safe:!0,mimeTypes:["application/vnd.jupyter.stderr"],defaultRank:110,createRenderer:e=>new r.Hw(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout"],defaultRank:120,createRenderer:e=>new r.lH(e)},h={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new r.ND(e)},u=[s,o,i,l,a,h,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>u._y,IMarkdownParser:()=>u.sc,IRenderMimeRegistry:()=>u.ZD,MimeModel:()=>l.a,OutputModel:()=>c.M,RenderMimeRegistry:()=>d.D,RenderedCommon:()=>p.pY,RenderedError:()=>p.Hw,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,errorRendererFactory:()=>i.Dq,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderError:()=>h.Op,renderHTML:()=>h.NN,renderImage:()=>h.co,renderLatex:()=>h.K3,renderMarkdown:()=>h.ap,renderSVG:()=>h.KB,renderText:()=>h.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var r=n(17722),s={};for(const e in r)"default"!==e&&(s[e]=()=>r[e]);n.d(t,s);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),c=n(4800),d=n(32549),h=n(3328),u=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const r="$",s=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,c=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":r))):n=e=>e;let d=e.replace(/\r\n?/g,"\n").split(s);for(let e=1,s=d.length;e<s;e+=2){const s=d[e];"@"===s.charAt(0)?(d[e]="@@"+t.length+"@@",t.push(s)):null!==a?s===i?c?l=e:(d=o(a,e,n,t,d),a=null,i=null,l=null):s.match(/\n.*\n/)?(null!==l&&(e=l,d=o(a,e,n,t,d)),a=null,i=null,l=null,c=0):"{"===s?c++:"}"===s&&c&&c--:s===r||"$$"===s?(a=e,i=s,c=0):"\\\\("===s||"\\\\["===s?(a=e,i="("===s.slice(-1)?"\\\\)":"\\\\]",c=0):"begin"===s.substr(1,5)&&(a=e,i="\\end"+s.substr(6),c=0)}return null!==a&&null!==l&&(d=o(a,l,n,t,d),a=null,i=null,l=null),{text:n(d.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let r=t[n];return"\\\\("===r.substr(0,3)&&"\\\\)"===r.substr(r.length-3)?r="\\("+r.substring(3,r.length-3)+"\\)":"\\\\["===r.substr(0,3)&&"\\\\]"===r.substr(r.length-3)&&(r="\\["+r.substring(3,r.length-3)+"\\]"),r}))}function o(e,t,n,r,s){let a=s.slice(e,t+1).join("").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)s[t]="",t--;return s[e]="@@"+r.length+"@@",n&&(a=n(a)),r.push(a),s}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});class r{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||s.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var s;!function(e){e.noOp=function(){}}(s||(s={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var r,s=n(49747),a=n(81417),i=n(20998),o=n(81997);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=r.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=r.extract(l,e)}this.type=l.output_type,s.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=r.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),r=Object.keys(t);for(const t of n)-1===r.indexOf(t)&&e.delete(t);for(const n of r){const r=e.get(n),s=t[n];r!==s&&e.set(n,s)}}}!function(e){e.getData=function(e){return r.getData(e)},e.getMetadata=function(e){return r.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(s.isExecuteResult(e)||s.isDisplayData(e)||s.isDisplayUpdate(e))t=e.data;else if(s.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(s.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=r(e,n);return t}(t)}function n(e){const t=Object.create(null);if(s.isExecuteResult(e)||s.isDisplayData(e))for(const n in e.metadata)t[n]=r(e.metadata,n);return t}function r(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=r}(r||(r={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var r,s=n(15465),a=n(44548),i=n(25291),o=n(32021);class l{constructor(e={}){var t,n,r,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(r=e.linkHandler)&&void 0!==r?r:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new s.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=r.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,r,s,a,i,o,c,d,h;const u=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(s=null!==(r=e.sanitizer)&&void 0!==r?r:this.sanitizer)&&void 0!==s?s:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(c=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==c?c:void 0,markdownParser:null!==(h=null!==(d=e.markdownParser)&&void 0!==d?d:this.markdownParser)&&void 0!==h?h:void 0,translator:this.translator});return u._factories={...this._factories},u._ranks={...this._ranks},u._id=this._id,u}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e,t=!1){return!this.isMalformed(e)&&(a.URLExt.isLocal(e,t)||!!this._contents.driveName(decodeURI(e)))}async resolvePath(e){const t=a.PageConfig.getOption("rootUri").replace("file://","");if(e.startsWith("~/")&&t.startsWith("/home/")&&(e=t.split("/").slice(0,3).join("/")+e.substring(1)),e.startsWith(t)||e.startsWith("./"))try{const n=e.replace(t,"");return{path:(await this._contents.get(n,{content:!1})).path,scope:"server"}}catch(t){return console.warn(`Could not resolve location of ${e} on server`),null}return{path:e,scope:"kernel"}}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const r=e[t],s=e[n];return r.rank!==s.rank?r.rank-s.rank:r.id-s.id}))}}(r||(r={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>w,K3:()=>u,KB:()=>f,NN:()=>d,Op:()=>T,ap:()=>p,co:()=>h});var r,s,a=n(44548),i=n(25291),o=n(8872),l=n.n(o),c=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:a,resolver:o,linkHandler:l,shouldTypeset:c,latexTypesetter:d,translator:h}=e;h=h||i.nullTranslator;const u=null==h?void 0:h.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=a.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=u.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=u.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{c&&d&&d.typeset(t)}))}function h(e){const{host:t,mimeType:n,source:r,width:s,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${r}`,"number"==typeof a&&(l.height=a),"number"==typeof s&&(l.width=s),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:r,latexTypesetter:s}=e;return t.textContent=n,r&&s&&s.typeset(t),Promise.resolve(void 0)}async function p(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,c.D)(n);i=await r.render(e.text),i=(0,c.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function f(e){let{host:t,source:n,trusted:r,unconfined:s}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!r)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===s&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(p||(p={})),function(e){const t="\\u0000-\\u0020\\u007f-\\u009f";e.webLinkRegex=new RegExp("(?<path>(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?])","ug");const n=new RegExp(`(${/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/.source}|${/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/.source})`),r=navigator.userAgent.indexOf("Windows")>=0;e.pathLinkRegex=new RegExp(`(?<path>${r?n.source:/((?:\~|\.)?(?:\/[\w\.-]*)+)/.source})${/(?:(?:\:|", line )(?<line>[\d]+))?(?:\:(?<column>[\d]+))?/.source}`,"g")}(r||(r={}));class m{constructor(){this.regex=r.webLinkRegex}createAnchor(e,t){const n=document.createElement("a");return n.href=e.startsWith("www.")?"https://"+e:e,n.rel="noopener",n.target="_blank",n.appendChild(document.createTextNode(t)),n}processPath(e){const t=e.slice(-1),n=-1!==[">","<"].indexOf(t)?e.length-1:e.length;return e.slice(0,n)}processLabel(e){return this.processPath(e)}}class g{constructor(){this.regex=r.pathLinkRegex}createAnchor(e,t,n){const r=document.createElement("a");r.dataset.path=e;const s=parseInt(n.line,10);let a=isNaN(s)?"":"line="+(s-1);return r.dataset.locator=a,r.appendChild(document.createTextNode(t)),r}}function y(e,t){const n=[];t.checkWeb&&n.push(new m),t.checkPaths&&n.push(new g);const r=[],s=(e,t)=>{if(t>=n.length)return void r.push(document.createTextNode(e));const a=n[t];let i,o=0;const l=a.regex;for(l.lastIndex=0;null!=(i=l.exec(e));){const n=e.substring(o,i.index);n&&s(n,t+1);const{path:l,...c}=i.groups,d=a.processPath?a.processPath(l):l,h=a.processLabel?a.processLabel(i[0]):i[0];r.push(a.createAnchor(d,h,c)),o=i.index+h.length}const c=e.substring(o);c&&s(c,t+1)};return s(e,0),r}function v(e,t){var n,r;const s=e.cloneNode();s.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(r=e.textContent)||void 0===r?void 0:r.slice(t),{pre:s,post:a}}function*x(e){var t;let n,r=0;for(let s of e)n=r+((null===(t=s.textContent)||void 0===t?void 0:t.length)||0),yield{node:s,start:r,end:n,isText:s.nodeType===Node.TEXT_NODE},r=n}function w(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre");l.innerHTML=o;const c=l.textContent;let d;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?y(c,{checkWeb:!0,checkPaths:!1}):[document.createTextNode(o)];d=b(Array.from(l.childNodes),e)}else d=document.createElement("pre");return r.appendChild(d),Promise.resolve(void 0)}function T(e){var t,n;const{host:r,linkHandler:a,sanitizer:i,resolver:o,source:l}=e,c=i.sanitize(s.ansiSpan(l),{allowedTags:["span"]}),d=document.createElement("pre");d.innerHTML=c;const h=d.textContent;let u,p;if(h){const e=null===(n=null===(t=i.getAutolink)||void 0===t?void 0:t.call(i))||void 0===n||n?y(h,{checkWeb:!0,checkPaths:!0}):[document.createTextNode(c)];u=b(Array.from(d.childNodes),e)}else u=document.createElement("pre");return r.appendChild(u),p=o?s.handlePaths(r,o,a):Promise.resolve(void 0),p}function b(e,t){const n=document.createElement("pre");let r=!1;const s=[];for(let n of function*(e,t){var n,r;let s=x(e),a=x(t),i=s.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=s.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=s.next(),o=a.next();else if(e.end>t.end){let{pre:r,post:s}=v(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[r,t.node],e.node=s,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=v(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(r=e.node.textContent)||void 0===r?void 0:r.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=s.next()}}}}(e,t)){if(!n[0]){s.push(n[1]),r=n[1].nodeType!==Node.TEXT_NODE;continue}if(!n[1]){s.push(n[0]),r=!1;continue}let[e,t]=n;const a=s[s.length-1];r&&t.href===a.href?a.appendChild(e):t.nodeType!==Node.TEXT_NODE?(t.textContent="",t.appendChild(e),s.push(t),r=!0):(s.push(e),r=!1)}for(const e of s)n.appendChild(e);return n}!function(e){async function t(e,t,n){const r=e.getAttribute(t)||"",s=n.isLocal?n.isLocal(r):a.URLExt.isLocal(r);if(r&&s)try{const s=await n.resolveUrl(r);let i=await n.getDownloadUrl(s);"data:"!==a.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let r=e.getAttribute("href")||"";const s=t.isLocal?t.isLocal(r):a.URLExt.isLocal(r);if(!r||!s)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===r)return e.target="_self",Promise.resolve(void 0);r=r.replace(i,"")}return t.resolveUrl(r).then((r=>{const s=decodeURIComponent(r);return n&&n.handleLink(e,s,i),t.getDownloadUrl(r)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}async function r(e,t,n){let r=e.dataset.path||"",s=e.dataset.locator?"#"+e.dataset.locator:"";delete e.dataset.path,delete e.dataset.locator;const i=t.isLocal?t.isLocal(r,!0):a.URLExt.isLocal(r,!0);if(!(r&&i&&t.resolvePath&&n&&n.handlePath))return e.replaceWith(...e.childNodes),Promise.resolve(void 0);try{const a=await t.resolvePath(r);if(!a)return console.log("Path resolution bailing: does not exist"),Promise.resolve(void 0);n.handlePath(e,a.path,a.scope,s),e.href=a.path+s}catch(t){console.warn("Path anchor error:",t),e.href="#linking-failed-see-console"}}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,r=n.length;e<r;++e){const{name:r,value:s}=n[e];t.setAttribute(r,s)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const r=n[e];if(!(r instanceof HTMLAnchorElement))continue;const s=r.href,i=t&&t.isLocal?t.isLocal(s):a.URLExt.isLocal(s);r.target||(r.target=i?"_self":"_blank"),i||(r.rel="noopener")}const r=e.getElementsByTagName("img");for(let e=0;e<r.length;e++)r[e].alt||(r[e].alt="Image")},e.handleUrls=function(e,r,s){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",r));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],r,s));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",r));return Promise.all(a).then((()=>{}))},e.handlePaths=async function(e,t,n){const s=e.getElementsByTagName("a");for(let e=0;e<s.length;e++)await r(s[e],t,n)},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=p.createHeaderId(n);const r=document.createElement("a");r.target="_self",r.textContent="¶",r.href="#"+n.id,r.classList.add("jp-InternalAnchorLink"),n.appendChild(r)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function i(e,t,n,r,a,i,o){if(e){const l=[],c=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?c.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?c.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||c.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),c.length&&o.push(` style="${c.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function o(e){let t,n,r;const s=e.shift();if(2===s&&e.length>=3){if(t=e.shift(),n=e.shift(),r=e.shift(),[t,n,r].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===s&&e.length>=1))throw new RangeError("Invalid extended color specification");{const s=e.shift();if(s<0)throw new RangeError("Color index must be >= 0");if(s<16)return s;if(s<232)t=Math.floor((s-16)/36),t=t>0?55+40*t:0,n=Math.floor((s-16)%36/6),n=n>0?55+40*n:0,r=(s-16)%6,r=r>0?55+40*r:0;else{if(!(s<256))throw new RangeError("Color index must be < 256");t=n=r=10*(s-232)+8}}}return[t,n,r]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,r=[],s=[],a=!1,c=!1,d=!1;const h=[],u=[];let p=0;for(e=l()(e),e+="";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)u.push(0);else{if(-1===n.search(/^\d+$/)){u.length=0;break}u.push(parseInt(n,10))}}}for(i(e.substring(p,n.index),r,s,a,c,d,h),p=t.lastIndex;u.length;){const e=u.shift();switch(e){case 0:r=s=[],a=!1,c=!1,d=!1;break;case 1:case 5:a=!0;break;case 4:c=!0;break;case 7:d=!0;break;case 21:case 22:a=!1;break;case 24:c=!1;break;case 27:d=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:r=e-30;break;case 38:try{r=o(u)}catch(e){u.length=0}break;case 39:r=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:s=e-40;break;case 48:try{s=o(u)}catch(e){u.length=0}break;case 49:s=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:r=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:s=e-100+8}}}return h.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>s,_y:()=>a,sc:()=>i});var r=n(20998);const s=new r.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new r.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new r.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>c,Hw:()=>f,ND:()=>m,UH:()=>d,cw:()=>h,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>u});var r=n(25291),s=n(63485),a=n(3328);class i extends s.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:r.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedHTML")}render(e){return this._rendered=a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class c extends i{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedLatex")}render(e){return this._rendered=a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class h extends o{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedMarkdown")}render(e){return this._rendered=a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class u extends i{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return this._rendered=a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.Op({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),linkHandler:this.linkHandler,resolver:this.resolver,translator:this.translator})}}class m extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var r,s=/[&<>"'`]/g,a=RegExp(s.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),c=(r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==r?void 0:r[e]}),d=Object.prototype.toString,h=l.Symbol,u=h?h.prototype:void 0,p=u?u.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(s,c):e}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2479],{72479:(e,t,s)=>{s.r(t),s.d(t,{AttachmentsCell:()=>ge,AttachmentsCellModel:()=>I,Cell:()=>ue,CellDragUtils:()=>l,CellFooter:()=>v,CellHeader:()=>_,CellModel:()=>A,CellSearchProvider:()=>B,CodeCell:()=>pe,CodeCellLayout:()=>ce,CodeCellModel:()=>k,Collapser:()=>p,InputArea:()=>w,InputCollapser:()=>g,InputPlaceholder:()=>W,InputPrompt:()=>f,MarkdownCell:()=>me,MarkdownCellModel:()=>j,OutputCollapser:()=>m,OutputPlaceholder:()=>L,Placeholder:()=>F,RawCell:()=>Ce,RawCellModel:()=>D,SELECTED_HIGHLIGHT_CLASS:()=>z,createCellSearchProvider:()=>J,isCodeCellModel:()=>E,isMarkdownCellModel:()=>H,isRawCellModel:()=>b});var i=s(24475);const n="jp-dragImage",o="jp-dragImage-singlePrompt",r="jp-dragImage-content",a="jp-dragImage-prompt",d="jp-dragImage-multipleBack";var l;!function(e){e.findCell=function(e,t,s){let i=-1;for(;e&&e.parentElement;){if(s(e)){let s=-1;for(const n of t)if(n.node===e){i=++s;break}break}e=e.parentElement}return i},e.detectTargetArea=function(e,t){var s,i;let n;return n=e?(null===(s=e.editorWidget)||void 0===s?void 0:s.node.contains(t))?"input":(null===(i=e.promptNode)||void 0===i?void 0:i.contains(t))?"prompt":"cell":"unknown",n},e.shouldStartDrag=function(e,t,s,i){const n=Math.abs(s-e),o=Math.abs(i-t);return n>=5||o>=5},e.createCellDragImage=function(e,t){const s=t.length;let l;if("code"===e.model.type){const t=e.model.executionCount;l=" ",t&&(l=t.toString())}else l="";const h=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);return s>1?""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a},"["+l+"]:"),i.h.span({className:r},h)),i.h.div({className:d},""))):i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a}),i.h.span({className:r},h)),i.h.div({className:d},""))):""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${o}`},i.h.span({className:a},"["+l+"]:"),i.h.span({className:r},h)))):i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${o}`},i.h.span({className:a}),i.h.span({className:r},h))))}}(l||(l={}));var h=s(95291),u=s(18395),c=s(78156);class p extends h.ReactWidget{constructor(){super(),this.addClass("jp-Collapser")}get collapsed(){return!1}render(){return c.createElement("div",{className:"jp-Collapser-child",onClick:e=>this.handleClick(e)})}}class g extends p{constructor(){super(),this.addClass("jp-InputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.inputHidden}handleClick(e){var t;const s=null===(t=this.parent)||void 0===t?void 0:t.parent;s&&(s.inputHidden=!s.inputHidden),this.update()}}class m extends p{constructor(){super(),this.addClass("jp-OutputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.outputHidden}handleClick(e){var t,s;const i=null===(t=this.parent)||void 0===t?void 0:t.parent;if(i&&(i.outputHidden=!i.outputHidden,i.outputHidden)){let e=null===(s=i.parent)||void 0===s?void 0:s.node;e&&u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}this.update()}}var C=s(63485);class _ extends C.Widget{constructor(){super(),this.addClass("jp-CellHeader")}}class v extends C.Widget{constructor(){super(),this.addClass("jp-CellFooter")}}var y=s(63242);class w extends C.Widget{constructor(e){super(),this.addClass("jp-InputArea");const{contentFactory:t,editorOptions:s,model:i}=e;this.model=i,this.contentFactory=t;const n=this._prompt=t.createInputPrompt();n.addClass("jp-InputArea-prompt");const o=this._editor=new y.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:s});o.addClass("jp-InputArea-editor");const r=this.layout=new C.PanelLayout;r.addWidget(n),r.addWidget(o)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;this._rendered&&(this._rendered.parent=null),this._editor.hide(),this._rendered=e,t.addWidget(e)}showEditor(){this._rendered&&(this._rendered.parent=null),this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){this.isDisposed||(this._prompt=null,this._editor=null,this._rendered=null,super.dispose())}}!function(e){e.ContentFactory=class{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new f}}}(w||(w={}));class f extends C.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-InputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?" ":`[${e||" "}]:`}}var x=s(81997),M=s(99122),O=s(1761),P=s(57508);const S=(0,P.createMutex)();function E(e){return"code"===e.type}function H(e){return"markdown"===e.type}function b(e){return"raw"===e.type}class A extends y.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:s,...i}=e;super({sharedModel:null!=s?s:(0,P.createStandaloneCell)({cell_type:null!=t?t:"raw",id:e.id}),...i}),this.contentChanged=new x.Signal(this),this.stateChanged=new x.Signal(this),this._metadataChanged=new x.Signal(this),this._trusted=!1,this.standaloneModel=void 0===e.sharedModel,this.trusted=!!this.getMetadata("trusted")||!!e.trusted,this.sharedModel.changed.connect(this.onGenericChange,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;t!==e&&(this._trusted=e,this.onTrustedChanged(this,{newValue:e,oldValue:t}))}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this.onGenericChange,this),this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this),super.dispose())}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class I extends A{constructor(e){var t;super(e);const s=null!==(t=e.contentFactory)&&void 0!==t?t:I.defaultContentFactory,i=this.sharedModel.getAttachments();this._attachments=s.createAttachmentsModel({values:i}),this._attachments.stateChanged.connect(this.onGenericChange,this),this._attachments.changed.connect(this._onAttachmentsChange,this),this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){this.isDisposed||(this._attachments.stateChanged.disconnect(this.onGenericChange,this),this._attachments.changed.disconnect(this._onAttachmentsChange,this),this._attachments.dispose(),this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),super.dispose())}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const s=this.sharedModel;S((()=>s.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;S((()=>{var t;return this._attachments.fromJSON(null!==(t=e.getAttachments())&&void 0!==t?t:{})}))}}}!function(e){class t{createAttachmentsModel(e){return new M.AttachmentsModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(I||(I={}));class D extends I{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class j extends I{constructor(e={}){super({cell_type:"markdown",...e}),this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class k extends A{constructor(e={}){var t;super({cell_type:"code",...e}),this._executedCode="",this._isDirty=!1;const s=null!==(t=null==e?void 0:e.contentFactory)&&void 0!==t?t:k.defaultContentFactory,i=this.trusted,n=this.sharedModel.getOutputs();this._outputs=s.createOutputArea({trusted:i,values:n}),this.sharedModel.changed.connect(this._onSharedModelChanged,this),this._outputs.changed.connect(this.onGenericChange,this),this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get isDirty(){return this._isDirty}set isDirty(e){this._setDirty(e)}get outputs(){return this._outputs}clearExecution(){this.outputs.clear(),this.executionCount=null,this._setDirty(!1),this.sharedModel.deleteMetadata("execution"),this.trusted=!0}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),this._outputs.changed.disconnect(this.onGenericChange,this),this._outputs.changed.disconnect(this.onOutputsChange,this),this._outputs.dispose(),this._outputs=null,super.dispose())}onTrustedChanged(e,t){const s=t.newValue;if(this._outputs&&(this._outputs.trusted=s),s){const e=this.sharedModel,t=e.getMetadata();t.trusted=!0,e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:s})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const s=this.sharedModel;S((()=>{switch(t.type){case"add":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.newIndex,t.newIndex,e);break}case"set":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.oldIndex,t.oldIndex+e.length,e);break}case"remove":s.updateOutputs(t.oldIndex,t.oldValues.length);break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){t.outputsChange&&S((()=>{this.outputs.clear(),e.getOutputs().forEach((e=>this._outputs.add(e)))})),t.executionCountChange&&(!t.executionCountChange.newValue||!this.isDirty&&t.executionCountChange.oldValue||this._setDirty(!1),this.stateChanged.emit({name:"executionCount",oldValue:t.executionCountChange.oldValue,newValue:t.executionCountChange.newValue})),t.sourceChange&&null!==this.executionCount&&this._setDirty(this._executedCode!==this.sharedModel.getSource().trim())}_setDirty(e){e||(this._executedCode=this.sharedModel.getSource().trim()),e!==this._isDirty&&(this._isDirty=e,this.stateChanged.emit({name:"isDirty",oldValue:!e,newValue:e}))}}!function(e){class t{createOutputArea(e){return new O.OutputAreaModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(k||(k={}));var N=s(70858);class F extends C.Widget{constructor(e){var t,s,i;const n=document.createElement("div");super({node:n});const o=(null!==(t=e.translator)&&void 0!==t?t:N.nullTranslator).load("jupyterlab"),r=document.createElement("div");r.className=null!==(s=e.promptClass)&&void 0!==s?s:"",n.insertAdjacentHTML("afterbegin",r.outerHTML),this._cell=document.createElement("div"),this._cell.classList.add("jp-Placeholder-content"),this._cell.title=o.__("Click to expand");const a=this._cell.appendChild(document.createElement("div"));a.classList.add("jp-Placeholder-contentContainer"),this._textContent=a.appendChild(document.createElement("span")),this._textContent.className="jp-PlaceholderText",this._textContent.innerText=null!==(i=e.text)&&void 0!==i?i:"",n.appendChild(this._cell),h.ellipsesIcon.element({container:a.appendChild(document.createElement("span")),className:"jp-MoreHorizIcon",elementPosition:"center",height:"auto",width:"32px"}),this.addClass("jp-Placeholder"),this._callback=e.callback}set text(e){this._textContent.innerText=e}get text(){return this._textContent.innerText}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this._callback)}onBeforeDetach(e){this.node.removeEventListener("click",this._callback),super.onBeforeDetach(e)}}class W extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-InputPrompt"}),this.addClass("jp-InputPlaceholder")}}class L extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-OutputPrompt"}),this.addClass("jp-OutputPlaceholder")}}var T=s(44033),R=s(65848),V=s(54509);const z="jp-mod-selected";class B extends T.EditorSearchProvider{constructor(e){super(),this.cell=e,this.cell.inViewport||this.cell.editor||(0,R.signalToPromise)(e.inViewportChanged).then((([,e])=>{e&&this.cmHandler.setEditor(this.editor)}))}get editor(){return this.cell.editor}get model(){return this.cell.model}}class U extends B{constructor(e){super(e),this.currentProviderIndex=-1,this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error("Failed to initialize search on cell outputs.",e)})),t.outputLengthChanged.connect(this._onOutputsChanged,this),t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){return this.isActive?super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0):0}async clearHighlight(){await super.clearHighlight(),await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){this.isDisposed||(super.dispose(),this.outputsProvider.map((e=>{e.dispose()})),this.outputsProvider.length=0)}async highlightNext(e,t){var s;const i=null!==(s=null==t?void 0:t.from)&&void 0!==s?s:"";if(!(0===this.matchesCount||"previous-match"===i&&null!==this.currentIndex&&this.currentIndex+1>=this.cmHandler.matches.length)&&this.isActive){if(-1===this.currentProviderIndex){const s=await super.highlightNext(e,t);if(s)return this.currentIndex=this.cmHandler.currentIndex,s;this.currentProviderIndex=0}for(;this.currentProviderIndex<this.outputsProvider.length;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightNext(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex+=1}return this.currentProviderIndex=-1,void(this.currentIndex=null)}this.currentIndex=null}async highlightPrevious(){if(0!==this.matchesCount&&this.isActive){for(null===this.currentIndex&&(this.currentProviderIndex=this.outputsProvider.length-1);this.currentProviderIndex>=0;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightPrevious(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex-=1}const e=await super.highlightPrevious();return e?(this.currentIndex=this.cmHandler.currentIndex,e):void(this.currentIndex=null)}this.currentIndex=null}async startQuery(e,t){await super.startQuery(e,t),!1!==(null==t?void 0:t.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}async endQuery(){var e;await super.endQuery(),!1!==(null===(e=this.filters)||void 0===e?void 0:e.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}async _onOutputsChanged(e,t){var s;this.outputsProvider.forEach((e=>{e.dispose()})),this.outputsProvider.length=0,this.currentProviderIndex=-1,this.outputsProvider=this.cell.outputArea.widgets.map((e=>new V.GenericSearchProvider(e))),this.isActive&&this.query&&!1!==(null===(s=this.filters)||void 0===s?void 0:s.output)&&await Promise.all([this.outputsProvider.map((e=>{e.startQuery(this.query)}))]),this._stateChanged.emit()}}class $ extends B{constructor(e){super(e),this._unrenderedByHighlight=!1,this.renderedProvider=new V.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight(),await this.renderedProvider.clearHighlight()}dispose(){this.isDisposed||(super.dispose(),this.renderedProvider.dispose())}async endQuery(){await super.endQuery(),await this.renderedProvider.endQuery()}async highlightNext(e=!0,t){let s;if(!this.isActive)return s;const i=this.cell;if(i.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(i.renderedChanged);i.rendered=!1,await e}return s=await super.highlightNext(e,t),s}async highlightPrevious(){let e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightPrevious(),e}async startQuery(e,t){await super.startQuery(e,t);const s=this.cell;s.rendered&&this.onRenderedChanged(s,s.rendered),s.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e){const t=await super.replaceAllMatches(e);return this.cell.rendered&&this.cell.update(),t}onRenderedChanged(e,t){var s;this._unrenderedByHighlight||(this.currentIndex=null),this._unrenderedByHighlight=!1,this.isActive&&(t?this.renderedProvider.startQuery(this.query):(null===(s=e.editor)||void 0===s||s.setCursorPosition({column:0,line:0}),this.renderedProvider.endQuery()))}}function J(e){if(e.isPlaceholder())return new B(e);switch(e.model.type){case"code":return new U(e);case"markdown":return new $(e);default:return new B(e)}}var Q=s(97205),q=s(72703),G=s(62514),X=s(85996),Y=s(20998),K=s(33625),Z=s(49503),ee=s(97934);const te="jp-mod-resizedCell";class se extends C.Widget{constructor(e){super(),this.targetNode=e,this._isActive=!1,this._isDragging=!1,this.sizeChanged=new x.Signal(this),this.addClass("jp-CellResizeHandle"),this._resizer=new ee.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose(),super.dispose()}handleEvent(e){var t,s;switch(e.type){case"dblclick":null===(t=this.targetNode.parentNode)||void 0===t||t.childNodes.forEach((e=>{e.classList.remove(te)})),document.documentElement.style.setProperty("--jp-side-by-side-output-size","1fr"),this._isActive=!1;break;case"mousedown":this._isDragging=!0,this._isActive||(null===(s=this.targetNode.parentNode)||void 0===s||s.childNodes.forEach((e=>{e.classList.add(te)})),this._isActive=!0),window.addEventListener("mousemove",this),window.addEventListener("mouseup",this);break;case"mousemove":this._isActive&&this._isDragging&&this._resizer.invoke(e);break;case"mouseup":this._isDragging=!1,window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this)}}onAfterAttach(e){this.node.addEventListener("dblclick",this),this.node.addEventListener("mousedown",this),super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this),this.node.removeEventListener("mousedown",this),super.onBeforeDetach(e)}_resize(e){const{width:t,x:s}=this.targetNode.getBoundingClientRect(),i=t/(e.clientX-s)-1;if(0<i){const e=Math.max(Math.min(Math.abs(i),50),.05);document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`),this.sizeChanged.emit(e)}}}const ie="jp-Cell-outputWrapper",ne="jp-mod-dirty",oe="jp-MarkdownHeadingCollapsed",re="jp-collapseHeadingButton",ae="jp-showHiddenCellsButton",de="jp-mod-rendered",le="jp-mod-noOutputs",he="application/x-jupyter-icontentsrich";class ue extends C.Widget{constructor(e){var t,s,i,n;super(),this.prompt="",this._displayChanged=new x.Signal(this),this._scrollRequested=new x.Signal(this),this._scrollHandlerExtension=Q.EditorView.scrollHandler.of(((e,t,s)=>{const i=null!==this._inViewport&&!this._inViewport;return this._scrollRequested.emit({defaultPrevented:i,scrollWithinCell:()=>{e.dispatch({effects:Q.EditorView.scrollIntoView(t,s)})}}),i})),this._editorConfig={},this._editorExtensions=[],this._inputHidden=!1,this._inViewportChanged=new x.Signal(this),this._readOnly=!1,this._ready=new Y.PromiseDelegate,this._resizeDebouncer=new ee.Debouncer((()=>{this._displayChanged.emit()}),0),this._syncCollapse=!1,this._syncEditable=!1,this.addClass("jp-Cell");const o=this._model=e.model;this.contentFactory=e.contentFactory,this.layout=null!==(t=e.layout)&&void 0!==t?t:new C.PanelLayout,this.translator=null!==(s=e.translator)&&void 0!==s?s:N.nullTranslator,this._editorConfig={searchWithCM:!1,...e.editorConfig},this._editorExtensions=null!==(i=e.editorExtensions)&&void 0!==i?i:[],this._editorExtensions.push(this._scrollHandlerExtension),this._placeholder=!0,this._inViewport=null,this.placeholder=null===(n=e.placeholder)||void 0===n||n,o.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){return this.loadCollapseState(),this.loadEditableState(),this}get displayChanged(){return this._displayChanged}get inViewport(){var e;return null!==(e=this._inViewport)&&void 0!==e&&e}set inViewport(e){this._inViewport!==e&&(this._inViewport=e,this._inViewportChanged.emit(this._inViewport))}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&!1===e&&(this.initializeDOM(),this._placeholder=e,this._ready.resolve())}get promptNode(){return this.placeholder?null:this._inputHidden?this._inputPlaceholder.node.firstElementChild:this._input.promptNode}get editorWidget(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editorWidget)&&void 0!==t?t:null}get editor(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editor)&&void 0!==t?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){e!==this._readOnly&&(this._readOnly=e,this.syncEditable&&this.saveEditableState(),this.update())}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model,t=e.getMetadata("editable");this.readOnly&&!1===t||!this.readOnly&&void 0===t||(this.readOnly?e.setMetadata("editable",!1):e.deleteMetadata("editable"))}loadEditableState(){this.readOnly=!1===this.model.sharedModel.getMetadata("editable")}get ready(){return this._ready.promise}setPrompt(e){var t;this.prompt=e,null===(t=this._input)||void 0===t||t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden!==e){if(!this.placeholder){const s=this._inputWrapper.layout;e?(this._input.parent=null,this._inputPlaceholder&&(this._inputPlaceholder.text=null===(t=this.model.sharedModel.getSource().split("\n"))||void 0===t?void 0:t[0]),s.addWidget(this._inputPlaceholder)):(this._inputPlaceholder.parent=null,s.addWidget(this._input))}this._inputHidden=e,this.syncCollapse&&this.saveCollapseState(),this.handleInputHidden(e)}}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};this.inputHidden&&!0===e.source_hidden||!this.inputHidden&&void 0===e.source_hidden||(this.inputHidden?e.source_hidden=!0:delete e.source_hidden,0===Object.keys(e).length?this.model.deleteMetadata("jupyter"):this.model.setMetadata("jupyter",e))}loadCollapseState(){var e;const t=null!==(e=this.model.getMetadata("jupyter"))&&void 0!==e?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){this._syncCollapse!==e&&(this._syncCollapse=e,e&&this.loadCollapseState())}get syncEditable(){return this._syncEditable}set syncEditable(e){this._syncEditable!==e&&(this._syncEditable=e,e&&this.loadEditableState())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}dispose(){this.isDisposed||(this._resizeDebouncer.dispose(),this._input=null,this._model=null,this._inputWrapper=null,this._inputPlaceholder=null,super.dispose())}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e},this.editor&&this.editor.setOptions(this._editorConfig)}get scrollRequested(){return this._scrollRequested}initializeDOM(){if(!this.placeholder)return;const e=this.contentFactory,t=this._model,s=e.createCellHeader();s.addClass("jp-Cell-header"),this.layout.addWidget(s);const i=this._inputWrapper=new C.Panel;i.addClass("jp-Cell-inputWrapper");const n=new g;n.addClass("jp-Cell-inputCollapser");const o=this._input=new w({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});o.addClass("jp-Cell-inputArea"),i.addWidget(n),i.addWidget(o),this.layout.addWidget(i),this._inputPlaceholder=new W({callback:()=>{this.inputHidden=!this.inputHidden},text:o.model.sharedModel.getSource().split("\n")[0],translator:this.translator}),o.model.contentChanged.connect(((e,t)=>{var s;this._inputPlaceholder&&this.inputHidden&&(this._inputPlaceholder.text=null===(s=e.sharedModel.getSource().split("\n"))||void 0===s?void 0:s[0])})),this.inputHidden&&(o.parent=null,i.layout.addWidget(this._inputPlaceholder));const r=this.contentFactory.createCellFooter();r.addClass("jp-Cell-footer"),this.layout.addWidget(r)}getEditorOptions(){return{config:this.editorConfig,extensions:this._editorExtensions}}onBeforeAttach(e){this.placeholder&&(this.placeholder=!1)}onAfterAttach(e){this.update()}onActivateRequest(e){var t;null===(t=this.editor)||void 0===t||t.focus()}onResize(e){this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,s;this._model&&(null===(t=this.editor)||void 0===t?void 0:t.getOption("readOnly"))!==this._readOnly&&(null===(s=this.editor)||void 0===s||s.setOption("readOnly",this._readOnly))}onContentChanged(){var e;this.inputHidden&&this._inputPlaceholder&&(this._inputPlaceholder.text=null===(e=this.model.sharedModel.getSource().split("\n"))||void 0===e?void 0:e[0])}onMetadataChanged(e,t){switch(t.key){case"jupyter":this.syncCollapse&&this.loadCollapseState();break;case"editable":this.syncEditable&&this.loadEditableState()}}}!function(e){let t;!function(e){e[e.HTML=0]="HTML",e[e.Markdown=1]="Markdown"}(t=e.HeadingType||(e.HeadingType={})),e.ContentFactory=class{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new _}createCellFooter(){return new v}createInputPrompt(){return new f}createOutputPrompt(){return new O.OutputPrompt}createStdin(e){return new O.Stdin(e)}}}(ue||(ue={}));class ce extends C.PanelLayout{onBeforeAttach(e){let t=!0;const s=this.parent.node.firstElementChild;for(const i of this)s&&(i.node===s?t=!1:(Z.MessageLoop.sendMessage(i,e),t?this.parent.node.insertBefore(i.node,s):this.parent.node.appendChild(i.node),this.parent.isHidden||i.setFlag(C.Widget.Flag.IsVisible),Z.MessageLoop.sendMessage(i,C.Widget.Msg.AfterAttach)))}onAfterDetach(e){for(const t of this)!t.hasClass(ie)&&t.node.isConnected&&(Z.MessageLoop.sendMessage(t,C.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),Z.MessageLoop.sendMessage(t,e))}}class pe extends ue{constructor(e){var t;super({layout:new ce,...e,placeholder:!0}),this._detectCaretMovementInOuput=e=>{const t=null!==this._inViewport&&!this._inViewport,s=e.target;if(!(s&&s instanceof HTMLElement))return;this._lastTarget&&(this._lastTarget.removeEventListener("selectionchange",this._lastOnCaretMovedHandler),document.removeEventListener("selectionchange",this._lastOnCaretMovedHandler));const i=()=>{this._scrollRequested.emit({scrollWithinCell:({scroller:e})=>{u.ElementExt.scrollIntoViewIfNeeded(e,s)},defaultPrevented:t})};this._lastTarget=s,this._lastOnCaretMovedHandler=i,s.addEventListener("selectionchange",i,{once:!0}),document.addEventListener("selectionchange",i,{once:!0}),setTimeout((()=>{s.removeEventListener("selectionchange",i),document.removeEventListener("selectionchange",i)}),250)},this._headingsCache=null,this._outputHidden=!1,this._outputWrapper=null,this._outputPlaceholder=null,this._syncScrolled=!1,this._lastTarget=null,this._lastOutputHeight="",this.addClass("jp-CodeCell");const s=this.translator.load("jupyterlab"),i=this._rendermime=e.rendermime,n=this.contentFactory,o=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const r=0===o.outputs.length?s.__("Code Cell Content"):s.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r);const a=this._output=new O.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:n,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:!0,inputHistoryScope:e.inputHistoryScope});a.node.addEventListener("keydown",this._detectCaretMovementInOuput),a.addClass("jp-Cell-outputArea"),a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled})),a.initialize.connect((()=>{this.updatePromptOverlayIcon()})),this.placeholder=null===(t=e.placeholder)||void 0===t||t,o.outputs.changed.connect(this.onOutputChanged,this),o.outputs.stateChanged.connect(this.onOutputChanged,this),o.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder)return;super.initializeDOM(),this.setPrompt(this.prompt);const e=this._outputWrapper=new C.Panel;e.addClass(ie);const t=new m;t.addClass("jp-Cell-outputCollapser"),e.addWidget(t),0===this.model.outputs.length&&this.addClass(le),this._output.outputLengthChanged.connect(this._outputLengthHandler,this),e.addWidget(this._output);const s=this.layout,i=new se(this.node);i.sizeChanged.connect(this._sizeChangedHandler,this),s.insertWidget(s.widgets.length-1,i),s.insertWidget(s.widgets.length-1,e),this.model.isDirty&&this.addClass(ne),this._outputPlaceholder=new L({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const n=e.layout;this.outputHidden&&(n.removeWidget(this._output),n.addWidget(this._outputPlaceholder),this.inputHidden&&!e.isHidden&&this._outputWrapper.hide());const o=this.translator.load("jupyterlab"),r=0===this.model.outputs.length?o.__("Code Cell Content"):o.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);if(!(null==t?void 0:t.data))return;const s=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"].find((e=>{const s=t.data[e];return"string"==(Array.isArray(s)?typeof s[0]:typeof s)})),i=t.data[null!=s?s:""];return void 0!==i?null===(e=Array.isArray(i)?i:null==i?void 0:i.split("\n"))||void 0===e?void 0:e.find((e=>""!==e)):void 0}initializeState(){return super.initializeState(),this.loadScrolledState(),this.setPrompt(`${this.model.executionCount||""}`),this}get headings(){if(!this._headingsCache){const e=[],t=this.model.outputs;for(let s=0;s<t.length;s++){const i=t.get(s);let n=null,o=null;Object.keys(i.data).forEach((e=>{!o&&X.TableOfContentsUtils.Markdown.isMarkdown(e)?o=e:!n&&X.TableOfContentsUtils.isHTML(e)&&(n=e)})),n?e.push(...X.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(i.data[n])).map((e=>({...e,outputIndex:s,type:ue.HeadingType.HTML})))):o&&e.push(...X.TableOfContentsUtils.Markdown.getHeadings(i.data[o]).map((e=>({...e,outputIndex:s,type:ue.HeadingType.Markdown}))))}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden!==e){if(!this.placeholder){const s=this._outputWrapper.layout;e?(s.removeWidget(this._output),s.addWidget(this._outputPlaceholder),this.inputHidden&&!this._outputWrapper.isHidden&&this._outputWrapper.hide(),this._outputPlaceholder&&(this._outputPlaceholder.text=null!==(t=this.getOutputPlaceholderText())&&void 0!==t?t:"")):(this._outputWrapper.isHidden&&this._outputWrapper.show(),s.removeWidget(this._outputPlaceholder),s.addWidget(this._output))}this._outputHidden=e,this.syncCollapse&&this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");this.outputHidden&&!0===e||!this.outputHidden&&void 0===e||(this.outputHidden?this.model.setMetadata("collapsed",!0):this.model.deleteMetadata("collapsed"))}),!1)}loadCollapseState(){super.loadCollapseState(),this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e),this._outputsScrolled=e,this.syncScrolled&&this.saveScrolledState(),this.updatePromptOverlayIcon()}updatePromptOverlayIcon(){var e;const t=q.DOMUtils.findElement(this.node,"jp-OutputArea-promptOverlay");if(!t)return;if(t.clientHeight<=24)return void(null===(e=t.firstChild)||void 0===e||e.remove());let s;this._outputsScrolled?(h.expandIcon.element({container:t}),s="Expand Output"):(h.collapseIcon.element({container:t}),s="Collapse Output");const i=this.translator.load("jupyterlab");t.title=i.__(s)}saveScrolledState(){const e=this.model.getMetadata("scrolled");this.outputsScrolled&&!0===e||!this.outputsScrolled&&void 0===e||(this.outputsScrolled?this.model.setMetadata("scrolled",!0):(this.outputArea.node.style.height="",this.model.deleteMetadata("scrolled")))}loadScrolledState(){"auto"===this.model.getMetadata("scrolled")?this.outputsScrolled=!1:this.outputsScrolled=!!this.model.getMetadata("scrolled")}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){this._syncScrolled!==e&&(this._syncScrolled=e,e&&this.loadScrolledState())}handleInputHidden(e){this.placeholder||(!e&&this._outputWrapper.isHidden?this._outputWrapper.show():e&&!this._outputWrapper.isHidden&&this._outputHidden&&this._outputWrapper.hide())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}cloneOutputArea(){return new O.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){this.isDisposed||(this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this),this._output.node.removeEventListener("keydown",this._detectCaretMovementInOuput),this._rendermime=null,this._output=null,this._outputWrapper=null,this._outputPlaceholder=null,super.dispose())}onStateChanged(e,t){switch(t.name){case"executionCount":this.setPrompt(`${e.executionCount||""}`);break;case"isDirty":e.isDirty?this.addClass(ne):this.removeClass(ne)}}onOutputChanged(){var e;this._headingsCache=null,this._outputPlaceholder&&this.outputHidden&&(this._outputPlaceholder.text=null!==(e=this.getOutputPlaceholderText())&&void 0!==e?e:""),this.updatePromptOverlayIcon();const t=this.outputArea.node.style.height;0===this.model.outputs.length&&""!==t?(this._lastOutputHeight=t,this.outputArea.node.style.height=""):this.model.outputs.length>0&&""===t&&(this.outputArea.node.style.height=this._lastOutputHeight)}onMetadataChanged(e,t){switch(t.key){case"scrolled":this.syncScrolled&&this.loadScrolledState();break;case"collapsed":this.syncCollapse&&this.loadCollapseState()}super.onMetadataChanged(e,t)}_outputLengthHandler(e,t){const s=0===t;this.toggleClass(le,s);const i=this.translator.load("jupyterlab"),n=s?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",n)}_sizeChangedHandler(e){this._displayChanged.emit()}}!function(e){e.execute=async function(e,t,s){var i;const n=e.model,o=n.sharedModel.getSource();if(!o.trim()||!(null===(i=t.session)||void 0===i?void 0:i.kernel))return void n.sharedModel.transact((()=>{n.clearExecution()}),!1);const r={cellId:n.sharedModel.getId()};s={...n.metadata,...s,...r};const{recordTiming:a}=s;let d;n.sharedModel.transact((()=>{n.clearExecution(),e.outputHidden=!1}),!1),e.setPrompt("*"),n.trusted=!0;try{const i=O.OutputArea.execute(o,e.outputArea,t,s);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return!0}const s=e.header.date||(new Date).toISOString(),i=Object.assign({},n.getMetadata("execution"));return i[`iopub.${t}`]=s,n.setMetadata("execution",i),!0};e.outputArea.future.registerMessageHook(t)}else n.deleteMetadata("execution");d=e.outputArea.future;const r=await i;if(n.executionCount=r.content.execution_count,a){const e=Object.assign({},n.getMetadata("execution")),t=r.metadata.started;t&&(e["shell.execute_reply.started"]=t);const s=r.header.date;e["shell.execute_reply"]=s||(new Date).toISOString(),n.setMetadata("execution",e)}return r}catch(t){if(d&&!e.isDisposed&&e.outputArea.future===d&&(e.setPrompt(""),a&&d.isDisposed)){const e=Object.assign({},n.getMetadata("execution"));e.execution_failed=(new Date).toISOString(),n.setMetadata("execution",e)}throw t}}}(pe||(pe={}));class ge extends ue{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e)}}getEditorOptions(){var e,t;const s=null!==(e=super.getEditorOptions())&&void 0!==e?e:{};return s.extensions=[...null!==(t=s.extensions)&&void 0!==t?t:[],Q.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})],s}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this),super.onBeforeDetach(e)}_evtDragOver(e){(0,K.some)(G.imageRendererFactory.mimeTypes,(t=>!!e.mimeData.hasData(he)&&e.mimeData.getData(he).model.mimetype===t))&&(e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction)}_evtPaste(e){if(e.clipboardData){const t=e.clipboardData.items;for(let s=0;s<t.length;s++){if("text/plain"===t[s].type){if(s<t.length-1&&"file"===t[s+1].kind)continue;t[s].getAsString((e=>{var t,s;null===(s=(t=this.editor).replaceSelection)||void 0===s||s.call(t,e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){e.dataTransfer&&this._attachFiles(e.dataTransfer.items),e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===he){const t=e.mimeData.getData(he);return-1!==G.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)}return-1!==G.imageRendererFactory.mimeTypes.indexOf(t)}));if(0!==t.length)if(e.preventDefault(),e.stopPropagation(),"none"!==e.proposedAction){e.dropAction="copy";for(const s of t)if(s===he){const{model:t,withContent:s}=e.mimeData.getData(he);if("file"===t.type){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e),s().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[s]:e.mimeData.getData(s)}),this.updateCellSourceWithAttachment(t,t)}}else e.dropAction="none"}_attachFiles(e){for(let t=0;t<e.length;t++){const s=e[t];if("file"===s.kind){const e=s.getAsFile();e&&this._attachFile(e)}}}_attachFile(e){const t=new FileReader;t.onload=s=>{const{href:i,protocol:n}=R.URLExt.parse(t.result);if("data:"!==n)return;const o=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/.exec(i);if(!o||4!==o.length)return;const r=o[1],a={[r]:o[3]},d=this._generateURI(e.name);r.startsWith("image/")&&(this.model.attachments.set(d,a),this.updateCellSourceWithAttachment(e.name,d))},t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)},t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return-1!==t?Y.UUID.uuid4().concat(e.substring(t)):Y.UUID.uuid4()}}class me extends ge{constructor(e){var t,s,i,n;super({...e,placeholder:!0}),this._headingsCache=null,this._headingCollapsedChanged=new x.Signal(this),this._prevText="",this._rendered=!0,this._renderedChanged=new x.Signal(this),this._showEditorForReadOnlyMarkdown=!0,this.addClass("jp-MarkdownCell"),this.model.contentChanged.connect(this.onContentChanged,this);const o=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",o.__("Markdown Cell Content")),this._rendermime=e.rendermime.clone({resolver:new M.AttachmentsResolver({parent:null!==(t=e.rendermime.resolver)&&void 0!==t?t:void 0,model:this.model.attachments})}),this._renderer=this._rendermime.createRenderer("text/markdown"),this._renderer.addClass("jp-MarkdownOutput"),this._headingCollapsed=null!==(s=this.model.getMetadata(oe))&&void 0!==s&&s,this._showEditorForReadOnlyMarkdown=null!==(i=e.showEditorForReadOnlyMarkdown)&&void 0!==i?i:me.defaultShowEditorForReadOnlyMarkdown,this.placeholder=null===(n=e.placeholder)||void 0===n||n,this._monitor=new R.ActivityMonitor({signal:this.model.contentChanged,timeout:1e3}),this.ready.then((()=>{this.isDisposed||this._monitor.activityStopped.connect((()=>{this._rendered&&this.update()}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:s}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:s}}return{text:"",level:-1}}get headings(){if(!this._headingsCache){const e=X.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:ue.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e,e?this.model.setMetadata(oe,e):"undefined"!==this.model.getMetadata(oe)&&this.model.deleteMetadata(oe);const s=null===(t=this.inputArea)||void 0===t?void 0:t.promptNode.getElementsByClassName(re)[0];s&&(e?s.classList.add("jp-mod-collapsed"):s.classList.remove("jp-mod-collapsed")),this.renderCollapseButtons(this._renderer),this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e,this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){this.readOnly&&!1===this._showEditorForReadOnlyMarkdown&&(e=!0),e!==this._rendered&&(this._rendered=e,this._handleRendered().then((()=>{this._displayChanged.emit(),this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)})))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e,!1===e&&(this.rendered=!0)}get renderer(){return this._renderer}dispose(){this.isDisposed||(this._monitor.dispose(),super.dispose())}initializeDOM(){this.placeholder&&(super.initializeDOM(),this.renderCollapseButtons(this._renderer),this._handleRendered().catch((e=>{console.error("Failed to render",e)})))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&0==(null===(e=this.inputArea)||void 0===e?void 0:e.promptNode.getElementsByClassName(re).length)){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${re}`,e.setAttribute("data-heading-level",t.toString()),this._headingCollapsed?e.classList.add("jp-mod-collapsed"):e.classList.remove("jp-mod-collapsed"),e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(ae);let t=this.translator.load("jupyterlab")._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);if(this.headingCollapsed&&this._numberChildNodes>0&&0==e.length){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${ae}`,h.addIcon.render(e);const s=document.createElement("div");s.textContent=t,e.appendChild(s),e.onclick=()=>{this.headingCollapsed=!1},this.node.appendChild(e)}if(this.headingCollapsed&&this._numberChildNodes>0&&1==e.length&&(e[0].childNodes[1].textContent=t),!(this.headingCollapsed&&this._numberChildNodes>0))for(const t of e)this.node.removeChild(t)}onContentChanged(){super.onContentChanged(),this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(oe,this._headingCollapsed),this.maybeCreateCollapseButton(),this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(de),this.placeholder||this.isDisposed||(this.renderCollapseButtons(e),this.inputArea.renderInput(e))}showEditor(){if(this.removeClass(de),!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;e>0&&this.inputArea.editor.setCursorPosition({column:e+1,line:0},{scroll:!1})}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)})),super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var s,i;const n=`![${e}](attachment:${null!=t?t:e})`;null===(i=null===(s=this.editor)||void 0===s?void 0:s.replaceSelection)||void 0===i||i.call(s,n)}async _handleRendered(){this._rendered?(await this._updateRenderedInput(),this._rendered&&this.renderInput(this._renderer)):this.showEditor()}_updateRenderedInput(){if(this.placeholder)return Promise.resolve();const e=this.model,t=e&&e.sharedModel.getSource()||"Type Markdown and LaTeX: $ α^2 $";if(t!==this._prevText){const e=new G.MimeModel({data:{"text/markdown":t}});return this._prevText=t,this._renderer.renderModel(e)}return Promise.resolve()}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}}!function(e){e.defaultShowEditorForReadOnlyMarkdown=!0}(me||(me={}));class Ce extends ue{constructor(e){super(e),this.addClass("jp-RawCell");const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2479],{72479:(e,t,s)=>{s.r(t),s.d(t,{AttachmentsCell:()=>ge,AttachmentsCellModel:()=>I,Cell:()=>ue,CellDragUtils:()=>l,CellFooter:()=>v,CellHeader:()=>_,CellModel:()=>A,CellSearchProvider:()=>B,CodeCell:()=>pe,CodeCellLayout:()=>ce,CodeCellModel:()=>j,Collapser:()=>p,InputArea:()=>w,InputCollapser:()=>g,InputPlaceholder:()=>W,InputPrompt:()=>x,MarkdownCell:()=>me,MarkdownCellModel:()=>k,OutputCollapser:()=>m,OutputPlaceholder:()=>L,Placeholder:()=>F,RawCell:()=>Ce,RawCellModel:()=>D,SELECTED_HIGHLIGHT_CLASS:()=>z,createCellSearchProvider:()=>J,isCodeCellModel:()=>E,isMarkdownCellModel:()=>H,isRawCellModel:()=>b});var i=s(24475);const n="jp-dragImage",o="jp-dragImage-singlePrompt",r="jp-dragImage-content",a="jp-dragImage-prompt",d="jp-dragImage-multipleBack";var l;!function(e){e.findCell=function(e,t,s){let i=-1;for(;e&&e.parentElement;){if(s(e)){let s=-1;for(const n of t)if(n.node===e){i=++s;break}break}e=e.parentElement}return i},e.detectTargetArea=function(e,t){var s,i;let n;return n=e?(null===(s=e.editorWidget)||void 0===s?void 0:s.node.contains(t))?"input":(null===(i=e.promptNode)||void 0===i?void 0:i.contains(t))?"prompt":"cell":"unknown",n},e.shouldStartDrag=function(e,t,s,i){const n=Math.abs(s-e),o=Math.abs(i-t);return n>=5||o>=5},e.createCellDragImage=function(e,t){const s=t.length;let l;if("code"===e.model.type){const t=e.model.executionCount;l=" ",t&&(l=t.toString())}else l="";const h=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);return s>1?""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a},"["+l+"]:"),i.h.span({className:r},h)),i.h.div({className:d},""))):i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a}),i.h.span({className:r},h)),i.h.div({className:d},""))):""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${o}`},i.h.span({className:a},"["+l+"]:"),i.h.span({className:r},h)))):i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${o}`},i.h.span({className:a}),i.h.span({className:r},h))))}}(l||(l={}));var h=s(12668),u=s(18395),c=s(78156);class p extends h.ReactWidget{constructor(){super(),this.addClass("jp-Collapser")}get collapsed(){return!1}render(){return c.createElement("div",{className:"jp-Collapser-child",onClick:e=>this.handleClick(e)})}}class g extends p{constructor(){super(),this.addClass("jp-InputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.inputHidden}handleClick(e){var t;const s=null===(t=this.parent)||void 0===t?void 0:t.parent;s&&(s.inputHidden=!s.inputHidden),this.update()}}class m extends p{constructor(){super(),this.addClass("jp-OutputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.outputHidden}handleClick(e){var t,s;const i=null===(t=this.parent)||void 0===t?void 0:t.parent;if(i&&(i.outputHidden=!i.outputHidden,i.outputHidden)){let e=null===(s=i.parent)||void 0===s?void 0:s.node;e&&u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}this.update()}}var C=s(63485);class _ extends C.Widget{constructor(){super(),this.addClass("jp-CellHeader")}}class v extends C.Widget{constructor(){super(),this.addClass("jp-CellFooter")}}var y=s(52712);class w extends C.Widget{constructor(e){super(),this.addClass("jp-InputArea");const{contentFactory:t,editorOptions:s,model:i}=e;this.model=i,this.contentFactory=t;const n=this._prompt=t.createInputPrompt();n.addClass("jp-InputArea-prompt");const o=this._editor=new y.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:s});o.addClass("jp-InputArea-editor");const r=this.layout=new C.PanelLayout;r.addWidget(n),r.addWidget(o)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;this._rendered&&(this._rendered.parent=null),this._editor.hide(),this._rendered=e,t.addWidget(e)}showEditor(){this._rendered&&(this._rendered.parent=null),this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){this.isDisposed||(this._prompt=null,this._editor=null,this._rendered=null,super.dispose())}}!function(e){e.ContentFactory=class{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new x}}}(w||(w={}));class x extends C.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-InputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?" ":`[${e||" "}]:`}}var f=s(81997),M=s(9981),O=s(43648),S=s(57508);const P=(0,S.createMutex)();function E(e){return"code"===e.type}function H(e){return"markdown"===e.type}function b(e){return"raw"===e.type}class A extends y.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:s,...i}=e;super({sharedModel:null!=s?s:(0,S.createStandaloneCell)({cell_type:null!=t?t:"raw",id:e.id}),...i}),this.contentChanged=new f.Signal(this),this.stateChanged=new f.Signal(this),this._metadataChanged=new f.Signal(this),this._trusted=!1,this.standaloneModel=void 0===e.sharedModel,this.trusted=!!this.getMetadata("trusted")||!!e.trusted,this.sharedModel.changed.connect(this.onGenericChange,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;t!==e&&(this._trusted=e,this.onTrustedChanged(this,{newValue:e,oldValue:t}))}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this.onGenericChange,this),this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this),super.dispose())}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class I extends A{constructor(e){var t;super(e);const s=null!==(t=e.contentFactory)&&void 0!==t?t:I.defaultContentFactory,i=this.sharedModel.getAttachments();this._attachments=s.createAttachmentsModel({values:i}),this._attachments.stateChanged.connect(this.onGenericChange,this),this._attachments.changed.connect(this._onAttachmentsChange,this),this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){this.isDisposed||(this._attachments.stateChanged.disconnect(this.onGenericChange,this),this._attachments.changed.disconnect(this._onAttachmentsChange,this),this._attachments.dispose(),this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),super.dispose())}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const s=this.sharedModel;P((()=>s.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;P((()=>{var t;return this._attachments.fromJSON(null!==(t=e.getAttachments())&&void 0!==t?t:{})}))}}}!function(e){class t{createAttachmentsModel(e){return new M.AttachmentsModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(I||(I={}));class D extends I{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class k extends I{constructor(e={}){super({cell_type:"markdown",...e}),this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class j extends A{constructor(e={}){var t;super({cell_type:"code",...e}),this._executionState="idle",this._executedCode="",this._isDirty=!1;const s=null!==(t=null==e?void 0:e.contentFactory)&&void 0!==t?t:j.defaultContentFactory,i=this.trusted,n=this.sharedModel.getOutputs();this._outputs=s.createOutputArea({trusted:i,values:n}),this.sharedModel.changed.connect(this._onSharedModelChanged,this),this._outputs.changed.connect(this.onGenericChange,this),this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get executionState(){return this._executionState}set executionState(e){const t=this._executionState;t!=e&&(this._executionState=e,this.stateChanged.emit({name:"executionState",oldValue:t,newValue:e}))}get isDirty(){return this._isDirty}set isDirty(e){this._setDirty(e)}get outputs(){return this._outputs}clearExecution(){this.outputs.clear(),this.executionCount=null,this.executionState="idle",this._setDirty(!1),this.sharedModel.deleteMetadata("execution"),this.trusted=!0}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),this._outputs.changed.disconnect(this.onGenericChange,this),this._outputs.changed.disconnect(this.onOutputsChange,this),this._outputs.dispose(),this._outputs=null,super.dispose())}onTrustedChanged(e,t){const s=t.newValue;if(this._outputs&&(this._outputs.trusted=s),s){const e=this.sharedModel,t=e.getMetadata();t.trusted=!0,e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:s})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const s=this.sharedModel;P((()=>{switch(t.type){case"add":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.newIndex,t.newIndex,e);break}case"set":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.oldIndex,t.oldIndex+e.length,e);break}case"remove":s.updateOutputs(t.oldIndex,t.oldValues.length);break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){t.outputsChange&&P((()=>{this.outputs.clear(),e.getOutputs().forEach((e=>this._outputs.add(e)))})),t.executionCountChange&&(!t.executionCountChange.newValue||!this.isDirty&&t.executionCountChange.oldValue||this._setDirty(!1),this.stateChanged.emit({name:"executionCount",oldValue:t.executionCountChange.oldValue,newValue:t.executionCountChange.newValue})),t.sourceChange&&null!==this.executionCount&&this._setDirty(this._executedCode!==this.sharedModel.getSource().trim())}_setDirty(e){e||(this._executedCode=this.sharedModel.getSource().trim()),e!==this._isDirty&&(this._isDirty=e,this.stateChanged.emit({name:"isDirty",oldValue:!e,newValue:e}))}}!function(e){class t{createOutputArea(e){return new O.OutputAreaModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(j||(j={}));var N=s(25291);class F extends C.Widget{constructor(e){var t,s,i;const n=document.createElement("div");super({node:n});const o=(null!==(t=e.translator)&&void 0!==t?t:N.nullTranslator).load("jupyterlab"),r=document.createElement("div");r.className=null!==(s=e.promptClass)&&void 0!==s?s:"",n.insertAdjacentHTML("afterbegin",r.outerHTML),this._cell=document.createElement("div"),this._cell.classList.add("jp-Placeholder-content"),this._cell.title=o.__("Click to expand");const a=this._cell.appendChild(document.createElement("div"));a.classList.add("jp-Placeholder-contentContainer"),this._textContent=a.appendChild(document.createElement("span")),this._textContent.className="jp-PlaceholderText",this._textContent.innerText=null!==(i=e.text)&&void 0!==i?i:"",n.appendChild(this._cell),h.ellipsesIcon.element({container:a.appendChild(document.createElement("span")),className:"jp-MoreHorizIcon",elementPosition:"center",height:"auto",width:"32px"}),this.addClass("jp-Placeholder"),this._callback=e.callback}set text(e){this._textContent.innerText=e}get text(){return this._textContent.innerText}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this._callback)}onBeforeDetach(e){this.node.removeEventListener("click",this._callback),super.onBeforeDetach(e)}}class W extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-InputPrompt"}),this.addClass("jp-InputPlaceholder")}}class L extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-OutputPrompt"}),this.addClass("jp-OutputPlaceholder")}}var T=s(81059),R=s(44548),V=s(57342);const z="jp-mod-selected";class B extends T.EditorSearchProvider{constructor(e){super(),this.cell=e,this.cell.inViewport||this.cell.editor||(0,R.signalToPromise)(e.inViewportChanged).then((([,e])=>{e&&this.cmHandler.setEditor(this.editor)}))}get editor(){return this.cell.editor}get model(){return this.cell.model}}class U extends B{constructor(e){super(e),this.currentProviderIndex=-1,this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error("Failed to initialize search on cell outputs.",e)})),t.outputLengthChanged.connect(this._onOutputsChanged,this),t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){return this.isActive?super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0):0}async clearHighlight(){await super.clearHighlight(),await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){this.isDisposed||(super.dispose(),this.outputsProvider.map((e=>{e.dispose()})),this.outputsProvider.length=0)}async highlightNext(e,t){var s;const i=null!==(s=null==t?void 0:t.from)&&void 0!==s?s:"";if(!(0===this.matchesCount||"previous-match"===i&&null!==this.currentIndex&&this.currentIndex+1>=this.cmHandler.matches.length)&&this.isActive){if(-1===this.currentProviderIndex){const s=await super.highlightNext(e,t);if(s)return this.currentIndex=this.cmHandler.currentIndex,s;this.currentProviderIndex=0}for(;this.currentProviderIndex<this.outputsProvider.length;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightNext(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex+=1}return this.currentProviderIndex=-1,void(this.currentIndex=null)}this.currentIndex=null}async highlightPrevious(){if(0!==this.matchesCount&&this.isActive){for(null===this.currentIndex&&(this.currentProviderIndex=this.outputsProvider.length-1);this.currentProviderIndex>=0;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightPrevious(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex-=1}const e=await super.highlightPrevious();return e?(this.currentIndex=this.cmHandler.currentIndex,e):void(this.currentIndex=null)}this.currentIndex=null}async startQuery(e,t){await super.startQuery(e,t),!1!==(null==t?void 0:t.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}async endQuery(){var e;await super.endQuery(),!1!==(null===(e=this.filters)||void 0===e?void 0:e.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}async _onOutputsChanged(e,t){var s;this.outputsProvider.forEach((e=>{e.dispose()})),this.outputsProvider.length=0,this.currentProviderIndex=-1,this.outputsProvider=this.cell.outputArea.widgets.map((e=>new V.GenericSearchProvider(e))),this.isActive&&this.query&&!1!==(null===(s=this.filters)||void 0===s?void 0:s.output)&&await Promise.all([this.outputsProvider.map((e=>{e.startQuery(this.query)}))]),this._stateChanged.emit()}}class $ extends B{constructor(e){super(e),this._unrenderedByHighlight=!1,this.renderedProvider=new V.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight(),await this.renderedProvider.clearHighlight()}dispose(){this.isDisposed||(super.dispose(),this.renderedProvider.dispose())}async endQuery(){await super.endQuery(),await this.renderedProvider.endQuery()}async highlightNext(e=!0,t){let s;if(!this.isActive)return s;const i=this.cell;if(i.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(i.renderedChanged);i.rendered=!1,await e}return s=await super.highlightNext(e,t),s}async highlightPrevious(){let e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightPrevious(),e}async startQuery(e,t){await super.startQuery(e,t);const s=this.cell;s.rendered&&this.onRenderedChanged(s,s.rendered),s.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e){const t=await super.replaceAllMatches(e);return this.cell.rendered&&this.cell.update(),t}onRenderedChanged(e,t){var s;this._unrenderedByHighlight||(this.currentIndex=null),this._unrenderedByHighlight=!1,this.isActive&&(t?this.renderedProvider.startQuery(this.query):(null===(s=e.editor)||void 0===s||s.setCursorPosition({column:0,line:0}),this.renderedProvider.endQuery()))}}function J(e){if(e.isPlaceholder())return new B(e);switch(e.model.type){case"code":return new U(e);case"markdown":return new $(e);default:return new B(e)}}var Q=s(63720),q=s(15465),G=s(50102),X=s(45776),Y=s(20998),K=s(33625),Z=s(49503),ee=s(97934);const te="jp-mod-resizedCell";class se extends C.Widget{constructor(e){super(),this.targetNode=e,this._isActive=!1,this._isDragging=!1,this.sizeChanged=new f.Signal(this),this.addClass("jp-CellResizeHandle"),this._resizer=new ee.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose(),super.dispose()}handleEvent(e){var t,s;switch(e.type){case"dblclick":null===(t=this.targetNode.parentNode)||void 0===t||t.childNodes.forEach((e=>{e.classList.remove(te)})),document.documentElement.style.setProperty("--jp-side-by-side-output-size","1fr"),this._isActive=!1;break;case"mousedown":this._isDragging=!0,this._isActive||(null===(s=this.targetNode.parentNode)||void 0===s||s.childNodes.forEach((e=>{e.classList.add(te)})),this._isActive=!0),window.addEventListener("mousemove",this),window.addEventListener("mouseup",this);break;case"mousemove":this._isActive&&this._isDragging&&this._resizer.invoke(e);break;case"mouseup":this._isDragging=!1,window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this)}}onAfterAttach(e){this.node.addEventListener("dblclick",this),this.node.addEventListener("mousedown",this),super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this),this.node.removeEventListener("mousedown",this),super.onBeforeDetach(e)}_resize(e){const{width:t,x:s}=this.targetNode.getBoundingClientRect(),i=t/(e.clientX-s)-1;if(0<i){const e=Math.max(Math.min(Math.abs(i),50),.05);document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`),this.sizeChanged.emit(e)}}}const ie="jp-Cell-outputWrapper",ne="jp-mod-dirty",oe="jp-MarkdownHeadingCollapsed",re="jp-collapseHeadingButton",ae="jp-showHiddenCellsButton",de="jp-mod-rendered",le="jp-mod-noOutputs",he="application/x-jupyter-icontentsrich";class ue extends C.Widget{constructor(e){var t,s,i,n;super(),this.prompt="",this._displayChanged=new f.Signal(this),this._scrollRequested=new f.Signal(this),this._scrollHandlerExtension=Q.EditorView.scrollHandler.of(((e,t,s)=>{const i=null!==this._inViewport&&!this._inViewport;return this._scrollRequested.emit({defaultPrevented:i,scrollWithinCell:()=>{e.dispatch({effects:Q.EditorView.scrollIntoView(t,s)})}}),i})),this._editorConfig={},this._editorExtensions=[],this._inputHidden=!1,this._inViewportChanged=new f.Signal(this),this._readOnly=!1,this._ready=new Y.PromiseDelegate,this._resizeDebouncer=new ee.Debouncer((()=>{this._displayChanged.emit()}),0),this._syncCollapse=!1,this._syncEditable=!1,this.addClass("jp-Cell");const o=this._model=e.model;this.contentFactory=e.contentFactory,this.layout=null!==(t=e.layout)&&void 0!==t?t:new C.PanelLayout,this.translator=null!==(s=e.translator)&&void 0!==s?s:N.nullTranslator,this._editorConfig={searchWithCM:!1,...e.editorConfig},this._editorExtensions=null!==(i=e.editorExtensions)&&void 0!==i?i:[],this._editorExtensions.push(this._scrollHandlerExtension),this._placeholder=!0,this._inViewport=null,this.placeholder=null===(n=e.placeholder)||void 0===n||n,o.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){return this.loadCollapseState(),this.loadEditableState(),this}get displayChanged(){return this._displayChanged}get inViewport(){var e;return null!==(e=this._inViewport)&&void 0!==e&&e}set inViewport(e){this._inViewport!==e&&(this._inViewport=e,this._inViewportChanged.emit(this._inViewport))}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&!1===e&&(this.initializeDOM(),this._placeholder=e,this._ready.resolve())}get promptNode(){return this.placeholder?null:this._inputHidden?this._inputPlaceholder.node.firstElementChild:this._input.promptNode}get editorWidget(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editorWidget)&&void 0!==t?t:null}get editor(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editor)&&void 0!==t?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){e!==this._readOnly&&(this._readOnly=e,this.syncEditable&&this.saveEditableState(),this.update())}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model,t=e.getMetadata("editable");this.readOnly&&!1===t||!this.readOnly&&void 0===t||(this.readOnly?e.setMetadata("editable",!1):e.deleteMetadata("editable"))}loadEditableState(){this.readOnly=!1===this.model.sharedModel.getMetadata("editable")}get ready(){return this._ready.promise}setPrompt(e){return this._setPrompt(e)}_setPrompt(e){var t;this.prompt=e,null===(t=this._input)||void 0===t||t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden!==e){if(!this.placeholder){const s=this._inputWrapper.layout;e?(this._input.parent=null,this._inputPlaceholder&&(this._inputPlaceholder.text=null===(t=this.model.sharedModel.getSource().split("\n"))||void 0===t?void 0:t[0]),s.addWidget(this._inputPlaceholder)):(this._inputPlaceholder.parent=null,s.addWidget(this._input))}this._inputHidden=e,this.syncCollapse&&this.saveCollapseState(),this.handleInputHidden(e)}}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};this.inputHidden&&!0===e.source_hidden||!this.inputHidden&&void 0===e.source_hidden||(this.inputHidden?e.source_hidden=!0:delete e.source_hidden,0===Object.keys(e).length?this.model.deleteMetadata("jupyter"):this.model.setMetadata("jupyter",e))}loadCollapseState(){var e;const t=null!==(e=this.model.getMetadata("jupyter"))&&void 0!==e?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){this._syncCollapse!==e&&(this._syncCollapse=e,e&&this.loadCollapseState())}get syncEditable(){return this._syncEditable}set syncEditable(e){this._syncEditable!==e&&(this._syncEditable=e,e&&this.loadEditableState())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}dispose(){this.isDisposed||(this._resizeDebouncer.dispose(),this._input=null,this._model=null,this._inputWrapper=null,this._inputPlaceholder=null,super.dispose())}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e},this.editor&&this.editor.setOptions(this._editorConfig)}get scrollRequested(){return this._scrollRequested}initializeDOM(){if(!this.placeholder)return;const e=this.contentFactory,t=this._model,s=e.createCellHeader();s.addClass("jp-Cell-header"),this.layout.addWidget(s);const i=this._inputWrapper=new C.Panel;i.addClass("jp-Cell-inputWrapper");const n=new g;n.addClass("jp-Cell-inputCollapser");const o=this._input=new w({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});o.addClass("jp-Cell-inputArea"),i.addWidget(n),i.addWidget(o),this.layout.addWidget(i),this._inputPlaceholder=new W({callback:()=>{this.inputHidden=!this.inputHidden},text:o.model.sharedModel.getSource().split("\n")[0],translator:this.translator}),o.model.contentChanged.connect(((e,t)=>{var s;this._inputPlaceholder&&this.inputHidden&&(this._inputPlaceholder.text=null===(s=e.sharedModel.getSource().split("\n"))||void 0===s?void 0:s[0])})),this.inputHidden&&(o.parent=null,i.layout.addWidget(this._inputPlaceholder));const r=this.contentFactory.createCellFooter();r.addClass("jp-Cell-footer"),this.layout.addWidget(r)}getEditorOptions(){return{config:this.editorConfig,extensions:this._editorExtensions}}onBeforeAttach(e){this.placeholder&&(this.placeholder=!1)}onAfterAttach(e){this.update()}onActivateRequest(e){var t;null===(t=this.editor)||void 0===t||t.focus()}onResize(e){this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,s;this._model&&(null===(t=this.editor)||void 0===t?void 0:t.getOption("readOnly"))!==this._readOnly&&(null===(s=this.editor)||void 0===s||s.setOption("readOnly",this._readOnly))}onContentChanged(){var e;this.inputHidden&&this._inputPlaceholder&&(this._inputPlaceholder.text=null===(e=this.model.sharedModel.getSource().split("\n"))||void 0===e?void 0:e[0])}onMetadataChanged(e,t){switch(t.key){case"jupyter":this.syncCollapse&&this.loadCollapseState();break;case"editable":this.syncEditable&&this.loadEditableState()}}}!function(e){let t;!function(e){e[e.HTML=0]="HTML",e[e.Markdown=1]="Markdown"}(t=e.HeadingType||(e.HeadingType={})),e.ContentFactory=class{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new _}createCellFooter(){return new v}createInputPrompt(){return new x}createOutputPrompt(){return new O.OutputPrompt}createStdin(e){return new O.Stdin(e)}}}(ue||(ue={}));class ce extends C.PanelLayout{onBeforeAttach(e){let t=!0;const s=this.parent.node.firstElementChild;for(const i of this)s&&(i.node===s?t=!1:(Z.MessageLoop.sendMessage(i,e),t?this.parent.node.insertBefore(i.node,s):this.parent.node.appendChild(i.node),this.parent.isHidden||i.setFlag(C.Widget.Flag.IsVisible),Z.MessageLoop.sendMessage(i,C.Widget.Msg.AfterAttach)))}onAfterDetach(e){for(const t of this)!t.hasClass(ie)&&t.node.isConnected&&(Z.MessageLoop.sendMessage(t,C.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),Z.MessageLoop.sendMessage(t,e))}}class pe extends ue{constructor(e){var t;super({layout:new ce,...e,placeholder:!0}),this._detectCaretMovementInOuput=e=>{const t=null!==this._inViewport&&!this._inViewport,s=e.target;if(!(s&&s instanceof HTMLElement))return;this._lastTarget&&(this._lastTarget.removeEventListener("selectionchange",this._lastOnCaretMovedHandler),document.removeEventListener("selectionchange",this._lastOnCaretMovedHandler));const i=()=>{this._scrollRequested.emit({scrollWithinCell:({scroller:e})=>{u.ElementExt.scrollIntoViewIfNeeded(e,s)},defaultPrevented:t})};this._lastTarget=s,this._lastOnCaretMovedHandler=i,s.addEventListener("selectionchange",i,{once:!0}),document.addEventListener("selectionchange",i,{once:!0}),setTimeout((()=>{s.removeEventListener("selectionchange",i),document.removeEventListener("selectionchange",i)}),250)},this._headingsCache=null,this._outputHidden=!1,this._outputWrapper=null,this._outputPlaceholder=null,this._syncScrolled=!1,this._lastTarget=null,this._lastOutputHeight="",this.addClass("jp-CodeCell");const s=this.translator.load("jupyterlab"),i=this._rendermime=e.rendermime,n=this.contentFactory,o=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const r=0===o.outputs.length?s.__("Code Cell Content"):s.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r);const a=this._output=new O.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:n,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:!0,inputHistoryScope:e.inputHistoryScope});a.node.addEventListener("keydown",this._detectCaretMovementInOuput),a.addClass("jp-Cell-outputArea"),a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled})),a.initialize.connect((()=>{this.updatePromptOverlayIcon()})),this.placeholder=null===(t=e.placeholder)||void 0===t||t,o.outputs.changed.connect(this.onOutputChanged,this),o.outputs.stateChanged.connect(this.onOutputChanged,this),o.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder)return;super.initializeDOM(),this._updatePrompt();const e=this._outputWrapper=new C.Panel;e.addClass(ie);const t=new m;t.addClass("jp-Cell-outputCollapser"),e.addWidget(t),0===this.model.outputs.length&&this.addClass(le),this._output.outputLengthChanged.connect(this._outputLengthHandler,this),e.addWidget(this._output);const s=this.layout,i=new se(this.node);i.sizeChanged.connect(this._sizeChangedHandler,this),s.insertWidget(s.widgets.length-1,i),s.insertWidget(s.widgets.length-1,e),this.model.isDirty&&this.addClass(ne),this._outputPlaceholder=new L({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const n=e.layout;this.outputHidden&&(n.removeWidget(this._output),n.addWidget(this._outputPlaceholder),this.inputHidden&&!e.isHidden&&this._outputWrapper.hide());const o=this.translator.load("jupyterlab"),r=0===this.model.outputs.length?o.__("Code Cell Content"):o.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);if(!(null==t?void 0:t.data))return;const s=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"].find((e=>{const s=t.data[e];return"string"==(Array.isArray(s)?typeof s[0]:typeof s)})),i=t.data[null!=s?s:""];return void 0!==i?null===(e=Array.isArray(i)?i:null==i?void 0:i.split("\n"))||void 0===e?void 0:e.find((e=>""!==e)):void 0}initializeState(){return super.initializeState(),this.loadScrolledState(),this._updatePrompt(),this}get headings(){if(!this._headingsCache){const e=[],t=this.model.outputs;for(let s=0;s<t.length;s++){const i=t.get(s);let n=null,o=null;Object.keys(i.data).forEach((e=>{!o&&X.TableOfContentsUtils.Markdown.isMarkdown(e)?o=e:!n&&X.TableOfContentsUtils.isHTML(e)&&(n=e)})),n?e.push(...X.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(i.data[n])).map((e=>({...e,outputIndex:s,type:ue.HeadingType.HTML})))):o&&e.push(...X.TableOfContentsUtils.Markdown.getHeadings(i.data[o]).map((e=>({...e,outputIndex:s,type:ue.HeadingType.Markdown}))))}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden!==e){if(!this.placeholder){const s=this._outputWrapper.layout;e?(s.removeWidget(this._output),s.addWidget(this._outputPlaceholder),this.inputHidden&&!this._outputWrapper.isHidden&&this._outputWrapper.hide(),this._outputPlaceholder&&(this._outputPlaceholder.text=null!==(t=this.getOutputPlaceholderText())&&void 0!==t?t:"")):(this._outputWrapper.isHidden&&this._outputWrapper.show(),s.removeWidget(this._outputPlaceholder),s.addWidget(this._output))}this._outputHidden=e,this.syncCollapse&&this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");this.outputHidden&&!0===e||!this.outputHidden&&void 0===e||(this.outputHidden?this.model.setMetadata("collapsed",!0):this.model.deleteMetadata("collapsed"))}),!1)}loadCollapseState(){super.loadCollapseState(),this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e),this._outputsScrolled=e,this.syncScrolled&&this.saveScrolledState(),this.updatePromptOverlayIcon()}updatePromptOverlayIcon(){var e;const t=q.DOMUtils.findElement(this.node,"jp-OutputArea-promptOverlay");if(!t)return;if(t.clientHeight<=24)return void(null===(e=t.firstChild)||void 0===e||e.remove());let s;this._outputsScrolled?(h.expandIcon.element({container:t}),s="Expand Output"):(h.collapseIcon.element({container:t}),s="Collapse Output");const i=this.translator.load("jupyterlab");t.title=i.__(s)}saveScrolledState(){const e=this.model.getMetadata("scrolled");this.outputsScrolled&&!0===e||!this.outputsScrolled&&void 0===e||(this.outputsScrolled?this.model.setMetadata("scrolled",!0):(this.outputArea.node.style.height="",this.model.deleteMetadata("scrolled")))}loadScrolledState(){"auto"===this.model.getMetadata("scrolled")?this.outputsScrolled=!1:this.outputsScrolled=!!this.model.getMetadata("scrolled")}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){this._syncScrolled!==e&&(this._syncScrolled=e,e&&this.loadScrolledState())}handleInputHidden(e){this.placeholder||(!e&&this._outputWrapper.isHidden?this._outputWrapper.show():e&&!this._outputWrapper.isHidden&&this._outputHidden&&this._outputWrapper.hide())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}cloneOutputArea(){return new O.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){this.isDisposed||(this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this),this._output.node.removeEventListener("keydown",this._detectCaretMovementInOuput),this._rendermime=null,this._output=null,this._outputWrapper=null,this._outputPlaceholder=null,super.dispose())}onStateChanged(e,t){switch(t.name){case"executionCount":this.model.executionState="idle",this._updatePrompt();break;case"executionState":this._updatePrompt();break;case"isDirty":e.isDirty?this.addClass(ne):this.removeClass(ne)}}onOutputChanged(){var e;this._headingsCache=null,this._outputPlaceholder&&this.outputHidden&&(this._outputPlaceholder.text=null!==(e=this.getOutputPlaceholderText())&&void 0!==e?e:""),this.updatePromptOverlayIcon();const t=this.outputArea.node.style.height;0===this.model.outputs.length&&""!==t?(this._lastOutputHeight=t,this.outputArea.node.style.height=""):this.model.outputs.length>0&&""===t&&(this.outputArea.node.style.height=this._lastOutputHeight)}onMetadataChanged(e,t){switch(t.key){case"scrolled":this.syncScrolled&&this.loadScrolledState();break;case"collapsed":this.syncCollapse&&this.loadCollapseState()}super.onMetadataChanged(e,t)}_updatePrompt(){let e;e="running"==this.model.executionState?"*":`${this.model.executionCount||""}`,this._setPrompt(e)}_outputLengthHandler(e,t){const s=0===t;this.toggleClass(le,s);const i=this.translator.load("jupyterlab"),n=s?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",n)}_sizeChangedHandler(e){this._displayChanged.emit()}}!function(e){e.execute=async function(e,t,s){var i;const n=e.model,o=n.sharedModel.getSource();if(!o.trim()||!(null===(i=t.session)||void 0===i?void 0:i.kernel))return void n.sharedModel.transact((()=>{n.clearExecution()}),!1);const r={cellId:n.sharedModel.getId()};s={...n.metadata,...s,...r};const{recordTiming:a}=s;let d;n.sharedModel.transact((()=>{n.clearExecution(),e.outputHidden=!1}),!1),n.executionState="running",n.trusted=!0;try{const i=O.OutputArea.execute(o,e.outputArea,t,s);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return!0}const s=e.header.date||(new Date).toISOString(),i=Object.assign({},n.getMetadata("execution"));return i[`iopub.${t}`]=s,n.setMetadata("execution",i),!0};e.outputArea.future.registerMessageHook(t)}else n.deleteMetadata("execution");d=e.outputArea.future;const r=await i;if(n.executionCount=r.content.execution_count,a){const e=Object.assign({},n.getMetadata("execution")),t=r.metadata.started;t&&(e["shell.execute_reply.started"]=t);const s=r.header.date;e["shell.execute_reply"]=s||(new Date).toISOString(),n.setMetadata("execution",e)}return r}catch(t){if(d&&!e.isDisposed&&e.outputArea.future===d&&(e.model.executionState="idle",a&&d.isDisposed)){const e=Object.assign({},n.getMetadata("execution"));e.execution_failed=(new Date).toISOString(),n.setMetadata("execution",e)}throw t}}}(pe||(pe={}));class ge extends ue{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e)}}getEditorOptions(){var e,t;const s=null!==(e=super.getEditorOptions())&&void 0!==e?e:{};return s.extensions=[...null!==(t=s.extensions)&&void 0!==t?t:[],Q.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})],s}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this),super.onBeforeDetach(e)}_evtDragOver(e){(0,K.some)(G.imageRendererFactory.mimeTypes,(t=>!!e.mimeData.hasData(he)&&e.mimeData.getData(he).model.mimetype===t))&&(e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction)}_evtPaste(e){if(e.clipboardData){const t=e.clipboardData.items;for(let s=0;s<t.length;s++){if("text/plain"===t[s].type){if(s<t.length-1&&"file"===t[s+1].kind)continue;t[s].getAsString((e=>{var t,s;null===(s=(t=this.editor).replaceSelection)||void 0===s||s.call(t,e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){e.dataTransfer&&this._attachFiles(e.dataTransfer.items),e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===he){const t=e.mimeData.getData(he);return-1!==G.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)}return-1!==G.imageRendererFactory.mimeTypes.indexOf(t)}));if(0!==t.length)if(e.preventDefault(),e.stopPropagation(),"none"!==e.proposedAction){e.dropAction="copy";for(const s of t)if(s===he){const{model:t,withContent:s}=e.mimeData.getData(he);if("file"===t.type){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e),s().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[s]:e.mimeData.getData(s)}),this.updateCellSourceWithAttachment(t,t)}}else e.dropAction="none"}_attachFiles(e){for(let t=0;t<e.length;t++){const s=e[t];if("file"===s.kind){const e=s.getAsFile();e&&this._attachFile(e)}}}_attachFile(e){const t=new FileReader;t.onload=s=>{const{href:i,protocol:n}=R.URLExt.parse(t.result);if("data:"!==n)return;const o=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/.exec(i);if(!o||4!==o.length)return;const r=o[1],a={[r]:o[3]},d=this._generateURI(e.name);r.startsWith("image/")&&(this.model.attachments.set(d,a),this.updateCellSourceWithAttachment(e.name,d))},t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)},t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return-1!==t?Y.UUID.uuid4().concat(e.substring(t)):Y.UUID.uuid4()}}class me extends ge{constructor(e){var t,s,i,n;super({...e,placeholder:!0}),this._headingsCache=null,this._headingCollapsedChanged=new f.Signal(this),this._prevText="",this._rendered=!0,this._renderedChanged=new f.Signal(this),this._showEditorForReadOnlyMarkdown=!0,this.addClass("jp-MarkdownCell"),this.model.contentChanged.connect(this.onContentChanged,this);const o=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",o.__("Markdown Cell Content")),this._rendermime=e.rendermime.clone({resolver:new M.AttachmentsResolver({parent:null!==(t=e.rendermime.resolver)&&void 0!==t?t:void 0,model:this.model.attachments})}),this._renderer=this._rendermime.createRenderer("text/markdown"),this._renderer.addClass("jp-MarkdownOutput"),this._headingCollapsed=null!==(s=this.model.getMetadata(oe))&&void 0!==s&&s,this._showEditorForReadOnlyMarkdown=null!==(i=e.showEditorForReadOnlyMarkdown)&&void 0!==i?i:me.defaultShowEditorForReadOnlyMarkdown,this.placeholder=null===(n=e.placeholder)||void 0===n||n,this._monitor=new R.ActivityMonitor({signal:this.model.contentChanged,timeout:1e3}),this.ready.then((()=>{this.isDisposed||this._monitor.activityStopped.connect((()=>{this._rendered&&this.update()}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:s}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:s}}return{text:"",level:-1}}get headings(){if(!this._headingsCache){const e=X.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:ue.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e,e?this.model.setMetadata(oe,e):"undefined"!==this.model.getMetadata(oe)&&this.model.deleteMetadata(oe);const s=null===(t=this.inputArea)||void 0===t?void 0:t.promptNode.getElementsByClassName(re)[0];s&&(e?s.classList.add("jp-mod-collapsed"):s.classList.remove("jp-mod-collapsed")),this.renderCollapseButtons(this._renderer),this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e,this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){this.readOnly&&!1===this._showEditorForReadOnlyMarkdown&&(e=!0),e!==this._rendered&&(this._rendered=e,this._handleRendered().then((()=>{this._displayChanged.emit(),this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)})))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e,!1===e&&(this.rendered=!0)}get renderer(){return this._renderer}dispose(){this.isDisposed||(this._monitor.dispose(),super.dispose())}initializeDOM(){this.placeholder&&(super.initializeDOM(),this.renderCollapseButtons(this._renderer),this._handleRendered().catch((e=>{console.error("Failed to render",e)})))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&0==(null===(e=this.inputArea)||void 0===e?void 0:e.promptNode.getElementsByClassName(re).length)){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${re}`,e.setAttribute("data-heading-level",t.toString()),this._headingCollapsed?e.classList.add("jp-mod-collapsed"):e.classList.remove("jp-mod-collapsed"),e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(ae);let t=this.translator.load("jupyterlab")._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);if(this.headingCollapsed&&this._numberChildNodes>0&&0==e.length){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${ae}`,h.addIcon.render(e);const s=document.createElement("div");s.textContent=t,e.appendChild(s),e.onclick=()=>{this.headingCollapsed=!1},this.node.appendChild(e)}if(this.headingCollapsed&&this._numberChildNodes>0&&1==e.length&&(e[0].childNodes[1].textContent=t),!(this.headingCollapsed&&this._numberChildNodes>0))for(const t of e)this.node.removeChild(t)}onContentChanged(){super.onContentChanged(),this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(oe,this._headingCollapsed),this.maybeCreateCollapseButton(),this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(de),this.placeholder||this.isDisposed||(this.renderCollapseButtons(e),this.inputArea.renderInput(e))}showEditor(){if(this.removeClass(de),!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;e>0&&this.inputArea.editor.setCursorPosition({column:e+1,line:0},{scroll:!1})}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)})),super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var s,i;const n=`![${e}](attachment:${null!=t?t:e})`;null===(i=null===(s=this.editor)||void 0===s?void 0:s.replaceSelection)||void 0===i||i.call(s,n)}async _handleRendered(){this._rendered?(await this._updateRenderedInput(),this._rendered&&this.renderInput(this._renderer)):this.showEditor()}_updateRenderedInput(){if(this.placeholder)return Promise.resolve();const e=this.model,t=e&&e.sharedModel.getSource()||"Type Markdown and LaTeX: $ α^2 $";if(t!==this._prevText){const e=new G.MimeModel({data:{"text/markdown":t}});return this._prevText=t,this._renderer.renderModel(e)}return Promise.resolve()}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}}!function(e){e.defaultShowEditorForReadOnlyMarkdown=!0}(me||(me={}));class Ce extends ue{constructor(e){super(e),this.addClass("jp-RawCell");const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}}}}]);