"use strict";(self.webpackChunkGiN=self.webpackChunkGiN||[]).push([[480],{4480:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r=n(6728),o=n(9828),a=n(6616),d=n(6999),i=n(4080),c=n(7455),l=n(7372),s=n(841),u=n(6988),p=(n(8657),n(3992),n(7936));const g=Object.assign(Object.assign(Object.assign({},s),u)),m={id:"GiN:plugin",requires:[r.IJupyterWidgetRegistry],optional:[d.IMainMenu,o.ILayoutRestorer,o.ILabShell,a.INotebookTracker],activate:function(e,t,n,r,o,a){!function(e,t){l.o.jupyter_app=e,l.o.notebook_tracker=t,l.o.context(),W(t)}(e,a);const d=new c.ToolRegistry,s=new i.Ld;return t.registerWidget({name:"GiN",version:"0.1.0",exports:g}),[d,s]},autoStart:!0};function h(e,t){var n=`<div class="lm-Widget p-Widget lm-Panel p-Panel jp-OutputArea-child">\n                        <div class="lm-Widget p-Widget jp-OutputPrompt jp-OutputArea-prompt"></div>\n                        <div class="lm-Widget p-Widget lm-Panel p-Panel jupyter-widgets jp-OutputArea-output">${e}</div>\n                    </div>`;const r=(new DOMParser).parseFromString(n,"text/html").querySelector(".lm-Widget.p-Widget.lm-Panel.p-Panel.jp-OutputArea-child"),o=t.currentWidget.content;return(0,p.ri)().includes(o.id),_.each(r.querySelectorAll(".nbtools-run"),(e=>{e.innerText="Update form for current user",e.addEventListener("click",(async()=>{t.currentWidget.context;const n=t.currentWidget.context.sessionContext;t.currentWidget.sessionContext.ready.then((()=>t.currentWidget.revealed)).then((()=>{a.NotebookActions.run(o,n)})),e.parentNode.parentNode.parentNode.parentNode.parentNode.parentElement.removeChild(e.parentNode.parentNode.parentNode.parentNode.parentNode)}))})),r}const W=e=>{const t=(0,p.ri)();e.currentChanged.connect(((e,n)=>{e.currentWidget&&e.currentWidget.context.ready.then((()=>{const n=e.currentWidget.content,r=e.currentWidget.context.sessionContext;!1===t.includes(n.id)&&(p.X1.ranNotebookIds.push(n.id),e.currentWidget.sessionContext.ready.then((()=>e.currentWidget.revealed)).then((async()=>{for(var t=e.currentWidget.content.widgets,o=0;o<t.length;o++)t[o].model.metadata.get("galaxy_cell")&&(null==t[o].model.metadata.get("html")||""==t[o].model.metadata.get("html")?((0,u.removeAllChildNodes)(t[o].outputArea.node),n.activeCellIndex=o,await a.NotebookActions.run(n,r)):((0,u.removeAllChildNodes)(t[o].outputArea.node),t[o].outputArea.node.append(h(t[o].model.metadata.get("html"),e))))})))}))}))}}}]);