"use strict";(self.webpackChunkopensarlab_frontend=self.webpackChunkopensarlab_frontend||[]).push([[648],{648:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var a=n(172),o=n(778);class s extends o.Widget{constructor(){super(),this.hyperlink=document.createElement("a"),this.hyperlink.text="OpenSARlab Docs",this.hyperlink.href="https://opensarlab-docs.asf.alaska.edu/user-guides/how_to_run_a_notebook/",this.hyperlink.target="blank",this.addClass("opensarlab-doc-link-widget"),this.addClass("opensarlab-widget"),this.node.appendChild(this.hyperlink)}}var r=n(987),l=n(790);async function i(e="",t={}){const n=l.ServerConnection.makeSettings(),a=r.URLExt.join(n.baseUrl,"opensarlab-frontend",e);let o;try{o=await l.ServerConnection.makeRequest(a,t,n)}catch(e){throw new l.ServerConnection.NetworkError(e)}let s=await o.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.log("Not a JSON response body.",o)}if(!o.ok)throw new l.ServerConnection.ResponseError(o,s.message||s);return s}class d extends o.Widget{constructor(){super(),this.span=document.createElement("span"),this.addClass("opensarlab-profile-label-widget"),this.addClass("opensarlab-widget"),this.node.appendChild(this.span)}}var c=n(51),p=n.n(c);const h={id:"opensarlab_frontend:plugin",description:"A JupyterLab extension.",autoStart:!0,activate:e=>{var t;console.log("JupyterLab extension opensarlab_frontend is activated!"),function(e,t){const n=new a.ToolbarButton({className:"opensarlab-gitcap-btn",label:"GIF Capture",onClick:()=>{window.open("https://gifcap.dev","_blank")},tooltip:"Create and download screen capture GIFs"});n.id=a.DOMUtils.createDomID(),n.addClass("opensarlab-widget"),e.shell.add(n,"top",{rank:1025})}(e),async function(e,t){let n=null;try{n=await i("opensarlab-profile-label"),console.log(n)}catch(e){console.error(`Error on GET /opensarlab-frontend/opensarlab-profile-label.\n${e}`)}const o=new d;o.id=a.DOMUtils.createDomID(),o.span.innerText=n.data,e.shell.add(o,"top",{rank:1050})}(e),function(e,t){const n=new s;n.id=a.DOMUtils.createDomID(),e.shell.add(n,"top",{rank:1100})}(e),function(e,t){const n=new a.ToolbarButton({className:"opensarlab-controlbtn",label:"Shutdown and Logout Page",onClick:()=>{window.location.href="/hub/home"},tooltip:"Hub Control Panel: A place to stop the server and logout"});n.id=a.DOMUtils.createDomID(),n.addClass("opensarlab-widget"),e.shell.add(n,"top",{rank:1110})}(e),console.log("JupyterLab extension opensarlab_oslnotify is activated!"),t="storage,calendar",document.head.insertAdjacentHTML("beforeend","<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css'/>"),document.head.insertAdjacentHTML("beforeend","<style>#toast-container>div{opacity:1;}</style>"),i(`opensarlab-oslnotify?type=${t}`).then((e=>{!function(e){p().options=e.options,e.data.forEach((e=>{p()[e.type](e.message,e.title)}))}(e)})).catch((e=>{console.log(`Error on GET /opensarlab-frontend/opensarlab-oslnotify.\n${e}`)}))}}}}]);