notebook 7.1.0rc1__py3-none-any.whl → 7.1.1__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 (198) hide show
  1. notebook/__init__.py +1 -1
  2. notebook/_version.py +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/131.bundle.js +1 -1
  5. notebook/static/1337.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1388.bundle.js +1 -1
  8. notebook/static/1408.bundle.js +1 -1
  9. notebook/static/1495.bundle.js +1 -1
  10. notebook/static/1496.bundle.js +1 -1
  11. notebook/static/1647.bundle.js +1 -1
  12. notebook/static/1650.bundle.js +1 -1
  13. notebook/static/1664.bundle.js +1 -1
  14. notebook/static/1682.bundle.js +1 -1
  15. notebook/static/1684.bundle.js +1 -1
  16. notebook/static/1809.bundle.js +1 -1
  17. notebook/static/1827.bundle.js +1 -1
  18. notebook/static/1833.bundle.js +1 -1
  19. notebook/static/1835.bundle.js +1 -1
  20. notebook/static/1846.bundle.js +1 -1
  21. notebook/static/1950.bundle.js +1 -1
  22. notebook/static/1958.bundle.js +1 -1
  23. notebook/static/2007.bundle.js +1 -1
  24. notebook/static/2067.bundle.js +1 -1
  25. notebook/static/2088.bundle.js +1 -1
  26. notebook/static/2089.bundle.js +1 -1
  27. notebook/static/2122.bundle.js +1 -1
  28. notebook/static/214.bundle.js +1 -1
  29. notebook/static/2167.bundle.js +1 -1
  30. notebook/static/2184.bundle.js +1 -1
  31. notebook/static/2241.bundle.js +1 -1
  32. notebook/static/2311.bundle.js +1 -1
  33. notebook/static/2324.bundle.js +1 -1
  34. notebook/static/2401.bundle.js +1 -1
  35. notebook/static/2479.bundle.js +1 -1
  36. notebook/static/2489.bundle.js +1 -1
  37. notebook/static/2512.bundle.js +1 -1
  38. notebook/static/2520.bundle.js +1 -1
  39. notebook/static/2577.bundle.js +1 -1
  40. notebook/static/2607.bundle.js +1 -1
  41. notebook/static/261.bundle.js +1 -1
  42. notebook/static/2615.bundle.js +1 -1
  43. notebook/static/2682.bundle.js +1 -1
  44. notebook/static/2692.bundle.js +1 -1
  45. notebook/static/2866.bundle.js +1 -1
  46. notebook/static/2924.bundle.js +1 -1
  47. notebook/static/2944.bundle.js +1 -1
  48. notebook/static/3129.bundle.js +1 -1
  49. notebook/static/3146.bundle.js +1 -1
  50. notebook/static/3154.bundle.js +1 -1
  51. notebook/static/3187.bundle.js +1 -1
  52. notebook/static/3213.bundle.js +1 -1
  53. notebook/static/3301.bundle.js +1 -1
  54. notebook/static/3340.bundle.js +1 -1
  55. notebook/static/3360.bundle.js +1 -1
  56. notebook/static/3466.bundle.js +1 -1
  57. notebook/static/3488.bundle.js +1 -1
  58. notebook/static/3512.bundle.js +1 -1
  59. notebook/static/3654.bundle.js +1 -1
  60. notebook/static/3676.bundle.js +1 -1
  61. notebook/static/3680.bundle.js +1 -1
  62. notebook/static/3768.bundle.js +1 -1
  63. notebook/static/377.bundle.js +1 -1
  64. notebook/static/3863.bundle.js +1 -1
  65. notebook/static/3881.bundle.js +1 -1
  66. notebook/static/4035.bundle.js +1 -1
  67. notebook/static/4042.bundle.js +1 -1
  68. notebook/static/4131.bundle.js +1 -1
  69. notebook/static/4212.bundle.js +1 -1
  70. notebook/static/4382.bundle.js +1 -1
  71. notebook/static/4558.bundle.js +1 -1
  72. notebook/static/4630.bundle.js +1 -1
  73. notebook/static/4645.bundle.js +1 -1
  74. notebook/static/4811.bundle.js +1 -1
  75. notebook/static/5088.bundle.js +1 -1
  76. notebook/static/5099.bundle.js +1 -1
  77. notebook/static/5135.bundle.js +1 -1
  78. notebook/static/514.bundle.js +1 -1
  79. notebook/static/5313.bundle.js +1 -1
  80. notebook/static/5325.bundle.js +1 -1
  81. notebook/static/5346.bundle.js +1 -1
  82. notebook/static/5426.bundle.js +1 -1
  83. notebook/static/5573.bundle.js +1 -1
  84. notebook/static/5601.bundle.js +1 -1
  85. notebook/static/5649.bundle.js +3 -3
  86. notebook/static/5733.bundle.js +1 -1
  87. notebook/static/5912.bundle.js +1 -1
  88. notebook/static/5921.bundle.js +1 -1
  89. notebook/static/6017.bundle.js +1 -1
  90. notebook/static/6139.bundle.js +1 -1
  91. notebook/static/62.bundle.js +1 -1
  92. notebook/static/6256.bundle.js +1 -1
  93. notebook/static/6281.bundle.js +1 -1
  94. notebook/static/6345.bundle.js +1 -1
  95. notebook/static/6417.bundle.js +1 -1
  96. notebook/static/6604.bundle.js +1 -1
  97. notebook/static/6621.bundle.js +1 -1
  98. notebook/static/6627.bundle.js +1 -1
  99. notebook/static/6640.bundle.js +1 -1
  100. notebook/static/6667.bundle.js +1 -1
  101. notebook/static/6815.bundle.js +1 -1
  102. notebook/static/6853.bundle.js +1 -1
  103. notebook/static/6893.bundle.js +1 -1
  104. notebook/static/690.bundle.js +1 -1
  105. notebook/static/6962.bundle.js +1 -1
  106. notebook/static/6999.bundle.js +1 -1
  107. notebook/static/{1608.bundle.js → 7005.bundle.js} +1 -1
  108. notebook/static/7097.bundle.js +1 -1
  109. notebook/static/7153.bundle.js +1 -1
  110. notebook/static/7226.bundle.js +1 -1
  111. notebook/static/7252.bundle.js +1 -1
  112. notebook/static/7302.bundle.js +1 -1
  113. notebook/static/7386.bundle.js +1 -1
  114. notebook/static/7391.bundle.js +1 -1
  115. notebook/static/7394.bundle.js +1 -1
  116. notebook/static/7427.bundle.js +1 -1
  117. notebook/static/755.bundle.js +1 -1
  118. notebook/static/7603.bundle.js +1 -1
  119. notebook/static/7639.bundle.js +1 -1
  120. notebook/static/7684.bundle.js +1 -1
  121. notebook/static/771.bundle.js +1 -0
  122. notebook/static/7811.bundle.js +1 -1
  123. notebook/static/7812.bundle.js +1 -1
  124. notebook/static/7819.bundle.js +1 -1
  125. notebook/static/7900.bundle.js +1 -1
  126. notebook/static/7906.bundle.js +1 -1
  127. notebook/static/7995.bundle.js +1 -1
  128. notebook/static/8579.bundle.js +1 -1
  129. notebook/static/8633.bundle.js +1 -1
  130. notebook/static/8768.bundle.js +1 -1
  131. notebook/static/8771.bundle.js +1 -1
  132. notebook/static/8781.bundle.js +1 -1
  133. notebook/static/8801.bundle.js +1 -1
  134. notebook/static/8875.bundle.js +1 -1
  135. notebook/static/8907.bundle.js +1 -1
  136. notebook/static/8928.bundle.js +1 -1
  137. notebook/static/8929.bundle.js +1 -1
  138. notebook/static/893.bundle.js +1 -1
  139. notebook/static/901.bundle.js +1 -1
  140. notebook/static/9068.bundle.js +1 -1
  141. notebook/static/911.bundle.js +1 -1
  142. notebook/static/9151.bundle.js +1 -1
  143. notebook/static/9161.bundle.js +1 -1
  144. notebook/static/9268.bundle.js +1 -1
  145. notebook/static/9335.bundle.js +1 -1
  146. notebook/static/9341.bundle.js +1 -1
  147. notebook/static/9380.bundle.js +1 -1
  148. notebook/static/9605.bundle.js +1 -1
  149. notebook/static/9638.bundle.js +1 -1
  150. notebook/static/9680.bundle.js +1 -1
  151. notebook/static/9685.bundle.js +1 -1
  152. notebook/static/9752.bundle.js +1 -1
  153. notebook/static/9821.bundle.js +1 -1
  154. notebook/static/9852.bundle.js +1 -1
  155. notebook/static/9866.bundle.js +1 -1
  156. notebook/static/bundle.js +1 -1
  157. notebook/static/third-party-licenses.json +99 -99
  158. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  159. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  160. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  161. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  162. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  163. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  164. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  165. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/913.ed31b967ed65df80c2cf.js → notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/355.1213f16419258c4671ec.js +1 -1
  166. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.c74a681c6a303d4da718.js +1 -0
  167. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.32f48ad22cd5f6a8da04.js +1 -0
  168. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js → notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.d3d4e56f2f961c2c2a13.js +1 -1
  169. notebook-7.1.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.330dffb5180b5b71100a.js +1 -0
  170. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  171. {notebook-7.1.0rc1.dist-info → notebook-7.1.1.dist-info}/METADATA +2 -2
  172. {notebook-7.1.0rc1.dist-info → notebook-7.1.1.dist-info}/RECORD +194 -194
  173. notebook/static/4837.bundle.js +0 -1
  174. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.7c69f17d842172804b2c.js +0 -1
  175. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.bf68c8ab6c905f205d45.js +0 -1
  176. notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.de9e68f80570f96cb86a.js +0 -1
  177. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  178. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  179. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  180. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  181. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  182. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  183. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  184. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  185. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  186. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  187. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  188. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  189. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  190. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  191. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  192. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  193. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  194. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  195. {notebook-7.1.0rc1.data → notebook-7.1.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  196. {notebook-7.1.0rc1.dist-info → notebook-7.1.1.dist-info}/WHEEL +0 -0
  197. {notebook-7.1.0rc1.dist-info → notebook-7.1.1.dist-info}/entry_points.txt +0 -0
  198. {notebook-7.1.0rc1.dist-info → notebook-7.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -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){const t=document.documentElement.lang||"en",o=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),r=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(r/e.milliseconds);if(0!==t)return o.format(t,e.name)}return o.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(""),b=!1,y=0;y<v.length;y++)if("-"!==(d=g.slice(y+2))){if(/[A-Za-z]/.test(v[y])&&"="===d[0]){u(v[y],d.slice(1),g),b=!0;break}if(/[A-Za-z]/.test(v[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[y],d,g),b=!0;break}if(v[y+1]&&v[y+1].match(/\W/)){u(v[y],g.slice(y+2),g),b=!0;break}u(v[y],!r.strings[v[y]]||"",g)}else u(v[y],d,g);h=g.slice(-1)[0],b||"-"===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,b=p.slice(),y=typeof t,w=this,C=0;for("object"!==y&&"string"!==y&&(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)))&&(b[3]=[/(.*)/,"pathname"]);C<b.length;C++)"function"!=typeof(l=b[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(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(87879),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)}}},87879:(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){const t=document.documentElement.lang||"en",o=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),r=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(r/e.milliseconds);if(0!==t)return o.format(t,e.name)}return o.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(""),b=!1,y=0;y<v.length;y++)if("-"!==(d=g.slice(y+2))){if(/[A-Za-z]/.test(v[y])&&"="===d[0]){u(v[y],d.slice(1),g),b=!0;break}if(/[A-Za-z]/.test(v[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[y],d,g),b=!0;break}if(v[y+1]&&v[y+1].match(/\W/)){u(v[y],g.slice(y+2),g),b=!0;break}u(v[y],!r.strings[v[y]]||"",g)}else u(v[y],d,g);h=g.slice(-1)[0],b||"-"===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,b=p.slice(),y=typeof t,w=this,C=0;for("object"!==y&&"string"!==y&&(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)))&&(b[3]=[/(.*)/,"pathname"]);C<b.length;C++)"function"!=typeof(l=b[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(98244),i=o(70397),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(87718),p=o(80864),c=o(42539),u=o(20998),f=o(31516);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(57797),i=o(52018),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(69072),p=o(6312),c=o(11523),u=o(20998),f=o(31516);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:()=>E,Completer:()=>b,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>G,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>k,HistoryInlineCompletionProvider:()=>$,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>V,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>L,KernelCompleterProvider:()=>H,ProviderReconciliator:()=>M,completerWidgetIcon:()=>K,inlineCompleterIcon:()=>U});var s,n,o=i(69319),r=i(70788),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.onTextChanged,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.onTextChanged,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)}_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(void 0===s||e.column<s.length)return;const n=this._composeRequest(i,e),o=this.inlineCompleter.model;if(!o)return;o.cursor=e;const r=++this._fetchingInline,l=this._reconciliator.fetchInline(n,t),a=new Set;for(const e of l)e.then((t=>{t&&t.items&&r===this._fetchingInline&&(a.add(e),1===a.size?o.setCompletions(t):o.appendCompletions(t))})).catch((e=>{console.warn(e)})).finally((()=>{a.add(e);const t=l.length-a.size;o.notifyProgress({pendingProviders:t,totalProviders:l.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(98244),f=i(8627),C=i(70397),y=i(18395),w=i(31516);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),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 M{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,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 E="CompletionProvider:context";class k{constructor(){this.identifier=E,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,q=i(30890),O=i(17811);class R{constructor(e){this.options=e}placeGhost(e,t){const i=[A.addMark.of(t)];e.state.field(A.markField,!1)||(i.push(O.StateEffect.appendConfig.of([A.markField])),i.push(O.StateEffect.appendConfig.of([q.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[A.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[A.removeMark.of(null)];e.dispatch({effects:t})}}R.streamingAnimation="uncover";class W extends q.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming}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=R.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_updateDOM(e){const t=this.content;let i=this.options.addedPart;if(i&&!this.isSpacer){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.isSpacer&&this.options.streaming){const t=document.createElement("span");t.className="jp-GhostText-streamingIndicator",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 j extends W{constructor(){super(...arguments),this.isSpacer=!0}}class N extends j{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e}}class z extends j{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}!function(e){let t;function i(e,t){return q.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=O.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=O.StateEffect.define(),e.markField=O.StateField.define({create:()=>q.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 j&&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 j;)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=q.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s}),o=q.Decoration.widget({widget:new N(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),q.Decoration.none}return s}}},provide:e=>q.EditorView.decorations.from(e)})}(A||(A={}));const B="jp-mod-inline-completer-active",F="jp-InlineCompleter-hover";class V 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=V.defaultSettings.showShortcuts,this._showWidget=V.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 R({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()),R.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(B),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(B))}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)}),i.host.classList.add(B)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(F)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(F)),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{n=i.getCoordinateForPosition(t.cursor)}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))}}}(V||(V={}));class G{constructor(){this._activeProviders=new Set([L,E]),this._inlineCompleterSettings=V.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}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(E)),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),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,this._panelHandlers.forEach(((t,i)=>{for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);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 M({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 V.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 U=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'}),K=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 Z=i(42539);class ${constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||Z.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:()=>E,Completer:()=>b,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>G,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>k,HistoryInlineCompletionProvider:()=>$,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>V,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>L,KernelCompleterProvider:()=>H,ProviderReconciliator:()=>M,completerWidgetIcon:()=>K,inlineCompleterIcon:()=>U});var s,n,o=i(2749),r=i(74787),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(void 0===s||e.column<s.length)return;const n=this._composeRequest(i,e),o=this.inlineCompleter.model;if(!o)return;o.cursor=e;const r=++this._fetchingInline,l=this._reconciliator.fetchInline(n,t),a=new Set;for(const e of l)e.then((t=>{t&&t.items&&r===this._fetchingInline&&(a.add(e),1===a.size?o.setCompletions(t):o.appendCompletions(t))})).catch((e=>{console.warn(e)})).finally((()=>{a.add(e);const t=l.length-a.size;o.notifyProgress({pendingProviders:t,totalProviders:l.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(57797),f=i(56761),C=i(52018),y=i(18395),w=i(31516);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),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 M{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,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 E="CompletionProvider:context";class k{constructor(){this.identifier=E,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,q=i(30890),O=i(17811);class R{constructor(e){this.options=e}placeGhost(e,t){const i=[A.addMark.of(t)];e.state.field(A.markField,!1)||(i.push(O.StateEffect.appendConfig.of([A.markField])),i.push(O.StateEffect.appendConfig.of([q.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[A.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[A.removeMark.of(null)];e.dispatch({effects:t})}}R.streamingAnimation="uncover";class W extends q.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming}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=R.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_updateDOM(e){const t=this.content;let i=this.options.addedPart;if(i&&!this.isSpacer){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.isSpacer&&this.options.streaming){const t=document.createElement("span");t.className="jp-GhostText-streamingIndicator",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 j extends W{constructor(){super(...arguments),this.isSpacer=!0}}class N extends j{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e}}class z extends j{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}!function(e){let t;function i(e,t){return q.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=O.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=O.StateEffect.define(),e.markField=O.StateField.define({create:()=>q.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 j&&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 j;)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=q.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s}),o=q.Decoration.widget({widget:new N(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),q.Decoration.none}return s}}},provide:e=>q.EditorView.decorations.from(e)})}(A||(A={}));const B="jp-mod-inline-completer-active",F="jp-InlineCompleter-hover";class V 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=V.defaultSettings.showShortcuts,this._showWidget=V.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 R({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()),R.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(B),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(B))}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)}),i.host.classList.add(B)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(F)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(F)),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{n=i.getCoordinateForPosition(t.cursor)}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))}}}(V||(V={}));class G{constructor(){this._activeProviders=new Set([L,E]),this._inlineCompleterSettings=V.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}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(E)),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),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,this._panelHandlers.forEach(((t,i)=>{for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);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 M({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 V.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 U=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'}),K=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 Z=i(11523);class ${constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||Z.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 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3129,9268],{79268:(e,n,r)=>{r.r(n),r.d(n,{createMarkdownParser:()=>l,default:()=>u});var t=r(20998),a=r(70788),i=r(88546),o=r(8627),s=r(30986);const c="```~~~";function l(e,n){return{render:r=>d.render(r,e,n)}}const u={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:o.IMarkdownParser,requires:[i.IEditorLanguageRegistry],optional:[s.IMermaidMarkdown],activate:(e,n,r)=>l(n,{blocks:r?[r]:[]})};var d;!function(e){let n=null,i=null,o=[],s=null,l={},u=new a.LruCache;async function d(e){if(i)return i;if(n)return await n.promise;o=(null==e?void 0:e.blocks)||[],o=o.sort(((e,n)=>{var r,t;return(null!==(r=e.rank)&&void 0!==r?r:1/0)-(null!==(t=n.rank)&&void 0!==t?t:1/0)})),n=new t.PromiseDelegate;const[{marked:a,Renderer:s},c]=await Promise.all([r.e(4329).then(r.t.bind(r,74329,23)),f()]);for(const e of c)a.use(e);return l={async:!0,gfm:!0,walkTokens:w,renderer:g(s)},i=a,n.resolve(i),i}async function f(){return Promise.all([(async()=>(await r.e(4152).then(r.t.bind(r,24152,23))).gfmHeadingId())(),(async()=>(await r.e(9853).then(r.t.bind(r,29853,23))).mangle())()])}function g(e){const n=new e,r=n.code;return n.code=(e,t)=>{for(const n of o)if(n.languages.includes(t)){const r=n.render(e);if(null!=r)return r}const a=`${t}${c}${e}${c}`,i=u.get(a);return null!=i?i:r.call(n,e,t)},n}async function w(e){if("code"===e.type){if(e.lang)for(const n of o)if(n.languages.includes(e.lang))return void await n.walk(e.text);await async function(e){const{lang:n,text:r}=e;if(!n||!s)return;const t=`${n}${c}${r}${c}`;if(u.get(t))return;const a=document.createElement("div");try{await s.highlight(r,s.findBest(n),a);const e=`<pre><code class="language-${n}">${a.innerHTML}</code></pre>`;u.set(t,e)}catch(e){console.error(`Failed to highlight ${n} code`,e)}finally{a.remove()}}(e)}}e.render=async function(e,n,r){return s=n,i||(i=await d(r)),i(e,l)},e.initializeMarked=d}(d||(d={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3129,9268],{79268:(e,n,r)=>{r.r(n),r.d(n,{createMarkdownParser:()=>l,default:()=>u});var t=r(20998),a=r(74787),i=r(37682),o=r(56761),s=r(34605);const c="```~~~";function l(e,n){return{render:r=>d.render(r,e,n)}}const u={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:o.IMarkdownParser,requires:[i.IEditorLanguageRegistry],optional:[s.IMermaidMarkdown],activate:(e,n,r)=>l(n,{blocks:r?[r]:[]})};var d;!function(e){let n=null,i=null,o=[],s=null,l={},u=new a.LruCache;async function d(e){if(i)return i;if(n)return await n.promise;o=(null==e?void 0:e.blocks)||[],o=o.sort(((e,n)=>{var r,t;return(null!==(r=e.rank)&&void 0!==r?r:1/0)-(null!==(t=n.rank)&&void 0!==t?t:1/0)})),n=new t.PromiseDelegate;const[{marked:a,Renderer:s},c]=await Promise.all([r.e(4329).then(r.t.bind(r,74329,23)),f()]);for(const e of c)a.use(e);return l={async:!0,gfm:!0,walkTokens:w,renderer:g(s)},i=a,n.resolve(i),i}async function f(){return Promise.all([(async()=>(await r.e(4152).then(r.t.bind(r,24152,23))).gfmHeadingId())(),(async()=>(await r.e(9853).then(r.t.bind(r,29853,23))).mangle())()])}function g(e){const n=new e,r=n.code;return n.code=(e,t)=>{for(const n of o)if(n.languages.includes(t)){const r=n.render(e);if(null!=r)return r}const a=`${t}${c}${e}${c}`,i=u.get(a);return null!=i?i:r.call(n,e,t)},n}async function w(e){if("code"===e.type){if(e.lang)for(const n of o)if(n.languages.includes(e.lang))return void await n.walk(e.text);await async function(e){const{lang:n,text:r}=e;if(!n||!s)return;const t=`${n}${c}${r}${c}`;if(u.get(t))return;const a=document.createElement("div");try{await s.highlight(r,s.findBest(n),a);const e=`<pre><code class="language-${n}">${a.innerHTML}</code></pre>`;u.set(t,e)}catch(e){console.error(`Failed to highlight ${n} code`,e)}finally{a.remove()}}(e)}}e.render=async function(e,n,r){return s=n,i||(i=await d(r)),i(e,l)},e.initializeMarked=d}(d||(d={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3146,4837],{73146:(e,t,o)=>{o.r(t),o.d(t,{INotebookTree:()=>n,NotebookTreeWidget:()=>s});var r=o(70397),a=o(31516);class s extends a.TabPanel{constructor(){super({tabPlacement:"top",tabsMovable:!0,renderer:r.TabBarSvg.defaultRenderer}),this.addClass("jp-TreePanel")}}const n=new(o(20998).Token)("@jupyter-notebook/tree:INotebookTree")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3146,771],{73146:(e,t,o)=>{o.r(t),o.d(t,{INotebookTree:()=>n,NotebookTreeWidget:()=>s});var r=o(52018),a=o(31516);class s extends a.TabPanel{constructor(){super({tabPlacement:"top",tabsMovable:!0,renderer:r.TabBarSvg.defaultRenderer}),this.addClass("jp-TreePanel")}}const n=new(o(20998).Token)("@jupyter-notebook/tree:INotebookTree")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3154],{43154:(e,t,s)=>{s.d(t,{diagram:()=>_});var o=s(75343),i=s(67406),a=s(23617),r=s(24028),n=s(86281);s(27693),s(7608),s(86599),s(7259),s(81779);const d="rect",l="rectWithTitle",c="statediagram",p=`${c}-state`,b="transition",g=`${b} note-edge`,h=`${c}-note`,u=`${c}-cluster`,y=`${c}-cluster-alt`,f="parent",w="note",x="----",T=`${x}${w}`,$=`${x}${f}`,m="fill:none",S="fill: #333",k="text",A="normal";let D={},B=0;function v(e="",t=0,s="",o=x){return`state-${e}${null!==s&&s.length>0?`${o}${s}`:""}-${t}`}const E=(e,t,s,i,a,n)=>{const c=s.id,b=null==(x=i[c])?"":x.classes?x.classes.join(" "):"";var x;if("root"!==c){let t=d;!0===s.start&&(t="start"),!1===s.start&&(t="end"),s.type!==o.D&&(t=s.type),D[c]||(D[c]={id:c,shape:t,description:r.e.sanitizeText(c,(0,r.c)()),classes:`${b} ${p}`});const i=D[c];s.description&&(Array.isArray(i.description)?(i.shape=l,i.description.push(s.description)):i.description.length>0?(i.shape=l,i.description===c?i.description=[s.description]:i.description=[i.description,s.description]):(i.shape=d,i.description=s.description),i.description=r.e.sanitizeTextOrArray(i.description,(0,r.c)())),1===i.description.length&&i.shape===l&&(i.shape=d),!i.type&&s.doc&&(r.l.info("Setting cluster for ",c,C(s)),i.type="group",i.dir=C(s),i.shape=s.type===o.a?"divider":"roundedWithTitle",i.classes=i.classes+" "+u+" "+(n?y:""));const a={labelStyle:"",shape:i.shape,labelText:i.description,classes:i.classes,style:"",id:c,dir:i.dir,domId:v(c,B),type:i.type,padding:15,centerLabel:!0};if(s.note){const t={labelStyle:"",shape:"note",labelText:s.note.text,classes:h,style:"",id:c+T+"-"+B,domId:v(c,B,w),type:i.type,padding:15},o={labelStyle:"",shape:"noteGroup",labelText:s.note.text,classes:i.classes,style:"",id:c+$,domId:v(c,B,f),type:"group",padding:0};B++;const r=c+$;e.setNode(r,o),e.setNode(t.id,t),e.setNode(c,a),e.setParent(c,r),e.setParent(t.id,r);let n=c,d=t.id;"left of"===s.note.position&&(n=t.id,d=c),e.setEdge(n,d,{arrowhead:"none",arrowType:"",style:m,labelStyle:"",classes:g,arrowheadStyle:S,labelpos:"c",labelType:k,thickness:A})}else e.setNode(c,a)}t&&"root"!==t.id&&(r.l.trace("Setting node ",c," to be child of its parent ",t.id),e.setParent(c,t.id)),s.doc&&(r.l.trace("Adding nodes children "),R(e,s,s.doc,i,a,!n))},R=(e,t,s,i,a,n)=>{r.l.trace("items",s),s.forEach((s=>{switch(s.stmt){case o.b:case o.D:E(e,t,s,i,a,n);break;case o.S:{E(e,t,s.state1,i,a,n),E(e,t,s.state2,i,a,n);const o={id:"edge"+B,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:m,labelStyle:"",label:r.e.sanitizeText(s.description,(0,r.c)()),arrowheadStyle:S,labelpos:"c",labelType:k,thickness:A,classes:b};e.setEdge(s.state1.id,s.state2.id,o,B),B++}}}))},C=(e,t=o.c)=>{let s=t;if(e.doc)for(let t=0;t<e.doc.length;t++){const o=e.doc[t];"dir"===o.stmt&&(s=o.value)}return s},P={setConf:function(e){const t=Object.keys(e);for(const s of t)e[s]},getClasses:function(e,t){return t.db.extract(t.db.getRootDocV2()),t.db.getClasses()},draw:async function(e,t,s,o){r.l.info("Drawing state diagram (v2)",t),D={},o.db.getDirection();const{securityLevel:l,state:p}=(0,r.c)(),b=p.nodeSpacing||50,g=p.rankSpacing||50;r.l.info(o.db.getRootDocV2()),o.db.extract(o.db.getRootDocV2()),r.l.info(o.db.getRootDocV2());const h=o.db.getStates(),u=new i.k({multigraph:!0,compound:!0}).setGraph({rankdir:C(o.db.getRootDocV2()),nodesep:b,ranksep:g,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));let y;E(u,void 0,o.db.getRootDocV2(),h,o.db,!0),"sandbox"===l&&(y=(0,a.Ys)("#i"+t));const f="sandbox"===l?(0,a.Ys)(y.nodes()[0].contentDocument.body):(0,a.Ys)("body"),w=f.select(`[id="${t}"]`),x=f.select("#"+t+" g");await(0,n.r)(x,u,["barb"],c,t),r.u.insertTitle(w,"statediagramTitleText",p.titleTopMargin,o.db.getDiagramTitle());const T=w.node().getBBox(),$=T.width+16,m=T.height+16;w.attr("class",c);const S=w.node().getBBox();(0,r.i)(w,m,$,p.useMaxWidth);const k=`${S.x-8} ${S.y-8} ${$} ${m}`;r.l.debug(`viewBox ${k}`),w.attr("viewBox",k);const A=document.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const e of A){const t=e.getBBox(),s=document.createElementNS("http://www.w3.org/2000/svg",d);s.setAttribute("rx",0),s.setAttribute("ry",0),s.setAttribute("width",t.width),s.setAttribute("height",t.height),e.insertBefore(s,e.firstChild)}}},_={parser:o.p,db:o.d,renderer:P,styles:o.s,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,o.d.clear()}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3154],{43154:(e,t,s)=>{s.d(t,{diagram:()=>_});var o=s(75343),i=s(67406),a=s(23617),r=s(24028),n=s(86281);s(27693),s(7608),s(31699),s(7259),s(58038);const d="rect",l="rectWithTitle",c="statediagram",p=`${c}-state`,b="transition",g=`${b} note-edge`,h=`${c}-note`,u=`${c}-cluster`,y=`${c}-cluster-alt`,f="parent",w="note",x="----",T=`${x}${w}`,$=`${x}${f}`,m="fill:none",S="fill: #333",k="text",A="normal";let D={},B=0;function v(e="",t=0,s="",o=x){return`state-${e}${null!==s&&s.length>0?`${o}${s}`:""}-${t}`}const E=(e,t,s,i,a,n)=>{const c=s.id,b=null==(x=i[c])?"":x.classes?x.classes.join(" "):"";var x;if("root"!==c){let t=d;!0===s.start&&(t="start"),!1===s.start&&(t="end"),s.type!==o.D&&(t=s.type),D[c]||(D[c]={id:c,shape:t,description:r.e.sanitizeText(c,(0,r.c)()),classes:`${b} ${p}`});const i=D[c];s.description&&(Array.isArray(i.description)?(i.shape=l,i.description.push(s.description)):i.description.length>0?(i.shape=l,i.description===c?i.description=[s.description]:i.description=[i.description,s.description]):(i.shape=d,i.description=s.description),i.description=r.e.sanitizeTextOrArray(i.description,(0,r.c)())),1===i.description.length&&i.shape===l&&(i.shape=d),!i.type&&s.doc&&(r.l.info("Setting cluster for ",c,C(s)),i.type="group",i.dir=C(s),i.shape=s.type===o.a?"divider":"roundedWithTitle",i.classes=i.classes+" "+u+" "+(n?y:""));const a={labelStyle:"",shape:i.shape,labelText:i.description,classes:i.classes,style:"",id:c,dir:i.dir,domId:v(c,B),type:i.type,padding:15,centerLabel:!0};if(s.note){const t={labelStyle:"",shape:"note",labelText:s.note.text,classes:h,style:"",id:c+T+"-"+B,domId:v(c,B,w),type:i.type,padding:15},o={labelStyle:"",shape:"noteGroup",labelText:s.note.text,classes:i.classes,style:"",id:c+$,domId:v(c,B,f),type:"group",padding:0};B++;const r=c+$;e.setNode(r,o),e.setNode(t.id,t),e.setNode(c,a),e.setParent(c,r),e.setParent(t.id,r);let n=c,d=t.id;"left of"===s.note.position&&(n=t.id,d=c),e.setEdge(n,d,{arrowhead:"none",arrowType:"",style:m,labelStyle:"",classes:g,arrowheadStyle:S,labelpos:"c",labelType:k,thickness:A})}else e.setNode(c,a)}t&&"root"!==t.id&&(r.l.trace("Setting node ",c," to be child of its parent ",t.id),e.setParent(c,t.id)),s.doc&&(r.l.trace("Adding nodes children "),R(e,s,s.doc,i,a,!n))},R=(e,t,s,i,a,n)=>{r.l.trace("items",s),s.forEach((s=>{switch(s.stmt){case o.b:case o.D:E(e,t,s,i,a,n);break;case o.S:{E(e,t,s.state1,i,a,n),E(e,t,s.state2,i,a,n);const o={id:"edge"+B,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:m,labelStyle:"",label:r.e.sanitizeText(s.description,(0,r.c)()),arrowheadStyle:S,labelpos:"c",labelType:k,thickness:A,classes:b};e.setEdge(s.state1.id,s.state2.id,o,B),B++}}}))},C=(e,t=o.c)=>{let s=t;if(e.doc)for(let t=0;t<e.doc.length;t++){const o=e.doc[t];"dir"===o.stmt&&(s=o.value)}return s},P={setConf:function(e){const t=Object.keys(e);for(const s of t)e[s]},getClasses:function(e,t){return t.db.extract(t.db.getRootDocV2()),t.db.getClasses()},draw:async function(e,t,s,o){r.l.info("Drawing state diagram (v2)",t),D={},o.db.getDirection();const{securityLevel:l,state:p}=(0,r.c)(),b=p.nodeSpacing||50,g=p.rankSpacing||50;r.l.info(o.db.getRootDocV2()),o.db.extract(o.db.getRootDocV2()),r.l.info(o.db.getRootDocV2());const h=o.db.getStates(),u=new i.k({multigraph:!0,compound:!0}).setGraph({rankdir:C(o.db.getRootDocV2()),nodesep:b,ranksep:g,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));let y;E(u,void 0,o.db.getRootDocV2(),h,o.db,!0),"sandbox"===l&&(y=(0,a.Ys)("#i"+t));const f="sandbox"===l?(0,a.Ys)(y.nodes()[0].contentDocument.body):(0,a.Ys)("body"),w=f.select(`[id="${t}"]`),x=f.select("#"+t+" g");await(0,n.r)(x,u,["barb"],c,t),r.u.insertTitle(w,"statediagramTitleText",p.titleTopMargin,o.db.getDiagramTitle());const T=w.node().getBBox(),$=T.width+16,m=T.height+16;w.attr("class",c);const S=w.node().getBBox();(0,r.i)(w,m,$,p.useMaxWidth);const k=`${S.x-8} ${S.y-8} ${$} ${m}`;r.l.debug(`viewBox ${k}`),w.attr("viewBox",k);const A=document.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const e of A){const t=e.getBBox(),s=document.createElementNS("http://www.w3.org/2000/svg",d);s.setAttribute("rx",0),s.setAttribute("ry",0),s.setAttribute("width",t.width),s.setAttribute("height",t.height),e.insertBefore(s,e.firstChild)}}},_={parser:o.p,db:o.d,renderer:P,styles:o.s,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,o.d.clear()}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3187],{53187:(e,n,a)=>{a.r(n),a.d(n,{default:()=>d});var l,r=a(17260),t=a(98244),i=a(42539),o=a(70397),s=a(26246);!function(e){e.open="pluginmanager:open",e.refreshPlugins="pluginmanager:refresh"}(l||(l={}));const u="@jupyterlab/pluginmanager-extension:plugin",d=[{id:u,description:"Enable or disable individual plugins.",autoStart:!0,requires:[],optional:[i.ITranslator,t.ICommandPalette,r.ILayoutRestorer],provides:s.IPluginManager,activate:(e,n,a,r)=>{const{commands:d,shell:c}=e,g=(n=null!=n?n:i.nullTranslator).load("jupyterlab"),p=g.__("Plugin Manager"),m=g.__("Advanced Plugin Manager"),P=g.__("Refresh Plugin List"),b=new t.WidgetTracker({namespace:"plugin-manager"});return d.addCommand(l.open,{label:m,execute:a=>{const r=function(a){const r=new s.PluginListModel({...a,pluginData:{availablePlugins:e.info.availablePlugins},serverSettings:e.serviceManager.serverSettings,extraLockedPlugins:[u,"@jupyterlab/application-extension:layout","@jupyterlab/apputils-extension:resolver"],translator:null!=n?n:i.nullTranslator}),c=new s.Plugins({model:r,translator:null!=n?n:i.nullTranslator});c.title.label=m,c.title.icon=o.extensionIcon,c.title.caption=g.__("Plugin Manager");const p=new t.MainAreaWidget({content:c,reveal:r.ready});return p.toolbar.addItem("refresh-plugins",new o.CommandToolbarButton({id:l.refreshPlugins,args:{noLabel:!0},commands:d})),p}(a);return c.add(r,"main",{type:"Plugins"}),b.add(r),r.content.model.trackerDataChanged.connect((()=>{b.save(r)})),r}}),d.addCommand(l.refreshPlugins,{label:e=>e.noLabel?"":P,caption:g.__("Refresh plugins list"),icon:o.refreshIcon,execute:async()=>{var e;return null===(e=b.currentWidget)||void 0===e?void 0:e.content.model.refresh().catch((e=>{console.error(`Failed to refresh the available plugins list:\n${e}`)}))}}),a&&a.addItem({command:l.open,category:p}),r&&r.restore(b,{command:l.open,name:e=>"plugins",args:e=>{const{query:n,isDisclaimed:a}=e.content.model;return{query:n,isDisclaimed:a}}}),{open:()=>e.commands.execute(l.open)}}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3187],{53187:(e,n,a)=>{a.r(n),a.d(n,{default:()=>d});var l,r=a(49880),t=a(57797),i=a(11523),o=a(52018),s=a(24224);!function(e){e.open="pluginmanager:open",e.refreshPlugins="pluginmanager:refresh"}(l||(l={}));const u="@jupyterlab/pluginmanager-extension:plugin",d=[{id:u,description:"Enable or disable individual plugins.",autoStart:!0,requires:[],optional:[i.ITranslator,t.ICommandPalette,r.ILayoutRestorer],provides:s.IPluginManager,activate:(e,n,a,r)=>{const{commands:d,shell:c}=e,g=(n=null!=n?n:i.nullTranslator).load("jupyterlab"),p=g.__("Plugin Manager"),m=g.__("Advanced Plugin Manager"),P=g.__("Refresh Plugin List"),b=new t.WidgetTracker({namespace:"plugin-manager"});return d.addCommand(l.open,{label:m,execute:a=>{const r=function(a){const r=new s.PluginListModel({...a,pluginData:{availablePlugins:e.info.availablePlugins},serverSettings:e.serviceManager.serverSettings,extraLockedPlugins:[u,"@jupyterlab/application-extension:layout","@jupyterlab/apputils-extension:resolver"],translator:null!=n?n:i.nullTranslator}),c=new s.Plugins({model:r,translator:null!=n?n:i.nullTranslator});c.title.label=m,c.title.icon=o.extensionIcon,c.title.caption=g.__("Plugin Manager");const p=new t.MainAreaWidget({content:c,reveal:r.ready});return p.toolbar.addItem("refresh-plugins",new o.CommandToolbarButton({id:l.refreshPlugins,args:{noLabel:!0},commands:d})),p}(a);return c.add(r,"main",{type:"Plugins"}),b.add(r),r.content.model.trackerDataChanged.connect((()=>{b.save(r)})),r}}),d.addCommand(l.refreshPlugins,{label:e=>e.noLabel?"":P,caption:g.__("Refresh plugins list"),icon:o.refreshIcon,execute:async()=>{var e;return null===(e=b.currentWidget)||void 0===e?void 0:e.content.model.refresh().catch((e=>{console.error(`Failed to refresh the available plugins list:\n${e}`)}))}}),a&&a.addItem({command:l.open,category:p}),r&&r.restore(b,{command:l.open,name:e=>"plugins",args:e=>{const{query:n,isDisclaimed:a}=e.content.model;return{query:n,isDisclaimed:a}}}),{open:()=>e.commands.execute(l.open)}}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3213],{53213:(e,t,s)=>{s.r(t),s.d(t,{ITerminal:()=>o,ITerminalTracker:()=>n,Terminal:()=>l});var i=s(20998);const n=new i.Token("@jupyterlab/terminal:ITerminalTracker","A widget tracker for terminals.\n Use this if you want to be able to iterate over and interact with terminals\n created by the application.");var o;!function(e){e.defaultOptions={theme:"inherit",fontFamily:'Menlo, Consolas, "DejaVu Sans Mono", monospace',fontSize:13,lineHeight:1,scrollback:1e3,shutdownOnClose:!1,closeOnExit:!0,cursorBlink:!0,initialCommand:"",screenReaderMode:!1,pasteWithCtrlV:!0,autoFit:!0,macOptionIsMeta:!1}}(o||(o={}));var r,a=s(42539),h=s(18395),c=s(49503),d=s(31516);class l extends d.Widget{constructor(e,t={},s){super(),this._needsResize=!0,this._offsetWidth=-1,this._offsetHeight=-1,this._isReady=!1,this._ready=new i.PromiseDelegate,this._termOpened=!1,s=s||a.nullTranslator,this._trans=s.load("jupyterlab"),this.session=e,this._options={...o.defaultOptions,...t};const{theme:n,...h}=this._options,c={theme:r.getXTermTheme(n),...h};this.addClass("jp-Terminal"),this._setThemeAttribute(n);let d="";const l=(e,t)=>{"stdout"===t.type&&t.content&&(d+=t.content[0])};e.messageReceived.connect(l),e.disposed.connect((()=>{this.getOption("closeOnExit")&&this.dispose()}),this),r.createTerminal(c).then((([t,s])=>{this._term=t,this._fitAddon=s,this._initializeTerm(),this.id="jp-Terminal-"+r.id++,this.title.label=this._trans.__("Terminal"),this._isReady=!0,this._ready.resolve(),d&&this._term.write(d),e.messageReceived.disconnect(l),e.messageReceived.connect(this._onMessage,this),"connected"===e.connectionStatus?this._initialConnection():e.connectionStatusChanged.connect(this._initialConnection,this),this.update()})).catch((e=>{console.error("Failed to create a terminal.\n",e),this._ready.reject(e)}))}get ready(){return this._ready.promise}getOption(e){return this._options[e]}setOption(e,t){if("theme"===e||this._options[e]!==t&&"initialCommand"!==e){switch(this._options[e]=t,e){case"fontFamily":this._term.options.fontFamily=t;break;case"fontSize":this._term.options.fontSize=t;break;case"lineHeight":this._term.options.lineHeight=t;break;case"screenReaderMode":this._term.options.screenReaderMode=t;break;case"scrollback":this._term.options.scrollback=t;break;case"theme":this._term.options.theme={...r.getXTermTheme(t)},this._setThemeAttribute(t);break;case"macOptionIsMeta":this._term.options.macOptionIsMeta=t}this._needsResize=!0,this.update()}}dispose(){this.session.isDisposed||this.getOption("shutdownOnClose")&&this.session.shutdown().catch((e=>{console.error(`Terminal not shut down: ${e}`)})),this.ready.then((()=>{this._term.dispose()})),super.dispose()}async refresh(){!this.isDisposed&&this._isReady&&(await this.session.reconnect(),this._term.clear())}hasSelection(){return!(this.isDisposed||!this._isReady)&&this._term.hasSelection()}paste(e){if(!this.isDisposed&&this._isReady)return this._term.paste(e)}getSelection(){return!this.isDisposed&&this._isReady?this._term.getSelection():null}processMessage(e){super.processMessage(e),"fit-request"===e.type&&this.onFitRequest(e)}onAfterAttach(e){this.update()}onAfterShow(e){this.update()}onResize(e){this._offsetWidth=e.width,this._offsetHeight=e.height,this._needsResize=!0,this.update()}onUpdateRequest(e){var t;this.isVisible&&this.isAttached&&this._isReady&&(this._termOpened||(this._term.open(this.node),null===(t=this._term.element)||void 0===t||t.classList.add("jp-Terminal-body"),this._termOpened=!0),this._needsResize&&this._resizeTerminal())}onFitRequest(e){const t=d.Widget.ResizeMessage.UnknownSize;c.MessageLoop.sendMessage(this,t)}onActivateRequest(e){var t;null===(t=this._term)||void 0===t||t.focus()}_initialConnection(){this.isDisposed||"connected"===this.session.connectionStatus&&(this.title.label=this._trans.__("Terminal %1",this.session.name),this._setSessionSize(),this._options.initialCommand&&this.session.send({type:"stdin",content:[this._options.initialCommand+"\r"]}),this.session.connectionStatusChanged.disconnect(this._initialConnection,this))}_initializeTerm(){const e=this._term;e.onData((e=>{this.isDisposed||this.session.send({type:"stdin",content:[e]})})),e.onTitleChange((e=>{this.title.label=e})),h.Platform.IS_MAC||e.attachCustomKeyEventHandler((t=>!(t.ctrlKey&&"c"===t.key&&e.hasSelection()||t.ctrlKey&&"v"===t.key&&this._options.pasteWithCtrlV)))}_onMessage(e,t){switch(t.type){case"stdout":t.content&&this._term.write(t.content[0]);break;case"disconnect":this._term.write("\r\n\r\n[Finished… Term Session]\r\n")}}_resizeTerminal(){this._options.autoFit&&this._fitAddon.fit(),-1===this._offsetWidth&&(this._offsetWidth=this.node.offsetWidth),-1===this._offsetHeight&&(this._offsetHeight=this.node.offsetHeight),this._setSessionSize(),this._needsResize=!1}_setSessionSize(){const e=[this._term.rows,this._term.cols,this._offsetHeight,this._offsetWidth];this.isDisposed||this.session.send({type:"set_size",content:e})}_setThemeAttribute(e){this.isDisposed||this.node.setAttribute("data-term-theme",e?e.toLowerCase():"inherit")}}!function(e){e.id=0,e.lightTheme={foreground:"#000",background:"#fff",cursor:"#616161",cursorAccent:"#F5F5F5",selectionBackground:"rgba(97, 97, 97, 0.3)",selectionInactiveBackground:"rgba(189, 189, 189, 0.3)"},e.darkTheme={foreground:"#fff",background:"#000",cursor:"#fff",cursorAccent:"#000",selectionBackground:"rgba(255, 255, 255, 0.3)",selectionInactiveBackground:"rgba(238, 238, 238, 0.3)"},e.inheritTheme=()=>({foreground:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color0").trim(),background:getComputedStyle(document.body).getPropertyValue("--jp-layout-color0").trim(),cursor:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color1").trim(),cursorAccent:getComputedStyle(document.body).getPropertyValue("--jp-ui-inverse-font-color0").trim(),selectionBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color3").trim(),selectionInactiveBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color2").trim()}),e.getXTermTheme=function(t){switch(t){case"light":return e.lightTheme;case"dark":return e.darkTheme;default:return e.inheritTheme()}}}(r||(r={})),function(e){let t,i,n,o,r=!1;function a(e){let t=new o;e.loadAddon(t),r&&t.onContextLoss((s=>{console.debug("WebGL context lost - reinitialize Xtermjs renderer."),t.dispose(),a(e)}))}e.createTerminal=async function(e){var h;if(!t){r=function(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");try{return t instanceof WebGLRenderingContext}catch(e){return!1}}();const[e,a,c,d]=await Promise.all([s.e(4997).then(s.t.bind(s,94997,23)),s.e(2758).then(s.t.bind(s,72758,23)),r?s.e(6467).then(s.t.bind(s,6467,23)):s.e(2094).then(s.t.bind(s,12094,23)),s.e(4928).then(s.t.bind(s,44928,23))]);t=e.Terminal,i=a.FitAddon,o=null!==(h=c.WebglAddon)&&void 0!==h?h:c.CanvasAddon,n=d.WebLinksAddon}const c=new t(e);a(c);const d=new i;return c.loadAddon(d),c.loadAddon(new n),[c,d]}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3213],{53213:(e,t,s)=>{s.r(t),s.d(t,{ITerminal:()=>o,ITerminalTracker:()=>n,Terminal:()=>l});var i=s(20998);const n=new i.Token("@jupyterlab/terminal:ITerminalTracker","A widget tracker for terminals.\n Use this if you want to be able to iterate over and interact with terminals\n created by the application.");var o;!function(e){e.defaultOptions={theme:"inherit",fontFamily:'Menlo, Consolas, "DejaVu Sans Mono", monospace',fontSize:13,lineHeight:1,scrollback:1e3,shutdownOnClose:!1,closeOnExit:!0,cursorBlink:!0,initialCommand:"",screenReaderMode:!1,pasteWithCtrlV:!0,autoFit:!0,macOptionIsMeta:!1}}(o||(o={}));var r,a=s(11523),h=s(18395),c=s(49503),d=s(31516);class l extends d.Widget{constructor(e,t={},s){super(),this._needsResize=!0,this._offsetWidth=-1,this._offsetHeight=-1,this._isReady=!1,this._ready=new i.PromiseDelegate,this._termOpened=!1,s=s||a.nullTranslator,this._trans=s.load("jupyterlab"),this.session=e,this._options={...o.defaultOptions,...t};const{theme:n,...h}=this._options,c={theme:r.getXTermTheme(n),...h};this.addClass("jp-Terminal"),this._setThemeAttribute(n);let d="";const l=(e,t)=>{"stdout"===t.type&&t.content&&(d+=t.content[0])};e.messageReceived.connect(l),e.disposed.connect((()=>{this.getOption("closeOnExit")&&this.dispose()}),this),r.createTerminal(c).then((([t,s])=>{this._term=t,this._fitAddon=s,this._initializeTerm(),this.id="jp-Terminal-"+r.id++,this.title.label=this._trans.__("Terminal"),this._isReady=!0,this._ready.resolve(),d&&this._term.write(d),e.messageReceived.disconnect(l),e.messageReceived.connect(this._onMessage,this),"connected"===e.connectionStatus?this._initialConnection():e.connectionStatusChanged.connect(this._initialConnection,this),this.update()})).catch((e=>{console.error("Failed to create a terminal.\n",e),this._ready.reject(e)}))}get ready(){return this._ready.promise}getOption(e){return this._options[e]}setOption(e,t){if("theme"===e||this._options[e]!==t&&"initialCommand"!==e){switch(this._options[e]=t,e){case"fontFamily":this._term.options.fontFamily=t;break;case"fontSize":this._term.options.fontSize=t;break;case"lineHeight":this._term.options.lineHeight=t;break;case"screenReaderMode":this._term.options.screenReaderMode=t;break;case"scrollback":this._term.options.scrollback=t;break;case"theme":this._term.options.theme={...r.getXTermTheme(t)},this._setThemeAttribute(t);break;case"macOptionIsMeta":this._term.options.macOptionIsMeta=t}this._needsResize=!0,this.update()}}dispose(){this.session.isDisposed||this.getOption("shutdownOnClose")&&this.session.shutdown().catch((e=>{console.error(`Terminal not shut down: ${e}`)})),this.ready.then((()=>{this._term.dispose()})),super.dispose()}async refresh(){!this.isDisposed&&this._isReady&&(await this.session.reconnect(),this._term.clear())}hasSelection(){return!(this.isDisposed||!this._isReady)&&this._term.hasSelection()}paste(e){if(!this.isDisposed&&this._isReady)return this._term.paste(e)}getSelection(){return!this.isDisposed&&this._isReady?this._term.getSelection():null}processMessage(e){super.processMessage(e),"fit-request"===e.type&&this.onFitRequest(e)}onAfterAttach(e){this.update()}onAfterShow(e){this.update()}onResize(e){this._offsetWidth=e.width,this._offsetHeight=e.height,this._needsResize=!0,this.update()}onUpdateRequest(e){var t;this.isVisible&&this.isAttached&&this._isReady&&(this._termOpened||(this._term.open(this.node),null===(t=this._term.element)||void 0===t||t.classList.add("jp-Terminal-body"),this._termOpened=!0),this._needsResize&&this._resizeTerminal())}onFitRequest(e){const t=d.Widget.ResizeMessage.UnknownSize;c.MessageLoop.sendMessage(this,t)}onActivateRequest(e){var t;null===(t=this._term)||void 0===t||t.focus()}_initialConnection(){this.isDisposed||"connected"===this.session.connectionStatus&&(this.title.label=this._trans.__("Terminal %1",this.session.name),this._setSessionSize(),this._options.initialCommand&&this.session.send({type:"stdin",content:[this._options.initialCommand+"\r"]}),this.session.connectionStatusChanged.disconnect(this._initialConnection,this))}_initializeTerm(){const e=this._term;e.onData((e=>{this.isDisposed||this.session.send({type:"stdin",content:[e]})})),e.onTitleChange((e=>{this.title.label=e})),h.Platform.IS_MAC||e.attachCustomKeyEventHandler((t=>!(t.ctrlKey&&"c"===t.key&&e.hasSelection()||t.ctrlKey&&"v"===t.key&&this._options.pasteWithCtrlV)))}_onMessage(e,t){switch(t.type){case"stdout":t.content&&this._term.write(t.content[0]);break;case"disconnect":this._term.write("\r\n\r\n[Finished… Term Session]\r\n")}}_resizeTerminal(){this._options.autoFit&&this._fitAddon.fit(),-1===this._offsetWidth&&(this._offsetWidth=this.node.offsetWidth),-1===this._offsetHeight&&(this._offsetHeight=this.node.offsetHeight),this._setSessionSize(),this._needsResize=!1}_setSessionSize(){const e=[this._term.rows,this._term.cols,this._offsetHeight,this._offsetWidth];this.isDisposed||this.session.send({type:"set_size",content:e})}_setThemeAttribute(e){this.isDisposed||this.node.setAttribute("data-term-theme",e?e.toLowerCase():"inherit")}}!function(e){e.id=0,e.lightTheme={foreground:"#000",background:"#fff",cursor:"#616161",cursorAccent:"#F5F5F5",selectionBackground:"rgba(97, 97, 97, 0.3)",selectionInactiveBackground:"rgba(189, 189, 189, 0.3)"},e.darkTheme={foreground:"#fff",background:"#000",cursor:"#fff",cursorAccent:"#000",selectionBackground:"rgba(255, 255, 255, 0.3)",selectionInactiveBackground:"rgba(238, 238, 238, 0.3)"},e.inheritTheme=()=>({foreground:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color0").trim(),background:getComputedStyle(document.body).getPropertyValue("--jp-layout-color0").trim(),cursor:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color1").trim(),cursorAccent:getComputedStyle(document.body).getPropertyValue("--jp-ui-inverse-font-color0").trim(),selectionBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color3").trim(),selectionInactiveBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color2").trim()}),e.getXTermTheme=function(t){switch(t){case"light":return e.lightTheme;case"dark":return e.darkTheme;default:return e.inheritTheme()}}}(r||(r={})),function(e){let t,i,n,o,r=!1;function a(e){let t=new o;e.loadAddon(t),r&&t.onContextLoss((s=>{console.debug("WebGL context lost - reinitialize Xtermjs renderer."),t.dispose(),a(e)}))}e.createTerminal=async function(e){var h;if(!t){r=function(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");try{return t instanceof WebGLRenderingContext}catch(e){return!1}}();const[e,a,c,d]=await Promise.all([s.e(4997).then(s.t.bind(s,94997,23)),s.e(2758).then(s.t.bind(s,72758,23)),r?s.e(6467).then(s.t.bind(s,6467,23)):s.e(2094).then(s.t.bind(s,12094,23)),s.e(4928).then(s.t.bind(s,44928,23))]);t=e.Terminal,i=a.FitAddon,o=null!==(h=c.WebglAddon)&&void 0!==h?h:c.CanvasAddon,n=d.WebLinksAddon}const c=new t(e);a(c);const d=new i;return c.loadAddon(d),c.loadAddon(new n),[c,d]}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3301],{43301:(e,t,n)=>{n.r(t),n.d(t,{CommandRegistry:()=>d});var i,s=n(33625),r=n(20998),a=n(2549),o=n(18395),l=n(80554),c=n(81997);class d{constructor(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new c.Signal(this),this._commandExecuted=new c.Signal(this),this._keyBindingChanged=new c.Signal(this)}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(e){return this._commands.has(e)}addCommand(e,t){if(this._commands.has(e))throw new Error(`Command '${e}' already registered.`);return this._commands.set(e,i.createCommand(t)),this._commandChanged.emit({id:e,type:"added"}),new a.DisposableDelegate((()=>{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=r.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve(null!==(n=null==i?void 0:i.describedBy.call(void 0,t))&&void 0!==n?n:{args:null})}label(e,t=r.JSONExt.emptyObject){var n;let i=this._commands.get(e);return null!==(n=null==i?void 0:i.label.call(void 0,t))&&void 0!==n?n:""}mnemonic(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(void 0,t):-1}icon(e,t=r.JSONExt.emptyObject){var n;return null===(n=this._commands.get(e))||void 0===n?void 0:n.icon.call(void 0,t)}iconClass(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(void 0,t):""}iconLabel(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(void 0,t):""}caption(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(void 0,t):""}usage(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(void 0,t):""}className(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(void 0,t):""}dataset(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(void 0,t):{}}isEnabled(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isEnabled.call(void 0,t)}isToggled(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggled.call(void 0,t)}isToggleable(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggleable}isVisible(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isVisible.call(void 0,t)}execute(e,t=r.JSONExt.emptyObject){let n,i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));try{n=i.execute.call(void 0,t)}catch(e){n=Promise.reject(e)}let s=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=i.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new a.DisposableDelegate((()=>{s.ArrayExt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(this._replaying||d.isModifierKeyPressed(e))return;let t=d.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(t);let{exact:n,partial:s}=i.matchKeyBinding(this._keyBindings,this._keystrokes,e);return n||s?(e.preventDefault(),e.stopPropagation(),n&&!s?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),i.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(i.replayKeyEvent),this._replaying=!1)}_executeKeyBinding(e){let{command:t,args:n}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(this.hasCommand(t)&&this.isEnabled(t,i))this.execute(t,i);else{let n=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${n}.`;console.warn(`${i} ${s}`)}}_clearPendingState(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}!function(e){function t(e){let t="",n=!1,i=!1,s=!1,r=!1;for(let a of e.split(/\s+/))"Accel"===a?o.Platform.IS_MAC?i=!0:s=!0:"Alt"===a?n=!0:"Cmd"===a?i=!0:"Ctrl"===a?s=!0:"Shift"===a?r=!0:a.length>0&&(t=a);return{cmd:i,ctrl:s,alt:n,shift:r,key:t}}function n(e){let n="",i=t(e);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&o.Platform.IS_MAC&&(n+="Cmd "),n+i.key}e.parseKeystroke=t,e.normalizeKeystroke=n,e.normalizeKeys=function(e){let t;return t=o.Platform.IS_WIN?e.winKeys||e.keys:o.Platform.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(n)},e.formatKeystroke=function(e){return"string"==typeof e?n(e):e.map(n).join(", ");function n(e){let n=[],s=o.Platform.IS_MAC?" ":"+",r=t(e);return r.ctrl&&n.push("Ctrl"),r.alt&&n.push("Alt"),r.shift&&n.push("Shift"),o.Platform.IS_MAC&&r.cmd&&n.push("Cmd"),n.push(r.key),n.map(i.formatKey).join(s)}},e.isModifierKeyPressed=function(e){let t=(0,l.getKeyboardLayout)(),n=t.keyForKeydownEvent(e);return t.isModifierKey(n)},e.keystrokeForKeydownEvent=function(e){let t=(0,l.getKeyboardLayout)(),n=t.keyForKeydownEvent(e);if(!n||t.isModifierKey(n))return"";let i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&o.Platform.IS_MAC&&i.push("Cmd"),i.push(n),i.join(" ")}}(d||(d={})),function(e){e.CHORD_TIMEOUT=1e3,e.createCommand=function(e){return{execute:e.execute,describedBy:h("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:h(e.label,i),mnemonic:h(e.mnemonic,s),icon:h(e.icon,m),iconClass:h(e.iconClass,i),iconLabel:h(e.iconLabel,i),caption:h(e.caption,i),usage:h(e.usage,i),className:h(e.className,i),dataset:h(e.dataset,c),isEnabled:e.isEnabled||a,isToggled:e.isToggled||l,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||a}},e.createKeyBinding=function(e){return{keys:d.normalizeKeys(e),selector:y(e),command:e.command,args:e.args||r.JSONExt.emptyObject}},e.matchKeyBinding=function(e,t,n){let i=null,s=!1,r=1/0,a=0;for(let l=0,c=e.length;l<c;++l){let c=e[l],d=u(c.keys,t);if(0===d)continue;if(2===d){s||-1===g(c.selector,n)||(s=!0);continue}let m=g(c.selector,n);if(-1===m||m>r)continue;let h=o.Selector.calculateSpecificity(c.selector);(!i||m<r||h>=a)&&(i=c,r=m,a=h)}return{exact:i,partial:s}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),n=e.bubbles||!0,i=e.cancelable||!0;return t.initEvent(e.type||"keydown",n,i),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return o.Platform.IS_MAC?t.hasOwnProperty(e)?t[e]:e:n.hasOwnProperty(e)?n[e]:e};const t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},n={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",s=()=>-1,a=()=>!0,l=()=>!1,c=()=>({}),m=()=>{};function h(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function y(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!o.Selector.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function u(e,t){if(e.length<t.length)return 0;for(let n=0,i=t.length;n<i;++n)if(e[n]!==t[n])return 0;return e.length>t.length?2:1}function g(e,t){let n=t.target,i=t.currentTarget;for(let t=0;null!==n;n=n.parentElement,++t){if(n.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.Selector.matches(n,e))return t;if(n===i)return-1}return-1}}(i||(i={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3301],{43301:(e,t,n)=>{n.r(t),n.d(t,{CommandRegistry:()=>d});var i,s=n(33625),r=n(20998),a=n(2549),o=n(18395),l=n(58114),c=n(81997);class d{constructor(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new c.Signal(this),this._commandExecuted=new c.Signal(this),this._keyBindingChanged=new c.Signal(this)}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(e){return this._commands.has(e)}addCommand(e,t){if(this._commands.has(e))throw new Error(`Command '${e}' already registered.`);return this._commands.set(e,i.createCommand(t)),this._commandChanged.emit({id:e,type:"added"}),new a.DisposableDelegate((()=>{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=r.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve(null!==(n=null==i?void 0:i.describedBy.call(void 0,t))&&void 0!==n?n:{args:null})}label(e,t=r.JSONExt.emptyObject){var n;let i=this._commands.get(e);return null!==(n=null==i?void 0:i.label.call(void 0,t))&&void 0!==n?n:""}mnemonic(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(void 0,t):-1}icon(e,t=r.JSONExt.emptyObject){var n;return null===(n=this._commands.get(e))||void 0===n?void 0:n.icon.call(void 0,t)}iconClass(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(void 0,t):""}iconLabel(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(void 0,t):""}caption(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(void 0,t):""}usage(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(void 0,t):""}className(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(void 0,t):""}dataset(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(void 0,t):{}}isEnabled(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isEnabled.call(void 0,t)}isToggled(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggled.call(void 0,t)}isToggleable(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggleable}isVisible(e,t=r.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isVisible.call(void 0,t)}execute(e,t=r.JSONExt.emptyObject){let n,i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));try{n=i.execute.call(void 0,t)}catch(e){n=Promise.reject(e)}let s=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=i.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new a.DisposableDelegate((()=>{s.ArrayExt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(this._replaying||d.isModifierKeyPressed(e))return;let t=d.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(t);let{exact:n,partial:s}=i.matchKeyBinding(this._keyBindings,this._keystrokes,e);return n||s?(e.preventDefault(),e.stopPropagation(),n&&!s?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),i.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(i.replayKeyEvent),this._replaying=!1)}_executeKeyBinding(e){let{command:t,args:n}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(this.hasCommand(t)&&this.isEnabled(t,i))this.execute(t,i);else{let n=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${n}.`;console.warn(`${i} ${s}`)}}_clearPendingState(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}!function(e){function t(e){let t="",n=!1,i=!1,s=!1,r=!1;for(let a of e.split(/\s+/))"Accel"===a?o.Platform.IS_MAC?i=!0:s=!0:"Alt"===a?n=!0:"Cmd"===a?i=!0:"Ctrl"===a?s=!0:"Shift"===a?r=!0:a.length>0&&(t=a);return{cmd:i,ctrl:s,alt:n,shift:r,key:t}}function n(e){let n="",i=t(e);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&o.Platform.IS_MAC&&(n+="Cmd "),n+i.key}e.parseKeystroke=t,e.normalizeKeystroke=n,e.normalizeKeys=function(e){let t;return t=o.Platform.IS_WIN?e.winKeys||e.keys:o.Platform.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(n)},e.formatKeystroke=function(e){return"string"==typeof e?n(e):e.map(n).join(", ");function n(e){let n=[],s=o.Platform.IS_MAC?" ":"+",r=t(e);return r.ctrl&&n.push("Ctrl"),r.alt&&n.push("Alt"),r.shift&&n.push("Shift"),o.Platform.IS_MAC&&r.cmd&&n.push("Cmd"),n.push(r.key),n.map(i.formatKey).join(s)}},e.isModifierKeyPressed=function(e){let t=(0,l.getKeyboardLayout)(),n=t.keyForKeydownEvent(e);return t.isModifierKey(n)},e.keystrokeForKeydownEvent=function(e){let t=(0,l.getKeyboardLayout)(),n=t.keyForKeydownEvent(e);if(!n||t.isModifierKey(n))return"";let i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&o.Platform.IS_MAC&&i.push("Cmd"),i.push(n),i.join(" ")}}(d||(d={})),function(e){e.CHORD_TIMEOUT=1e3,e.createCommand=function(e){return{execute:e.execute,describedBy:h("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:h(e.label,i),mnemonic:h(e.mnemonic,s),icon:h(e.icon,m),iconClass:h(e.iconClass,i),iconLabel:h(e.iconLabel,i),caption:h(e.caption,i),usage:h(e.usage,i),className:h(e.className,i),dataset:h(e.dataset,c),isEnabled:e.isEnabled||a,isToggled:e.isToggled||l,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||a}},e.createKeyBinding=function(e){return{keys:d.normalizeKeys(e),selector:y(e),command:e.command,args:e.args||r.JSONExt.emptyObject}},e.matchKeyBinding=function(e,t,n){let i=null,s=!1,r=1/0,a=0;for(let l=0,c=e.length;l<c;++l){let c=e[l],d=u(c.keys,t);if(0===d)continue;if(2===d){s||-1===g(c.selector,n)||(s=!0);continue}let m=g(c.selector,n);if(-1===m||m>r)continue;let h=o.Selector.calculateSpecificity(c.selector);(!i||m<r||h>=a)&&(i=c,r=m,a=h)}return{exact:i,partial:s}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),n=e.bubbles||!0,i=e.cancelable||!0;return t.initEvent(e.type||"keydown",n,i),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return o.Platform.IS_MAC?t.hasOwnProperty(e)?t[e]:e:n.hasOwnProperty(e)?n[e]:e};const t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},n={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",s=()=>-1,a=()=>!0,l=()=>!1,c=()=>({}),m=()=>{};function h(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function y(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!o.Selector.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function u(e,t){if(e.length<t.length)return 0;for(let n=0,i=t.length;n<i;++n)if(e[n]!==t[n])return 0;return e.length>t.length?2:1}function g(e,t){let n=t.target,i=t.currentTarget;for(let t=0;null!==n;n=n.parentElement,++t){if(n.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.Selector.matches(n,e))return t;if(n===i)return-1}return-1}}(i||(i={}))}}]);