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
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2756],{12756:function(t,e){!function(t){"use strict";t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function r(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;let o=n(t),s=n(i);return o===s&&(o&&s?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;++n)if(!r(t[n],e[n]))return!1;return!0}(t,i):function(t,e){if(t===e)return!0;for(let n in t)if(void 0!==t[n]&&!(n in e))return!1;for(let n in e)if(void 0!==e[n]&&!(n in t))return!1;for(let n in t){let i=t[n],o=e[n];if(void 0!==i||void 0!==o){if(void 0===i||void 0===o)return!1;if(!r(i,o))return!1}}return!0}(t,i))}function i(t){return e(t)?t:n(t)?function(t){let e=new Array(t.length);for(let n=0,r=t.length;n<r;++n)e[n]=i(t[n]);return e}(t):function(t){let e={};for(let n in t){let r=t[n];void 0!==r&&(e[n]=i(r))}return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=r,t.deepCopy=i}(t.JSONExt||(t.JSONExt={}));function e(t){let e=0;for(let n=0,r=t.length;n<r;++n)n%4==0&&(e=4294967295*Math.random()>>>0),t[n]=255&e,e>>>=8}t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{const t="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:e})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){const e=new Uint8Array(16),n=new Array(256);for(let t=0;t<16;++t)n[t]="0"+t.toString(16);for(let t=16;t<256;++t)n[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+"-"+n[e[4]]+n[e[5]]+"-"+n[e[6]]+n[e[7]]+"-"+n[e[8]]+n[e[9]]+"-"+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=null!=e?e:"",this._tokenStructuralPropertyT=null}}}(e)}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2756],{12756:function(t,e,i){!function(t,e){"use strict";t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function i(t){return Array.isArray(t)}function r(t,n){if(t===n)return!0;if(e(t)||e(n))return!1;let s=i(t),o=i(n);return s===o&&(s&&o?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;++i)if(!r(t[i],e[i]))return!1;return!0}(t,n):function(t,e){if(t===e)return!0;for(let i in t)if(void 0!==t[i]&&!(i in e))return!1;for(let i in e)if(void 0!==e[i]&&!(i in t))return!1;for(let i in t){let n=t[i],s=e[i];if(void 0!==n||void 0!==s){if(void 0===n||void 0===s)return!1;if(!r(n,s))return!1}}return!0}(t,n))}function n(t){return e(t)?t:i(t)?function(t){let e=new Array(t.length);for(let i=0,r=t.length;i<r;++i)e[i]=n(t[i]);return e}(t):function(t){let e={};for(let i in t){let r=t[i];void 0!==r&&(e[i]=n(r))}return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=i,t.isObject=function(t){return!e(t)&&!i(t)},t.deepEqual=r,t.deepCopy=n}(t.JSONExt||(t.JSONExt={}));var i;!function(t){class i{constructor(t){var e,i,r,n;this._activated=!1,this._promise=null,this._service=null,this.id=t.id,this.description=null!==(e=t.description)&&void 0!==e?e:"",this.activate=t.activate,this.deactivate=null!==(i=t.deactivate)&&void 0!==i?i:null,this.provides=null!==(r=t.provides)&&void 0!==r?r:null,this.autoStart=null!==(n=t.autoStart)&&void 0!==n&&n,this.requires=t.requires?t.requires.slice():[],this.optional=t.optional?t.optional.slice():[]}get activated(){return this._activated}set activated(t){this._activated=t}get service(){return this._service}set service(t){this._service=t}get promise(){return this._promise}set promise(t){this._promise=t}}t.createPluginData=function(t){return new i(t)},t.ensureNoCycle=function(t,e,i){const r=[...t.requires,...t.optional],n=r=>{if(r===t.provides)return!0;const o=i.get(r);if(!o)return!1;const a=e.get(o),l=[...a.requires,...a.optional];return 0!==l.length&&(s.push(o),!!l.some(n)||(s.pop(),!1))};if(!t.provides||0===r.length)return;const s=[t.id];if(r.some(n))throw new ReferenceError(`Cycle detected: ${s.join(" -> ")}.`)},t.findDependents=function(t,i,r){const n=new Array,s=t=>{const e=i.get(t),s=[...e.requires,...e.optional];n.push(...s.reduce(((e,i)=>{const n=r.get(i);return n&&e.push([t,n]),e}),[]))};for(const t of i.keys())s(t);const o=n.filter((e=>e[1]===t));let a=0;for(;o.length>a;){const t=o.length,e=new Set(o.map((t=>t[0])));for(const t of e)n.filter((e=>e[1]===t)).forEach((t=>{o.includes(t)||o.push(t)}));a=t}const l=e.topologicSort(o),u=l.findIndex((e=>e===t));return-1===u?[t]:l.slice(0,u+1)},t.collectStartupPlugins=function(t,e){const i=new Set;for(const e of t.keys())!0===t.get(e).autoStart&&i.add(e);if(e.startPlugins)for(const t of e.startPlugins)i.add(t);if(e.ignorePlugins)for(const t of e.ignorePlugins)i.delete(t);return Array.from(i)}}(i||(i={}));function r(t){let e=0;for(let i=0,r=t.length;i<r;++i)i%4==0&&(e=4294967295*Math.random()>>>0),t[i]=255&e,e>>>=8}t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{const t="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:r})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){const e=new Uint8Array(16),i=new Array(256);for(let t=0;t<16;++t)i[t]="0"+t.toString(16);for(let t=16;t<256;++t)i[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],i[e[0]]+i[e[1]]+i[e[2]]+i[e[3]]+"-"+i[e[4]]+i[e[5]]+"-"+i[e[6]]+i[e[7]]+"-"+i[e[8]]+i[e[9]]+"-"+i[e[10]]+i[e[11]]+i[e[12]]+i[e[13]]+i[e[14]]+i[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PluginRegistry=class{constructor(t={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,t.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=t.validatePlugin)}get application(){return this._application}set application(t){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=t}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}getPluginDescription(t){var e,i;return null!==(i=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==i?i:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,i;return null!==(i=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==i&&i}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);if(!this._validatePlugin(t))throw new Error(`Plugin '${t.id}' is not valid.`);const e=i.createPluginData(t);i.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(const e of t)this.registerPlugin(e)}deregisterPlugin(t,e){const i=this._plugins.get(t);if(i){if(i.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;const i=e.requires.map((t=>this.resolveRequiredService(t))),r=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...i,...r]).then((t=>e.activate.apply(void 0,[this.application,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async activatePlugins(t,e={}){switch(t){case"defer":{const t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t);break}case"startUp":{const t=i.collectStartupPlugins(this._plugins,e).map((async t=>{try{return await this.activatePlugin(t)}catch(e){console.error(`Plugin '${t}' failed to activate.`,e)}}));await Promise.all(t);break}}}async deactivatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);const r=i.findDependents(t,this._plugins,this._services),n=r.map((t=>this._plugins.get(t)));for(const e of n)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(const t of n){const e=[...t.requires,...t.optional].map((t=>{const e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this.application,...e),t.service=null,t.activated=!1}return r.pop(),r}async resolveRequiredService(t){const e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);const i=this._plugins.get(e);return i.activated||await this.activatePlugin(e),i.service}async resolveOptionalService(t){const e=this._services.get(t);if(!e)return null;const i=this._plugins.get(e);if(!i.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return i.service}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=null!=e?e:"",this._tokenStructuralPropertyT=null}}}(e,i(14931))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2813,3325],{23325:(t,e,r)=>{r.r(e),r.d(e,{MAJOR_VERSION:()=>u,MINOR_VERSION:()=>i,isCode:()=>c,isDisplayData:()=>l,isDisplayUpdate:()=>_,isError:()=>f,isExecuteResult:()=>s,isMarkdown:()=>p,isRaw:()=>o,isStream:()=>y,validateMimeValue:()=>a});var n=r(20998);const u=4,i=4;function a(t,e){const r="application/json"===t||/^application\/.+\+json$/.test(t),u=t=>"[object String]"===Object.prototype.toString.call(t);if(Array.isArray(e)){if(r)return!1;let t=!0;return e.forEach((e=>{u(e)||(t=!1)})),t}return u(e)?!r:!!r&&n.JSONExt.isObject(e)}function o(t){return"raw"===t.cell_type}function p(t){return"markdown"===t.cell_type}function c(t){return"code"===t.cell_type}function s(t){return"execute_result"===t.output_type}function l(t){return"display_data"===t.output_type}function _(t){return"update_display_data"===t.output_type}function y(t){return"stream"===t.output_type}function f(t){return"error"===t.output_type}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2813,3325],{23325:(t,e,r)=>{r.r(e),r.d(e,{MAJOR_VERSION:()=>u,MINOR_VERSION:()=>i,isCode:()=>c,isDisplayData:()=>l,isDisplayUpdate:()=>_,isError:()=>f,isExecuteResult:()=>s,isMarkdown:()=>p,isRaw:()=>o,isStream:()=>y,validateMimeValue:()=>a});var n=r(21961);const u=4,i=4;function a(t,e){const r="application/json"===t||/^application\/.+\+json$/.test(t),u=t=>"[object String]"===Object.prototype.toString.call(t);if(Array.isArray(e)){if(r)return!1;let t=!0;return e.forEach((e=>{u(e)||(t=!1)})),t}return u(e)?!r:!!r&&n.JSONExt.isObject(e)}function o(t){return"raw"===t.cell_type}function p(t){return"markdown"===t.cell_type}function c(t){return"code"===t.cell_type}function s(t){return"execute_result"===t.output_type}function l(t){return"display_data"===t.output_type}function _(t){return"update_display_data"===t.output_type}function y(t){return"stream"===t.output_type}function f(t){return"error"===t.output_type}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(81997);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(79844),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},94741:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(n||(t.MarkdownCodeBlocks=n={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(20998),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=o.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(20998);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;!function(e){e.formatHuman=function(e,t="long"){const o=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(o,{numeric:"auto",style:t}),i=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(i/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(o||(t.Time=o={}))},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));var s;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:o}=t(e);return(!o||0!==e.toLowerCase().indexOf(o))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(s||(t.URLExt=s={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var _=m[2];r.bools[h]&&(_="false"!==_),u(h,_,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),y=!1,b=0;b<v.length;b++)if("-"!==(d=g.slice(b+2))){if(/[A-Za-z]/.test(v[b])&&"="===d[0]){u(v[b],d.slice(1),g),y=!0;break}if(/[A-Za-z]/.test(v[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[b],d,g),y=!0;break}if(v[b+1]&&v[b+1].match(/\W/)){u(v[b],g.slice(b+2),g),y=!0;break}u(v[b],!r.strings[v[b]]||"",g)}else u(v[b],d,g);h=g.slice(-1)[0],y||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"===i)for(t in r=new _(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,c,l,h,v,y=p.slice(),b=typeof t,w=this,C=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);C<y.length;C++)"function"!=typeof(l=y[C])?(c=l[0],v=l[1],c!=c?w[v]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[v]=e.slice(0,h),e=e.slice(h+l[2])):(w[v]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[v]=h[1],e=e.slice(0,h.index)),w[v]=w[v]||i&&l[3]&&t[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=m,_.location=d,_.trimLeft=f,_.qs=r,e.exports=_}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(2159);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(79844),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},94741:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(n||(t.MarkdownCodeBlocks=n={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(21961),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=o.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(21961);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;!function(e){e.formatHuman=function(e,t="long"){const o=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(o,{numeric:"auto",style:t}),i=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(i/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(o||(t.Time=o={}))},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));var s;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:o}=t(e);return(!o||0!==e.toLowerCase().indexOf(o))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(s||(t.URLExt=s={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var _=m[2];r.bools[h]&&(_="false"!==_),u(h,_,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),y=!1,b=0;b<v.length;b++)if("-"!==(d=g.slice(b+2))){if(/[A-Za-z]/.test(v[b])&&"="===d[0]){u(v[b],d.slice(1),g),y=!0;break}if(/[A-Za-z]/.test(v[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[b],d,g),y=!0;break}if(v[b+1]&&v[b+1].match(/\W/)){u(v[b],g.slice(b+2),g),y=!0;break}u(v[b],!r.strings[v[b]]||"",g)}else u(v[b],d,g);h=g.slice(-1)[0],y||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"===i)for(t in r=new _(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,c,l,h,v,y=p.slice(),b=typeof t,w=this,C=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);C<y.length;C++)"function"!=typeof(l=y[C])?(c=l[0],v=l[1],c!=c?w[v]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[v]=e.slice(0,h),e=e.slice(h+l[2])):(w[v]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[v]=h[1],e=e.slice(0,h.index)),w[v]=w[v]||i&&l[3]&&t[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=m,_.location=d,_.trimLeft=f,_.qs=r,e.exports=_}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(15465),i=o(12668),s=o(27478),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(30754),p=o(87844),c=o(25291),u=o(20998),f=o(63485);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(20911),i=o(7258),s=o(27478),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(70750),p=o(68878),c=o(66649),u=o(21961),f=o(2260);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2944],{62944:(e,t,i)=>{i.r(t),i.d(t,{CONTEXT_PROVIDER_ID:()=>M,Completer:()=>b,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>$,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>k,HistoryInlineCompletionProvider:()=>Q,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>U,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>L,KernelCompleterProvider:()=>H,ProviderReconciliator:()=>E,completerWidgetIcon:()=>Z,inlineCompleterIcon:()=>K});var s,n,o=i(52712),r=i(44548),l=i(49503),a=i(81997),h=i(20998);!function(e){e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions"}(s||(s={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(n||(n={}));const d=new h.Token("@jupyterlab/completer:IInlineCompleterFactory","A factory of inline completer widgets."),c=new h.Token("@jupyterlab/completer:ICompletionProviderManager","A service for the completion providers management.");class u{constructor(e){this._fetchingInline=0,this._editor=null,this._enabled=!1,this._isDisposed=!1,this._autoCompletion=!1,this._continuousInline=!0,this.completer=e.completer,this.inlineCompleter=e.inlineCompleter,this.completer.selected.connect(this.onCompletionSelected,this),this.completer.visibilityChanged.connect(this.onVisibilityChanged,this),this._reconciliator=e.reconciliator}set reconciliator(e){this._reconciliator=e}get editor(){return this._editor}set editor(e){if(e===this._editor)return;let t=this._editor;if(t&&!t.isDisposed){const e=t.model;t.host.classList.remove(o.COMPLETER_ENABLED_CLASS),t.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),e.selections.changed.disconnect(this.onSelectionsChanged,this),e.sharedModel.changed.disconnect(this._onSharedModelChanged,this)}if(this.completer.reset(),this.completer.editor=e,t=this._editor=e,t){const e=t.model;this._enabled=!1,e.selections.changed.connect(this.onSelectionsChanged,this),e.sharedModel.changed.connect(this._onSharedModelChanged,this),this.onSelectionsChanged(),this.inlineCompleter&&(this.inlineCompleter.editor=t)}}get isDisposed(){return this._isDisposed}set autoCompletion(e){this._autoCompletion=e}get autoCompletion(){return this._autoCompletion}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}invokeInline(){const e=this._editor;e&&this._makeInlineRequest(e.getCursorPosition(),n.Invoke).catch((e=>{console.warn("Inline invoke request bailed",e)}))}invoke(){l.MessageLoop.sendMessage(this,u.Msg.InvokeRequest)}processMessage(e){e.type===u.Msg.InvokeRequest.type&&this.onInvokeRequest(e)}getState(e,t){return{text:e.model.sharedModel.getSource(),line:t.line,column:t.column}}onCompletionSelected(e,t){const i=e.model,s=this._editor;if(!s||!i)return;const n=i.createPatch(t);if(!n)return;const{start:o,end:r,value:l}=n,a=s.getOffsetAt(s.getCursorPosition());s.model.sharedModel.updateSource(o,r,l),a<=r&&a>=o&&s.setCursorPosition(s.getPositionAt(o+l.length))}onInvokeRequest(e){if(!this.completer.model)return;if(this.completer.model.original)return;const t=this._editor;t&&this._makeRequest(t.getCursorPosition(),s.Invoked).catch((e=>{console.warn("Invoke request bailed",e)}))}onSelectionsChanged(){var e;const t=this.completer.model,i=this._editor;if(!i)return;const s=null===(e=this.inlineCompleter)||void 0===e?void 0:e.model;s&&s.handleSelectionChange(i.getSelection());const n=i.host;if(!t)return this._enabled=!1,void n.classList.remove(o.COMPLETER_ENABLED_CLASS);if(t.subsetMatch)return;const r=i.getCursorPosition(),l=i.getLine(r.line);if(!l)return this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS);const{start:a,end:h}=i.getSelection();return a.column!==h.column||a.line!==h.line||l.slice(0,r.column).match(/^\s*$/)?(this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS)):(this._enabled||(this._enabled=!0,n.classList.add(o.COMPLETER_ENABLED_CLASS)),void t.handleCursorChange(this.getState(i,i.getCursorPosition())))}async onTextChanged(e,t){var i;if(!this._enabled)return;const o=this.completer.model,r=this.editor;if(!r)return;o&&this._autoCompletion&&this._reconciliator.shouldShowContinuousHint&&await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible,t)&&this._makeRequest(r.getCursorPosition(),s.TriggerCharacter);const l=null===(i=this.inlineCompleter)||void 0===i?void 0:i.model;if(l&&(l.handleTextChange(t),this._continuousInline&&this._makeInlineRequest(r.getCursorPosition(),n.Automatic)),o){const{start:e,end:t}=r.getSelection();if(e.column!==t.column||e.line!==t.line)return;o.handleTextChange(this.getState(r,r.getCursorPosition()))}}onVisibilityChanged(e){e.isDisposed||e.isHidden?this._editor&&(this._editor.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),this._editor.focus()):this._editor&&this._editor.host.classList.add(o.COMPLETER_ACTIVE_CLASS)}async _onSharedModelChanged(e,t){t.sourceChange&&await this.onTextChanged(e,t)}_makeRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));const s=this._composeRequest(i,e),n=this.getState(i,e);return this._reconciliator.fetch(s,t).then((e=>{if(!e)return;const t=this._updateModel(n,e.start,e.end);t&&t.setCompletionItems&&t.setCompletionItems(e.items)})).catch((e=>{}))}async _makeInlineRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));if(!this.inlineCompleter)return Promise.reject(new Error("No inline completer"));const s=i.getLine(e.line);if(t===n.Automatic&&(void 0===s||e.column<s.length))return;const o=this._composeRequest(i,e),r=this.inlineCompleter.model;if(!r)return;r.cursor=e;const l=++this._fetchingInline,a=this._reconciliator.fetchInline(o,t),h=new Set;for(const e of a)e.then((t=>{t&&t.items&&l===this._fetchingInline&&(h.add(e),1===h.size?r.setCompletions(t):r.appendCompletions(t))})).catch((e=>{console.warn(e)})).finally((()=>{h.add(e);const t=a.length-h.size;r.notifyProgress({pendingProviders:t,totalProviders:a.length})}))}_composeRequest(e,t){const i=e.model.sharedModel.getSource(),s=e.model.mimeType;return{text:i,offset:r.Text.jsIndexToCharIndex(e.getOffsetAt(t),i),mimeType:s}}_updateModel(e,t,i){const s=this.completer.model,n=e.text;return s?(s.original=e,s.cursor={start:r.Text.charIndexToJsIndex(t,n),end:r.Text.charIndexToJsIndex(i,n)},s):null}}!function(e){let t,i;!function(e){e[e.opened=0]="opened",e[e.update=1]="update",e[e.closed=2]="closed"}(t=e.StraemEvent||(e.StraemEvent={})),function(e){e.InvokeRequest=new l.Message("invoke-request")}(i=e.Msg||(e.Msg={}))}(u||(u={}));var m,p=i(33625);function g(e){const t=document.createElement("span");return t.textContent=e,t.innerHTML}class _{constructor(){this.processedItemsCache=null,this._current=null,this._cursor=null,this._isDisposed=!1,this._completionItems=[],this._original=null,this._query="",this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],this._stateChanged=new a.Signal(this),this._queryChanged=new a.Signal(this),this._processedToOriginalItem=null,this._resolvingItem=0}get stateChanged(){return this._stateChanged}get queryChanged(){return this._queryChanged}get original(){return this._original}set original(e){this._original===e||this._original&&e&&h.JSONExt.deepEqual(e,this._original)||(this._reset(),this._current=this._original=e,this._stateChanged.emit(void 0))}get current(){return this._current}set current(e){if(this._current===e||this._current&&e&&h.JSONExt.deepEqual(e,this._current))return;const t=this._original;if(!t)return;const i=this._cursor;if(!i)return;const s=this._current=e;if(!s)return void this._stateChanged.emit(void 0);const n=t.text.split("\n")[t.line],o=s.text.split("\n")[s.line];if(!this._subsetMatch&&o.length<n.length)return void this.reset(!0);const{start:r,end:l}=i;let a=s.text.substring(r);const d=t.text.substring(l);a=a.substring(0,a.lastIndexOf(d)),this._query=a,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"editorUpdate"}),this._stateChanged.emit(void 0)}get cursor(){return this._cursor}set cursor(e){this.original&&(this._cursor=e)}get query(){return this._query}set query(e){this._query=e,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"setter"})}get subsetMatch(){return this._subsetMatch}set subsetMatch(e){this._subsetMatch=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}completionItems(){if(!this.processedItemsCache){let e=this._query;if(e){const t=this._markup(e);this.processedItemsCache=t.map((e=>e.processedItem)),this._processedToOriginalItem=new WeakMap(t.map((e=>[e.processedItem,e.originalItem])))}else this.processedItemsCache=this._completionItems.map((e=>this._escapeItemLabel(e))),this._processedToOriginalItem=null}return this.processedItemsCache}setCompletionItems(e){h.JSONExt.deepEqual(e,this._completionItems)||(this._completionItems=e,this._orderedTypes=m.findOrderedCompletionItemTypes(this._completionItems),this.processedItemsCache=null,this._processedToOriginalItem=null,this._stateChanged.emit(void 0))}typeMap(){return this._typeMap}orderedTypes(){return this._orderedTypes}handleCursorChange(e){if(!this._original)return;const{column:t,line:i}=e,{current:s,original:n}=this;if(!n)return;if(i!==n.line)return void this.reset(!0);if(t<n.column)return void this.reset(!0);const{cursor:o}=this;if(!o||!s)return;const r=o.end-o.start,l=n.text.split("\n")[n.line],a=s.text.split("\n")[s.line].length-l.length;t>n.column+r+a&&this.reset(!0)}handleTextChange(e){const t=this._original;if(!t)return;const{text:i,column:s,line:n}=e,o=i.split("\n")[n][s-1];o&&o.match(/\S/)||e.column>=t.column?this.current=e:this.reset(!1)}createPatch(e){const t=this._original,i=this._cursor,s=this._current;if(!t||!i||!s)return;let{start:n,end:o}=i;return o+=s.text.length-t.text.length,{start:n,end:o,value:e}}reset(e=!1){!e&&this._subsetMatch||(this._reset(),this._stateChanged.emit(void 0))}_markup(e){var t;const i=this._completionItems;let s=[];for(const n of i){const i=n.label.indexOf("("),o=i>-1?n.label.substring(0,i):n.label,r=p.StringExt.matchSumOfSquares(g(o),e);if(r){let e=p.StringExt.highlight(g(n.label),r.indices,m.mark);const i=Object.assign({},n);i.label=e.join(""),i.insertText=null!==(t=n.insertText)&&void 0!==t?t:n.label,s.push({item:i,score:r.score,originalItem:n})}}return s.sort(m.scoreCmp),s.map((e=>({processedItem:e.item,originalItem:e.originalItem})))}resolveItem(e){let t,i;if("number"==typeof e){const i=this.completionItems();if(!i||!i[e])return;t=i[e]}else t=e;if(t)return i=this._processedToOriginalItem?this._processedToOriginalItem.get(t):t,i?this._resolveItemByValue(i):void 0}_resolveItemByValue(e){const t=++this._resolvingItem;let i;if(e.resolve){let t;e.insertText&&(t=this.createPatch(e.insertText)),i=e.resolve(t)}else i=Promise.resolve(e);return i.then((i=>(this._escapeItemLabel(i,!0),Object.keys(i).forEach((t=>{e[t]=i[t]})),e.resolve=void 0,t!==this._resolvingItem?Promise.resolve(null):i))).catch((t=>(console.error(t),Promise.resolve(e))))}_escapeItemLabel(e,t=!1){var i;const s=g(e.label);if(s!==e.label){const n=t?e:Object.assign({},e);return n.insertText=null!==(i=e.insertText)&&void 0!==i?i:e.label,n.label=s,n}return e}_reset(){const e=this._query;this._current=null,this._cursor=null,this._completionItems=[],this._original=null,this._query="",this.processedItemsCache=null,this._processedToOriginalItem=null,this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],e&&this._queryChanged.emit({newValue:this._query,origin:"reset"})}}!function(e){const t=["function","instance","class","module","keyword"],i=t.reduce(((e,t)=>(e[t]=null,e)),{});e.mark=function(e){return`<mark>${e}</mark>`},e.scoreCmp=function(e,t){var i,s,n;const o=e.score-t.score;return 0!==o?o:null!==(n=null===(i=e.item.insertText)||void 0===i?void 0:i.localeCompare(null!==(s=t.item.insertText)&&void 0!==s?s:""))&&void 0!==n?n:0},e.findOrderedCompletionItemTypes=function(e){const i=new Set;e.forEach((e=>{!e.type||t.includes(e.type)||i.has(e.type)||i.add(e.type)}));const s=Array.from(i);return s.sort(((e,t)=>e.localeCompare(t))),t.concat(s)},e.findOrderedTypes=function(e){const s=Object.keys(e).map((t=>e[t])).filter((e=>!!e&&!(e in i))).sort(((e,t)=>e.localeCompare(t)));return t.concat(s)}}(m||(m={}));var v=i(15465),f=i(50102),C=i(12668),y=i(18395),w=i(63485);const x="jp-Completer-item",P="jp-mod-active",I="jp-Completer-list",S=!0;class b extends w.Widget{constructor(e){var t,i,s,n;super({node:document.createElement("div")}),this._activeIndex=0,this._editor=null,this._model=null,this._selected=new a.Signal(this),this._visibilityChanged=new a.Signal(this),this._indexChanged=new a.Signal(this),this._lastSubsetMatch="",this._geometryLock=!1,this._geometryCounter=0,this._docPanelExpanded=!1,this._renderCounter=0,this.sanitizer=null!==(t=e.sanitizer)&&void 0!==t?t:new v.Sanitizer,this._defaultRenderer=b.getDefaultRenderer(this.sanitizer),this._renderer=null!==(i=e.renderer)&&void 0!==i?i:this._defaultRenderer,this._docPanel=this._createDocPanelNode(),this.model=null!==(s=e.model)&&void 0!==s?s:null,this.editor=null!==(n=e.editor)&&void 0!==n?n:null,this.addClass("jp-Completer"),this._updateConstraints()}_updateConstraints(){const e=document.createElement("div");e.classList.add(I),e.style.visibility="hidden",e.style.overflowY="scroll",document.body.appendChild(e);const t=window.getComputedStyle(e);this._maxHeight=parseInt(t.maxHeight,10),this._minHeight=parseInt(t.minHeight,10),this._scrollbarWidth=e.offsetWidth-e.clientWidth,document.body.removeChild(e);const i=this._createDocPanelNode();this._docPanelWidth=T.measureSize(i,"inline-block").width}get activeIndex(){return this._activeIndex}get editor(){return this._editor}set editor(e){this._editor=e}get selected(){return this._selected}get visibilityChanged(){return this._visibilityChanged}get indexChanged(){return this._indexChanged}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.stateChanged.disconnect(this.onModelStateChanged,this),this._model.queryChanged.disconnect(this.onModelQueryChanged,this)),this._model=e,this._model&&(this._model.stateChanged.connect(this.onModelStateChanged,this),this._model.queryChanged.connect(this.onModelQueryChanged,this)))}get renderer(){return this._renderer}set renderer(e){this._renderer=e}set showDocsPanel(e){this._showDoc=e}get showDocsPanel(){return this._showDoc}dispose(){this._sizeCache=void 0,this._model=null,super.dispose()}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"keydown":this._evtKeydown(e);break;case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}reset(){this._activeIndex=0,this._lastSubsetMatch="",this._model&&this._model.reset(!0),this._docPanel.style.display="none",this._sizeCache=void 0,this.node.scrollTop=0}selectActive(){const e=this.node.querySelector(`.${P}`);e?(this._selected.emit(e.getAttribute("data-value")),this.reset()):this.reset()}onAfterAttach(e){document.addEventListener("keydown",this,S),document.addEventListener("pointerdown",this,S),document.addEventListener("scroll",this,S)}onBeforeDetach(e){document.removeEventListener("keydown",this,S),document.removeEventListener("pointerdown",this,S),document.removeEventListener("scroll",this,S)}onModelStateChanged(){this.isAttached&&(this._activeIndex=0,this._indexChanged.emit(this._activeIndex),this.update())}onModelQueryChanged(e,t){if(this._sizeCache&&"editorUpdate"===t.origin){const t=e.completionItems(),i=this._sizeCache.items,s=i[this._findWidestItemIndex(i)],n=t[this._findWidestItemIndex(t)],o=this._getPreferredItemWidthHeuristic();t.length===this._sizeCache.items.length&&o(s)===o(n)||(this._sizeCache=void 0)}}onUpdateRequest(e){var t;const i=this._model;if(!i)return;i.query||this._populateSubset();let s=i.completionItems();if(!s.length)return void(this.isHidden||(this.reset(),this.hide(),this._visibilityChanged.emit(void 0)));this._updateConstraints(),this._geometryLock=!0;const n=this._createCompleterNode(i,s);let o=n.querySelectorAll(`.${x}`)[this._activeIndex];o.classList.add(P);const r=null===(t=this.model)||void 0===t?void 0:t.resolveItem(s[this._activeIndex]);this._showDoc&&(this._docPanel.innerText="",n.appendChild(this._docPanel),this._docPanelExpanded=!1,this._docPanel.style.display="none",this._updateDocPanel(r,o)),this.isHidden?(this.show(),this._setGeometry(),this._visibilityChanged.emit(void 0)):this._setGeometry(),this._geometryLock=!1}get sizeCache(){if(this._sizeCache)return{width:this._sizeCache.width+this._sizeCache.docPanelWidth,height:Math.max(this._sizeCache.height,this._sizeCache.docPanelHeight)}}_createDocPanelNode(){const e=document.createElement("div");return e.className="jp-Completer-docpanel",e}_createCompleterNode(e,t){const i=++this._renderCounter;let s=this.node;s.textContent="";let n=e.orderedTypes(),o=document.createElement("ul");o.className=I;const r=this._renderer.createCompletionItemNode(t[0],n),l=[r],a=T.measureSize(r,"inline-grid"),h=Math.max(Math.ceil(this._maxHeight/a.height),5),d=Math.min(h+1,t.length),c=performance.now();for(let e=1;e<d;e++){const i=this._renderer.createCompletionItemNode(t[e],n);l.push(i)}for(const e of l)o.appendChild(e);const u=this._findWidestItemIndex(t),m=u<l.length?l[u]:this._renderer.createCompletionItemNode(t[u],n),p=T.measureSize(m.cloneNode(!0),"inline-grid");if(this._sizeCache={height:Math.min(this._maxHeight,a.height*t.length),width:p.width+this._scrollbarWidth,items:t,docPanelWidth:0,docPanelHeight:0},d<t.length){const e=(performance.now()-c)/d,s=Math.max(5,Math.floor(12/e));let r=d,h=l[l.length-1];const u=()=>{if(r>=t.length)return;const e=a.height*(t.length-r);h.style.marginBottom=`${e}px`,requestAnimationFrame((()=>{if(i!=this._renderCounter)return;h.style.marginBottom="";const e=Math.min(t.length,r+s);for(let i=r;i<e;i++){const e=this._renderer.createCompletionItemNode(t[i],n);o.appendChild(e),h=e}r=e,u()}))};u()}return s.appendChild(o),s}_findWidestItemIndex(e){const t=this._getPreferredItemWidthHeuristic(),i=e.map(t);return i.indexOf(Math.max(...i))}_getPreferredItemWidthHeuristic(){return this._renderer.itemWidthHeuristic?this._renderer.itemWidthHeuristic.bind(this._renderer):this._defaultRenderer.itemWidthHeuristic.bind(this._defaultRenderer)}_cycle(e){var t,i;const s=this.node.querySelectorAll(`.${x}`),n=this._activeIndex,o=s.length-1;let r=this.node.querySelector(`.${P}`);switch(r.classList.remove(P),e){case"up":this._activeIndex=0===n?o:n-1;break;case"down":this._activeIndex=n<o?n+1:0;break;case"pageUp":case"pageDown":{const t=this.node.getBoundingClientRect(),i=r.getBoundingClientRect(),s=Math.floor(t.height/i.height),l="pageUp"===e?-1:1;this._activeIndex=Math.min(Math.max(0,n+l*s),o);break}}r=s[this._activeIndex],r.classList.add(P);let l=this.node.querySelector(`.${I}`);y.ElementExt.scrollIntoViewIfNeeded(l,r),this._indexChanged.emit(this._activeIndex);const a=null===(t=this.model)||void 0===t?void 0:t.completionItems(),h=null==a?void 0:a[this._activeIndex];if(h){const e=null===(i=this.model)||void 0===i?void 0:i.resolveItem(h);this._showDoc&&this._updateDocPanel(e,r)}}_evtKeydown(e){if(!this.isHidden&&this._editor)if(this._editor.host.contains(e.target))switch(e.keyCode){case 9:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=this._model;if(!t)return;const i=t.completionItems();if(i&&1===i.length)return this._selected.emit(i[0].insertText||i[0].label),void this.reset();const s=this._populateSubset();return t.query&&t.query!==this._lastSubsetMatch&&(t.subsetMatch=!0,this._selected.emit(t.query),t.subsetMatch=!1,this._lastSubsetMatch=t.query),s&&this.update(),void this._cycle(e.shiftKey?"up":"down")}case 27:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),void this.reset();case 33:case 34:case 38:case 40:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=T.keyCodeMap[e.keyCode];return void this._cycle(t)}default:return}else this.reset()}_evtPointerdown(e){if(this.isHidden||!this._editor)return;if(T.nonstandardClick(e))return void this.reset();let t=e.target;for(;t!==document.documentElement;){if(t.classList.contains(x))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._selected.emit(t.getAttribute("data-value")),void this.reset();if(t===this.node)return e.preventDefault(),e.stopPropagation(),void e.stopImmediatePropagation();t=t.parentElement}this.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_populateSubset(){const{model:e}=this;if(!e)return!1;const t=e.completionItems(),i=T.commonSubset(t.map((e=>e.insertText||e.label))),{query:s}=e;return!(!i||i===s||0!==i.indexOf(s)||(e.query=i,0))}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!(i&&t&&t.original&&t.cursor))return;const s=t.cursor.start,n=i.getPositionAt(s),o=i.getCoordinateForPosition(n);if(!o)return;const r=window.getComputedStyle(e),l=parseInt(r.borderLeftWidth,10)||0,a=parseInt(r.paddingLeft,10)||0,h=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host,d=t.completionItems();this._sizeCache&&this._sizeCache.items.length!==d.length&&(this._sizeCache=void 0),C.HoverBox.setGeometry({anchor:o,host:h,maxHeight:this._maxHeight,minHeight:this._minHeight,node:e,size:this.sizeCache,offset:{horizontal:l+a},privilege:"below",style:r,outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}});const c=++this._geometryCounter;this._sizeCache||requestAnimationFrame((()=>{if(c!=this._geometryCounter)return;let t=e.getBoundingClientRect(),i=this._docPanel.getBoundingClientRect();this._sizeCache={width:t.width-i.width,height:t.height,items:d,docPanelWidth:i.width,docPanelHeight:i.height}}))}_updateDocPanel(e,t){var i,s,n;let o=this._docPanel;if(!e)return void this._toggleDocPanel(!1);const r=null!==(n=null===(s=(i=this._renderer).createLoadingDocsIndicator)||void 0===s?void 0:s.call(i))&&void 0!==n?n:this._defaultRenderer.createLoadingDocsIndicator();t.appendChild(r),e.then((e=>{var t,i,s;if(e&&o)if(e.documentation){const n=null!==(s=null===(i=(t=this._renderer).createDocumentationNode)||void 0===i?void 0:i.call(t,e))&&void 0!==s?s:this._defaultRenderer.createDocumentationNode(e);o.textContent="",o.appendChild(n),this._toggleDocPanel(!0)}else this._toggleDocPanel(!1)})).catch((e=>console.error(e))).finally((()=>{t.removeChild(r)}))}_toggleDocPanel(e){let t=this._docPanel;if(e){if(this._docPanelExpanded)return;t.style.display="",this._docPanelExpanded=!0}else{if(!this._docPanelExpanded)return;t.style.display="none",this._docPanelExpanded=!1}const i=this._sizeCache;i&&(i.docPanelHeight=e?this._maxHeight:0,i.docPanelWidth=e?this._docPanelWidth:0,this._geometryLock||this._setGeometry())}}var T;!function(e){class t{constructor(e){this.sanitizer=(null==e?void 0:e.sanitizer)||new v.Sanitizer}createCompletionItemNode(e,t){let i=this._createWrapperNode(e.insertText||e.label);return e.deprecated&&i.classList.add("jp-Completer-deprecated"),this._constructNode(i,this._createLabelNode(e.label),!!e.type,e.type,t,e.icon)}createDocumentationNode(e){const t=document.createElement("div");t.classList.add("jp-RenderedText");const i=this.sanitizer,s=e.documentation||"";return(0,f.renderText)({host:t,sanitizer:i,source:s}).catch(console.error),t}itemWidthHeuristic(e){var t;return e.label.replace(/<(\/)?mark>/g,"").length+((null===(t=e.type)||void 0===t?void 0:t.length)||0)}createLoadingDocsIndicator(){const e=document.createElement("div");e.classList.add("jp-Completer-loading-bar-container");const t=document.createElement("div");return t.classList.add("jp-Completer-loading-bar"),e.append(t),e}_createWrapperNode(e){const t=document.createElement("li");return t.className=x,t.setAttribute("data-value",e),t}_createLabelNode(e){const t=document.createElement("code");return t.className="jp-Completer-match",t.innerHTML=e,t}_constructNode(e,t,i,s,n,o){if(o){const t=o.element({className:"jp-Completer-type jp-Completer-icon"});e.appendChild(t)}else if(i){const t=document.createElement("span");t.textContent=(s[0]||"").toLowerCase();const i=n.indexOf(s)%10+1;t.className="jp-Completer-type jp-Completer-monogram",t.setAttribute("data-color-index",i.toString()),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-monogram",e.appendChild(t)}if(e.appendChild(t),i){e.title=s;const t=document.createElement("code");t.className="jp-Completer-typeExtended",t.textContent=s.toLocaleLowerCase(),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-typeExtended",e.appendChild(t)}return e}}let i;e.Renderer=t,e.getDefaultRenderer=function(e){return(!i||e&&i.sanitizer!==e)&&(i=new t({sanitizer:e})),i}}(b||(b={})),function(e){e.keyCodeMap={38:"up",40:"down",33:"pageUp",34:"pageDown"},e.commonSubset=function(e){const t=e.length;let i="";if(t<2)return i;const s=e[0].length;for(let n=0;n<s;n++){const s=e[0][n];for(let o=1;o<t;o++)if(e[o][n]!==s)return i;i+=s}return i},e.nonstandardClick=function(e){return 0!==e.button||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey},e.measureSize=function(e,t){e.isConnected&&console.warn("Measuring connected elements with `measureSize` has side-effects"),e.style.visibility="hidden",e.style.display=t,document.body.appendChild(e);const i=e.getBoundingClientRect();return document.body.removeChild(e),e.removeAttribute("style"),i}}(T||(T={}));class E{constructor(e){var t,i;this._resolveFactory=(e,t)=>e.resolve?i=>e.resolve(t,this._context,i):void 0,this._fetching=0,this._inlineFetching=0,this._providers=e.providers,this._inlineProviders=null!==(t=e.inlineProviders)&&void 0!==t?t:[],this._inlineProvidersSettings=null!==(i=e.inlineProvidersSettings)&&void 0!==i?i:{},this._context=e.context,this._timeout=e.timeout}async applicableProviders(){const e=this._providers.map((e=>e.isApplicable(this._context))),t=await Promise.all(e);return this._providers.filter(((e,i)=>t[i]))}fetchInline(e,t){let i=[];const s=++this._inlineFetching;for(const o of this._inlineProviders){const r=this._inlineProvidersSettings[o.identifier];let l=0;t===n.Automatic&&(l=r.debouncerDelay);const h=()=>{const i=o.fetch(e,{...this._context,triggerKind:t}).then((e=>({...e,items:e.items.map((e=>{const t=e;return t.stream=new a.Signal(t),t.provider=o,this._stream(t,o),t}))}))),s=new Promise((e=>setTimeout((()=>e(null)),l+r.timeout)));return Promise.race([i,s])},d=0===l?h():new Promise(((e,t)=>setTimeout((()=>s!=this._inlineFetching?t(null):e(h())),l)));i.push(d.catch((e=>e)))}return i}async _stream(e,t){if(!e.isIncomplete||!t.stream||!e.token)return;const i=e.stream,s=e.token;e.token=void 0,e.streaming=!0,i.emit(u.StraemEvent.opened);for await(const n of t.stream(s)){const t=n.response,s=t.insertText.substring(e.insertText.length);e.insertText=t.insertText,e.lastStreamed=s,e.error=n.response.error,i.emit(u.StraemEvent.update)}e.isIncomplete=!1,e.lastStreamed=void 0,e.streaming=!1,i.emit(u.StraemEvent.closed)}async fetch(e,t){const i=++this._fetching;let s=[];const n=await this.applicableProviders();for(const o of n){let n;n=o.fetch(e,this._context,t).then((e=>{if(i!==this._fetching)return Promise.reject(void 0);const t=e.items.map((e=>({...e,resolve:this._resolveFactory(o,e)})));return{...e,items:t}}));const r=new Promise((e=>setTimeout((()=>e(null)),this._timeout)));n=Promise.race([n,r]),s.push(n.catch((e=>e)))}const o=Promise.all(s);return this._mergeCompletions(o)}async shouldShowContinuousHint(e,t){const i=await this.applicableProviders();return 0!==i.length&&(i[0].shouldShowContinuousHint?i[0].shouldShowContinuousHint(e,t,this._context):this._defaultShouldShowContinuousHint(e,t))}_alignPrefixes(e,t,i){if(t!=i){const t=this._context.editor;if(!t)return e;const s=t.getCursorPosition(),n=t.getLine(s.line);return n?e.map((e=>{if(e.start==i)return e;let t=n.substring(e.start,i);return{...e,items:e.items.map((e=>{let i=e.insertText||e.label;return e.insertText=i.startsWith(t)?i.slice(t.length):i,e}))}})):e}return e}async _mergeCompletions(e){let t=(await e).filter((e=>!(!e||e instanceof Error||!e.items.length)));if(0==t.length)return null;if(1==t.length)return t[0];const i=Math.min(...t.map((e=>e.end))),s=t.map((e=>e.start)),n=Math.min(...s),o=Math.max(...s);t=this._alignPrefixes(t,n,o);const r=new Set,l=new Array;for(const e of t)e.items.forEach((e=>{let t=(e.insertText||e.label).trim();r.has(t)||(r.add(t),l.push(e))}));return{start:o,end:i,items:l}}_defaultShouldShowContinuousHint(e,t){return!e&&(null==t.sourceChange||t.sourceChange.some((e=>null!=e.insert&&e.insert.length>0)))}}const M="CompletionProvider:context";class k{constructor(){this.identifier=M,this.rank=500,this.renderer=null}async isApplicable(e){return!0}fetch(e,t){const i=t.editor;return i?new Promise((e=>{e(D.contextHint(i))})):Promise.reject("No editor")}}var D;!function(e){e.contextHint=function(e){const t=e.getTokenAtCursor(),i=function(e,t){return t.getTokens().filter((t=>0===t.value.indexOf(e.value)&&t.value!==e.value))}(t,e).filter((e=>e.type)).map((e=>e.value)),s=new Set(i),n=new Array;return s.forEach((e=>n.push({label:e}))),{start:t.offset,end:t.offset+t.value.length,items:n}}}(D||(D={}));const L="CompletionProvider:kernel";class H{constructor(){this.identifier=L,this.rank=550,this.renderer=null}async isApplicable(e){var t;return!!(null===(t=e.session)||void 0===t?void 0:t.kernel)}async fetch(e,t){var i;const s=null===(i=t.session)||void 0===i?void 0:i.kernel;if(!s)throw new Error("No kernel for completion request.");const n={code:e.text,cursor_pos:e.offset},o=(await s.requestComplete(n)).content;if("ok"!==o.status)throw new Error("Completion fetch failed to return successfully.");const r=new Array,l=o.metadata._jupyter_types_experimental;return o.matches.forEach(((e,t)=>{l&&l[t]?r.push({label:e,type:l[t].type,insertText:l[t].text}):r.push({label:e})})),{start:o.cursor_start,end:o.cursor_end,items:r}}async resolve(e,t,i){const{editor:s,session:n}=t;if(n&&s){let t=s.model.sharedModel.getSource();const o=s.getCursorPosition();let l=r.Text.jsIndexToCharIndex(s.getOffsetAt(o),t);const a=n.kernel;if(!t||!a)return Promise.resolve(e);if(i){const{start:e,value:s}=i;t=t.substring(0,e)+s,l+=s.length}const h={code:t,cursor_pos:l,detail_level:0},d=(await a.requestInspect(h)).content;return"ok"===d.status&&d.found?(e.documentation=d.data["text/plain"],e):e}return e}shouldShowContinuousHint(e,t){const i=t.sourceChange;return null==i||!i.some((e=>null!=e.delete))&&i.some((t=>null!=t.insert&&("."===t.insert||!e&&t.insert.trim().length>0)))}}var A=i(63720),q=i(89843);const O="jp-GhostText-streamingIndicator",R="jp-GhostText-errorIndicator";class W{constructor(e){this.options=e}placeGhost(e,t){const i=[F.addMark.of(t)];e.state.field(F.markField,!1)||(i.push(q.StateEffect.appendConfig.of([F.markField])),i.push(q.StateEffect.appendConfig.of([A.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[F.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[F.removeMark.of(null)];e.dispatch({effects:t})}}W.streamingAnimation="uncover";class j extends A.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1,this._clearErrorTimeout=null}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming&&e.options.error===this.options.error}get lineBreaks(){return(this.content.match(/\n/g)||"").length}updateDOM(e,t){return this._updateDOM(e),!0}get content(){return this.options.content}toDOM(){let e=document.createElement("span");return this.options.onPointerOver&&e.addEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.addEventListener("pointerleave",this.options.onPointerLeave),e.classList.add("jp-GhostText"),e.dataset.animation=W.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_removeErrorAnimation(e){e.querySelectorAll(`.${R}`).forEach((e=>{e.remove()}))}_mountErrorAnimation(e){const t=document.createElement("span");t.className=R;const i=this.options.error;(null==i?void 0:i.message)&&(t.title=null==i?void 0:i.message),e.querySelectorAll(`.${O}, .${R}`).forEach((e=>{e.remove()})),e.appendChild(t)}_updateDOM(e){if(this.options.error)return this._mountErrorAnimation(e),void(this._clearErrorTimeout=setTimeout((()=>{this._removeErrorAnimation(e),this._clearErrorTimeout=null}),5e3));null!==this._clearErrorTimeout&&(clearTimeout(this._clearErrorTimeout),this._removeErrorAnimation(e),this._clearErrorTimeout=null);const t=this.content;if(this.isSpacer)return void(e.innerText=t);let i=this.options.addedPart;if(i){i.startsWith("\n")&&(i=i.substring(1)),e.innerText=t.substring(0,t.length-i.length);const s=document.createElement("span");s.className="jp-GhostText-streamedToken",s.innerText=i,e.appendChild(s)}else e.innerText=t;if(this.options.streaming){const t=document.createElement("span");t.className=O,e.appendChild(t)}}destroy(e){this.options.onPointerOver&&e.removeEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.removeEventListener("pointerleave",this.options.onPointerLeave),super.destroy(e)}}class N extends j{constructor(){super(...arguments),this.isSpacer=!0}}class z extends N{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e}}class B extends N{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}var F;!function(e){let t;function i(e,t){return A.Decoration.widget({widget:new j(e),side:1,ghostSpec:e}).range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))}!function(e){e[e.Set=0]="Set",e[e.Remove=1]="Remove",e[e.FilterAndUpdate=2]="FilterAndUpdate"}(t||(t={})),e.addMark=q.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=q.StateEffect.define(),e.markField=q.StateField.define({create:()=>A.Decoration.none,update(s,n){const o=function(i){for(let s of i.effects){if(s.is(e.addMark))return{action:t.Set,spec:s.value};if(s.is(e.removeMark))return{action:t.Remove}}return i.docChanged||i.selection?{action:t.FilterAndUpdate}:null}(n);if(s=s.update({filter:(e,t,i)=>!(i.spec.widget instanceof N&&i.spec.timeoutInfo.elapsed)}),!o)return s.map(n.changes);switch(o.action){case t.Set:{const e=i(o.spec,n);return s.update({add:[e],filter:(t,i,s)=>s===e.value})}case t.Remove:return s.update({filter:()=>!1});case t.FilterAndUpdate:{let e=s.iter();for(;e.value&&e.value.spec.widget instanceof N;)e.next();if(!e.value)return s.map(n.changes);const t=e.value.spec.ghostSpec,o={...t};let r=!1;n.changes.iterChanges(((e,t,i,s,n)=>{if(!r)if(e===t&&i!==s)for(let e=0;e<n.lines;e++){const t=n.lineAt(e).text,i=e>0?"\n"+t:t;if(!o.content.startsWith(i)){r=!0;break}o.content=o.content.slice(i.length),o.from+=i.length}else r=!0}));const l=r?function(e,t,i=1e3){if(e.content.length<2)return[];const s={elapsed:!1};setTimeout((()=>{s.elapsed=!0}),i);const n=A.Decoration.widget({widget:new B(e),side:1,timeoutInfo:s}),o=A.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s});return[n.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length)),o.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))]}(t,n):[i(o,n)],a=l.map((e=>e.value));if(s=s.update({add:l,filter:(e,t,i)=>a.includes(i)}),r)try{s=s.map(n.changes)}catch(e){return console.warn(e),A.Decoration.none}return s}}},provide:e=>A.EditorView.decorations.from(e)})}(F||(F={}));const V="jp-mod-inline-completer-active",G="jp-InlineCompleter-hover";class U extends w.Widget{constructor(e){var t,i;super({node:document.createElement("div")}),this._clearHoverTimeout=null,this._current=0,this._editor=null,this._lastItem=null,this._model=null,this._providerWidget=new w.Widget,this._showShortcuts=U.defaultSettings.showShortcuts,this._showWidget=U.defaultSettings.showWidget,this._suggestionsCounter=new w.Widget,this._toolbar=new C.Toolbar,this.model=null!==(t=e.model)&&void 0!==t?t:null,this.editor=null!==(i=e.editor)&&void 0!==i?i:null,this.addClass("jp-InlineCompleter"),this._ghostManager=new W({onBlur:this._onEditorBlur.bind(this)}),this._trans=e.trans;const s=this.layout=new w.PanelLayout;s.addWidget(this._suggestionsCounter),s.addWidget(this.toolbar),s.addWidget(this._providerWidget),this._progressBar=document.createElement("div"),this._progressBar.className="jp-InlineCompleter-progressBar",this.node.appendChild(this._progressBar),this._updateShortcutsVisibility(),this._updateDisplay(),this.node.tabIndex=0}get toolbar(){return this._toolbar}get editor(){return this._editor}set editor(e){var t;null===(t=this.model)||void 0===t||t.reset(),this._editor=e}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged,this),this._model.provisionProgress.disconnect(this._onProvisionProgress,this)),this._model=e,this._model&&(this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.connect(this._onModelFilterTextChanged,this),this._model.provisionProgress.connect(this._onProvisionProgress,this)))}cycle(e){var t,i;const s=null===(i=null===(t=this.model)||void 0===t?void 0:t.completions)||void 0===i?void 0:i.items;if(s){if("next"===e){const e=this._current+1;this._current=e===s.length?0:e}else{const e=this._current-1;this._current=-1===e?s.length-1:e}this._updateStreamTracking(),this._render()}}accept(){const e=this.model,t=this.current,i=this._editor;if(!i||!e||!t)return;const s=e.cursor,n=t.insertText,o=i.getOffsetAt(i.getCursorPosition()),r=i.getOffsetAt(s),l=r,a=o;i.model.sharedModel.updateSource(r,o,n),o<=a&&o>=l&&i.setCursorPosition(i.getPositionAt(l+n.length)),e.reset(),this.update()}get current(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.completions;return t?t.items[this._current]:null}_updateStreamTracking(){this._lastItem&&this._lastItem.stream.disconnect(this._onStream,this);const e=this.current;e&&e.stream.connect(this._onStream,this),this._lastItem=e}_onStream(e,t){var i;const s=null===(i=this.model)||void 0===i?void 0:i.completions;if(!s||!s.items||0===s.items.length)return;if(this.isHidden)return;const n=s.items[this._current];this._setText(n)}configure(e){this._showWidget=e.showWidget,this._updateDisplay(),e.showShortcuts!==this._showShortcuts&&(this._showShortcuts=e.showShortcuts,this._updateShortcutsVisibility()),W.streamingAnimation=e.streamingAnimation}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}onUpdateRequest(e){super.onUpdateRequest(e);const t=this._model;if(!t)return;let i=t.completions;i&&i.items&&0!==i.items.length?this.isHidden&&(this.show(),this._setGeometry()):this.isHidden||this.hide()}onAfterAttach(e){document.addEventListener("scroll",this,!0),document.addEventListener("pointerdown",this,!0)}onBeforeDetach(e){document.removeEventListener("scroll",this,!0),document.removeEventListener("pointerdown",this,!0)}_evtPointerdown(e){var t;if(this.isHidden||!this._editor)return;const i=e.target;if(this.node.contains(i))return!0;this.hide(),null===(t=this.model)||void 0===t||t.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_onEditorBlur(e){var t;if(this.node.contains(e.relatedTarget))return!1;null===(t=this._editor)||void 0===t||t.host.classList.remove(V),this.hide()}_onModelSuggestionsChanged(e,t){var i;if(this.isAttached){if("set"===t.event)this._current=null!==(i=t.indexMap.get(this._current))&&void 0!==i?i:0;else if("clear"===t.event){const e=this.editor;e&&(this._ghostManager.clearGhosts(e.editor),e.host.classList.remove(V))}this._updateStreamTracking(),this.update(),this._render()}else this.update()}_onModelFilterTextChanged(e,t){var i,s;const n=null===(i=this.model)||void 0===i?void 0:i.completions;n&&n.items&&0!==n.items.length&&(this._current=null!==(s=t.get(this._current))&&void 0!==s?s:0,this._updateStreamTracking(),setTimeout((()=>{this._render(),this._setGeometry()}),0))}_onProvisionProgress(e,t){requestAnimationFrame((()=>{0===t.pendingProviders?this._progressBar.style.display="none":(this._progressBar.style.display="",this._progressBar.style.width=100*t.pendingProviders/t.totalProviders+"%")}))}_render(){var e,t;const i=null===(e=this.model)||void 0===e?void 0:e.completions;if(!i||!i.items||0===i.items.length)return;const s=i.items[this._current];this._setText(s),"never"!==this._showWidget&&(this._suggestionsCounter.node.innerText=this._trans.__("%1/%2",this._current+1,i.items.length),this._providerWidget.node.title=this._trans.__("Provider: %1",s.provider.name),(null!==(t=s.provider.icon)&&void 0!==t?t:C.kernelIcon).render(this._providerWidget.node))}_setText(e){const t=e.insertText,i=this._editor,s=this._model;if(!s||!i)return;const n=i.editor;this._ghostManager.placeGhost(n,{from:i.getOffsetAt(s.cursor),content:t,providerId:e.provider.identifier,addedPart:e.lastStreamed,streaming:e.streaming,onPointerOver:this._onPointerOverGhost.bind(this),onPointerLeave:this._onPointerLeaveGhost.bind(this),error:e.error}),i.host.classList.add(V)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(G)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(G)),500)}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!i||!t||!t.cursor)return;const s=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host;let n;try{const e=i.getCoordinateForPosition(t.cursor);if(!e)throw Error("No coordinates for cursor position");n=e}catch(e){return void this.hide()}C.HoverBox.setGeometry({anchor:n,host:s,maxHeight:40,minHeight:20,node:e,privilege:"forceAbove",outOfViewDisplay:{top:"stick-outside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}})}_updateShortcutsVisibility(){this.node.dataset.showShortcuts=this._showShortcuts+""}_updateDisplay(){this.node.dataset.display=this._showWidget}}!function(e){e.defaultSettings={showWidget:"onHover",showShortcuts:!0,streamingAnimation:"uncover",providers:{}},e.Model=class{constructor(){this.suggestionsChanged=new a.Signal(this),this.filterTextChanged=new a.Signal(this),this.provisionProgress=new a.Signal(this),this._isDisposed=!1,this._completions=null}setCompletions(e){var t,i;const s=new Map(null===(i=null===(t=this._completions)||void 0===t?void 0:t.items)||void 0===i?void 0:i.map(((e,t)=>[e.insertText,t])));this._completions=e;const n=new Map(e.items.map(((e,t)=>[s.get(e.insertText),t])));this.suggestionsChanged.emit({event:"set",indexMap:n})}appendCompletions(e){this._completions&&this._completions.items?(this._completions.items.push(...e.items),this.suggestionsChanged.emit({event:"append"})):console.warn("No completions to append to")}notifyProgress(e){this.provisionProgress.emit(e)}get cursor(){return this._cursor}set cursor(e){this._cursor=e}get completions(){return this._completions}reset(){this._completions=null,this.suggestionsChanged.emit({event:"clear"})}get isDisposed(){return this._isDisposed}handleTextChange(e){var t;const i=this._completions;if(!i||!i.items||0===i.items.length)return;const s=new Map(i.items.map(((e,t)=>[e,t])));for(let s of null!==(t=e.sourceChange)&&void 0!==t?t:[]){const e=s.insert;if(e){const t=i.items.filter((t=>{var i;const s=null!==(i=t.filterText)&&void 0!==i?i:t.insertText;return!!s.startsWith(e)&&(t.filterText=s.substring(e.length),t.insertText=t.insertText.substring(e.length),!0)}));0===t.length&&(this._completions=null),i.items=t}else s.retain||(this._completions=null)}const n=new Map(i.items.map(((e,t)=>[s.get(e),t])));this.filterTextChanged.emit(n)}handleSelectionChange(e){const t=this.cursor;if(!t)return;const{start:i,end:s}=e;i.column===s.column&&i.line===s.line||this.reset(),(i.line!==t.line||i.column<t.column)&&this.reset()}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}}}(U||(U={}));class ${constructor(){this._activeProviders=new Set([L,M]),this._inlineCompleterSettings=U.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._selected=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(e){this._timeout=e}setShowDocumentationPanel(e){this._panelHandlers.forEach((t=>t.completer.showDocsPanel=e)),this._showDoc=e}setContinuousHinting(e){this._panelHandlers.forEach((t=>t.autoCompletion=e)),this._autoCompletion=e}registerProvider(e){const t=e.identifier;this._providers.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._providers.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}registerInlineProvider(e){const t=e.identifier;this._inlineProviders.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._inlineProviders.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}getProviders(){return this._providers}activateProvider(e){this._activeProviders=new Set([]),e.forEach((e=>{this._providers.has(e)&&this._activeProviders.add(e)})),0===this._activeProviders.size&&(this._activeProviders.add(L),this._activeProviders.add(M)),this._activeProvidersChanged.emit()}async updateCompleter(e){var t,i;const{widget:s,editor:n,sanitizer:o}=e,r=s.id,l=this._panelHandlers.get(r),a=[...this._activeProviders][0],h=this._providers.get(a);let d=null!==(t=null==h?void 0:h.renderer)&&void 0!==t?t:b.getDefaultRenderer(o);const c=null==h?void 0:h.modelFactory;let u;u=c?await c.call(h,e):new _,this._mostRecentContext.set(s.id,e);const m={model:u,editor:n,renderer:d,sanitizer:o,showDoc:this._showDoc};if(l){const t=l.completer;null===(i=t.model)||void 0===i||i.dispose(),t.model=m.model,t.renderer=m.renderer,t.showDocsPanel=m.showDoc,l.autoCompletion=this._autoCompletion,n&&(l.editor=n,l.reconciliator=await this.generateReconciliator(e))}else{const t=await this._generateHandler(e,m);this._panelHandlers.set(s.id,t),t.completer.selected.connect(((e,t)=>this._selected.emit({insertText:t}))),s.disposed.connect((e=>{this.disposeHandler(e.id,t),this._mostRecentContext.delete(r)}))}}invoke(e){const t=this._panelHandlers.get(e);t&&t.invoke()}select(e){const t=this._panelHandlers.get(e);t&&t.completer.selectActive()}setInlineCompleterFactory(e){this._inlineCompleterFactory=e,this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})),this.inline||(this.inline={invoke:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.invokeInline()},cycle:(e,t)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(t)},accept:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e;for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);this._panelHandlers.forEach(((t,i)=>{t.inlineCompleter&&t.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))}))}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(e){const t=[];for(const[e,i]of Object.entries(this._inlineCompleterSettings.providers))!0===i.enabled&&t.push(e);const i=[...this._inlineProviders.values()].filter((e=>t.includes(e.identifier))),s=[];for(const e of this._activeProviders){const t=this._providers.get(e);t&&s.push(t)}return new E({context:e,providers:s,inlineProviders:i,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(e,t){var i,s,n,o;null===(i=t.completer.model)||void 0===i||i.dispose(),t.completer.dispose(),null===(n=null===(s=t.inlineCompleter)||void 0===s?void 0:s.model)||void 0===n||n.dispose(),null===(o=t.inlineCompleter)||void 0===o||o.dispose(),t.dispose(),this._panelHandlers.delete(e)}async _generateHandler(e,t){const i=new b(t),s=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...t,model:new U.Model}):void 0;i.hide(),w.Widget.attach(i,document.body),s&&(w.Widget.attach(s,document.body),s.hide(),s.configure(this._inlineCompleterSettings));const n=await this.generateReconciliator(e),o=new u({completer:i,inlineCompleter:s,reconciliator:n});return o.editor=e.editor,o}}const K=new C.LabIcon({name:"completer:inline",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n <path class="jp-icon4" fill="#bbbbbb" d="M17 15H3v2h14v-2Zm0-8h-6v2h6V7ZM3 13h18v-2H3v2Zm0 8h18v-2H3v2Z"/>\n <path class="jp-icon1" fill="#616161" d="M3 3v2h18V3H3ZM3 7v2h8V7H3Z"/>\n</svg>\n'}),Z=new C.LabIcon({name:"completer:widget",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n<g fill="#616161" class="jp-icon2 jp-icon-selectable">\n <path d="M6 8h16v14.3H6z" style="fill:#eee;stroke:#444;stroke-linejoin:round"/>\n <path d="M3 3v2h10V3H3Z" transform="matrix(.8 0 0 1 .5 0)"/>\n</g>\n<g class="jp-icon3 jp-icon-selectable">\n <path fill="#616161" d="M18 14.1H8v2h11v-2ZM8 12.1H20V10.1H8v2Zm0 8H20v-2H8v3Z"/>\n</g>\n</svg>\n'});var J=i(25291);class Q{constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||J.nullTranslator;this._trans=t.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return C.historyIcon}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(e){var t;this._maxSuggestions=null!==(t=e.maxSuggestions)&&void 0!==t?t:100}async fetch(e,t,i){var s;const n=null===(s=t.session)||void 0===s?void 0:s.kernel;if(!n)throw new Error("No kernel for completion request.");const o=e.text.slice(0,e.offset).split("\n").slice(-1)[0],r={output:!1,raw:!0,hist_access_type:"search",pattern:o+"*",unique:!0,n:this._maxSuggestions},l=await n.requestHistory(r),a=[];if(""===o)return{items:[]};if("ok"===l.content.status)for(const e of l.content.history){const t=e[2].split("\n");for(let e=0;e<t.length;e++){const i=t[e];if(i.startsWith(o)){const s=i.slice(o.length,i.length)+"\n"+t.slice(e+1).join("\n");a.push({insertText:s})}}}return{items:a}}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2944],{62944:(e,t,i)=>{i.r(t),i.d(t,{CONTEXT_PROVIDER_ID:()=>M,Completer:()=>T,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>$,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>L,HistoryInlineCompletionProvider:()=>Q,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>U,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>D,KernelCompleterProvider:()=>A,ProviderReconciliator:()=>E,completerWidgetIcon:()=>Z,inlineCompleterIcon:()=>K});var s,n,o=i(71386),r=i(77075),l=i(62633),a=i(2159),h=i(21961);!function(e){e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions"}(s||(s={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(n||(n={}));const d=new h.Token("@jupyterlab/completer:IInlineCompleterFactory","A factory of inline completer widgets."),c=new h.Token("@jupyterlab/completer:ICompletionProviderManager","A service for the completion providers management.");class u{constructor(e){this._fetchingInline=0,this._editor=null,this._enabled=!1,this._isDisposed=!1,this._autoCompletion=!1,this._continuousInline=!0,this._tabCompleterActive=!1,this.completer=e.completer,this.inlineCompleter=e.inlineCompleter,this.completer.selected.connect(this.onCompletionSelected,this),this.completer.visibilityChanged.connect(this.onVisibilityChanged,this),this._reconciliator=e.reconciliator}set reconciliator(e){this._reconciliator=e}get editor(){return this._editor}set editor(e){if(e===this._editor)return;let t=this._editor;if(t&&!t.isDisposed){const e=t.model;t.host.classList.remove(o.COMPLETER_ENABLED_CLASS),t.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),e.selections.changed.disconnect(this.onSelectionsChanged,this),e.sharedModel.changed.disconnect(this._onSharedModelChanged,this)}if(this.completer.reset(),this.completer.editor=e,t=this._editor=e,t){const e=t.model;this._enabled=!1,e.selections.changed.connect(this.onSelectionsChanged,this),e.sharedModel.changed.connect(this._onSharedModelChanged,this),this.onSelectionsChanged(),this.inlineCompleter&&(this.inlineCompleter.editor=t)}}get isDisposed(){return this._isDisposed}set autoCompletion(e){this._autoCompletion=e}get autoCompletion(){return this._autoCompletion}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}invokeInline(){const e=this._editor;e&&this._makeInlineRequest(e.getCursorPosition(),n.Invoke).catch((e=>{console.warn("Inline invoke request bailed",e)}))}invoke(){l.MessageLoop.sendMessage(this,u.Msg.InvokeRequest)}processMessage(e){e.type===u.Msg.InvokeRequest.type&&this.onInvokeRequest(e)}getState(e,t){return{text:e.model.sharedModel.getSource(),line:t.line,column:t.column}}onCompletionSelected(e,t){const i=e.model,s=this._editor;if(!s||!i)return;const n=i.createPatch(t);if(!n)return;const{start:o,end:r,value:l}=n,a=s.getOffsetAt(s.getCursorPosition());s.model.sharedModel.updateSource(o,r,l),a<=r&&a>=o&&s.setCursorPosition(s.getPositionAt(o+l.length))}onInvokeRequest(e){if(!this.completer.model)return;if(this.completer.model.original)return;const t=this._editor;t&&this._makeRequest(t.getCursorPosition(),s.Invoked).catch((e=>{console.warn("Invoke request bailed",e)}))}onSelectionsChanged(){var e;const t=this.completer.model,i=this._editor;if(!i)return;const s=null===(e=this.inlineCompleter)||void 0===e?void 0:e.model;s&&s.handleSelectionChange(i.getSelection());const n=i.host;if(!t)return this._enabled=!1,void n.classList.remove(o.COMPLETER_ENABLED_CLASS);if(t.subsetMatch)return;const r=i.getCursorPosition(),l=i.getLine(r.line);if(!l)return this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS);const{start:a,end:h}=i.getSelection();return a.column!==h.column||a.line!==h.line||l.slice(0,r.column).match(/^\s*$/)?(this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS)):(this._enabled||(this._enabled=!0,n.classList.add(o.COMPLETER_ENABLED_CLASS)),void t.handleCursorChange(this.getState(i,i.getCursorPosition())))}async onTextChanged(e,t){var i;if(!this._enabled)return;const o=this.completer.model,r=this.editor;if(!r)return;o&&this._autoCompletion&&this._reconciliator.shouldShowContinuousHint&&await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible,t)&&this._makeRequest(r.getCursorPosition(),s.TriggerCharacter);const l=null===(i=this.inlineCompleter)||void 0===i?void 0:i.model;if(l&&(l.handleTextChange(t),this._continuousInline&&this._makeInlineRequest(r.getCursorPosition(),n.Automatic)),o){const{start:e,end:t}=r.getSelection();if(e.column!==t.column||e.line!==t.line)return;o.handleTextChange(this.getState(r,r.getCursorPosition()))}}onVisibilityChanged(e){var t;if(e.isDisposed||e.isHidden)return this._tabCompleterActive=!1,void(this._editor&&(this._editor.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),this._editor.focus()));this._tabCompleterActive=!0,null===(t=this._editor)||void 0===t||t.host.classList.add(o.COMPLETER_ACTIVE_CLASS)}async _onSharedModelChanged(e,t){t.sourceChange&&await this.onTextChanged(e,t)}_makeRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));const s=this._composeRequest(i,e),n=this.getState(i,e);return this._reconciliator.fetch(s,t).then((e=>{var t;if(!e)return;const i=this._updateModel(n,e.start,e.end);i&&(this.completer.suppressIfInlineCompleterActive&&(null===(t=this.inlineCompleter)||void 0===t?void 0:t.isActive)||i.setCompletionItems&&i.setCompletionItems(e.items))})).catch((e=>{}))}async _makeInlineRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));if(!this.inlineCompleter)return Promise.reject(new Error("No inline completer"));const s=i.getLine(e.line);if(t===n.Automatic&&(void 0===s||e.column<s.length))return;const o=this._composeRequest(i,e),r=this.inlineCompleter.model;if(!r)return;r.cursor=e;const l=++this._fetchingInline,a=this._reconciliator.fetchInline(o,t);let h=!1;const d=new Set;for(const e of a)e.then((t=>{var i;if(!h&&t&&t.items&&l===this._fetchingInline)if(d.add(e),1===d.size){if((null===(i=this.inlineCompleter)||void 0===i?void 0:i.suppressIfTabCompleterActive)&&this._tabCompleterActive)return void(h=!0);r.setCompletions(t)}else r.appendCompletions(t)})).catch((e=>{console.warn(e)})).finally((()=>{d.add(e);const t=a.length-d.size;r.notifyProgress({pendingProviders:t,totalProviders:a.length})}))}_composeRequest(e,t){const i=e.model.sharedModel.getSource(),s=e.model.mimeType;return{text:i,offset:r.Text.jsIndexToCharIndex(e.getOffsetAt(t),i),mimeType:s}}_updateModel(e,t,i){const s=this.completer.model,n=e.text;return s?(s.original=e,s.cursor={start:r.Text.charIndexToJsIndex(t,n),end:r.Text.charIndexToJsIndex(i,n)},s):null}}!function(e){let t,i;!function(e){e[e.opened=0]="opened",e[e.update=1]="update",e[e.closed=2]="closed"}(t=e.StraemEvent||(e.StraemEvent={})),function(e){e.InvokeRequest=new l.Message("invoke-request")}(i=e.Msg||(e.Msg={}))}(u||(u={}));var m,p=i(14931);function g(e){const t=document.createElement("span");return t.textContent=e,t.innerHTML}class _{constructor(){this.processedItemsCache=null,this._current=null,this._cursor=null,this._isDisposed=!1,this._completionItems=[],this._original=null,this._query="",this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],this._stateChanged=new a.Signal(this),this._queryChanged=new a.Signal(this),this._processedToOriginalItem=null,this._resolvingItem=0}get stateChanged(){return this._stateChanged}get queryChanged(){return this._queryChanged}get original(){return this._original}set original(e){this._original===e||this._original&&e&&h.JSONExt.deepEqual(e,this._original)||(this._reset(),this._current=this._original=e,this._stateChanged.emit(void 0))}get current(){return this._current}set current(e){if(this._current===e||this._current&&e&&h.JSONExt.deepEqual(e,this._current))return;const t=this._original;if(!t)return;const i=this._cursor;if(!i)return;const s=this._current=e;if(!s)return void this._stateChanged.emit(void 0);const n=t.text.split("\n")[t.line],o=s.text.split("\n")[s.line];if(!this._subsetMatch&&o.length<n.length)return void this.reset(!0);const{start:r,end:l}=i;let a=s.text.substring(r);const d=t.text.substring(l);a=a.substring(0,a.lastIndexOf(d)),this._query=a,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"editorUpdate"}),this._stateChanged.emit(void 0)}get cursor(){return this._cursor}set cursor(e){this.original&&(this._cursor=e)}get query(){return this._query}set query(e){this._query=e,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"setter"})}get subsetMatch(){return this._subsetMatch}set subsetMatch(e){this._subsetMatch=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}completionItems(){if(!this.processedItemsCache){let e=this._query;if(e){const t=this._markup(e);this.processedItemsCache=t.map((e=>e.processedItem)),this._processedToOriginalItem=new WeakMap(t.map((e=>[e.processedItem,e.originalItem])))}else this.processedItemsCache=this._completionItems.map((e=>this._escapeItemLabel(e))),this._processedToOriginalItem=null}return this.processedItemsCache}setCompletionItems(e){h.JSONExt.deepEqual(e,this._completionItems)||(this._completionItems=e,this._orderedTypes=m.findOrderedCompletionItemTypes(this._completionItems),this.processedItemsCache=null,this._processedToOriginalItem=null,this._stateChanged.emit(void 0))}typeMap(){return this._typeMap}orderedTypes(){return this._orderedTypes}handleCursorChange(e){if(!this._original)return;const{column:t,line:i}=e,{current:s,original:n}=this;if(!n)return;if(i!==n.line)return void this.reset(!0);if(t<n.column)return void this.reset(!0);const{cursor:o}=this;if(!o||!s)return;const r=o.end-o.start,l=n.text.split("\n")[n.line],a=s.text.split("\n")[s.line].length-l.length;t>n.column+r+a&&this.reset(!0)}handleTextChange(e){const t=this._original;if(!t)return;const{text:i,column:s,line:n}=e,o=i.split("\n")[n][s-1];o&&o.match(/\S/)||e.column>=t.column?this.current=e:this.reset(!1)}createPatch(e){const t=this._original,i=this._cursor,s=this._current;if(!t||!i||!s)return;let{start:n,end:o}=i;return o+=s.text.length-t.text.length,{start:n,end:o,value:e}}reset(e=!1){!e&&this._subsetMatch||(this._reset(),this._stateChanged.emit(void 0))}_markup(e){var t;const i=this._completionItems;let s=[];for(const n of i){const i=n.label.indexOf("("),o=i>-1?n.label.substring(0,i):n.label,r=p.StringExt.matchSumOfSquares(g(o),e);if(r){let e=p.StringExt.highlight(g(n.label),r.indices,m.mark);const i=Object.assign({},n);i.label=e.join(""),i.insertText=null!==(t=n.insertText)&&void 0!==t?t:n.label,s.push({item:i,score:r.score,originalItem:n})}}return s.sort(m.scoreCmp),s.map((e=>({processedItem:e.item,originalItem:e.originalItem})))}resolveItem(e){let t,i;if("number"==typeof e){const i=this.completionItems();if(!i||!i[e])return;t=i[e]}else t=e;if(t)return i=this._processedToOriginalItem?this._processedToOriginalItem.get(t):t,i?this._resolveItemByValue(i):void 0}_resolveItemByValue(e){const t=++this._resolvingItem;let i;if(e.resolve){let t;e.insertText&&(t=this.createPatch(e.insertText)),i=e.resolve(t)}else i=Promise.resolve(e);return i.then((i=>(this._escapeItemLabel(i,!0),Object.keys(i).forEach((t=>{e[t]=i[t]})),e.resolve=void 0,t!==this._resolvingItem?Promise.resolve(null):i))).catch((t=>(console.error(t),Promise.resolve(e))))}_escapeItemLabel(e,t=!1){var i;const s=g(e.label);if(s!==e.label){const n=t?e:Object.assign({},e);return n.insertText=null!==(i=e.insertText)&&void 0!==i?i:e.label,n.label=s,n}return e}_reset(){const e=this._query;this._current=null,this._cursor=null,this._completionItems=[],this._original=null,this._query="",this.processedItemsCache=null,this._processedToOriginalItem=null,this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],e&&this._queryChanged.emit({newValue:this._query,origin:"reset"})}}!function(e){const t=["function","instance","class","module","keyword"],i=t.reduce(((e,t)=>(e[t]=null,e)),{});e.mark=function(e){return`<mark>${e}</mark>`},e.scoreCmp=function(e,t){var i,s,n;const o=e.score-t.score;return 0!==o?o:null!==(n=null===(i=e.item.insertText)||void 0===i?void 0:i.localeCompare(null!==(s=t.item.insertText)&&void 0!==s?s:""))&&void 0!==n?n:0},e.findOrderedCompletionItemTypes=function(e){const i=new Set;e.forEach((e=>{!e.type||t.includes(e.type)||i.has(e.type)||i.add(e.type)}));const s=Array.from(i);return s.sort(((e,t)=>e.localeCompare(t))),t.concat(s)},e.findOrderedTypes=function(e){const s=Object.keys(e).map((t=>e[t])).filter((e=>!!e&&!(e in i))).sort(((e,t)=>e.localeCompare(t)));return t.concat(s)}}(m||(m={}));var v=i(20911),f=i(95704),C=i(7258),y=i(47392),x=i(2260);const w="jp-Completer-item",I="jp-mod-active",P="jp-Completer-list",S=!0;class T extends x.Widget{constructor(e){var t,i,s,n;super({node:document.createElement("div")}),this._activeIndex=0,this._editor=null,this._model=null,this._selected=new a.Signal(this),this._visibilityChanged=new a.Signal(this),this._indexChanged=new a.Signal(this),this._lastSubsetMatch="",this._geometryLock=!1,this._geometryCounter=0,this._docPanelExpanded=!1,this._renderCounter=0,this.sanitizer=null!==(t=e.sanitizer)&&void 0!==t?t:new v.Sanitizer,this._defaultRenderer=T.getDefaultRenderer(this.sanitizer),this._renderer=null!==(i=e.renderer)&&void 0!==i?i:this._defaultRenderer,this._docPanel=this._createDocPanelNode(),this.model=null!==(s=e.model)&&void 0!==s?s:null,this.editor=null!==(n=e.editor)&&void 0!==n?n:null,this.addClass("jp-Completer"),this.addClass("jp-ThemedContainer"),this._updateConstraints()}_updateConstraints(){const e=document.createElement("div");e.classList.add(P),e.style.visibility="hidden",e.style.overflowY="scroll",document.body.appendChild(e);const t=window.getComputedStyle(e);this._maxHeight=parseInt(t.maxHeight,10),this._minHeight=parseInt(t.minHeight,10),this._scrollbarWidth=e.offsetWidth-e.clientWidth,document.body.removeChild(e);const i=this._createDocPanelNode();this._docPanelWidth=b.measureSize(i,"inline-block").width}get activeIndex(){return this._activeIndex}get editor(){return this._editor}set editor(e){this._editor=e}get selected(){return this._selected}get visibilityChanged(){return this._visibilityChanged}get indexChanged(){return this._indexChanged}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.stateChanged.disconnect(this.onModelStateChanged,this),this._model.queryChanged.disconnect(this.onModelQueryChanged,this)),this._model=e,this._model&&(this._model.stateChanged.connect(this.onModelStateChanged,this),this._model.queryChanged.connect(this.onModelQueryChanged,this)))}get renderer(){return this._renderer}set renderer(e){this._renderer=e}set showDocsPanel(e){this._showDoc=e}get showDocsPanel(){return this._showDoc}dispose(){this._sizeCache=void 0,this._model=null,super.dispose()}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"keydown":this._evtKeydown(e);break;case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}reset(){this._activeIndex=0,this._lastSubsetMatch="",this._model&&this._model.reset(!0),this._docPanel.style.display="none",this._sizeCache=void 0,this.node.scrollTop=0}selectActive(){const e=this.node.querySelector(`.${I}`);e?(this._selected.emit(e.getAttribute("data-value")),this.reset()):this.reset()}onAfterAttach(e){document.addEventListener("keydown",this,S),document.addEventListener("pointerdown",this,S),document.addEventListener("scroll",this,S)}onBeforeDetach(e){document.removeEventListener("keydown",this,S),document.removeEventListener("pointerdown",this,S),document.removeEventListener("scroll",this,S)}onModelStateChanged(){this.isAttached&&(this._activeIndex=0,this._indexChanged.emit(this._activeIndex),this.update())}onModelQueryChanged(e,t){if(this._sizeCache&&"editorUpdate"===t.origin){const t=e.completionItems(),i=this._sizeCache.items,s=i[this._findWidestItemIndex(i)],n=t[this._findWidestItemIndex(t)],o=this._getPreferredItemWidthHeuristic();t.length===this._sizeCache.items.length&&o(s)===o(n)||(this._sizeCache=void 0)}}onUpdateRequest(e){var t;const i=this._model;if(!i)return;i.query||this._populateSubset();let s=i.completionItems();if(!s.length)return void(this.isHidden||(this.reset(),this.hide(),this._visibilityChanged.emit(void 0)));this._updateConstraints(),this._geometryLock=!0;const n=this._createCompleterNode(i,s);let o=n.querySelectorAll(`.${w}`)[this._activeIndex];o.classList.add(I);const r=null===(t=this.model)||void 0===t?void 0:t.resolveItem(s[this._activeIndex]);this._showDoc&&(this._docPanel.innerText="",n.appendChild(this._docPanel),this._docPanelExpanded=!1,this._docPanel.style.display="none",this._updateDocPanel(r,o)),this.isHidden?(this.show(),this._setGeometry(),this._visibilityChanged.emit(void 0)):this._setGeometry(),this._geometryLock=!1}get sizeCache(){if(this._sizeCache)return{width:this._sizeCache.width+this._sizeCache.docPanelWidth,height:Math.max(this._sizeCache.height,this._sizeCache.docPanelHeight)}}_createDocPanelNode(){const e=document.createElement("div");return e.className="jp-Completer-docpanel",e}_createCompleterNode(e,t){const i=++this._renderCounter;let s=this.node;s.textContent="";let n=e.orderedTypes(),o=document.createElement("ul");o.className=P;const r=this._renderer.createCompletionItemNode(t[0],n),l=[r],a=b.measureSize(r,"inline-grid"),h=Math.max(Math.ceil(this._maxHeight/a.height),5),d=Math.min(h+1,t.length),c=performance.now();for(let e=1;e<d;e++){const i=this._renderer.createCompletionItemNode(t[e],n);l.push(i)}for(const e of l)o.appendChild(e);const u=this._findWidestItemIndex(t),m=u<l.length?l[u]:this._renderer.createCompletionItemNode(t[u],n),p=b.measureSize(m.cloneNode(!0),"inline-grid");if(this._sizeCache={height:Math.min(this._maxHeight,a.height*t.length),width:p.width+this._scrollbarWidth,items:t,docPanelWidth:0,docPanelHeight:0},d<t.length){const e=(performance.now()-c)/d,s=Math.max(5,Math.floor(12/e));let r=d,h=l[l.length-1];const u=()=>{if(r>=t.length)return;const e=a.height*(t.length-r);h.style.marginBottom=`${e}px`,requestAnimationFrame((()=>{if(i!=this._renderCounter)return;h.style.marginBottom="";const e=Math.min(t.length,r+s);for(let i=r;i<e;i++){const e=this._renderer.createCompletionItemNode(t[i],n);o.appendChild(e),h=e}r=e,u()}))};u()}return s.appendChild(o),s}_findWidestItemIndex(e){const t=this._getPreferredItemWidthHeuristic(),i=e.map(t);return i.indexOf(Math.max(...i))}_getPreferredItemWidthHeuristic(){return this._renderer.itemWidthHeuristic?this._renderer.itemWidthHeuristic.bind(this._renderer):this._defaultRenderer.itemWidthHeuristic.bind(this._defaultRenderer)}_cycle(e){var t,i;const s=this.node.querySelectorAll(`.${w}`),n=this._activeIndex,o=s.length-1;let r=this.node.querySelector(`.${I}`);switch(r.classList.remove(I),e){case"up":this._activeIndex=0===n?o:n-1;break;case"down":this._activeIndex=n<o?n+1:0;break;case"pageUp":case"pageDown":{const t=this.node.getBoundingClientRect(),i=r.getBoundingClientRect(),s=Math.floor(t.height/i.height),l="pageUp"===e?-1:1;this._activeIndex=Math.min(Math.max(0,n+l*s),o);break}}r=s[this._activeIndex],r.classList.add(I);let l=this.node.querySelector(`.${P}`);y.ElementExt.scrollIntoViewIfNeeded(l,r),this._indexChanged.emit(this._activeIndex);const a=null===(t=this.model)||void 0===t?void 0:t.completionItems(),h=null==a?void 0:a[this._activeIndex];if(h){const e=null===(i=this.model)||void 0===i?void 0:i.resolveItem(h);this._showDoc&&this._updateDocPanel(e,r)}}_evtKeydown(e){if(!this.isHidden&&this._editor)if(this._editor.host.contains(e.target))switch(e.keyCode){case 9:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=this._model;if(!t)return;const i=t.completionItems();if(i&&1===i.length)return this._selected.emit(i[0].insertText||i[0].label),void this.reset();const s=this._populateSubset();return t.query&&t.query!==this._lastSubsetMatch&&(t.subsetMatch=!0,this._selected.emit(t.query),t.subsetMatch=!1,this._lastSubsetMatch=t.query),s&&this.update(),void this._cycle(e.shiftKey?"up":"down")}case 27:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),void this.reset();case 33:case 34:case 38:case 40:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=b.keyCodeMap[e.keyCode];return void this._cycle(t)}default:return}else this.reset()}_evtPointerdown(e){if(this.isHidden||!this._editor)return;if(b.nonstandardClick(e))return void this.reset();let t=e.target;for(;t!==document.documentElement;){if(t.classList.contains(w))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._selected.emit(t.getAttribute("data-value")),void this.reset();if(t===this.node)return e.preventDefault(),e.stopPropagation(),void e.stopImmediatePropagation();t=t.parentElement}this.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_populateSubset(){const{model:e}=this;if(!e)return!1;const t=e.completionItems(),i=b.commonSubset(t.map((e=>e.insertText||e.label))),{query:s}=e;return!(!i||i===s||0!==i.indexOf(s)||(e.query=i,0))}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!(i&&t&&t.original&&t.cursor))return;const s=t.cursor.start,n=i.getPositionAt(s),o=i.getCoordinateForPosition(n);if(!o)return;const r=window.getComputedStyle(e),l=parseInt(r.borderLeftWidth,10)||0,a=parseInt(r.paddingLeft,10)||0,h=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host,d=t.completionItems();this._sizeCache&&this._sizeCache.items.length!==d.length&&(this._sizeCache=void 0),C.HoverBox.setGeometry({anchor:o,host:h,maxHeight:this._maxHeight,minHeight:this._minHeight,node:e,size:this.sizeCache,offset:{horizontal:l+a},privilege:"below",style:r,outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}});const c=++this._geometryCounter;this._sizeCache||requestAnimationFrame((()=>{if(c!=this._geometryCounter)return;let t=e.getBoundingClientRect(),i=this._docPanel.getBoundingClientRect();this._sizeCache={width:t.width-i.width,height:t.height,items:d,docPanelWidth:i.width,docPanelHeight:i.height}}))}_updateDocPanel(e,t){var i,s,n;let o=this._docPanel;if(!e)return void this._toggleDocPanel(!1);const r=null!==(n=null===(s=(i=this._renderer).createLoadingDocsIndicator)||void 0===s?void 0:s.call(i))&&void 0!==n?n:this._defaultRenderer.createLoadingDocsIndicator();t.appendChild(r),e.then((e=>{var t,i,s;if(e&&o)if(e.documentation){const n=null!==(s=null===(i=(t=this._renderer).createDocumentationNode)||void 0===i?void 0:i.call(t,e))&&void 0!==s?s:this._defaultRenderer.createDocumentationNode(e);o.textContent="",o.appendChild(n),this._toggleDocPanel(!0)}else this._toggleDocPanel(!1)})).catch((e=>console.error(e))).finally((()=>{t.removeChild(r)}))}_toggleDocPanel(e){let t=this._docPanel;if(e){if(this._docPanelExpanded)return;t.style.display="",this._docPanelExpanded=!0}else{if(!this._docPanelExpanded)return;t.style.display="none",this._docPanelExpanded=!1}const i=this._sizeCache;i&&(i.docPanelHeight=e?this._maxHeight:0,i.docPanelWidth=e?this._docPanelWidth:0,this._geometryLock||this._setGeometry())}}var b;!function(e){class t{constructor(e){this.sanitizer=(null==e?void 0:e.sanitizer)||new v.Sanitizer}createCompletionItemNode(e,t){let i=this._createWrapperNode(e.insertText||e.label);return e.deprecated&&i.classList.add("jp-Completer-deprecated"),this._constructNode(i,this._createLabelNode(e.label),!!e.type,e.type,t,e.icon)}createDocumentationNode(e){const t=document.createElement("div");t.classList.add("jp-RenderedText");const i=this.sanitizer,s=e.documentation||"";return(0,f.renderText)({host:t,sanitizer:i,source:s}).catch(console.error),t}itemWidthHeuristic(e){var t;return e.label.replace(/<(\/)?mark>/g,"").length+((null===(t=e.type)||void 0===t?void 0:t.length)||0)}createLoadingDocsIndicator(){const e=document.createElement("div");e.classList.add("jp-Completer-loading-bar-container");const t=document.createElement("div");return t.classList.add("jp-Completer-loading-bar"),e.append(t),e}_createWrapperNode(e){const t=document.createElement("li");return t.className=w,t.setAttribute("data-value",e),t}_createLabelNode(e){const t=document.createElement("code");return t.className="jp-Completer-match",t.innerHTML=e,t}_constructNode(e,t,i,s,n,o){if(o){const t=o.element({className:"jp-Completer-type jp-Completer-icon"});e.appendChild(t)}else if(i){const t=document.createElement("span");t.textContent=(s[0]||"").toLowerCase();const i=n.indexOf(s)%10+1;t.className="jp-Completer-type jp-Completer-monogram",t.setAttribute("data-color-index",i.toString()),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-monogram",e.appendChild(t)}if(e.appendChild(t),i){e.title=s;const t=document.createElement("code");t.className="jp-Completer-typeExtended",t.textContent=s.toLocaleLowerCase(),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-typeExtended",e.appendChild(t)}return e}}let i;e.Renderer=t,e.getDefaultRenderer=function(e){return(!i||e&&i.sanitizer!==e)&&(i=new t({sanitizer:e})),i}}(T||(T={})),function(e){e.keyCodeMap={38:"up",40:"down",33:"pageUp",34:"pageDown"},e.commonSubset=function(e){const t=e.length;let i="";if(t<2)return i;const s=e[0].length;for(let n=0;n<s;n++){const s=e[0][n];for(let o=1;o<t;o++)if(e[o][n]!==s)return i;i+=s}return i},e.nonstandardClick=function(e){return 0!==e.button||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey},e.measureSize=function(e,t){e.isConnected&&console.warn("Measuring connected elements with `measureSize` has side-effects"),e.style.visibility="hidden",e.style.display=t,document.body.appendChild(e);const i=e.getBoundingClientRect();return document.body.removeChild(e),e.removeAttribute("style"),i}}(b||(b={}));class E{constructor(e){var t,i;this._resolveFactory=(e,t)=>e.resolve?i=>e.resolve(t,this._context,i):void 0,this._fetching=0,this._inlineFetching=0,this._providers=e.providers,this._inlineProviders=null!==(t=e.inlineProviders)&&void 0!==t?t:[],this._inlineProvidersSettings=null!==(i=e.inlineProvidersSettings)&&void 0!==i?i:{},this._context=e.context,this._timeout=e.timeout}async applicableProviders(){const e=this._providers.map((e=>e.isApplicable(this._context))),t=await Promise.all(e);return this._providers.filter(((e,i)=>t[i]))}fetchInline(e,t){let i=[];const s=++this._inlineFetching;for(const o of this._inlineProviders){const r=this._inlineProvidersSettings[o.identifier];let l=0;t===n.Automatic&&(l=r.debouncerDelay);const h=()=>{const i=o.fetch(e,{...this._context,triggerKind:t}).then((e=>({...e,items:e.items.map((e=>{const t=e;return t.stream=new a.Signal(t),t.provider=o,this._stream(t,o),t}))}))),s=new Promise((e=>setTimeout((()=>e(null)),l+r.timeout)));return Promise.race([i,s])},d=0===l?h():new Promise(((e,t)=>setTimeout((()=>s!=this._inlineFetching?t(null):e(h())),l)));i.push(d.catch((e=>e)))}return i}async _stream(e,t){if(!e.isIncomplete||!t.stream||!e.token)return;const i=e.stream,s=e.token;e.token=void 0,e.streaming=!0,i.emit(u.StraemEvent.opened);for await(const n of t.stream(s)){const t=n.response,s=t.insertText.substring(e.insertText.length);e.insertText=t.insertText,e.lastStreamed=s,e.error=n.response.error,i.emit(u.StraemEvent.update)}e.isIncomplete=!1,e.lastStreamed=void 0,e.streaming=!1,i.emit(u.StraemEvent.closed)}async fetch(e,t){const i=++this._fetching;let s=[];const n=await this.applicableProviders();for(const o of n){let n;n=o.fetch(e,this._context,t).then((e=>{if(i!==this._fetching)return Promise.reject(void 0);const t=e.items.map((e=>({...e,resolve:this._resolveFactory(o,e)})));return{...e,items:t}}));const r=new Promise((e=>setTimeout((()=>e(null)),this._timeout)));n=Promise.race([n,r]),s.push(n.catch((e=>e)))}const o=Promise.all(s);return this._mergeCompletions(o)}async shouldShowContinuousHint(e,t){const i=await this.applicableProviders();return 0!==i.length&&(i[0].shouldShowContinuousHint?i[0].shouldShowContinuousHint(e,t,this._context):this._defaultShouldShowContinuousHint(e,t))}_alignPrefixes(e,t,i){if(t!=i){const t=this._context.editor;if(!t)return e;const s=t.getCursorPosition(),n=t.getLine(s.line);return n?e.map((e=>{if(e.start==i)return e;let t=n.substring(e.start,i);return{...e,items:e.items.map((e=>{let i=e.insertText||e.label;return e.insertText=i.startsWith(t)?i.slice(t.length):i,e}))}})):e}return e}async _mergeCompletions(e){let t=(await e).filter((e=>!(!e||e instanceof Error||!e.items.length)));if(0==t.length)return null;if(1==t.length)return t[0];const i=Math.min(...t.map((e=>e.end))),s=t.map((e=>e.start)),n=Math.min(...s),o=Math.max(...s);t=this._alignPrefixes(t,n,o);const r=new Set,l=new Array;for(const e of t)e.items.forEach((e=>{let t=(e.insertText||e.label).trim();r.has(t)||(r.add(t),l.push(e))}));return{start:o,end:i,items:l}}_defaultShouldShowContinuousHint(e,t){return!e&&(null==t.sourceChange||t.sourceChange.some((e=>null!=e.insert&&e.insert.length>0)))}}const M="CompletionProvider:context";class L{constructor(){this.identifier=M,this.rank=500,this.renderer=null}async isApplicable(e){return!0}fetch(e,t){const i=t.editor;return i?new Promise((e=>{e(k.contextHint(i))})):Promise.reject("No editor")}}var k;!function(e){e.contextHint=function(e){const t=e.getTokenAtCursor(),i=function(e,t){return t.getTokens().filter((t=>0===t.value.indexOf(e.value)&&t.value!==e.value))}(t,e).filter((e=>e.type)).map((e=>e.value)),s=new Set(i),n=new Array;return s.forEach((e=>n.push({label:e}))),{start:t.offset,end:t.offset+t.value.length,items:n}}}(k||(k={}));const D="CompletionProvider:kernel";class A{constructor(){this.identifier=D,this.rank=550,this.renderer=null}async isApplicable(e){var t;return!!(null===(t=e.session)||void 0===t?void 0:t.kernel)}async fetch(e,t){var i;const s=null===(i=t.session)||void 0===i?void 0:i.kernel;if(!s)throw new Error("No kernel for completion request.");const n={code:e.text,cursor_pos:e.offset},o=(await s.requestComplete(n)).content;if("ok"!==o.status)throw new Error("Completion fetch failed to return successfully.");const r=new Array,l=o.metadata._jupyter_types_experimental;return o.matches.forEach(((e,t)=>{l&&l[t]?r.push({label:e,type:l[t].type,insertText:l[t].text}):r.push({label:e})})),{start:o.cursor_start,end:o.cursor_end,items:r}}async resolve(e,t,i){const{editor:s,session:n}=t;if(n&&s){let t=s.model.sharedModel.getSource();const o=s.getCursorPosition();let l=r.Text.jsIndexToCharIndex(s.getOffsetAt(o),t);const a=n.kernel;if(!t||!a)return Promise.resolve(e);if(i){const{start:e,value:s}=i;t=t.substring(0,e)+s,l+=s.length}const h={code:t,cursor_pos:l,detail_level:0},d=(await a.requestInspect(h)).content;return"ok"===d.status&&d.found?(e.documentation=d.data["text/plain"],e):e}return e}shouldShowContinuousHint(e,t){const i=t.sourceChange;return null==i||!i.some((e=>null!=e.delete))&&i.some((t=>null!=t.insert&&("."===t.insert||!e&&t.insert.trim().length>0)))}}var H=i(63720),R=i(89843);const q="jp-GhostText-streamingIndicator",O="jp-GhostText-errorIndicator";class j{constructor(e){this.options=e}placeGhost(e,t){const i=[B.addMark.of(t)];e.state.field(B.markField,!1)||(i.push(R.StateEffect.appendConfig.of([B.markField])),i.push(R.StateEffect.appendConfig.of([H.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[B.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[B.removeMark.of(null)];e.dispatch({effects:t})}}j.streamingAnimation="uncover",j.spacerRemovalDelay=700,j.spacerRemovalDuration=300;class W extends H.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1,this._clearErrorTimeout=null}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming&&e.options.error===this.options.error}get lineBreaks(){return(this.content.match(/\n/g)||"").length}updateDOM(e,t){return this._updateDOM(e),!0}get content(){return this.options.content}toDOM(){let e=document.createElement("span");return this.options.onPointerOver&&e.addEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.addEventListener("pointerleave",this.options.onPointerLeave),e.classList.add("jp-GhostText"),e.dataset.animation=j.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_removeErrorAnimation(e){e.querySelectorAll(`.${O}`).forEach((e=>{e.remove()}))}_mountErrorAnimation(e){const t=document.createElement("span");t.className=O;const i=this.options.error;(null==i?void 0:i.message)&&(t.title=null==i?void 0:i.message),e.querySelectorAll(`.${q}, .${O}`).forEach((e=>{e.remove()})),e.appendChild(t)}_updateDOM(e){var t,i;if(this.options.error)return this._mountErrorAnimation(e),void(this._clearErrorTimeout=setTimeout((()=>{this._removeErrorAnimation(e),this._clearErrorTimeout=null}),5e3));null!==this._clearErrorTimeout&&(clearTimeout(this._clearErrorTimeout),this._removeErrorAnimation(e),this._clearErrorTimeout=null);let s=this.content,n="",o=this.options.addedPart;if(o&&(o.startsWith("\n")&&(o=o.substring(1)),s=s.substring(0,s.length-o.length)),this.options.maxLines){const e=s.split("\n");s=e.slice(0,this.options.maxLines).join("\n"),n=e.slice(this.options.maxLines).join("\n")}const r=Math.min(null!==(t=this.options.minLines)&&void 0!==t?t:0,null!==(i=this.options.maxLines)&&void 0!==i?i:1/0),l=Math.max(0,r-s.split("\n").length+1),a=new Array(l).fill("").join("\n");if(this.isSpacer)return void(e.innerText=s+a);e.innerText=s;let h=e;if(n.length>0){const t=document.createElement("span");t.className="jp-GhostText-hiddenWrapper",e.appendChild(t);const i=document.createElement("span");i.className="jp-GhostText-expandHidden",i.innerText="⇓";const s=document.createElement("span");t.appendChild(i),s.className="jp-GhostText-hiddenLines",s.innerText="\n"+n,t.appendChild(s),h=s}if(o){const e=document.createElement("span");e.className="jp-GhostText-streamedToken",e.innerText=o,h.appendChild(e)}if(this.options.streaming){const e=document.createElement("span");e.className=q,h.appendChild(e)}if(a.length>0){const e=document.createTextNode(a);h.appendChild(e)}}destroy(e){this.options.onPointerOver&&e.removeEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.removeEventListener("pointerleave",this.options.onPointerLeave),super.destroy(e)}}class N extends W{constructor(){super(...arguments),this.isSpacer=!0}}class z extends N{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e.style.animationDelay=j.spacerRemovalDelay+"ms",e.style.animationDuration=j.spacerRemovalDuration+"ms",e}}class F extends N{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}var B;!function(e){let t;function i(e,t){return H.Decoration.widget({widget:new W(e),side:1,ghostSpec:e}).range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))}!function(e){e[e.Set=0]="Set",e[e.Remove=1]="Remove",e[e.FilterAndUpdate=2]="FilterAndUpdate"}(t||(t={})),e.addMark=R.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=R.StateEffect.define(),e.markField=R.StateField.define({create:()=>H.Decoration.none,update(s,n){const o=function(i){for(let s of i.effects){if(s.is(e.addMark))return{action:t.Set,spec:s.value};if(s.is(e.removeMark))return{action:t.Remove}}return i.docChanged||i.selection?{action:t.FilterAndUpdate}:null}(n);if(s=s.update({filter:(e,t,i)=>!(i.spec.widget instanceof N&&i.spec.timeoutInfo.elapsed)}),!o)return s.map(n.changes);switch(o.action){case t.Set:{const e=i(o.spec,n);return s.update({add:[e],filter:(t,i,s)=>s===e.value})}case t.Remove:return s.update({filter:()=>!1});case t.FilterAndUpdate:{let e=s.iter();for(;e.value&&e.value.spec.widget instanceof N;)e.next();if(!e.value)return s.map(n.changes);const t=e.value.spec.ghostSpec,o={...t};let r=!1;n.changes.iterChanges(((e,t,i,s,n)=>{if(!r)if(e===t&&i!==s)for(let e=0;e<n.lines;e++){const t=n.lineAt(e).text,i=e>0?"\n"+t:t;if(!o.content.startsWith(i)){r=!0;break}o.content=o.content.slice(i.length),o.from+=i.length}else r=!0}));const l=r?function(e,t,i=1e3){if(e.content.length<2)return[];const s={elapsed:!1};setTimeout((()=>{s.elapsed=!0}),i);const n=H.Decoration.widget({widget:new F(e),side:1,timeoutInfo:s}),o=H.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s});return[n.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length)),o.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))]}(t,n):[i(o,n)],a=l.map((e=>e.value));if(s=s.update({add:l,filter:(e,t,i)=>a.includes(i)}),r)try{s=s.map(n.changes)}catch(e){return console.warn(e),H.Decoration.none}return s}}},provide:e=>H.EditorView.decorations.from(e)})}(B||(B={}));const G="jp-mod-inline-completer-active",V="jp-InlineCompleter-hover";class U extends x.Widget{constructor(e){var t,i;super({node:document.createElement("div")}),this._clearHoverTimeout=null,this._current=0,this._editor=null,this._lastItem=null,this._model=null,this._providerWidget=new x.Widget,this._showShortcuts=U.defaultSettings.showShortcuts,this._showWidget=U.defaultSettings.showWidget,this._suggestionsCounter=new x.Widget,this._toolbar=new C.Toolbar,this.model=null!==(t=e.model)&&void 0!==t?t:null,this.editor=null!==(i=e.editor)&&void 0!==i?i:null,this.addClass("jp-InlineCompleter"),this.addClass("jp-ThemedContainer"),this._ghostManager=new j({onBlur:this._onEditorBlur.bind(this)}),this._trans=e.trans;const s=this.layout=new x.PanelLayout;s.addWidget(this._suggestionsCounter),s.addWidget(this.toolbar),s.addWidget(this._providerWidget),this._progressBar=document.createElement("div"),this._progressBar.className="jp-InlineCompleter-progressBar",this.node.appendChild(this._progressBar),this._updateShortcutsVisibility(),this._updateDisplay(),this.node.tabIndex=0}get toolbar(){return this._toolbar}get editor(){return this._editor}set editor(e){var t;null===(t=this.model)||void 0===t||t.reset(),this._editor=e}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged,this),this._model.provisionProgress.disconnect(this._onProvisionProgress,this)),this._model=e,this._model&&(this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.connect(this._onModelFilterTextChanged,this),this._model.provisionProgress.connect(this._onProvisionProgress,this)))}cycle(e){var t,i;const s=null===(i=null===(t=this.model)||void 0===t?void 0:t.completions)||void 0===i?void 0:i.items;if(s){if("next"===e){const e=this._current+1;this._current=e===s.length?0:e}else{const e=this._current-1;this._current=-1===e?s.length-1:e}this._updateStreamTracking(),this._render()}}accept(){const e=this.model,t=this.current,i=this._editor;if(!i||!e||!t)return;const s=e.cursor,n=t.insertText,o=i.getOffsetAt(i.getCursorPosition()),r=i.getOffsetAt(s),l=r,a=o;i.model.sharedModel.updateSource(r,o,n),o<=a&&o>=l&&i.setCursorPosition(i.getPositionAt(l+n.length)),e.reset(),this.update()}get current(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.completions;return t?t.items[this._current]:null}_updateStreamTracking(){this._lastItem&&this._lastItem.stream.disconnect(this._onStream,this);const e=this.current;e&&e.stream.connect(this._onStream,this),this._lastItem=e}_onStream(e,t){var i;const s=null===(i=this.model)||void 0===i?void 0:i.completions;if(!s||!s.items||0===s.items.length)return;if(this.isHidden)return;const n=s.items[this._current];this._setText(n)}configure(e){this._showWidget=e.showWidget,this._updateDisplay(),e.showShortcuts!==this._showShortcuts&&(this._showShortcuts=e.showShortcuts,this._updateShortcutsVisibility()),j.streamingAnimation=e.streamingAnimation,j.spacerRemovalDelay=Math.max(0,e.editorResizeDelay-300),j.spacerRemovalDuration=Math.max(0,Math.min(300,e.editorResizeDelay-300)),this._minLines=e.minLines,this._maxLines=e.maxLines,this._reserveSpaceForLongest=e.reserveSpaceForLongest,this._suppressIfTabCompleterActive=e.suppressIfTabCompleterActive}get suppressIfTabCompleterActive(){return this._suppressIfTabCompleterActive}get isActive(){var e;return!!(null===(e=this.editor)||void 0===e?void 0:e.host.classList.contains(G))}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}onUpdateRequest(e){super.onUpdateRequest(e);const t=this._model;if(!t)return;let i=t.completions;i&&i.items&&0!==i.items.length?this.isHidden&&(this.show(),this._setGeometry()):this.isHidden||this.hide()}onAfterAttach(e){document.addEventListener("scroll",this,!0),document.addEventListener("pointerdown",this,!0)}onBeforeDetach(e){document.removeEventListener("scroll",this,!0),document.removeEventListener("pointerdown",this,!0)}_evtPointerdown(e){var t;if(this.isHidden||!this._editor)return;const i=e.target;if(this.node.contains(i))return!0;this.hide(),null===(t=this.model)||void 0===t||t.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_onEditorBlur(e){var t;if(this.node.contains(e.relatedTarget))return!1;null===(t=this._editor)||void 0===t||t.host.classList.remove(G),this.hide()}_onModelSuggestionsChanged(e,t){var i;if(this.isAttached){if("set"===t.event)this._current=null!==(i=t.indexMap.get(this._current))&&void 0!==i?i:0;else if("clear"===t.event){const e=this.editor;e&&(this._ghostManager.clearGhosts(e.editor),e.host.classList.remove(G))}this._updateStreamTracking(),this.update(),this._render()}else this.update()}_onModelFilterTextChanged(e,t){var i,s;const n=null===(i=this.model)||void 0===i?void 0:i.completions;n&&n.items&&0!==n.items.length&&(this._current=null!==(s=t.get(this._current))&&void 0!==s?s:0,this._updateStreamTracking(),setTimeout((()=>{this._render(),this._setGeometry()}),0))}_onProvisionProgress(e,t){requestAnimationFrame((()=>{0===t.pendingProviders?this._progressBar.style.display="none":(this._progressBar.style.display="",this._progressBar.style.width=100*t.pendingProviders/t.totalProviders+"%")}))}_render(){var e,t;const i=null===(e=this.model)||void 0===e?void 0:e.completions;if(!i||!i.items||0===i.items.length)return;const s=i.items[this._current];this._setText(s),"never"!==this._showWidget&&(this._suggestionsCounter.node.innerText=this._trans.__("%1/%2",this._current+1,i.items.length),this._providerWidget.node.title=this._trans.__("Provider: %1",s.provider.name),(null!==(t=s.provider.icon)&&void 0!==t?t:C.kernelIcon).render(this._providerWidget.node))}_setText(e){var t,i,s;const n=e.insertText,o=this._editor,r=this._model;if(!r||!o)return;const l=o.editor;let a;if(this._reserveSpaceForLongest){const e=null!==(s=null===(i=null===(t=this.model)||void 0===t?void 0:t.completions)||void 0===i?void 0:i.items)&&void 0!==s?s:[],n=Math.max(...e.map((e=>e.insertText.split("\n").length)));a=Math.max(this._minLines,n)}else a=this._minLines;this._ghostManager.placeGhost(l,{from:o.getOffsetAt(r.cursor),content:n,providerId:e.provider.identifier,addedPart:e.lastStreamed,streaming:e.streaming,minLines:a,maxLines:this._maxLines,onPointerOver:this._onPointerOverGhost.bind(this),onPointerLeave:this._onPointerLeaveGhost.bind(this),error:e.error}),o.host.classList.add(G)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(V)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(V)),500)}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!i||!t||!t.cursor)return;const s=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host;let n;try{const e=i.getCoordinateForPosition(t.cursor);if(!e)throw Error("No coordinates for cursor position");n=e}catch(e){return void this.hide()}C.HoverBox.setGeometry({anchor:n,host:s,maxHeight:40,minHeight:20,node:e,privilege:"forceAbove",outOfViewDisplay:{top:"stick-outside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}})}_updateShortcutsVisibility(){this.node.dataset.showShortcuts=this._showShortcuts+""}_updateDisplay(){this.node.dataset.display=this._showWidget}}!function(e){e.defaultSettings={showWidget:"onHover",showShortcuts:!0,streamingAnimation:"uncover",providers:{},minLines:2,maxLines:4,editorResizeDelay:1e3,reserveSpaceForLongest:!1,suppressIfTabCompleterActive:!0},e.Model=class{constructor(){this.suggestionsChanged=new a.Signal(this),this.filterTextChanged=new a.Signal(this),this.provisionProgress=new a.Signal(this),this._isDisposed=!1,this._completions=null}setCompletions(e){var t,i;const s=new Map(null===(i=null===(t=this._completions)||void 0===t?void 0:t.items)||void 0===i?void 0:i.map(((e,t)=>[e.insertText,t])));this._completions=e;const n=new Map(e.items.map(((e,t)=>[s.get(e.insertText),t])));this.suggestionsChanged.emit({event:"set",indexMap:n})}appendCompletions(e){this._completions&&this._completions.items?(this._completions.items.push(...e.items),this.suggestionsChanged.emit({event:"append"})):console.warn("No completions to append to")}notifyProgress(e){this.provisionProgress.emit(e)}get cursor(){return this._cursor}set cursor(e){this._cursor=e}get completions(){return this._completions}reset(){this._completions=null,this.suggestionsChanged.emit({event:"clear"})}get isDisposed(){return this._isDisposed}handleTextChange(e){var t;const i=this._completions;if(!i||!i.items||0===i.items.length)return;const s=new Map(i.items.map(((e,t)=>[e,t])));for(let s of null!==(t=e.sourceChange)&&void 0!==t?t:[]){const e=s.insert;if(e){const t=i.items.filter((t=>{var i;const s=null!==(i=t.filterText)&&void 0!==i?i:t.insertText;return!!s.startsWith(e)&&(t.filterText=s.substring(e.length),t.insertText=t.insertText.substring(e.length),!0)}));0===t.length&&(this._completions=null),i.items=t}else s.retain||(this._completions=null)}const n=new Map(i.items.map(((e,t)=>[s.get(e),t])));this.filterTextChanged.emit(n)}handleSelectionChange(e){const t=this.cursor;if(!t)return;const{start:i,end:s}=e;i.column===s.column&&i.line===s.line||this.reset(),(i.line!==t.line||i.column<t.column)&&this.reset()}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}}}(U||(U={}));class ${constructor(){this._activeProviders=new Set([D,M]),this._inlineCompleterSettings=U.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._selected=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(e){this._timeout=e}setShowDocumentationPanel(e){this._panelHandlers.forEach((t=>t.completer.showDocsPanel=e)),this._showDoc=e}setSuppressIfInlineCompleterActive(e){this._panelHandlers.forEach((t=>t.completer.suppressIfInlineCompleterActive=e)),this._suppressIfInlineCompleterActive=e}setContinuousHinting(e){this._panelHandlers.forEach((t=>t.autoCompletion=e)),this._autoCompletion=e}registerProvider(e){const t=e.identifier;this._providers.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._providers.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}registerInlineProvider(e){const t=e.identifier;this._inlineProviders.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._inlineProviders.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}getProviders(){return this._providers}activateProvider(e){this._activeProviders=new Set([]),e.forEach((e=>{this._providers.has(e)&&this._activeProviders.add(e)})),0===this._activeProviders.size&&(this._activeProviders.add(D),this._activeProviders.add(M)),this._activeProvidersChanged.emit()}async updateCompleter(e){var t,i;const{widget:s,editor:n,sanitizer:o}=e,r=s.id,l=this._panelHandlers.get(r),a=[...this._activeProviders][0],h=this._providers.get(a);let d=null!==(t=null==h?void 0:h.renderer)&&void 0!==t?t:T.getDefaultRenderer(o);const c=null==h?void 0:h.modelFactory;let u;u=c?await c.call(h,e):new _,this._mostRecentContext.set(s.id,e);const m={model:u,editor:n,renderer:d,sanitizer:o,showDoc:this._showDoc};if(l){const t=l.completer;null===(i=t.model)||void 0===i||i.dispose(),t.model=m.model,t.renderer=m.renderer,t.showDocsPanel=m.showDoc,t.suppressIfInlineCompleterActive=this._suppressIfInlineCompleterActive,l.autoCompletion=this._autoCompletion,n&&(l.editor=n,l.reconciliator=await this.generateReconciliator(e))}else{const t=await this._generateHandler(e,m);this._panelHandlers.set(s.id,t),t.completer.selected.connect(((e,t)=>this._selected.emit({insertText:t}))),s.disposed.connect((e=>{this.disposeHandler(e.id,t),this._mostRecentContext.delete(r)}))}}invoke(e){const t=this._panelHandlers.get(e);t&&t.invoke()}select(e){const t=this._panelHandlers.get(e);t&&t.completer.selectActive()}setInlineCompleterFactory(e){this._inlineCompleterFactory=e,this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})),this.inline||(this.inline={invoke:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.invokeInline()},isActive:e=>{const t=this._panelHandlers.get(e);return!(!t||!t.inlineCompleter)&&t.inlineCompleter.isActive},cycle:(e,t)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(t)},accept:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e;for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);this._panelHandlers.forEach(((t,i)=>{t.inlineCompleter&&t.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))}))}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(e){const t=[];for(const[e,i]of Object.entries(this._inlineCompleterSettings.providers))!0===i.enabled&&t.push(e);const i=[...this._inlineProviders.values()].filter((e=>t.includes(e.identifier))),s=[];for(const e of this._activeProviders){const t=this._providers.get(e);t&&s.push(t)}return new E({context:e,providers:s,inlineProviders:i,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(e,t){var i,s,n,o;null===(i=t.completer.model)||void 0===i||i.dispose(),t.completer.dispose(),null===(n=null===(s=t.inlineCompleter)||void 0===s?void 0:s.model)||void 0===n||n.dispose(),null===(o=t.inlineCompleter)||void 0===o||o.dispose(),t.dispose(),this._panelHandlers.delete(e)}async _generateHandler(e,t){const i=new T(t),s=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...t,model:new U.Model}):void 0;i.hide(),x.Widget.attach(i,document.body),s&&(x.Widget.attach(s,document.body),s.hide(),s.configure(this._inlineCompleterSettings));const n=await this.generateReconciliator(e),o=new u({completer:i,inlineCompleter:s,reconciliator:n});return o.editor=e.editor,o}}const K=new C.LabIcon({name:"completer:inline",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n <path class="jp-icon4" fill="#bbbbbb" d="M17 15H3v2h14v-2Zm0-8h-6v2h6V7ZM3 13h18v-2H3v2Zm0 8h18v-2H3v2Z"/>\n <path class="jp-icon1" fill="#616161" d="M3 3v2h18V3H3ZM3 7v2h8V7H3Z"/>\n</svg>\n'}),Z=new C.LabIcon({name:"completer:widget",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n<g fill="#616161" class="jp-icon2 jp-icon-selectable">\n <path d="M6 8h16v14.3H6z" style="fill:#eee;stroke:#444;stroke-linejoin:round"/>\n <path d="M3 3v2h10V3H3Z" transform="matrix(.8 0 0 1 .5 0)"/>\n</g>\n<g class="jp-icon3 jp-icon-selectable">\n <path fill="#616161" d="M18 14.1H8v2h11v-2ZM8 12.1H20V10.1H8v2Zm0 8H20v-2H8v3Z"/>\n</g>\n</svg>\n'});var J=i(66649);class Q{constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||J.nullTranslator;this._trans=t.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return C.historyIcon}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(e){var t;this._maxSuggestions=null!==(t=e.maxSuggestions)&&void 0!==t?t:100}async fetch(e,t,i){var s;const n=null===(s=t.session)||void 0===s?void 0:s.kernel;if(!n)throw new Error("No kernel for completion request.");const o=e.text.slice(0,e.offset).split("\n").slice(-1)[0],r={output:!1,raw:!0,hist_access_type:"search",pattern:o+"*",unique:!0,n:this._maxSuggestions},l=await n.requestHistory(r),a=[];if(""===o)return{items:[]};if("ok"===l.content.status)for(const e of l.content.history){const t=e[2].split("\n");for(let e=0;e<t.length;e++){const i=t[e];if(i.startsWith(o)){const s=i.slice(o.length,i.length)+"\n"+t.slice(e+1).join("\n");a.push({insertText:s})}}}return{items:a}}}}}]);