notebook 7.0.5__py3-none-any.whl → 7.0.7__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 (173) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +7 -4
  3. notebook/static/1018.bundle.js +1 -1
  4. notebook/static/1053.bundle.js +1 -1
  5. notebook/static/1198.bundle.js +1 -1
  6. notebook/static/1337.bundle.js +1 -1
  7. notebook/static/134.bundle.js +1 -1
  8. notebook/static/1408.bundle.js +1 -1
  9. notebook/static/1647.bundle.js +1 -1
  10. notebook/static/1650.bundle.js +1 -1
  11. notebook/static/1682.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1696.bundle.js +1 -1
  14. notebook/static/1809.bundle.js +1 -1
  15. notebook/static/1827.bundle.js +1 -1
  16. notebook/static/1833.bundle.js +1 -1
  17. notebook/static/1835.bundle.js +1 -1
  18. notebook/static/1950.bundle.js +1 -1
  19. notebook/static/1958.bundle.js +1 -1
  20. notebook/static/2007.bundle.js +1 -1
  21. notebook/static/2053.bundle.js +1 -0
  22. notebook/static/2067.bundle.js +1 -1
  23. notebook/static/2088.bundle.js +1 -1
  24. notebook/static/2089.bundle.js +1 -1
  25. notebook/static/2122.bundle.js +1 -1
  26. notebook/static/2167.bundle.js +1 -1
  27. notebook/static/2184.bundle.js +1 -1
  28. notebook/static/2311.bundle.js +1 -1
  29. notebook/static/2401.bundle.js +1 -1
  30. notebook/static/2479.bundle.js +1 -1
  31. notebook/static/2512.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2924.bundle.js +1 -1
  34. notebook/static/3146.bundle.js +1 -1
  35. notebook/static/3213.bundle.js +1 -1
  36. notebook/static/3340.bundle.js +1 -1
  37. notebook/static/3360.bundle.js +1 -1
  38. notebook/static/3466.bundle.js +1 -1
  39. notebook/static/35.bundle.js +1 -1
  40. notebook/static/3676.bundle.js +1 -1
  41. notebook/static/3680.bundle.js +1 -1
  42. notebook/static/3768.bundle.js +1 -1
  43. notebook/static/377.bundle.js +1 -1
  44. notebook/static/3863.bundle.js +1 -1
  45. notebook/static/3881.bundle.js +1 -1
  46. notebook/static/{6621.bundle.js → 3911.bundle.js} +1 -1
  47. notebook/static/4042.bundle.js +1 -1
  48. notebook/static/4131.bundle.js +1 -1
  49. notebook/static/4212.bundle.js +1 -1
  50. notebook/static/4234.bundle.js +1 -1
  51. notebook/static/4291.bundle.js +1 -1
  52. notebook/static/4382.bundle.js +1 -1
  53. notebook/static/4558.bundle.js +1 -1
  54. notebook/static/4588.bundle.js +1 -1
  55. notebook/static/4645.bundle.js +1 -1
  56. notebook/static/4811.bundle.js +1 -1
  57. notebook/static/4837.bundle.js +1 -1
  58. notebook/static/5088.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5125.bundle.js +1 -1
  61. notebook/static/5135.bundle.js +1 -1
  62. notebook/static/514.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/5573.bundle.js +1 -1
  68. notebook/static/5601.bundle.js +1 -1
  69. notebook/static/5678.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5912.bundle.js +1 -1
  72. notebook/static/5921.bundle.js +1 -1
  73. notebook/static/6017.bundle.js +1 -1
  74. notebook/static/6027.bundle.js +1 -1
  75. notebook/static/6139.bundle.js +1 -1
  76. notebook/static/62.bundle.js +1 -1
  77. notebook/static/6256.bundle.js +1 -1
  78. notebook/static/6345.bundle.js +1 -1
  79. notebook/static/6604.bundle.js +1 -1
  80. notebook/static/6627.bundle.js +1 -1
  81. notebook/static/6815.bundle.js +1 -1
  82. notebook/static/6853.bundle.js +1 -1
  83. notebook/static/6893.bundle.js +1 -1
  84. notebook/static/690.bundle.js +1 -1
  85. notebook/static/6962.bundle.js +1 -1
  86. notebook/static/6999.bundle.js +1 -1
  87. notebook/static/7226.bundle.js +1 -1
  88. notebook/static/7252.bundle.js +1 -1
  89. notebook/static/7302.bundle.js +1 -1
  90. notebook/static/7369.bundle.js +1 -1
  91. notebook/static/7386.bundle.js +1 -1
  92. notebook/static/7391.bundle.js +1 -1
  93. notebook/static/7394.bundle.js +1 -1
  94. notebook/static/7427.bundle.js +1 -1
  95. notebook/static/7603.bundle.js +1 -1
  96. notebook/static/7639.bundle.js +1 -1
  97. notebook/static/7684.bundle.js +1 -1
  98. notebook/static/7819.bundle.js +1 -1
  99. notebook/static/7900.bundle.js +1 -1
  100. notebook/static/7906.bundle.js +1 -1
  101. notebook/static/8579.bundle.js +1 -1
  102. notebook/static/8633.bundle.js +1 -1
  103. notebook/static/8771.bundle.js +1 -1
  104. notebook/static/8781.bundle.js +1 -0
  105. notebook/static/8875.bundle.js +1 -1
  106. notebook/static/8907.bundle.js +1 -1
  107. notebook/static/8928.bundle.js +1 -1
  108. notebook/static/8929.bundle.js +1 -1
  109. notebook/static/893.bundle.js +1 -1
  110. notebook/static/901.bundle.js +1 -1
  111. notebook/static/9068.bundle.js +1 -1
  112. notebook/static/9086.bundle.js +1 -1
  113. notebook/static/911.bundle.js +1 -1
  114. notebook/static/9151.bundle.js +1 -1
  115. notebook/static/9268.bundle.js +1 -1
  116. notebook/static/9335.bundle.js +1 -1
  117. notebook/static/9341.bundle.js +1 -1
  118. notebook/static/9380.bundle.js +1 -1
  119. notebook/static/9577.bundle.js +1 -0
  120. notebook/static/9605.bundle.js +1 -1
  121. notebook/static/9609.bundle.js +1 -1
  122. notebook/static/9638.bundle.js +1 -1
  123. notebook/static/9670.bundle.js +1 -0
  124. notebook/static/9680.bundle.js +1 -1
  125. notebook/static/9685.bundle.js +1 -1
  126. notebook/static/9752.bundle.js +1 -1
  127. notebook/static/9799.bundle.js +1 -1
  128. notebook/static/9852.bundle.js +1 -1
  129. notebook/static/bundle.js +1 -1
  130. notebook/static/third-party-licenses.json +98 -98
  131. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  132. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  133. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  134. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  135. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  136. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  137. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  138. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/34.19d4610ec716fa511ef4.js +1 -0
  139. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1160e2de23274a7c0e28.js +1 -0
  140. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.de56d0eb47577cb652f3.js +1 -0
  141. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eddcbb0f5a946c74796b.js +1 -0
  142. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.f2d2e79c8a92fd2ec840.js +1 -0
  143. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +4 -4
  144. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/METADATA +3 -2
  145. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/RECORD +166 -164
  146. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/WHEEL +1 -1
  147. notebook/static/6774.bundle.js +0 -1
  148. notebook/static/880.bundle.js +0 -1
  149. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.cf0b00aa9baf659e6dc7.js +0 -1
  150. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -1
  151. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/922.0beff4620746e288bd5e.js +0 -1
  152. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.79046a2eb17bde1af38c.js +0 -1
  153. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.58182cbb5c785b66277a.js +0 -1
  154. {notebook-7.0.5.data → notebook-7.0.7.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  155. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  156. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  157. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  158. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  159. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  160. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  161. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  162. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  163. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  164. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  165. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  166. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  167. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  168. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  169. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  170. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  171. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  172. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/entry_points.txt +0 -0
  173. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3466],{83466:(e,t,r)=>{r.r(t),r.d(t,{RunningLanguageServer:()=>_,default:()=>j});var n=r(400),a=r(30279),s=r(20457),o=r(49255),i=r(59361),c=r(81997),l=r(20998),u=r(97934),m=r(78156),d=r.n(m);const p="languageServers",g="configuration";function h(e){const{[g]:t,...r}=e.schema,{[g]:n,serverName:a,...s}=e.settings,[o,i]=(0,m.useState)(a),c={};Object.entries(n).forEach((([e,t])=>{const r={property:e,type:typeof t,value:t};c[l.UUID.uuid4()]=r}));const[p,h]=(0,m.useState)(c),f={};Object.entries(r).forEach((([e,t])=>{f[e]=e in s?s[e]:t.default}));const[E,S]=(0,m.useState)(f),y=t=>{const r={};Object.entries(p).forEach((([n,a])=>{n!==t&&(r[n]=a);const s={};Object.values(r).forEach((e=>{s[e.property]=e.value})),e.updateSetting.invoke(e.serverHash,{[g]:s}).catch(console.error),h(r)}))},b=new u.Debouncer(((t,r)=>{if(t in p){const n={...p,[t]:r},a={};Object.values(n).forEach((e=>{a[e.property]=e.value})),h(n),e.updateSetting.invoke(e.serverHash,{[g]:a}).catch(console.error)}}));return d().createElement("div",{className:"array-item"},d().createElement("div",{className:"form-group "},d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("div",{className:"jp-objectFieldWrapper"},d().createElement("fieldset",null,d().createElement("div",{className:"form-group small-field"},d().createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}),d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.trans.__("Server name:")),d().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},d().createElement("input",{className:"form-control",type:"text",required:!0,value:o,onChange:t=>{(t=>{e.updateSetting.invoke(e.serverHash,{serverName:t.target.value}).catch(console.error),i(t.target.value)})(t)}})),d().createElement("div",{className:"validationErrors"},d().createElement("div",null,d().createElement("ul",{className:"error-detail bs-callout bs-callout-info"},d().createElement("li",{className:"text-danger"},e.trans.__("is a required property"))))))),Object.entries(r).map((([t,r],n)=>d().createElement("div",{key:`${n}-${t}`,className:"form-group small-field"},d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},r.title),d().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},d().createElement("input",{className:"form-control",placeholder:"",type:r.type,value:E[t],onChange:n=>((t,r,n)=>{let a=r;"number"===n&&(a=parseFloat(r));const s={...E,[t]:a};e.updateSetting.invoke(e.serverHash,s).catch(console.error),S(s)})(t,n.target.value,r.type)})),d().createElement("div",{className:"jp-FormGroup-description"},r.description),d().createElement("div",{className:"validationErrors"}))))),d().createElement("fieldset",null,d().createElement("legend",null,t.title),Object.entries(p).map((([e,t])=>d().createElement(v,{key:e,hash:e,property:t,removeProperty:y,setProperty:b}))),d().createElement("span",null,t.description)))))),d().createElement("div",{className:"jp-ArrayOperations"},d().createElement("button",{className:"jp-mod-styled jp-mod-reject",onClick:()=>{const t=l.UUID.uuid4(),r={...p,[t]:{property:"",type:"string",value:""}},n={};Object.values(r).forEach((e=>{n[e.property]=e.value})),e.updateSetting.invoke(e.serverHash,{[g]:n}).catch(console.error),h(r)}},e.trans.__("Add property")),d().createElement("button",{className:"jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:()=>e.removeSetting(e.serverHash)},e.trans.__("Remove server"))))}function v(e){const[t,r]=(0,m.useState)({...e.property}),n=(n,a)=>{let s=n;"number"===a&&(s=parseFloat(n));const o={...t,value:s};e.setProperty.invoke(e.hash,o).catch(console.error),r(o)};return d().createElement("div",{key:e.hash,className:"form-group small-field"},d().createElement("div",{className:"jp-FormGroup-content jp-LSPExtension-FormGroup-content"},d().createElement("input",{className:"form-control",type:"text",required:!0,placeholder:"Property name",value:t.property,onChange:n=>{(n=>{const a={...t,property:n};e.setProperty.invoke(e.hash,a).catch(console.error),r(a)})(n.target.value)}}),d().createElement("select",{className:"form-control",value:t.type,onChange:n=>(n=>{let a;a="boolean"!==n&&("number"===n?0:"");const s={...t,type:n,value:a};r(s),e.setProperty.invoke(e.hash,s).catch(console.error)})(n.target.value)},d().createElement("option",{value:"string"},"String"),d().createElement("option",{value:"number"},"Number"),d().createElement("option",{value:"boolean"},"Boolean")),d().createElement("input",{className:"form-control",type:{string:"text",number:"number",boolean:"checkbox"}[t.type],required:!1,placeholder:"Property value",value:"boolean"!==t.type?t.value:void 0,checked:"boolean"===t.type?t.value:void 0,onChange:"boolean"!==t.type?e=>n(e.target.value,t.type):e=>n(e.target.checked,t.type)}),d().createElement("button",{className:"jp-mod-minimal jp-Button",onClick:()=>{e.removeProperty(e.hash)}},d().createElement(i.closeIcon.react,null))))}class f extends d().Component{constructor(e){super(e),this.removeSetting=e=>{if(e in this.state.items){const t={};for(const r in this.state.items)r!==e&&(t[r]=this.state.items[r]);this.setState((e=>({...e,items:t})),(()=>{this.saveServerSetting()}))}},this.updateSetting=(e,t)=>{if(e in this.state.items){const r={};for(const n in this.state.items)r[n]=n===e?{...this.state.items[n],...t}:this.state.items[n];this.setState((e=>({...e,items:r})),(()=>{this.saveServerSetting()}))}},this.addServerSetting=()=>{let e=0,t="newKey";for(;Object.values(this.state.items).map((e=>e.serverName)).includes(t);)e+=1,t=`newKey-${e}`;this.setState((e=>({...e,items:{...e.items,[l.UUID.uuid4()]:{...this._defaultSetting,serverName:t}}})),(()=>{this.saveServerSetting()}))},this.saveServerSetting=()=>{const e={};Object.values(this.state.items).forEach((t=>{const{serverName:r,...n}=t;e[r]=n})),this._setting.set(p,e).catch(console.error)},this._setting=e.formContext.settings,this._trans=e.translator.load("jupyterlab");const t=this._setting.schema.definitions;this._defaultSetting=t.languageServer.default,this._schema=t.languageServer.properties;const r=e.schema.title,n=e.schema.description,a=e.formContext.settings.get(p).composite;let s={};a&&Object.entries(a).forEach((([e,t])=>{if(t){const r=l.UUID.uuid4();s[r]={serverName:e,...t}}})),this.state={title:r,desc:n,items:s},this._debouncedUpdateSetting=new u.Debouncer(this.updateSetting.bind(this))}render(){return d().createElement("div",null,d().createElement("fieldset",null,d().createElement("legend",null,this.state.title),d().createElement("p",{className:"field-description"},this.state.desc),d().createElement("div",{className:"field field-array field-array-of-object"},Object.entries(this.state.items).map((([e,t],r)=>d().createElement(h,{key:`${r}-${e}`,trans:this._trans,removeSetting:this.removeSetting,updateSetting:this._debouncedUpdateSetting,serverHash:e,settings:t,schema:this._schema})))),d().createElement("div",null,d().createElement("button",{style:{margin:2},className:"jp-mod-styled jp-mod-reject",onClick:this.addServerSetting},this._trans.__("Add server")))))}}const E={activate:function(e,t,r){const a=new n.LanguageServerManager({settings:e.serviceManager.serverSettings}),s=new n.DocumentConnectionManager({languageServerManager:a});return r&&function(e,t,r){const n=r.load("jupyterlab"),a=new c.Signal(t);t.connected.connect((()=>a.emit(t))),t.disconnected.connect((()=>a.emit(t))),t.closed.connect((()=>a.emit(t))),t.documentsChanged.connect((()=>a.emit(t)));let s=[];e.add({name:n.__("Language servers"),running:()=>{const e=new Set([...t.connections.values()]);return s=[...e].map((e=>new _(e,t))),s},shutdownAll:()=>{s.forEach((e=>{e.shutdown()}))},refreshRunning:()=>{},runningChanged:a,shutdownLabel:n.__("Shut Down"),shutdownAllLabel:n.__("Shut Down All"),shutdownAllConfirmationText:n.__("Are you sure you want to permanently shut down all running language servers?")})}(r,s,t),s},id:"@jupyterlab/lsp-extension:plugin",description:"Provides the language server connection manager.",requires:[o.ITranslator],optional:[a.IRunningSessionManagers],provides:n.ILSPDocumentConnectionManager,autoStart:!0},S={id:"@jupyterlab/lsp-extension:feature",description:"Provides the language server feature manager.",activate:()=>new n.FeatureManager,provides:n.ILSPFeatureManager,autoStart:!0},y={activate:function(e,t,r,n,a){const s="languageServers",o=t.languageServerManager,i=e=>{const r=e.composite,n=r.languageServers||{};if("on"!==r.activate||o.isEnabled){if("off"===r.activate&&o.isEnabled)return void o.disable()}else o.enable().catch(console.error);t.initialConfigurations=n,t.updateConfiguration(n),t.updateServerConfigurations(n),t.updateLogging(r.logAllCommunication,r.setTrace)};if(r.transform(E.id,{fetch:e=>{const t=e.schema.properties,r={};return o.sessions.forEach(((e,t)=>{r[t]={rank:50,configuration:{}}})),t[s].default=r,e},compose:e=>{const t=e.schema.properties,r=e.data.user,n=t[s].default,a=r[s];let o={...n};a&&(o={...o,...a});const i={[s]:o};return Object.entries(t).forEach((([e,t])=>{e!==s&&(i[e]=e in r?r[e]:t.default)})),e.data.composite=i,e}}),o.sessionsChanged.connect((async()=>{await r.load(E.id,!0)})),r.load(E.id).then((e=>{i(e),e.changed.connect((()=>{i(e)})),o.disable()})).catch((e=>{console.error(e.message)})),a){const e={fieldRenderer:e=>function(e,t){return d().createElement(f,{...e,translator:t})}(e,n)};a.addRenderer(`${E.id}.${s}`,e)}},id:"@jupyterlab/lsp-extension:settings",description:"Provides the language server settings.",requires:[n.ILSPDocumentConnectionManager,s.ISettingRegistry,o.ITranslator],optional:[i.IFormRendererRegistry],autoStart:!0},b={id:n.ILSPCodeExtractorsManager.name,description:"Provides the code extractor manager.",activate:e=>{const t=new n.CodeExtractorsManager,r=new n.TextForeignCodeExtractor({language:"markdown",isStandalone:!1,file_extension:"md",cellType:["markdown"]});t.register(r,null);const a=new n.TextForeignCodeExtractor({language:"text",isStandalone:!1,file_extension:"txt",cellType:["raw"]});return t.register(a,null),t},provides:n.ILSPCodeExtractorsManager,autoStart:!0};class _{constructor(e,t){this._connection=new WeakSet([e]),this._manager=t,this._serverIdentifier=e.serverIdentifier,this._serverLanguage=e.serverLanguage}open(){}icon(){return i.pythonIcon}label(){var e,t;return`${null!==(e=this._serverIdentifier)&&void 0!==e?e:""} (${null!==(t=this._serverLanguage)&&void 0!==t?t:""})`}shutdown(){for(const[e,t]of this._manager.connections.entries())if(this._connection.has(t)){const{uri:t}=this._manager.documents.get(e);this._manager.unregisterDocument(t)}this._manager.disconnect(this._serverIdentifier)}}const j=[E,S,y,b]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3466],{83466:(e,t,r)=>{r.r(t),r.d(t,{RunningLanguageServer:()=>_,default:()=>j});var n=r(86850),a=r(56153),s=r(70394),o=r(57356),i=r(90710),c=r(81997),l=r(20998),u=r(97934),m=r(78156),d=r.n(m);const p="languageServers",g="configuration";function h(e){const{[g]:t,...r}=e.schema,{[g]:n,serverName:a,...s}=e.settings,[o,i]=(0,m.useState)(a),c={};Object.entries(n).forEach((([e,t])=>{const r={property:e,type:typeof t,value:t};c[l.UUID.uuid4()]=r}));const[p,h]=(0,m.useState)(c),f={};Object.entries(r).forEach((([e,t])=>{f[e]=e in s?s[e]:t.default}));const[E,S]=(0,m.useState)(f),y=t=>{const r={};Object.entries(p).forEach((([n,a])=>{n!==t&&(r[n]=a);const s={};Object.values(r).forEach((e=>{s[e.property]=e.value})),e.updateSetting.invoke(e.serverHash,{[g]:s}).catch(console.error),h(r)}))},b=new u.Debouncer(((t,r)=>{if(t in p){const n={...p,[t]:r},a={};Object.values(n).forEach((e=>{a[e.property]=e.value})),h(n),e.updateSetting.invoke(e.serverHash,{[g]:a}).catch(console.error)}}));return d().createElement("div",{className:"array-item"},d().createElement("div",{className:"form-group "},d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("div",{className:"jp-objectFieldWrapper"},d().createElement("fieldset",null,d().createElement("div",{className:"form-group small-field"},d().createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}),d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.trans.__("Server name:")),d().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},d().createElement("input",{className:"form-control",type:"text",required:!0,value:o,onChange:t=>{(t=>{e.updateSetting.invoke(e.serverHash,{serverName:t.target.value}).catch(console.error),i(t.target.value)})(t)}})),d().createElement("div",{className:"validationErrors"},d().createElement("div",null,d().createElement("ul",{className:"error-detail bs-callout bs-callout-info"},d().createElement("li",{className:"text-danger"},e.trans.__("is a required property"))))))),Object.entries(r).map((([t,r],n)=>d().createElement("div",{key:`${n}-${t}`,className:"form-group small-field"},d().createElement("div",{className:"jp-FormGroup-content"},d().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},r.title),d().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},d().createElement("input",{className:"form-control",placeholder:"",type:r.type,value:E[t],onChange:n=>((t,r,n)=>{let a=r;"number"===n&&(a=parseFloat(r));const s={...E,[t]:a};e.updateSetting.invoke(e.serverHash,s).catch(console.error),S(s)})(t,n.target.value,r.type)})),d().createElement("div",{className:"jp-FormGroup-description"},r.description),d().createElement("div",{className:"validationErrors"}))))),d().createElement("fieldset",null,d().createElement("legend",null,t.title),Object.entries(p).map((([e,t])=>d().createElement(v,{key:e,hash:e,property:t,removeProperty:y,setProperty:b}))),d().createElement("span",null,t.description)))))),d().createElement("div",{className:"jp-ArrayOperations"},d().createElement("button",{className:"jp-mod-styled jp-mod-reject",onClick:()=>{const t=l.UUID.uuid4(),r={...p,[t]:{property:"",type:"string",value:""}},n={};Object.values(r).forEach((e=>{n[e.property]=e.value})),e.updateSetting.invoke(e.serverHash,{[g]:n}).catch(console.error),h(r)}},e.trans.__("Add property")),d().createElement("button",{className:"jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:()=>e.removeSetting(e.serverHash)},e.trans.__("Remove server"))))}function v(e){const[t,r]=(0,m.useState)({...e.property}),n=(n,a)=>{let s=n;"number"===a&&(s=parseFloat(n));const o={...t,value:s};e.setProperty.invoke(e.hash,o).catch(console.error),r(o)};return d().createElement("div",{key:e.hash,className:"form-group small-field"},d().createElement("div",{className:"jp-FormGroup-content jp-LSPExtension-FormGroup-content"},d().createElement("input",{className:"form-control",type:"text",required:!0,placeholder:"Property name",value:t.property,onChange:n=>{(n=>{const a={...t,property:n};e.setProperty.invoke(e.hash,a).catch(console.error),r(a)})(n.target.value)}}),d().createElement("select",{className:"form-control",value:t.type,onChange:n=>(n=>{let a;a="boolean"!==n&&("number"===n?0:"");const s={...t,type:n,value:a};r(s),e.setProperty.invoke(e.hash,s).catch(console.error)})(n.target.value)},d().createElement("option",{value:"string"},"String"),d().createElement("option",{value:"number"},"Number"),d().createElement("option",{value:"boolean"},"Boolean")),d().createElement("input",{className:"form-control",type:{string:"text",number:"number",boolean:"checkbox"}[t.type],required:!1,placeholder:"Property value",value:"boolean"!==t.type?t.value:void 0,checked:"boolean"===t.type?t.value:void 0,onChange:"boolean"!==t.type?e=>n(e.target.value,t.type):e=>n(e.target.checked,t.type)}),d().createElement("button",{className:"jp-mod-minimal jp-Button",onClick:()=>{e.removeProperty(e.hash)}},d().createElement(i.closeIcon.react,null))))}class f extends d().Component{constructor(e){super(e),this.removeSetting=e=>{if(e in this.state.items){const t={};for(const r in this.state.items)r!==e&&(t[r]=this.state.items[r]);this.setState((e=>({...e,items:t})),(()=>{this.saveServerSetting()}))}},this.updateSetting=(e,t)=>{if(e in this.state.items){const r={};for(const n in this.state.items)r[n]=n===e?{...this.state.items[n],...t}:this.state.items[n];this.setState((e=>({...e,items:r})),(()=>{this.saveServerSetting()}))}},this.addServerSetting=()=>{let e=0,t="newKey";for(;Object.values(this.state.items).map((e=>e.serverName)).includes(t);)e+=1,t=`newKey-${e}`;this.setState((e=>({...e,items:{...e.items,[l.UUID.uuid4()]:{...this._defaultSetting,serverName:t}}})),(()=>{this.saveServerSetting()}))},this.saveServerSetting=()=>{const e={};Object.values(this.state.items).forEach((t=>{const{serverName:r,...n}=t;e[r]=n})),this._setting.set(p,e).catch(console.error)},this._setting=e.formContext.settings,this._trans=e.translator.load("jupyterlab");const t=this._setting.schema.definitions;this._defaultSetting=t.languageServer.default,this._schema=t.languageServer.properties;const r=e.schema.title,n=e.schema.description,a=e.formContext.settings.get(p).composite;let s={};a&&Object.entries(a).forEach((([e,t])=>{if(t){const r=l.UUID.uuid4();s[r]={serverName:e,...t}}})),this.state={title:r,desc:n,items:s},this._debouncedUpdateSetting=new u.Debouncer(this.updateSetting.bind(this))}render(){return d().createElement("div",null,d().createElement("fieldset",null,d().createElement("legend",null,this.state.title),d().createElement("p",{className:"field-description"},this.state.desc),d().createElement("div",{className:"field field-array field-array-of-object"},Object.entries(this.state.items).map((([e,t],r)=>d().createElement(h,{key:`${r}-${e}`,trans:this._trans,removeSetting:this.removeSetting,updateSetting:this._debouncedUpdateSetting,serverHash:e,settings:t,schema:this._schema})))),d().createElement("div",null,d().createElement("button",{style:{margin:2},className:"jp-mod-styled jp-mod-reject",onClick:this.addServerSetting},this._trans.__("Add server")))))}}const E={activate:function(e,t,r){const a=new n.LanguageServerManager({settings:e.serviceManager.serverSettings}),s=new n.DocumentConnectionManager({languageServerManager:a});return r&&function(e,t,r){const n=r.load("jupyterlab"),a=new c.Signal(t);t.connected.connect((()=>a.emit(t))),t.disconnected.connect((()=>a.emit(t))),t.closed.connect((()=>a.emit(t))),t.documentsChanged.connect((()=>a.emit(t)));let s=[];e.add({name:n.__("Language servers"),running:()=>{const e=new Set([...t.connections.values()]);return s=[...e].map((e=>new _(e,t))),s},shutdownAll:()=>{s.forEach((e=>{e.shutdown()}))},refreshRunning:()=>{},runningChanged:a,shutdownLabel:n.__("Shut Down"),shutdownAllLabel:n.__("Shut Down All"),shutdownAllConfirmationText:n.__("Are you sure you want to permanently shut down all running language servers?")})}(r,s,t),s},id:"@jupyterlab/lsp-extension:plugin",description:"Provides the language server connection manager.",requires:[o.ITranslator],optional:[a.IRunningSessionManagers],provides:n.ILSPDocumentConnectionManager,autoStart:!0},S={id:"@jupyterlab/lsp-extension:feature",description:"Provides the language server feature manager.",activate:()=>new n.FeatureManager,provides:n.ILSPFeatureManager,autoStart:!0},y={activate:function(e,t,r,n,a){const s="languageServers",o=t.languageServerManager,i=e=>{const r=e.composite,n=r.languageServers||{};if("on"!==r.activate||o.isEnabled){if("off"===r.activate&&o.isEnabled)return void o.disable()}else o.enable().catch(console.error);t.initialConfigurations=n,t.updateConfiguration(n),t.updateServerConfigurations(n),t.updateLogging(r.logAllCommunication,r.setTrace)};if(r.transform(E.id,{fetch:e=>{const t=e.schema.properties,r={};return o.sessions.forEach(((e,t)=>{r[t]={rank:50,configuration:{}}})),t[s].default=r,e},compose:e=>{const t=e.schema.properties,r=e.data.user,n=t[s].default,a=r[s];let o={...n};a&&(o={...o,...a});const i={[s]:o};return Object.entries(t).forEach((([e,t])=>{e!==s&&(i[e]=e in r?r[e]:t.default)})),e.data.composite=i,e}}),o.sessionsChanged.connect((async()=>{await r.load(E.id,!0)})),r.load(E.id).then((e=>{i(e),e.changed.connect((()=>{i(e)})),o.disable()})).catch((e=>{console.error(e.message)})),a){const e={fieldRenderer:e=>function(e,t){return d().createElement(f,{...e,translator:t})}(e,n)};a.addRenderer(`${E.id}.${s}`,e)}},id:"@jupyterlab/lsp-extension:settings",description:"Provides the language server settings.",requires:[n.ILSPDocumentConnectionManager,s.ISettingRegistry,o.ITranslator],optional:[i.IFormRendererRegistry],autoStart:!0},b={id:n.ILSPCodeExtractorsManager.name,description:"Provides the code extractor manager.",activate:e=>{const t=new n.CodeExtractorsManager,r=new n.TextForeignCodeExtractor({language:"markdown",isStandalone:!1,file_extension:"md",cellType:["markdown"]});t.register(r,null);const a=new n.TextForeignCodeExtractor({language:"text",isStandalone:!1,file_extension:"txt",cellType:["raw"]});return t.register(a,null),t},provides:n.ILSPCodeExtractorsManager,autoStart:!0};class _{constructor(e,t){this._connection=new WeakSet([e]),this._manager=t,this._serverIdentifier=e.serverIdentifier,this._serverLanguage=e.serverLanguage}open(){}icon(){return i.pythonIcon}label(){var e,t;return`${null!==(e=this._serverIdentifier)&&void 0!==e?e:""} (${null!==(t=this._serverLanguage)&&void 0!==t?t:""})`}shutdown(){for(const[e,t]of this._manager.connections.entries())if(this._connection.has(t)){const{uri:t}=this._manager.documents.get(e);this._manager.unregisterDocument(t)}this._manager.disconnect(this._serverIdentifier)}}const j=[E,S,y,b]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[35],{50035:(t,e,s)=>{function a(t){let e=new Map;return t.changes.keys.forEach(((t,s)=>{e.set(s,{action:t.action,oldValue:t.oldValue,newValue:this.ymeta.get(s)})})),e}s.r(e),s.d(e,{YBaseCell:()=>b,YCodeCell:()=>v,YDocument:()=>m,YFile:()=>p,YMarkdownCell:()=>w,YNotebook:()=>C,YRawCell:()=>k,convertYMapEventToMapChange:()=>a,createMutex:()=>n,createStandaloneCell:()=>f});const n=()=>{let t=!0;return e=>{if(t){t=!1;try{e()}finally{t=!0}}}};var o=s(20998),i=s(81997),r=s(2431),d=s(11182),h=s(12330),l=s(38828),c=s(87946);class u extends h.y{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const t=r.ZG();null!==this.getLocalState()&&15e3<=t-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const e=[];this.meta.forEach(((s,a)=>{a!==this.clientID&&3e4<=t-s.lastUpdated&&this.states.has(a)&&e.push(a)})),e.length>0&&g(this,e,"timeout")}),d.GW(3e3)),t.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const e=this.clientID,s=this.meta.get(e),a=void 0===s?0:s.clock+1,n=this.states.get(e);null===t?this.states.delete(e):this.states.set(e,t),this.meta.set(e,{clock:a,lastUpdated:r.ZG()});const o=[],i=[],d=[],h=[];null===t?h.push(e):null==n?null!=t&&o.push(e):(i.push(e),l.Hi(n,t)||d.push(e)),(o.length>0||d.length>0||h.length>0)&&this.emit("change",[{added:o,updated:d,removed:h},"local"]),this.emit("update",[{added:o,updated:i,removed:h},"local"])}setLocalStateField(t,e){const s=this.getLocalState();null!==s&&this.setLocalState({...s,[t]:e})}getStates(){return this.states}}const g=(t,e,s)=>{const a=[];for(let s=0;s<e.length;s++){const n=e[s];if(t.states.has(n)){if(t.states.delete(n),n===t.clientID){const e=t.meta.get(n);t.meta.set(n,{clock:e.clock+1,lastUpdated:r.ZG()})}a.push(n)}}a.length>0&&(t.emit("change",[{added:[],updated:[],removed:a},s]),t.emit("update",[{added:[],updated:[],removed:a},s]))};class m{constructor(t){var e;this.onStateChanged=t=>{const e=new Array;t.keysChanged.forEach((s=>{const a=t.changes.keys.get(s);a&&e.push({name:s,oldValue:a.oldValue,newValue:this.ystate.get(s)})})),this._changed.emit({stateChange:e})},this._changed=new i.Signal(this),this._isDisposed=!1,this._disposed=new i.Signal(this),this._ydoc=null!==(e=null==t?void 0:t.ydoc)&&void 0!==e?e:new c.Doc,this._ystate=this._ydoc.getMap("state"),this._undoManager=new c.UndoManager([],{trackedOrigins:new Set([this]),doc:this._ydoc}),this._awareness=new u(this._ydoc),this._ystate.observe(this.onStateChanged)}get ydoc(){return this._ydoc}get ystate(){return this._ystate}get undoManager(){return this._undoManager}get awareness(){return this._awareness}get changed(){return this._changed}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get state(){return o.JSONExt.deepCopy(this.ystate.toJSON())}canUndo(){return this.undoManager.undoStack.length>0}canRedo(){return this.undoManager.redoStack.length>0}dispose(){this._isDisposed||(this._isDisposed=!0,this.ystate.unobserve(this.onStateChanged),this.awareness.destroy(),this.undoManager.destroy(),this.ydoc.destroy(),this._disposed.emit(),i.Signal.clearData(this))}getState(t){const e=this.ystate.get(t);return void 0===e?e:o.JSONExt.deepCopy(e)}setState(t,e){o.JSONExt.deepEqual(this.ystate.get(t),e)||this.ystate.set(t,e)}undo(){this.undoManager.undo()}redo(){this.undoManager.redo()}clearUndoHistory(){this.undoManager.clear()}transact(t,e=!0){this.ydoc.transact(t,e?this:null)}}class p extends m{constructor(){super(),this.version="1.0.0",this.ysource=this.ydoc.getText("source"),this._modelObserver=t=>{this._changed.emit({sourceChange:t.changes.delta})},this.undoManager.addToScope(this.ysource),this.ysource.observe(this._modelObserver)}static create(){return new p}get source(){return this.getSource()}set source(t){this.setSource(t)}dispose(){this.isDisposed||(this.ysource.unobserve(this._modelObserver),super.dispose())}getSource(){return this.ysource.toString()}setSource(t){this.transact((()=>{const e=this.ysource;e.delete(0,e.length),e.insert(0,t)}))}updateSource(t,e,s=""){this.transact((()=>{const a=this.ysource;a.insert(t,s),a.delete(t+s.length,e-t)}))}}const y=(t,e={})=>{switch(t.get("cell_type")){case"code":return new v(t,t.get("source"),t.get("outputs"),e);case"markdown":return new w(t,t.get("source"),e);case"raw":return new k(t,t.get("source"),e);default:throw new Error("Found unknown cell type")}},_=(t,e)=>{var s,a;const n=new c.Map,i=new c.Text,r=new c.Map;let d;switch(n.set("source",i),n.set("metadata",r),n.set("cell_type",t.cell_type),n.set("id",null!==(s=t.id)&&void 0!==s?s:o.UUID.uuid4()),t.cell_type){case"markdown":d=new w(n,i,{notebook:e},r),null!=t.attachments&&d.setAttachments(t.attachments);break;case"code":{const s=new c.Array;n.set("outputs",s),d=new v(n,i,s,{notebook:e},r);const o=t;d.execution_count=null!==(a=o.execution_count)&&void 0!==a?a:null,o.outputs&&d.setOutputs(o.outputs);break}default:d=new k(n,i,{notebook:e},r),t.attachments&&d.setAttachments(t.attachments)}return null!=t.metadata&&d.setMetadata(t.metadata),null!=t.source&&d.setSource("string"==typeof t.source?t.source:t.source.join("\n")),d},f=t=>_(t);class b{static create(t){return _({id:t,cell_type:this.prototype.cell_type})}constructor(t,e,s={},a){if(this._modelObserver=t=>{this._changed.emit(this.getChanges(t))},this._metadataChanged=new i.Signal(this),this._notebook=null,this._changed=new i.Signal(this),this._disposed=new i.Signal(this),this._isDisposed=!1,this._undoManager=null,this.ymodel=t,this._ysource=e,this._ymetadata=null!=a?a:this.ymodel.get("metadata"),this._prevSourceLength=e?e.length:0,this._notebook=null,this._awareness=null,this._undoManager=null,s.notebook)this._notebook=s.notebook;else{const t=new c.Doc;t.getArray().insert(0,[this.ymodel]),this._awareness=new u(t),this._undoManager=new c.UndoManager([this.ymodel],{trackedOrigins:new Set([this])})}this.ymodel.observeDeep(this._modelObserver)}get awareness(){var t,e,s;return null!==(s=null!==(t=this._awareness)&&void 0!==t?t:null===(e=this.notebook)||void 0===e?void 0:e.awareness)&&void 0!==s?s:null}get cell_type(){throw new Error("A YBaseCell must not be constructed")}get changed(){return this._changed}get disposed(){return this._disposed}get id(){return this.getId()}get isDisposed(){return this._isDisposed}get isStandalone(){return null!==this._notebook}get metadata(){return this.getMetadata()}set metadata(t){this.setMetadata(t)}get metadataChanged(){return this._metadataChanged}get notebook(){return this._notebook}get source(){return this.getSource()}set source(t){this.setSource(t)}get undoManager(){var t;return this.notebook?(null===(t=this.notebook)||void 0===t?void 0:t.disableDocumentWideUndoRedo)?this._undoManager:this.notebook.undoManager:this._undoManager}setUndoManager(){if(this._undoManager)throw new Error("The cell undo manager is already set.");this._notebook&&this._notebook.disableDocumentWideUndoRedo&&(this._undoManager=new c.UndoManager([this.ymodel],{trackedOrigins:new Set([this])}))}get ysource(){return this._ysource}canUndo(){return!!this.undoManager&&this.undoManager.undoStack.length>0}canRedo(){return!!this.undoManager&&this.undoManager.redoStack.length>0}clearUndoHistory(){var t;null===(t=this.undoManager)||void 0===t||t.clear()}undo(){var t;null===(t=this.undoManager)||void 0===t||t.undo()}redo(){var t;null===(t=this.undoManager)||void 0===t||t.redo()}dispose(){var t;if(!this._isDisposed){if(this._isDisposed=!0,this.ymodel.unobserveDeep(this._modelObserver),this._awareness){const t=this._awareness.doc;this._awareness.destroy(),t.destroy()}this._undoManager&&(this._undoManager===(null===(t=this.notebook)||void 0===t?void 0:t.undoManager)?this._undoManager=null:this._undoManager.destroy()),this._disposed.emit(),i.Signal.clearData(this)}}getId(){return this.ymodel.get("id")}getSource(){return this.ysource.toString()}setSource(t){this.transact((()=>{this.ysource.delete(0,this.ysource.length),this.ysource.insert(0,t)}))}updateSource(t,e,s=""){this.transact((()=>{const a=this.ysource;a.insert(t,s),a.delete(t+s.length,e-t)}))}deleteMetadata(t){void 0!==this.getMetadata(t)&&this.transact((()=>{this._ymetadata.delete(t);const e=this.getMetadata("jupyter");if("collapsed"===t&&e){const{outputs_hidden:t,...s}=e;0===Object.keys(s).length?this._ymetadata.delete("jupyter"):this._ymetadata.set("jupyter",s)}else"jupyter"===t&&this._ymetadata.delete("collapsed")}),!1)}getMetadata(t){const e=this._ymetadata;if(void 0!==e)return"string"==typeof t?void 0===e.get(t)?void 0:o.JSONExt.deepCopy(e.get(t)):o.JSONExt.deepCopy(e.toJSON())}setMetadata(t,e){var s,a;if("string"==typeof t){if(void 0===e)throw new TypeError(`Metadata value for ${t} cannot be 'undefined'; use deleteMetadata.`);const a=t;if(o.JSONExt.deepEqual(null!==(s=this.getMetadata(a))&&void 0!==s?s:null,e))return;this.transact((()=>{var t;if(this._ymetadata.set(a,e),"collapsed"===a){const s=null!==(t=this.getMetadata("jupyter"))&&void 0!==t?t:{};s.outputs_hidden!==e&&this.setMetadata("jupyter",{...s,outputs_hidden:e})}else if("jupyter"===a){const t=e.outputs_hidden;void 0!==t?this.getMetadata("collapsed")!==t&&this.setMetadata("collapsed",t):this.deleteMetadata("collapsed")}}),!1)}else{const e=o.JSONExt.deepCopy(t);null!=e.collapsed?(e.jupyter=e.jupyter||{},e.jupyter.outputs_hidden=e.collapsed):null!=(null===(a=null==e?void 0:e.jupyter)||void 0===a?void 0:a.outputs_hidden)&&(e.collapsed=e.jupyter.outputs_hidden),o.JSONExt.deepEqual(e,this.getMetadata())||this.transact((()=>{for(const[t,s]of Object.entries(e))this._ymetadata.set(t,s)}),!1)}}toJSON(){return{id:this.getId(),cell_type:this.cell_type,source:this.getSource(),metadata:this.getMetadata()}}transact(t,e=!0){!this.notebook||this.notebook.disableDocumentWideUndoRedo?null==this.ymodel.doc?t():this.ymodel.doc.transact(t,e?this:null):this.notebook.transact(t,e)}getChanges(t){const e={},s=t.find((t=>t.target===this.ymodel.get("source")));s&&(e.sourceChange=s.changes.delta);const a=t.find((t=>t.target===this._ymetadata));a&&(e.metadataChange=a.changes.keys,a.changes.keys.forEach(((t,e)=>{switch(t.action){case"add":this._metadataChanged.emit({key:e,newValue:this._ymetadata.get(e),type:"add"});break;case"delete":this._metadataChanged.emit({key:e,oldValue:t.oldValue,type:"remove"});break;case"update":{const s=this._ymetadata.get(e),a=t.oldValue;let n=!0;n="object"==typeof a&&"object"==typeof s?o.JSONExt.deepEqual(a,s):a===s,n||this._metadataChanged.emit({key:e,type:"change",oldValue:a,newValue:s})}}})));const n=t.find((t=>t.target===this.ymodel)),i=this.ymodel.get("source");return n&&n.keysChanged.has("source")&&(e.sourceChange=[{delete:this._prevSourceLength},{insert:i.toString()}]),this._prevSourceLength=i.length,e}}class v extends b{static create(t){return super.create(t)}constructor(t,e,s,a={},n){super(t,e,a,n),this._youtputs=s}get cell_type(){return"code"}get execution_count(){return this.ymodel.get("execution_count")||null}set execution_count(t){this.ymodel.get("execution_count")!==t&&this.transact((()=>{this.ymodel.set("execution_count",t)}),!1)}get outputs(){return this.getOutputs()}set outputs(t){this.setOutputs(t)}getOutputs(){return o.JSONExt.deepCopy(this._youtputs.toArray())}setOutputs(t){this.transact((()=>{this._youtputs.delete(0,this._youtputs.length),this._youtputs.insert(0,t)}),!1)}updateOutputs(t,e,s=[]){const a=e<this._youtputs.length?e-t:this._youtputs.length-t;this.transact((()=>{this._youtputs.delete(t,a),this._youtputs.insert(t,s)}),!1)}toJSON(){return{...super.toJSON(),outputs:this.getOutputs(),execution_count:this.execution_count}}getChanges(t){const e=super.getChanges(t),s=t.find((t=>t.target===this.ymodel.get("outputs")));s&&(e.outputsChange=s.changes.delta);const a=t.find((t=>t.target===this.ymodel));if(a&&a.keysChanged.has("execution_count")){const t=a.changes.keys.get("execution_count");e.executionCountChange={oldValue:t.oldValue,newValue:this.ymodel.get("execution_count")}}return e}}class M extends b{get attachments(){return this.getAttachments()}set attachments(t){this.setAttachments(t)}getAttachments(){return this.ymodel.get("attachments")}setAttachments(t){this.transact((()=>{null==t?this.ymodel.delete("attachments"):this.ymodel.set("attachments",t)}),!1)}getChanges(t){const e=super.getChanges(t),s=t.find((t=>t.target===this.ymodel));if(s&&s.keysChanged.has("attachments")){const t=s.changes.keys.get("attachments");e.executionCountChange={oldValue:t.oldValue,newValue:this.ymodel.get("attachments")}}return e}}class k extends M{static create(t){return super.create(t)}get cell_type(){return"raw"}toJSON(){return{id:this.getId(),cell_type:"raw",source:this.getSource(),metadata:this.getMetadata(),attachments:this.getAttachments()}}}class w extends M{static create(t){return super.create(t)}get cell_type(){return"markdown"}toJSON(){return{id:this.getId(),cell_type:"markdown",source:this.getSource(),metadata:this.getMetadata(),attachments:this.getAttachments()}}}class C extends m{constructor(t={}){var e;super(),this.version="1.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=t=>{const e=t.find((t=>t.target===this.ymeta.get("metadata")));if(e){const t=e.changes.keys,s=this.ymeta.get("metadata");e.changes.keys.forEach(((t,e)=>{switch(t.action){case"add":this._metadataChanged.emit({key:e,type:"add",newValue:s.get(e)});break;case"delete":this._metadataChanged.emit({key:e,type:"remove",oldValue:t.oldValue});break;case"update":{const a=s.get(e),n=t.oldValue;let i=!0;i="object"==typeof n&&"object"==typeof a?o.JSONExt.deepEqual(n,a):n===a,i||this._metadataChanged.emit({key:e,type:"change",oldValue:n,newValue:a})}}})),this._changed.emit({metadataChange:t})}const s=t.find((t=>t.target===this.ymeta));if(s){if(s.keysChanged.has("metadata")){const t=s.changes.keys.get("metadata");if("add"===(null==t?void 0:t.action)&&!t.oldValue){const t=new Map;for(const e of Object.keys(this.metadata))t.set(e,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:e,type:"add",newValue:this.getMetadata(e)});this._changed.emit({metadataChange:t})}}if(s.keysChanged.has("nbformat")){const t=s.changes.keys.get("nbformat"),e={key:"nbformat",oldValue:(null==t?void 0:t.oldValue)?t.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:e})}if(s.keysChanged.has("nbformat_minor")){const t=s.changes.keys.get("nbformat_minor"),e={key:"nbformat_minor",oldValue:(null==t?void 0:t.oldValue)?t.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:e})}}},this._onYCellsChanged=t=>{t.changes.added.forEach((t=>{const e=t.content.type;if(!this._ycellMapping.has(e)){const t=y(e,{notebook:this});t.setUndoManager(),this._ycellMapping.set(e,t)}})),t.changes.deleted.forEach((t=>{const e=t.content.type,s=this._ycellMapping.get(e);s&&(s.dispose(),this._ycellMapping.delete(e))}));let e=0;const s=[];t.changes.delta.forEach((t=>{if(null!=t.insert){const a=t.insert.map((t=>this._ycellMapping.get(t)));s.push({insert:a}),this.cells.splice(e,0,...a),e+=t.insert.length}else null!=t.delete?(s.push(t),this.cells.splice(e,t.delete)):null!=t.retain&&(s.push(t),e+=t.retain)})),this._changed.emit({cellsChange:s})},this._metadataChanged=new i.Signal(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=null!==(e=t.disableDocumentWideUndoRedo)&&void 0!==e&&e,this.cells=this._ycells.toArray().map((t=>(this._ycellMapping.has(t)||this._ycellMapping.set(t,y(t,{notebook:this})),this._ycellMapping.get(t)))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(t={}){var e,s,a,n,o,i,r,d,h;const l=new C({disableDocumentWideUndoRedo:null!==(e=t.disableDocumentWideUndoRedo)&&void 0!==e&&e}),c={cells:null!==(a=null===(s=t.data)||void 0===s?void 0:s.cells)&&void 0!==a?a:[],nbformat:null!==(o=null===(n=t.data)||void 0===n?void 0:n.nbformat)&&void 0!==o?o:4,nbformat_minor:null!==(r=null===(i=t.data)||void 0===i?void 0:i.nbformat_minor)&&void 0!==r?r:5,metadata:null!==(h=null===(d=t.data)||void 0===d?void 0:d.metadata)&&void 0!==h?h:{}};return l.fromJSON(c),l}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(t){this.setMetadata(t)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(t){this.transact((()=>{this.ymeta.set("nbformat",t)}),!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(t){this.transact((()=>{this.ymeta.set("nbformat_minor",t)}),!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(t){return this.cells[t]}addCell(t){return this.insertCell(this._ycells.length,t)}insertCell(t,e){return this.insertCells(t,[e])[0]}insertCells(t,e){const s=e.map((t=>{const e=_(t,this);return this._ycellMapping.set(e.ymodel,e),e}));return this.transact((()=>{this._ycells.insert(t,s.map((t=>t.ymodel)))})),s.forEach((t=>{t.setUndoManager()})),s}moveCell(t,e){this.moveCells(t,e)}moveCells(t,e,s=1){const a=new Array(s).fill(!0).map(((e,s)=>this.getCell(t+s).toJSON()));this.transact((()=>{this._ycells.delete(t,s),this._ycells.insert(t>e?e:e-s+1,a.map((t=>_(t,this).ymodel)))}))}deleteCell(t){this.deleteCellRange(t,t+1)}deleteCellRange(t,e){this.transact((()=>{this._ycells.delete(t,e-t)}))}deleteMetadata(t){if(void 0===this.getMetadata(t))return;const e=this.metadata;delete e[t],this.setMetadata(e)}getMetadata(t){const e=this.ymeta.get("metadata");if(void 0!==e){if("string"==typeof t){const s=e.get(t);return void 0===s?void 0:o.JSONExt.deepCopy(s)}return o.JSONExt.deepCopy(e.toJSON())}}setMetadata(t,e){var s;if("string"==typeof t){if(void 0===e)throw new TypeError(`Metadata value for ${t} cannot be 'undefined'; use deleteMetadata.`);if(o.JSONExt.deepEqual(null!==(s=this.getMetadata(t))&&void 0!==s?s:null,e))return;const a={};a[t]=e,this.updateMetadata(a)}else if(!this.metadata||!o.JSONExt.deepEqual(this.metadata,t)){const e=o.JSONExt.deepCopy(t),s=this.ymeta.get("metadata");if(void 0===s)return;this.transact((()=>{s.clear();for(const[t,a]of Object.entries(e))s.set(t,a)}))}}updateMetadata(t){const e=o.JSONExt.deepCopy(t),s=this.ymeta.get("metadata");void 0!==s&&this.transact((()=>{for(const[t,a]of Object.entries(e))s.set(t,a)}))}fromJSON(t){this.transact((()=>{this.nbformat=t.nbformat,this.nbformat_minor=t.nbformat_minor;const e=t.metadata;if(void 0!==e.orig_nbformat&&delete e.orig_nbformat,this.metadata)this.metadata=e;else{const t=new c.Map;for(const[s,a]of Object.entries(e))t.set(s,a);this.ymeta.set("metadata",t)}const s=4===t.nbformat&&t.nbformat_minor>=5,a=t.cells.map((t=>(s||delete t.id,t)));this.insertCells(this.cells.length,a),this.deleteCellRange(0,this.cells.length)}))}toJSON(){const t=4===this.nbformat&&this.nbformat_minor<=4;return{metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map((e=>{const s=e.toJSON();return t&&delete s.id,s}))}}}},79504:(t,e,s)=>{s.d(e,{Dp:()=>o,G:()=>i,JJ:()=>r,Z$:()=>a,kJ:()=>d,s7:()=>n});const a=t=>t[t.length-1],n=(t,e)=>{for(let s=0;s<e.length;s++)t.push(e[s])},o=Array.from,i=(t,e)=>{for(let s=0;s<t.length;s++)if(e(t[s],s,t))return!0;return!1},r=(t,e)=>{const s=new Array(t);for(let a=0;a<t;a++)s[a]=e(a,s);return s},d=Array.isArray},38828:(t,e,s)=>{s.d(e,{Hi:()=>r,PP:()=>o,gB:()=>d,id:()=>i});var a=s(79504),n=s(36498);const o=(t,e,s=0)=>{try{for(;s<t.length;s++)t[s](...e)}finally{s<t.length&&o(t,e,s+1)}},i=t=>t,r=(t,e)=>{if(null==t||null==e)return((t,e)=>t===e)(t,e);if(t.constructor!==e.constructor)return!1;if(t===e)return!0;switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:if(t.byteLength!==e.byteLength)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;break;case Set:if(t.size!==e.size)return!1;for(const s of t)if(!e.has(s))return!1;break;case Map:if(t.size!==e.size)return!1;for(const s of t.keys())if(!e.has(s)||!r(t.get(s),e.get(s)))return!1;break;case Object:if(n.kE(t)!==n.kE(e))return!1;for(const s in t)if(!n.l$(t,s)||!r(t[s],e[s]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(!r(t[s],e[s]))return!1;break;default:return!1}return!0},d=(t,e)=>e.includes(t);a.kJ},22592:(t,e,s)=>{s.d(e,{JG:()=>n,UI:()=>i,Ue:()=>a,Yj:()=>r,Yu:()=>o});const a=()=>new Map,n=t=>{const e=a();return t.forEach(((t,s)=>{e.set(s,t)})),e},o=(t,e,s)=>{let a=t.get(e);return void 0===a&&t.set(e,a=s()),a},i=(t,e)=>{const s=[];for(const[a,n]of t)s.push(e(n,a));return s},r=(t,e)=>{for(const[s,a]of t)if(e(a,s))return!0;return!1}},11182:(t,e,s)=>{s.d(e,{Fp:()=>i,GR:()=>r,GW:()=>a,VV:()=>o,Wn:()=>n});const a=Math.floor,n=(Math.ceil,Math.abs),o=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(t,e)=>t<e?t:e),i=(t,e)=>t>e?t:e,r=(Number.isNaN,Math.pow,Math.sign,t=>0!==t?t<0:1/t<0)},36498:(t,e,s)=>{s.d(e,{$m:()=>h,Ed:()=>o,f0:()=>a,kE:()=>i,l$:()=>d,xb:()=>r});const a=Object.assign,n=Object.keys,o=(t,e)=>{for(const s in t)e(t[s],s)},i=t=>n(t).length,r=t=>{for(const e in t)return!1;return!0},d=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h=(t,e)=>t===e||i(t)===i(e)&&((t,e)=>{for(const s in t)if(!e(t[s],s))return!1;return!0})(t,((t,s)=>(void 0!==t||d(e,s))&&e[s]===t))},12330:(t,e,s)=>{s.d(e,{y:()=>i});var a=s(22592),n=s(79287),o=s(79504);class i{constructor(){this._observers=a.Ue()}on(t,e){a.Yu(this._observers,t,n.Ue).add(e)}once(t,e){const s=(...a)=>{this.off(t,s),e(...a)};this.on(t,s)}off(t,e){const s=this._observers.get(t);void 0!==s&&(s.delete(e),0===s.size&&this._observers.delete(t))}emit(t,e){return o.Dp((this._observers.get(t)||a.Ue()).values()).forEach((t=>t(...e)))}destroy(){this._observers=a.Ue()}}},79287:(t,e,s)=>{s.d(e,{Ue:()=>a});const a=()=>new Set},2431:(t,e,s)=>{s.d(e,{ZG:()=>a});const a=Date.now}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[35],{50035:(t,e,s)=>{function a(t){let e=new Map;return t.changes.keys.forEach(((t,s)=>{e.set(s,{action:t.action,oldValue:t.oldValue,newValue:this.ymeta.get(s)})})),e}s.r(e),s.d(e,{YBaseCell:()=>b,YCodeCell:()=>v,YDocument:()=>m,YFile:()=>p,YMarkdownCell:()=>w,YNotebook:()=>C,YRawCell:()=>k,convertYMapEventToMapChange:()=>a,createMutex:()=>n,createStandaloneCell:()=>f});const n=()=>{let t=!0;return e=>{if(t){t=!1;try{e()}finally{t=!0}}}};var o=s(20998),i=s(81997),r=s(2431),d=s(11182),h=s(12330),l=s(38828),c=s(87946);class u extends h.y{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const t=r.ZG();null!==this.getLocalState()&&15e3<=t-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const e=[];this.meta.forEach(((s,a)=>{a!==this.clientID&&3e4<=t-s.lastUpdated&&this.states.has(a)&&e.push(a)})),e.length>0&&g(this,e,"timeout")}),d.GW(3e3)),t.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const e=this.clientID,s=this.meta.get(e),a=void 0===s?0:s.clock+1,n=this.states.get(e);null===t?this.states.delete(e):this.states.set(e,t),this.meta.set(e,{clock:a,lastUpdated:r.ZG()});const o=[],i=[],d=[],h=[];null===t?h.push(e):null==n?null!=t&&o.push(e):(i.push(e),l.Hi(n,t)||d.push(e)),(o.length>0||d.length>0||h.length>0)&&this.emit("change",[{added:o,updated:d,removed:h},"local"]),this.emit("update",[{added:o,updated:i,removed:h},"local"])}setLocalStateField(t,e){const s=this.getLocalState();null!==s&&this.setLocalState({...s,[t]:e})}getStates(){return this.states}}const g=(t,e,s)=>{const a=[];for(let s=0;s<e.length;s++){const n=e[s];if(t.states.has(n)){if(t.states.delete(n),n===t.clientID){const e=t.meta.get(n);t.meta.set(n,{clock:e.clock+1,lastUpdated:r.ZG()})}a.push(n)}}a.length>0&&(t.emit("change",[{added:[],updated:[],removed:a},s]),t.emit("update",[{added:[],updated:[],removed:a},s]))};class m{constructor(t){var e;this.onStateChanged=t=>{const e=new Array;t.keysChanged.forEach((s=>{const a=t.changes.keys.get(s);a&&e.push({name:s,oldValue:a.oldValue,newValue:this.ystate.get(s)})})),this._changed.emit({stateChange:e})},this._changed=new i.Signal(this),this._isDisposed=!1,this._disposed=new i.Signal(this),this._ydoc=null!==(e=null==t?void 0:t.ydoc)&&void 0!==e?e:new c.Doc,this._ystate=this._ydoc.getMap("state"),this._undoManager=new c.UndoManager([],{trackedOrigins:new Set([this]),doc:this._ydoc}),this._awareness=new u(this._ydoc),this._ystate.observe(this.onStateChanged)}get ydoc(){return this._ydoc}get ystate(){return this._ystate}get undoManager(){return this._undoManager}get awareness(){return this._awareness}get changed(){return this._changed}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get state(){return o.JSONExt.deepCopy(this.ystate.toJSON())}canUndo(){return this.undoManager.undoStack.length>0}canRedo(){return this.undoManager.redoStack.length>0}dispose(){this._isDisposed||(this._isDisposed=!0,this.ystate.unobserve(this.onStateChanged),this.awareness.destroy(),this.undoManager.destroy(),this.ydoc.destroy(),this._disposed.emit(),i.Signal.clearData(this))}getState(t){const e=this.ystate.get(t);return void 0===e?e:o.JSONExt.deepCopy(e)}setState(t,e){o.JSONExt.deepEqual(this.ystate.get(t),e)||this.ystate.set(t,e)}undo(){this.undoManager.undo()}redo(){this.undoManager.redo()}clearUndoHistory(){this.undoManager.clear()}transact(t,e=!0){this.ydoc.transact(t,e?this:null)}}class p extends m{constructor(){super(),this.version="1.0.0",this.ysource=this.ydoc.getText("source"),this._modelObserver=t=>{this._changed.emit({sourceChange:t.changes.delta})},this.undoManager.addToScope(this.ysource),this.ysource.observe(this._modelObserver)}static create(){return new p}get source(){return this.getSource()}set source(t){this.setSource(t)}dispose(){this.isDisposed||(this.ysource.unobserve(this._modelObserver),super.dispose())}getSource(){return this.ysource.toString()}setSource(t){this.transact((()=>{const e=this.ysource;e.delete(0,e.length),e.insert(0,t)}))}updateSource(t,e,s=""){this.transact((()=>{const a=this.ysource;a.insert(t,s),a.delete(t+s.length,e-t)}))}}const y=(t,e={})=>{switch(t.get("cell_type")){case"code":return new v(t,t.get("source"),t.get("outputs"),e);case"markdown":return new w(t,t.get("source"),e);case"raw":return new k(t,t.get("source"),e);default:throw new Error("Found unknown cell type")}},_=(t,e)=>{var s,a;const n=new c.Map,i=new c.Text,r=new c.Map;let d;switch(n.set("source",i),n.set("metadata",r),n.set("cell_type",t.cell_type),n.set("id",null!==(s=t.id)&&void 0!==s?s:o.UUID.uuid4()),t.cell_type){case"markdown":d=new w(n,i,{notebook:e},r),null!=t.attachments&&d.setAttachments(t.attachments);break;case"code":{const s=new c.Array;n.set("outputs",s),d=new v(n,i,s,{notebook:e},r);const o=t;d.execution_count=null!==(a=o.execution_count)&&void 0!==a?a:null,o.outputs&&d.setOutputs(o.outputs);break}default:d=new k(n,i,{notebook:e},r),t.attachments&&d.setAttachments(t.attachments)}return null!=t.metadata&&d.setMetadata(t.metadata),null!=t.source&&d.setSource("string"==typeof t.source?t.source:t.source.join("")),d},f=t=>_(t);class b{static create(t){return _({id:t,cell_type:this.prototype.cell_type})}constructor(t,e,s={},a){if(this._modelObserver=t=>{this._changed.emit(this.getChanges(t))},this._metadataChanged=new i.Signal(this),this._notebook=null,this._changed=new i.Signal(this),this._disposed=new i.Signal(this),this._isDisposed=!1,this._undoManager=null,this.ymodel=t,this._ysource=e,this._ymetadata=null!=a?a:this.ymodel.get("metadata"),this._prevSourceLength=e?e.length:0,this._notebook=null,this._awareness=null,this._undoManager=null,s.notebook)this._notebook=s.notebook;else{const t=new c.Doc;t.getArray().insert(0,[this.ymodel]),this._awareness=new u(t),this._undoManager=new c.UndoManager([this.ymodel],{trackedOrigins:new Set([this])})}this.ymodel.observeDeep(this._modelObserver)}get awareness(){var t,e,s;return null!==(s=null!==(t=this._awareness)&&void 0!==t?t:null===(e=this.notebook)||void 0===e?void 0:e.awareness)&&void 0!==s?s:null}get cell_type(){throw new Error("A YBaseCell must not be constructed")}get changed(){return this._changed}get disposed(){return this._disposed}get id(){return this.getId()}get isDisposed(){return this._isDisposed}get isStandalone(){return null!==this._notebook}get metadata(){return this.getMetadata()}set metadata(t){this.setMetadata(t)}get metadataChanged(){return this._metadataChanged}get notebook(){return this._notebook}get source(){return this.getSource()}set source(t){this.setSource(t)}get undoManager(){var t;return this.notebook?(null===(t=this.notebook)||void 0===t?void 0:t.disableDocumentWideUndoRedo)?this._undoManager:this.notebook.undoManager:this._undoManager}setUndoManager(){if(this._undoManager)throw new Error("The cell undo manager is already set.");this._notebook&&this._notebook.disableDocumentWideUndoRedo&&(this._undoManager=new c.UndoManager([this.ymodel],{trackedOrigins:new Set([this])}))}get ysource(){return this._ysource}canUndo(){return!!this.undoManager&&this.undoManager.undoStack.length>0}canRedo(){return!!this.undoManager&&this.undoManager.redoStack.length>0}clearUndoHistory(){var t;null===(t=this.undoManager)||void 0===t||t.clear()}undo(){var t;null===(t=this.undoManager)||void 0===t||t.undo()}redo(){var t;null===(t=this.undoManager)||void 0===t||t.redo()}dispose(){var t;if(!this._isDisposed){if(this._isDisposed=!0,this.ymodel.unobserveDeep(this._modelObserver),this._awareness){const t=this._awareness.doc;this._awareness.destroy(),t.destroy()}this._undoManager&&(this._undoManager===(null===(t=this.notebook)||void 0===t?void 0:t.undoManager)?this._undoManager=null:this._undoManager.destroy()),this._disposed.emit(),i.Signal.clearData(this)}}getId(){return this.ymodel.get("id")}getSource(){return this.ysource.toString()}setSource(t){this.transact((()=>{this.ysource.delete(0,this.ysource.length),this.ysource.insert(0,t)}))}updateSource(t,e,s=""){this.transact((()=>{const a=this.ysource;a.insert(t,s),a.delete(t+s.length,e-t)}))}deleteMetadata(t){void 0!==this.getMetadata(t)&&this.transact((()=>{this._ymetadata.delete(t);const e=this.getMetadata("jupyter");if("collapsed"===t&&e){const{outputs_hidden:t,...s}=e;0===Object.keys(s).length?this._ymetadata.delete("jupyter"):this._ymetadata.set("jupyter",s)}else"jupyter"===t&&this._ymetadata.delete("collapsed")}),!1)}getMetadata(t){const e=this._ymetadata;if(void 0!==e)return"string"==typeof t?void 0===e.get(t)?void 0:o.JSONExt.deepCopy(e.get(t)):o.JSONExt.deepCopy(e.toJSON())}setMetadata(t,e){var s,a;if("string"==typeof t){if(void 0===e)throw new TypeError(`Metadata value for ${t} cannot be 'undefined'; use deleteMetadata.`);const a=t;if(o.JSONExt.deepEqual(null!==(s=this.getMetadata(a))&&void 0!==s?s:null,e))return;this.transact((()=>{var t;if(this._ymetadata.set(a,e),"collapsed"===a){const s=null!==(t=this.getMetadata("jupyter"))&&void 0!==t?t:{};s.outputs_hidden!==e&&this.setMetadata("jupyter",{...s,outputs_hidden:e})}else if("jupyter"===a){const t=e.outputs_hidden;void 0!==t?this.getMetadata("collapsed")!==t&&this.setMetadata("collapsed",t):this.deleteMetadata("collapsed")}}),!1)}else{const e=o.JSONExt.deepCopy(t);null!=e.collapsed?(e.jupyter=e.jupyter||{},e.jupyter.outputs_hidden=e.collapsed):null!=(null===(a=null==e?void 0:e.jupyter)||void 0===a?void 0:a.outputs_hidden)&&(e.collapsed=e.jupyter.outputs_hidden),o.JSONExt.deepEqual(e,this.getMetadata())||this.transact((()=>{for(const[t,s]of Object.entries(e))this._ymetadata.set(t,s)}),!1)}}toJSON(){return{id:this.getId(),cell_type:this.cell_type,source:this.getSource(),metadata:this.getMetadata()}}transact(t,e=!0){!this.notebook||this.notebook.disableDocumentWideUndoRedo?null==this.ymodel.doc?t():this.ymodel.doc.transact(t,e?this:null):this.notebook.transact(t,e)}getChanges(t){const e={},s=t.find((t=>t.target===this.ymodel.get("source")));s&&(e.sourceChange=s.changes.delta);const a=t.find((t=>t.target===this._ymetadata));a&&(e.metadataChange=a.changes.keys,a.changes.keys.forEach(((t,e)=>{switch(t.action){case"add":this._metadataChanged.emit({key:e,newValue:this._ymetadata.get(e),type:"add"});break;case"delete":this._metadataChanged.emit({key:e,oldValue:t.oldValue,type:"remove"});break;case"update":{const s=this._ymetadata.get(e),a=t.oldValue;let n=!0;n="object"==typeof a&&"object"==typeof s?o.JSONExt.deepEqual(a,s):a===s,n||this._metadataChanged.emit({key:e,type:"change",oldValue:a,newValue:s})}}})));const n=t.find((t=>t.target===this.ymodel)),i=this.ymodel.get("source");return n&&n.keysChanged.has("source")&&(e.sourceChange=[{delete:this._prevSourceLength},{insert:i.toString()}]),this._prevSourceLength=i.length,e}}class v extends b{static create(t){return super.create(t)}constructor(t,e,s,a={},n){super(t,e,a,n),this._youtputs=s}get cell_type(){return"code"}get execution_count(){return this.ymodel.get("execution_count")||null}set execution_count(t){this.ymodel.get("execution_count")!==t&&this.transact((()=>{this.ymodel.set("execution_count",t)}),!1)}get outputs(){return this.getOutputs()}set outputs(t){this.setOutputs(t)}getOutputs(){return o.JSONExt.deepCopy(this._youtputs.toArray())}setOutputs(t){this.transact((()=>{this._youtputs.delete(0,this._youtputs.length),this._youtputs.insert(0,t)}),!1)}updateOutputs(t,e,s=[]){const a=e<this._youtputs.length?e-t:this._youtputs.length-t;this.transact((()=>{this._youtputs.delete(t,a),this._youtputs.insert(t,s)}),!1)}toJSON(){return{...super.toJSON(),outputs:this.getOutputs(),execution_count:this.execution_count}}getChanges(t){const e=super.getChanges(t),s=t.find((t=>t.target===this.ymodel.get("outputs")));s&&(e.outputsChange=s.changes.delta);const a=t.find((t=>t.target===this.ymodel));if(a&&a.keysChanged.has("execution_count")){const t=a.changes.keys.get("execution_count");e.executionCountChange={oldValue:t.oldValue,newValue:this.ymodel.get("execution_count")}}return e}}class M extends b{get attachments(){return this.getAttachments()}set attachments(t){this.setAttachments(t)}getAttachments(){return this.ymodel.get("attachments")}setAttachments(t){this.transact((()=>{null==t?this.ymodel.delete("attachments"):this.ymodel.set("attachments",t)}),!1)}getChanges(t){const e=super.getChanges(t),s=t.find((t=>t.target===this.ymodel));if(s&&s.keysChanged.has("attachments")){const t=s.changes.keys.get("attachments");e.executionCountChange={oldValue:t.oldValue,newValue:this.ymodel.get("attachments")}}return e}}class k extends M{static create(t){return super.create(t)}get cell_type(){return"raw"}toJSON(){return{id:this.getId(),cell_type:"raw",source:this.getSource(),metadata:this.getMetadata(),attachments:this.getAttachments()}}}class w extends M{static create(t){return super.create(t)}get cell_type(){return"markdown"}toJSON(){return{id:this.getId(),cell_type:"markdown",source:this.getSource(),metadata:this.getMetadata(),attachments:this.getAttachments()}}}class C extends m{constructor(t={}){var e;super(),this.version="1.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=t=>{const e=t.find((t=>t.target===this.ymeta.get("metadata")));if(e){const t=e.changes.keys,s=this.ymeta.get("metadata");e.changes.keys.forEach(((t,e)=>{switch(t.action){case"add":this._metadataChanged.emit({key:e,type:"add",newValue:s.get(e)});break;case"delete":this._metadataChanged.emit({key:e,type:"remove",oldValue:t.oldValue});break;case"update":{const a=s.get(e),n=t.oldValue;let i=!0;i="object"==typeof n&&"object"==typeof a?o.JSONExt.deepEqual(n,a):n===a,i||this._metadataChanged.emit({key:e,type:"change",oldValue:n,newValue:a})}}})),this._changed.emit({metadataChange:t})}const s=t.find((t=>t.target===this.ymeta));if(s){if(s.keysChanged.has("metadata")){const t=s.changes.keys.get("metadata");if("add"===(null==t?void 0:t.action)&&!t.oldValue){const t=new Map;for(const e of Object.keys(this.metadata))t.set(e,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:e,type:"add",newValue:this.getMetadata(e)});this._changed.emit({metadataChange:t})}}if(s.keysChanged.has("nbformat")){const t=s.changes.keys.get("nbformat"),e={key:"nbformat",oldValue:(null==t?void 0:t.oldValue)?t.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:e})}if(s.keysChanged.has("nbformat_minor")){const t=s.changes.keys.get("nbformat_minor"),e={key:"nbformat_minor",oldValue:(null==t?void 0:t.oldValue)?t.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:e})}}},this._onYCellsChanged=t=>{t.changes.added.forEach((t=>{const e=t.content.type;if(!this._ycellMapping.has(e)){const t=y(e,{notebook:this});t.setUndoManager(),this._ycellMapping.set(e,t)}})),t.changes.deleted.forEach((t=>{const e=t.content.type,s=this._ycellMapping.get(e);s&&(s.dispose(),this._ycellMapping.delete(e))}));let e=0;const s=[];t.changes.delta.forEach((t=>{if(null!=t.insert){const a=t.insert.map((t=>this._ycellMapping.get(t)));s.push({insert:a}),this.cells.splice(e,0,...a),e+=t.insert.length}else null!=t.delete?(s.push(t),this.cells.splice(e,t.delete)):null!=t.retain&&(s.push(t),e+=t.retain)})),this._changed.emit({cellsChange:s})},this._metadataChanged=new i.Signal(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=null!==(e=t.disableDocumentWideUndoRedo)&&void 0!==e&&e,this.cells=this._ycells.toArray().map((t=>(this._ycellMapping.has(t)||this._ycellMapping.set(t,y(t,{notebook:this})),this._ycellMapping.get(t)))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(t={}){var e,s,a,n,o,i,r,d,h;const l=new C({disableDocumentWideUndoRedo:null!==(e=t.disableDocumentWideUndoRedo)&&void 0!==e&&e}),c={cells:null!==(a=null===(s=t.data)||void 0===s?void 0:s.cells)&&void 0!==a?a:[],nbformat:null!==(o=null===(n=t.data)||void 0===n?void 0:n.nbformat)&&void 0!==o?o:4,nbformat_minor:null!==(r=null===(i=t.data)||void 0===i?void 0:i.nbformat_minor)&&void 0!==r?r:5,metadata:null!==(h=null===(d=t.data)||void 0===d?void 0:d.metadata)&&void 0!==h?h:{}};return l.fromJSON(c),l}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(t){this.setMetadata(t)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(t){this.transact((()=>{this.ymeta.set("nbformat",t)}),!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(t){this.transact((()=>{this.ymeta.set("nbformat_minor",t)}),!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(t){return this.cells[t]}addCell(t){return this.insertCell(this._ycells.length,t)}insertCell(t,e){return this.insertCells(t,[e])[0]}insertCells(t,e){const s=e.map((t=>{const e=_(t,this);return this._ycellMapping.set(e.ymodel,e),e}));return this.transact((()=>{this._ycells.insert(t,s.map((t=>t.ymodel)))})),s.forEach((t=>{t.setUndoManager()})),s}moveCell(t,e){this.moveCells(t,e)}moveCells(t,e,s=1){const a=new Array(s).fill(!0).map(((e,s)=>this.getCell(t+s).toJSON()));this.transact((()=>{this._ycells.delete(t,s),this._ycells.insert(t>e?e:e-s+1,a.map((t=>_(t,this).ymodel)))}))}deleteCell(t){this.deleteCellRange(t,t+1)}deleteCellRange(t,e){this.transact((()=>{this._ycells.delete(t,e-t)}))}deleteMetadata(t){if(void 0===this.getMetadata(t))return;const e=this.metadata;delete e[t],this.setMetadata(e)}getMetadata(t){const e=this.ymeta.get("metadata");if(void 0!==e){if("string"==typeof t){const s=e.get(t);return void 0===s?void 0:o.JSONExt.deepCopy(s)}return o.JSONExt.deepCopy(e.toJSON())}}setMetadata(t,e){var s;if("string"==typeof t){if(void 0===e)throw new TypeError(`Metadata value for ${t} cannot be 'undefined'; use deleteMetadata.`);if(o.JSONExt.deepEqual(null!==(s=this.getMetadata(t))&&void 0!==s?s:null,e))return;const a={};a[t]=e,this.updateMetadata(a)}else if(!this.metadata||!o.JSONExt.deepEqual(this.metadata,t)){const e=o.JSONExt.deepCopy(t),s=this.ymeta.get("metadata");if(void 0===s)return;this.transact((()=>{s.clear();for(const[t,a]of Object.entries(e))s.set(t,a)}))}}updateMetadata(t){const e=o.JSONExt.deepCopy(t),s=this.ymeta.get("metadata");void 0!==s&&this.transact((()=>{for(const[t,a]of Object.entries(e))s.set(t,a)}))}fromJSON(t){this.transact((()=>{this.nbformat=t.nbformat,this.nbformat_minor=t.nbformat_minor;const e=t.metadata;if(void 0!==e.orig_nbformat&&delete e.orig_nbformat,this.metadata)this.metadata=e;else{const t=new c.Map;for(const[s,a]of Object.entries(e))t.set(s,a);this.ymeta.set("metadata",t)}const s=4===t.nbformat&&t.nbformat_minor>=5,a=t.cells.map((t=>(s||delete t.id,t)));this.insertCells(this.cells.length,a),this.deleteCellRange(0,this.cells.length)}))}toJSON(){const t=4===this.nbformat&&this.nbformat_minor<=4;return{metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map((e=>{const s=e.toJSON();return t&&delete s.id,s}))}}}},79504:(t,e,s)=>{s.d(e,{Dp:()=>o,G:()=>i,JJ:()=>r,Z$:()=>a,kJ:()=>d,s7:()=>n});const a=t=>t[t.length-1],n=(t,e)=>{for(let s=0;s<e.length;s++)t.push(e[s])},o=Array.from,i=(t,e)=>{for(let s=0;s<t.length;s++)if(e(t[s],s,t))return!0;return!1},r=(t,e)=>{const s=new Array(t);for(let a=0;a<t;a++)s[a]=e(a,s);return s},d=Array.isArray},38828:(t,e,s)=>{s.d(e,{Hi:()=>r,PP:()=>o,gB:()=>d,id:()=>i});var a=s(79504),n=s(36498);const o=(t,e,s=0)=>{try{for(;s<t.length;s++)t[s](...e)}finally{s<t.length&&o(t,e,s+1)}},i=t=>t,r=(t,e)=>{if(null==t||null==e)return((t,e)=>t===e)(t,e);if(t.constructor!==e.constructor)return!1;if(t===e)return!0;switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:if(t.byteLength!==e.byteLength)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;break;case Set:if(t.size!==e.size)return!1;for(const s of t)if(!e.has(s))return!1;break;case Map:if(t.size!==e.size)return!1;for(const s of t.keys())if(!e.has(s)||!r(t.get(s),e.get(s)))return!1;break;case Object:if(n.kE(t)!==n.kE(e))return!1;for(const s in t)if(!n.l$(t,s)||!r(t[s],e[s]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(!r(t[s],e[s]))return!1;break;default:return!1}return!0},d=(t,e)=>e.includes(t);a.kJ},22592:(t,e,s)=>{s.d(e,{JG:()=>n,UI:()=>i,Ue:()=>a,Yj:()=>r,Yu:()=>o});const a=()=>new Map,n=t=>{const e=a();return t.forEach(((t,s)=>{e.set(s,t)})),e},o=(t,e,s)=>{let a=t.get(e);return void 0===a&&t.set(e,a=s()),a},i=(t,e)=>{const s=[];for(const[a,n]of t)s.push(e(n,a));return s},r=(t,e)=>{for(const[s,a]of t)if(e(a,s))return!0;return!1}},11182:(t,e,s)=>{s.d(e,{Fp:()=>i,GR:()=>r,GW:()=>a,VV:()=>o,Wn:()=>n});const a=Math.floor,n=(Math.ceil,Math.abs),o=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(t,e)=>t<e?t:e),i=(t,e)=>t>e?t:e,r=(Number.isNaN,Math.pow,Math.sign,t=>0!==t?t<0:1/t<0)},36498:(t,e,s)=>{s.d(e,{$m:()=>h,Ed:()=>o,f0:()=>a,kE:()=>i,l$:()=>d,xb:()=>r});const a=Object.assign,n=Object.keys,o=(t,e)=>{for(const s in t)e(t[s],s)},i=t=>n(t).length,r=t=>{for(const e in t)return!1;return!0},d=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h=(t,e)=>t===e||i(t)===i(e)&&((t,e)=>{for(const s in t)if(!e(t[s],s))return!1;return!0})(t,((t,s)=>(void 0!==t||d(e,s))&&e[s]===t))},12330:(t,e,s)=>{s.d(e,{y:()=>i});var a=s(22592),n=s(79287),o=s(79504);class i{constructor(){this._observers=a.Ue()}on(t,e){a.Yu(this._observers,t,n.Ue).add(e)}once(t,e){const s=(...a)=>{this.off(t,s),e(...a)};this.on(t,s)}off(t,e){const s=this._observers.get(t);void 0!==s&&(s.delete(e),0===s.size&&this._observers.delete(t))}emit(t,e){return o.Dp((this._observers.get(t)||a.Ue()).values()).forEach((t=>t(...e)))}destroy(){this._observers=a.Ue()}}},79287:(t,e,s)=>{s.d(e,{Ue:()=>a});const a=()=>new Set},2431:(t,e,s)=>{s.d(e,{ZG:()=>a});const a=Date.now}}]);