(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3844,9853],{23844:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>b});var a=n(12908),o=n(56901),s=n(56123),r=n(22645),l=n(51507),i=n(20850),c=n(42428),d=n(39462),u=n(36735);const p="jp-RetroKernelStatus-error",h="jp-RetroKernelStatus-warn",C="jp-RetroKernelStatus-info",f="jp-RetroKernelStatus-fade",k={id:"@retrolab/application-extension:checkpoints",autoStart:!0,requires:[r.IDocumentManager,i.ITranslator],optional:[c.IRetroShell],activate:(e,t,n,a)=>{const{shell:r}=e,l=n.load("retrolab"),i=new u.Widget;i.id=o.DOMUtils.createDomID(),i.addClass("jp-RetroCheckpoint"),e.shell.add(i,"top",{rank:100});const c=async()=>{const e=r.currentWidget;if(!e)return;const n=t.contextForWidget(e);null==n||n.fileChanged.disconnect(c),null==n||n.fileChanged.connect(c);const a=await(null==n?void 0:n.listCheckpoints());if(!a)return;const o=a[a.length-1];i.node.textContent=l.__("Last Checkpoint: %1",s.Time.formatHuman(new Date(o.last_modified)))};a&&a.currentChanged.connect(c),new d.Poll({auto:!0,factory:()=>c(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},v={id:"@retrolab/application-extension:kernel-logo",autoStart:!0,requires:[c.IRetroShell],activate:(e,t)=>{const{serviceManager:n}=e,a=s.PageConfig.getBaseUrl();let o;const r=async()=>{var s,i,c,d,p;o&&(o.dispose(),o.parent=null);const h=t.currentWidget;if(!(h instanceof l.NotebookPanel))return;await h.sessionContext.ready,h.sessionContext.kernelChanged.disconnect(r),h.sessionContext.kernelChanged.connect(r);const C=null!==(c=null===(i=null===(s=h.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===i?void 0:i.name)&&void 0!==c?c:"",f=null===(p=null===(d=n.kernelspecs)||void 0===d?void 0:d.specs)||void 0===p?void 0:p.kernelspecs[C];if(!f)return;let k=f.resources["logo-64x64"];if(!k)return;const v=k.indexOf("kernelspecs");k=a+k.slice(v);const g=document.createElement("div"),m=document.createElement("img");m.src=k,m.title=f.display_name,g.appendChild(m),o=new u.Widget({node:g}),o.addClass("jp-RetroKernelLogo"),e.shell.add(o,"top",{rank:10010})};t.currentChanged.connect(r)}},g={id:"@retrolab/application-extension:kernel-status",autoStart:!0,requires:[c.IRetroShell],activate:(e,t)=>{const n=new u.Widget;n.addClass("jp-RetroKernelStatus"),e.shell.add(n,"menu",{rank:10010});const a=e=>{const t=e.kernelDisplayStatus;let a=`Kernel ${s.Text.titleCase(t)}`;switch(n.removeClass(p),n.removeClass(h),n.removeClass(C),n.removeClass(f),t){case"busy":case"idle":a="",n.addClass(f);break;case"dead":case"terminating":n.addClass(p);break;case"unknown":n.addClass(h);break;default:n.addClass(C),n.addClass(f)}n.node.textContent=a};t.currentChanged.connect((async()=>{const e=t.currentWidget;e instanceof l.NotebookPanel&&e.sessionContext.statusChanged.connect(a)}))}},m={id:"@retrolab/application-extension:paths",activate:e=>{if(!(e instanceof c.RetroApp))throw new Error(`${m.id} must be activated in RetroLab.`);return e.paths},autoStart:!0,provides:a.JupyterFrontEnd.IPaths},R={id:"@retrolab/application-extension:shell",activate:e=>{if(!(e.shell instanceof c.RetroShell))throw new Error(`${R.id} did not find a RetroShell instance.`);return e.shell},autoStart:!0,provides:c.IRetroShell},b=[k,v,g]}}]);