"use strict";(self.webpackChunka_jupyterlab_session=self.webpackChunka_jupyterlab_session||[]).push([[568],{568:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var i=a(980),n=a(250),s=a(571);const o={id:"a-jupyterlab-session:plugin",autoStart:!0,requires:[n.IContents],activate:(e,t)=>{const a=".sessions",n="requirements.txt";t.ready.then((async()=>{console.log("JupyterLite server extension a-jupyterlab-session is activated!"),await t.get(a,{content:!1})||await t.newUntitled({type:"directory",path:i.PathExt.dirname(a)}).then((async e=>{await t.rename(e.path,a)}));const o=(new Date).toLocaleDateString("en-us",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).replace(/\//g,".").replace(", ","-"),r=(0,s.v4)().slice(0,8),c=i.PathExt.join(a,`${o}-${r}`);await t.newUntitled({type:"directory",path:i.PathExt.dirname(c)}).then((async e=>{await t.rename(e.path,c)})),await e.commands.execute("filebrowser:open-path",{path:c}),await t.copy(n,c).catch((e=>console.warn(`Failed to copy the ${n} file to the new session: ${e}`)))}))}}}}]);