(self.webpackChunkchartfactor_jlab_ext=self.webpackChunkchartfactor_jlab_ext||[]).push([[568],{568:(e,t,n)=>{const s=n(788).Z;e.exports=[{id:"chartfactor_jlab_ext",autoStart:!0,activate:function(e){const t=new s;e.docRegistry.addWidgetExtension("Notebook",t)}}]},788:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o}),n(979);var s=n(138);class a{constructor(e){this._sessionContext=e,this._future=null,this._kernel_id=void 0}future(e,t=null){this._future=e,e&&(e.onIOPub=e=>{switch(e.header.msg_type){case"execute_result":if(t){const n=e.content.data["text/plain"]||"";t(n)}else t("");break;case"display_data":case"update_display_data":t&&t("");break;case"stream":t(t?e.content.text.trim():"");break;case"error":t&&e.content.ename&&e.content.evalue?("name 'cf' is not defined"===e.content.evalue&&(e.content.evalue="Name 'cf' is not defined. Please execute 'from chartfactor import *' in any cell above."),t(`{"ename": "${e.content.ename}", "evalue": "${e.content.evalue}"}`)):t("")}})}execute(e,t=null){this._sessionContext&&this._sessionContext.session?.kernel&&this.future(this._sessionContext.session?.kernel?.requestExecute({code:e}),t)}}class o{createNew(e,t){const n=new a(t.sessionContext);return t.sessionContext.ready.then((e=>{n._kernel_id=t.sessionContext.session?.kernel?.id,window.JupyterLab||(window.JupyterLab={}),window.JupyterLab[n._kernel_id]={notebook:{kernel:n}}})).catch((e=>console.error(e))),new s.DisposableDelegate((()=>{}))}}}}]);