(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9853,3844],{23844:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var o=n(42489),s=n(78919),a=n(82475),r=n(26162),l=n(93245),d=n(38769),c=n(39462),i=n(36735);const u="jp-RetroKernelStatus-error",C="jp-RetroKernelStatus-warn",k="jp-RetroKernelStatus-info",h="jp-RetroKernelStatus-fade",p=[{id:"@retrolab/notebook-extension:checkpoints",autoStart:!0,requires:[a.IDocumentManager,l.ITranslator],optional:[d.IRetroShell],activate:(e,t,n,a)=>{const{shell:r}=e,l=n.load("retrolab"),d=new i.Widget;d.id=o.DOMUtils.createDomID(),d.addClass("jp-RetroCheckpoint"),e.shell.add(d,"top",{rank:100});const u=async()=>{const e=r.currentWidget;if(!e)return;const n=t.contextForWidget(e);null==n||n.fileChanged.disconnect(u),null==n||n.fileChanged.connect(u);const o=await(null==n?void 0:n.listCheckpoints());if(!o)return;const a=o[o.length-1];d.node.textContent=l.__("Last Checkpoint: %1",s.Time.formatHuman(new Date(a.last_modified)))};a&&a.currentChanged.connect(u),new c.Poll({auto:!0,factory:()=>u(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},{id:"@retrolab/notebook-extension:kernel-logo",autoStart:!0,requires:[d.IRetroShell],activate:(e,t)=>{const{serviceManager:n}=e;let o;const s=async()=>{var a,l,d,c,u;o&&(o.dispose(),o.parent=null);const C=t.currentWidget;if(!(C instanceof r.NotebookPanel))return;await C.sessionContext.ready,C.sessionContext.kernelChanged.disconnect(s),C.sessionContext.kernelChanged.connect(s);const k=null!==(d=null===(l=null===(a=C.sessionContext.session)||void 0===a?void 0:a.kernel)||void 0===l?void 0:l.name)&&void 0!==d?d:"",h=null===(u=null===(c=n.kernelspecs)||void 0===c?void 0:c.specs)||void 0===u?void 0:u.kernelspecs[k];if(!h)return;const p=h.resources["logo-64x64"];if(!p)return;const g=document.createElement("div"),v=document.createElement("img");v.src=p,v.title=h.display_name,g.appendChild(v),o=new i.Widget({node:g}),o.addClass("jp-RetroKernelLogo"),e.shell.add(o,"top",{rank:10010})};e.started.then((()=>{t.currentChanged.connect(s)}))}},{id:"@retrolab/notebook-extension:kernel-status",autoStart:!0,requires:[d.IRetroShell,l.ITranslator],activate:(e,t,n)=>{const o=n.load("retrolab"),a=new i.Widget;a.addClass("jp-RetroKernelStatus"),e.shell.add(a,"menu",{rank:10010});const l=e=>{const t=e.kernelDisplayStatus;let n=`Kernel ${s.Text.titleCase(t)}`;switch(a.removeClass(u),a.removeClass(C),a.removeClass(k),a.removeClass(h),t){case"busy":case"idle":n="",a.addClass(h);break;case"dead":case"terminating":a.addClass(u);break;case"unknown":a.addClass(C);break;default:a.addClass(k),a.addClass(h)}a.node.textContent=o.__(n)};t.currentChanged.connect((async()=>{const e=t.currentWidget;e instanceof r.NotebookPanel&&e.sessionContext.statusChanged.connect(l)}))}}]}}]);