notebook 7.3.0a1__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 (239) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +10 -2
  3. notebook/static/1088.bundle.js +1 -1
  4. notebook/static/113.bundle.js +1 -1
  5. notebook/static/1198.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/1584.bundle.js +1 -1
  12. notebook/static/1647.bundle.js +1 -1
  13. notebook/static/1650.bundle.js +1 -1
  14. notebook/static/1684.bundle.js +1 -1
  15. notebook/static/170.bundle.js +1 -1
  16. notebook/static/1809.bundle.js +1 -1
  17. notebook/static/1827.bundle.js +1 -1
  18. notebook/static/1828.bundle.js +1 -1
  19. notebook/static/1833.bundle.js +1 -1
  20. notebook/static/1958.bundle.js +1 -1
  21. notebook/static/1962.bundle.js +1 -1
  22. notebook/static/2007.bundle.js +1 -1
  23. notebook/static/2065.bundle.js +1 -1
  24. notebook/static/2088.bundle.js +1 -1
  25. notebook/static/2089.bundle.js +1 -1
  26. notebook/static/2122.bundle.js +1 -1
  27. notebook/static/2167.bundle.js +1 -1
  28. notebook/static/2184.bundle.js +1 -1
  29. notebook/static/2311.bundle.js +1 -1
  30. notebook/static/{3030.bundle.js → 2323.bundle.js} +1 -1
  31. notebook/static/2401.bundle.js +1 -1
  32. notebook/static/2424.bundle.js +377 -0
  33. notebook/static/2479.bundle.js +1 -1
  34. notebook/static/2489.bundle.js +1 -1
  35. notebook/static/2607.bundle.js +1 -1
  36. notebook/static/2615.bundle.js +1 -1
  37. notebook/static/2636.bundle.js +1 -1
  38. notebook/static/2756.bundle.js +1 -1
  39. notebook/static/2813.bundle.js +1 -1
  40. notebook/static/2866.bundle.js +1 -1
  41. notebook/static/2924.bundle.js +1 -1
  42. notebook/static/2944.bundle.js +1 -1
  43. notebook/static/2955.bundle.js +1 -0
  44. notebook/static/3129.bundle.js +1 -1
  45. notebook/static/3146.bundle.js +1 -1
  46. notebook/static/3187.bundle.js +1 -1
  47. notebook/static/3213.bundle.js +1 -1
  48. notebook/static/3301.bundle.js +1 -1
  49. notebook/static/3325.bundle.js +1 -1
  50. notebook/static/3340.bundle.js +1 -1
  51. notebook/static/3360.bundle.js +1 -1
  52. notebook/static/3466.bundle.js +1 -1
  53. notebook/static/35.bundle.js +1 -1
  54. notebook/static/3512.bundle.js +1 -1
  55. notebook/static/3676.bundle.js +1 -1
  56. notebook/static/3680.bundle.js +1 -1
  57. notebook/static/374.bundle.js +1 -1
  58. notebook/static/3768.bundle.js +1 -1
  59. notebook/static/377.bundle.js +1 -1
  60. notebook/static/3863.bundle.js +1 -1
  61. notebook/static/3881.bundle.js +1 -1
  62. notebook/static/4042.bundle.js +1 -1
  63. notebook/static/4058.bundle.js +1 -1
  64. notebook/static/409.bundle.js +1 -1
  65. notebook/static/4212.bundle.js +1 -1
  66. notebook/static/4242.bundle.js +79 -0
  67. notebook/static/4271.bundle.js +1 -1
  68. notebook/static/4291.bundle.js +1 -1
  69. notebook/static/4382.bundle.js +1 -1
  70. notebook/static/4499.bundle.js +1 -1
  71. notebook/static/4526.bundle.js +1 -1
  72. notebook/static/4588.bundle.js +1 -1
  73. notebook/static/4630.bundle.js +1 -1
  74. notebook/static/4645.bundle.js +1 -1
  75. notebook/static/4811.bundle.js +1 -1
  76. notebook/static/4837.bundle.js +1 -1
  77. notebook/static/5099.bundle.js +1 -1
  78. notebook/static/5135.bundle.js +1 -1
  79. notebook/static/5166.bundle.js +1 -1
  80. notebook/static/5234.bundle.js +1 -1
  81. notebook/static/5254.bundle.js +1 -1
  82. notebook/static/5261.bundle.js +1 -1
  83. notebook/static/5263.bundle.js +1 -0
  84. notebook/static/5313.bundle.js +1 -1
  85. notebook/static/5325.bundle.js +1 -1
  86. notebook/static/5346.bundle.js +1 -1
  87. notebook/static/5426.bundle.js +1 -1
  88. notebook/static/5430.bundle.js +653 -0
  89. notebook/static/545.bundle.js +1 -1
  90. notebook/static/5451.bundle.js +1 -1
  91. notebook/static/5573.bundle.js +1 -1
  92. notebook/static/5601.bundle.js +1 -1
  93. notebook/static/5649.bundle.js +2 -2
  94. notebook/static/5733.bundle.js +1 -1
  95. notebook/static/5850.bundle.js +1 -1
  96. notebook/static/5912.bundle.js +1 -1
  97. notebook/static/5952.bundle.js +1 -0
  98. notebook/static/6017.bundle.js +1 -1
  99. notebook/static/6061.bundle.js +1 -1
  100. notebook/static/6139.bundle.js +1 -1
  101. notebook/static/62.bundle.js +1 -1
  102. notebook/static/6271.bundle.js +1 -1
  103. notebook/static/6345.bundle.js +1 -1
  104. notebook/static/6604.bundle.js +1 -1
  105. notebook/static/6621.bundle.js +1 -1
  106. notebook/static/6627.bundle.js +1 -1
  107. notebook/static/6648.bundle.js +1 -0
  108. notebook/static/6731.bundle.js +1 -1
  109. notebook/static/6748.bundle.js +1 -1
  110. notebook/static/677.bundle.js +1 -1
  111. notebook/static/6815.bundle.js +1 -1
  112. notebook/static/6853.bundle.js +1 -1
  113. notebook/static/6893.bundle.js +1 -1
  114. notebook/static/690.bundle.js +1 -1
  115. notebook/static/6962.bundle.js +1 -1
  116. notebook/static/6999.bundle.js +1 -1
  117. notebook/static/7226.bundle.js +1 -1
  118. notebook/static/7252.bundle.js +1 -1
  119. notebook/static/7302.bundle.js +1 -1
  120. notebook/static/7369.bundle.js +1 -1
  121. notebook/static/7386.bundle.js +1 -1
  122. notebook/static/7391.bundle.js +1 -1
  123. notebook/static/7543.bundle.js +1 -1
  124. notebook/static/755.bundle.js +1 -1
  125. notebook/static/7603.bundle.js +1 -1
  126. notebook/static/7639.bundle.js +1 -1
  127. notebook/static/7655.bundle.js +1 -1
  128. notebook/static/7684.bundle.js +1 -1
  129. notebook/static/7811.bundle.js +1 -1
  130. notebook/static/7812.bundle.js +1 -1
  131. notebook/static/7819.bundle.js +1 -1
  132. notebook/static/7821.bundle.js +1 -1
  133. notebook/static/7854.bundle.js +1 -1
  134. notebook/static/7866.bundle.js +1 -0
  135. notebook/static/7900.bundle.js +1 -1
  136. notebook/static/7906.bundle.js +1 -1
  137. notebook/static/8010.bundle.js +1 -1
  138. notebook/static/8032.bundle.js +1 -1
  139. notebook/static/8285.bundle.js +1 -1
  140. notebook/static/8471.bundle.js +1 -1
  141. notebook/static/8579.bundle.js +1 -1
  142. notebook/static/8633.bundle.js +1 -1
  143. notebook/static/8635.bundle.js +41 -0
  144. notebook/static/8771.bundle.js +1 -1
  145. notebook/static/8781.bundle.js +1 -1
  146. notebook/static/8875.bundle.js +1 -1
  147. notebook/static/8907.bundle.js +1 -1
  148. notebook/static/8928.bundle.js +1 -1
  149. notebook/static/8929.bundle.js +1 -1
  150. notebook/static/893.bundle.js +1 -1
  151. notebook/static/901.bundle.js +1 -1
  152. notebook/static/9068.bundle.js +1 -1
  153. notebook/static/9136.bundle.js +1 -1
  154. notebook/static/9151.bundle.js +1 -1
  155. notebook/static/9161.bundle.js +1 -1
  156. notebook/static/9268.bundle.js +1 -1
  157. notebook/static/9335.bundle.js +1 -1
  158. notebook/static/9341.bundle.js +1 -1
  159. notebook/static/9357.bundle.js +1 -0
  160. notebook/static/9380.bundle.js +1 -1
  161. notebook/static/9605.bundle.js +1 -1
  162. notebook/static/9638.bundle.js +1 -1
  163. notebook/static/9672.bundle.js +352 -0
  164. notebook/static/9680.bundle.js +1 -1
  165. notebook/static/9685.bundle.js +1 -1
  166. notebook/static/9752.bundle.js +1 -1
  167. notebook/static/9799.bundle.js +1 -0
  168. notebook/static/9821.bundle.js +1 -1
  169. notebook/static/9852.bundle.js +1 -1
  170. notebook/static/bundle.js +1 -1
  171. notebook/static/third-party-licenses.json +124 -130
  172. notebook/templates/consoles.html +1 -1
  173. notebook/templates/edit.html +1 -1
  174. notebook/templates/error.html +1 -1
  175. notebook/templates/notebooks.html +1 -1
  176. notebook/templates/terminals.html +1 -1
  177. notebook/templates/tree.html +1 -1
  178. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +17 -17
  179. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  180. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  181. notebook-7.3.0b1.data/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/full-width-notebook.json +27 -0
  182. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +11 -11
  183. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +18 -18
  184. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +6 -1
  185. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +13 -13
  186. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +12 -12
  187. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/466.16ad54314911066edf9c.js +1 -0
  188. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.963a302c93b1c86218b2.js +1 -0
  189. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js → notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.2635b6a9fd871a610e32.js +1 -1
  190. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.c690bcb5ab5c38794e5d.js +1 -0
  191. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  192. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/METADATA +2 -2
  193. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/RECORD +216 -223
  194. notebook/static/1226.bundle.js +0 -1
  195. notebook/static/1750.bundle.js +0 -1
  196. notebook/static/1884.bundle.js +0 -386
  197. notebook/static/4045.bundle.js +0 -1
  198. notebook/static/4434.bundle.js +0 -1
  199. notebook/static/5018.bundle.js +0 -1
  200. notebook/static/5712.bundle.js +0 -1
  201. notebook/static/5921.bundle.js +0 -1
  202. notebook/static/6164.bundle.js +0 -1
  203. notebook/static/6318.bundle.js +0 -1
  204. notebook/static/6619.bundle.js +0 -1
  205. notebook/static/6898.bundle.js +0 -1
  206. notebook/static/7506.bundle.js +0 -703
  207. notebook/static/7579.bundle.js +0 -1
  208. notebook/static/8054.bundle.js +0 -1
  209. notebook/static/8647.bundle.js +0 -1
  210. notebook/static/8723.bundle.js +0 -1
  211. notebook/static/911.bundle.js +0 -1
  212. notebook/static/9734.bundle.js +0 -1
  213. notebook/static/9906.bundle.js +0 -1
  214. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +0 -1
  215. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js +0 -1
  216. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +0 -1
  217. /notebook/static/{7506.bundle.js.LICENSE.txt → 4242.bundle.js.LICENSE.txt} +0 -0
  218. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  219. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  220. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  221. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  222. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  223. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  224. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  225. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  226. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  227. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  228. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  229. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  230. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  231. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  232. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  233. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  234. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  235. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  236. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  237. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/WHEEL +0 -0
  238. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/entry_points.txt +0 -0
  239. {notebook-7.3.0a1.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(81417),n=s(50102),i=s(81997);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(20998),s=a(50102);!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(27961),s=n(15465),r=n(44548),l=n(2646),o=n(25291),i=n(12668),c=n(78156),d=n(60211),u=n(20998),m=n(81997),h=n(24475),p=n(63485);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:"csv",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.__("© 2015-2023 Project Jupyter Contributors")),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([[1584,4434],{31584:(t,e,n)=>{n.r(e),n.d(e,{DocInput:()=>b,HighlightStyle:()=>Dt,IndentContext:()=>F,LRLanguage:()=>p,Language:()=>f,LanguageDescription:()=>N,LanguageSupport:()=>I,ParseContext:()=>x,StreamLanguage:()=>ee,StringStream:()=>Qt,TreeIndentContext:()=>_,bidiIsolates:()=>ve,bracketMatching:()=>Ht,bracketMatchingHandle:()=>Gt,codeFolding:()=>bt,continuedIndent:()=>J,defaultHighlightStyle:()=>Mt,defineLanguageFacet:()=>u,delimitedIndent:()=>z,ensureSyntaxTree:()=>m,flatIndent:()=>G,foldAll:()=>dt,foldCode:()=>ut,foldEffect:()=>nt,foldGutter:()=>At,foldInside:()=>Q,foldKeymap:()=>kt,foldNodeProp:()=>Z,foldService:()=>K,foldState:()=>it,foldable:()=>tt,foldedRanges:()=>ot,forceParsing:()=>w,getIndentUnit:()=>L,getIndentation:()=>R,highlightingFor:()=>Lt,indentNodeProp:()=>V,indentOnInput:()=>Y,indentRange:()=>M,indentService:()=>O,indentString:()=>B,indentUnit:()=>E,language:()=>D,languageDataProp:()=>h,matchBrackets:()=>Yt,sublanguageProp:()=>c,syntaxHighlighting:()=>Et,syntaxParserRunning:()=>v,syntaxTree:()=>g,syntaxTreeAvailable:()=>k,toggleFold:()=>mt,unfoldAll:()=>pt,unfoldCode:()=>ct,unfoldEffect:()=>rt});var r,s=n(79352),i=n(89843),o=n(37960),a=n(92209),l=n(4434);const h=new s.NodeProp;function u(t){return i.Facet.define({combine:t?e=>e.concat(t):void 0})}const c=new s.NodeProp;class f{constructor(t,e,n=[],r=""){this.data=t,this.name=r,i.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(i.EditorState.prototype,"tree",{get(){return g(this)}}),this.parser=e,this.extension=[D.of(this),i.EditorState.languageData.of(((t,e,n)=>{let r=d(t,e,n),s=r.type.prop(h);if(!s)return[];let i=t.facet(s),o=r.type.prop(c);if(o){let s=r.resolve(e-r.from,n);for(let e of o)if(e.test(s,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(t,e,n=-1){return d(t,e,n).type.prop(h)==this.data}findRegions(t){let e=t.facet(D);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],r=(t,e)=>{if(t.prop(h)==this.data)return void n.push({from:e,to:e+t.length});let i=t.prop(s.NodeProp.mounted);if(i){if(i.tree.prop(h)==this.data){if(i.overlay)for(let t of i.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(i.overlay){let t=n.length;if(r(i.tree,i.overlay[0].from+e),n.length>t)return}}for(let n=0;n<t.children.length;n++){let i=t.children[n];i instanceof s.Tree&&r(i,t.positions[n]+e)}};return r(g(t),0),n}get allowsNesting(){return!0}}function d(t,e,n){let r=t.facet(D),i=g(t).topNode;if(!r||r.allowsNesting)for(let t=i;t;t=t.enter(e,n,s.IterMode.ExcludeBuffers))t.type.isTop&&(i=t);return i}f.setState=i.StateEffect.define();class p extends f{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=u(t.languageData);return new p(e,t.parser.configure({props:[h.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function g(t){let e=t.field(f.state,!1);return e?e.tree:s.Tree.empty}function m(t,e,n=50){var r;let s=null===(r=t.field(f.state,!1))||void 0===r?void 0:r.context;if(!s)return null;let i=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(i),o}function k(t,e=t.doc.length){var n;return(null===(n=t.field(f.state,!1))||void 0===n?void 0:n.context.isDone(e))||!1}function w(t,e=t.viewport.to,n=100){let r=m(t.state,e,n);return r!=g(t.state)&&t.dispatch({}),!!r}function v(t){var e;return(null===(e=t.plugin(C))||void 0===e?void 0:e.isWorking())||!1}class b{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let y=null;class x{constructor(t,e,n=[],r,s,i,o,a){this.parser=t,this.state=e,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=i,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new x(t,e,[],s.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new b(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=s.Tree.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=y;y=this;try{return t()}finally{y=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=S(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,n,r,s)=>e.push({fromA:t,toA:n,fromB:r,toB:s}))),n=s.TreeFragment.applyChanges(n,e),r=s.Tree.empty,i=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){a=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&a.push({from:n,to:r})}}}return new x(this.parser,e,n,r,i,o,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:n,to:r}=this.skipped[e];n<t.to&&r>t.from&&(this.fragments=S(this.fragments,n,r),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends s.Parser{createParse(e,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let e=y;if(e){for(let t of r)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new s.Tree(s.NodeType.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return y}}function S(t,e,n){return s.TreeFragment.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class T{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new T(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=x.create(t.facet(D).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new T(n)}}f.state=i.StateField.define({create:T.init,update(t,e){for(let t of e.effects)if(t.is(f.setState))return t.value;return e.startState.facet(D)!=e.state.facet(D)?T.init(e.state):t.apply(e)}});let P=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(P=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const A="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,C=o.ViewPlugin.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(f.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(f.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=P(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(f.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,t&&!A?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<r&&n.doc.length>r+1e3,a=s.context.work((()=>A&&A()||Date.now()>i),r+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:f.setState.of(new T(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,o.logException)(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),D=i.Facet.define({combine:t=>t.length?t[0]:null,enables:t=>[f.state,C,o.EditorView.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class I{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class N{constructor(t,e,n,r,s,i=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=i,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new N(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n)for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e;return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some((t=>t==e)))return n;if(n)for(let n of t)for(let t of n.alias){let r=e.indexOf(t);if(r>-1&&(t.length>2||!/\w/.test(e[r-1])&&!/\w/.test(e[r+t.length])))return n}return null}}const O=i.Facet.define(),E=i.Facet.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function L(t){let e=t.facet(E);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){let n="",r=t.tabSize,s=t.facet(E)[0];if("\t"==s){for(;e>=r;)n+="\t",e-=r;s=" "}for(let t=0;t<e;t++)n+=s;return n}function R(t,e){t instanceof i.EditorState&&(t=new F(t));for(let n of t.state.facet(O)){let r=n(t,e);if(void 0!==r)return r}let n=g(t.state);return n.length>=e?function(t,e,n){let r=e.resolveStack(n),s=r.node.enterUnfinishedNodesBefore(n);if(s!=r.node){let t=[];for(let e=s;e!=r.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return U(r,t,n)}(t,n,e):null}function M(t,e,n){let r=Object.create(null),s=new F(t,{overrideIndentation:t=>{var e;return null!==(e=r[t])&&void 0!==e?e:-1}}),i=[];for(let o=e;o<=n;){let e=t.doc.lineAt(o);o=e.to+1;let n=R(s,e.from);if(null==n)continue;/\S/.test(e.text)||(n=0);let a=/^\s*/.exec(e.text)[0],l=B(t,n);a!=l&&(r[e.from]=n,i.push({from:e.from,to:e.from+a.length,insert:l}))}return t.changes(i)}class F{constructor(t,e={}){this.state=t,this.options=e,this.unit=L(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return null!=r&&r>=n.from&&r<=n.to?s&&r==t?{text:"",from:t}:(e<0?r<t:r<=t)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(t,e);return n.slice(t-r,Math.min(n.length,t+100-r))}column(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.countColumn(n,t-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(s+=i-this.countColumn(n,n.search(/\S|$/))),s}countColumn(t,e=t.length){return(0,i.countColumn)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(r);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const V=new s.NodeProp;function U(t,e,n){for(let r=t;r;r=r.next){let t=j(r.node);if(t)return t(_.create(e,n,r))}return 0}function j(t){let e=t.type.prop(V);if(e)return e;let n,r=t.firstChild;if(r&&(n=r.type.prop(s.NodeProp.closedBy))){let e=t.lastChild,r=e&&n.indexOf(e.name)>-1;return t=>H(t,!0,1,void 0,r&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?W:null}function W(){return 0}class _ extends F{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new _(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return U(this.context.next,this.base,this.pos)}}function $(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function z({closing:t,align:e=!0,units:n=1}){return r=>H(r,e,n,t)}function H(t,e,n,r,s){let i=t.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==t.pos+o,l=e?function(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),o=null==s||s<=i.from?i.to:Math.min(i.to,s);for(let t=n.to;;){let s=e.childAfter(t);if(!s||s==r)return null;if(!s.type.isSkipped)return s.from<o?n:null;t=s.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const G=t=>t.baseIndent;function J({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const q=200;function Y(){return i.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+q)return t;let i=n.sliceString(s.from,r);if(!e.some((t=>t.test(i))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let n=R(o,e.from);if(null==n)continue;let r=/^\s*/.exec(e.text)[0],s=B(o,n);r!=s&&l.push({from:e.from,to:e.from+r.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const K=i.Facet.define(),Z=new s.NodeProp;function Q(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function X(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function tt(t,e,n){for(let r of t.facet(K)){let s=r(t,e,n);if(s)return s}return function(t,e,n){let r=g(t);if(r.length<n)return null;let s=null;for(let i=r.resolveStack(n,1);i;i=i.next){let o=i.node;if(o.to<=n||o.from>n)continue;if(s&&o.from<e)break;let a=o.type.prop(Z);if(a&&(o.to<r.length-50||r.length==t.doc.length||!X(o))){let r=a(o,t);r&&r.from<=n&&r.from>=e&&r.to>n&&(s=r)}}return s}(t,e,n)}function et(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const nt=i.StateEffect.define({map:et}),rt=i.StateEffect.define({map:et});function st(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some((t=>t.from<=n&&t.to>=n))||e.push(t.lineBlockAt(n));return e}const it=i.StateField.define({create:()=>o.Decoration.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(nt)&&!lt(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(vt),s=r?o.Decoration.replace({widget:new St(r(e.state,n.value))}):xt;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(rt)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,((t,e)=>{t<r&&e>r&&(n=!0)})),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r}))}return t},provide:t=>o.EditorView.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,((t,e)=>{n.push(t,e)})),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if("number"!=typeof r||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");e.push(xt.range(r,s))}return o.Decoration.set(e,!0)}});function ot(t){return t.field(it,!1)||i.RangeSet.empty}function at(t,e,n){var r;let s=null;return null===(r=t.field(it,!1))||void 0===r||r.between(e,n,((t,e)=>{(!s||s.from>t)&&(s={from:t,to:e})})),s}function lt(t,e,n){let r=!1;return t.between(e,e,((t,s)=>{t==e&&s==n&&(r=!0)})),r}function ht(t,e){return t.field(it,!1)?e:e.concat(i.StateEffect.appendConfig.of(bt()))}const ut=t=>{for(let e of st(t)){let n=tt(t.state,e.from,e.to);if(n)return t.dispatch({effects:ht(t.state,[nt.of(n),ft(t,n)])}),!0}return!1},ct=t=>{if(!t.state.field(it,!1))return!1;let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);r&&e.push(rt.of(r),ft(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function ft(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return o.EditorView.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const dt=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=tt(e,s.from,s.to);i&&n.push(nt.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:ht(t.state,n)}),!!n.length},pt=t=>{let e=t.state.field(it,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,((t,e)=>{n.push(rt.of({from:t,to:e}))})),t.dispatch({effects:n}),!0};function gt(t,e){for(let n=e;;){let r=tt(t.state,n.from,n.to);if(r&&r.to>e.from)return r;if(!n.from)return null;n=t.lineBlockAt(n.from-1)}}const mt=t=>{let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);if(r)e.push(rt.of(r),ft(t,r,!1));else{let r=gt(t,n);r&&e.push(nt.of(r),ft(t,r))}}return e.length>0&&t.dispatch({effects:ht(t.state,e)}),!!e.length},kt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ct},{key:"Ctrl-Alt-[",run:dt},{key:"Ctrl-Alt-]",run:pt}],wt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},vt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,wt)});function bt(t){let e=[it,Ct];return t&&e.push(vt.of(t)),e}function yt(t,e){let{state:n}=t,r=n.facet(vt),s=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),r=at(t.state,n.from,n.to);r&&t.dispatch({effects:rt.of(r)}),e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const xt=o.Decoration.replace({widget:new class extends o.WidgetType{toDOM(t){return yt(t,null)}}});class St extends o.WidgetType{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return yt(t,this.value)}}const Tt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Pt extends o.GutterMarker{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function At(t={}){let e=Object.assign(Object.assign({},Tt),t),n=new Pt(e,!0),r=new Pt(e,!1),s=o.ViewPlugin.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(D)!=t.state.facet(D)||t.startState.field(it,!1)!=t.state.field(it,!1)||g(t.startState)!=g(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new i.RangeSetBuilder;for(let s of t.viewportLineBlocks){let i=at(t.state,s.from,s.to)?r:tt(t.state,s.from,s.to)?n:null;i&&e.add(s.from,s.from,i)}return e.finish()}}),{domEventHandlers:a}=e;return[s,(0,o.gutter)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||i.RangeSet.empty},initialSpacer:()=>new Pt(e,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(t,e,n)=>{if(a.click&&a.click(t,e,n))return!0;let r=at(t.state,e.from,e.to);if(r)return t.dispatch({effects:rt.of(r)}),!0;let s=tt(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:nt.of(s)}),!0)}})}),bt()]}const Ct=o.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Dt{constructor(t,e){let n;function r(t){let e=l.V.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?r(e.all):void 0,i=e.scope;this.scope=i instanceof f?t=>t.prop(h)==i.data:i?t=>t==i:void 0,this.style=(0,a.tagHighlighter)(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=n?new l.V(n):null,this.themeType=e.themeType}static define(t,e){return new Dt(t,e||{})}}const It=i.Facet.define(),Nt=i.Facet.define({combine:t=>t.length?[t[0]]:null});function Ot(t){let e=t.facet(It);return e.length?e:t.facet(Nt)}function Et(t,e){let n,r=[Rt];return t instanceof Dt&&(t.module&&r.push(o.EditorView.styleModule.of(t.module)),n=t.themeType),(null==e?void 0:e.fallback)?r.push(Nt.of(t)):n?r.push(It.computeN([o.EditorView.darkTheme],(e=>e.facet(o.EditorView.darkTheme)==("dark"==n)?[t]:[]))):r.push(It.of(t)),r}function Lt(t,e,n){let r=Ot(t),s=null;if(r)for(let t of r)if(!t.scope||n&&t.scope(n)){let n=t.style(e);n&&(s=s?s+" "+n:n)}return s}class Bt{constructor(t){this.markCache=Object.create(null),this.tree=g(t.state),this.decorations=this.buildDeco(t,Ot(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=g(t.state),n=Ot(t.state),r=n!=Ot(t.startState),{viewport:s}=t.view,i=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!r&&e.type==this.tree.type&&i>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=i):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.Decoration.none;let n=new i.RangeSetBuilder;for(let{from:r,to:s}of t.visibleRanges)(0,a.highlightTree)(this.tree,e,((t,e,r)=>{n.add(t,e,this.markCache[r]||(this.markCache[r]=o.Decoration.mark({class:r})))}),r,s);return n.finish()}}const Rt=i.Prec.high(o.ViewPlugin.fromClass(Bt,{decorations:t=>t.decorations})),Mt=Dt.define([{tag:a.tags.meta,color:"#404740"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),Ft=o.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vt=1e4,Ut="()[]{}",jt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,{afterCursor:!0,brackets:Ut,maxScanDistance:Vt,renderMatch:$t})}),Wt=o.Decoration.mark({class:"cm-matchingBracket"}),_t=o.Decoration.mark({class:"cm-nonmatchingBracket"});function $t(t){let e=[],n=t.matched?Wt:_t;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const zt=[i.StateField.define({create:()=>o.Decoration.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(jt);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=Yt(e.state,t.head,-1,r)||t.head>0&&Yt(e.state,t.head-1,1,r)||r.afterCursor&&(Yt(e.state,t.head,1,r)||t.head<e.state.doc.length&&Yt(e.state,t.head+1,-1,r));s&&(n=n.concat(r.renderMatch(s,e.state)))}return o.Decoration.set(n,!0)},provide:t=>o.EditorView.decorations.from(t)}),Ft];function Ht(t={}){return[jt.of(t),zt]}const Gt=new s.NodeProp;function Jt(t,e,n){let r=t.prop(e<0?s.NodeProp.openedBy:s.NodeProp.closedBy);if(r)return r;if(1==t.name.length){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function qt(t){let e=t.type.prop(Gt);return e?e(t.node):t}function Yt(t,e,n,r={}){let s=r.maxScanDistance||Vt,i=r.brackets||Ut,o=g(t),a=o.resolveInner(e,n);for(let t=a;t;t=t.parent){let r=Jt(t.type,n,i);if(r&&t.from<t.to){let s=qt(t);if(s&&(n>0?e>=s.from&&e<s.to:e>s.from&&e<=s.to))return Kt(0,0,n,t,s,r,i)}}return function(t,e,n,r,s,i,o){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),c=0;for(let t=0;!u.next().done&&t<=i;){let i=u.value;n<0&&(t+=i.length);let a=e+t*n;for(let t=n>0?0:i.length-1,e=n>0?i.length:-1;t!=e;t+=n){let e=o.indexOf(i[t]);if(!(e<0||r.resolveInner(a+t,1).type!=s))if(e%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};c--}}n>0&&(t+=i.length)}return u.done?{start:h,matched:!1}:null}(t,e,n,o,a.type,s,i)}function Kt(t,e,n,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},h=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==h&&i.indexOf(u.type.name)>-1&&u.from<u.to){let t=qt(u);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Jt(u.type,n,o))h++;else if(Jt(u.type,-n,o)){if(0==h){let t=qt(u);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function Zt(t,e,n,r=0,s=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let i=s;for(let s=r;s<e;s++)9==t.charCodeAt(s)?i+=n-i%n:i++;return i}class Qt{constructor(t,e,n,r){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t instanceof RegExp?t.test(n):t(n)),e)return++this.pos,n}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Zt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:Zt(this.string,null,this.tabSize)}match(t,e,n){if("string"==typeof t){let r=t=>n?t.toLowerCase():t;return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Xt(t){if("object"!=typeof t)return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const te=new WeakMap;class ee extends f{constructor(t){let e,n=u(t.languageData),r={name:(i=t).name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Xt,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||oe};var i;super(n,new class extends s.Parser{createParse(t,n,r){return new se(e,t,n,r)}},[O.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=s.NodeType.define({id:ae.length,name:"Document",props:[h.add((()=>t))],top:!0});return ae.push(e),e}(n),e=this,this.streamParser=r,this.stateAfter=new s.NodeProp({perNode:!0}),this.tokenTable=t.tokenTable?new fe(r.tokenTable):de}static define(t){return new ee(t)}getIndent(t,e){let n,r=g(t.state),s=r.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:i}=t.options;i&&(n=te.get(t.state),null!=n&&n<e-1e4&&(n=void 0));let o,a,l=ne(this,r,0,s.from,null!=n?n:e);if(l?(a=l.state,o=l.pos+1):(a=this.streamParser.startState(t.unit),o=0),e-o>1e4)return null;for(;o<e;){let n=t.state.doc.lineAt(o),r=Math.min(e,n.to);if(n.length){let e=i?i(n.from):-1,s=new Qt(n.text,t.state.tabSize,t.unit,e<0?void 0:e);for(;s.pos<r-n.from;)ie(this.streamParser.token,s,a)}else this.streamParser.blankLine(a,t.unit);if(r==e)break;o=n.to+1}let h=t.lineAt(e);return i&&null==n&&te.set(t.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],t)}get allowsNesting(){return!1}}function ne(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=n+e.positions[o],h=a instanceof s.Tree&&l<i&&ne(t,a,l,r,i);if(h)return h}return null}function re(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;i||e.type!=t.topNode||(i=!0);for(let o=e.children.length-1;o>=0;o--){let a,l=e.positions[o],h=e.children[o];if(l<r&&h instanceof s.Tree){if(!(a=re(t,h,n-l,r-l,i)))break;return i?new s.Tree(e.type,e.children.slice(0,o).concat(a),e.positions.slice(0,o+1),l+a.length):a}}return null}class se{constructor(t,e,n,r){this.lang=t,this.input=e,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=x.get(),o=r[0].from,{state:a,tree:l}=function(t,e,n,r){for(let r of e){let e,s=r.from+(r.openStart?25:0),i=r.to-(r.openEnd?25:0),o=s<=n&&i>n&&ne(t,r.tree,0-r.offset,n,i);if(o&&(e=re(t,r.tree,n+r.offset,o.pos+r.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(r?L(r):4),tree:s.Tree.empty}}(t,n,o,null==i?void 0:i.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let t=0;t<l.children.length;t++)this.chunks.push(l.children[t]),this.chunkPos.push(l.positions[t]);i&&this.parsedPos<i.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(L(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let t=x.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+2048);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let t=this.rangeIndex;;){let r=this.ranges[t].to;if(r>=n)break;if(e=e.slice(0,r-(n-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,i=this.lineAfter(s);e+=i,n=s+i.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+e;if(n>0?r>s:r>=s)break;e+=this.ranges[++this.rangeIndex].from-r}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,r,s){if(this.ranges.length>1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;n+=s=this.skipGapsTo(n,s,-1),r+=this.chunk.length-t}return this.chunk.push(t,e,n,r),s}parseLine(t){let{line:e,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,i=new Qt(e,t?t.state.tabSize:4,t?L(t.state):2);if(i.eol())s.blankLine(this.state,i.indentUnit);else for(;!i.eol();){let t=ie(s.token,i,this.state);if(t&&(r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+i.start,this.parsedPos+i.pos,4,r)),i.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=s.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:le,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new s.Tree(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new s.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ie(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const oe=Object.create(null),ae=[s.NodeType.none],le=new s.NodeSet(ae),he=[],ue=Object.create(null),ce=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ce[t]=ge(oe,e);class fe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ce)}resolve(t){return t?this.table[t]||(this.table[t]=ge(this.extra,t)):0}}const de=new fe(oe);function pe(t,e){he.indexOf(t)>-1||(he.push(t),console.warn(e))}function ge(t,e){let n=[];for(let r of e.split(" ")){let e=[];for(let n of r.split(".")){let r=t[n]||a.tags[n];r?"function"==typeof r?e.length?e=e.map(r):pe(n,`Modifier ${n} used at start of tag`):e.length?pe(n,`Tag ${n} used as modifier`):e=Array.isArray(r)?r:[r]:pe(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map((t=>t.id)),o=ue[i];if(o)return o.id;let l=ue[i]=s.NodeType.define({id:ae.length,name:r,props:[(0,a.styleTags)({[r]:n})]});return ae.push(l),l.id}function me(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function ke(t){for(let e=t.iter();!e.next().done;)if(me(e.value))return!0;return!1}const we=i.Facet.define({combine:t=>t.some((t=>t))});function ve(t={}){let e=[be];return t.alwaysIsolate&&e.push(we.of(!0)),e}const be=o.ViewPlugin.fromClass(class{constructor(t){this.always=t.state.facet(we)||t.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection),this.hasRTL=!this.always&&ke(t.state.doc),this.tree=g(t.state),this.decorations=this.always||this.hasRTL?ye(t,this.tree,this.always):o.Decoration.none}update(t){let e=t.state.facet(we)||t.view.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,n,r,s,i)=>{!e&&ke(i)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let n=g(t.state);(e!=this.always||n!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=n,this.always=e,this.decorations=ye(t.view,n,e))}},{provide:t=>{function e(e){var n,r;return null!==(r=null===(n=e.plugin(t))||void 0===n?void 0:n.decorations)&&void 0!==r?r:o.Decoration.none}return[o.EditorView.outerDecorations.of(e),i.Prec.lowest(o.EditorView.bidiIsolatedRanges.of(e))]}});function ye(t,e,n){let r=new i.RangeSetBuilder,o=t.visibleRanges;n||(o=function(t,e){let n=e.iter(),r=0,s=[],i=null;for(let{from:e,to:o}of t)for(e!=r&&(r<e&&n.next(e-r),r=e);;){let t=r,e=r+n.value.length;if(!n.lineBreak&&me(n.value)&&(i&&i.to>t-10?i.to=Math.min(o,e):s.push(i={from:t,to:Math.min(o,e)})),r>=o)break;r=e,n.next()}return s}(o,t.state.doc));for(let{from:t,to:n}of o)e.iterate({enter:t=>{let e=t.type.prop(s.NodeProp.isolate);e&&r.add(t.from,t.to,xe[e])},from:t,to:n});return r.finish()}const xe={rtl:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:o.Direction.RTL}),ltr:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:o.Direction.LTR}),auto:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},4434:(t,e,n)=>{n.d(e,{V:()=>o});const r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),s="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(t,e){this.rules=[];let{finish:n}=e||{};function r(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,i,o){let a=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return i.push(t[0]+";");for(let n in e){let o=e[n];if(/&/.test(n))s(n.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,i);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");s(r(n),o,a,h)}else null!=o&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&i.push((!n||l||o?t:t.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(r(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=i[r]||1;return i[r]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let r=t[s],i=n&&n.nonce;r?i&&r.setNonce(i):r=new l(t,i),r.mount(Array.isArray(e)?e:[e])}}let a=new Map;class l{constructor(t,e){let n=t.ownerDocument||t,r=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let e=a.get(n);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[s]=e;this.sheet=new r.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],a.set(n,this)}else{this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let r=t.head||t;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],t[s]=this}mount(t){let e=this.sheet,n=0,r=0;for(let s=0;s<t.length;s++){let i=t[s],o=this.modules.indexOf(i);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,i),e)for(let t=0;t<i.rules.length;t++)e.insertRule(i.rules[t],n++)}else{for(;r<o;)n+=this.modules[r++].rules.length;n+=i.rules.length,r++}}if(!e){let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1584],{31584:(t,e,n)=>{n.r(e),n.d(e,{DocInput:()=>b,HighlightStyle:()=>Dt,IndentContext:()=>F,LRLanguage:()=>p,Language:()=>f,LanguageDescription:()=>N,LanguageSupport:()=>I,ParseContext:()=>x,StreamLanguage:()=>ee,StringStream:()=>Qt,TreeIndentContext:()=>_,bidiIsolates:()=>ve,bracketMatching:()=>Ht,bracketMatchingHandle:()=>Gt,codeFolding:()=>bt,continuedIndent:()=>J,defaultHighlightStyle:()=>Mt,defineLanguageFacet:()=>u,delimitedIndent:()=>z,ensureSyntaxTree:()=>m,flatIndent:()=>G,foldAll:()=>dt,foldCode:()=>ut,foldEffect:()=>nt,foldGutter:()=>At,foldInside:()=>Q,foldKeymap:()=>kt,foldNodeProp:()=>Z,foldService:()=>K,foldState:()=>it,foldable:()=>tt,foldedRanges:()=>ot,forceParsing:()=>w,getIndentUnit:()=>L,getIndentation:()=>R,highlightingFor:()=>Lt,indentNodeProp:()=>V,indentOnInput:()=>Y,indentRange:()=>M,indentService:()=>O,indentString:()=>B,indentUnit:()=>E,language:()=>D,languageDataProp:()=>h,matchBrackets:()=>Yt,sublanguageProp:()=>c,syntaxHighlighting:()=>Et,syntaxParserRunning:()=>v,syntaxTree:()=>g,syntaxTreeAvailable:()=>k,toggleFold:()=>mt,unfoldAll:()=>pt,unfoldCode:()=>ct,unfoldEffect:()=>rt});var r,s=n(79352),i=n(89843),o=n(63720),a=n(92209),l=n(4434);const h=new s.NodeProp;function u(t){return i.Facet.define({combine:t?e=>e.concat(t):void 0})}const c=new s.NodeProp;class f{constructor(t,e,n=[],r=""){this.data=t,this.name=r,i.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(i.EditorState.prototype,"tree",{get(){return g(this)}}),this.parser=e,this.extension=[D.of(this),i.EditorState.languageData.of(((t,e,n)=>{let r=d(t,e,n),s=r.type.prop(h);if(!s)return[];let i=t.facet(s),o=r.type.prop(c);if(o){let s=r.resolve(e-r.from,n);for(let e of o)if(e.test(s,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(t,e,n=-1){return d(t,e,n).type.prop(h)==this.data}findRegions(t){let e=t.facet(D);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],r=(t,e)=>{if(t.prop(h)==this.data)return void n.push({from:e,to:e+t.length});let i=t.prop(s.NodeProp.mounted);if(i){if(i.tree.prop(h)==this.data){if(i.overlay)for(let t of i.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(i.overlay){let t=n.length;if(r(i.tree,i.overlay[0].from+e),n.length>t)return}}for(let n=0;n<t.children.length;n++){let i=t.children[n];i instanceof s.Tree&&r(i,t.positions[n]+e)}};return r(g(t),0),n}get allowsNesting(){return!0}}function d(t,e,n){let r=t.facet(D),i=g(t).topNode;if(!r||r.allowsNesting)for(let t=i;t;t=t.enter(e,n,s.IterMode.ExcludeBuffers))t.type.isTop&&(i=t);return i}f.setState=i.StateEffect.define();class p extends f{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=u(t.languageData);return new p(e,t.parser.configure({props:[h.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function g(t){let e=t.field(f.state,!1);return e?e.tree:s.Tree.empty}function m(t,e,n=50){var r;let s=null===(r=t.field(f.state,!1))||void 0===r?void 0:r.context;if(!s)return null;let i=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(i),o}function k(t,e=t.doc.length){var n;return(null===(n=t.field(f.state,!1))||void 0===n?void 0:n.context.isDone(e))||!1}function w(t,e=t.viewport.to,n=100){let r=m(t.state,e,n);return r!=g(t.state)&&t.dispatch({}),!!r}function v(t){var e;return(null===(e=t.plugin(C))||void 0===e?void 0:e.isWorking())||!1}class b{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let y=null;class x{constructor(t,e,n=[],r,s,i,o,a){this.parser=t,this.state=e,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=i,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new x(t,e,[],s.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new b(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=s.Tree.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=y;y=this;try{return t()}finally{y=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=S(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,n,r,s)=>e.push({fromA:t,toA:n,fromB:r,toB:s}))),n=s.TreeFragment.applyChanges(n,e),r=s.Tree.empty,i=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){a=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&a.push({from:n,to:r})}}}return new x(this.parser,e,n,r,i,o,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:n,to:r}=this.skipped[e];n<t.to&&r>t.from&&(this.fragments=S(this.fragments,n,r),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends s.Parser{createParse(e,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let e=y;if(e){for(let t of r)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new s.Tree(s.NodeType.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return y}}function S(t,e,n){return s.TreeFragment.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class T{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new T(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=x.create(t.facet(D).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new T(n)}}f.state=i.StateField.define({create:T.init,update(t,e){for(let t of e.effects)if(t.is(f.setState))return t.value;return e.startState.facet(D)!=e.state.facet(D)?T.init(e.state):t.apply(e)}});let P=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(P=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const A="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,C=o.ViewPlugin.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(f.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(f.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=P(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(f.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,t&&!A?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<r&&n.doc.length>r+1e3,a=s.context.work((()=>A&&A()||Date.now()>i),r+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:f.setState.of(new T(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,o.logException)(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),D=i.Facet.define({combine:t=>t.length?t[0]:null,enables:t=>[f.state,C,o.EditorView.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class I{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class N{constructor(t,e,n,r,s,i=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=i,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new N(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n)for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e;return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some((t=>t==e)))return n;if(n)for(let n of t)for(let t of n.alias){let r=e.indexOf(t);if(r>-1&&(t.length>2||!/\w/.test(e[r-1])&&!/\w/.test(e[r+t.length])))return n}return null}}const O=i.Facet.define(),E=i.Facet.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function L(t){let e=t.facet(E);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){let n="",r=t.tabSize,s=t.facet(E)[0];if("\t"==s){for(;e>=r;)n+="\t",e-=r;s=" "}for(let t=0;t<e;t++)n+=s;return n}function R(t,e){t instanceof i.EditorState&&(t=new F(t));for(let n of t.state.facet(O)){let r=n(t,e);if(void 0!==r)return r}let n=g(t.state);return n.length>=e?function(t,e,n){let r=e.resolveStack(n),s=r.node.enterUnfinishedNodesBefore(n);if(s!=r.node){let t=[];for(let e=s;e!=r.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return U(r,t,n)}(t,n,e):null}function M(t,e,n){let r=Object.create(null),s=new F(t,{overrideIndentation:t=>{var e;return null!==(e=r[t])&&void 0!==e?e:-1}}),i=[];for(let o=e;o<=n;){let e=t.doc.lineAt(o);o=e.to+1;let n=R(s,e.from);if(null==n)continue;/\S/.test(e.text)||(n=0);let a=/^\s*/.exec(e.text)[0],l=B(t,n);a!=l&&(r[e.from]=n,i.push({from:e.from,to:e.from+a.length,insert:l}))}return t.changes(i)}class F{constructor(t,e={}){this.state=t,this.options=e,this.unit=L(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return null!=r&&r>=n.from&&r<=n.to?s&&r==t?{text:"",from:t}:(e<0?r<t:r<=t)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(t,e);return n.slice(t-r,Math.min(n.length,t+100-r))}column(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.countColumn(n,t-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(s+=i-this.countColumn(n,n.search(/\S|$/))),s}countColumn(t,e=t.length){return(0,i.countColumn)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(r);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const V=new s.NodeProp;function U(t,e,n){for(let r=t;r;r=r.next){let t=j(r.node);if(t)return t(_.create(e,n,r))}return 0}function j(t){let e=t.type.prop(V);if(e)return e;let n,r=t.firstChild;if(r&&(n=r.type.prop(s.NodeProp.closedBy))){let e=t.lastChild,r=e&&n.indexOf(e.name)>-1;return t=>H(t,!0,1,void 0,r&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?W:null}function W(){return 0}class _ extends F{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new _(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return U(this.context.next,this.base,this.pos)}}function $(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function z({closing:t,align:e=!0,units:n=1}){return r=>H(r,e,n,t)}function H(t,e,n,r,s){let i=t.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==t.pos+o,l=e?function(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),o=null==s||s<=i.from?i.to:Math.min(i.to,s);for(let t=n.to;;){let s=e.childAfter(t);if(!s||s==r)return null;if(!s.type.isSkipped)return s.from<o?n:null;t=s.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const G=t=>t.baseIndent;function J({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const q=200;function Y(){return i.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+q)return t;let i=n.sliceString(s.from,r);if(!e.some((t=>t.test(i))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let n=R(o,e.from);if(null==n)continue;let r=/^\s*/.exec(e.text)[0],s=B(o,n);r!=s&&l.push({from:e.from,to:e.from+r.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const K=i.Facet.define(),Z=new s.NodeProp;function Q(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function X(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function tt(t,e,n){for(let r of t.facet(K)){let s=r(t,e,n);if(s)return s}return function(t,e,n){let r=g(t);if(r.length<n)return null;let s=null;for(let i=r.resolveStack(n,1);i;i=i.next){let o=i.node;if(o.to<=n||o.from>n)continue;if(s&&o.from<e)break;let a=o.type.prop(Z);if(a&&(o.to<r.length-50||r.length==t.doc.length||!X(o))){let r=a(o,t);r&&r.from<=n&&r.from>=e&&r.to>n&&(s=r)}}return s}(t,e,n)}function et(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const nt=i.StateEffect.define({map:et}),rt=i.StateEffect.define({map:et});function st(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some((t=>t.from<=n&&t.to>=n))||e.push(t.lineBlockAt(n));return e}const it=i.StateField.define({create:()=>o.Decoration.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(nt)&&!lt(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(vt),s=r?o.Decoration.replace({widget:new St(r(e.state,n.value))}):xt;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(rt)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,((t,e)=>{t<r&&e>r&&(n=!0)})),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r}))}return t},provide:t=>o.EditorView.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,((t,e)=>{n.push(t,e)})),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if("number"!=typeof r||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");e.push(xt.range(r,s))}return o.Decoration.set(e,!0)}});function ot(t){return t.field(it,!1)||i.RangeSet.empty}function at(t,e,n){var r;let s=null;return null===(r=t.field(it,!1))||void 0===r||r.between(e,n,((t,e)=>{(!s||s.from>t)&&(s={from:t,to:e})})),s}function lt(t,e,n){let r=!1;return t.between(e,e,((t,s)=>{t==e&&s==n&&(r=!0)})),r}function ht(t,e){return t.field(it,!1)?e:e.concat(i.StateEffect.appendConfig.of(bt()))}const ut=t=>{for(let e of st(t)){let n=tt(t.state,e.from,e.to);if(n)return t.dispatch({effects:ht(t.state,[nt.of(n),ft(t,n)])}),!0}return!1},ct=t=>{if(!t.state.field(it,!1))return!1;let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);r&&e.push(rt.of(r),ft(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function ft(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return o.EditorView.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const dt=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=tt(e,s.from,s.to);i&&n.push(nt.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:ht(t.state,n)}),!!n.length},pt=t=>{let e=t.state.field(it,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,((t,e)=>{n.push(rt.of({from:t,to:e}))})),t.dispatch({effects:n}),!0};function gt(t,e){for(let n=e;;){let r=tt(t.state,n.from,n.to);if(r&&r.to>e.from)return r;if(!n.from)return null;n=t.lineBlockAt(n.from-1)}}const mt=t=>{let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);if(r)e.push(rt.of(r),ft(t,r,!1));else{let r=gt(t,n);r&&e.push(nt.of(r),ft(t,r))}}return e.length>0&&t.dispatch({effects:ht(t.state,e)}),!!e.length},kt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ct},{key:"Ctrl-Alt-[",run:dt},{key:"Ctrl-Alt-]",run:pt}],wt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},vt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,wt)});function bt(t){let e=[it,Ct];return t&&e.push(vt.of(t)),e}function yt(t,e){let{state:n}=t,r=n.facet(vt),s=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),r=at(t.state,n.from,n.to);r&&t.dispatch({effects:rt.of(r)}),e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const xt=o.Decoration.replace({widget:new class extends o.WidgetType{toDOM(t){return yt(t,null)}}});class St extends o.WidgetType{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return yt(t,this.value)}}const Tt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Pt extends o.GutterMarker{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function At(t={}){let e=Object.assign(Object.assign({},Tt),t),n=new Pt(e,!0),r=new Pt(e,!1),s=o.ViewPlugin.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(D)!=t.state.facet(D)||t.startState.field(it,!1)!=t.state.field(it,!1)||g(t.startState)!=g(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new i.RangeSetBuilder;for(let s of t.viewportLineBlocks){let i=at(t.state,s.from,s.to)?r:tt(t.state,s.from,s.to)?n:null;i&&e.add(s.from,s.from,i)}return e.finish()}}),{domEventHandlers:a}=e;return[s,(0,o.gutter)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||i.RangeSet.empty},initialSpacer:()=>new Pt(e,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(t,e,n)=>{if(a.click&&a.click(t,e,n))return!0;let r=at(t.state,e.from,e.to);if(r)return t.dispatch({effects:rt.of(r)}),!0;let s=tt(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:nt.of(s)}),!0)}})}),bt()]}const Ct=o.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Dt{constructor(t,e){let n;function r(t){let e=l.V.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?r(e.all):void 0,i=e.scope;this.scope=i instanceof f?t=>t.prop(h)==i.data:i?t=>t==i:void 0,this.style=(0,a.tagHighlighter)(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=n?new l.V(n):null,this.themeType=e.themeType}static define(t,e){return new Dt(t,e||{})}}const It=i.Facet.define(),Nt=i.Facet.define({combine:t=>t.length?[t[0]]:null});function Ot(t){let e=t.facet(It);return e.length?e:t.facet(Nt)}function Et(t,e){let n,r=[Rt];return t instanceof Dt&&(t.module&&r.push(o.EditorView.styleModule.of(t.module)),n=t.themeType),(null==e?void 0:e.fallback)?r.push(Nt.of(t)):n?r.push(It.computeN([o.EditorView.darkTheme],(e=>e.facet(o.EditorView.darkTheme)==("dark"==n)?[t]:[]))):r.push(It.of(t)),r}function Lt(t,e,n){let r=Ot(t),s=null;if(r)for(let t of r)if(!t.scope||n&&t.scope(n)){let n=t.style(e);n&&(s=s?s+" "+n:n)}return s}class Bt{constructor(t){this.markCache=Object.create(null),this.tree=g(t.state),this.decorations=this.buildDeco(t,Ot(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=g(t.state),n=Ot(t.state),r=n!=Ot(t.startState),{viewport:s}=t.view,i=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!r&&e.type==this.tree.type&&i>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=i):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.Decoration.none;let n=new i.RangeSetBuilder;for(let{from:r,to:s}of t.visibleRanges)(0,a.highlightTree)(this.tree,e,((t,e,r)=>{n.add(t,e,this.markCache[r]||(this.markCache[r]=o.Decoration.mark({class:r})))}),r,s);return n.finish()}}const Rt=i.Prec.high(o.ViewPlugin.fromClass(Bt,{decorations:t=>t.decorations})),Mt=Dt.define([{tag:a.tags.meta,color:"#404740"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),Ft=o.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vt=1e4,Ut="()[]{}",jt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,{afterCursor:!0,brackets:Ut,maxScanDistance:Vt,renderMatch:$t})}),Wt=o.Decoration.mark({class:"cm-matchingBracket"}),_t=o.Decoration.mark({class:"cm-nonmatchingBracket"});function $t(t){let e=[],n=t.matched?Wt:_t;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const zt=[i.StateField.define({create:()=>o.Decoration.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(jt);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=Yt(e.state,t.head,-1,r)||t.head>0&&Yt(e.state,t.head-1,1,r)||r.afterCursor&&(Yt(e.state,t.head,1,r)||t.head<e.state.doc.length&&Yt(e.state,t.head+1,-1,r));s&&(n=n.concat(r.renderMatch(s,e.state)))}return o.Decoration.set(n,!0)},provide:t=>o.EditorView.decorations.from(t)}),Ft];function Ht(t={}){return[jt.of(t),zt]}const Gt=new s.NodeProp;function Jt(t,e,n){let r=t.prop(e<0?s.NodeProp.openedBy:s.NodeProp.closedBy);if(r)return r;if(1==t.name.length){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function qt(t){let e=t.type.prop(Gt);return e?e(t.node):t}function Yt(t,e,n,r={}){let s=r.maxScanDistance||Vt,i=r.brackets||Ut,o=g(t),a=o.resolveInner(e,n);for(let t=a;t;t=t.parent){let r=Jt(t.type,n,i);if(r&&t.from<t.to){let s=qt(t);if(s&&(n>0?e>=s.from&&e<s.to:e>s.from&&e<=s.to))return Kt(0,0,n,t,s,r,i)}}return function(t,e,n,r,s,i,o){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),c=0;for(let t=0;!u.next().done&&t<=i;){let i=u.value;n<0&&(t+=i.length);let a=e+t*n;for(let t=n>0?0:i.length-1,e=n>0?i.length:-1;t!=e;t+=n){let e=o.indexOf(i[t]);if(!(e<0||r.resolveInner(a+t,1).type!=s))if(e%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};c--}}n>0&&(t+=i.length)}return u.done?{start:h,matched:!1}:null}(t,e,n,o,a.type,s,i)}function Kt(t,e,n,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},h=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==h&&i.indexOf(u.type.name)>-1&&u.from<u.to){let t=qt(u);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Jt(u.type,n,o))h++;else if(Jt(u.type,-n,o)){if(0==h){let t=qt(u);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function Zt(t,e,n,r=0,s=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let i=s;for(let s=r;s<e;s++)9==t.charCodeAt(s)?i+=n-i%n:i++;return i}class Qt{constructor(t,e,n,r){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t instanceof RegExp?t.test(n):t(n)),e)return++this.pos,n}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Zt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:Zt(this.string,null,this.tabSize)}match(t,e,n){if("string"==typeof t){let r=t=>n?t.toLowerCase():t;return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Xt(t){if("object"!=typeof t)return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const te=new WeakMap;class ee extends f{constructor(t){let e,n=u(t.languageData),r={name:(i=t).name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Xt,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||oe};var i;super(n,new class extends s.Parser{createParse(t,n,r){return new se(e,t,n,r)}},[O.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=s.NodeType.define({id:ae.length,name:"Document",props:[h.add((()=>t))],top:!0});return ae.push(e),e}(n),e=this,this.streamParser=r,this.stateAfter=new s.NodeProp({perNode:!0}),this.tokenTable=t.tokenTable?new fe(r.tokenTable):de}static define(t){return new ee(t)}getIndent(t,e){let n,r=g(t.state),s=r.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:i}=t.options;i&&(n=te.get(t.state),null!=n&&n<e-1e4&&(n=void 0));let o,a,l=ne(this,r,0,s.from,null!=n?n:e);if(l?(a=l.state,o=l.pos+1):(a=this.streamParser.startState(t.unit),o=0),e-o>1e4)return null;for(;o<e;){let n=t.state.doc.lineAt(o),r=Math.min(e,n.to);if(n.length){let e=i?i(n.from):-1,s=new Qt(n.text,t.state.tabSize,t.unit,e<0?void 0:e);for(;s.pos<r-n.from;)ie(this.streamParser.token,s,a)}else this.streamParser.blankLine(a,t.unit);if(r==e)break;o=n.to+1}let h=t.lineAt(e);return i&&null==n&&te.set(t.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],t)}get allowsNesting(){return!1}}function ne(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=n+e.positions[o],h=a instanceof s.Tree&&l<i&&ne(t,a,l,r,i);if(h)return h}return null}function re(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;i||e.type!=t.topNode||(i=!0);for(let o=e.children.length-1;o>=0;o--){let a,l=e.positions[o],h=e.children[o];if(l<r&&h instanceof s.Tree){if(!(a=re(t,h,n-l,r-l,i)))break;return i?new s.Tree(e.type,e.children.slice(0,o).concat(a),e.positions.slice(0,o+1),l+a.length):a}}return null}class se{constructor(t,e,n,r){this.lang=t,this.input=e,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=x.get(),o=r[0].from,{state:a,tree:l}=function(t,e,n,r){for(let r of e){let e,s=r.from+(r.openStart?25:0),i=r.to-(r.openEnd?25:0),o=s<=n&&i>n&&ne(t,r.tree,0-r.offset,n,i);if(o&&(e=re(t,r.tree,n+r.offset,o.pos+r.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(r?L(r):4),tree:s.Tree.empty}}(t,n,o,null==i?void 0:i.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let t=0;t<l.children.length;t++)this.chunks.push(l.children[t]),this.chunkPos.push(l.positions[t]);i&&this.parsedPos<i.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(L(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let t=x.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+2048);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let t=this.rangeIndex;;){let r=this.ranges[t].to;if(r>=n)break;if(e=e.slice(0,r-(n-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,i=this.lineAfter(s);e+=i,n=s+i.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+e;if(n>0?r>s:r>=s)break;e+=this.ranges[++this.rangeIndex].from-r}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,r,s){if(this.ranges.length>1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;n+=s=this.skipGapsTo(n,s,-1),r+=this.chunk.length-t}return this.chunk.push(t,e,n,r),s}parseLine(t){let{line:e,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,i=new Qt(e,t?t.state.tabSize:4,t?L(t.state):2);if(i.eol())s.blankLine(this.state,i.indentUnit);else for(;!i.eol();){let t=ie(s.token,i,this.state);if(t&&(r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+i.start,this.parsedPos+i.pos,4,r)),i.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=s.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:le,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new s.Tree(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new s.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ie(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const oe=Object.create(null),ae=[s.NodeType.none],le=new s.NodeSet(ae),he=[],ue=Object.create(null),ce=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ce[t]=ge(oe,e);class fe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ce)}resolve(t){return t?this.table[t]||(this.table[t]=ge(this.extra,t)):0}}const de=new fe(oe);function pe(t,e){he.indexOf(t)>-1||(he.push(t),console.warn(e))}function ge(t,e){let n=[];for(let r of e.split(" ")){let e=[];for(let n of r.split(".")){let r=t[n]||a.tags[n];r?"function"==typeof r?e.length?e=e.map(r):pe(n,`Modifier ${n} used at start of tag`):e.length?pe(n,`Tag ${n} used as modifier`):e=Array.isArray(r)?r:[r]:pe(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map((t=>t.id)),o=ue[i];if(o)return o.id;let l=ue[i]=s.NodeType.define({id:ae.length,name:r,props:[(0,a.styleTags)({[r]:n})]});return ae.push(l),l.id}function me(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function ke(t){for(let e=t.iter();!e.next().done;)if(me(e.value))return!0;return!1}const we=i.Facet.define({combine:t=>t.some((t=>t))});function ve(t={}){let e=[be];return t.alwaysIsolate&&e.push(we.of(!0)),e}const be=o.ViewPlugin.fromClass(class{constructor(t){this.always=t.state.facet(we)||t.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection),this.hasRTL=!this.always&&ke(t.state.doc),this.tree=g(t.state),this.decorations=this.always||this.hasRTL?ye(t,this.tree,this.always):o.Decoration.none}update(t){let e=t.state.facet(we)||t.view.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,n,r,s,i)=>{!e&&ke(i)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let n=g(t.state);(e!=this.always||n!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=n,this.always=e,this.decorations=ye(t.view,n,e))}},{provide:t=>{function e(e){var n,r;return null!==(r=null===(n=e.plugin(t))||void 0===n?void 0:n.decorations)&&void 0!==r?r:o.Decoration.none}return[o.EditorView.outerDecorations.of(e),i.Prec.lowest(o.EditorView.bidiIsolatedRanges.of(e))]}});function ye(t,e,n){let r=new i.RangeSetBuilder,o=t.visibleRanges;n||(o=function(t,e){let n=e.iter(),r=0,s=[],i=null;for(let{from:e,to:o}of t)for(e!=r&&(r<e&&n.next(e-r),r=e);;){let t=r,e=r+n.value.length;if(!n.lineBreak&&me(n.value)&&(i&&i.to>t-10?i.to=Math.min(o,e):s.push(i={from:t,to:Math.min(o,e)})),r>=o)break;r=e,n.next()}return s}(o,t.state.doc));for(let{from:t,to:n}of o)e.iterate({enter:t=>{let e=t.type.prop(s.NodeProp.isolate);e&&r.add(t.from,t.to,xe[e])},from:t,to:n});return r.finish()}const xe={rtl:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:o.Direction.RTL}),ltr:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:o.Direction.LTR}),auto:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},4434:(t,e,n)=>{n.d(e,{V:()=>o});const r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),s="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(t,e){this.rules=[];let{finish:n}=e||{};function r(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,i,o){let a=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return i.push(t[0]+";");for(let n in e){let o=e[n];if(/&/.test(n))s(n.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,i);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");s(r(n),o,a,h)}else null!=o&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&i.push((!n||l||o?t:t.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(r(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=i[r]||1;return i[r]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let r=t[s],i=n&&n.nonce;r?i&&r.setNonce(i):r=new l(t,i),r.mount(Array.isArray(e)?e:[e])}}let a=new Map;class l{constructor(t,e){let n=t.ownerDocument||t,r=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let e=a.get(n);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[s]=e;this.sheet=new r.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],a.set(n,this)}else{this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let r=t.head||t;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],t[s]=this}mount(t){let e=this.sheet,n=0,r=0;for(let s=0;s<t.length;s++){let i=t[s],o=this.modules.indexOf(i);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,i),e)for(let t=0;t<i.rules.length;t++)e.insertRule(i.rules[t],n++)}else{for(;r<o;)n+=this.modules[r++].rules.length;n+=i.rules.length,r++}}if(!e){let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}}}]);
@@ -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(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(12668),n=o(50102),r=o(63485);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
1
+ "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(44548),a=o(94624),i=o(97373),d=o(81997);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(27961),o=n(44548),i=n(75467),r=n(97373),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(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([[170],{10170:(e,t,s)=>{s.r(t),s.d(t,{ModelDB:()=>m,ObservableJSON:()=>d,ObservableList:()=>c,ObservableMap:()=>o,ObservableString:()=>l,ObservableUndoableList:()=>p,ObservableValue:()=>g});var i,n=s(20998),a=s(2549),r=s(81997),h=s(49503);class o{constructor(e={}){if(this._map=new Map,this._changed=new r.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||i.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const s=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==s&&i(s,t)||(this._map.set(e,t),this._changed.emit({type:s?"change":"add",key:e,oldValue:s,newValue:t})),s}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,s)=>{e.push(s)})),e}values(){const e=[];return this._map.forEach(((t,s)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;t<e.length;t++)this.delete(e[t])}dispose(){this.isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._map.clear())}}!function(e){e.itemCmp=function(e,t){return e===t}}(i||(i={}));class d extends o{constructor(e={}){super({itemCmp:n.JSONExt.deepEqual,values:e.values})}toJSON(){const e=Object.create(null),t=this.keys();for(const s of t){const t=this.get(s);void 0!==t&&(e[s]=n.JSONExt.deepCopy(t))}return e}}!function(e){class t extends h.Message{constructor(e,t){super(e),this.args=t}}e.ChangeMessage=t}(d||(d={}));class l{constructor(e=""){this._text="",this._isDisposed=!1,this._changed=new r.Signal(this),this._text=e}get type(){return"String"}get changed(){return this._changed}set text(e){e.length===this._text.length&&e===this._text||(this._text=e,this._changed.emit({type:"set",start:0,end:e.length,value:e}))}get text(){return this._text}insert(e,t){this._text=this._text.slice(0,e)+t+this._text.slice(e),this._changed.emit({type:"insert",start:e,end:e+t.length,value:t})}remove(e,t){const s=this._text.slice(e,t);this._text=this._text.slice(0,e)+this._text.slice(t),this._changed.emit({type:"remove",start:e,end:t,value:s})}clear(){this.text=""}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}}var _,u=s(33625);class c{constructor(e={}){if(this._array=[],this._isDisposed=!1,this._changed=new r.Signal(this),e.values)for(const t of e.values)this._array.push(t);this._itemCmp=e.itemCmp||_.itemCmp}get type(){return"List"}get changed(){return this._changed}get length(){return this._array.length}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}[Symbol.iterator](){return this._array[Symbol.iterator]()}get(e){return this._array[e]}set(e,t){const s=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(s,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[s],newValues:[t]}))}push(e){const t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t}insert(e,t){e===this._array.length?this._array.push(t):u.ArrayExt.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-2,newIndex:e,oldValues:[],newValues:[t]})}removeValue(e){const t=this._itemCmp,s=u.ArrayExt.findFirstIndex(this._array,(s=>t(s,e)));return this.remove(s),s}remove(e){const t=u.ArrayExt.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t}clear(){const e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t)return;const s=[this._array[e]];u.ArrayExt.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:s,newValues:s})}pushAll(e){const t=this.length;for(const t of e)this._array.push(t);return this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)}),this.length}insertAll(e,t){const s=e;for(const s of t)u.ArrayExt.insert(this._array,e++,s);this._changed.emit({type:"add",oldIndex:-2,newIndex:s,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const s=this._array.slice(e,t);for(let s=e;s<t;s++)u.ArrayExt.removeAt(this._array,e);return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,oldValues:s,newValues:[]}),this.length}}!function(e){e.itemCmp=function(e,t){return e===t}}(_||(_={}));class p extends c{constructor(e){super(),this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange=!1,this._index=-1,this._stack=[],this._serializer=e,this.changed.connect(this._onListChanged,this)}get canRedo(){return this._index<this._stack.length-1}get canUndo(){return this._index>=0}beginCompoundOperation(e){this._inCompound=!0,this._isUndoable=!1!==e,this._madeCompoundChange=!1}endCompoundOperation(){this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange&&this._index++}undo(){if(!this.canUndo)return;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e.reverse())this._undoChange(t);this._isUndoable=!0,this._index--}redo(){if(!this.canRedo)return;this._index++;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e)this._redoChange(t);this._isUndoable=!0}clearUndo(){this._index=-1,this._stack=[]}_onListChanged(e,t){if(this.isDisposed||!this._isUndoable)return;this._inCompound&&this._madeCompoundChange||(this._stack=this._stack.slice(0,this._index+1));const s=this._copyChange(t);this._stack[this._index+1]?this._stack[this._index+1].push(s):this._stack.push([s]),this._inCompound?this._madeCompoundChange=!0:this._index++}_undoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":for(let t=e.newValues.length;t>0;t--)this.remove(e.newIndex);break;case"set":t=e.oldIndex;for(const i of e.oldValues)this.set(t++,s.fromJSON(i));break;case"remove":t=e.oldIndex;for(const i of e.oldValues)this.insert(t++,s.fromJSON(i));break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}}_redoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":t=e.newIndex;for(const i of e.newValues)this.insert(t++,s.fromJSON(i));break;case"set":t=e.newIndex;for(const t of e.newValues)this.set(e.newIndex++,s.fromJSON(t));break;case"remove":for(let t=e.oldValues.length;t>0;t--)this.remove(e.oldIndex);break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}}_copyChange(e){const t=[];for(const s of e.oldValues)t.push(this._serializer.toJSON(s));const s=[];for(const t of e.newValues)s.push(this._serializer.toJSON(t));return{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:t,newValues:s}}}!function(e){e.IdentitySerializer=class{toJSON(e){return e}fromJSON(e){return e}}}(p||(p={}));class g{constructor(e=null){this._value=null,this._changed=new r.Signal(this),this._isDisposed=!1,this._value=e}get type(){return"Value"}get isDisposed(){return this._isDisposed}get changed(){return this._changed}get(){return this._value}set(e){const t=this._value;n.JSONExt.deepEqual(t,e)||(this._value=e,this._changed.emit({oldValue:t,newValue:e}))}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._value=null)}}!function(e){e.IChangedArgs=class{}}(g||(g={}));class m{constructor(e={}){this.isPrepopulated=!1,this.isCollaborative=!1,this.connected=Promise.resolve(void 0),this._toDispose=!1,this._isDisposed=!1,this._disposables=new a.DisposableSet,this._basePath=e.basePath||"",e.baseDB?this._db=e.baseDB:(this._db=new o,this._toDispose=!0)}get basePath(){return this._basePath}get isDisposed(){return this._isDisposed}get(e){return this._db.get(this._resolvePath(e))}has(e){return this._db.has(this._resolvePath(e))}createString(e){const t=new l;return this._disposables.add(t),this.set(e,t),t}createList(e){const t=new p(new p.IdentitySerializer);return this._disposables.add(t),this.set(e,t),t}createMap(e){const t=new d;return this._disposables.add(t),this.set(e,t),t}createValue(e){const t=new g;return this._disposables.add(t),this.set(e,t),t}getValue(e){const t=this.get(e);if(!t||"Value"!==t.type)throw Error("Can only call getValue for an ObservableValue");return t.get()}setValue(e,t){const s=this.get(e);if(!s||"Value"!==s.type)throw Error("Can only call setValue on an ObservableValue");s.set(t)}view(e){const t=new m({basePath:e,baseDB:this});return this._disposables.add(t),t}set(e,t){this._db.set(this._resolvePath(e),t)}dispose(){this.isDisposed||(this._isDisposed=!0,this._toDispose&&this._db.dispose(),this._disposables.dispose())}_resolvePath(e){return this._basePath&&(e=this._basePath+"."+e),e}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[170],{10170:(e,t,s)=>{s.r(t),s.d(t,{ModelDB:()=>m,ObservableJSON:()=>d,ObservableList:()=>c,ObservableMap:()=>o,ObservableString:()=>l,ObservableUndoableList:()=>p,ObservableValue:()=>g});var i,n=s(21961),a=s(49901),r=s(2159),h=s(62633);class o{constructor(e={}){if(this._map=new Map,this._changed=new r.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||i.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const s=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==s&&i(s,t)||(this._map.set(e,t),this._changed.emit({type:s?"change":"add",key:e,oldValue:s,newValue:t})),s}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,s)=>{e.push(s)})),e}values(){const e=[];return this._map.forEach(((t,s)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;t<e.length;t++)this.delete(e[t])}dispose(){this.isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._map.clear())}}!function(e){e.itemCmp=function(e,t){return e===t}}(i||(i={}));class d extends o{constructor(e={}){super({itemCmp:n.JSONExt.deepEqual,values:e.values})}toJSON(){const e=Object.create(null),t=this.keys();for(const s of t){const t=this.get(s);void 0!==t&&(e[s]=n.JSONExt.deepCopy(t))}return e}}!function(e){class t extends h.Message{constructor(e,t){super(e),this.args=t}}e.ChangeMessage=t}(d||(d={}));class l{constructor(e=""){this._text="",this._isDisposed=!1,this._changed=new r.Signal(this),this._text=e}get type(){return"String"}get changed(){return this._changed}set text(e){e.length===this._text.length&&e===this._text||(this._text=e,this._changed.emit({type:"set",start:0,end:e.length,value:e}))}get text(){return this._text}insert(e,t,s){this._text=this._text.slice(0,e)+t+this._text.slice(e),this._changed.emit({type:"insert",start:e,end:e+t.length,value:t,options:s})}remove(e,t,s){const i=this._text.slice(e,t);this._text=this._text.slice(0,e)+this._text.slice(t),this._changed.emit({type:"remove",start:e,end:t,value:i,options:s})}clear(){this.text=""}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}}var _,u=s(14931);class c{constructor(e={}){if(this._array=[],this._isDisposed=!1,this._changed=new r.Signal(this),e.values)for(const t of e.values)this._array.push(t);this._itemCmp=e.itemCmp||_.itemCmp}get type(){return"List"}get changed(){return this._changed}get length(){return this._array.length}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}[Symbol.iterator](){return this._array[Symbol.iterator]()}get(e){return this._array[e]}set(e,t){const s=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(s,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[s],newValues:[t]}))}push(e){const t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t}insert(e,t){e===this._array.length?this._array.push(t):u.ArrayExt.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-2,newIndex:e,oldValues:[],newValues:[t]})}removeValue(e){const t=this._itemCmp,s=u.ArrayExt.findFirstIndex(this._array,(s=>t(s,e)));return this.remove(s),s}remove(e){const t=u.ArrayExt.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t}clear(){const e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t)return;const s=[this._array[e]];u.ArrayExt.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:s,newValues:s})}pushAll(e){const t=this.length;for(const t of e)this._array.push(t);return this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)}),this.length}insertAll(e,t){const s=e;for(const s of t)u.ArrayExt.insert(this._array,e++,s);this._changed.emit({type:"add",oldIndex:-2,newIndex:s,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const s=this._array.slice(e,t);for(let s=e;s<t;s++)u.ArrayExt.removeAt(this._array,e);return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,oldValues:s,newValues:[]}),this.length}}!function(e){e.itemCmp=function(e,t){return e===t}}(_||(_={}));class p extends c{constructor(e){super(),this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange=!1,this._index=-1,this._stack=[],this._serializer=e,this.changed.connect(this._onListChanged,this)}get canRedo(){return this._index<this._stack.length-1}get canUndo(){return this._index>=0}beginCompoundOperation(e){this._inCompound=!0,this._isUndoable=!1!==e,this._madeCompoundChange=!1}endCompoundOperation(){this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange&&this._index++}undo(){if(!this.canUndo)return;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e.reverse())this._undoChange(t);this._isUndoable=!0,this._index--}redo(){if(!this.canRedo)return;this._index++;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e)this._redoChange(t);this._isUndoable=!0}clearUndo(){this._index=-1,this._stack=[]}_onListChanged(e,t){if(this.isDisposed||!this._isUndoable)return;this._inCompound&&this._madeCompoundChange||(this._stack=this._stack.slice(0,this._index+1));const s=this._copyChange(t);this._stack[this._index+1]?this._stack[this._index+1].push(s):this._stack.push([s]),this._inCompound?this._madeCompoundChange=!0:this._index++}_undoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":for(let t=e.newValues.length;t>0;t--)this.remove(e.newIndex);break;case"set":t=e.oldIndex;for(const i of e.oldValues)this.set(t++,s.fromJSON(i));break;case"remove":t=e.oldIndex;for(const i of e.oldValues)this.insert(t++,s.fromJSON(i));break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}}_redoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":t=e.newIndex;for(const i of e.newValues)this.insert(t++,s.fromJSON(i));break;case"set":t=e.newIndex;for(const t of e.newValues)this.set(e.newIndex++,s.fromJSON(t));break;case"remove":for(let t=e.oldValues.length;t>0;t--)this.remove(e.oldIndex);break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}}_copyChange(e){const t=[];for(const s of e.oldValues)t.push(this._serializer.toJSON(s));const s=[];for(const t of e.newValues)s.push(this._serializer.toJSON(t));return{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:t,newValues:s}}}!function(e){e.IdentitySerializer=class{toJSON(e){return e}fromJSON(e){return e}}}(p||(p={}));class g{constructor(e=null){this._value=null,this._changed=new r.Signal(this),this._isDisposed=!1,this._value=e}get type(){return"Value"}get isDisposed(){return this._isDisposed}get changed(){return this._changed}get(){return this._value}set(e){const t=this._value;n.JSONExt.deepEqual(t,e)||(this._value=e,this._changed.emit({oldValue:t,newValue:e}))}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._value=null)}}!function(e){e.IChangedArgs=class{}}(g||(g={}));class m{constructor(e={}){this.isPrepopulated=!1,this.isCollaborative=!1,this.connected=Promise.resolve(void 0),this._toDispose=!1,this._isDisposed=!1,this._disposables=new a.DisposableSet,this._basePath=e.basePath||"",e.baseDB?this._db=e.baseDB:(this._db=new o,this._toDispose=!0)}get basePath(){return this._basePath}get isDisposed(){return this._isDisposed}get(e){return this._db.get(this._resolvePath(e))}has(e){return this._db.has(this._resolvePath(e))}createString(e){const t=new l;return this._disposables.add(t),this.set(e,t),t}createList(e){const t=new p(new p.IdentitySerializer);return this._disposables.add(t),this.set(e,t),t}createMap(e){const t=new d;return this._disposables.add(t),this.set(e,t),t}createValue(e){const t=new g;return this._disposables.add(t),this.set(e,t),t}getValue(e){const t=this.get(e);if(!t||"Value"!==t.type)throw Error("Can only call getValue for an ObservableValue");return t.get()}setValue(e,t){const s=this.get(e);if(!s||"Value"!==s.type)throw Error("Can only call setValue on an ObservableValue");s.set(t)}view(e){const t=new m({basePath:e,baseDB:this});return this._disposables.add(t),t}set(e,t){this._db.set(this._resolvePath(e),t)}dispose(){this.isDisposed||(this._isDisposed=!0,this._toDispose&&this._db.dispose(),this._disposables.dispose())}_resolvePath(e){return this._basePath&&(e=this._basePath+"."+e),e}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>C,IRunningSessionSidebar:()=>y,RunningSessionManagers:()=>I,RunningSessions:()=>L,SearchableSessions:()=>D,SearchableSessionsList:()=>B});var n=s(15465),i=s(25291),a=s(12668),o=s(20998),l=s(2549),r=s(18395),d=s(81997),h=s(63485),c=s(78156),u=s.n(c);const g="jp-RunningSessions",p="jp-RunningSessions-sectionList",_="jp-RunningSessions-item",m="jp-RunningSessions-itemLabel",w="jp-RunningSessions-itemDetail",b="jp-RunningSessions-itemShutdown",f="jp-RunningSessions-caret",S="jp-RunningSessions-icon",v="jp-running-sessions",C=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),y=new o.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class I{constructor(){this._added=new d.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function T(t){var e,s;const{runningItem:n}=t,o=[_],l=null===(e=n.detail)||void 0===e?void 0:e.call(n),r=n.icon(),d=n.labelTitle?n.labelTitle():"",h=t.translator||i.nullTranslator,c=h.load("jupyterlab");let g=!1;const p=t.shutdownItemIcon||a.closeIcon,v=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(n):t.shutdownLabel)&&void 0!==s?s:c.__("Shut Down"),C=n.children,[y,I]=u().useState(!1),T=!!(null==C?void 0:C.length),E=T?()=>!g&&I(!y):void 0;return t.collapseToggled.connect(((t,e)=>I(e))),n.className&&o.push(n.className),t.child&&o.push("jp-mod-running-child"),t.child&&!C&&o.push("jp-mod-running-leaf"),u().createElement(u().Fragment,null,u().createElement("li",null,u().createElement("div",{className:o.join(" "),onClick:E,"data-context":n.context||""},T&&(y?u().createElement(a.caretRightIcon.react,{tag:"span",className:f}):u().createElement(a.caretDownIcon.react,{tag:"span",className:f})),r?"string"==typeof r?u().createElement("img",{src:r,className:S}):u().createElement(r.react,{tag:"span",className:S}):void 0,u().createElement("span",{className:m,title:d,onClick:n.open&&(()=>n.open())},n.label()),l&&u().createElement("span",{className:w},l),n.shutdown&&u().createElement(a.ToolbarButtonComponent,{className:b,icon:p,onClick:()=>{var t;g=!0,null===(t=n.shutdown)||void 0===t||t.call(n)},tooltip:v})),T&&!y&&u().createElement(j,{child:!0,runningItems:C,shutdownItemIcon:p,translator:h,collapseToggled:t.collapseToggled})))}function j(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return u().createElement("ul",{className:p},s.map(((e,s)=>u().createElement(T,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends a.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new d.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return u().createElement(a.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,c.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class x extends a.ReactWidget{constructor(t){super(),this._options=t,this._update=new d.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}dispose(){d.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return u().createElement(a.UseSignal,{signal:this._update},(()=>{var s;return e?e=!1:t.runningItems=t.manager.running(),u().createElement("div",{className:"jp-RunningSessions-sectionContainer"},u().createElement(j,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled}))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class A extends a.PanelWithToolbar{constructor(t){super(),this._buttons=null,this._listView=!1,this._collapseToggled=new d.Signal(this),this._viewChanged=new d.Signal(this),this._manager=t.manager,this._filterProvider=t.filterProvider;const e=t.translator||i.nullTranslator;this._trans=e.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();let s=t.manager.running();!1!==t.showToolbar&&this._initializeToolbar(s),this.addWidget(new x({runningItems:s,collapseToggled:this._collapseToggled,...t}))}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,i=`${s}?`,o=this._manager.shutdownAllConfirmationText||`${s} ${this._manager.name}`,l=new a.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{(0,n.showDialog)({title:i,body:o,buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),r=new a.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:a.tableRowsIcon,pressedIcon:a.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),d=new a.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:a.collapseAllIcon,pressedIcon:a.expandAllIcon,onClick:()=>{const t=!d.pressed;this._collapseToggled.emit(t),d.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":r,"collapse-expand":d,"shutdown-all":l},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this);for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running().filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running();const e=t.length>0,s=0!==t.filter((t=>t.children)).length,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"block":"none",this._buttons["collapse-expand"].node.style.display=n?"block":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class L extends a.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:i.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(g),this.toolbar.addItem("refresh",new a.ToolbarButton({tooltip:n.__("Refresh List"),icon:a.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new A({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(v,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(v))&&void 0!==t?t:{}}}class R extends A{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends h.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class D extends h.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:i.nullTranslator,this.addClass(g),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new B(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+m)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+_)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),r.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class B extends h.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:i.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>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(27961),i=n(15465),o=n(21058),a=n(40930),s=n(57342),d=n(2646),l=n(87844),c=n(25291);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(25291),o=n(12668),a=n(63485);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(44548),o=n(71120),a=n(20998),s=n(81997),d=n(63485),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9072).then(n.t.bind(n,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9072)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(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([[1828,5166],{11828:(a,e,s)=>{s.r(e),s.d(e,{IWorkspaceCommands:()=>o,IWorkspacesModel:()=>n,WorkspacesModel:()=>r});var t=s(97934),i=s(81997);class r{constructor(a){var e;this._refreshed=new i.Signal(this),this._isDisposed=!1,this._workspaceData={ids:[],values:[]},this._manager=a.manager;const s=a.refreshInterval||1e4;this._poll=new t.Poll({auto:null===(e=a.auto)||void 0===e||e,name:"@jupyterlab/workspaces:Model",factory:()=>this._fetchList(),frequency:{interval:s,backoff:!0,max:3e5},standby:a.refreshStandby||"when-hidden"})}get workspaces(){return this._workspaceData.values}get identifiers(){return this._workspaceData.ids}async create(a){await this._manager.save(a,{metadata:{id:a},data:{}}),await this.refresh()}get refreshed(){return this._refreshed}async refresh(){await this._poll.refresh(),await this._poll.tick}async rename(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this._manager.remove(a),await this.refresh()}async reset(a){const e=await this._manager.fetch(a);e.data={},await this._manager.save(a,e),await this.refresh()}async remove(a){await this._manager.remove(a),await this.refresh()}async saveAs(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this.refresh()}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._poll.dispose(),i.Signal.clearData(this))}async _fetchList(){this._workspaceData=await this._manager.list(),this._refreshed.emit(void 0)}}var h=s(20998);const o=new h.Token("@jupyterlab/workspaces:IWorkspaceCommands","Provides identifiers of workspace commands."),n=new h.Token("@jupyterlab/workspaces:IWorkspacesModel","Provides a model for available workspaces.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1828,5166],{11828:(a,e,s)=>{s.r(e),s.d(e,{IWorkspaceCommands:()=>o,IWorkspacesModel:()=>n,WorkspacesModel:()=>r});var t=s(32406),i=s(2159);class r{constructor(a){var e;this._refreshed=new i.Signal(this),this._isDisposed=!1,this._workspaceData={ids:[],values:[]},this._manager=a.manager;const s=a.refreshInterval||1e4;this._poll=new t.Poll({auto:null===(e=a.auto)||void 0===e||e,name:"@jupyterlab/workspaces:Model",factory:()=>this._fetchList(),frequency:{interval:s,backoff:!0,max:3e5},standby:a.refreshStandby||"when-hidden"})}get workspaces(){return this._workspaceData.values}get identifiers(){return this._workspaceData.ids}async create(a){await this._manager.save(a,{metadata:{id:a},data:{}}),await this.refresh()}get refreshed(){return this._refreshed}async refresh(){await this._poll.refresh(),await this._poll.tick}async rename(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this._manager.remove(a),await this.refresh()}async reset(a){const e=await this._manager.fetch(a);e.data={},await this._manager.save(a,e),await this.refresh()}async remove(a){await this._manager.remove(a),await this.refresh()}async saveAs(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this.refresh()}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._poll.dispose(),i.Signal.clearData(this))}async _fetchList(){this._workspaceData=await this._manager.list(),this._refreshed.emit(void 0)}}var h=s(21961);const o=new h.Token("@jupyterlab/workspaces:IWorkspaceCommands","Provides identifiers of workspace commands."),n=new h.Token("@jupyterlab/workspaces:IWorkspacesModel","Provides a model for available workspaces.")}}]);