tMenuItems:!0})),t.length>F&&s.appendChild(ft(i)),s.appendChild(D(t.slice(-1*F).join(`
`),n)),s}var O={};function Lt(i,t,n,s){O[t]||(O[t]=0);let e=n.split(/\r\n|\r|\n/g),l=e.length+O[t];return l>bt?!1:(i.appendChild(D(e.join(`
`),s)),O[t]=l,!0)}function S(i,t,n){let{linesLimit:s,error:e,scrollable:l,trustHtml:r,linkifyFilePaths:o}=n,a={linkifyFilePaths:o,trustHtml:r},u=t.split(/\r\n|\r|\n/g);O[i]=O[i]=Math.min(u.length,F);let m;return l?m=xt(i,u,a):m=Et(i,u,s,a),m.setAttribute("output-item-id",i),e&&m.classList.add("error"),m}function G(i,t,n){let s=i.appendedText?.(),e={linkifyFilePaths:n.linkifyFilePaths,trustHtml:n.trustHtml};if(s&&n.scrollable&&Lt(t,i.id,s,e))return;let l=S(i.id,i.text(),n);for(t.replaceWith(l);l.nextSibling;)l.nextSibling.remove()}function Y(i,t){let n;return n=i.replace(/\u001b\[4\dm/g,""),n=n.replace(/(?<=\u001b\[[\d;]*?);4\d(?=m)/g,""),n=n.replace(/\u001b\[38;.*?\d+m/g,"\x1B[39m"),n=n.replace(/(;32m[ ->]*?)(\d+)(.*)\n/g,(s,e,l,r)=>(r=r.replace(/\u001b\[3\d+m/g,"\x1B[39m"),`${e}${l}${r}
`)),At(n)&&t?Rt(n):{formattedStack:n}}var dt=/\u001b\[.+?m/g,P=/File\s+(?:\u001b\[.+?m)?(.+):(\d+)/,z=/(-+>(?:\u001b\[[\d;]*m|\s)*)(\d+)(.*)/,I=/^(?<prefix>(?:\u001b\[[\d;]*m|\s)*Cell(?:\u001b\[[\d;]*m|\s)*In(?:\u001b\[[\d;]*m|\s)*\[(?<executionCount>\d+)\](?:\u001b\[[\d;]*m|\s|,)+)(?<lineLabel>line (?<lineNumber>\d+))[^\n]*$/m,M=/(?<prefix>Input\s+?(?:\u001b\[.+?m)(?<cellLabel>In\s*\[(?<executionCount>\d+)\]))(?<postfix>.*)/;function At(i){return I.test(i)||M.test(i)||P.test(i)}function N(i){return i.replace(dt,"").trim()}function Rt(i){let t=i.split(`
`),n,s="";for(let l in t){let r=t[l];if(P.test(r)){let o=t[l].match(P);n={kind:"file",path:N(o[1])};continue}else if(I.test(r)){n={kind:"cell",path:N(r.replace(I,"vscode-notebook-cell:?execution_count=$<executionCount>"))};let o=r.replace(I,`<a href='${n.path}&line=$<lineNumber>'>line $<lineNumber></a>`);t[l]=r.replace(I,`$<prefix>${o}`),s=s||o;continue}else if(M.test(r)){n={kind:"cell",path:N(r.replace(M,"vscode-notebook-cell:?execution_count=$<executionCount>"))};let o=r.replace(M,`<a href='${n.path}'>$<cellLabel></a>`);t[l]=r.replace(M,`Input ${o}$<postfix>`);continue}else if(!n||r.trim()===""){n=void 0;continue}else if(z.test(r)){t[l]=r.replace(z,(o,a,u,m)=>n?.kind==="file"?`${a}<a href='${n?.path}:${u}'>${u}</a>${m}`:`${a}<a href='${n?.path}&line=${u}'>${u}</a>${m}`);continue}}let e=s;return{formattedStack:t.join(`
`),errorLocation:e}}function $(i){for(;i.firstChild;)i.firstChild.remove()}function vt(i,t){let n=new Blob([i.data()],{type:i.mime}),s=URL.createObjectURL(n),e={dispose:()=>{URL.revokeObjectURL(s)}};if(t.firstChild){let a=t.firstChild;if(a.firstChild&&a.firstChild.nodeName==="IMG"&&a.firstChild instanceof HTMLImageElement)return a.firstChild.src=s,e}let l=document.createElement("img");l.src=s;let r=nt(i);r&&(l.alt=r),l.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",outputId:i.id,preventDefaultContextMenuItems:!0}));let o=document.createElement("div");return o.classList.add("display"),o.appendChild(l),t.appendChild(o),e}var Tt=["type","src","nonce","noModule","async"],tt=i=>{let t=Array.from(i.getElementsByTagName("script"));for(let n=0;n<t.length;n++){let s=t[n],e=document.createElement("script"),l=k?.createScript(s.innerText)??s.innerText;e.text=l;for(let r of Tt){let o=s[r]||s.getAttribute&&s.getAttribute(r);o&&e.setAttribute(r,o)}i.appendChild(e).parentNode.removeChild(e)}};function nt(i){let t=i.metadata;if(typeof t=="object"&&t&&typeof t.vscode_altText=="string")return t.vscode_altText}function kt(i,t){if(i.mime.indexOf("svg")>-1){let n=t.querySelector("svg"),s=nt(i);if(n&&s){let e=document.createElement("title");e.innerText=s,n.prepend(e)}n&&(n.classList.add("output-image"),n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",outputId:i.id,preventDefaultContextMenuItems:!0})))}}async function Ut(i,t,n,s){$(t);let e=document.createElement("div"),l=i.text(),r=k?.createHTML(l)??l;e.innerHTML=r,kt(i,e);for(let o of s)if(e=await o.postRender(i,e,n)??e,n.aborted)return;t.appendChild(e),tt(e)}async function wt(i,t,n,s){let e=i.text();for(let a of s)if(e=await a.preEvaluate(i,t,e,n)??e,n.aborted)return;let l=document.createElement("script");l.type="module",l.textContent=e;let r=document.createElement("div"),o=k?.createHTML(l.outerHTML)??l.outerHTML;r.innerHTML=o,t.appendChild(r),tt(r)}function W(){let i=[];return{push:(...n)=>{i.push(...n)},dispose:()=>{i.forEach(n=>n.dispose())}}}function Dt(i,t,n,s){let e=W();$(t);let l;try{l=JSON.parse(i.text())}catch(o){return console.log(o),e}let r=l.name&&l.message?`${l.name}: ${l.message}`:l.name||l.message;if(l.stack){let o=n.settings.minimalError&&!!r?.length;t.classList.add("traceback");let{formattedStack:a,errorLocation:u}=Y(l.stack,s),m=!o&&V(i,n.settings),d={linesLimit:o?1e3:n.settings.lineLimit,scrollable:m,trustHtml:s,linkifyFilePaths:!1},f=S(i.id,a,d),A=document.createElement("div");A.appendChild(f),t.classList.toggle("word-wrap",n.settings.outputWordWrap),e.push(n.onDidChangeSettings(_=>{t.classList.toggle("word-wrap",_.outputWordWrap)})),o?Ot(u,r,A,t):(A.classList.toggle("scrollable",m),t.appendChild(A),K(A,e))}else{let o=document.createElement("div");r&&(o.innerText=r,t.appendChild(o))}return t.classList.add("error"),e}function Ot(i,t,n,s){let e=document.createElement("div"),l=document.createElement("div");l.classList.add("error-output-header"),i&&i.indexOf("<a")===0&&(l.innerHTML=i);let r=document.createElement("span");r.innerText=t,l.appendChild(r),e.appendChild(l);function o(m){let b=document.createElement("li");return b.appendChild(m),b.onmouseover=function(){b.classList.add("hover")},b.onmouseout=function(){b.classList.remove("hover")},b}let a=document.createElement("ul");a.classList.add("error-output-actions"),e.appendChild(a);let u=document.createElement("a");u.innerText="Show Details",u.href="#!",a.appendChild(o(u)),u.onclick=m=>{m.preventDefault();let b=n.style.display==="none";n.style.display=b?"":"none",u.innerText=b?"Hide Details":"Show Details"},e.appendChild(n),n.style.display="none",s.appendChild(e)}function St(i){let t=i.parentElement,n,s=t?.previousSibling;for(;s;){let e=s.firstChild;if(!e||!e.classList.contains("output-stream"))break;n=e.firstChild,s=s?.previousSibling}return n}function Z(i){let t=i.target;t.scrollTop===0?t.classList.remove("more-above"):t.classList.add("more-above")}function Q(i){i.ctrlKey||i.shiftKey||(i.code==="ArrowDown"||i.code==="ArrowUp"||i.code==="End"||i.code==="Home"||i.code==="PageUp"||i.code==="PageDown")&&i.stopPropagation()}function K(i,t,n){if(i.classList.contains(y)){let s=i.scrollHeight>i.clientHeight;i.classList.toggle("scrollbar-visible",s),i.scrollTop=n!==void 0?n:i.scrollHeight,s&&(i.addEventListener("scroll",Z),t.push({dispose:()=>i.removeEventListener("scroll",Z)}),i.addEventListener("keydown",Q),t.push({dispose:()=>i.removeEventListener("keydown",Q)}))}}function It(i){let t=i.querySelector("."+y);if(t&&t.scrollHeight-t.scrollTop-t.clientHeight>2)return t.scrollTop}function V(i,t){let n=i.metadata;return typeof n=="object"&&n&&typeof n.scrollable=="boolean"?n.scrollable:t.outputScrolling}function h(i,t,n,s){let e=W(),l=V(i,s.settings),r={linesLimit:s.settings.lineLimit,scrollable:l,trustHtml:!1,error:n,linkifyFilePaths:s.settings.linkifyFilePaths};t.classList.add("output-stream");let o=l?It(t):void 0,a=St(t);if(a){let u=a.querySelector(`[output-item-id="${i.id}"]`);if(u)G(i,u,r);else{let m=S(i.id,i.text(),r);a.appendChild(m)}a.classList.toggle("scrollbar-visible",a.scrollHeight>a.clientHeight),a.scrollTop=o!==void 0?o:a.scrollHeight}else{let u=t.querySelector(`[output-item-id="${i.id}"]`),m=u?.parentElement;if(u&&m)G(i,u,r);else{let b=S(i.id,i.text(),r);for(m=document.createElement("div"),m.appendChild(b);t.firstChild;)t.firstChild.remove();t.appendChild(m)}m.classList.toggle("scrollable",l),t.classList.toggle("word-wrap",s.settings.outputWordWrap),e.push(s.onDidChangeSettings(b=>{t.classList.toggle("word-wrap",b.outputWordWrap)})),K(m,e,o)}return e}function C(i,t,n){let s=W();$(t);let e=i.text(),l=V(i,n.settings),r={linesLimit:n.settings.lineLimit,scrollable:l,trustHtml:!1,linkifyFilePaths:n.settings.linkifyFilePaths},o=S(i.id,e,r);return o.classList.add("output-plaintext"),o.classList.toggle("word-wrap",n.settings.outputWordWrap),s.push(n.onDidChangeSettings(a=>{o.classList.toggle("word-wrap",a.outputWordWrap)})),o.classList.toggle("scrollable",l),t.appendChild(o),K(o,s),s}var zt=i=>{let t=new Map,n=new Set,s=new Set,e=i,l=document.createElement("style");return l.textContent=`
	#container div.output.remove-padding {
		padding-left: 0;
		padding-right: 0;
	}
	.output-plaintext,
	.output-stream,
	.traceback {
		display: inline-block;
		width: 100%;
		line-height: var(--notebook-cell-output-line-height);
		font-family: var(--notebook-cell-output-font-family);
		font-size: var(--notebook-cell-output-font-size);
		user-select: text;
		-webkit-user-select: text;
		-ms-user-select: text;
		cursor: auto;
		word-wrap: break-word;
		/* text/stream output container should scroll but preserve newline character */
		white-space: pre;
	}
	/* When wordwrap turned on, force it to pre-wrap */
	#container div.output_container .word-wrap {
		white-space: pre-wrap;
	}
	#container div.output>div {
		padding-left: var(--notebook-output-node-left-padding);
		padding-right: var(--notebook-output-node-padding);
		box-sizing: border-box;
		border-width: 1px;
		border-style: solid;
		border-color: transparent;
	}
	#container div.output>div:focus {
		outline: 0;
		border-color: var(--theme-input-focus-border-color);
	}
	#container div.output .scrollable {
		overflow-y: auto;
		max-height: var(--notebook-cell-output-max-height);
	}
	#container div.output .scrollable.scrollbar-visible {
		border-color: var(--vscode-editorWidget-border);
	}
	#container div.output .scrollable.scrollbar-visible:focus {
		border-color: var(--theme-input-focus-border-color);
	}
	#container div.truncation-message {
		font-style: italic;
		font-family: var(--theme-font-family);
		padding-top: 4px;
	}
	#container div.output .scrollable div {
		cursor: text;
	}
	#container div.output .scrollable div a {
		cursor: pointer;
	}
	#container div.output .scrollable.more-above {
		box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
	}
	.output-plaintext .code-bold,
	.output-stream .code-bold,
	.traceback .code-bold {
		font-weight: bold;
	}
	.output-plaintext .code-italic,
	.output-stream .code-italic,
	.traceback .code-italic {
		font-style: italic;
	}
	.output-plaintext .code-strike-through,
	.output-stream .code-strike-through,
	.traceback .code-strike-through {
		text-decoration: line-through;
	}
	.output-plaintext .code-underline,
	.output-stream .code-underline,
	.traceback .code-underline {
		text-decoration: underline;
	}
	#container ul.error-output-actions {
		margin: 0px;
		padding: 6px 0px 0px 6px;
		padding-inline-start: 0px;
	}
	#container .error-output-actions li {
		padding: 0px 4px 0px 4px;
		border-radius: 5px;
		height: 20px;
		display: inline-flex;
		cursor: pointer;
		border: solid 1px var(--vscode-notebook-cellToolbarSeparator);
	}
	#container .error-output-actions li.hover {
		background-color: var(--vscode-toolbar-hoverBackground);
	}
	#container .error-output-actions li:focus-within {
		border-color: var(--theme-input-focus-border-color);
	}
	#container .error-output-actions a:focus {
		outline: 0;
	}
	#container .error-output-actions li a {
		color: var(--vscode-foreground);
		text-decoration: none;
	}
	#container .error-output-header a {
		padding-right: 12px;
	}
	`,document.body.appendChild(l),{renderOutputItem:async(r,o,a)=>{switch(o.classList.add("remove-padding"),r.mime){case"text/html":case"image/svg+xml":{if(!i.workspace.isTrusted)return;await Ut(r,o,a,n);break}case"application/javascript":{if(!i.workspace.isTrusted)return;wt(r,o,a,s);break}case"image/gif":case"image/png":case"image/jpeg":case"image/git":{t.get(r.id)?.dispose();let u=vt(r,o);t.set(r.id,u)}break;case"application/vnd.code.notebook.error":{t.get(r.id)?.dispose();let u=Dt(r,o,e,i.workspace.isTrusted);t.set(r.id,u)}break;case"application/vnd.code.notebook.stdout":case"application/x.notebook.stdout":case"application/x.notebook.stream":{t.get(r.id)?.dispose();let u=h(r,o,!1,e);t.set(r.id,u)}break;case"application/vnd.code.notebook.stderr":case"application/x.notebook.stderr":{t.get(r.id)?.dispose();let u=h(r,o,!0,e);t.set(r.id,u)}break;case"text/plain":{t.get(r.id)?.dispose();let u=C(r,o,e);t.set(r.id,u)}break;default:if(r.mime.indexOf("text/")>-1){t.get(r.id)?.dispose();let u=C(r,o,e);t.set(r.id,u)}break}o.querySelector("div")&&(o.querySelector("div").tabIndex=0)},disposeOutputItem:r=>{r?t.get(r)?.dispose():t.forEach(o=>o.dispose())},experimental_registerHtmlRenderingHook:r=>(n.add(r),{dispose:()=>{n.delete(r)}}),experimental_registerJavaScriptRenderingHook:r=>(s.add(r),{dispose:()=>{s.delete(r)}})}};export{zt as activate};
