notebook 7.3.0b0__py3-none-any.whl → 7.3.0b1__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 (174) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/1088.bundle.js +1 -1
  3. notebook/static/113.bundle.js +1 -1
  4. notebook/static/1198.bundle.js +1 -1
  5. notebook/static/{3463.bundle.js → 1261.bundle.js} +1 -1
  6. notebook/static/131.bundle.js +1 -1
  7. notebook/static/1326.bundle.js +1 -1
  8. notebook/static/134.bundle.js +1 -1
  9. notebook/static/1408.bundle.js +1 -1
  10. notebook/static/1496.bundle.js +1 -1
  11. notebook/static/1647.bundle.js +1 -1
  12. notebook/static/1650.bundle.js +1 -1
  13. notebook/static/1684.bundle.js +1 -1
  14. notebook/static/1809.bundle.js +1 -1
  15. notebook/static/1827.bundle.js +1 -1
  16. notebook/static/1833.bundle.js +1 -1
  17. notebook/static/1958.bundle.js +1 -1
  18. notebook/static/1962.bundle.js +1 -1
  19. notebook/static/2007.bundle.js +1 -1
  20. notebook/static/2065.bundle.js +1 -1
  21. notebook/static/2088.bundle.js +1 -1
  22. notebook/static/2089.bundle.js +1 -1
  23. notebook/static/2122.bundle.js +1 -1
  24. notebook/static/2167.bundle.js +1 -1
  25. notebook/static/2184.bundle.js +1 -1
  26. notebook/static/2311.bundle.js +1 -1
  27. notebook/static/2401.bundle.js +1 -1
  28. notebook/static/2479.bundle.js +1 -1
  29. notebook/static/2489.bundle.js +1 -1
  30. notebook/static/2607.bundle.js +1 -1
  31. notebook/static/2615.bundle.js +1 -1
  32. notebook/static/2636.bundle.js +1 -1
  33. notebook/static/2924.bundle.js +1 -1
  34. notebook/static/2944.bundle.js +1 -1
  35. notebook/static/3129.bundle.js +1 -1
  36. notebook/static/3146.bundle.js +1 -1
  37. notebook/static/3187.bundle.js +1 -1
  38. notebook/static/3213.bundle.js +1 -1
  39. notebook/static/3340.bundle.js +1 -1
  40. notebook/static/3360.bundle.js +1 -1
  41. notebook/static/3466.bundle.js +1 -1
  42. notebook/static/3512.bundle.js +1 -1
  43. notebook/static/3676.bundle.js +1 -1
  44. notebook/static/3680.bundle.js +1 -1
  45. notebook/static/374.bundle.js +1 -1
  46. notebook/static/3768.bundle.js +1 -1
  47. notebook/static/377.bundle.js +1 -1
  48. notebook/static/3863.bundle.js +1 -1
  49. notebook/static/3881.bundle.js +1 -1
  50. notebook/static/4042.bundle.js +1 -1
  51. notebook/static/4212.bundle.js +1 -1
  52. notebook/static/4242.bundle.js +1 -1
  53. notebook/static/4382.bundle.js +1 -1
  54. notebook/static/4499.bundle.js +1 -1
  55. notebook/static/4630.bundle.js +1 -1
  56. notebook/static/4645.bundle.js +1 -1
  57. notebook/static/4811.bundle.js +1 -1
  58. notebook/static/4837.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5135.bundle.js +1 -1
  61. notebook/static/5254.bundle.js +1 -1
  62. notebook/static/5263.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/545.bundle.js +1 -1
  68. notebook/static/5573.bundle.js +1 -1
  69. notebook/static/5601.bundle.js +1 -1
  70. notebook/static/5649.bundle.js +2 -2
  71. notebook/static/5733.bundle.js +1 -1
  72. notebook/static/5912.bundle.js +1 -1
  73. notebook/static/5952.bundle.js +1 -0
  74. notebook/static/6017.bundle.js +1 -1
  75. notebook/static/6139.bundle.js +1 -1
  76. notebook/static/62.bundle.js +1 -1
  77. notebook/static/6345.bundle.js +1 -1
  78. notebook/static/6604.bundle.js +1 -1
  79. notebook/static/6621.bundle.js +1 -1
  80. notebook/static/6627.bundle.js +1 -1
  81. notebook/static/6748.bundle.js +1 -1
  82. notebook/static/6815.bundle.js +1 -1
  83. notebook/static/6853.bundle.js +1 -1
  84. notebook/static/6893.bundle.js +1 -1
  85. notebook/static/690.bundle.js +1 -1
  86. notebook/static/6962.bundle.js +1 -1
  87. notebook/static/6999.bundle.js +1 -1
  88. notebook/static/7226.bundle.js +1 -1
  89. notebook/static/7252.bundle.js +1 -1
  90. notebook/static/7302.bundle.js +1 -1
  91. notebook/static/7386.bundle.js +1 -1
  92. notebook/static/7391.bundle.js +1 -1
  93. notebook/static/7543.bundle.js +1 -1
  94. notebook/static/755.bundle.js +1 -1
  95. notebook/static/7603.bundle.js +1 -1
  96. notebook/static/7639.bundle.js +1 -1
  97. notebook/static/7655.bundle.js +1 -1
  98. notebook/static/7684.bundle.js +1 -1
  99. notebook/static/7811.bundle.js +1 -1
  100. notebook/static/7812.bundle.js +1 -1
  101. notebook/static/7819.bundle.js +1 -1
  102. notebook/static/7854.bundle.js +1 -1
  103. notebook/static/7900.bundle.js +1 -1
  104. notebook/static/7906.bundle.js +1 -1
  105. notebook/static/8471.bundle.js +1 -1
  106. notebook/static/8579.bundle.js +1 -1
  107. notebook/static/8633.bundle.js +1 -1
  108. notebook/static/8771.bundle.js +1 -1
  109. notebook/static/8781.bundle.js +1 -1
  110. notebook/static/8875.bundle.js +1 -1
  111. notebook/static/8907.bundle.js +1 -1
  112. notebook/static/8928.bundle.js +1 -1
  113. notebook/static/893.bundle.js +1 -1
  114. notebook/static/901.bundle.js +1 -1
  115. notebook/static/9068.bundle.js +1 -1
  116. notebook/static/9136.bundle.js +1 -1
  117. notebook/static/9151.bundle.js +1 -1
  118. notebook/static/9161.bundle.js +1 -1
  119. notebook/static/9268.bundle.js +1 -1
  120. notebook/static/9335.bundle.js +1 -1
  121. notebook/static/9341.bundle.js +1 -1
  122. notebook/static/9357.bundle.js +1 -0
  123. notebook/static/9380.bundle.js +1 -1
  124. notebook/static/9605.bundle.js +1 -1
  125. notebook/static/9638.bundle.js +1 -1
  126. notebook/static/9680.bundle.js +1 -1
  127. notebook/static/9685.bundle.js +1 -1
  128. notebook/static/9752.bundle.js +1 -1
  129. notebook/static/9821.bundle.js +1 -1
  130. notebook/static/9852.bundle.js +1 -1
  131. notebook/static/bundle.js +1 -1
  132. notebook/static/third-party-licenses.json +101 -101
  133. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  134. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  135. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  136. notebook-7.3.0b1.data/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/full-width-notebook.json +27 -0
  137. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  138. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  139. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +6 -0
  140. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  141. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  142. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/466.16ad54314911066edf9c.js +1 -0
  143. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.67f8b11d2af855286118.js → notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.963a302c93b1c86218b2.js +1 -1
  144. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.2635b6a9fd871a610e32.js +1 -0
  145. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.fd0956ebf15f666a19f8.js → notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.c690bcb5ab5c38794e5d.js +1 -1
  146. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  147. {notebook-7.3.0b0.dist-info → notebook-7.3.0b1.dist-info}/METADATA +2 -2
  148. {notebook-7.3.0b0.dist-info → notebook-7.3.0b1.dist-info}/RECORD +170 -169
  149. notebook/static/5921.bundle.js +0 -1
  150. notebook/static/911.bundle.js +0 -1
  151. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/907.767373e59d0c0e33ef12.js +0 -1
  152. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.50419fa0a72e54064396.js +0 -1
  153. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  154. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  155. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  156. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  157. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  158. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  159. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  160. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  161. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  162. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  163. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  164. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  165. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  166. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  167. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  168. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  169. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  170. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  171. {notebook-7.3.0b0.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  172. {notebook-7.3.0b0.dist-info → notebook-7.3.0b1.dist-info}/WHEEL +0 -0
  173. {notebook-7.3.0b0.dist-info → notebook-7.3.0b1.dist-info}/entry_points.txt +0 -0
  174. {notebook-7.3.0b0.dist-info → notebook-7.3.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(71370),n=s(58194),i=s(2159);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(92545),n=s(95704),i=s(2159);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(21961),s=a(58194);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class o{constructor(){this._initialized=!1}async _ensureInitialized(){this._initialized||(this._mathDocument=await c.ensureMathDocument(),this._initialized=!0)}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const r={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:s.ILatexTypesetter,activate:e=>{const t=new o;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0};var c;!function(e){let t=null;e.ensureMathDocument=async function(){if(!t){t=new i.PromiseDelegate,Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const[{mathjax:e},{CHTML:n},{TeX:s},{TeXFont:o},{AllPackages:r},{SafeHandler:c},{HTMLHandler:l},{browserAdaptor:m},{AssistiveMmlHandler:h}]=await Promise.all([a.e(4971).then(a.bind(a,44971)),Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),a.e(8285).then(a.t.bind(a,78285,23)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),a.e(270).then(a.bind(a,90270)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23))]);e.handlers.register(h(c(new l(m()))));class d extends o{}d.defaultFonts={};const u=new n({font:new d}),p=new s({packages:r.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}),x=e.document(window.document,{InputJax:p,OutputJax:u});t.resolve(x)}return t.promise}}(c||(c={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(21961),s=a(95704);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class o{constructor(){this._initialized=!1}async _ensureInitialized(){this._initialized||(this._mathDocument=await c.ensureMathDocument(),this._initialized=!0)}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const r={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:s.ILatexTypesetter,activate:e=>{const t=new o;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0};var c;!function(e){let t=null;e.ensureMathDocument=async function(){if(!t){t=new i.PromiseDelegate,Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const[{mathjax:e},{CHTML:n},{TeX:s},{TeXFont:o},{AllPackages:r},{SafeHandler:c},{HTMLHandler:l},{browserAdaptor:m},{AssistiveMmlHandler:h}]=await Promise.all([a.e(4971).then(a.bind(a,44971)),Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),a.e(8285).then(a.t.bind(a,78285,23)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),a.e(270).then(a.bind(a,90270)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23))]);e.handlers.register(h(c(new l(m()))));class d extends o{}d.defaultFonts={};const u=new n({font:new d}),p=new s({packages:r.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}),x=e.document(window.document,{InputJax:p,OutputJax:u});t.resolve(x)}return t.promise}}(c||(c={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(73852),s=n(53876),r=n(20754),l=n(70607),o=n(93050),i=n(76878),c=n(78156),d=n(5348),u=n(21961),m=n(2159),h=n(47087),p=n(2260);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"json",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© %1-%2 Project Jupyter Contributors",2015,2024)),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.createButton({label:r.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"],loading:"lazy"});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.createButton({label:l.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),m.addGroup([{command:k}],20);const y=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),y.push({command:t})})),m.addGroup(y,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function y(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=y(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${m} ${t.title}`},icon:e=>y(`${e.format}`).icon,execute:async e=>{var t;const n=y(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(84241),s=n(20911),r=n(77075),l=n(68567),o=n(66649),i=n(7258),c=n(78156),d=n(68086),u=n(21961),m=n(2159),h=n(47087),p=n(2260);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"json",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© %1-%2 Project Jupyter Contributors",2015,2024)),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.cancelButton({label:r.__("Close")})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"],loading:"lazy"});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.cancelButton({label:l.__("Close")})]})}}),m.addGroup([{command:k}],20);const C=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),C.push({command:t})})),m.addGroup(C,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function C(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=C(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=C(`${e.format}`);return`${m} ${t.title}`},icon:e=>C(`${e.format}`).icon,execute:async e=>{var t;const n=C(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(21961).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(76878),n=o(58194),r=o(2260);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null,this.addClass("jp-ThemedContainer");const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(21961).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(7258),n=o(95704),r=o(2260);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null,this.addClass("jp-ThemedContainer");const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(20754),a=o(7073),i=o(28976),d=o(2159);const s=[{id:"@jupyter-notebook/docmanager-extension:opener",autoStart:!0,optional:[i.INotebookPathOpener,i.INotebookShell],provides:a.IDocumentWidgetOpener,description:"Open documents in a new browser tab",activate:(e,t,o)=>{const a=n.PageConfig.getBaseUrl(),s=e.docRegistry,r=null!=t?t:i.defaultNotebookPathOpener;let l=0;return new class{constructor(){this._opened=new d.Signal(this)}async open(t,i){var d,c,u;const p=null!==(d=null==i?void 0:i.type)&&void 0!==d?d:"",h=null==i?void 0:i.ref,v=null===(u=null===(c=null==o?void 0:o.userLayout)||void 0===c?void 0:c[p])||void 0===u?void 0:u.area;if("_noref"!==h&&void 0===v){const e=t.context.path,o=n.PathExt.extname(e);let i,d="edit";return("default"===p&&".ipynb"===o||p.includes("Notebook"))&&(t.context.sessionContext.kernelPreference.name&&await t.context.save(),d="notebooks"),p!==s.defaultWidgetFactory(e).name&&(i=new URLSearchParams({factory:p})),r.open({prefix:n.URLExt.join(a,d),path:e,searchParams:i}),void t.dispose()}t.id||(t.id="document-manager-"+ ++l),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.shell.add(t,"main",i||{}),e.shell.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(77075),a=o(20780),i=o(20763),d=o(2159);const s=[{id:"@jupyter-notebook/docmanager-extension:opener",autoStart:!0,optional:[i.INotebookPathOpener,i.INotebookShell],provides:a.IDocumentWidgetOpener,description:"Open documents in a new browser tab",activate:(e,t,o)=>{const a=n.PageConfig.getBaseUrl(),s=e.docRegistry,r=null!=t?t:i.defaultNotebookPathOpener;let l=0;return new class{constructor(){this._opened=new d.Signal(this)}async open(t,i){var d,c,u;const p=null!==(d=null==i?void 0:i.type)&&void 0!==d?d:"",h=null==i?void 0:i.ref,v=null===(u=null===(c=null==o?void 0:o.userLayout)||void 0===c?void 0:c[p])||void 0===u?void 0:u.area;if("_noref"!==h&&void 0===v){const e=t.context.path,o=n.PathExt.extname(e);let i,d="edit";return("default"===p&&".ipynb"===o||p.includes("Notebook"))&&(t.context.sessionContext.kernelPreference.name&&await t.context.save(),d="notebooks"),p!==s.defaultWidgetFactory(e).name&&(i=new URLSearchParams({factory:p})),r.open({prefix:n.URLExt.join(a,d),path:e,searchParams:i}),void t.dispose()}t.id||(t.id="document-manager-"+ ++l),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.shell.add(t,"main",i||{}),e.shell.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(73852),o=n(20754),i=n(88117),r=n(28976),s=n(14931);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(84241),o=n(77075),i=n(50027),r=n(20763),s=n(14931);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>I,IRunningSessionSidebar:()=>T,RunningSessionManagers:()=>y,RunningSessions:()=>V,SearchableSessions:()=>B,SearchableSessionsList:()=>D});var n=s(63956),i=s(85430),a=s(55947),o=s(53876),l=s(93050),r=s(76878),d=s(21961),h=s(49901),c=s(47392),u=s(2159),g=s(2260),p=s(78156),_=s.n(p);const m="jp-RunningSessions",w="jp-RunningSessions-item",f="jp-RunningSessions-itemLabel",b="jp-RunningSessions-itemDetail",v="jp-RunningSessions-itemShutdown",S="jp-RunningSessions-icon",C="jp-running-sessions",I=new d.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),T=new d.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class y{constructor(){this._added=new u.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new h.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function j(t){var e,s;const{runningItem:a}=t,[o,d]=_().useState(!1),h=(0,p.useRef)(!1),c=[w],u=null===(e=a.detail)||void 0===e?void 0:e.call(a),g=a.icon(),m=a.labelTitle?a.labelTitle():"",C=t.translator||l.nullTranslator,I=C.load("jupyterlab"),T=t.shutdownItemIcon||r.closeIcon,y=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(a):t.shutdownLabel)&&void 0!==s?s:I.__("Shut Down"),j=(0,p.useCallback)((t=>{var e;h.current=!0,t.preventDefault(),null===(e=a.shutdown)||void 0===e||e.call(a)}),[a,h]),E=a.children,A=!!(null==E?void 0:E.length),L=(0,p.useCallback)((t=>{if(h.current)return;const e=(0,r.getTreeItemElement)(t.target);t.currentTarget===e&&A&&d(!o)}),[A,o,h]);return t.collapseToggled.connect(((t,e)=>d(e))),a.className&&c.push(a.className),_().createElement(_().Fragment,null,_().createElement(n.k,{className:`${c.join(" ")} jp-TreeItem nested`,onClick:L,"data-context":a.context||"",expanded:!o},g?"string"==typeof g?_().createElement("img",{src:g,className:S,slot:"start"}):_().createElement(g.react,{slot:"start",tag:"span",className:S}):void 0,_().createElement("span",{className:f,title:m,onClick:a.open&&(()=>a.open())},a.label()),u&&_().createElement("span",{className:b},u),a.shutdown&&_().createElement(i.z,{appearance:"stealth",className:v,onClick:j,title:y,slot:"end"},_().createElement(T.react,{tag:null})),E&&_().createElement(x,{runningItems:E,shutdownItemIcon:T,translator:C,collapseToggled:t.collapseToggled})))}function x(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return _().createElement(_().Fragment,null,s.map(((e,s)=>_().createElement(j,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends r.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new u.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return _().createElement(r.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,p.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class A extends r.ReactWidget{constructor(t){super(),this._options=t,this._update=new u.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}get mode(){return this._mode}set mode(t){this._mode!==t&&(this._mode=t,this._update.emit())}dispose(){u.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return _().createElement(r.UseSignal,{signal:this._update},(()=>{var s;e?e=!1:t.runningItems=t.manager.running({mode:this.mode});const n=["jp-TreeView"];return"list"===this.mode&&n.push("jp-mod-flat"),_().createElement("div",{className:"jp-RunningSessions-sectionContainer"},_().createElement(a.L,{className:n.join(" ")},_().createElement(x,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled})))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class L extends r.PanelWithToolbar{constructor(t){var e;super(),this._buttons=null,this._listView=!1,this._collapseToggled=new u.Signal(this),this._viewChanged=new u.Signal(this),this._listView="list"===(null!==(e=t.viewMode)&&void 0!==e?e:"tree"),this._manager=t.manager,this._filterProvider=t.filterProvider;const s=t.translator||l.nullTranslator;this._trans=s.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();const n=t.manager.running({mode:t.manager.supportsMultipleViews&&!this._listView?"tree":"list"});!1!==t.showToolbar&&this._initializeToolbar(n),this._listWidget=new A({runningItems:n,collapseToggled:this._collapseToggled,...t}),this._listWidget.mode=t.manager.supportsMultipleViews&&!this._listView?"tree":"list",this.addWidget(this._listWidget)}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),void 0===this._manager.supportsMultipleViews&&this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._listWidget.mode=this._manager.supportsMultipleViews&&!this._listView?"tree":"list",this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,n=`${s}?`,i=new r.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{var t;const e=null!==(t="function"==typeof this._manager.shutdownAllConfirmationText?this._manager.shutdownAllConfirmationText():this._manager.shutdownAllConfirmationText)&&void 0!==t?t:`${s} ${this._manager.name}`;(0,o.showDialog)({title:n,body:e,buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),a=new r.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:r.tableRowsIcon,pressedIcon:r.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),l=new r.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:r.collapseAllIcon,pressedIcon:r.expandAllIcon,onClick:()=>{const t=!l.pressed;this._collapseToggled.emit(t),l.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":a,"collapse-expand":l,"shutdown-all":i},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this),this._manager.toolbarButtons&&this._manager.toolbarButtons.forEach((t=>this.toolbar.addItem(t instanceof r.CommandToolbarButton?t.commandId:t.id,t)));for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"}).filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"});const e=t.length>0,s=void 0===this._manager.supportsMultipleViews?0!==t.filter((t=>t.children)).length:this._manager.supportsMultipleViews,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"flex":"none",this._buttons["collapse-expand"].node.style.display=n?"flex":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class V extends r.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:l.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(m),this.toolbar.addItem("refresh",new r.ToolbarButton({tooltip:n.__("Refresh List"),icon:r.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new L({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(C,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(C))&&void 0!==t?t:{}}}class R extends L{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends g.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class B extends g.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:l.nullTranslator,this.addClass(m),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new D(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+f)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+w)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),c.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class D extends g.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:l.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget,viewMode:"list"});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>I,IRunningSessionSidebar:()=>T,RunningSessionManagers:()=>y,RunningSessions:()=>V,SearchableSessions:()=>B,SearchableSessionsList:()=>D});var n=s(63956),i=s(85430),a=s(55947),o=s(20911),l=s(66649),r=s(7258),d=s(21961),h=s(49901),c=s(47392),u=s(2159),g=s(2260),p=s(78156),_=s.n(p);const m="jp-RunningSessions",w="jp-RunningSessions-item",f="jp-RunningSessions-itemLabel",b="jp-RunningSessions-itemDetail",v="jp-RunningSessions-itemShutdown",S="jp-RunningSessions-icon",C="jp-running-sessions",I=new d.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),T=new d.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class y{constructor(){this._added=new u.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new h.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function j(t){var e,s;const{runningItem:a}=t,[o,d]=_().useState(!1),h=(0,p.useRef)(!1),c=[w],u=null===(e=a.detail)||void 0===e?void 0:e.call(a),g=a.icon(),m=a.labelTitle?a.labelTitle():"",C=t.translator||l.nullTranslator,I=C.load("jupyterlab"),T=t.shutdownItemIcon||r.closeIcon,y=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(a):t.shutdownLabel)&&void 0!==s?s:I.__("Shut Down"),j=(0,p.useCallback)((t=>{var e;h.current=!0,t.preventDefault(),null===(e=a.shutdown)||void 0===e||e.call(a)}),[a,h]),E=a.children,A=!!(null==E?void 0:E.length),L=(0,p.useCallback)((t=>{if(h.current)return;const e=(0,r.getTreeItemElement)(t.target);t.currentTarget===e&&A&&d(!o)}),[A,o,h]);return t.collapseToggled.connect(((t,e)=>d(e))),a.className&&c.push(a.className),_().createElement(_().Fragment,null,_().createElement(n.k,{className:`${c.join(" ")} jp-TreeItem nested`,onClick:L,"data-context":a.context||"",expanded:!o},g?"string"==typeof g?_().createElement("img",{src:g,className:S,slot:"start"}):_().createElement(g.react,{slot:"start",tag:"span",className:S}):void 0,_().createElement("span",{className:f,title:m,onClick:a.open&&(()=>a.open())},a.label()),u&&_().createElement("span",{className:b},u),a.shutdown&&_().createElement(i.z,{appearance:"stealth",className:v,onClick:j,title:y,slot:"end"},_().createElement(T.react,{tag:null})),E&&_().createElement(x,{runningItems:E,shutdownItemIcon:T,translator:C,collapseToggled:t.collapseToggled})))}function x(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return _().createElement(_().Fragment,null,s.map(((e,s)=>_().createElement(j,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends r.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new u.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return _().createElement(r.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,p.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class A extends r.ReactWidget{constructor(t){super(),this._options=t,this._update=new u.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}get mode(){return this._mode}set mode(t){this._mode!==t&&(this._mode=t,this._update.emit())}dispose(){u.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return _().createElement(r.UseSignal,{signal:this._update},(()=>{var s;e?e=!1:t.runningItems=t.manager.running({mode:this.mode});const n=["jp-TreeView"];return"list"===this.mode&&n.push("jp-mod-flat"),_().createElement("div",{className:"jp-RunningSessions-sectionContainer"},_().createElement(a.L,{className:n.join(" ")},_().createElement(x,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled})))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class L extends r.PanelWithToolbar{constructor(t){var e;super(),this._buttons=null,this._listView=!1,this._collapseToggled=new u.Signal(this),this._viewChanged=new u.Signal(this),this._listView="list"===(null!==(e=t.viewMode)&&void 0!==e?e:"tree"),this._manager=t.manager,this._filterProvider=t.filterProvider;const s=t.translator||l.nullTranslator;this._trans=s.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();const n=t.manager.running({mode:t.manager.supportsMultipleViews&&!this._listView?"tree":"list"});!1!==t.showToolbar&&this._initializeToolbar(n),this._listWidget=new A({runningItems:n,collapseToggled:this._collapseToggled,...t}),this._listWidget.mode=t.manager.supportsMultipleViews&&!this._listView?"tree":"list",this.addWidget(this._listWidget)}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),void 0===this._manager.supportsMultipleViews&&this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._listWidget.mode=this._manager.supportsMultipleViews&&!this._listView?"tree":"list",this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,n=`${s}?`,i=new r.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{var t;const e=null!==(t="function"==typeof this._manager.shutdownAllConfirmationText?this._manager.shutdownAllConfirmationText():this._manager.shutdownAllConfirmationText)&&void 0!==t?t:`${s} ${this._manager.name}`;(0,o.showDialog)({title:n,body:e,buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),a=new r.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:r.tableRowsIcon,pressedIcon:r.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),l=new r.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:r.collapseAllIcon,pressedIcon:r.expandAllIcon,onClick:()=>{const t=!l.pressed;this._collapseToggled.emit(t),l.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":a,"collapse-expand":l,"shutdown-all":i},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this),this._manager.toolbarButtons&&this._manager.toolbarButtons.forEach((t=>this.toolbar.addItem(t instanceof r.CommandToolbarButton?t.commandId:t.id,t)));for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"}).filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"});const e=t.length>0,s=void 0===this._manager.supportsMultipleViews?0!==t.filter((t=>t.children)).length:this._manager.supportsMultipleViews,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"flex":"none",this._buttons["collapse-expand"].node.style.display=n?"flex":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class V extends r.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:l.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(m),this.toolbar.addItem("refresh",new r.ToolbarButton({tooltip:n.__("Refresh List"),icon:r.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new L({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(C,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(C))&&void 0!==t?t:{}}}class R extends L{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends g.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class B extends g.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:l.nullTranslator,this.addClass(m),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new D(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+f)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+w)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),c.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class D extends g.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:l.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget,viewMode:"list"});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(73852),i=n(53876),o=n(21058),a=n(40930),s=n(95514),d=n(70607),l=n(3012),c=n(93050);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(93050),o=n(76878),a=n(2260);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(20754),o=n(23764),a=n(21961),s=n(2159),d=n(2260),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9772).then(n.t.bind(n,39772,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9772)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(84241),i=n(20911),o=n(21058),a=n(40930),s=n(12043),d=n(68567),l=n(68878),c=n(66649);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(66649),o=n(7258),a=n(2260);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(77075),o=n(21428),a=n(21961),s=n(2159),d=n(2260),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9772).then(n.t.bind(n,39772,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9772)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(983),o=i(37497),s=i(21961);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(53876),d=i(3984),l=i(23764),c=i(76878),h=i(2260);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(33441),f=i(93050),v=i(78156),_=i.n(v);function C(e){return _().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:f.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?_().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||f.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return _().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||f.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return _().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(10035);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |async def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |async def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(71386),o=i(67188),s=i(21961);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(20911),d=i(23436),l=i(21428),c=i(7258),h=i(2260);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(15603),f=i(66649),v=i(78156),_=i.n(v);function C(e){return _().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:f.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?_().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||f.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return _().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||f.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return _().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(61362);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |async def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |async def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(39772),s=a(2159),n=a(2260),l=a(93050),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(39772),s=a(2159),n=a(2260),l=a(66649),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);