"use strict";(self.webpackChunkgennaker_tools=self.webpackChunkgennaker_tools||[]).push([[509],{509:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b,reloadPlugin:()=>c,snippetsPlugin:()=>m,statelessRunPlugin:()=>d});var n=o(389),a=o(827),r=o(591),s=o(460),l=o(505);const i="gennaker-tools:restart-run-stateless",p="gennaker-tools:reset-jupyterlab",d={id:"gennaker-tools:stateless-run",description:"A JupyterLab extension.",autoStart:!0,requires:[a.ICommandPalette,n.INotebookTracker],optional:[r.ITranslator],activate:(e,t,o,n)=>{const a=(null!=n?n:r.nullTranslator).load("jupyterlab"),{commands:s,shell:l}=e;console.log("JupyterLab extension gennaker-tools is activated!"),s.addCommand(i,{label:"Restart Kernel, Clear Outputs, and Run All Above Selected Cell",caption:"Clear all outputs, restart kernel, and run all cells above the selected cell",isEnabled:()=>(console.log("enabed",{tracker:o,shell:l}),null!==o.currentWidget&&o.currentWidget===l.currentWidget),execute:async e=>{const t=e.origin;console.log(`${i} has been called from... ${t}.`),"init"!==t&&await s.execute("apputils:run-all-enabled",{commands:["notebook:clear-all-cell-outputs","notebook:restart-and-run-to-selected"]})}});const p=a.__("Notebook Operations");t.addItem({command:i,category:p,args:{origin:"from palette"}})}},c={id:"gennaker-tools:reload",description:"A JupyterLab extension.",autoStart:!0,requires:[a.ICommandPalette],optional:[r.ITranslator],activate:(e,t,o)=>{const{commands:n}=e,a=(null!=o?o:r.nullTranslator).load("jupyterlab");n.addCommand(p,{label:"Reset JupyterLab",caption:"Reset JupyterLab",isEnabled:()=>!0,execute:e=>{"init"!==e.origin&&window.location.reload()}});const s=a.__("Reset");t.addItem({command:p,category:s,args:{origin:"from palette"}})}},u={properties:{snippets:{type:"array",title:"Codemirror snippets",description:"Snippets of the form accepted by Codemirrors snippetCompletion",items:{type:"object",properties:{type:{type:"string",enum:["class","constant","enum","function","interface","keyword","method","namespace","property","text","type","variable"]},body:{type:"string"},label:{type:"string"}},required:["type","body","label"]}}},additionalProperties:!1,type:"object"},m={id:"gennaker-tools:snippets",description:"A JupyterLab extension.",autoStart:!0,requires:[s.IEditorExtensionRegistry],optional:[],activate:(e,t)=>{t.addExtension(Object.freeze({name:"gennaker-tools:snippets",factory:()=>s.EditorExtensionRegistry.createConfigurableExtension(e=>(0,l.autocompletion)({override:[(0,l.completeFromList)(e.snippets.map(e=>{const{body:t,...o}=e;return(0,l.snippetCompletion)(t,o)}))]})),default:{snippets:[]},schema:u}))}},b=[d,c,m]}}]);