notebook 7.0.5__py3-none-any.whl → 7.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of notebook might be problematic. Click here for more details.
- notebook/_version.py +1 -1
- notebook/app.py +7 -4
- notebook/static/1018.bundle.js +1 -1
- notebook/static/1053.bundle.js +1 -1
- notebook/static/1198.bundle.js +1 -1
- notebook/static/1337.bundle.js +1 -1
- notebook/static/134.bundle.js +1 -1
- notebook/static/1408.bundle.js +1 -1
- notebook/static/1647.bundle.js +1 -1
- notebook/static/1650.bundle.js +1 -1
- notebook/static/1682.bundle.js +1 -1
- notebook/static/1684.bundle.js +1 -1
- notebook/static/1696.bundle.js +1 -1
- notebook/static/1809.bundle.js +1 -1
- notebook/static/1827.bundle.js +1 -1
- notebook/static/1833.bundle.js +1 -1
- notebook/static/1835.bundle.js +1 -1
- notebook/static/1950.bundle.js +1 -1
- notebook/static/1958.bundle.js +1 -1
- notebook/static/2007.bundle.js +1 -1
- notebook/static/2053.bundle.js +1 -0
- notebook/static/2067.bundle.js +1 -1
- notebook/static/2088.bundle.js +1 -1
- notebook/static/2089.bundle.js +1 -1
- notebook/static/2122.bundle.js +1 -1
- notebook/static/2167.bundle.js +1 -1
- notebook/static/2184.bundle.js +1 -1
- notebook/static/2311.bundle.js +1 -1
- notebook/static/2401.bundle.js +1 -1
- notebook/static/2479.bundle.js +1 -1
- notebook/static/2512.bundle.js +1 -1
- notebook/static/2607.bundle.js +1 -1
- notebook/static/2924.bundle.js +1 -1
- notebook/static/3146.bundle.js +1 -1
- notebook/static/3213.bundle.js +1 -1
- notebook/static/3340.bundle.js +1 -1
- notebook/static/3360.bundle.js +1 -1
- notebook/static/3466.bundle.js +1 -1
- notebook/static/35.bundle.js +1 -1
- notebook/static/3676.bundle.js +1 -1
- notebook/static/3680.bundle.js +1 -1
- notebook/static/3768.bundle.js +1 -1
- notebook/static/377.bundle.js +1 -1
- notebook/static/3863.bundle.js +1 -1
- notebook/static/3881.bundle.js +1 -1
- notebook/static/{6621.bundle.js → 3911.bundle.js} +1 -1
- notebook/static/4042.bundle.js +1 -1
- notebook/static/4131.bundle.js +1 -1
- notebook/static/4212.bundle.js +1 -1
- notebook/static/4234.bundle.js +1 -1
- notebook/static/4291.bundle.js +1 -1
- notebook/static/4382.bundle.js +1 -1
- notebook/static/4558.bundle.js +1 -1
- notebook/static/4588.bundle.js +1 -1
- notebook/static/4645.bundle.js +1 -1
- notebook/static/4811.bundle.js +1 -1
- notebook/static/4837.bundle.js +1 -1
- notebook/static/5088.bundle.js +1 -1
- notebook/static/5099.bundle.js +1 -1
- notebook/static/5125.bundle.js +1 -1
- notebook/static/5135.bundle.js +1 -1
- notebook/static/514.bundle.js +1 -1
- notebook/static/5313.bundle.js +1 -1
- notebook/static/5325.bundle.js +1 -1
- notebook/static/5346.bundle.js +1 -1
- notebook/static/5426.bundle.js +1 -1
- notebook/static/5573.bundle.js +1 -1
- notebook/static/5601.bundle.js +1 -1
- notebook/static/5678.bundle.js +1 -1
- notebook/static/5733.bundle.js +1 -1
- notebook/static/5912.bundle.js +1 -1
- notebook/static/5921.bundle.js +1 -1
- notebook/static/6017.bundle.js +1 -1
- notebook/static/6027.bundle.js +1 -1
- notebook/static/6139.bundle.js +1 -1
- notebook/static/62.bundle.js +1 -1
- notebook/static/6256.bundle.js +1 -1
- notebook/static/6345.bundle.js +1 -1
- notebook/static/6604.bundle.js +1 -1
- notebook/static/6627.bundle.js +1 -1
- notebook/static/6815.bundle.js +1 -1
- notebook/static/6853.bundle.js +1 -1
- notebook/static/6893.bundle.js +1 -1
- notebook/static/690.bundle.js +1 -1
- notebook/static/6962.bundle.js +1 -1
- notebook/static/6999.bundle.js +1 -1
- notebook/static/7226.bundle.js +1 -1
- notebook/static/7252.bundle.js +1 -1
- notebook/static/7302.bundle.js +1 -1
- notebook/static/7369.bundle.js +1 -1
- notebook/static/7386.bundle.js +1 -1
- notebook/static/7391.bundle.js +1 -1
- notebook/static/7394.bundle.js +1 -1
- notebook/static/7427.bundle.js +1 -1
- notebook/static/7603.bundle.js +1 -1
- notebook/static/7639.bundle.js +1 -1
- notebook/static/7684.bundle.js +1 -1
- notebook/static/7819.bundle.js +1 -1
- notebook/static/7900.bundle.js +1 -1
- notebook/static/7906.bundle.js +1 -1
- notebook/static/8579.bundle.js +1 -1
- notebook/static/8633.bundle.js +1 -1
- notebook/static/8771.bundle.js +1 -1
- notebook/static/8781.bundle.js +1 -0
- notebook/static/8875.bundle.js +1 -1
- notebook/static/8907.bundle.js +1 -1
- notebook/static/8928.bundle.js +1 -1
- notebook/static/8929.bundle.js +1 -1
- notebook/static/893.bundle.js +1 -1
- notebook/static/901.bundle.js +1 -1
- notebook/static/9068.bundle.js +1 -1
- notebook/static/9086.bundle.js +1 -1
- notebook/static/911.bundle.js +1 -1
- notebook/static/9151.bundle.js +1 -1
- notebook/static/9268.bundle.js +1 -1
- notebook/static/9335.bundle.js +1 -1
- notebook/static/9341.bundle.js +1 -1
- notebook/static/9380.bundle.js +1 -1
- notebook/static/9577.bundle.js +1 -0
- notebook/static/9605.bundle.js +1 -1
- notebook/static/9609.bundle.js +1 -1
- notebook/static/9638.bundle.js +1 -1
- notebook/static/9670.bundle.js +1 -0
- notebook/static/9680.bundle.js +1 -1
- notebook/static/9685.bundle.js +1 -1
- notebook/static/9752.bundle.js +1 -1
- notebook/static/9799.bundle.js +1 -1
- notebook/static/9852.bundle.js +1 -1
- notebook/static/bundle.js +1 -1
- notebook/static/third-party-licenses.json +98 -98
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
- notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/34.19d4610ec716fa511ef4.js +1 -0
- notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1160e2de23274a7c0e28.js +1 -0
- notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.de56d0eb47577cb652f3.js +1 -0
- notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eddcbb0f5a946c74796b.js +1 -0
- notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.f2d2e79c8a92fd2ec840.js +1 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +4 -4
- {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/METADATA +3 -2
- {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/RECORD +166 -164
- {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/WHEEL +1 -1
- notebook/static/6774.bundle.js +0 -1
- notebook/static/880.bundle.js +0 -1
- notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.cf0b00aa9baf659e6dc7.js +0 -1
- notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -1
- notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/922.0beff4620746e288bd5e.js +0 -1
- notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.79046a2eb17bde1af38c.js +0 -1
- notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.58182cbb5c785b66277a.js +0 -1
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/applications/jupyter-notebook.desktop +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
- {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
- {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/entry_points.txt +0 -0
- {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/licenses/LICENSE +0 -0
notebook/static/1835.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1835],{11835:(e,t,n)=>{n.r(t),n.d(t,{ToolbarItems:()=>F,default:()=>W,downloadPlugin:()=>D,openBrowserTabPlugin:()=>k,pathStatusPlugin:()=>x,savingStatusPlugin:()=>C});var o,a=n(86883),r=n(56165),i=n(85421),l=n(89488),d=n(20457),s=n(67993),c=n(49255),u=n(59361),m=n(33625),g=n(20998),p=n(81997),h=n(9267),v=n(78156);!function(e){e.clone="docmanager:clone",e.deleteFile="docmanager:delete-file",e.newUntitled="docmanager:new-untitled",e.open="docmanager:open",e.openBrowserTab="docmanager:open-browser-tab",e.reload="docmanager:reload",e.rename="docmanager:rename",e.del="docmanager:delete",e.duplicate="docmanager:duplicate",e.restoreCheckpoint="docmanager:restore-checkpoint",e.save="docmanager:save",e.saveAll="docmanager:save-all",e.saveAs="docmanager:save-as",e.download="docmanager:download",e.toggleAutosave="docmanager:toggle-autosave",e.showInFileBrowser="docmanager:show-in-file-browser"}(o||(o={}));const f="@jupyterlab/docmanager-extension:plugin",w={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:l.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){e.id||(e.id="document-manager-"+ ++S.id),e.title.dataset={type:"document-title",...e.title.dataset},e.isAttached||t.add(e,"main",n||{}),t.activateById(e.id),this._opened.emit(e)}get opened(){return this._opened}}}},_={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener],optional:[a.ILabStatus],activate:(e,t,n,o)=>{const a=new WeakSet;n.opened.connect(((e,n)=>{const r=t.contextForWidget(n);r&&!a.has(r)&&(o&&function(e,t){let n=null;const o=(t,o)=>{"dirty"===o.name&&(!0===o.newValue?n||(n=e.setDirty()):n&&(n.dispose(),n=null))};t.ready.then((()=>{t.model.stateChanged.connect(o),t.model.dirty&&(n=e.setDirty())})),t.disposed.connect((()=>{n&&n.dispose()}))}(o,r),a.add(r))}))}},b={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:l.IDocumentManager,requires:[l.IDocumentWidgetOpener],optional:[c.ITranslator,a.ILabStatus,r.ISessionContextDialogs,a.JupyterLab.IInfo],activate:(e,t,n,o,a,i)=>{var d;const{serviceManager:s,docRegistry:u}=e,m=null!=n?n:c.nullTranslator,g=null!=a?a:new r.SessionContextDialogs({translator:m}),p=e.restored.then((()=>{}));return new l.DocumentManager({registry:u,manager:s,opener:t,when:p,setBusy:null!==(d=o&&(()=>o.setBusy()))&&void 0!==d?d:void 0,sessionDialogs:g,translator:null!=m?m:c.nullTranslator,isConnectedCallback:()=>!i||i.isConnected})}},y={id:f,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener,d.ISettingRegistry],optional:[c.ITranslator,r.ICommandPalette,a.ILabShell],activate:(e,t,n,a,d,s,p)=>{const h=(d=null!=d?d:c.nullTranslator).load("jupyterlab"),v=e.docRegistry;!function(e,t,n,a,d,s,c){const g=d.load("jupyterlab"),{commands:p,shell:h}=e,v=g.__("File Operations"),w=()=>{const{currentWidget:e}=h;return!(!e||!t.contextForWidget(e))};s&&function(e,t,n,a,i){const d=i.load("jupyterlab"),{commands:s}=e,c=()=>{var o;const a=/[Pp]ath:\s?(.*)\n?/,r=e.contextMenuHitTest((e=>{var t;return!!(null===(t=e.title)||void 0===t?void 0:t.match(a))})),i=null==r?void 0:r.title.match(a);return null!==(o=i&&t.findWidget(i[1],null))&&void 0!==o?o:n.currentWidget},u=()=>{const{currentWidget:e}=n;return!(!e||!t.contextForWidget(e))};s.addCommand(o.clone,{label:()=>d.__("New View for %1",T(c(),t)),isEnabled:u,execute:e=>{const n=c(),o=e.options||{mode:"split-right"};if(!n)return;const r=t.cloneWidget(n);r&&a.open(r,o)}}),s.addCommand(o.rename,{label:()=>{let e=T(c(),t);return e&&(e=" "+e),d.__("Rename%1…",e)},isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());return(0,l.renameDialog)(t,e)}}}),s.addCommand(o.duplicate,{label:()=>d.__("Duplicate %1",T(c(),t)),isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());if(!e)return;return t.duplicate(e.path)}}}),s.addCommand(o.del,{label:()=>d.__("Delete %1",T(c(),t)),isEnabled:u,execute:async()=>{if(u()){const n=t.contextForWidget(c());if(!n)return;(await(0,r.showDialog)({title:d.__("Delete"),body:d.__("Are you sure you want to delete %1",n.path),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:d.__("Delete")})]})).button.accept&&await e.commands.execute("docmanager:delete-file",{path:n.path})}}}),s.addCommand(o.showInFileBrowser,{label:()=>d.__("Show in File Browser"),isEnabled:u,execute:async()=>{const e=c(),n=e&&t.contextForWidget(e);n&&(await s.execute("filebrowser:activate",{path:n.path}),await s.execute("filebrowser:go-to-path",{path:n.path}))}})}(e,t,s,n,d),p.addCommand(o.deleteFile,{label:()=>`Delete ${T(h.currentWidget,t)}`,execute:e=>{const n=void 0===e.path?"":e.path;if(!n){const e=o.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}}),p.addCommand(o.newUntitled,{execute:e=>{const n=e.error||g.__("Error"),o=void 0===e.path?"":e.path,a={type:e.type,path:o};return"file"===e.type&&(a.ext=e.ext||".txt"),t.services.contents.newUntitled(a).catch((e=>(0,r.showErrorMessage)(n,e)))},label:e=>e.label||`New ${e.type}`}),p.addCommand(o.open,{execute:e=>{const n=void 0===e.path?"":e.path,o=e.factory||void 0,a=null==e?void 0:e.kernel,r=e.options||void 0;return t.services.contents.get(n,{content:!1}).then((()=>t.openOrReveal(n,o,a,r)))},iconClass:e=>e.icon||"",label:e=>{var t;return null!==(t=e.label||e.factory)&&void 0!==t?t:g.__("Open the provided `path`.")},mnemonic:e=>e.mnemonic||-1}),p.addCommand(o.reload,{label:()=>g.__("Reload %1 from Disk",T(h.currentWidget,t)),caption:g.__("Reload contents from disk"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget),n=T(h.currentWidget,t);return e?e.model.dirty?(0,r.showDialog)({title:g.__("Reload %1 from Disk",n),body:g.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed)return e.revert()})):e.isDisposed?void 0:e.revert():(0,r.showDialog)({title:g.__("Cannot Reload"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}),p.addCommand(o.restoreCheckpoint,{label:()=>g.__("Revert %1 to Checkpoint…",T(h.currentWidget,t)),caption:g.__("Revert contents to previous checkpoint"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget);return e?e.listCheckpoints().then((async n=>{const o=T(h.currentWidget,t);if(n.length<1)return void await(0,r.showErrorMessage)(g.__("No checkpoints"),g.__("No checkpoints are available for this %1.",o));const a=1===n.length?n[0]:await S.getTargetCheckpoint(n.reverse(),g);return a?(0,r.showDialog)({title:g.__("Revert %1 to checkpoint",o),body:new I(a,g,o),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Revert"),ariaLabel:g.__("Revert to Checkpoint")})]}).then((t=>{if(!e.isDisposed)return t.button.accept?e.model.readOnly?e.revert():e.restoreCheckpoint(a.id).then((()=>e.revert())):void 0})):void 0})):(0,r.showDialog)({title:g.__("Cannot Revert"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}});const _=new WeakSet;p.addCommand(o.save,{label:()=>g.__("Save %1",T(h.currentWidget,t)),caption:()=>{if(h.currentWidget){const e=t.contextForWidget(h.currentWidget);if(null==e?void 0:e.model.collaborative)return g.__("In collaborative mode, the document is saved automatically after every change")}return g.__("Save and create checkpoint")},icon:e=>e.toolbar?u.saveIcon:void 0,isEnabled:()=>{var e;const{currentWidget:n}=h;if(!n)return!1;const o=t.contextForWidget(n);return!!(null===(e=null==o?void 0:o.contentsModel)||void 0===e?void 0:e.writable)},execute:async()=>{var e,n,o;if(w()){const l=h.currentWidget,d=t.contextForWidget(l);if(!d)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});{if(_.has(d))return;if(d.model.readOnly)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("Document is read-only"),buttons:[r.Dialog.okButton()]});_.add(d);const s=i.PathExt.basename(null!==(n=null===(e=d.contentsModel)||void 0===e?void 0:e.path)&&void 0!==n?n:"");let c=s;if(t.renameUntitledFileOnSave&&!0===l.isUntitled){const e=await r.InputDialog.getText({title:g.__("Rename file"),okLabel:g.__("Rename"),placeholder:g.__("File name"),text:s,selectionRange:s.length-i.PathExt.extname(s).length,checkbox:{label:g.__("Do not ask me again."),caption:g.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept&&(c=null!==(o=e.value)&&void 0!==o?o:s,l.isUntitled=!1,"boolean"==typeof e.isChecked)){const t=(await a.get(f,"renameUntitledFileOnSave")).composite;e.isChecked===t&&a.set(f,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}try{if(await d.save(),!(null==l?void 0:l.isDisposed))return d.createCheckpoint()}catch(e){if("ModalCancelError"===e.name)return;throw e}finally{_.delete(d),c!==s&&await d.rename(c)}}}}}),p.addCommand(o.saveAll,{label:()=>g.__("Save All"),caption:g.__("Save all open documents"),isEnabled:()=>(0,m.some)(h.widgets("main"),(e=>{var n,o,a;return null!==(a=null===(o=null===(n=t.contextForWidget(e))||void 0===n?void 0:n.contentsModel)||void 0===o?void 0:o.writable)&&void 0!==a&&a})),execute:()=>{const e=[],n=new Set;for(const o of h.widgets("main")){const a=t.contextForWidget(o);!a||a.model.readOnly||n.has(a.path)||(n.add(a.path),e.push(a.save()))}return Promise.all(e)}}),p.addCommand(o.saveAs,{label:()=>g.__("Save %1 As…",T(h.currentWidget,t)),caption:g.__("Save with new path"),isEnabled:w,execute:()=>{if(w()){const e=t.contextForWidget(h.currentWidget);if(!e)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});const n=(n,a)=>{"save"===a.type&&a.newValue&&a.newValue.path!==e.path&&(t.closeFile(e.path),p.execute(o.open,{path:a.newValue.path}))};t.services.contents.fileChanged.connect(n),e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}}),p.addCommand(o.toggleAutosave,{label:g.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave,n="autosave";return a.set(f,n,e).catch((e=>{console.error(`Failed to set ${f}:${n} - ${e.message}`)}))}}),c&&[o.reload,o.restoreCheckpoint,o.save,o.saveAs,o.toggleAutosave,o.duplicate].forEach((e=>{c.addItem({command:e,category:v})}))}(e,t,n,a,d,p,s);const w=n=>{const a=n.get("autosave").composite;t.autosave=!0!==a&&!1!==a||a,e.commands.notifyCommandChanged(o.toggleAutosave);const r=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=null==r||r;const i=n.get("autosaveInterval").composite;t.autosaveInterval=i||120;const l=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=l||500;const d=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=null==d||d;const s=n.get("defaultViewers").composite,c={};Object.keys(s).forEach((e=>{v.getFileType(e)?(v.getWidgetFactory(s[e])||console.warn(`Document viewer ${s[e]} not found`),c[e]=s[e]):console.warn(`File Type ${e} not found`)}));for(const e of v.fileTypes())try{v.setDefaultWidgetFactory(e.name,c[e.name])}catch(t){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}};Promise.all([a.load(f),e.restored]).then((([e])=>{e.changed.connect(w),w(e),t.stateChanged.connect(((t,n)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue&&e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}))})).catch((e=>{console.error(e.message)})),a.transform(f,{fetch:e=>{const t=Array.from(v.fileTypes()).map((e=>e.name)).join(" \n"),n=Array.from(v.widgetFactories()).map((e=>e.name)).join(" \n"),o=h.__('Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2',n,t),a=g.JSONExt.deepCopy(e.schema);return a.properties.defaultViewers.description=o,{...e,schema:a}}}),v.changed.connect((()=>a.load(f,!0)))}},C={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[c.ITranslator,s.IStatusBar],activate:(e,t,n,o,a)=>{if(!a)return;const r=new l.SavingStatus({docManager:t,translator:null!=o?o:c.nullTranslator});r.model.widget=n.currentWidget,n.currentChanged.connect((()=>{r.model.widget=n.currentWidget})),a.registerStatusItem(C.id,{item:r,align:"middle",isActive:()=>null!==r.model&&null!==r.model.status,activeStateChanged:r.model.stateChanged})}},x={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[s.IStatusBar],activate:(e,t,n,o)=>{if(!o)return;const a=new l.PathStatus({docManager:t});a.model.widget=n.currentWidget,n.currentChanged.connect((()=>{a.model.widget=n.currentWidget})),o.registerStatusItem(x.id,{item:a,align:"right",rank:0})}},D={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator,r.ICommandPalette],activate:(e,t,n,a)=>{const i=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:l,shell:d}=e,s=()=>{const{currentWidget:e}=d;return!(!e||!t.contextForWidget(e))};l.addCommand(o.download,{label:i.__("Download"),caption:i.__("Download the file to your computer"),isEnabled:s,execute:()=>{if(s()){const e=t.contextForWidget(d.currentWidget);return e?e.download():(0,r.showDialog)({title:i.__("Cannot Download"),body:i.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}});const u=i.__("File Operations");a&&a.addItem({command:o.download,category:u})}},k={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator],activate:(e,t,n)=>{const a=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:r}=e;r.addCommand(o.openBrowserTab,{execute:e=>{const n=void 0===e.path?"":e.path;if(n)return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(!t)throw new Error("Failed to open new browser tab.");t.opener=null,t.location.href=e}))},iconClass:e=>e.icon||"",label:()=>a.__("Open in New Browser Tab")})}},W=[b,y,_,x,C,D,k,w];var F,S;!function(e){e.createSaveButton=function(e,t){return(0,r.addCommandToolbarButtonClass)(r.ReactWidget.create(v.createElement(r.UseSignal,{signal:t},(()=>v.createElement(r.CommandToolbarButtonComponent,{commands:e,id:o.save,label:"",args:{toolbar:!0}})))))}}(F||(F={}));class I extends h.Widget{constructor(e,t,n="notebook"){super({node:S.createRevertConfirmNode(e,n,t)})}}function T(e,t){if(!e)return"File";const n=t.contextForWidget(e);if(!n)return"";const o=t.registry.getFileTypesForPath(n.path);return o.length&&o[0].displayName?o[0].displayName:"File"}!function(e){e.id=0,e.createRevertConfirmNode=function(e,t,n){const o=document.createElement("div"),a=document.createElement("p"),r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t)),l=document.createElement("strong");l.textContent=n.__("This cannot be undone."),a.appendChild(r),a.appendChild(l);const d=document.createElement("p"),s=document.createTextNode(n.__("The checkpoint was last updated at: ")),c=document.createElement("p"),u=new Date(e.last_modified);return c.style.textAlign="center",c.textContent=i.Time.format(u)+" ("+i.Time.formatHuman(u)+")",d.appendChild(s),d.appendChild(c),o.appendChild(a),o.appendChild(d),o},e.getTargetCheckpoint=async function(e,t){const n=e.map(((e,t)=>`${t}. ${i.Time.format(e.last_modified)} (${i.Time.formatHuman(e.last_modified)})`)),o=(await r.InputDialog.getItem({items:n,title:t.__("Choose a checkpoint")})).value;if(!o)return;const a=o.split(".",1)[0];return e[parseInt(a,10)]}}(S||(S={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1835],{11835:(e,t,n)=>{n.r(t),n.d(t,{ToolbarItems:()=>F,default:()=>W,downloadPlugin:()=>D,openBrowserTabPlugin:()=>k,pathStatusPlugin:()=>x,savingStatusPlugin:()=>C});var o,a=n(70273),r=n(28054),i=n(64588),l=n(17017),d=n(70394),s=n(72145),c=n(57356),u=n(90710),m=n(33625),g=n(20998),p=n(81997),h=n(9267),v=n(78156);!function(e){e.clone="docmanager:clone",e.deleteFile="docmanager:delete-file",e.newUntitled="docmanager:new-untitled",e.open="docmanager:open",e.openBrowserTab="docmanager:open-browser-tab",e.reload="docmanager:reload",e.rename="docmanager:rename",e.del="docmanager:delete",e.duplicate="docmanager:duplicate",e.restoreCheckpoint="docmanager:restore-checkpoint",e.save="docmanager:save",e.saveAll="docmanager:save-all",e.saveAs="docmanager:save-as",e.download="docmanager:download",e.toggleAutosave="docmanager:toggle-autosave",e.showInFileBrowser="docmanager:show-in-file-browser"}(o||(o={}));const f="@jupyterlab/docmanager-extension:plugin",w={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:l.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){e.id||(e.id="document-manager-"+ ++S.id),e.title.dataset={type:"document-title",...e.title.dataset},e.isAttached||t.add(e,"main",n||{}),t.activateById(e.id),this._opened.emit(e)}get opened(){return this._opened}}}},_={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener],optional:[a.ILabStatus],activate:(e,t,n,o)=>{const a=new WeakSet;n.opened.connect(((e,n)=>{const r=t.contextForWidget(n);r&&!a.has(r)&&(o&&function(e,t){let n=null;const o=(t,o)=>{"dirty"===o.name&&(!0===o.newValue?n||(n=e.setDirty()):n&&(n.dispose(),n=null))};t.ready.then((()=>{t.model.stateChanged.connect(o),t.model.dirty&&(n=e.setDirty())})),t.disposed.connect((()=>{n&&n.dispose()}))}(o,r),a.add(r))}))}},b={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:l.IDocumentManager,requires:[l.IDocumentWidgetOpener],optional:[c.ITranslator,a.ILabStatus,r.ISessionContextDialogs,a.JupyterLab.IInfo],activate:(e,t,n,o,a,i)=>{var d;const{serviceManager:s,docRegistry:u}=e,m=null!=n?n:c.nullTranslator,g=null!=a?a:new r.SessionContextDialogs({translator:m}),p=e.restored.then((()=>{}));return new l.DocumentManager({registry:u,manager:s,opener:t,when:p,setBusy:null!==(d=o&&(()=>o.setBusy()))&&void 0!==d?d:void 0,sessionDialogs:g,translator:null!=m?m:c.nullTranslator,isConnectedCallback:()=>!i||i.isConnected})}},y={id:f,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener,d.ISettingRegistry],optional:[c.ITranslator,r.ICommandPalette,a.ILabShell],activate:(e,t,n,a,d,s,p)=>{const h=(d=null!=d?d:c.nullTranslator).load("jupyterlab"),v=e.docRegistry;!function(e,t,n,a,d,s,c){const g=d.load("jupyterlab"),{commands:p,shell:h}=e,v=g.__("File Operations"),w=()=>{const{currentWidget:e}=h;return!(!e||!t.contextForWidget(e))};s&&function(e,t,n,a,i){const d=i.load("jupyterlab"),{commands:s}=e,c=()=>{var o;const a=/[Pp]ath:\s?(.*)\n?/,r=e.contextMenuHitTest((e=>{var t;return!!(null===(t=e.title)||void 0===t?void 0:t.match(a))})),i=null==r?void 0:r.title.match(a);return null!==(o=i&&t.findWidget(i[1],null))&&void 0!==o?o:n.currentWidget},u=()=>{const{currentWidget:e}=n;return!(!e||!t.contextForWidget(e))};s.addCommand(o.clone,{label:()=>d.__("New View for %1",T(c(),t)),isEnabled:u,execute:e=>{const n=c(),o=e.options||{mode:"split-right"};if(!n)return;const r=t.cloneWidget(n);r&&a.open(r,o)}}),s.addCommand(o.rename,{label:()=>{let e=T(c(),t);return e&&(e=" "+e),d.__("Rename%1…",e)},isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());return(0,l.renameDialog)(t,e)}}}),s.addCommand(o.duplicate,{label:()=>d.__("Duplicate %1",T(c(),t)),isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());if(!e)return;return t.duplicate(e.path)}}}),s.addCommand(o.del,{label:()=>d.__("Delete %1",T(c(),t)),isEnabled:u,execute:async()=>{if(u()){const n=t.contextForWidget(c());if(!n)return;(await(0,r.showDialog)({title:d.__("Delete"),body:d.__("Are you sure you want to delete %1",n.path),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:d.__("Delete")})]})).button.accept&&await e.commands.execute("docmanager:delete-file",{path:n.path})}}}),s.addCommand(o.showInFileBrowser,{label:()=>d.__("Show in File Browser"),isEnabled:u,execute:async()=>{const e=c(),n=e&&t.contextForWidget(e);n&&(await s.execute("filebrowser:activate",{path:n.path}),await s.execute("filebrowser:go-to-path",{path:n.path}))}})}(e,t,s,n,d),p.addCommand(o.deleteFile,{label:()=>`Delete ${T(h.currentWidget,t)}`,execute:e=>{const n=void 0===e.path?"":e.path;if(!n){const e=o.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}}),p.addCommand(o.newUntitled,{execute:e=>{const n=e.error||g.__("Error"),o=void 0===e.path?"":e.path,a={type:e.type,path:o};return"file"===e.type&&(a.ext=e.ext||".txt"),t.services.contents.newUntitled(a).catch((e=>(0,r.showErrorMessage)(n,e)))},label:e=>e.label||`New ${e.type}`}),p.addCommand(o.open,{execute:e=>{const n=void 0===e.path?"":e.path,o=e.factory||void 0,a=null==e?void 0:e.kernel,r=e.options||void 0;return t.services.contents.get(n,{content:!1}).then((()=>t.openOrReveal(n,o,a,r)))},iconClass:e=>e.icon||"",label:e=>{var t;return null!==(t=e.label||e.factory)&&void 0!==t?t:g.__("Open the provided `path`.")},mnemonic:e=>e.mnemonic||-1}),p.addCommand(o.reload,{label:()=>g.__("Reload %1 from Disk",T(h.currentWidget,t)),caption:g.__("Reload contents from disk"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget),n=T(h.currentWidget,t);return e?e.model.dirty?(0,r.showDialog)({title:g.__("Reload %1 from Disk",n),body:g.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed)return e.revert()})):e.isDisposed?void 0:e.revert():(0,r.showDialog)({title:g.__("Cannot Reload"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}),p.addCommand(o.restoreCheckpoint,{label:()=>g.__("Revert %1 to Checkpoint…",T(h.currentWidget,t)),caption:g.__("Revert contents to previous checkpoint"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget);return e?e.listCheckpoints().then((async n=>{const o=T(h.currentWidget,t);if(n.length<1)return void await(0,r.showErrorMessage)(g.__("No checkpoints"),g.__("No checkpoints are available for this %1.",o));const a=1===n.length?n[0]:await S.getTargetCheckpoint(n.reverse(),g);return a?(0,r.showDialog)({title:g.__("Revert %1 to checkpoint",o),body:new I(a,g,o),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Revert"),ariaLabel:g.__("Revert to Checkpoint")})]}).then((t=>{if(!e.isDisposed)return t.button.accept?e.model.readOnly?e.revert():e.restoreCheckpoint(a.id).then((()=>e.revert())):void 0})):void 0})):(0,r.showDialog)({title:g.__("Cannot Revert"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}});const _=new WeakSet;p.addCommand(o.save,{label:()=>g.__("Save %1",T(h.currentWidget,t)),caption:()=>{if(h.currentWidget){const e=t.contextForWidget(h.currentWidget);if(null==e?void 0:e.model.collaborative)return g.__("In collaborative mode, the document is saved automatically after every change")}return g.__("Save and create checkpoint")},icon:e=>e.toolbar?u.saveIcon:void 0,isEnabled:()=>{var e;const{currentWidget:n}=h;if(!n)return!1;const o=t.contextForWidget(n);return!!(null===(e=null==o?void 0:o.contentsModel)||void 0===e?void 0:e.writable)},execute:async()=>{var e,n,o;if(w()){const l=h.currentWidget,d=t.contextForWidget(l);if(!d)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});{if(_.has(d))return;if(d.model.readOnly)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("Document is read-only"),buttons:[r.Dialog.okButton()]});_.add(d);const s=i.PathExt.basename(null!==(n=null===(e=d.contentsModel)||void 0===e?void 0:e.path)&&void 0!==n?n:"");let c=s;if(t.renameUntitledFileOnSave&&!0===l.isUntitled){const e=await r.InputDialog.getText({title:g.__("Rename file"),okLabel:g.__("Rename"),placeholder:g.__("File name"),text:s,selectionRange:s.length-i.PathExt.extname(s).length,checkbox:{label:g.__("Do not ask me again."),caption:g.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept&&(c=null!==(o=e.value)&&void 0!==o?o:s,l.isUntitled=!1,"boolean"==typeof e.isChecked)){const t=(await a.get(f,"renameUntitledFileOnSave")).composite;e.isChecked===t&&a.set(f,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}try{if(await d.save(),!(null==l?void 0:l.isDisposed))return d.createCheckpoint()}catch(e){if("ModalCancelError"===e.name)return;throw e}finally{_.delete(d),c!==s&&await d.rename(c)}}}}}),p.addCommand(o.saveAll,{label:()=>g.__("Save All"),caption:g.__("Save all open documents"),isEnabled:()=>(0,m.some)(h.widgets("main"),(e=>{var n,o,a;return null!==(a=null===(o=null===(n=t.contextForWidget(e))||void 0===n?void 0:n.contentsModel)||void 0===o?void 0:o.writable)&&void 0!==a&&a})),execute:()=>{const e=[],n=new Set;for(const o of h.widgets("main")){const a=t.contextForWidget(o);!a||a.model.readOnly||n.has(a.path)||(n.add(a.path),e.push(a.save()))}return Promise.all(e)}}),p.addCommand(o.saveAs,{label:()=>g.__("Save %1 As…",T(h.currentWidget,t)),caption:g.__("Save with new path"),isEnabled:w,execute:()=>{if(w()){const e=t.contextForWidget(h.currentWidget);if(!e)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});const n=(n,a)=>{"save"===a.type&&a.newValue&&a.newValue.path!==e.path&&(t.closeFile(e.path),p.execute(o.open,{path:a.newValue.path}))};t.services.contents.fileChanged.connect(n),e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}}),p.addCommand(o.toggleAutosave,{label:g.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave,n="autosave";return a.set(f,n,e).catch((e=>{console.error(`Failed to set ${f}:${n} - ${e.message}`)}))}}),c&&[o.reload,o.restoreCheckpoint,o.save,o.saveAs,o.toggleAutosave,o.duplicate].forEach((e=>{c.addItem({command:e,category:v})}))}(e,t,n,a,d,p,s);const w=n=>{const a=n.get("autosave").composite;t.autosave=!0!==a&&!1!==a||a,e.commands.notifyCommandChanged(o.toggleAutosave);const r=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=null==r||r;const i=n.get("autosaveInterval").composite;t.autosaveInterval=i||120;const l=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=l||500;const d=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=null==d||d;const s=n.get("defaultViewers").composite,c={};Object.keys(s).forEach((e=>{v.getFileType(e)?(v.getWidgetFactory(s[e])||console.warn(`Document viewer ${s[e]} not found`),c[e]=s[e]):console.warn(`File Type ${e} not found`)}));for(const e of v.fileTypes())try{v.setDefaultWidgetFactory(e.name,c[e.name])}catch(t){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}};Promise.all([a.load(f),e.restored]).then((([e])=>{e.changed.connect(w),w(e),t.stateChanged.connect(((t,n)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue&&e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}))})).catch((e=>{console.error(e.message)})),a.transform(f,{fetch:e=>{const t=Array.from(v.fileTypes()).map((e=>e.name)).join(" \n"),n=Array.from(v.widgetFactories()).map((e=>e.name)).join(" \n"),o=h.__('Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2',n,t),a=g.JSONExt.deepCopy(e.schema);return a.properties.defaultViewers.description=o,{...e,schema:a}}}),v.changed.connect((()=>a.load(f,!0)))}},C={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[c.ITranslator,s.IStatusBar],activate:(e,t,n,o,a)=>{if(!a)return;const r=new l.SavingStatus({docManager:t,translator:null!=o?o:c.nullTranslator});r.model.widget=n.currentWidget,n.currentChanged.connect((()=>{r.model.widget=n.currentWidget})),a.registerStatusItem(C.id,{item:r,align:"middle",isActive:()=>null!==r.model&&null!==r.model.status,activeStateChanged:r.model.stateChanged})}},x={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[s.IStatusBar],activate:(e,t,n,o)=>{if(!o)return;const a=new l.PathStatus({docManager:t});a.model.widget=n.currentWidget,n.currentChanged.connect((()=>{a.model.widget=n.currentWidget})),o.registerStatusItem(x.id,{item:a,align:"right",rank:0})}},D={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator,r.ICommandPalette],activate:(e,t,n,a)=>{const i=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:l,shell:d}=e,s=()=>{const{currentWidget:e}=d;return!(!e||!t.contextForWidget(e))};l.addCommand(o.download,{label:i.__("Download"),caption:i.__("Download the file to your computer"),isEnabled:s,execute:()=>{if(s()){const e=t.contextForWidget(d.currentWidget);return e?e.download():(0,r.showDialog)({title:i.__("Cannot Download"),body:i.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}});const u=i.__("File Operations");a&&a.addItem({command:o.download,category:u})}},k={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator],activate:(e,t,n)=>{const a=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:r}=e;r.addCommand(o.openBrowserTab,{execute:e=>{const n=void 0===e.path?"":e.path;if(n)return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(!t)throw new Error("Failed to open new browser tab.");t.opener=null,t.location.href=e}))},iconClass:e=>e.icon||"",label:()=>a.__("Open in New Browser Tab")})}},W=[b,y,_,x,C,D,k,w];var F,S;!function(e){e.createSaveButton=function(e,t){return(0,r.addCommandToolbarButtonClass)(r.ReactWidget.create(v.createElement(r.UseSignal,{signal:t},(()=>v.createElement(r.CommandToolbarButtonComponent,{commands:e,id:o.save,label:"",args:{toolbar:!0}})))))}}(F||(F={}));class I extends h.Widget{constructor(e,t,n="notebook"){super({node:S.createRevertConfirmNode(e,n,t)})}}function T(e,t){if(!e)return"File";const n=t.contextForWidget(e);if(!n)return"";const o=t.registry.getFileTypesForPath(n.path);return o.length&&o[0].displayName?o[0].displayName:"File"}!function(e){e.id=0,e.createRevertConfirmNode=function(e,t,n){const o=document.createElement("div"),a=document.createElement("p"),r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t)),l=document.createElement("strong");l.textContent=n.__("This cannot be undone."),a.appendChild(r),a.appendChild(l);const d=document.createElement("p"),s=document.createTextNode(n.__("The checkpoint was last updated at: ")),c=document.createElement("p"),u=new Date(e.last_modified);return c.style.textAlign="center",c.textContent=i.Time.format(u)+" ("+i.Time.formatHuman(u)+")",d.appendChild(s),d.appendChild(c),o.appendChild(a),o.appendChild(d),o},e.getTargetCheckpoint=async function(e,t){const n=e.map(((e,t)=>`${t}. ${i.Time.format(e.last_modified)} (${i.Time.formatHuman(e.last_modified)})`)),o=(await r.InputDialog.getItem({items:n,title:t.__("Choose a checkpoint")})).value;if(!o)return;const a=o.split(".",1)[0];return e[parseInt(a,10)]}}(S||(S={}))}}]);
|
notebook/static/1950.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I,lineColItem:()=>b});var o=r(70273),i=r(69384),n=r(72145),a=r(57356),s=r(7201),d=r(58277),l=r(70394),c=r(90710),u=r(20998),g=r(89319),m=r.n(g),p=r(78156),h=r.n(p);const f="@jupyterlab/codemirror-extension:plugin",v={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:d.IEditorLanguageRegistry,optional:[a.ITranslator],activate:(e,t)=>{const o=new d.EditorLanguageRegistry;for(const e of d.EditorLanguageRegistry.getDefaultLanguages(t))o.addLanguage(e);return o.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[e,t]=await Promise.all([r.e(252).then(r.t.bind(r,252,23)),r.e(311).then(r.bind(r,60311))]);return e.markdown({base:e.markdownLanguage,codeLanguages:e=>o.findBest(e),extensions:[(0,d.parseMathIPython)(s.StreamLanguage.define(t.stexMath).parser)]})}}),o}},y={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:d.IEditorThemeRegistry,optional:[a.ITranslator],activate:(e,t)=>{const r=new d.EditorThemeRegistry;for(const e of d.EditorThemeRegistry.getDefaultThemes(t))r.addTheme(e);return r}},E={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:d.IEditorExtensionRegistry,requires:[d.IEditorThemeRegistry],optional:[a.ITranslator,l.ISettingRegistry,c.IFormRendererRegistry],activate:(e,t,r,o,i)=>{const n=new d.EditorExtensionRegistry;for(const e of d.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:r}))n.addExtension(e);if(o){const t=e=>{var t;n.baseConfiguration=null!==(t=e.get("defaultConfig").composite)&&void 0!==t?t:{}};Promise.all([o.load(f),e.restored]).then((([e])=>{t(e),e.changed.connect(t)})),null==i||i.addRenderer(`${f}.defaultConfig`,{fieldRenderer:e=>{const t=h().useMemo((()=>n.settingsSchema),[]),o={};for(const[e,r]of Object.entries(n.defaultConfiguration))void 0!==t[e]&&(o[e]=r);return h().createElement("div",{className:"jp-FormGroup-contentNormal"},h().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&h().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),h().createElement(c.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:!1},validator:m(),formData:{...o,...e.formData},formContext:{defaultFormData:o},liveValidate:!0,onChange:t=>{var r;const i={};for(const[e,n]of Object.entries(null!==(r=t.formData)&&void 0!==r?r:{})){const t=o[e];void 0!==t&&u.JSONExt.deepEqual(n,t)||(i[e]=n)}e.onChange(i)},tagName:"div",translator:null!=r?r:a.nullTranslator}))}})}return n}},x={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[d.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"shared-model-binding",factory:e=>{var t;const r=e.model.sharedModel;return d.EditorExtensionRegistry.createImmutableExtension((0,d.ybinding)({ytext:r.ysource,undoManager:null!==(t=r.undoManager)&&void 0!==t?t:void 0}))}})}},R={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:i.IEditorServices,requires:[d.IEditorLanguageRegistry,d.IEditorExtensionRegistry],optional:[a.ITranslator],activate:(e,t,r,o)=>({factoryService:new d.CodeMirrorEditorFactory({extensions:r,languages:t,translator:null!=o?o:a.nullTranslator}),mimeTypeService:new d.CodeMirrorMimeTypeService(t)})},b={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[a.ITranslator],optional:[o.ILabShell,n.IStatusBar],provides:i.IPositionModel,activate:(e,t,r,o)=>{const n=new i.LineCol(t),a=new Set;function s(e,t){Promise.all([...a].map((e=>e(t.newValue)))).then((e=>{var t;n.model.editor=null!==(t=e.filter((e=>null!==e))[0])&&void 0!==t?t:null})).catch((e=>{console.error("Get editors",e)}))}return o&&o.registerStatusItem(b.id,{item:n,align:"right",rank:2,isActive:()=>!!n.model.editor}),r&&r.currentChanged.connect(s),{addEditorProvider:t=>{a.add(t),e.shell.currentWidget&&s(e.shell,{newValue:e.shell.currentWidget,oldValue:null})},update:()=>{s(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})}}}},I=[v,y,x,E,R,b]}}]);
|
notebook/static/1958.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,o)=>{o.r(t),o.d(t,{Grid:()=>i,GridModel:()=>c});var a,r=o(81056),n=o(81997),s=o(9267),l=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,o)=>{o.r(t),o.d(t,{Grid:()=>i,GridModel:()=>c});var a,r=o(81056),n=o(81997),s=o(9267),l=o(57356),d=o(78947);class i extends s.Panel{constructor(e){super();const{commands:t,model:o,themeManager:n}=e;this.model=o;const s=new c(e.translator),l=new r.DataGrid,i=new a.MouseHandler;i.doubleClicked.connect(((e,o)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:s.getVariableReference(o.row),name:s.getVariableName(o.row)}))),i.selected.connect(((e,t)=>{const{row:o}=t;this.model.selectedVariable={name:s.getVariableName(o),value:s.data("body",o,1),type:s.data("body",o,2),variablesReference:s.getVariableReference(o)}})),l.dataModel=s,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:s}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,n&&n.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=a.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,o){return"row-header"===e?this._data.name[t]:"column-header"===e?1===o?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===o?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,o;this._clearData(),this.emitChanged({type:"model-reset",region:"body"});const a=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(o=null==a?void 0:a.variables)&&void 0!==o?o:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var o;this._data.name[t]=e.name,this._data.type[t]=null!==(o=e.type)&&void 0!==o?o:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:o,backgroundColor:a,headerBackgroundColor:n,gridLineColor:s,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?o:a,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new n.Signal(this),this._selected=new n.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(n.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const o=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(o)}onMouseDown(e,t){let{clientX:o,clientY:a}=t,r=e.hitTest(o,a);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:o,clientY:a}=t,r=e.hitTest(o,a);this._selected.emit(r)}}e.MouseHandler=t}(a||(a={}))}}]);
|
notebook/static/2007.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2007,2607],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2007,2607],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(90710),i=s(33625),a=s(9267),u=s(28054);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2053],{32053:(e,t,r)=>{r.r(t),r.d(t,{Drag:()=>o});var n,i=r(2549);class o{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:r}=this._scrollTarget,i=n.SCROLL_EDGE_SIZE-r,o=Math.pow(i/n.SCROLL_EDGE_SIZE,2),s=Math.max(1,Math.round(o*n.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=s;break;case"left":e.scrollLeft-=s;break;case"right":e.scrollLeft+=s;break;case"bottom":e.scrollTop+=s}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});n.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((e=>{this._resolve=e}));let r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(r),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){this.dragImage&&(this.dragImage.style.transform=`translate(${e}px, ${t}px)`)}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return n.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");let t=n.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=n.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,r=this._currentTarget,i=this._currentElement,o=n.findElementBehidBackdrop(e,this.document);this._currentElement=o,o!==i&&o!==r&&n.dispatchDragExit(this,r,o,e),o!==i&&o!==r&&(r=n.dispatchDragEnter(this,o,r,e)),r!==t&&(this._currentTarget=r,n.dispatchDragLeave(this,t,r,e));let s=n.dispatchDragOver(this,r,e);this._setDropAction(s)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let r=this.dragImage.style;r.pointerEvents="none",r.position="fixed",r.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=n.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=o.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=o.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=o.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=o.overrideCursor("move",this.document)}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});const{drag:r}=t;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}e.Event=t,e.overrideCursor=function(e,t=document){return n.overrideCursor(e,t)}}(o||(o={})),function(e){function t(t,n=document){if(r&&t==r.event)return r.element;e.cursorBackdrop.style.zIndex="-1000";const i=n.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",r={event:t,element:i},i}e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,t){return n[e]&s[t]?e:"none"},e.findElementBehidBackdrop=t;let r=null;e.findScrollTarget=function(r){let n=r.clientX,i=r.clientY,o=t(r);for(;o;o=o.parentElement){if(!o.hasAttribute("data-lm-dragscroll"))continue;let t=0,r=0;o===document.body&&(t=window.pageXOffset,r=window.pageYOffset);let s=o.getBoundingClientRect(),a=s.top+r,c=s.left+t,d=c+s.width,l=a+s.height;if(n<c||n>=d||i<a||i>=l)continue;let u,h=n-c+1,p=i-a+1,m=d-n,v=l-i,g=Math.min(h,p,m,v);if(g>e.SCROLL_EDGE_SIZE)continue;switch(g){case v:u="bottom";break;case p:u="top";break;case m:u="right";break;case h:u="left";break;default:throw"unreachable"}let _,f=o.scrollWidth-o.clientWidth,E=o.scrollHeight-o.clientHeight;switch(u){case"top":_=E>0&&o.scrollTop>0;break;case"left":_=f>0&&o.scrollLeft>0;break;case"right":_=f>0&&o.scrollLeft<f;break;case"bottom":_=E>0&&o.scrollTop<E;break;default:throw"unreachable"}if(_)return{element:o,edge:u,distance:g}}return null},e.dispatchDragEnter=function(e,t,r,n){if(!t)return null;let i=new o.Event(n,{drag:e,related:r,type:"lm-dragenter"});if(!t.dispatchEvent(i))return t;const s=e.document instanceof Document?e.document.body:e.document.firstElementChild;return t===s?r:(i=new o.Event(n,{drag:e,related:r,type:"lm-dragenter"}),s.dispatchEvent(i),s)},e.dispatchDragExit=function(e,t,r,n){if(!t)return;let i=new o.Event(n,{drag:e,related:r,type:"lm-dragexit"});t.dispatchEvent(i)},e.dispatchDragLeave=function(e,t,r,n){if(!t)return;let i=new o.Event(n,{drag:e,related:r,type:"lm-dragleave"});t.dispatchEvent(i)},e.dispatchDragOver=function(e,t,r){if(!t)return"none";let n=new o.Event(r,{drag:e,related:null,type:"lm-dragover"});return t.dispatchEvent(n)?"none":n.dropAction},e.dispatchDrop=function(e,t,r){if(!t)return"none";let n=new o.Event(r,{drag:e,related:null,type:"lm-drop"});return t.dispatchEvent(n)?"none":n.dropAction};const n={none:0,copy:1,link:2,move:4},s={none:n.none,copy:n.copy,link:n.link,move:n.move,"copy-link":n.copy|n.link,"copy-move":n.copy|n.move,"link-move":n.link|n.move,all:n.copy|n.link|n.move};function a(t){e.cursorBackdrop&&(e.cursorBackdrop.style.transform=`translate(${t.clientX}px, ${t.clientY}px)`)}e.overrideCursor=function(t,r=document){let n=++c;const o=r instanceof Document?r.body:r.firstElementChild;return e.cursorBackdrop.isConnected||(e.cursorBackdrop.style.transform="scale(0)",o.appendChild(e.cursorBackdrop),document.addEventListener("pointermove",a,{capture:!0,passive:!0})),e.cursorBackdrop.style.cursor=t,new i.DisposableDelegate((()=>{n===c&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",a,!0),o.removeChild(e.cursorBackdrop))}))};let c=0;e.cursorBackdrop=function(){const e=document.createElement("div");return e.classList.add("lm-cursor-backdrop"),e}()}(n||(n={}))}}]);
|
notebook/static/2067.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2067],{32067:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>l,ConsolePanel:()=>S,ForeignHandler:()=>i,IConsoleTracker:()=>k});var o,n=s(81997);class i{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,n.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class l{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,n.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(o.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(o||(o={}));var r=s(56165),a=s(85421),h=s(42628),d=s(49255),c=s(59361),u=s(20998),p=s(9267),_=s(17811),C=s(19768),m=s(69688),g=s(93944),y=s(97031),f=s(20805);const v="jp-Console-cell",w="jp-CodeConsole-promptCell";class x extends p.Widget{constructor(e){var t,s;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new n.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new n.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:d.nullTranslator,this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.tabIndex=-1;const o=this.layout=new p.PanelLayout;this._cells=new y.ObservableList,this._content=new p.Panel,this._input=new p.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(s=e.modelFactory)&&void 0!==s?s:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),o.addWidget(this._content),o.addWidget(this._input),this._history=new l({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(v),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new g.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,g.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let o=e.target;const n=e=>e.classList.contains(v);let i=g.CellDragUtils.findCell(o,this._cells,n);if(-1===i&&(o=document.elementFromPoint(e.clientX,e.clientY),i=g.CellDragUtils.findCell(o,this._cells,n)),-1===i)return;const l=this._cells.get(i);"prompt"===g.CellDragUtils.detectTargetArea(l,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:i},this._focusedCell=l,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&g.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const o=this._focusedCell.model,n=[o.toJSON()],i=g.CellDragUtils.createCellDragImage(this._focusedCell,n);this._drag=new f.Drag({mimeData:new u.MimeData,dragImage:i,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",n);const l=o.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",l),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;t&&(t.readOnly=!0,t.removeClass(w),n.Signal.clearData(t.editor),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t));const o=this.contentFactory,i=this._createCodeCellOptions();t=o.createCodeCell(i),t.model.mimeType=this._mimetype,t.addClass(w),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){D.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_execute(e){const t=e.model.sharedModel.getSource();return this._history.push(t),"clear"===t||"%clear"===t?(this.clear(),Promise.resolve(void 0)):(e.model.contentChanged.connect(this.update,this),g.CodeCell.execute(e,this.sessionContext).then((t=>{if(!this.isDisposed){if(t&&"ok"===t.content.status){const s=t.content;if(s.payload&&s.payload.length){const t=s.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}}else if(t&&"error"===t.content.status)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("");e.model.contentChanged.disconnect(this.update,this),this.update(),this._executed.emit(new Date)}}),(()=>{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())})))}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const e=this.contentFactory,t=this.modelFactory.createCodeCell({}),s=this.rendermime,o=this.editorConfig,n=C.EditorView.domEventHandlers({keydown:(e,t)=>13===e.keyCode&&(e.preventDefault(),!0)});return{model:t,rendermime:s,contentFactory:e,editorConfig:o,editorExtensions:[_.Prec.high(n)],placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}}var D,b;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends g.Cell.ContentFactory{createCodeCell(e){return new g.CodeCell(e).initializeState()}createRawCell(e){return new g.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||g.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new g.CodeCellModel(e)}createRawCell(e){return new g.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(D||(D={}));class S extends r.MainAreaWidget{constructor(e){super({content:new p.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{rendermime:t,mimeTypeService:s,path:o,basePath:n,name:i,manager:l,modelFactory:_,sessionContext:C,translator:m}=e;this.translator=null!=m?m:d.nullTranslator;const g=this.translator.load("jupyterlab"),y=this.contentFactory=e.contentFactory,f=b.count++;o||(o=a.PathExt.join(n||"",`console-${f}-${u.UUID.uuid4()}`)),C=this._sessionContext=null!=C?C:new r.SessionContext({sessionManager:l.sessions,specsManager:l.kernelspecs,path:l.contents.localPath(o),name:i||g.__("Console %1",f),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const v=new h.RenderMimeRegistry.UrlResolver({path:o,contents:l.contents});t=t.clone({resolver:v}),this.console=y.createConsole({rendermime:t,sessionContext:C,mimeTypeService:s,contentFactory:y,modelFactory:_,translator:m}),this.content.addWidget(this.console),C.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new r.SessionContextDialogs({translator:m})).selectKernel(C),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),C.kernelChanged.connect(this._updateTitlePanel,this),C.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=c.consoleIcon,this.title.closable=!0,this.id=`console-${f}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){b.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new u.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(S||(S={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||d.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",a.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",a.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(b||(b={}));const k=new u.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.")}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2067],{32067:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>l,ConsolePanel:()=>S,ForeignHandler:()=>i,IConsoleTracker:()=>k});var o,n=s(81997);class i{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,n.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class l{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,n.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(o.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(o||(o={}));var r=s(28054),a=s(64588),h=s(39401),d=s(57356),c=s(90710),u=s(20998),p=s(9267),_=s(17811),C=s(19768),m=s(23781),g=s(72751),y=s(7437),f=s(99615);const v="jp-Console-cell",w="jp-CodeConsole-promptCell";class x extends p.Widget{constructor(e){var t,s;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new n.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new n.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:d.nullTranslator,this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.tabIndex=-1;const o=this.layout=new p.PanelLayout;this._cells=new y.ObservableList,this._content=new p.Panel,this._input=new p.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(s=e.modelFactory)&&void 0!==s?s:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),o.addWidget(this._content),o.addWidget(this._input),this._history=new l({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(v),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new g.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,g.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let o=e.target;const n=e=>e.classList.contains(v);let i=g.CellDragUtils.findCell(o,this._cells,n);if(-1===i&&(o=document.elementFromPoint(e.clientX,e.clientY),i=g.CellDragUtils.findCell(o,this._cells,n)),-1===i)return;const l=this._cells.get(i);"prompt"===g.CellDragUtils.detectTargetArea(l,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:i},this._focusedCell=l,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&g.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const o=this._focusedCell.model,n=[o.toJSON()],i=g.CellDragUtils.createCellDragImage(this._focusedCell,n);this._drag=new f.Drag({mimeData:new u.MimeData,dragImage:i,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",n);const l=o.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",l),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;t&&(t.readOnly=!0,t.removeClass(w),n.Signal.clearData(t.editor),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t));const o=this.contentFactory,i=this._createCodeCellOptions();t=o.createCodeCell(i),t.model.mimeType=this._mimetype,t.addClass(w),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){D.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_execute(e){const t=e.model.sharedModel.getSource();return this._history.push(t),"clear"===t||"%clear"===t?(this.clear(),Promise.resolve(void 0)):(e.model.contentChanged.connect(this.update,this),g.CodeCell.execute(e,this.sessionContext).then((t=>{if(!this.isDisposed){if(t&&"ok"===t.content.status){const s=t.content;if(s.payload&&s.payload.length){const t=s.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}}else if(t&&"error"===t.content.status)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("");e.model.contentChanged.disconnect(this.update,this),this.update(),this._executed.emit(new Date)}}),(()=>{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())})))}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const e=this.contentFactory,t=this.modelFactory.createCodeCell({}),s=this.rendermime,o=this.editorConfig,n=C.EditorView.domEventHandlers({keydown:(e,t)=>13===e.keyCode&&(e.preventDefault(),!0)});return{model:t,rendermime:s,contentFactory:e,editorConfig:o,editorExtensions:[_.Prec.high(n)],placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}}var D,b;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends g.Cell.ContentFactory{createCodeCell(e){return new g.CodeCell(e).initializeState()}createRawCell(e){return new g.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||g.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new g.CodeCellModel(e)}createRawCell(e){return new g.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(D||(D={}));class S extends r.MainAreaWidget{constructor(e){super({content:new p.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{rendermime:t,mimeTypeService:s,path:o,basePath:n,name:i,manager:l,modelFactory:_,sessionContext:C,translator:m}=e;this.translator=null!=m?m:d.nullTranslator;const g=this.translator.load("jupyterlab"),y=this.contentFactory=e.contentFactory,f=b.count++;o||(o=a.PathExt.join(n||"",`console-${f}-${u.UUID.uuid4()}`)),C=this._sessionContext=null!=C?C:new r.SessionContext({sessionManager:l.sessions,specsManager:l.kernelspecs,path:l.contents.localPath(o),name:i||g.__("Console %1",f),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const v=new h.RenderMimeRegistry.UrlResolver({path:o,contents:l.contents});t=t.clone({resolver:v}),this.console=y.createConsole({rendermime:t,sessionContext:C,mimeTypeService:s,contentFactory:y,modelFactory:_,translator:m}),this.content.addWidget(this.console),C.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new r.SessionContextDialogs({translator:m})).selectKernel(C),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),C.kernelChanged.connect(this._updateTitlePanel,this),C.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=c.consoleIcon,this.title.closable=!0,this.id=`console-${f}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){b.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new u.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(S||(S={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||d.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",a.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",a.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(b||(b={}));const k=new u.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.")}}]);
|
notebook/static/2088.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2088,6604],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2088,6604],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(6081),r=t(64588),l=t(75405),s=t(72518),a=t(39401),d=t(55830),c=t(57356),u=t(33625),p=t(9267);!function(e){e.dismiss="tooltip:dismiss",e.launchConsole="tooltip:launch-console",e.launchNotebook="tooltip:launch-notebook",e.launchFile="tooltip:launch-file"}(n||(n={}));const m={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:!0,optional:[c.ITranslator],provides:d.ITooltipManager,activate:(e,o)=>{const t=(null!=o?o:c.nullTranslator).load("jupyterlab");let i=null;return e.commands.addCommand(n.dismiss,{label:t.__("Dismiss the tooltip"),execute:()=>{i&&(i.dispose(),i=null)}}),{invoke(e){const{anchor:o,editor:t,kernel:n,rendermime:r}=e;return i&&(i.dispose(),i=null),T.fetch({detail:0,editor:t,kernel:n}).then((e=>{i=new d.Tooltip({anchor:o,bundle:e,editor:t,rendermime:r}),p.Widget.attach(i,document.body)})).catch((()=>{}))}}}},h={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,i.IConsoleTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchConsole,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.console,l=null===(e=r.promptCell)||void 0===e?void 0:e.editor,s=null===(n=r.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},v={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,s.INotebookTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchNotebook,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.content,l=null===(e=r.activeCell)||void 0===e?void 0:e.editor,s=null===(n=i.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,l.IEditorTracker,a.IRenderMimeRegistry],activate:(e,o,t,i,r)=>{const l=(null!=r?r:c.nullTranslator).load("jupyterlab"),s={},a=e.serviceManager.sessions,d=(e,o)=>{t.forEach((e=>{const t=(0,u.find)(o,(o=>e.context.path===o.path));if(t){const o=s[e.id];if(o&&o.id===t.id)return;o&&(delete s[e.id],o.dispose());const n=a.connectTo({model:t});s[e.id]=n}else{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}}))};d(0,a.running()),a.runningChanged.connect(d),t.widgetAdded.connect(((e,o)=>{o.disposed.connect((e=>{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}))})),e.commands.addCommand(n.launchFile,{label:l.__("Open the tooltip"),execute:async()=>{const e=t.currentWidget,n=e&&s[e.id]&&s[e.id].kernel;if(!n)return;const r=e.content,l=null==r?void 0:r.editor;return l&&n&&i?o.invoke({anchor:r,editor:l,kernel:n,rendermime:i}):void 0}})}},b=[m,h,v,k];var T;!function(e){let o=0;e.fetch=function(e){const{detail:t,editor:n,kernel:i}=e,l=n.model.sharedModel.getSource(),s=n.getCursorPosition(),a=r.Text.jsIndexToCharIndex(n.getOffsetAt(s),l);if(!l||!i)return Promise.reject(void 0);const d={code:l,cursor_pos:a,detail_level:t||0},c=++o;return i.requestInspect(d).then((e=>{const t=e.content;return c!==o?Promise.reject(void 0):"ok"===t.status&&t.found?Promise.resolve(t.data):Promise.reject(void 0)}))}}(T||(T={}))}}]);
|
notebook/static/2089.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2089],{2089:(e,t,s)=>{s.r(t),s.d(t,{ILoggerRegistry:()=>d,LogConsolePanel:()=>w,LogOutputModel:()=>a,Logger:()=>u,LoggerOutputAreaModel:()=>l,LoggerRegistry:()=>g,ScrollingWidget:()=>v});var i,r=s(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2089],{2089:(e,t,s)=>{s.r(t),s.d(t,{ILoggerRegistry:()=>d,LogConsolePanel:()=>w,LogOutputModel:()=>a,Logger:()=>u,LoggerOutputAreaModel:()=>l,LoggerRegistry:()=>g,ScrollingWidget:()=>v});var i,r=s(90363),n=s(39401),o=s(81997);class a extends n.OutputModel{constructor(e){super(e),this.timestamp=new Date(e.value.timestamp),this.level=e.value.level}}class h extends r.OutputAreaModel.ContentFactory{createOutputModel(e){return new a(e)}}class l extends r.OutputAreaModel{constructor({maxLength:e,...t}){super(t),this.maxLength=e}add(e){return super.add(e),this._applyMaxLength(),this.length}shouldCombine(e){const{value:t,lastModel:s}=e;return Math.trunc(s.timestamp.getTime()/1e3)===Math.trunc(t.timestamp/1e3)}get(e){return super.get(e)}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._applyMaxLength()}_applyMaxLength(){this.list.length>this._maxLength&&this.list.removeRange(0,this.list.length-this._maxLength)}}class u{constructor(e){this._isDisposed=!1,this._contentChanged=new o.Signal(this),this._stateChanged=new o.Signal(this),this._rendermime=null,this._version=0,this._level="warning",this.source=e.source,this.outputAreaModel=new l({contentFactory:new h,maxLength:e.maxLength})}get maxLength(){return this.outputAreaModel.maxLength}set maxLength(e){this.outputAreaModel.maxLength=e}get level(){return this._level}set level(e){const t=this._level;t!==e&&(this._level=e,this._log({output:{output_type:"display_data",data:{"text/plain":`Log level set to ${e}`}},level:"metadata"}),this._stateChanged.emit({name:"level",oldValue:t,newValue:e}))}get length(){return this.outputAreaModel.length}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get rendermime(){return this._rendermime}set rendermime(e){if(e!==this._rendermime){const t=this._rendermime,s=this._rendermime=e;this._stateChanged.emit({name:"rendermime",oldValue:t,newValue:s})}}get version(){return this._version}log(e){if(i.LogLevel[e.level]<i.LogLevel[this._level])return;let t=null;switch(e.type){case"text":t={output_type:"display_data",data:{"text/plain":e.data}};break;case"html":t={output_type:"display_data",data:{"text/html":e.data}};break;case"output":t=e.data}t&&this._log({output:t,level:e.level})}clear(){this.outputAreaModel.clear(!1),this._contentChanged.emit("clear")}checkpoint(){this._log({output:{output_type:"display_data",data:{"text/html":"<hr/>"}},level:"metadata"})}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.clear(),this._rendermime=null,o.Signal.clearData(this))}_log(e){this._version++,this.outputAreaModel.add({...e.output,timestamp:Date.now(),level:e.level}),this._contentChanged.emit("append")}}!function(e){let t;!function(e){e[e.debug=0]="debug",e[e.info=1]="info",e[e.warning=2]="warning",e[e.error=3]="error",e[e.critical=4]="critical",e[e.metadata=5]="metadata"}(t=e.LogLevel||(e.LogLevel={}))}(i||(i={}));class g{constructor(e){this._loggers=new Map,this._registryChanged=new o.Signal(this),this._isDisposed=!1,this._defaultRendermime=e.defaultRendermime,this._maxLength=e.maxLength}getLogger(e){const t=this._loggers;let s=t.get(e);return s||(s=new u({source:e,maxLength:this.maxLength}),s.rendermime=this._defaultRendermime,t.set(e,s),this._registryChanged.emit("append"),s)}getLoggers(){return Array.from(this._loggers.values())}get registryChanged(){return this._registryChanged}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e,this._loggers.forEach((t=>{t.maxLength=e}))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._loggers.forEach((e=>e.dispose())),o.Signal.clearData(this))}}const d=new(s(20998).Token)("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure.");var c=s(57356),_=s(9267);class p extends _.Widget{constructor(){super(),this._timestampNode=document.createElement("div"),this.node.append(this._timestampNode)}set timestamp(e){this._timestamp=e,this._timestampNode.innerHTML=this._timestamp.toLocaleTimeString(),this.update()}set level(e){this._level=e,this.node.dataset.logLevel=e,this.update()}update(){var e;void 0!==this._level&&void 0!==this._timestamp&&(this.node.title=`${this._timestamp.toLocaleString()}; ${e=this._level,0===e.length?e:e[0].toUpperCase()+e.slice(1)} level`)}}class m extends r.OutputArea{createOutputItem(e){const t=super.createOutputItem(e);if(null===t)return null;const s=t.widgets[0];return s.timestamp=e.timestamp,s.level=e.level,t}onInputRequest(e,t){}}class L extends r.OutputArea.ContentFactory{createOutputPrompt(){return new p}}class v extends _.Widget{constructor({content:e,...t}){super(t),this._observer=null,this.addClass("jp-Scrolling"),(this.layout=new _.PanelLayout).addWidget(e),this._content=e,this._sentinel=document.createElement("div"),this.node.appendChild(this._sentinel)}get content(){return this._content}onAfterAttach(e){super.onAfterAttach(e),requestAnimationFrame((()=>{this._sentinel.scrollIntoView(),this._scrollHeight=this.node.scrollHeight})),"undefined"!=typeof IntersectionObserver&&(this._observer=new IntersectionObserver((e=>{this._handleScroll(e)}),{root:this.node,threshold:1}),this._observer.observe(this._sentinel))}onBeforeDetach(e){this._observer&&this._observer.disconnect()}onAfterShow(e){this._tracking&&this._sentinel.scrollIntoView()}_handleScroll([e]){if(e.isIntersecting)this._tracking=!0;else if(this.isVisible){const e=this.node.scrollHeight;e===this._scrollHeight?this._tracking=!1:(this._sentinel.scrollIntoView(),this._scrollHeight=e,this._tracking=!0)}}}class w extends _.StackedPanel{constructor(e,t){super(),this._outputAreas=new Map,this._source=null,this._sourceChanged=new o.Signal(this),this._sourceDisplayed=new o.Signal(this),this._loggersWatched=new Set,this.translator=t||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._loggerRegistry=e,this.addClass("jp-LogConsolePanel"),e.registryChanged.connect(((e,t)=>{this._bindLoggerSignals()}),this),this._bindLoggerSignals(),this._placeholder=new _.Widget,this._placeholder.addClass("jp-LogConsoleListPlaceholder"),this.addWidget(this._placeholder)}get loggerRegistry(){return this._loggerRegistry}get logger(){return null===this.source?null:this.loggerRegistry.getLogger(this.source)}get source(){return this._source}set source(e){if(e===this._source)return;const t=this._source,s=this._source=e;this._showOutputFromSource(s),this._handlePlaceholder(),this._sourceChanged.emit({oldValue:t,newValue:s,name:"source"})}get sourceVersion(){const e=this.source;return null!==e?this._loggerRegistry.getLogger(e).version:null}get sourceChanged(){return this._sourceChanged}get sourceDisplayed(){return this._sourceDisplayed}onAfterAttach(e){super.onAfterAttach(e),this._updateOutputAreas(),this._showOutputFromSource(this._source),this._handlePlaceholder()}onAfterShow(e){super.onAfterShow(e),null!==this.source&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}_bindLoggerSignals(){const e=this._loggerRegistry.getLoggers();for(const t of e)this._loggersWatched.has(t.source)||(t.contentChanged.connect(((e,t)=>{this._updateOutputAreas(),this._handlePlaceholder()}),this),t.stateChanged.connect(((e,t)=>{if("rendermime"!==t.name)return;const s=`source:${e.source}`,i=this._outputAreas.get(s);i&&(t.newValue?i.rendermime=t.newValue:i.dispose())}),this),this._loggersWatched.add(t.source))}_showOutputFromSource(e){const t=null===e?"null source":`source:${e}`;this._outputAreas.forEach(((e,s)=>{var i,r;e.id===t?(null===(i=e.parent)||void 0===i||i.show(),e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})):null===(r=e.parent)||void 0===r||r.hide()}));const s=null===e?this._trans.__("Log Console"):this._trans.__("Log: %1",e);this.title.label=s,this.title.caption=s}_handlePlaceholder(){null===this.source?(this._placeholder.node.textContent=this._trans.__("No source selected."),this._placeholder.show()):0===this._loggerRegistry.getLogger(this.source).length?(this._placeholder.node.textContent=this._trans.__("No log messages."),this._placeholder.show()):(this._placeholder.hide(),this._placeholder.node.textContent="")}_updateOutputAreas(){const e=new Set,t=this._loggerRegistry.getLoggers();for(const s of t){const t=s.source,i=`source:${t}`;if(e.add(i),!this._outputAreas.has(i)){const e=new m({rendermime:s.rendermime,contentFactory:new L,model:s.outputAreaModel});e.id=i;const r=new v({content:e});this.addWidget(r),this._outputAreas.set(i,e);const n=e=>{this.source===t&&e.isVisible&&this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})};e.outputLengthChanged.connect(n,this),n(e)}}const s=this._outputAreas.keys();for(const t of s)if(!e.has(t)){const e=this._outputAreas.get(t);null==e||e.dispose(),this._outputAreas.delete(t)}}}}}]);
|
notebook/static/2122.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2122],{92122:(t,e,o)=>{o.r(e),o.d(e,{default:()=>i});var a=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2122],{92122:(t,e,o)=>{o.r(e),o.d(e,{default:()=>i});var a=o(70394),l=o(31195),n=o(28054),r=o(57356);const s={id:"@jupyterlab/cell-toolbar-extension:plugin",description:"Add the cells toolbar.",autoStart:!0,activate:async(t,e,o,a)=>{const i=e&&o?(0,n.createToolbarFactory)(o,e,l.CellBarExtension.FACTORY_NAME,s.id,null!=a?a:r.nullTranslator):void 0;t.docRegistry.addWidgetExtension("Notebook",new l.CellBarExtension(t.commands,i))},optional:[a.ISettingRegistry,n.IToolbarWidgetRegistry,r.ITranslator]},i=s}}]);
|
notebook/static/2167.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2167,1647],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2167,1647],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(90710),n=o(39401),r=o(9267);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t),s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
|
notebook/static/2184.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2184],{42184:(e,n,t)=>{t.r(n),t.d(n,{default:()=>x});var a=t(86883),o=t(56165),i=t(93944),r=t(8434),s=t(35436),l=t(85421),d=t(50833),c=t(49358),u=t(16166),g=t(90296),b=t(44148),v=t(42628),p=t(20457),m=t(49255);function h(e){Object.values(d.Debugger.CommandIDs).forEach((n=>{e.commands.hasCommand(n)&&e.commands.notifyCommandChanged(n)}))}const I={id:"@jupyterlab/debugger-extension:consoles",description:"Add debugger capability to the consoles.",autoStart:!0,requires:[d.IDebugger,s.IConsoleTracker],optional:[a.ILabShell],activate:(e,n,t,a)=>{const o=new d.Debugger.Handler({type:"console",shell:e.shell,service:n}),i=async n=>{const{sessionContext:t}=n;await t.ready,await o.updateContext(n,t),h(e)};a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;t instanceof s.ConsolePanel&&i(t)})):t.currentChanged.connect(((e,n)=>{n&&i(n)}))}},f={id:"@jupyterlab/debugger-extension:files",description:"Adds debugger capabilities to files.",autoStart:!0,requires:[d.IDebugger,u.IEditorTracker],optional:[a.ILabShell],activate:(e,n,t,a)=>{const o=new d.Debugger.Handler({type:"file",shell:e.shell,service:n}),i={},r=async n=>{const t=e.serviceManager.sessions;try{const a=await t.findByPath(n.context.path);if(!a)return;let r=i[a.id];r||(r=t.connectTo({model:a}),i[a.id]=r),await o.update(n,r),h(e)}catch(e){return}};a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;if(t instanceof c.DocumentWidget){const{content:e}=t;e instanceof u.FileEditor&&r(t)}})):t.currentChanged.connect(((e,n)=>{n&&r(n)}))}},y={id:"@jupyterlab/debugger-extension:notebooks",description:"Adds debugger capability to notebooks and provides the debugger notebook handler.",autoStart:!0,requires:[d.IDebugger,b.INotebookTracker],optional:[a.ILabShell,o.ICommandPalette,o.ISessionContextDialogs,m.ITranslator],provides:d.IDebuggerHandler,activate:(e,n,t,a,i,r,s)=>{const l=null!=s?s:m.nullTranslator,c=null!=r?r:new o.SessionContextDialogs({translator:l}),u=new d.Debugger.Handler({type:"notebook",shell:e.shell,service:n}),g=l.load("jupyterlab");e.commands.addCommand(d.Debugger.CommandIDs.restartDebug,{label:g.__("Restart Kernel and Debug…"),caption:g.__("Restart Kernel and Debug…"),isEnabled:()=>n.isStarted,execute:async()=>{const e=n.getDebuggerState();await n.stop();const a=t.currentWidget;if(!a)return;const{content:o,sessionContext:i}=a;await c.restart(i)&&(await n.restoreDebuggerState(e),await u.updateWidget(a,i.session),await b.NotebookActions.runAll(o,i,c,l))}});const v=async n=>{if(n){const{sessionContext:e}=n;await e.ready,await u.updateContext(n,e)}h(e)};return a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;t instanceof b.NotebookPanel&&v(t)})):t.currentChanged.connect(((e,n)=>{n&&v(n)})),i&&i.addItem({category:"Notebook Operations",command:d.Debugger.CommandIDs.restartDebug}),u}},C={id:"@jupyterlab/debugger-extension:service",description:"Provides the debugger service.",autoStart:!0,provides:d.IDebugger,requires:[d.IDebuggerConfig],optional:[d.IDebuggerSources,m.ITranslator],activate:(e,n,t,a)=>new d.Debugger.Service({config:n,debuggerSources:t,specsManager:e.serviceManager.kernelspecs,translator:a})},D={id:"@jupyterlab/debugger-extension:config",description:"Provides the debugger configuration",provides:d.IDebuggerConfig,autoStart:!0,activate:()=>new d.Debugger.Config},_={id:"@jupyterlab/debugger-extension:sources",description:"Provides the source feature for debugging",autoStart:!0,provides:d.IDebuggerSources,requires:[d.IDebuggerConfig,r.IEditorServices],optional:[b.INotebookTracker,s.IConsoleTracker,u.IEditorTracker],activate:(e,n,t,a,o,i)=>new d.Debugger.Sources({config:n,shell:e.shell,editorServices:t,notebookTracker:a,consoleTracker:o,editorTracker:i})},S={id:"@jupyterlab/debugger-extension:variables",description:"Adds variables renderer and inspection in the debugger variable panel.",autoStart:!0,requires:[d.IDebugger,d.IDebuggerHandler,m.ITranslator],optional:[o.IThemeManager,v.IRenderMimeRegistry],activate:(e,n,t,a,i,r)=>{const s=a.load("jupyterlab"),{commands:l,shell:c}=e,u=new o.WidgetTracker({namespace:"debugger/inspect-variable"}),g=new o.WidgetTracker({namespace:"debugger/render-variable"}),v=d.Debugger.CommandIDs;l.addCommand(v.inspectVariable,{label:s.__("Inspect Variable"),caption:s.__("Inspect Variable"),isEnabled:e=>{var t,a,o,i;return!!(null===(t=n.session)||void 0===t?void 0:t.isStarted)&&Number(null!==(i=null!==(a=e.variableReference)&&void 0!==a?a:null===(o=n.model.variables.selectedVariable)||void 0===o?void 0:o.variablesReference)&&void 0!==i?i:0)>0},execute:async e=>{var t,a,r,s;let{variableReference:g,name:b}=e;g||(g=null===(t=n.model.variables.selectedVariable)||void 0===t?void 0:t.variablesReference),b||(b=null===(a=n.model.variables.selectedVariable)||void 0===a?void 0:a.name);const v=`jp-debugger-variable-${b}`;if(!b||!g||u.find((e=>e.id===v)))return;const p=await n.inspectVariable(g);if(!p||0===p.length)return;const m=n.model.variables,h=new o.MainAreaWidget({content:new d.Debugger.VariablesGrid({model:m,commands:l,scopes:[{name:b,variables:p}],themeManager:i})});h.addClass("jp-DebuggerVariables"),h.id=v,h.title.icon=d.Debugger.Icons.variableIcon,h.title.label=`${null===(s=null===(r=n.session)||void 0===r?void 0:r.connection)||void 0===s?void 0:s.name} - ${b}`,u.add(h);const I=()=>{h.dispose(),m.changed.disconnect(I)};m.changed.connect(I),c.add(h,"main",{mode:u.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(v.renderMimeVariable,{label:s.__("Render Variable"),caption:s.__("Render variable according to its mime type"),isEnabled:()=>{var e;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>n.model.hasRichVariableRendering&&(null!==r||t.activeWidget instanceof b.NotebookPanel),execute:e=>{var o,i,s,l,u,v,p,m;let{name:h,frameId:I}=e;h||(h=null===(o=n.model.variables.selectedVariable)||void 0===o?void 0:o.name),I||(I=null===(i=n.model.callstack.frame)||void 0===i?void 0:i.id);const f=t.activeWidget;let y=f instanceof b.NotebookPanel?f.content.rendermime:r;if(!y)return;const C=`jp-debugger-variable-mime-${h}-${null===(l=null===(s=n.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path.replace("/","-")}`;if(!h||g.find((e=>e.id===C))||!I&&n.hasStoppedThreads())return;const D=n.model.variables,_=new d.Debugger.VariableRenderer({dataLoader:()=>n.inspectRichVariable(h,I),rendermime:y,translator:a});_.addClass("jp-DebuggerRichVariable"),_.id=C,_.title.icon=d.Debugger.Icons.variableIcon,_.title.label=`${h} - ${null===(v=null===(u=n.session)||void 0===u?void 0:u.connection)||void 0===v?void 0:v.name}`,_.title.caption=`${h} - ${null===(m=null===(p=n.session)||void 0===p?void 0:p.connection)||void 0===m?void 0:m.path}`,g.add(_);const S=()=>{_.dispose(),D.changed.disconnect(w),null==f||f.disposed.disconnect(S)},w=()=>{t.activeWidget===f&&_.refresh()};_.disposed.connect(S),D.changed.connect(w),null==f||f.disposed.connect(S),c.add(_,"main",{mode:g.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(v.copyToClipboard,{label:s.__("Copy to Clipboard"),caption:s.__("Copy text representation of the value to clipboard"),isEnabled:()=>{var e,t;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)&&!!(null===(t=n.model.variables.selectedVariable)||void 0===t?void 0:t.value)},isVisible:()=>t.activeWidget instanceof b.NotebookPanel,execute:async()=>{const e=n.model.variables.selectedVariable.value;e&&o.Clipboard.copyToSystem(e)}}),l.addCommand(v.copyToGlobals,{label:s.__("Copy Variable to Globals"),caption:s.__("Copy variable to globals scope"),isEnabled:()=>{var e;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>t.activeWidget instanceof b.NotebookPanel&&n.model.supportCopyToGlobals,execute:async e=>{const t=n.model.variables.selectedVariable.name;await n.copyToGlobals(t)}})}},w={id:"@jupyterlab/debugger-extension:sidebar",description:"Provides the debugger sidebar.",provides:d.IDebuggerSidebar,requires:[d.IDebugger,r.IEditorServices,m.ITranslator],optional:[o.IThemeManager,p.ISettingRegistry],autoStart:!0,activate:async(e,n,t,a,o,i)=>{const{commands:r}=e,s=d.Debugger.CommandIDs,l={registry:r,continue:s.debugContinue,terminate:s.terminate,next:s.next,stepIn:s.stepIn,stepOut:s.stepOut,evaluate:s.evaluate},c={registry:r,pauseOnExceptions:s.pauseOnExceptions},u=new d.Debugger.Sidebar({service:n,callstackCommands:l,breakpointsCommands:c,editorServices:t,themeManager:o,translator:a});if(i){const e=await i.load(k.id),t=()=>{var t,a,o,i;const r=e.get("variableFilters").composite,s=null!==(i=null===(o=null===(a=null===(t=n.session)||void 0===t?void 0:t.connection)||void 0===a?void 0:a.kernel)||void 0===o?void 0:o.name)&&void 0!==i?i:"";s&&r[s]&&(u.variables.filter=new Set(r[s]));const l=e.get("defaultKernelSourcesFilter").composite;u.kernelSources.filter=l};t(),e.changed.connect(t),n.sessionChanged.connect(t)}return u}},k={id:"@jupyterlab/debugger-extension:main",description:"Initialize the debugger user interface.",requires:[d.IDebugger,d.IDebuggerSidebar,r.IEditorServices,m.ITranslator],optional:[o.ICommandPalette,d.IDebuggerSources,a.ILabShell,a.ILayoutRestorer,g.ILoggerRegistry,p.ISettingRegistry],autoStart:!0,activate:async(e,n,t,a,r,s,c,u,g,b,p)=>{var m;const I=r.load("jupyterlab"),{commands:f,shell:y,serviceManager:C}=e,{kernelspecs:D}=C,_=d.Debugger.CommandIDs;if("true"!==l.PageConfig.getOption("alwaysShowDebuggerExtension").toLowerCase()){await D.ready;const e=null===(m=D.specs)||void 0===m?void 0:m.kernelspecs;if(!e)return;const n=Object.keys(e).some((n=>{var t,a,o;return!(null===(o=null===(a=null===(t=e[n])||void 0===t?void 0:t.metadata)||void 0===a?void 0:a.debugger)||void 0===o||!o)}));if(!n)return}const S=new v.RenderMimeRegistry({initialFactories:v.standardRendererFactories});f.addCommand(_.evaluate,{label:I.__("Evaluate Code"),caption:I.__("Evaluate Code"),icon:d.Debugger.Icons.evaluateIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{var e,t,o;const r=await(async()=>{var e,t,o;const i=null===(t=null===(e=n.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.kernel;if(!i)return"";const r=(await i.info).language_info.name;return null!==(o=a.mimeTypeService.getMimeTypeByLanguage({name:r}))&&void 0!==o?o:""})(),s=await d.Debugger.Dialogs.getCode({title:I.__("Evaluate Code"),okLabel:I.__("Evaluate"),cancelLabel:I.__("Cancel"),mimeType:r,contentFactory:new i.CodeCell.ContentFactory({editorFactory:e=>a.factoryService.newInlineEditor(e)}),rendermime:S}),l=s.value;if(!s.button.accept||!l)return;const c=await n.evaluate(l);if(c){const a=c.result,i=null===(t=null===(e=null==n?void 0:n.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.path,r=i?null===(o=null==b?void 0:b.getLogger)||void 0===o?void 0:o.call(b,i):void 0;r?r.log({type:"text",data:a,level:r.level}):console.debug(a)}}}),f.addCommand(_.debugContinue,{label:()=>n.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),caption:()=>n.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),icon:()=>n.hasStoppedThreads()?d.Debugger.Icons.continueIcon:d.Debugger.Icons.pauseIcon,isEnabled:()=>{var e,t;return null!==(t=null===(e=n.session)||void 0===e?void 0:e.isStarted)&&void 0!==t&&t},execute:async()=>{n.hasStoppedThreads()?await n.continue():await n.pause(),f.notifyCommandChanged(_.debugContinue)}}),f.addCommand(_.terminate,{label:I.__("Terminate"),caption:I.__("Terminate"),icon:d.Debugger.Icons.terminateIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.restart(),h(e)}}),f.addCommand(_.next,{label:I.__("Next"),caption:I.__("Next"),icon:d.Debugger.Icons.stepOverIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.next()}}),f.addCommand(_.stepIn,{label:I.__("Step In"),caption:I.__("Step In"),icon:d.Debugger.Icons.stepIntoIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.stepIn()}}),f.addCommand(_.stepOut,{label:I.__("Step Out"),caption:I.__("Step Out"),icon:d.Debugger.Icons.stepOutIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.stepOut()}}),f.addCommand(_.pauseOnExceptions,{label:e=>e.filter||"Breakpoints on exception",caption:e=>e.description,isToggled:e=>{var t;return(null===(t=n.session)||void 0===t?void 0:t.isPausingOnException(e.filter))||!1},isEnabled:()=>n.pauseOnExceptionsIsValid(),execute:async e=>{var t,a,i;if(null==e?void 0:e.filter){let t=e.filter;await n.pauseOnExceptionsFilter(t)}else{let e=[];null===(a=null===(t=n.session)||void 0===t?void 0:t.exceptionBreakpointFilters)||void 0===a||a.forEach((n=>{e.push(n.filter)}));const r=await o.InputDialog.getMultipleItems({title:I.__("Select a filter for breakpoints on exception"),items:e,defaults:(null===(i=n.session)||void 0===i?void 0:i.currentExceptionFilters)||[]});let s=r.button.accept?r.value:null;null!==s&&await n.pauseOnExceptions(s)}}});let w=!1;if(p){const e=await p.load(k.id),n=()=>{w=e.get("autoCollapseDebuggerSidebar").composite};n(),e.changed.connect(n)}if(n.eventMessage.connect(((n,a)=>{h(e),u&&"initialized"===a.event?u.activateById(t.id):u&&t.isVisible&&"terminated"===a.event&&w&&u.collapseRight()})),n.sessionChanged.connect((n=>{h(e)})),g&&g.add(t,"debugger-sidebar"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",I.__("Debugger section")),t.title.caption=I.__("Debugger"),y.add(t,"right",{type:"Debugger"}),f.addCommand(_.showPanel,{label:I.__("Debugger Panel"),execute:()=>{y.activateById(t.id)}}),s){const e=I.__("Debugger");[_.debugContinue,_.terminate,_.next,_.stepIn,_.stepOut,_.evaluate,_.pauseOnExceptions].forEach((n=>{s.addItem({command:n,category:e})}))}if(c){const{model:e}=n,t=new d.Debugger.ReadOnlyEditorFactory({editorServices:a}),o=(e,t)=>{var a,o,i,r,s,l,u,g,b;c.find({focus:!0,kernel:null!==(r=null===(i=null===(o=null===(a=n.session)||void 0===a?void 0:a.connection)||void 0===o?void 0:o.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",path:null!==(u=null===(l=null===(s=n.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path)&&void 0!==u?u:"",source:null!==(b=null===(g=null==t?void 0:t.source)||void 0===g?void 0:g.path)&&void 0!==b?b:""}).forEach((e=>{requestAnimationFrame((()=>{e.reveal().then((()=>{const n=e.get();n&&d.Debugger.EditorHandler.showCurrentLine(n,t.line)}))}))}))},i=(e,a,o)=>{var i,r,s,u,g,b,v;if(!a)return;const{content:p,mimeType:m,path:h}=a,I=c.find({focus:!0,kernel:null!==(u=null===(s=null===(r=null===(i=n.session)||void 0===i?void 0:i.connection)||void 0===r?void 0:r.kernel)||void 0===s?void 0:s.name)&&void 0!==u?u:"",path:null!==(v=null===(b=null===(g=n.session)||void 0===g?void 0:g.connection)||void 0===b?void 0:b.path)&&void 0!==v?v:"",source:h});if(I.length>0)return void(o&&void 0!==o.line&&I.forEach((e=>{e.reveal().then((()=>{var n;null===(n=e.get())||void 0===n||n.revealPosition({line:o.line-1,column:o.column||0})}))})));const f=t.createNewEditor({content:p,mimeType:m,path:h}),y=f.editor,C=new d.Debugger.EditorHandler({debuggerService:n,editorReady:()=>Promise.resolve(y),getEditor:()=>y,path:h,src:y.model.sharedModel});f.disposed.connect((()=>C.dispose())),c.open({label:l.PathExt.basename(h),caption:h,editorWrapper:f});const D=n.model.callstack.frame;D&&d.Debugger.EditorHandler.showCurrentLine(y,D.line)},r=(e,n,t)=>{n&&i(null,n,t)};e.callstack.currentFrameChanged.connect(o),e.sources.currentSourceOpened.connect(i),e.kernelSources.kernelSourceOpened.connect(r),e.breakpoints.clicked.connect((async(e,t)=>{var a;const o=null===(a=t.source)||void 0===a?void 0:a.path,r=await n.getSource({sourceReference:0,path:o});i(null,r,t)}))}}},x=[C,I,f,y,S,w,k,_,D]}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2184],{42184:(e,n,t)=>{t.r(n),t.d(n,{default:()=>x});var a=t(70273),o=t(28054),i=t(72751),r=t(69384),s=t(6081),l=t(64588),d=t(18651),c=t(26621),u=t(75405),g=t(85813),b=t(72518),v=t(39401),p=t(70394),m=t(57356);function h(e){Object.values(d.Debugger.CommandIDs).forEach((n=>{e.commands.hasCommand(n)&&e.commands.notifyCommandChanged(n)}))}const I={id:"@jupyterlab/debugger-extension:consoles",description:"Add debugger capability to the consoles.",autoStart:!0,requires:[d.IDebugger,s.IConsoleTracker],optional:[a.ILabShell],activate:(e,n,t,a)=>{const o=new d.Debugger.Handler({type:"console",shell:e.shell,service:n}),i=async n=>{const{sessionContext:t}=n;await t.ready,await o.updateContext(n,t),h(e)};a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;t instanceof s.ConsolePanel&&i(t)})):t.currentChanged.connect(((e,n)=>{n&&i(n)}))}},f={id:"@jupyterlab/debugger-extension:files",description:"Adds debugger capabilities to files.",autoStart:!0,requires:[d.IDebugger,u.IEditorTracker],optional:[a.ILabShell],activate:(e,n,t,a)=>{const o=new d.Debugger.Handler({type:"file",shell:e.shell,service:n}),i={},r=async n=>{const t=e.serviceManager.sessions;try{const a=await t.findByPath(n.context.path);if(!a)return;let r=i[a.id];r||(r=t.connectTo({model:a}),i[a.id]=r),await o.update(n,r),h(e)}catch(e){return}};a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;if(t instanceof c.DocumentWidget){const{content:e}=t;e instanceof u.FileEditor&&r(t)}})):t.currentChanged.connect(((e,n)=>{n&&r(n)}))}},y={id:"@jupyterlab/debugger-extension:notebooks",description:"Adds debugger capability to notebooks and provides the debugger notebook handler.",autoStart:!0,requires:[d.IDebugger,b.INotebookTracker],optional:[a.ILabShell,o.ICommandPalette,o.ISessionContextDialogs,m.ITranslator],provides:d.IDebuggerHandler,activate:(e,n,t,a,i,r,s)=>{const l=null!=s?s:m.nullTranslator,c=null!=r?r:new o.SessionContextDialogs({translator:l}),u=new d.Debugger.Handler({type:"notebook",shell:e.shell,service:n}),g=l.load("jupyterlab");e.commands.addCommand(d.Debugger.CommandIDs.restartDebug,{label:g.__("Restart Kernel and Debug…"),caption:g.__("Restart Kernel and Debug…"),isEnabled:()=>n.isStarted,execute:async()=>{const e=n.getDebuggerState();await n.stop();const a=t.currentWidget;if(!a)return;const{content:o,sessionContext:i}=a;await c.restart(i)&&(await n.restoreDebuggerState(e),await u.updateWidget(a,i.session),await b.NotebookActions.runAll(o,i,c,l))}});const v=async n=>{if(n){const{sessionContext:e}=n;await e.ready,await u.updateContext(n,e)}h(e)};return a?a.currentChanged.connect(((e,n)=>{const t=n.newValue;t instanceof b.NotebookPanel&&v(t)})):t.currentChanged.connect(((e,n)=>{n&&v(n)})),i&&i.addItem({category:"Notebook Operations",command:d.Debugger.CommandIDs.restartDebug}),u}},C={id:"@jupyterlab/debugger-extension:service",description:"Provides the debugger service.",autoStart:!0,provides:d.IDebugger,requires:[d.IDebuggerConfig],optional:[d.IDebuggerSources,m.ITranslator],activate:(e,n,t,a)=>new d.Debugger.Service({config:n,debuggerSources:t,specsManager:e.serviceManager.kernelspecs,translator:a})},D={id:"@jupyterlab/debugger-extension:config",description:"Provides the debugger configuration",provides:d.IDebuggerConfig,autoStart:!0,activate:()=>new d.Debugger.Config},_={id:"@jupyterlab/debugger-extension:sources",description:"Provides the source feature for debugging",autoStart:!0,provides:d.IDebuggerSources,requires:[d.IDebuggerConfig,r.IEditorServices],optional:[b.INotebookTracker,s.IConsoleTracker,u.IEditorTracker],activate:(e,n,t,a,o,i)=>new d.Debugger.Sources({config:n,shell:e.shell,editorServices:t,notebookTracker:a,consoleTracker:o,editorTracker:i})},S={id:"@jupyterlab/debugger-extension:variables",description:"Adds variables renderer and inspection in the debugger variable panel.",autoStart:!0,requires:[d.IDebugger,d.IDebuggerHandler,m.ITranslator],optional:[o.IThemeManager,v.IRenderMimeRegistry],activate:(e,n,t,a,i,r)=>{const s=a.load("jupyterlab"),{commands:l,shell:c}=e,u=new o.WidgetTracker({namespace:"debugger/inspect-variable"}),g=new o.WidgetTracker({namespace:"debugger/render-variable"}),v=d.Debugger.CommandIDs;l.addCommand(v.inspectVariable,{label:s.__("Inspect Variable"),caption:s.__("Inspect Variable"),isEnabled:e=>{var t,a,o,i;return!!(null===(t=n.session)||void 0===t?void 0:t.isStarted)&&Number(null!==(i=null!==(a=e.variableReference)&&void 0!==a?a:null===(o=n.model.variables.selectedVariable)||void 0===o?void 0:o.variablesReference)&&void 0!==i?i:0)>0},execute:async e=>{var t,a,r,s;let{variableReference:g,name:b}=e;g||(g=null===(t=n.model.variables.selectedVariable)||void 0===t?void 0:t.variablesReference),b||(b=null===(a=n.model.variables.selectedVariable)||void 0===a?void 0:a.name);const v=`jp-debugger-variable-${b}`;if(!b||!g||u.find((e=>e.id===v)))return;const p=await n.inspectVariable(g);if(!p||0===p.length)return;const m=n.model.variables,h=new o.MainAreaWidget({content:new d.Debugger.VariablesGrid({model:m,commands:l,scopes:[{name:b,variables:p}],themeManager:i})});h.addClass("jp-DebuggerVariables"),h.id=v,h.title.icon=d.Debugger.Icons.variableIcon,h.title.label=`${null===(s=null===(r=n.session)||void 0===r?void 0:r.connection)||void 0===s?void 0:s.name} - ${b}`,u.add(h);const I=()=>{h.dispose(),m.changed.disconnect(I)};m.changed.connect(I),c.add(h,"main",{mode:u.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(v.renderMimeVariable,{label:s.__("Render Variable"),caption:s.__("Render variable according to its mime type"),isEnabled:()=>{var e;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>n.model.hasRichVariableRendering&&(null!==r||t.activeWidget instanceof b.NotebookPanel),execute:e=>{var o,i,s,l,u,v,p,m;let{name:h,frameId:I}=e;h||(h=null===(o=n.model.variables.selectedVariable)||void 0===o?void 0:o.name),I||(I=null===(i=n.model.callstack.frame)||void 0===i?void 0:i.id);const f=t.activeWidget;let y=f instanceof b.NotebookPanel?f.content.rendermime:r;if(!y)return;const C=`jp-debugger-variable-mime-${h}-${null===(l=null===(s=n.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path.replace("/","-")}`;if(!h||g.find((e=>e.id===C))||!I&&n.hasStoppedThreads())return;const D=n.model.variables,_=new d.Debugger.VariableRenderer({dataLoader:()=>n.inspectRichVariable(h,I),rendermime:y,translator:a});_.addClass("jp-DebuggerRichVariable"),_.id=C,_.title.icon=d.Debugger.Icons.variableIcon,_.title.label=`${h} - ${null===(v=null===(u=n.session)||void 0===u?void 0:u.connection)||void 0===v?void 0:v.name}`,_.title.caption=`${h} - ${null===(m=null===(p=n.session)||void 0===p?void 0:p.connection)||void 0===m?void 0:m.path}`,g.add(_);const S=()=>{_.dispose(),D.changed.disconnect(w),null==f||f.disposed.disconnect(S)},w=()=>{t.activeWidget===f&&_.refresh()};_.disposed.connect(S),D.changed.connect(w),null==f||f.disposed.connect(S),c.add(_,"main",{mode:g.currentWidget?"split-right":"split-bottom",activate:!1,type:"Debugger Variables"})}}),l.addCommand(v.copyToClipboard,{label:s.__("Copy to Clipboard"),caption:s.__("Copy text representation of the value to clipboard"),isEnabled:()=>{var e,t;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)&&!!(null===(t=n.model.variables.selectedVariable)||void 0===t?void 0:t.value)},isVisible:()=>t.activeWidget instanceof b.NotebookPanel,execute:async()=>{const e=n.model.variables.selectedVariable.value;e&&o.Clipboard.copyToSystem(e)}}),l.addCommand(v.copyToGlobals,{label:s.__("Copy Variable to Globals"),caption:s.__("Copy variable to globals scope"),isEnabled:()=>{var e;return!!(null===(e=n.session)||void 0===e?void 0:e.isStarted)},isVisible:()=>t.activeWidget instanceof b.NotebookPanel&&n.model.supportCopyToGlobals,execute:async e=>{const t=n.model.variables.selectedVariable.name;await n.copyToGlobals(t)}})}},w={id:"@jupyterlab/debugger-extension:sidebar",description:"Provides the debugger sidebar.",provides:d.IDebuggerSidebar,requires:[d.IDebugger,r.IEditorServices,m.ITranslator],optional:[o.IThemeManager,p.ISettingRegistry],autoStart:!0,activate:async(e,n,t,a,o,i)=>{const{commands:r}=e,s=d.Debugger.CommandIDs,l={registry:r,continue:s.debugContinue,terminate:s.terminate,next:s.next,stepIn:s.stepIn,stepOut:s.stepOut,evaluate:s.evaluate},c={registry:r,pauseOnExceptions:s.pauseOnExceptions},u=new d.Debugger.Sidebar({service:n,callstackCommands:l,breakpointsCommands:c,editorServices:t,themeManager:o,translator:a});if(i){const e=await i.load(k.id),t=()=>{var t,a,o,i;const r=e.get("variableFilters").composite,s=null!==(i=null===(o=null===(a=null===(t=n.session)||void 0===t?void 0:t.connection)||void 0===a?void 0:a.kernel)||void 0===o?void 0:o.name)&&void 0!==i?i:"";s&&r[s]&&(u.variables.filter=new Set(r[s]));const l=e.get("defaultKernelSourcesFilter").composite;u.kernelSources.filter=l};t(),e.changed.connect(t),n.sessionChanged.connect(t)}return u}},k={id:"@jupyterlab/debugger-extension:main",description:"Initialize the debugger user interface.",requires:[d.IDebugger,d.IDebuggerSidebar,r.IEditorServices,m.ITranslator],optional:[o.ICommandPalette,d.IDebuggerSources,a.ILabShell,a.ILayoutRestorer,g.ILoggerRegistry,p.ISettingRegistry],autoStart:!0,activate:async(e,n,t,a,r,s,c,u,g,b,p)=>{var m;const I=r.load("jupyterlab"),{commands:f,shell:y,serviceManager:C}=e,{kernelspecs:D}=C,_=d.Debugger.CommandIDs;if("true"!==l.PageConfig.getOption("alwaysShowDebuggerExtension").toLowerCase()){await D.ready;const e=null===(m=D.specs)||void 0===m?void 0:m.kernelspecs;if(!e)return;const n=Object.keys(e).some((n=>{var t,a,o;return!(null===(o=null===(a=null===(t=e[n])||void 0===t?void 0:t.metadata)||void 0===a?void 0:a.debugger)||void 0===o||!o)}));if(!n)return}const S=new v.RenderMimeRegistry({initialFactories:v.standardRendererFactories});f.addCommand(_.evaluate,{label:I.__("Evaluate Code"),caption:I.__("Evaluate Code"),icon:d.Debugger.Icons.evaluateIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{var e,t,o;const r=await(async()=>{var e,t,o;const i=null===(t=null===(e=n.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.kernel;if(!i)return"";const r=(await i.info).language_info.name;return null!==(o=a.mimeTypeService.getMimeTypeByLanguage({name:r}))&&void 0!==o?o:""})(),s=await d.Debugger.Dialogs.getCode({title:I.__("Evaluate Code"),okLabel:I.__("Evaluate"),cancelLabel:I.__("Cancel"),mimeType:r,contentFactory:new i.CodeCell.ContentFactory({editorFactory:e=>a.factoryService.newInlineEditor(e)}),rendermime:S}),l=s.value;if(!s.button.accept||!l)return;const c=await n.evaluate(l);if(c){const a=c.result,i=null===(t=null===(e=null==n?void 0:n.session)||void 0===e?void 0:e.connection)||void 0===t?void 0:t.path,r=i?null===(o=null==b?void 0:b.getLogger)||void 0===o?void 0:o.call(b,i):void 0;r?r.log({type:"text",data:a,level:r.level}):console.debug(a)}}}),f.addCommand(_.debugContinue,{label:()=>n.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),caption:()=>n.hasStoppedThreads()?I.__("Continue"):I.__("Pause"),icon:()=>n.hasStoppedThreads()?d.Debugger.Icons.continueIcon:d.Debugger.Icons.pauseIcon,isEnabled:()=>{var e,t;return null!==(t=null===(e=n.session)||void 0===e?void 0:e.isStarted)&&void 0!==t&&t},execute:async()=>{n.hasStoppedThreads()?await n.continue():await n.pause(),f.notifyCommandChanged(_.debugContinue)}}),f.addCommand(_.terminate,{label:I.__("Terminate"),caption:I.__("Terminate"),icon:d.Debugger.Icons.terminateIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.restart(),h(e)}}),f.addCommand(_.next,{label:I.__("Next"),caption:I.__("Next"),icon:d.Debugger.Icons.stepOverIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.next()}}),f.addCommand(_.stepIn,{label:I.__("Step In"),caption:I.__("Step In"),icon:d.Debugger.Icons.stepIntoIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.stepIn()}}),f.addCommand(_.stepOut,{label:I.__("Step Out"),caption:I.__("Step Out"),icon:d.Debugger.Icons.stepOutIcon,isEnabled:()=>n.hasStoppedThreads(),execute:async()=>{await n.stepOut()}}),f.addCommand(_.pauseOnExceptions,{label:e=>e.filter||"Breakpoints on exception",caption:e=>e.description,isToggled:e=>{var t;return(null===(t=n.session)||void 0===t?void 0:t.isPausingOnException(e.filter))||!1},isEnabled:()=>n.pauseOnExceptionsIsValid(),execute:async e=>{var t,a,i;if(null==e?void 0:e.filter){let t=e.filter;await n.pauseOnExceptionsFilter(t)}else{let e=[];null===(a=null===(t=n.session)||void 0===t?void 0:t.exceptionBreakpointFilters)||void 0===a||a.forEach((n=>{e.push(n.filter)}));const r=await o.InputDialog.getMultipleItems({title:I.__("Select a filter for breakpoints on exception"),items:e,defaults:(null===(i=n.session)||void 0===i?void 0:i.currentExceptionFilters)||[]});let s=r.button.accept?r.value:null;null!==s&&await n.pauseOnExceptions(s)}}});let w=!1;if(p){const e=await p.load(k.id),n=()=>{w=e.get("autoCollapseDebuggerSidebar").composite};n(),e.changed.connect(n)}if(n.eventMessage.connect(((n,a)=>{h(e),u&&"initialized"===a.event?u.activateById(t.id):u&&t.isVisible&&"terminated"===a.event&&w&&u.collapseRight()})),n.sessionChanged.connect((n=>{h(e)})),g&&g.add(t,"debugger-sidebar"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",I.__("Debugger section")),t.title.caption=I.__("Debugger"),y.add(t,"right",{type:"Debugger"}),f.addCommand(_.showPanel,{label:I.__("Debugger Panel"),execute:()=>{y.activateById(t.id)}}),s){const e=I.__("Debugger");[_.debugContinue,_.terminate,_.next,_.stepIn,_.stepOut,_.evaluate,_.pauseOnExceptions].forEach((n=>{s.addItem({command:n,category:e})}))}if(c){const{model:e}=n,t=new d.Debugger.ReadOnlyEditorFactory({editorServices:a}),o=(e,t)=>{var a,o,i,r,s,l,u,g,b;c.find({focus:!0,kernel:null!==(r=null===(i=null===(o=null===(a=n.session)||void 0===a?void 0:a.connection)||void 0===o?void 0:o.kernel)||void 0===i?void 0:i.name)&&void 0!==r?r:"",path:null!==(u=null===(l=null===(s=n.session)||void 0===s?void 0:s.connection)||void 0===l?void 0:l.path)&&void 0!==u?u:"",source:null!==(b=null===(g=null==t?void 0:t.source)||void 0===g?void 0:g.path)&&void 0!==b?b:""}).forEach((e=>{requestAnimationFrame((()=>{e.reveal().then((()=>{const n=e.get();n&&d.Debugger.EditorHandler.showCurrentLine(n,t.line)}))}))}))},i=(e,a,o)=>{var i,r,s,u,g,b,v;if(!a)return;const{content:p,mimeType:m,path:h}=a,I=c.find({focus:!0,kernel:null!==(u=null===(s=null===(r=null===(i=n.session)||void 0===i?void 0:i.connection)||void 0===r?void 0:r.kernel)||void 0===s?void 0:s.name)&&void 0!==u?u:"",path:null!==(v=null===(b=null===(g=n.session)||void 0===g?void 0:g.connection)||void 0===b?void 0:b.path)&&void 0!==v?v:"",source:h});if(I.length>0)return void(o&&void 0!==o.line&&I.forEach((e=>{e.reveal().then((()=>{var n;null===(n=e.get())||void 0===n||n.revealPosition({line:o.line-1,column:o.column||0})}))})));const f=t.createNewEditor({content:p,mimeType:m,path:h}),y=f.editor,C=new d.Debugger.EditorHandler({debuggerService:n,editorReady:()=>Promise.resolve(y),getEditor:()=>y,path:h,src:y.model.sharedModel});f.disposed.connect((()=>C.dispose())),c.open({label:l.PathExt.basename(h),caption:h,editorWrapper:f});const D=n.model.callstack.frame;D&&d.Debugger.EditorHandler.showCurrentLine(y,D.line)},r=(e,n,t)=>{n&&i(null,n,t)};e.callstack.currentFrameChanged.connect(o),e.sources.currentSourceOpened.connect(i),e.kernelSources.kernelSourceOpened.connect(r),e.breakpoints.clicked.connect((async(e,t)=>{var a;const o=null===(a=t.source)||void 0===a?void 0:a.path,r=await n.getSource({sourceReference:0,path:o});i(null,r,t)}))}}},x=[C,I,f,y,S,w,k,_,D]}}]);
|
notebook/static/2311.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2311],{22311:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var a=t(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2311],{22311:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var a=t(70273),i=t(28054),o=t(53623),s=t(70394),l=t(57356),d=t(90710);const r="@jupyterlab/extensionmanager-extension:plugin";var c;!function(e){e.showPanel="extensionmanager:show-panel",e.toggle="extensionmanager:toggle"}(c||(c={}));const g={id:r,description:"Adds the extension manager plugin.",autoStart:!0,requires:[s.ISettingRegistry],optional:[l.ITranslator,a.ILayoutRestorer,i.ICommandPalette],activate:async(e,n,t,a,i)=>{const{commands:s,shell:m,serviceManager:b}=e,h=(t=null!=t?t:l.nullTranslator).load("jupyterlab"),p=new o.ListModel(b,t),_=()=>{const e=new o.ExtensionsPanel({model:p,translator:t});return e.id="extensionmanager.main-view",e.title.icon=d.extensionIcon,e.title.caption=h.__("Extension Manager"),e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",h.__("Extension Manager section")),a&&a.add(e,e.id),m.add(e,"left",{rank:1e3}),e};let E=_();Promise.all([e.restored,n.load(r)]).then((([,n])=>{p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,p.stateChanged.connect((()=>{p.isDisclaimed!==n.get("disclaimed").composite&&n.set("disclaimed",p.isDisclaimed).catch((e=>{console.error(`Failed to set setting 'disclaimed'.\n${e}`)})),p.isEnabled!==n.get("enabled").composite&&n.set("enabled",p.isEnabled).catch((e=>{console.error(`Failed to set setting 'enabled'.\n${e}`)}))})),p.isEnabled?E=null!=E?E:_():(null==E||E.dispose(),E=null),n.changed.connect((async()=>{if(p.isDisclaimed=n.get("disclaimed").composite,p.isEnabled=n.get("enabled").composite,e.commands.notifyCommandChanged(c.toggle),p.isEnabled){if(!(null!==E&&E.isAttached||await u.showWarning(h)))return void n.set("enabled",!1);E=null!=E?E:_()}else null==E||E.dispose(),E=null}))})).catch((e=>{console.error(`Something went wrong when reading the settings.\n${e}`)})),s.addCommand(c.showPanel,{label:h.__("Extension Manager"),execute:()=>{E&&m.activateById(E.id)},isVisible:()=>p.isEnabled}),s.addCommand(c.toggle,{label:h.__("Enable Extension Manager"),execute:()=>{n&&n.set(g.id,"enabled",!p.isEnabled)},isToggled:()=>p.isEnabled}),i&&i.addItem({command:c.toggle,category:h.__("Extension Manager")})}},m=g;var u;!function(e){e.showWarning=async function(e){return(await(0,i.showDialog)({title:e.__("Enable Extension Manager?"),body:e.__("Thanks for trying out JupyterLab's extension manager.\nThe JupyterLab development team is excited to have a robust\nthird-party extension community.\nHowever, we cannot vouch for every extension,\nand some may introduce security risks.\nDo you want to continue?"),buttons:[i.Dialog.cancelButton({label:e.__("Disable")}),i.Dialog.warnButton({label:e.__("Enable")})]})).button.accept}}(u||(u={}))}}]);
|