@dxos/shell 0.4.3-main.c3bfede → 0.4.3-main.f97384b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,7 +109,7 @@ Check the top-level render call using <`+Ee+">.")}return fe}}function so(q,fe){{
109
109
  * @author Feross Aboukhadijeh <https://feross.org>
110
110
  * @license MIT
111
111
  */(function(e){const t=Vs,r=qu,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=_,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const b=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(b,f),b.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const f=new Uint8Array(b);return Object.setPrototypeOf(f,s.prototype),f}function s(b,f,g){if(typeof b=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(b)}return l(b,f,g)}s.poolSize=8192;function l(b,f,g){if(typeof b=="string")return h(b,f);if(ArrayBuffer.isView(b))return v(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(Oe(b,ArrayBuffer)||b&&Oe(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(b,SharedArrayBuffer)||b&&Oe(b.buffer,SharedArrayBuffer)))return y(b,f,g);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=b.valueOf&&b.valueOf();if(x!=null&&x!==b)return s.from(x,f,g);const O=w(b);if(O)return O;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return s.from(b[Symbol.toPrimitive]("string"),f,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}s.from=function(b,f,g){return l(b,f,g)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function d(b,f,g){return u(b),b<=0?a(b):f!==void 0?typeof g=="string"?a(b).fill(f,g):a(b).fill(f):a(b)}s.alloc=function(b,f,g){return d(b,f,g)};function p(b){return u(b),a(b<0?0:E(b)|0)}s.allocUnsafe=function(b){return p(b)},s.allocUnsafeSlow=function(b){return p(b)};function h(b,f){if((typeof f!="string"||f==="")&&(f="utf8"),!s.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const g=S(b,f)|0;let x=a(g);const O=x.write(b,f);return O!==g&&(x=x.slice(0,O)),x}function m(b){const f=b.length<0?0:E(b.length)|0,g=a(f);for(let x=0;x<f;x+=1)g[x]=b[x]&255;return g}function v(b){if(Oe(b,Uint8Array)){const f=new Uint8Array(b);return y(f.buffer,f.byteOffset,f.byteLength)}return m(b)}function y(b,f,g){if(f<0||b.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<f+(g||0))throw new RangeError('"length" is outside of buffer bounds');let x;return f===void 0&&g===void 0?x=new Uint8Array(b):g===void 0?x=new Uint8Array(b,f):x=new Uint8Array(b,f,g),Object.setPrototypeOf(x,s.prototype),x}function w(b){if(s.isBuffer(b)){const f=E(b.length)|0,g=a(f);return g.length===0||b.copy(g,0,0,f),g}if(b.length!==void 0)return typeof b.length!="number"||Re(b.length)?a(0):m(b);if(b.type==="Buffer"&&Array.isArray(b.data))return m(b.data)}function E(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function _(b){return+b!=b&&(b=0),s.alloc(+b)}s.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==s.prototype},s.compare=function(f,g){if(Oe(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),Oe(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(f)||!s.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===g)return 0;let x=f.length,O=g.length;for(let L=0,W=Math.min(x,O);L<W;++L)if(f[L]!==g[L]){x=f[L],O=g[L];break}return x<O?-1:O<x?1:0},s.isEncoding=function(f){switch(String(f).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(f,g){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return s.alloc(0);let x;if(g===void 0)for(g=0,x=0;x<f.length;++x)g+=f[x].length;const O=s.allocUnsafe(g);let L=0;for(x=0;x<f.length;++x){let W=f[x];if(Oe(W,Uint8Array))L+W.length>O.length?(s.isBuffer(W)||(W=s.from(W)),W.copy(O,L)):Uint8Array.prototype.set.call(O,W,L);else if(s.isBuffer(W))W.copy(O,L);else throw new TypeError('"list" argument must be an Array of Buffers');L+=W.length}return O};function S(b,f){if(s.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||Oe(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const g=b.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&g===0)return 0;let O=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return _e(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Me(b).length;default:if(O)return x?-1:_e(b).length;f=(""+f).toLowerCase(),O=!0}}s.byteLength=S;function $(b,f,g){let x=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,f>>>=0,g<=f))return"";for(b||(b="utf8");;)switch(b){case"hex":return se(this,f,g);case"utf8":case"utf-8":return Y(this,f,g);case"ascii":return oe(this,f,g);case"latin1":case"binary":return ce(this,f,g);case"base64":return Z(this,f,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,f,g);default:if(x)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),x=!0}}s.prototype._isBuffer=!0;function k(b,f,g){const x=b[f];b[f]=b[g],b[g]=x}s.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<f;g+=2)k(this,g,g+1);return this},s.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<f;g+=4)k(this,g,g+3),k(this,g+1,g+2);return this},s.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<f;g+=8)k(this,g,g+7),k(this,g+1,g+6),k(this,g+2,g+5),k(this,g+3,g+4);return this},s.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?Y(this,0,f):$.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(f){if(!s.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:s.compare(this,f)===0},s.prototype.inspect=function(){let f="";const g=e.INSPECT_MAX_BYTES;return f=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(f+=" ... "),"<Buffer "+f+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(f,g,x,O,L){if(Oe(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(g===void 0&&(g=0),x===void 0&&(x=f?f.length:0),O===void 0&&(O=0),L===void 0&&(L=this.length),g<0||x>f.length||O<0||L>this.length)throw new RangeError("out of range index");if(O>=L&&g>=x)return 0;if(O>=L)return-1;if(g>=x)return 1;if(g>>>=0,x>>>=0,O>>>=0,L>>>=0,this===f)return 0;let W=L-O,me=x-g;const ke=Math.min(W,me),$e=this.slice(O,L),Ie=f.slice(g,x);for(let Ae=0;Ae<ke;++Ae)if($e[Ae]!==Ie[Ae]){W=$e[Ae],me=Ie[Ae];break}return W<me?-1:me<W?1:0};function P(b,f,g,x,O){if(b.length===0)return-1;if(typeof g=="string"?(x=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,Re(g)&&(g=O?0:b.length-1),g<0&&(g=b.length+g),g>=b.length){if(O)return-1;g=b.length-1}else if(g<0)if(O)g=0;else return-1;if(typeof f=="string"&&(f=s.from(f,x)),s.isBuffer(f))return f.length===0?-1:C(b,f,g,x,O);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?O?Uint8Array.prototype.indexOf.call(b,f,g):Uint8Array.prototype.lastIndexOf.call(b,f,g):C(b,[f],g,x,O);throw new TypeError("val must be string, number or Buffer")}function C(b,f,g,x,O){let L=1,W=b.length,me=f.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(b.length<2||f.length<2)return-1;L=2,W/=2,me/=2,g/=2}function ke(Ie,Ae){return L===1?Ie[Ae]:Ie.readUInt16BE(Ae*L)}let $e;if(O){let Ie=-1;for($e=g;$e<W;$e++)if(ke(b,$e)===ke(f,Ie===-1?0:$e-Ie)){if(Ie===-1&&(Ie=$e),$e-Ie+1===me)return Ie*L}else Ie!==-1&&($e-=$e-Ie),Ie=-1}else for(g+me>W&&(g=W-me),$e=g;$e>=0;$e--){let Ie=!0;for(let Ae=0;Ae<me;Ae++)if(ke(b,$e+Ae)!==ke(f,Ae)){Ie=!1;break}if(Ie)return $e}return-1}s.prototype.includes=function(f,g,x){return this.indexOf(f,g,x)!==-1},s.prototype.indexOf=function(f,g,x){return P(this,f,g,x,!0)},s.prototype.lastIndexOf=function(f,g,x){return P(this,f,g,x,!1)};function T(b,f,g,x){g=Number(g)||0;const O=b.length-g;x?(x=Number(x),x>O&&(x=O)):x=O;const L=f.length;x>L/2&&(x=L/2);let W;for(W=0;W<x;++W){const me=parseInt(f.substr(W*2,2),16);if(Re(me))return W;b[g+W]=me}return W}function D(b,f,g,x){return at(_e(f,b.length-g),b,g,x)}function j(b,f,g,x){return at(xe(f),b,g,x)}function F(b,f,g,x){return at(Me(f),b,g,x)}function M(b,f,g,x){return at(ae(f,b.length-g),b,g,x)}s.prototype.write=function(f,g,x,O){if(g===void 0)O="utf8",x=this.length,g=0;else if(x===void 0&&typeof g=="string")O=g,x=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(x)?(x=x>>>0,O===void 0&&(O="utf8")):(O=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const L=this.length-g;if((x===void 0||x>L)&&(x=L),f.length>0&&(x<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");O||(O="utf8");let W=!1;for(;;)switch(O){case"hex":return T(this,f,g,x);case"utf8":case"utf-8":return D(this,f,g,x);case"ascii":case"latin1":case"binary":return j(this,f,g,x);case"base64":return F(this,f,g,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,f,g,x);default:if(W)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),W=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Z(b,f,g){return f===0&&g===b.length?t.fromByteArray(b):t.fromByteArray(b.slice(f,g))}function Y(b,f,g){g=Math.min(b.length,g);const x=[];let O=f;for(;O<g;){const L=b[O];let W=null,me=L>239?4:L>223?3:L>191?2:1;if(O+me<=g){let ke,$e,Ie,Ae;switch(me){case 1:L<128&&(W=L);break;case 2:ke=b[O+1],(ke&192)===128&&(Ae=(L&31)<<6|ke&63,Ae>127&&(W=Ae));break;case 3:ke=b[O+1],$e=b[O+2],(ke&192)===128&&($e&192)===128&&(Ae=(L&15)<<12|(ke&63)<<6|$e&63,Ae>2047&&(Ae<55296||Ae>57343)&&(W=Ae));break;case 4:ke=b[O+1],$e=b[O+2],Ie=b[O+3],(ke&192)===128&&($e&192)===128&&(Ie&192)===128&&(Ae=(L&15)<<18|(ke&63)<<12|($e&63)<<6|Ie&63,Ae>65535&&Ae<1114112&&(W=Ae))}}W===null?(W=65533,me=1):W>65535&&(W-=65536,x.push(W>>>10&1023|55296),W=56320|W&1023),x.push(W),O+=me}return ne(x)}const X=4096;function ne(b){const f=b.length;if(f<=X)return String.fromCharCode.apply(String,b);let g="",x=0;for(;x<f;)g+=String.fromCharCode.apply(String,b.slice(x,x+=X));return g}function oe(b,f,g){let x="";g=Math.min(b.length,g);for(let O=f;O<g;++O)x+=String.fromCharCode(b[O]&127);return x}function ce(b,f,g){let x="";g=Math.min(b.length,g);for(let O=f;O<g;++O)x+=String.fromCharCode(b[O]);return x}function se(b,f,g){const x=b.length;(!f||f<0)&&(f=0),(!g||g<0||g>x)&&(g=x);let O="";for(let L=f;L<g;++L)O+=gt[b[L]];return O}function ge(b,f,g){const x=b.slice(f,g);let O="";for(let L=0;L<x.length-1;L+=2)O+=String.fromCharCode(x[L]+x[L+1]*256);return O}s.prototype.slice=function(f,g){const x=this.length;f=~~f,g=g===void 0?x:~~g,f<0?(f+=x,f<0&&(f=0)):f>x&&(f=x),g<0?(g+=x,g<0&&(g=0)):g>x&&(g=x),g<f&&(g=f);const O=this.subarray(f,g);return Object.setPrototypeOf(O,s.prototype),O};function le(b,f,g){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+f>g)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(f,g,x){f=f>>>0,g=g>>>0,x||le(f,g,this.length);let O=this[f],L=1,W=0;for(;++W<g&&(L*=256);)O+=this[f+W]*L;return O},s.prototype.readUintBE=s.prototype.readUIntBE=function(f,g,x){f=f>>>0,g=g>>>0,x||le(f,g,this.length);let O=this[f+--g],L=1;for(;g>0&&(L*=256);)O+=this[f+--g]*L;return O},s.prototype.readUint8=s.prototype.readUInt8=function(f,g){return f=f>>>0,g||le(f,1,this.length),this[f]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(f,g){return f=f>>>0,g||le(f,2,this.length),this[f]|this[f+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(f,g){return f=f>>>0,g||le(f,2,this.length),this[f]<<8|this[f+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(f,g){return f=f>>>0,g||le(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(f,g){return f=f>>>0,g||le(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},s.prototype.readBigUInt64LE=Se(function(f){f=f>>>0,Q(f,"offset");const g=this[f],x=this[f+7];(g===void 0||x===void 0)&&ie(f,this.length-8);const O=g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,L=this[++f]+this[++f]*2**8+this[++f]*2**16+x*2**24;return BigInt(O)+(BigInt(L)<<BigInt(32))}),s.prototype.readBigUInt64BE=Se(function(f){f=f>>>0,Q(f,"offset");const g=this[f],x=this[f+7];(g===void 0||x===void 0)&&ie(f,this.length-8);const O=g*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],L=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+x;return(BigInt(O)<<BigInt(32))+BigInt(L)}),s.prototype.readIntLE=function(f,g,x){f=f>>>0,g=g>>>0,x||le(f,g,this.length);let O=this[f],L=1,W=0;for(;++W<g&&(L*=256);)O+=this[f+W]*L;return L*=128,O>=L&&(O-=Math.pow(2,8*g)),O},s.prototype.readIntBE=function(f,g,x){f=f>>>0,g=g>>>0,x||le(f,g,this.length);let O=g,L=1,W=this[f+--O];for(;O>0&&(L*=256);)W+=this[f+--O]*L;return L*=128,W>=L&&(W-=Math.pow(2,8*g)),W},s.prototype.readInt8=function(f,g){return f=f>>>0,g||le(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},s.prototype.readInt16LE=function(f,g){f=f>>>0,g||le(f,2,this.length);const x=this[f]|this[f+1]<<8;return x&32768?x|4294901760:x},s.prototype.readInt16BE=function(f,g){f=f>>>0,g||le(f,2,this.length);const x=this[f+1]|this[f]<<8;return x&32768?x|4294901760:x},s.prototype.readInt32LE=function(f,g){return f=f>>>0,g||le(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},s.prototype.readInt32BE=function(f,g){return f=f>>>0,g||le(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},s.prototype.readBigInt64LE=Se(function(f){f=f>>>0,Q(f,"offset");const g=this[f],x=this[f+7];(g===void 0||x===void 0)&&ie(f,this.length-8);const O=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(x<<24);return(BigInt(O)<<BigInt(32))+BigInt(g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),s.prototype.readBigInt64BE=Se(function(f){f=f>>>0,Q(f,"offset");const g=this[f],x=this[f+7];(g===void 0||x===void 0)&&ie(f,this.length-8);const O=(g<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(O)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+x)}),s.prototype.readFloatLE=function(f,g){return f=f>>>0,g||le(f,4,this.length),r.read(this,f,!0,23,4)},s.prototype.readFloatBE=function(f,g){return f=f>>>0,g||le(f,4,this.length),r.read(this,f,!1,23,4)},s.prototype.readDoubleLE=function(f,g){return f=f>>>0,g||le(f,8,this.length),r.read(this,f,!0,52,8)},s.prototype.readDoubleBE=function(f,g){return f=f>>>0,g||le(f,8,this.length),r.read(this,f,!1,52,8)};function V(b,f,g,x,O,L){if(!s.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>O||f<L)throw new RangeError('"value" argument is out of bounds');if(g+x>b.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(f,g,x,O){if(f=+f,g=g>>>0,x=x>>>0,!O){const me=Math.pow(2,8*x)-1;V(this,f,g,x,me,0)}let L=1,W=0;for(this[g]=f&255;++W<x&&(L*=256);)this[g+W]=f/L&255;return g+x},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(f,g,x,O){if(f=+f,g=g>>>0,x=x>>>0,!O){const me=Math.pow(2,8*x)-1;V(this,f,g,x,me,0)}let L=x-1,W=1;for(this[g+L]=f&255;--L>=0&&(W*=256);)this[g+L]=f/W&255;return g+x},s.prototype.writeUint8=s.prototype.writeUInt8=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,1,255,0),this[g]=f&255,g+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,2,65535,0),this[g]=f&255,this[g+1]=f>>>8,g+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,2,65535,0),this[g]=f>>>8,this[g+1]=f&255,g+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,4,4294967295,0),this[g+3]=f>>>24,this[g+2]=f>>>16,this[g+1]=f>>>8,this[g]=f&255,g+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,4,4294967295,0),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4};function J(b,f,g,x,O){N(f,x,O,b,g,7);let L=Number(f&BigInt(4294967295));b[g++]=L,L=L>>8,b[g++]=L,L=L>>8,b[g++]=L,L=L>>8,b[g++]=L;let W=Number(f>>BigInt(32)&BigInt(4294967295));return b[g++]=W,W=W>>8,b[g++]=W,W=W>>8,b[g++]=W,W=W>>8,b[g++]=W,g}function re(b,f,g,x,O){N(f,x,O,b,g,7);let L=Number(f&BigInt(4294967295));b[g+7]=L,L=L>>8,b[g+6]=L,L=L>>8,b[g+5]=L,L=L>>8,b[g+4]=L;let W=Number(f>>BigInt(32)&BigInt(4294967295));return b[g+3]=W,W=W>>8,b[g+2]=W,W=W>>8,b[g+1]=W,W=W>>8,b[g]=W,g+8}s.prototype.writeBigUInt64LE=Se(function(f,g=0){return J(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Se(function(f,g=0){return re(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(f,g,x,O){if(f=+f,g=g>>>0,!O){const ke=Math.pow(2,8*x-1);V(this,f,g,x,ke-1,-ke)}let L=0,W=1,me=0;for(this[g]=f&255;++L<x&&(W*=256);)f<0&&me===0&&this[g+L-1]!==0&&(me=1),this[g+L]=(f/W>>0)-me&255;return g+x},s.prototype.writeIntBE=function(f,g,x,O){if(f=+f,g=g>>>0,!O){const ke=Math.pow(2,8*x-1);V(this,f,g,x,ke-1,-ke)}let L=x-1,W=1,me=0;for(this[g+L]=f&255;--L>=0&&(W*=256);)f<0&&me===0&&this[g+L+1]!==0&&(me=1),this[g+L]=(f/W>>0)-me&255;return g+x},s.prototype.writeInt8=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,1,127,-128),f<0&&(f=255+f+1),this[g]=f&255,g+1},s.prototype.writeInt16LE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,2,32767,-32768),this[g]=f&255,this[g+1]=f>>>8,g+2},s.prototype.writeInt16BE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,2,32767,-32768),this[g]=f>>>8,this[g+1]=f&255,g+2},s.prototype.writeInt32LE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,4,2147483647,-2147483648),this[g]=f&255,this[g+1]=f>>>8,this[g+2]=f>>>16,this[g+3]=f>>>24,g+4},s.prototype.writeInt32BE=function(f,g,x){return f=+f,g=g>>>0,x||V(this,f,g,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4},s.prototype.writeBigInt64LE=Se(function(f,g=0){return J(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Se(function(f,g=0){return re(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(b,f,g,x,O,L){if(g+x>b.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function H(b,f,g,x,O){return f=+f,g=g>>>0,O||de(b,f,g,4),r.write(b,f,g,x,23,4),g+4}s.prototype.writeFloatLE=function(f,g,x){return H(this,f,g,!0,x)},s.prototype.writeFloatBE=function(f,g,x){return H(this,f,g,!1,x)};function G(b,f,g,x,O){return f=+f,g=g>>>0,O||de(b,f,g,8),r.write(b,f,g,x,52,8),g+8}s.prototype.writeDoubleLE=function(f,g,x){return G(this,f,g,!0,x)},s.prototype.writeDoubleBE=function(f,g,x){return G(this,f,g,!1,x)},s.prototype.copy=function(f,g,x,O){if(!s.isBuffer(f))throw new TypeError("argument should be a Buffer");if(x||(x=0),!O&&O!==0&&(O=this.length),g>=f.length&&(g=f.length),g||(g=0),O>0&&O<x&&(O=x),O===x||f.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(x<0||x>=this.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),f.length-g<O-x&&(O=f.length-g+x);const L=O-x;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,x,O):Uint8Array.prototype.set.call(f,this.subarray(x,O),g),L},s.prototype.fill=function(f,g,x,O){if(typeof f=="string"){if(typeof g=="string"?(O=g,g=0,x=this.length):typeof x=="string"&&(O=x,x=this.length),O!==void 0&&typeof O!="string")throw new TypeError("encoding must be a string");if(typeof O=="string"&&!s.isEncoding(O))throw new TypeError("Unknown encoding: "+O);if(f.length===1){const W=f.charCodeAt(0);(O==="utf8"&&W<128||O==="latin1")&&(f=W)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(g<0||this.length<g||this.length<x)throw new RangeError("Out of range index");if(x<=g)return this;g=g>>>0,x=x===void 0?this.length:x>>>0,f||(f=0);let L;if(typeof f=="number")for(L=g;L<x;++L)this[L]=f;else{const W=s.isBuffer(f)?f:s.from(f,O),me=W.length;if(me===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(L=0;L<x-g;++L)this[L+g]=W[L%me]}return this};const B={};function z(b,f,g){B[b]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(O){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:O,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(b,f){return`The "${b}" argument must be of type number. Received type ${typeof f}`},TypeError),z("ERR_OUT_OF_RANGE",function(b,f,g){let x=`The value of "${b}" is out of range.`,O=g;return Number.isInteger(g)&&Math.abs(g)>2**32?O=K(String(g)):typeof g=="bigint"&&(O=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(O=K(O)),O+="n"),x+=` It must be ${f}. Received ${O}`,x},RangeError);function K(b){let f="",g=b.length;const x=b[0]==="-"?1:0;for(;g>=x+4;g-=3)f=`_${b.slice(g-3,g)}${f}`;return`${b.slice(0,g)}${f}`}function I(b,f,g){Q(f,"offset"),(b[f]===void 0||b[f+g]===void 0)&&ie(f,b.length-(g+1))}function N(b,f,g,x,O,L){if(b>g||b<f){const W=typeof f=="bigint"?"n":"";let me;throw L>3?f===0||f===BigInt(0)?me=`>= 0${W} and < 2${W} ** ${(L+1)*8}${W}`:me=`>= -(2${W} ** ${(L+1)*8-1}${W}) and < 2 ** ${(L+1)*8-1}${W}`:me=`>= ${f}${W} and <= ${g}${W}`,new B.ERR_OUT_OF_RANGE("value",me,b)}I(x,O,L)}function Q(b,f){if(typeof b!="number")throw new B.ERR_INVALID_ARG_TYPE(f,"number",b)}function ie(b,f,g){throw Math.floor(b)!==b?(Q(b,g),new B.ERR_OUT_OF_RANGE(g||"offset","an integer",b)):f<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE(g||"offset",`>= ${g?1:0} and <= ${f}`,b)}const pe=/[^+/0-9A-Za-z-_]/g;function ye(b){if(b=b.split("=")[0],b=b.trim().replace(pe,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function _e(b,f){f=f||1/0;let g;const x=b.length;let O=null;const L=[];for(let W=0;W<x;++W){if(g=b.charCodeAt(W),g>55295&&g<57344){if(!O){if(g>56319){(f-=3)>-1&&L.push(239,191,189);continue}else if(W+1===x){(f-=3)>-1&&L.push(239,191,189);continue}O=g;continue}if(g<56320){(f-=3)>-1&&L.push(239,191,189),O=g;continue}g=(O-55296<<10|g-56320)+65536}else O&&(f-=3)>-1&&L.push(239,191,189);if(O=null,g<128){if((f-=1)<0)break;L.push(g)}else if(g<2048){if((f-=2)<0)break;L.push(g>>6|192,g&63|128)}else if(g<65536){if((f-=3)<0)break;L.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((f-=4)<0)break;L.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return L}function xe(b){const f=[];for(let g=0;g<b.length;++g)f.push(b.charCodeAt(g)&255);return f}function ae(b,f){let g,x,O;const L=[];for(let W=0;W<b.length&&!((f-=2)<0);++W)g=b.charCodeAt(W),x=g>>8,O=g%256,L.push(O),L.push(x);return L}function Me(b){return t.toByteArray(ye(b))}function at(b,f,g,x){let O;for(O=0;O<x&&!(O+g>=f.length||O>=b.length);++O)f[O+g]=b[O];return O}function Oe(b,f){return b instanceof f||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===f.name}function Re(b){return b!==b}const gt=function(){const b="0123456789abcdef",f=new Array(256);for(let g=0;g<16;++g){const x=g*16;for(let O=0;O<16;++O)f[x+O]=b[g]+b[O]}return f}();function Se(b){return typeof BigInt>"u"?je:b}function je(){throw new Error("BigInt not supported")}})(qo);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=qo,n=r.Buffer;function i(a,s){for(var l in a)s[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o);function o(a,s,l){return n(a,s,l)}o.prototype=Object.create(n.prototype),i(n,o),o.from=function(a,s,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,s,l)},o.alloc=function(a,s,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var u=n(a);return s!==void 0?typeof l=="string"?u.fill(s,l):u.fill(s):u.fill(0),u},o.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},o.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(Gu,Gu.exports);var py=Gu.exports,Yu=65536,$D=4294967295;function CD(){throw new Error(`Secure random number generation is not supported by this browser.
