homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge.
2 lines (1 loc) • 3.26 kB
JavaScript
import{e as I}from"./chunk-QSPBB6EE.js";var j=I((k,m)=>{(function(g,l){typeof k=="object"&&typeof m=="object"?m.exports=l():typeof define=="function"&&define.amd?define([],l):typeof k=="object"?k.WebLinksAddon=l():g.WebLinksAddon=l()})(self,function(){return(()=>{"use strict";var g={6:(a,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkComputer=r.WebLinkProvider=void 0;var s=function(){function o(n,i,e,t){t===void 0&&(t={}),this._terminal=n,this._regex=i,this._handler=e,this._options=t}return o.prototype.provideLinks=function(n,i){var e=p.computeLink(n,this._regex,this._terminal,this._handler);i(this._addCallbacks(e))},o.prototype._addCallbacks=function(n){var i=this;return n.map(function(e){return e.leave=i._options.leave,e.hover=function(t,u){if(i._options.hover){var c=e.range;i._options.hover(t,u,c)}},e})},o}();r.WebLinkProvider=s;var p=function(){function o(){}return o.computeLink=function(n,i,e,t){for(var u,c=new RegExp(i.source,(i.flags||"")+"g"),_=o._translateBufferLineToStringWithWrap(n-1,!1,e),d=_[0],f=_[1],v=-1,w=[];(u=c.exec(d))!==null;){var h=u[1];if(!h){console.log("match found without corresponding matchIndex");break}if(v=d.indexOf(h,v+1),c.lastIndex=v+h.length,v<0)break;for(var b=v+h.length,y=f+1;b>e.cols;)b-=e.cols,y++;for(var L=v+1,P=f+1;L>e.cols;)L-=e.cols,P++;var M={start:{x:L,y:P},end:{x:b,y}};w.push({range:M,text:h,activate:t})}return w},o._translateBufferLineToStringWithWrap=function(n,i,e){var t,u,c="";do{if(!(d=e.buffer.active.getLine(n)))break;d.isWrapped&&n--,u=d.isWrapped}while(u);var _=n;do{var d,f=e.buffer.active.getLine(n+1);if(t=!!f&&f.isWrapped,!(d=e.buffer.active.getLine(n)))break;c+=d.translateToString(!t&&i).substring(0,e.cols),n++}while(t);return[c,_]},o}();r.LinkComputer=p}},l={};function x(a){var r=l[a];if(r!==void 0)return r.exports;var s=l[a]={exports:{}};return g[a](s,s.exports,x),s.exports}var W={};return(()=>{var a=W;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;var r=x(6),s=new RegExp(`(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,18}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+@]*)*([^:"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)`);function p(n,i){var e=window.open();if(e){try{e.opener=null}catch{}e.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var o=function(){function n(i,e,t){i===void 0&&(i=p),e===void 0&&(e={}),t===void 0&&(t=!1),this._handler=i,this._options=e,this._useLinkProvider=t}return n.prototype.activate=function(i){if(this._terminal=i,this._useLinkProvider&&"registerLinkProvider"in this._terminal){var e=(t=this._options).urlRegex||s;this._linkProvider=this._terminal.registerLinkProvider(new r.WebLinkProvider(this._terminal,e,this._handler,t))}else{var t;(t=this._options).matchIndex=1,this._linkMatcherId=this._terminal.registerLinkMatcher(s,this._handler,t)}},n.prototype.dispose=function(){var i;this._linkMatcherId!==void 0&&this._terminal!==void 0&&this._terminal.deregisterLinkMatcher(this._linkMatcherId),(i=this._linkProvider)===null||i===void 0||i.dispose()},n}();a.WebLinksAddon=o})(),W})()})});export{j as a};