(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6521],{86521:e=>{var t;self,t=()=>(()=>{"use strict";var e={6:(e,t)=>{function r(e){try{const t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,r,n={}){this._terminal=e,this._regex=t,this._handler=r,this._options=n}provideLinks(e,t){const r=n.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,r)=>{if(this._options.hover){const{range:n}=e;this._options.hover(t,r,n)}},e)))}};class n{static computeLink(e,t,s,i){const o=new RegExp(t.source,(t.flags||"")+"g"),[a,l]=n._getWindowedLineStrings(e-1,s),c=a.join("");let d;const h=[];for(;d=o.exec(c);){const e=d[0];if(!r(e))continue;const[t,o]=n._mapStrIdx(s,l,0,d.index),[a,c]=n._mapStrIdx(s,t,o,e.length);if(-1===t||-1===o||-1===a||-1===c)continue;const p={start:{x:o+1,y:t+1},end:{x:c,y:a+1}};h.push({range:p,text:e,activate:i})}return h}static _getWindowedLineStrings(e,t){let r,n=e,s=e,i=0,o="";const a=[];if(r=t.buffer.active.getLine(e)){const e=r.translateToString(!0);if(r.isWrapped&&" "!==e[0]){for(i=0;(r=t.buffer.active.getLine(--n))&&i<2048&&(o=r.translateToString(!0),i+=o.length,a.push(o),r.isWrapped&&-1===o.indexOf(" ")););a.reverse()}for(a.push(e),i=0;(r=t.buffer.active.getLine(++s))&&r.isWrapped&&i<2048&&(o=r.translateToString(!0),i+=o.length,a.push(o),-1===o.indexOf(" ")););}return[a,n]}static _mapStrIdx(e,t,r,n){const s=e.buffer.active,i=s.getNullCell();let o=r;for(;n;){const e=s.getLine(t);if(!e)return[-1,-1];for(let r=o;r<e.length;++r){e.getCell(r,i);const o=i.getChars();if(i.getWidth()&&(n-=o.length||1,r===e.length-1&&""===o)){const e=s.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,i),2===i.getWidth()&&(n+=1))}if(n<0)return[t,r]}t++,o=0}return[t,o]}}t.LinkComputer=n}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;const t=r(6),s=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function i(e,t){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=i,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const r=this._options,n=r.urlRegex||s;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,n,this._handler,r))}dispose(){this._linkProvider?.dispose()}}})(),n})(),e.exports=t()}}]);
//# sourceMappingURL=6521.ee3d4f9.js.map