112
- Use Chrome, Firefox or Internet Explorer 11`)}var AD=py.Buffer,Gs=et.crypto||et.msCrypto;Gs&&Gs.getRandomValues?Vu.exports=OD:Vu.exports=CD;function OD(e,t){if(e>$D)throw new RangeError("requested too many random bytes");var r=AD.allocUnsafe(e);if(e>0)if(e>Yu)for(var n=0;n<e;n+=Yu)Gs.getRandomValues(r.slice(n,n+Yu));else Gs.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var TD=Vu.exports;const ID=cn(TD);var Ju="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",PD=32,hy=class Vt{static from(t){if(Ko(t,void 0,{F:Ju,L:31,S:this,A:["source",""]}),t instanceof Vt)return t;if(t instanceof Cn)return new Vt(new Uint8Array(t.buffer,t.byteOffset,t.byteLength));if(t instanceof Uint8Array)return new Vt(t);if(t instanceof ArrayBuffer)return new Vt(new Uint8Array(t));if(typeof t=="string")return Vt.fromHex(t);if(t.asUint8Array)return new Vt(t.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${t}`)}static safeFrom(t){if(t)try{return Vt.from(t)}catch{return}}static fromHex(t){t.startsWith("0x")&&(t=t.slice(2));const r=Cn.from(t,"hex");return new Vt(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}static random(){return Vt.from(ID(PD))}static*randomSequence(){for(let t=0;t<1e4;t++)yield Vt.random();throw new Error("Too many keys requested")}static isPublicKey(t){return t instanceof Vt}static assertValidPublicKey(t){if(!this.isPublicKey(t))throw new TypeError("Invalid PublicKey")}static equals(t,r){return Vt.from(t).equals(r)}static bufferize(t){return Ko(typeof t=="string","Invalid type",{F:Ju,L:130,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Cn.from(t,"hex")}static stringify(t){return t instanceof Vt?t=t.asBuffer():t instanceof Uint8Array&&(t=Cn.from(t.buffer,t.byteOffset,t.byteLength)),Ko(t instanceof Cn,"Invalid type",{F:Ju,L:149,S:this,A:["key instanceof Buffer","'Invalid type'"]}),t.toString("hex")}static hash(t){return t.toHex()}constructor(t){if(this._value=t,!(t instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${t}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(t=void 0){return hD(this,t)}asBuffer(){return Cn.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(t){return Math.abs(this._value.reduce((r,n)=>r^n|0,0))%t}[_r.custom](t,r){if(!r.colors||typeof Us.stdout.hasColors!="function"||!Us.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const n=a=>`\x1B[${a}m`,i=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],o=i[this.getInsecureHash(i.length)];return`PublicKey(${n(_r.colors[o][0])}${this.truncate()}${n(_r.colors.reset[0])})`}get[Hs](){return{header:()=>{const t=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],r=t[this.getInsecureHash(t.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${r};`},this.truncate()],["span",{},")"]]}}}equals(t){const r=Vt.from(t);if(this._value.length!==r._value.length)return!1;let n=!0;for(let i=0;i<this._value.length;i++)n&&(n=this._value[i]===r._value[i]);return n}[mD](t){return Vt.isPublicKey(t)?this.equals(t):!1}},gy=10;(class{constructor(e,t){if(this._projection=e,this._values=new Map,t)for(const r of t)this.add(r)}toString(){return zs(this)}toJSON(){return this._values.size>gy?{size:this._values.size}:Array.from(this._values.values())}[_r.custom](){return zs(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,t){t&&(e=e.bind(t)),this._values.forEach(r=>e(r,r,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,t){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,t)for(const[r,n]of t)this.set(r,n)}toString(){return zs(this)}toJSON(){return this._values.size>gy?{size:this._values.size}:Array.from(this._values.values())}[_r.custom](){return zs(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const t=this._keys.delete(this._keyProjection(e)),r=this._values.delete(this._keyProjection(e));return t||r}forEach(e,t){t&&(e=e.bind(t)),this._keys.forEach((r,n)=>e(this._values.get(n)??uy(new Error("Map corrupted.")),r,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,t){const r=this._keyProjection(e);return this._keys.set(r,e),this._values.set(r,t),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,t]of this._keys){const r=this._values.get(e)??uy(new Error("Map corrupted."));yield[t,r]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var kD=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],ND=class{constructor(e=kD){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,t=4,r="-"){const n=e.match(/(..?)/g);if(!n)throw new Error("");const i=n.map(a=>parseInt(a,16));return this._compress(i,t).map(a=>this.wordlist[a]).join(r)}_compress(e,t){const r=e.length;if(t>r)throw new Error("Fewer input bytes than requested output");const n=r/t>>0,i=[];for(let a=0;a<n*t;a+=n)i.push(e.slice(a,a+n));return i[i.length-1]=i[i.length-1].concat(e.slice(t*n)),i.map(a=>a.reduce((s,l)=>s^l))}},DD=new ND,LD=e=>(e instanceof Cn||e instanceof Uint8Array||e instanceof ArrayBuffer?e=hy.stringify(e):e instanceof hy&&(e=e.toHex()),DD.humanize(e)),MD=e=>Cn.from(e.buffer,e.byteOffset,e.byteLength),FD=5,Xu=(e,t=0,r=new WeakSet)=>{if(t>FD)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(r.has(e))return null;r.add(e);try{if(e instanceof Uint8Array)return MD(e).toString("hex");if(Array.isArray(e))return e.map(n=>Xu(n,t+1,r));if(typeof e.toJSON=="function")return e.toJSON();{const n={};for(const i of Object.keys(e))n[i]=Xu(e[i],t+1,r);return n}}finally{r.delete(e)}}else return e},BD=(e,t,r)=>{let n=e.get(t);return n===void 0&&(n=typeof r=="function"?r():r,e.set(t,n)),n},jD=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Zu=Symbol("instanceTag"),RD=e=>t=>{t.prototype[Zu]=e,Object.defineProperty(t.prototype,Symbol.hasInstance,{value:r=>(r==null?void 0:r[Zu])===e}),Object.defineProperty(t,Symbol.hasInstance,{value:r=>(r==null?void 0:r[Zu])===e})},Qu=Symbol.for("dxos.instance-contexts"),UD=globalThis[Qu]??(globalThis[Qu]=new WeakMap),WD=e=>{const t=Object.getPrototypeOf(e),r=BD(UD,t,()=>({nextId:0,instanceIds:new WeakMap}));let n=r.instanceIds.get(e);return n===void 0&&(n=r.nextId++,r.instanceIds.set(e,n)),n},ef=()=>{throw new Error("Not available on this platform")},zD=()=>ef(),HD=()=>ef(),VD=()=>ef(),my=He({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,t){function r(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function n(a,s){for(var l="",u=0,d=-1,p=0,h,m=0;m<=a.length;++m){if(m<a.length)h=a.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(d===m-1||p===1))if(d!==m-1&&p===2){if(l.length<2||u!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var v=l.lastIndexOf("/");if(v!==l.length-1){v===-1?(l="",u=0):(l=l.slice(0,v),u=l.length-1-l.lastIndexOf("/")),d=m,p=0;continue}}else if(l.length===2||l.length===1){l="",u=0,d=m,p=0;continue}}s&&(l.length>0?l+="/..":l="..",u=2)}else l.length>0?l+="/"+a.slice(d+1,m):l=a.slice(d+1,m),u=m-d-1;d=m,p=0}else h===46&&p!==-1?++p:p=-1}return l}function i(a,s){var l=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return l?l===s.root?l+u:l+a+u:u}var o={resolve:function(){for(var s="",l=!1,u,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),r(p),p.length!==0&&(s=p+"/"+s,l=p.charCodeAt(0)===47)}return s=n(s,!l),l?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(r(s),s.length===0)return".";var l=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=n(s,!l),s.length===0&&!l&&(s="."),s.length>0&&u&&(s+="/"),l?"/"+s:s},isAbsolute:function(s){return r(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,l=0;l<arguments.length;++l){var u=arguments[l];r(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":o.normalize(s)},relative:function(s,l){if(r(s),r(l),s===l||(s=o.resolve(s),l=o.resolve(l),s===l))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,p=d-u,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var m=l.length,v=m-h,y=p<v?p:v,w=-1,E=0;E<=y;++E){if(E===y){if(v>y){if(l.charCodeAt(h+E)===47)return l.slice(h+E+1);if(E===0)return l.slice(h+E)}else p>y&&(s.charCodeAt(u+E)===47?w=E:E===0&&(w=0));break}var _=s.charCodeAt(u+E),S=l.charCodeAt(h+E);if(_!==S)break;_===47&&(w=E)}var $="";for(E=u+w+1;E<=d;++E)(E===d||s.charCodeAt(E)===47)&&($.length===0?$+="..":$+="/..");return $.length>0?$+l.slice(h+w):(h+=w,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(r(s),s.length===0)return".";for(var l=s.charCodeAt(0),u=l===47,d=-1,p=!0,h=s.length-1;h>=1;--h)if(l=s.charCodeAt(h),l===47){if(!p){d=h;break}}else p=!1;return d===-1?u?"/":".":u&&d===1?"//":s.slice(0,d)},basename:function(s,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');r(s);var u=0,d=-1,p=!0,h;if(l!==void 0&&l.length>0&&l.length<=s.length){if(l.length===s.length&&l===s)return"";var m=l.length-1,v=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!p){u=h+1;break}}else v===-1&&(p=!1,v=h+1),m>=0&&(y===l.charCodeAt(m)?--m===-1&&(d=h):(m=-1,d=v))}return u===d?d=v:d===-1&&(d=s.length),s.slice(u,d)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!p){u=h+1;break}}else d===-1&&(p=!1,d=h+1);return d===-1?"":s.slice(u,d)}},extname:function(s){r(s);for(var l=-1,u=0,d=-1,p=!0,h=0,m=s.length-1;m>=0;--m){var v=s.charCodeAt(m);if(v===47){if(!p){u=m+1;break}continue}d===-1&&(p=!1,d=m+1),v===46?l===-1?l=m:h!==1&&(h=1):l!==-1&&(h=-1)}return l===-1||d===-1||h===0||h===1&&l===d-1&&l===u+1?"":s.slice(l,d)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){r(s);var l={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return l;var u=s.charCodeAt(0),d=u===47,p;d?(l.root="/",p=1):p=0;for(var h=-1,m=0,v=-1,y=!0,w=s.length-1,E=0;w>=p;--w){if(u=s.charCodeAt(w),u===47){if(!y){m=w+1;break}continue}v===-1&&(y=!1,v=w+1),u===46?h===-1?h=w:E!==1&&(E=1):h!==-1&&(E=-1)}return h===-1||v===-1||E===0||E===1&&h===v-1&&h===m+1?v!==-1&&(m===0&&d?l.base=l.name=s.slice(1,v):l.base=l.name=s.slice(m,v)):(m===0&&d?(l.name=s.slice(1,h),l.base=s.slice(1,v)):(l.name=s.slice(m,h),l.base=s.slice(m,v)),l.ext=s.slice(h,v)),m>0?l.dir=s.slice(0,m-1):d&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}});Zn(my());var Wr=Zn(my());Wr.basename;var GD=Wr.dirname;Wr.extname,Wr.format,Wr.isAbsolute,Wr.join,Wr.normalize,Wr.parse,Wr.relative,Wr.resolve;var _t;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(_t||(_t={}));var KD={trace:5,debug:10,info:11,warn:12,error:13},Yo;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(Yo||(Yo={}));var qD=Symbol("logInfoProperties"),YD=e=>{if(!e)return{};const t={},n=Object.getPrototypeOf(e)[qD]??[];for(const i of n)try{t[i]=typeof e[i]=="function"?e[i]():e[i]}catch(o){t[i]=o.message}return t},JD=(e,t,r)=>t>=e.level&&(!e.pattern||r.includes(e.pattern)),vy=(e,t)=>t===void 0?!0:t.some(r=>{var n;return JD(r,e.level,((n=e.meta)==null?void 0:n.F)??"")}),tf=e=>{let t;if(e.meta){const r=YD(e.meta.S);Object.keys(r).length>0&&(t=Object.assign(t??{},r))}if(e.context)if(e.context instanceof Error){const r=e.context.context;t=Object.assign(t??{},{error:e.context.stack,...r})}else typeof e.context=="object"&&(t=Object.assign(t??{},e.context));return t&&Object.keys(t).length>0?t:void 0},XD=0,ZD=e=>(t,r,n)=>(i,o,a)=>{const s=a.value;a.value=function(...l){const u={...n??{},S:this},d=l.map(p=>_r(p,!1,1,!0)).join(", ");try{const p=performance.now(),h=s.apply(this,l);if(QD(h)){const m=XD++;e.info(`${o}(${d}) => Promise { #${m} }`,{},u),h.then(v=>{v!==void 0?e.info(`✅ resolve #${m} ${(performance.now()-p).toFixed(0)}ms => ${_r(v,!1,1,!0)}`,{},u):e.info(`✅ resolve #${m} ${(performance.now()-p).toFixed(0)}ms`,{},u)},v=>{e.info(`🔥 reject #${m} #${(performance.now()-p).toFixed(0)}ms => ${v}`,{},u)})}else e.info(`${o}(${d}) => ${_r(h,!1,1,!0)}`,{},u);return h}catch(p){throw e.error(`${o}(${d}) 🔥 ${p}`,{},u),p}},Object.defineProperty(a.value,"name",{value:o+"$log"})},QD=e=>e&&typeof e.then=="function",eL=e=>{try{return JSON.parse(localStorage.getItem("dxlog"))}catch{return}},yy=()=>{},tL=(e,t)=>{console.log(_r(t,!1,null,!0))},by=e=>{const t=e.match(/.+\/(packages\/.+\/.+)/);if(t){const[,r]=t;return r}return e},rf=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},rL=(e,t)=>{var u,d,p;if(!vy(t,e.filters))return;const r=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",n=[];let i="";if(t.meta){const h=by(t.meta.F);i=`${`${r.replace(/\/$/,"")}/${h}`}#L${t.meta.L}`}let o=[];if((u=t.meta)!=null&&u.S){const h=(d=t.meta)==null?void 0:d.S,m=Object.getPrototypeOf(h),v=WD(h);o.push(`%c${m.constructor.name}#${v}`,"color:#C026D3;font-weight:bold")}o.push(t.message);const a=tf(t);a&&o.push(a);const s={[_t.ERROR]:console.error,[_t.WARN]:console.warn,[_t.DEBUG]:console.log};(rf.printFileLinks||jD())&&(n!=null&&n.length?o=[`%c${i}
112
+ Use Chrome, Firefox or Internet Explorer 11`)}var AD=py.Buffer,Gs=et.crypto||et.msCrypto;Gs&&Gs.getRandomValues?Vu.exports=OD:Vu.exports=CD;function OD(e,t){if(e>$D)throw new RangeError("requested too many random bytes");var r=AD.allocUnsafe(e);if(e>0)if(e>Yu)for(var n=0;n<e;n+=Yu)Gs.getRandomValues(r.slice(n,n+Yu));else Gs.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var TD=Vu.exports;const ID=cn(TD);var Ju="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",PD=32,hy=class Vt{static from(t){if(Ko(t,void 0,{F:Ju,L:31,S:this,A:["source",""]}),t instanceof Vt)return t;if(t instanceof Cn)return new Vt(new Uint8Array(t.buffer,t.byteOffset,t.byteLength));if(t instanceof Uint8Array)return new Vt(t);if(t instanceof ArrayBuffer)return new Vt(new Uint8Array(t));if(typeof t=="string")return Vt.fromHex(t);if(t.asUint8Array)return new Vt(t.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${t}`)}static safeFrom(t){if(t)try{return Vt.from(t)}catch{return}}static fromHex(t){t.startsWith("0x")&&(t=t.slice(2));const r=Cn.from(t,"hex");return new Vt(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}static random(){return Vt.from(ID(PD))}static*randomSequence(){for(let t=0;t<1e4;t++)yield Vt.random();throw new Error("Too many keys requested")}static isPublicKey(t){return t instanceof Vt}static assertValidPublicKey(t){if(!this.isPublicKey(t))throw new TypeError("Invalid PublicKey")}static equals(t,r){return Vt.from(t).equals(r)}static bufferize(t){return Ko(typeof t=="string","Invalid type",{F:Ju,L:130,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Cn.from(t,"hex")}static stringify(t){return t instanceof Vt?t=t.asBuffer():t instanceof Uint8Array&&(t=Cn.from(t.buffer,t.byteOffset,t.byteLength)),Ko(t instanceof Cn,"Invalid type",{F:Ju,L:149,S:this,A:["key instanceof Buffer","'Invalid type'"]}),t.toString("hex")}static hash(t){return t.toHex()}constructor(t){if(this._value=t,!(t instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${t}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(t=void 0){return hD(this,t)}asBuffer(){return Cn.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(t){return Math.abs(this._value.reduce((r,n)=>r^n|0,0))%t}[_r.custom](t,r){if(!r.colors||typeof Us.stdout.hasColors!="function"||!Us.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const n=a=>`\x1B[${a}m`,i=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],o=i[this.getInsecureHash(i.length)];return`PublicKey(${n(_r.colors[o][0])}${this.truncate()}${n(_r.colors.reset[0])})`}get[Hs](){return{header:()=>{const t=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],r=t[this.getInsecureHash(t.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${r};`},this.truncate()],["span",{},")"]]}}}equals(t){const r=Vt.from(t);if(this._value.length!==r._value.length)return!1;let n=!0;for(let i=0;i<this._value.length;i++)n&&(n=this._value[i]===r._value[i]);return n}[mD](t){return Vt.isPublicKey(t)?this.equals(t):!1}},gy=10;(class{constructor(e,t){if(this._projection=e,this._values=new Map,t)for(const r of t)this.add(r)}toString(){return zs(this)}toJSON(){return this._values.size>gy?{size:this._values.size}:Array.from(this._values.values())}[_r.custom](){return zs(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,t){t&&(e=e.bind(t)),this._values.forEach(r=>e(r,r,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,t){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,t)for(const[r,n]of t)this.set(r,n)}toString(){return zs(this)}toJSON(){return this._values.size>gy?{size:this._values.size}:Array.from(this._values.values())}[_r.custom](){return zs(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const t=this._keys.delete(this._keyProjection(e)),r=this._values.delete(this._keyProjection(e));return t||r}forEach(e,t){t&&(e=e.bind(t)),this._keys.forEach((r,n)=>e(this._values.get(n)??uy(new Error("Map corrupted.")),r,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,t){const r=this._keyProjection(e);return this._keys.set(r,e),this._values.set(r,t),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,t]of this._keys){const r=this._values.get(e)??uy(new Error("Map corrupted."));yield[t,r]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var kD=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],ND=class{constructor(e=kD){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,t=4,r="-"){const n=e.match(/(..?)/g);if(!n)throw new Error("");const i=n.map(a=>parseInt(a,16));return this._compress(i,t).map(a=>this.wordlist[a]).join(r)}_compress(e,t){const r=e.length;if(t>r)throw new Error("Fewer input bytes than requested output");const n=r/t>>0,i=[];for(let a=0;a<n*t;a+=n)i.push(e.slice(a,a+n));return i[i.length-1]=i[i.length-1].concat(e.slice(t*n)),i.map(a=>a.reduce((s,l)=>s^l))}},DD=new ND,LD=e=>(e instanceof Cn||e instanceof Uint8Array||e instanceof ArrayBuffer?e=hy.stringify(e):e instanceof hy&&(e=e.toHex()),DD.humanize(e)),MD=e=>Cn.from(e.buffer,e.byteOffset,e.byteLength),FD=5,Xu=(e,t=0,r=new WeakSet)=>{if(t>FD)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(r.has(e))return null;r.add(e);try{if(e instanceof Uint8Array)return MD(e).toString("hex");if(Array.isArray(e))return e.map(n=>Xu(n,t+1,r));if(typeof e.toJSON=="function")return e.toJSON();{const n={};for(const i of Object.keys(e))n[i]=Xu(e[i],t+1,r);return n}}finally{r.delete(e)}}else return e},BD=(e,t,r)=>{let n=e.get(t);return n===void 0&&(n=typeof r=="function"?r():r,e.set(t,n)),n},jD=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Zu=Symbol("instanceTag"),RD=e=>t=>{t.prototype[Zu]=e,Object.defineProperty(t.prototype,Symbol.hasInstance,{value:r=>(r==null?void 0:r[Zu])===e}),Object.defineProperty(t,Symbol.hasInstance,{value:r=>(r==null?void 0:r[Zu])===e})},Qu=Symbol.for("dxos.instance-contexts"),UD=globalThis[Qu]??(globalThis[Qu]=new WeakMap),WD=e=>{const t=Object.getPrototypeOf(e),r=BD(UD,t,()=>({nextId:0,instanceIds:new WeakMap}));let n=r.instanceIds.get(e);return n===void 0&&(n=r.nextId++,r.instanceIds.set(e,n)),n};Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var ef=()=>{throw new Error("Not available on this platform")},zD=()=>ef(),HD=()=>ef(),VD=()=>ef(),my=He({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,t){function r(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function n(a,s){for(var l="",u=0,d=-1,p=0,h,m=0;m<=a.length;++m){if(m<a.length)h=a.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(d===m-1||p===1))if(d!==m-1&&p===2){if(l.length<2||u!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var v=l.lastIndexOf("/");if(v!==l.length-1){v===-1?(l="",u=0):(l=l.slice(0,v),u=l.length-1-l.lastIndexOf("/")),d=m,p=0;continue}}else if(l.length===2||l.length===1){l="",u=0,d=m,p=0;continue}}s&&(l.length>0?l+="/..":l="..",u=2)}else l.length>0?l+="/"+a.slice(d+1,m):l=a.slice(d+1,m),u=m-d-1;d=m,p=0}else h===46&&p!==-1?++p:p=-1}return l}function i(a,s){var l=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return l?l===s.root?l+u:l+a+u:u}var o={resolve:function(){for(var s="",l=!1,u,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),r(p),p.length!==0&&(s=p+"/"+s,l=p.charCodeAt(0)===47)}return s=n(s,!l),l?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(r(s),s.length===0)return".";var l=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=n(s,!l),s.length===0&&!l&&(s="."),s.length>0&&u&&(s+="/"),l?"/"+s:s},isAbsolute:function(s){return r(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,l=0;l<arguments.length;++l){var u=arguments[l];r(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":o.normalize(s)},relative:function(s,l){if(r(s),r(l),s===l||(s=o.resolve(s),l=o.resolve(l),s===l))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,p=d-u,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var m=l.length,v=m-h,y=p<v?p:v,w=-1,E=0;E<=y;++E){if(E===y){if(v>y){if(l.charCodeAt(h+E)===47)return l.slice(h+E+1);if(E===0)return l.slice(h+E)}else p>y&&(s.charCodeAt(u+E)===47?w=E:E===0&&(w=0));break}var _=s.charCodeAt(u+E),S=l.charCodeAt(h+E);if(_!==S)break;_===47&&(w=E)}var $="";for(E=u+w+1;E<=d;++E)(E===d||s.charCodeAt(E)===47)&&($.length===0?$+="..":$+="/..");return $.length>0?$+l.slice(h+w):(h+=w,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(r(s),s.length===0)return".";for(var l=s.charCodeAt(0),u=l===47,d=-1,p=!0,h=s.length-1;h>=1;--h)if(l=s.charCodeAt(h),l===47){if(!p){d=h;break}}else p=!1;return d===-1?u?"/":".":u&&d===1?"//":s.slice(0,d)},basename:function(s,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');r(s);var u=0,d=-1,p=!0,h;if(l!==void 0&&l.length>0&&l.length<=s.length){if(l.length===s.length&&l===s)return"";var m=l.length-1,v=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!p){u=h+1;break}}else v===-1&&(p=!1,v=h+1),m>=0&&(y===l.charCodeAt(m)?--m===-1&&(d=h):(m=-1,d=v))}return u===d?d=v:d===-1&&(d=s.length),s.slice(u,d)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!p){u=h+1;break}}else d===-1&&(p=!1,d=h+1);return d===-1?"":s.slice(u,d)}},extname:function(s){r(s);for(var l=-1,u=0,d=-1,p=!0,h=0,m=s.length-1;m>=0;--m){var v=s.charCodeAt(m);if(v===47){if(!p){u=m+1;break}continue}d===-1&&(p=!1,d=m+1),v===46?l===-1?l=m:h!==1&&(h=1):l!==-1&&(h=-1)}return l===-1||d===-1||h===0||h===1&&l===d-1&&l===u+1?"":s.slice(l,d)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){r(s);var l={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return l;var u=s.charCodeAt(0),d=u===47,p;d?(l.root="/",p=1):p=0;for(var h=-1,m=0,v=-1,y=!0,w=s.length-1,E=0;w>=p;--w){if(u=s.charCodeAt(w),u===47){if(!y){m=w+1;break}continue}v===-1&&(y=!1,v=w+1),u===46?h===-1?h=w:E!==1&&(E=1):h!==-1&&(E=-1)}return h===-1||v===-1||E===0||E===1&&h===v-1&&h===m+1?v!==-1&&(m===0&&d?l.base=l.name=s.slice(1,v):l.base=l.name=s.slice(m,v)):(m===0&&d?(l.name=s.slice(1,h),l.base=s.slice(1,v)):(l.name=s.slice(m,h),l.base=s.slice(m,v)),l.ext=s.slice(h,v)),m>0?l.dir=s.slice(0,m-1):d&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}});Zn(my());var Wr=Zn(my());Wr.basename;var GD=Wr.dirname;Wr.extname,Wr.format,Wr.isAbsolute,Wr.join,Wr.normalize,Wr.parse,Wr.relative,Wr.resolve;var _t;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(_t||(_t={}));var KD={trace:5,debug:10,info:11,warn:12,error:13},Yo;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(Yo||(Yo={}));var qD=Symbol("logInfoProperties"),YD=e=>{if(!e)return{};const t={},n=Object.getPrototypeOf(e)[qD]??[];for(const i of n)try{t[i]=typeof e[i]=="function"?e[i]():e[i]}catch(o){t[i]=o.message}return t},JD=(e,t,r)=>t>=e.level&&(!e.pattern||r.includes(e.pattern)),vy=(e,t)=>t===void 0?!0:t.some(r=>{var n;return JD(r,e.level,((n=e.meta)==null?void 0:n.F)??"")}),tf=e=>{let t;if(e.meta){const r=YD(e.meta.S);Object.keys(r).length>0&&(t=Object.assign(t??{},r))}if(e.context)if(e.context instanceof Error){const r=e.context.context;t=Object.assign(t??{},{error:e.context.stack,...r})}else typeof e.context=="object"&&(t=Object.assign(t??{},e.context));return t&&Object.keys(t).length>0?t:void 0},XD=0,ZD=e=>(t,r,n)=>(i,o,a)=>{const s=a.value;a.value=function(...l){const u={...n??{},S:this},d=l.map(p=>_r(p,!1,1,!0)).join(", ");try{const p=performance.now(),h=s.apply(this,l);if(QD(h)){const m=XD++;e.info(`${o}(${d}) => Promise { #${m} }`,{},u),h.then(v=>{v!==void 0?e.info(`✅ resolve #${m} ${(performance.now()-p).toFixed(0)}ms => ${_r(v,!1,1,!0)}`,{},u):e.info(`✅ resolve #${m} ${(performance.now()-p).toFixed(0)}ms`,{},u)},v=>{e.info(`🔥 reject #${m} #${(performance.now()-p).toFixed(0)}ms => ${v}`,{},u)})}else e.info(`${o}(${d}) => ${_r(h,!1,1,!0)}`,{},u);return h}catch(p){throw e.error(`${o}(${d}) 🔥 ${p}`,{},u),p}},Object.defineProperty(a.value,"name",{value:o+"$log"})},QD=e=>e&&typeof e.then=="function",eL=e=>{try{return JSON.parse(localStorage.getItem("dxlog"))}catch{return}},yy=()=>{},tL=(e,t)=>{console.log(_r(t,!1,null,!0))},by=e=>{const t=e.match(/.+\/(packages\/.+\/.+)/);if(t){const[,r]=t;return r}return e},rf=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},rL=(e,t)=>{var u,d,p;if(!vy(t,e.filters))return;const r=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",n=[];let i="";if(t.meta){const h=by(t.meta.F);i=`${`${r.replace(/\/$/,"")}/${h}`}#L${t.meta.L}`}let o=[];if((u=t.meta)!=null&&u.S){const h=(d=t.meta)==null?void 0:d.S,m=Object.getPrototypeOf(h),v=WD(h);o.push(`%c${m.constructor.name}#${v}`,"color:#C026D3;font-weight:bold")}o.push(t.message);const a=tf(t);a&&o.push(a);const s={[_t.ERROR]:console.error,[_t.WARN]:console.warn,[_t.DEBUG]:console.log};(rf.printFileLinks||jD())&&(n!=null&&n.length?o=[`%c${i}
113
113
  %c${o.join(" ")}`,...n]:o=[i+`
114
114
  `,...o]);const l=s[t.level]??console.log;typeof((p=t.meta)==null?void 0:p.C)=="function"?t.meta.C(l,o):l(...o)},nL=(e,t)=>{var s;if(!vy(t,e.filters))return;let r="";t.meta&&(r=`${by(t.meta.F)}:${t.meta.L}`);let n=[];n.push(t.message);const i=tf(t);i&&n.push(i);const o={[_t.ERROR]:console.error,[_t.WARN]:console.warn,[_t.DEBUG]:console.log};rf.printFileLinks&&(n=[r,...n]);const a=o[t.level]??console.log;typeof((s=t.meta)==null?void 0:s.C)=="function"?t.meta.C(a,n):a(...n)},wy=rf.useTestProcessor?nL:rL,iL=({path:e,levels:t})=>{let r;return(n,i)=>{var a,s;if(!t.includes(i.level))return;if(!r){try{HD(GD(e))}catch{}r=VD()}const o={...i,timestamp:Date.now(),meta:{file:(a=i.meta)==null?void 0:a.F,line:(s=i.meta)==null?void 0:s.L},context:Xu(tf(i))};zD(r,JSON.stringify(o)+`
115
115
  `)}},Ey,oL=()=>(Ey??(Ey=process.env.LOG_FILE??(process.env.HOME?`${process.env.HOME}/.dxlog/${new Date().toISOString()}.log`:void 0)),Ey);iL({path:oL(),levels:[_t.ERROR,_t.WARN,_t.INFO,_t.TRACE]});var aL={[Yo.CONSOLE]:yy,[Yo.BROWSER]:wy,[Yo.DEBUG]:tL},sL=typeof window<"u"||typeof navigator<"u",nf=[sL?wy:yy],_y=e=>{if(typeof e=="number")return[{level:e}];const t=(n,i=_t.WARN)=>KD[n.toLowerCase()]??i;return(typeof e=="string"?e.split(/,\s*/):e).map(n=>{const[i,o]=n.split(":");return o?{level:t(o),pattern:i}:{level:t(i)}})},xy=e=>{const t="process"in globalThis?{file:process.env.LOG_CONFIG,filter:process.env.LOG_FILTER,processor:process.env.LOG_PROCESSOR}:void 0,r=cD({},e,t&&eL(t.file),t);return{options:r,filters:_y(r.filter??_t.INFO),captureFilters:_y(r.captureFilter??_t.WARN),processors:r.processor?[aL[r.processor]]:nf,prefix:r.prefix}},lL=()=>{const e=(...r)=>t(_t.DEBUG,...r);e._config=xy(),Object.defineProperty(e,"runtimeConfig",{get:()=>e._config}),e.addProcessor=r=>{nf.filter(n=>n===r).length===0&&nf.push(r),e._config.processors.filter(n=>n===r).length===0&&e._config.processors.push(r)},e.config=r=>{e._config=xy(r)},e.trace=(...r)=>t(_t.TRACE,...r),e.debug=(...r)=>t(_t.DEBUG,...r),e.info=(...r)=>t(_t.INFO,...r),e.warn=(...r)=>t(_t.WARN,...r),e.error=(...r)=>t(_t.ERROR,...r),e.catch=(r,n,i)=>t(_t.ERROR,r.stack,n,i),e.break=()=>e.info("——————————————————————————————————————————————————"),e.stack=(r,n,i)=>t(_t.INFO,`${r??"Stack Dump"}