notebook 7.1.3__py3-none-any.whl → 7.2.0__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 (228) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/113.bundle.js +1 -0
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/131.bundle.js +1 -1
  5. notebook/static/134.bundle.js +1 -1
  6. notebook/static/1408.bundle.js +1 -1
  7. notebook/static/1496.bundle.js +1 -1
  8. notebook/static/1584.bundle.js +1 -1
  9. notebook/static/1647.bundle.js +1 -1
  10. notebook/static/1650.bundle.js +1 -1
  11. notebook/static/1684.bundle.js +1 -1
  12. notebook/static/1809.bundle.js +1 -1
  13. notebook/static/1827.bundle.js +1 -1
  14. notebook/static/1828.bundle.js +1 -0
  15. notebook/static/1833.bundle.js +1 -1
  16. notebook/static/1846.bundle.js +1 -1
  17. notebook/static/1884.bundle.js +386 -0
  18. notebook/static/1958.bundle.js +1 -1
  19. notebook/static/1962.bundle.js +1 -0
  20. notebook/static/2007.bundle.js +1 -1
  21. notebook/static/2088.bundle.js +1 -1
  22. notebook/static/2089.bundle.js +1 -1
  23. notebook/static/2122.bundle.js +1 -1
  24. notebook/static/2167.bundle.js +1 -1
  25. notebook/static/2184.bundle.js +1 -1
  26. notebook/static/2311.bundle.js +1 -1
  27. notebook/static/2323.bundle.js +1 -1
  28. notebook/static/2401.bundle.js +1 -1
  29. notebook/static/2479.bundle.js +1 -1
  30. notebook/static/2489.bundle.js +1 -1
  31. notebook/static/2552.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2615.bundle.js +1 -1
  34. notebook/static/2636.bundle.js +1 -0
  35. notebook/static/2866.bundle.js +1 -1
  36. notebook/static/2924.bundle.js +1 -1
  37. notebook/static/2944.bundle.js +1 -1
  38. notebook/static/2955.bundle.js +1 -1
  39. notebook/static/3129.bundle.js +1 -1
  40. notebook/static/3146.bundle.js +1 -1
  41. notebook/static/3154.bundle.js +1 -1
  42. notebook/static/3187.bundle.js +1 -1
  43. notebook/static/3213.bundle.js +1 -1
  44. notebook/static/3301.bundle.js +1 -1
  45. notebook/static/3340.bundle.js +1 -1
  46. notebook/static/3360.bundle.js +1 -1
  47. notebook/static/3462.bundle.js +1 -0
  48. notebook/static/3466.bundle.js +1 -1
  49. notebook/static/3512.bundle.js +1 -1
  50. notebook/static/3676.bundle.js +1 -1
  51. notebook/static/3680.bundle.js +1 -1
  52. notebook/static/374.bundle.js +1 -0
  53. notebook/static/3768.bundle.js +1 -1
  54. notebook/static/377.bundle.js +1 -1
  55. notebook/static/3797.bundle.js +1 -1
  56. notebook/static/3863.bundle.js +1 -1
  57. notebook/static/3881.bundle.js +1 -1
  58. notebook/static/4042.bundle.js +1 -1
  59. notebook/static/4058.bundle.js +1 -1
  60. notebook/static/4212.bundle.js +1 -1
  61. notebook/static/4382.bundle.js +1 -1
  62. notebook/static/4430.bundle.js +1 -0
  63. notebook/static/4588.bundle.js +1 -1
  64. notebook/static/4630.bundle.js +1 -1
  65. notebook/static/4645.bundle.js +1 -1
  66. notebook/static/4670.bundle.js +1 -1
  67. notebook/static/4708.bundle.js +1 -0
  68. notebook/static/4810.bundle.js +1 -1
  69. notebook/static/4811.bundle.js +1 -1
  70. notebook/static/4837.bundle.js +1 -1
  71. notebook/static/5099.bundle.js +1 -1
  72. notebook/static/5135.bundle.js +1 -1
  73. notebook/static/5166.bundle.js +1 -0
  74. notebook/static/5254.bundle.js +1 -0
  75. notebook/static/5261.bundle.js +1 -1
  76. notebook/static/5263.bundle.js +1 -1
  77. notebook/static/5313.bundle.js +1 -1
  78. notebook/static/5325.bundle.js +1 -1
  79. notebook/static/5346.bundle.js +1 -1
  80. notebook/static/5425.bundle.js +1 -1
  81. notebook/static/5426.bundle.js +1 -1
  82. notebook/static/545.bundle.js +1 -0
  83. notebook/static/5573.bundle.js +1 -1
  84. notebook/static/5601.bundle.js +1 -1
  85. notebook/static/5649.bundle.js +3 -3
  86. notebook/static/5733.bundle.js +1 -1
  87. notebook/static/5828.bundle.js +1 -1
  88. notebook/static/5850.bundle.js +1 -1
  89. notebook/static/5912.bundle.js +1 -1
  90. notebook/static/5921.bundle.js +1 -1
  91. notebook/static/6017.bundle.js +1 -1
  92. notebook/static/6061.bundle.js +1 -1
  93. notebook/static/{1053.bundle.js → 6078.bundle.js} +1 -1
  94. notebook/static/6139.bundle.js +1 -1
  95. notebook/static/62.bundle.js +1 -1
  96. notebook/static/6271.bundle.js +1 -1
  97. notebook/static/6281.bundle.js +1 -1
  98. notebook/static/6345.bundle.js +1 -1
  99. notebook/static/6417.bundle.js +1 -1
  100. notebook/static/6521.bundle.js +1 -0
  101. notebook/static/6604.bundle.js +1 -1
  102. notebook/static/6621.bundle.js +1 -1
  103. notebook/static/6627.bundle.js +1 -1
  104. notebook/static/6731.bundle.js +1 -1
  105. notebook/static/6748.bundle.js +1 -0
  106. notebook/static/6815.bundle.js +1 -1
  107. notebook/static/6853.bundle.js +1 -0
  108. notebook/static/6893.bundle.js +1 -1
  109. notebook/static/690.bundle.js +1 -1
  110. notebook/static/6962.bundle.js +1 -1
  111. notebook/static/6972.bundle.js +1 -1
  112. notebook/static/6999.bundle.js +1 -1
  113. notebook/static/7153.bundle.js +1 -1
  114. notebook/static/7226.bundle.js +1 -1
  115. notebook/static/7252.bundle.js +1 -1
  116. notebook/static/7302.bundle.js +1 -1
  117. notebook/static/7386.bundle.js +1 -1
  118. notebook/static/7391.bundle.js +1 -1
  119. notebook/static/7450.bundle.js +1 -1
  120. notebook/static/7506.bundle.js +703 -0
  121. notebook/static/7543.bundle.js +1 -0
  122. notebook/static/7603.bundle.js +1 -1
  123. notebook/static/7639.bundle.js +1 -1
  124. notebook/static/7655.bundle.js +1 -0
  125. notebook/static/7674.bundle.js +1 -1
  126. notebook/static/7684.bundle.js +1 -1
  127. notebook/static/7812.bundle.js +1 -1
  128. notebook/static/7819.bundle.js +1 -1
  129. notebook/static/7854.bundle.js +1 -0
  130. notebook/static/7866.bundle.js +1 -1
  131. notebook/static/7884.bundle.js +1 -0
  132. notebook/static/7900.bundle.js +1 -1
  133. notebook/static/7906.bundle.js +1 -1
  134. notebook/static/7995.bundle.js +1 -1
  135. notebook/static/7997.bundle.js +1 -1
  136. notebook/static/8010.bundle.js +1 -1
  137. notebook/static/8032.bundle.js +1 -1
  138. notebook/static/8471.bundle.js +1 -0
  139. notebook/static/8579.bundle.js +1 -1
  140. notebook/static/8633.bundle.js +1 -1
  141. notebook/static/8771.bundle.js +1 -1
  142. notebook/static/8781.bundle.js +1 -1
  143. notebook/static/8845.bundle.js +1 -1
  144. notebook/static/8875.bundle.js +1 -1
  145. notebook/static/8907.bundle.js +1 -1
  146. notebook/static/8928.bundle.js +1 -1
  147. notebook/static/8929.bundle.js +1 -1
  148. notebook/static/893.bundle.js +1 -1
  149. notebook/static/901.bundle.js +1 -1
  150. notebook/static/9068.bundle.js +1 -1
  151. notebook/static/911.bundle.js +1 -1
  152. notebook/static/9136.bundle.js +1 -0
  153. notebook/static/9151.bundle.js +1 -1
  154. notebook/static/9161.bundle.js +1 -1
  155. notebook/static/9239.bundle.js +1 -1
  156. notebook/static/9268.bundle.js +1 -1
  157. notebook/static/9335.bundle.js +1 -1
  158. notebook/static/9341.bundle.js +1 -1
  159. notebook/static/9380.bundle.js +1 -1
  160. notebook/static/9605.bundle.js +1 -1
  161. notebook/static/9638.bundle.js +1 -1
  162. notebook/static/9680.bundle.js +1 -1
  163. notebook/static/9685.bundle.js +1 -1
  164. notebook/static/9752.bundle.js +1 -1
  165. notebook/static/9799.bundle.js +1 -1
  166. notebook/static/9821.bundle.js +1 -1
  167. notebook/static/9852.bundle.js +1 -1
  168. notebook/static/bundle.js +1 -1
  169. notebook/static/third-party-licenses.json +173 -161
  170. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +15 -15
  171. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  172. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  173. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +10 -10
  174. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +17 -17
  175. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +12 -12
  176. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +11 -11
  177. notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/302.8a8d0af0376cb309e580.js +1 -0
  178. notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1a379d1d7dc566a197da.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.aff74c88f76bc9000e65.js +1 -1
  179. notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.a1f037cc55c9ffb2e994.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.76f40c4b4ee1c8583ca3.js +1 -1
  180. notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.a1a4e0e795dca61023d3.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.eced2d228ddfce366f36.js +1 -1
  181. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  182. {notebook-7.1.3.dist-info → notebook-7.2.0.dist-info}/METADATA +4 -4
  183. {notebook-7.1.3.dist-info → notebook-7.2.0.dist-info}/RECORD +207 -205
  184. {notebook-7.1.3.dist-info → notebook-7.2.0.dist-info}/WHEEL +1 -1
  185. notebook/static/1337.bundle.js +0 -1
  186. notebook/static/1664.bundle.js +0 -743
  187. notebook/static/1682.bundle.js +0 -1
  188. notebook/static/1835.bundle.js +0 -1
  189. notebook/static/1950.bundle.js +0 -1
  190. notebook/static/2067.bundle.js +0 -1
  191. notebook/static/2094.bundle.js +0 -1
  192. notebook/static/2512.bundle.js +0 -1
  193. notebook/static/2577.bundle.js +0 -1
  194. notebook/static/2758.bundle.js +0 -1
  195. notebook/static/3654.bundle.js +0 -1
  196. notebook/static/4558.bundle.js +0 -1
  197. notebook/static/4928.bundle.js +0 -1
  198. notebook/static/4997.bundle.js +0 -1
  199. notebook/static/5088.bundle.js +0 -1
  200. notebook/static/514.bundle.js +0 -1
  201. notebook/static/6256.bundle.js +0 -1
  202. notebook/static/6467.bundle.js +0 -1
  203. notebook/static/7394.bundle.js +0 -1
  204. notebook/static/853.bundle.js +0 -1
  205. notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/419.e980232a56ae53a39be0.js +0 -1
  206. /notebook/static/{1664.bundle.js.LICENSE.txt → 7506.bundle.js.LICENSE.txt} +0 -0
  207. {notebook-7.1.3.data → notebook-7.2.0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  208. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  209. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  210. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  211. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  212. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  213. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  214. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  215. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  216. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  217. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  218. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  219. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  220. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  221. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  222. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  223. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  224. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  225. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  226. {notebook-7.1.3.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  227. {notebook-7.1.3.dist-info → notebook-7.2.0.dist-info}/entry_points.txt +0 -0
  228. {notebook-7.1.3.dist-info → notebook-7.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6345,4645],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(3053),s=o(46122),a=o(38639),r=o(45373),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6345,4645],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(44604),s=o(67260),a=o(68722),r=o(23817),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6417],{74193:(e,t,n)=>{n.d(t,{a:()=>l});var r=n(51723);function l(e,t){var n=e.append("foreignObject").attr("width","100000"),l=n.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var o=t.label;switch(typeof o){case"function":l.insert(o);break;case"object":l.insert((function(){return o}));break;default:l.html(o)}r.bg(l,t.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var a=l.node().getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}},51723:(e,t,n)=>{n.d(t,{$p:()=>d,O1:()=>a,WR:()=>p,bF:()=>o,bg:()=>c});var r=n(53541),l=n(48489);function o(e,t){return!!e.children(t).length}function a(e){return i(e.v)+":"+i(e.w)+":"+i(e.name)}var s=/:/g;function i(e){return e?String(e).replace(s,"\\:"):""}function c(e,t){t&&e.attr("style",t)}function d(e,t,n){t&&e.attr("class",t).attr("class",n+" "+e.attr("class"))}function p(e,t){var n=t.graph();if(r.Z(n)){var o=n.transition;if(l.Z(o))return o(e)}return e}},66417:(e,t,n)=>{n.d(t,{diagram:()=>s});var r=n(31261),l=(n(67406),n(23617));n(24028),n(36004),n(65479),n(21845),n(7259),n(51723),n(74193),n(12451),n(36735),n(87768),l.c_6;var o=n(3675);n(27693),n(7608),n(31699),n(58038);const a={},s={parser:r.p,db:r.f,renderer:o.f,styles:o.a,init:e=>{e.flowchart||(e.flowchart={}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,function(e){const t=Object.keys(e);for(const n of t)a[n]=e[n]}(e.flowchart),r.f.clear(),r.f.setGen("gen-1")}}},3675:(e,t,n)=>{n.d(t,{a:()=>h,f:()=>u});var r=n(67406),l=n(23617),o=n(24028),a=n(86281),s=n(74193),i=n(90267),c=n(42528);const d=(e,t)=>i.Z.lang.round(c.Z.parse(e)[t]);var p=n(14728);const b={},f=function(e,t,n,r,l,a){const i=r.select(`[id="${n}"]`);Object.keys(e).forEach((function(n){const r=e[n];let c="default";r.classes.length>0&&(c=r.classes.join(" ")),c+=" flowchart-label";const d=(0,o.k)(r.styles);let p,b=void 0!==r.text?r.text:r.id;if(o.l.info("vertex",r,r.labelType),"markdown"===r.labelType)o.l.info("vertex",r,r.labelType);else if((0,o.m)((0,o.c)().flowchart.htmlLabels)){const e={label:b.replace(/fa[blrs]?:fa-[\w-]+/g,(e=>`<i class='${e.replace(":"," ")}'></i>`))};p=(0,s.a)(i,e).node(),p.parentNode.removeChild(p)}else{const e=l.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",d.labelStyle.replace("color:","fill:"));const t=b.split(o.e.lineBreakRegex);for(const n of t){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","1"),t.textContent=n,e.appendChild(t)}p=e}let f=0,w="";switch(r.type){case"round":f=5,w="rect";break;case"square":case"group":default:w="rect";break;case"diamond":w="question";break;case"hexagon":w="hexagon";break;case"odd":case"odd_right":w="rect_left_inv_arrow";break;case"lean_right":w="lean_right";break;case"lean_left":w="lean_left";break;case"trapezoid":w="trapezoid";break;case"inv_trapezoid":w="inv_trapezoid";break;case"circle":w="circle";break;case"ellipse":w="ellipse";break;case"stadium":w="stadium";break;case"subroutine":w="subroutine";break;case"cylinder":w="cylinder";break;case"doublecircle":w="doublecircle"}t.setNode(r.id,{labelStyle:d.labelStyle,shape:w,labelText:b,labelType:r.labelType,rx:f,ry:f,class:c,style:d.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:a.db.getTooltip(r.id)||"",domId:a.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:"group"===r.type?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:(0,o.c)().flowchart.padding}),o.l.info("setNode",{labelStyle:d.labelStyle,labelType:r.labelType,shape:w,labelText:b,rx:f,ry:f,class:c,style:d.style,id:r.id,domId:a.db.lookUpDomId(r.id),width:"group"===r.type?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:(0,o.c)().flowchart.padding})}))},w=function(e,t,n){o.l.info("abc78 edges = ",e);let r,a,s=0,i={};if(void 0!==e.defaultStyle){const t=(0,o.k)(e.defaultStyle);r=t.style,a=t.labelStyle}e.forEach((function(n){s++;const c="L-"+n.start+"-"+n.end;void 0===i[c]?(i[c]=0,o.l.info("abc78 new entry",c,i[c])):(i[c]++,o.l.info("abc78 new entry",c,i[c]));let d=c+"-"+i[c];o.l.info("abc78 new link id to be used is",c,d,i[c]);const p="LS-"+n.start,f="LE-"+n.end,w={style:"",labelStyle:""};switch(w.minlen=n.length||1,"arrow_open"===n.type?w.arrowhead="none":w.arrowhead="normal",w.arrowTypeStart="arrow_open",w.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":w.arrowTypeStart="arrow_cross";case"arrow_cross":w.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":w.arrowTypeStart="arrow_point";case"arrow_point":w.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":w.arrowTypeStart="arrow_circle";case"arrow_circle":w.arrowTypeEnd="arrow_circle"}let u="",h="";switch(n.stroke){case"normal":u="fill:none;",void 0!==r&&(u=r),void 0!==a&&(h=a),w.thickness="normal",w.pattern="solid";break;case"dotted":w.thickness="normal",w.pattern="dotted",w.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":w.thickness="thick",w.pattern="solid",w.style="stroke-width: 3.5px;fill:none;";break;case"invisible":w.thickness="invisible",w.pattern="solid",w.style="stroke-width: 0;fill:none;"}if(void 0!==n.style){const e=(0,o.k)(n.style);u=e.style,h=e.labelStyle}w.style=w.style+=u,w.labelStyle=w.labelStyle+=h,void 0!==n.interpolate?w.curve=(0,o.n)(n.interpolate,l.c_6):void 0!==e.defaultInterpolate?w.curve=(0,o.n)(e.defaultInterpolate,l.c_6):w.curve=(0,o.n)(b.curve,l.c_6),void 0===n.text?void 0!==n.style&&(w.arrowheadStyle="fill: #333"):(w.arrowheadStyle="fill: #333",w.labelpos="c"),w.labelType=n.labelType,w.label=n.text.replace(o.e.lineBreakRegex,"\n"),void 0===n.style&&(w.style=w.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),w.labelStyle=w.labelStyle.replace("color:","fill:"),w.id=d,w.classes="flowchart-link "+p+" "+f,t.setEdge(n.start,n.end,w,s)}))},u={setConf:function(e){const t=Object.keys(e);for(const n of t)b[n]=e[n]},addVertices:f,addEdges:w,getClasses:function(e,t){return t.db.getClasses()},draw:async function(e,t,n,s){o.l.info("Drawing flowchart");let i=s.db.getDirection();void 0===i&&(i="TD");const{securityLevel:c,flowchart:d}=(0,o.c)(),p=d.nodeSpacing||50,b=d.rankSpacing||50;let u;"sandbox"===c&&(u=(0,l.Ys)("#i"+t));const h="sandbox"===c?(0,l.Ys)(u.nodes()[0].contentDocument.body):(0,l.Ys)("body"),g="sandbox"===c?u.nodes()[0].contentDocument:document,y=new r.k({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:p,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let k;const x=s.db.getSubGraphs();o.l.info("Subgraphs - ",x);for(let e=x.length-1;e>=0;e--)k=x[e],o.l.info("Subgraph - ",k),s.db.addVertex(k.id,{text:k.title,type:k.labelType},"group",void 0,k.classes,k.dir);const v=s.db.getVertices(),m=s.db.getEdges();o.l.info("Edges",m);let T=0;for(T=x.length-1;T>=0;T--){k=x[T],(0,l.td_)("cluster").append("text");for(let e=0;e<k.nodes.length;e++)o.l.info("Setting up subgraphs",k.nodes[e],k.id),y.setParent(k.nodes[e],k.id)}f(v,y,t,h,g,s),w(m,y);const S=h.select(`[id="${t}"]`),_=h.select("#"+t+" g");if(await(0,a.r)(_,y,["point","circle","cross"],"flowchart",t),o.u.insertTitle(S,"flowchartTitleText",d.titleTopMargin,s.db.getDiagramTitle()),(0,o.o)(y,S,d.diagramPadding,d.useMaxWidth),s.db.indexNodes("subGraph"+T),!d.htmlLabels){const e=g.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of e){const e=t.getBBox(),n=g.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",e.width),n.setAttribute("height",e.height),t.insertBefore(n,t.firstChild)}}Object.keys(v).forEach((function(e){const n=v[e];if(n.link){const r=(0,l.Ys)("#"+t+' [id="'+e+'"]');if(r){const e=g.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",n.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",n.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===c?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):n.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",n.linkTarget);const t=r.insert((function(){return e}),":first-child"),l=r.select(".label-container");l&&t.append((function(){return l.node()}));const o=r.select(".label");o&&t.append((function(){return o.node()}))}}}))}},h=e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${((e,t)=>{const n=d,r=n(e,"r"),l=n(e,"g"),o=n(e,"b");return p.Z(r,l,o,.5)})(e.edgeLabelBackground)};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6417],{74193:(e,t,n)=>{n.d(t,{a:()=>l});var r=n(51723);function l(e,t){var n=e.append("foreignObject").attr("width","100000"),l=n.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var o=t.label;switch(typeof o){case"function":l.insert(o);break;case"object":l.insert((function(){return o}));break;default:l.html(o)}r.bg(l,t.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var a=l.node().getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}},51723:(e,t,n)=>{n.d(t,{$p:()=>d,O1:()=>a,WR:()=>p,bF:()=>o,bg:()=>c});var r=n(53541),l=n(48489);function o(e,t){return!!e.children(t).length}function a(e){return i(e.v)+":"+i(e.w)+":"+i(e.name)}var s=/:/g;function i(e){return e?String(e).replace(s,"\\:"):""}function c(e,t){t&&e.attr("style",t)}function d(e,t,n){t&&e.attr("class",t).attr("class",n+" "+e.attr("class"))}function p(e,t){var n=t.graph();if(r.Z(n)){var o=n.transition;if(l.Z(o))return o(e)}return e}},66417:(e,t,n)=>{n.d(t,{diagram:()=>s});var r=n(31261),l=(n(67406),n(23617));n(24028),n(36004),n(65479),n(21845),n(7259),n(51723),n(74193),n(12451),n(36735),n(87768),l.c_6;var o=n(3675);n(27693),n(7608),n(31699),n(81779);const a={},s={parser:r.p,db:r.f,renderer:o.f,styles:o.a,init:e=>{e.flowchart||(e.flowchart={}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,function(e){const t=Object.keys(e);for(const n of t)a[n]=e[n]}(e.flowchart),r.f.clear(),r.f.setGen("gen-1")}}},3675:(e,t,n)=>{n.d(t,{a:()=>h,f:()=>u});var r=n(67406),l=n(23617),o=n(24028),a=n(86281),s=n(74193),i=n(90267),c=n(42528);const d=(e,t)=>i.Z.lang.round(c.Z.parse(e)[t]);var p=n(14728);const b={},f=function(e,t,n,r,l,a){const i=r.select(`[id="${n}"]`);Object.keys(e).forEach((function(n){const r=e[n];let c="default";r.classes.length>0&&(c=r.classes.join(" ")),c+=" flowchart-label";const d=(0,o.k)(r.styles);let p,b=void 0!==r.text?r.text:r.id;if(o.l.info("vertex",r,r.labelType),"markdown"===r.labelType)o.l.info("vertex",r,r.labelType);else if((0,o.m)((0,o.c)().flowchart.htmlLabels)){const e={label:b.replace(/fa[blrs]?:fa-[\w-]+/g,(e=>`<i class='${e.replace(":"," ")}'></i>`))};p=(0,s.a)(i,e).node(),p.parentNode.removeChild(p)}else{const e=l.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",d.labelStyle.replace("color:","fill:"));const t=b.split(o.e.lineBreakRegex);for(const n of t){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","1"),t.textContent=n,e.appendChild(t)}p=e}let f=0,w="";switch(r.type){case"round":f=5,w="rect";break;case"square":case"group":default:w="rect";break;case"diamond":w="question";break;case"hexagon":w="hexagon";break;case"odd":case"odd_right":w="rect_left_inv_arrow";break;case"lean_right":w="lean_right";break;case"lean_left":w="lean_left";break;case"trapezoid":w="trapezoid";break;case"inv_trapezoid":w="inv_trapezoid";break;case"circle":w="circle";break;case"ellipse":w="ellipse";break;case"stadium":w="stadium";break;case"subroutine":w="subroutine";break;case"cylinder":w="cylinder";break;case"doublecircle":w="doublecircle"}t.setNode(r.id,{labelStyle:d.labelStyle,shape:w,labelText:b,labelType:r.labelType,rx:f,ry:f,class:c,style:d.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:a.db.getTooltip(r.id)||"",domId:a.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:"group"===r.type?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:(0,o.c)().flowchart.padding}),o.l.info("setNode",{labelStyle:d.labelStyle,labelType:r.labelType,shape:w,labelText:b,rx:f,ry:f,class:c,style:d.style,id:r.id,domId:a.db.lookUpDomId(r.id),width:"group"===r.type?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:(0,o.c)().flowchart.padding})}))},w=function(e,t,n){o.l.info("abc78 edges = ",e);let r,a,s=0,i={};if(void 0!==e.defaultStyle){const t=(0,o.k)(e.defaultStyle);r=t.style,a=t.labelStyle}e.forEach((function(n){s++;const c="L-"+n.start+"-"+n.end;void 0===i[c]?(i[c]=0,o.l.info("abc78 new entry",c,i[c])):(i[c]++,o.l.info("abc78 new entry",c,i[c]));let d=c+"-"+i[c];o.l.info("abc78 new link id to be used is",c,d,i[c]);const p="LS-"+n.start,f="LE-"+n.end,w={style:"",labelStyle:""};switch(w.minlen=n.length||1,"arrow_open"===n.type?w.arrowhead="none":w.arrowhead="normal",w.arrowTypeStart="arrow_open",w.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":w.arrowTypeStart="arrow_cross";case"arrow_cross":w.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":w.arrowTypeStart="arrow_point";case"arrow_point":w.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":w.arrowTypeStart="arrow_circle";case"arrow_circle":w.arrowTypeEnd="arrow_circle"}let u="",h="";switch(n.stroke){case"normal":u="fill:none;",void 0!==r&&(u=r),void 0!==a&&(h=a),w.thickness="normal",w.pattern="solid";break;case"dotted":w.thickness="normal",w.pattern="dotted",w.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":w.thickness="thick",w.pattern="solid",w.style="stroke-width: 3.5px;fill:none;";break;case"invisible":w.thickness="invisible",w.pattern="solid",w.style="stroke-width: 0;fill:none;"}if(void 0!==n.style){const e=(0,o.k)(n.style);u=e.style,h=e.labelStyle}w.style=w.style+=u,w.labelStyle=w.labelStyle+=h,void 0!==n.interpolate?w.curve=(0,o.n)(n.interpolate,l.c_6):void 0!==e.defaultInterpolate?w.curve=(0,o.n)(e.defaultInterpolate,l.c_6):w.curve=(0,o.n)(b.curve,l.c_6),void 0===n.text?void 0!==n.style&&(w.arrowheadStyle="fill: #333"):(w.arrowheadStyle="fill: #333",w.labelpos="c"),w.labelType=n.labelType,w.label=n.text.replace(o.e.lineBreakRegex,"\n"),void 0===n.style&&(w.style=w.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),w.labelStyle=w.labelStyle.replace("color:","fill:"),w.id=d,w.classes="flowchart-link "+p+" "+f,t.setEdge(n.start,n.end,w,s)}))},u={setConf:function(e){const t=Object.keys(e);for(const n of t)b[n]=e[n]},addVertices:f,addEdges:w,getClasses:function(e,t){return t.db.getClasses()},draw:async function(e,t,n,s){o.l.info("Drawing flowchart");let i=s.db.getDirection();void 0===i&&(i="TD");const{securityLevel:c,flowchart:d}=(0,o.c)(),p=d.nodeSpacing||50,b=d.rankSpacing||50;let u;"sandbox"===c&&(u=(0,l.Ys)("#i"+t));const h="sandbox"===c?(0,l.Ys)(u.nodes()[0].contentDocument.body):(0,l.Ys)("body"),g="sandbox"===c?u.nodes()[0].contentDocument:document,y=new r.k({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:p,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let k;const x=s.db.getSubGraphs();o.l.info("Subgraphs - ",x);for(let e=x.length-1;e>=0;e--)k=x[e],o.l.info("Subgraph - ",k),s.db.addVertex(k.id,{text:k.title,type:k.labelType},"group",void 0,k.classes,k.dir);const v=s.db.getVertices(),m=s.db.getEdges();o.l.info("Edges",m);let T=0;for(T=x.length-1;T>=0;T--){k=x[T],(0,l.td_)("cluster").append("text");for(let e=0;e<k.nodes.length;e++)o.l.info("Setting up subgraphs",k.nodes[e],k.id),y.setParent(k.nodes[e],k.id)}f(v,y,t,h,g,s),w(m,y);const S=h.select(`[id="${t}"]`),_=h.select("#"+t+" g");if(await(0,a.r)(_,y,["point","circle","cross"],"flowchart",t),o.u.insertTitle(S,"flowchartTitleText",d.titleTopMargin,s.db.getDiagramTitle()),(0,o.o)(y,S,d.diagramPadding,d.useMaxWidth),s.db.indexNodes("subGraph"+T),!d.htmlLabels){const e=g.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of e){const e=t.getBBox(),n=g.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",e.width),n.setAttribute("height",e.height),t.insertBefore(n,t.firstChild)}}Object.keys(v).forEach((function(e){const n=v[e];if(n.link){const r=(0,l.Ys)("#"+t+' [id="'+e+'"]');if(r){const e=g.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",n.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",n.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===c?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):n.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",n.linkTarget);const t=r.insert((function(){return e}),":first-child"),l=r.select(".label-container");l&&t.append((function(){return l.node()}));const o=r.select(".label");o&&t.append((function(){return o.node()}))}}}))}},h=e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${((e,t)=>{const n=d,r=n(e,"r"),l=n(e,"g"),o=n(e,"b");return p.Z(r,l,o,.5)})(e.edgeLabelBackground)};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6521],{86521:e=>{var t;self,t=()=>(()=>{"use strict";var e={6:(e,t)=>{function r(e){try{const t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,r,n={}){this._terminal=e,this._regex=t,this._handler=r,this._options=n}provideLinks(e,t){const r=n.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,r)=>{if(this._options.hover){const{range:n}=e;this._options.hover(t,r,n)}},e)))}};class n{static computeLink(e,t,s,i){const o=new RegExp(t.source,(t.flags||"")+"g"),[a,l]=n._getWindowedLineStrings(e-1,s),c=a.join("");let d;const h=[];for(;d=o.exec(c);){const e=d[0];if(!r(e))continue;const[t,o]=n._mapStrIdx(s,l,0,d.index),[a,c]=n._mapStrIdx(s,t,o,e.length);if(-1===t||-1===o||-1===a||-1===c)continue;const p={start:{x:o+1,y:t+1},end:{x:c,y:a+1}};h.push({range:p,text:e,activate:i})}return h}static _getWindowedLineStrings(e,t){let r,n=e,s=e,i=0,o="";const a=[];if(r=t.buffer.active.getLine(e)){const e=r.translateToString(!0);if(r.isWrapped&&" "!==e[0]){for(i=0;(r=t.buffer.active.getLine(--n))&&i<2048&&(o=r.translateToString(!0),i+=o.length,a.push(o),r.isWrapped&&-1===o.indexOf(" ")););a.reverse()}for(a.push(e),i=0;(r=t.buffer.active.getLine(++s))&&r.isWrapped&&i<2048&&(o=r.translateToString(!0),i+=o.length,a.push(o),-1===o.indexOf(" ")););}return[a,n]}static _mapStrIdx(e,t,r,n){const s=e.buffer.active,i=s.getNullCell();let o=r;for(;n;){const e=s.getLine(t);if(!e)return[-1,-1];for(let r=o;r<e.length;++r){e.getCell(r,i);const o=i.getChars();if(i.getWidth()&&(n-=o.length||1,r===e.length-1&&""===o)){const e=s.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,i),2===i.getWidth()&&(n+=1))}if(n<0)return[t,r]}t++,o=0}return[t,o]}}t.LinkComputer=n}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;const t=r(6),s=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function i(e,t){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=i,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const r=this._options,n=r.urlRegex||s;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,n,this._handler,r))}dispose(){this._linkProvider?.dispose()}}})(),n})(),e.exports=t()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6604,2088],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(46122),r=t(38639),l=t(89421),s=t(43833),a=t(70856),d=t(53757),c=t(71677),u=t(33625),p=t(31516);!function(e){e.dismiss="tooltip:dismiss",e.launchConsole="tooltip:launch-console",e.launchNotebook="tooltip:launch-notebook",e.launchFile="tooltip:launch-file"}(n||(n={}));const m={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:!0,optional:[c.ITranslator],provides:d.ITooltipManager,activate:(e,o)=>{const t=(null!=o?o:c.nullTranslator).load("jupyterlab");let i=null;return e.commands.addCommand(n.dismiss,{label:t.__("Dismiss the tooltip"),execute:()=>{i&&(i.dispose(),i=null)}}),{invoke(e){const{anchor:o,editor:t,kernel:n,rendermime:r}=e;return i&&(i.dispose(),i=null),T.fetch({detail:0,editor:t,kernel:n}).then((e=>{i=new d.Tooltip({anchor:o,bundle:e,editor:t,rendermime:r}),p.Widget.attach(i,document.body)})).catch((()=>{}))}}}},h={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,i.IConsoleTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchConsole,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.console,l=null===(e=r.promptCell)||void 0===e?void 0:e.editor,s=null===(n=r.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},v={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,s.INotebookTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchNotebook,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.content,l=null===(e=r.activeCell)||void 0===e?void 0:e.editor,s=null===(n=i.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,l.IEditorTracker,a.IRenderMimeRegistry],activate:(e,o,t,i,r)=>{const l=(null!=r?r:c.nullTranslator).load("jupyterlab"),s={},a=e.serviceManager.sessions,d=(e,o)=>{t.forEach((e=>{const t=(0,u.find)(o,(o=>e.context.path===o.path));if(t){const o=s[e.id];if(o&&o.id===t.id)return;o&&(delete s[e.id],o.dispose());const n=a.connectTo({model:t});s[e.id]=n}else{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}}))};d(0,a.running()),a.runningChanged.connect(d),t.widgetAdded.connect(((e,o)=>{o.disposed.connect((e=>{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}))})),e.commands.addCommand(n.launchFile,{label:l.__("Open the tooltip"),execute:async()=>{const e=t.currentWidget,n=e&&s[e.id]&&s[e.id].kernel;if(!n)return;const r=e.content,l=null==r?void 0:r.editor;return l&&n&&i?o.invoke({anchor:r,editor:l,kernel:n,rendermime:i}):void 0}})}},b=[m,h,v,k];var T;!function(e){let o=0;e.fetch=function(e){const{detail:t,editor:n,kernel:i}=e,l=n.model.sharedModel.getSource(),s=n.getCursorPosition(),a=r.Text.jsIndexToCharIndex(n.getOffsetAt(s),l);if(!l||!i)return Promise.reject(void 0);const d={code:l,cursor_pos:a,detail_level:t||0},c=++o;return i.requestInspect(d).then((e=>{const t=e.content;return c!==o?Promise.reject(void 0):"ok"===t.status&&t.found?Promise.resolve(t.data):Promise.reject(void 0)}))}}(T||(T={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6604,2088],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(67260),r=t(68722),l=t(34663),s=t(25460),a=t(81221),d=t(27865),c=t(12030),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([[6621],{78947:(e,t,s)=>{s.d(t,{q:()=>Be});var i=s(68239);const r=1540483477,n=new TextEncoder;function o(e,t){const s=n.encode(e);let i=s.length,o=t^i,a=0;for(;i>=4;){let e=255&s[a]|(255&s[++a])<<8|(255&s[++a])<<16|(255&s[++a])<<24;e=(65535&e)*r+(((e>>>16)*r&65535)<<16),e^=e>>>24,e=(65535&e)*r+(((e>>>16)*r&65535)<<16),o=(65535&o)*r+(((o>>>16)*r&65535)<<16)^e,i-=4,++a}switch(i){case 3:o^=(255&s[a+2])<<16;case 2:o^=(255&s[a+1])<<8;case 1:o^=255&s[a],o=(65535&o)*r+(((o>>>16)*r&65535)<<16)}return o^=o>>>13,o=(65535&o)*r+(((o>>>16)*r&65535)<<16),o^=o>>>15,o>>>0}class a{constructor(){this._fileParams=new Map,this._hashMethods=new Map}getCodeId(e,t){const s=this._fileParams.get(t);if(!s)throw new Error(`Kernel (${t}) has no tmp file params.`);const i=this._hashMethods.get(t);if(!i)throw new Error(`Kernel (${t}) has no hashing params.`);const{prefix:r,suffix:n}=s;return`${r}${i(e)}${n}`}setHashParams(e){const{kernel:t,method:s,seed:i}=e;if(!t)throw new TypeError("Kernel name is not defined.");if("Murmur2"!==s)throw new Error(`Hash method (${s}) is not supported.`);this._hashMethods.set(t,(e=>o(e,i).toString()))}setTmpFileParams(e){const{kernel:t,prefix:s,suffix:i}=e;if(!t)throw new TypeError("Kernel name is not defined.");this._fileParams.set(t,{kernel:t,prefix:s,suffix:i})}getTmpFileParams(e){return this._fileParams.get(e)}}var l,d=s(12982),c=s(24912),h=s(31516);!function(e){e.getCode=function(e){return new u({...e,body:new p(e),buttons:[d.Dialog.cancelButton({label:e.cancelLabel}),d.Dialog.okButton({label:e.okLabel})]}).launch()}}(l||(l={}));class u extends d.Dialog{handleEvent(e){if("keydown"===e.type){const t=e,{code:s,shiftKey:i}=t;if(i&&"Enter"===s)return this.resolve();if("Enter"===s)return}super.handleEvent(e)}}class p extends h.Widget{constructor(e){super();const{contentFactory:t,rendermime:s,mimeType:i}=e,r=new c.CodeCellModel;r.mimeType=null!=i?i:"",this._prompt=new c.CodeCell({contentFactory:t,rendermime:s,model:r,placeholder:!1}).initializeState(),this._prompt.inputArea.promptNode.remove(),this.node.appendChild(this._prompt.node)}getValue(){return this._prompt.model.sharedModel.getSource()}onAfterAttach(e){super.onAfterAttach(e),this._prompt.activate()}}var g=s(31536);class _{constructor(e){this._services=e.editorServices}createNewEditor(e){const{content:t,mimeType:s,path:i}=e,r=this._services.factoryService.newInlineEditor,n=this._services.mimeTypeService,o=new g.CodeEditor.Model({mimeType:s||n.getMimeTypeByFilePath(i)});o.sharedModel.source=t;const a=new g.CodeEditorWrapper({editorOptions:{config:{readOnly:!0,lineNumbers:!0}},model:o,factory:r});return a.node.setAttribute("data-jp-debugger","true"),a.disposed.connect((()=>{o.dispose()})),a}}var m,v=s(71677),b=s(11351),f=s(81997),w=s(38639),k=s(17811),S=s(30890);class C{constructor(e){var t,s,i,r;this._src=e.src,this._id=null!==(i=null===(s=null===(t=e.debuggerService.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.id)&&void 0!==i?i:"",this._path=null!==(r=e.path)&&void 0!==r?r:"",this._debuggerService=e.debuggerService,this._editor=e.getEditor,this._editorMonitor=new w.ActivityMonitor({signal:this._src.changed,timeout:1e3}),this._editorMonitor.activityStopped.connect((()=>{this._sendEditorBreakpoints()}),this),this._debuggerService.model.breakpoints.changed.connect((async()=>{const e=this.editor;e&&!e.isDisposed&&this._addBreakpointsToEditor()})),this._debuggerService.model.breakpoints.restored.connect((async()=>{const e=this.editor;e&&!e.isDisposed&&this._addBreakpointsToEditor()})),this._debuggerService.model.callstack.currentFrameChanged.connect((()=>{const e=this.editor;e&&C.clearHighlight(e)})),this._breakpointEffect=k.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})}),this._breakpointState=k.StateField.define({create:()=>k.RangeSet.empty,update:(e,t)=>{e=e.map(t.changes);for(let s of t.effects)if(s.is(this._breakpointEffect)){let t=s;e=t.value.pos.length?e.update({add:t.value.pos.map((e=>m.breakpointMarker.range(e))),sort:!0}):k.RangeSet.empty}return e}}),this._gutter=new k.Compartment,this._highlightDeco=S.Decoration.line({class:"jp-DebuggerEditor-highlight"}),this._highlightState=k.StateField.define({create:()=>S.Decoration.none,update:(e,t)=>{e=e.map(t.changes);for(let s of t.effects)if(s.is(C._highlightEffect)){let t=s;e=t.value.pos.length?e.update({add:t.value.pos.map((e=>this._highlightDeco.range(e)))}):S.Decoration.none}return e},provide:e=>S.EditorView.decorations.from(e)}),e.editorReady().then((()=>{this._setupEditor()}))}get editor(){return this._editor()}dispose(){this.isDisposed||(this._editorMonitor.dispose(),this._clearEditor(),this.isDisposed=!0,f.Signal.clearData(this))}refreshBreakpoints(){this._addBreakpointsToEditor()}_setupEditor(){const e=this.editor;if(!e||e.isDisposed)return;e.setOption("lineNumbers",!0);const t=[this._breakpointState,this._highlightState,k.Prec.highest((0,S.gutter)({class:"cm-breakpoint-gutter",renderEmptyElements:!0,markers:e=>e.state.field(this._breakpointState),initialSpacer:()=>m.breakpointMarker,domEventHandlers:{mousedown:(e,t)=>(this._onGutterClick(e,t.from),!0)}}))];e.injectExtension(this._gutter.of(t)),this._addBreakpointsToEditor()}_clearEditor(){const e=this.editor;e&&!e.isDisposed&&(C.clearHighlight(e),this._clearGutter(e),e.setOption("lineNumbers",!1),e.editor.dispatch({effects:this._gutter.reconfigure([])}))}_sendEditorBreakpoints(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.isDisposed)return;const t=this._getBreakpointsFromEditor().map((e=>{var t,s;return m.createBreakpoint((null===(s=null===(t=this._debuggerService.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.name)||"",e)}));this._debuggerService.updateBreakpoints(this._src.getSource(),t,this._path)}_onGutterClick(e,t){var s,i,r;if(this._id!==(null===(i=null===(s=this._debuggerService.session)||void 0===s?void 0:s.connection)||void 0===i?void 0:i.id))return;const n=e.state.doc.lineAt(t).number;let o=e.state.field(this._breakpointState),a=!1;o.between(t,t,(()=>{a=!0}));let l=this._getBreakpoints();a?l=l.filter((e=>e.line!==n)):l.push(m.createBreakpoint(null!==(r=this._path)&&void 0!==r?r:this._debuggerService.session.connection.name,n)),l.sort(((e,t)=>e.line-t.line)),this._debuggerService.updateBreakpoints(this._src.getSource(),l,this._path)}_addBreakpointsToEditor(){var e,t;if(this._id!==(null===(t=null===(e=this._debuggerService.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.id))return;const s=this.editor,i=this._getBreakpoints();this._clearGutter(s);const r=i.map((e=>s.state.doc.line(e.line).from));s.editor.dispatch({effects:this._breakpointEffect.of({pos:r})})}_getBreakpointsFromEditor(){const e=this.editor,t=e.editor.state.field(this._breakpointState);let s=[];return t.between(0,e.doc.length,(t=>{s.push(e.doc.lineAt(t).number)})),s}_clearGutter(e){e&&e.editor.dispatch({effects:this._breakpointEffect.of({pos:[]})})}_getBreakpoints(){const e=this._src.getSource();return this._debuggerService.model.breakpoints.getBreakpoints(this._path||this._debuggerService.getCodeId(e))}}!function(e){function t(t){t&&!t.isDisposed&&t.editor.dispatch({effects:e._highlightEffect.of({pos:[]})})}e._highlightEffect=k.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})}),e.showCurrentLine=function(s,i){t(s);const r=s,n=r.doc.line(i).from;r.editor.dispatch({effects:e._highlightEffect.of({pos:[n]})})},e.clearHighlight=t}(C||(C={})),function(e){e.breakpointMarker=new class extends S.GutterMarker{toDOM(){return document.createTextNode("●")}},e.createBreakpoint=function(e,t){return{line:t,verified:!0,source:{name:e}}}}(m||(m={}));class y{constructor(e){this._debuggerService=e.debuggerService,this._consolePanel=e.widget,this._cellMap=new b.ObservableMap;const t=this._consolePanel.console;t.promptCell&&this._addEditorHandler(t.promptCell),t.promptCellCreated.connect(((e,t)=>{this._addEditorHandler(t)}));const s=()=>{for(const e of t.cells)this._addEditorHandler(e)};s(),this._consolePanel.console.cells.changed.connect(s)}dispose(){this.isDisposed||(this.isDisposed=!0,this._cellMap.values().forEach((e=>e.dispose())),this._cellMap.dispose(),f.Signal.clearData(this))}_addEditorHandler(e){const t=e.model.id;if("code"!==e.model.type||this._cellMap.has(t))return;const s=e,i=new C({debuggerService:this._debuggerService,editorReady:async()=>(await s.ready,s.editor),getEditor:()=>s.editor,src:e.model.sharedModel});s.disposed.connect((()=>{this._cellMap.delete(t),i.dispose()})),this._cellMap.set(t,i)}}class E{constructor(e){var t;this._debuggerService=e.debuggerService,this._fileEditor=e.widget.content,this._hasLineNumber=null!==(t=this._fileEditor.editor.getOption("lineNumbers"))&&void 0!==t&&t,this._editorHandler=new C({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._fileEditor.editor),getEditor:()=>this._fileEditor.editor,src:this._fileEditor.model.sharedModel})}dispose(){var e,t;this.isDisposed||(this.isDisposed=!0,null===(e=this._editorHandler)||void 0===e||e.dispose(),null===(t=this._editorHandler)||void 0===t||t.editor.setOptions({lineNumbers:this._hasLineNumber}),f.Signal.clearData(this))}}class x{constructor(e){this._debuggerService=e.debuggerService,this._notebookPanel=e.widget,this._cellMap=new b.ObservableMap,this._notebookPanel.content.model.cells.changed.connect(this._onCellsChanged,this),this._onCellsChanged()}dispose(){this.isDisposed||(this.isDisposed=!0,this._cellMap.values().forEach((e=>{var t;e.dispose(),null===(t=e.editor)||void 0===t||t.setOptions({...this._notebookPanel.content.editorConfig.code})})),this._cellMap.dispose(),f.Signal.clearData(this))}_onCellsChanged(e,t){var s;if(this._notebookPanel.content.widgets.forEach((e=>this._addEditorHandler(e))),"move"===(null==t?void 0:t.type))for(const e of t.newValues)null===(s=this._cellMap.get(e.id))||void 0===s||s.refreshBreakpoints()}_addEditorHandler(e){const t=e.model.id;if("code"!==e.model.type||this._cellMap.has(t))return;const s=e,i=new C({debuggerService:this._debuggerService,editorReady:async()=>(await s.ready,s.editor),getEditor:()=>s.editor,src:e.model.sharedModel});s.disposed.connect((()=>{this._cellMap.delete(t),i.dispose()})),this._cellMap.set(e.model.id,i)}}const M="debugger-icon";function D(e,t,s=!0,i){e&&(e.enabled=s,e.pressed=t,i&&(e.onClick=i))}class T{constructor(e){this._handlers={},this._contextKernelChangedHandlers={},this._kernelChangedHandlers={},this._statusChangedHandlers={},this._iopubMessageHandlers={},this._iconButtons={},this._type=e.type,this._shell=e.shell,this._service=e.service}get activeWidget(){return this._activeWidget}async update(e,t){if(!t)return delete this._kernelChangedHandlers[e.id],delete this._statusChangedHandlers[e.id],delete this._iopubMessageHandlers[e.id],this.updateWidget(e,t);const s=()=>{this.updateWidget(e,t)},i=this._kernelChangedHandlers[e.id];i&&t.kernelChanged.disconnect(i),this._kernelChangedHandlers[e.id]=s,t.kernelChanged.connect(s);const r=(s,i)=>{i.endsWith("restarting")&&this.updateWidget(e,t)},n=this._statusChangedHandlers[e.id];n&&t.statusChanged.disconnect(n),t.statusChanged.connect(r),this._statusChangedHandlers[e.id]=r;const o=(e,t)=>{"execute_request"==t.parent_header.msg_type&&this._service.isStarted&&!this._service.hasStoppedThreads()&&this._service.displayDefinedVariables()},a=this._iopubMessageHandlers[e.id];return a&&t.iopubMessage.disconnect(a),t.iopubMessage.connect(o),this._iopubMessageHandlers[e.id]=o,this._activeWidget=e,this.updateWidget(e,t)}async updateContext(e,t){const s=()=>{const{session:s}=t;this.update(e,s)},i=this._contextKernelChangedHandlers[e.id];return i&&t.kernelChanged.disconnect(i),this._contextKernelChangedHandlers[e.id]=s,t.kernelChanged.connect(s),this.update(e,t.session)}async updateWidget(e,t){var s,r,n,o;if(!this._service.model||!t)return;const a=()=>this._shell.currentWidget===e,l=()=>{this._handlers[e.id]?e.node.setAttribute("data-jp-debugger","true"):e.node.removeAttribute("data-jp-debugger")},d=()=>{if(!this._handlers[e.id]){switch(this._type){case"notebook":this._handlers[e.id]=new x({debuggerService:this._service,widget:e});break;case"console":this._handlers[e.id]=new y({debuggerService:this._service,widget:e});break;case"file":this._handlers[e.id]=new E({debuggerService:this._service,widget:e});break;default:throw Error(`No handler for the type ${this._type}`)}l()}},c=()=>{var s,i,r,n;const o=this._handlers[e.id];o&&(o.dispose(),delete this._handlers[e.id],delete this._kernelChangedHandlers[e.id],delete this._statusChangedHandlers[e.id],delete this._iopubMessageHandlers[e.id],delete this._contextKernelChangedHandlers[e.id],(null===(i=null===(s=this._service.session)||void 0===s?void 0:s.connection)||void 0===i?void 0:i.path)!==(null==t?void 0:t.path)&&(null===(n=null===(r=this._service.session)||void 0===r?void 0:r.connection)||void 0===n?void 0:n.kernel)||this._service.model.clear(),l())},h=()=>{var e;return this._service.isStarted&&(null===(e=this._previousConnection)||void 0===e?void 0:e.id)===(null==t?void 0:t.id)},u=async()=>{this._service.session.connection=t,await this._service.stop()},p=async()=>{var e,s;this._service.session.connection=t,this._previousConnection=t,await this._service.restoreState(!0),await this._service.displayDefinedVariables(),(null===(s=null===(e=this._service.session)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.supportsModulesRequest)&&await this._service.displayModules()},g=async()=>{if(!a())return;const t=this._iconButtons[e.id];h()?(await u(),c(),D(t,!1)):(await p(),d(),D(t,!0))};return((t=!0)=>{const s=this._iconButtons[e.id];s?D(s,this._service.isStarted,t,g):this._iconButtons[e.id]=function(e,t,s,r,n=v.nullTranslator){const o=n.load("jupyterlab"),a=new i.ToolbarButton({className:"jp-DebuggerBugButton",icon:i.bugIcon,tooltip:o.__("Enable Debugger"),pressedIcon:i.bugDotIcon,pressedTooltip:o.__("Disable Debugger"),disabledTooltip:o.__("Select a kernel that supports debugging to enable debugger"),enabled:s,pressed:r,onClick:t});return e.toolbar.insertBefore("kernelName",M,a)||e.toolbar.addItem(M,a),a}(e,g,this._service.isStarted,t)})(!1),e.disposed.connect((async()=>{h()&&await u(),c(),delete this._iconButtons[e.id],delete this._contextKernelChangedHandlers[e.id]})),await this._service.isAvailable(t)?(this._service.session?(this._previousConnection=(null===(s=this._service.session.connection)||void 0===s?void 0:s.kernel)?this._service.session.connection:null,this._service.session.connection=t):this._service.session=new Be.Session({connection:t,config:this._service.config}),await this._service.restoreState(!1),this._service.isStarted&&!this._service.hasStoppedThreads()&&(await this._service.displayDefinedVariables(),(null===(n=null===(r=this._service.session)||void 0===r?void 0:r.capabilities)||void 0===n?void 0:n.supportsModulesRequest)&&await this._service.displayModules()),D(this._iconButtons[e.id],this._service.isStarted,!0),this._service.isStarted?(d(),void(this._previousConnection=t)):(c(),this._service.session.connection=null!==(o=this._previousConnection)&&void 0!==o?o:t,void await this._service.restoreState(!1))):(c(),void D(this._iconButtons[e.id],!1,!1))}}const I=new i.LabIcon({name:"debugger:close-all",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M16.4805 17.2481C16.8158 16.3972 17 15.4701 17 14.5C17 10.3579 13.6421 7.00001 9.5 7.00001C8.36314 7.00001 7.28536 7.25295 6.31986 7.70564C7.60064 6.0592 9.60074 5 11.8482 5C15.7142 5 18.8482 8.13401 18.8482 12C18.8482 14.0897 17.9325 15.9655 16.4805 17.2481Z" />\n <path d="M19.1607 14.2481C19.496 13.3971 19.6801 12.4701 19.6801 11.5C19.6801 7.35786 16.3223 4 12.1801 4C11.0433 4 9.9655 4.25295 9.00001 4.70563C10.2808 3.05919 12.2809 2 14.5284 2C18.3944 2 21.5284 5.134 21.5284 9C21.5284 11.0897 20.6127 12.9655 19.1607 14.2481Z" />\n <path d="M16 15C16 18.866 12.866 22 9 22C5.13401 22 2 18.866 2 15C2 11.134 5.13401 8 9 8C12.866 8 16 11.134 16 15ZM11.7914 11L13 12.2086L10.2086 15L13 17.7914L11.7914 19L9 16.2086L6.20857 19L5 17.7914L7.79143 15L5 12.2086L6.20857 11L9 13.7914L11.7914 11Z" />\n </g>\n</svg>\n'}),V=new i.LabIcon({name:"debugger:pause-on-exception",svgstr:'<svg height="24" width="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161" transform="matrix(1.1999396,0,0,1.3858273,-2.3726971,-4.6347192)">\n <path\n d="M 12.023438,0.30859375 11.158203,1.8085937 -1.2382812,23.285156 l 26.5292972,-0.002 z m 0.002,3.99999995 9.800781,16.9746093 -19.6015626,0.002 z"\n transform="matrix(0.72509832,0,0,0.7247701,3.2918397,3.480876)"\n />\n <path d="m 11.144475,9.117095 h 1.666751 v 7.215906 h -1.666751 z" />\n <path d="m 11.144475,17.054592 h 1.666751 v 1.443181 h -1.666751 z" />\n </g>\n</svg>\n'}),B=new i.LabIcon({name:"debugger:pause",svgstr:'<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="m 7,6 h 4 V 18 H 7 Z" />\n <path d="m 13,6 h 4 v 12 h -4 z" />\n </g>\n</svg>\n'}),H=new i.LabIcon({name:"debugger:step-into",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M7.99998 9.53198H8.54198L12.447 5.62698L11.386 4.56698L8.74898 7.17698L8.74898 0.999985H7.99998H7.25098L7.25098 7.17698L4.61398 4.56698L3.55298 5.62698L7.45798 9.53198H7.99998ZM9.95598 13.013C9.95598 14.1175 9.06055 15.013 7.95598 15.013C6.85141 15.013 5.95598 14.1175 5.95598 13.013C5.95598 11.9084 6.85141 11.013 7.95598 11.013C9.06055 11.013 9.95598 11.9084 9.95598 13.013Z"/>\n\t</g>\n</svg>\n'}),R=new i.LabIcon({name:"debugger:step-over",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M14.25 5.75V1.75H12.75V4.2916C11.605 2.93303 9.83899 2.08334 7.90914 2.08334C4.73316 2.08334 1.98941 4.39036 1.75072 7.48075L1.72992 7.75H3.231L3.25287 7.5241C3.46541 5.32932 5.45509 3.58334 7.90914 3.58334C9.6452 3.58334 11.1528 4.45925 11.9587 5.75H9.12986V7.25H13.292L14.2535 6.27493V5.75H14.25ZM7.99997 14C9.10454 14 9.99997 13.1046 9.99997 12C9.99997 10.8954 9.10454 10 7.99997 10C6.8954 10 5.99997 10.8954 5.99997 12C5.99997 13.1046 6.8954 14 7.99997 14Z"/>\n\t</g>\n</svg>\n'}),j=new i.LabIcon({name:"debugger:step-out",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M7.99998 1H7.45798L3.55298 4.905L4.61398 5.965L7.25098 3.355V9.532H7.99998H8.74898V3.355L11.386 5.965L12.447 4.905L8.54198 1H7.99998ZM9.95598 13.013C9.95598 14.1176 9.06055 15.013 7.95598 15.013C6.85141 15.013 5.95598 14.1176 5.95598 13.013C5.95598 11.9084 6.85141 11.013 7.95598 11.013C9.06055 11.013 9.95598 11.9084 9.95598 13.013Z"/>\n\t</g>\n</svg>\n'}),F=new i.LabIcon({name:"debugger:variable",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 4L1 4.5V12.5L1.5 13H4V12H2V5H4V4H1.5ZM14.5 13L15 12.5L15 4.5L14.5 4H12V5L14 5L14 12H12V13H14.5ZM8.79693 5L4.29693 7L4 7.45691V9.95691L4.24275 10.3857L6.74275 11.8857L7.20307 11.9138L11.7031 9.91381L12 9.45691V6.95691L11.7572 6.52816L9.25725 5.02816L8.79693 5ZM5 8.34V9.67381L6.5 10.5738V9.24L5 8.34ZM7.5 9.28184V10.6875L11 9.13197V7.72629L7.5 9.28184ZM10.4178 6.89071L8.96559 6.01936L5.58216 7.52311L7.03441 8.39445L10.4178 6.89071Z" fill="#007ACC"/>\n</svg>\n'}),L=new i.LabIcon({name:"debugger:view-breakpoint",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M5 2H15L20 7V20C20 20.5304 19.7893 21.0391 19.4142 21.4142C19.0391 21.7893 18.5304 22 18 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V14H4V16L8 13L4 10V12H3V4C3 3.46957 3.21071 2.96086 3.58579 2.58579C3.96086 2.21071 4.46957 2 5 2ZM12 18H16V16H12V18ZM12 14H18V12H12V14ZM12 10H18V8H12V10ZM10 14C10.5523 14 11 13.5523 11 13C11 12.4477 10.5523 12 10 12C9.44771 12 9 12.4477 9 13C9 13.5523 9.44771 14 10 14Z"/>\n <path d="M3 12V14H1V13V12H3Z"/>\n </g>\n</svg>\n'}),P=new i.LabIcon({name:"debugger:open-kernel-source",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M5 2H15L20 7V20C20 20.5304 19.7893 21.0391 19.4142 21.4142C19.0391 21.7893 18.5304 22 18 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V14H4V16L8 13L4 10V12H3V4C3 3.46957 3.21071 2.96086 3.58579 2.58579C3.96086 2.21071 4.46957 2 5 2ZM12 18H16V16H12V18ZM12 14H18V12H12V14ZM12 10H18V8H12V10ZM10 14C10.5523 14 11 13.5523 11 13C11 12.4477 10.5523 12 10 12C9.44771 12 9 12.4477 9 13C9 13.5523 9.44771 14 10 14Z"/>\n <path d="M3 12V14H1V13V12H3Z"/>\n </g>\n</svg>\n'});class O{constructor(){this._breakpoints=new Map,this._changed=new f.Signal(this),this._restored=new f.Signal(this),this._clicked=new f.Signal(this)}get changed(){return this._changed}get restored(){return this._restored}get clicked(){return this._clicked}get breakpoints(){return this._breakpoints}setBreakpoints(e,t){this._breakpoints.set(e,t),this._changed.emit(t)}getBreakpoints(e){var t;return null!==(t=this._breakpoints.get(e))&&void 0!==t?t:[]}restoreBreakpoints(e){this._breakpoints=e,this._restored.emit()}}class N{constructor(){this._state=[],this._currentFrame=null,this._framesChanged=new f.Signal(this),this._currentFrameChanged=new f.Signal(this)}get frames(){return this._state}set frames(e){this._state=e;const t=null!==this.frame?A.getFrameId(this.frame):"";e.find((e=>A.getFrameId(e)===t))||(this.frame=e[0]),this._framesChanged.emit(e)}get frame(){return this._currentFrame}set frame(e){this._currentFrame=e,this._currentFrameChanged.emit(e)}get framesChanged(){return this._framesChanged}get currentFrameChanged(){return this._currentFrameChanged}}var A;!function(e){e.getFrameId=function(e){var t;return`${null===(t=null==e?void 0:e.source)||void 0===t?void 0:t.path}-${null==e?void 0:e.id}`}}(A||(A={}));class q{constructor(e){this._currentSourceOpened=new f.Signal(this),this._currentSourceChanged=new f.Signal(this),this.currentFrameChanged=e.currentFrameChanged}get currentSourceOpened(){return this._currentSourceOpened}get currentSourceChanged(){return this._currentSourceChanged}get currentSource(){return this._currentSource}set currentSource(e){this._currentSource=e,this._currentSourceChanged.emit(e)}open(){this._currentSourceOpened.emit(this._currentSource)}}var W=s(97934);const Z=(e,t)=>e.name<t.name?-1:e.name>t.name?1:0;class K{constructor(){this._filteredKernelSources=null,this._filter="",this._isDisposed=!1,this._kernelSources=null,this._changed=new f.Signal(this),this._filterChanged=new f.Signal(this),this._kernelSourceOpened=new f.Signal(this),this.refresh=this.refresh.bind(this),this._refreshDebouncer=new W.Debouncer(this.refresh,500)}get filter(){return this._filter}set filter(e){this._filter=e,this._filterChanged.emit(e),this._refreshDebouncer.invoke()}get isDisposed(){return this._isDisposed}get kernelSources(){return this._kernelSources}set kernelSources(e){this._kernelSources=e,this.refresh()}get changed(){return this._changed}get filterChanged(){return this._filterChanged}get kernelSourceOpened(){return this._kernelSourceOpened}dispose(){this._isDisposed||(this._isDisposed=!0,this._refreshDebouncer.dispose(),f.Signal.clearData(this))}open(e){this._kernelSourceOpened.emit(e)}getFilteredKernelSources(){const e=new RegExp(this._filter);return this._kernelSources.filter((t=>e.test(t.name)))}refresh(){this._kernelSources?(this._filteredKernelSources=this._filter?this.getFilteredKernelSources():this._kernelSources,this._filteredKernelSources.sort(Z)):(this._kernelSources=new Array,this._filteredKernelSources=new Array),this._changed.emit(this._filteredKernelSources)}}class G{constructor(){this._selectedVariable=null,this._state=[],this._variableExpanded=new f.Signal(this),this._changed=new f.Signal(this)}get scopes(){return this._state}set scopes(e){this._state=e,this._changed.emit()}get changed(){return this._changed}get variableExpanded(){return this._variableExpanded}get selectedVariable(){return this._selectedVariable}set selectedVariable(e){this._selectedVariable=e}expandVariable(e){this._variableExpanded.emit(e)}}class z{constructor(){this._disposed=new f.Signal(this),this._isDisposed=!1,this._hasRichVariableRendering=!1,this._supportCopyToGlobals=!1,this._stoppedThreads=new Set,this._title="-",this._titleChanged=new f.Signal(this),this.breakpoints=new O,this.callstack=new N,this.variables=new G,this.sources=new q({currentFrameChanged:this.callstack.currentFrameChanged}),this.kernelSources=new K}get disposed(){return this._disposed}get hasRichVariableRendering(){return this._hasRichVariableRendering}set hasRichVariableRendering(e){this._hasRichVariableRendering=e}get supportCopyToGlobals(){return this._supportCopyToGlobals}set supportCopyToGlobals(e){this._supportCopyToGlobals=e}get isDisposed(){return this._isDisposed}get stoppedThreads(){return this._stoppedThreads}set stoppedThreads(e){this._stoppedThreads=e}get title(){return this._title}set title(e){e!==this._title&&(this._title=null!=e?e:"-",this._titleChanged.emit(e))}get titleChanged(){return this._titleChanged}dispose(){this._isDisposed||(this._isDisposed=!0,this.kernelSources.dispose(),this._disposed.emit())}clear(){this._stoppedThreads.clear();const e=new Map;this.breakpoints.restoreBreakpoints(e),this.callstack.frames=[],this.variables.scopes=[],this.sources.currentSource=null,this.kernelSources.kernelSources=null,this.title="-"}}class $ extends h.Panel{constructor(e){super(),this._filter=new Set,this._grid=null,this._pending=null,this.commands=e.commands,this.model=e.model,this.themeManager=e.themeManager,this.translator=e.translator,this.model.changed.connect((()=>this.update()),this),this.addClass("jp-DebuggerVariables-body")}get filter(){return this._filter}set filter(e){this._filter=e,this.update()}get scope(){return this._scope}set scope(e){this._scope=e,"Globals"!==e?this.addClass("jp-debuggerVariables-local"):this.removeClass("jp-debuggerVariables-local"),this.update()}async initialize(){if(this._grid||this._pending)return;const{Grid:e}=await(this._pending=Promise.all([s.e(5585),s.e(1958)]).then(s.bind(s,31958))),{commands:t,model:i,themeManager:r,translator:n}=this;this._grid=new e({commands:t,model:i,themeManager:r,translator:n}),this._grid.addClass("jp-DebuggerVariables-grid"),this._pending=null,this.addWidget(this._grid),this.update()}onBeforeShow(e){this._grid||this._pending||this.initialize(),super.onBeforeShow(e)}onUpdateRequest(e){var t;if(this._grid){const{dataModel:e}=this._grid;e.filter=this._filter,e.scope=this._scope,e.setData(null!==(t=this.model.scopes)&&void 0!==t?t:[])}super.onUpdateRequest(e)}}var U=s(70856),J=s(20998);class Y extends d.MainAreaWidget{constructor(e){const{dataLoader:t,rendermime:s,translator:i}=e,r=new h.Panel,n=new J.PromiseDelegate;super({content:r,reveal:Promise.all([t,n.promise])}),this.content.addClass("jp-VariableRendererPanel"),this.trans=(null!=i?i:v.nullTranslator).load("jupyterlab"),this.dataLoader=t,this.renderMime=s,this._dataHash=null,this.refresh().then((()=>{n.resolve()})).catch((e=>n.reject(e)))}async refresh(e=!1){let t=await this.dataLoader();if(0===Object.keys(t.data).length&&(t={data:{"text/plain":this.trans.__("The variable is undefined in the active context.")},metadata:{}}),!t.data)return this._dataHash=null,Promise.reject("Unable to get a view on the variable.");{const s=o(JSON.stringify(t),17);if(e||this._dataHash!==s){this.content.layout&&this.content.widgets.forEach((e=>{this.content.layout.removeWidget(e)}));const e=this.renderMime.preferredMimeType(t.data,"any");if(!e)return this._dataHash=null,Promise.reject("Unable to determine the preferred mime type.");{const i=this.renderMime.createRenderer(e);i.addClass("jp-VariableRendererPanel-renderer");const r=new U.MimeModel({...t,trusted:!0});this._dataHash=s,await i.renderModel(r),this.content.addWidget(i)}}}}}class Q{constructor(e){var t,s;this._eventMessage=new f.Signal(this),this._isDisposed=!1,this._sessionChanged=new f.Signal(this),this._pauseOnExceptionChanged=new f.Signal(this),this._config=e.config,this._session=null,this._specsManager=null!==(t=e.specsManager)&&void 0!==t?t:null,this._model=new Be.Model,this._debuggerSources=null!==(s=e.debuggerSources)&&void 0!==s?s:null,this._trans=(e.translator||v.nullTranslator).load("jupyterlab")}get eventMessage(){return this._eventMessage}get config(){return this._config}get isDisposed(){return this._isDisposed}get isStarted(){var e,t;return null!==(t=null===(e=this._session)||void 0===e?void 0:e.isStarted)&&void 0!==t&&t}get pauseOnExceptionChanged(){return this._pauseOnExceptionChanged}get model(){return this._model}get session(){return this._session}set session(e){var t;this._session!==e&&(this._session&&this._session.dispose(),this._session=e,null===(t=this._session)||void 0===t||t.eventMessage.connect(((e,t)=>{"stopped"===t.event?(this._model.stoppedThreads.add(t.body.threadId),this._getAllFrames()):"continued"===t.event&&(this._model.stoppedThreads.delete(t.body.threadId),this._clearModel(),this._clearSignals()),this._eventMessage.emit(t)})),this._sessionChanged.emit(e))}get sessionChanged(){return this._sessionChanged}dispose(){this.isDisposed||(this._isDisposed=!0,f.Signal.clearData(this))}getCodeId(e){var t,s,i,r;try{return this._config.getCodeId(e,null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"")}catch(e){return""}}hasStoppedThreads(){var e,t;return null!==(t=(null===(e=this._model)||void 0===e?void 0:e.stoppedThreads.size)>0)&&void 0!==t&&t}async isAvailable(e){var t,s,i,r;if(!this._specsManager)return!0;await this._specsManager.ready;const n=null==e?void 0:e.kernel;if(!n)return!1;const o=n.name;return!(null===(t=this._specsManager.specs)||void 0===t?void 0:t.kernelspecs[o])||!(null===(r=null===(i=null===(s=this._specsManager.specs.kernelspecs[o])||void 0===s?void 0:s.metadata)||void 0===i?void 0:i.debugger)||void 0===r||!r)}async clearBreakpoints(){var e;if(!0!==(null===(e=this.session)||void 0===e?void 0:e.isStarted))return;this._model.breakpoints.breakpoints.forEach(((e,t,s)=>{this._setBreakpoints([],t)}));let t=new Map;this._model.breakpoints.restoreBreakpoints(t)}async continue(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("continue",{threadId:this._currentThread()}),this._model.stoppedThreads.delete(this._currentThread()),this._clearModel(),this._clearSignals()}catch(e){console.error("Error:",e.message)}}async getSource(e){var t,s;if(!this.session)throw new Error("No active debugger session");return{...(await this.session.sendRequest("source",{source:e,sourceReference:null!==(t=e.sourceReference)&&void 0!==t?t:0})).body,path:null!==(s=e.path)&&void 0!==s?s:""}}async evaluate(e){var t;if(!this.session)throw new Error("No active debugger session");const s=null===(t=this.model.callstack.frame)||void 0===t?void 0:t.id,i=await this.session.sendRequest("evaluate",{context:"repl",expression:e,frameId:s});return i.success?(this._clearModel(),await this._getAllFrames(),i.body):null}async next(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("next",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async inspectRichVariable(e,t){if(!this.session)throw new Error("No active debugger session");const s=await this.session.sendRequest("richInspectVariables",{variableName:e,frameId:t});if(s.success)return s.body;throw new Error(s.message)}async inspectVariable(e){if(!this.session)throw new Error("No active debugger session");const t=await this.session.sendRequest("variables",{variablesReference:e});if(t.success)return t.body.variables;throw new Error(t.message)}async copyToGlobals(e){if(!this.session)throw new Error("No active debugger session");if(!this.model.supportCopyToGlobals)throw new Error('The "copyToGlobals" request is not supported by the kernel');const t=this.model.callstack.frames;this.session.sendRequest("copyToGlobals",{srcVariableName:e,dstVariableName:e,srcFrameId:t[0].id}).then((async()=>{const e=await this._getScopes(t[0]),s=await Promise.all(e.map((e=>this._getVariables(e)))),i=this._convertScopes(e,s);this._model.variables.scopes=i})).catch((e=>{console.error(e)}))}async displayDefinedVariables(){if(!this.session)throw new Error("No active debugger session");const e=(await this.session.sendRequest("inspectVariables",{})).body.variables,t=[{name:this._trans.__("Globals"),variables:e}];this._model.variables.scopes=t}async displayModules(){if(!this.session)throw new Error("No active debugger session");const e=await this.session.sendRequest("modules",{});this._model.kernelSources.kernelSources=e.body.modules.map((e=>({name:e.name,path:e.path})))}async restart(){const{breakpoints:e}=this._model.breakpoints;await this.stop(),await this.start(),await this._restoreBreakpoints(e)}async restoreState(e){var t,s,i,r,n,o,a,l,d,c;if(!this.model||!this.session)return;const h=await this.session.restoreState(),{body:u}=h,p=this._mapBreakpoints(u.breakpoints),g=new Set(u.stoppedThreads);if(this._model.hasRichVariableRendering=!0===u.richRendering,this._model.supportCopyToGlobals=!0===u.copyToGlobals,this._config.setHashParams({kernel:null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",method:u.hashMethod,seed:u.hashSeed}),this._config.setTmpFileParams({kernel:null!==(l=null===(a=null===(o=null===(n=this.session)||void 0===n?void 0:n.connection)||void 0===o?void 0:o.kernel)||void 0===a?void 0:a.name)&&void 0!==l?l:"",prefix:u.tmpFilePrefix,suffix:u.tmpFileSuffix}),this._model.stoppedThreads=g,this.isStarted||!e&&0===g.size||await this.start(),(this.isStarted||e)&&(this._model.title=this.isStarted&&(null===(c=null===(d=this.session)||void 0===d?void 0:d.connection)||void 0===c?void 0:c.name)||"-"),this._debuggerSources){const e=this._filterBreakpoints(p);this._model.breakpoints.restoreBreakpoints(e)}else this._model.breakpoints.restoreBreakpoints(p);0!==g.size?await this._getAllFrames():this.isStarted&&(this._clearModel(),this._clearSignals()),this.session.currentExceptionFilters&&await this.pauseOnExceptions(this.session.currentExceptionFilters)}start(){if(!this.session)throw new Error("No active debugger session");return this.session.start()}async pause(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("pause",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepIn(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("stepIn",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepOut(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("stepOut",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stop(){if(!this.session)throw new Error("No active debugger session");await this.session.stop(),this._model&&this._model.clear()}async updateBreakpoints(e,t,s){var i;if(!(null===(i=this.session)||void 0===i?void 0:i.isStarted))return;s||(s=(await this._dumpCell(e)).body.sourcePath);const r=await this.session.restoreState(),n=t.filter((({line:e})=>"number"==typeof e)).map((({line:e})=>({line:e}))),o=this._mapBreakpoints(r.body.breakpoints);if(this._debuggerSources){const e=this._filterBreakpoints(o);this._model.breakpoints.restoreBreakpoints(e)}else this._model.breakpoints.restoreBreakpoints(o);let a=new Set;const l=(await this._setBreakpoints(n,s)).body.breakpoints.filter(((e,t,s)=>{const i=s.findIndex((t=>t.line===e.line))>-1,r=!a.has(e.line);return a.add(e.line),i&&r}));this._model.breakpoints.setBreakpoints(s,l),await this.session.sendRequest("configurationDone",{})}pauseOnExceptionsIsValid(){var e,t;return!(!this.isStarted||0===(null===(t=null===(e=this.session)||void 0===e?void 0:e.exceptionBreakpointFilters)||void 0===t?void 0:t.length))}async pauseOnExceptionsFilter(e){var t;if(!(null===(t=this.session)||void 0===t?void 0:t.isStarted))return;let s=this.session.currentExceptionFilters;if(this.session.isPausingOnException(e)){const t=s.indexOf(e);s.splice(t,1)}else null==s||s.push(e);await this.pauseOnExceptions(s)}async pauseOnExceptions(e){var t,s;if(!(null===(t=this.session)||void 0===t?void 0:t.isStarted))return;const i=(null===(s=this.session.exceptionBreakpointFilters)||void 0===s?void 0:s.map((e=>e.filter)))||[];let r={filters:[]};e.forEach((e=>{i.includes(e)&&r.filters.push(e)})),this.session.currentExceptionFilters=r.filters,await this.session.sendRequest("setExceptionBreakpoints",r),this._pauseOnExceptionChanged.emit()}getDebuggerState(){var e,t,s,i,r,n,o;const a=this._model.breakpoints.breakpoints;let l=[];if(this._debuggerSources)for(const d of a.keys()){const a=this._debuggerSources.find({focus:!1,kernel:null!==(i=null===(s=null===(t=null===(e=this.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.name)&&void 0!==i?i:"",path:null!==(o=null===(n=null===(r=this._session)||void 0===r?void 0:r.connection)||void 0===n?void 0:n.path)&&void 0!==o?o:"",source:d}).map((e=>e.src.getSource()));l=l.concat(a)}return{cells:l,breakpoints:a}}async restoreDebuggerState(e){var t,s,i,r;await this.start();for(const t of e.cells)await this._dumpCell(t);const n=new Map,o=null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",{prefix:a,suffix:l}=this._config.getTmpFileParams(o);for(const t of e.breakpoints){const[e,s]=t,i=e.substr(0,e.length-l.length),r=i.substr(i.lastIndexOf("/")+1),o=a.concat(r).concat(l);n.set(o,s)}await this._restoreBreakpoints(n);const d=await this.session.sendRequest("configurationDone",{});return await this.restoreState(!1),d.success}_clearModel(){this._model.callstack.frames=[],this._model.variables.scopes=[]}_clearSignals(){this._model.callstack.currentFrameChanged.disconnect(this._onCurrentFrameChanged,this),this._model.variables.variableExpanded.disconnect(this._onVariableExpanded,this)}_convertScopes(e,t){return t&&e?e.map(((e,s)=>({name:e.name,variables:t[s].map((e=>({...e})))}))):[]}_currentThread(){return 1}async _dumpCell(e){if(!this.session)throw new Error("No active debugger session");return this.session.sendRequest("dumpCell",{code:e})}_filterBreakpoints(e){if(!this._debuggerSources)return e;let t=new Map;for(const s of e){const[e,i]=s;i.forEach((()=>{var s,r,n,o,a,l,d;this._debuggerSources.find({focus:!1,kernel:null!==(o=null===(n=null===(r=null===(s=this.session)||void 0===s?void 0:s.connection)||void 0===r?void 0:r.kernel)||void 0===n?void 0:n.name)&&void 0!==o?o:"",path:null!==(d=null===(l=null===(a=this._session)||void 0===a?void 0:a.connection)||void 0===l?void 0:l.path)&&void 0!==d?d:"",source:e}).forEach((()=>{i.length>0&&t.set(e,i)}))}))}return t}async _getAllFrames(){this._model.callstack.currentFrameChanged.connect(this._onCurrentFrameChanged,this),this._model.variables.variableExpanded.connect(this._onVariableExpanded,this);const e=await this._getFrames(this._currentThread());this._model.callstack.frames=e}async _getFrames(e){if(!this.session)throw new Error("No active debugger session");return(await this.session.sendRequest("stackTrace",{threadId:e})).body.stackFrames}async _getScopes(e){if(!this.session)throw new Error("No active debugger session");return e?(await this.session.sendRequest("scopes",{frameId:e.id})).body.scopes:[]}async _getVariables(e){if(!this.session)throw new Error("No active debugger session");return e?(await this.session.sendRequest("variables",{variablesReference:e.variablesReference})).body.variables:[]}_mapBreakpoints(e){return e.length?e.reduce(((e,t)=>{const{breakpoints:s,source:i}=t;return e.set(i,s.map((e=>({...e,source:{path:i},verified:!0})))),e}),new Map):new Map}async _onCurrentFrameChanged(e,t){if(!t)return;const s=await this._getScopes(t),i=await Promise.all(s.map((e=>this._getVariables(e)))),r=this._convertScopes(s,i);this._model.variables.scopes=r}async _onVariableExpanded(e,t){if(!this.session)throw new Error("No active debugger session");const s=await this.session.sendRequest("variables",{variablesReference:t.variablesReference});let i={...t,expanded:!0};s.body.variables.forEach((e=>{i={[e.name]:e,...i}}));const r=this._model.variables.scopes.map((e=>{const s=e.variables.findIndex((e=>e.variablesReference===t.variablesReference));return e.variables[s]=i,{...e}}));return this._model.variables.scopes=[...r],s.body.variables}async _setBreakpoints(e,t){if(!this.session)throw new Error("No active debugger session");return await this.session.sendRequest("setBreakpoints",{breakpoints:e,source:{path:t},sourceModified:!1})}async _restoreBreakpoints(e){for(const[t,s]of e)await this._setBreakpoints(s.filter((({line:e})=>"number"==typeof e)).map((({line:e})=>({line:e}))),t);this._model.breakpoints.restoreBreakpoints(e)}}class X{constructor(e){this._seq=0,this._ready=new J.PromiseDelegate,this._isDisposed=!1,this._isStarted=!1,this._exceptionPaths=[],this._exceptionBreakpointFilters=[],this._currentExceptionFilters={},this._disposed=new f.Signal(this),this._eventMessage=new f.Signal(this),this.connection=e.connection,this._config=e.config,this.translator=e.translator||v.nullTranslator}get isDisposed(){return this._isDisposed}get capabilities(){return this._capabilities}get disposed(){return this._disposed}get connection(){return this._connection}set connection(e){var t,s;if(this._connection&&this._connection.iopubMessage.disconnect(this._handleEvent,this),this._connection=e,!this._connection)return void(this._isStarted=!1);this._connection.iopubMessage.connect(this._handleEvent,this),this._ready=new J.PromiseDelegate;const i=null===(s=null===(t=this.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.requestDebug({type:"request",seq:0,command:"debugInfo"});i&&(i.onReply=e=>{this._ready.resolve(),i.dispose()})}get isStarted(){return this._isStarted}get exceptionPaths(){return this._exceptionPaths}get exceptionBreakpointFilters(){return this._exceptionBreakpointFilters}get currentExceptionFilters(){var e,t,s;const i=null!==(s=null===(t=null===(e=this.connection)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==s?s:"";if(!i)return[];const r=this._config.getTmpFileParams(i);if(!r)return[];let n=r.prefix;return Object.keys(this._currentExceptionFilters).includes(n)?this._currentExceptionFilters[n]:[]}set currentExceptionFilters(e){var t,s,i;const r=null!==(i=null===(s=null===(t=this.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.name)&&void 0!==i?i:"";if(!r)return;const n=this._config.getTmpFileParams(r);if(!n)return;let o=n.prefix;null===e?Object.keys(this._currentExceptionFilters).includes(o)&&delete this._currentExceptionFilters[o]:this._currentExceptionFilters[o]=e}get eventMessage(){return this._eventMessage}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposed.emit(),f.Signal.clearData(this))}async start(){var e,t,s,i;const r=await this.sendRequest("initialize",{clientID:"jupyterlab",clientName:"JupyterLab",adapterID:null!==(s=null===(t=null===(e=this.connection)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==s?s:"",pathFormat:"path",linesStartAt1:!0,columnsStartAt1:!0,supportsVariableType:!0,supportsVariablePaging:!0,supportsRunInTerminalRequest:!0,locale:document.documentElement.lang});if(!r.success)throw new Error(`Could not start the debugger: ${r.message}`);this._capabilities=r.body,this._isStarted=!0,this._exceptionBreakpointFilters=null===(i=r.body)||void 0===i?void 0:i.exceptionBreakpointFilters,await this.sendRequest("attach",{})}async stop(){this._isStarted=!1,await this.sendRequest("disconnect",{restart:!1,terminateDebuggee:!1})}async restoreState(){var e;const t=await this.sendRequest("debugInfo",{});return this._isStarted=t.body.isStarted,this._exceptionPaths=null===(e=t.body)||void 0===e?void 0:e.exceptionPaths,t}isPausingOnException(e){var t,s;return e?null!==(s=null===(t=this.currentExceptionFilters)||void 0===t?void 0:t.includes(e))&&void 0!==s&&s:this.currentExceptionFilters.length>0}async sendRequest(e,t){return await this._ready.promise,(await this._sendDebugMessage({type:"request",seq:this._seq++,command:e,arguments:t})).content}_handleEvent(e,t){if("debug_event"!==t.header.msg_type)return;const s=t.content;this._eventMessage.emit(s)}async _sendDebugMessage(e){var t;const s=null===(t=this.connection)||void 0===t?void 0:t.kernel;if(!s)return Promise.reject(new Error("A kernel is required to send debug messages."));const i=new J.PromiseDelegate,r=s.requestDebug(e);return r.onReply=e=>{i.resolve(e)},await r.done,i.promise}}var ee=s(78156),te=s.n(ee);class se extends i.ReactWidget{constructor(e){super(),this._model=e,this.addClass("jp-DebuggerBreakpoints-body")}render(){return te().createElement(ie,{model:this._model})}}const ie=({model:e})=>{const[t,s]=(0,ee.useState)(Array.from(e.breakpoints.entries()));return(0,ee.useEffect)((()=>{const t=(t,i)=>{s(Array.from(e.breakpoints.entries()))},i=t=>{s(Array.from(e.breakpoints.entries()))};return e.changed.connect(t),e.restored.connect(i),()=>{e.changed.disconnect(t),e.restored.disconnect(i)}})),te().createElement(te().Fragment,null,t.map((t=>te().createElement(re,{key:t[0],breakpoints:t[1],model:e}))))},re=({breakpoints:e,model:t})=>te().createElement(te().Fragment,null,e.sort(((e,t)=>{var s,i;return(null!==(s=e.line)&&void 0!==s?s:0)-(null!==(i=t.line)&&void 0!==i?i:0)})).map(((e,s)=>{var i,r;return te().createElement(ne,{key:(null!==(r=null===(i=e.source)||void 0===i?void 0:i.path)&&void 0!==r?r:"")+s,breakpoint:e,model:t})}))),ne=({breakpoint:e,model:t})=>{var s,i,r,n;return te().createElement("div",{className:"jp-DebuggerBreakpoint",onClick:()=>t.clicked.emit(e),title:null===(s=e.source)||void 0===s?void 0:s.path},te().createElement("span",{className:"jp-DebuggerBreakpoint-marker"},"●"),te().createElement("span",{className:"jp-DebuggerBreakpoint-source jp-left-truncated"},"/"===(n=null!==(r=null===(i=e.source)||void 0===i?void 0:i.path)&&void 0!==r?r:"")[0]?n.slice(1)+"/":n),te().createElement("span",{className:"jp-DebuggerBreakpoint-line"},e.line))},oe="jp-PauseOnExceptions";class ae extends i.ToolbarButton{constructor(e){super(),this.onclick=()=>{this._menu.open(this.node.getBoundingClientRect().left,this.node.getBoundingClientRect().bottom)},this._menu=new le({service:e.service,commands:{registry:e.commands.registry,pauseOnExceptions:e.commands.pauseOnExceptions}}),this.node.className="jp-debugger-pauseOnExceptions",this._props=e,this._props.className=oe,this._props.service.eventMessage.connect(((e,t)=>{"initialized"!==t.event&&"terminated"!==t.event||this.onChange()}),this),this._props.enabled=this._props.service.pauseOnExceptionsIsValid(),this._props.service.pauseOnExceptionChanged.connect(this.onChange,this)}onChange(){var e;const t=this._props.service.session,s=null==t?void 0:t.exceptionBreakpointFilters;this._props.className=oe,(null===(e=this._props.service.session)||void 0===e?void 0:e.isStarted)&&s?(this._props.pressed=t.isPausingOnException(),this._props.enabled=!0):this._props.enabled=!1,this.update()}render(){return ee.createElement(i.ToolbarButtonComponent,{...this._props,onClick:this.onclick})}}class le extends i.MenuSvg{constructor(e){super({commands:e.commands.registry}),this._service=e.service,this._command=e.commands.pauseOnExceptions,e.service.eventMessage.connect(((e,t)=>{"initialized"===t.event&&this._build()}),this),this._build(),this.addClass("jp-PauseOnExceptions-menu")}_build(){var e,t;this.clearItems(),(null!==(t=null===(e=this._service.session)||void 0===e?void 0:e.exceptionBreakpointFilters)&&void 0!==t?t:[]).map(((e,t)=>{this.addItem({command:this._command,args:{filter:e.filter,description:e.description}})}))}}class de extends i.PanelWithToolbar{constructor(e){var t;super(e),this.clicked=new f.Signal(this);const{model:s,service:r,commands:n}=e,o=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=o.__("Breakpoints");const a=new se(s);this.toolbar.addItem("pauseOnException",new ae({service:r,commands:n,icon:V,tooltip:o.__("Pause on exception filter")})),this.toolbar.addItem("closeAll",new i.ToolbarButton({icon:I,onClick:async()=>{if(0!==s.breakpoints.size)return(await(0,d.showDialog)({title:o.__("Remove All Breakpoints"),body:o.__("Are you sure you want to remove all breakpoints?"),buttons:[d.Dialog.okButton({label:o.__("Remove breakpoints")}),d.Dialog.cancelButton()],hasClose:!0})).button.accept?r.clearBreakpoints():void 0},tooltip:o.__("Remove All Breakpoints")})),this.addWidget(a),this.addClass("jp-DebuggerBreakpoints")}}class ce extends i.ReactWidget{constructor(e){super(),this._model=e,this.addClass("jp-DebuggerCallstack-body")}render(){return te().createElement(he,{model:this._model})}}const he=({model:e})=>{const[t,s]=(0,ee.useState)(e.frames),[i,r]=(0,ee.useState)(e.frame);return(0,ee.useEffect)((()=>{const t=()=>{r(e.frame),s(e.frames)};return e.framesChanged.connect(t),()=>{e.framesChanged.disconnect(t)}}),[e]),te().createElement("ul",null,t.map((t=>{var s;return te().createElement("li",{key:t.id,onClick:()=>{return r(s=t),void(e.frame=s);var s},className:(null==i?void 0:i.id)===t.id?"selected jp-DebuggerCallstackFrame":"jp-DebuggerCallstackFrame"},te().createElement("span",{className:"jp-DebuggerCallstackFrame-name"},t.name),te().createElement("span",{className:"jp-DebuggerCallstackFrame-location",title:null===(s=t.source)||void 0===s?void 0:s.path},(e=>{var t;const s=(null===(t=e.source)||void 0===t?void 0:t.path)||"",i=w.PathExt.basename(w.PathExt.dirname(s)),r=w.PathExt.basename(s);return`${w.PathExt.join(i,r)}:${e.line}`})(t)))})))};class ue extends i.PanelWithToolbar{constructor(e){var t;super(e);const{commands:s,model:r}=e,n=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=n.__("Callstack");const o=new ce(r);this.toolbar.addItem("continue",new i.CommandToolbarButton({commands:s.registry,id:s.continue,label:""})),this.toolbar.addItem("terminate",new i.CommandToolbarButton({commands:s.registry,id:s.terminate,label:""})),this.toolbar.addItem("step-over",new i.CommandToolbarButton({commands:s.registry,id:s.next,label:""})),this.toolbar.addItem("step-in",new i.CommandToolbarButton({commands:s.registry,id:s.stepIn,label:""})),this.toolbar.addItem("step-out",new i.CommandToolbarButton({commands:s.registry,id:s.stepOut,label:""})),this.toolbar.addItem("evaluate",new i.CommandToolbarButton({commands:s.registry,id:s.evaluate,label:""})),this.addWidget(o),this.addClass("jp-DebuggerCallstack")}}const pe=({model:e})=>te().createElement(i.UseSignal,{signal:e.currentSourceChanged,initialSender:e},(e=>{var t,s;return te().createElement("span",{onClick:()=>null==e?void 0:e.open(),className:"jp-DebuggerSources-header-path"},null!==(s=null===(t=null==e?void 0:e.currentSource)||void 0===t?void 0:t.path)&&void 0!==s?s:"")}));class ge extends h.Widget{constructor(e){super(),this._model=e.model,this._debuggerService=e.service,this._mimeTypeService=e.editorServices.mimeTypeService;const t=new Be.ReadOnlyEditorFactory({editorServices:e.editorServices});this._editor=t.createNewEditor({content:"",mimeType:"",path:""}),this._editor.hide(),this._model.currentFrameChanged.connect((async(e,t)=>{t?this._showSource(t):this._clearEditor()}));const s=new h.PanelLayout;s.addWidget(this._editor),this.layout=s,this.addClass("jp-DebuggerSources-body")}dispose(){var e;this.isDisposed||(null===(e=this._editorHandler)||void 0===e||e.dispose(),f.Signal.clearData(this),super.dispose())}_clearEditor(){this._model.currentSource=null,this._editor.hide()}async _showSource(e){var t;const s=null===(t=e.source)||void 0===t?void 0:t.path,i=await this._debuggerService.getSource({sourceReference:0,path:s});if(!(null==i?void 0:i.content))return void this._clearEditor();this._editorHandler&&this._editorHandler.dispose();const{content:r,mimeType:n}=i,o=n||this._mimeTypeService.getMimeTypeByFilePath(null!=s?s:"");this._editor.model.sharedModel.setSource(r),this._editor.model.mimeType=o,this._editorHandler=new C({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._editor.editor),getEditor:()=>this._editor.editor,path:s,src:this._editor.model.sharedModel}),this._model.currentSource={content:r,mimeType:o,path:null!=s?s:""},requestAnimationFrame((()=>{C.showCurrentLine(this._editor.editor,e.line)})),this._editor.show()}}class _e extends i.PanelWithToolbar{constructor(e){var t;super();const{model:s,service:r,editorServices:n}=e,o=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=o.__("Source"),this.toolbar.addClass("jp-DebuggerSources-header");const a=new ge({service:r,model:s,editorServices:n});this.toolbar.addItem("open",new i.ToolbarButton({icon:L,onClick:()=>s.open(),tooltip:o.__("Open in the Main Area")}));const l=i.ReactWidget.create(te().createElement(pe,{model:s}));this.toolbar.addItem("sourcePath",l),this.addClass("jp-DebuggerSources-header"),this.addWidget(a),this.addClass("jp-DebuggerSources")}}const me=e=>te().createElement(i.InputGroup,{type:"text",onChange:t=>{const s=t.target.value;e.model.filter=s},placeholder:"Filter the kernel sources",value:e.model.filter}),ve=e=>te().createElement(i.UseSignal,{signal:e.model.filterChanged,initialArgs:e.model.filter},(t=>te().createElement(me,{model:e.model})));class be extends i.ReactWidget{constructor(e){var t;super(),this._showFilter=!1,this._model=e.model,this._debuggerService=e.service,this._trans=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab"),this.addClass("jp-DebuggerKernelSources-body")}render(){let e="jp-DebuggerKernelSource-filterBox";return this._showFilter||(e+=" jp-DebuggerKernelSource-filterBox-hidden"),te().createElement(te().Fragment,null,te().createElement("div",{className:e,key:"filter"},te().createElement(ve,{model:this._model})),te().createElement(i.UseSignal,{signal:this._model.changed},((e,t)=>{const s={};return(null!=t?t:[]).map((e=>{var t;const r=e.name,n=e.path,o=r+(s[r]=(null!==(t=s[r])&&void 0!==t?t:0)+1).toString();return te().createElement("div",{key:o,title:n,className:"jp-DebuggerKernelSource-source",onClick:()=>{this._debuggerService.getSource({sourceReference:0,path:n}).then((e=>{this._model.open(e)})).catch((e=>{(0,d.showErrorMessage)(this._trans.__("Fail to get source"),this._trans.__("Fail to get '%1' source:\n%2",n,e))}))}},te().createElement(i.LabIcon.resolveReact,{icon:P,iconClass:(0,i.classes)("jp-Icon"),tag:null}),r)}))})))}toggleFilterbox(){this._showFilter=!this._showFilter,this.update()}}class fe extends i.PanelWithToolbar{constructor(e){var t;super();const{model:s,service:r}=e;this._model=s;const n=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=n.__("Kernel Sources"),this.toolbar.addClass("jp-DebuggerKernelSources-header"),this._body=new be({service:r,model:s,translator:e.translator}),this.toolbar.addItem("open-filter",new i.ToolbarButton({icon:i.searchIcon,onClick:async()=>{this._body.toggleFilterbox()},tooltip:n.__("Toggle search filter")})),this.toolbar.addItem("refresh",new i.ToolbarButton({icon:i.refreshIcon,onClick:()=>{this._model.kernelSources=[],r.displayModules().catch((e=>{(0,d.showErrorMessage)(n.__("Fail to get kernel sources"),n.__("Fail to get kernel sources:\n%2",e))}))},tooltip:n.__("Refresh kernel sources")})),this.addClass("jp-DebuggerKernelSources-header"),this.addWidget(this._body),this.addClass("jp-DebuggerKenelSources")}set filter(e){this._model.filter=e}}const we=({model:e,tree:t,grid:s,trans:r})=>{const[n,o]=(0,ee.useState)("-"),a=e.scopes;return te().createElement(i.HTMLSelect,{onChange:e=>{const i=e.target.value;o(i),t.scope=i,s.scope=i},value:n,"aria-label":r.__("Scope")},a.map((e=>te().createElement("option",{key:e.name,value:e.name},r.__(e.name)))))};class ke extends i.ReactWidget{constructor(e){super();const{translator:t,model:s,tree:i,grid:r}=e;this._model=s,this._tree=i,this._grid=r,this._trans=(t||v.nullTranslator).load("jupyterlab")}render(){return te().createElement(i.UseSignal,{signal:this._model.changed,initialSender:this._model},(()=>te().createElement(we,{model:this._model,trans:this._trans,tree:this._tree,grid:this._grid})))}}var Se=s(33625);const Ce="jp-DebuggerVariables-buttons";class ye extends i.ReactWidget{constructor(e){super(),this._scope="",this._scopes=[],this._filter=new Set,this._commands=e.commands,this._service=e.service,this._translator=e.translator,this._hoverChanged=new f.Signal(this),(this.model=e.model).changed.connect(this._updateScopes,this),this.addClass("jp-DebuggerVariables-body")}render(){var e;const t=null!==(e=this._scopes.find((e=>e.name===this._scope)))&&void 0!==e?e:this._scopes[0],s=e=>{this.model.selectedVariable=e},r=te().createElement(i.caretDownEmptyIcon.react,{stylesheet:"menuItem",tag:"span"});return"Globals"!==(null==t?void 0:t.name)?this.addClass("jp-debuggerVariables-local"):this.removeClass("jp-debuggerVariables-local"),t?te().createElement(te().Fragment,null,te().createElement(xe,{key:t.name,commands:this._commands,service:this._service,data:t.variables,filter:this._filter,translator:this._translator,handleSelectVariable:s,onHoverChanged:e=>{this._hoverChanged.emit(e)},collapserIcon:r}),te().createElement(Ee,{commands:this._commands,service:this._service,hoverChanged:this._hoverChanged,handleSelectVariable:s})):te().createElement("div",null)}set filter(e){this._filter=e,this.update()}set scope(e){this._scope=e,this.update()}_updateScopes(e){Se.ArrayExt.shallowEqual(this._scopes,e.scopes)||(this._scopes=e.scopes,this.update())}}const Ee=e=>{var t;const{commands:s,service:r,translator:n,handleSelectVariable:o}=e,a=(null!=n?n:v.nullTranslator).load("jupyterlab"),[l,d]=(0,ee.useState)(0),[c,h]=(0,ee.useState)(null);let u=0;const p=(0,ee.useCallback)(((e,t)=>{const s=++u;if(t.variable)h(t.variable),requestAnimationFrame((()=>{s===u&&t.target&&d(t.target.offsetTop)}));else{if(s!==u)return;const e=t.target;if(e&&e instanceof Element&&e.closest(`.${Ce}`))return;h(null)}}),[]);return(0,ee.useEffect)((()=>(e.hoverChanged.connect(p),()=>{e.hoverChanged.disconnect(p)})),[p]),te().createElement("div",{className:Ce,style:{transform:`translateY(${l}px)`,opacity:!c||["special variables","protected variables","function variables","class variables"].includes(c.name)?0:1}},te().createElement("button",{className:"jp-DebuggerVariables-renderVariable",disabled:!c||!r.model.hasRichVariableRendering||!s.isEnabled(Be.CommandIDs.renderMimeVariable,{name:c.name,frameID:null===(t=r.model.callstack.frame)||void 0===t?void 0:t.id}),onClick:e=>{var t;c&&o&&(e.stopPropagation(),o(c),s.execute(Be.CommandIDs.renderMimeVariable,{name:c.name,frameID:null===(t=r.model.callstack.frame)||void 0===t?void 0:t.id}).catch((e=>{console.error(`Failed to render variable ${null==c?void 0:c.name}`,e)})))},title:a.__("Render variable: %1",null==c?void 0:c.name)},te().createElement(i.searchIcon.react,{stylesheet:"menuItem",tag:"span"})))},xe=e=>{const{commands:t,data:s,service:i,filter:r,translator:n,handleSelectVariable:o,onHoverChanged:a,collapserIcon:l}=e,[d,c]=(0,ee.useState)(s);return(0,ee.useEffect)((()=>{c(s)}),[s]),te().createElement("ul",{className:"jp-DebuggerVariables-branch"},d.filter((e=>!(r||new Set).has(e.evaluateName||""))).map((e=>{const s=`${e.name}-${e.evaluateName}-${e.type}-${e.value}-${e.variablesReference}`;return te().createElement(Me,{key:s,commands:t,data:e,service:i,filter:r,translator:n,onSelect:o,onHoverChanged:a,collapserIcon:l})})))},Me=e=>{const{commands:t,data:s,service:i,filter:r,translator:n,onSelect:o,onHoverChanged:a,collapserIcon:l}=e,[d]=(0,ee.useState)(s),[c,h]=(0,ee.useState)(),[u,p]=(0,ee.useState)(),g=null!=o?o:()=>{},_=0!==d.variablesReference||"function"===d.type;return te().createElement("li",{onClick:e=>(async e=>{if(!_)return;e.stopPropagation();const t=await i.inspectVariable(d.variablesReference);h(!c),p(t)})(e),onMouseDown:e=>{e.stopPropagation(),g(d)},onMouseOver:e=>{a&&(a({target:e.currentTarget,variable:d}),e.stopPropagation())},onMouseLeave:e=>{a&&(a({target:e.relatedTarget,variable:null}),e.stopPropagation())}},te().createElement("span",{className:"jp-DebuggerVariables-collapser"+(c?" jp-mod-expanded":"")},_?te().cloneElement(l):null),te().createElement("span",{className:"jp-DebuggerVariables-name"},d.name),te().createElement("span",{className:"jp-DebuggerVariables-detail"},function(e){if("float"===e.type&&("inf"==e.value||"-inf"==e.value))return e.value;const t=Te(e);return"float"===e.type&&isNaN(t)?"NaN":t}(d)),c&&u&&te().createElement(xe,{key:d.name,commands:t,data:u,service:i,filter:r,translator:n,handleSelectVariable:o,onHoverChanged:a,collapserIcon:l}))};class De extends i.PanelWithToolbar{constructor(e){super(e);const{model:t,service:s,commands:r,themeManager:n}=e,o=e.translator||v.nullTranslator,a=o.load("jupyterlab");this.title.label=a.__("Variables"),this.toolbar.addClass("jp-DebuggerVariables-toolbar"),this._tree=new ye({model:t,service:s,commands:r,translator:o}),this._table=new $({model:t,commands:r,themeManager:n,translator:o}),this._table.hide(),this.toolbar.addItem("scope-switcher",new ke({translator:o,model:t,tree:this._tree,grid:this._table}));const l=()=>{this._table.isHidden?(this._tree.hide(),this._table.show(),this.node.setAttribute("data-jp-table","true"),h("table")):(this._tree.show(),this._table.hide(),this.node.removeAttribute("data-jp-table"),h("tree")),this.update()},d=new i.ToolbarButton({icon:i.treeViewIcon,className:"jp-TreeView",onClick:l,tooltip:a.__("Tree View")}),c=new i.ToolbarButton({icon:i.tableRowsIcon,className:"jp-TableView",onClick:l,tooltip:a.__("Table View")}),h=e=>{c.pressed="tree"!==e,d.pressed=!c.pressed};h(this._table.isHidden?"tree":"table"),this.toolbar.addItem("view-VariableTreeView",d),this.toolbar.addItem("view-VariableTableView",c),this.addWidget(this._tree),this.addWidget(this._table),this.addClass("jp-DebuggerVariables")}set filter(e){this._tree.filter=e,this._table.filter=e}onResize(e){super.onResize(e),this._resizeBody(e)}_resizeBody(e){const t=e.height-this.toolbar.node.offsetHeight;this._tree.node.style.height=`${t}px`}}const Te=e=>{var t,s;const{type:i,value:r}=e;switch(i){case"int":return parseInt(r,10);case"float":return parseFloat(r);case"bool":return r;case"str":return(null===(s=null===(t=e.presentationHint)||void 0===t?void 0:t.attributes)||void 0===s?void 0:s.includes("rawString"))?r.slice(1,r.length-1):r;default:return null!=i?i:r}};class Ie extends i.SidePanel{constructor(e){const t=e.translator||v.nullTranslator;super({translator:t}),this.id="jp-debugger-sidebar",this.title.icon=i.bugIcon,this.addClass("jp-DebuggerSidebar");const{callstackCommands:s,breakpointsCommands:r,editorServices:n,service:o,themeManager:a}=e,l=o.model;this.variables=new De({model:l.variables,commands:s.registry,service:o,themeManager:a,translator:t}),this.callstack=new ue({commands:s,model:l.callstack,translator:t}),this.breakpoints=new de({service:o,commands:r,model:l.breakpoints,translator:t}),this.sources=new _e({model:l.sources,service:o,editorServices:n,translator:t}),this.kernelSources=new fe({model:l.kernelSources,service:o,translator:t});const d=new Ie.Header;this.header.addWidget(d),l.titleChanged.connect(((e,t)=>{d.title.label=t})),this.content.addClass("jp-DebuggerSidebar-body"),this.addWidget(this.variables),this.addWidget(this.callstack),this.addWidget(this.breakpoints),this.addWidget(this.sources),this.addWidget(this.kernelSources)}}var Ve,Be;!function(e){class t extends h.Widget{constructor(){super({node:Ve.createHeader()}),this.title.changed.connect((e=>{this.node.textContent=this.title.label}))}}e.Header=t}(Ie||(Ie={})),function(e){e.createHeader=function(){const e=document.createElement("h2");return e.textContent="-",e.classList.add("jp-text-truncated"),e}}(Ve||(Ve={}));class He{constructor(e){var t,s,i;this._config=e.config,this._shell=e.shell,this._notebookTracker=null!==(t=e.notebookTracker)&&void 0!==t?t:null,this._consoleTracker=null!==(s=e.consoleTracker)&&void 0!==s?s:null,this._editorTracker=null!==(i=e.editorTracker)&&void 0!==i?i:null,this._readOnlyEditorTracker=new d.WidgetTracker({namespace:"@jupyterlab/debugger"})}find(e){return[...this._findInConsoles(e),...this._findInEditors(e),...this._findInNotebooks(e),...this._findInReadOnlyEditors(e)]}open(e){const{editorWrapper:t,label:s,caption:r}=e,n=new d.MainAreaWidget({content:t});n.id=d.DOMUtils.createDomID(),n.title.label=s,n.title.closable=!0,n.title.caption=r,n.title.icon=i.textEditorIcon,this._shell.add(n,"main",{type:"Debugger Sources"}),this._readOnlyEditorTracker.add(n)}_findInNotebooks(e){if(!this._notebookTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._notebookTracker.forEach((e=>{const o=e.sessionContext;if(i!==o.path)return;const a=e.content;t&&(a.mode="command"),e.content.widgets.forEach(((i,o)=>{const l=i.model.sharedModel.getSource(),d=this._getCodeId(l,s);d&&r===d&&(t&&(a.activeCellIndex=o,a.activeCell&&a.scrollToItem(a.activeCellIndex).catch((e=>{})),this._shell.activateById(e.id)),n.push(Object.freeze({get:()=>i.editor,reveal:()=>a.scrollToItem(o),src:i.model.sharedModel})))}))})),n}_findInConsoles(e){if(!this._consoleTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._consoleTracker.forEach((e=>{const o=e.sessionContext;if(i!==o.path)return;const a=e.console.cells;for(const i of a){const o=i.model.sharedModel.getSource(),a=this._getCodeId(o,s);if(!a)break;if(r!==a)break;n.push(Object.freeze({get:()=>i.editor,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:i.model.sharedModel})),t&&this._shell.activateById(e.id)}})),n}_findInEditors(e){if(!this._editorTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._editorTracker.forEach((e=>{const o=e.content;if(i!==o.context.path)return;const a=o.editor;if(!a)return;const l=a.model.sharedModel.getSource(),d=this._getCodeId(l,s);d&&r===d&&(n.push(Object.freeze({get:()=>a,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:o.model.sharedModel})),t&&this._shell.activateById(e.id))})),n}_findInReadOnlyEditors(e){const{focus:t,kernel:s,source:i}=e,r=[];return this._readOnlyEditorTracker.forEach((e=>{var n;const o=null===(n=e.content)||void 0===n?void 0:n.editor;if(!o)return;const a=o.model.sharedModel.getSource(),l=this._getCodeId(a,s);l&&(e.title.caption!==i&&i!==l||(r.push(Object.freeze({get:()=>o,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:o.model.sharedModel})),t&&this._shell.activateById(e.id)))})),r}_getCodeId(e,t){try{return this._config.getCodeId(e,t)}catch(e){return""}}}!function(e){let t,s,r;e.Config=class extends a{},e.EditorHandler=class extends C{},e.Handler=class extends T{},e.Model=class extends z{},e.ReadOnlyEditorFactory=class extends _{},e.Service=class extends Q{},e.Session=class extends X{},e.Sidebar=class extends Ie{},e.Sources=class extends He{},e.VariablesGrid=class extends ${},e.VariableRenderer=class extends Y{},function(e){e.debugContinue="debugger:continue",e.terminate="debugger:terminate",e.next="debugger:next",e.showPanel="debugger:show-panel",e.stepIn="debugger:stepIn",e.stepOut="debugger:stepOut",e.inspectVariable="debugger:inspect-variable",e.renderMimeVariable="debugger:render-mime-variable",e.evaluate="debugger:evaluate",e.restartDebug="debugger:restart-debug",e.pauseOnExceptions="debugger:pause-on-exceptions",e.copyToClipboard="debugger:copy-to-clipboard",e.copyToGlobals="debugger:copy-to-globals",e.openSource="debugger:open-source"}(t=e.CommandIDs||(e.CommandIDs={})),function(e){e.closeAllIcon=I,e.evaluateIcon=i.codeIcon,e.continueIcon=i.runIcon,e.pauseIcon=B,e.stepIntoIcon=H,e.stepOutIcon=j,e.stepOverIcon=R,e.terminateIcon=i.stopIcon,e.variableIcon=F,e.viewBreakpointIcon=L,e.pauseOnExceptionsIcon=B}(s=e.Icons||(e.Icons={})),function(e){e.getCode=l.getCode}(r=e.Dialogs||(e.Dialogs={}))}(Be||(Be={}))},36621:(e,t,s)=>{s.r(t),s.d(t,{Debugger:()=>i.q,IDebugger:()=>n,IDebuggerConfig:()=>o,IDebuggerHandler:()=>d,IDebuggerSidebar:()=>l,IDebuggerSourceViewer:()=>c,IDebuggerSources:()=>a});var i=s(78947),r=s(20998);const n=new r.Token("@jupyterlab/debugger:IDebugger","A debugger user interface."),o=new r.Token("@jupyterlab/debugger:IDebuggerConfig","A service to handle the debugger configuration."),a=new r.Token("@jupyterlab/debugger:IDebuggerSources","A service to display sources in debug mode."),l=new r.Token("@jupyterlab/debugger:IDebuggerSidebar","A service for the debugger sidebar."),d=new r.Token("@jupyterlab/debugger:IDebuggerHandler","A service for handling notebook debugger."),c=new r.Token("@jupyterlab/debugger:IDebuggerSourceViewer","A debugger source viewer.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6621],{78947:(e,t,s)=>{s.d(t,{q:()=>He});var i=s(35613);const r=1540483477,n=new TextEncoder;function o(e,t){const s=n.encode(e);let i=s.length,o=t^i,a=0;for(;i>=4;){let e=255&s[a]|(255&s[++a])<<8|(255&s[++a])<<16|(255&s[++a])<<24;e=(65535&e)*r+(((e>>>16)*r&65535)<<16),e^=e>>>24,e=(65535&e)*r+(((e>>>16)*r&65535)<<16),o=(65535&o)*r+(((o>>>16)*r&65535)<<16)^e,i-=4,++a}switch(i){case 3:o^=(255&s[a+2])<<16;case 2:o^=(255&s[a+1])<<8;case 1:o^=255&s[a],o=(65535&o)*r+(((o>>>16)*r&65535)<<16)}return o^=o>>>13,o=(65535&o)*r+(((o>>>16)*r&65535)<<16),o^=o>>>15,o>>>0}class a{constructor(){this._fileParams=new Map,this._hashMethods=new Map}getCodeId(e,t){const s=this._fileParams.get(t);if(!s)throw new Error(`Kernel (${t}) has no tmp file params.`);const i=this._hashMethods.get(t);if(!i)throw new Error(`Kernel (${t}) has no hashing params.`);const{prefix:r,suffix:n}=s;return`${r}${i(e)}${n}`}setHashParams(e){const{kernel:t,method:s,seed:i}=e;if(!t)throw new TypeError("Kernel name is not defined.");if("Murmur2"!==s)throw new Error(`Hash method (${s}) is not supported.`);this._hashMethods.set(t,(e=>o(e,i).toString()))}setTmpFileParams(e){const{kernel:t,prefix:s,suffix:i}=e;if(!t)throw new TypeError("Kernel name is not defined.");this._fileParams.set(t,{kernel:t,prefix:s,suffix:i})}getTmpFileParams(e){return this._fileParams.get(e)}}var l,d=s(53312),c=s(73166),h=s(63485);!function(e){e.getCode=function(e){return new u({...e,body:new p(e),buttons:[d.Dialog.cancelButton({label:e.cancelLabel}),d.Dialog.okButton({label:e.okLabel})]}).launch()}}(l||(l={}));class u extends d.Dialog{handleEvent(e){if("keydown"===e.type){const t=e,{code:s,shiftKey:i}=t;if(i&&"Enter"===s)return this.resolve();if("Enter"===s)return}super.handleEvent(e)}}class p extends h.Widget{constructor(e){super();const{contentFactory:t,rendermime:s,mimeType:i}=e,r=new c.CodeCellModel;r.mimeType=null!=i?i:"",this._prompt=new c.CodeCell({contentFactory:t,rendermime:s,model:r,placeholder:!1}).initializeState(),this._prompt.inputArea.promptNode.remove(),this.node.appendChild(this._prompt.node)}getValue(){return this._prompt.model.sharedModel.getSource()}onAfterAttach(e){super.onAfterAttach(e),this._prompt.activate()}}var g=s(51429);class _{constructor(e){this._services=e.editorServices}createNewEditor(e){const{content:t,mimeType:s,path:i}=e,r=this._services.factoryService.newInlineEditor,n=this._services.mimeTypeService,o=new g.CodeEditor.Model({mimeType:s||n.getMimeTypeByFilePath(i)});o.sharedModel.source=t;const a=new g.CodeEditorWrapper({editorOptions:{config:{readOnly:!0,lineNumbers:!0}},model:o,factory:r});return a.node.setAttribute("data-jp-debugger","true"),a.disposed.connect((()=>{o.dispose()})),a}}var m,v=s(12030),b=s(31231),f=s(81997),w=s(68722),k=s(89843),S=s(3546);class C{constructor(e){var t,s,i,r;this._src=e.src,this._id=null!==(i=null===(s=null===(t=e.debuggerService.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.id)&&void 0!==i?i:"",this._path=null!==(r=e.path)&&void 0!==r?r:"",this._debuggerService=e.debuggerService,this._editor=e.getEditor,this._editorMonitor=new w.ActivityMonitor({signal:this._src.changed,timeout:1e3}),this._editorMonitor.activityStopped.connect((()=>{this._sendEditorBreakpoints()}),this),this._debuggerService.model.breakpoints.changed.connect((async()=>{const e=this.editor;e&&!e.isDisposed&&this._addBreakpointsToEditor()})),this._debuggerService.model.breakpoints.restored.connect((async()=>{const e=this.editor;e&&!e.isDisposed&&this._addBreakpointsToEditor()})),this._debuggerService.model.callstack.currentFrameChanged.connect((()=>{const e=this.editor;e&&C.clearHighlight(e)})),this._breakpointEffect=k.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})}),this._breakpointState=k.StateField.define({create:()=>k.RangeSet.empty,update:(e,t)=>{e=e.map(t.changes);for(let s of t.effects)if(s.is(this._breakpointEffect)){let t=s;e=t.value.pos.length?e.update({add:t.value.pos.map((e=>m.breakpointMarker.range(e))),sort:!0}):k.RangeSet.empty}return e}}),this._gutter=new k.Compartment,this._highlightDeco=S.Decoration.line({class:"jp-DebuggerEditor-highlight"}),this._highlightState=k.StateField.define({create:()=>S.Decoration.none,update:(e,t)=>{e=e.map(t.changes);for(let s of t.effects)if(s.is(C._highlightEffect)){let t=s;e=t.value.pos.length?e.update({add:t.value.pos.map((e=>this._highlightDeco.range(e)))}):S.Decoration.none}return e},provide:e=>S.EditorView.decorations.from(e)}),e.editorReady().then((()=>{this._setupEditor()}))}get editor(){return this._editor()}dispose(){this.isDisposed||(this._editorMonitor.dispose(),this._clearEditor(),this.isDisposed=!0,f.Signal.clearData(this))}refreshBreakpoints(){this._addBreakpointsToEditor()}_setupEditor(){const e=this.editor;if(!e||e.isDisposed)return;e.setOption("lineNumbers",!0);const t=[this._breakpointState,this._highlightState,k.Prec.highest((0,S.gutter)({class:"cm-breakpoint-gutter",renderEmptyElements:!0,markers:e=>e.state.field(this._breakpointState),initialSpacer:()=>m.breakpointMarker,domEventHandlers:{mousedown:(e,t)=>(this._onGutterClick(e,t.from),!0)}}))];e.injectExtension(this._gutter.of(t)),this._addBreakpointsToEditor()}_clearEditor(){const e=this.editor;e&&!e.isDisposed&&(C.clearHighlight(e),this._clearGutter(e),e.setOption("lineNumbers",!1),e.editor.dispatch({effects:this._gutter.reconfigure([])}))}_sendEditorBreakpoints(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.isDisposed)return;const t=this._getBreakpointsFromEditor().map((e=>{var t,s;return m.createBreakpoint((null===(s=null===(t=this._debuggerService.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.name)||"",e)}));this._debuggerService.updateBreakpoints(this._src.getSource(),t,this._path)}_onGutterClick(e,t){var s,i,r;if(this._id!==(null===(i=null===(s=this._debuggerService.session)||void 0===s?void 0:s.connection)||void 0===i?void 0:i.id))return;const n=e.state.doc.lineAt(t).number;let o=e.state.field(this._breakpointState),a=!1;o.between(t,t,(()=>{a=!0}));let l=this._getBreakpoints();a?l=l.filter((e=>e.line!==n)):l.push(m.createBreakpoint(null!==(r=this._path)&&void 0!==r?r:this._debuggerService.session.connection.name,n)),l.sort(((e,t)=>e.line-t.line)),this._debuggerService.updateBreakpoints(this._src.getSource(),l,this._path)}_addBreakpointsToEditor(){var e,t;if(this._id!==(null===(t=null===(e=this._debuggerService.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.id))return;const s=this.editor,i=this._getBreakpoints();this._clearGutter(s);const r=i.map((e=>s.state.doc.line(e.line).from));s.editor.dispatch({effects:this._breakpointEffect.of({pos:r})})}_getBreakpointsFromEditor(){const e=this.editor,t=e.editor.state.field(this._breakpointState);let s=[];return t.between(0,e.doc.length,(t=>{s.push(e.doc.lineAt(t).number)})),s}_clearGutter(e){e&&e.editor.dispatch({effects:this._breakpointEffect.of({pos:[]})})}_getBreakpoints(){const e=this._src.getSource();return this._debuggerService.model.breakpoints.getBreakpoints(this._path||this._debuggerService.getCodeId(e))}}!function(e){function t(t){t&&!t.isDisposed&&t.editor.dispatch({effects:e._highlightEffect.of({pos:[]})})}e._highlightEffect=k.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})}),e.showCurrentLine=function(s,i){t(s);const r=s,n=r.doc.line(i).from;r.editor.dispatch({effects:e._highlightEffect.of({pos:[n]})})},e.clearHighlight=t}(C||(C={})),function(e){e.breakpointMarker=new class extends S.GutterMarker{toDOM(){return document.createTextNode("●")}},e.createBreakpoint=function(e,t){return{line:t,verified:!0,source:{name:e}}}}(m||(m={}));class y{constructor(e){this._debuggerService=e.debuggerService,this._consolePanel=e.widget,this._cellMap=new b.ObservableMap;const t=this._consolePanel.console;t.promptCell&&this._addEditorHandler(t.promptCell),t.promptCellCreated.connect(((e,t)=>{this._addEditorHandler(t)}));const s=()=>{for(const e of t.cells)this._addEditorHandler(e)};s(),this._consolePanel.console.cells.changed.connect(s)}dispose(){this.isDisposed||(this.isDisposed=!0,this._cellMap.values().forEach((e=>e.dispose())),this._cellMap.dispose(),f.Signal.clearData(this))}_addEditorHandler(e){const t=e.model.id;if("code"!==e.model.type||this._cellMap.has(t))return;const s=e,i=new C({debuggerService:this._debuggerService,editorReady:async()=>(await s.ready,s.editor),getEditor:()=>s.editor,src:e.model.sharedModel});s.disposed.connect((()=>{this._cellMap.delete(t),i.dispose()})),this._cellMap.set(t,i)}}class E{constructor(e){var t;this._debuggerService=e.debuggerService,this._fileEditor=e.widget.content,this._hasLineNumber=null!==(t=this._fileEditor.editor.getOption("lineNumbers"))&&void 0!==t&&t,this._editorHandler=new C({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._fileEditor.editor),getEditor:()=>this._fileEditor.editor,src:this._fileEditor.model.sharedModel})}dispose(){var e,t;this.isDisposed||(this.isDisposed=!0,null===(e=this._editorHandler)||void 0===e||e.dispose(),null===(t=this._editorHandler)||void 0===t||t.editor.setOptions({lineNumbers:this._hasLineNumber}),f.Signal.clearData(this))}}class x{constructor(e){this._debuggerService=e.debuggerService,this._notebookPanel=e.widget,this._cellMap=new b.ObservableMap,this._notebookPanel.content.model.cells.changed.connect(this._onCellsChanged,this),this._onCellsChanged()}dispose(){this.isDisposed||(this.isDisposed=!0,this._cellMap.values().forEach((e=>{var t;e.dispose(),null===(t=e.editor)||void 0===t||t.setOptions({...this._notebookPanel.content.editorConfig.code})})),this._cellMap.dispose(),f.Signal.clearData(this))}_onCellsChanged(e,t){var s;if(this._notebookPanel.content.widgets.forEach((e=>this._addEditorHandler(e))),"move"===(null==t?void 0:t.type))for(const e of t.newValues)null===(s=this._cellMap.get(e.id))||void 0===s||s.refreshBreakpoints()}_addEditorHandler(e){const t=e.model.id;if("code"!==e.model.type||this._cellMap.has(t))return;const s=e,i=new C({debuggerService:this._debuggerService,editorReady:async()=>(await s.ready,s.editor),getEditor:()=>s.editor,src:e.model.sharedModel});s.disposed.connect((()=>{this._cellMap.delete(t),i.dispose()})),this._cellMap.set(e.model.id,i)}}const M="debugger-icon";function D(e,t,s=!0,i){e&&(e.enabled=s,e.pressed=t,i&&(e.onClick=i))}class T{constructor(e){this._handlers={},this._contextKernelChangedHandlers={},this._kernelChangedHandlers={},this._statusChangedHandlers={},this._iopubMessageHandlers={},this._iconButtons={},this._type=e.type,this._shell=e.shell,this._service=e.service}get activeWidget(){return this._activeWidget}async update(e,t){if(!t)return delete this._kernelChangedHandlers[e.id],delete this._statusChangedHandlers[e.id],delete this._iopubMessageHandlers[e.id],this.updateWidget(e,t);const s=()=>{this.updateWidget(e,t)},i=this._kernelChangedHandlers[e.id];i&&t.kernelChanged.disconnect(i),this._kernelChangedHandlers[e.id]=s,t.kernelChanged.connect(s);const r=(s,i)=>{i.endsWith("restarting")&&this.updateWidget(e,t)},n=this._statusChangedHandlers[e.id];n&&t.statusChanged.disconnect(n),t.statusChanged.connect(r),this._statusChangedHandlers[e.id]=r;const o=(e,t)=>{"execute_request"==t.parent_header.msg_type&&this._service.isStarted&&!this._service.hasStoppedThreads()&&this._service.displayDefinedVariables()},a=this._iopubMessageHandlers[e.id];return a&&t.iopubMessage.disconnect(a),t.iopubMessage.connect(o),this._iopubMessageHandlers[e.id]=o,this._activeWidget=e,this.updateWidget(e,t)}async updateContext(e,t){const s=()=>{const{session:s}=t;this.update(e,s)},i=this._contextKernelChangedHandlers[e.id];return i&&t.kernelChanged.disconnect(i),this._contextKernelChangedHandlers[e.id]=s,t.kernelChanged.connect(s),this.update(e,t.session)}async updateWidget(e,t){var s,r,n,o;if(!this._service.model||!t)return;const a=()=>this._shell.currentWidget===e,l=()=>{this._handlers[e.id]?e.node.setAttribute("data-jp-debugger","true"):e.node.removeAttribute("data-jp-debugger")},d=()=>{if(!this._handlers[e.id]){switch(this._type){case"notebook":this._handlers[e.id]=new x({debuggerService:this._service,widget:e});break;case"console":this._handlers[e.id]=new y({debuggerService:this._service,widget:e});break;case"file":this._handlers[e.id]=new E({debuggerService:this._service,widget:e});break;default:throw Error(`No handler for the type ${this._type}`)}l()}},c=()=>{var s,i,r,n;const o=this._handlers[e.id];o&&(o.dispose(),delete this._handlers[e.id],delete this._kernelChangedHandlers[e.id],delete this._statusChangedHandlers[e.id],delete this._iopubMessageHandlers[e.id],delete this._contextKernelChangedHandlers[e.id],(null===(i=null===(s=this._service.session)||void 0===s?void 0:s.connection)||void 0===i?void 0:i.path)!==(null==t?void 0:t.path)&&(null===(n=null===(r=this._service.session)||void 0===r?void 0:r.connection)||void 0===n?void 0:n.kernel)||this._service.model.clear(),l())},h=()=>{var e;return this._service.isStarted&&(null===(e=this._previousConnection)||void 0===e?void 0:e.id)===(null==t?void 0:t.id)},u=async()=>{this._service.session.connection=t,await this._service.stop()},p=async()=>{var e,s;this._service.session.connection=t,this._previousConnection=t,await this._service.restoreState(!0),await this._service.displayDefinedVariables(),(null===(s=null===(e=this._service.session)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.supportsModulesRequest)&&await this._service.displayModules()},g=async()=>{if(!a())return;const t=this._iconButtons[e.id];h()?(await u(),c(),D(t,!1)):(await p(),d(),D(t,!0))};return((t=!0)=>{const s=this._iconButtons[e.id];s?D(s,this._service.isStarted,t,g):this._iconButtons[e.id]=function(e,t,s,r,n=v.nullTranslator){const o=n.load("jupyterlab"),a=new i.ToolbarButton({className:"jp-DebuggerBugButton",icon:i.bugIcon,tooltip:o.__("Enable Debugger"),pressedIcon:i.bugDotIcon,pressedTooltip:o.__("Disable Debugger"),disabledTooltip:o.__("Select a kernel that supports debugging to enable debugger"),enabled:s,pressed:r,onClick:t});return e.toolbar.insertBefore("kernelName",M,a)||e.toolbar.addItem(M,a),a}(e,g,this._service.isStarted,t)})(!1),e.disposed.connect((async()=>{h()&&await u(),c(),delete this._iconButtons[e.id],delete this._contextKernelChangedHandlers[e.id]})),await this._service.isAvailable(t)?(this._service.session?(this._previousConnection=(null===(s=this._service.session.connection)||void 0===s?void 0:s.kernel)?this._service.session.connection:null,this._service.session.connection=t):this._service.session=new He.Session({connection:t,config:this._service.config}),await this._service.restoreState(!1),this._service.isStarted&&!this._service.hasStoppedThreads()&&(await this._service.displayDefinedVariables(),(null===(n=null===(r=this._service.session)||void 0===r?void 0:r.capabilities)||void 0===n?void 0:n.supportsModulesRequest)&&await this._service.displayModules()),D(this._iconButtons[e.id],this._service.isStarted,!0),this._service.isStarted?(d(),void(this._previousConnection=t)):(c(),this._service.session.connection=null!==(o=this._previousConnection)&&void 0!==o?o:t,void await this._service.restoreState(!1))):(c(),void D(this._iconButtons[e.id],!1,!1))}}const I=new i.LabIcon({name:"debugger:close-all",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M16.4805 17.2481C16.8158 16.3972 17 15.4701 17 14.5C17 10.3579 13.6421 7.00001 9.5 7.00001C8.36314 7.00001 7.28536 7.25295 6.31986 7.70564C7.60064 6.0592 9.60074 5 11.8482 5C15.7142 5 18.8482 8.13401 18.8482 12C18.8482 14.0897 17.9325 15.9655 16.4805 17.2481Z" />\n <path d="M19.1607 14.2481C19.496 13.3971 19.6801 12.4701 19.6801 11.5C19.6801 7.35786 16.3223 4 12.1801 4C11.0433 4 9.9655 4.25295 9.00001 4.70563C10.2808 3.05919 12.2809 2 14.5284 2C18.3944 2 21.5284 5.134 21.5284 9C21.5284 11.0897 20.6127 12.9655 19.1607 14.2481Z" />\n <path d="M16 15C16 18.866 12.866 22 9 22C5.13401 22 2 18.866 2 15C2 11.134 5.13401 8 9 8C12.866 8 16 11.134 16 15ZM11.7914 11L13 12.2086L10.2086 15L13 17.7914L11.7914 19L9 16.2086L6.20857 19L5 17.7914L7.79143 15L5 12.2086L6.20857 11L9 13.7914L11.7914 11Z" />\n </g>\n</svg>\n'}),V=new i.LabIcon({name:"debugger:pause-on-exception",svgstr:'<svg height="24" width="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161" transform="matrix(1.1999396,0,0,1.3858273,-2.3726971,-4.6347192)">\n <path\n d="M 12.023438,0.30859375 11.158203,1.8085937 -1.2382812,23.285156 l 26.5292972,-0.002 z m 0.002,3.99999995 9.800781,16.9746093 -19.6015626,0.002 z"\n transform="matrix(0.72509832,0,0,0.7247701,3.2918397,3.480876)"\n />\n <path d="m 11.144475,9.117095 h 1.666751 v 7.215906 h -1.666751 z" />\n <path d="m 11.144475,17.054592 h 1.666751 v 1.443181 h -1.666751 z" />\n </g>\n</svg>\n'}),B=new i.LabIcon({name:"debugger:pause",svgstr:'<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="m 7,6 h 4 V 18 H 7 Z" />\n <path d="m 13,6 h 4 v 12 h -4 z" />\n </g>\n</svg>\n'}),H=new i.LabIcon({name:"debugger:step-into",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M7.99998 9.53198H8.54198L12.447 5.62698L11.386 4.56698L8.74898 7.17698L8.74898 0.999985H7.99998H7.25098L7.25098 7.17698L4.61398 4.56698L3.55298 5.62698L7.45798 9.53198H7.99998ZM9.95598 13.013C9.95598 14.1175 9.06055 15.013 7.95598 15.013C6.85141 15.013 5.95598 14.1175 5.95598 13.013C5.95598 11.9084 6.85141 11.013 7.95598 11.013C9.06055 11.013 9.95598 11.9084 9.95598 13.013Z"/>\n\t</g>\n</svg>\n'}),R=new i.LabIcon({name:"debugger:step-over",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M14.25 5.75V1.75H12.75V4.2916C11.605 2.93303 9.83899 2.08334 7.90914 2.08334C4.73316 2.08334 1.98941 4.39036 1.75072 7.48075L1.72992 7.75H3.231L3.25287 7.5241C3.46541 5.32932 5.45509 3.58334 7.90914 3.58334C9.6452 3.58334 11.1528 4.45925 11.9587 5.75H9.12986V7.25H13.292L14.2535 6.27493V5.75H14.25ZM7.99997 14C9.10454 14 9.99997 13.1046 9.99997 12C9.99997 10.8954 9.10454 10 7.99997 10C6.8954 10 5.99997 10.8954 5.99997 12C5.99997 13.1046 6.8954 14 7.99997 14Z"/>\n\t</g>\n</svg>\n'}),j=new i.LabIcon({name:"debugger:step-out",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n\t<g class="jp-icon3" fill="#616161">\n\t\t<path d="M7.99998 1H7.45798L3.55298 4.905L4.61398 5.965L7.25098 3.355V9.532H7.99998H8.74898V3.355L11.386 5.965L12.447 4.905L8.54198 1H7.99998ZM9.95598 13.013C9.95598 14.1176 9.06055 15.013 7.95598 15.013C6.85141 15.013 5.95598 14.1176 5.95598 13.013C5.95598 11.9084 6.85141 11.013 7.95598 11.013C9.06055 11.013 9.95598 11.9084 9.95598 13.013Z"/>\n\t</g>\n</svg>\n'}),F=new i.LabIcon({name:"debugger:variable",svgstr:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 4L1 4.5V12.5L1.5 13H4V12H2V5H4V4H1.5ZM14.5 13L15 12.5L15 4.5L14.5 4H12V5L14 5L14 12H12V13H14.5ZM8.79693 5L4.29693 7L4 7.45691V9.95691L4.24275 10.3857L6.74275 11.8857L7.20307 11.9138L11.7031 9.91381L12 9.45691V6.95691L11.7572 6.52816L9.25725 5.02816L8.79693 5ZM5 8.34V9.67381L6.5 10.5738V9.24L5 8.34ZM7.5 9.28184V10.6875L11 9.13197V7.72629L7.5 9.28184ZM10.4178 6.89071L8.96559 6.01936L5.58216 7.52311L7.03441 8.39445L10.4178 6.89071Z" fill="#007ACC"/>\n</svg>\n'}),L=new i.LabIcon({name:"debugger:view-breakpoint",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M5 2H15L20 7V20C20 20.5304 19.7893 21.0391 19.4142 21.4142C19.0391 21.7893 18.5304 22 18 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V14H4V16L8 13L4 10V12H3V4C3 3.46957 3.21071 2.96086 3.58579 2.58579C3.96086 2.21071 4.46957 2 5 2ZM12 18H16V16H12V18ZM12 14H18V12H12V14ZM12 10H18V8H12V10ZM10 14C10.5523 14 11 13.5523 11 13C11 12.4477 10.5523 12 10 12C9.44771 12 9 12.4477 9 13C9 13.5523 9.44771 14 10 14Z"/>\n <path d="M3 12V14H1V13V12H3Z"/>\n </g>\n</svg>\n'}),P=new i.LabIcon({name:"debugger:open-kernel-source",svgstr:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3" fill="#616161">\n <path d="M5 2H15L20 7V20C20 20.5304 19.7893 21.0391 19.4142 21.4142C19.0391 21.7893 18.5304 22 18 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V14H4V16L8 13L4 10V12H3V4C3 3.46957 3.21071 2.96086 3.58579 2.58579C3.96086 2.21071 4.46957 2 5 2ZM12 18H16V16H12V18ZM12 14H18V12H12V14ZM12 10H18V8H12V10ZM10 14C10.5523 14 11 13.5523 11 13C11 12.4477 10.5523 12 10 12C9.44771 12 9 12.4477 9 13C9 13.5523 9.44771 14 10 14Z"/>\n <path d="M3 12V14H1V13V12H3Z"/>\n </g>\n</svg>\n'});class O{constructor(){this._breakpoints=new Map,this._changed=new f.Signal(this),this._restored=new f.Signal(this),this._clicked=new f.Signal(this)}get changed(){return this._changed}get restored(){return this._restored}get clicked(){return this._clicked}get breakpoints(){return this._breakpoints}setBreakpoints(e,t){this._breakpoints.set(e,t),this._changed.emit(t)}getBreakpoints(e){var t;return null!==(t=this._breakpoints.get(e))&&void 0!==t?t:[]}restoreBreakpoints(e){this._breakpoints=e,this._restored.emit()}}class N{constructor(){this._state=[],this._currentFrame=null,this._framesChanged=new f.Signal(this),this._currentFrameChanged=new f.Signal(this)}get frames(){return this._state}set frames(e){this._state=e;const t=null!==this.frame?A.getFrameId(this.frame):"";e.find((e=>A.getFrameId(e)===t))||(this.frame=e[0]),this._framesChanged.emit(e)}get frame(){return this._currentFrame}set frame(e){this._currentFrame=e,this._currentFrameChanged.emit(e)}get framesChanged(){return this._framesChanged}get currentFrameChanged(){return this._currentFrameChanged}}var A;!function(e){e.getFrameId=function(e){var t;return`${null===(t=null==e?void 0:e.source)||void 0===t?void 0:t.path}-${null==e?void 0:e.id}`}}(A||(A={}));class q{constructor(e){this._currentSourceOpened=new f.Signal(this),this._currentSourceChanged=new f.Signal(this),this.currentFrameChanged=e.currentFrameChanged}get currentSourceOpened(){return this._currentSourceOpened}get currentSourceChanged(){return this._currentSourceChanged}get currentSource(){return this._currentSource}set currentSource(e){this._currentSource=e,this._currentSourceChanged.emit(e)}open(){this._currentSourceOpened.emit(this._currentSource)}}var W=s(97934);const Z=(e,t)=>e.name<t.name?-1:e.name>t.name?1:0;class K{constructor(){this._filteredKernelSources=null,this._filter="",this._isDisposed=!1,this._kernelSources=null,this._changed=new f.Signal(this),this._filterChanged=new f.Signal(this),this._kernelSourceOpened=new f.Signal(this),this.refresh=this.refresh.bind(this),this._refreshDebouncer=new W.Debouncer(this.refresh,500)}get filter(){return this._filter}set filter(e){this._filter=e,this._filterChanged.emit(e),this._refreshDebouncer.invoke()}get isDisposed(){return this._isDisposed}get kernelSources(){return this._kernelSources}set kernelSources(e){this._kernelSources=e,this.refresh()}get changed(){return this._changed}get filterChanged(){return this._filterChanged}get kernelSourceOpened(){return this._kernelSourceOpened}dispose(){this._isDisposed||(this._isDisposed=!0,this._refreshDebouncer.dispose(),f.Signal.clearData(this))}open(e){this._kernelSourceOpened.emit(e)}getFilteredKernelSources(){const e=new RegExp(this._filter);return this._kernelSources.filter((t=>e.test(t.name)))}refresh(){this._kernelSources?(this._filteredKernelSources=this._filter?this.getFilteredKernelSources():this._kernelSources,this._filteredKernelSources.sort(Z)):(this._kernelSources=new Array,this._filteredKernelSources=new Array),this._changed.emit(this._filteredKernelSources)}}class z{constructor(){this._selectedVariable=null,this._state=[],this._variableExpanded=new f.Signal(this),this._changed=new f.Signal(this)}get scopes(){return this._state}set scopes(e){this._state=e,this._changed.emit()}get changed(){return this._changed}get variableExpanded(){return this._variableExpanded}get selectedVariable(){return this._selectedVariable}set selectedVariable(e){this._selectedVariable=e}expandVariable(e){this._variableExpanded.emit(e)}}class G{constructor(){this._disposed=new f.Signal(this),this._isDisposed=!1,this._hasRichVariableRendering=!1,this._supportCopyToGlobals=!1,this._stoppedThreads=new Set,this._title="-",this._titleChanged=new f.Signal(this),this.breakpoints=new O,this.callstack=new N,this.variables=new z,this.sources=new q({currentFrameChanged:this.callstack.currentFrameChanged}),this.kernelSources=new K}get disposed(){return this._disposed}get hasRichVariableRendering(){return this._hasRichVariableRendering}set hasRichVariableRendering(e){this._hasRichVariableRendering=e}get supportCopyToGlobals(){return this._supportCopyToGlobals}set supportCopyToGlobals(e){this._supportCopyToGlobals=e}get isDisposed(){return this._isDisposed}get stoppedThreads(){return this._stoppedThreads}set stoppedThreads(e){this._stoppedThreads=e}get title(){return this._title}set title(e){e!==this._title&&(this._title=null!=e?e:"-",this._titleChanged.emit(e))}get titleChanged(){return this._titleChanged}dispose(){this._isDisposed||(this._isDisposed=!0,this.kernelSources.dispose(),this._disposed.emit())}clear(){this._stoppedThreads.clear();const e=new Map;this.breakpoints.restoreBreakpoints(e),this.callstack.frames=[],this.variables.scopes=[],this.sources.currentSource=null,this.kernelSources.kernelSources=null,this.title="-"}}class $ extends h.Panel{constructor(e){super(),this._filter=new Set,this._grid=null,this._pending=null,this.commands=e.commands,this.model=e.model,this.themeManager=e.themeManager,this.translator=e.translator,this.model.changed.connect((()=>this.update()),this),this.addClass("jp-DebuggerVariables-body")}get filter(){return this._filter}set filter(e){this._filter=e,this.update()}get scope(){return this._scope}set scope(e){this._scope=e,"Globals"!==e?this.addClass("jp-debuggerVariables-local"):this.removeClass("jp-debuggerVariables-local"),this.update()}async initialize(){if(this._grid||this._pending)return;const{Grid:e}=await(this._pending=Promise.all([s.e(9072),s.e(1958)]).then(s.bind(s,31958))),{commands:t,model:i,themeManager:r,translator:n}=this;this._grid=new e({commands:t,model:i,themeManager:r,translator:n}),this._grid.addClass("jp-DebuggerVariables-grid"),this._pending=null,this.addWidget(this._grid),this.update()}onBeforeShow(e){this._grid||this._pending||this.initialize(),super.onBeforeShow(e)}onUpdateRequest(e){var t;if(this._grid){const{dataModel:e}=this._grid;e.filter=this._filter,e.scope=this._scope,e.setData(null!==(t=this.model.scopes)&&void 0!==t?t:[])}super.onUpdateRequest(e)}}var U=s(81221),J=s(20998);class Y extends d.MainAreaWidget{constructor(e){const{dataLoader:t,rendermime:s,translator:i}=e,r=new h.Panel,n=new J.PromiseDelegate;super({content:r,reveal:Promise.all([t,n.promise])}),this.content.addClass("jp-VariableRendererPanel"),this.trans=(null!=i?i:v.nullTranslator).load("jupyterlab"),this.dataLoader=t,this.renderMime=s,this._dataHash=null,this.refresh().then((()=>{n.resolve()})).catch((e=>n.reject(e)))}async refresh(e=!1){let t=await this.dataLoader();if(0===Object.keys(t.data).length&&(t={data:{"text/plain":this.trans.__("The variable is undefined in the active context.")},metadata:{}}),!t.data)return this._dataHash=null,Promise.reject("Unable to get a view on the variable.");{const s=o(JSON.stringify(t),17);if(e||this._dataHash!==s){this.content.layout&&this.content.widgets.forEach((e=>{this.content.layout.removeWidget(e)}));const e=this.renderMime.preferredMimeType(t.data,"any");if(!e)return this._dataHash=null,Promise.reject("Unable to determine the preferred mime type.");{const i=this.renderMime.createRenderer(e);i.addClass("jp-VariableRendererPanel-renderer");const r=new U.MimeModel({...t,trusted:!0});this._dataHash=s,await i.renderModel(r),this.content.addWidget(i)}}}}}class Q{constructor(e){var t,s;this._eventMessage=new f.Signal(this),this._isDisposed=!1,this._sessionChanged=new f.Signal(this),this._pauseOnExceptionChanged=new f.Signal(this),this._config=e.config,this._session=null,this._specsManager=null!==(t=e.specsManager)&&void 0!==t?t:null,this._model=new He.Model,this._debuggerSources=null!==(s=e.debuggerSources)&&void 0!==s?s:null,this._trans=(e.translator||v.nullTranslator).load("jupyterlab")}get eventMessage(){return this._eventMessage}get config(){return this._config}get isDisposed(){return this._isDisposed}get isStarted(){var e,t;return null!==(t=null===(e=this._session)||void 0===e?void 0:e.isStarted)&&void 0!==t&&t}get pauseOnExceptionChanged(){return this._pauseOnExceptionChanged}get model(){return this._model}get session(){return this._session}set session(e){var t;this._session!==e&&(this._session&&this._session.dispose(),this._session=e,null===(t=this._session)||void 0===t||t.eventMessage.connect(((e,t)=>{"stopped"===t.event?(this._model.stoppedThreads.add(t.body.threadId),this._getAllFrames()):"continued"===t.event&&(this._model.stoppedThreads.delete(t.body.threadId),this._clearModel(),this._clearSignals()),this._eventMessage.emit(t)})),this._sessionChanged.emit(e))}get sessionChanged(){return this._sessionChanged}dispose(){this.isDisposed||(this._isDisposed=!0,f.Signal.clearData(this))}getCodeId(e){var t,s,i,r;try{return this._config.getCodeId(e,null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"")}catch(e){return""}}hasStoppedThreads(){var e,t;return null!==(t=(null===(e=this._model)||void 0===e?void 0:e.stoppedThreads.size)>0)&&void 0!==t&&t}async isAvailable(e){var t,s,i,r;if(!this._specsManager)return!0;await this._specsManager.ready;const n=null==e?void 0:e.kernel;if(!n)return!1;const o=n.name;return!(null===(t=this._specsManager.specs)||void 0===t?void 0:t.kernelspecs[o])||!(null===(r=null===(i=null===(s=this._specsManager.specs.kernelspecs[o])||void 0===s?void 0:s.metadata)||void 0===i?void 0:i.debugger)||void 0===r||!r)}async clearBreakpoints(){var e;if(!0!==(null===(e=this.session)||void 0===e?void 0:e.isStarted))return;this._model.breakpoints.breakpoints.forEach(((e,t,s)=>{this._setBreakpoints([],t)}));let t=new Map;this._model.breakpoints.restoreBreakpoints(t)}async continue(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("continue",{threadId:this._currentThread()}),this._model.stoppedThreads.delete(this._currentThread()),this._clearModel(),this._clearSignals()}catch(e){console.error("Error:",e.message)}}async getSource(e){var t,s;if(!this.session)throw new Error("No active debugger session");return{...(await this.session.sendRequest("source",{source:e,sourceReference:null!==(t=e.sourceReference)&&void 0!==t?t:0})).body,path:null!==(s=e.path)&&void 0!==s?s:""}}async evaluate(e){var t;if(!this.session)throw new Error("No active debugger session");const s=null===(t=this.model.callstack.frame)||void 0===t?void 0:t.id,i=await this.session.sendRequest("evaluate",{context:"repl",expression:e,frameId:s});return i.success?(this._clearModel(),await this._getAllFrames(),i.body):null}async next(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("next",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async inspectRichVariable(e,t){if(!this.session)throw new Error("No active debugger session");const s=await this.session.sendRequest("richInspectVariables",{variableName:e,frameId:t});if(s.success)return s.body;throw new Error(s.message)}async inspectVariable(e){if(!this.session)throw new Error("No active debugger session");const t=await this.session.sendRequest("variables",{variablesReference:e});if(t.success)return t.body.variables;throw new Error(t.message)}async copyToGlobals(e){if(!this.session)throw new Error("No active debugger session");if(!this.model.supportCopyToGlobals)throw new Error('The "copyToGlobals" request is not supported by the kernel');const t=this.model.callstack.frames;this.session.sendRequest("copyToGlobals",{srcVariableName:e,dstVariableName:e,srcFrameId:t[0].id}).then((async()=>{const e=await this._getScopes(t[0]),s=await Promise.all(e.map((e=>this._getVariables(e)))),i=this._convertScopes(e,s);this._model.variables.scopes=i})).catch((e=>{console.error(e)}))}async displayDefinedVariables(){if(!this.session)throw new Error("No active debugger session");const e=(await this.session.sendRequest("inspectVariables",{})).body.variables,t=[{name:this._trans.__("Globals"),variables:e}];this._model.variables.scopes=t}async displayModules(){if(!this.session)throw new Error("No active debugger session");const e=await this.session.sendRequest("modules",{});this._model.kernelSources.kernelSources=e.body.modules.map((e=>({name:e.name,path:e.path})))}async restart(){const{breakpoints:e}=this._model.breakpoints;await this.stop(),await this.start(),await this._restoreBreakpoints(e)}async restoreState(e){var t,s,i,r,n,o,a,l,d,c;if(!this.model||!this.session)return;const h=await this.session.restoreState(),{body:u}=h,p=this._mapBreakpoints(u.breakpoints),g=new Set(u.stoppedThreads);if(this._model.hasRichVariableRendering=!0===u.richRendering,this._model.supportCopyToGlobals=!0===u.copyToGlobals,this._config.setHashParams({kernel:null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",method:u.hashMethod,seed:u.hashSeed}),this._config.setTmpFileParams({kernel:null!==(l=null===(a=null===(o=null===(n=this.session)||void 0===n?void 0:n.connection)||void 0===o?void 0:o.kernel)||void 0===a?void 0:a.name)&&void 0!==l?l:"",prefix:u.tmpFilePrefix,suffix:u.tmpFileSuffix}),this._model.stoppedThreads=g,this.isStarted||!e&&0===g.size||await this.start(),(this.isStarted||e)&&(this._model.title=this.isStarted&&(null===(c=null===(d=this.session)||void 0===d?void 0:d.connection)||void 0===c?void 0:c.name)||"-"),this._debuggerSources){const e=this._filterBreakpoints(p);this._model.breakpoints.restoreBreakpoints(e)}else this._model.breakpoints.restoreBreakpoints(p);0!==g.size?await this._getAllFrames():this.isStarted&&(this._clearModel(),this._clearSignals()),this.session.currentExceptionFilters&&await this.pauseOnExceptions(this.session.currentExceptionFilters)}start(){if(!this.session)throw new Error("No active debugger session");return this.session.start()}async pause(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("pause",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepIn(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("stepIn",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepOut(){try{if(!this.session)throw new Error("No active debugger session");await this.session.sendRequest("stepOut",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stop(){if(!this.session)throw new Error("No active debugger session");await this.session.stop(),this._model&&this._model.clear()}async updateBreakpoints(e,t,s){var i;if(!(null===(i=this.session)||void 0===i?void 0:i.isStarted))return;s||(s=(await this._dumpCell(e)).body.sourcePath);const r=await this.session.restoreState(),n=t.filter((({line:e})=>"number"==typeof e)).map((({line:e})=>({line:e}))),o=this._mapBreakpoints(r.body.breakpoints);if(this._debuggerSources){const e=this._filterBreakpoints(o);this._model.breakpoints.restoreBreakpoints(e)}else this._model.breakpoints.restoreBreakpoints(o);let a=new Set;const l=(await this._setBreakpoints(n,s)).body.breakpoints.filter(((e,t,s)=>{const i=s.findIndex((t=>t.line===e.line))>-1,r=!a.has(e.line);return a.add(e.line),i&&r}));this._model.breakpoints.setBreakpoints(s,l),await this.session.sendRequest("configurationDone",{})}pauseOnExceptionsIsValid(){var e,t;return!(!this.isStarted||0===(null===(t=null===(e=this.session)||void 0===e?void 0:e.exceptionBreakpointFilters)||void 0===t?void 0:t.length))}async pauseOnExceptionsFilter(e){var t;if(!(null===(t=this.session)||void 0===t?void 0:t.isStarted))return;let s=this.session.currentExceptionFilters;if(this.session.isPausingOnException(e)){const t=s.indexOf(e);s.splice(t,1)}else null==s||s.push(e);await this.pauseOnExceptions(s)}async pauseOnExceptions(e){var t,s;if(!(null===(t=this.session)||void 0===t?void 0:t.isStarted))return;const i=(null===(s=this.session.exceptionBreakpointFilters)||void 0===s?void 0:s.map((e=>e.filter)))||[];let r={filters:[]};e.forEach((e=>{i.includes(e)&&r.filters.push(e)})),this.session.currentExceptionFilters=r.filters,await this.session.sendRequest("setExceptionBreakpoints",r),this._pauseOnExceptionChanged.emit()}getDebuggerState(){var e,t,s,i,r,n,o;const a=this._model.breakpoints.breakpoints;let l=[];if(this._debuggerSources)for(const d of a.keys()){const a=this._debuggerSources.find({focus:!1,kernel:null!==(i=null===(s=null===(t=null===(e=this.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.name)&&void 0!==i?i:"",path:null!==(o=null===(n=null===(r=this._session)||void 0===r?void 0:r.connection)||void 0===n?void 0:n.path)&&void 0!==o?o:"",source:d}).map((e=>e.src.getSource()));l=l.concat(a)}return{cells:l,breakpoints:a}}async restoreDebuggerState(e){var t,s,i,r;await this.start();for(const t of e.cells)await this._dumpCell(t);const n=new Map,o=null!==(r=null===(i=null===(s=null===(t=this.session)||void 0===t?void 0:t.connection)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",{prefix:a,suffix:l}=this._config.getTmpFileParams(o);for(const t of e.breakpoints){const[e,s]=t,i=e.substr(0,e.length-l.length),r=i.substr(i.lastIndexOf("/")+1),o=a.concat(r).concat(l);n.set(o,s)}await this._restoreBreakpoints(n);const d=await this.session.sendRequest("configurationDone",{});return await this.restoreState(!1),d.success}_clearModel(){this._model.callstack.frames=[],this._model.variables.scopes=[]}_clearSignals(){this._model.callstack.currentFrameChanged.disconnect(this._onCurrentFrameChanged,this),this._model.variables.variableExpanded.disconnect(this._onVariableExpanded,this)}_convertScopes(e,t){return t&&e?e.map(((e,s)=>({name:e.name,variables:t[s].map((e=>({...e})))}))):[]}_currentThread(){return 1}async _dumpCell(e){if(!this.session)throw new Error("No active debugger session");return this.session.sendRequest("dumpCell",{code:e})}_filterBreakpoints(e){if(!this._debuggerSources)return e;let t=new Map;for(const s of e){const[e,i]=s;i.forEach((()=>{var s,r,n,o,a,l,d;this._debuggerSources.find({focus:!1,kernel:null!==(o=null===(n=null===(r=null===(s=this.session)||void 0===s?void 0:s.connection)||void 0===r?void 0:r.kernel)||void 0===n?void 0:n.name)&&void 0!==o?o:"",path:null!==(d=null===(l=null===(a=this._session)||void 0===a?void 0:a.connection)||void 0===l?void 0:l.path)&&void 0!==d?d:"",source:e}).forEach((()=>{i.length>0&&t.set(e,i)}))}))}return t}async _getAllFrames(){this._model.callstack.currentFrameChanged.connect(this._onCurrentFrameChanged,this),this._model.variables.variableExpanded.connect(this._onVariableExpanded,this);const e=await this._getFrames(this._currentThread());this._model.callstack.frames=e}async _getFrames(e){if(!this.session)throw new Error("No active debugger session");return(await this.session.sendRequest("stackTrace",{threadId:e})).body.stackFrames}async _getScopes(e){if(!this.session)throw new Error("No active debugger session");return e?(await this.session.sendRequest("scopes",{frameId:e.id})).body.scopes:[]}async _getVariables(e){if(!this.session)throw new Error("No active debugger session");return e?(await this.session.sendRequest("variables",{variablesReference:e.variablesReference})).body.variables:[]}_mapBreakpoints(e){return e.length?e.reduce(((e,t)=>{const{breakpoints:s,source:i}=t;return e.set(i,s.map((e=>({...e,source:{path:i},verified:!0})))),e}),new Map):new Map}async _onCurrentFrameChanged(e,t){if(!t)return;const s=await this._getScopes(t),i=await Promise.all(s.map((e=>this._getVariables(e)))),r=this._convertScopes(s,i);this._model.variables.scopes=r}async _onVariableExpanded(e,t){if(!this.session)throw new Error("No active debugger session");const s=await this.session.sendRequest("variables",{variablesReference:t.variablesReference});let i={...t,expanded:!0};s.body.variables.forEach((e=>{i={[e.name]:e,...i}}));const r=this._model.variables.scopes.map((e=>{const s=e.variables.findIndex((e=>e.variablesReference===t.variablesReference));return e.variables[s]=i,{...e}}));return this._model.variables.scopes=[...r],s.body.variables}async _setBreakpoints(e,t){if(!this.session)throw new Error("No active debugger session");return await this.session.sendRequest("setBreakpoints",{breakpoints:e,source:{path:t},sourceModified:!1})}async _restoreBreakpoints(e){for(const[t,s]of e)await this._setBreakpoints(s.filter((({line:e})=>"number"==typeof e)).map((({line:e})=>({line:e}))),t);this._model.breakpoints.restoreBreakpoints(e)}}class X{constructor(e){this._seq=0,this._ready=new J.PromiseDelegate,this._isDisposed=!1,this._isStarted=!1,this._exceptionPaths=[],this._exceptionBreakpointFilters=[],this._currentExceptionFilters={},this._disposed=new f.Signal(this),this._eventMessage=new f.Signal(this),this.connection=e.connection,this._config=e.config,this.translator=e.translator||v.nullTranslator}get isDisposed(){return this._isDisposed}get capabilities(){return this._capabilities}get disposed(){return this._disposed}get connection(){return this._connection}set connection(e){var t,s;if(this._connection&&this._connection.iopubMessage.disconnect(this._handleEvent,this),this._connection=e,!this._connection)return void(this._isStarted=!1);this._connection.iopubMessage.connect(this._handleEvent,this),this._ready=new J.PromiseDelegate;const i=null===(s=null===(t=this.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.requestDebug({type:"request",seq:0,command:"debugInfo"});i&&(i.onReply=e=>{this._ready.resolve(),i.dispose()})}get isStarted(){return this._isStarted}get exceptionPaths(){return this._exceptionPaths}get exceptionBreakpointFilters(){return this._exceptionBreakpointFilters}get currentExceptionFilters(){var e,t,s;const i=null!==(s=null===(t=null===(e=this.connection)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==s?s:"";if(!i)return[];const r=this._config.getTmpFileParams(i);if(!r)return[];let n=r.prefix;return Object.keys(this._currentExceptionFilters).includes(n)?this._currentExceptionFilters[n]:[]}set currentExceptionFilters(e){var t,s,i;const r=null!==(i=null===(s=null===(t=this.connection)||void 0===t?void 0:t.kernel)||void 0===s?void 0:s.name)&&void 0!==i?i:"";if(!r)return;const n=this._config.getTmpFileParams(r);if(!n)return;let o=n.prefix;null===e?Object.keys(this._currentExceptionFilters).includes(o)&&delete this._currentExceptionFilters[o]:this._currentExceptionFilters[o]=e}get eventMessage(){return this._eventMessage}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposed.emit(),f.Signal.clearData(this))}async start(){var e,t,s,i;const r=await this.sendRequest("initialize",{clientID:"jupyterlab",clientName:"JupyterLab",adapterID:null!==(s=null===(t=null===(e=this.connection)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==s?s:"",pathFormat:"path",linesStartAt1:!0,columnsStartAt1:!0,supportsVariableType:!0,supportsVariablePaging:!0,supportsRunInTerminalRequest:!0,locale:document.documentElement.lang});if(!r.success)throw new Error(`Could not start the debugger: ${r.message}`);this._capabilities=r.body,this._isStarted=!0,this._exceptionBreakpointFilters=null===(i=r.body)||void 0===i?void 0:i.exceptionBreakpointFilters,await this.sendRequest("attach",{})}async stop(){this._isStarted=!1,await this.sendRequest("disconnect",{restart:!1,terminateDebuggee:!1})}async restoreState(){var e;const t=await this.sendRequest("debugInfo",{});return this._isStarted=t.body.isStarted,this._exceptionPaths=null===(e=t.body)||void 0===e?void 0:e.exceptionPaths,t}isPausingOnException(e){var t,s;return e?null!==(s=null===(t=this.currentExceptionFilters)||void 0===t?void 0:t.includes(e))&&void 0!==s&&s:this.currentExceptionFilters.length>0}async sendRequest(e,t){return await this._ready.promise,(await this._sendDebugMessage({type:"request",seq:this._seq++,command:e,arguments:t})).content}_handleEvent(e,t){if("debug_event"!==t.header.msg_type)return;const s=t.content;this._eventMessage.emit(s)}async _sendDebugMessage(e){var t;const s=null===(t=this.connection)||void 0===t?void 0:t.kernel;if(!s)return Promise.reject(new Error("A kernel is required to send debug messages."));const i=new J.PromiseDelegate,r=s.requestDebug(e);return r.onReply=e=>{i.resolve(e)},await r.done,i.promise}}var ee=s(78156),te=s.n(ee);class se extends i.ReactWidget{constructor(e){super(),this._model=e,this.addClass("jp-DebuggerBreakpoints-body")}render(){return te().createElement(ie,{model:this._model})}}const ie=({model:e})=>{const[t,s]=(0,ee.useState)(Array.from(e.breakpoints.entries()));return(0,ee.useEffect)((()=>{const t=(t,i)=>{s(Array.from(e.breakpoints.entries()))},i=t=>{s(Array.from(e.breakpoints.entries()))};return e.changed.connect(t),e.restored.connect(i),()=>{e.changed.disconnect(t),e.restored.disconnect(i)}})),te().createElement(te().Fragment,null,t.map((t=>te().createElement(re,{key:t[0],breakpoints:t[1],model:e}))))},re=({breakpoints:e,model:t})=>te().createElement(te().Fragment,null,e.sort(((e,t)=>{var s,i;return(null!==(s=e.line)&&void 0!==s?s:0)-(null!==(i=t.line)&&void 0!==i?i:0)})).map(((e,s)=>{var i,r;return te().createElement(ne,{key:(null!==(r=null===(i=e.source)||void 0===i?void 0:i.path)&&void 0!==r?r:"")+s,breakpoint:e,model:t})}))),ne=({breakpoint:e,model:t})=>{var s,i,r,n;return te().createElement("div",{className:"jp-DebuggerBreakpoint",onClick:()=>t.clicked.emit(e),title:null===(s=e.source)||void 0===s?void 0:s.path},te().createElement("span",{className:"jp-DebuggerBreakpoint-marker"},"●"),te().createElement("span",{className:"jp-DebuggerBreakpoint-source jp-left-truncated"},"/"===(n=null!==(r=null===(i=e.source)||void 0===i?void 0:i.path)&&void 0!==r?r:"")[0]?n.slice(1)+"/":n),te().createElement("span",{className:"jp-DebuggerBreakpoint-line"},e.line))},oe="jp-PauseOnExceptions";class ae extends i.ToolbarButton{constructor(e){super(),this.onclick=()=>{this._menu.open(this.node.getBoundingClientRect().left,this.node.getBoundingClientRect().bottom)},this._menu=new le({service:e.service,commands:{registry:e.commands.registry,pauseOnExceptions:e.commands.pauseOnExceptions}}),this.node.className="jp-debugger-pauseOnExceptions",this._props=e,this._props.className=oe,this._props.service.eventMessage.connect(((e,t)=>{"initialized"!==t.event&&"terminated"!==t.event||this.onChange()}),this),this._props.enabled=this._props.service.pauseOnExceptionsIsValid(),this._props.service.pauseOnExceptionChanged.connect(this.onChange,this)}onChange(){var e;const t=this._props.service.session,s=null==t?void 0:t.exceptionBreakpointFilters;this._props.className=oe,(null===(e=this._props.service.session)||void 0===e?void 0:e.isStarted)&&s?(this._props.pressed=t.isPausingOnException(),this._props.enabled=!0):this._props.enabled=!1,this.update()}render(){return ee.createElement(i.ToolbarButtonComponent,{...this._props,onClick:this.onclick})}}class le extends i.MenuSvg{constructor(e){super({commands:e.commands.registry}),this._service=e.service,this._command=e.commands.pauseOnExceptions,e.service.eventMessage.connect(((e,t)=>{"initialized"===t.event&&this._build()}),this),this._build(),this.addClass("jp-PauseOnExceptions-menu")}_build(){var e,t;this.clearItems(),(null!==(t=null===(e=this._service.session)||void 0===e?void 0:e.exceptionBreakpointFilters)&&void 0!==t?t:[]).map(((e,t)=>{this.addItem({command:this._command,args:{filter:e.filter,description:e.description}})}))}}class de extends i.PanelWithToolbar{constructor(e){var t;super(e),this.clicked=new f.Signal(this);const{model:s,service:r,commands:n}=e,o=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=o.__("Breakpoints");const a=new se(s);this.toolbar.addItem("pauseOnException",new ae({service:r,commands:n,icon:V,tooltip:o.__("Pause on exception filter")})),this.toolbar.addItem("closeAll",new i.ToolbarButton({icon:I,onClick:async()=>{if(0!==s.breakpoints.size)return(await(0,d.showDialog)({title:o.__("Remove All Breakpoints"),body:o.__("Are you sure you want to remove all breakpoints?"),buttons:[d.Dialog.okButton({label:o.__("Remove breakpoints")}),d.Dialog.cancelButton()],hasClose:!0})).button.accept?r.clearBreakpoints():void 0},tooltip:o.__("Remove All Breakpoints")})),this.addWidget(a),this.addClass("jp-DebuggerBreakpoints")}}class ce extends i.ReactWidget{constructor(e){super(),this._model=e,this.addClass("jp-DebuggerCallstack-body")}render(){return te().createElement(he,{model:this._model})}}const he=({model:e})=>{const[t,s]=(0,ee.useState)(e.frames),[i,r]=(0,ee.useState)(e.frame);return(0,ee.useEffect)((()=>{const t=()=>{r(e.frame),s(e.frames)};return e.framesChanged.connect(t),()=>{e.framesChanged.disconnect(t)}}),[e]),te().createElement("ul",null,t.map((t=>{var s;return te().createElement("li",{key:t.id,onClick:()=>{return r(s=t),void(e.frame=s);var s},className:(null==i?void 0:i.id)===t.id?"selected jp-DebuggerCallstackFrame":"jp-DebuggerCallstackFrame"},te().createElement("span",{className:"jp-DebuggerCallstackFrame-name"},t.name),te().createElement("span",{className:"jp-DebuggerCallstackFrame-location",title:null===(s=t.source)||void 0===s?void 0:s.path},(e=>{var t;const s=(null===(t=e.source)||void 0===t?void 0:t.path)||"",i=w.PathExt.basename(w.PathExt.dirname(s)),r=w.PathExt.basename(s);return`${w.PathExt.join(i,r)}:${e.line}`})(t)))})))};class ue extends i.PanelWithToolbar{constructor(e){var t;super(e);const{commands:s,model:r}=e,n=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=n.__("Callstack");const o=new ce(r);this.toolbar.addItem("continue",new i.CommandToolbarButton({commands:s.registry,id:s.continue,label:""})),this.toolbar.addItem("terminate",new i.CommandToolbarButton({commands:s.registry,id:s.terminate,label:""})),this.toolbar.addItem("step-over",new i.CommandToolbarButton({commands:s.registry,id:s.next,label:""})),this.toolbar.addItem("step-in",new i.CommandToolbarButton({commands:s.registry,id:s.stepIn,label:""})),this.toolbar.addItem("step-out",new i.CommandToolbarButton({commands:s.registry,id:s.stepOut,label:""})),this.toolbar.addItem("evaluate",new i.CommandToolbarButton({commands:s.registry,id:s.evaluate,label:""})),this.addWidget(o),this.addClass("jp-DebuggerCallstack")}}const pe=({model:e})=>te().createElement(i.UseSignal,{signal:e.currentSourceChanged,initialSender:e},(e=>{var t,s;return te().createElement("span",{onClick:()=>null==e?void 0:e.open(),className:"jp-DebuggerSources-header-path"},null!==(s=null===(t=null==e?void 0:e.currentSource)||void 0===t?void 0:t.path)&&void 0!==s?s:"")}));class ge extends h.Widget{constructor(e){super(),this._model=e.model,this._debuggerService=e.service,this._mimeTypeService=e.editorServices.mimeTypeService;const t=new He.ReadOnlyEditorFactory({editorServices:e.editorServices});this._editor=t.createNewEditor({content:"",mimeType:"",path:""}),this._editor.hide(),this._model.currentFrameChanged.connect((async(e,t)=>{t?this._showSource(t):this._clearEditor()}));const s=new h.PanelLayout;s.addWidget(this._editor),this.layout=s,this.addClass("jp-DebuggerSources-body")}dispose(){var e;this.isDisposed||(null===(e=this._editorHandler)||void 0===e||e.dispose(),f.Signal.clearData(this),super.dispose())}_clearEditor(){this._model.currentSource=null,this._editor.hide()}async _showSource(e){var t;const s=null===(t=e.source)||void 0===t?void 0:t.path,i=await this._debuggerService.getSource({sourceReference:0,path:s});if(!(null==i?void 0:i.content))return void this._clearEditor();this._editorHandler&&this._editorHandler.dispose();const{content:r,mimeType:n}=i,o=n||this._mimeTypeService.getMimeTypeByFilePath(null!=s?s:"");this._editor.model.sharedModel.setSource(r),this._editor.model.mimeType=o,this._editorHandler=new C({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._editor.editor),getEditor:()=>this._editor.editor,path:s,src:this._editor.model.sharedModel}),this._model.currentSource={content:r,mimeType:o,path:null!=s?s:""},requestAnimationFrame((()=>{C.showCurrentLine(this._editor.editor,e.line)})),this._editor.show()}}class _e extends i.PanelWithToolbar{constructor(e){var t;super();const{model:s,service:r,editorServices:n}=e,o=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=o.__("Source"),this.toolbar.addClass("jp-DebuggerSources-header");const a=new ge({service:r,model:s,editorServices:n});this.toolbar.addItem("open",new i.ToolbarButton({icon:L,onClick:()=>s.open(),tooltip:o.__("Open in the Main Area")}));const l=i.ReactWidget.create(te().createElement(pe,{model:s}));this.toolbar.addItem("sourcePath",l),this.addClass("jp-DebuggerSources-header"),this.addWidget(a),this.addClass("jp-DebuggerSources")}}var me=s(31884);const ve=e=>te().createElement(me.o,{onChange:t=>{const s=t.target.value;e.model.filter=s},placeholder:e.trans.__("Filter the kernel sources"),value:e.model.filter}),be=e=>te().createElement(i.UseSignal,{signal:e.model.filterChanged,initialArgs:e.model.filter},(t=>te().createElement(ve,{model:e.model,trans:e.trans})));class fe extends i.ReactWidget{constructor(e){var t;super(),this._showFilter=!1,this._model=e.model,this._debuggerService=e.service,this._trans=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab"),this.addClass("jp-DebuggerKernelSources-body")}render(){let e="jp-DebuggerKernelSource-filterBox";return this._showFilter||(e+=" jp-DebuggerKernelSource-filterBox-hidden"),te().createElement(te().Fragment,null,te().createElement("div",{className:e,key:"filter"},te().createElement(be,{model:this._model,trans:this._trans})),te().createElement(i.UseSignal,{signal:this._model.changed},((e,t)=>{const s={};return(null!=t?t:[]).map((e=>{var t;const r=e.name,n=e.path,o=r+(s[r]=(null!==(t=s[r])&&void 0!==t?t:0)+1).toString();return te().createElement("div",{key:o,title:n,className:"jp-DebuggerKernelSource-source",onClick:()=>{this._debuggerService.getSource({sourceReference:0,path:n}).then((e=>{this._model.open(e)})).catch((e=>{(0,d.showErrorMessage)(this._trans.__("Fail to get source"),this._trans.__("Fail to get '%1' source:\n%2",n,e))}))}},te().createElement(i.LabIcon.resolveReact,{icon:P,iconClass:(0,i.classes)("jp-Icon"),tag:null}),r)}))})))}toggleFilterbox(){this._showFilter=!this._showFilter,this.update()}}class we extends i.PanelWithToolbar{constructor(e){var t;super();const{model:s,service:r}=e;this._model=s;const n=(null!==(t=e.translator)&&void 0!==t?t:v.nullTranslator).load("jupyterlab");this.title.label=n.__("Kernel Sources"),this.toolbar.addClass("jp-DebuggerKernelSources-header"),this._body=new fe({service:r,model:s,translator:e.translator}),this.toolbar.addItem("open-filter",new i.ToolbarButton({icon:i.searchIcon,onClick:async()=>{this._body.toggleFilterbox()},tooltip:n.__("Toggle search filter")})),this.toolbar.addItem("refresh",new i.ToolbarButton({icon:i.refreshIcon,onClick:()=>{this._model.kernelSources=[],r.displayModules().catch((e=>{(0,d.showErrorMessage)(n.__("Fail to get kernel sources"),n.__("Fail to get kernel sources:\n%2",e))}))},tooltip:n.__("Refresh kernel sources")})),this.addClass("jp-DebuggerKernelSources-header"),this.addWidget(this._body),this.addClass("jp-DebuggerKenelSources")}set filter(e){this._model.filter=e}}const ke=({model:e,tree:t,grid:s,trans:r})=>{const[n,o]=(0,ee.useState)("-"),a=e.scopes;return te().createElement(i.HTMLSelect,{onChange:e=>{const i=e.target.value;o(i),t.scope=i,s.scope=i},value:n,"aria-label":r.__("Scope")},a.map((e=>te().createElement("option",{key:e.name,value:e.name},r.__(e.name)))))};class Se extends i.ReactWidget{constructor(e){super();const{translator:t,model:s,tree:i,grid:r}=e;this._model=s,this._tree=i,this._grid=r,this._trans=(t||v.nullTranslator).load("jupyterlab")}render(){return te().createElement(i.UseSignal,{signal:this._model.changed,initialSender:this._model},(()=>te().createElement(ke,{model:this._model,trans:this._trans,tree:this._tree,grid:this._grid})))}}var Ce=s(33625);const ye="jp-DebuggerVariables-buttons";class Ee extends i.ReactWidget{constructor(e){super(),this._scope="",this._scopes=[],this._filter=new Set,this._commands=e.commands,this._service=e.service,this._translator=e.translator,this._hoverChanged=new f.Signal(this),(this.model=e.model).changed.connect(this._updateScopes,this),this.addClass("jp-DebuggerVariables-body")}render(){var e;const t=null!==(e=this._scopes.find((e=>e.name===this._scope)))&&void 0!==e?e:this._scopes[0],s=e=>{this.model.selectedVariable=e},r=te().createElement(i.caretDownEmptyIcon.react,{stylesheet:"menuItem",tag:"span"});return"Globals"!==(null==t?void 0:t.name)?this.addClass("jp-debuggerVariables-local"):this.removeClass("jp-debuggerVariables-local"),t?te().createElement(te().Fragment,null,te().createElement(Me,{key:t.name,commands:this._commands,service:this._service,data:t.variables,filter:this._filter,translator:this._translator,handleSelectVariable:s,onHoverChanged:e=>{this._hoverChanged.emit(e)},collapserIcon:r}),te().createElement(xe,{commands:this._commands,service:this._service,hoverChanged:this._hoverChanged,handleSelectVariable:s})):te().createElement("div",null)}set filter(e){this._filter=e,this.update()}set scope(e){this._scope=e,this.update()}_updateScopes(e){Ce.ArrayExt.shallowEqual(this._scopes,e.scopes)||(this._scopes=e.scopes,this.update())}}const xe=e=>{var t;const{commands:s,service:r,translator:n,handleSelectVariable:o}=e,a=(null!=n?n:v.nullTranslator).load("jupyterlab"),[l,d]=(0,ee.useState)(0),[c,h]=(0,ee.useState)(null);let u=0;const p=(0,ee.useCallback)(((e,t)=>{const s=++u;if(t.variable)h(t.variable),requestAnimationFrame((()=>{s===u&&t.target&&d(t.target.offsetTop)}));else{if(s!==u)return;const e=t.target;if(e&&e instanceof Element&&e.closest(`.${ye}`))return;h(null)}}),[]);return(0,ee.useEffect)((()=>(e.hoverChanged.connect(p),()=>{e.hoverChanged.disconnect(p)})),[p]),te().createElement("div",{className:ye,style:{transform:`translateY(${l}px)`,opacity:!c||["special variables","protected variables","function variables","class variables"].includes(c.name)?0:1}},te().createElement("button",{className:"jp-DebuggerVariables-renderVariable",disabled:!c||!r.model.hasRichVariableRendering||!s.isEnabled(He.CommandIDs.renderMimeVariable,{name:c.name,frameID:null===(t=r.model.callstack.frame)||void 0===t?void 0:t.id}),onClick:e=>{var t;c&&o&&(e.stopPropagation(),o(c),s.execute(He.CommandIDs.renderMimeVariable,{name:c.name,frameID:null===(t=r.model.callstack.frame)||void 0===t?void 0:t.id}).catch((e=>{console.error(`Failed to render variable ${null==c?void 0:c.name}`,e)})))},title:a.__("Render variable: %1",null==c?void 0:c.name)},te().createElement(i.searchIcon.react,{stylesheet:"menuItem",tag:"span"})))},Me=e=>{const{commands:t,data:s,service:i,filter:r,translator:n,handleSelectVariable:o,onHoverChanged:a,collapserIcon:l}=e,[d,c]=(0,ee.useState)(s);return(0,ee.useEffect)((()=>{c(s)}),[s]),te().createElement("ul",{className:"jp-DebuggerVariables-branch"},d.filter((e=>!(r||new Set).has(e.evaluateName||""))).map((e=>{const s=`${e.name}-${e.evaluateName}-${e.type}-${e.value}-${e.variablesReference}`;return te().createElement(De,{key:s,commands:t,data:e,service:i,filter:r,translator:n,onSelect:o,onHoverChanged:a,collapserIcon:l})})))},De=e=>{const{commands:t,data:s,service:i,filter:r,translator:n,onSelect:o,onHoverChanged:a,collapserIcon:l}=e,[d]=(0,ee.useState)(s),[c,h]=(0,ee.useState)(),[u,p]=(0,ee.useState)(),g=null!=o?o:()=>{},_=0!==d.variablesReference||"function"===d.type;return te().createElement("li",{onClick:e=>(async e=>{if(!_)return;e.stopPropagation();const t=await i.inspectVariable(d.variablesReference);h(!c),p(t)})(e),onMouseDown:e=>{e.stopPropagation(),g(d)},onMouseOver:e=>{a&&(a({target:e.currentTarget,variable:d}),e.stopPropagation())},onMouseLeave:e=>{a&&(a({target:e.relatedTarget,variable:null}),e.stopPropagation())}},te().createElement("span",{className:"jp-DebuggerVariables-collapser"+(c?" jp-mod-expanded":"")},_?te().cloneElement(l):null),te().createElement("span",{className:"jp-DebuggerVariables-name"},d.name),te().createElement("span",{className:"jp-DebuggerVariables-detail"},function(e){if("float"===e.type&&("inf"==e.value||"-inf"==e.value))return e.value;const t=Ie(e);return"float"===e.type&&isNaN(t)?"NaN":t}(d)),c&&u&&te().createElement(Me,{key:d.name,commands:t,data:u,service:i,filter:r,translator:n,handleSelectVariable:o,onHoverChanged:a,collapserIcon:l}))};class Te extends i.PanelWithToolbar{constructor(e){super(e);const{model:t,service:s,commands:r,themeManager:n}=e,o=e.translator||v.nullTranslator,a=o.load("jupyterlab");this.title.label=a.__("Variables"),this.toolbar.addClass("jp-DebuggerVariables-toolbar"),this._tree=new Ee({model:t,service:s,commands:r,translator:o}),this._table=new $({model:t,commands:r,themeManager:n,translator:o}),this._table.hide(),this.toolbar.addItem("scope-switcher",new Se({translator:o,model:t,tree:this._tree,grid:this._table}));const l=()=>{this._table.isHidden?(this._tree.hide(),this._table.show(),this.node.setAttribute("data-jp-table","true"),h("table")):(this._tree.show(),this._table.hide(),this.node.removeAttribute("data-jp-table"),h("tree")),this.update()},d=new i.ToolbarButton({icon:i.treeViewIcon,className:"jp-TreeView",onClick:l,tooltip:a.__("Tree View")}),c=new i.ToolbarButton({icon:i.tableRowsIcon,className:"jp-TableView",onClick:l,tooltip:a.__("Table View")}),h=e=>{c.pressed="tree"!==e,d.pressed=!c.pressed};h(this._table.isHidden?"tree":"table"),this.toolbar.addItem("view-VariableTreeView",d),this.toolbar.addItem("view-VariableTableView",c),this.addWidget(this._tree),this.addWidget(this._table),this.addClass("jp-DebuggerVariables")}set filter(e){this._tree.filter=e,this._table.filter=e}onResize(e){super.onResize(e),this._resizeBody(e)}_resizeBody(e){const t=e.height-this.toolbar.node.offsetHeight;this._tree.node.style.height=`${t}px`}}const Ie=e=>{var t,s;const{type:i,value:r}=e;switch(i){case"int":return parseInt(r,10);case"float":return parseFloat(r);case"bool":return r;case"str":return(null===(s=null===(t=e.presentationHint)||void 0===t?void 0:t.attributes)||void 0===s?void 0:s.includes("rawString"))?r.slice(1,r.length-1):r;default:return null!=i?i:r}};class Ve extends i.SidePanel{constructor(e){const t=e.translator||v.nullTranslator;super({translator:t}),this.id="jp-debugger-sidebar",this.title.icon=i.bugIcon,this.addClass("jp-DebuggerSidebar");const{callstackCommands:s,breakpointsCommands:r,editorServices:n,service:o,themeManager:a}=e,l=o.model;this.variables=new Te({model:l.variables,commands:s.registry,service:o,themeManager:a,translator:t}),this.callstack=new ue({commands:s,model:l.callstack,translator:t}),this.breakpoints=new de({service:o,commands:r,model:l.breakpoints,translator:t}),this.sources=new _e({model:l.sources,service:o,editorServices:n,translator:t}),this.kernelSources=new we({model:l.kernelSources,service:o,translator:t});const d=new Ve.Header;this.header.addWidget(d),l.titleChanged.connect(((e,t)=>{d.title.label=t})),this.content.addClass("jp-DebuggerSidebar-body"),this.addWidget(this.variables),this.addWidget(this.callstack),this.addWidget(this.breakpoints),this.addWidget(this.sources),this.addWidget(this.kernelSources)}}var Be,He;!function(e){class t extends h.Widget{constructor(){super({node:Be.createHeader()}),this.title.changed.connect((e=>{this.node.textContent=this.title.label}))}}e.Header=t}(Ve||(Ve={})),function(e){e.createHeader=function(){const e=document.createElement("h2");return e.textContent="-",e.classList.add("jp-text-truncated"),e}}(Be||(Be={}));class Re{constructor(e){var t,s,i;this._config=e.config,this._shell=e.shell,this._notebookTracker=null!==(t=e.notebookTracker)&&void 0!==t?t:null,this._consoleTracker=null!==(s=e.consoleTracker)&&void 0!==s?s:null,this._editorTracker=null!==(i=e.editorTracker)&&void 0!==i?i:null,this._readOnlyEditorTracker=new d.WidgetTracker({namespace:"@jupyterlab/debugger"})}find(e){return[...this._findInConsoles(e),...this._findInEditors(e),...this._findInNotebooks(e),...this._findInReadOnlyEditors(e)]}open(e){const{editorWrapper:t,label:s,caption:r}=e,n=new d.MainAreaWidget({content:t});n.id=d.DOMUtils.createDomID(),n.title.label=s,n.title.closable=!0,n.title.caption=r,n.title.icon=i.textEditorIcon,this._shell.add(n,"main",{type:"Debugger Sources"}),this._readOnlyEditorTracker.add(n)}_findInNotebooks(e){if(!this._notebookTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._notebookTracker.forEach((e=>{const o=e.sessionContext;if(i!==o.path)return;const a=e.content;t&&(a.mode="command"),e.content.widgets.forEach(((i,o)=>{const l=i.model.sharedModel.getSource(),d=this._getCodeId(l,s);d&&r===d&&(t&&(a.activeCellIndex=o,a.activeCell&&a.scrollToItem(a.activeCellIndex,"smart").catch((e=>{})),this._shell.activateById(e.id)),n.push(Object.freeze({get:()=>i.editor,reveal:()=>a.scrollToItem(o,"smart"),src:i.model.sharedModel})))}))})),n}_findInConsoles(e){if(!this._consoleTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._consoleTracker.forEach((e=>{const o=e.sessionContext;if(i!==o.path)return;const a=e.console.cells;for(const i of a){const o=i.model.sharedModel.getSource(),a=this._getCodeId(o,s);if(!a)break;if(r!==a)break;n.push(Object.freeze({get:()=>i.editor,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:i.model.sharedModel})),t&&this._shell.activateById(e.id)}})),n}_findInEditors(e){if(!this._editorTracker)return[];const{focus:t,kernel:s,path:i,source:r}=e,n=[];return this._editorTracker.forEach((e=>{const o=e.content;if(i!==o.context.path)return;const a=o.editor;if(!a)return;const l=a.model.sharedModel.getSource(),d=this._getCodeId(l,s);d&&r===d&&(n.push(Object.freeze({get:()=>a,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:o.model.sharedModel})),t&&this._shell.activateById(e.id))})),n}_findInReadOnlyEditors(e){const{focus:t,kernel:s,source:i}=e,r=[];return this._readOnlyEditorTracker.forEach((e=>{var n;const o=null===(n=e.content)||void 0===n?void 0:n.editor;if(!o)return;const a=o.model.sharedModel.getSource(),l=this._getCodeId(a,s);l&&(e.title.caption!==i&&i!==l||(r.push(Object.freeze({get:()=>o,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:o.model.sharedModel})),t&&this._shell.activateById(e.id)))})),r}_getCodeId(e,t){try{return this._config.getCodeId(e,t)}catch(e){return""}}}!function(e){let t,s,r;e.Config=class extends a{},e.EditorHandler=class extends C{},e.Handler=class extends T{},e.Model=class extends G{},e.ReadOnlyEditorFactory=class extends _{},e.Service=class extends Q{},e.Session=class extends X{},e.Sidebar=class extends Ve{},e.Sources=class extends Re{},e.VariablesGrid=class extends ${},e.VariableRenderer=class extends Y{},function(e){e.debugContinue="debugger:continue",e.terminate="debugger:terminate",e.next="debugger:next",e.showPanel="debugger:show-panel",e.stepIn="debugger:stepIn",e.stepOut="debugger:stepOut",e.inspectVariable="debugger:inspect-variable",e.renderMimeVariable="debugger:render-mime-variable",e.evaluate="debugger:evaluate",e.restartDebug="debugger:restart-debug",e.pauseOnExceptions="debugger:pause-on-exceptions",e.copyToClipboard="debugger:copy-to-clipboard",e.copyToGlobals="debugger:copy-to-globals",e.openSource="debugger:open-source"}(t=e.CommandIDs||(e.CommandIDs={})),function(e){e.closeAllIcon=I,e.evaluateIcon=i.codeIcon,e.continueIcon=i.runIcon,e.pauseIcon=B,e.stepIntoIcon=H,e.stepOutIcon=j,e.stepOverIcon=R,e.terminateIcon=i.stopIcon,e.variableIcon=F,e.viewBreakpointIcon=L,e.pauseOnExceptionsIcon=B}(s=e.Icons||(e.Icons={})),function(e){e.getCode=l.getCode}(r=e.Dialogs||(e.Dialogs={}))}(He||(He={}))},36621:(e,t,s)=>{s.r(t),s.d(t,{Debugger:()=>i.q,IDebugger:()=>n,IDebuggerConfig:()=>o,IDebuggerHandler:()=>d,IDebuggerSidebar:()=>l,IDebuggerSourceViewer:()=>c,IDebuggerSources:()=>a});var i=s(78947),r=s(20998);const n=new r.Token("@jupyterlab/debugger:IDebugger","A debugger user interface."),o=new r.Token("@jupyterlab/debugger:IDebuggerConfig","A service to handle the debugger configuration."),a=new r.Token("@jupyterlab/debugger:IDebuggerSources","A service to display sources in debug mode."),l=new r.Token("@jupyterlab/debugger:IDebuggerSidebar","A service for the debugger sidebar."),d=new r.Token("@jupyterlab/debugger:IDebuggerHandler","A service for handling notebook debugger."),c=new r.Token("@jupyterlab/debugger:IDebuggerSourceViewer","A debugger source viewer.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6627],{6627:(e,a,r)=>{r.r(a),r.d(a,{default:()=>d});var t=r(12982),s=r(71677);const d={id:"@jupyterlab/theme-dark-extension:plugin",description:"Adds a dark theme.",requires:[t.IThemeManager,s.ITranslator],activate:(e,a,r)=>{const t=r.load("jupyterlab");a.register({name:"JupyterLab Dark",displayName:t.__("JupyterLab Dark"),isLight:!1,themeScrollbars:!0,load:()=>a.loadCSS("@jupyterlab/theme-dark-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6627],{6627:(e,a,r)=>{r.r(a),r.d(a,{default:()=>d});var t=r(53312),s=r(12030);const d={id:"@jupyterlab/theme-dark-extension:plugin",description:"Adds a dark theme.",requires:[t.IThemeManager,s.ITranslator],activate:(e,a,r)=>{const t=r.load("jupyterlab");a.register({name:"JupyterLab Dark",displayName:t.__("JupyterLab Dark"),isLight:!1,themeScrollbars:!0,load:()=>a.loadCSS("@jupyterlab/theme-dark-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6731],{16731:(t,e,n)=>{n.r(e),n.d(e,{Application:()=>h});var i,r,s,o,l=n(32895),a=n(20998),u=n(31516);!function(t){function e(t,e,n=0,i=-1){let r,s=t.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i){let r=(n+i)%s;if(t[r]===e)return r}return-1}function n(t,e,n=-1,i=0){let r,s=t.length;if(0===s)return-1;r=(n=n<0?Math.max(0,n+s):Math.min(n,s-1))<(i=i<0?Math.max(0,i+s):Math.min(i,s-1))?n+1+(s-i):n-i+1;for(let i=0;i<r;++i){let r=(n-i+s)%s;if(t[r]===e)return r}return-1}function i(t,e,n=0,i=-1){let r,s=t.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i){let r=(n+i)%s;if(e(t[r],r))return r}return-1}function r(t,e,n=-1,i=0){let r,s=t.length;if(0===s)return-1;r=(n=n<0?Math.max(0,n+s):Math.min(n,s-1))<(i=i<0?Math.max(0,i+s):Math.min(i,s-1))?n+1+(s-i):n-i+1;for(let i=0;i<r;++i){let r=(n-i+s)%s;if(e(t[r],r))return r}return-1}function s(t,e=0,n=-1){let i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){let i=t[e],r=t[n];t[e++]=r,t[n--]=i}}function o(t,e){let n=t.length;if(e<0&&(e+=n),e<0||e>=n)return;let i=t[e];for(let i=e+1;i<n;++i)t[i-1]=t[i];return t.length=n-1,i}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n=0,r=-1){let s=i(t,e,n,r);return-1!==s?t[s]:void 0},t.findLastValue=function(t,e,n=-1,i=0){let s=r(t,e,n,i);return-1!==s?t[s]:void 0},t.lowerBound=function(t,e,n,i=0,r=-1){let s=t.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),l=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;l>0;){let i=l>>1,r=o+i;n(t[r],e)<0?(o=r+1,l-=i+1):l=i}return o},t.upperBound=function(t,e,n,i=0,r=-1){let s=t.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),l=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;l>0;){let i=l>>1,r=o+i;n(t[r],e)>0?l=i:(o=r+1,l-=i+1)}return o},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e={}){let{start:n,stop:i,step:r}=e;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");let s,o=t.length;void 0===n?n=r<0?o-1:0:n<0?n=Math.max(n+o,r<0?-1:0):n>=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let l=[];for(let e=0;e<s;++e)l[e]=t[n+e*r];return l},t.move=function(t,e,n){let i=t.length;if(i<=1)return;if((e=e<0?Math.max(0,e+i):Math.min(e,i-1))===(n=n<0?Math.max(0,n+i):Math.min(n,i-1)))return;let r=t[e],s=e<n?1:-1;for(let i=e;i!==n;i+=s)t[i]=t[i+s];t[n]=r},t.reverse=s,t.rotate=function(t,e,n=0,i=-1){let r=t.length;if(r<=1)return;if((n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(e>0?e%=o:e<0&&(e=(e%o+o)%o),0===e)return;let l=n+e;s(t,n,l-1),s(t,l,i),s(t,n,i)},t.fill=function(t,e,n=0,i=-1){let r,s=t.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i)t[(n+i)%s]=e}},t.insert=function(t,e,n){let i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(let n=i;n>e;--n)t[n]=t[n-1];t[e]=n},t.removeAt=o,t.removeFirstOf=function(t,n,i=0,r=-1){let s=e(t,n,i,r);return-1!==s&&o(t,s),s},t.removeLastOf=function(t,e,i=-1,r=0){let s=n(t,e,i,r);return-1!==s&&o(t,s),s},t.removeAllOf=function(t,e,n=0,i=-1){let r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o<r;++o)n<=i&&o>=n&&o<=i&&t[o]===e||i<n&&(o<=i||o>=n)&&t[o]===e?s++:s>0&&(t[o-s]=t[o]);return s>0&&(t.length=r-s),s},t.removeFirstWhere=function(t,e,n=0,r=-1){let s,l=i(t,e,n,r);return-1!==l&&(s=o(t,l)),{index:l,value:s}},t.removeLastWhere=function(t,e,n=-1,i=0){let s,l=r(t,e,n,i);return-1!==l&&(s=o(t,l)),{index:l,value:s}},t.removeAllWhere=function(t,e,n=0,i=-1){let r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o<r;++o)n<=i&&o>=n&&o<=i&&e(t[o],o)||i<n&&(o<=i||o>=n)&&e(t[o],o)?s++:s>0&&(t[o-s]=t[o]);return s>0&&(t.length=r-s),s}}(i||(i={})),function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0||t<e&&n<0?0:Math.ceil((e-t)/n)}}(r||(r={})),function(t){function e(t,e,n=0){let i=new Array(e.length);for(let r=0,s=n,o=e.length;r<o;++r,++s){if(s=t.indexOf(e[r],s),-1===s)return null;i[r]=s}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i=0){let r=e(t,n,i);if(!r)return null;let s=0;for(let t=0,e=r.length;t<e;++t){let e=r[t]-i;s+=e*e}return{score:s,indices:r}},t.matchSumOfDeltas=function(t,n,i=0){let r=e(t,n,i);if(!r)return null;let s=0,o=i-1;for(let t=0,e=r.length;t<e;++t){let e=r[t];s+=e-o-1,o=e}return{score:s,indices:r}},t.highlight=function(t,e,n){let i=[],r=0,s=0,o=e.length;for(;r<o;){let l=e[r],a=e[r];for(;++r<o&&e[r]===a+1;)a++;s<l&&i.push(t.slice(s,l)),l<a+1&&i.push(n(t.slice(l,a+1))),s=a+1}return s<t.length&&i.push(t.slice(s)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(s||(s={}));class h{constructor(t){this._delegate=new a.PromiseDelegate,this._plugins=new Map,this._services=new Map,this._started=!1,this._bubblingKeydown=!1,this.commands=new l.CommandRegistry,this.contextMenu=new u.ContextMenu({commands:this.commands,renderer:t.contextMenuRenderer}),this.shell=t.shell}get started(){return this._delegate.promise}getPluginDescription(t){var e,n;return null!==(n=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==n?n:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,n;return null!==(n=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==n&&n}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);const e=o.createPluginData(t);o.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(const e of t)this.registerPlugin(e)}deregisterPlugin(t,e){const n=this._plugins.get(t);if(n){if(n.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;const n=e.requires.map((t=>this.resolveRequiredService(t))),i=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...n,...i]).then((t=>e.activate.apply(void 0,[this,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async deactivatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);const n=o.findDependents(t,this._plugins,this._services),i=n.map((t=>this._plugins.get(t)));for(const e of i)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(const t of i){const e=[...t.requires,...t.optional].map((t=>{const e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this,...e),t.service=null,t.activated=!1}return n.pop(),n}async resolveRequiredService(t){const e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);const n=this._plugins.get(e);return n.activated||await this.activatePlugin(e),n.service}async resolveOptionalService(t){const e=this._services.get(t);if(!e)return null;const n=this._plugins.get(e);if(!n.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return n.service}start(t={}){if(this._started)return this._delegate.promise;this._started=!0,this._bubblingKeydown=t.bubblingKeydown||!1;const e=t.hostID||"",n=o.collectStartupPlugins(this._plugins,t).map((t=>this.activatePlugin(t).catch((e=>{console.error(`Plugin '${t}' failed to activate.`),console.error(e)}))));return Promise.all(n).then((()=>{this.attachShell(e),this.addEventListeners(),this._delegate.resolve()})),this._delegate.promise}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}async activateDeferredPlugins(){const t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t)}handleEvent(t){switch(t.type){case"resize":this.evtResize(t);break;case"keydown":this.evtKeydown(t);break;case"contextmenu":this.evtContextMenu(t)}}attachShell(t){u.Widget.attach(this.shell,t&&document.getElementById(t)||document.body)}addEventListeners(){document.addEventListener("contextmenu",this),document.addEventListener("keydown",this,!this._bubblingKeydown),window.addEventListener("resize",this)}evtKeydown(t){this.commands.processKeydownEvent(t)}evtContextMenu(t){t.shiftKey||this.contextMenu.open(t)&&(t.preventDefault(),t.stopPropagation())}evtResize(t){this.shell.update()}}!function(t){t.createPluginData=function(t){var e,n,i,r;return{id:t.id,description:null!==(e=t.description)&&void 0!==e?e:"",service:null,promise:null,activated:!1,activate:t.activate,deactivate:null!==(n=t.deactivate)&&void 0!==n?n:null,provides:null!==(i=t.provides)&&void 0!==i?i:null,autoStart:null!==(r=t.autoStart)&&void 0!==r&&r,requires:t.requires?t.requires.slice():[],optional:t.optional?t.optional.slice():[]}},t.ensureNoCycle=function(t,e,n){const i=[...t.requires,...t.optional],r=i=>{if(i===t.provides)return!0;const o=n.get(i);if(!o)return!1;const l=e.get(o),a=[...l.requires,...l.optional];return 0!==a.length&&(s.push(o),!!a.some(r)||(s.pop(),!1))};if(!t.provides||0===i.length)return;const s=[t.id];if(i.some(r))throw new ReferenceError(`Cycle detected: ${s.join(" -> ")}.`)},t.findDependents=function(t,e,n){const i=new Array,r=t=>{const r=e.get(t),s=[...r.requires,...r.optional];i.push(...s.reduce(((e,i)=>{const r=n.get(i);return r&&e.push([t,r]),e}),[]))};for(const t of e.keys())r(t);const s=i.filter((e=>e[1]===t));let o=0;for(;s.length>o;){const t=s.length,e=new Set(s.map((t=>t[0])));for(const t of e)i.filter((e=>e[1]===t)).forEach((t=>{s.includes(t)||s.push(t)}));o=t}const l=function(t){let e=[],n=new Set,i=new Map;for(const e of t)r(e);for(const[t]of i)s(t);return e;function r(t){let[e,n]=t,r=i.get(n);r?r.push(e):i.set(n,[e])}function s(t){if(n.has(t))return;n.add(t);let r=i.get(t);if(r)for(const t of r)s(t);e.push(t)}}(s),a=l.findIndex((e=>e===t));return-1===a?[t]:l.slice(0,a+1)},t.collectStartupPlugins=function(t,e){const n=new Set;for(const e of t.keys())!0===t.get(e).autoStart&&n.add(e);if(e.startPlugins)for(const t of e.startPlugins)n.add(t);if(e.ignorePlugins)for(const t of e.ignorePlugins)n.delete(t);return Array.from(n)}}(o||(o={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6731],{16731:(t,e,n)=>{n.r(e),n.d(e,{Application:()=>h});var i,r,s,o,l=n(16934),a=n(20998),u=n(63485);!function(t){function e(t,e,n=0,i=-1){let r,s=t.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i){let r=(n+i)%s;if(t[r]===e)return r}return-1}function n(t,e,n=-1,i=0){let r,s=t.length;if(0===s)return-1;r=(n=n<0?Math.max(0,n+s):Math.min(n,s-1))<(i=i<0?Math.max(0,i+s):Math.min(i,s-1))?n+1+(s-i):n-i+1;for(let i=0;i<r;++i){let r=(n-i+s)%s;if(t[r]===e)return r}return-1}function i(t,e,n=0,i=-1){let r,s=t.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i){let r=(n+i)%s;if(e(t[r],r))return r}return-1}function r(t,e,n=-1,i=0){let r,s=t.length;if(0===s)return-1;r=(n=n<0?Math.max(0,n+s):Math.min(n,s-1))<(i=i<0?Math.max(0,i+s):Math.min(i,s-1))?n+1+(s-i):n-i+1;for(let i=0;i<r;++i){let r=(n-i+s)%s;if(e(t[r],r))return r}return-1}function s(t,e=0,n=-1){let i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){let i=t[e],r=t[n];t[e++]=r,t[n--]=i}}function o(t,e){let n=t.length;if(e<0&&(e+=n),e<0||e>=n)return;let i=t[e];for(let i=e+1;i<n;++i)t[i-1]=t[i];return t.length=n-1,i}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n=0,r=-1){let s=i(t,e,n,r);return-1!==s?t[s]:void 0},t.findLastValue=function(t,e,n=-1,i=0){let s=r(t,e,n,i);return-1!==s?t[s]:void 0},t.lowerBound=function(t,e,n,i=0,r=-1){let s=t.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),l=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;l>0;){let i=l>>1,r=o+i;n(t[r],e)<0?(o=r+1,l-=i+1):l=i}return o},t.upperBound=function(t,e,n,i=0,r=-1){let s=t.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),l=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;l>0;){let i=l>>1,r=o+i;n(t[r],e)>0?l=i:(o=r+1,l-=i+1)}return o},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e={}){let{start:n,stop:i,step:r}=e;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");let s,o=t.length;void 0===n?n=r<0?o-1:0:n<0?n=Math.max(n+o,r<0?-1:0):n>=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let l=[];for(let e=0;e<s;++e)l[e]=t[n+e*r];return l},t.move=function(t,e,n){let i=t.length;if(i<=1)return;if((e=e<0?Math.max(0,e+i):Math.min(e,i-1))===(n=n<0?Math.max(0,n+i):Math.min(n,i-1)))return;let r=t[e],s=e<n?1:-1;for(let i=e;i!==n;i+=s)t[i]=t[i+s];t[n]=r},t.reverse=s,t.rotate=function(t,e,n=0,i=-1){let r=t.length;if(r<=1)return;if((n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(e>0?e%=o:e<0&&(e=(e%o+o)%o),0===e)return;let l=n+e;s(t,n,l-1),s(t,l,i),s(t,n,i)},t.fill=function(t,e,n=0,i=-1){let r,s=t.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))<n?i+1+(s-n):i-n+1;for(let i=0;i<r;++i)t[(n+i)%s]=e}},t.insert=function(t,e,n){let i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(let n=i;n>e;--n)t[n]=t[n-1];t[e]=n},t.removeAt=o,t.removeFirstOf=function(t,n,i=0,r=-1){let s=e(t,n,i,r);return-1!==s&&o(t,s),s},t.removeLastOf=function(t,e,i=-1,r=0){let s=n(t,e,i,r);return-1!==s&&o(t,s),s},t.removeAllOf=function(t,e,n=0,i=-1){let r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o<r;++o)n<=i&&o>=n&&o<=i&&t[o]===e||i<n&&(o<=i||o>=n)&&t[o]===e?s++:s>0&&(t[o-s]=t[o]);return s>0&&(t.length=r-s),s},t.removeFirstWhere=function(t,e,n=0,r=-1){let s,l=i(t,e,n,r);return-1!==l&&(s=o(t,l)),{index:l,value:s}},t.removeLastWhere=function(t,e,n=-1,i=0){let s,l=r(t,e,n,i);return-1!==l&&(s=o(t,l)),{index:l,value:s}},t.removeAllWhere=function(t,e,n=0,i=-1){let r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o<r;++o)n<=i&&o>=n&&o<=i&&e(t[o],o)||i<n&&(o<=i||o>=n)&&e(t[o],o)?s++:s>0&&(t[o-s]=t[o]);return s>0&&(t.length=r-s),s}}(i||(i={})),function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0||t<e&&n<0?0:Math.ceil((e-t)/n)}}(r||(r={})),function(t){function e(t,e,n=0){let i=new Array(e.length);for(let r=0,s=n,o=e.length;r<o;++r,++s){if(s=t.indexOf(e[r],s),-1===s)return null;i[r]=s}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i=0){let r=e(t,n,i);if(!r)return null;let s=0;for(let t=0,e=r.length;t<e;++t){let e=r[t]-i;s+=e*e}return{score:s,indices:r}},t.matchSumOfDeltas=function(t,n,i=0){let r=e(t,n,i);if(!r)return null;let s=0,o=i-1;for(let t=0,e=r.length;t<e;++t){let e=r[t];s+=e-o-1,o=e}return{score:s,indices:r}},t.highlight=function(t,e,n){let i=[],r=0,s=0,o=e.length;for(;r<o;){let l=e[r],a=e[r];for(;++r<o&&e[r]===a+1;)a++;s<l&&i.push(t.slice(s,l)),l<a+1&&i.push(n(t.slice(l,a+1))),s=a+1}return s<t.length&&i.push(t.slice(s)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(s||(s={}));class h{constructor(t){this._delegate=new a.PromiseDelegate,this._plugins=new Map,this._services=new Map,this._started=!1,this._bubblingKeydown=!1,this.commands=new l.CommandRegistry,this.contextMenu=new u.ContextMenu({commands:this.commands,renderer:t.contextMenuRenderer}),this.shell=t.shell}get started(){return this._delegate.promise}getPluginDescription(t){var e,n;return null!==(n=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==n?n:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,n;return null!==(n=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==n&&n}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);const e=o.createPluginData(t);o.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(const e of t)this.registerPlugin(e)}deregisterPlugin(t,e){const n=this._plugins.get(t);if(n){if(n.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;const n=e.requires.map((t=>this.resolveRequiredService(t))),i=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...n,...i]).then((t=>e.activate.apply(void 0,[this,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async deactivatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);const n=o.findDependents(t,this._plugins,this._services),i=n.map((t=>this._plugins.get(t)));for(const e of i)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(const t of i){const e=[...t.requires,...t.optional].map((t=>{const e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this,...e),t.service=null,t.activated=!1}return n.pop(),n}async resolveRequiredService(t){const e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);const n=this._plugins.get(e);return n.activated||await this.activatePlugin(e),n.service}async resolveOptionalService(t){const e=this._services.get(t);if(!e)return null;const n=this._plugins.get(e);if(!n.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return n.service}start(t={}){if(this._started)return this._delegate.promise;this._started=!0,this._bubblingKeydown=t.bubblingKeydown||!1;const e=t.hostID||"",n=o.collectStartupPlugins(this._plugins,t).map((t=>this.activatePlugin(t).catch((e=>{console.error(`Plugin '${t}' failed to activate.`),console.error(e)}))));return Promise.all(n).then((()=>{this.attachShell(e),this.addEventListeners(),this._delegate.resolve()})),this._delegate.promise}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}async activateDeferredPlugins(){const t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t)}handleEvent(t){switch(t.type){case"resize":this.evtResize(t);break;case"keydown":this.evtKeydown(t);break;case"contextmenu":this.evtContextMenu(t)}}attachShell(t){u.Widget.attach(this.shell,t&&document.getElementById(t)||document.body)}addEventListeners(){document.addEventListener("contextmenu",this),document.addEventListener("keydown",this,!this._bubblingKeydown),window.addEventListener("resize",this)}evtKeydown(t){this.commands.processKeydownEvent(t)}evtContextMenu(t){t.shiftKey||this.contextMenu.open(t)&&(t.preventDefault(),t.stopPropagation())}evtResize(t){this.shell.update()}}!function(t){t.createPluginData=function(t){var e,n,i,r;return{id:t.id,description:null!==(e=t.description)&&void 0!==e?e:"",service:null,promise:null,activated:!1,activate:t.activate,deactivate:null!==(n=t.deactivate)&&void 0!==n?n:null,provides:null!==(i=t.provides)&&void 0!==i?i:null,autoStart:null!==(r=t.autoStart)&&void 0!==r&&r,requires:t.requires?t.requires.slice():[],optional:t.optional?t.optional.slice():[]}},t.ensureNoCycle=function(t,e,n){const i=[...t.requires,...t.optional],r=i=>{if(i===t.provides)return!0;const o=n.get(i);if(!o)return!1;const l=e.get(o),a=[...l.requires,...l.optional];return 0!==a.length&&(s.push(o),!!a.some(r)||(s.pop(),!1))};if(!t.provides||0===i.length)return;const s=[t.id];if(i.some(r))throw new ReferenceError(`Cycle detected: ${s.join(" -> ")}.`)},t.findDependents=function(t,e,n){const i=new Array,r=t=>{const r=e.get(t),s=[...r.requires,...r.optional];i.push(...s.reduce(((e,i)=>{const r=n.get(i);return r&&e.push([t,r]),e}),[]))};for(const t of e.keys())r(t);const s=i.filter((e=>e[1]===t));let o=0;for(;s.length>o;){const t=s.length,e=new Set(s.map((t=>t[0])));for(const t of e)i.filter((e=>e[1]===t)).forEach((t=>{s.includes(t)||s.push(t)}));o=t}const l=function(t){let e=[],n=new Set,i=new Map;for(const e of t)r(e);for(const[t]of i)s(t);return e;function r(t){let[e,n]=t,r=i.get(n);r?r.push(e):i.set(n,[e])}function s(t){if(n.has(t))return;n.add(t);let r=i.get(t);if(r)for(const t of r)s(t);e.push(t)}}(s),a=l.findIndex((e=>e===t));return-1===a?[t]:l.slice(0,a+1)},t.collectStartupPlugins=function(t,e){const n=new Set;for(const e of t.keys())!0===t.get(e).autoStart&&n.add(e);if(e.startPlugins)for(const t of e.startPlugins)n.add(t);if(e.ignorePlugins)for(const t of e.ignorePlugins)n.delete(t);return Array.from(n)}}(o||(o={}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6748],{86748:(e,n,o)=>{o.r(n),o.d(n,{default:()=>P});var t=o(44604),r=o(53312),l=o(51429),s=o(81002),a=o(67260),c=o(71427),i=o(86810),d=o(29879),u=o(81221),p=o(23295),m=o(12030),C=o(35613),v=o(33625),g=o(20998),h=o(2549),b=o(14421);const f={id:"@jupyterlab/console-extension:foreign",description:"Add foreign handler of IOPub messages to the console.",requires:[a.IConsoleTracker,p.ISettingRegistry,m.ITranslator],optional:[r.ICommandPalette],activate:function(e,n,o,t,r){var l;const s=t.load("jupyterlab"),{shell:c}=e;n.widgetAdded.connect(((e,n)=>{const t=n.console,r=new a.ForeignHandler({sessionContext:t.sessionContext,parent:t});k.foreignHandlerProperty.set(t,r),o.get("@jupyterlab/console-extension:tracker","showAllKernelActivity").then((({composite:e})=>{const n=e;r.enabled=n})),t.disposed.connect((()=>{r.dispose()}))}));const{commands:i}=e,d=s.__("Console"),u="console:toggle-show-all-kernel-activity";i.addCommand(u,{label:e=>s.__("Show All Kernel Activity"),execute:e=>{const o=function(e){const o=n.currentWidget;return!1!==e.activate&&o&&c.activateById(o.id),o}(e);if(!o)return;const t=k.foreignHandlerProperty.get(o.console);t&&(t.enabled=!t.enabled)},isToggled:()=>{var e;return null!==n.currentWidget&&!!(null===(e=k.foreignHandlerProperty.get(n.currentWidget.console))||void 0===e?void 0:e.enabled)},isEnabled:()=>null!==n.currentWidget&&n.currentWidget===c.currentWidget});const p=()=>{i.notifyCommandChanged(u)};n.currentChanged.connect(p),null===(l=c.currentChanged)||void 0===l||l.connect(p),r&&r.addItem({command:u,category:d,args:{isPalette:!0}})},autoStart:!0},y=f;var k;!function(e){e.foreignHandlerProperty=new b.AttachedProperty({name:"foreignHandler",create:()=>{}})}(k||(k={}));const _={id:"@jupyterlab/console-extension:cell-executor",description:"Provides the console cell executor.",autoStart:!0,provides:a.IConsoleCellExecutor,activate:()=>Object.freeze({runCell:a.runCell})};var x;!function(e){e.autoClosingBrackets="console:toggle-autoclosing-brackets",e.create="console:create",e.clear="console:clear",e.runUnforced="console:run-unforced",e.runForced="console:run-forced",e.linebreak="console:linebreak",e.interrupt="console:interrupt-kernel",e.restart="console:restart-kernel",e.closeAndShutdown="console:close-and-shutdown",e.open="console:open",e.inject="console:inject",e.changeKernel="console:change-kernel",e.getKernel="console:get-kernel",e.interactionMode="console:interaction-mode",e.redo="console:redo",e.replaceSelection="console:replace-selection",e.shutdown="console:shutdown",e.undo="console:undo",e.invokeCompleter="completer:invoke-console",e.selectCompleter="completer:select-console"}(x||(x={}));const w={id:"@jupyterlab/console-extension:tracker",description:"Provides the console widget tracker.",provides:a.IConsoleTracker,requires:[a.ConsolePanel.IContentFactory,l.IEditorServices,a.IConsoleCellExecutor,u.IRenderMimeRegistry,p.ISettingRegistry],optional:[t.ILayoutRestorer,c.IDefaultFileBrowser,d.IMainMenu,r.ICommandPalette,i.ILauncher,t.ILabStatus,r.ISessionContextDialogs,C.IFormRendererRegistry,m.ITranslator],activate:async function(e,n,o,t,l,s,c,i,d,u,p,b,f,y,k){var _;const w=null!=k?k:m.nullTranslator,I=w.load("jupyterlab"),E=e.serviceManager,{commands:S,shell:P}=e,M=I.__("Console"),j=null!=f?f:new r.SessionContextDialogs({translator:w}),T=new r.WidgetTracker({namespace:"console"});async function A(e){var r,c;await E.ready;const i=new a.ConsolePanel({manager:E,contentFactory:n,mimeTypeService:o.mimeTypeService,rendermime:l,sessionDialogs:j,executor:t,translator:w,setBusy:null!==(r=b&&(()=>b.setBusy()))&&void 0!==r?r:void 0,...e}),d=(await s.get("@jupyterlab/console-extension:tracker","interactionMode")).composite;return i.console.node.dataset.jpInteractionMode=d,await T.add(i),i.sessionContext.propertyChanged.connect((()=>{T.save(i)})),P.add(i,"main",{ref:e.ref,mode:e.insertMode,activate:!1!==e.activate,type:null!==(c=e.type)&&void 0!==c?c:"Console"}),i}c&&c.restore(T,{command:x.create,args:e=>{const{path:n,name:o,kernelPreference:t}=e.console.sessionContext;return{path:n,name:o,kernelPreference:{...t}}},name:e=>{var n;return null!==(n=e.console.sessionContext.path)&&void 0!==n?n:g.UUID.uuid4()},when:E.ready}),p&&E.ready.then((()=>{let e=null;const n=()=>{e&&(e.dispose(),e=null);const n=E.kernelspecs.specs;if(n){e=new h.DisposableSet;for(const o in n.kernelspecs){const t=o===n.default?0:1/0,r=n.kernelspecs[o],l=r.resources["logo-svg"]||r.resources["logo-64x64"];e.add(p.add({command:x.create,args:{isLauncher:!0,kernelPreference:{name:o}},category:I.__("Console"),rank:t,kernelIconUrl:l,metadata:{kernel:g.JSONExt.deepCopy(r.metadata||{})}}))}}};n(),E.kernelspecs.specsChanged.connect(n)}));const K="@jupyterlab/console-extension:tracker";let R,B={};async function U(e){R=(await s.get(K,"interactionMode")).composite,B=(await s.get(K,"promptCellConfig")).composite;const n=e=>{var n,o;e.console.node.dataset.jpInteractionMode=R,e.console.editorConfig=B,null===(o=null===(n=e.console.promptCell)||void 0===n?void 0:n.editor)||void 0===o||o.setOptions(B)};e?n(e):T.forEach(n)}if(s.pluginChanged.connect(((e,n)=>{n===K&&U()})),await U(),y){const e=y.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&y.addRenderer("@jupyterlab/console-extension:tracker.promptCellConfig",e)}function W(){return null!==T.currentWidget&&T.currentWidget===P.currentWidget}function D(e){const n=T.currentWidget;return!1!==e.activate&&n&&P.activateById(n.id),null!=n?n:null}T.widgetAdded.connect(((e,n)=>{U(n)})),S.addCommand(x.autoClosingBrackets,{execute:async e=>{var n;B.autoClosingBrackets=!!(null!==(n=e.force)&&void 0!==n?n:!B.autoClosingBrackets),await s.set(K,"promptCellConfig",B)},label:I.__("Auto Close Brackets for Code Console Prompt"),isToggled:()=>B.autoClosingBrackets}),S.addCommand(x.open,{label:I.__("Open a console for the provided `path`."),execute:e=>{const n=e.path,o=T.find((e=>{var o;return(null===(o=e.console.sessionContext.session)||void 0===o?void 0:o.path)===n}));return o?(!1!==e.activate&&P.activateById(o.id),o):E.ready.then((()=>(0,v.find)(E.sessions.running(),(e=>e.path===n))?A(e):Promise.reject(`No running kernel session for path: ${n}`)))}}),S.addCommand(x.create,{label:e=>{var n,o,t,r;if(e.isPalette)return I.__("New Console");if(e.isLauncher&&e.kernelPreference){const l=e.kernelPreference;return null!==(r=null===(t=null===(o=null===(n=E.kernelspecs)||void 0===n?void 0:n.specs)||void 0===o?void 0:o.kernelspecs[l.name||""])||void 0===t?void 0:t.display_name)&&void 0!==r?r:""}return I.__("Console")},icon:e=>e.isPalette?void 0:C.consoleIcon,execute:e=>{var n;return A({basePath:null!==(n=e.basePath||e.cwd||(null==i?void 0:i.model.path))&&void 0!==n?n:"",...e})}}),S.addCommand(x.undo,{execute:e=>{var n;const o=D(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.undo()},isEnabled:e=>{var n,o,t;if(!W())return!1;const r=null===(t=null===(o=null===(n=D(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canUndo()},icon:C.undoIcon.bindprops({stylesheet:"menuItem"}),label:I.__("Undo")}),S.addCommand(x.redo,{execute:e=>{var n;const o=D(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.redo()},isEnabled:e=>{var n,o,t;if(!W())return!1;const r=null===(t=null===(o=null===(n=D(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canRedo()},icon:C.redoIcon.bindprops({stylesheet:"menuItem"}),label:I.__("Redo")}),S.addCommand(x.clear,{label:I.__("Clear Console Cells"),execute:e=>{const n=D(e);n&&n.console.clear()},isEnabled:W}),S.addCommand(x.runUnforced,{label:I.__("Run Cell (unforced)"),execute:e=>{const n=D(e);if(n)return n.console.execute()},isEnabled:W}),S.addCommand(x.runForced,{label:I.__("Run Cell (forced)"),execute:e=>{const n=D(e);if(n)return n.console.execute(!0)},isEnabled:W}),S.addCommand(x.linebreak,{label:I.__("Insert Line Break"),execute:e=>{const n=D(e);n&&n.console.insertLinebreak()},isEnabled:W}),S.addCommand(x.replaceSelection,{label:I.__("Replace Selection in Console"),execute:e=>{const n=D(e);if(!n)return;const o=e.text||"";n.console.replaceSelection(o)},isEnabled:W}),S.addCommand(x.interrupt,{label:I.__("Interrupt Kernel"),execute:e=>{var n;const o=D(e);if(!o)return;const t=null===(n=o.console.sessionContext.session)||void 0===n?void 0:n.kernel;return t?t.interrupt():void 0},isEnabled:W}),S.addCommand(x.restart,{label:I.__("Restart Kernel…"),execute:e=>{const n=D(e);if(n)return j.restart(n.console.sessionContext)},isEnabled:W}),S.addCommand(x.shutdown,{label:I.__("Shut Down"),execute:e=>{const n=D(e);if(n)return n.console.sessionContext.shutdown()}}),S.addCommand(x.closeAndShutdown,{label:I.__("Close and Shut Down…"),execute:e=>{const n=D(e);if(n)return(0,r.showDialog)({title:I.__("Shut down the console?"),body:I.__('Are you sure you want to close "%1"?',n.title.label),buttons:[r.Dialog.cancelButton({ariaLabel:I.__("Cancel console Shut Down")}),r.Dialog.warnButton({ariaLabel:I.__("Confirm console Shut Down")})]}).then((e=>!!e.button.accept&&S.execute(x.shutdown,{activate:!1}).then((()=>(n.dispose(),!0)))))},isEnabled:W}),S.addCommand(x.inject,{label:I.__("Inject some code in a console."),execute:e=>{const n=e.path;T.find((o=>{var t;return(null===(t=o.console.sessionContext.session)||void 0===t?void 0:t.path)===n&&(!1!==e.activate&&P.activateById(o.id),o.console.inject(e.code,e.metadata),!0)}))},isEnabled:W}),S.addCommand(x.changeKernel,{label:I.__("Change Kernel…"),execute:e=>{const n=D(e);if(n)return j.selectKernel(n.console.sessionContext)},isEnabled:W}),S.addCommand(x.getKernel,{label:I.__("Get Kernel"),execute:e=>{var n;const o=D({activate:!1,...e});if(o)return null===(n=o.sessionContext.session)||void 0===n?void 0:n.kernel},isEnabled:W});const F=[x.create],L=()=>{Object.values(x).filter((e=>!F.includes(e))).forEach((n=>e.commands.notifyCommandChanged(n)))};T.currentChanged.connect(L),null===(_=P.currentChanged)||void 0===_||_.connect(L),u&&[x.create,x.linebreak,x.clear,x.runUnforced,x.runForced,x.restart,x.interrupt,x.changeKernel,x.closeAndShutdown].forEach((e=>{u.addItem({command:e,category:M,args:{isPalette:!0}})})),d&&(d.fileMenu.closeAndCleaners.add({id:x.closeAndShutdown,isEnabled:W}),d.kernelMenu.kernelUsers.changeKernel.add({id:x.changeKernel,isEnabled:W}),d.kernelMenu.kernelUsers.clearWidget.add({id:x.clear,isEnabled:W}),d.kernelMenu.kernelUsers.interruptKernel.add({id:x.interrupt,isEnabled:W}),d.kernelMenu.kernelUsers.restartKernel.add({id:x.restart,isEnabled:W}),d.kernelMenu.kernelUsers.shutdownKernel.add({id:x.shutdown,isEnabled:W}),d.runMenu.codeRunners.run.add({id:x.runForced,isEnabled:W}),d.editMenu.clearers.clearCurrent.add({id:x.clear,isEnabled:W}),d.editMenu.undoers.redo.add({id:x.redo,isEnabled:W}),d.editMenu.undoers.undo.add({id:x.undo,isEnabled:W}),d.helpMenu.getKernel.add({id:x.getKernel,isEnabled:W}));const O={notebook:I.__("Execute with Shift+Enter"),terminal:I.__("Execute with Enter")};return S.addCommand(x.interactionMode,{label:e=>{var n;return null!==(n=O[e.interactionMode])&&void 0!==n?n:"Set the console interaction mode."},execute:async e=>{try{await s.set(K,"interactionMode",e.interactionMode)}catch(e){console.error(`Failed to set ${K}:keyMap - ${e.message}`)}},isToggled:e=>e.interactionMode===R}),T},autoStart:!0},I={id:"@jupyterlab/console-extension:factory",description:"Provides the console widget content factory.",provides:a.ConsolePanel.IContentFactory,requires:[l.IEditorServices],autoStart:!0,activate:(e,n)=>{const o=n.factoryService.newInlineEditor;return new a.ConsolePanel.ContentFactory({editorFactory:o})}},E={id:"@jupyterlab/console-extension:kernel-status",description:"Adds the console to the kernel status indicator model.",autoStart:!0,requires:[a.IConsoleTracker,r.IKernelStatusModel],activate:(e,n,o)=>{o.addSessionProvider((e=>e&&n.has(e)?e.sessionContext:null))}},S={id:"@jupyterlab/console-extension:cursor-position",description:"Adds the console to the code editor cursor position model.",autoStart:!0,requires:[a.IConsoleTracker,l.IPositionModel],activate:(e,n,o)=>{let t=null;o.addEditorProvider((async e=>{let r=null;if(e!==t){if(null==t||t.console.promptCellCreated.disconnect(o.update),t=null,e&&n.has(e)){e.console.promptCellCreated.connect(o.update);const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor),t=e}}else if(e){const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor)}return r}))}},P=[I,w,y,E,S,{id:"@jupyterlab/console-extension:completer",description:"Adds completion to the console.",autoStart:!0,requires:[a.IConsoleTracker],optional:[s.ICompletionProviderManager,m.ITranslator,r.ISanitizer],activate:function(e,n,o,t,l){if(!o)return;const s=(null!=t?t:m.nullTranslator).load("jupyterlab"),a=null!=l?l:new r.Sanitizer;e.commands.addCommand(x.invokeCompleter,{label:s.__("Display the completion helper."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.invoke(e)}}),e.commands.addCommand(x.selectCompleter,{label:s.__("Select the completion suggestion."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:x.selectCompleter,keys:["Enter"],selector:".jp-ConsolePanel .jp-mod-completer-active"});const c=async(e,n)=>{var t,r;const l={editor:null!==(r=null===(t=n.console.promptCell)||void 0===t?void 0:t.editor)&&void 0!==r?r:null,session:n.console.sessionContext.session,widget:n};await o.updateCompleter(l),n.console.promptCellCreated.connect(((e,t)=>{const r={editor:t.editor,session:e.sessionContext.session,widget:n,sanitzer:a};o.updateCompleter(r).catch(console.error)})),n.console.sessionContext.sessionChanged.connect((()=>{var e,t;const r={editor:null!==(t=null===(e=n.console.promptCell)||void 0===e?void 0:e.editor)&&void 0!==t?t:null,session:n.console.sessionContext.session,widget:n,sanitizer:a};o.updateCompleter(r).catch(console.error)}))};n.widgetAdded.connect(c),o.activeProvidersChanged.connect((()=>{n.forEach((e=>{c(0,e).catch((e=>console.error(e)))}))}))}},_]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6815],{56815:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(3053),o=a(12982),s=a(97104),l=a(36768),r=a(71677);const i="@jupyterlab/translation-extension:plugin",c={id:"@jupyterlab/translation:translator",description:"Provides the application translation object.",autoStart:!0,requires:[n.JupyterFrontEnd.IPaths,l.ISettingRegistry],optional:[n.ILabShell],provides:r.ITranslator,activate:async(e,t,a,n)=>{const s=await a.load(i),l=s.get("locale").composite;let c=s.get("stringsPrefix").composite;c=s.get("displayStringsPrefix").composite?c:"";const d=e.serviceManager.serverSettings,u=new r.TranslationManager(t.urls.translations,c,d);return await u.fetch(l),n&&(n.translator=u),o.Dialog.translator=u,u}},d={id:i,description:"Adds translation commands and settings.",requires:[l.ISettingRegistry,r.ITranslator],optional:[s.IMainMenu,o.ICommandPalette],autoStart:!0,activate:(e,t,a,n,s)=>{const l=a.load("jupyterlab"),{commands:c}=e;let d;function u(e){d=e.get("locale").composite}t.load(i).then((t=>{var a;u(t),document.documentElement.lang="default"!==d?(null!=d?d:"").replace("_","-"):"en-US",t.changed.connect(u);const i=n?null===(a=n.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-language"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===a?void 0:a.submenu:null;let g;const p=e.serviceManager.serverSettings;(0,r.requestTranslationsAPI)("","",{},p).then((e=>{for(const a in e.data){const n=e.data[a],r=n.displayName,d=n.nativeName,u=r===d,p=u?`${r}`:`${r} - ${d}`;g=`jupyterlab-translation:${a}`,c.addCommand(g,{label:p,caption:p,isEnabled:()=>!u,isVisible:()=>!0,isToggled:()=>u,execute:()=>(0,o.showDialog)({title:l.__("Change interface language?"),body:l.__("After changing the interface language to %1, you will need to reload JupyterLab to see the changes.",p),buttons:[o.Dialog.cancelButton({label:l.__("Cancel")}),o.Dialog.okButton({label:l.__("Change and reload")})]}).then((e=>{e.button.accept&&t.set("locale",a).then((()=>{window.location.reload()})).catch((e=>{console.error(e)}))}))}),i&&i.addItem({command:g,args:{}}),s&&s.addItem({category:l.__("Display Languages"),command:g})}})).catch((e=>{console.error(`Available locales errored!\n${e}`)}))})).catch((e=>{console.error(`The jupyterlab translation extension appears to be missing.\n${e}`)}))}},u=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6815],{56815:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(44604),o=a(53312),s=a(29879),l=a(23295),r=a(12030);const i="@jupyterlab/translation-extension:plugin",c={id:"@jupyterlab/translation:translator",description:"Provides the application translation object.",autoStart:!0,requires:[n.JupyterFrontEnd.IPaths,l.ISettingRegistry],optional:[n.ILabShell],provides:r.ITranslator,activate:async(e,t,a,n)=>{const s=await a.load(i),l=s.get("locale").composite;let c=s.get("stringsPrefix").composite;c=s.get("displayStringsPrefix").composite?c:"";const d=e.serviceManager.serverSettings,u=new r.TranslationManager(t.urls.translations,c,d);return await u.fetch(l),n&&(n.translator=u),o.Dialog.translator=u,u}},d={id:i,description:"Adds translation commands and settings.",requires:[l.ISettingRegistry,r.ITranslator],optional:[s.IMainMenu,o.ICommandPalette],autoStart:!0,activate:(e,t,a,n,s)=>{const l=a.load("jupyterlab"),{commands:c}=e;let d;function u(e){d=e.get("locale").composite}t.load(i).then((t=>{var a;u(t),document.documentElement.lang="default"!==d?(null!=d?d:"").replace("_","-"):"en-US",t.changed.connect(u);const i=n?null===(a=n.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-language"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===a?void 0:a.submenu:null;let g;const p=e.serviceManager.serverSettings;(0,r.requestTranslationsAPI)("","",{},p).then((e=>{for(const a in e.data){const n=e.data[a],r=n.displayName,d=n.nativeName,u=r===d,p=u?`${r}`:`${r} - ${d}`;g=`jupyterlab-translation:${a}`,c.addCommand(g,{label:p,caption:p,isEnabled:()=>!u,isVisible:()=>!0,isToggled:()=>u,execute:()=>(0,o.showDialog)({title:l.__("Change interface language?"),body:l.__("After changing the interface language to %1, you will need to reload JupyterLab to see the changes.",p),buttons:[o.Dialog.cancelButton({label:l.__("Cancel")}),o.Dialog.okButton({label:l.__("Change and reload")})]}).then((e=>{e.button.accept&&t.set("locale",a).then((()=>{window.location.reload()})).catch((e=>{console.error(e)}))}))}),i&&i.addItem({command:g,args:{}}),s&&s.addItem({category:l.__("Display Languages"),command:g})}})).catch((e=>{console.error(`Available locales errored!\n${e}`)}))})).catch((e=>{console.error(`The jupyterlab translation extension appears to be missing.\n${e}`)}))}},u=[c,d]}}]);