notebook 7.1.0rc0__py3-none-any.whl → 7.1.0rc1__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 (79) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/1650.bundle.js +1 -1
  3. notebook/static/1682.bundle.js +1 -1
  4. notebook/static/1684.bundle.js +1 -1
  5. notebook/static/1827.bundle.js +1 -1
  6. notebook/static/1833.bundle.js +1 -1
  7. notebook/static/2067.bundle.js +1 -1
  8. notebook/static/2184.bundle.js +1 -1
  9. notebook/static/2512.bundle.js +1 -1
  10. notebook/static/2577.bundle.js +1 -1
  11. notebook/static/3512.bundle.js +1 -1
  12. notebook/static/3768.bundle.js +1 -1
  13. notebook/static/377.bundle.js +1 -1
  14. notebook/static/4382.bundle.js +1 -1
  15. notebook/static/4558.bundle.js +1 -1
  16. notebook/static/4645.bundle.js +1 -1
  17. notebook/static/5099.bundle.js +1 -1
  18. notebook/static/5135.bundle.js +1 -1
  19. notebook/static/514.bundle.js +1 -1
  20. notebook/static/5313.bundle.js +1 -1
  21. notebook/static/5325.bundle.js +1 -1
  22. notebook/static/5573.bundle.js +1 -1
  23. notebook/static/5601.bundle.js +1 -1
  24. notebook/static/5649.bundle.js +2 -2
  25. notebook/static/6017.bundle.js +1 -1
  26. notebook/static/6345.bundle.js +1 -1
  27. notebook/static/6621.bundle.js +1 -1
  28. notebook/static/6853.bundle.js +1 -1
  29. notebook/static/7302.bundle.js +1 -1
  30. notebook/static/7812.bundle.js +1 -1
  31. notebook/static/7900.bundle.js +1 -1
  32. notebook/static/7906.bundle.js +1 -1
  33. notebook/static/8579.bundle.js +1 -1
  34. notebook/static/8781.bundle.js +1 -1
  35. notebook/static/8875.bundle.js +1 -1
  36. notebook/static/8928.bundle.js +1 -1
  37. notebook/static/901.bundle.js +1 -1
  38. notebook/static/9341.bundle.js +1 -1
  39. notebook/static/9380.bundle.js +1 -1
  40. notebook/static/9680.bundle.js +1 -1
  41. notebook/static/bundle.js +1 -1
  42. notebook/static/third-party-licenses.json +11 -11
  43. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  44. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  45. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  46. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  47. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  48. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  49. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  50. notebook-7.1.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.a662ef5ec5d782f45f74.js → notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.7c69f17d842172804b2c.js +1 -1
  51. notebook-7.1.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.3444a26629e196e5b2de.js → notebook-7.1.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.de9e68f80570f96cb86a.js +1 -1
  52. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +1 -1
  53. {notebook-7.1.0rc0.dist-info → notebook-7.1.0rc1.dist-info}/METADATA +2 -2
  54. {notebook-7.1.0rc0.dist-info → notebook-7.1.0rc1.dist-info}/RECORD +79 -79
  55. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  56. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  57. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  58. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  59. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  60. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  61. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  62. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  63. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  64. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  65. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  66. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  67. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  68. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  69. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  70. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  71. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  72. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  73. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/913.ed31b967ed65df80c2cf.js +0 -0
  74. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.bf68c8ab6c905f205d45.js +0 -0
  75. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  76. {notebook-7.1.0rc0.data → notebook-7.1.0rc1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  77. {notebook-7.1.0rc0.dist-info → notebook-7.1.0rc1.dist-info}/WHEEL +0 -0
  78. {notebook-7.1.0rc0.dist-info → notebook-7.1.0rc1.dist-info}/entry_points.txt +0 -0
  79. {notebook-7.1.0rc0.dist-info → notebook-7.1.0rc1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4558],{94558:(t,e,s)=>{s.r(e),s.d(e,{DocumentManager:()=>x,DocumentWidgetManager:()=>P,IDocumentManager:()=>A,IDocumentWidgetOpener:()=>O,PathStatus:()=>W,SaveHandler:()=>f,SavingStatus:()=>E,isValidFileName:()=>d,renameDialog:()=>l,renameFile:()=>h,shouldOverwrite:()=>c});var i,n=s(98244),a=s(70788),o=s(42539),r=s(31516);function l(t,e,s){const i=(s=s||o.nullTranslator).load("jupyterlab"),a=e.localPath.split("/").pop()||e.localPath;return(0,n.showDialog)({title:i.__("Rename File"),body:new g(a),focusNodeSelector:"input",buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:i.__("Rename"),ariaLabel:i.__("Rename File")})]}).then((t=>t.value?d(t.value)?e.rename(t.value):((0,n.showErrorMessage)(i.__("Rename Error"),Error(i.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',t.value))),null):null))}function h(t,e,s){return t.rename(e,s).catch((i=>{if(409!==i.response.status)throw i;return c(s).then((i=>i?t.overwrite(e,s):Promise.reject("File not renamed")))}))}function c(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i={title:s.__("Overwrite file?"),body:s.__('"%1" already exists, overwrite?',t),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s.__("Overwrite"),ariaLabel:s.__("Overwrite Existing File")})]};return(0,n.showDialog)(i).then((t=>Promise.resolve(t.button.accept)))}function d(t){return t.length>0&&!/[\/\\:]/.test(t)}class g extends r.Widget{constructor(t){super({node:i.createRenameNode(t)}),this.addClass("jp-FileDialog");const e=a.PathExt.extname(t),s=this.inputNode.value=a.PathExt.basename(t);this.inputNode.setSelectionRange(0,s.length-e.length)}get inputNode(){return this.node.getElementsByTagName("input")[0]}getValue(){return this.inputNode.value}}!function(t){t.createRenameNode=function(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i=document.createElement("div"),n=document.createElement("label");n.textContent=s.__("File Path");const a=document.createElement("span");a.textContent=t;const r=document.createElement("label");r.textContent=s.__("New Name"),r.className="jp-new-name-title";const l=document.createElement("input");return i.appendChild(n),i.appendChild(a),i.appendChild(r),i.appendChild(l),i}}(i||(i={}));var u=s(19928),_=s(33625),m=s(20998),p=s(14421),v=s(81997);class f{constructor(t){this._autosaveTimer=-1,this._minInterval=-1,this._interval=-1,this._isActive=!1,this._inDialog=!1,this._isDisposed=!1,this._multiplier=10,this._context=t.context,this._isConnectedCallback=t.isConnectedCallback||(()=>!0);const e=t.saveInterval||120;this._minInterval=1e3*e,this._interval=this._minInterval,this._context.fileChanged.connect(this._setTimer,this),this._context.disposed.connect(this.dispose,this)}get saveInterval(){return this._interval/1e3}set saveInterval(t){this._minInterval=this._interval=1e3*t,this._isActive&&this._setTimer()}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,clearTimeout(this._autosaveTimer),v.Signal.clearData(this))}start(){this._isActive=!0,this._setTimer()}stop(){this._isActive=!1,clearTimeout(this._autosaveTimer)}_setTimer(){clearTimeout(this._autosaveTimer),this._isActive&&(this._autosaveTimer=window.setTimeout((()=>{this._isConnectedCallback()&&this._save()}),this._interval))}_save(){const t=this._context;if(this._setTimer(),!t)return;if(!t.contentsModel||!t.contentsModel.writable||!t.model.dirty||this._inDialog)return;const e=(new Date).getTime();t.save().then((()=>{if(this.isDisposed)return;const t=(new Date).getTime()-e;this._interval=Math.max(this._multiplier*t,this._minInterval),this._setTimer()})).catch((t=>{const{name:e}=t;"ModalCancelError"!==e&&"ModalDuplicateError"!==e&&console.error("Error in Auto-Save",t.message)}))}}var w,C,y=s(2549),D=s(49503);class P{constructor(t){this._activateRequested=new v.Signal(this),this._confirmClosingTab=!1,this._isDisposed=!1,this._stateChanged=new v.Signal(this),this._registry=t.registry,this.translator=t.translator||o.nullTranslator}get activateRequested(){return this._activateRequested}get confirmClosingDocument(){return this._confirmClosingTab}set confirmClosingDocument(t){if(this._confirmClosingTab!==t){const e=this._confirmClosingTab;this._confirmClosingTab=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.disconnectReceiver(this))}createWidget(t,e){const s=t.createNew(e);return this._initializeWidget(s,t,e),s}_initializeWidget(t,e,s){w.factoryProperty.set(t,e);const i=new y.DisposableSet;for(const n of this._registry.widgetExtensions(e.name)){const e=n.createNew(t,s);e&&i.add(e)}w.disposablesProperty.set(t,i),t.disposed.connect(this._onWidgetDisposed,this),this.adoptWidget(s,t),s.fileChanged.connect(this._onFileChanged,this),s.pathChanged.connect(this._onPathChanged,this),s.ready.then((()=>{this.setCaption(t)}))}adoptWidget(t,e){w.widgetsProperty.get(t).push(e),D.MessageLoop.installMessageHook(e,this),e.addClass("jp-Document"),e.title.closable=!0,e.disposed.connect(this._widgetDisposed,this),w.contextProperty.set(e,t)}findWidget(t,e){const s=w.widgetsProperty.get(t);if(s)return(0,_.find)(s,(t=>{const s=w.factoryProperty.get(t);return!!s&&s.name===e}))}contextForWidget(t){return w.contextProperty.get(t)}cloneWidget(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.factoryProperty.get(t);if(!s)return;const i=s.createNew(e,t);return this._initializeWidget(i,s,e),i}closeWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onClose(t)))).then((()=>{}))}deleteWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onDelete(t)))).then((()=>{}))}messageHook(t,e){switch(e.type){case"close-request":return this.onClose(t),!1;case"activate-request":{const e=this.contextForWidget(t);e&&this._activateRequested.emit(e.path);break}}return!0}async setCaption(t){const e=this.translator.load("jupyterlab"),s=w.contextProperty.get(t);if(!s)return;const i=s.contentsModel;if(i)return s.listCheckpoints().then((n=>{if(t.isDisposed)return;const o=n[n.length-1],r=o?a.Time.format(o.last_modified):"None";let l=e.__("Name: %1\nPath: %2\n",i.name,i.path);s.model.readOnly?l+=e.__("Read-only"):l+=e.__("Last Saved: %1\n",a.Time.format(i.last_modified))+e.__("Last Checkpoint: %1",r),t.title.caption=l}));t.title.caption=""}async onClose(t){var e;const[s,i]=await this._maybeClose(t,this.translator);if(t.isDisposed)return!0;if(s){if(!i){const s=w.contextProperty.get(t);if(!s)return!0;(null===(e=s.contentsModel)||void 0===e?void 0:e.writable)?await s.save():await s.saveAs()}if(t.isDisposed)return!0;t.dispose()}return s}onDelete(t){return t.dispose(),Promise.resolve(void 0)}async _maybeClose(t,e){var s,i;const a=(e=e||o.nullTranslator).load("jupyterlab"),r=w.contextProperty.get(t);if(!r)return Promise.resolve([!0,!0]);let l=w.widgetsProperty.get(r);if(!l)return Promise.resolve([!0,!0]);l=l.filter((t=>{const e=w.factoryProperty.get(t);return!!e&&!1===e.readOnly}));const h=t.title.label,c=w.factoryProperty.get(t),d=r.model.dirty&&l.length<=1&&!(null===(s=null==c?void 0:c.readOnly)||void 0===s||s);if(this.confirmClosingDocument){const t=[n.Dialog.cancelButton(),n.Dialog.okButton({label:d?a.__("Close and save"):a.__("Close"),ariaLabel:d?a.__("Close and save Document"):a.__("Close Document")})];d&&t.splice(1,0,n.Dialog.warnButton({label:a.__("Close without saving"),ariaLabel:a.__("Close Document without saving")}));const e=await(0,n.showDialog)({title:a.__("Confirmation"),body:a.__('Please confirm you want to close "%1".',h),checkbox:d?null:{label:a.__("Do not ask me again."),caption:a.__("If checked, no confirmation to close a document will be asked in the future.")},buttons:t});return e.isChecked&&(this.confirmClosingDocument=!1),Promise.resolve([e.button.accept,!d||"warn"===e.button.displayType])}{if(!d)return Promise.resolve([!0,!0]);const t=(null===(i=r.contentsModel)||void 0===i?void 0:i.writable)?a.__("Save"):a.__("Save as"),e=await(0,n.showDialog)({title:a.__("Save your work"),body:a.__('Save changes in "%1" before closing?',h),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:a.__("Discard"),ariaLabel:a.__("Discard changes to file")}),n.Dialog.okButton({label:t})]});return[e.button.accept,"warn"===e.button.displayType]}}_widgetDisposed(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.widgetsProperty.get(e);s&&(_.ArrayExt.removeFirstOf(s,t),s.length||e.dispose())}_onWidgetDisposed(t){w.disposablesProperty.get(t).dispose()}_onFileChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}_onPathChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}}!function(t){t.contextProperty=new p.AttachedProperty({name:"context",create:()=>{}}),t.factoryProperty=new p.AttachedProperty({name:"factory",create:()=>{}}),t.widgetsProperty=new p.AttachedProperty({name:"widgets",create:()=>[]}),t.disposablesProperty=new p.AttachedProperty({name:"disposables",create:()=>new y.DisposableSet})}(w||(w={}));class x{constructor(t){var e;this._activateRequested=new v.Signal(this),this._contexts=[],this._isDisposed=!1,this._autosave=!0,this._autosaveInterval=120,this._lastModifiedCheckMargin=500,this._renameUntitledFileOnSave=!0,this._stateChanged=new v.Signal(this),this.translator=t.translator||o.nullTranslator,this.registry=t.registry,this.services=t.manager,this._dialogs=null!==(e=t.sessionDialogs)&&void 0!==e?e:new n.SessionContextDialogs({translator:t.translator}),this._isConnectedCallback=t.isConnectedCallback||(()=>!0),this._opener=t.opener,this._when=t.when||t.manager.ready;const s=new P({registry:this.registry,translator:this.translator});s.activateRequested.connect(this._onActivateRequested,this),s.stateChanged.connect(this._onWidgetStateChanged,this),this._widgetManager=s,this._setBusy=t.setBusy}get activateRequested(){return this._activateRequested}get autosave(){return this._autosave}set autosave(t){if(this._autosave!==t){const e=this._autosave;this._autosave=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(!0!==t||s.isActive?!1===t&&s.isActive&&s.stop():s.start())})),this._stateChanged.emit({name:"autosave",oldValue:e,newValue:t})}}get autosaveInterval(){return this._autosaveInterval}set autosaveInterval(t){if(this._autosaveInterval!==t){const e=this._autosaveInterval;this._autosaveInterval=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(s.saveInterval=t||120)})),this._stateChanged.emit({name:"autosaveInterval",oldValue:e,newValue:t})}}get confirmClosingDocument(){return this._widgetManager.confirmClosingDocument}set confirmClosingDocument(t){if(this._widgetManager.confirmClosingDocument!==t){const e=this._widgetManager.confirmClosingDocument;this._widgetManager.confirmClosingDocument=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(t){if(this._lastModifiedCheckMargin!==t){const e=this._lastModifiedCheckMargin;this._lastModifiedCheckMargin=t,this._contexts.forEach((e=>{e.lastModifiedCheckMargin=t})),this._stateChanged.emit({name:"lastModifiedCheckMargin",oldValue:e,newValue:t})}}get renameUntitledFileOnSave(){return this._renameUntitledFileOnSave}set renameUntitledFileOnSave(t){if(this._renameUntitledFileOnSave!==t){const e=this._renameUntitledFileOnSave;this._renameUntitledFileOnSave=t,this._stateChanged.emit({name:"renameUntitledFileOnSave",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.clearData(this),this._contexts.forEach((t=>this._widgetManager.closeWidgets(t))),this._widgetManager.dispose(),this._contexts.length=0)}cloneWidget(t){return this._widgetManager.cloneWidget(t)}closeAll(){return Promise.all(this._contexts.map((t=>this._widgetManager.closeWidgets(t)))).then((()=>{}))}closeFile(t){const e=this._contextsForPath(t).map((t=>this._widgetManager.closeWidgets(t)));return Promise.all(e).then((t=>{}))}contextForWidget(t){return this._widgetManager.contextForWidget(t)}copy(t,e){return this.services.contents.copy(t,e)}createNew(t,e="default",s){return this._createOrOpenDocument("create",t,e,s)}deleteFile(t){return this.services.sessions.stopIfNeeded(t).then((()=>this.services.contents.delete(t))).then((()=>(this._contextsForPath(t).forEach((t=>this._widgetManager.deleteWidgets(t))),Promise.resolve(void 0))))}duplicate(t){const e=a.PathExt.dirname(t);return this.services.contents.copy(t,e)}findWidget(t,e="default"){const s=a.PathExt.normalize(t);let i=[e];if("default"===e){const t=this.registry.defaultWidgetFactory(s);if(!t)return;i=[t.name]}else null===e&&(i=this.registry.preferredWidgetFactories(s).map((t=>t.name)));for(const t of this._contextsForPath(s))for(const e of i)if(null!==e){const s=this._widgetManager.findWidget(t,e);if(s)return s}}newUntitled(t){return"file"===t.type&&(t.ext=t.ext||".txt"),this.services.contents.newUntitled(t)}open(t,e="default",s,i){return this._createOrOpenDocument("open",t,e,s,i)}openOrReveal(t,e="default",s,i){const n=this.findWidget(t,e);return n?(this._opener.open(n,{type:e,...i}),n):this.open(t,e,s,null!=i?i:{})}overwrite(t,e){const s=`${e}.${m.UUID.uuid4()}`,i=()=>this.rename(s,e);return this.rename(t,s).then((()=>this.deleteFile(e))).then(i,i)}rename(t,e){return this.services.contents.rename(t,e)}_findContext(t,e){const s=this.services.contents.normalize(t);return(0,_.find)(this._contexts,(t=>t.path===s&&t.factoryName===e))}_contextsForPath(t){const e=this.services.contents.normalize(t);return this._contexts.filter((t=>t.path===e))}_createContext(t,e,s){const i=new u.Context({opener:(t,e)=>{this._widgetManager.adoptWidget(i,t),this._opener.open(t,e)},manager:this.services,factory:e,path:t,kernelPreference:s,setBusy:this._setBusy,sessionDialogs:this._dialogs,lastModifiedCheckMargin:this._lastModifiedCheckMargin,translator:this.translator}),n=new f({context:i,isConnectedCallback:this._isConnectedCallback,saveInterval:this.autosaveInterval});return C.saveHandlerProperty.set(i,n),i.ready.then((()=>{this.autosave&&n.start()})),i.disposed.connect(this._onContextDisposed,this),this._contexts.push(i),i}_onContextDisposed(t){_.ArrayExt.removeFirstOf(this._contexts,t)}_widgetFactoryFor(t,e){const{registry:s}=this;if("default"===e){const i=s.defaultWidgetFactory(t);if(!i)return;e=i.name}return s.getWidgetFactory(e)}_createOrOpenDocument(t,e,s="default",i,n){const a=this._widgetFactoryFor(e,s);if(!a)return;const o=a.modelName||"text",r=this.registry.getModelFactory(o);if(!r)return;const l=this.registry.getKernelPreference(e,a.name,i);let h,c=Promise.resolve(void 0);if("open"===t)h=this._findContext(e,r.name)||null,h||(h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!1))));else{if("create"!==t)throw new Error(`Invalid argument 'which': ${t}`);h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!0)))}const d=this._widgetManager.createWidget(a,h);return this._opener.open(d,{type:a.name,...n}),c.catch((t=>{console.error(`Failed to initialize the context with '${r.name}' for ${e}`,t),d.close()})),d}_onActivateRequested(t,e){this._activateRequested.emit(e)}_onWidgetStateChanged(t,e){"confirmClosingDocument"===e.name&&this._stateChanged.emit(e)}}!function(t){t.saveHandlerProperty=new p.AttachedProperty({name:"saveHandler",create:()=>{}})}(C||(C={}));var b=s(80890),M=s(70397),S=s(78156),T=s.n(S);function F(t){return T().createElement(b.TextItem,{source:t.name,title:t.fullPath})}class W extends M.VDomRenderer{constructor(t){super(new W.Model(t.docManager)),this.node.title=this.model.path}render(){return T().createElement(F,{fullPath:this.model.path,name:this.model.name})}}function k(t){return T().createElement(b.TextItem,{source:t.fileStatus})}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onTitleChange=t=>{const e=this._getAllState();this._name=t.label,this._triggerChange(e,this._getAllState())},this._onPathChange=(t,e)=>{const s=this._getAllState();this._path=e,this._name=a.PathExt.basename(e),this._triggerChange(s,this._getAllState())},this._path="",this._name="",this._widget=null,this._docManager=t}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(t){const e=this._widget;if(null!==e){const t=this._docManager.contextForWidget(e);t?t.pathChanged.disconnect(this._onPathChange):e.title.changed.disconnect(this._onTitleChange)}const s=this._getAllState();if(this._widget=t,null===this._widget)this._path="",this._name="";else{const t=this._docManager.contextForWidget(this._widget);t?(this._path=t.path,this._name=a.PathExt.basename(t.path),t.pathChanged.connect(this._onPathChange)):(this._path="",this._name=this._widget.title.label,this._widget.title.changed.connect(this._onTitleChange))}this._triggerChange(s,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(t,e){t[0]===e[0]&&t[1]===e[1]||this.stateChanged.emit(void 0)}}t.Model=e}(W||(W={}));class E extends M.VDomRenderer{constructor(t){super(new E.Model(t.docManager));const e=(t.translator||o.nullTranslator).load("jupyterlab");this._statusMap={completed:e.__("Saving completed"),started:e.__("Saving started"),failed:e.__("Saving failed")}}render(){return null===this.model||null===this.model.status?null:T().createElement(k,{fileStatus:this._statusMap[this.model.status]})}}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onStatusChange=(t,e)=>{this._status=e,"completed"===this._status?(setTimeout((()=>{this._status=null,this.stateChanged.emit(void 0)}),2e3),this.stateChanged.emit(void 0)):this.stateChanged.emit(void 0)},this._status=null,this._widget=null,this._status=null,this.widget=null,this._docManager=t}get status(){return this._status}get widget(){return this._widget}set widget(t){var e,s;const i=this._widget;if(null!==i){const t=this._docManager.contextForWidget(i);t?t.saveState.disconnect(this._onStatusChange):(null===(e=this._widget.content)||void 0===e?void 0:e.saveStateChanged)&&this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}if(this._widget=t,null===this._widget)this._status=null;else{const t=this._docManager.contextForWidget(this._widget);t?t.saveState.connect(this._onStatusChange):(null===(s=this._widget.content)||void 0===s?void 0:s.saveStateChanged)&&this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}t.Model=e}(E||(E={}));const A=new m.Token("@jupyterlab/docmanager:IDocumentManager","A service for the manager for all\n documents used by the application. Use this if you want to open and close documents,\n create and delete files, and otherwise interact with the file system."),O=new m.Token("@jupyterlab/docmanager:IDocumentWidgetOpener","A service to open a widget.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4558],{94558:(t,e,s)=>{s.r(e),s.d(e,{DocumentManager:()=>x,DocumentWidgetManager:()=>P,IDocumentManager:()=>A,IDocumentWidgetOpener:()=>O,PathStatus:()=>W,SaveHandler:()=>f,SavingStatus:()=>E,isValidFileName:()=>d,renameDialog:()=>l,renameFile:()=>h,shouldOverwrite:()=>c});var i,n=s(98244),a=s(70788),o=s(42539),r=s(31516);function l(t,e,s){const i=(s=s||o.nullTranslator).load("jupyterlab"),a=e.localPath.split("/").pop()||e.localPath;return(0,n.showDialog)({title:i.__("Rename File"),body:new g(a),focusNodeSelector:"input",buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:i.__("Rename"),ariaLabel:i.__("Rename File")})]}).then((t=>t.value?d(t.value)?e.rename(t.value):((0,n.showErrorMessage)(i.__("Rename Error"),Error(i.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',t.value))),null):null))}function h(t,e,s){return t.rename(e,s).catch((i=>{if(409!==i.response.status)throw i;return c(s).then((i=>i?t.overwrite(e,s):Promise.reject("File not renamed")))}))}function c(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i={title:s.__("Overwrite file?"),body:s.__('"%1" already exists, overwrite?',t),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s.__("Overwrite"),ariaLabel:s.__("Overwrite Existing File")})]};return(0,n.showDialog)(i).then((t=>Promise.resolve(t.button.accept)))}function d(t){return t.length>0&&!/[\/\\:]/.test(t)}class g extends r.Widget{constructor(t){super({node:i.createRenameNode(t)}),this.addClass("jp-FileDialog");const e=a.PathExt.extname(t),s=this.inputNode.value=a.PathExt.basename(t);this.inputNode.setSelectionRange(0,s.length-e.length)}get inputNode(){return this.node.getElementsByTagName("input")[0]}getValue(){return this.inputNode.value}}!function(t){t.createRenameNode=function(t,e){const s=(e=e||o.nullTranslator).load("jupyterlab"),i=document.createElement("div"),n=document.createElement("label");n.textContent=s.__("File Path");const a=document.createElement("span");a.textContent=t;const r=document.createElement("label");r.textContent=s.__("New Name"),r.className="jp-new-name-title";const l=document.createElement("input");return i.appendChild(n),i.appendChild(a),i.appendChild(r),i.appendChild(l),i}}(i||(i={}));var u=s(57526),_=s(33625),m=s(20998),p=s(14421),v=s(81997);class f{constructor(t){this._autosaveTimer=-1,this._minInterval=-1,this._interval=-1,this._isActive=!1,this._inDialog=!1,this._isDisposed=!1,this._multiplier=10,this._context=t.context,this._isConnectedCallback=t.isConnectedCallback||(()=>!0);const e=t.saveInterval||120;this._minInterval=1e3*e,this._interval=this._minInterval,this._context.fileChanged.connect(this._setTimer,this),this._context.disposed.connect(this.dispose,this)}get saveInterval(){return this._interval/1e3}set saveInterval(t){this._minInterval=this._interval=1e3*t,this._isActive&&this._setTimer()}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,clearTimeout(this._autosaveTimer),v.Signal.clearData(this))}start(){this._isActive=!0,this._setTimer()}stop(){this._isActive=!1,clearTimeout(this._autosaveTimer)}_setTimer(){clearTimeout(this._autosaveTimer),this._isActive&&(this._autosaveTimer=window.setTimeout((()=>{this._isConnectedCallback()&&this._save()}),this._interval))}_save(){const t=this._context;if(this._setTimer(),!t)return;if(!t.contentsModel||!t.contentsModel.writable||!t.model.dirty||this._inDialog)return;const e=(new Date).getTime();t.save().then((()=>{if(this.isDisposed)return;const t=(new Date).getTime()-e;this._interval=Math.max(this._multiplier*t,this._minInterval),this._setTimer()})).catch((t=>{const{name:e}=t;"ModalCancelError"!==e&&"ModalDuplicateError"!==e&&console.error("Error in Auto-Save",t.message)}))}}var w,C,y=s(2549),D=s(49503);class P{constructor(t){this._activateRequested=new v.Signal(this),this._confirmClosingTab=!1,this._isDisposed=!1,this._stateChanged=new v.Signal(this),this._registry=t.registry,this.translator=t.translator||o.nullTranslator}get activateRequested(){return this._activateRequested}get confirmClosingDocument(){return this._confirmClosingTab}set confirmClosingDocument(t){if(this._confirmClosingTab!==t){const e=this._confirmClosingTab;this._confirmClosingTab=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.disconnectReceiver(this))}createWidget(t,e){const s=t.createNew(e);return this._initializeWidget(s,t,e),s}_initializeWidget(t,e,s){w.factoryProperty.set(t,e);const i=new y.DisposableSet;for(const n of this._registry.widgetExtensions(e.name)){const e=n.createNew(t,s);e&&i.add(e)}w.disposablesProperty.set(t,i),t.disposed.connect(this._onWidgetDisposed,this),this.adoptWidget(s,t),s.fileChanged.connect(this._onFileChanged,this),s.pathChanged.connect(this._onPathChanged,this),s.ready.then((()=>{this.setCaption(t)}))}adoptWidget(t,e){w.widgetsProperty.get(t).push(e),D.MessageLoop.installMessageHook(e,this),e.addClass("jp-Document"),e.title.closable=!0,e.disposed.connect(this._widgetDisposed,this),w.contextProperty.set(e,t)}findWidget(t,e){const s=w.widgetsProperty.get(t);if(s)return(0,_.find)(s,(t=>{const s=w.factoryProperty.get(t);return!!s&&s.name===e}))}contextForWidget(t){return w.contextProperty.get(t)}cloneWidget(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.factoryProperty.get(t);if(!s)return;const i=s.createNew(e,t);return this._initializeWidget(i,s,e),i}closeWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onClose(t)))).then((()=>{}))}deleteWidgets(t){const e=w.widgetsProperty.get(t);return Promise.all(e.map((t=>this.onDelete(t)))).then((()=>{}))}messageHook(t,e){switch(e.type){case"close-request":return this.onClose(t),!1;case"activate-request":{const e=this.contextForWidget(t);e&&this._activateRequested.emit(e.path);break}}return!0}async setCaption(t){const e=this.translator.load("jupyterlab"),s=w.contextProperty.get(t);if(!s)return;const i=s.contentsModel;if(i)return s.listCheckpoints().then((n=>{if(t.isDisposed)return;const o=n[n.length-1],r=o?a.Time.format(o.last_modified):"None";let l=e.__("Name: %1\nPath: %2\n",i.name,i.path);s.model.readOnly?l+=e.__("Read-only"):l+=e.__("Last Saved: %1\n",a.Time.format(i.last_modified))+e.__("Last Checkpoint: %1",r),t.title.caption=l}));t.title.caption=""}async onClose(t){var e;const[s,i]=await this._maybeClose(t,this.translator);if(t.isDisposed)return!0;if(s){if(!i){const s=w.contextProperty.get(t);if(!s)return!0;(null===(e=s.contentsModel)||void 0===e?void 0:e.writable)?await s.save():await s.saveAs()}if(t.isDisposed)return!0;t.dispose()}return s}onDelete(t){return t.dispose(),Promise.resolve(void 0)}async _maybeClose(t,e){var s,i;const a=(e=e||o.nullTranslator).load("jupyterlab"),r=w.contextProperty.get(t);if(!r)return Promise.resolve([!0,!0]);let l=w.widgetsProperty.get(r);if(!l)return Promise.resolve([!0,!0]);l=l.filter((t=>{const e=w.factoryProperty.get(t);return!!e&&!1===e.readOnly}));const h=t.title.label,c=w.factoryProperty.get(t),d=r.model.dirty&&l.length<=1&&!(null===(s=null==c?void 0:c.readOnly)||void 0===s||s);if(this.confirmClosingDocument){const t=[n.Dialog.cancelButton(),n.Dialog.okButton({label:d?a.__("Close and save"):a.__("Close"),ariaLabel:d?a.__("Close and save Document"):a.__("Close Document")})];d&&t.splice(1,0,n.Dialog.warnButton({label:a.__("Close without saving"),ariaLabel:a.__("Close Document without saving")}));const e=await(0,n.showDialog)({title:a.__("Confirmation"),body:a.__('Please confirm you want to close "%1".',h),checkbox:d?null:{label:a.__("Do not ask me again."),caption:a.__("If checked, no confirmation to close a document will be asked in the future.")},buttons:t});return e.isChecked&&(this.confirmClosingDocument=!1),Promise.resolve([e.button.accept,!d||"warn"===e.button.displayType])}{if(!d)return Promise.resolve([!0,!0]);const t=(null===(i=r.contentsModel)||void 0===i?void 0:i.writable)?a.__("Save"):a.__("Save as"),e=await(0,n.showDialog)({title:a.__("Save your work"),body:a.__('Save changes in "%1" before closing?',h),buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:a.__("Discard"),ariaLabel:a.__("Discard changes to file")}),n.Dialog.okButton({label:t})]});return[e.button.accept,"warn"===e.button.displayType]}}_widgetDisposed(t){const e=w.contextProperty.get(t);if(!e)return;const s=w.widgetsProperty.get(e);s&&(_.ArrayExt.removeFirstOf(s,t),s.length||e.dispose())}_onWidgetDisposed(t){w.disposablesProperty.get(t).dispose()}_onFileChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}_onPathChanged(t){const e=w.widgetsProperty.get(t);for(const t of e)this.setCaption(t)}}!function(t){t.contextProperty=new p.AttachedProperty({name:"context",create:()=>{}}),t.factoryProperty=new p.AttachedProperty({name:"factory",create:()=>{}}),t.widgetsProperty=new p.AttachedProperty({name:"widgets",create:()=>[]}),t.disposablesProperty=new p.AttachedProperty({name:"disposables",create:()=>new y.DisposableSet})}(w||(w={}));class x{constructor(t){var e;this._activateRequested=new v.Signal(this),this._contexts=[],this._isDisposed=!1,this._autosave=!0,this._autosaveInterval=120,this._lastModifiedCheckMargin=500,this._renameUntitledFileOnSave=!0,this._stateChanged=new v.Signal(this),this.translator=t.translator||o.nullTranslator,this.registry=t.registry,this.services=t.manager,this._dialogs=null!==(e=t.sessionDialogs)&&void 0!==e?e:new n.SessionContextDialogs({translator:t.translator}),this._isConnectedCallback=t.isConnectedCallback||(()=>!0),this._opener=t.opener,this._when=t.when||t.manager.ready;const s=new P({registry:this.registry,translator:this.translator});s.activateRequested.connect(this._onActivateRequested,this),s.stateChanged.connect(this._onWidgetStateChanged,this),this._widgetManager=s,this._setBusy=t.setBusy}get activateRequested(){return this._activateRequested}get autosave(){return this._autosave}set autosave(t){if(this._autosave!==t){const e=this._autosave;this._autosave=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(!0!==t||s.isActive?!1===t&&s.isActive&&s.stop():s.start())})),this._stateChanged.emit({name:"autosave",oldValue:e,newValue:t})}}get autosaveInterval(){return this._autosaveInterval}set autosaveInterval(t){if(this._autosaveInterval!==t){const e=this._autosaveInterval;this._autosaveInterval=t,this._contexts.forEach((e=>{const s=C.saveHandlerProperty.get(e);s&&(s.saveInterval=t||120)})),this._stateChanged.emit({name:"autosaveInterval",oldValue:e,newValue:t})}}get confirmClosingDocument(){return this._widgetManager.confirmClosingDocument}set confirmClosingDocument(t){if(this._widgetManager.confirmClosingDocument!==t){const e=this._widgetManager.confirmClosingDocument;this._widgetManager.confirmClosingDocument=t,this._stateChanged.emit({name:"confirmClosingDocument",oldValue:e,newValue:t})}}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(t){if(this._lastModifiedCheckMargin!==t){const e=this._lastModifiedCheckMargin;this._lastModifiedCheckMargin=t,this._contexts.forEach((e=>{e.lastModifiedCheckMargin=t})),this._stateChanged.emit({name:"lastModifiedCheckMargin",oldValue:e,newValue:t})}}get renameUntitledFileOnSave(){return this._renameUntitledFileOnSave}set renameUntitledFileOnSave(t){if(this._renameUntitledFileOnSave!==t){const e=this._renameUntitledFileOnSave;this._renameUntitledFileOnSave=t,this._stateChanged.emit({name:"renameUntitledFileOnSave",oldValue:e,newValue:t})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,v.Signal.clearData(this),this._contexts.forEach((t=>this._widgetManager.closeWidgets(t))),this._widgetManager.dispose(),this._contexts.length=0)}cloneWidget(t){return this._widgetManager.cloneWidget(t)}closeAll(){return Promise.all(this._contexts.map((t=>this._widgetManager.closeWidgets(t)))).then((()=>{}))}closeFile(t){const e=this._contextsForPath(t).map((t=>this._widgetManager.closeWidgets(t)));return Promise.all(e).then((t=>{}))}contextForWidget(t){return this._widgetManager.contextForWidget(t)}copy(t,e){return this.services.contents.copy(t,e)}createNew(t,e="default",s){return this._createOrOpenDocument("create",t,e,s)}deleteFile(t){return this.services.sessions.stopIfNeeded(t).then((()=>this.services.contents.delete(t))).then((()=>(this._contextsForPath(t).forEach((t=>this._widgetManager.deleteWidgets(t))),Promise.resolve(void 0))))}duplicate(t){const e=a.PathExt.dirname(t);return this.services.contents.copy(t,e)}findWidget(t,e="default"){const s=a.PathExt.normalize(t);let i=[e];if("default"===e){const t=this.registry.defaultWidgetFactory(s);if(!t)return;i=[t.name]}else null===e&&(i=this.registry.preferredWidgetFactories(s).map((t=>t.name)));for(const t of this._contextsForPath(s))for(const e of i)if(null!==e){const s=this._widgetManager.findWidget(t,e);if(s)return s}}newUntitled(t){return"file"===t.type&&(t.ext=t.ext||".txt"),this.services.contents.newUntitled(t)}open(t,e="default",s,i){return this._createOrOpenDocument("open",t,e,s,i)}openOrReveal(t,e="default",s,i){const n=this.findWidget(t,e);return n?(this._opener.open(n,{type:e,...i}),n):this.open(t,e,s,null!=i?i:{})}overwrite(t,e){const s=`${e}.${m.UUID.uuid4()}`,i=()=>this.rename(s,e);return this.rename(t,s).then((()=>this.deleteFile(e))).then(i,i)}rename(t,e){return this.services.contents.rename(t,e)}_findContext(t,e){const s=this.services.contents.normalize(t);return(0,_.find)(this._contexts,(t=>t.path===s&&t.factoryName===e))}_contextsForPath(t){const e=this.services.contents.normalize(t);return this._contexts.filter((t=>t.path===e))}_createContext(t,e,s){const i=new u.Context({opener:(t,e)=>{this._widgetManager.adoptWidget(i,t),this._opener.open(t,e)},manager:this.services,factory:e,path:t,kernelPreference:s,setBusy:this._setBusy,sessionDialogs:this._dialogs,lastModifiedCheckMargin:this._lastModifiedCheckMargin,translator:this.translator}),n=new f({context:i,isConnectedCallback:this._isConnectedCallback,saveInterval:this.autosaveInterval});return C.saveHandlerProperty.set(i,n),i.ready.then((()=>{this.autosave&&n.start()})),i.disposed.connect(this._onContextDisposed,this),this._contexts.push(i),i}_onContextDisposed(t){_.ArrayExt.removeFirstOf(this._contexts,t)}_widgetFactoryFor(t,e){const{registry:s}=this;if("default"===e){const i=s.defaultWidgetFactory(t);if(!i)return;e=i.name}return s.getWidgetFactory(e)}_createOrOpenDocument(t,e,s="default",i,n){const a=this._widgetFactoryFor(e,s);if(!a)return;const o=a.modelName||"text",r=this.registry.getModelFactory(o);if(!r)return;const l=this.registry.getKernelPreference(e,a.name,i);let h,c=Promise.resolve(void 0);if("open"===t)h=this._findContext(e,r.name)||null,h||(h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!1))));else{if("create"!==t)throw new Error(`Invalid argument 'which': ${t}`);h=this._createContext(e,r,l),c=this._when.then((()=>h.initialize(!0)))}const d=this._widgetManager.createWidget(a,h);return this._opener.open(d,{type:a.name,...n}),c.catch((t=>{console.error(`Failed to initialize the context with '${r.name}' for ${e}`,t),d.close()})),d}_onActivateRequested(t,e){this._activateRequested.emit(e)}_onWidgetStateChanged(t,e){"confirmClosingDocument"===e.name&&this._stateChanged.emit(e)}}!function(t){t.saveHandlerProperty=new p.AttachedProperty({name:"saveHandler",create:()=>{}})}(C||(C={}));var b=s(80890),M=s(70397),S=s(78156),T=s.n(S);function F(t){return T().createElement(b.TextItem,{source:t.name,title:t.fullPath})}class W extends M.VDomRenderer{constructor(t){super(new W.Model(t.docManager)),this.node.title=this.model.path}render(){return T().createElement(F,{fullPath:this.model.path,name:this.model.name})}}function k(t){return T().createElement(b.TextItem,{source:t.fileStatus})}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onTitleChange=t=>{const e=this._getAllState();this._name=t.label,this._triggerChange(e,this._getAllState())},this._onPathChange=(t,e)=>{const s=this._getAllState();this._path=e,this._name=a.PathExt.basename(e),this._triggerChange(s,this._getAllState())},this._path="",this._name="",this._widget=null,this._docManager=t}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(t){const e=this._widget;if(null!==e){const t=this._docManager.contextForWidget(e);t?t.pathChanged.disconnect(this._onPathChange):e.title.changed.disconnect(this._onTitleChange)}const s=this._getAllState();if(this._widget=t,null===this._widget)this._path="",this._name="";else{const t=this._docManager.contextForWidget(this._widget);t?(this._path=t.path,this._name=a.PathExt.basename(t.path),t.pathChanged.connect(this._onPathChange)):(this._path="",this._name=this._widget.title.label,this._widget.title.changed.connect(this._onTitleChange))}this._triggerChange(s,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(t,e){t[0]===e[0]&&t[1]===e[1]||this.stateChanged.emit(void 0)}}t.Model=e}(W||(W={}));class E extends M.VDomRenderer{constructor(t){super(new E.Model(t.docManager));const e=(t.translator||o.nullTranslator).load("jupyterlab");this._statusMap={completed:e.__("Saving completed"),started:e.__("Saving started"),failed:e.__("Saving failed")}}render(){return null===this.model||null===this.model.status?null:T().createElement(k,{fileStatus:this._statusMap[this.model.status]})}}!function(t){class e extends M.VDomModel{constructor(t){super(),this._onStatusChange=(t,e)=>{this._status=e,"completed"===this._status?(setTimeout((()=>{this._status=null,this.stateChanged.emit(void 0)}),2e3),this.stateChanged.emit(void 0)):this.stateChanged.emit(void 0)},this._status=null,this._widget=null,this._status=null,this.widget=null,this._docManager=t}get status(){return this._status}get widget(){return this._widget}set widget(t){var e,s;const i=this._widget;if(null!==i){const t=this._docManager.contextForWidget(i);t?t.saveState.disconnect(this._onStatusChange):(null===(e=this._widget.content)||void 0===e?void 0:e.saveStateChanged)&&this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}if(this._widget=t,null===this._widget)this._status=null;else{const t=this._docManager.contextForWidget(this._widget);t?t.saveState.connect(this._onStatusChange):(null===(s=this._widget.content)||void 0===s?void 0:s.saveStateChanged)&&this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}t.Model=e}(E||(E={}));const A=new m.Token("@jupyterlab/docmanager:IDocumentManager","A service for the manager for all\n documents used by the application. Use this if you want to open and close documents,\n create and delete files, and otherwise interact with the file system."),O=new m.Token("@jupyterlab/docmanager:IDocumentWidgetOpener","A service to open a widget.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4645,6345],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(17260),s=o(57978),a=o(70788),r=o(83195),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4645,6345],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(17260),s=o(57978),a=o(70788),r=o(30679),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5099],{25099:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ce,toggleHeader:()=>oe});var n=a(17260),o=a(98244),s=a(70788),i=a(80864),r=a(97511),l=a(42539),c=a(70397),d=a(20998),u=a(2549),m=a(97934),p=a(69825);const h="help:open",g="https://jupyterlab.readthedocs.io/en/latest/privacy_policies.html";async function b(e,t={}){const a=p.ServerConnection.makeSettings(),n=s.URLExt.join(a.baseUrl,e);let o;try{o=await p.ServerConnection.makeRequest(n,t,a)}catch(e){throw new p.ServerConnection.NetworkError(e)}const i=await o.json();if(!o.ok)throw new p.ServerConnection.ResponseError(o,i.message);return i}const f={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:!0,optional:[i.ISettingRegistry,l.ITranslator],activate:(e,t,a)=>{var n;const s=f.id.replace(/[^\w]/g,"");Promise.all([e.restored,null!==(n=null==t?void 0:t.load("@jupyterlab/apputils-extension:notification"))&&void 0!==n?n:Promise.resolve(null),p.ConfigSection.create({name:s})]).then((async([t,n,s])=>{const i=(null!=a?a:l.nullTranslator).load("jupyterlab");if(o.Notification.manager.changed.connect(((e,t)=>{var a;if("removed"!==t.type)return;const{id:n,tags:o}=null!==(a=t.notification.options.data)&&void 0!==a?a:{};if((null!=o?o:[]).some((e=>["news","update"].includes(e)))&&n){const e={};e[n]={seen:!0,dismissed:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}})),"none"===(null==n?void 0:n.get("fetchNews").composite)){const t=o.Notification.emit(i.__("Would you like to receive official Jupyter news?\nPlease read the privacy policy."),"default",{autoClose:!1,actions:[{label:i.__("Open privacy policy"),caption:g,callback:t=>{t.preventDefault(),e.commands.hasCommand(h)?e.commands.execute(h,{text:i.__("Privacy policies"),url:g}):window.open(g,"_blank","noreferrer")},displayType:"link"},{label:i.__("Yes"),callback:()=>{o.Notification.dismiss(t),s.update({}).then((()=>r())).catch((e=>{console.error(`Failed to get the news:\n${e}`)})),null==n||n.set("fetchNews","true").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}},{label:i.__("No"),callback:()=>{o.Notification.dismiss(t),null==n||n.set("fetchNews","false").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}}]})}else await r();async function r(){var e,t,a,r;if("true"===(null!==(e=null==n?void 0:n.get("fetchNews").composite)&&void 0!==e?e:"false"))try{const e=await b("/lab/api/news");for(const{link:a,message:n,type:r,options:l}of e.news){const e=l.data.id,c=null!==(t=s.data[e])&&void 0!==t?t:{seen:!1,dismissed:!1};if(!c.dismissed){if(l.actions=[{label:i.__("Hide"),caption:i.__("Never show this notification again."),callback:()=>{const t={};t[e]={seen:!0,dismissed:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}],2===(null==a?void 0:a.length)&&l.actions.push({label:a[0],caption:a[1],callback:()=>{window.open(a[1],"_blank","noreferrer")},displayType:"link"}),!c.seen){l.autoClose=5e3;const t={};t[e]={seen:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}o.Notification.emit(n,r,l)}}}catch(e){console.log("Failed to get the announcements.",e)}if(null===(a=null==n?void 0:n.get("checkForUpdates").composite)||void 0===a||a){const e=await b("/lab/api/update");if(e.notification){const{link:t,message:a,type:l,options:c}=e.notification,d=c.data.id,u=null!==(r=s.data[d])&&void 0!==r?r:{seen:!1,dismissed:!1};if(!u.dismissed){let e;if(c.actions=[{label:i.__("Do not check for updates"),caption:i.__("If pressed, you will not be prompted if a new JupyterLab version is found."),callback:()=>{null==n||n.set("checkForUpdates",!1).then((()=>{o.Notification.dismiss(e)})).catch((e=>{console.error("Failed to set the `checkForUpdates` setting.",e)}))}}],2===(null==t?void 0:t.length)&&c.actions.push({label:t[0],caption:t[1],callback:()=>{window.open(t[1],"_blank","noreferrer")},displayType:"link"}),!u.seen){c.autoClose=5e3;const e={};e[d]={seen:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}e=o.Notification.emit(a,l,c)}}}}}))}};var y,v=a(80890),w=a(31516),_=a(78156),k=a(37634);function S(e){const{manager:t,onClose:a,trans:n}=e,[o,s]=_.useState([]),[i,r]=_.useState(null);return _.useEffect((()=>{async function e(){s(await Promise.all(t.notifications.map((async e=>Object.freeze({...e})))))}return o.length!==t.count&&e(),t.changed.connect(e),()=>{t.changed.disconnect(e)}}),[t]),_.useEffect((()=>{E.getIcons().then((e=>{r(e)})).catch((e=>{console.error(`Failed to get react-toastify icons:\n${e}`)}))}),[]),_.createElement(c.UseSignal,{signal:t.changed},(()=>_.createElement(_.Fragment,null,_.createElement("h2",{className:"jp-Notification-Header jp-Toolbar"},_.createElement("span",{className:"jp-Toolbar-item"},t.count>0?n._n("%1 notification","%1 notifications",t.count):n.__("No notifications")),_.createElement("span",{className:"jp-Toolbar-item jp-Toolbar-spacer"}),_.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:()=>{t.dismiss()},icon:c.deleteIcon,tooltip:n.__("Dismiss all notifications"),enabled:t.count>0}),_.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:a,icon:c.closeIcon,tooltip:n.__("Hide notifications")})),_.createElement("ol",{className:"jp-Notification-List"},o.map((e=>{var a;const{id:o,message:s,type:r,options:l}=e,d="in-progress"===r?"default":r,u=()=>{t.dismiss(o)},m="default"===r?null:"in-progress"===r?null!==(a=null==i?void 0:i.spinner)&&void 0!==a?a:null:i&&i[r];return _.createElement("li",{className:"jp-Notification-List-Item",key:e.id,onClick:e=>{e.stopPropagation()}},_.createElement("div",{className:`Toastify__toast Toastify__toast-theme--light Toastify__toast--${d} jp-Notification-Toast-${d}`},_.createElement("div",{className:"Toastify__toast-body"},m&&_.createElement("div",{className:"Toastify__toast-icon"},m({theme:"light",type:d})),_.createElement("div",null,E.createContent(s,u,l.actions))),_.createElement(E.CloseButton,{close:u,closeIcon:c.deleteIcon.react,title:n.__("Dismiss notification"),closeIconMargin:!0})))}))))))}!function(e){e.dismiss="apputils:dismiss-notification",e.display="apputils:display-notifications",e.notify="apputils:notify",e.update="apputils:update-notification"}(y||(y={}));class C extends c.VDomModel{constructor(e){super(),this.manager=e,this._highlight=!1,this._listOpened=!1,this._doNotDisturbMode=!1,this._count=e.count,this.manager.changed.connect(this.onNotificationChanged,this)}get count(){return this._count}get doNotDisturbMode(){return this._doNotDisturbMode}set doNotDisturbMode(e){this._doNotDisturbMode=e}get highlight(){return this._highlight}get listOpened(){return this._listOpened}set listOpened(e){this._listOpened=e,(this._listOpened||this._highlight)&&(this._highlight=!1),this.stateChanged.emit()}onNotificationChanged(e,t){this._count=this.manager.count;const{autoClose:a}=t.notification.options,n=this.doNotDisturbMode||"number"==typeof a&&a<=0;!this._listOpened&&"removed"!==t.type&&n&&(this._highlight=!0),this.stateChanged.emit()}}function T(e){return _.createElement(v.GroupItem,{spacing:4,onClick:()=>{e.onClick()},title:e.count>0?e.trans._n("%1 notification","%1 notifications",e.count):e.trans.__("No notifications")},_.createElement(v.TextItem,{className:"jp-Notification-Status-Text",source:`${e.count}`}),_.createElement(c.bellIcon.react,{top:"2px",stylesheet:"statusBar"}))}const j={id:"@jupyterlab/apputils-extension:notification",description:"Add the notification center and its status indicator.",autoStart:!0,optional:[v.IStatusBar,i.ISettingRegistry,l.ITranslator],activate:(e,t,a,n)=>{E.translator=null!=n?n:l.nullTranslator;const s=E.translator.load("jupyterlab"),i=new C(o.Notification.manager);i.doNotDisturbMode=!1,a&&Promise.all([a.load(j.id),e.restored]).then((([e])=>{const t=()=>{i.doNotDisturbMode=e.get("doNotDisturbMode").composite};t(),e.changed.connect(t)})),e.commands.addCommand(y.notify,{label:s.__("Emit a notification"),caption:s.__("Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{var a;const{message:n,type:s}=t,i=null!==(a=t.options)&&void 0!==a?a:{};return o.Notification.manager.notify(n,null!=s?s:"default",{...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.update,{label:s.__("Update a notification"),caption:s.__("Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{const{id:a,message:n,type:s,...i}=t;return o.Notification.manager.update({id:a,message:n,type:null!=s?s:"default",...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.dismiss,{label:s.__("Dismiss a notification"),execute:e=>{const{id:t}=e;o.Notification.manager.dismiss(t)}});let r=null;i.listOpened=!1;const d=o.ReactWidget.create(_.createElement(S,{manager:o.Notification.manager,onClose:()=>{null==r||r.dispose()},trans:s}));d.addClass("jp-Notification-Center"),o.Notification.manager.changed.connect((async function(e,t){var a;if(i.doNotDisturbMode||null!==r&&!r.isDisposed)return;const{message:n,type:o,options:s,id:l}=t.notification;if(!("number"==typeof s.autoClose&&s.autoClose<=0))switch(t.type){case"added":await E.createToast(l,n,o,s);break;case"updated":{const t=await E.toast(),i=s.actions,r=null!==(a=s.autoClose)&&void 0!==a?a:!(i&&i.length>0)&&null;if(t.isActive(l)){const a=()=>{t.dismiss(l),e.dismiss(l)};t.update(l,{type:"in-progress"===o?null:o,isLoading:"in-progress"===o,autoClose:r,render:E.createContent(n,a,s.actions)})}else await E.createToast(l,n,o,s)}break;case"removed":await E.toast().then((e=>{e.dismiss(l)}))}}));const u=()=>{r?(r.dispose(),r=null):(r=(0,v.showPopup)({body:d,anchor:m,align:"right",hasDynamicSize:!0,startHidden:!0}),E.toast().then((e=>{e.dismiss()})).catch((e=>{console.error(`Failed to dismiss all toasts:\n${e}`)})).finally((()=>{null==r||r.launch(),d.node.focus(),null==r||r.disposed.connect((()=>{i.listOpened=!1,r=null}))}))),i.listOpened=null!==r};e.commands.addCommand(y.display,{label:s.__("Show Notifications"),execute:u});const m=o.ReactWidget.create(_.createElement(c.UseSignal,{signal:i.stateChanged},(()=>(i.highlight||r&&!r.isDisposed?m.addClass("jp-mod-selected"):m.removeClass("jp-mod-selected"),_.createElement(T,{count:i.count,highlight:i.highlight,trans:s,onClick:u})))));m.addClass("jp-Notification-Status"),t?t.registerStatusItem(j.id,{item:m,align:"right",rank:-1}):(m.node.style.position="fixed",m.node.style.bottom="0",m.node.style.right="10px",w.Widget.attach(m,document.body),m.show())}};var E;!function(e){e.translator=l.nullTranslator;let t=null;function n(e){var t;return _.createElement("button",{className:"jp-Button jp-mod-minimal jp-Notification-Toast-Close"+(e.closeIconMargin?" jp-Notification-Toast-Close-Margin":""),title:null!==(t=e.title)&&void 0!==t?t:"",onClick:e.close},_.createElement(e.closeIcon,{className:"jp-icon-hover",tag:"span"}))}function s(t){const a=e.translator.load("jupyterlab");return _.createElement(n,{close:t.closeToast,closeIcon:c.closeIcon.react,title:a.__("Hide notification")})}e.CloseButton=n;let i=null;async function r(){if(null===i?i=new d.PromiseDelegate:await i.promise,null===t){t=await a.e(53).then(a.t.bind(a,60053,23));const e=document.body.appendChild(document.createElement("div"));e.id="react-toastify-container",(0,k.s)(e).render(_.createElement(t.ToastContainer,{draggable:!1,closeOnClick:!1,hideProgressBar:!0,newestOnTop:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,position:"bottom-right",className:"jp-toastContainer",transition:t.Slide,closeButton:s})),i.resolve()}return t.toast}e.toast=r,e.getIcons=async function(){return null===t&&await r(),t.Icons};const u={accent:"jp-mod-accept",link:"jp-mod-link",warn:"jp-mod-warn",default:""};function m({action:e,closeToast:t}){var a,n;const o=["jp-toast-button",u[null!==(a=e.displayType)&&void 0!==a?a:"default"]].join(" ");return _.createElement(c.Button,{title:null!==(n=e.caption)&&void 0!==n?n:e.label,className:o,onClick:a=>{e.callback(a),a.defaultPrevented||t()},small:!0},e.label)}function p(e,t,a){var n;const o=e.length>140?e.slice(0,140)+"…":e;return _.createElement(_.Fragment,null,_.createElement("div",{className:"jp-toast-message"},o.split("\n").map(((e,t)=>_.createElement(_.Fragment,{key:`part-${t}`},t>0?_.createElement("br",null):null,e)))),(null!==(n=null==a?void 0:a.length)&&void 0!==n?n:0)>0&&_.createElement("div",{className:"jp-toast-buttonBar"},_.createElement("div",{className:"jp-toast-spacer"}),a.map(((e,a)=>_.createElement(m,{key:"button-"+a,action:e,closeToast:t})))))}e.createContent=p,e.createToast=async function(e,t,a,n={}){const{actions:s,autoClose:i,data:l}=n;return(await r())((({closeToast:a})=>p(t,(()=>{a&&a(),o.Notification.manager.dismiss(e)}),s)),{autoClose:null!=i?i:!(s&&s.length>0)&&void 0,data:l,className:`jp-Notification-Toast-${a}`,toastId:e,type:"in-progress"===a?null:a,isLoading:"in-progress"===a})}}(E||(E={}));var I,x,N=a(33625),P=a(32895);!function(e){e.activate="apputils:activate-command-palette"}(I||(I={}));class D{constructor(e,t){this.translator=t||l.nullTranslator;const a=this.translator.load("jupyterlab");this._palette=e,this._palette.title.label="",this._palette.title.caption=a.__("Command Palette")}set placeholder(e){this._palette.inputNode.placeholder=e}get placeholder(){return this._palette.inputNode.placeholder}activate(){this._palette.activate()}addItem(e){const t=this._palette.addItem(e);return new u.DisposableDelegate((()=>{this._palette.removeItem(t)}))}}!function(e){e.activate=function(t,a,n){const{commands:s,shell:i}=t,r=a.load("jupyterlab"),l=x.createPalette(t,a),c=new o.ModalCommandPalette({commandPalette:l});let d=!1;if(l.node.setAttribute("role","region"),l.node.setAttribute("aria-label",r.__("Command Palette Section")),i.add(l,"left",{rank:300,type:"Command Palette"}),n){const e=n.load("@jupyterlab/apputils-extension:palette"),a=e=>{const t=e.get("modal").composite;d&&!t?(l.parent=null,c.detach(),i.add(l,"left",{rank:300,type:"Command Palette"})):!d&&t&&(l.parent=null,c.palette=l,l.show(),c.attach()),d=t};Promise.all([e,t.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}const u=()=>{const e=(0,N.find)(t.commands.keyBindings,(e=>e.command===I.activate));if(e){const t=e.keys.map(P.CommandRegistry.formatKeystroke).join(", ");l.title.caption=r.__("Commands (%1)",t)}else l.title.caption=r.__("Commands")};return u(),t.commands.keyBindingChanged.connect((()=>{u()})),s.addCommand(I.activate,{execute:()=>{d?c.activate():i.activateById(l.id)},label:r.__("Activate Command Palette")}),l.inputNode.placeholder=r.__("SEARCH"),new e(l,a)},e.restore=function(e,t,a){const n=x.createPalette(e,a);t.add(n,"command-palette")}}(D||(D={})),function(e){let t;e.createPalette=function(e,a){if(!t){t=new w.CommandPalette({commands:e.commands,renderer:c.CommandPaletteSvg.defaultRenderer}),t.id="command-palette",t.title.icon=c.paletteIcon;const n=a.load("jupyterlab");t.title.label=n.__("Commands")}return t}}(x||(x={}));class F extends r.DataConnector{constructor(e){super(),this._throttlers=Object.create(null),this._connector=e}fetch(e){const t=this._throttlers;return e in t||(t[e]=new m.Throttler((()=>this._connector.fetch(e)),100)),t[e].invoke()}async list(e="all"){const{isDisabled:t}=s.PageConfig.Extension,{ids:a,values:n}=await this._connector.list("ids"===e?"ids":void 0);return"all"===e?{ids:a,values:n}:"ids"===e?{ids:a}:{ids:a.filter((e=>!t(e))),values:n.filter((({id:e})=>!t(e)))}}async save(e,t){await this._connector.save(e,t)}}const R={id:"@jupyterlab/apputils-extension:settings",description:"Provides the setting registry.",activate:async e=>{const{isDisabled:t}=s.PageConfig.Extension,a=new F(e.serviceManager.settings),n=new i.SettingRegistry({connector:a,plugins:(await a.list("active")).values.filter((t=>e.hasPlugin(t.id)))});return e.restored.then((async()=>{(await a.list("ids")).ids.forEach((async a=>{if(e.hasPlugin(a)&&!t(a)&&!(a in n.plugins))try{await n.load(a)}catch(t){console.warn(`Settings failed to load for (${a})`,t),e.isPluginActivated(a)||console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this may happen if {autoStart: false} in (${a}) or if it is one of the deferredExtensions in page config.`)}}))})),n},autoStart:!0,provides:i.ISettingRegistry},A={id:"@jupyterlab/apputils-extension:kernel-status",description:"Provides the kernel status indicator model.",autoStart:!0,requires:[v.IStatusBar],provides:o.IKernelStatusModel,optional:[o.ISessionContextDialogs,l.ITranslator,n.ILabShell],activate:(e,t,a,n,s)=>{const i=null!=n?n:l.nullTranslator,r=null!=a?a:new o.SessionContextDialogs({translator:i}),c=async()=>{d.model.sessionContext&&await r.selectKernel(d.model.sessionContext)},d=new o.KernelStatus({onClick:c,onKeyDown:async e=>{if("Enter"===e.key||"Spacebar"===e.key||" "===e.key)return e.preventDefault(),e.stopPropagation(),c()}},i),u=new Set;function m(e,t){var a;const{oldValue:n,newValue:o}=t;n&&n.title.changed.disconnect(p),d.model.sessionContext=null!==(a=[...u].map((e=>e(t.newValue))).filter((e=>null!==e))[0])&&void 0!==a?a:null,o&&d.model.sessionContext&&(p(o.title),o.title.changed.connect(p))}const p=e=>{d.model.activityName=e.label};return s&&s.currentChanged.connect(m),t.registerStatusItem(A.id,{priority:1,item:d,align:"left",rank:1,isActive:()=>null!==d.model.sessionContext}),{addSessionProvider:t=>{u.add(t),e.shell.currentWidget&&m(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}}}},M={id:"@jupyterlab/apputils-extension:running-sessions-status",description:"Add the running sessions and terminals status bar item.",autoStart:!0,requires:[v.IStatusBar,l.ITranslator],activate:(e,t,a)=>{const n=new o.RunningSessions({onClick:()=>e.shell.activateById("jp-running-sessions"),onKeyDown:t=>{"Enter"!==t.key&&"Spacebar"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),e.shell.activateById("jp-running-sessions"))},serviceManager:e.serviceManager,translator:a});n.model.sessions=Array.from(e.serviceManager.sessions.running()).length,n.model.terminals=Array.from(e.serviceManager.terminals.running()).length,t.registerStatusItem(M.id,{item:n,align:"left",rank:0})}};var W,O=a(59012);!function(e){e.changeTheme="apputils:change-theme",e.changePreferredLightTheme="apputils:change-light-theme",e.changePreferredDarkTheme="apputils:change-dark-theme",e.toggleAdaptiveTheme="apputils:adaptive-theme",e.themeScrollbars="apputils:theme-scrollbars",e.changeFont="apputils:change-font",e.incrFontSize="apputils:incr-font-size",e.decrFontSize="apputils:decr-font-size"}(W||(W={}));const L={id:"@jupyterlab/apputils-extension:themes",description:"Provides the theme manager.",requires:[i.ISettingRegistry,n.JupyterFrontEnd.IPaths,l.ITranslator],optional:[o.ISplashScreen],activate:(e,t,a,n,i)=>{const r=n.load("jupyterlab"),l=e.shell,c=e.commands,d=s.URLExt.join(s.PageConfig.getBaseUrl(),a.urls.themes),u=L.id,m=new o.ThemeManager({key:u,host:l,settings:t,splash:null!=i?i:void 0,url:d});let p,h=null;return m.themeChanged.connect(((e,t)=>{p=t.newValue,document.body.dataset.jpThemeLight=String(m.isLight(p)),document.body.dataset.jpThemeName=p,document.body.dataset.jpThemeScrollbars!==String(m.themeScrollbars(p))&&(document.body.dataset.jpThemeScrollbars=String(m.themeScrollbars(p)),m.themeScrollbars(p)?(h||(h=function(e){const t=document.createElement("style");return t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n background: rgb(var(--jp-scrollbar-thumb-color));\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-right: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-bottom: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid transparent;\n border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid transparent;\n border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n")),t}()),h.parentElement||document.body.appendChild(h)):h&&h.parentElement&&h.parentElement.removeChild(h)),c.notifyCommandChanged(W.changeTheme)})),c.addCommand(W.changeTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Use Theme: %1",a):a},isToggled:e=>e.theme===p,execute:e=>{const t=e.theme;if(t!==m.theme)return m.isToggledAdaptiveTheme()?m.toggleAdaptiveTheme():m.setTheme(t)}}),c.addCommand(W.changePreferredLightTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided light `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Light Theme: %1",a):a},isToggled:e=>e.theme===m.preferredLightTheme,execute:e=>{const t=e.theme;if(t!==m.preferredLightTheme)return m.setPreferredLightTheme(t)}}),c.addCommand(W.changePreferredDarkTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided dark `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Dark Theme: %1",a):a},isToggled:e=>e.theme===m.preferredDarkTheme,execute:e=>{const t=e.theme;if(t!==m.preferredDarkTheme)return m.setPreferredDarkTheme(t)}}),c.addCommand(W.toggleAdaptiveTheme,{label:e=>e.isPalette?r.__("Synchronize Styling Theme with System Settings"):r.__("Synchronize with System Settings"),isToggled:()=>m.isToggledAdaptiveTheme(),execute:()=>{m.toggleAdaptiveTheme().catch(console.warn)}}),c.addCommand(W.themeScrollbars,{label:r.__("Theme Scrollbars"),isToggled:()=>m.isToggledThemeScrollbars(),execute:()=>m.toggleThemeScrollbars()}),c.addCommand(W.changeFont,{label:e=>e.enabled?`${e.font}`:r.__("waiting for fonts"),isEnabled:e=>e.enabled,isToggled:e=>m.getCSS(e.key)===e.font,execute:e=>m.setCSSOverride(e.key,e.font)}),c.addCommand(W.incrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Increase Code Font Size");case"content-font-size1":return r.__("Increase Content Font Size");case"ui-font-size1":return r.__("Increase UI Font Size");default:return r.__("Increase Font Size")}},execute:e=>m.incrFontSize(e.key)}),c.addCommand(W.decrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Decrease Code Font Size");case"content-font-size1":return r.__("Decrease Content Font Size");case"ui-font-size1":return r.__("Decrease UI Font Size");default:return r.__("Decrease Font Size")}},execute:e=>m.decrFontSize(e.key)}),m},autoStart:!0,provides:o.IThemeManager},$={id:"@jupyterlab/apputils-extension:themes-palette-menu",description:"Adds theme commands to the menu and the command palette.",requires:[o.IThemeManager,l.ITranslator],optional:[o.ICommandPalette,O.IMainMenu],activate:(e,t,a,n,o)=>{const s=a.load("jupyterlab");o&&e.restored.then((()=>{var e;const a=null===(e=o.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-apputilstheme"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===e?void 0:e.submenu;a&&t.themes.forEach(((e,t)=>{a.insertItem(t,{command:W.changeTheme,args:{isPalette:!1,theme:e}})}))})),n&&e.restored.then((()=>{const e=s.__("Theme"),a=W.changeTheme,o=!0;t.themes.forEach((t=>{n.addItem({command:a,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:W.changePreferredLightTheme,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:W.changePreferredDarkTheme,args:{isPalette:o,theme:t},category:e})})),n.addItem({command:W.toggleAdaptiveTheme,args:{isPalette:o},category:e}),n.addItem({command:W.themeScrollbars,category:e}),n.addItem({command:W.incrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:W.incrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:W.incrFontSize,args:{key:"ui-font-size1"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"ui-font-size1"},category:e})}))},autoStart:!0},z={id:"@jupyterlab/apputils-extension:toolbar-registry",description:"Provides toolbar items registry.",autoStart:!0,provides:o.IToolbarWidgetRegistry,activate:e=>new o.ToolbarWidgetRegistry({defaultFactory:(0,o.createDefaultFactory)(e.commands)})};var B,U=a(19928),H=a(96795);!function(e){e.saveWorkspace="workspace-ui:save",e.saveWorkspaceAs="workspace-ui:save-as"}(B||(B={}));const q="jupyterlab-workspace",J="."+q,K="workspace-ui:lastSave",V={id:"@jupyterlab/apputils-extension:workspaces",description:"Add workspace file type and commands.",autoStart:!0,requires:[H.IDefaultFileBrowser,o.IWindowResolver,r.IStateDB,l.ITranslator,n.JupyterFrontEnd.IPaths],optional:[n.IRouter],activate:(e,t,a,n,o,s,i)=>{const r=new Q.WorkspaceFactory({workspaces:e.serviceManager.workspaces,router:i,state:n,translator:o,paths:s}),l=o.load("jupyterlab");e.docRegistry.addFileType({name:q,contentType:"file",fileFormat:"text",displayName:l.__("JupyterLab workspace File"),extensions:[J],mimeTypes:["text/json"],iconClass:"jp-JupyterIcon"}),e.docRegistry.addWidgetFactory(r),e.commands.addCommand(B.saveWorkspaceAs,{label:l.__("Save Current Workspace As…"),execute:async()=>{const s=e.serviceManager.workspaces.fetch(a.name);await Q.saveAs(t,e.serviceManager.contents,s,n,o)}}),e.commands.addCommand(B.saveWorkspace,{label:l.__("Save Current Workspace"),execute:async()=>{const{contents:s}=e.serviceManager,i=e.serviceManager.workspaces.fetch(a.name),r=await n.fetch(K);void 0===r?await Q.saveAs(t,s,i,n,o):await Q.save(r,s,i,n)}})}};var Q;!function(e){async function t(e,t,a,n){let o=e.split("/").pop();void 0!==o&&o.includes(".")?o=o.split(".")[0]:e+=J,await n.save(K,e);const s=await a;s.metadata.id=`${o}`,await t.save(e,{type:"file",format:"text",content:JSON.stringify(s)})}e.save=t,e.saveAs=async function(e,a,s,i,r){var c;r=r||l.nullTranslator;const d=await i.fetch(K);let u;u=void 0===d?"new-workspace":null===(c=d.split("/").pop())||void 0===c?void 0:c.split(".")[0];const m=e.model.path+"/"+u+J,p=await async function(e,t){const a=(t=t||l.nullTranslator).load("jupyterlab"),s=o.Dialog.okButton({label:a.__("Save"),ariaLabel:a.__("Save Current Workspace")}),i=await(0,o.showDialog)({title:a.__("Save Current Workspace As…"),body:new n(e),buttons:[o.Dialog.cancelButton(),s]});return i.button.label===a.__("Save")?i.value:null}(m,r);p&&await t(p,a,s,i)};class a extends U.ABCWidgetFactory{constructor(e){super({name:"Workspace loader",label:(e.translator||l.nullTranslator).load("jupyterlab").__("Workspace loader"),fileTypes:[q],defaultFor:[q],readOnly:!0}),this._application=e.paths.urls.app,this._router=e.router,this._state=e.state,this._workspaces=e.workspaces}createNewWidget(e){return e.ready.then((async()=>{const t=e.model.toJSON(),a=e.path,n=t.metadata.id;await this._workspaces.save(n,t),await this._state.save(K,a);const o=s.URLExt.join(this._application,"workspaces"),i=s.URLExt.join(o,n);if(!o.startsWith(i))throw new Error("Can only be used for workspaces");this._router?this._router.navigate(i,{hard:!0}):document.location.href=i})),function(e){const t=new U.DocumentWidget({content:new w.Widget,context:e});return t.content.dispose(),t}(e)}}e.WorkspaceFactory=a;class n extends w.Widget{constructor(e){super({node:i(e)})}getValue(){return this.node.value}}function i(e){const t=document.createElement("input");return t.value=e,t}}(Q||(Q={}));var Y=a(18395);const G="jp-ContextualShortcut-TableItem";var X;!function(e){e.loadState="apputils:load-statedb",e.print="apputils:print",e.reset="apputils:reset",e.resetOnLoad="apputils:reset-on-load",e.runFirstEnabled="apputils:run-first-enabled",e.runAllEnabled="apputils:run-all-enabled",e.toggleHeader="apputils:toggle-header",e.displayShortcuts="apputils:display-shortcuts"}(X||(X={}));const Z={id:"@jupyterlab/apputils-extension:palette",description:"Provides the command palette.",autoStart:!0,requires:[l.ITranslator],provides:o.ICommandPalette,optional:[i.ISettingRegistry],activate:(e,t,a)=>D.activate(e,t,a)},ee={id:"@jupyterlab/apputils-extension:palette-restorer",description:"Restores the command palette.",autoStart:!0,requires:[n.ILayoutRestorer,l.ITranslator],activate:(e,t,a)=>{D.restore(e,t,a)}},te={id:"@jupyterlab/apputils-extension:resolver",description:"Provides the window name resolver.",autoStart:!0,provides:o.IWindowResolver,requires:[n.JupyterFrontEnd.IPaths,n.IRouter],activate:async(e,t,a)=>{const{hash:n,search:i}=a.current,r=s.URLExt.queryStringToObject(i||""),l=new o.WindowResolver,c=s.PageConfig.getOption("workspace"),d=s.PageConfig.getOption("treePath"),u="multiple-document"===s.PageConfig.getOption("mode")?"lab":"doc",m=c||s.PageConfig.defaultWorkspace,p=d?s.URLExt.join("tree",d):"";try{return await l.resolve(m),l}catch(e){return new Promise((()=>{const{base:e}=t.urls,o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())];let i=s.URLExt.join(e,u,"workspaces",`auto-${o}`);i=p?s.URLExt.join(i,s.URLExt.encodeParts(p)):i,r.reset="";const l=i+s.URLExt.objectToQueryString(r)+(n||"");a.navigate(l,{hard:!0})}))}}},ae={id:"@jupyterlab/apputils-extension:splash",description:"Provides the splash screen.",autoStart:!0,requires:[l.ITranslator],provides:o.ISplashScreen,activate:(e,t)=>{const a=t.load("jupyterlab"),{commands:n,restored:s}=e,i=document.createElement("div"),r=document.createElement("div"),l=document.createElement("div");let d;i.id="jupyterlab-splash",r.id="galaxy",l.id="main-logo",c.jupyterFaviconIcon.element({container:l,stylesheet:"splash"}),r.appendChild(l),["1","2","3"].forEach((e=>{const t=document.createElement("div"),a=document.createElement("div");t.id=`moon${e}`,t.className="moon orbit",a.id=`planet${e}`,a.className="planet",t.appendChild(a),r.appendChild(t)})),i.appendChild(r);const p=new m.Throttler((async()=>{if(!d){d=new o.Dialog({title:a.__("Loading…"),body:a.__("The loading screen is taking a long time.\nWould you like to clear the workspace or keep waiting?"),buttons:[o.Dialog.cancelButton({label:a.__("Keep Waiting")}),o.Dialog.warnButton({label:a.__("Clear Workspace")})]});try{const e=await d.launch();if(d.dispose(),d=null,e.button.accept&&n.hasCommand(X.reset))return n.execute(X.reset);requestAnimationFrame((()=>{p.invoke().catch((e=>{}))}))}catch(e){}}}),{limit:12e3,edge:"trailing"});let h=0;return{show:(e=!0)=>(i.classList.remove("splash-fade"),i.classList.toggle("light",e),i.classList.toggle("dark",!e),h++,document.body.appendChild(i),p.invoke().catch((e=>{})),new u.DisposableDelegate((async()=>{await s,0==--h&&(p.stop(),d&&(d.dispose(),d=null),i.classList.add("splash-fade"),window.setTimeout((()=>{document.body.removeChild(i)}),200))})))}}},ne={id:"@jupyterlab/apputils-extension:print",description:"Add the print capability",autoStart:!0,requires:[l.ITranslator],activate:(e,t)=>{const a=t.load("jupyterlab");e.commands.addCommand(X.print,{label:a.__("Print…"),isEnabled:()=>{const t=e.shell.currentWidget;return null!==o.Printing.getPrintFunction(t)},execute:async()=>{const t=e.shell.currentWidget,a=o.Printing.getPrintFunction(t);a&&await a()}})}},oe={id:"@jupyterlab/apputils-extension:toggle-header",description:"Adds a command to display the main area widget content header.",autoStart:!0,requires:[l.ITranslator],optional:[o.ICommandPalette],activate:(e,t,a)=>{const n=t.load("jupyterlab"),s=n.__("Main Area");e.commands.addCommand(X.toggleHeader,{label:n.__("Show Header Above Content"),isEnabled:()=>e.shell.currentWidget instanceof o.MainAreaWidget&&!e.shell.currentWidget.contentHeader.isDisposed&&e.shell.currentWidget.contentHeader.widgets.length>0,isToggled:()=>{const t=e.shell.currentWidget;return t instanceof o.MainAreaWidget&&!t.contentHeader.isHidden},execute:async()=>{const t=e.shell.currentWidget;t instanceof o.MainAreaWidget&&t.contentHeader.setHidden(!t.contentHeader.isHidden)}}),a&&a.addItem({command:X.toggleHeader,category:s})}},se={id:"@jupyterlab/apputils-extension:state",description:"Provides the application state. It is stored per workspaces.",autoStart:!0,provides:r.IStateDB,requires:[n.JupyterFrontEnd.IPaths,n.IRouter,l.ITranslator],optional:[o.IWindowResolver],activate:(e,t,a,n,o)=>{const i=n.load("jupyterlab");if(null===o)return new r.StateDB;let l=!1;const{commands:c,name:u,serviceManager:p}=e,{workspaces:h}=p,g=o.name,b=new d.PromiseDelegate,f=new r.StateDB({transform:b.promise}),y=new m.Debouncer((async()=>{const e=g,t={id:e},a=await f.toJSON();await h.save(e,{data:a,metadata:t})}));return f.changed.connect((()=>{y.invoke()}),f),f.changed.connect((()=>async function(e,t,a){var n,o;const i=await t.toJSON();if(void 0===(null===(o=null===(n=i["layout-restorer:data"])||void 0===n?void 0:n.main)||void 0===o?void 0:o.current))document.title=`${s.PageConfig.getOption("appName")||"JupyterLab"}${e.startsWith("auto-")?` (${e})`:""}`;else{let t=s.PathExt.basename(decodeURIComponent(window.location.href));t=t.length>15?t.slice(0,12).concat("…"):t;const n=Object.keys(i).filter((e=>e.startsWith("notebook")||e.startsWith("editor"))).length;e.startsWith("auto-")?document.title=`${t} (${e}${n>1?` : ${n}`:""}) - ${a}`:document.title=`${t}${n>1?` (${n})`:""} - ${a}`}}(g,f,u))),c.addCommand(X.loadState,{label:i.__("Load state for the current workspace."),execute:async e=>{if(l)return;const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="string"==typeof i.clone?""===i.clone?s.PageConfig.defaultWorkspace:i.clone:null,c=r||g||null;if(null!==c){try{const e=await h.fetch(c);l||(l=!0,b.resolve({type:"overwrite",contents:e.data}))}catch({message:e}){console.warn(`Fetching workspace "${g}" failed.`,e),l||(l=!0,b.resolve({type:"cancel",contents:null}))}if(c===r){delete i.clone;const e=n+s.URLExt.objectToQueryString(i)+t,o=y.invoke().then((()=>a.stop));return o.then((()=>{a.navigate(e)})),o}await y.invoke()}else console.error(`${X.loadState} cannot load null workspace.`)}}),c.addCommand(X.reset,{label:i.__("Reset Application State"),execute:async({reload:e})=>{await f.clear(),await y.invoke(),e&&a.reload()}}),c.addCommand(X.resetOnLoad,{label:i.__("Reset state when loading for the workspace."),execute:e=>{const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="clone"in i;if(!("reset"in i))return;if(l)return a.reload();l=!0,b.resolve({type:"clear",contents:null}),delete i.reset;const c=n+s.URLExt.objectToQueryString(i)+t,d=f.clear().then((()=>y.invoke()));return r?d.then((()=>{a.navigate(c,{hard:!0})})):d.then((()=>{a.navigate(c)})),d}}),a.register({command:X.loadState,pattern:/.?/,rank:30}),a.register({command:X.resetOnLoad,pattern:/(\?reset|\&reset)($|&)/,rank:20}),f}},ie={id:"@jupyterlab/apputils-extension:sessionDialogs",description:"Provides the session context dialogs.",provides:o.ISessionContextDialogs,optional:[l.ITranslator],autoStart:!0,activate:async(e,t)=>new o.SessionContextDialogs({translator:null!=t?t:l.nullTranslator})},re={id:"@jupyterlab/apputils-extension:utilityCommands",description:"Adds meta commands to run set of other commands.",requires:[l.ITranslator],optional:[o.ICommandPalette],autoStart:!0,activate:(e,t,a)=>{const n=t.load("jupyterlab"),{commands:s}=e;if(s.addCommand(X.runFirstEnabled,{label:n.__("Run First Enabled Command"),execute:t=>{const a=t.commands,n=t.args,o=Array.isArray(t);for(let t=0;t<a.length;t++){const s=a[t],i=o?n[t]:n;if(e.commands.isEnabled(s,i))return e.commands.execute(s,i)}}}),s.addCommand(X.runAllEnabled,{label:n.__("Run All Enabled Commands Passed as Args"),execute:async t=>{var a,n;const o=null!==(a=t.commands)&&void 0!==a?a:[],s=t.args,i=Array.isArray(t),r=null!==(n=t.errorIfNotEnabled)&&void 0!==n&&n;for(let t=0;t<o.length;t++){const a=o[t],n=i?s[t]:s;e.commands.isEnabled(a,n)?await e.commands.execute(a,n):r&&console.error(`${a} is not enabled.`)}},isEnabled:t=>{var a;const n=null!==(a=t.commands)&&void 0!==a?a:[],o=t.args,s=Array.isArray(t);return n.some(((t,a)=>e.commands.isEnabled(t,s?o[a]:o)))}}),s.addCommand(X.displayShortcuts,{label:n.__("Show Keyboard Shortcuts"),caption:n.__("Show relevant keyboard shortcuts for the current active widget"),execute:t=>{var a;const i=e.shell.currentWidget;if(!(null==i?void 0:i.node.contains(document.activeElement))&&i instanceof o.MainAreaWidget){const e=null!==(a=i.content.node)&&void 0!==a?a:null==i?void 0:i.node;null==e||e.focus()}return function(e){const{commands:t,trans:a,activeElement:n}=e,s=null!=n?n:document.activeElement;function i(e){const t=[];return e.forEach(((e,a)=>{const n=[];e.split(" ").forEach(((e,t)=>{n.push(_.createElement("span",{className:"jp-ContextualShortcut-Key",key:`ch-${t}`},_.createElement("kbd",null,e)),_.createElement(_.Fragment,{key:`fragment-${t}`}," + "))})),t.push(_.createElement("span",{key:`key-${a}`},n.slice(0,-1)),_.createElement(_.Fragment,{key:`fragment-${a}`}," + "))})),_.createElement("span",null,t.slice(0,-1))}function r(e){const a=t.label(e.command),n=e.command.split(":")[1].split("-");let o="";for(let e=0;e<n.length;e++)o=o+" "+((s=n[e]).charAt(0).toUpperCase()+s.slice(1));var s;return a.length>0?a:o}function l(e,t){let a=t;for(let t=0;null!==a&&a!==a.parentElement;a=a.parentElement,++t){if(a.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(a.matches(e))return t}return-1}const c=new Map;for(let e=0;e<t.keyBindings.length;e++){const a=t.keyBindings[e];let n=l(a.selector,s);if(n<0)continue;let o=P.CommandRegistry.formatKeystroke(a.keys);if(c.has(o)){let e=c.get(o);if(e[0]<n||e[0]===n&&Y.Selector.calculateSpecificity(e[1].selector)>Y.Selector.calculateSpecificity(a.selector))continue}c.set(o,[n,a])}let d=-1;const u=new Map;for(let[e,t]of c.values())d=Math.max(e,d),u.has(e)||u.set(e,[]),u.get(e).push(t);const m=[];for(let e=0;e<=d;e++)u.has(e)&&(m.push(u.get(e).map((e=>_.createElement("tr",{className:"jp-ContextualShortcut-TableRow",key:`${e.command}-${e.keys.join("-").replace(" ","_")}`},_.createElement("td",{className:G},r(e)),_.createElement("td",{className:G},i([...e.keys])))))),m.push(_.createElement("tr",{className:"jp-ContextualShortcut-TableLastRow",key:`group-${e}-last`})));const p=_.createElement("table",null,_.createElement("tbody",null,m));return(0,o.showDialog)({title:a.__("Keyboard Shortcuts"),body:p,buttons:[o.Dialog.cancelButton({label:a.__("Close")})]})}({commands:s,trans:n})}}),a){const e=n.__("Help");a.addItem({command:X.displayShortcuts,category:e})}}},le={id:"@jupyterlab/apputils-extension:sanitizer",description:"Provides the HTML sanitizer.",autoStart:!0,provides:o.ISanitizer,requires:[i.ISettingRegistry],activate:(e,t)=>{const a=new o.Sanitizer,n=e=>{const t=e.get("allowedSchemes").composite,n=e.get("autolink").composite;t&&a.setAllowedSchemes(t),a.setAutolink(n)};return t.load("@jupyterlab/apputils-extension:sanitizer").then((e=>{n(e),e.changed.connect(n)})).catch((e=>{console.error("Failed to load sanitizer settings:",e)})),a}},ce=[f,A,j,Z,ee,ne,te,M,le,R,se,ae,ie,L,$,oe,z,re,V]},37634:(e,t,a)=>{var n=a(38005);t.s=n.createRoot,n.hydrateRoot}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5099],{25099:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ce,toggleHeader:()=>oe});var n=a(17260),o=a(98244),s=a(70788),i=a(80864),r=a(97511),l=a(42539),c=a(70397),d=a(20998),u=a(2549),m=a(97934),p=a(69825);const h="help:open",g="https://jupyterlab.readthedocs.io/en/latest/privacy_policies.html";async function b(e,t={}){const a=p.ServerConnection.makeSettings(),n=s.URLExt.join(a.baseUrl,e);let o;try{o=await p.ServerConnection.makeRequest(n,t,a)}catch(e){throw new p.ServerConnection.NetworkError(e)}const i=await o.json();if(!o.ok)throw new p.ServerConnection.ResponseError(o,i.message);return i}const f={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:!0,optional:[i.ISettingRegistry,l.ITranslator],activate:(e,t,a)=>{var n;const s=f.id.replace(/[^\w]/g,"");Promise.all([e.restored,null!==(n=null==t?void 0:t.load("@jupyterlab/apputils-extension:notification"))&&void 0!==n?n:Promise.resolve(null),p.ConfigSection.create({name:s})]).then((async([t,n,s])=>{const i=(null!=a?a:l.nullTranslator).load("jupyterlab");if(o.Notification.manager.changed.connect(((e,t)=>{var a;if("removed"!==t.type)return;const{id:n,tags:o}=null!==(a=t.notification.options.data)&&void 0!==a?a:{};if((null!=o?o:[]).some((e=>["news","update"].includes(e)))&&n){const e={};e[n]={seen:!0,dismissed:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}})),"none"===(null==n?void 0:n.get("fetchNews").composite)){const t=o.Notification.emit(i.__("Would you like to receive official Jupyter news?\nPlease read the privacy policy."),"default",{autoClose:!1,actions:[{label:i.__("Open privacy policy"),caption:g,callback:t=>{t.preventDefault(),e.commands.hasCommand(h)?e.commands.execute(h,{text:i.__("Privacy policies"),url:g}):window.open(g,"_blank","noreferrer")},displayType:"link"},{label:i.__("Yes"),callback:()=>{o.Notification.dismiss(t),s.update({}).then((()=>r())).catch((e=>{console.error(`Failed to get the news:\n${e}`)})),null==n||n.set("fetchNews","true").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}},{label:i.__("No"),callback:()=>{o.Notification.dismiss(t),null==n||n.set("fetchNews","false").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}}]})}else await r();async function r(){var e,t,a,r;if("true"===(null!==(e=null==n?void 0:n.get("fetchNews").composite)&&void 0!==e?e:"false"))try{const e=await b("/lab/api/news");for(const{link:a,message:n,type:r,options:l}of e.news){const e=l.data.id,c=null!==(t=s.data[e])&&void 0!==t?t:{seen:!1,dismissed:!1};if(!c.dismissed){if(l.actions=[{label:i.__("Hide"),caption:i.__("Never show this notification again."),callback:()=>{const t={};t[e]={seen:!0,dismissed:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}],2===(null==a?void 0:a.length)&&l.actions.push({label:a[0],caption:a[1],callback:()=>{window.open(a[1],"_blank","noreferrer")},displayType:"link"}),!c.seen){l.autoClose=5e3;const t={};t[e]={seen:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}o.Notification.emit(n,r,l)}}}catch(e){console.log("Failed to get the announcements.",e)}if(null===(a=null==n?void 0:n.get("checkForUpdates").composite)||void 0===a||a){const e=await b("/lab/api/update");if(e.notification){const{link:t,message:a,type:l,options:c}=e.notification,d=c.data.id,u=null!==(r=s.data[d])&&void 0!==r?r:{seen:!1,dismissed:!1};if(!u.dismissed){let e;if(c.actions=[{label:i.__("Do not check for updates"),caption:i.__("If pressed, you will not be prompted if a new JupyterLab version is found."),callback:()=>{null==n||n.set("checkForUpdates",!1).then((()=>{o.Notification.dismiss(e)})).catch((e=>{console.error("Failed to set the `checkForUpdates` setting.",e)}))}}],2===(null==t?void 0:t.length)&&c.actions.push({label:t[0],caption:t[1],callback:()=>{window.open(t[1],"_blank","noreferrer")},displayType:"link"}),!u.seen){c.autoClose=5e3;const e={};e[d]={seen:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}e=o.Notification.emit(a,l,c)}}}}}))}};var y,v=a(80890),w=a(31516),_=a(78156),k=a(37634);function S(e){const{manager:t,onClose:a,trans:n}=e,[o,s]=_.useState([]),[i,r]=_.useState(null);return _.useEffect((()=>{async function e(){s(await Promise.all(t.notifications.map((async e=>Object.freeze({...e})))))}return o.length!==t.count&&e(),t.changed.connect(e),()=>{t.changed.disconnect(e)}}),[t]),_.useEffect((()=>{E.getIcons().then((e=>{r(e)})).catch((e=>{console.error(`Failed to get react-toastify icons:\n${e}`)}))}),[]),_.createElement(c.UseSignal,{signal:t.changed},(()=>_.createElement(_.Fragment,null,_.createElement("h2",{className:"jp-Notification-Header jp-Toolbar"},_.createElement("span",{className:"jp-Toolbar-item"},t.count>0?n._n("%1 notification","%1 notifications",t.count):n.__("No notifications")),_.createElement("span",{className:"jp-Toolbar-item jp-Toolbar-spacer"}),_.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:()=>{t.dismiss()},icon:c.deleteIcon,tooltip:n.__("Dismiss all notifications"),enabled:t.count>0}),_.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:a,icon:c.closeIcon,tooltip:n.__("Hide notifications")})),_.createElement("ol",{className:"jp-Notification-List"},o.map((e=>{var a;const{id:o,message:s,type:r,options:l}=e,d="in-progress"===r?"default":r,u=()=>{t.dismiss(o)},m="default"===r?null:"in-progress"===r?null!==(a=null==i?void 0:i.spinner)&&void 0!==a?a:null:i&&i[r];return _.createElement("li",{className:"jp-Notification-List-Item",key:e.id,onClick:e=>{e.stopPropagation()}},_.createElement("div",{className:`Toastify__toast Toastify__toast-theme--light Toastify__toast--${d} jp-Notification-Toast-${d}`},_.createElement("div",{className:"Toastify__toast-body"},m&&_.createElement("div",{className:"Toastify__toast-icon"},m({theme:"light",type:d})),_.createElement("div",null,E.createContent(s,u,l.actions))),_.createElement(E.CloseButton,{close:u,closeIcon:c.deleteIcon.react,title:n.__("Dismiss notification"),closeIconMargin:!0})))}))))))}!function(e){e.dismiss="apputils:dismiss-notification",e.display="apputils:display-notifications",e.notify="apputils:notify",e.update="apputils:update-notification"}(y||(y={}));class C extends c.VDomModel{constructor(e){super(),this.manager=e,this._highlight=!1,this._listOpened=!1,this._doNotDisturbMode=!1,this._count=e.count,this.manager.changed.connect(this.onNotificationChanged,this)}get count(){return this._count}get doNotDisturbMode(){return this._doNotDisturbMode}set doNotDisturbMode(e){this._doNotDisturbMode=e}get highlight(){return this._highlight}get listOpened(){return this._listOpened}set listOpened(e){this._listOpened=e,(this._listOpened||this._highlight)&&(this._highlight=!1),this.stateChanged.emit()}onNotificationChanged(e,t){this._count=this.manager.count;const{autoClose:a}=t.notification.options,n=this.doNotDisturbMode||"number"==typeof a&&a<=0;!this._listOpened&&"removed"!==t.type&&n&&(this._highlight=!0),this.stateChanged.emit()}}function T(e){return _.createElement(v.GroupItem,{spacing:4,onClick:()=>{e.onClick()},title:e.count>0?e.trans._n("%1 notification","%1 notifications",e.count):e.trans.__("No notifications")},_.createElement(v.TextItem,{className:"jp-Notification-Status-Text",source:`${e.count}`}),_.createElement(c.bellIcon.react,{top:"2px",stylesheet:"statusBar"}))}const j={id:"@jupyterlab/apputils-extension:notification",description:"Add the notification center and its status indicator.",autoStart:!0,optional:[v.IStatusBar,i.ISettingRegistry,l.ITranslator],activate:(e,t,a,n)=>{E.translator=null!=n?n:l.nullTranslator;const s=E.translator.load("jupyterlab"),i=new C(o.Notification.manager);i.doNotDisturbMode=!1,a&&Promise.all([a.load(j.id),e.restored]).then((([e])=>{const t=()=>{i.doNotDisturbMode=e.get("doNotDisturbMode").composite};t(),e.changed.connect(t)})),e.commands.addCommand(y.notify,{label:s.__("Emit a notification"),caption:s.__("Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{var a;const{message:n,type:s}=t,i=null!==(a=t.options)&&void 0!==a?a:{};return o.Notification.manager.notify(n,null!=s?s:"default",{...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.update,{label:s.__("Update a notification"),caption:s.__("Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{const{id:a,message:n,type:s,...i}=t;return o.Notification.manager.update({id:a,message:n,type:null!=s?s:"default",...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.dismiss,{label:s.__("Dismiss a notification"),execute:e=>{const{id:t}=e;o.Notification.manager.dismiss(t)}});let r=null;i.listOpened=!1;const d=o.ReactWidget.create(_.createElement(S,{manager:o.Notification.manager,onClose:()=>{null==r||r.dispose()},trans:s}));d.addClass("jp-Notification-Center"),o.Notification.manager.changed.connect((async function(e,t){var a;if(i.doNotDisturbMode||null!==r&&!r.isDisposed)return;const{message:n,type:o,options:s,id:l}=t.notification;if(!("number"==typeof s.autoClose&&s.autoClose<=0))switch(t.type){case"added":await E.createToast(l,n,o,s);break;case"updated":{const t=await E.toast(),i=s.actions,r=null!==(a=s.autoClose)&&void 0!==a?a:!(i&&i.length>0)&&null;if(t.isActive(l)){const a=()=>{t.dismiss(l),e.dismiss(l)};t.update(l,{type:"in-progress"===o?null:o,isLoading:"in-progress"===o,autoClose:r,render:E.createContent(n,a,s.actions)})}else await E.createToast(l,n,o,s)}break;case"removed":await E.toast().then((e=>{e.dismiss(l)}))}}));const u=()=>{r?(r.dispose(),r=null):(r=(0,v.showPopup)({body:d,anchor:m,align:"right",hasDynamicSize:!0,startHidden:!0}),E.toast().then((e=>{e.dismiss()})).catch((e=>{console.error(`Failed to dismiss all toasts:\n${e}`)})).finally((()=>{null==r||r.launch(),d.node.focus(),null==r||r.disposed.connect((()=>{i.listOpened=!1,r=null}))}))),i.listOpened=null!==r};e.commands.addCommand(y.display,{label:s.__("Show Notifications"),execute:u});const m=o.ReactWidget.create(_.createElement(c.UseSignal,{signal:i.stateChanged},(()=>(i.highlight||r&&!r.isDisposed?m.addClass("jp-mod-selected"):m.removeClass("jp-mod-selected"),_.createElement(T,{count:i.count,highlight:i.highlight,trans:s,onClick:u})))));m.addClass("jp-Notification-Status"),t?t.registerStatusItem(j.id,{item:m,align:"right",rank:-1}):(m.node.style.position="fixed",m.node.style.bottom="0",m.node.style.right="10px",w.Widget.attach(m,document.body),m.show())}};var E;!function(e){e.translator=l.nullTranslator;let t=null;function n(e){var t;return _.createElement("button",{className:"jp-Button jp-mod-minimal jp-Notification-Toast-Close"+(e.closeIconMargin?" jp-Notification-Toast-Close-Margin":""),title:null!==(t=e.title)&&void 0!==t?t:"",onClick:e.close},_.createElement(e.closeIcon,{className:"jp-icon-hover",tag:"span"}))}function s(t){const a=e.translator.load("jupyterlab");return _.createElement(n,{close:t.closeToast,closeIcon:c.closeIcon.react,title:a.__("Hide notification")})}e.CloseButton=n;let i=null;async function r(){if(null===i?i=new d.PromiseDelegate:await i.promise,null===t){t=await a.e(53).then(a.t.bind(a,60053,23));const e=document.body.appendChild(document.createElement("div"));e.id="react-toastify-container",(0,k.s)(e).render(_.createElement(t.ToastContainer,{draggable:!1,closeOnClick:!1,hideProgressBar:!0,newestOnTop:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,position:"bottom-right",className:"jp-toastContainer",transition:t.Slide,closeButton:s})),i.resolve()}return t.toast}e.toast=r,e.getIcons=async function(){return null===t&&await r(),t.Icons};const u={accent:"jp-mod-accept",link:"jp-mod-link",warn:"jp-mod-warn",default:""};function m({action:e,closeToast:t}){var a,n;const o=["jp-toast-button",u[null!==(a=e.displayType)&&void 0!==a?a:"default"]].join(" ");return _.createElement(c.Button,{title:null!==(n=e.caption)&&void 0!==n?n:e.label,className:o,onClick:a=>{e.callback(a),a.defaultPrevented||t()},small:!0},e.label)}function p(e,t,a){var n;const o=e.length>140?e.slice(0,140)+"…":e;return _.createElement(_.Fragment,null,_.createElement("div",{className:"jp-toast-message"},o.split("\n").map(((e,t)=>_.createElement(_.Fragment,{key:`part-${t}`},t>0?_.createElement("br",null):null,e)))),(null!==(n=null==a?void 0:a.length)&&void 0!==n?n:0)>0&&_.createElement("div",{className:"jp-toast-buttonBar"},_.createElement("div",{className:"jp-toast-spacer"}),a.map(((e,a)=>_.createElement(m,{key:"button-"+a,action:e,closeToast:t})))))}e.createContent=p,e.createToast=async function(e,t,a,n={}){const{actions:s,autoClose:i,data:l}=n;return(await r())((({closeToast:a})=>p(t,(()=>{a&&a(),o.Notification.manager.dismiss(e)}),s)),{autoClose:null!=i?i:!(s&&s.length>0)&&void 0,data:l,className:`jp-Notification-Toast-${a}`,toastId:e,type:"in-progress"===a?null:a,isLoading:"in-progress"===a})}}(E||(E={}));var I,x,N=a(33625),P=a(32895);!function(e){e.activate="apputils:activate-command-palette"}(I||(I={}));class D{constructor(e,t){this.translator=t||l.nullTranslator;const a=this.translator.load("jupyterlab");this._palette=e,this._palette.title.label="",this._palette.title.caption=a.__("Command Palette")}set placeholder(e){this._palette.inputNode.placeholder=e}get placeholder(){return this._palette.inputNode.placeholder}activate(){this._palette.activate()}addItem(e){const t=this._palette.addItem(e);return new u.DisposableDelegate((()=>{this._palette.removeItem(t)}))}}!function(e){e.activate=function(t,a,n){const{commands:s,shell:i}=t,r=a.load("jupyterlab"),l=x.createPalette(t,a),c=new o.ModalCommandPalette({commandPalette:l});let d=!1;if(l.node.setAttribute("role","region"),l.node.setAttribute("aria-label",r.__("Command Palette Section")),i.add(l,"left",{rank:300,type:"Command Palette"}),n){const e=n.load("@jupyterlab/apputils-extension:palette"),a=e=>{const t=e.get("modal").composite;d&&!t?(l.parent=null,c.detach(),i.add(l,"left",{rank:300,type:"Command Palette"})):!d&&t&&(l.parent=null,c.palette=l,l.show(),c.attach()),d=t};Promise.all([e,t.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}const u=()=>{const e=(0,N.find)(t.commands.keyBindings,(e=>e.command===I.activate));if(e){const t=e.keys.map(P.CommandRegistry.formatKeystroke).join(", ");l.title.caption=r.__("Commands (%1)",t)}else l.title.caption=r.__("Commands")};return u(),t.commands.keyBindingChanged.connect((()=>{u()})),s.addCommand(I.activate,{execute:()=>{d?c.activate():i.activateById(l.id)},label:r.__("Activate Command Palette")}),l.inputNode.placeholder=r.__("SEARCH"),new e(l,a)},e.restore=function(e,t,a){const n=x.createPalette(e,a);t.add(n,"command-palette")}}(D||(D={})),function(e){let t;e.createPalette=function(e,a){if(!t){t=new w.CommandPalette({commands:e.commands,renderer:c.CommandPaletteSvg.defaultRenderer}),t.id="command-palette",t.title.icon=c.paletteIcon;const n=a.load("jupyterlab");t.title.label=n.__("Commands")}return t}}(x||(x={}));class F extends r.DataConnector{constructor(e){super(),this._throttlers=Object.create(null),this._connector=e}fetch(e){const t=this._throttlers;return e in t||(t[e]=new m.Throttler((()=>this._connector.fetch(e)),100)),t[e].invoke()}async list(e="all"){const{isDisabled:t}=s.PageConfig.Extension,{ids:a,values:n}=await this._connector.list("ids"===e?"ids":void 0);return"all"===e?{ids:a,values:n}:"ids"===e?{ids:a}:{ids:a.filter((e=>!t(e))),values:n.filter((({id:e})=>!t(e)))}}async save(e,t){await this._connector.save(e,t)}}const R={id:"@jupyterlab/apputils-extension:settings",description:"Provides the setting registry.",activate:async e=>{const{isDisabled:t}=s.PageConfig.Extension,a=new F(e.serviceManager.settings),n=new i.SettingRegistry({connector:a,plugins:(await a.list("active")).values.filter((t=>e.hasPlugin(t.id)))});return e.restored.then((async()=>{(await a.list("ids")).ids.forEach((async a=>{if(e.hasPlugin(a)&&!t(a)&&!(a in n.plugins))try{await n.load(a)}catch(t){console.warn(`Settings failed to load for (${a})`,t),e.isPluginActivated(a)||console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this may happen if {autoStart: false} in (${a}) or if it is one of the deferredExtensions in page config.`)}}))})),n},autoStart:!0,provides:i.ISettingRegistry},A={id:"@jupyterlab/apputils-extension:kernel-status",description:"Provides the kernel status indicator model.",autoStart:!0,requires:[v.IStatusBar],provides:o.IKernelStatusModel,optional:[o.ISessionContextDialogs,l.ITranslator,n.ILabShell],activate:(e,t,a,n,s)=>{const i=null!=n?n:l.nullTranslator,r=null!=a?a:new o.SessionContextDialogs({translator:i}),c=async()=>{d.model.sessionContext&&await r.selectKernel(d.model.sessionContext)},d=new o.KernelStatus({onClick:c,onKeyDown:async e=>{if("Enter"===e.key||"Spacebar"===e.key||" "===e.key)return e.preventDefault(),e.stopPropagation(),c()}},i),u=new Set;function m(e,t){var a;const{oldValue:n,newValue:o}=t;n&&n.title.changed.disconnect(p),d.model.sessionContext=null!==(a=[...u].map((e=>e(t.newValue))).filter((e=>null!==e))[0])&&void 0!==a?a:null,o&&d.model.sessionContext&&(p(o.title),o.title.changed.connect(p))}const p=e=>{d.model.activityName=e.label};return s&&s.currentChanged.connect(m),t.registerStatusItem(A.id,{priority:1,item:d,align:"left",rank:1,isActive:()=>null!==d.model.sessionContext}),{addSessionProvider:t=>{u.add(t),e.shell.currentWidget&&m(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}}}},M={id:"@jupyterlab/apputils-extension:running-sessions-status",description:"Add the running sessions and terminals status bar item.",autoStart:!0,requires:[v.IStatusBar,l.ITranslator],activate:(e,t,a)=>{const n=new o.RunningSessions({onClick:()=>e.shell.activateById("jp-running-sessions"),onKeyDown:t=>{"Enter"!==t.key&&"Spacebar"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),e.shell.activateById("jp-running-sessions"))},serviceManager:e.serviceManager,translator:a});n.model.sessions=Array.from(e.serviceManager.sessions.running()).length,n.model.terminals=Array.from(e.serviceManager.terminals.running()).length,t.registerStatusItem(M.id,{item:n,align:"left",rank:0})}};var W,O=a(59012);!function(e){e.changeTheme="apputils:change-theme",e.changePreferredLightTheme="apputils:change-light-theme",e.changePreferredDarkTheme="apputils:change-dark-theme",e.toggleAdaptiveTheme="apputils:adaptive-theme",e.themeScrollbars="apputils:theme-scrollbars",e.changeFont="apputils:change-font",e.incrFontSize="apputils:incr-font-size",e.decrFontSize="apputils:decr-font-size"}(W||(W={}));const L={id:"@jupyterlab/apputils-extension:themes",description:"Provides the theme manager.",requires:[i.ISettingRegistry,n.JupyterFrontEnd.IPaths,l.ITranslator],optional:[o.ISplashScreen],activate:(e,t,a,n,i)=>{const r=n.load("jupyterlab"),l=e.shell,c=e.commands,d=s.URLExt.join(s.PageConfig.getBaseUrl(),a.urls.themes),u=L.id,m=new o.ThemeManager({key:u,host:l,settings:t,splash:null!=i?i:void 0,url:d});let p,h=null;return m.themeChanged.connect(((e,t)=>{p=t.newValue,document.body.dataset.jpThemeLight=String(m.isLight(p)),document.body.dataset.jpThemeName=p,document.body.dataset.jpThemeScrollbars!==String(m.themeScrollbars(p))&&(document.body.dataset.jpThemeScrollbars=String(m.themeScrollbars(p)),m.themeScrollbars(p)?(h||(h=function(e){const t=document.createElement("style");return t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n background: rgb(var(--jp-scrollbar-thumb-color));\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-right: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-bottom: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid transparent;\n border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid transparent;\n border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n")),t}()),h.parentElement||document.body.appendChild(h)):h&&h.parentElement&&h.parentElement.removeChild(h)),c.notifyCommandChanged(W.changeTheme)})),c.addCommand(W.changeTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Use Theme: %1",a):a},isToggled:e=>e.theme===p,execute:e=>{const t=e.theme;if(t!==m.theme)return m.isToggledAdaptiveTheme()?m.toggleAdaptiveTheme():m.setTheme(t)}}),c.addCommand(W.changePreferredLightTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided light `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Light Theme: %1",a):a},isToggled:e=>e.theme===m.preferredLightTheme,execute:e=>{const t=e.theme;if(t!==m.preferredLightTheme)return m.setPreferredLightTheme(t)}}),c.addCommand(W.changePreferredDarkTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided dark `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Dark Theme: %1",a):a},isToggled:e=>e.theme===m.preferredDarkTheme,execute:e=>{const t=e.theme;if(t!==m.preferredDarkTheme)return m.setPreferredDarkTheme(t)}}),c.addCommand(W.toggleAdaptiveTheme,{label:e=>e.isPalette?r.__("Synchronize Styling Theme with System Settings"):r.__("Synchronize with System Settings"),isToggled:()=>m.isToggledAdaptiveTheme(),execute:()=>{m.toggleAdaptiveTheme().catch(console.warn)}}),c.addCommand(W.themeScrollbars,{label:r.__("Theme Scrollbars"),isToggled:()=>m.isToggledThemeScrollbars(),execute:()=>m.toggleThemeScrollbars()}),c.addCommand(W.changeFont,{label:e=>e.enabled?`${e.font}`:r.__("waiting for fonts"),isEnabled:e=>e.enabled,isToggled:e=>m.getCSS(e.key)===e.font,execute:e=>m.setCSSOverride(e.key,e.font)}),c.addCommand(W.incrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Increase Code Font Size");case"content-font-size1":return r.__("Increase Content Font Size");case"ui-font-size1":return r.__("Increase UI Font Size");default:return r.__("Increase Font Size")}},execute:e=>m.incrFontSize(e.key)}),c.addCommand(W.decrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Decrease Code Font Size");case"content-font-size1":return r.__("Decrease Content Font Size");case"ui-font-size1":return r.__("Decrease UI Font Size");default:return r.__("Decrease Font Size")}},execute:e=>m.decrFontSize(e.key)}),m},autoStart:!0,provides:o.IThemeManager},$={id:"@jupyterlab/apputils-extension:themes-palette-menu",description:"Adds theme commands to the menu and the command palette.",requires:[o.IThemeManager,l.ITranslator],optional:[o.ICommandPalette,O.IMainMenu],activate:(e,t,a,n,o)=>{const s=a.load("jupyterlab");o&&e.restored.then((()=>{var e;const a=null===(e=o.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-apputilstheme"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===e?void 0:e.submenu;a&&t.themes.forEach(((e,t)=>{a.insertItem(t,{command:W.changeTheme,args:{isPalette:!1,theme:e}})}))})),n&&e.restored.then((()=>{const e=s.__("Theme"),a=W.changeTheme,o=!0;t.themes.forEach((t=>{n.addItem({command:a,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:W.changePreferredLightTheme,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:W.changePreferredDarkTheme,args:{isPalette:o,theme:t},category:e})})),n.addItem({command:W.toggleAdaptiveTheme,args:{isPalette:o},category:e}),n.addItem({command:W.themeScrollbars,category:e}),n.addItem({command:W.incrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:W.incrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:W.incrFontSize,args:{key:"ui-font-size1"},category:e}),n.addItem({command:W.decrFontSize,args:{key:"ui-font-size1"},category:e})}))},autoStart:!0},z={id:"@jupyterlab/apputils-extension:toolbar-registry",description:"Provides toolbar items registry.",autoStart:!0,provides:o.IToolbarWidgetRegistry,activate:e=>new o.ToolbarWidgetRegistry({defaultFactory:(0,o.createDefaultFactory)(e.commands)})};var B,U=a(57526),H=a(96795);!function(e){e.saveWorkspace="workspace-ui:save",e.saveWorkspaceAs="workspace-ui:save-as"}(B||(B={}));const q="jupyterlab-workspace",J="."+q,K="workspace-ui:lastSave",V={id:"@jupyterlab/apputils-extension:workspaces",description:"Add workspace file type and commands.",autoStart:!0,requires:[H.IDefaultFileBrowser,o.IWindowResolver,r.IStateDB,l.ITranslator,n.JupyterFrontEnd.IPaths],optional:[n.IRouter],activate:(e,t,a,n,o,s,i)=>{const r=new Q.WorkspaceFactory({workspaces:e.serviceManager.workspaces,router:i,state:n,translator:o,paths:s}),l=o.load("jupyterlab");e.docRegistry.addFileType({name:q,contentType:"file",fileFormat:"text",displayName:l.__("JupyterLab workspace File"),extensions:[J],mimeTypes:["text/json"],iconClass:"jp-JupyterIcon"}),e.docRegistry.addWidgetFactory(r),e.commands.addCommand(B.saveWorkspaceAs,{label:l.__("Save Current Workspace As…"),execute:async()=>{const s=e.serviceManager.workspaces.fetch(a.name);await Q.saveAs(t,e.serviceManager.contents,s,n,o)}}),e.commands.addCommand(B.saveWorkspace,{label:l.__("Save Current Workspace"),execute:async()=>{const{contents:s}=e.serviceManager,i=e.serviceManager.workspaces.fetch(a.name),r=await n.fetch(K);void 0===r?await Q.saveAs(t,s,i,n,o):await Q.save(r,s,i,n)}})}};var Q;!function(e){async function t(e,t,a,n){let o=e.split("/").pop();void 0!==o&&o.includes(".")?o=o.split(".")[0]:e+=J,await n.save(K,e);const s=await a;s.metadata.id=`${o}`,await t.save(e,{type:"file",format:"text",content:JSON.stringify(s)})}e.save=t,e.saveAs=async function(e,a,s,i,r){var c;r=r||l.nullTranslator;const d=await i.fetch(K);let u;u=void 0===d?"new-workspace":null===(c=d.split("/").pop())||void 0===c?void 0:c.split(".")[0];const m=e.model.path+"/"+u+J,p=await async function(e,t){const a=(t=t||l.nullTranslator).load("jupyterlab"),s=o.Dialog.okButton({label:a.__("Save"),ariaLabel:a.__("Save Current Workspace")}),i=await(0,o.showDialog)({title:a.__("Save Current Workspace As…"),body:new n(e),buttons:[o.Dialog.cancelButton(),s]});return i.button.label===a.__("Save")?i.value:null}(m,r);p&&await t(p,a,s,i)};class a extends U.ABCWidgetFactory{constructor(e){super({name:"Workspace loader",label:(e.translator||l.nullTranslator).load("jupyterlab").__("Workspace loader"),fileTypes:[q],defaultFor:[q],readOnly:!0}),this._application=e.paths.urls.app,this._router=e.router,this._state=e.state,this._workspaces=e.workspaces}createNewWidget(e){return e.ready.then((async()=>{const t=e.model.toJSON(),a=e.path,n=t.metadata.id;await this._workspaces.save(n,t),await this._state.save(K,a);const o=s.URLExt.join(this._application,"workspaces"),i=s.URLExt.join(o,n);if(!o.startsWith(i))throw new Error("Can only be used for workspaces");this._router?this._router.navigate(i,{hard:!0}):document.location.href=i})),function(e){const t=new U.DocumentWidget({content:new w.Widget,context:e});return t.content.dispose(),t}(e)}}e.WorkspaceFactory=a;class n extends w.Widget{constructor(e){super({node:i(e)})}getValue(){return this.node.value}}function i(e){const t=document.createElement("input");return t.value=e,t}}(Q||(Q={}));var Y=a(18395);const G="jp-ContextualShortcut-TableItem";var X;!function(e){e.loadState="apputils:load-statedb",e.print="apputils:print",e.reset="apputils:reset",e.resetOnLoad="apputils:reset-on-load",e.runFirstEnabled="apputils:run-first-enabled",e.runAllEnabled="apputils:run-all-enabled",e.toggleHeader="apputils:toggle-header",e.displayShortcuts="apputils:display-shortcuts"}(X||(X={}));const Z={id:"@jupyterlab/apputils-extension:palette",description:"Provides the command palette.",autoStart:!0,requires:[l.ITranslator],provides:o.ICommandPalette,optional:[i.ISettingRegistry],activate:(e,t,a)=>D.activate(e,t,a)},ee={id:"@jupyterlab/apputils-extension:palette-restorer",description:"Restores the command palette.",autoStart:!0,requires:[n.ILayoutRestorer,l.ITranslator],activate:(e,t,a)=>{D.restore(e,t,a)}},te={id:"@jupyterlab/apputils-extension:resolver",description:"Provides the window name resolver.",autoStart:!0,provides:o.IWindowResolver,requires:[n.JupyterFrontEnd.IPaths,n.IRouter],activate:async(e,t,a)=>{const{hash:n,search:i}=a.current,r=s.URLExt.queryStringToObject(i||""),l=new o.WindowResolver,c=s.PageConfig.getOption("workspace"),d=s.PageConfig.getOption("treePath"),u="multiple-document"===s.PageConfig.getOption("mode")?"lab":"doc",m=c||s.PageConfig.defaultWorkspace,p=d?s.URLExt.join("tree",d):"";try{return await l.resolve(m),l}catch(e){return new Promise((()=>{const{base:e}=t.urls,o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())];let i=s.URLExt.join(e,u,"workspaces",`auto-${o}`);i=p?s.URLExt.join(i,s.URLExt.encodeParts(p)):i,r.reset="";const l=i+s.URLExt.objectToQueryString(r)+(n||"");a.navigate(l,{hard:!0})}))}}},ae={id:"@jupyterlab/apputils-extension:splash",description:"Provides the splash screen.",autoStart:!0,requires:[l.ITranslator],provides:o.ISplashScreen,activate:(e,t)=>{const a=t.load("jupyterlab"),{commands:n,restored:s}=e,i=document.createElement("div"),r=document.createElement("div"),l=document.createElement("div");let d;i.id="jupyterlab-splash",r.id="galaxy",l.id="main-logo",c.jupyterFaviconIcon.element({container:l,stylesheet:"splash"}),r.appendChild(l),["1","2","3"].forEach((e=>{const t=document.createElement("div"),a=document.createElement("div");t.id=`moon${e}`,t.className="moon orbit",a.id=`planet${e}`,a.className="planet",t.appendChild(a),r.appendChild(t)})),i.appendChild(r);const p=new m.Throttler((async()=>{if(!d){d=new o.Dialog({title:a.__("Loading…"),body:a.__("The loading screen is taking a long time.\nWould you like to clear the workspace or keep waiting?"),buttons:[o.Dialog.cancelButton({label:a.__("Keep Waiting")}),o.Dialog.warnButton({label:a.__("Clear Workspace")})]});try{const e=await d.launch();if(d.dispose(),d=null,e.button.accept&&n.hasCommand(X.reset))return n.execute(X.reset);requestAnimationFrame((()=>{p.invoke().catch((e=>{}))}))}catch(e){}}}),{limit:12e3,edge:"trailing"});let h=0;return{show:(e=!0)=>(i.classList.remove("splash-fade"),i.classList.toggle("light",e),i.classList.toggle("dark",!e),h++,document.body.appendChild(i),p.invoke().catch((e=>{})),new u.DisposableDelegate((async()=>{await s,0==--h&&(p.stop(),d&&(d.dispose(),d=null),i.classList.add("splash-fade"),window.setTimeout((()=>{document.body.removeChild(i)}),200))})))}}},ne={id:"@jupyterlab/apputils-extension:print",description:"Add the print capability",autoStart:!0,requires:[l.ITranslator],activate:(e,t)=>{const a=t.load("jupyterlab");e.commands.addCommand(X.print,{label:a.__("Print…"),isEnabled:()=>{const t=e.shell.currentWidget;return null!==o.Printing.getPrintFunction(t)},execute:async()=>{const t=e.shell.currentWidget,a=o.Printing.getPrintFunction(t);a&&await a()}})}},oe={id:"@jupyterlab/apputils-extension:toggle-header",description:"Adds a command to display the main area widget content header.",autoStart:!0,requires:[l.ITranslator],optional:[o.ICommandPalette],activate:(e,t,a)=>{const n=t.load("jupyterlab"),s=n.__("Main Area");e.commands.addCommand(X.toggleHeader,{label:n.__("Show Header Above Content"),isEnabled:()=>e.shell.currentWidget instanceof o.MainAreaWidget&&!e.shell.currentWidget.contentHeader.isDisposed&&e.shell.currentWidget.contentHeader.widgets.length>0,isToggled:()=>{const t=e.shell.currentWidget;return t instanceof o.MainAreaWidget&&!t.contentHeader.isHidden},execute:async()=>{const t=e.shell.currentWidget;t instanceof o.MainAreaWidget&&t.contentHeader.setHidden(!t.contentHeader.isHidden)}}),a&&a.addItem({command:X.toggleHeader,category:s})}},se={id:"@jupyterlab/apputils-extension:state",description:"Provides the application state. It is stored per workspaces.",autoStart:!0,provides:r.IStateDB,requires:[n.JupyterFrontEnd.IPaths,n.IRouter,l.ITranslator],optional:[o.IWindowResolver],activate:(e,t,a,n,o)=>{const i=n.load("jupyterlab");if(null===o)return new r.StateDB;let l=!1;const{commands:c,name:u,serviceManager:p}=e,{workspaces:h}=p,g=o.name,b=new d.PromiseDelegate,f=new r.StateDB({transform:b.promise}),y=new m.Debouncer((async()=>{const e=g,t={id:e},a=await f.toJSON();await h.save(e,{data:a,metadata:t})}));return f.changed.connect((()=>{y.invoke()}),f),f.changed.connect((()=>async function(e,t,a){var n,o;const i=await t.toJSON();if(void 0===(null===(o=null===(n=i["layout-restorer:data"])||void 0===n?void 0:n.main)||void 0===o?void 0:o.current))document.title=`${s.PageConfig.getOption("appName")||"JupyterLab"}${e.startsWith("auto-")?` (${e})`:""}`;else{let t=s.PathExt.basename(decodeURIComponent(window.location.href));t=t.length>15?t.slice(0,12).concat("…"):t;const n=Object.keys(i).filter((e=>e.startsWith("notebook")||e.startsWith("editor"))).length;e.startsWith("auto-")?document.title=`${t} (${e}${n>1?` : ${n}`:""}) - ${a}`:document.title=`${t}${n>1?` (${n})`:""} - ${a}`}}(g,f,u))),c.addCommand(X.loadState,{label:i.__("Load state for the current workspace."),execute:async e=>{if(l)return;const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="string"==typeof i.clone?""===i.clone?s.PageConfig.defaultWorkspace:i.clone:null,c=r||g||null;if(null!==c){try{const e=await h.fetch(c);l||(l=!0,b.resolve({type:"overwrite",contents:e.data}))}catch({message:e}){console.warn(`Fetching workspace "${g}" failed.`,e),l||(l=!0,b.resolve({type:"cancel",contents:null}))}if(c===r){delete i.clone;const e=n+s.URLExt.objectToQueryString(i)+t,o=y.invoke().then((()=>a.stop));return o.then((()=>{a.navigate(e)})),o}await y.invoke()}else console.error(`${X.loadState} cannot load null workspace.`)}}),c.addCommand(X.reset,{label:i.__("Reset Application State"),execute:async({reload:e})=>{await f.clear(),await y.invoke(),e&&a.reload()}}),c.addCommand(X.resetOnLoad,{label:i.__("Reset state when loading for the workspace."),execute:e=>{const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="clone"in i;if(!("reset"in i))return;if(l)return a.reload();l=!0,b.resolve({type:"clear",contents:null}),delete i.reset;const c=n+s.URLExt.objectToQueryString(i)+t,d=f.clear().then((()=>y.invoke()));return r?d.then((()=>{a.navigate(c,{hard:!0})})):d.then((()=>{a.navigate(c)})),d}}),a.register({command:X.loadState,pattern:/.?/,rank:30}),a.register({command:X.resetOnLoad,pattern:/(\?reset|\&reset)($|&)/,rank:20}),f}},ie={id:"@jupyterlab/apputils-extension:sessionDialogs",description:"Provides the session context dialogs.",provides:o.ISessionContextDialogs,optional:[l.ITranslator],autoStart:!0,activate:async(e,t)=>new o.SessionContextDialogs({translator:null!=t?t:l.nullTranslator})},re={id:"@jupyterlab/apputils-extension:utilityCommands",description:"Adds meta commands to run set of other commands.",requires:[l.ITranslator],optional:[o.ICommandPalette],autoStart:!0,activate:(e,t,a)=>{const n=t.load("jupyterlab"),{commands:s}=e;if(s.addCommand(X.runFirstEnabled,{label:n.__("Run First Enabled Command"),execute:t=>{const a=t.commands,n=t.args,o=Array.isArray(t);for(let t=0;t<a.length;t++){const s=a[t],i=o?n[t]:n;if(e.commands.isEnabled(s,i))return e.commands.execute(s,i)}}}),s.addCommand(X.runAllEnabled,{label:n.__("Run All Enabled Commands Passed as Args"),execute:async t=>{var a,n;const o=null!==(a=t.commands)&&void 0!==a?a:[],s=t.args,i=Array.isArray(t),r=null!==(n=t.errorIfNotEnabled)&&void 0!==n&&n;for(let t=0;t<o.length;t++){const a=o[t],n=i?s[t]:s;e.commands.isEnabled(a,n)?await e.commands.execute(a,n):r&&console.error(`${a} is not enabled.`)}},isEnabled:t=>{var a;const n=null!==(a=t.commands)&&void 0!==a?a:[],o=t.args,s=Array.isArray(t);return n.some(((t,a)=>e.commands.isEnabled(t,s?o[a]:o)))}}),s.addCommand(X.displayShortcuts,{label:n.__("Show Keyboard Shortcuts"),caption:n.__("Show relevant keyboard shortcuts for the current active widget"),execute:t=>{var a;const i=e.shell.currentWidget;if(!(null==i?void 0:i.node.contains(document.activeElement))&&i instanceof o.MainAreaWidget){const e=null!==(a=i.content.node)&&void 0!==a?a:null==i?void 0:i.node;null==e||e.focus()}return function(e){const{commands:t,trans:a,activeElement:n}=e,s=null!=n?n:document.activeElement;function i(e){const t=[];return e.forEach(((e,a)=>{const n=[];e.split(" ").forEach(((e,t)=>{n.push(_.createElement("span",{className:"jp-ContextualShortcut-Key",key:`ch-${t}`},_.createElement("kbd",null,e)),_.createElement(_.Fragment,{key:`fragment-${t}`}," + "))})),t.push(_.createElement("span",{key:`key-${a}`},n.slice(0,-1)),_.createElement(_.Fragment,{key:`fragment-${a}`}," + "))})),_.createElement("span",null,t.slice(0,-1))}function r(e){const a=t.label(e.command),n=e.command.split(":")[1].split("-");let o="";for(let e=0;e<n.length;e++)o=o+" "+((s=n[e]).charAt(0).toUpperCase()+s.slice(1));var s;return a.length>0?a:o}function l(e,t){let a=t;for(let t=0;null!==a&&a!==a.parentElement;a=a.parentElement,++t){if(a.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(a.matches(e))return t}return-1}const c=new Map;for(let e=0;e<t.keyBindings.length;e++){const a=t.keyBindings[e];let n=l(a.selector,s);if(n<0)continue;let o=P.CommandRegistry.formatKeystroke(a.keys);if(c.has(o)){let e=c.get(o);if(e[0]<n||e[0]===n&&Y.Selector.calculateSpecificity(e[1].selector)>Y.Selector.calculateSpecificity(a.selector))continue}c.set(o,[n,a])}let d=-1;const u=new Map;for(let[e,t]of c.values())d=Math.max(e,d),u.has(e)||u.set(e,[]),u.get(e).push(t);const m=[];for(let e=0;e<=d;e++)u.has(e)&&(m.push(u.get(e).map((e=>_.createElement("tr",{className:"jp-ContextualShortcut-TableRow",key:`${e.command}-${e.keys.join("-").replace(" ","_")}`},_.createElement("td",{className:G},r(e)),_.createElement("td",{className:G},i([...e.keys])))))),m.push(_.createElement("tr",{className:"jp-ContextualShortcut-TableLastRow",key:`group-${e}-last`})));const p=_.createElement("table",null,_.createElement("tbody",null,m));return(0,o.showDialog)({title:a.__("Keyboard Shortcuts"),body:p,buttons:[o.Dialog.cancelButton({label:a.__("Close")})]})}({commands:s,trans:n})}}),a){const e=n.__("Help");a.addItem({command:X.displayShortcuts,category:e})}}},le={id:"@jupyterlab/apputils-extension:sanitizer",description:"Provides the HTML sanitizer.",autoStart:!0,provides:o.ISanitizer,requires:[i.ISettingRegistry],activate:(e,t)=>{const a=new o.Sanitizer,n=e=>{const t=e.get("allowedSchemes").composite,n=e.get("autolink").composite;t&&a.setAllowedSchemes(t),a.setAutolink(n)};return t.load("@jupyterlab/apputils-extension:sanitizer").then((e=>{n(e),e.changed.connect(n)})).catch((e=>{console.error("Failed to load sanitizer settings:",e)})),a}},ce=[f,A,j,Z,ee,ne,te,M,le,R,se,ae,ie,L,$,oe,z,re,V]},37634:(e,t,a)=>{var n=a(38005);t.s=n.createRoot,n.hydrateRoot}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5135,1682],{21682:(n,e,t)=>{t.r(e),t.d(e,{CommandIDs:()=>h,default:()=>p});var s=t(17260),o=t(47005),i=t(42539),l=t(70397),a=t(70788),r=t(97934),d=t(81997);const c="jp-mod-kernel";var u;!function(n){n.RunningKernel=class{constructor(n){this.className=c,this.commands=n.commands,this.kernel=n.kernel,this.context=this.kernel.id,this.kernels=n.kernels,this.sessions=n.sessions,this.spec=n.spec||null,this.trans=n.trans}get children(){var n;const e=[],t=h.kernelOpenSession,{commands:s}=this;for(const o of this.sessions.running())if(this.kernel.id===(null===(n=o.kernel)||void 0===n?void 0:n.id)){const{name:n,path:i,type:a}=o;e.push({className:c,context:this.kernel.id,open:()=>{s.execute(t,{name:n,path:i,type:a})},icon:()=>"console"===a?l.consoleIcon:"notebook"===a?l.notebookIcon:l.jupyterIcon,label:()=>n,labelTitle:()=>i})}return e}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){const{spec:n}=this;return n&&n.resources?n.resources["logo-svg"]||n.resources["logo-64x64"]||n.resources["logo-32x32"]:l.jupyterIcon}label(){const{kernel:n,spec:e}=this;return(null==e?void 0:e.display_name)||n.name}labelTitle(){var n;const{trans:e}=this,{id:t}=this.kernel,s=[`${this.label()}: ${t}`];for(const t of this.sessions.running())if(this.kernel.id===(null===(n=t.kernel)||void 0===n?void 0:n.id)){const{path:n,type:o}=t;s.push(e.__("%1\nPath: %2",o,n))}return s.join("\n\n")}},n.runningChanged=new d.Signal({})}(u||(u={}));var h,g=t(19928);class m{constructor(n){this._tabsChanged=new d.Signal(this),this._widgets=[],this._labShell=n,this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(n){n.title.changed.connect(this._emitTabsChanged,this),this._widgets.push(n)}_emitTabsChanged(){this._widgets.forEach((n=>{n.title.changed.disconnect(this._emitTabsChanged,this)})),this._widgets=[],this._tabsChanged.emit(void 0)}}!function(n){n.kernelNewConsole="running:kernel-new-console",n.kernelNewNotebook="running:kernel-new-notebook",n.kernelOpenSession="running:kernel-open-session",n.kernelShutDown="running:kernel-shut-down",n.showPanel="running:show-panel"}(h||(h={}));const p={activate:function(n,e,t,s){const i=e.load("jupyterlab"),d=new o.RunningSessionManagers,p=new o.RunningSessions(d,e);return p.id="jp-running-sessions",p.title.caption=i.__("Running Terminals and Kernels"),p.title.icon=l.runningIcon,p.node.setAttribute("role","region"),p.node.setAttribute("aria-label",i.__("Running Sessions section")),t&&t.add(p,"running-sessions"),s&&function(n,e,t){const s=new m(t),o=e.load("jupyterlab");n.add({name:o.__("Open Tabs"),running:()=>Array.from(t.widgets("main")).map((n=>(s.addWidget(n),new i(n)))),shutdownAll:()=>{for(const n of t.widgets("main"))n.close()},refreshRunning:()=>{},runningChanged:s.tabsChanged,shutdownLabel:o.__("Close"),shutdownAllLabel:o.__("Close All"),shutdownAllConfirmationText:o.__("Are you sure you want to close all open tabs?")});class i{constructor(n){this._widget=n}open(){t.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const n=this._widget.title.icon;return n instanceof l.LabIcon?n:l.fileIcon}label(){return this._widget.title.label}labelTitle(){let n;return n=this._widget instanceof g.DocumentWidget?this._widget.context.path:this._widget.title.label,n}}}(d,e,s),async function(n,e,t){const{commands:s,contextMenu:o,serviceManager:i}=t,{kernels:d,kernelspecs:g,sessions:m}=i,{runningChanged:p,RunningKernel:w}=u,_=new r.Throttler((()=>p.emit(void 0)),100),b=e.load("jupyterlab");d.runningChanged.connect((()=>{_.invoke()})),m.runningChanged.connect((()=>{_.invoke()})),await Promise.all([d.ready,g.ready,m.ready]),n.add({name:b.__("Kernels"),running:()=>Array.from(d.running()).map((n=>{var e;return new w({commands:s,kernel:n,kernels:d,sessions:m,spec:null===(e=g.specs)||void 0===e?void 0:e.kernelspecs[n.name],trans:b})})),shutdownAll:()=>d.shutdownAll(),refreshRunning:()=>Promise.all([d.refreshRunning(),m.refreshRunning()]),runningChanged:p,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:b.__("Are you sure you want to permanently shut down all running kernels?")});const k=n=>n.classList.contains(c);s.addCommand(h.kernelNewConsole,{icon:l.consoleIcon,label:b.__("New Console for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("console:create",{kernelPreference:{id:i}})}}),s.addCommand(h.kernelNewNotebook,{icon:l.notebookIcon,label:b.__("New Notebook for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("notebook:create-new",{kernelId:i})}}),s.addCommand(h.kernelOpenSession,{icon:n=>"console"===n.type?l.consoleIcon:"notebook"===n.type?l.notebookIcon:void 0,isEnabled:({path:n,type:e})=>!!e||void 0!==n,label:({name:n,path:e})=>n||a.PathExt.basename(e||b.__("Unknown Session")),execute:({path:n,type:e})=>{if(!e||void 0===n)return;const t="console"===e?"console:open":"docmanager:open";return s.execute(t,{path:n})}}),s.addCommand(h.kernelShutDown,{icon:l.closeIcon,label:b.__("Shut Down Kernel"),execute:n=>{var e;const s=t.contextMenuHitTest(k),o=null!==(e=n.id)&&void 0!==e?e:null==s?void 0:s.dataset.context;if(o)return d.shutdown(o)}});const v=[];o.opened.connect((async()=>{var n,e,s;const i=null!==(e=null===(n=o.menu.items.find((n=>{var e;return"submenu"===n.type&&"jp-contextmenu-connected-sessions"===(null===(e=n.submenu)||void 0===e?void 0:e.id)})))||void 0===n?void 0:n.submenu)&&void 0!==e?e:null;if(!i)return;v.forEach((n=>n.dispose())),v.length=0,i.clearItems();const l=t.contextMenuHitTest(k),a=null==l?void 0:l.dataset.context;if(!a)return;const r=h.kernelOpenSession;for(const n of m.running())if(a===(null===(s=n.kernel)||void 0===s?void 0:s.id)){const{name:e,path:t,type:s}=n;v.push(i.addItem({command:r,args:{name:e,path:t,type:s}}))}}))}(d,e,n),n.shell.add(p,"left",{rank:200,type:"Sessions and Tabs"}),n.commands.addCommand(h.showPanel,{label:i.__("Sessions and Tabs"),execute:()=>{n.shell.activateById(p.id)}}),d},id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[i.ITranslator],optional:[s.ILayoutRestorer,s.ILabShell],autoStart:!0}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5135,1682],{21682:(n,e,t)=>{t.r(e),t.d(e,{CommandIDs:()=>h,default:()=>p});var s=t(17260),o=t(47005),i=t(42539),l=t(70397),a=t(70788),r=t(97934),d=t(81997);const c="jp-mod-kernel";var u;!function(n){n.RunningKernel=class{constructor(n){this.className=c,this.commands=n.commands,this.kernel=n.kernel,this.context=this.kernel.id,this.kernels=n.kernels,this.sessions=n.sessions,this.spec=n.spec||null,this.trans=n.trans}get children(){var n;const e=[],t=h.kernelOpenSession,{commands:s}=this;for(const o of this.sessions.running())if(this.kernel.id===(null===(n=o.kernel)||void 0===n?void 0:n.id)){const{name:n,path:i,type:a}=o;e.push({className:c,context:this.kernel.id,open:()=>{s.execute(t,{name:n,path:i,type:a})},icon:()=>"console"===a?l.consoleIcon:"notebook"===a?l.notebookIcon:l.jupyterIcon,label:()=>n,labelTitle:()=>i})}return e}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){const{spec:n}=this;return n&&n.resources?n.resources["logo-svg"]||n.resources["logo-64x64"]||n.resources["logo-32x32"]:l.jupyterIcon}label(){const{kernel:n,spec:e}=this;return(null==e?void 0:e.display_name)||n.name}labelTitle(){var n;const{trans:e}=this,{id:t}=this.kernel,s=[`${this.label()}: ${t}`];for(const t of this.sessions.running())if(this.kernel.id===(null===(n=t.kernel)||void 0===n?void 0:n.id)){const{path:n,type:o}=t;s.push(e.__("%1\nPath: %2",o,n))}return s.join("\n\n")}},n.runningChanged=new d.Signal({})}(u||(u={}));var h,g=t(57526);class m{constructor(n){this._tabsChanged=new d.Signal(this),this._widgets=[],this._labShell=n,this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(n){n.title.changed.connect(this._emitTabsChanged,this),this._widgets.push(n)}_emitTabsChanged(){this._widgets.forEach((n=>{n.title.changed.disconnect(this._emitTabsChanged,this)})),this._widgets=[],this._tabsChanged.emit(void 0)}}!function(n){n.kernelNewConsole="running:kernel-new-console",n.kernelNewNotebook="running:kernel-new-notebook",n.kernelOpenSession="running:kernel-open-session",n.kernelShutDown="running:kernel-shut-down",n.showPanel="running:show-panel"}(h||(h={}));const p={activate:function(n,e,t,s){const i=e.load("jupyterlab"),d=new o.RunningSessionManagers,p=new o.RunningSessions(d,e);return p.id="jp-running-sessions",p.title.caption=i.__("Running Terminals and Kernels"),p.title.icon=l.runningIcon,p.node.setAttribute("role","region"),p.node.setAttribute("aria-label",i.__("Running Sessions section")),t&&t.add(p,"running-sessions"),s&&function(n,e,t){const s=new m(t),o=e.load("jupyterlab");n.add({name:o.__("Open Tabs"),running:()=>Array.from(t.widgets("main")).map((n=>(s.addWidget(n),new i(n)))),shutdownAll:()=>{for(const n of t.widgets("main"))n.close()},refreshRunning:()=>{},runningChanged:s.tabsChanged,shutdownLabel:o.__("Close"),shutdownAllLabel:o.__("Close All"),shutdownAllConfirmationText:o.__("Are you sure you want to close all open tabs?")});class i{constructor(n){this._widget=n}open(){t.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const n=this._widget.title.icon;return n instanceof l.LabIcon?n:l.fileIcon}label(){return this._widget.title.label}labelTitle(){let n;return n=this._widget instanceof g.DocumentWidget?this._widget.context.path:this._widget.title.label,n}}}(d,e,s),async function(n,e,t){const{commands:s,contextMenu:o,serviceManager:i}=t,{kernels:d,kernelspecs:g,sessions:m}=i,{runningChanged:p,RunningKernel:w}=u,_=new r.Throttler((()=>p.emit(void 0)),100),b=e.load("jupyterlab");d.runningChanged.connect((()=>{_.invoke()})),m.runningChanged.connect((()=>{_.invoke()})),await Promise.all([d.ready,g.ready,m.ready]),n.add({name:b.__("Kernels"),running:()=>Array.from(d.running()).map((n=>{var e;return new w({commands:s,kernel:n,kernels:d,sessions:m,spec:null===(e=g.specs)||void 0===e?void 0:e.kernelspecs[n.name],trans:b})})),shutdownAll:()=>d.shutdownAll(),refreshRunning:()=>Promise.all([d.refreshRunning(),m.refreshRunning()]),runningChanged:p,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:b.__("Are you sure you want to permanently shut down all running kernels?")});const k=n=>n.classList.contains(c);s.addCommand(h.kernelNewConsole,{icon:l.consoleIcon,label:b.__("New Console for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("console:create",{kernelPreference:{id:i}})}}),s.addCommand(h.kernelNewNotebook,{icon:l.notebookIcon,label:b.__("New Notebook for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("notebook:create-new",{kernelId:i})}}),s.addCommand(h.kernelOpenSession,{icon:n=>"console"===n.type?l.consoleIcon:"notebook"===n.type?l.notebookIcon:void 0,isEnabled:({path:n,type:e})=>!!e||void 0!==n,label:({name:n,path:e})=>n||a.PathExt.basename(e||b.__("Unknown Session")),execute:({path:n,type:e})=>{if(!e||void 0===n)return;const t="console"===e?"console:open":"docmanager:open";return s.execute(t,{path:n})}}),s.addCommand(h.kernelShutDown,{icon:l.closeIcon,label:b.__("Shut Down Kernel"),execute:n=>{var e;const s=t.contextMenuHitTest(k),o=null!==(e=n.id)&&void 0!==e?e:null==s?void 0:s.dataset.context;if(o)return d.shutdown(o)}});const v=[];o.opened.connect((async()=>{var n,e,s;const i=null!==(e=null===(n=o.menu.items.find((n=>{var e;return"submenu"===n.type&&"jp-contextmenu-connected-sessions"===(null===(e=n.submenu)||void 0===e?void 0:e.id)})))||void 0===n?void 0:n.submenu)&&void 0!==e?e:null;if(!i)return;v.forEach((n=>n.dispose())),v.length=0,i.clearItems();const l=t.contextMenuHitTest(k),a=null==l?void 0:l.dataset.context;if(!a)return;const r=h.kernelOpenSession;for(const n of m.running())if(a===(null===(s=n.kernel)||void 0===s?void 0:s.id)){const{name:e,path:t,type:s}=n;v.push(i.addItem({command:r,args:{name:e,path:t,type:s}}))}}))}(d,e,n),n.shell.add(p,"left",{rank:200,type:"Sessions and Tabs"}),n.commands.addCommand(h.showPanel,{label:i.__("Sessions and Tabs"),execute:()=>{n.shell.activateById(p.id)}}),d},id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[i.ITranslator],optional:[s.ILayoutRestorer,s.ILabShell],autoStart:!0}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[514],{45135:(e,t,i)=>{i.r(t),i.d(t,{INotebookPathOpener:()=>C,INotebookShell:()=>y,NotebookApp:()=>H,NotebookShell:()=>k,PanelHandler:()=>f,Private:()=>v,SidePanelHandler:()=>w,SidePanelPalette:()=>W,defaultNotebookPathOpener:()=>b});var s,n=i(17260),r=i(19928),a=i(75677),o=i(20389),d=i(70788),l=i(97934),h=i(42539),p=i(33625),g=i(20998),u=i(81997),c=i(31516),_=i(70397),m=i(49503);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new c.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new c.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),_.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new c.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){e?this._currentWidget&&this._currentWidget.id===e?(this.collapse(),this.hide()):(this.collapse(),this.hide(),this.activate(e),this.show()):this.currentWidget&&(this._currentWidget=this.currentWidget,this.activate(this._currentWidget.id),this.show())}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const y=new g.Token("@jupyter-notebook/application:INotebookShell");class k extends c.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new u.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._userLayout={},this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new c.Panel;const e=this._topWrapper=new c.Panel,t=this._menuWrapper=new c.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new c.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new c.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new c.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new c.BoxLayout({spacing:0,direction:"top-to-bottom"});c.BoxLayout.setStretch(this._topWrapper,0),c.BoxLayout.setStretch(this._menuWrapper,0),c.BoxLayout.setStretch(this._main,1);const a=new c.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const o=new c.SplitPanel;o.id="main-split-panel",o.spacing=1,c.BoxLayout.setStretch(o,1),c.SplitPanel.setStretch(s.panel,0),c.SplitPanel.setStretch(n.panel,0),c.SplitPanel.setStretch(a,1),o.addWidget(s.panel),o.addWidget(a),o.addWidget(n.panel),o.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(o),this.layout=i;const d=this._skipLinkWidgetHandler=new v.SkipLinkWidgetHandler(this);this.add(d.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}get userLayout(){return g.JSONExt.deepCopy(this._userLayout)}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s,n;let r;r=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(s=null==r?void 0:r.area)&&void 0!==s?s:t;const a=null!==(n=null==(i=i||(null==r?void 0:r.options)?{...i,...null==r?void 0:r.options}:void 0)?void 0:i.rank)&&void 0!==n?n:900;switch(t){case"top":return this._topHandler.addWidget(e,a);case"menu":return this._menuHandler.addWidget(e,a);case"main":case void 0:if(this._main.widgets.length>0)return;this._main.addWidget(e),this._main.update(),this._currentChanged.emit(void 0),this._mainWidgetLoaded.resolve();break;case"left":return this._leftHandler.addWidget(e,a);case"right":return this._rightHandler.addWidget(e,a);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}}var v,P;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new c.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(v||(v={}));class H extends n.JupyterFrontEnd{constructor(e={shell:new k}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new k}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new o.J(this),this.version=null!==(i=d.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._info=n.JupyterLab.defaultInfo,this._formatter=new l.Throttler((()=>{P.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);const s=Object.keys(n.JupyterLab.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...n.JupyterLab.defaultInfo,...s},this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get info(){return this._info}get paths(){return{urls:{base:d.PageConfig.getOption("baseUrl"),notFound:d.PageConfig.getOption("notFoundUrl"),app:d.PageConfig.getOption("appUrl"),static:d.PageConfig.getOption("staticUrl"),settings:d.PageConfig.getOption("settingsUrl"),themes:d.PageConfig.getOption("themesUrl"),doc:d.PageConfig.getOption("docUrl"),translations:d.PageConfig.getOption("translationsApiUrl"),hubHost:d.PageConfig.getOption("hubHost")||void 0,hubPrefix:d.PageConfig.getOption("hubPrefix")||void 0,hubUser:d.PageConfig.getOption("hubUser")||void 0,hubServerName:d.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:d.PageConfig.getOption("appSettingsDir"),schemas:d.PageConfig.getOption("schemasDir"),static:d.PageConfig.getOption("staticDir"),templates:d.PageConfig.getOption("templatesDir"),themes:d.PageConfig.getOption("themesDir"),userSettings:d.PageConfig.getOption("userSettingsDir"),serverRoot:d.PageConfig.getOption("serverRoot"),workspaces:d.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(P||(P={}));const b=new class{open(e){const{prefix:t,path:i,searchParams:s,target:n,features:r}=e,a=new URL(d.URLExt.join(t,null!=i?i:""),window.location.origin);return s&&(a.search=s.toString()),window.open(a,n,r)}},C=new g.Token("@jupyter-notebook/application:INotebookPathOpener")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[514],{45135:(e,t,i)=>{i.r(t),i.d(t,{INotebookPathOpener:()=>C,INotebookShell:()=>y,NotebookApp:()=>H,NotebookShell:()=>k,PanelHandler:()=>f,Private:()=>v,SidePanelHandler:()=>w,SidePanelPalette:()=>W,defaultNotebookPathOpener:()=>b});var s,n=i(17260),r=i(57526),a=i(75677),o=i(20389),d=i(70788),l=i(97934),h=i(42539),p=i(33625),g=i(20998),u=i(81997),c=i(31516),_=i(70397),m=i(49503);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new c.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new c.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),_.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new c.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){e?this._currentWidget&&this._currentWidget.id===e?(this.collapse(),this.hide()):(this.collapse(),this.hide(),this.activate(e),this.show()):this.currentWidget&&(this._currentWidget=this.currentWidget,this.activate(this._currentWidget.id),this.show())}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const y=new g.Token("@jupyter-notebook/application:INotebookShell");class k extends c.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new u.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._userLayout={},this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new c.Panel;const e=this._topWrapper=new c.Panel,t=this._menuWrapper=new c.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new c.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new c.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new c.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new c.BoxLayout({spacing:0,direction:"top-to-bottom"});c.BoxLayout.setStretch(this._topWrapper,0),c.BoxLayout.setStretch(this._menuWrapper,0),c.BoxLayout.setStretch(this._main,1);const a=new c.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const o=new c.SplitPanel;o.id="main-split-panel",o.spacing=1,c.BoxLayout.setStretch(o,1),c.SplitPanel.setStretch(s.panel,0),c.SplitPanel.setStretch(n.panel,0),c.SplitPanel.setStretch(a,1),o.addWidget(s.panel),o.addWidget(a),o.addWidget(n.panel),o.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(o),this.layout=i;const d=this._skipLinkWidgetHandler=new v.SkipLinkWidgetHandler(this);this.add(d.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}get userLayout(){return g.JSONExt.deepCopy(this._userLayout)}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s,n;let r;r=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(s=null==r?void 0:r.area)&&void 0!==s?s:t;const a=null!==(n=null==(i=i||(null==r?void 0:r.options)?{...i,...null==r?void 0:r.options}:void 0)?void 0:i.rank)&&void 0!==n?n:900;switch(t){case"top":return this._topHandler.addWidget(e,a);case"menu":return this._menuHandler.addWidget(e,a);case"main":case void 0:if(this._main.widgets.length>0)return;this._main.addWidget(e),this._main.update(),this._currentChanged.emit(void 0),this._mainWidgetLoaded.resolve();break;case"left":return this._leftHandler.addWidget(e,a);case"right":return this._rightHandler.addWidget(e,a);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}}var v,P;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new c.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(v||(v={}));class H extends n.JupyterFrontEnd{constructor(e={shell:new k}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new k}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new o.J(this),this.version=null!==(i=d.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._info=n.JupyterLab.defaultInfo,this._formatter=new l.Throttler((()=>{P.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);const s=Object.keys(n.JupyterLab.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...n.JupyterLab.defaultInfo,...s},this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get info(){return this._info}get paths(){return{urls:{base:d.PageConfig.getOption("baseUrl"),notFound:d.PageConfig.getOption("notFoundUrl"),app:d.PageConfig.getOption("appUrl"),static:d.PageConfig.getOption("staticUrl"),settings:d.PageConfig.getOption("settingsUrl"),themes:d.PageConfig.getOption("themesUrl"),doc:d.PageConfig.getOption("docUrl"),translations:d.PageConfig.getOption("translationsApiUrl"),hubHost:d.PageConfig.getOption("hubHost")||void 0,hubPrefix:d.PageConfig.getOption("hubPrefix")||void 0,hubUser:d.PageConfig.getOption("hubUser")||void 0,hubServerName:d.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:d.PageConfig.getOption("appSettingsDir"),schemas:d.PageConfig.getOption("schemasDir"),static:d.PageConfig.getOption("staticDir"),templates:d.PageConfig.getOption("templatesDir"),themes:d.PageConfig.getOption("themesDir"),userSettings:d.PageConfig.getOption("userSettingsDir"),serverRoot:d.PageConfig.getOption("serverRoot"),workspaces:d.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(P||(P={}));const b=new class{open(e){const{prefix:t,path:i,searchParams:s,target:n,features:r}=e,a=new URL(d.URLExt.join(t,null!=i?i:""),window.location.origin);return s&&(a.search=s.toString()),window.open(a,n,r)}},C=new g.Token("@jupyter-notebook/application:INotebookPathOpener")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5313,8060],{65313:(e,t,i)=>{i.r(t),i.d(t,{CSVDelimiter:()=>n.p,CSVDocumentWidget:()=>o.kw,CSVViewer:()=>o.A9,CSVViewerFactory:()=>o.LT,DSVModel:()=>r.DSVModel,GridSearchService:()=>o.JZ,TSVViewerFactory:()=>o._d,TextRenderConfig:()=>o.B0,parseDSV:()=>s.G,parseDSVNoQuotes:()=>s.z});var r=i(18032),s=i(48234),n=i(40930),o=i(21058)},40930:(e,t,i)=>{i.d(t,{p:()=>a});var r,s=i(42539),n=i(70397),o=i(31516);class a extends o.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const i=null==(t=t||s.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",i.__("tab")],["|",i.__("pipe")],["#",i.__("hash")]],o=document.createElement("div"),a=document.createElement("span"),d=document.createElement("select");a.textContent=i.__("Delimiter: "),a.className="jp-CSVDelimiter-label";for(const[t,i]of r){const r=document.createElement("option");r.value=t,r.textContent=i,t===e&&(r.selected=!0),d.appendChild(r)}o.appendChild(a);const l=n.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),o.appendChild(l),o}}(r||(r={}))},21058:(e,t,i)=>{i.d(t,{A9:()=>u,B0:()=>h,JZ:()=>c,LT:()=>g,_d:()=>m,kw:()=>_});var r,s=i(70788),n=i(19928),o=i(20998),a=i(81997),d=i(31516),l=i(40930);class h{}class c{constructor(e){this._looping=!0,this._changed=new a.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:i,column:r})=>this._query&&t.match(this._query)?this._row===i&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const i=this._grid.dataModel,r=i.rowCount("body"),s=i.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const n=this._grid.scrollY/this._grid.defaultSizes.rowHeight,o=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,a=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=n&&e<=o&&t>=a&&t<=d,h=t?-1:1;this._column+=h;for(let n=this._row;t?n>=0:n<r;n+=h){for(let r=this._column;t?r>=0:r<s;r+=h)if(i.data("body",n,r).match(e))return this._changed.emit(void 0),l(n,r)||this._grid.scrollToRow(n),this._row=n,this._column=r,!0;this._column=t?s-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,i=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=i-1,this._column=r):!e&&this._row>=i-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new o.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:i,DataGrid:n}=await r.ensureDataGrid();this._defaultStyle=n.defaultStyle,this._grid=new n({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new i,this._grid.copyConfig={separator:"\t",format:n.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new c(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new s.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),i=this._context.model.toString(),s=this._delimiter,n=this._grid.dataModel,o=this._grid.dataModel=new t({data:i,delimiter:s});this._grid.selectionModel=new e({dataModel:o}),n&&n.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,i=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:i,"column-header":i,"corner-header":i,"row-header":i})}}class _ extends n.DocumentWidget{constructor(e){let{content:t,context:i,delimiter:s,reveal:n,...o}=e;t=t||r.createContent(i),n=Promise.all([n,t.revealed]),super({content:t,context:i,reveal:n,...o}),s&&(t.delimiter=s)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let i=t[1].split(";")[0];i=i.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(i))}))}}class g extends n.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new _({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends g{createNewWidget(e){return new _({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new o.PromiseDelegate,t.resolve(await i.e(5585).then(i.t.bind(i,95585,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new o.PromiseDelegate,r.resolve(await Promise.all([i.e(8032),i.e(5585)]).then(i.bind(i,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5313,8060],{65313:(e,t,i)=>{i.r(t),i.d(t,{CSVDelimiter:()=>n.p,CSVDocumentWidget:()=>o.kw,CSVViewer:()=>o.A9,CSVViewerFactory:()=>o.LT,DSVModel:()=>r.DSVModel,GridSearchService:()=>o.JZ,TSVViewerFactory:()=>o._d,TextRenderConfig:()=>o.B0,parseDSV:()=>s.G,parseDSVNoQuotes:()=>s.z});var r=i(18032),s=i(48234),n=i(40930),o=i(21058)},40930:(e,t,i)=>{i.d(t,{p:()=>a});var r,s=i(42539),n=i(70397),o=i(31516);class a extends o.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const i=null==(t=t||s.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",i.__("tab")],["|",i.__("pipe")],["#",i.__("hash")]],o=document.createElement("div"),a=document.createElement("span"),d=document.createElement("select");a.textContent=i.__("Delimiter: "),a.className="jp-CSVDelimiter-label";for(const[t,i]of r){const r=document.createElement("option");r.value=t,r.textContent=i,t===e&&(r.selected=!0),d.appendChild(r)}o.appendChild(a);const l=n.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),o.appendChild(l),o}}(r||(r={}))},21058:(e,t,i)=>{i.d(t,{A9:()=>u,B0:()=>h,JZ:()=>c,LT:()=>g,_d:()=>m,kw:()=>_});var r,s=i(70788),n=i(57526),o=i(20998),a=i(81997),d=i(31516),l=i(40930);class h{}class c{constructor(e){this._looping=!0,this._changed=new a.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:i,column:r})=>this._query&&t.match(this._query)?this._row===i&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const i=this._grid.dataModel,r=i.rowCount("body"),s=i.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const n=this._grid.scrollY/this._grid.defaultSizes.rowHeight,o=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,a=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=n&&e<=o&&t>=a&&t<=d,h=t?-1:1;this._column+=h;for(let n=this._row;t?n>=0:n<r;n+=h){for(let r=this._column;t?r>=0:r<s;r+=h)if(i.data("body",n,r).match(e))return this._changed.emit(void 0),l(n,r)||this._grid.scrollToRow(n),this._row=n,this._column=r,!0;this._column=t?s-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,i=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=i-1,this._column=r):!e&&this._row>=i-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new o.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:i,DataGrid:n}=await r.ensureDataGrid();this._defaultStyle=n.defaultStyle,this._grid=new n({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new i,this._grid.copyConfig={separator:"\t",format:n.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new c(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new s.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),i=this._context.model.toString(),s=this._delimiter,n=this._grid.dataModel,o=this._grid.dataModel=new t({data:i,delimiter:s});this._grid.selectionModel=new e({dataModel:o}),n&&n.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,i=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:i,"column-header":i,"corner-header":i,"row-header":i})}}class _ extends n.DocumentWidget{constructor(e){let{content:t,context:i,delimiter:s,reveal:n,...o}=e;t=t||r.createContent(i),n=Promise.all([n,t.revealed]),super({content:t,context:i,reveal:n,...o}),s&&(t.delimiter=s)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let i=t[1].split(";")[0];i=i.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(i))}))}}class g extends n.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new _({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends g{createNewWidget(e){return new _({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new o.PromiseDelegate,t.resolve(await i.e(5585).then(i.t.bind(i,95585,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new o.PromiseDelegate,r.resolve(await Promise.all([i.e(8032),i.e(5585)]).then(i.bind(i,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5325,377],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(20998).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(70788),i=n(19928),l=n(42539),u=n(70397),c=n(81997),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"]})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5325,377],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(20998).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(70788),i=n(57526),l=n(42539),u=n(70397),c=n(81997),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"]})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5573],{5573:(e,o,t)=>{t.r(o),t.d(o,{default:()=>A});var n=t(98244),a=t(70788),s=t(91919),r=t(59012),c=t(87718),i=t(80864),d=t(42539),l=t(83195),u=t(97934),k=t(31516),b=t(78156),p=t.n(b);const g=e=>{const o=e.model;if(!o)return!1;const t=Array.from(o.cells);let n=0,a=0;for(const e of t)"code"===e.type&&(n++,e.trusted&&a++);return a===n},h=({notebook:e,translator:o})=>{const t=o.load("notebook"),[n,a]=(0,b.useState)(g(e)),s=()=>{const o=g(e);a(o)};return(0,b.useEffect)((()=>(e.modelContentChanged.connect(s),e.activeCellChanged.connect(s),s(),()=>{e.modelContentChanged.disconnect(s),e.activeCellChanged.disconnect(s)}))),p().createElement("button",{className:"jp-NotebookTrustedStatus",style:n?{cursor:"help"}:{cursor:"pointer"},onClick:()=>!n&&(async()=>{await c.NotebookActions.trust(e,o),s()})(),title:n?t.__("JavaScript enabled for notebook display"):t.__("JavaScript disabled for notebook display")},n?t.__("Trusted"):t.__("Not Trusted"))};var m;!function(e){e.create=({notebook:e,translator:o})=>n.ReactWidget.create(p().createElement(h,{notebook:e,translator:o}))}(m||(m={}));const C="jp-NotebookKernelStatus-error",f="jp-NotebookKernelStatus-warn",y="jp-NotebookKernelStatus-info",v="jp-NotebookKernelStatus-fade";var N;!function(e){e.openEditNotebookMetadata="notebook:edit-metadata"}(N||(N={}));const S={id:"@jupyter-notebook/notebook-extension:checkpoints",description:"A plugin for the checkpoint indicator.",autoStart:!0,requires:[s.IDocumentManager,d.ITranslator],optional:[l.INotebookShell,n.IToolbarWidgetRegistry],activate:(e,o,t,s,r)=>{const{shell:c}=e,i=t.load("notebook"),d=document.createElement("div");r&&r.addFactory("TopBar","checkpoint",(e=>{const o=new k.Widget({node:d});return o.id=n.DOMUtils.createDomID(),o.addClass("jp-NotebookCheckpoint"),o}));const l=async()=>{const e=c.currentWidget;if(!e)return;const t=o.contextForWidget(e);null==t||t.fileChanged.disconnect(l),null==t||t.fileChanged.connect(l);const n=await(null==t?void 0:t.listCheckpoints());if(!n)return;const s=n[n.length-1];d.textContent=i.__("Last Checkpoint: %1",a.Time.formatHuman(new Date(s.last_modified)))};s&&s.currentChanged.connect(l),new u.Poll({auto:!0,factory:()=>l(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},w={id:"@jupyter-notebook/notebook-extension:close-tab",description:'Add a command to close the browser tab when clicking on "Close and Shut Down".',autoStart:!0,requires:[r.IMainMenu],optional:[d.ITranslator],activate:(e,o,t)=>{const{commands:n}=e,a=(t=null!=t?t:d.nullTranslator).load("notebook"),s="notebook:close-and-halt";n.addCommand(s,{label:a.__("Close and Shut Down Notebook"),execute:async()=>{await n.execute("notebook:close-and-shutdown"),window.close()}}),o.fileMenu.closeAndCleaners.add({id:s,rank:0})}},T={id:"@jupyter-notebook/notebook-extension:kernel-logo",description:"The kernel logo plugin.",autoStart:!0,requires:[l.INotebookShell],optional:[n.IToolbarWidgetRegistry],activate:(e,o,t)=>{const{serviceManager:n}=e,a=document.createElement("div"),s=document.createElement("img"),r=async()=>{var e,t,i,d,l;const u=o.currentWidget;if(!(u instanceof c.NotebookPanel))return;a.hasChildNodes()||a.appendChild(s),await u.sessionContext.ready,u.sessionContext.kernelChanged.disconnect(r),u.sessionContext.kernelChanged.connect(r);const k=null!==(i=null===(t=null===(e=u.sessionContext.session)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==i?i:"",b=null===(l=null===(d=n.kernelspecs)||void 0===d?void 0:d.specs)||void 0===l?void 0:l.kernelspecs[k];if(!b)return void a.childNodes[0].remove();const p=b.resources["logo-64x64"];p?(s.src=p,s.title=b.display_name):a.childNodes[0].remove()};t&&t.addFactory("TopBar","kernelLogo",(e=>{const o=new k.Widget({node:a});return o.addClass("jp-NotebookKernelLogo"),o})),e.started.then((()=>{o.currentChanged.connect(r)}))}},x={id:"@jupyter-notebook/notebook-extension:kernel-status",description:"A plugin to display the kernel status.",autoStart:!0,requires:[l.INotebookShell,d.ITranslator],activate:(e,o,t)=>{const n=t.load("notebook"),s=new k.Widget;s.addClass("jp-NotebookKernelStatus"),e.shell.add(s,"menu",{rank:10010});const r=e=>{const o=e.kernelDisplayStatus;let t=`Kernel ${a.Text.titleCase(o)}`;switch(s.removeClass(C),s.removeClass(f),s.removeClass(y),s.removeClass(v),o){case"busy":case"idle":t="",s.addClass(v);break;case"dead":case"terminating":s.addClass(C);break;case"unknown":s.addClass(f);break;default:s.addClass(y),s.addClass(v)}s.node.textContent=n.__(t)};o.currentChanged.connect((async()=>{const e=o.currentWidget;e instanceof c.NotebookPanel&&e.sessionContext.statusChanged.connect(r)}))}},_={id:"@jupyter-notebook/notebook-extension:scroll-output",description:"A plugin to enable scrolling for outputs by default.",autoStart:!0,requires:[c.INotebookTracker],optional:[i.ISettingRegistry],activate:async(e,o,t)=>{let n=!0;const a=e=>{if(!n)return;const{outputArea:o}=e;if(void 0!==e.model.getMetadata("scrolled"))return;const{node:t}=o,a=t.scrollHeight>1.3*(parseFloat(t.style.fontSize.replace("px",""))||14)*100;e.toggleClass("jp-mod-outputsScrolled",a)},s={},r=e=>{if("code"===e.model.type){const o=e,t=o.model.id;a(o),s[t]&&o.outputArea.model.changed.disconnect(s[t]),s[t]=()=>a(o),o.outputArea.model.changed.connect(s[t])}};if(o.widgetAdded.connect(((e,o)=>{var t;o.sessionContext.ready.then((()=>{o.content.widgets.forEach(r)})),null===(t=o.model)||void 0===t||t.cells.changed.connect(((e,t)=>{o.content.widgets.forEach(r)}))})),t){const o=t.load(_.id),a=e=>{n=e.get("autoScrollOutputs").composite};Promise.all([o,e.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}}},I={id:"@jupyter-notebook/notebook-extension:notebook-tools",description:"A plugin to add the NotebookTools to the side panel.",autoStart:!0,requires:[l.INotebookShell],optional:[c.INotebookTools],activate:(e,o,t)=>{o.currentChanged.connect((async()=>{o.currentWidget instanceof c.NotebookPanel&&t&&o.add(t,"right",{type:"Property Inspector"})}))}},E={id:"@jupyter-notebook/notebook-extension:tab-icon",description:"A plugin to update the tab icon based on the kernel status.",autoStart:!0,requires:[c.INotebookTracker],activate:(e,o)=>{const t=a.PageConfig.getBaseUrl(),n=a.URLExt.join(t,"static/favicons/favicon-notebook.ico"),s=a.URLExt.join(t,"static/favicons/favicon-busy-1.ico");o.currentChanged.connect((async()=>{const e=o.currentWidget,t=null==e?void 0:e.sessionContext;t&&t.statusChanged.connect((()=>{(e=>{const o=document.querySelector("link[rel*='icon']");switch(e){case"busy":o.href=s;break;case"idle":o.href=n}})(t.kernelDisplayStatus)}))}))}},j={id:"@jupyter-notebook/notebook-extension:trusted",description:"A plugin that adds a Trusted indicator to the menu area.",autoStart:!0,requires:[l.INotebookShell,d.ITranslator],activate:(e,o,t)=>{o.currentChanged.connect((async()=>{const e=o.currentWidget;if(!(e instanceof c.NotebookPanel))return;const n=e.content;await e.context.ready;const a=m.create({notebook:n,translator:t});o.add(a,"menu",{rank:11e3})}))}},A=[S,w,{id:"@jupyter-notebook/notebook-extension:edit-notebook-metadata",description:'Add a command to open right sidebar for Editing Notebook Metadata when clicking on "Edit Notebook Metadata" under Edit menu',autoStart:!0,optional:[n.ICommandPalette,d.ITranslator,c.INotebookTools],activate:(e,o,t,n)=>{const{commands:a}=e,s=(t=null!=t?t:d.nullTranslator).load("notebook");a.addCommand(N.openEditNotebookMetadata,{label:s.__("Edit Notebook Metadata"),execute:async()=>{const e="application:toggle-panel",o={side:"right",title:"Show Notebook Tools",id:"notebook-tools"};a.isToggled(e,o)||await a.execute(e,o).then((e=>{n&&(null==n?void 0:n.layout).widgets.forEach((e=>{e.widget.title.label===s.__("Advanced Tools")&&e.collapsed&&e.toggle()}))}))}}),o&&o.addItem({command:N.openEditNotebookMetadata,category:"Notebook Operations"})}},T,x,I,_,E,j]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5573],{5573:(e,o,t)=>{t.r(o),t.d(o,{default:()=>A});var n=t(98244),a=t(70788),s=t(91919),r=t(59012),c=t(87718),i=t(80864),d=t(42539),l=t(30679),u=t(97934),k=t(31516),b=t(78156),p=t.n(b);const g=e=>{const o=e.model;if(!o)return!1;const t=Array.from(o.cells);let n=0,a=0;for(const e of t)"code"===e.type&&(n++,e.trusted&&a++);return a===n},h=({notebook:e,translator:o})=>{const t=o.load("notebook"),[n,a]=(0,b.useState)(g(e)),s=()=>{const o=g(e);a(o)};return(0,b.useEffect)((()=>(e.modelContentChanged.connect(s),e.activeCellChanged.connect(s),s(),()=>{e.modelContentChanged.disconnect(s),e.activeCellChanged.disconnect(s)}))),p().createElement("button",{className:"jp-NotebookTrustedStatus",style:n?{cursor:"help"}:{cursor:"pointer"},onClick:()=>!n&&(async()=>{await c.NotebookActions.trust(e,o),s()})(),title:n?t.__("JavaScript enabled for notebook display"):t.__("JavaScript disabled for notebook display")},n?t.__("Trusted"):t.__("Not Trusted"))};var m;!function(e){e.create=({notebook:e,translator:o})=>n.ReactWidget.create(p().createElement(h,{notebook:e,translator:o}))}(m||(m={}));const C="jp-NotebookKernelStatus-error",f="jp-NotebookKernelStatus-warn",y="jp-NotebookKernelStatus-info",v="jp-NotebookKernelStatus-fade";var N;!function(e){e.openEditNotebookMetadata="notebook:edit-metadata"}(N||(N={}));const S={id:"@jupyter-notebook/notebook-extension:checkpoints",description:"A plugin for the checkpoint indicator.",autoStart:!0,requires:[s.IDocumentManager,d.ITranslator],optional:[l.INotebookShell,n.IToolbarWidgetRegistry],activate:(e,o,t,s,r)=>{const{shell:c}=e,i=t.load("notebook"),d=document.createElement("div");r&&r.addFactory("TopBar","checkpoint",(e=>{const o=new k.Widget({node:d});return o.id=n.DOMUtils.createDomID(),o.addClass("jp-NotebookCheckpoint"),o}));const l=async()=>{const e=c.currentWidget;if(!e)return;const t=o.contextForWidget(e);null==t||t.fileChanged.disconnect(l),null==t||t.fileChanged.connect(l);const n=await(null==t?void 0:t.listCheckpoints());if(!n)return;const s=n[n.length-1];d.textContent=i.__("Last Checkpoint: %1",a.Time.formatHuman(new Date(s.last_modified)))};s&&s.currentChanged.connect(l),new u.Poll({auto:!0,factory:()=>l(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},w={id:"@jupyter-notebook/notebook-extension:close-tab",description:'Add a command to close the browser tab when clicking on "Close and Shut Down".',autoStart:!0,requires:[r.IMainMenu],optional:[d.ITranslator],activate:(e,o,t)=>{const{commands:n}=e,a=(t=null!=t?t:d.nullTranslator).load("notebook"),s="notebook:close-and-halt";n.addCommand(s,{label:a.__("Close and Shut Down Notebook"),execute:async()=>{await n.execute("notebook:close-and-shutdown"),window.close()}}),o.fileMenu.closeAndCleaners.add({id:s,rank:0})}},T={id:"@jupyter-notebook/notebook-extension:kernel-logo",description:"The kernel logo plugin.",autoStart:!0,requires:[l.INotebookShell],optional:[n.IToolbarWidgetRegistry],activate:(e,o,t)=>{const{serviceManager:n}=e,a=document.createElement("div"),s=document.createElement("img"),r=async()=>{var e,t,i,d,l;const u=o.currentWidget;if(!(u instanceof c.NotebookPanel))return;a.hasChildNodes()||a.appendChild(s),await u.sessionContext.ready,u.sessionContext.kernelChanged.disconnect(r),u.sessionContext.kernelChanged.connect(r);const k=null!==(i=null===(t=null===(e=u.sessionContext.session)||void 0===e?void 0:e.kernel)||void 0===t?void 0:t.name)&&void 0!==i?i:"",b=null===(l=null===(d=n.kernelspecs)||void 0===d?void 0:d.specs)||void 0===l?void 0:l.kernelspecs[k];if(!b)return void a.childNodes[0].remove();const p=b.resources["logo-64x64"];p?(s.src=p,s.title=b.display_name):a.childNodes[0].remove()};t&&t.addFactory("TopBar","kernelLogo",(e=>{const o=new k.Widget({node:a});return o.addClass("jp-NotebookKernelLogo"),o})),e.started.then((()=>{o.currentChanged.connect(r)}))}},x={id:"@jupyter-notebook/notebook-extension:kernel-status",description:"A plugin to display the kernel status.",autoStart:!0,requires:[l.INotebookShell,d.ITranslator],activate:(e,o,t)=>{const n=t.load("notebook"),s=new k.Widget;s.addClass("jp-NotebookKernelStatus"),e.shell.add(s,"menu",{rank:10010});const r=e=>{const o=e.kernelDisplayStatus;let t=`Kernel ${a.Text.titleCase(o)}`;switch(s.removeClass(C),s.removeClass(f),s.removeClass(y),s.removeClass(v),o){case"busy":case"idle":t="",s.addClass(v);break;case"dead":case"terminating":s.addClass(C);break;case"unknown":s.addClass(f);break;default:s.addClass(y),s.addClass(v)}s.node.textContent=n.__(t)};o.currentChanged.connect((async()=>{const e=o.currentWidget;e instanceof c.NotebookPanel&&e.sessionContext.statusChanged.connect(r)}))}},_={id:"@jupyter-notebook/notebook-extension:scroll-output",description:"A plugin to enable scrolling for outputs by default.",autoStart:!0,requires:[c.INotebookTracker],optional:[i.ISettingRegistry],activate:async(e,o,t)=>{let n=!0;const a=e=>{if(!n)return;const{outputArea:o}=e;if(void 0!==e.model.getMetadata("scrolled"))return;const{node:t}=o,a=t.scrollHeight>1.3*(parseFloat(t.style.fontSize.replace("px",""))||14)*100;e.toggleClass("jp-mod-outputsScrolled",a)},s={},r=e=>{if("code"===e.model.type){const o=e,t=o.model.id;a(o),s[t]&&o.outputArea.model.changed.disconnect(s[t]),s[t]=()=>a(o),o.outputArea.model.changed.connect(s[t])}};if(o.widgetAdded.connect(((e,o)=>{var t;o.sessionContext.ready.then((()=>{o.content.widgets.forEach(r)})),null===(t=o.model)||void 0===t||t.cells.changed.connect(((e,t)=>{o.content.widgets.forEach(r)}))})),t){const o=t.load(_.id),a=e=>{n=e.get("autoScrollOutputs").composite};Promise.all([o,e.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}}},I={id:"@jupyter-notebook/notebook-extension:notebook-tools",description:"A plugin to add the NotebookTools to the side panel.",autoStart:!0,requires:[l.INotebookShell],optional:[c.INotebookTools],activate:(e,o,t)=>{o.currentChanged.connect((async()=>{o.currentWidget instanceof c.NotebookPanel&&t&&o.add(t,"right",{type:"Property Inspector"})}))}},E={id:"@jupyter-notebook/notebook-extension:tab-icon",description:"A plugin to update the tab icon based on the kernel status.",autoStart:!0,requires:[c.INotebookTracker],activate:(e,o)=>{const t=a.PageConfig.getBaseUrl(),n=a.URLExt.join(t,"static/favicons/favicon-notebook.ico"),s=a.URLExt.join(t,"static/favicons/favicon-busy-1.ico");o.currentChanged.connect((async()=>{const e=o.currentWidget,t=null==e?void 0:e.sessionContext;t&&t.statusChanged.connect((()=>{(e=>{const o=document.querySelector("link[rel*='icon']");switch(e){case"busy":o.href=s;break;case"idle":o.href=n}})(t.kernelDisplayStatus)}))}))}},j={id:"@jupyter-notebook/notebook-extension:trusted",description:"A plugin that adds a Trusted indicator to the menu area.",autoStart:!0,requires:[l.INotebookShell,d.ITranslator],activate:(e,o,t)=>{o.currentChanged.connect((async()=>{const e=o.currentWidget;if(!(e instanceof c.NotebookPanel))return;const n=e.content;await e.context.ready;const a=m.create({notebook:n,translator:t});o.add(a,"menu",{rank:11e3})}))}},A=[S,w,{id:"@jupyter-notebook/notebook-extension:edit-notebook-metadata",description:'Add a command to open right sidebar for Editing Notebook Metadata when clicking on "Edit Notebook Metadata" under Edit menu',autoStart:!0,optional:[n.ICommandPalette,d.ITranslator,c.INotebookTools],activate:(e,o,t,n)=>{const{commands:a}=e,s=(t=null!=t?t:d.nullTranslator).load("notebook");a.addCommand(N.openEditNotebookMetadata,{label:s.__("Edit Notebook Metadata"),execute:async()=>{const e="application:toggle-panel",o={side:"right",title:"Show Notebook Tools",id:"notebook-tools"};a.isToggled(e,o)||await a.execute(e,o).then((e=>{n&&(null==n?void 0:n.layout).widgets.forEach((e=>{e.widget.title.label===s.__("Advanced Tools")&&e.collapsed&&e.toggle()}))}))}}),o&&o.addItem({command:N.openEditNotebookMetadata,category:"Notebook Operations"})}},T,x,I,_,E,j]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5601,1684],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(17260),o=n(70788),i=n(38847),r=n(83195),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5601,1684],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(17260),o=n(70788),i=n(38847),r=n(30679),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);