@muze-nl/jsfs-solid 0.4.1 → 0.4.2
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.
- package/dist/browser.js +16 -2
- package/dist/browser.js.map +2 -2
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +2 -2
- package/package.json +3 -3
package/dist/browser.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(()=>{var If=Object.create;var Qn=Object.defineProperty;var Af=Object.getOwnPropertyDescriptor;var Tf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,kf=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nt=(t,e)=>{for(var r in e)Qn(t,r,{get:e[r],enumerable:!0})},jf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tf(e))!kf.call(t,i)&&i!==r&&Qn(t,i,{get:()=>e[i],enumerable:!(n=Af(e,i))||n.enumerable});return t};var zr=(t,e,r)=>(r=t!=null?If(vf(t)):{},jf(e||!t||!t.__esModule?Qn(r,"default",{value:t,enumerable:!0}):r,t));var xo=v(rn=>{"use strict";rn.byteLength=ac;rn.toByteArray=uc;rn.fromByteArray=dc;var de=[],ne=[],oc=typeof Uint8Array<"u"?Uint8Array:Array,fi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ft=0,go=fi.length;ft<go;++ft)de[ft]=fi[ft],ne[fi.charCodeAt(ft)]=ft;var ft,go;ne[45]=62;ne[95]=63;function wo(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function ac(t){var e=wo(t),r=e[0],n=e[1];return(r+n)*3/4-n}function lc(t,e,r){return(e+r)*3/4-r}function uc(t){var e,r=wo(t),n=r[0],i=r[1],s=new oc(lc(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=ne[t.charCodeAt(l)]<<18|ne[t.charCodeAt(l+1)]<<12|ne[t.charCodeAt(l+2)]<<6|ne[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ne[t.charCodeAt(l)]<<2|ne[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ne[t.charCodeAt(l)]<<10|ne[t.charCodeAt(l+1)]<<4|ne[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function fc(t){return de[t>>18&63]+de[t>>12&63]+de[t>>6&63]+de[t&63]}function cc(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(fc(n));return i.join("")}function dc(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(cc(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(de[e>>2]+de[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(de[e>>10]+de[e>>4&63]+de[e<<2&63]+"=")),i.join("")}});var So=v(ci=>{ci.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,l=(1<<a)-1,u=l>>1,f=-7,c=r?i-1:0,d=r?-1:1,h=t[e+c];for(c+=d,s=h&(1<<-f)-1,h>>=-f,f+=a;f>0;s=s*256+t[e+c],c+=d,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=n;f>0;o=o*256+t[e+c],c+=d,f-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(h?-1:1)*o*Math.pow(2,s-n)};ci.write=function(t,e,r,n,i,s){var o,a,l,u=s*8-i-1,f=(1<<u)-1,c=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,y=n?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=d/l:e+=d*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=f?(a=0,o=f):o+c>=1?(a=(e*l-1)*Math.pow(2,i),o=o+c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=a&255,h+=y,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+h]=o&255,h+=y,o/=256,u-=8);t[r+h-y]|=_*128}});var pe=v(Dt=>{"use strict";var di=xo(),Ft=So(),Eo=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Dt.Buffer=p;Dt.SlowBuffer=mc;Dt.INSPECT_MAX_BYTES=50;var nn=2147483647;Dt.kMaxLength=nn;p.TYPED_ARRAY_SUPPORT=hc();!p.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 hc(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ke(t){if(t>nn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yi(t)}return To(t,e,r)}p.poolSize=8192;function To(t,e,r){if(typeof t=="string")return _c(t,e);if(ArrayBuffer.isView(t))return yc(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(he(t,ArrayBuffer)||t&&he(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(he(t,SharedArrayBuffer)||t&&he(t.buffer,SharedArrayBuffer)))return pi(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return p.from(n,e,r);let i=bc(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}p.from=function(t,e,r){return To(t,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function vo(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function pc(t,e,r){return vo(t),t<=0?ke(t):e!==void 0?typeof r=="string"?ke(t).fill(e,r):ke(t).fill(e):ke(t)}p.alloc=function(t,e,r){return pc(t,e,r)};function yi(t){return vo(t),ke(t<0?0:bi(t)|0)}p.allocUnsafe=function(t){return yi(t)};p.allocUnsafeSlow=function(t){return yi(t)};function _c(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=ko(t,e)|0,n=ke(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function hi(t){let e=t.length<0?0:bi(t.length)|0,r=ke(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function yc(t){if(he(t,Uint8Array)){let e=new Uint8Array(t);return pi(e.buffer,e.byteOffset,e.byteLength)}return hi(t)}function pi(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,p.prototype),n}function bc(t){if(p.isBuffer(t)){let e=bi(t.length)|0,r=ke(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||gi(t.length)?ke(0):hi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return hi(t.data)}function bi(t){if(t>=nn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nn.toString(16)+" bytes");return t|0}function mc(t){return+t!=t&&(t=0),p.alloc(+t)}p.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype};p.compare=function(e,r){if(he(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),he(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let s=0,o=Math.min(n,i);s<o;++s)if(e[s]!==r[s]){n=e[s],i=r[s];break}return n<i?-1:i<n?1:0};p.isEncoding=function(e){switch(String(e).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}};p.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=p.allocUnsafe(r),s=0;for(n=0;n<e.length;++n){let o=e[n];if(he(o,Uint8Array))s+o.length>i.length?(p.isBuffer(o)||(o=p.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(p.isBuffer(o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return i};function ko(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||he(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _i(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Mo(t).length;default:if(i)return n?-1:_i(t).length;e=(""+e).toLowerCase(),i=!0}}p.byteLength=ko;function gc(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return kc(this,e,r);case"utf8":case"utf-8":return No(this,e,r);case"ascii":return Tc(this,e,r);case"latin1":case"binary":return vc(this,e,r);case"base64":return Ic(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jc(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function ct(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ct(this,r,r+1);return this};p.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ct(this,r,r+3),ct(this,r+1,r+2);return this};p.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ct(this,r,r+7),ct(this,r+1,r+6),ct(this,r+2,r+5),ct(this,r+3,r+4);return this};p.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?No(this,0,e):gc.apply(this,arguments)};p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){let e="",r=Dt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Eo&&(p.prototype[Eo]=p.prototype.inspect);p.prototype.compare=function(e,r,n,i,s){if(he(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),r<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&r>=n)return 0;if(i>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;let o=s-i,a=n-r,l=Math.min(o,a),u=this.slice(i,s),f=e.slice(r,n);for(let c=0;c<l;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0};function jo(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,gi(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),p.isBuffer(e))return e.length===0?-1:Ro(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ro(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Ro(t,e,r,n,i){let s=1,o=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(f,c){return s===1?f[c]:f.readUInt16BE(c*s)}let u;if(i){let f=-1;for(u=r;u<o;u++)if(l(t,u)===l(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===a)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(r+a>o&&(r=o-a),u=r;u>=0;u--){let f=!0;for(let c=0;c<a;c++)if(l(t,u+c)!==l(e,c)){f=!1;break}if(f)return u}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return jo(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return jo(this,e,r,n,!1)};function wc(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let s=e.length;n>s/2&&(n=s/2);let o;for(o=0;o<n;++o){let a=parseInt(e.substr(o*2,2),16);if(gi(a))return o;t[r+o]=a}return o}function xc(t,e,r,n){return sn(_i(e,t.length-r),t,r,n)}function Sc(t,e,r,n){return sn(Lc(e),t,r,n)}function Ec(t,e,r,n){return sn(Mo(e),t,r,n)}function Rc(t,e,r,n){return sn(Bc(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return wc(this,e,r,n);case"utf8":case"utf-8":return xc(this,e,r,n);case"ascii":case"latin1":case"binary":return Sc(this,e,r,n);case"base64":return Ec(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rc(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ic(t,e,r){return e===0&&r===t.length?di.fromByteArray(t):di.fromByteArray(t.slice(e,r))}function No(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let s=t[i],o=null,a=s>239?4:s>223?3:s>191?2:1;if(i+a<=r){let l,u,f,c;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[i+1],(l&192)===128&&(c=(s&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(c=(s&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[i+1],u=t[i+2],f=t[i+3],(l&192)===128&&(u&192)===128&&(f&192)===128&&(c=(s&15)<<18|(l&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=a}return Ac(n)}var Io=4096;function Ac(t){let e=t.length;if(e<=Io)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Io));return r}function Tc(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function vc(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function kc(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let s=e;s<r;++s)i+=Cc[t[s]];return i}function jc(t,e,r){let n=t.slice(e,r),i="";for(let s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}p.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,p.prototype),i};function H(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||H(e,r,this.length);let i=this[e],s=1,o=0;for(;++o<r&&(s*=256);)i+=this[e+o]*s;return i};p.prototype.readUintBE=p.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||H(e,r,this.length);let i=this[e+--r],s=1;for(;r>0&&(s*=256);)i+=this[e+--r]*s;return i};p.prototype.readUint8=p.prototype.readUInt8=function(e,r){return e=e>>>0,r||H(e,1,this.length),this[e]};p.prototype.readUint16LE=p.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||H(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUint16BE=p.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||H(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUint32LE=p.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUint32BE=p.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||H(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readBigUInt64LE=Ve(function(e){e=e>>>0,Mt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&yr(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<<BigInt(32))});p.prototype.readBigUInt64BE=Ve(function(e){e=e>>>0,Mt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&yr(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(s)});p.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||H(e,r,this.length);let i=this[e],s=1,o=0;for(;++o<r&&(s*=256);)i+=this[e+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*r)),i};p.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||H(e,r,this.length);let i=r,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};p.prototype.readInt8=function(e,r){return e=e>>>0,r||H(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){e=e>>>0,r||H(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){e=e>>>0,r||H(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return e=e>>>0,r||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return e=e>>>0,r||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readBigInt64LE=Ve(function(e){e=e>>>0,Mt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&yr(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});p.prototype.readBigInt64BE=Ve(function(e){e=e>>>0,Mt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&yr(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});p.prototype.readFloatLE=function(e,r){return e=e>>>0,r||H(e,4,this.length),Ft.read(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return e=e>>>0,r||H(e,4,this.length),Ft.read(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||H(e,8,this.length),Ft.read(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||H(e,8,this.length),Ft.read(this,e,!1,52,8)};function X(t,e,r,n,i,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;X(this,e,r,n,a,0)}let s=1,o=0;for(this[r]=e&255;++o<n&&(s*=256);)this[r+o]=e/s&255;return r+n};p.prototype.writeUintBE=p.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;X(this,e,r,n,a,0)}let s=n-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+n};p.prototype.writeUint8=p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,1,255,0),this[r]=e&255,r+1};p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Po(t,e,r,n,i){Fo(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function Oo(t,e,r,n,i){Fo(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}p.prototype.writeBigUInt64LE=Ve(function(e,r=0){return Po(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeBigUInt64BE=Ve(function(e,r=0){return Oo(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);X(this,e,r,n,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s<n&&(o*=256);)e<0&&a===0&&this[r+s-1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+n};p.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);X(this,e,r,n,l-1,-l)}let s=n-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||X(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};p.prototype.writeBigInt64LE=Ve(function(e,r=0){return Po(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});p.prototype.writeBigInt64BE=Ve(function(e,r=0){return Oo(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Lo(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bo(t,e,r,n,i){return e=+e,r=r>>>0,i||Lo(t,e,r,4,34028234663852886e22,-34028234663852886e22),Ft.write(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return Bo(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return Bo(this,e,r,!1,n)};function Co(t,e,r,n,i){return e=+e,r=r>>>0,i||Lo(t,e,r,8,17976931348623157e292,-17976931348623157e292),Ft.write(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return Co(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return Co(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,i){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),s};p.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!p.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{let o=p.isBuffer(e)?e:p.from(e,i),a=o.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-r;++s)this[s+r]=o[s%a]}return this};var Ct={};function mi(t,e,r){Ct[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}mi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);mi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);mi("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Ao(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ao(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Ao(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Nc(t,e,r){Mt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&yr(e,t.length-(r+1))}function Fo(t,e,r,n,i,s){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",a;throw s>3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new Ct.ERR_OUT_OF_RANGE("value",a,t)}Nc(n,i,s)}function Mt(t,e){if(typeof t!="number")throw new Ct.ERR_INVALID_ARG_TYPE(e,"number",t)}function yr(t,e,r){throw Math.floor(t)!==t?(Mt(t,r),new Ct.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Ct.ERR_BUFFER_OUT_OF_BOUNDS:new Ct.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Pc=/[^+/0-9A-Za-z-_]/g;function Oc(t){if(t=t.split("=")[0],t=t.trim().replace(Pc,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function _i(t,e){e=e||1/0;let r,n=t.length,i=null,s=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Lc(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Bc(t,e){let r,n,i,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}function Mo(t){return di.toByteArray(Oc(t))}function sn(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function he(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function gi(t){return t!==t}var Cc=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e})();function Ve(t){return typeof BigInt>"u"?Fc:t}function Fc(){throw new Error("BigInt not supported")}});var B=v((vg,ta)=>{"use strict";var Ri=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
|
|
2
|
-
`;super(r),this.name="AggregateError",this.errors=e}};ta.exports={AggregateError:Ri,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Ii=v((kg,ra)=>{"use strict";ra.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var Q=v((jg,sa)=>{"use strict";var{format:rd,inspect:ln}=Ii(),{AggregateError:nd}=B(),id=globalThis.AggregateError||nd,sd=Symbol("kIsNodeError"),od=["string","function","number","object","Function","Object","boolean","bigint","symbol"],ad=/^([A-Z][a-z0-9]*)+$/,ld="__node_internal_",un={};function mt(t,e){if(!t)throw new un.ERR_INTERNAL_ASSERTION(e)}function na(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ud(t,e,r){if(typeof e=="function")return mt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return mt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:rd(e,...r)}function K(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(ud(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[sd]=!0,un[t]=n}function ia(t){let e=ld+t.name;return Object.defineProperty(t,"name",{value:e}),t}function fd(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new id([e,t],e.message);return r.code=e.code,r}return t||e}var Ai=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new un.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};K("ERR_ASSERTION","%s",Error);K("ERR_INVALID_ARG_TYPE",(t,e,r)=>{mt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let l of e)mt(typeof l=="string","All expected entries have to be of type string"),od.includes(l)?i.push(l.toLowerCase()):ad.test(l)?s.push(l):(mt(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=ln(r,{depth:-1});n+=`. Received ${l}`}}else{let l=ln(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);K("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=ln(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);K("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);K("ERR_MISSING_ARGS",(...t)=>{mt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);K("ERR_OUT_OF_RANGE",(t,e,r)=>{mt(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=na(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=na(n)),n+="n"}else n=ln(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);K("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);K("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);K("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);K("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);K("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);K("ERR_STREAM_WRITE_AFTER_END","write after end",Error);K("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);sa.exports={AbortError:Ai,aggregateTwoErrors:ia(fd),hideStackFrames:ia,codes:un}});var zt=v((Ng,fn)=>{"use strict";var{AbortController:oa,AbortSignal:cd}=typeof self<"u"?self:typeof window<"u"?window:void 0;fn.exports=oa;fn.exports.AbortSignal=cd;fn.exports.default=oa});var Rr=v((Pg,Ti)=>{"use strict";var Gt=typeof Reflect=="object"?Reflect:null,aa=Gt&&typeof Gt.apply=="function"?Gt.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},cn;Gt&&typeof Gt.ownKeys=="function"?cn=Gt.ownKeys:Object.getOwnPropertySymbols?cn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:cn=function(e){return Object.getOwnPropertyNames(e)};function dd(t){console&&console.warn&&console.warn(t)}var ua=Number.isNaN||function(e){return e!==e};function j(){j.init.call(this)}Ti.exports=j;Ti.exports.once=yd;j.EventEmitter=j;j.prototype._events=void 0;j.prototype._eventsCount=0;j.prototype._maxListeners=void 0;var la=10;function dn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return la},set:function(t){if(typeof t!="number"||t<0||ua(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");la=t}});j.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};j.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ua(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function fa(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}j.prototype.getMaxListeners=function(){return fa(this)};j.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")aa(l,this,r);else for(var u=l.length,f=_a(l,u),n=0;n<u;++n)aa(f[n],this,r);return!0};function ca(t,e,r,n){var i,s,o;if(dn(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=fa(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,dd(a)}return t}j.prototype.addListener=function(e,r){return ca(this,e,r,!1)};j.prototype.on=j.prototype.addListener;j.prototype.prependListener=function(e,r){return ca(this,e,r,!0)};function hd(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function da(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=hd.bind(n);return i.listener=r,n.wrapFn=i,i}j.prototype.once=function(e,r){return dn(r),this.on(e,da(this,e,r)),this};j.prototype.prependOnceListener=function(e,r){return dn(r),this.prependListener(e,da(this,e,r)),this};j.prototype.removeListener=function(e,r){var n,i,s,o,a;if(dn(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():pd(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};j.prototype.off=j.prototype.removeListener;j.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function ha(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?_d(i):_a(i,i.length)}j.prototype.listeners=function(e){return ha(this,e,!0)};j.prototype.rawListeners=function(e){return ha(this,e,!1)};j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pa.call(t,e)};j.prototype.listenerCount=pa;function pa(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}j.prototype.eventNames=function(){return this._eventsCount>0?cn(this._events):[]};function _a(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function pd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function _d(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function yd(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}ya(t,e,s,{once:!0}),e!=="error"&&bd(t,i,{once:!0})})}function bd(t,e,r){typeof t.on=="function"&&ya(t,"error",e,r)}function ya(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Y=v((Og,ki)=>{"use strict";var md=pe(),{format:gd,inspect:wd}=Ii(),{codes:{ERR_INVALID_ARG_TYPE:vi}}=Q(),{kResistStopPropagation:xd,AggregateError:Sd,SymbolDispose:Ed}=B(),Rd=globalThis.AbortSignal||zt().AbortSignal,Id=globalThis.AbortController||zt().AbortController,Ad=Object.getPrototypeOf(async function(){}).constructor,ba=globalThis.Blob||md.Blob,Td=typeof ba<"u"?function(e){return e instanceof ba}:function(e){return!1},ma=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new vi(e,"AbortSignal",t)},vd=(t,e)=>{if(typeof t!="function")throw new vi(e,"Function",t)};ki.exports={AggregateError:Sd,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format:gd,inspect:wd,types:{isAsyncFunction(t){return t instanceof Ad},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Td,deprecate(t,e){return t},addAbortListener:Rr().addAbortListener||function(e,r){if(e===void 0)throw new vi("signal","AbortSignal",e);ma(e,"signal"),vd(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[xd]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Ed](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Rd.any||function(e){if(e.length===1)return e[0];let r=new Id,n=()=>r.abort();return e.forEach(i=>{ma(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};ki.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Vt=v((Lg,va)=>{"use strict";var{ArrayIsArray:Ni,ArrayPrototypeIncludes:Sa,ArrayPrototypeJoin:Ea,ArrayPrototypeMap:kd,NumberIsInteger:Pi,NumberIsNaN:jd,NumberMAX_SAFE_INTEGER:Nd,NumberMIN_SAFE_INTEGER:Pd,NumberParseInt:Od,ObjectPrototypeHasOwnProperty:Ld,RegExpPrototypeExec:Ra,String:Bd,StringPrototypeToUpperCase:Cd,StringPrototypeTrim:Fd}=B(),{hideStackFrames:ie,codes:{ERR_SOCKET_BAD_PORT:Md,ERR_INVALID_ARG_TYPE:J,ERR_INVALID_ARG_VALUE:Ht,ERR_OUT_OF_RANGE:gt,ERR_UNKNOWN_SIGNAL:ga}}=Q(),{normalizeEncoding:Dd}=Y(),{isAsyncFunction:Ud,isArrayBufferView:$d}=Y().types,wa={};function qd(t){return t===(t|0)}function Wd(t){return t===t>>>0}var zd=/^[0-7]+$/,Gd="must be a 32-bit unsigned integer or an octal string";function Hd(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Ra(zd,t)===null)throw new Ht(e,t,Gd);t=Od(t,8)}return Ia(t,e),t}var Vd=ie((t,e,r=Pd,n=Nd)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);if(t<r||t>n)throw new gt(e,`>= ${r} && <= ${n}`,t)}),Kd=ie((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);if(t<r||t>n)throw new gt(e,`>= ${r} && <= ${n}`,t)}),Ia=ie((t,e,r=!1)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new gt(e,`>= ${n} && <= ${i}`,t)});function Oi(t,e){if(typeof t!="string")throw new J(e,"string",t)}function Qd(t,e,r=void 0,n){if(typeof t!="number")throw new J(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&jd(t))throw new gt(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Jd=ie((t,e,r)=>{if(!Sa(r,t)){let i="must be one of: "+Ea(kd(r,s=>typeof s=="string"?`'${s}'`:Bd(s)),", ");throw new Ht(e,t,i)}});function Aa(t,e){if(typeof t!="boolean")throw new J(e,"boolean",t)}function ji(t,e,r){return t==null||!Ld(t,e)?r:t[e]}var Yd=ie((t,e,r=null)=>{let n=ji(r,"allowArray",!1),i=ji(r,"allowFunction",!1);if(!ji(r,"nullable",!1)&&t===null||!n&&Ni(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new J(e,"Object",t)}),Zd=ie((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new J(e,"a dictionary",t)}),hn=ie((t,e,r=0)=>{if(!Ni(t))throw new J(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Ht(e,t,n)}});function Xd(t,e){hn(t,e);for(let r=0;r<t.length;r++)Oi(t[r],`${e}[${r}]`)}function eh(t,e){hn(t,e);for(let r=0;r<t.length;r++)Aa(t[r],`${e}[${r}]`)}function th(t,e){hn(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new J(i,"AbortSignal",n);Ta(n,i)}}function rh(t,e="signal"){if(Oi(t,e),wa[t]===void 0)throw wa[Cd(t)]!==void 0?new ga(t+" (signals must use all capital letters)"):new ga(t)}var nh=ie((t,e="buffer")=>{if(!$d(t))throw new J(e,["Buffer","TypedArray","DataView"],t)});function ih(t,e){let r=Dd(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Ht("encoding",e,`is invalid for data of length ${n}`)}function sh(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Fd(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Md(e,t,r);return t|0}var Ta=ie((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new J(e,"AbortSignal",t)}),oh=ie((t,e)=>{if(typeof t!="function")throw new J(e,"Function",t)}),ah=ie((t,e)=>{if(typeof t!="function"||Ud(t))throw new J(e,"Function",t)}),lh=ie((t,e)=>{if(t!==void 0)throw new J(e,"undefined",t)});function uh(t,e,r){if(!Sa(r,t))throw new J(e,`('${Ea(r,"|")}')`,t)}var fh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function xa(t,e){if(typeof t>"u"||!Ra(fh,t))throw new Ht(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ch(t){if(typeof t=="string")return xa(t,"hints"),t;if(Ni(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];xa(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Ht("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}va.exports={isInt32:qd,isUint32:Wd,parseFileMode:Hd,validateArray:hn,validateStringArray:Xd,validateBooleanArray:eh,validateAbortSignalArray:th,validateBoolean:Aa,validateBuffer:nh,validateDictionary:Zd,validateEncoding:ih,validateFunction:oh,validateInt32:Kd,validateInteger:Vd,validateNumber:Qd,validateObject:Yd,validateOneOf:Jd,validatePlainFunction:ah,validatePort:sh,validateSignalName:rh,validateString:Oi,validateUint32:Ia,validateUndefined:lh,validateUnion:uh,validateAbortSignal:Ta,validateLinkHeaderValue:ch}});var Je=v((Bg,Pa)=>{var F=Pa.exports={},ye,be;function Li(){throw new Error("setTimeout has not been defined")}function Bi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ye=setTimeout:ye=Li}catch{ye=Li}try{typeof clearTimeout=="function"?be=clearTimeout:be=Bi}catch{be=Bi}})();function ka(t){if(ye===setTimeout)return setTimeout(t,0);if((ye===Li||!ye)&&setTimeout)return ye=setTimeout,setTimeout(t,0);try{return ye(t,0)}catch{try{return ye.call(null,t,0)}catch{return ye.call(this,t,0)}}}function dh(t){if(be===clearTimeout)return clearTimeout(t);if((be===Bi||!be)&&clearTimeout)return be=clearTimeout,clearTimeout(t);try{return be(t)}catch{try{return be.call(null,t)}catch{return be.call(this,t)}}}var Oe=[],Kt=!1,wt,pn=-1;function hh(){!Kt||!wt||(Kt=!1,wt.length?Oe=wt.concat(Oe):pn=-1,Oe.length&&ja())}function ja(){if(!Kt){var t=ka(hh);Kt=!0;for(var e=Oe.length;e;){for(wt=Oe,Oe=[];++pn<e;)wt&&wt[pn].run();pn=-1,e=Oe.length}wt=null,Kt=!1,dh(t)}}F.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Oe.push(new Na(t,e)),Oe.length===1&&!Kt&&ka(ja)};function Na(t,e){this.fun=t,this.array=e}Na.prototype.run=function(){this.fun.apply(null,this.array)};F.title="browser";F.browser=!0;F.env={};F.argv=[];F.version="";F.versions={};function Le(){}F.on=Le;F.addListener=Le;F.once=Le;F.off=Le;F.removeListener=Le;F.removeAllListeners=Le;F.emit=Le;F.prependListener=Le;F.prependOnceListener=Le;F.listeners=function(t){return[]};F.binding=function(t){throw new Error("process.binding is not supported")};F.cwd=function(){return"/"};F.chdir=function(t){throw new Error("process.chdir is not supported")};F.umask=function(){return 0}});var ge=v((Cg,Va)=>{"use strict";var{SymbolAsyncIterator:Oa,SymbolIterator:La,SymbolFor:xt}=B(),Ba=xt("nodejs.stream.destroyed"),Ca=xt("nodejs.stream.errored"),Ci=xt("nodejs.stream.readable"),Fi=xt("nodejs.stream.writable"),Fa=xt("nodejs.stream.disturbed"),ph=xt("nodejs.webstream.isClosedPromise"),_h=xt("nodejs.webstream.controllerErrorFunction");function _n(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function yn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function yh(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function me(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Ma(t){return!!(t&&!me(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Da(t){return!!(t&&!me(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Ua(t){return!!(t&&!me(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function bh(t){return Ma(t)||Da(t)||Ua(t)}function mh(t,e){return t==null?!1:e===!0?typeof t[Oa]=="function":e===!1?typeof t[La]=="function":typeof t[Oa]=="function"||typeof t[La]=="function"}function bn(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Ba]||n!=null&&n.destroyed)}function $a(t){if(!yn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function gh(t,e){if(!yn(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function wh(t){if(!_n(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function qa(t,e){if(!_n(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Wa(t){return t&&t[Ci]!=null?t[Ci]:typeof t?.readable!="boolean"?null:bn(t)?!1:_n(t)&&t.readable&&!qa(t)}function za(t){return t&&t[Fi]!=null?t[Fi]:typeof t?.writable!="boolean"?null:bn(t)?!1:yn(t)&&t.writable&&!$a(t)}function xh(t,e){return me(t)?bn(t)?!0:!(e?.readable!==!1&&Wa(t)||e?.writable!==!1&&za(t)):null}function Sh(t){var e,r;return me(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Eh(t){var e,r;return me(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Rh(t){if(!me(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Ga(t)?t._closed:null}function Ga(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Ha(t){return typeof t._sent100=="boolean"&&Ga(t)}function Ih(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Ah(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Ha(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Th(t){var e;return!!(t&&((e=t[Fa])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function vh(t){var e,r,n,i,s,o,a,l,u,f;return!!(t&&((e=(r=(n=(i=(s=(o=t[Ca])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}Va.exports={isDestroyed:bn,kIsDestroyed:Ba,isDisturbed:Th,kIsDisturbed:Fa,isErrored:vh,kIsErrored:Ca,isReadable:Wa,kIsReadable:Ci,kIsClosedPromise:ph,kControllerErrorFunction:_h,kIsWritable:Fi,isClosed:Rh,isDuplexNodeStream:yh,isFinished:xh,isIterable:mh,isReadableNodeStream:_n,isReadableStream:Ma,isReadableEnded:wh,isReadableFinished:qa,isReadableErrored:Eh,isNodeStream:me,isWebStream:bh,isWritable:za,isWritableNodeStream:yn,isWritableStream:Da,isWritableEnded:$a,isWritableFinished:gh,isWritableErrored:Sh,isServerRequest:Ih,isServerResponse:Ha,willEmitClose:Ah,isTransformStream:Ua}});var Be=v((Fg,qi)=>{"use strict";var Ye=Je(),{AbortError:rl,codes:kh}=Q(),{ERR_INVALID_ARG_TYPE:jh,ERR_STREAM_PREMATURE_CLOSE:Ka}=kh,{kEmptyObject:Di,once:Ui}=Y(),{validateAbortSignal:Nh,validateFunction:Ph,validateObject:Oh,validateBoolean:Lh}=Vt(),{Promise:Bh,PromisePrototypeThen:Ch,SymbolDispose:nl}=B(),{isClosed:Fh,isReadable:Qa,isReadableNodeStream:Mi,isReadableStream:Mh,isReadableFinished:Ja,isReadableErrored:Ya,isWritable:Za,isWritableNodeStream:Xa,isWritableStream:Dh,isWritableFinished:el,isWritableErrored:tl,isNodeStream:Uh,willEmitClose:$h,kIsClosedPromise:qh}=ge(),Qt;function Wh(t){return t.setHeader&&typeof t.abort=="function"}var $i=()=>{};function il(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Di):e==null?e=Di:Oh(e,"options"),Ph(r,"callback"),Nh(e.signal,"options.signal"),r=Ui(r),Mh(t)||Dh(t))return zh(t,e,r);if(!Uh(t))throw new jh("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:Mi(t),o=(i=e.writable)!==null&&i!==void 0?i:Xa(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||d()},f=$h(t)&&Mi(t)===s&&Xa(t)===o,c=el(t,!1),d=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||h)&&r.call(t)},h=Ja(t,!1),y=()=>{h=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},_=T=>{r.call(t,T)},x=Fh(t),b=()=>{x=!0;let T=tl(t)||Ya(t);if(T&&typeof T!="boolean")return r.call(t,T);if(s&&!h&&Mi(t,!0)&&!Ja(t,!1))return r.call(t,new Ka);if(o&&!c&&!el(t,!1))return r.call(t,new Ka);r.call(t)},g=()=>{x=!0;let T=tl(t)||Ya(t);if(T&&typeof T!="boolean")return r.call(t,T);r.call(t)},S=()=>{t.req.on("finish",d)};Wh(t)?(t.on("complete",d),f||t.on("abort",b),t.req?S():t.on("request",S)):o&&!a&&(t.on("end",u),t.on("close",u)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",b),t.on("end",y),t.on("finish",d),e.error!==!1&&t.on("error",_),t.on("close",b),x?Ye.nextTick(b):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?f||Ye.nextTick(g):(!s&&(!f||Qa(t))&&(c||Za(t)===!1)||!o&&(!f||Za(t))&&(h||Qa(t)===!1)||l&&t.req&&t.aborted)&&Ye.nextTick(g);let w=()=>{r=$i,t.removeListener("aborted",b),t.removeListener("complete",d),t.removeListener("abort",b),t.removeListener("request",S),t.req&&t.req.removeListener("finish",d),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",d),t.removeListener("end",y),t.removeListener("error",_),t.removeListener("close",b)};if(e.signal&&!x){let T=()=>{let Ae=r;w(),Ae.call(t,new rl(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ye.nextTick(T);else{Qt=Qt||Y().addAbortListener;let Ae=Qt(e.signal,T),U=r;r=Ui((...jt)=>{Ae[nl](),U.apply(t,jt)})}}return w}function zh(t,e,r){let n=!1,i=$i;if(e.signal)if(i=()=>{n=!0,r.call(t,new rl(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ye.nextTick(i);else{Qt=Qt||Y().addAbortListener;let o=Qt(e.signal,i),a=r;r=Ui((...l)=>{o[nl](),a.apply(t,l)})}let s=(...o)=>{n||Ye.nextTick(()=>r.apply(t,o))};return Ch(t[qh].promise,s,s),$i}function Gh(t,e){var r;let n=!1;return e===null&&(e=Di),(r=e)!==null&&r!==void 0&&r.cleanup&&(Lh(e.cleanup,"cleanup"),n=e.cleanup),new Bh((i,s)=>{let o=il(t,e,a=>{n&&o(),a?s(a):i()})})}qi.exports=il;qi.exports.finished=Gh});var St=v((Mg,dl)=>{"use strict";var we=Je(),{aggregateTwoErrors:Hh,codes:{ERR_MULTIPLE_CALLBACK:Vh},AbortError:Kh}=Q(),{Symbol:al}=B(),{kIsDestroyed:Qh,isDestroyed:Jh,isFinished:Yh,isServerRequest:Zh}=ge(),ll=al("kDestroy"),Wi=al("kConstruct");function ul(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Xh(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(ul(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?sl(this,t,e):this.once(ll,function(s){sl(this,Hh(s,t),e)}),this)}function sl(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;ul(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?we.nextTick(ep,t,s):we.nextTick(fl,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function ep(t,e){zi(t,e),fl(t)}function fl(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function zi(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function tp(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Gi(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?we.nextTick(zi,t,e):zi(t,e))}function rp(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Wi,e),!(t.listenerCount(Wi)>1)&&we.nextTick(np,t)}function np(t){let e=!1;function r(n){if(e){Gi(t,n??new Vh);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(ll,n):n?Gi(t,n,!0):we.nextTick(ip,t)}try{t._construct(n=>{we.nextTick(r,n)})}catch(n){we.nextTick(r,n)}}function ip(t){t.emit(Wi)}function ol(t){return t?.setHeader&&typeof t.abort=="function"}function cl(t){t.emit("close")}function sp(t,e){t.emit("error",e),we.nextTick(cl,t)}function op(t,e){!t||Jh(t)||(!e&&!Yh(t)&&(e=new Kh),Zh(t)?(t.socket=null,t.destroy(e)):ol(t)?t.abort():ol(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?we.nextTick(sp,t,e):we.nextTick(cl,t),t.destroyed||(t[Qh]=!0))}dl.exports={construct:rp,destroyer:op,destroy:Xh,undestroy:tp,errorOrDestroy:Gi}});var wn=v((Dg,pl)=>{"use strict";var{ArrayIsArray:ap,ObjectSetPrototypeOf:hl}=B(),{EventEmitter:mn}=Rr();function gn(t){mn.call(this,t)}hl(gn.prototype,mn.prototype);hl(gn,mn);gn.prototype.pipe=function(t,e){let r=this;function n(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(f){u(),mn.listenerCount(this,"error")===0&&this.emit("error",f)}Hi(r,"error",l),Hi(t,"error",l);function u(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Hi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):ap(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}pl.exports={Stream:gn,prependListener:Hi}});var Ir=v((Ug,xn)=>{"use strict";var{SymbolDispose:lp}=B(),{AbortError:_l,codes:up}=Q(),{isNodeStream:yl,isWebStream:fp,kControllerErrorFunction:cp}=ge(),dp=Be(),{ERR_INVALID_ARG_TYPE:bl}=up,Vi,hp=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new bl(e,"AbortSignal",t)};xn.exports.addAbortSignal=function(e,r){if(hp(e,"signal"),!yl(r)&&!fp(r))throw new bl("stream",["ReadableStream","WritableStream","Stream"],r);return xn.exports.addAbortSignalNoValidate(e,r)};xn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=yl(e)?()=>{e.destroy(new _l(void 0,{cause:t.reason}))}:()=>{e[cp](new _l(void 0,{cause:t.reason}))};if(t.aborted)r();else{Vi=Vi||Y().addAbortListener;let n=Vi(t,r);dp(e,n[lp])}return e}});var wl=v((qg,gl)=>{"use strict";var{StringPrototypeSlice:ml,SymbolIterator:pp,TypedArrayPrototypeSet:Sn,Uint8Array:_p}=B(),{Buffer:Ki}=pe(),{inspect:yp}=Y();gl.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Ki.alloc(0);let r=Ki.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Sn(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[pp](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let s=n.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=ml(s,0,e),this.head=n,n.data=ml(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Ki.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Sn(r,o,n-e),e-=o.length;else{e===o.length?(Sn(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Sn(r,new _p(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return yp(this,{...r,depth:0,customInspect:!1})}}});var Ar=v((Wg,Rl)=>{"use strict";var{MathFloor:bp,NumberIsInteger:mp}=B(),{validateInteger:gp}=Vt(),{ERR_INVALID_ARG_VALUE:wp}=Q().codes,xl=16*1024,Sl=16;function xp(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function El(t){return t?Sl:xl}function Sp(t,e){gp(e,"value",0),t?Sl=e:xl=e}function Ep(t,e,r,n){let i=xp(e,n,r);if(i!=null){if(!mp(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new wp(s,i)}return bp(i)}return El(t.objectMode)}Rl.exports={getHighWaterMark:Ep,getDefaultHighWaterMark:El,setDefaultHighWaterMark:Sp}});var Tl=v((Qi,Al)=>{var En=pe(),xe=En.Buffer;function Il(t,e){for(var r in t)e[r]=t[r]}xe.from&&xe.alloc&&xe.allocUnsafe&&xe.allocUnsafeSlow?Al.exports=En:(Il(En,Qi),Qi.Buffer=Et);function Et(t,e,r){return xe(t,e,r)}Et.prototype=Object.create(xe.prototype);Il(xe,Et);Et.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return xe(t,e,r)};Et.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=xe(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Et.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return xe(t)};Et.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return En.SlowBuffer(t)}});var jl=v(kl=>{"use strict";var Yi=Tl().Buffer,vl=Yi.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Rp(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Ip(t){var e=Rp(t);if(typeof e!="string"&&(Yi.isEncoding===vl||!vl(t)))throw new Error("Unknown encoding: "+t);return e||t}kl.StringDecoder=Tr;function Tr(t){this.encoding=Ip(t);var e;switch(this.encoding){case"utf16le":this.text=Np,this.end=Pp,e=4;break;case"utf8":this.fillLast=vp,e=4;break;case"base64":this.text=Op,this.end=Lp,e=3;break;default:this.write=Bp,this.end=Cp;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Yi.allocUnsafe(e)}Tr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Tr.prototype.end=jp;Tr.prototype.text=kp;Tr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ji(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Ap(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Ji(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Ji(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Ji(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Tp(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function vp(t){var e=this.lastTotal-this.lastNeed,r=Tp(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function kp(t,e){var r=Ap(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function jp(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Np(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Pp(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Op(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Lp(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Bp(t){return t.toString(this.encoding)}function Cp(t){return t&&t.length?this.write(t):""}});var Zi=v((Gg,Ll)=>{"use strict";var Nl=Je(),{PromisePrototypeThen:Fp,SymbolAsyncIterator:Pl,SymbolIterator:Ol}=B(),{Buffer:Mp}=pe(),{ERR_INVALID_ARG_TYPE:Dp,ERR_STREAM_NULL_VALUES:Up}=Q().codes;function $p(t,e,r){let n;if(typeof e=="string"||e instanceof Mp)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Pl])i=!0,n=e[Pl]();else if(e&&e[Ol])i=!1,n=e[Ol]();else throw new Dp("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,f){Fp(a(u),()=>Nl.nextTick(f,u),c=>Nl.nextTick(f,c||u))};async function a(u){let f=u!=null,c=typeof n.throw=="function";if(f&&c){let{value:d,done:h}=await n.throw(u);if(await d,h)return}if(typeof n.return=="function"){let{value:d}=await n.return();await d}}async function l(){for(;;){try{let{value:u,done:f}=i?await n.next():n.next();if(f)s.push(null);else{let c=u&&typeof u.then=="function"?await u:u;if(c===null)throw o=!1,new Up;if(s.push(c))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ll.exports=$p});var kr=v((Hg,Zl)=>{"use strict";var le=Je(),{ArrayPrototypeIndexOf:qp,NumberIsInteger:Wp,NumberIsNaN:zp,NumberParseInt:Gp,ObjectDefineProperties:os,ObjectKeys:Hp,ObjectSetPrototypeOf:Fl,Promise:Ml,SafeSet:Vp,SymbolAsyncDispose:Kp,SymbolAsyncIterator:Qp,Symbol:Jp}=B();Zl.exports=I;I.ReadableState=Tn;var{EventEmitter:Yp}=Rr(),{Stream:Ze,prependListener:Zp}=wn(),{Buffer:Xi}=pe(),{addAbortSignal:Xp}=Ir(),Dl=Be(),A=Y().debuglog("stream",t=>{A=t}),e_=wl(),Zt=St(),{getHighWaterMark:t_,getDefaultHighWaterMark:r_}=Ar(),{aggregateTwoErrors:Bl,codes:{ERR_INVALID_ARG_TYPE:n_,ERR_METHOD_NOT_IMPLEMENTED:i_,ERR_OUT_OF_RANGE:s_,ERR_STREAM_PUSH_AFTER_EOF:o_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:a_},AbortError:l_}=Q(),{validateObject:u_}=Vt(),Rt=Jp("kPaused"),{StringDecoder:Ul}=jl(),f_=Zi();Fl(I.prototype,Ze.prototype);Fl(I,Ze);var es=()=>{},{errorOrDestroy:Jt}=Zt,Yt=1,c_=2,$l=4,vr=8,ql=16,Rn=32,In=64,Wl=128,d_=256,h_=512,p_=1024,is=2048,ss=4096,__=8192,y_=16384,b_=32768,zl=65536,m_=1<<17,g_=1<<18;function q(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}os(Tn.prototype,{objectMode:q(Yt),ended:q(c_),endEmitted:q($l),reading:q(vr),constructed:q(ql),sync:q(Rn),needReadable:q(In),emittedReadable:q(Wl),readableListening:q(d_),resumeScheduled:q(h_),errorEmitted:q(p_),emitClose:q(is),autoDestroy:q(ss),destroyed:q(__),closed:q(y_),closeEmitted:q(b_),multiAwaitDrain:q(zl),readingMore:q(m_),dataEmitted:q(g_)});function Tn(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.state=is|ss|ql|Rn,t&&t.objectMode&&(this.state|=Yt),r&&t&&t.readableObjectMode&&(this.state|=Yt),this.highWaterMark=t?t_(this,t,"readableHighWaterMark",r):r_(!1),this.buffer=new e_,this.length=0,this.pipes=[],this.flowing=null,this[Rt]=null,t&&t.emitClose===!1&&(this.state&=~is),t&&t.autoDestroy===!1&&(this.state&=~ss),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Ul(t.encoding),this.encoding=t.encoding)}function I(t){if(!(this instanceof I))return new I(t);let e=this instanceof Se();this._readableState=new Tn(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Xp(t.signal,this)),Ze.call(this,t),Zt.construct(this,()=>{this._readableState.needReadable&&An(this,this._readableState)})}I.prototype.destroy=Zt.destroy;I.prototype._undestroy=Zt.undestroy;I.prototype._destroy=function(t,e){e(t)};I.prototype[Yp.captureRejectionSymbol]=function(t){this.destroy(t)};I.prototype[Kp]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new l_,this.destroy(t)),new Ml((e,r)=>Dl(this,n=>n&&n!==t?r(n):e(null)))};I.prototype.push=function(t,e){return Gl(this,t,e,!1)};I.prototype.unshift=function(t,e){return Gl(this,t,e,!0)};function Gl(t,e,r,n){A("readableAddChunk",e);let i=t._readableState,s;if((i.state&Yt)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=Xi.from(e,r).toString(i.encoding):(e=Xi.from(e,r),r=""))):e instanceof Xi?r="":Ze._isUint8Array(e)?(e=Ze._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new n_("chunk",["string","Buffer","Uint8Array"],e))),s)Jt(t,s);else if(e===null)i.state&=~vr,S_(t,i);else if((i.state&Yt)!==0||e&&e.length>0)if(n)if((i.state&$l)!==0)Jt(t,new a_);else{if(i.destroyed||i.errored)return!1;ts(t,i,e,!0)}else if(i.ended)Jt(t,new o_);else{if(i.destroyed||i.errored)return!1;i.state&=~vr,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?ts(t,i,e,!1):An(t,i)):ts(t,i,e,!1)}else n||(i.state&=~vr,An(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function ts(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&zl)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&In)!==0&&vn(t)),An(t,e)}I.prototype.isPaused=function(){let t=this._readableState;return t[Rt]===!0||t.flowing===!1};I.prototype.setEncoding=function(t){let e=new Ul(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var w_=1073741824;function x_(t){if(t>w_)throw new s_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Cl(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Yt)!==0?1:zp(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}I.prototype.read=function(t){A("read",t),t===void 0?t=NaN:Wp(t)||(t=Gp(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=x_(t)),t!==0&&(e.state&=~Wl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return A("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?rs(this):vn(this),null;if(t=Cl(t,e),t===0&&e.ended)return e.length===0&&rs(this),null;let n=(e.state&In)!==0;if(A("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,A("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,A("reading, ended or constructing",n);else if(n){A("do read"),e.state|=vr|Rn,e.length===0&&(e.state|=In);try{this._read(e.highWaterMark)}catch(s){Jt(this,s)}e.state&=~Rn,e.reading||(t=Cl(r,e))}let i;return t>0?i=Jl(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&rs(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function S_(t,e){if(A("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?vn(t):(e.needReadable=!1,e.emittedReadable=!0,Hl(t))}}function vn(t){let e=t._readableState;A("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(A("emitReadable",e.flowing),e.emittedReadable=!0,le.nextTick(Hl,t))}function Hl(t){let e=t._readableState;A("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Kl(t)}function An(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,le.nextTick(E_,t,e))}function E_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(A("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}I.prototype._read=function(t){throw new i_("_read()")};I.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Vp(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),A("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==le.stdout&&t!==le.stderr?a:x;n.endEmitted?le.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(b,g){A("onunpipe"),b===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,f())}function a(){A("onend"),t.end()}let l,u=!1;function f(){A("cleanup"),t.removeListener("close",y),t.removeListener("finish",_),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",x),r.removeListener("data",d),u=!0,l&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function c(){u||(n.pipes.length===1&&n.pipes[0]===t?(A("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(A("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=R_(r,t),t.on("drain",l))}r.on("data",d);function d(b){A("ondata");let g=t.write(b);A("dest.write",g),g===!1&&c()}function h(b){if(A("onerror",b),x(),t.removeListener("error",h),t.listenerCount("error")===0){let g=t._writableState||t._readableState;g&&!g.errorEmitted?Jt(t,b):t.emit("error",b)}}Zp(t,"error",h);function y(){t.removeListener("finish",_),x()}t.once("close",y);function _(){A("onfinish"),t.removeListener("close",y),x()}t.once("finish",_);function x(){A("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():n.flowing||(A("pipe resume"),r.resume()),t};function R_(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(A("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(A("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}I.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s<i.length;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=qp(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};I.prototype.on=function(t,e){let r=Ze.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,A("on readable",n.length,n.reading),n.length?vn(this):n.reading||le.nextTick(I_,this)),r};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(t,e){let r=Ze.prototype.removeListener.call(this,t,e);return t==="readable"&&le.nextTick(Vl,this),r};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(t){let e=Ze.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&le.nextTick(Vl,this),e};function Vl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Rt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function I_(t){A("readable nexttick read 0"),t.read(0)}I.prototype.resume=function(){let t=this._readableState;return t.flowing||(A("resume"),t.flowing=!t.readableListening,A_(this,t)),t[Rt]=!1,this};function A_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,le.nextTick(T_,t,e))}function T_(t,e){A("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Kl(t),e.flowing&&!e.reading&&t.read(0)}I.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Rt]=!0,this};function Kl(t){let e=t._readableState;for(A("flow",e.flowing);e.flowing&&t.read()!==null;);}I.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Jt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Hp(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};I.prototype[Qp]=function(){return Ql(this)};I.prototype.iterator=function(t){return t!==void 0&&u_(t,"options"),Ql(this,t)};function Ql(t,e){typeof t.read!="function"&&(t=I.wrap(t,{objectMode:!0}));let r=v_(t,e);return r.stream=t,r}async function*v_(t,e){let r=es;function n(o){this===t?(r(),r=es):r=o}t.on("readable",n);let i,s=Dl(t,{writable:!1},o=>{i=o?Bl(i,o):null,r(),r=es});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new Ml(n)}}}catch(o){throw i=Bl(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Zt.destroyer(t,null):(t.off("readable",n),s())}}os(I.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});os(Tn.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Rt]!==!1},set(t){this[Rt]=!!t}}});I._fromList=Jl;function Jl(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function rs(t){let e=t._readableState;A("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,le.nextTick(k_,e,t))}function k_(t,e){if(A("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)le.nextTick(j_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function j_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}I.from=function(t,e){return f_(I,t,e)};var ns;function Yl(){return ns===void 0&&(ns={}),ns}I.fromWeb=function(t,e){return Yl().newStreamReadableFromReadableStream(t,e)};I.toWeb=function(t,e){return Yl().newReadableStreamFromStreamReadable(t,e)};I.wrap=function(t,e){var r,n;return new I({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){Zt.destroyer(t,i),s(i)}}).wrap(t)}});var On=v((Vg,fu)=>{"use strict";var It=Je(),{ArrayPrototypeSlice:tu,Error:N_,FunctionPrototypeSymbolHasInstance:ru,ObjectDefineProperty:nu,ObjectDefineProperties:P_,ObjectSetPrototypeOf:iu,StringPrototypeToLowerCase:O_,Symbol:L_,SymbolHasInstance:B_}=B();fu.exports=C;C.WritableState=Pr;var{EventEmitter:C_}=Rr(),jr=wn().Stream,{Buffer:kn}=pe(),Pn=St(),{addAbortSignal:F_}=Ir(),{getHighWaterMark:M_,getDefaultHighWaterMark:D_}=Ar(),{ERR_INVALID_ARG_TYPE:U_,ERR_METHOD_NOT_IMPLEMENTED:$_,ERR_MULTIPLE_CALLBACK:su,ERR_STREAM_CANNOT_PIPE:q_,ERR_STREAM_DESTROYED:Nr,ERR_STREAM_ALREADY_FINISHED:W_,ERR_STREAM_NULL_VALUES:z_,ERR_STREAM_WRITE_AFTER_END:G_,ERR_UNKNOWN_ENCODING:ou}=Q().codes,{errorOrDestroy:Xt}=Pn;iu(C.prototype,jr.prototype);iu(C,jr);function us(){}var er=L_("kOnFinished");function Pr(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?M_(this,t,"writableHighWaterMark",r):D_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=V_.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Nn(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[er]=[]}function Nn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Pr.prototype.getBuffer=function(){return tu(this.buffered,this.bufferedIndex)};nu(Pr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function C(t){let e=this instanceof Se();if(!e&&!ru(C,this))return new C(t);this._writableState=new Pr(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&F_(t.signal,this)),jr.call(this,t),Pn.construct(this,()=>{let r=this._writableState;r.writing||cs(this,r),ds(this,r)})}nu(C,B_,{__proto__:null,value:function(t){return ru(this,t)?!0:this!==C?!1:t&&t._writableState instanceof Pr}});C.prototype.pipe=function(){Xt(this,new q_)};function au(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!kn.isEncoding(r))throw new ou(r);typeof n!="function"&&(n=us)}if(e===null)throw new z_;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=kn.from(e,r),r="buffer");else if(e instanceof kn)r="buffer";else if(jr._isUint8Array(e))e=jr._uint8ArrayToBuffer(e),r="buffer";else throw new U_("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new G_:i.destroyed&&(s=new Nr("write")),s?(It.nextTick(n,s),Xt(t,s,!0),s):(i.pendingcb++,H_(t,i,e,r,n))}C.prototype.write=function(t,e,r){return au(this,t,e,r)===!0};C.prototype.cork=function(){this._writableState.corked++};C.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||cs(this,t))};C.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=O_(e)),!kn.isEncoding(e))throw new ou(e);return this._writableState.defaultEncoding=e,this};function H_(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==us&&(e.allNoop=!1)):(e.writelen=s,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function Xl(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Nr("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function eu(t,e,r,n){--e.pendingcb,n(r),fs(e),Xt(t,r)}function V_(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Xt(t,new su);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?It.nextTick(eu,t,r,e,i):eu(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&cs(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},It.nextTick(K_,r.afterWriteTickInfo)):lu(t,r,1,i))}function K_({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,lu(t,e,r,n)}function lu(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&fs(e),ds(t,e)}function fs(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:s,callback:o}=t.buffered[i],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new Nr("write"))}let r=t[er].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new Nr("end"))}Nn(t)}function cs(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,s=r.length-n;if(!s)return;let o=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?us:u=>{for(let f=o;f<r.length;++f)r[f].callback(u)},l=e.allNoop&&o===0?r:tu(r,o);l.allBuffers=e.allBuffers,Xl(t,e,!0,e.length,l,"",a),Nn(e)}else{do{let{chunk:a,encoding:l,callback:u}=r[o];r[o++]=null;let f=i?1:a.length;Xl(t,e,!1,f,a,l,u)}while(o<r.length&&!e.writing);o===r.length?Nn(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}C.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new $_("_write()")};C.prototype._writev=null;C.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=au(this,t,e);s instanceof N_&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,ds(this,n,!0),n.ended=!0):n.finished?i=new W_("end"):n.destroyed&&(i=new Nr("end"))),typeof r=="function"&&(i||n.finished?It.nextTick(r,i):n[er].push(r)),this};function jn(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Q_(t,e){let r=!1;function n(i){if(r){Xt(t,i??su());return}if(r=!0,e.pendingcb--,i){let s=e[er].splice(0);for(let o=0;o<s.length;o++)s[o](i);Xt(t,i,e.sync)}else jn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,It.nextTick(ls,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function J_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Q_(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function ds(t,e,r){jn(e)&&(J_(t,e),e.pendingcb===0&&(r?(e.pendingcb++,It.nextTick((n,i)=>{jn(i)?ls(n,i):i.pendingcb--},t,e)):jn(e)&&(e.pendingcb++,ls(t,e))))}function ls(t,e){e.pendingcb--,e.finished=!0;let r=e[er].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}P_(C.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Y_=Pn.destroy;C.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[er].length)&&It.nextTick(fs,r),Y_.call(this,t,e),this};C.prototype._undestroy=Pn.undestroy;C.prototype._destroy=function(t,e){e(t)};C.prototype[C_.captureRejectionSymbol]=function(t){this.destroy(t)};var as;function uu(){return as===void 0&&(as={}),as}C.fromWeb=function(t,e){return uu().newStreamWritableFromWritableStream(t,e)};C.toWeb=function(t){return uu().newWritableStreamFromStreamWritable(t)}});var Iu=v((Kg,Ru)=>{var hs=Je(),Z_=pe(),{isReadable:X_,isWritable:ey,isIterable:cu,isNodeStream:ty,isReadableNodeStream:du,isWritableNodeStream:hu,isDuplexNodeStream:ry,isReadableStream:pu,isWritableStream:_u}=ge(),yu=Be(),{AbortError:Su,codes:{ERR_INVALID_ARG_TYPE:ny,ERR_INVALID_RETURN_VALUE:bu}}=Q(),{destroyer:rr}=St(),iy=Se(),Eu=kr(),sy=On(),{createDeferredPromise:mu}=Y(),gu=Zi(),wu=globalThis.Blob||Z_.Blob,oy=typeof wu<"u"?function(e){return e instanceof wu}:function(e){return!1},ay=globalThis.AbortController||zt().AbortController,{FunctionPrototypeCall:xu}=B(),Xe=class extends iy{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ru.exports=function t(e,r){if(ry(e))return e;if(du(e))return tr({readable:e});if(hu(e))return tr({writable:e});if(ty(e))return tr({writable:!1,readable:!1});if(pu(e))return tr({readable:Eu.fromWeb(e)});if(_u(e))return tr({writable:sy.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=ly(e);if(cu(i))return gu(Xe,i,{objectMode:!0,write:s,final:o,destroy:a});let l=i?.then;if(typeof l=="function"){let u,f=xu(l,i,c=>{if(c!=null)throw new bu("nully","body",c)},c=>{rr(u,c)});return u=new Xe({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,hs.nextTick(c,null)}catch(d){hs.nextTick(c,d)}})},destroy:a})}throw new bu("Iterable, AsyncIterable or AsyncFunction",r,i)}if(oy(e))return t(e.arrayBuffer());if(cu(e))return gu(Xe,e,{objectMode:!0,writable:!1});if(pu(e?.readable)&&_u(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?du(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?hu(e?.writable)?e?.writable:t(e.writable):void 0;return tr({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return xu(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{rr(i,s)}),i=new Xe({objectMode:!0,writable:!1,read(){}})}throw new ny(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function ly(t){let{promise:e,resolve:r}=mu(),n=new ay,i=n.signal;return{value:t((async function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=await o;if(hs.nextTick(u),l)return;if(i.aborted)throw new Su(void 0,{cause:i.reason});({promise:e,resolve:r}=mu()),yield a}})(),{signal:i}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){n.abort(),a(o)}}}function tr(t){let e=t.readable&&typeof t.readable.read!="function"?Eu.wrap(t.readable):t.readable,r=t.writable,n=!!X_(e),i=!!ey(r),s,o,a,l,u;function f(c){let d=l;l=null,d?d(c):c&&u.destroy(c)}return u=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(yu(r,c=>{i=!1,c&&rr(e,c),f(c)}),u._write=function(c,d,h){r.write(c,d)?h():s=h},u._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),n&&(yu(e,c=>{n=!1,c&&rr(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let c=e.read();if(c===null){a=u._read;return}if(!u.push(c))return}}),u._destroy=function(c,d){!c&&l!==null&&(c=new Su),a=null,s=null,o=null,l===null?d(c):(l=d,rr(r,c),rr(e,c))},u}});var Se=v((Qg,vu)=>{"use strict";var{ObjectDefineProperties:uy,ObjectGetOwnPropertyDescriptor:Ce,ObjectKeys:fy,ObjectSetPrototypeOf:Au}=B();vu.exports=ue;var ys=kr(),se=On();Au(ue.prototype,ys.prototype);Au(ue,ys);{let t=fy(se.prototype);for(let e=0;e<t.length;e++){let r=t[e];ue.prototype[r]||(ue.prototype[r]=se.prototype[r])}}function ue(t){if(!(this instanceof ue))return new ue(t);ys.call(this,t),se.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}uy(ue.prototype,{writable:{__proto__:null,...Ce(se.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ce(se.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ce(se.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ce(se.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ce(se.prototype,"writableLength")},writableFinished:{__proto__:null,...Ce(se.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ce(se.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ce(se.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ce(se.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var ps;function Tu(){return ps===void 0&&(ps={}),ps}ue.fromWeb=function(t,e){return Tu().newStreamDuplexFromReadableWritablePair(t,e)};ue.toWeb=function(t){return Tu().newReadableWritablePairFromDuplex(t)};var _s;ue.from=function(t){return _s||(_s=Iu()),_s(t,"body")}});var gs=v((Jg,ju)=>{"use strict";var{ObjectSetPrototypeOf:ku,Symbol:cy}=B();ju.exports=Fe;var{ERR_METHOD_NOT_IMPLEMENTED:dy}=Q().codes,ms=Se(),{getHighWaterMark:hy}=Ar();ku(Fe.prototype,ms.prototype);ku(Fe,ms);var Or=cy("kCallback");function Fe(t){if(!(this instanceof Fe))return new Fe(t);let e=t?hy(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ms.call(this,t),this._readableState.sync=!1,this[Or]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",py)}function bs(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function py(){this._final!==bs&&bs.call(this)}Fe.prototype._final=bs;Fe.prototype._transform=function(t,e,r){throw new dy("_transform()")};Fe.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),i.ended||s===n.length||n.length<n.highWaterMark?r():this[Or]=r})};Fe.prototype._read=function(){if(this[Or]){let t=this[Or];this[Or]=null,t()}}});var xs=v((Yg,Pu)=>{"use strict";var{ObjectSetPrototypeOf:Nu}=B();Pu.exports=nr;var ws=gs();Nu(nr.prototype,ws.prototype);Nu(nr,ws);function nr(t){if(!(this instanceof nr))return new nr(t);ws.call(this,t)}nr.prototype._transform=function(t,e,r){r(null,t)}});var Fn=v((Zg,Fu)=>{var Lr=Je(),{ArrayIsArray:_y,Promise:yy,SymbolAsyncIterator:by,SymbolDispose:my}=B(),Cn=Be(),{once:gy}=Y(),wy=St(),Ou=Se(),{aggregateTwoErrors:xy,codes:{ERR_INVALID_ARG_TYPE:js,ERR_INVALID_RETURN_VALUE:Ss,ERR_MISSING_ARGS:Sy,ERR_STREAM_DESTROYED:Ey,ERR_STREAM_PREMATURE_CLOSE:Ry},AbortError:Iy}=Q(),{validateFunction:Ay,validateAbortSignal:Ty}=Vt(),{isIterable:At,isReadable:Es,isReadableNodeStream:Bn,isNodeStream:Lu,isTransformStream:ir,isWebStream:vy,isReadableStream:Rs,isReadableFinished:ky}=ge(),jy=globalThis.AbortController||zt().AbortController,Is,As,Ts;function Bu(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Cn(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,wy.destroyer(t,s||new Ey("pipe")))},cleanup:i}}function Ny(t){return Ay(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function vs(t){if(At(t))return t;if(Bn(t))return Py(t);throw new js("val",["Readable","Iterable","AsyncIterable"],t)}async function*Py(t){As||(As=kr()),yield*As.prototype[by].call(t)}async function Ln(t,e,r,{end:n}){let i,s=null,o=u=>{if(u&&(i=u),s){let f=s;s=null,f()}},a=()=>new yy((u,f)=>{i?f(i):s=()=>{i?f(i):u()}});e.on("drain",o);let l=Cn(e,{readable:!1},o);try{e.writableNeedDrain&&await a();for await(let u of t)e.write(u)||await a();n&&(e.end(),await a()),r()}catch(u){r(i!==u?xy(i,u):u)}finally{l(),e.off("drain",o)}}async function ks(t,e,r,{end:n}){ir(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function Oy(...t){return Cu(t,gy(Ny(t)))}function Cu(t,e,r){if(t.length===1&&_y(t[0])&&(t=t[0]),t.length<2)throw new Sy("streams");let n=new jy,i=n.signal,s=r?.signal,o=[];Ty(s,"options.signal");function a(){y(new Iy)}Ts=Ts||Y().addAbortListener;let l;s&&(l=Ts(s,a));let u,f,c=[],d=0;function h(S){y(S,--d===0)}function y(S,w){var T;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!w)){for(;c.length;)c.shift()(u);(T=l)===null||T===void 0||T[my](),n.abort(),w&&(u||o.forEach(Ae=>Ae()),Lr.nextTick(e,u,f))}}let _;for(let S=0;S<t.length;S++){let w=t[S],T=S<t.length-1,Ae=S>0,U=T||r?.end!==!1,jt=S===t.length-1;if(Lu(w)){let Z=function(Te){Te&&Te.name!=="AbortError"&&Te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(Te)};var g=Z;if(U){let{destroy:Te,cleanup:Kn}=Bu(w,T,Ae);c.push(Te),Es(w)&&jt&&o.push(Kn)}w.on("error",Z),Es(w)&&jt&&o.push(()=>{w.removeListener("error",Z)})}if(S===0)if(typeof w=="function"){if(_=w({signal:i}),!At(_))throw new Ss("Iterable, AsyncIterable or Stream","source",_)}else At(w)||Bn(w)||ir(w)?_=w:_=Ou.from(w);else if(typeof w=="function"){if(ir(_)){var x;_=vs((x=_)===null||x===void 0?void 0:x.readable)}else _=vs(_);if(_=w(_,{signal:i}),T){if(!At(_,!0))throw new Ss("AsyncIterable",`transform[${S-1}]`,_)}else{var b;Is||(Is=xs());let Z=new Is({objectMode:!0}),Te=(b=_)===null||b===void 0?void 0:b.then;if(typeof Te=="function")d++,Te.call(_,Ue=>{f=Ue,Ue!=null&&Z.write(Ue),U&&Z.end(),Lr.nextTick(h)},Ue=>{Z.destroy(Ue),Lr.nextTick(h,Ue)});else if(At(_,!0))d++,Ln(_,Z,h,{end:U});else if(Rs(_)||ir(_)){let Ue=_.readable||_;d++,Ln(Ue,Z,h,{end:U})}else throw new Ss("AsyncIterable or Promise","destination",_);_=Z;let{destroy:Kn,cleanup:Rf}=Bu(_,!1,!0);c.push(Kn),jt&&o.push(Rf)}}else if(Lu(w)){if(Bn(_)){d+=2;let Z=Ly(_,w,h,{end:U});Es(w)&&jt&&o.push(Z)}else if(ir(_)||Rs(_)){let Z=_.readable||_;d++,Ln(Z,w,h,{end:U})}else if(At(_))d++,Ln(_,w,h,{end:U});else throw new js("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else if(vy(w)){if(Bn(_))d++,ks(vs(_),w,h,{end:U});else if(Rs(_)||At(_))d++,ks(_,w,h,{end:U});else if(ir(_))d++,ks(_.readable,w,h,{end:U});else throw new js("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else _=Ou.from(w)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&Lr.nextTick(a),_}function Ly(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Ry)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;ky(t)?Lr.nextTick(o):t.once("end",o)}else r();return Cn(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Cn(e,{readable:!1,writable:!0},r)}Fu.exports={pipelineImpl:Cu,pipeline:Oy}});var Ps=v((Xg,Wu)=>{"use strict";var{pipeline:By}=Fn(),Mn=Se(),{destroyer:Cy}=St(),{isNodeStream:Dn,isReadable:Mu,isWritable:Du,isWebStream:Ns,isTransformStream:Tt,isWritableStream:Uu,isReadableStream:$u}=ge(),{AbortError:Fy,codes:{ERR_INVALID_ARG_VALUE:qu,ERR_MISSING_ARGS:My}}=Q(),Dy=Be();Wu.exports=function(...e){if(e.length===0)throw new My("streams");if(e.length===1)return Mn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Mn.from(e[0])),typeof e[e.length-1]=="function"){let h=e.length-1;e[h]=Mn.from(e[h])}for(let h=0;h<e.length;++h)if(!(!Dn(e[h])&&!Ns(e[h]))){if(h<e.length-1&&!(Mu(e[h])||$u(e[h])||Tt(e[h])))throw new qu(`streams[${h}]`,r[h],"must be readable");if(h>0&&!(Du(e[h])||Uu(e[h])||Tt(e[h])))throw new qu(`streams[${h}]`,r[h],"must be writable")}let n,i,s,o,a;function l(h){let y=o;o=null,y?y(h):h?a.destroy(h):!d&&!c&&a.destroy()}let u=e[0],f=By(e,l),c=!!(Du(u)||Uu(u)||Tt(u)),d=!!(Mu(f)||$u(f)||Tt(f));if(a=new Mn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:d}),c){if(Dn(u))a._write=function(y,_,x){u.write(y,_)?x():n=x},a._final=function(y){u.end(),i=y},u.on("drain",function(){if(n){let y=n;n=null,y()}});else if(Ns(u)){let _=(Tt(u)?u.writable:u).getWriter();a._write=async function(x,b,g){try{await _.ready,_.write(x).catch(()=>{}),g()}catch(S){g(S)}},a._final=async function(x){try{await _.ready,_.close().catch(()=>{}),i=x}catch(b){x(b)}}}let h=Tt(f)?f.readable:f;Dy(h,()=>{if(i){let y=i;i=null,y()}})}if(d){if(Dn(f))f.on("readable",function(){if(s){let h=s;s=null,h()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let h=f.read();if(h===null){s=a._read;return}if(!a.push(h))return}};else if(Ns(f)){let y=(Tt(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:_,done:x}=await y.read();if(!a.push(_))return;if(x){a.push(null);return}}catch{return}}}}return a._destroy=function(h,y){!h&&o!==null&&(h=new Fy),s=null,n=null,i=null,o===null?y(h):(o=y,Dn(f)&&Cy(f,h))},a}});var Xu=v((ew,Bs)=>{"use strict";var Uy=globalThis.AbortController||zt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:$y,ERR_INVALID_ARG_TYPE:Br,ERR_MISSING_ARGS:qy,ERR_OUT_OF_RANGE:Wy},AbortError:Ee}=Q(),{validateAbortSignal:vt,validateInteger:zu,validateObject:kt}=Vt(),zy=B().Symbol("kWeak"),Gy=B().Symbol("kResistStopPropagation"),{finished:Hy}=Be(),Vy=Ps(),{addAbortSignalNoValidate:Ky}=Ir(),{isWritable:Qy,isNodeStream:Jy}=ge(),{deprecate:Yy}=Y(),{ArrayPrototypePush:Zy,Boolean:Xy,MathFloor:Gu,Number:eb,NumberIsNaN:tb,Promise:Hu,PromiseReject:Vu,PromiseResolve:rb,PromisePrototypeThen:Ku,Symbol:Ju}=B(),Un=Ju("kEmpty"),Qu=Ju("kEof");function nb(t,e){if(e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),Jy(t)&&!Qy(t))throw new $y("stream",t,"must be writable");let r=Vy(this,t);return e!=null&&e.signal&&Ky(e.signal,r),r}function $n(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Gu(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Gu(e.highWaterMark)),zu(r,"options.concurrency",1),zu(n,"options.highWaterMark",0),n+=r,async function*(){let s=Y().AbortSignalAny([e?.signal].filter(Xy)),o=this,a=[],l={signal:s},u,f,c=!1,d=0;function h(){c=!0,y()}function y(){d-=1,_()}function _(){f&&!c&&d<r&&a.length<n&&(f(),f=null)}async function x(){try{for await(let b of o){if(c)return;if(s.aborted)throw new Ee;try{if(b=t(b,l),b===Un)continue;b=rb(b)}catch(g){b=Vu(g)}d+=1,Ku(b,y,h),a.push(b),u&&(u(),u=null),!c&&(a.length>=n||d>=r)&&await new Hu(g=>{f=g})}a.push(Qu)}catch(b){let g=Vu(b);Ku(g,y,h),a.push(g)}finally{c=!0,u&&(u(),u=null)}}x();try{for(;;){for(;a.length>0;){let b=await a[0];if(b===Qu)return;if(s.aborted)throw new Ee;b!==Un&&(yield b),a.shift(),_()}await new Hu(b=>{u=b})}}finally{c=!0,f&&(f(),f=null)}}.call(this)}function ib(t=void 0){return t!=null&&kt(t,"options"),t?.signal!=null&&vt(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ee({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function Yu(t,e=void 0){for await(let r of Ls.call(this,t,e))return!0;return!1}async function sb(t,e=void 0){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);return!await Yu.call(this,async(...r)=>!await t(...r),e)}async function ob(t,e){for await(let r of Ls.call(this,t,e))return r}async function ab(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Un}for await(let n of $n.call(this,r,e));}function Ls(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Un}return $n.call(this,r,e)}var Os=class extends qy{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function lb(t,e,r){var n;if(typeof t!="function")throw new Br("reducer",["Function","AsyncFunction"],t);r!=null&&kt(r,"options"),r?.signal!=null&&vt(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new Ee(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Hy(this.destroy(u)),u}let s=new Uy,o=s.signal;if(r!=null&&r.signal){let u={once:!0,[zy]:this,[Gy]:!0};r.signal.addEventListener("abort",()=>s.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new Ee;i?e=await t(e,u,{signal:o}):(e=u,i=!0)}if(!a&&!i)throw new Os}finally{s.abort()}return e}async function ub(t){t!=null&&kt(t,"options"),t?.signal!=null&&vt(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Ee(void 0,{cause:t.signal.reason});Zy(e,n)}return e}function fb(t,e){let r=$n.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function Zu(t){if(t=eb(t),tb(t))return 0;if(t<0)throw new Wy("number",">= 0",t);return t}function cb(t,e=void 0){return e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ee;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ee;t--<=0&&(yield s)}}.call(this)}function db(t,e=void 0){return e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ee;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ee;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Bs.exports.streamReturningOperators={asIndexedPairs:Yy(ib,"readable.asIndexedPairs will be removed in a future version."),drop:cb,filter:Ls,flatMap:fb,map:$n,take:db,compose:nb};Bs.exports.promiseReturningOperators={every:sb,forEach:ab,reduce:lb,toArray:ub,some:Yu,find:ob}});var Cs=v((tw,ef)=>{"use strict";var{ArrayPrototypePop:hb,Promise:pb}=B(),{isIterable:_b,isNodeStream:yb,isWebStream:bb}=ge(),{pipelineImpl:mb}=Fn(),{finished:gb}=Be();Fs();function wb(...t){return new pb((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!yb(s)&&!_b(s)&&!bb(s)){let o=hb(t);n=o.signal,i=o.end}mb(t,(o,a)=>{o?r(o):e(a)},{signal:n,end:i})})}ef.exports={finished:gb,pipeline:wb}});var Fs=v((rw,ff)=>{"use strict";var{Buffer:xb}=pe(),{ObjectDefineProperty:Me,ObjectKeys:nf,ReflectApply:sf}=B(),{promisify:{custom:of}}=Y(),{streamReturningOperators:tf,promiseReturningOperators:rf}=Xu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:af}}=Q(),Sb=Ps(),{setDefaultHighWaterMark:Eb,getDefaultHighWaterMark:Rb}=Ar(),{pipeline:lf}=Fn(),{destroyer:Ib}=St(),uf=Be(),Ms=Cs(),Cr=ge(),L=ff.exports=wn().Stream;L.isDestroyed=Cr.isDestroyed;L.isDisturbed=Cr.isDisturbed;L.isErrored=Cr.isErrored;L.isReadable=Cr.isReadable;L.isWritable=Cr.isWritable;L.Readable=kr();for(let t of nf(tf)){let r=function(...n){if(new.target)throw af();return L.Readable.from(sf(e,this,n))},e=tf[t];Me(r,"name",{__proto__:null,value:e.name}),Me(r,"length",{__proto__:null,value:e.length}),Me(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of nf(rf)){let r=function(...n){if(new.target)throw af();return sf(e,this,n)},e=rf[t];Me(r,"name",{__proto__:null,value:e.name}),Me(r,"length",{__proto__:null,value:e.length}),Me(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}L.Writable=On();L.Duplex=Se();L.Transform=gs();L.PassThrough=xs();L.pipeline=lf;var{addAbortSignal:Ab}=Ir();L.addAbortSignal=Ab;L.finished=uf;L.destroy=Ib;L.compose=Sb;L.setDefaultHighWaterMark=Eb;L.getDefaultHighWaterMark=Rb;Me(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ms}});Me(lf,of,{__proto__:null,enumerable:!0,get(){return Ms.pipeline}});Me(uf,of,{__proto__:null,enumerable:!0,get(){return Ms.finished}});L.Stream=L;L._isUint8Array=function(e){return e instanceof Uint8Array};L._uint8ArrayToBuffer=function(e){return xb.from(e.buffer,e.byteOffset,e.byteLength)}});var qn=v((nw,M)=>{"use strict";var W=Fs(),Tb=Cs(),vb=W.Readable.destroy;M.exports=W.Readable;M.exports._uint8ArrayToBuffer=W._uint8ArrayToBuffer;M.exports._isUint8Array=W._isUint8Array;M.exports.isDisturbed=W.isDisturbed;M.exports.isErrored=W.isErrored;M.exports.isReadable=W.isReadable;M.exports.Readable=W.Readable;M.exports.Writable=W.Writable;M.exports.Duplex=W.Duplex;M.exports.Transform=W.Transform;M.exports.PassThrough=W.PassThrough;M.exports.addAbortSignal=W.addAbortSignal;M.exports.finished=W.finished;M.exports.destroy=W.destroy;M.exports.destroy=vb;M.exports.pipeline=W.pipeline;M.exports.compose=W.compose;Object.defineProperty(W,"promises",{configurable:!0,enumerable:!0,get(){return Tb}});M.exports.Stream=W.Stream;M.exports.default=M.exports});var E=class t{#e;constructor(e){this.#e=t.collapse(e)}get value(){return this.#e}toString(){return this.#e}get length(){return this.#e.length}static collapse(e,r=""){if(e instanceof t)return e.value;if(typeof e!="string")throw new TypeError("path argument must be a string or an instance of Path");if(r&&!(r instanceof t)&&(r=new t(r)),e=e.trim(),e.length===0)return r.value;t.isRelative(e)&&(e=r+e);let n=t.reduce(e,(s,o)=>(o==".."?s.pop():o!=="."&&s.push(o),s),[]),i="/";return n.length&&(i+=n.join("/"),t.isFolder(e)&&(i+="/")),""+i}static isAbsolute(e){return e instanceof t?!0:e.length&&e[0]==="/"}static isRelative(e){return!t.isAbsolute(e)}static isFolder(e){return e instanceof t&&(e=e.value),e.length&&e[e.length-1]=="/"}static isPath(e){return e instanceof t?!0:typeof e!="string"?!1:(e=e.trim(),new URL(e,document.location).pathname==e)}static reduce(e,r,n){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).reduce(r,n)}static map(e,r){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).map(r)}static parent(e){e instanceof t&&(e=e.value),e=e.split("/").filter(Boolean),e.pop();let r="/";return e.length&&(r+=e.join("/")+"/"),r}static filename(e){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).pop()}static head(e){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).shift()}static tail(e){e instanceof t&&(e=e.value),e=e.split("/").filter(Boolean),e.shift();let r="/";return e.length&&(r+=e.join("/")+"/"),r}};var ar=class t{#e;#t="/";constructor(e){this.#e=e,this.#t=this.#e.path}get path(){return this.#t}cd(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),new t(this.#e.cd(e))}async read(e,r=null){if(e instanceof E||(e=new E(E.collapse(e,this.#t))),typeof r=="function"){if(!this.#e.supportsStreamingRead())throw new Error("Adapter "+this.#e.name+" does not support streaming reading.");return this.#e.readStream(e,r)}else return this.#e.read(e)}async write(e,r,n=null){if(e instanceof E||(e=new E(E.collapse(e,this.#t))),!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(typeof r=="function"){if(!this.#e.supportsStreamingWrite())throw new Error("Adapter "+this.#e.name+" does not support streaming writing.");return this.#e.writeStream(e,r,n)}else{if(typeof r=="string")return this.#e.write(e,r,n);throw new TypeError("Cannot write contents of type "+typeof r)}}async remove(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.remove(e)}async exists(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.exists(e)}async list(e=""){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.list(e)}async mkdir(e=""){if(!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(!this.#e.supportsDirectories)throw new Error("Adapter "+this.#e.name+" does not support directories.");return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.mkdir(e)}async rmdir(e=""){if(!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(!this.#e.supportsDirectories)throw new Error("Adapter "+this.#e.name+" does not support directories.");return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.rmdir(e)}};var Pt={};nt(Pt,{Client:()=>oe,client:()=>re,deepClone:()=>$e,formdata:()=>Ks,metroError:()=>V,request:()=>st,response:()=>Nt,trace:()=>Pf,url:()=>z});var it="https://metro.muze.nl/details/";Symbol.metroProxy||(Symbol.metroProxy=Symbol("isProxy"));Symbol.metroSource||(Symbol.metroSource=Symbol("source"));var oe=class t{clientOptions={url:z(typeof window<"u"?window.location:"https://localhost"),verbs:["get","post","put","delete","patch","head","options","query"]};static tracers={};constructor(...e){for(let r of e)if(typeof r=="string"||r instanceof String)this.clientOptions.url=z(this.clientOptions.url.href,r);else if(r instanceof t)Object.assign(this.clientOptions,r.clientOptions);else if(r instanceof Function)this.#e([r]);else if(r&&typeof r=="object")for(let n in r)n=="middlewares"?this.#e(r[n]):n=="url"?this.clientOptions.url=z(this.clientOptions.url.href,r[n]):typeof r[n]=="function"?this.clientOptions[n]=r[n](this.clientOptions[n],this.clientOptions):this.clientOptions[n]=r[n];for(let r of this.clientOptions.verbs)this[r]=async function(...n){return this.fetch(st(this.clientOptions,...n,{method:r.toUpperCase()}))}}#e(e){typeof e=="function"&&(e=[e]);let r=e.findIndex(n=>typeof n!="function");if(r>=0)throw V("metro.client: middlewares must be a function or an array of functions "+it+"client/invalid-middlewares/",e[r]);Array.isArray(this.clientOptions.middlewares)||(this.clientOptions.middlewares=[]),this.clientOptions.middlewares=this.clientOptions.middlewares.concat(e)}fetch(e,r){if(e=st(e,r),!e.url)throw V("metro.client."+e.method.toLowerCase()+": Missing url parameter "+it+"client/fetch-missing-url/",e);if(r||(r={}),typeof r!="object"||r instanceof String)throw V("metro.client.fetch: Invalid options parameter "+it+"client/fetch-invalid-options/",r);let i=[async function(a){a[Symbol.metroProxy]&&(a=a[Symbol.metroSource]);let l=await fetch(a);return Nt(l)}].concat(this.clientOptions?.middlewares?.slice()||[]);r=Object.assign({},this.clientOptions,r);let s;for(let o of i)s=(function(a,l){return async function(u){let f,c=Object.values(t.tracers);for(let d of c)d.request&&d.request.call(d,u,l);f=await l(u,a);for(let d of c)d.response&&d.response.call(d,f,l);return f}})(s,o);return s(e)}with(...e){return new t($e(this.clientOptions),...e)}get location(){return this.clientOptions.url}};function re(...t){return new oe(...$e(t))}function Nf(t,e){let r=e||{};!r.url&&e.url&&(r.url=e.url);for(let n of["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","priority","url"]){let i=t[n];if(!(typeof i>"u"||i==null))if(i?.[Symbol.metroProxy]&&(i=i[Symbol.metroSource]),typeof i=="function")r[n]=i(r[n],r);else if(n=="url")r.url=z(r.url,i);else if(n=="headers"){r.headers=new Headers(e.headers),i instanceof Headers||(i=new Headers(t.headers));for(let[s,o]of i.entries())r.headers.set(s,o)}else r[n]=i}return t instanceof Request&&t.data&&(r.body=t.data),r}function st(...t){let e={url:z(typeof window<"u"?window.location:"https://localhost/"),duplex:"half"};for(let i of t)typeof i=="string"||i instanceof URL||i instanceof URLSearchParams?e.url=z(e.url,i):i&&(i instanceof FormData||i instanceof ReadableStream||i instanceof Blob||i instanceof ArrayBuffer||i instanceof DataView)?e.body=i:i&&typeof i=="object"&&Object.assign(e,Nf(i,e));let r=new Request(e.url,e),n=e.body;return n&&typeof n=="object"&&!(n instanceof String)&&!(n instanceof ReadableStream)&&!(n instanceof Blob)&&!(n instanceof ArrayBuffer)&&!(n instanceof DataView)&&!(n instanceof FormData)&&!(n instanceof URLSearchParams)&&(typeof globalThis.TypedArray>"u"||!(n instanceof globalThis.TypedArray))&&typeof n.toString=="function"&&(e.body=n.toString({headers:r.headers}),r=new Request(e.url,e)),Object.freeze(r),new Proxy(r,{get(i,s){let o;switch(s){case Symbol.metroSource:o=i;break;case Symbol.metroProxy:o=!0;break;case"with":o=function(...a){return n&&a.unshift({body:n}),st(i,...a)};break;case"data":o=n;break;default:i[s]instanceof Function?o=i[s].bind(i):o=i[s];break}return o}})}function Hs(t,e){let r=e||{};!r.url&&e.url&&(r.url=e.url);for(let n of["status","statusText","headers","body","url","type","redirected"]){let i=t[n];typeof i>"u"||i==null||(i?.[Symbol.metroProxy]&&(i=i[Symbol.metroSource]),typeof i=="function"?r[n]=i(r[n],r):n=="url"?r.url=new URL(i,r.url||"https://localhost/"):r[n]=i)}return t instanceof Response&&t.data&&(r.body=t.data),r}function Nt(...t){let e={};for(let i of t)typeof i=="string"?e.body=i:i instanceof Response?Object.assign(e,Hs(i,e)):i&&typeof i=="object"&&(i instanceof FormData||i instanceof Blob||i instanceof ArrayBuffer||i instanceof DataView||i instanceof ReadableStream||i instanceof URLSearchParams||i instanceof String||typeof globalThis.TypedArray<"u"&&i instanceof globalThis.TypedArray?e.body=i:Object.assign(e,Hs(i,e)));let r;e.body&&(r=e.body),[101,204,205,304].includes(e.status)&&(e.body=null);let n=new Response(e.body,e);return Object.freeze(n),new Proxy(n,{get(i,s){let o;switch(s){case Symbol.metroProxy:o=!0;break;case Symbol.metroSource:o=i;break;case"with":o=function(...a){return Nt(i,...a)};break;case"data":o=r;break;case"ok":o=i.status>=200&&i.status<400;break;default:typeof i[s]=="function"?o=i[s].bind(i):o=i[s];break}return o}})}function Vs(t,e){typeof e=="function"?e(t.searchParams,t):(e=new URLSearchParams(e),e.forEach((r,n)=>{t.searchParams.append(n,r)}))}function z(...t){let e=["hash","host","hostname","href","password","pathname","port","protocol","username","search","searchParams"],r=new URL("https://localhost/");for(let n of t)if(typeof n=="string"||n instanceof String)r=new URL(n,r);else if(n instanceof URL||typeof Location<"u"&&n instanceof Location)r=new URL(n);else if(n instanceof URLSearchParams)Vs(r,n);else if(n&&typeof n=="object")for(let i in n)switch(i){case"search":typeof n.search=="function"?n.search(r.search,r):r.search=new URLSearchParams(n.search);break;case"searchParams":Vs(r,n.searchParams);break;default:if(!e.includes(i))throw V("metro.url: unknown url parameter "+it+"url/unknown-param-name/",i);if(typeof n[i]=="function")n[i](r[i],r);else if(typeof n[i]=="string"||n[i]instanceof String||typeof n[i]=="number"||n[i]instanceof Number||typeof n[i]=="boolean"||n[i]instanceof Boolean)r[i]=""+n[i];else if(typeof n[i]=="object"&&n[i].toString)r[i]=n[i].toString();else throw V("metro.url: unsupported value for "+i+" "+it+"url/unsupported-param-value/",t[i]);break}else throw V("metro.url: unsupported option value "+it+"url/unsupported-option-value/",n);return Object.freeze(r),new Proxy(r,{get(n,i){let s;switch(i){case Symbol.metroProxy:s=!0;break;case Symbol.metroSource:s=n;break;case"with":s=function(...o){return z(n,...o)};break;case"filename":s=n.pathname.split("/").pop();break;case"folderpath":s=n.pathname.substring(0,n.pathname.lastIndexOf("\\")+1);break;case"authority":s=n.username??"",s+=n.password?":"+n.password:"",s+=s?"@":"",s+=n.hostname,s+=n.port?":"+n.port:"",s+="/",s=n.protocol+"//"+s;break;case"origin":s=n.protocol+"//"+n.hostname,s+=n.port?":"+n.port:"",s+="/";break;case"fragment":s=n.hash.substring(1);break;case"scheme":n.protocol?s=n.protocol.substring(0,n.protocol.length-1):s="";break;default:n[i]instanceof Function?s=n[i].bind(n):s=n[i];break}return s}})}function Ks(...t){var e=new FormData;for(let r of t)if(r instanceof HTMLFormElement&&(r=new FormData(r)),r instanceof FormData)for(let n of r.entries())e.append(n[0],n[1]);else if(r&&typeof r=="object")for(let n of Object.entries(r))if(Array.isArray(n[1]))for(let i of n[1])e.append(n[0],i);else e.append(n[0],n[1]);else throw new V("metro.formdata: unknown option type "+it+"formdata/unknown-option-value/",r);return Object.freeze(e),new Proxy(e,{get(r,n){let i;switch(n){case Symbol.metroProxy:i=!0;break;case Symbol.metroSource:i=r;break;case"with":i=function(...s){return Ks(r,...s)};break;default:r[n]instanceof Function?i=r[n].bind(r):i=r[n];break}return i}})}var lr={error:(t,...e)=>{console.error("\u24C2\uFE0F ",t,...e)},info:(t,...e)=>{console.info("\u24C2\uFE0F ",t,...e)},group:t=>{console.group("\u24C2\uFE0F "+t)},groupEnd:t=>{console.groupEnd("\u24C2\uFE0F "+t)}};function V(t,...e){return lr.error(t,...e),new Error(t,...e)}var Pf={add(t,e){oe.tracers[t]=e},delete(t){delete oe.tracers[t]},clear(){oe.tracers={}},group(){let t=0;return{request:(e,r)=>{t++,lr.group(t),lr.info(e?.url,e,r)},response:(e,r)=>{lr.info(e?.body?e.body[Symbol.metroSource]:null,e,r),lr.groupEnd(t),t--}}}};function $e(t){if(Array.isArray(t))return t.slice().map($e);if(t&&typeof t=="object")if(t.__proto__.constructor==Object||!t.__proto__){let e=Object.assign({},t);return Object.keys(e).forEach(r=>{e[r]=$e(t[r])}),e}else return t;return t}var ot=class{#e;#t;constructor(e,r="/"){this.#e=re(e),this.#t=new E(r)}get name(){return"HttpAdapter"}get path(){return this.#t}supportsWrite(){return!0}supportsStreamingWrite(){return Of}supportsStreamingRead(){return!0}supportsDirectories(){return!1}cd(e){if(!E.isPath(e))throw new TypeError(e+" is not a valid path");return E.isRelative(e)&&(e=E.collapse(e,this.#t)),new this.constructor(this.#e,e)}async write(e,r,n=null){return this.#e.put({body:r})}writeStream(e,r,n=null){throw new Error("Not yet implemented")}async read(e){let r=await this.#e.get(e),n={type:this.getMimetype(r),name:E.filename(e),http:{headers:r.headers,status:r.status,url:r.url}};return n.type.match(/text\/.*/)?n.contents=await r.text():n.type.match(/application\/json.*/)?n.contents=await r.json():n.contents=await r.blob(),n}readStream(e,r){throw new Error("Not yet implemented")}async exists(e){return this.#e.head(e)}async remove(e){return this.#e.delete(e)}async list(e){let r=["text/html","text/xhtml","text/xhtml+xml","text/xml"],n=await this.read(e);if(r.includes(n.type.split(";")[0]))var i=n.contents;else{let u=this.getUrl(e);throw new TypeError("URL "+u+" is not of a supported content type",{cause:n})}let s=z(this.#e.clientOptions.url).pathname,o=this.getUrl(e),a=document.createElement("template");a.innerHTML=i;let l=a.content.querySelectorAll("a[href]");return Array.from(l).map(u=>{let f=new URL(u.getAttribute("href"),o.href);return u.href=f.href,{filename:E.filename(u.pathname),path:u.pathname,name:u.innerText,href:u.href}}).filter(u=>{let f=new URL(u.href);return f.pathname=E.parent(f.pathname),f.href===o.href}).map(u=>({filename:u.filename,path:u.path.substring(s.length-1),name:u.name}))}getUrl(e){let r=z(this.#e.clientOptions.url).pathname;return e=E.collapse(r+E.collapse(e)),new URL(e,this.#e.clientOptions.url)}getMimetype(e){return e.headers.has("Content-Type")?e.headers.get("Content-Type"):null}},Of=(async()=>new Request("",{body:new ReadableStream,method:"POST",duplex:"half"}).headers.has("Content-Type")?!1:fetch("data:a/a;charset=utf-8,",{method:"POST",body:new ReadableStream,duplex:"half"}).then(()=>!0,()=>!1))();var Lf={fs:ar,adapters:{https:ot},path:E};globalThis.jsfs=Lf;function fe(t){return t=Object.assign({contentType:"application/json",reviver:null,replacer:null,space:""},t),async function(r,n){if(r.headers.get("Accept")||(r=r.with({headers:{Accept:t.accept??t.contentType}})),r.method!=="GET"&&r.method!=="HEAD"&&r.data&&typeof r.data=="object"&&!(r.data instanceof ReadableStream)){let s=r.headers.get("Content-Type");(!s||Cf(s))&&(r=r.with({headers:{"Content-Type":t.contentType}})),Qs(r.headers.get("Content-Type"))&&(r=r.with({body:JSON.stringify(r.data,t.replacer,t.space)}))}let i=await n(r);if(i&&Qs(i.headers?.get("Content-Type"))){let o=await i.clone().text();try{let a=JSON.parse(o,t.reviver);return i.with({body:a})}catch{}}return i}}var Bf=/^application\/([a-zA-Z0-9\-_]+\+)?json\b/;function Qs(t){return Bf.exec(t)}function Cf(t){return/^text\/plain\b/.exec(t)}function ce(t){return async function(r,n){let i=await n(r);if(!i.ok)if(t&&typeof t[i.status]=="function")i=t[i.status].apply(i,r);else throw new Error(i.status+": "+i.statusText,{cause:i});return i}}function Ot(){return async function(e,r){let n=await r(e);return n.ok&&n.data?n.data:n}}var Gr=class extends oe{#e=null;#t="";constructor(e,r,n=null){e instanceof oe?super(e.clientOptions,ce(),Ot()):super(e,ce(),Ot()),n||(n=this),this.#e=r,this.#t=e;for(let i in r)typeof r[i]=="function"?this[i]=r[i].bind(n):r[i]&&typeof r[i]=="object"&&(Object.getPrototypeOf(r[i])===null||Object.getPrototypeOf(r[i]).constructor===Object)?this[i]=new this.constructor(e,r[i],n):this[i]=r[i]}extend(e){return new this.constructor(this.#t,Object.assign({},this.#e,e))}},Jn=class extends Gr{constructor(e,r,n=null){e instanceof oe?super(e.with(fe()),r,n):super(re(e,fe()),r,n)}};function Js(...t){return new Gr(...$e(t))}function Ys(...t){return new Jn(...$e(t))}var Zs=Object.assign({},Pt,{mw:{json:fe,thrower:ce,getdata:Ot},api:Js,jsonApi:Ys});globalThis.metro||(globalThis.metro=Zs);var N=Zs;var Hr={};nt(Hr,{base64url_encode:()=>ti,createState:()=>ro,default:()=>Bt,generateCodeChallenge:()=>to,generateCodeVerifier:()=>eo,getExpires:()=>Xn,isAuthorized:()=>Uf,isExpired:()=>ei,isRedirected:()=>ri});globalThis.assertEnabled=!1;function Ff(){globalThis.assertEnabled=!0}function Mf(){globalThis.assertEnabled=!1}function D(t,e){if(globalThis.assertEnabled){let r=G(t,e);if(r)throw console.error("\u{1F170}\uFE0F Assertions failed because of:",r,"in this source:",t),new Error("Assertions failed",{cause:{problems:r,source:t}})}}function m(t){return function(r,n,i){if(typeof r<"u"&&r!=null&&typeof t<"u")return G(r,t,n,i)}}function k(t){return function(r,n,i){return r==null||typeof r>"u"?P("data is required",r,t||"any value",i):typeof t<"u"?G(r,t,n,i):!1}}function qe(t){return function(r,n,i){return r==null||typeof r>"u"?(Xs("data does not contain recommended value",r,t,i),!1):G(r,t,n,i)}}function $(...t){return function(r,n,i){for(let s of t)if(!G(r,s,n,i))return!1;return P("data does not match oneOf patterns",r,t,i)}}function ve(...t){return function(r,n,i){if(!Array.isArray(r))return P("data is not an array",r,"anyOf",i);for(let s of r)if($(...t)(s))return P("data does not match anyOf patterns",s,t,i);return!1}}function Yn(...t){return function(r,n,i){let s=[];for(let o of t)s=s.concat(G(r,o,n,i));if(s=s.filter(Boolean),s.length)return P("data does not match all given patterns",r,t,i,s)}}function R(t,e,r){try{t instanceof URL&&(t=t.href);let n=new URL(t);if(n.href!=t&&!(n.href+"/"==t||n.href==t+"/"))return P("data is not a valid url",t,"validURL",r)}catch{return P("data is not a valid url",t,"validURL",r)}}function Zn(t,e,r){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return P("data is not a valid email",t,"validEmail",r)}function at(t){return function(r,n,i){if(!(r instanceof t))return P("data is not an instanceof pattern",r,t,i)}}function Lt(t){return function(r,n,i){if(!G(r,t,n,i))return P("data matches pattern, when required not to",r,t,i)}}function G(t,e,r,n=""){r||(r=t);let i=[];if(e===Boolean)typeof t!="boolean"&&!(t instanceof Boolean)&&i.push(P("data is not a boolean",t,e,n));else if(e===Number)typeof t!="number"&&!(t instanceof Number)&&i.push(P("data is not a number",t,e,n));else if(e===String)typeof t!="string"&&!(t instanceof String)&&i.push(P("data is not a string",t,e,n)),t==""&&i.push(P("data is an empty string, which is not allowed",t,e,n));else if(e instanceof RegExp)if(Array.isArray(t)){let s=t.findIndex((o,a)=>G(o,e,r,n+"["+a+"]"));s>-1&&i.push(P("data["+s+"] does not match pattern",t[s],e,n+"["+s+"]"))}else typeof t>"u"?i.push(P("data is undefined, should match pattern",t,e,n)):e.test(t)||i.push(P("data does not match pattern",t,e,n));else if(e instanceof Function){let s=e(t,r,n);s&&(Array.isArray(s)?i=i.concat(s):i.push(s))}else if(Array.isArray(e)){Array.isArray(t)||i.push(P("data is not an array",t,[],n));for(let s of e)for(let o of t.keys()){let a=G(t[o],s,r,n+"["+o+"]");Array.isArray(a)?i=i.concat(a):a&&i.push(a)}}else if(e&&typeof e=="object")if(Array.isArray(t)){let s=t.findIndex((o,a)=>G(o,e,r,n+"["+a+"]"));s>-1&&i.push(P("data["+s+"] does not match pattern",t[s],e,n+"["+s+"]"))}else if(!t||typeof t!="object")i.push(P("data is not an object, pattern is",t,e,n));else if(t instanceof URLSearchParams&&(t=Object.fromEntries(t)),e instanceof Function){let s=G(t,e,r,n);s&&(i=i.concat(s))}else for(let[s,o]of Object.entries(e)){let a=G(t[s],o,r,n+"."+s);a&&(i=i.concat(a))}else e!=t&&i.push(P("data and pattern are not equal",t,e,n));return i.length?i:!1}function P(t,e,r,n,i){let s={path:n,message:t,found:e,expected:r};return i&&(s.problems=i),s}function Xs(t,e,r,n){console.warn("\u{1F170}\uFE0F Assert: "+n,t,r,e)}globalThis.assert={warn:Xs,error:P,assert:D,enable:Ff,disable:Mf,Required:k,Recommended:qe,Optional:m,oneOf:$,anyOf:ve,allOf:Yn,validURL:R,validEmail:Zn,instanceOf:at,not:Lt,fails:G};function ur(t){let e,r;if(typeof localStorage<"u")e={get:()=>localStorage.getItem("metro/state:"+t),set:n=>localStorage.setItem("metro/state:"+t,n),has:()=>localStorage.getItem("metro/state:"+t)!==null,delete:()=>localStorage.remoteItem("metro/state:"+t)},r={get:n=>JSON.parse(localStorage.getItem(t+":"+n)),set:(n,i)=>localStorage.setItem(t+":"+n,JSON.stringify(i)),has:n=>localStorage.getItem(t+":"+n)!==null,delete:n=>localStorage.removeItem(t+":"+n)};else{let n=new Map;e={get:()=>n.get("metro/state:"+t),set:i=>n.set("metro/state:"+t,i),has:()=>n.has("metro/state:"+t),delete:()=>n.delete("metro/state:"+t)},r=new Map}return{state:e,tokens:r}}function Bt(t){let e={client:re(),force_authorization:!1,site:"default",oauth2_configuration:{authorization_endpoint:"/authorize",token_endpoint:"/token",redirect_uri:globalThis.document?.location.href,grant_type:"authorization_code",code_verifier:eo(64)},authorize_callback:async f=>(window.location.href!=f.href&&window.location.replace(f.href),!1)};D(t,{});let r=Object.assign({},e.oauth2_configuration,t?.oauth2_configuration);t=Object.assign({},e,t),t.oauth2_configuration=r;let n=ur(t.site);t.tokens||(t.tokens=n.tokens),t.state||(t.state=n.state),D(t,{oauth2_configuration:{client_id:k(/.+/),grant_type:"authorization_code",authorization_endpoint:k(R),token_endpoint:k(R),redirect_uri:k(R)}});for(let f in r)switch(f){case"access_token":case"authorization_code":case"refresh_token":t.tokens.set(f,r[f]);break}return async function(f,c){if(t.force_authorization)return i(f,c);let d;try{if(d=await c(f),d.ok)return d}catch(h){switch(d?.status){case 400:case 401:return i(f,c)}throw h}if(!d.ok)switch(d.status){case 400:case 401:return i(f,c)}return d};async function i(f,c){s();let d=t.tokens.get("access_token"),h=t.tokens.get("refresh_token"),y=ei(d);if(!d||y&&!h){try{if(!await o())return Nt("false")}catch(_){throw _}return i(f,c)}else if(y&&h){try{if(!await a())return Nt("false")}catch(_){throw _}return i(f,c)}else return f=st(f,{headers:{Authorization:d.type+" "+d.value}}),c(f)}function s(){if(typeof window<"u"&&window?.location){let f=z(window.location),c,d,h;if(f.searchParams.has("code"))h=f.searchParams,f=f.with({search:""}),history.pushState({},"",f.href);else if(f.hash){let y=f.hash.substr(1);h=new URLSearchParams("?"+y),f=f.with({hash:""}),history.pushState({},"",f.href)}if(h){c=h.get("code"),d=h.get("state");let y=t.state.get("metro/state");if(!d||d!==y)return;c&&t.tokens.set("authorization_code",c)}}}async function o(){if(r.grant_type==="authorization_code"&&!t.tokens.has("authorization_code")){let h=await l();if(!t.authorize_callback||typeof t.authorize_callback!="function")throw V("oauth2mw: oauth2 with grant_type:authorization_code requires a callback function in client options.authorize_callback");let y=await t.authorize_callback(h);if(y)t.tokens.set("authorization_code",y);else return!1}let f=u(),c=await t.client.post(f);if(!c.ok){let h=await c.text();throw V("OAuth2mw: fetch access_token: "+c.status+": "+c.statusText+" ("+h+")",{cause:f})}let d=await c.json();if(t.tokens.set("access_token",{value:d.access_token,expires:Xn(d.expires_in),type:d.token_type,scope:d.scope}),d.refresh_token){let h={value:d.refresh_token};t.tokens.set("refresh_token",h)}return t.tokens.delete("authorization_code"),d}async function a(){let f=u("refresh_token"),c=await t.client.post(f);if(!c.ok)throw V("OAuth2mw: refresh access_token: "+c.status+": "+c.statusText,{cause:f});let d=await c.json();if(t.tokens.set("access_token",{value:d.access_token,expires:Xn(d.expires_in),type:d.token_type,scope:d.scope}),d.refresh_token){let h={value:d.refresh_token};t.tokens.set("refresh_token",h)}else return!1;return d}async function l(){if(!r.authorization_endpoint)throw V("oauth2mw: Missing options.oauth2_configuration.authorization_endpoint");let f=z(r.authorization_endpoint,{hash:""});D(r,{client_id:/.+/,redirect_uri:/.+/,scope:/.*/});let c={response_type:"code",client_id:r.client_id,redirect_uri:r.redirect_uri,state:r.state||ro(40)};return r.response_type&&(c.response_type=r.response_type),r.response_mode&&(c.response_mode=r.response_mode),t.state.set(c.state),r.client_secret&&(c.client_secret=r.client_secret),r.code_verifier&&(t.tokens.set("code_verifier",r.code_verifier),c.code_challenge=await to(r.code_verifier),c.code_challenge_method="S256"),r.scope&&(c.scope=r.scope),r.prompt&&(c.prompt=r.prompt),z(f,{search:c})}function u(f=null){if(D(r,{client_id:/.+/,redirect_uri:/.+/}),!r.token_endpoint)throw V("oauth2mw: Missing options.endpoints.token url");let c=z(r.token_endpoint,{hash:""}),d={grant_type:f||r.grant_type,client_id:r.client_id};switch(r.client_secret&&(d.client_secret=r.client_secret),r.scope&&(d.scope=r.scope),d.grant_type){case"authorization_code":d.redirect_uri=r.redirect_uri,d.code=t.tokens.get("authorization_code");let h=t.tokens.get("code_verifier");h&&(d.code_verifier=h);break;case"client_credentials":break;case"refresh_token":d.refresh_token=t.tokens.get("refresh_token");break;default:throw new Error("Unknown grant_type: ".oauth2.grant_type)}return st(c,{method:"POST",body:new URLSearchParams(d)})}}function ei(t){if(!t)return!0;let e=new Date(t.expires);return new Date().getTime()>e.getTime()}function Xn(t){if(t instanceof Date)return new Date(t.getTime());if(typeof t=="number"){let e=new Date;return e.setSeconds(e.getSeconds()+t),e}throw new TypeError("Unknown expires type "+t)}function eo(t=64){let e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),ti(e)}async function to(t){let r=new TextEncoder().encode(t),n=await globalThis.crypto.subtle.digest("SHA-256",r);return ti(n)}function ti(t){let e=Array.from(new Uint8Array(t),r=>String.fromCharCode(r)).join("");return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ro(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="",n=0;for(;n<t;)r+=e.charAt(Math.floor(Math.random()*e.length)),n++;return r}function ri(){let t=new URL(document.location.href);if(!t.searchParams.has("code")){if(t.hash){let e=t.hash.substr(1);if(new URLSearchParams("?"+e).has("code"))return!0}return!1}return!0}function Uf(t){typeof t=="string"&&(t=ur(t).tokens);let e=t.get("access_token");return!!(e&&!ei(e)||t.get("refresh_token"))}var ni={};nt(ni,{default:()=>io});var Vr={status:200,statusText:"OK",headers:{"Content-Type":"application/json"}},fr=t=>({status:400,statusText:"Bad Request",headers:{"Content-Type":"application/json"},body:JSON.stringify({error:"invalid_request",error_description:t})}),We,no={};function io(t={}){return t=Object.assign({},{PKCE:!1,DPoP:!1},t),async(r,n)=>{let i=N.url(r.url);switch(i.pathname){case"/authorize/":if(We=G(i.searchParams,{response_type:"code",client_id:"mockClientId",state:m(/.*/)}))return N.response(fr(We));if(i.searchParams.has("code_challenge")){if(!i.searchParams.has("code_challenge_method"))return N.response(fr("missing code_challenge_method"));no.code_challenge=i.searchParams.get("code_challenge"),no.code_challenge_method=i.searchParams.get("code_challenge_method")}return N.response(Vr,{body:JSON.stringify({code:"mockAuthorizeToken",state:i.searchParams.get("state")})});case"/token/":if(r.data instanceof URLSearchParams){let l={};r.data.forEach((u,f)=>l[f]=u),r=r.with({body:l})}if(We=G(r,{method:"POST",data:{grant_type:$("refresh_token","authorization_code")}}))return N.response(fr(We));switch(r.data.grant_type){case"refresh_token":if(We=G(r.data,$({refresh_token:"mockRefreshToken",client_id:"mockClientId",client_secret:"mockClientSecret"},{refresh_token:"mockRefreshToken",client_id:"mockClientId",code_verifier:/.+/})))return N.response(fr(We));break;case"access_token":if(We=G(r.data,$({client_id:"mockClientId",client_secret:"mockClientSecret"},{client_id:"mockClientId",code_challenge:/.*/,code_challenge_method:"S256"})))return N.response(fr(We));break}return N.response(Vr,{body:JSON.stringify({access_token:"mockAccessToken",token_type:"mockExample",expires_in:3600,refresh_token:"mockRefreshToken",example_parameter:"mockExampleValue"})});case"/protected/":let s=r.headers.get("Authorization"),[o,a]=s?s.split(" "):[];return!a||a!=="mockAccessToken"?N.response({status:401,statusText:"Forbidden",body:"401 Forbidden"}):N.response(Vr,{body:JSON.stringify({result:"Success"})});case"/public/":return N.response(Vr,{body:JSON.stringify({result:"Success"})});default:return N.response({status:404,statusText:"not found",body:"404 Not Found "+i})}}}var ii={};nt(ii,{default:()=>ao});var so=["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],oo=["client_secret_post","client_secret_base","client_secret_jwt","private_key_jwt"],$f={issuer:k(R),authorization_endpoint:k(R),token_endpoint:k(R),jwks_uri:m(R),registration_endpoint:m(R),scopes_supported:qe([]),response_types_supported:k(ve("code","token")),response_modes_supported:m([]),grant_types_supported:m([]),token_endpoint_auth_methods_supported:m([]),token_endpoint_auth_signing_alg_values_supported:m([]),service_documentation:m(R),ui_locales_supported:m([]),op_policy_uri:m(R),op_tos_uri:m(R),revocation_endpoint:m(R),revocation_endpoint_auth_methods_supported:m(oo),revocation_endpoint_auth_signing_alg_values_supported:m(so),introspection_endpoint:m(R),introspection_endpoint_auth_methods_supported:m(oo),introspection_endpoint_auth_signing_alg_values_supported:m(so),code_challendge_methods_supported:m([])};function ao(t={}){let e={client:N.client()};t=Object.assign({},e,t),D(t,{issuer:k(R)});let r=qf(t.issuer);return t.client.with(t.issuer)}async function qf(t,e){let r=e.get(N.url(t,".wellknown/oauth_authorization_server"));if(r.ok){D(r.headers.get("Content-Type"),/application\/json.*/);let n=await r.json();return D(n,$f),n}throw N.metroError("metro.oidcmw: Error while fetching "+t+".wellknown/oauth_authorization_server",r)}function lo(t=null){let e=!1;t=t||window.location.origin;let r=new URLSearchParams(window.location.search);if(!r.has("code")&&window.location.hash){let i=window.location.hash.substr(1);r=new URLSearchParams("?"+i)}let n=window.parent!==window?window.parent:window.opener;return n?r.has("code")?(n.postMessage({authorization_code:r.get("code")},t),e=!0):r.has("error")?n.postMessage({error:r.get("error")},t):n.postMessage({error:"Could not find an authorization_code"},t):console.error("No parent window found, cannot post authorization code (or error)"),e}function uo(t){return new Promise((e,r)=>{addEventListener("message",n=>{n.data.authorization_code?e(n.data.authorization_code):n.data.error?r(n.data.error):r("Unknown authorization error")},{once:!0}),window.open(t)})}function cr(){return new Promise((t,e)=>{let r=globalThis.indexedDB.open("metro",1);r.onupgradeneeded=()=>r.result.createObjectStore("keyPairs",{keyPath:"domain"}),r.onerror=n=>{e(n)},r.onsuccess=n=>{let i=n.target.result;t({set:function(s,o){return new Promise((a,l)=>{let u=i.transaction("keyPairs","readwrite",{durability:"strict"}),f=u.objectStore("keyPairs");u.oncomplete=()=>{a()},u.onerror=l,f.put(s,o)})},get:function(s){return new Promise((o,a)=>{let l=i.transaction("keyPairs","readonly"),f=l.objectStore("keyPairs").get(s);f.onsuccess=()=>{o(f.result)},f.onerror=a,l.onerror=a})},clear:function(){return new Promise((s,o)=>{let a=i.transaction("keyPairs","readwrite"),u=a.objectStore("keyPairs").clear();u.onsuccess=()=>{s()},u.onerror=o,a.onerror=o})}})}})}var Wf=new TextEncoder,zf=new TextDecoder;function Kr(t){return typeof t=="string"?Wf.encode(t):zf.decode(t)}function fo(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new oi(`${t.name} modulusLength must be at least 2048 bits`)}function Gf(t){switch(t.algorithm.name){case"ECDSA":return{name:t.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return fo(t.algorithm),{name:t.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return fo(t.algorithm),{name:t.algorithm.name};case"Ed25519":return{name:t.algorithm.name}}throw new ze}async function Hf(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');let n=`${Qr(Kr(JSON.stringify(t)))}.${Qr(Kr(JSON.stringify(e)))}`,i=Qr(await crypto.subtle.sign(Gf(r),r,Kr(n)));return`${n}.${i}`}var si;Uint8Array.prototype.toBase64?si=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):si=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));let r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Qr(t){return si(t)}var ze=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},oi=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function Vf(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";default:throw new ze("unsupported RsaHashedKeyAlgorithm hash name")}}function Kf(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";default:throw new ze("unsupported RsaHashedKeyAlgorithm hash name")}}function Qf(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";default:throw new ze("unsupported EcKeyAlgorithm namedCurve")}}function Jf(t){switch(t.algorithm.name){case"RSA-PSS":return Vf(t);case"RSASSA-PKCS1-v1_5":return Kf(t);case"ECDSA":return Qf(t);case"Ed25519":return"Ed25519";default:throw new ze("unsupported CryptoKey algorithm name")}}function co(t){return t instanceof CryptoKey}function Yf(t){return co(t)&&t.type==="private"}function Zf(t){return co(t)&&t.type==="public"}function Xf(){return Math.floor(Date.now()/1e3)}async function ai(t,e,r,n,i,s){let o=t?.privateKey,a=t?.publicKey;if(!Yf(o))throw new TypeError('"keypair.privateKey" must be a private CryptoKey');if(!Zf(a))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(a.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(i!==void 0&&typeof i!="string")throw new TypeError('"accessToken" must be a string or undefined');if(s!==void 0&&(typeof s!="object"||s===null||Array.isArray(s)))throw new TypeError('"additional" must be an object');return Hf({alg:Jf(o),typ:"dpop+jwt",jwk:await ec(a)},Object.assign(Object.assign({},s),{iat:Xf(),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:i?Qr(await crypto.subtle.digest("SHA-256",Kr(i))):void 0}),o)}async function ec(t){let{kty:e,e:r,n,x:i,y:s,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:i,y:s}}async function ho(t,e){var r;let n;if(typeof t!="string"||t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new ze}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0?r:!1,["sign","verify"])}function dr(t){return D(t,{site:k(R),authorization_endpoint:k(R),token_endpoint:k(R),dpop_signing_alg_values_supported:m([])}),async(e,r)=>{let n=await cr(),i=await n.get(t.site);if(!i){let a=await ho("ES256");i={domain:t.site,keyPair:a},await n.set(i)}let s=N.url(e.url);if(e.url.startsWith(t.authorization_endpoint)){let a=e.body;a instanceof URLSearchParams||a instanceof FormData?a.set("dpop_jkt",i.keyPair.publicKey):a.dpop_jkt=i.keyPair.publicKey}else if(e.url.startsWith(t.token_endpoint)){let a=await ai(i.keyPair,e.url,e.method);e=e.with({headers:{DPoP:a}})}else if(e.headers.has("Authorization")){let a=localStorage.getItem(s.host+":nonce")||void 0,l=e.headers.get("Authorization").split(" ")[1],u=await ai(i.keyPair,e.url,e.method,a,l);e=e.with({headers:{Authorization:"DPoP "+l,DPoP:u}})}let o=await r(e);return o.headers.get("DPoP-Nonce")&&localStorage.setItem(s.host+":nonce",o.headers.get("DPoP-Nonce")),o}}var rc=Object.assign({},Hr,{oauth2mw:Bt,mockserver:ni,discover:ii,tokenstore:ur,dpopmw:dr,keysstore:cr,authorizePopup:uo,popupHandleRedirect:lo});globalThis.metro.oauth2||(globalThis.metro.oauth2=rc);var hr=(...t)=>(e,r)=>t.filter(n=>r.hasOwnKey(n)).length>0?!1:P("root data must have all of",r,t),Ge=(...t)=>e=>Array.isArray(e)&&t.filter(r=>!e.includes(r)).length==0?!1:P("data must be an array which includes",e,t);var ae=["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],Jr=["client_secret_post","client_secret_basic","client_secret_jwt","private_key_jwt"];async function pr(t={}){D(t,{client:m(at(N.client().constructor)),issuer:k(R)});let e={client:N.client().with(ce()).with(fe()),requireDynamicRegistration:!1};t=Object.assign({},e,t);let r=!1;function n(l){return r}let i={issuer:k(Yn(t.issuer,n)),authorization_endpoint:k(R),token_endpoint:k(R),userinfo_endpoint:qe(R),jwks_uri:k(R),registration_endpoint:t.requireDynamicRegistration?k(R):qe(R),scopes_supported:qe(Ge("openid")),response_types_supported:t.requireDynamicRegistration?k(Ge("code","id_token","id_token token")):k([]),response_modes_supported:m([]),grant_types_supported:t.requireDynamicRegistration?m(Ge("authorization_code")):m([]),acr_values_supported:m([]),subject_types_supported:k([]),id_token_signing_alg_values_supported:k(Ge("RS256")),id_token_encryption_alg_values_supported:m([]),id_token_encryption_enc_values_supported:m([]),userinfo_signing_alg_values_supported:m([]),userinfo_encryption_alg_values_supported:m([]),userinfo_encryption_enc_values_supported:m([]),request_object_signing_alg_values_supported:m(Ge("RS256")),request_object_encryption_alg_values_supported:m([]),request_object_encryption_enc_values_supported:m([]),token_endpoint_auth_methods_supported:m(ve(...Jr)),token_endpoint_auth_signing_alg_values_supported:m(Ge("RS256"),Lt(Ge("none"))),display_values_supported:m(ve("page","popup","touch","wap")),claim_types_supported:m(ve("normal","aggregated","distributed")),claims_supported:qe([]),service_documentation:m(R),claims_locales_supported:m([]),ui_locales_supported:m([]),claims_parameter_supported:m(Boolean),request_parameter_supported:m(Boolean),request_uri_parameter_supported:m(Boolean),op_policy_uri:m(R),op_tos_uri:m(R)},s=N.url(t.issuer,".well-known/openid-configuration"),a=(await t.client.get(s)).data;return D(a,i),D(a.issuer,t.issuer),a}async function _r(t){let e={redirect_uris:k([R]),response_types:m([]),grant_types:m(ve("authorization_code","refresh_token")),application_type:m($("native","web")),contacts:m([Zn]),client_name:m(String),logo_uri:m(R),client_uri:m(R),policy_uri:m(R),tos_uri:m(R),jwks_uri:m(R,Lt(hr("jwks"))),jwks:m(R,Lt(hr("jwks_uri"))),sector_identifier_uri:m(R),subject_type:m(String),id_token_signed_response_alg:m($(...ae)),id_token_encrypted_response_alg:m($(...ae)),id_token_encrypted_response_enc:m($(...ae),hr("id_token_encrypted_response_alg")),userinfo_signed_response_alg:m($(...ae)),userinfo_encrypted_response_alg:m($(...ae)),userinfo_encrypted_response_enc:m($(...ae),hr("userinfo_encrypted_response_alg")),request_object_signing_alg:m($(...ae)),request_object_encryption_alg:m($(...ae)),request_object_encryption_enc:m($(...ae)),token_endpoint_auth_method:m($(...Jr)),token_endpoint_auth_signing_alg:m($(...ae)),default_max_age:m(Number),require_auth_time:m(Boolean),default_acr_values:m([String]),initiate_login_uri:m([R]),request_uris:m([R])};D(t,{client:m(at(N.client().constructor)),registration_endpoint:R,client_info:e});let r={client:N.client().with(ce()).with(fe()),client_info:{redirect_uris:[globalThis.document?.location.href]}};t=Object.assign({},r,t),t.client_info||(t.client_info={}),t.client_info.redirect_uris||(t.client_info.redirect_uris=[globalThis.document?.location.href]);let n=await t.client.post(t.registration_endpoint,{body:t.client_info}),i=n.data;if(!i.client_id||!i.client_secret)throw N.metroError("metro.oidc: Error: dynamic registration of client failed, no client_id or client_secret returned",n);return t.client_info=Object.assign(t.client_info,i),t.client_info}function Yr(t){let e;if(typeof localStorage<"u")e={get:r=>JSON.parse(localStorage.getItem("metro/oidc:"+t+":"+r)),set:(r,n)=>localStorage.setItem("metro/oidc:"+t+":"+r,JSON.stringify(n)),has:r=>localStorage.getItem("metro/oidc:"+t+":"+r)!==null};else{let r=new Map;e={get:n=>JSON.parse(r.get("metro/oidc:"+t+":"+n)||null),set:(n,i)=>r.set("metro/oidc:"+t+":"+n,JSON.stringify(i)),has:n=>r.has("metro/oidc:"+t+":"+n)}}return e}function li(t={}){let e={client:re(),force_authorization:!1,use_dpop:!0,authorize_callback:async r=>(window.location.href!=r.href&&window.location.replace(r.href),!1)};return t=Object.assign({},e,t),D(t,{client:k(at(re().constructor)),client_info:k(),issuer:k(R),oauth2:m({}),openid_configuration:m()}),t.store||(t.store=Yr(t.issuer)),!t.openid_configuration&&t.store.has("openid_configuration")&&(t.openid_configuration=t.store.get("openid_configuration")),!t.client_info?.client_id&&t.store.has("client_info")&&(t.client_info=t.store.get("client_info")),async(r,n)=>{let i;if(!t.force_authorization){try{i=await n(r)}catch(u){if(i.status!=401&&i.status!=403)throw u}if(i.ok||i.status!=401&&i.status!=403)return i}if(t.openid_configuration||(t.openid_configuration=await pr({issuer:t.issuer}),t.store.set("openid_configuration",t.openid_configuration)),!t.client_info?.client_id){if(!t.openid_configuration.registration_endpoint)throw V("metro.oidcmw: Error: issuer "+t.issuer+" does not support dynamic client registration, but you haven't specified a client_id");t.client_info=await _r({registration_endpoint:t.openid_configuration.registration_endpoint,client_info:t.client_info}),t.store.set("client_info",t.client_info)}let s=t.scope||"openid",o=Object.assign({site:t.issuer,client:t.client,force_authorization:!0,authorize_callback:t.authorize_callback,oauth2_configuration:{client_id:t.client_info?.client_id,client_secret:t.client_info?.client_secret,grant_type:"authorization_code",response_type:"code",response_mode:"query",authorization_endpoint:t.openid_configuration.authorization_endpoint,token_endpoint:t.openid_configuration.token_endpoint,scope:s,redirect_uri:t.client_info.redirect_uris[0]}}),a=async(u,f)=>{let c=await f(u);if(c.headers.get("content-type")?.startsWith("application/json")){let h=c.data?.id_token;if(!h){let y=c.clone();try{let _=await y.json();_&&_.id_token&&(h=_.id_token)}catch{}}h&&t.store.set("id_token",h)}return c},l=t.client.with(t.issuer).with(a);if(t.use_dpop){let u={site:t.issuer,authorization_endpoint:t.openid_configuration.authorization_endpoint,token_endpoint:t.openid_configuration.token_endpoint,dpop_signing_alg_values_supported:t.openid_configuration.dpop_signing_alg_values_supported};l=l.with(dr(u)),o.client=l}return l=l.with(Bt(o)),i=await l.fetch(r),i}}function po(){return ri()}function _o(t){if(!t.store){if(!t.issuer)throw V("Must supply options.issuer or options.store to get the id_token");t.store=Yr(t.issuer)}return t.store.get("id_token")}var yo={oidcmw:li,discover:pr,register:_r,isRedirected:po,idToken:_o};globalThis.metro.oidc||(globalThis.metro.oidc=yo);var bo=yo;var ui={};nt(ui,{BlankNode:()=>He,Collection:()=>ut,Context:()=>Zr,Graph:()=>Xr,NamedNode:()=>lt,default:()=>en,first:()=>sc,many:()=>ic,one:()=>nc,prefixes:()=>mo,rdfType:()=>tn});function en(t){return new Zr(t)}var tn="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",mo={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",solid:"http://www.w3.org/ns/solid/terms#",schema:"http://schema.org/",vcard:"http://www.w3.org/2006/vcard/ns#"};function nc(t,e="last"){let r=t;if(Array.isArray(t))if(e=="last")r=t[t.length-1];else if(e=="first")r=t[0];else if(typeof e=="function")r=e(t);else throw new Error("Unknown value for whichOne parameter");return r}function ic(t){return Array.isArray(t)?t:t==null?[]:[t]}function sc(...t){for(let e of t)if(e!=null)return e;return null}var Zr=class{constructor(e){this.prefixes={...mo,...e?.prefixes},this.prefixes.xsd||(this.prefixes.xsd="http://www.w3.org/2001/XMLSchema#"),this.parser=e?.parser,this.writer=e?.writer,this.sources=Object.create(null),this.separator=e?.separator??"$"}parse(e,r,n){let{quads:i,prefixes:s}=this.parser(e,r,n);if(s)for(let o in s){let a=s[o];if(a.match(/^http(s?):\/\/$/i))a+=r.substring(a.length);else try{a=new URL(s[o],r).href}catch(l){console.error("Could not parse prefix",s[o],l.message)}this.prefixes[o]||(this.prefixes[o]=a)}return this.sources[r]=new Xr(i,r,n,s,this),this.sources[r]}setType(e,r){if(!r)return e;if(typeof e=="string"?e=new String(e):typeof result=="number"&&(e=new Number(e)),typeof e!="object")throw new Error("cannot set type on ",e,r);return e.type=r,e}getType(e){return e&&typeof e=="object"?e.type:null}},Xr=class{#e=Object.create(null);constructor(e,r,n,i,s){this.mimetype=n,this.url=r,this.prefixes=i,this.context=s,this.subjects=Object.create(null);for(let o of e){let a;if(o.subject.termType=="BlankNode"){let l=this.shortURI(o.predicate.id,":"),u;switch(l){case"rdf:first":if(a=this.addCollection(o.subject.id),u=this.shortURI(o.object.id,":"),u!="rdf:nil"){let f=this.getValue(o.object);f&&a.push(f)}continue;case"rdf:rest":this.#e[o.object.id]=this.#e[o.subject.id];continue;default:a=this.addBlankNode(o.subject.id);break}}else a=this.addNamedNode(o.subject.id);a.addPredicate(o.predicate.id,o.object)}this.subjects[r]?this.primary=this.subjects[r]:this.primary=null,Object.defineProperty(this,"data",{get(){return Object.values(this.subjects)}})}addNamedNode(e){let r=new URL(e,this.url).href;return this.subjects[r]||(this.subjects[r]=new lt(r,this)),this.subjects[r]}addBlankNode(e){return this.#e[e]||(this.#e[e]=new He(this)),this.#e[e]}addCollection(e){return this.#e[e]||(this.#e[e]=new ut(this)),this.#e[e]}write(){return this.context.writer(this)}get(e){return this.subjects[this.fullURI(e)]}fullURI(e,r=null){r||(r=this.context.separator);let[n,i]=e.split(r);return i?this.prefixes[n]+i:e}shortURI(e,r=null){r||(r=this.context.separator);for(let n in this.context.prefixes)if(e.startsWith(this.context.prefixes[n]))return n+r+e.substring(this.context.prefixes[n].length);return this.url&&e.startsWith(this.url)?e.substring(this.url.length):e}setType(e,r){let n=this.shortURI(r);return this.context.setType(e,n)}getType(e){return this.context.getType(e)}setLanguage(e,r){if(typeof e=="string"?e=new String(e):typeof result=="number"&&(e=new Number(e)),typeof e!="object")throw new Error("cannot set language on ",e);return e.language=r,e}getValue(e){let r;if(e.termType=="Literal"){r=e.value;let n=e.datatype?.id;n&&(r=this.setType(r,n));let i=e.language;i&&(r=this.setLanguage(r,i))}else e.termType=="BlankNode"?r=this.addBlankNode(e.id):r=this.addNamedNode(e.id);return r}},He=class{constructor(e){Object.defineProperty(this,"graph",{value:e,writable:!1,enumerable:!1})}addPredicate(e,r){if(e.id&&(e=e.id),e==tn){let n=this.graph.shortURI(r.id);this.addType(n)}else{let n=this.graph.getValue(r);e=this.graph.shortURI(e),this[e]?Array.isArray(this[e])?this[e].push(n):this[e]=[this[e],n]:this[e]=n}}addType(e){this.a?(Array.isArray(this.a)||(this.a=[this.a]),this.a.push(e)):this.a=e}},lt=class extends He{constructor(e,r){super(r),Object.defineProperty(this,"id",{value:e,writable:!1,enumerable:!0})}},ut=class extends Array{constructor(e,r){super(),Object.defineProperty(this,"graph",{value:r,writable:!1,enumerable:!1})}};var qs={};nt(qs,{n3Parser:()=>kb,n3Writer:()=>jb});var Uo=zr(pe());var dt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",br="http://www.w3.org/2001/XMLSchema#",on="http://www.w3.org/2000/10/swap/",O={xsd:{decimal:`${br}decimal`,boolean:`${br}boolean`,double:`${br}double`,integer:`${br}integer`,string:`${br}string`},rdf:{type:`${dt}type`,nil:`${dt}nil`,first:`${dt}first`,rest:`${dt}rest`,langString:`${dt}langString`,dirLangString:`${dt}dirLangString`,reifies:`${dt}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${on}reify#forSome`,forAll:`${on}reify#forAll`},log:{implies:`${on}log#implies`,isImpliedBy:`${on}log#isImpliedBy`}};var{xsd:an}=O,Mc=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Do={"\\":"\\","'":"'",'"':'"',n:`
|
|
2
|
+
`;super(r),this.name="AggregateError",this.errors=e}};ta.exports={AggregateError:Ri,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Ii=v((kg,ra)=>{"use strict";ra.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var Q=v((jg,sa)=>{"use strict";var{format:rd,inspect:ln}=Ii(),{AggregateError:nd}=B(),id=globalThis.AggregateError||nd,sd=Symbol("kIsNodeError"),od=["string","function","number","object","Function","Object","boolean","bigint","symbol"],ad=/^([A-Z][a-z0-9]*)+$/,ld="__node_internal_",un={};function mt(t,e){if(!t)throw new un.ERR_INTERNAL_ASSERTION(e)}function na(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ud(t,e,r){if(typeof e=="function")return mt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return mt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:rd(e,...r)}function K(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(ud(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[sd]=!0,un[t]=n}function ia(t){let e=ld+t.name;return Object.defineProperty(t,"name",{value:e}),t}function fd(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new id([e,t],e.message);return r.code=e.code,r}return t||e}var Ai=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new un.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};K("ERR_ASSERTION","%s",Error);K("ERR_INVALID_ARG_TYPE",(t,e,r)=>{mt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let l of e)mt(typeof l=="string","All expected entries have to be of type string"),od.includes(l)?i.push(l.toLowerCase()):ad.test(l)?s.push(l):(mt(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=ln(r,{depth:-1});n+=`. Received ${l}`}}else{let l=ln(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);K("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=ln(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);K("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);K("ERR_MISSING_ARGS",(...t)=>{mt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);K("ERR_OUT_OF_RANGE",(t,e,r)=>{mt(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=na(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=na(n)),n+="n"}else n=ln(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);K("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);K("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);K("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);K("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);K("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);K("ERR_STREAM_WRITE_AFTER_END","write after end",Error);K("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);sa.exports={AbortError:Ai,aggregateTwoErrors:ia(fd),hideStackFrames:ia,codes:un}});var zt=v((Ng,fn)=>{"use strict";var{AbortController:oa,AbortSignal:cd}=typeof self<"u"?self:typeof window<"u"?window:void 0;fn.exports=oa;fn.exports.AbortSignal=cd;fn.exports.default=oa});var Rr=v((Pg,Ti)=>{"use strict";var Gt=typeof Reflect=="object"?Reflect:null,aa=Gt&&typeof Gt.apply=="function"?Gt.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},cn;Gt&&typeof Gt.ownKeys=="function"?cn=Gt.ownKeys:Object.getOwnPropertySymbols?cn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:cn=function(e){return Object.getOwnPropertyNames(e)};function dd(t){console&&console.warn&&console.warn(t)}var ua=Number.isNaN||function(e){return e!==e};function j(){j.init.call(this)}Ti.exports=j;Ti.exports.once=yd;j.EventEmitter=j;j.prototype._events=void 0;j.prototype._eventsCount=0;j.prototype._maxListeners=void 0;var la=10;function dn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return la},set:function(t){if(typeof t!="number"||t<0||ua(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");la=t}});j.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};j.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ua(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function fa(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}j.prototype.getMaxListeners=function(){return fa(this)};j.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")aa(l,this,r);else for(var u=l.length,f=_a(l,u),n=0;n<u;++n)aa(f[n],this,r);return!0};function ca(t,e,r,n){var i,s,o;if(dn(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=fa(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,dd(a)}return t}j.prototype.addListener=function(e,r){return ca(this,e,r,!1)};j.prototype.on=j.prototype.addListener;j.prototype.prependListener=function(e,r){return ca(this,e,r,!0)};function hd(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function da(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=hd.bind(n);return i.listener=r,n.wrapFn=i,i}j.prototype.once=function(e,r){return dn(r),this.on(e,da(this,e,r)),this};j.prototype.prependOnceListener=function(e,r){return dn(r),this.prependListener(e,da(this,e,r)),this};j.prototype.removeListener=function(e,r){var n,i,s,o,a;if(dn(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():pd(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};j.prototype.off=j.prototype.removeListener;j.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function ha(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?_d(i):_a(i,i.length)}j.prototype.listeners=function(e){return ha(this,e,!0)};j.prototype.rawListeners=function(e){return ha(this,e,!1)};j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pa.call(t,e)};j.prototype.listenerCount=pa;function pa(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}j.prototype.eventNames=function(){return this._eventsCount>0?cn(this._events):[]};function _a(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function pd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function _d(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function yd(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}ya(t,e,s,{once:!0}),e!=="error"&&bd(t,i,{once:!0})})}function bd(t,e,r){typeof t.on=="function"&&ya(t,"error",e,r)}function ya(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Y=v((Og,ki)=>{"use strict";var md=pe(),{format:gd,inspect:wd}=Ii(),{codes:{ERR_INVALID_ARG_TYPE:vi}}=Q(),{kResistStopPropagation:xd,AggregateError:Sd,SymbolDispose:Ed}=B(),Rd=globalThis.AbortSignal||zt().AbortSignal,Id=globalThis.AbortController||zt().AbortController,Ad=Object.getPrototypeOf(async function(){}).constructor,ba=globalThis.Blob||md.Blob,Td=typeof ba<"u"?function(e){return e instanceof ba}:function(e){return!1},ma=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new vi(e,"AbortSignal",t)},vd=(t,e)=>{if(typeof t!="function")throw new vi(e,"Function",t)};ki.exports={AggregateError:Sd,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format:gd,inspect:wd,types:{isAsyncFunction(t){return t instanceof Ad},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Td,deprecate(t,e){return t},addAbortListener:Rr().addAbortListener||function(e,r){if(e===void 0)throw new vi("signal","AbortSignal",e);ma(e,"signal"),vd(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[xd]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Ed](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Rd.any||function(e){if(e.length===1)return e[0];let r=new Id,n=()=>r.abort();return e.forEach(i=>{ma(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};ki.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Vt=v((Lg,va)=>{"use strict";var{ArrayIsArray:Ni,ArrayPrototypeIncludes:Sa,ArrayPrototypeJoin:Ea,ArrayPrototypeMap:kd,NumberIsInteger:Pi,NumberIsNaN:jd,NumberMAX_SAFE_INTEGER:Nd,NumberMIN_SAFE_INTEGER:Pd,NumberParseInt:Od,ObjectPrototypeHasOwnProperty:Ld,RegExpPrototypeExec:Ra,String:Bd,StringPrototypeToUpperCase:Cd,StringPrototypeTrim:Fd}=B(),{hideStackFrames:ie,codes:{ERR_SOCKET_BAD_PORT:Md,ERR_INVALID_ARG_TYPE:J,ERR_INVALID_ARG_VALUE:Ht,ERR_OUT_OF_RANGE:gt,ERR_UNKNOWN_SIGNAL:ga}}=Q(),{normalizeEncoding:Dd}=Y(),{isAsyncFunction:Ud,isArrayBufferView:$d}=Y().types,wa={};function qd(t){return t===(t|0)}function Wd(t){return t===t>>>0}var zd=/^[0-7]+$/,Gd="must be a 32-bit unsigned integer or an octal string";function Hd(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Ra(zd,t)===null)throw new Ht(e,t,Gd);t=Od(t,8)}return Ia(t,e),t}var Vd=ie((t,e,r=Pd,n=Nd)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);if(t<r||t>n)throw new gt(e,`>= ${r} && <= ${n}`,t)}),Kd=ie((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);if(t<r||t>n)throw new gt(e,`>= ${r} && <= ${n}`,t)}),Ia=ie((t,e,r=!1)=>{if(typeof t!="number")throw new J(e,"number",t);if(!Pi(t))throw new gt(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new gt(e,`>= ${n} && <= ${i}`,t)});function Oi(t,e){if(typeof t!="string")throw new J(e,"string",t)}function Qd(t,e,r=void 0,n){if(typeof t!="number")throw new J(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&jd(t))throw new gt(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Jd=ie((t,e,r)=>{if(!Sa(r,t)){let i="must be one of: "+Ea(kd(r,s=>typeof s=="string"?`'${s}'`:Bd(s)),", ");throw new Ht(e,t,i)}});function Aa(t,e){if(typeof t!="boolean")throw new J(e,"boolean",t)}function ji(t,e,r){return t==null||!Ld(t,e)?r:t[e]}var Yd=ie((t,e,r=null)=>{let n=ji(r,"allowArray",!1),i=ji(r,"allowFunction",!1);if(!ji(r,"nullable",!1)&&t===null||!n&&Ni(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new J(e,"Object",t)}),Zd=ie((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new J(e,"a dictionary",t)}),hn=ie((t,e,r=0)=>{if(!Ni(t))throw new J(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Ht(e,t,n)}});function Xd(t,e){hn(t,e);for(let r=0;r<t.length;r++)Oi(t[r],`${e}[${r}]`)}function eh(t,e){hn(t,e);for(let r=0;r<t.length;r++)Aa(t[r],`${e}[${r}]`)}function th(t,e){hn(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new J(i,"AbortSignal",n);Ta(n,i)}}function rh(t,e="signal"){if(Oi(t,e),wa[t]===void 0)throw wa[Cd(t)]!==void 0?new ga(t+" (signals must use all capital letters)"):new ga(t)}var nh=ie((t,e="buffer")=>{if(!$d(t))throw new J(e,["Buffer","TypedArray","DataView"],t)});function ih(t,e){let r=Dd(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Ht("encoding",e,`is invalid for data of length ${n}`)}function sh(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Fd(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Md(e,t,r);return t|0}var Ta=ie((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new J(e,"AbortSignal",t)}),oh=ie((t,e)=>{if(typeof t!="function")throw new J(e,"Function",t)}),ah=ie((t,e)=>{if(typeof t!="function"||Ud(t))throw new J(e,"Function",t)}),lh=ie((t,e)=>{if(t!==void 0)throw new J(e,"undefined",t)});function uh(t,e,r){if(!Sa(r,t))throw new J(e,`('${Ea(r,"|")}')`,t)}var fh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function xa(t,e){if(typeof t>"u"||!Ra(fh,t))throw new Ht(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ch(t){if(typeof t=="string")return xa(t,"hints"),t;if(Ni(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];xa(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Ht("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}va.exports={isInt32:qd,isUint32:Wd,parseFileMode:Hd,validateArray:hn,validateStringArray:Xd,validateBooleanArray:eh,validateAbortSignalArray:th,validateBoolean:Aa,validateBuffer:nh,validateDictionary:Zd,validateEncoding:ih,validateFunction:oh,validateInt32:Kd,validateInteger:Vd,validateNumber:Qd,validateObject:Yd,validateOneOf:Jd,validatePlainFunction:ah,validatePort:sh,validateSignalName:rh,validateString:Oi,validateUint32:Ia,validateUndefined:lh,validateUnion:uh,validateAbortSignal:Ta,validateLinkHeaderValue:ch}});var Je=v((Bg,Pa)=>{var F=Pa.exports={},ye,be;function Li(){throw new Error("setTimeout has not been defined")}function Bi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ye=setTimeout:ye=Li}catch{ye=Li}try{typeof clearTimeout=="function"?be=clearTimeout:be=Bi}catch{be=Bi}})();function ka(t){if(ye===setTimeout)return setTimeout(t,0);if((ye===Li||!ye)&&setTimeout)return ye=setTimeout,setTimeout(t,0);try{return ye(t,0)}catch{try{return ye.call(null,t,0)}catch{return ye.call(this,t,0)}}}function dh(t){if(be===clearTimeout)return clearTimeout(t);if((be===Bi||!be)&&clearTimeout)return be=clearTimeout,clearTimeout(t);try{return be(t)}catch{try{return be.call(null,t)}catch{return be.call(this,t)}}}var Oe=[],Kt=!1,wt,pn=-1;function hh(){!Kt||!wt||(Kt=!1,wt.length?Oe=wt.concat(Oe):pn=-1,Oe.length&&ja())}function ja(){if(!Kt){var t=ka(hh);Kt=!0;for(var e=Oe.length;e;){for(wt=Oe,Oe=[];++pn<e;)wt&&wt[pn].run();pn=-1,e=Oe.length}wt=null,Kt=!1,dh(t)}}F.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Oe.push(new Na(t,e)),Oe.length===1&&!Kt&&ka(ja)};function Na(t,e){this.fun=t,this.array=e}Na.prototype.run=function(){this.fun.apply(null,this.array)};F.title="browser";F.browser=!0;F.env={};F.argv=[];F.version="";F.versions={};function Le(){}F.on=Le;F.addListener=Le;F.once=Le;F.off=Le;F.removeListener=Le;F.removeAllListeners=Le;F.emit=Le;F.prependListener=Le;F.prependOnceListener=Le;F.listeners=function(t){return[]};F.binding=function(t){throw new Error("process.binding is not supported")};F.cwd=function(){return"/"};F.chdir=function(t){throw new Error("process.chdir is not supported")};F.umask=function(){return 0}});var ge=v((Cg,Va)=>{"use strict";var{SymbolAsyncIterator:Oa,SymbolIterator:La,SymbolFor:xt}=B(),Ba=xt("nodejs.stream.destroyed"),Ca=xt("nodejs.stream.errored"),Ci=xt("nodejs.stream.readable"),Fi=xt("nodejs.stream.writable"),Fa=xt("nodejs.stream.disturbed"),ph=xt("nodejs.webstream.isClosedPromise"),_h=xt("nodejs.webstream.controllerErrorFunction");function _n(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function yn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function yh(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function me(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Ma(t){return!!(t&&!me(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Da(t){return!!(t&&!me(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Ua(t){return!!(t&&!me(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function bh(t){return Ma(t)||Da(t)||Ua(t)}function mh(t,e){return t==null?!1:e===!0?typeof t[Oa]=="function":e===!1?typeof t[La]=="function":typeof t[Oa]=="function"||typeof t[La]=="function"}function bn(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Ba]||n!=null&&n.destroyed)}function $a(t){if(!yn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function gh(t,e){if(!yn(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function wh(t){if(!_n(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function qa(t,e){if(!_n(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Wa(t){return t&&t[Ci]!=null?t[Ci]:typeof t?.readable!="boolean"?null:bn(t)?!1:_n(t)&&t.readable&&!qa(t)}function za(t){return t&&t[Fi]!=null?t[Fi]:typeof t?.writable!="boolean"?null:bn(t)?!1:yn(t)&&t.writable&&!$a(t)}function xh(t,e){return me(t)?bn(t)?!0:!(e?.readable!==!1&&Wa(t)||e?.writable!==!1&&za(t)):null}function Sh(t){var e,r;return me(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Eh(t){var e,r;return me(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Rh(t){if(!me(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Ga(t)?t._closed:null}function Ga(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Ha(t){return typeof t._sent100=="boolean"&&Ga(t)}function Ih(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Ah(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Ha(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Th(t){var e;return!!(t&&((e=t[Fa])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function vh(t){var e,r,n,i,s,o,a,l,u,f;return!!(t&&((e=(r=(n=(i=(s=(o=t[Ca])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}Va.exports={isDestroyed:bn,kIsDestroyed:Ba,isDisturbed:Th,kIsDisturbed:Fa,isErrored:vh,kIsErrored:Ca,isReadable:Wa,kIsReadable:Ci,kIsClosedPromise:ph,kControllerErrorFunction:_h,kIsWritable:Fi,isClosed:Rh,isDuplexNodeStream:yh,isFinished:xh,isIterable:mh,isReadableNodeStream:_n,isReadableStream:Ma,isReadableEnded:wh,isReadableFinished:qa,isReadableErrored:Eh,isNodeStream:me,isWebStream:bh,isWritable:za,isWritableNodeStream:yn,isWritableStream:Da,isWritableEnded:$a,isWritableFinished:gh,isWritableErrored:Sh,isServerRequest:Ih,isServerResponse:Ha,willEmitClose:Ah,isTransformStream:Ua}});var Be=v((Fg,qi)=>{"use strict";var Ye=Je(),{AbortError:rl,codes:kh}=Q(),{ERR_INVALID_ARG_TYPE:jh,ERR_STREAM_PREMATURE_CLOSE:Ka}=kh,{kEmptyObject:Di,once:Ui}=Y(),{validateAbortSignal:Nh,validateFunction:Ph,validateObject:Oh,validateBoolean:Lh}=Vt(),{Promise:Bh,PromisePrototypeThen:Ch,SymbolDispose:nl}=B(),{isClosed:Fh,isReadable:Qa,isReadableNodeStream:Mi,isReadableStream:Mh,isReadableFinished:Ja,isReadableErrored:Ya,isWritable:Za,isWritableNodeStream:Xa,isWritableStream:Dh,isWritableFinished:el,isWritableErrored:tl,isNodeStream:Uh,willEmitClose:$h,kIsClosedPromise:qh}=ge(),Qt;function Wh(t){return t.setHeader&&typeof t.abort=="function"}var $i=()=>{};function il(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Di):e==null?e=Di:Oh(e,"options"),Ph(r,"callback"),Nh(e.signal,"options.signal"),r=Ui(r),Mh(t)||Dh(t))return zh(t,e,r);if(!Uh(t))throw new jh("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:Mi(t),o=(i=e.writable)!==null&&i!==void 0?i:Xa(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||d()},f=$h(t)&&Mi(t)===s&&Xa(t)===o,c=el(t,!1),d=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||h)&&r.call(t)},h=Ja(t,!1),y=()=>{h=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},_=T=>{r.call(t,T)},x=Fh(t),b=()=>{x=!0;let T=tl(t)||Ya(t);if(T&&typeof T!="boolean")return r.call(t,T);if(s&&!h&&Mi(t,!0)&&!Ja(t,!1))return r.call(t,new Ka);if(o&&!c&&!el(t,!1))return r.call(t,new Ka);r.call(t)},g=()=>{x=!0;let T=tl(t)||Ya(t);if(T&&typeof T!="boolean")return r.call(t,T);r.call(t)},S=()=>{t.req.on("finish",d)};Wh(t)?(t.on("complete",d),f||t.on("abort",b),t.req?S():t.on("request",S)):o&&!a&&(t.on("end",u),t.on("close",u)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",b),t.on("end",y),t.on("finish",d),e.error!==!1&&t.on("error",_),t.on("close",b),x?Ye.nextTick(b):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?f||Ye.nextTick(g):(!s&&(!f||Qa(t))&&(c||Za(t)===!1)||!o&&(!f||Za(t))&&(h||Qa(t)===!1)||l&&t.req&&t.aborted)&&Ye.nextTick(g);let w=()=>{r=$i,t.removeListener("aborted",b),t.removeListener("complete",d),t.removeListener("abort",b),t.removeListener("request",S),t.req&&t.req.removeListener("finish",d),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",d),t.removeListener("end",y),t.removeListener("error",_),t.removeListener("close",b)};if(e.signal&&!x){let T=()=>{let Ae=r;w(),Ae.call(t,new rl(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ye.nextTick(T);else{Qt=Qt||Y().addAbortListener;let Ae=Qt(e.signal,T),U=r;r=Ui((...jt)=>{Ae[nl](),U.apply(t,jt)})}}return w}function zh(t,e,r){let n=!1,i=$i;if(e.signal)if(i=()=>{n=!0,r.call(t,new rl(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ye.nextTick(i);else{Qt=Qt||Y().addAbortListener;let o=Qt(e.signal,i),a=r;r=Ui((...l)=>{o[nl](),a.apply(t,l)})}let s=(...o)=>{n||Ye.nextTick(()=>r.apply(t,o))};return Ch(t[qh].promise,s,s),$i}function Gh(t,e){var r;let n=!1;return e===null&&(e=Di),(r=e)!==null&&r!==void 0&&r.cleanup&&(Lh(e.cleanup,"cleanup"),n=e.cleanup),new Bh((i,s)=>{let o=il(t,e,a=>{n&&o(),a?s(a):i()})})}qi.exports=il;qi.exports.finished=Gh});var St=v((Mg,dl)=>{"use strict";var we=Je(),{aggregateTwoErrors:Hh,codes:{ERR_MULTIPLE_CALLBACK:Vh},AbortError:Kh}=Q(),{Symbol:al}=B(),{kIsDestroyed:Qh,isDestroyed:Jh,isFinished:Yh,isServerRequest:Zh}=ge(),ll=al("kDestroy"),Wi=al("kConstruct");function ul(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Xh(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(ul(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?sl(this,t,e):this.once(ll,function(s){sl(this,Hh(s,t),e)}),this)}function sl(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;ul(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?we.nextTick(ep,t,s):we.nextTick(fl,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function ep(t,e){zi(t,e),fl(t)}function fl(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function zi(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function tp(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Gi(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?we.nextTick(zi,t,e):zi(t,e))}function rp(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Wi,e),!(t.listenerCount(Wi)>1)&&we.nextTick(np,t)}function np(t){let e=!1;function r(n){if(e){Gi(t,n??new Vh);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(ll,n):n?Gi(t,n,!0):we.nextTick(ip,t)}try{t._construct(n=>{we.nextTick(r,n)})}catch(n){we.nextTick(r,n)}}function ip(t){t.emit(Wi)}function ol(t){return t?.setHeader&&typeof t.abort=="function"}function cl(t){t.emit("close")}function sp(t,e){t.emit("error",e),we.nextTick(cl,t)}function op(t,e){!t||Jh(t)||(!e&&!Yh(t)&&(e=new Kh),Zh(t)?(t.socket=null,t.destroy(e)):ol(t)?t.abort():ol(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?we.nextTick(sp,t,e):we.nextTick(cl,t),t.destroyed||(t[Qh]=!0))}dl.exports={construct:rp,destroyer:op,destroy:Xh,undestroy:tp,errorOrDestroy:Gi}});var wn=v((Dg,pl)=>{"use strict";var{ArrayIsArray:ap,ObjectSetPrototypeOf:hl}=B(),{EventEmitter:mn}=Rr();function gn(t){mn.call(this,t)}hl(gn.prototype,mn.prototype);hl(gn,mn);gn.prototype.pipe=function(t,e){let r=this;function n(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(f){u(),mn.listenerCount(this,"error")===0&&this.emit("error",f)}Hi(r,"error",l),Hi(t,"error",l);function u(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Hi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):ap(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}pl.exports={Stream:gn,prependListener:Hi}});var Ir=v((Ug,xn)=>{"use strict";var{SymbolDispose:lp}=B(),{AbortError:_l,codes:up}=Q(),{isNodeStream:yl,isWebStream:fp,kControllerErrorFunction:cp}=ge(),dp=Be(),{ERR_INVALID_ARG_TYPE:bl}=up,Vi,hp=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new bl(e,"AbortSignal",t)};xn.exports.addAbortSignal=function(e,r){if(hp(e,"signal"),!yl(r)&&!fp(r))throw new bl("stream",["ReadableStream","WritableStream","Stream"],r);return xn.exports.addAbortSignalNoValidate(e,r)};xn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=yl(e)?()=>{e.destroy(new _l(void 0,{cause:t.reason}))}:()=>{e[cp](new _l(void 0,{cause:t.reason}))};if(t.aborted)r();else{Vi=Vi||Y().addAbortListener;let n=Vi(t,r);dp(e,n[lp])}return e}});var wl=v((qg,gl)=>{"use strict";var{StringPrototypeSlice:ml,SymbolIterator:pp,TypedArrayPrototypeSet:Sn,Uint8Array:_p}=B(),{Buffer:Ki}=pe(),{inspect:yp}=Y();gl.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Ki.alloc(0);let r=Ki.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Sn(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[pp](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let s=n.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=ml(s,0,e),this.head=n,n.data=ml(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Ki.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Sn(r,o,n-e),e-=o.length;else{e===o.length?(Sn(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Sn(r,new _p(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return yp(this,{...r,depth:0,customInspect:!1})}}});var Ar=v((Wg,Rl)=>{"use strict";var{MathFloor:bp,NumberIsInteger:mp}=B(),{validateInteger:gp}=Vt(),{ERR_INVALID_ARG_VALUE:wp}=Q().codes,xl=16*1024,Sl=16;function xp(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function El(t){return t?Sl:xl}function Sp(t,e){gp(e,"value",0),t?Sl=e:xl=e}function Ep(t,e,r,n){let i=xp(e,n,r);if(i!=null){if(!mp(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new wp(s,i)}return bp(i)}return El(t.objectMode)}Rl.exports={getHighWaterMark:Ep,getDefaultHighWaterMark:El,setDefaultHighWaterMark:Sp}});var Tl=v((Qi,Al)=>{var En=pe(),xe=En.Buffer;function Il(t,e){for(var r in t)e[r]=t[r]}xe.from&&xe.alloc&&xe.allocUnsafe&&xe.allocUnsafeSlow?Al.exports=En:(Il(En,Qi),Qi.Buffer=Et);function Et(t,e,r){return xe(t,e,r)}Et.prototype=Object.create(xe.prototype);Il(xe,Et);Et.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return xe(t,e,r)};Et.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=xe(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Et.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return xe(t)};Et.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return En.SlowBuffer(t)}});var jl=v(kl=>{"use strict";var Yi=Tl().Buffer,vl=Yi.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Rp(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Ip(t){var e=Rp(t);if(typeof e!="string"&&(Yi.isEncoding===vl||!vl(t)))throw new Error("Unknown encoding: "+t);return e||t}kl.StringDecoder=Tr;function Tr(t){this.encoding=Ip(t);var e;switch(this.encoding){case"utf16le":this.text=Np,this.end=Pp,e=4;break;case"utf8":this.fillLast=vp,e=4;break;case"base64":this.text=Op,this.end=Lp,e=3;break;default:this.write=Bp,this.end=Cp;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Yi.allocUnsafe(e)}Tr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Tr.prototype.end=jp;Tr.prototype.text=kp;Tr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ji(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Ap(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Ji(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Ji(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Ji(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Tp(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function vp(t){var e=this.lastTotal-this.lastNeed,r=Tp(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function kp(t,e){var r=Ap(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function jp(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Np(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Pp(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Op(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Lp(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Bp(t){return t.toString(this.encoding)}function Cp(t){return t&&t.length?this.write(t):""}});var Zi=v((Gg,Ll)=>{"use strict";var Nl=Je(),{PromisePrototypeThen:Fp,SymbolAsyncIterator:Pl,SymbolIterator:Ol}=B(),{Buffer:Mp}=pe(),{ERR_INVALID_ARG_TYPE:Dp,ERR_STREAM_NULL_VALUES:Up}=Q().codes;function $p(t,e,r){let n;if(typeof e=="string"||e instanceof Mp)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Pl])i=!0,n=e[Pl]();else if(e&&e[Ol])i=!1,n=e[Ol]();else throw new Dp("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,f){Fp(a(u),()=>Nl.nextTick(f,u),c=>Nl.nextTick(f,c||u))};async function a(u){let f=u!=null,c=typeof n.throw=="function";if(f&&c){let{value:d,done:h}=await n.throw(u);if(await d,h)return}if(typeof n.return=="function"){let{value:d}=await n.return();await d}}async function l(){for(;;){try{let{value:u,done:f}=i?await n.next():n.next();if(f)s.push(null);else{let c=u&&typeof u.then=="function"?await u:u;if(c===null)throw o=!1,new Up;if(s.push(c))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ll.exports=$p});var kr=v((Hg,Zl)=>{"use strict";var le=Je(),{ArrayPrototypeIndexOf:qp,NumberIsInteger:Wp,NumberIsNaN:zp,NumberParseInt:Gp,ObjectDefineProperties:os,ObjectKeys:Hp,ObjectSetPrototypeOf:Fl,Promise:Ml,SafeSet:Vp,SymbolAsyncDispose:Kp,SymbolAsyncIterator:Qp,Symbol:Jp}=B();Zl.exports=I;I.ReadableState=Tn;var{EventEmitter:Yp}=Rr(),{Stream:Ze,prependListener:Zp}=wn(),{Buffer:Xi}=pe(),{addAbortSignal:Xp}=Ir(),Dl=Be(),A=Y().debuglog("stream",t=>{A=t}),e_=wl(),Zt=St(),{getHighWaterMark:t_,getDefaultHighWaterMark:r_}=Ar(),{aggregateTwoErrors:Bl,codes:{ERR_INVALID_ARG_TYPE:n_,ERR_METHOD_NOT_IMPLEMENTED:i_,ERR_OUT_OF_RANGE:s_,ERR_STREAM_PUSH_AFTER_EOF:o_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:a_},AbortError:l_}=Q(),{validateObject:u_}=Vt(),Rt=Jp("kPaused"),{StringDecoder:Ul}=jl(),f_=Zi();Fl(I.prototype,Ze.prototype);Fl(I,Ze);var es=()=>{},{errorOrDestroy:Jt}=Zt,Yt=1,c_=2,$l=4,vr=8,ql=16,Rn=32,In=64,Wl=128,d_=256,h_=512,p_=1024,is=2048,ss=4096,__=8192,y_=16384,b_=32768,zl=65536,m_=1<<17,g_=1<<18;function q(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}os(Tn.prototype,{objectMode:q(Yt),ended:q(c_),endEmitted:q($l),reading:q(vr),constructed:q(ql),sync:q(Rn),needReadable:q(In),emittedReadable:q(Wl),readableListening:q(d_),resumeScheduled:q(h_),errorEmitted:q(p_),emitClose:q(is),autoDestroy:q(ss),destroyed:q(__),closed:q(y_),closeEmitted:q(b_),multiAwaitDrain:q(zl),readingMore:q(m_),dataEmitted:q(g_)});function Tn(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.state=is|ss|ql|Rn,t&&t.objectMode&&(this.state|=Yt),r&&t&&t.readableObjectMode&&(this.state|=Yt),this.highWaterMark=t?t_(this,t,"readableHighWaterMark",r):r_(!1),this.buffer=new e_,this.length=0,this.pipes=[],this.flowing=null,this[Rt]=null,t&&t.emitClose===!1&&(this.state&=~is),t&&t.autoDestroy===!1&&(this.state&=~ss),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Ul(t.encoding),this.encoding=t.encoding)}function I(t){if(!(this instanceof I))return new I(t);let e=this instanceof Se();this._readableState=new Tn(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Xp(t.signal,this)),Ze.call(this,t),Zt.construct(this,()=>{this._readableState.needReadable&&An(this,this._readableState)})}I.prototype.destroy=Zt.destroy;I.prototype._undestroy=Zt.undestroy;I.prototype._destroy=function(t,e){e(t)};I.prototype[Yp.captureRejectionSymbol]=function(t){this.destroy(t)};I.prototype[Kp]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new l_,this.destroy(t)),new Ml((e,r)=>Dl(this,n=>n&&n!==t?r(n):e(null)))};I.prototype.push=function(t,e){return Gl(this,t,e,!1)};I.prototype.unshift=function(t,e){return Gl(this,t,e,!0)};function Gl(t,e,r,n){A("readableAddChunk",e);let i=t._readableState,s;if((i.state&Yt)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=Xi.from(e,r).toString(i.encoding):(e=Xi.from(e,r),r=""))):e instanceof Xi?r="":Ze._isUint8Array(e)?(e=Ze._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new n_("chunk",["string","Buffer","Uint8Array"],e))),s)Jt(t,s);else if(e===null)i.state&=~vr,S_(t,i);else if((i.state&Yt)!==0||e&&e.length>0)if(n)if((i.state&$l)!==0)Jt(t,new a_);else{if(i.destroyed||i.errored)return!1;ts(t,i,e,!0)}else if(i.ended)Jt(t,new o_);else{if(i.destroyed||i.errored)return!1;i.state&=~vr,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?ts(t,i,e,!1):An(t,i)):ts(t,i,e,!1)}else n||(i.state&=~vr,An(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function ts(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&zl)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&In)!==0&&vn(t)),An(t,e)}I.prototype.isPaused=function(){let t=this._readableState;return t[Rt]===!0||t.flowing===!1};I.prototype.setEncoding=function(t){let e=new Ul(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var w_=1073741824;function x_(t){if(t>w_)throw new s_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Cl(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Yt)!==0?1:zp(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}I.prototype.read=function(t){A("read",t),t===void 0?t=NaN:Wp(t)||(t=Gp(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=x_(t)),t!==0&&(e.state&=~Wl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return A("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?rs(this):vn(this),null;if(t=Cl(t,e),t===0&&e.ended)return e.length===0&&rs(this),null;let n=(e.state&In)!==0;if(A("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,A("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,A("reading, ended or constructing",n);else if(n){A("do read"),e.state|=vr|Rn,e.length===0&&(e.state|=In);try{this._read(e.highWaterMark)}catch(s){Jt(this,s)}e.state&=~Rn,e.reading||(t=Cl(r,e))}let i;return t>0?i=Jl(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&rs(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function S_(t,e){if(A("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?vn(t):(e.needReadable=!1,e.emittedReadable=!0,Hl(t))}}function vn(t){let e=t._readableState;A("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(A("emitReadable",e.flowing),e.emittedReadable=!0,le.nextTick(Hl,t))}function Hl(t){let e=t._readableState;A("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Kl(t)}function An(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,le.nextTick(E_,t,e))}function E_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(A("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}I.prototype._read=function(t){throw new i_("_read()")};I.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Vp(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),A("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==le.stdout&&t!==le.stderr?a:x;n.endEmitted?le.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(b,g){A("onunpipe"),b===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,f())}function a(){A("onend"),t.end()}let l,u=!1;function f(){A("cleanup"),t.removeListener("close",y),t.removeListener("finish",_),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",x),r.removeListener("data",d),u=!0,l&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function c(){u||(n.pipes.length===1&&n.pipes[0]===t?(A("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(A("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=R_(r,t),t.on("drain",l))}r.on("data",d);function d(b){A("ondata");let g=t.write(b);A("dest.write",g),g===!1&&c()}function h(b){if(A("onerror",b),x(),t.removeListener("error",h),t.listenerCount("error")===0){let g=t._writableState||t._readableState;g&&!g.errorEmitted?Jt(t,b):t.emit("error",b)}}Zp(t,"error",h);function y(){t.removeListener("finish",_),x()}t.once("close",y);function _(){A("onfinish"),t.removeListener("close",y),x()}t.once("finish",_);function x(){A("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():n.flowing||(A("pipe resume"),r.resume()),t};function R_(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(A("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(A("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}I.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s<i.length;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=qp(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};I.prototype.on=function(t,e){let r=Ze.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,A("on readable",n.length,n.reading),n.length?vn(this):n.reading||le.nextTick(I_,this)),r};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(t,e){let r=Ze.prototype.removeListener.call(this,t,e);return t==="readable"&&le.nextTick(Vl,this),r};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(t){let e=Ze.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&le.nextTick(Vl,this),e};function Vl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Rt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function I_(t){A("readable nexttick read 0"),t.read(0)}I.prototype.resume=function(){let t=this._readableState;return t.flowing||(A("resume"),t.flowing=!t.readableListening,A_(this,t)),t[Rt]=!1,this};function A_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,le.nextTick(T_,t,e))}function T_(t,e){A("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Kl(t),e.flowing&&!e.reading&&t.read(0)}I.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Rt]=!0,this};function Kl(t){let e=t._readableState;for(A("flow",e.flowing);e.flowing&&t.read()!==null;);}I.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Jt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Hp(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};I.prototype[Qp]=function(){return Ql(this)};I.prototype.iterator=function(t){return t!==void 0&&u_(t,"options"),Ql(this,t)};function Ql(t,e){typeof t.read!="function"&&(t=I.wrap(t,{objectMode:!0}));let r=v_(t,e);return r.stream=t,r}async function*v_(t,e){let r=es;function n(o){this===t?(r(),r=es):r=o}t.on("readable",n);let i,s=Dl(t,{writable:!1},o=>{i=o?Bl(i,o):null,r(),r=es});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new Ml(n)}}}catch(o){throw i=Bl(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Zt.destroyer(t,null):(t.off("readable",n),s())}}os(I.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});os(Tn.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Rt]!==!1},set(t){this[Rt]=!!t}}});I._fromList=Jl;function Jl(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function rs(t){let e=t._readableState;A("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,le.nextTick(k_,e,t))}function k_(t,e){if(A("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)le.nextTick(j_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function j_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}I.from=function(t,e){return f_(I,t,e)};var ns;function Yl(){return ns===void 0&&(ns={}),ns}I.fromWeb=function(t,e){return Yl().newStreamReadableFromReadableStream(t,e)};I.toWeb=function(t,e){return Yl().newReadableStreamFromStreamReadable(t,e)};I.wrap=function(t,e){var r,n;return new I({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){Zt.destroyer(t,i),s(i)}}).wrap(t)}});var On=v((Vg,fu)=>{"use strict";var It=Je(),{ArrayPrototypeSlice:tu,Error:N_,FunctionPrototypeSymbolHasInstance:ru,ObjectDefineProperty:nu,ObjectDefineProperties:P_,ObjectSetPrototypeOf:iu,StringPrototypeToLowerCase:O_,Symbol:L_,SymbolHasInstance:B_}=B();fu.exports=C;C.WritableState=Pr;var{EventEmitter:C_}=Rr(),jr=wn().Stream,{Buffer:kn}=pe(),Pn=St(),{addAbortSignal:F_}=Ir(),{getHighWaterMark:M_,getDefaultHighWaterMark:D_}=Ar(),{ERR_INVALID_ARG_TYPE:U_,ERR_METHOD_NOT_IMPLEMENTED:$_,ERR_MULTIPLE_CALLBACK:su,ERR_STREAM_CANNOT_PIPE:q_,ERR_STREAM_DESTROYED:Nr,ERR_STREAM_ALREADY_FINISHED:W_,ERR_STREAM_NULL_VALUES:z_,ERR_STREAM_WRITE_AFTER_END:G_,ERR_UNKNOWN_ENCODING:ou}=Q().codes,{errorOrDestroy:Xt}=Pn;iu(C.prototype,jr.prototype);iu(C,jr);function us(){}var er=L_("kOnFinished");function Pr(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?M_(this,t,"writableHighWaterMark",r):D_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=V_.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Nn(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[er]=[]}function Nn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Pr.prototype.getBuffer=function(){return tu(this.buffered,this.bufferedIndex)};nu(Pr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function C(t){let e=this instanceof Se();if(!e&&!ru(C,this))return new C(t);this._writableState=new Pr(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&F_(t.signal,this)),jr.call(this,t),Pn.construct(this,()=>{let r=this._writableState;r.writing||cs(this,r),ds(this,r)})}nu(C,B_,{__proto__:null,value:function(t){return ru(this,t)?!0:this!==C?!1:t&&t._writableState instanceof Pr}});C.prototype.pipe=function(){Xt(this,new q_)};function au(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!kn.isEncoding(r))throw new ou(r);typeof n!="function"&&(n=us)}if(e===null)throw new z_;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=kn.from(e,r),r="buffer");else if(e instanceof kn)r="buffer";else if(jr._isUint8Array(e))e=jr._uint8ArrayToBuffer(e),r="buffer";else throw new U_("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new G_:i.destroyed&&(s=new Nr("write")),s?(It.nextTick(n,s),Xt(t,s,!0),s):(i.pendingcb++,H_(t,i,e,r,n))}C.prototype.write=function(t,e,r){return au(this,t,e,r)===!0};C.prototype.cork=function(){this._writableState.corked++};C.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||cs(this,t))};C.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=O_(e)),!kn.isEncoding(e))throw new ou(e);return this._writableState.defaultEncoding=e,this};function H_(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==us&&(e.allNoop=!1)):(e.writelen=s,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function Xl(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Nr("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function eu(t,e,r,n){--e.pendingcb,n(r),fs(e),Xt(t,r)}function V_(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Xt(t,new su);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?It.nextTick(eu,t,r,e,i):eu(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&cs(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},It.nextTick(K_,r.afterWriteTickInfo)):lu(t,r,1,i))}function K_({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,lu(t,e,r,n)}function lu(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&fs(e),ds(t,e)}function fs(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:s,callback:o}=t.buffered[i],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new Nr("write"))}let r=t[er].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new Nr("end"))}Nn(t)}function cs(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,s=r.length-n;if(!s)return;let o=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?us:u=>{for(let f=o;f<r.length;++f)r[f].callback(u)},l=e.allNoop&&o===0?r:tu(r,o);l.allBuffers=e.allBuffers,Xl(t,e,!0,e.length,l,"",a),Nn(e)}else{do{let{chunk:a,encoding:l,callback:u}=r[o];r[o++]=null;let f=i?1:a.length;Xl(t,e,!1,f,a,l,u)}while(o<r.length&&!e.writing);o===r.length?Nn(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}C.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new $_("_write()")};C.prototype._writev=null;C.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=au(this,t,e);s instanceof N_&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,ds(this,n,!0),n.ended=!0):n.finished?i=new W_("end"):n.destroyed&&(i=new Nr("end"))),typeof r=="function"&&(i||n.finished?It.nextTick(r,i):n[er].push(r)),this};function jn(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Q_(t,e){let r=!1;function n(i){if(r){Xt(t,i??su());return}if(r=!0,e.pendingcb--,i){let s=e[er].splice(0);for(let o=0;o<s.length;o++)s[o](i);Xt(t,i,e.sync)}else jn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,It.nextTick(ls,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function J_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Q_(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function ds(t,e,r){jn(e)&&(J_(t,e),e.pendingcb===0&&(r?(e.pendingcb++,It.nextTick((n,i)=>{jn(i)?ls(n,i):i.pendingcb--},t,e)):jn(e)&&(e.pendingcb++,ls(t,e))))}function ls(t,e){e.pendingcb--,e.finished=!0;let r=e[er].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}P_(C.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Y_=Pn.destroy;C.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[er].length)&&It.nextTick(fs,r),Y_.call(this,t,e),this};C.prototype._undestroy=Pn.undestroy;C.prototype._destroy=function(t,e){e(t)};C.prototype[C_.captureRejectionSymbol]=function(t){this.destroy(t)};var as;function uu(){return as===void 0&&(as={}),as}C.fromWeb=function(t,e){return uu().newStreamWritableFromWritableStream(t,e)};C.toWeb=function(t){return uu().newWritableStreamFromStreamWritable(t)}});var Iu=v((Kg,Ru)=>{var hs=Je(),Z_=pe(),{isReadable:X_,isWritable:ey,isIterable:cu,isNodeStream:ty,isReadableNodeStream:du,isWritableNodeStream:hu,isDuplexNodeStream:ry,isReadableStream:pu,isWritableStream:_u}=ge(),yu=Be(),{AbortError:Su,codes:{ERR_INVALID_ARG_TYPE:ny,ERR_INVALID_RETURN_VALUE:bu}}=Q(),{destroyer:rr}=St(),iy=Se(),Eu=kr(),sy=On(),{createDeferredPromise:mu}=Y(),gu=Zi(),wu=globalThis.Blob||Z_.Blob,oy=typeof wu<"u"?function(e){return e instanceof wu}:function(e){return!1},ay=globalThis.AbortController||zt().AbortController,{FunctionPrototypeCall:xu}=B(),Xe=class extends iy{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ru.exports=function t(e,r){if(ry(e))return e;if(du(e))return tr({readable:e});if(hu(e))return tr({writable:e});if(ty(e))return tr({writable:!1,readable:!1});if(pu(e))return tr({readable:Eu.fromWeb(e)});if(_u(e))return tr({writable:sy.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=ly(e);if(cu(i))return gu(Xe,i,{objectMode:!0,write:s,final:o,destroy:a});let l=i?.then;if(typeof l=="function"){let u,f=xu(l,i,c=>{if(c!=null)throw new bu("nully","body",c)},c=>{rr(u,c)});return u=new Xe({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,hs.nextTick(c,null)}catch(d){hs.nextTick(c,d)}})},destroy:a})}throw new bu("Iterable, AsyncIterable or AsyncFunction",r,i)}if(oy(e))return t(e.arrayBuffer());if(cu(e))return gu(Xe,e,{objectMode:!0,writable:!1});if(pu(e?.readable)&&_u(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?du(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?hu(e?.writable)?e?.writable:t(e.writable):void 0;return tr({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return xu(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{rr(i,s)}),i=new Xe({objectMode:!0,writable:!1,read(){}})}throw new ny(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function ly(t){let{promise:e,resolve:r}=mu(),n=new ay,i=n.signal;return{value:t((async function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=await o;if(hs.nextTick(u),l)return;if(i.aborted)throw new Su(void 0,{cause:i.reason});({promise:e,resolve:r}=mu()),yield a}})(),{signal:i}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){n.abort(),a(o)}}}function tr(t){let e=t.readable&&typeof t.readable.read!="function"?Eu.wrap(t.readable):t.readable,r=t.writable,n=!!X_(e),i=!!ey(r),s,o,a,l,u;function f(c){let d=l;l=null,d?d(c):c&&u.destroy(c)}return u=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(yu(r,c=>{i=!1,c&&rr(e,c),f(c)}),u._write=function(c,d,h){r.write(c,d)?h():s=h},u._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),n&&(yu(e,c=>{n=!1,c&&rr(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let c=e.read();if(c===null){a=u._read;return}if(!u.push(c))return}}),u._destroy=function(c,d){!c&&l!==null&&(c=new Su),a=null,s=null,o=null,l===null?d(c):(l=d,rr(r,c),rr(e,c))},u}});var Se=v((Qg,vu)=>{"use strict";var{ObjectDefineProperties:uy,ObjectGetOwnPropertyDescriptor:Ce,ObjectKeys:fy,ObjectSetPrototypeOf:Au}=B();vu.exports=ue;var ys=kr(),se=On();Au(ue.prototype,ys.prototype);Au(ue,ys);{let t=fy(se.prototype);for(let e=0;e<t.length;e++){let r=t[e];ue.prototype[r]||(ue.prototype[r]=se.prototype[r])}}function ue(t){if(!(this instanceof ue))return new ue(t);ys.call(this,t),se.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}uy(ue.prototype,{writable:{__proto__:null,...Ce(se.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ce(se.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ce(se.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ce(se.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ce(se.prototype,"writableLength")},writableFinished:{__proto__:null,...Ce(se.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ce(se.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ce(se.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ce(se.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var ps;function Tu(){return ps===void 0&&(ps={}),ps}ue.fromWeb=function(t,e){return Tu().newStreamDuplexFromReadableWritablePair(t,e)};ue.toWeb=function(t){return Tu().newReadableWritablePairFromDuplex(t)};var _s;ue.from=function(t){return _s||(_s=Iu()),_s(t,"body")}});var gs=v((Jg,ju)=>{"use strict";var{ObjectSetPrototypeOf:ku,Symbol:cy}=B();ju.exports=Fe;var{ERR_METHOD_NOT_IMPLEMENTED:dy}=Q().codes,ms=Se(),{getHighWaterMark:hy}=Ar();ku(Fe.prototype,ms.prototype);ku(Fe,ms);var Or=cy("kCallback");function Fe(t){if(!(this instanceof Fe))return new Fe(t);let e=t?hy(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ms.call(this,t),this._readableState.sync=!1,this[Or]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",py)}function bs(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function py(){this._final!==bs&&bs.call(this)}Fe.prototype._final=bs;Fe.prototype._transform=function(t,e,r){throw new dy("_transform()")};Fe.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),i.ended||s===n.length||n.length<n.highWaterMark?r():this[Or]=r})};Fe.prototype._read=function(){if(this[Or]){let t=this[Or];this[Or]=null,t()}}});var xs=v((Yg,Pu)=>{"use strict";var{ObjectSetPrototypeOf:Nu}=B();Pu.exports=nr;var ws=gs();Nu(nr.prototype,ws.prototype);Nu(nr,ws);function nr(t){if(!(this instanceof nr))return new nr(t);ws.call(this,t)}nr.prototype._transform=function(t,e,r){r(null,t)}});var Fn=v((Zg,Fu)=>{var Lr=Je(),{ArrayIsArray:_y,Promise:yy,SymbolAsyncIterator:by,SymbolDispose:my}=B(),Cn=Be(),{once:gy}=Y(),wy=St(),Ou=Se(),{aggregateTwoErrors:xy,codes:{ERR_INVALID_ARG_TYPE:js,ERR_INVALID_RETURN_VALUE:Ss,ERR_MISSING_ARGS:Sy,ERR_STREAM_DESTROYED:Ey,ERR_STREAM_PREMATURE_CLOSE:Ry},AbortError:Iy}=Q(),{validateFunction:Ay,validateAbortSignal:Ty}=Vt(),{isIterable:At,isReadable:Es,isReadableNodeStream:Bn,isNodeStream:Lu,isTransformStream:ir,isWebStream:vy,isReadableStream:Rs,isReadableFinished:ky}=ge(),jy=globalThis.AbortController||zt().AbortController,Is,As,Ts;function Bu(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Cn(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,wy.destroyer(t,s||new Ey("pipe")))},cleanup:i}}function Ny(t){return Ay(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function vs(t){if(At(t))return t;if(Bn(t))return Py(t);throw new js("val",["Readable","Iterable","AsyncIterable"],t)}async function*Py(t){As||(As=kr()),yield*As.prototype[by].call(t)}async function Ln(t,e,r,{end:n}){let i,s=null,o=u=>{if(u&&(i=u),s){let f=s;s=null,f()}},a=()=>new yy((u,f)=>{i?f(i):s=()=>{i?f(i):u()}});e.on("drain",o);let l=Cn(e,{readable:!1},o);try{e.writableNeedDrain&&await a();for await(let u of t)e.write(u)||await a();n&&(e.end(),await a()),r()}catch(u){r(i!==u?xy(i,u):u)}finally{l(),e.off("drain",o)}}async function ks(t,e,r,{end:n}){ir(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function Oy(...t){return Cu(t,gy(Ny(t)))}function Cu(t,e,r){if(t.length===1&&_y(t[0])&&(t=t[0]),t.length<2)throw new Sy("streams");let n=new jy,i=n.signal,s=r?.signal,o=[];Ty(s,"options.signal");function a(){y(new Iy)}Ts=Ts||Y().addAbortListener;let l;s&&(l=Ts(s,a));let u,f,c=[],d=0;function h(S){y(S,--d===0)}function y(S,w){var T;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!w)){for(;c.length;)c.shift()(u);(T=l)===null||T===void 0||T[my](),n.abort(),w&&(u||o.forEach(Ae=>Ae()),Lr.nextTick(e,u,f))}}let _;for(let S=0;S<t.length;S++){let w=t[S],T=S<t.length-1,Ae=S>0,U=T||r?.end!==!1,jt=S===t.length-1;if(Lu(w)){let Z=function(Te){Te&&Te.name!=="AbortError"&&Te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(Te)};var g=Z;if(U){let{destroy:Te,cleanup:Kn}=Bu(w,T,Ae);c.push(Te),Es(w)&&jt&&o.push(Kn)}w.on("error",Z),Es(w)&&jt&&o.push(()=>{w.removeListener("error",Z)})}if(S===0)if(typeof w=="function"){if(_=w({signal:i}),!At(_))throw new Ss("Iterable, AsyncIterable or Stream","source",_)}else At(w)||Bn(w)||ir(w)?_=w:_=Ou.from(w);else if(typeof w=="function"){if(ir(_)){var x;_=vs((x=_)===null||x===void 0?void 0:x.readable)}else _=vs(_);if(_=w(_,{signal:i}),T){if(!At(_,!0))throw new Ss("AsyncIterable",`transform[${S-1}]`,_)}else{var b;Is||(Is=xs());let Z=new Is({objectMode:!0}),Te=(b=_)===null||b===void 0?void 0:b.then;if(typeof Te=="function")d++,Te.call(_,Ue=>{f=Ue,Ue!=null&&Z.write(Ue),U&&Z.end(),Lr.nextTick(h)},Ue=>{Z.destroy(Ue),Lr.nextTick(h,Ue)});else if(At(_,!0))d++,Ln(_,Z,h,{end:U});else if(Rs(_)||ir(_)){let Ue=_.readable||_;d++,Ln(Ue,Z,h,{end:U})}else throw new Ss("AsyncIterable or Promise","destination",_);_=Z;let{destroy:Kn,cleanup:Rf}=Bu(_,!1,!0);c.push(Kn),jt&&o.push(Rf)}}else if(Lu(w)){if(Bn(_)){d+=2;let Z=Ly(_,w,h,{end:U});Es(w)&&jt&&o.push(Z)}else if(ir(_)||Rs(_)){let Z=_.readable||_;d++,Ln(Z,w,h,{end:U})}else if(At(_))d++,Ln(_,w,h,{end:U});else throw new js("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else if(vy(w)){if(Bn(_))d++,ks(vs(_),w,h,{end:U});else if(Rs(_)||At(_))d++,ks(_,w,h,{end:U});else if(ir(_))d++,ks(_.readable,w,h,{end:U});else throw new js("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else _=Ou.from(w)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&Lr.nextTick(a),_}function Ly(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Ry)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;ky(t)?Lr.nextTick(o):t.once("end",o)}else r();return Cn(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Cn(e,{readable:!1,writable:!0},r)}Fu.exports={pipelineImpl:Cu,pipeline:Oy}});var Ps=v((Xg,Wu)=>{"use strict";var{pipeline:By}=Fn(),Mn=Se(),{destroyer:Cy}=St(),{isNodeStream:Dn,isReadable:Mu,isWritable:Du,isWebStream:Ns,isTransformStream:Tt,isWritableStream:Uu,isReadableStream:$u}=ge(),{AbortError:Fy,codes:{ERR_INVALID_ARG_VALUE:qu,ERR_MISSING_ARGS:My}}=Q(),Dy=Be();Wu.exports=function(...e){if(e.length===0)throw new My("streams");if(e.length===1)return Mn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Mn.from(e[0])),typeof e[e.length-1]=="function"){let h=e.length-1;e[h]=Mn.from(e[h])}for(let h=0;h<e.length;++h)if(!(!Dn(e[h])&&!Ns(e[h]))){if(h<e.length-1&&!(Mu(e[h])||$u(e[h])||Tt(e[h])))throw new qu(`streams[${h}]`,r[h],"must be readable");if(h>0&&!(Du(e[h])||Uu(e[h])||Tt(e[h])))throw new qu(`streams[${h}]`,r[h],"must be writable")}let n,i,s,o,a;function l(h){let y=o;o=null,y?y(h):h?a.destroy(h):!d&&!c&&a.destroy()}let u=e[0],f=By(e,l),c=!!(Du(u)||Uu(u)||Tt(u)),d=!!(Mu(f)||$u(f)||Tt(f));if(a=new Mn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:d}),c){if(Dn(u))a._write=function(y,_,x){u.write(y,_)?x():n=x},a._final=function(y){u.end(),i=y},u.on("drain",function(){if(n){let y=n;n=null,y()}});else if(Ns(u)){let _=(Tt(u)?u.writable:u).getWriter();a._write=async function(x,b,g){try{await _.ready,_.write(x).catch(()=>{}),g()}catch(S){g(S)}},a._final=async function(x){try{await _.ready,_.close().catch(()=>{}),i=x}catch(b){x(b)}}}let h=Tt(f)?f.readable:f;Dy(h,()=>{if(i){let y=i;i=null,y()}})}if(d){if(Dn(f))f.on("readable",function(){if(s){let h=s;s=null,h()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let h=f.read();if(h===null){s=a._read;return}if(!a.push(h))return}};else if(Ns(f)){let y=(Tt(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:_,done:x}=await y.read();if(!a.push(_))return;if(x){a.push(null);return}}catch{return}}}}return a._destroy=function(h,y){!h&&o!==null&&(h=new Fy),s=null,n=null,i=null,o===null?y(h):(o=y,Dn(f)&&Cy(f,h))},a}});var Xu=v((ew,Bs)=>{"use strict";var Uy=globalThis.AbortController||zt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:$y,ERR_INVALID_ARG_TYPE:Br,ERR_MISSING_ARGS:qy,ERR_OUT_OF_RANGE:Wy},AbortError:Ee}=Q(),{validateAbortSignal:vt,validateInteger:zu,validateObject:kt}=Vt(),zy=B().Symbol("kWeak"),Gy=B().Symbol("kResistStopPropagation"),{finished:Hy}=Be(),Vy=Ps(),{addAbortSignalNoValidate:Ky}=Ir(),{isWritable:Qy,isNodeStream:Jy}=ge(),{deprecate:Yy}=Y(),{ArrayPrototypePush:Zy,Boolean:Xy,MathFloor:Gu,Number:eb,NumberIsNaN:tb,Promise:Hu,PromiseReject:Vu,PromiseResolve:rb,PromisePrototypeThen:Ku,Symbol:Ju}=B(),Un=Ju("kEmpty"),Qu=Ju("kEof");function nb(t,e){if(e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),Jy(t)&&!Qy(t))throw new $y("stream",t,"must be writable");let r=Vy(this,t);return e!=null&&e.signal&&Ky(e.signal,r),r}function $n(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Gu(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Gu(e.highWaterMark)),zu(r,"options.concurrency",1),zu(n,"options.highWaterMark",0),n+=r,async function*(){let s=Y().AbortSignalAny([e?.signal].filter(Xy)),o=this,a=[],l={signal:s},u,f,c=!1,d=0;function h(){c=!0,y()}function y(){d-=1,_()}function _(){f&&!c&&d<r&&a.length<n&&(f(),f=null)}async function x(){try{for await(let b of o){if(c)return;if(s.aborted)throw new Ee;try{if(b=t(b,l),b===Un)continue;b=rb(b)}catch(g){b=Vu(g)}d+=1,Ku(b,y,h),a.push(b),u&&(u(),u=null),!c&&(a.length>=n||d>=r)&&await new Hu(g=>{f=g})}a.push(Qu)}catch(b){let g=Vu(b);Ku(g,y,h),a.push(g)}finally{c=!0,u&&(u(),u=null)}}x();try{for(;;){for(;a.length>0;){let b=await a[0];if(b===Qu)return;if(s.aborted)throw new Ee;b!==Un&&(yield b),a.shift(),_()}await new Hu(b=>{u=b})}}finally{c=!0,f&&(f(),f=null)}}.call(this)}function ib(t=void 0){return t!=null&&kt(t,"options"),t?.signal!=null&&vt(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ee({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function Yu(t,e=void 0){for await(let r of Ls.call(this,t,e))return!0;return!1}async function sb(t,e=void 0){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);return!await Yu.call(this,async(...r)=>!await t(...r),e)}async function ob(t,e){for await(let r of Ls.call(this,t,e))return r}async function ab(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Un}for await(let n of $n.call(this,r,e));}function Ls(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Un}return $n.call(this,r,e)}var Os=class extends qy{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function lb(t,e,r){var n;if(typeof t!="function")throw new Br("reducer",["Function","AsyncFunction"],t);r!=null&&kt(r,"options"),r?.signal!=null&&vt(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new Ee(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Hy(this.destroy(u)),u}let s=new Uy,o=s.signal;if(r!=null&&r.signal){let u={once:!0,[zy]:this,[Gy]:!0};r.signal.addEventListener("abort",()=>s.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new Ee;i?e=await t(e,u,{signal:o}):(e=u,i=!0)}if(!a&&!i)throw new Os}finally{s.abort()}return e}async function ub(t){t!=null&&kt(t,"options"),t?.signal!=null&&vt(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Ee(void 0,{cause:t.signal.reason});Zy(e,n)}return e}function fb(t,e){let r=$n.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function Zu(t){if(t=eb(t),tb(t))return 0;if(t<0)throw new Wy("number",">= 0",t);return t}function cb(t,e=void 0){return e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ee;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ee;t--<=0&&(yield s)}}.call(this)}function db(t,e=void 0){return e!=null&&kt(e,"options"),e?.signal!=null&&vt(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ee;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ee;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Bs.exports.streamReturningOperators={asIndexedPairs:Yy(ib,"readable.asIndexedPairs will be removed in a future version."),drop:cb,filter:Ls,flatMap:fb,map:$n,take:db,compose:nb};Bs.exports.promiseReturningOperators={every:sb,forEach:ab,reduce:lb,toArray:ub,some:Yu,find:ob}});var Cs=v((tw,ef)=>{"use strict";var{ArrayPrototypePop:hb,Promise:pb}=B(),{isIterable:_b,isNodeStream:yb,isWebStream:bb}=ge(),{pipelineImpl:mb}=Fn(),{finished:gb}=Be();Fs();function wb(...t){return new pb((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!yb(s)&&!_b(s)&&!bb(s)){let o=hb(t);n=o.signal,i=o.end}mb(t,(o,a)=>{o?r(o):e(a)},{signal:n,end:i})})}ef.exports={finished:gb,pipeline:wb}});var Fs=v((rw,ff)=>{"use strict";var{Buffer:xb}=pe(),{ObjectDefineProperty:Me,ObjectKeys:nf,ReflectApply:sf}=B(),{promisify:{custom:of}}=Y(),{streamReturningOperators:tf,promiseReturningOperators:rf}=Xu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:af}}=Q(),Sb=Ps(),{setDefaultHighWaterMark:Eb,getDefaultHighWaterMark:Rb}=Ar(),{pipeline:lf}=Fn(),{destroyer:Ib}=St(),uf=Be(),Ms=Cs(),Cr=ge(),L=ff.exports=wn().Stream;L.isDestroyed=Cr.isDestroyed;L.isDisturbed=Cr.isDisturbed;L.isErrored=Cr.isErrored;L.isReadable=Cr.isReadable;L.isWritable=Cr.isWritable;L.Readable=kr();for(let t of nf(tf)){let r=function(...n){if(new.target)throw af();return L.Readable.from(sf(e,this,n))},e=tf[t];Me(r,"name",{__proto__:null,value:e.name}),Me(r,"length",{__proto__:null,value:e.length}),Me(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of nf(rf)){let r=function(...n){if(new.target)throw af();return sf(e,this,n)},e=rf[t];Me(r,"name",{__proto__:null,value:e.name}),Me(r,"length",{__proto__:null,value:e.length}),Me(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}L.Writable=On();L.Duplex=Se();L.Transform=gs();L.PassThrough=xs();L.pipeline=lf;var{addAbortSignal:Ab}=Ir();L.addAbortSignal=Ab;L.finished=uf;L.destroy=Ib;L.compose=Sb;L.setDefaultHighWaterMark=Eb;L.getDefaultHighWaterMark=Rb;Me(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ms}});Me(lf,of,{__proto__:null,enumerable:!0,get(){return Ms.pipeline}});Me(uf,of,{__proto__:null,enumerable:!0,get(){return Ms.finished}});L.Stream=L;L._isUint8Array=function(e){return e instanceof Uint8Array};L._uint8ArrayToBuffer=function(e){return xb.from(e.buffer,e.byteOffset,e.byteLength)}});var qn=v((nw,M)=>{"use strict";var W=Fs(),Tb=Cs(),vb=W.Readable.destroy;M.exports=W.Readable;M.exports._uint8ArrayToBuffer=W._uint8ArrayToBuffer;M.exports._isUint8Array=W._isUint8Array;M.exports.isDisturbed=W.isDisturbed;M.exports.isErrored=W.isErrored;M.exports.isReadable=W.isReadable;M.exports.Readable=W.Readable;M.exports.Writable=W.Writable;M.exports.Duplex=W.Duplex;M.exports.Transform=W.Transform;M.exports.PassThrough=W.PassThrough;M.exports.addAbortSignal=W.addAbortSignal;M.exports.finished=W.finished;M.exports.destroy=W.destroy;M.exports.destroy=vb;M.exports.pipeline=W.pipeline;M.exports.compose=W.compose;Object.defineProperty(W,"promises",{configurable:!0,enumerable:!0,get(){return Tb}});M.exports.Stream=W.Stream;M.exports.default=M.exports});var E=class t{#e;constructor(e){this.#e=t.collapse(e)}get value(){return this.#e}toString(){return this.#e}get length(){return this.#e.length}static collapse(e,r=""){if(e instanceof t)return e.value;if(typeof e!="string")throw new TypeError("path argument must be a string or an instance of Path");if(r&&!(r instanceof t)&&(r=new t(r)),e=e.trim(),e.length===0)return r.value;t.isRelative(e)&&(e=r+e);let n=t.reduce(e,(s,o)=>(o==".."?s.pop():o!=="."&&s.push(o),s),[]),i="/";return n.length&&(i+=n.join("/"),t.isFolder(e)&&(i+="/")),""+i}static isAbsolute(e){return e instanceof t?!0:e.length&&e[0]==="/"}static isRelative(e){return!t.isAbsolute(e)}static isFolder(e){return e instanceof t&&(e=e.value),e.length&&e[e.length-1]=="/"}static isPath(e){return e instanceof t?!0:typeof e!="string"?!1:(e=e.trim(),new URL(e,document.location).pathname==e)}static reduce(e,r,n){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).reduce(r,n)}static map(e,r){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).map(r)}static parent(e){e instanceof t&&(e=e.value),e=e.split("/").filter(Boolean),e.pop();let r="/";return e.length&&(r+=e.join("/")+"/"),r}static filename(e){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).pop()}static head(e){return e instanceof t&&(e=e.value),e.split("/").filter(Boolean).shift()}static tail(e){e instanceof t&&(e=e.value),e=e.split("/").filter(Boolean),e.shift();let r="/";return e.length&&(r+=e.join("/")+"/"),r}};var ar=class t{#e;#t="/";constructor(e){this.#e=e,this.#t=this.#e.path}get path(){return this.#t}cd(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),new t(this.#e.cd(e))}async read(e,r=null){if(e instanceof E||(e=new E(E.collapse(e,this.#t))),typeof r=="function"){if(!this.#e.supportsStreamingRead())throw new Error("Adapter "+this.#e.name+" does not support streaming reading.");return this.#e.readStream(e,r)}else return this.#e.read(e)}async write(e,r,n=null){if(e instanceof E||(e=new E(E.collapse(e,this.#t))),!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(typeof r=="function"){if(!this.#e.supportsStreamingWrite())throw new Error("Adapter "+this.#e.name+" does not support streaming writing.");return this.#e.writeStream(e,r,n)}else{if(typeof r=="string")return this.#e.write(e,r,n);throw new TypeError("Cannot write contents of type "+typeof r)}}async remove(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.remove(e)}async exists(e){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.exists(e)}async list(e=""){return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.list(e)}async mkdir(e=""){if(!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(!this.#e.supportsDirectories)throw new Error("Adapter "+this.#e.name+" does not support directories.");return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.mkdir(e)}async rmdir(e=""){if(!this.#e.supportsWrite())throw new Error("Adapter "+this.#e.name+" is read only.");if(!this.#e.supportsDirectories)throw new Error("Adapter "+this.#e.name+" does not support directories.");return e instanceof E||(e=new E(E.collapse(e,this.#t))),this.#e.rmdir(e)}};var Pt={};nt(Pt,{Client:()=>oe,client:()=>re,deepClone:()=>$e,formdata:()=>Ks,metroError:()=>V,request:()=>st,response:()=>Nt,trace:()=>Pf,url:()=>z});var it="https://metro.muze.nl/details/";Symbol.metroProxy||(Symbol.metroProxy=Symbol("isProxy"));Symbol.metroSource||(Symbol.metroSource=Symbol("source"));var oe=class t{clientOptions={url:z(typeof window<"u"?window.location:"https://localhost"),verbs:["get","post","put","delete","patch","head","options","query"]};static tracers={};constructor(...e){for(let r of e)if(typeof r=="string"||r instanceof String)this.clientOptions.url=z(this.clientOptions.url.href,r);else if(r instanceof t)Object.assign(this.clientOptions,r.clientOptions);else if(r instanceof Function)this.#e([r]);else if(r&&typeof r=="object")for(let n in r)n=="middlewares"?this.#e(r[n]):n=="url"?this.clientOptions.url=z(this.clientOptions.url.href,r[n]):typeof r[n]=="function"?this.clientOptions[n]=r[n](this.clientOptions[n],this.clientOptions):this.clientOptions[n]=r[n];for(let r of this.clientOptions.verbs)this[r]=async function(...n){return this.fetch(st(this.clientOptions,...n,{method:r.toUpperCase()}))}}#e(e){typeof e=="function"&&(e=[e]);let r=e.findIndex(n=>typeof n!="function");if(r>=0)throw V("metro.client: middlewares must be a function or an array of functions "+it+"client/invalid-middlewares/",e[r]);Array.isArray(this.clientOptions.middlewares)||(this.clientOptions.middlewares=[]),this.clientOptions.middlewares=this.clientOptions.middlewares.concat(e)}fetch(e,r){if(e=st(e,r),!e.url)throw V("metro.client."+e.method.toLowerCase()+": Missing url parameter "+it+"client/fetch-missing-url/",e);if(r||(r={}),typeof r!="object"||r instanceof String)throw V("metro.client.fetch: Invalid options parameter "+it+"client/fetch-invalid-options/",r);let i=[async function(a){a[Symbol.metroProxy]&&(a=a[Symbol.metroSource]);let l=await fetch(a);return Nt(l)}].concat(this.clientOptions?.middlewares?.slice()||[]);r=Object.assign({},this.clientOptions,r);let s;for(let o of i)s=(function(a,l){return async function(u){let f,c=Object.values(t.tracers);for(let d of c)d.request&&d.request.call(d,u,l);f=await l(u,a);for(let d of c)d.response&&d.response.call(d,f,l);return f}})(s,o);return s(e)}with(...e){return new t($e(this.clientOptions),...e)}get location(){return this.clientOptions.url}};function re(...t){return new oe(...$e(t))}function Nf(t,e){let r=e||{};!r.url&&e.url&&(r.url=e.url);for(let n of["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","priority","url"]){let i=t[n];if(!(typeof i>"u"||i==null))if(i?.[Symbol.metroProxy]&&(i=i[Symbol.metroSource]),typeof i=="function")r[n]=i(r[n],r);else if(n=="url")r.url=z(r.url,i);else if(n=="headers"){r.headers=new Headers(e.headers),i instanceof Headers||(i=new Headers(t.headers));for(let[s,o]of i.entries())r.headers.set(s,o)}else r[n]=i}return t instanceof Request&&t.data&&(r.body=t.data),r}function st(...t){let e={url:z(typeof window<"u"?window.location:"https://localhost/"),duplex:"half"};for(let i of t)typeof i=="string"||i instanceof URL||i instanceof URLSearchParams?e.url=z(e.url,i):i&&(i instanceof FormData||i instanceof ReadableStream||i instanceof Blob||i instanceof ArrayBuffer||i instanceof DataView)?e.body=i:i&&typeof i=="object"&&Object.assign(e,Nf(i,e));let r=new Request(e.url,e),n=e.body;return n&&typeof n=="object"&&!(n instanceof String)&&!(n instanceof ReadableStream)&&!(n instanceof Blob)&&!(n instanceof ArrayBuffer)&&!(n instanceof DataView)&&!(n instanceof FormData)&&!(n instanceof URLSearchParams)&&(typeof globalThis.TypedArray>"u"||!(n instanceof globalThis.TypedArray))&&typeof n.toString=="function"&&(e.body=n.toString({headers:r.headers}),r=new Request(e.url,e)),Object.freeze(r),new Proxy(r,{get(i,s){let o;switch(s){case Symbol.metroSource:o=i;break;case Symbol.metroProxy:o=!0;break;case"with":o=function(...a){return n&&a.unshift({body:n}),st(i,...a)};break;case"data":o=n;break;default:i[s]instanceof Function?o=i[s].bind(i):o=i[s];break}return o}})}function Hs(t,e){let r=e||{};!r.url&&e.url&&(r.url=e.url);for(let n of["status","statusText","headers","body","url","type","redirected"]){let i=t[n];typeof i>"u"||i==null||(i?.[Symbol.metroProxy]&&(i=i[Symbol.metroSource]),typeof i=="function"?r[n]=i(r[n],r):n=="url"?r.url=new URL(i,r.url||"https://localhost/"):r[n]=i)}return t instanceof Response&&t.data&&(r.body=t.data),r}function Nt(...t){let e={};for(let i of t)typeof i=="string"?e.body=i:i instanceof Response?Object.assign(e,Hs(i,e)):i&&typeof i=="object"&&(i instanceof FormData||i instanceof Blob||i instanceof ArrayBuffer||i instanceof DataView||i instanceof ReadableStream||i instanceof URLSearchParams||i instanceof String||typeof globalThis.TypedArray<"u"&&i instanceof globalThis.TypedArray?e.body=i:Object.assign(e,Hs(i,e)));let r;e.body&&(r=e.body),[101,204,205,304].includes(e.status)&&(e.body=null);let n=new Response(e.body,e);return Object.freeze(n),new Proxy(n,{get(i,s){let o;switch(s){case Symbol.metroProxy:o=!0;break;case Symbol.metroSource:o=i;break;case"with":o=function(...a){return Nt(i,...a)};break;case"data":o=r;break;case"ok":o=i.status>=200&&i.status<400;break;default:typeof i[s]=="function"?o=i[s].bind(i):o=i[s];break}return o}})}function Vs(t,e){typeof e=="function"?e(t.searchParams,t):(e=new URLSearchParams(e),e.forEach((r,n)=>{t.searchParams.append(n,r)}))}function z(...t){let e=["hash","host","hostname","href","password","pathname","port","protocol","username","search","searchParams"],r=new URL("https://localhost/");for(let n of t)if(typeof n=="string"||n instanceof String)r=new URL(n,r);else if(n instanceof URL||typeof Location<"u"&&n instanceof Location)r=new URL(n);else if(n instanceof URLSearchParams)Vs(r,n);else if(n&&typeof n=="object")for(let i in n)switch(i){case"search":typeof n.search=="function"?n.search(r.search,r):r.search=new URLSearchParams(n.search);break;case"searchParams":Vs(r,n.searchParams);break;default:if(!e.includes(i))throw V("metro.url: unknown url parameter "+it+"url/unknown-param-name/",i);if(typeof n[i]=="function")n[i](r[i],r);else if(typeof n[i]=="string"||n[i]instanceof String||typeof n[i]=="number"||n[i]instanceof Number||typeof n[i]=="boolean"||n[i]instanceof Boolean)r[i]=""+n[i];else if(typeof n[i]=="object"&&n[i].toString)r[i]=n[i].toString();else throw V("metro.url: unsupported value for "+i+" "+it+"url/unsupported-param-value/",t[i]);break}else throw V("metro.url: unsupported option value "+it+"url/unsupported-option-value/",n);return Object.freeze(r),new Proxy(r,{get(n,i){let s;switch(i){case Symbol.metroProxy:s=!0;break;case Symbol.metroSource:s=n;break;case"with":s=function(...o){return z(n,...o)};break;case"filename":s=n.pathname.split("/").pop();break;case"folderpath":s=n.pathname.substring(0,n.pathname.lastIndexOf("\\")+1);break;case"authority":s=n.username??"",s+=n.password?":"+n.password:"",s+=s?"@":"",s+=n.hostname,s+=n.port?":"+n.port:"",s+="/",s=n.protocol+"//"+s;break;case"origin":s=n.protocol+"//"+n.hostname,s+=n.port?":"+n.port:"",s+="/";break;case"fragment":s=n.hash.substring(1);break;case"scheme":n.protocol?s=n.protocol.substring(0,n.protocol.length-1):s="";break;default:n[i]instanceof Function?s=n[i].bind(n):s=n[i];break}return s}})}function Ks(...t){var e=new FormData;for(let r of t)if(r instanceof HTMLFormElement&&(r=new FormData(r)),r instanceof FormData)for(let n of r.entries())e.append(n[0],n[1]);else if(r&&typeof r=="object")for(let n of Object.entries(r))if(Array.isArray(n[1]))for(let i of n[1])e.append(n[0],i);else e.append(n[0],n[1]);else throw new V("metro.formdata: unknown option type "+it+"formdata/unknown-option-value/",r);return Object.freeze(e),new Proxy(e,{get(r,n){let i;switch(n){case Symbol.metroProxy:i=!0;break;case Symbol.metroSource:i=r;break;case"with":i=function(...s){return Ks(r,...s)};break;default:r[n]instanceof Function?i=r[n].bind(r):i=r[n];break}return i}})}var lr={error:(t,...e)=>{console.error("\u24C2\uFE0F ",t,...e)},info:(t,...e)=>{console.info("\u24C2\uFE0F ",t,...e)},group:t=>{console.group("\u24C2\uFE0F "+t)},groupEnd:t=>{console.groupEnd("\u24C2\uFE0F "+t)}};function V(t,...e){return lr.error(t,...e),new Error(t,...e)}var Pf={add(t,e){oe.tracers[t]=e},delete(t){delete oe.tracers[t]},clear(){oe.tracers={}},group(){let t=0;return{request:(e,r)=>{t++,lr.group(t),lr.info(e?.url,e,r)},response:(e,r)=>{lr.info(e?.body?e.body[Symbol.metroSource]:null,e,r),lr.groupEnd(t),t--}}}};function $e(t){if(Array.isArray(t))return t.slice().map($e);if(t&&typeof t=="object")if(t.__proto__.constructor==Object||!t.__proto__){let e=Object.assign({},t);return Object.keys(e).forEach(r=>{e[r]=$e(t[r])}),e}else return t;return t}var ot=class{#e;#t;constructor(e,r="/"){this.#e=re(e),this.#t=new E(r)}get name(){return"HttpAdapter"}get path(){return this.#t}supportsWrite(){return!0}supportsStreamingWrite(){return Of}supportsStreamingRead(){return!0}supportsDirectories(){return!1}cd(e){if(!E.isPath(e))throw new TypeError(e+" is not a valid path");return E.isRelative(e)&&(e=E.collapse(e,this.#t)),new this.constructor(this.#e,e)}async write(e,r,n=null){return this.#e.put({body:r})}writeStream(e,r,n=null){throw new Error("Not yet implemented")}async read(e){let r=await this.#e.get(e),n={type:this.getMimetype(r),name:E.filename(e),http:{headers:r.headers,status:r.status,url:r.url}};return n.type.match(/text\/.*/)?n.contents=await r.text():n.type.match(/application\/json.*/)?n.contents=await r.json():n.contents=await r.blob(),n}readStream(e,r){throw new Error("Not yet implemented")}async exists(e){return this.#e.head(e)}async remove(e){return this.#e.delete(e)}async list(e){let r=["text/html","text/xhtml","text/xhtml+xml","text/xml"],n=await this.read(e);if(r.includes(n.type.split(";")[0]))var i=n.contents;else{let u=this.getUrl(e);throw new TypeError("URL "+u+" is not of a supported content type",{cause:n})}let s=z(this.#e.clientOptions.url).pathname,o=this.getUrl(e),a=document.createElement("template");a.innerHTML=i;let l=a.content.querySelectorAll("a[href]");return Array.from(l).map(u=>{let f=new URL(u.getAttribute("href"),o.href);return u.href=f.href,{filename:E.filename(u.pathname),path:u.pathname,name:u.innerText,href:u.href}}).filter(u=>{let f=new URL(u.href);return f.pathname=E.parent(f.pathname),f.href===o.href}).map(u=>({filename:u.filename,path:u.path.substring(s.length-1),name:u.name}))}getUrl(e){let r=z(this.#e.clientOptions.url).pathname;return e=E.collapse(r+E.collapse(e)),new URL(e,this.#e.clientOptions.url)}getMimetype(e){return e.headers.has("Content-Type")?e.headers.get("Content-Type"):null}},Of=(async()=>new Request("",{body:new ReadableStream,method:"POST",duplex:"half"}).headers.has("Content-Type")?!1:fetch("data:a/a;charset=utf-8,",{method:"POST",body:new ReadableStream,duplex:"half"}).then(()=>!0,()=>!1))();var Lf={fs:ar,adapters:{https:ot},path:E};globalThis.jsfs=Lf;function fe(t){return t=Object.assign({contentType:"application/json",reviver:null,replacer:null,space:""},t),async function(r,n){if(r.headers.get("Accept")||(r=r.with({headers:{Accept:t.accept??t.contentType}})),r.method!=="GET"&&r.method!=="HEAD"&&r.data&&typeof r.data=="object"&&!(r.data instanceof ReadableStream)){let s=r.headers.get("Content-Type");(!s||Cf(s))&&(r=r.with({headers:{"Content-Type":t.contentType}})),Qs(r.headers.get("Content-Type"))&&(r=r.with({body:JSON.stringify(r.data,t.replacer,t.space)}))}let i=await n(r);if(i&&Qs(i.headers?.get("Content-Type"))){let o=await i.clone().text();try{let a=JSON.parse(o,t.reviver);return i.with({body:a})}catch{}}return i}}var Bf=/^application\/([a-zA-Z0-9\-_]+\+)?json\b/;function Qs(t){return Bf.exec(t)}function Cf(t){return/^text\/plain\b/.exec(t)}function ce(t){return async function(r,n){let i=await n(r);if(!i.ok)if(t&&typeof t[i.status]=="function")i=t[i.status].apply(i,r);else throw new Error(i.status+": "+i.statusText,{cause:i});return i}}function Ot(){return async function(e,r){let n=await r(e);return n.ok&&n.data?n.data:n}}var Gr=class extends oe{#e=null;#t="";constructor(e,r,n=null){e instanceof oe?super(e.clientOptions,ce(),Ot()):super(e,ce(),Ot()),n||(n=this),this.#e=r,this.#t=e;for(let i in r)typeof r[i]=="function"?this[i]=r[i].bind(n):r[i]&&typeof r[i]=="object"&&(Object.getPrototypeOf(r[i])===null||Object.getPrototypeOf(r[i]).constructor===Object)?this[i]=new this.constructor(e,r[i],n):this[i]=r[i]}extend(e){return new this.constructor(this.#t,Object.assign({},this.#e,e))}},Jn=class extends Gr{constructor(e,r,n=null){e instanceof oe?super(e.with(fe()),r,n):super(re(e,fe()),r,n)}};function Js(...t){return new Gr(...$e(t))}function Ys(...t){return new Jn(...$e(t))}var Zs=Object.assign({},Pt,{mw:{json:fe,thrower:ce,getdata:Ot},api:Js,jsonApi:Ys});globalThis.metro||(globalThis.metro=Zs);var N=Zs;var Hr={};nt(Hr,{base64url_encode:()=>ti,createState:()=>ro,default:()=>Bt,generateCodeChallenge:()=>to,generateCodeVerifier:()=>eo,getExpires:()=>Xn,isAuthorized:()=>Uf,isExpired:()=>ei,isRedirected:()=>ri});globalThis.assertEnabled=!1;function Ff(){globalThis.assertEnabled=!0}function Mf(){globalThis.assertEnabled=!1}function D(t,e){if(globalThis.assertEnabled){let r=G(t,e);if(r)throw console.error("\u{1F170}\uFE0F Assertions failed because of:",r,"in this source:",t),new Error("Assertions failed",{cause:{problems:r,source:t}})}}function m(t){return function(r,n,i){if(typeof r<"u"&&r!=null&&typeof t<"u")return G(r,t,n,i)}}function k(t){return function(r,n,i){return r==null||typeof r>"u"?P("data is required",r,t||"any value",i):typeof t<"u"?G(r,t,n,i):!1}}function qe(t){return function(r,n,i){return r==null||typeof r>"u"?(Xs("data does not contain recommended value",r,t,i),!1):G(r,t,n,i)}}function $(...t){return function(r,n,i){for(let s of t)if(!G(r,s,n,i))return!1;return P("data does not match oneOf patterns",r,t,i)}}function ve(...t){return function(r,n,i){if(!Array.isArray(r))return P("data is not an array",r,"anyOf",i);for(let s of r)if($(...t)(s))return P("data does not match anyOf patterns",s,t,i);return!1}}function Yn(...t){return function(r,n,i){let s=[];for(let o of t)s=s.concat(G(r,o,n,i));if(s=s.filter(Boolean),s.length)return P("data does not match all given patterns",r,t,i,s)}}function R(t,e,r){try{t instanceof URL&&(t=t.href);let n=new URL(t);if(n.href!=t&&!(n.href+"/"==t||n.href==t+"/"))return P("data is not a valid url",t,"validURL",r)}catch{return P("data is not a valid url",t,"validURL",r)}}function Zn(t,e,r){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return P("data is not a valid email",t,"validEmail",r)}function at(t){return function(r,n,i){if(!(r instanceof t))return P("data is not an instanceof pattern",r,t,i)}}function Lt(t){return function(r,n,i){if(!G(r,t,n,i))return P("data matches pattern, when required not to",r,t,i)}}function G(t,e,r,n=""){r||(r=t);let i=[];if(e===Boolean)typeof t!="boolean"&&!(t instanceof Boolean)&&i.push(P("data is not a boolean",t,e,n));else if(e===Number)typeof t!="number"&&!(t instanceof Number)&&i.push(P("data is not a number",t,e,n));else if(e===String)typeof t!="string"&&!(t instanceof String)&&i.push(P("data is not a string",t,e,n)),t==""&&i.push(P("data is an empty string, which is not allowed",t,e,n));else if(e instanceof RegExp)if(Array.isArray(t)){let s=t.findIndex((o,a)=>G(o,e,r,n+"["+a+"]"));s>-1&&i.push(P("data["+s+"] does not match pattern",t[s],e,n+"["+s+"]"))}else typeof t>"u"?i.push(P("data is undefined, should match pattern",t,e,n)):e.test(t)||i.push(P("data does not match pattern",t,e,n));else if(e instanceof Function){let s=e(t,r,n);s&&(Array.isArray(s)?i=i.concat(s):i.push(s))}else if(Array.isArray(e)){Array.isArray(t)||i.push(P("data is not an array",t,[],n));for(let s of e)for(let o of t.keys()){let a=G(t[o],s,r,n+"["+o+"]");Array.isArray(a)?i=i.concat(a):a&&i.push(a)}}else if(e&&typeof e=="object")if(Array.isArray(t)){let s=t.findIndex((o,a)=>G(o,e,r,n+"["+a+"]"));s>-1&&i.push(P("data["+s+"] does not match pattern",t[s],e,n+"["+s+"]"))}else if(!t||typeof t!="object")i.push(P("data is not an object, pattern is",t,e,n));else if(t instanceof URLSearchParams&&(t=Object.fromEntries(t)),e instanceof Function){let s=G(t,e,r,n);s&&(i=i.concat(s))}else for(let[s,o]of Object.entries(e)){let a=G(t[s],o,r,n+"."+s);a&&(i=i.concat(a))}else e!=t&&i.push(P("data and pattern are not equal",t,e,n));return i.length?i:!1}function P(t,e,r,n,i){let s={path:n,message:t,found:e,expected:r};return i&&(s.problems=i),s}function Xs(t,e,r,n){console.warn("\u{1F170}\uFE0F Assert: "+n,t,r,e)}globalThis.assert={warn:Xs,error:P,assert:D,enable:Ff,disable:Mf,Required:k,Recommended:qe,Optional:m,oneOf:$,anyOf:ve,allOf:Yn,validURL:R,validEmail:Zn,instanceOf:at,not:Lt,fails:G};function ur(t){let e,r;if(typeof localStorage<"u")e={get:()=>localStorage.getItem("metro/state:"+t),set:n=>localStorage.setItem("metro/state:"+t,n),has:()=>localStorage.getItem("metro/state:"+t)!==null,delete:()=>localStorage.remoteItem("metro/state:"+t)},r={get:n=>JSON.parse(localStorage.getItem(t+":"+n)),set:(n,i)=>localStorage.setItem(t+":"+n,JSON.stringify(i)),has:n=>localStorage.getItem(t+":"+n)!==null,delete:n=>localStorage.removeItem(t+":"+n)};else{let n=new Map;e={get:()=>n.get("metro/state:"+t),set:i=>n.set("metro/state:"+t,i),has:()=>n.has("metro/state:"+t),delete:()=>n.delete("metro/state:"+t)},r=new Map}return{state:e,tokens:r}}function Bt(t){let e={client:re(),force_authorization:!1,site:"default",oauth2_configuration:{authorization_endpoint:"/authorize",token_endpoint:"/token",redirect_uri:globalThis.document?.location.href,grant_type:"authorization_code",code_verifier:eo(64)},authorize_callback:async f=>(window.location.href!=f.href&&window.location.replace(f.href),!1)};D(t,{});let r=Object.assign({},e.oauth2_configuration,t?.oauth2_configuration);t=Object.assign({},e,t),t.oauth2_configuration=r;let n=ur(t.site);t.tokens||(t.tokens=n.tokens),t.state||(t.state=n.state),D(t,{oauth2_configuration:{client_id:k(/.+/),grant_type:"authorization_code",authorization_endpoint:k(R),token_endpoint:k(R),redirect_uri:k(R)}});for(let f in r)switch(f){case"access_token":case"authorization_code":case"refresh_token":t.tokens.set(f,r[f]);break}return async function(f,c){if(t.force_authorization)return i(f,c);let d;try{if(d=await c(f),d.ok)return d}catch(h){switch(d?.status){case 400:case 401:return i(f,c)}throw h}if(!d.ok)switch(d.status){case 400:case 401:return i(f,c)}return d};async function i(f,c){s();let d=t.tokens.get("access_token"),h=t.tokens.get("refresh_token"),y=ei(d);if(!d||y&&!h){try{if(!await o())return Nt("false")}catch(_){throw _}return i(f,c)}else if(y&&h){try{if(!await a())return Nt("false")}catch(_){throw _}return i(f,c)}else return f=st(f,{headers:{Authorization:d.type+" "+d.value}}),c(f)}function s(){if(typeof window<"u"&&window?.location){let f=z(window.location),c,d,h;if(f.searchParams.has("code"))h=f.searchParams,f=f.with({search:""}),history.pushState({},"",f.href);else if(f.hash){let y=f.hash.substr(1);h=new URLSearchParams("?"+y),f=f.with({hash:""}),history.pushState({},"",f.href)}if(h){c=h.get("code"),d=h.get("state");let y=t.state.get("metro/state");if(!d||d!==y)return;c&&t.tokens.set("authorization_code",c)}}}async function o(){if(r.grant_type==="authorization_code"&&!t.tokens.has("authorization_code")){let h=await l();if(!t.authorize_callback||typeof t.authorize_callback!="function")throw V("oauth2mw: oauth2 with grant_type:authorization_code requires a callback function in client options.authorize_callback");let y=await t.authorize_callback(h);if(y)t.tokens.set("authorization_code",y);else return!1}let f=u(),c=await t.client.post(f);if(!c.ok){let h=await c.text();throw V("OAuth2mw: fetch access_token: "+c.status+": "+c.statusText+" ("+h+")",{cause:f})}let d=await c.json();if(t.tokens.set("access_token",{value:d.access_token,expires:Xn(d.expires_in),type:d.token_type,scope:d.scope}),d.refresh_token){let h={value:d.refresh_token};t.tokens.set("refresh_token",h)}return t.tokens.delete("authorization_code"),d}async function a(){let f=u("refresh_token"),c=await t.client.post(f);if(!c.ok)throw V("OAuth2mw: refresh access_token: "+c.status+": "+c.statusText,{cause:f});let d=await c.json();if(t.tokens.set("access_token",{value:d.access_token,expires:Xn(d.expires_in),type:d.token_type,scope:d.scope}),d.refresh_token){let h={value:d.refresh_token};t.tokens.set("refresh_token",h)}else return!1;return d}async function l(){if(!r.authorization_endpoint)throw V("oauth2mw: Missing options.oauth2_configuration.authorization_endpoint");let f=z(r.authorization_endpoint,{hash:""});D(r,{client_id:/.+/,redirect_uri:/.+/,scope:/.*/});let c={response_type:"code",client_id:r.client_id,redirect_uri:r.redirect_uri,state:r.state||ro(40)};return r.response_type&&(c.response_type=r.response_type),r.response_mode&&(c.response_mode=r.response_mode),t.state.set(c.state),r.client_secret&&(c.client_secret=r.client_secret),r.code_verifier&&(t.tokens.set("code_verifier",r.code_verifier),c.code_challenge=await to(r.code_verifier),c.code_challenge_method="S256"),r.scope&&(c.scope=r.scope),r.prompt&&(c.prompt=r.prompt),z(f,{search:c})}function u(f=null){if(D(r,{client_id:/.+/,redirect_uri:/.+/}),!r.token_endpoint)throw V("oauth2mw: Missing options.endpoints.token url");let c=z(r.token_endpoint,{hash:""}),d={grant_type:f||r.grant_type,client_id:r.client_id};switch(r.client_secret&&(d.client_secret=r.client_secret),r.scope&&(d.scope=r.scope),d.grant_type){case"authorization_code":d.redirect_uri=r.redirect_uri,d.code=t.tokens.get("authorization_code");let h=t.tokens.get("code_verifier");h&&(d.code_verifier=h);break;case"client_credentials":break;case"refresh_token":d.refresh_token=t.tokens.get("refresh_token");break;default:throw new Error("Unknown grant_type: ".oauth2.grant_type)}return st(c,{method:"POST",body:new URLSearchParams(d)})}}function ei(t){if(!t)return!0;let e=new Date(t.expires);return new Date().getTime()>e.getTime()}function Xn(t){if(t instanceof Date)return new Date(t.getTime());if(typeof t=="number"){let e=new Date;return e.setSeconds(e.getSeconds()+t),e}throw new TypeError("Unknown expires type "+t)}function eo(t=64){let e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),ti(e)}async function to(t){let r=new TextEncoder().encode(t),n=await globalThis.crypto.subtle.digest("SHA-256",r);return ti(n)}function ti(t){let e=Array.from(new Uint8Array(t),r=>String.fromCharCode(r)).join("");return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ro(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="",n=0;for(;n<t;)r+=e.charAt(Math.floor(Math.random()*e.length)),n++;return r}function ri(){let t=new URL(document.location.href);if(!t.searchParams.has("code")){if(t.hash){let e=t.hash.substr(1);if(new URLSearchParams("?"+e).has("code"))return!0}return!1}return!0}function Uf(t){typeof t=="string"&&(t=ur(t).tokens);let e=t.get("access_token");return!!(e&&!ei(e)||t.get("refresh_token"))}var ni={};nt(ni,{default:()=>io});var Vr={status:200,statusText:"OK",headers:{"Content-Type":"application/json"}},fr=t=>({status:400,statusText:"Bad Request",headers:{"Content-Type":"application/json"},body:JSON.stringify({error:"invalid_request",error_description:t})}),We,no={};function io(t={}){return t=Object.assign({},{PKCE:!1,DPoP:!1},t),async(r,n)=>{let i=N.url(r.url);switch(i.pathname){case"/authorize/":if(We=G(i.searchParams,{response_type:"code",client_id:"mockClientId",state:m(/.*/)}))return N.response(fr(We));if(i.searchParams.has("code_challenge")){if(!i.searchParams.has("code_challenge_method"))return N.response(fr("missing code_challenge_method"));no.code_challenge=i.searchParams.get("code_challenge"),no.code_challenge_method=i.searchParams.get("code_challenge_method")}return N.response(Vr,{body:JSON.stringify({code:"mockAuthorizeToken",state:i.searchParams.get("state")})});case"/token/":if(r.data instanceof URLSearchParams){let l={};r.data.forEach((u,f)=>l[f]=u),r=r.with({body:l})}if(We=G(r,{method:"POST",data:{grant_type:$("refresh_token","authorization_code")}}))return N.response(fr(We));switch(r.data.grant_type){case"refresh_token":if(We=G(r.data,$({refresh_token:"mockRefreshToken",client_id:"mockClientId",client_secret:"mockClientSecret"},{refresh_token:"mockRefreshToken",client_id:"mockClientId",code_verifier:/.+/})))return N.response(fr(We));break;case"access_token":if(We=G(r.data,$({client_id:"mockClientId",client_secret:"mockClientSecret"},{client_id:"mockClientId",code_challenge:/.*/,code_challenge_method:"S256"})))return N.response(fr(We));break}return N.response(Vr,{body:JSON.stringify({access_token:"mockAccessToken",token_type:"mockExample",expires_in:3600,refresh_token:"mockRefreshToken",example_parameter:"mockExampleValue"})});case"/protected/":let s=r.headers.get("Authorization"),[o,a]=s?s.split(" "):[];return!a||a!=="mockAccessToken"?N.response({status:401,statusText:"Forbidden",body:"401 Forbidden"}):N.response(Vr,{body:JSON.stringify({result:"Success"})});case"/public/":return N.response(Vr,{body:JSON.stringify({result:"Success"})});default:return N.response({status:404,statusText:"not found",body:"404 Not Found "+i})}}}var ii={};nt(ii,{default:()=>ao});var so=["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],oo=["client_secret_post","client_secret_base","client_secret_jwt","private_key_jwt"],$f={issuer:k(R),authorization_endpoint:k(R),token_endpoint:k(R),jwks_uri:m(R),registration_endpoint:m(R),scopes_supported:qe([]),response_types_supported:k(ve("code","token")),response_modes_supported:m([]),grant_types_supported:m([]),token_endpoint_auth_methods_supported:m([]),token_endpoint_auth_signing_alg_values_supported:m([]),service_documentation:m(R),ui_locales_supported:m([]),op_policy_uri:m(R),op_tos_uri:m(R),revocation_endpoint:m(R),revocation_endpoint_auth_methods_supported:m(oo),revocation_endpoint_auth_signing_alg_values_supported:m(so),introspection_endpoint:m(R),introspection_endpoint_auth_methods_supported:m(oo),introspection_endpoint_auth_signing_alg_values_supported:m(so),code_challendge_methods_supported:m([])};function ao(t={}){let e={client:N.client()};t=Object.assign({},e,t),D(t,{issuer:k(R)});let r=qf(t.issuer);return t.client.with(t.issuer)}async function qf(t,e){let r=e.get(N.url(t,".wellknown/oauth_authorization_server"));if(r.ok){D(r.headers.get("Content-Type"),/application\/json.*/);let n=await r.json();return D(n,$f),n}throw N.metroError("metro.oidcmw: Error while fetching "+t+".wellknown/oauth_authorization_server",r)}function lo(t=null){let e=!1;t=t||window.location.origin;let r=new URLSearchParams(window.location.search);if(!r.has("code")&&window.location.hash){let i=window.location.hash.substr(1);r=new URLSearchParams("?"+i)}let n=window.parent!==window?window.parent:window.opener;return n?r.has("code")?(n.postMessage({authorization_code:r.get("code")},t),e=!0):r.has("error")?n.postMessage({error:r.get("error")},t):n.postMessage({error:"Could not find an authorization_code"},t):console.error("No parent window found, cannot post authorization code (or error)"),e}function uo(t){return new Promise((e,r)=>{addEventListener("message",n=>{n.data.authorization_code?e(n.data.authorization_code):n.data.error?r(n.data.error):r("Unknown authorization error")},{once:!0}),window.open(t)})}function cr(){return new Promise((t,e)=>{let r=globalThis.indexedDB.open("metro",1);r.onupgradeneeded=()=>r.result.createObjectStore("keyPairs",{keyPath:"domain"}),r.onerror=n=>{e(n)},r.onsuccess=n=>{let i=n.target.result;t({set:function(s,o){return new Promise((a,l)=>{let u=i.transaction("keyPairs","readwrite",{durability:"strict"}),f=u.objectStore("keyPairs");u.oncomplete=()=>{a()},u.onerror=l,f.put(s,o)})},get:function(s){return new Promise((o,a)=>{let l=i.transaction("keyPairs","readonly"),f=l.objectStore("keyPairs").get(s);f.onsuccess=()=>{o(f.result)},f.onerror=a,l.onerror=a})},clear:function(){return new Promise((s,o)=>{let a=i.transaction("keyPairs","readwrite"),u=a.objectStore("keyPairs").clear();u.onsuccess=()=>{s()},u.onerror=o,a.onerror=o})}})}})}var Wf=new TextEncoder,zf=new TextDecoder;function Kr(t){return typeof t=="string"?Wf.encode(t):zf.decode(t)}function fo(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new oi(`${t.name} modulusLength must be at least 2048 bits`)}function Gf(t){switch(t.algorithm.name){case"ECDSA":return{name:t.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return fo(t.algorithm),{name:t.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return fo(t.algorithm),{name:t.algorithm.name};case"Ed25519":return{name:t.algorithm.name}}throw new ze}async function Hf(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');let n=`${Qr(Kr(JSON.stringify(t)))}.${Qr(Kr(JSON.stringify(e)))}`,i=Qr(await crypto.subtle.sign(Gf(r),r,Kr(n)));return`${n}.${i}`}var si;Uint8Array.prototype.toBase64?si=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):si=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));let r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Qr(t){return si(t)}var ze=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},oi=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function Vf(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";default:throw new ze("unsupported RsaHashedKeyAlgorithm hash name")}}function Kf(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";default:throw new ze("unsupported RsaHashedKeyAlgorithm hash name")}}function Qf(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";default:throw new ze("unsupported EcKeyAlgorithm namedCurve")}}function Jf(t){switch(t.algorithm.name){case"RSA-PSS":return Vf(t);case"RSASSA-PKCS1-v1_5":return Kf(t);case"ECDSA":return Qf(t);case"Ed25519":return"Ed25519";default:throw new ze("unsupported CryptoKey algorithm name")}}function co(t){return t instanceof CryptoKey}function Yf(t){return co(t)&&t.type==="private"}function Zf(t){return co(t)&&t.type==="public"}function Xf(){return Math.floor(Date.now()/1e3)}async function ai(t,e,r,n,i,s){let o=t?.privateKey,a=t?.publicKey;if(!Yf(o))throw new TypeError('"keypair.privateKey" must be a private CryptoKey');if(!Zf(a))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(a.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(i!==void 0&&typeof i!="string")throw new TypeError('"accessToken" must be a string or undefined');if(s!==void 0&&(typeof s!="object"||s===null||Array.isArray(s)))throw new TypeError('"additional" must be an object');return Hf({alg:Jf(o),typ:"dpop+jwt",jwk:await ec(a)},Object.assign(Object.assign({},s),{iat:Xf(),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:i?Qr(await crypto.subtle.digest("SHA-256",Kr(i))):void 0}),o)}async function ec(t){let{kty:e,e:r,n,x:i,y:s,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:i,y:s}}async function ho(t,e){var r;let n;if(typeof t!="string"||t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new ze}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0?r:!1,["sign","verify"])}function dr(t){return D(t,{site:k(R),authorization_endpoint:k(R),token_endpoint:k(R),dpop_signing_alg_values_supported:m([])}),async(e,r)=>{let n=await cr(),i=await n.get(t.site);if(!i){let a=await ho("ES256");i={domain:t.site,keyPair:a},await n.set(i)}let s=N.url(e.url);if(e.url.startsWith(t.authorization_endpoint)){let a=e.body;a instanceof URLSearchParams||a instanceof FormData?a.set("dpop_jkt",i.keyPair.publicKey):a.dpop_jkt=i.keyPair.publicKey}else if(e.url.startsWith(t.token_endpoint)){let a=await ai(i.keyPair,e.url,e.method);e=e.with({headers:{DPoP:a}})}else if(e.headers.has("Authorization")){let a=localStorage.getItem(s.host+":nonce")||void 0,l=e.headers.get("Authorization").split(" ")[1],u=await ai(i.keyPair,e.url,e.method,a,l);e=e.with({headers:{Authorization:"DPoP "+l,DPoP:u}})}let o=await r(e);return o.headers.get("DPoP-Nonce")&&localStorage.setItem(s.host+":nonce",o.headers.get("DPoP-Nonce")),o}}var rc=Object.assign({},Hr,{oauth2mw:Bt,mockserver:ni,discover:ii,tokenstore:ur,dpopmw:dr,keysstore:cr,authorizePopup:uo,popupHandleRedirect:lo});globalThis.metro.oauth2||(globalThis.metro.oauth2=rc);var hr=(...t)=>(e,r)=>t.filter(n=>r.hasOwnKey(n)).length>0?!1:P("root data must have all of",r,t),Ge=(...t)=>e=>Array.isArray(e)&&t.filter(r=>!e.includes(r)).length==0?!1:P("data must be an array which includes",e,t);var ae=["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],Jr=["client_secret_post","client_secret_basic","client_secret_jwt","private_key_jwt"];async function pr(t={}){D(t,{client:m(at(N.client().constructor)),issuer:k(R)});let e={client:N.client().with(ce()).with(fe()),requireDynamicRegistration:!1};t=Object.assign({},e,t);let r=!1;function n(l){return r}let i={issuer:k(Yn(t.issuer,n)),authorization_endpoint:k(R),token_endpoint:k(R),userinfo_endpoint:qe(R),jwks_uri:k(R),registration_endpoint:t.requireDynamicRegistration?k(R):qe(R),scopes_supported:qe(Ge("openid")),response_types_supported:t.requireDynamicRegistration?k(Ge("code","id_token","id_token token")):k([]),response_modes_supported:m([]),grant_types_supported:t.requireDynamicRegistration?m(Ge("authorization_code")):m([]),acr_values_supported:m([]),subject_types_supported:k([]),id_token_signing_alg_values_supported:k(Ge("RS256")),id_token_encryption_alg_values_supported:m([]),id_token_encryption_enc_values_supported:m([]),userinfo_signing_alg_values_supported:m([]),userinfo_encryption_alg_values_supported:m([]),userinfo_encryption_enc_values_supported:m([]),request_object_signing_alg_values_supported:m(Ge("RS256")),request_object_encryption_alg_values_supported:m([]),request_object_encryption_enc_values_supported:m([]),token_endpoint_auth_methods_supported:m(ve(...Jr)),token_endpoint_auth_signing_alg_values_supported:m(Ge("RS256"),Lt(Ge("none"))),display_values_supported:m(ve("page","popup","touch","wap")),claim_types_supported:m(ve("normal","aggregated","distributed")),claims_supported:qe([]),service_documentation:m(R),claims_locales_supported:m([]),ui_locales_supported:m([]),claims_parameter_supported:m(Boolean),request_parameter_supported:m(Boolean),request_uri_parameter_supported:m(Boolean),op_policy_uri:m(R),op_tos_uri:m(R)},s=N.url(t.issuer,".well-known/openid-configuration"),a=(await t.client.get(s)).data;return D(a,i),D(a.issuer,t.issuer),a}async function _r(t){let e={redirect_uris:k([R]),response_types:m([]),grant_types:m(ve("authorization_code","refresh_token")),application_type:m($("native","web")),contacts:m([Zn]),client_name:m(String),logo_uri:m(R),client_uri:m(R),policy_uri:m(R),tos_uri:m(R),jwks_uri:m(R,Lt(hr("jwks"))),jwks:m(R,Lt(hr("jwks_uri"))),sector_identifier_uri:m(R),subject_type:m(String),id_token_signed_response_alg:m($(...ae)),id_token_encrypted_response_alg:m($(...ae)),id_token_encrypted_response_enc:m($(...ae),hr("id_token_encrypted_response_alg")),userinfo_signed_response_alg:m($(...ae)),userinfo_encrypted_response_alg:m($(...ae)),userinfo_encrypted_response_enc:m($(...ae),hr("userinfo_encrypted_response_alg")),request_object_signing_alg:m($(...ae)),request_object_encryption_alg:m($(...ae)),request_object_encryption_enc:m($(...ae)),token_endpoint_auth_method:m($(...Jr)),token_endpoint_auth_signing_alg:m($(...ae)),default_max_age:m(Number),require_auth_time:m(Boolean),default_acr_values:m([String]),initiate_login_uri:m([R]),request_uris:m([R])};D(t,{client:m(at(N.client().constructor)),registration_endpoint:R,client_info:e});let r={client:N.client().with(ce()).with(fe()),client_info:{redirect_uris:[globalThis.document?.location.href]}};t=Object.assign({},r,t),t.client_info||(t.client_info={}),t.client_info.redirect_uris||(t.client_info.redirect_uris=[globalThis.document?.location.href]);let n=await t.client.post(t.registration_endpoint,{body:t.client_info}),i=n.data;if(!i.client_id||!i.client_secret)throw N.metroError("metro.oidc: Error: dynamic registration of client failed, no client_id or client_secret returned",n);return t.client_info=Object.assign(t.client_info,i),t.client_info}function Yr(t){let e;if(typeof localStorage<"u")e={get:r=>JSON.parse(localStorage.getItem("metro/oidc:"+t+":"+r)),set:(r,n)=>localStorage.setItem("metro/oidc:"+t+":"+r,JSON.stringify(n)),has:r=>localStorage.getItem("metro/oidc:"+t+":"+r)!==null};else{let r=new Map;e={get:n=>JSON.parse(r.get("metro/oidc:"+t+":"+n)||null),set:(n,i)=>r.set("metro/oidc:"+t+":"+n,JSON.stringify(i)),has:n=>r.has("metro/oidc:"+t+":"+n)}}return e}function li(t={}){let e={client:re(),force_authorization:!1,use_dpop:!0,authorize_callback:async r=>(window.location.href!=r.href&&window.location.replace(r.href),!1)};return t=Object.assign({},e,t),D(t,{client:k(at(re().constructor)),client_info:k(),issuer:k(R),oauth2:m({}),openid_configuration:m()}),t.store||(t.store=Yr(t.issuer)),!t.openid_configuration&&t.store.has("openid_configuration")&&(t.openid_configuration=t.store.get("openid_configuration")),!t.client_info?.client_id&&t.store.has("client_info")&&(t.client_info=t.store.get("client_info")),async(r,n)=>{let i;if(!t.force_authorization){try{i=await n(r)}catch(u){if(i.status!=401&&i.status!=403)throw u}if(i.ok||i.status!=401&&i.status!=403)return i}if(t.openid_configuration||(t.openid_configuration=await pr({issuer:t.issuer}),t.store.set("openid_configuration",t.openid_configuration)),!t.client_info?.client_id){if(!t.openid_configuration.registration_endpoint)throw V("metro.oidcmw: Error: issuer "+t.issuer+" does not support dynamic client registration, but you haven't specified a client_id");t.client_info=await _r({registration_endpoint:t.openid_configuration.registration_endpoint,client_info:t.client_info}),t.store.set("client_info",t.client_info)}let s=t.scope||"openid",o=Object.assign({site:t.issuer,client:t.client,force_authorization:!0,authorize_callback:t.authorize_callback,oauth2_configuration:{client_id:t.client_info?.client_id,client_secret:t.client_info?.client_secret,grant_type:"authorization_code",response_type:"code",response_mode:"query",authorization_endpoint:t.openid_configuration.authorization_endpoint,token_endpoint:t.openid_configuration.token_endpoint,scope:s,redirect_uri:t.client_info.redirect_uris[0]}}),a=async(u,f)=>{let c=await f(u);if(c.headers.get("content-type")?.startsWith("application/json")){let h=c.data?.id_token;if(!h){let y=c.clone();try{let _=await y.json();_&&_.id_token&&(h=_.id_token)}catch{}}h&&t.store.set("id_token",h)}return c},l=t.client.with(t.issuer).with(a);if(t.use_dpop){let u={site:t.issuer,authorization_endpoint:t.openid_configuration.authorization_endpoint,token_endpoint:t.openid_configuration.token_endpoint,dpop_signing_alg_values_supported:t.openid_configuration.dpop_signing_alg_values_supported};l=l.with(dr(u)),o.client=l}return l=l.with(Bt(o)),i=await l.fetch(r),i}}function po(){return ri()}function _o(t){if(!t.store){if(!t.issuer)throw V("Must supply options.issuer or options.store to get the id_token");t.store=Yr(t.issuer)}return t.store.get("id_token")}var yo={oidcmw:li,discover:pr,register:_r,isRedirected:po,idToken:_o};globalThis.metro.oidc||(globalThis.metro.oidc=yo);var bo=yo;var ui={};nt(ui,{BlankNode:()=>He,Collection:()=>ut,Context:()=>Zr,Graph:()=>Xr,NamedNode:()=>lt,default:()=>en,first:()=>sc,many:()=>ic,one:()=>nc,prefixes:()=>mo,rdfType:()=>tn});function en(t){return new Zr(t)}var tn="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",mo={acl:"http://www.w3.org/ns/auth/acl#",acp:"http://www.w3.org/ns/solid/acp#",dcterms:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",ldn:"https://www.w3.org/ns/ldn#",ldp:"http://www.w3.org/ns/ldp#",notify:"http://www.w3.org/ns/solid/notifications#",oidc:"http://www.w3.org/ns/solid/oidc#",owl:"http://www.w3.org/2002/07/owl#",pim:"http://www.w3.org/ns/pim/space#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",solid:"http://www.w3.org/ns/solid/terms#",stat:"http://www.w3.org/ns/posix/stat#",turtle:"http://www.w3.org/ns/iana/media-types/text/turtle#",vcard:"http://www.w3.org/2006/vcard/ns#",xsd:"http://www.w3.org/2001/XMLSchema#"};function nc(t,e="last"){let r=t;if(Array.isArray(t))if(e=="last")r=t[t.length-1];else if(e=="first")r=t[0];else if(typeof e=="function")r=e(t);else throw new Error("Unknown value for whichOne parameter");return r}function ic(t){return Array.isArray(t)?t:t==null?[]:[t]}function sc(...t){for(let e of t)if(e!=null)return e;return null}var Zr=class{constructor(e){this.prefixes={...mo,...e?.prefixes},this.prefixes.xsd||(this.prefixes.xsd="http://www.w3.org/2001/XMLSchema#"),this.parser=e?.parser,this.writer=e?.writer,this.sources=Object.create(null),this.separator=e?.separator??"$"}parse(e,r,n){let{quads:i,prefixes:s}=this.parser(e,r,n);if(s)for(let o in s){let a=s[o];if(a.match(/^http(s?):\/\/$/i))a+=r.substring(a.length);else try{a=new URL(s[o],r).href}catch(l){console.error("Could not parse prefix",s[o],l.message)}this.prefixes[o]||(this.prefixes[o]=a)}return this.sources[r]=new Xr(i,r,n,s,this),this.sources[r]}setType(e,r){if(!r)return e;if(typeof e=="string"?e=new String(e):typeof result=="number"&&(e=new Number(e)),typeof e!="object")throw new Error("cannot set type on ",e,r);return e.type=r,e}getType(e){return e&&typeof e=="object"?e.type:null}},Xr=class{#e=Object.create(null);constructor(e,r,n,i,s){this.mimetype=n,this.url=r,this.prefixes=i,this.context=s,this.subjects=Object.create(null);for(let o of e){let a;if(o.subject.termType=="BlankNode"){let l=this.shortURI(o.predicate.id,":"),u;switch(l){case"rdf:first":if(a=this.addCollection(o.subject.id),u=this.shortURI(o.object.id,":"),u!="rdf:nil"){let f=this.getValue(o.object);f&&a.push(f)}continue;case"rdf:rest":this.#e[o.object.id]=this.#e[o.subject.id];continue;default:a=this.addBlankNode(o.subject.id);break}}else a=this.addNamedNode(o.subject.id);a.addPredicate(o.predicate.id,o.object)}this.subjects[r]?this.primary=this.subjects[r]:this.primary=null,Object.defineProperty(this,"data",{get(){return Object.values(this.subjects)}})}addNamedNode(e){let r=new URL(e,this.url).href;return this.subjects[r]||(this.subjects[r]=new lt(r,this)),this.subjects[r]}addBlankNode(e){return this.#e[e]||(this.#e[e]=new He(this)),this.#e[e]}addCollection(e){return this.#e[e]||(this.#e[e]=new ut(this)),this.#e[e]}write(){return this.context.writer(this)}get(e){return this.subjects[this.fullURI(e)]}fullURI(e,r=null){r||(r=this.context.separator);let[n,i]=e.split(r);return i?this.prefixes[n]+i:e}shortURI(e,r=null){r||(r=this.context.separator);for(let n in this.context.prefixes)if(e.startsWith(this.context.prefixes[n]))return n+r+e.substring(this.context.prefixes[n].length);return this.url&&e.startsWith(this.url)?e.substring(this.url.length):e}setType(e,r){let n=this.shortURI(r);return this.context.setType(e,n)}getType(e){return this.context.getType(e)}setLanguage(e,r){if(typeof e=="string"?e=new String(e):typeof result=="number"&&(e=new Number(e)),typeof e!="object")throw new Error("cannot set language on ",e);return e.language=r,e}getValue(e){let r;if(e.termType=="Literal"){r=e.value;let n=e.datatype?.id;n&&(r=this.setType(r,n));let i=e.language;i&&(r=this.setLanguage(r,i))}else e.termType=="BlankNode"?r=this.addBlankNode(e.id):r=this.addNamedNode(e.id);return r}},He=class{constructor(e){Object.defineProperty(this,"graph",{value:e,writable:!1,enumerable:!1})}addPredicate(e,r){if(e.id&&(e=e.id),e==tn){let n=this.graph.shortURI(r.id);this.addType(n)}else{let n=this.graph.getValue(r);e=this.graph.shortURI(e),this[e]?Array.isArray(this[e])?this[e].push(n):this[e]=[this[e],n]:this[e]=n}}addType(e){this.a?(Array.isArray(this.a)||(this.a=[this.a]),this.a.push(e)):this.a=e}},lt=class extends He{constructor(e,r){super(r),Object.defineProperty(this,"id",{value:e,writable:!1,enumerable:!0})}},ut=class extends Array{constructor(e,r){super(),Object.defineProperty(this,"graph",{value:r,writable:!1,enumerable:!1})}};var qs={};nt(qs,{n3Parser:()=>kb,n3Writer:()=>jb});var Uo=zr(pe());var dt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",br="http://www.w3.org/2001/XMLSchema#",on="http://www.w3.org/2000/10/swap/",O={xsd:{decimal:`${br}decimal`,boolean:`${br}boolean`,double:`${br}double`,integer:`${br}integer`,string:`${br}string`},rdf:{type:`${dt}type`,nil:`${dt}nil`,first:`${dt}first`,rest:`${dt}rest`,langString:`${dt}langString`,dirLangString:`${dt}dirLangString`,reifies:`${dt}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${on}reify#forSome`,forAll:`${on}reify#forAll`},log:{implies:`${on}log#implies`,isImpliedBy:`${on}log#isImpliedBy`}};var{xsd:an}=O,Mc=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Do={"\\":"\\","'":"'",'"':'"',n:`
|
|
3
3
|
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Dc=/[\x00-\x20<>\\"\{\}\|\^\`]/,Uc={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_dircode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},$c=/$0^/,ht=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i,this._dircode=/^--(ltr)|(rtl)/,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Uc)&&this[r]instanceof RegExp&&(this[r]=$c)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let n=this._input,i=n.length;for(;;){let a,l;for(;a=this._newline.exec(n);)this.comments&&(l=this._comment.exec(a[0]))&&s("comment",l[1],"",this._line,a[0].length),n=n.substr(a[0].length,n.length),i=n.length,this._line++;if(!a&&(a=this._whitespace.exec(n))&&(n=n.substr(a[0].length,n.length)),this._endOfFile.test(n))return r&&(this.comments&&(l=this._comment.exec(n))&&s("comment",l[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;let u=this._line,f=n[0],c="",d="",h="",y=null,_=0,x=!1;switch(f){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){x=!0;break}}else{this._n3Mode&&(_=1,c="^");break}case"<":if(y=this._unescapedIri.exec(n))c="IRI",d=y[1];else if(y=this._iri.exec(n)){if(d=this._unescape(y[1]),d===null||Dc.test(d))return o(this);c="IRI"}else n.length>2&&n[1]==="<"&&n[2]==="("?(c="<<(",_=3):!this._lineMode&&n.length>(r?1:2)&&n[1]==="<"?(c="<<",_=2):this._n3Mode&&n.length>1&&n[1]==="="&&(_=2,this._isImpliedBy?(c="abbreviation",d="<"):(c="inverse",d=">"));break;case">":n.length>1&&n[1]===">"&&(c=">>",_=2);break;case"_":((y=this._blank.exec(n))||r&&(y=this._blank.exec(`${n} `)))&&(c="blank",h="_",d=y[1]);break;case'"':if(y=this._simpleQuotedString.exec(n))d=y[1];else if({value:d,matchLength:_}=this._parseLiteral(n),d===null)return o(this);(y!==null||_!==0)&&(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(y=this._simpleApostropheString.exec(n))d=y[1];else if({value:d,matchLength:_}=this._parseLiteral(n),d===null)return o(this);(y!==null||_!==0)&&(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(y=this._variable.exec(n))&&(c="var",d=y[0]);break;case"@":this._previousMarker==="literal"&&(y=this._langcode.exec(n))&&y[1]!=="version"?(c="langcode",d=y[1]):(y=this._atKeyword.exec(n))&&(c=y[0]);break;case".":if(n.length===1?r:n[1]<"0"||n[1]>"9"){c=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if(n[1]==="-"){this._previousMarker==="langcode"&&(y=this._dircode.exec(n))&&(c="dircode",_=2,d=y[1]||y[2],_=d.length+2);break}(y=this._number.exec(n)||r&&(y=this._number.exec(`${n} `)))&&(c="literal",d=y[0],h=typeof y[1]=="string"?an.double:typeof y[2]=="string"?an.decimal:an.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(y=this._keyword.exec(n))?c=y[0].toUpperCase():x=!0;break;case"f":case"t":(y=this._boolean.exec(n))?(c="literal",d=y[0],h=an.boolean):x=!0;break;case"a":(y=this._shortPredicates.exec(n))?(c="abbreviation",d="a"):x=!0;break;case"=":this._n3Mode&&n.length>1&&(c="abbreviation",n[1]!==">"?(_=1,d="="):(_=2,d=">"));break;case"!":if(!this._n3Mode)break;case")":if(!r&&(n.length===1||n.length===2&&n[1]===">"))break;if(n.length>2&&n[1]===">"&&n[2]===">"){c=")>>",_=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(_=1,c=f);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(c="{|",_=2):(c=f,_=1));break;case"|":n.length>=2&&n[1]==="}"&&(c="|}",_=2);break;default:x=!0}if(x&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(y=this._prefix.exec(n))?(c="prefix",d=y[1]||""):((y=this._prefixed.exec(n))||r&&(y=this._prefixed.exec(`${n} `)))&&(c="prefixed",h=y[1]||"",d=this._unescape(y[2]))),this._previousMarker==="^^")switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return r||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;let b=_||y[0].length,g=s(c,d,h,u,b);this.previousToken=g,this._previousMarker=c,n=n.substr(b,n.length)}function s(a,l,u,f,c){let d=n?i-n.length:i,h=d+c,y={type:a,value:l,prefix:u,line:f,start:d,end:h};return e(null,y),y}function o(a){e(a._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let r=!1,n=e.replace(Mc,(i,s,o,a)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof o=="string"){let l=Number.parseInt(o,16);return l<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return a in Do?Do[a]:(r=!0,"")});return r?null:n}_parseLiteral(e){if(e.length>=3){let r=e.match(/^(?:"""|"|'''|'|)/)[0],n=r.length,i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(r,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){let o=e.substring(n,i),a=o.split(/\r\n|\r|\n/).length-1,l=i+n;if(n===1&&a!==0||n===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:l}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,r){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")queueMicrotask(()=>this._tokenizeToEnd(r,!0));else{let n=[],i;if(this._tokenizeToEnd((s,o)=>s?i=s:n.push(o),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Uo.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",r)}};var{rdf:$o,xsd:pt}=O,$t,qc=0;var wi={namedNode:qo,blankNode:Wo,variable:Go,literal:zo,defaultGraph:Wc,quad:xi,triple:xi,fromTerm:mr,fromQuad:Ho},te=wi,ee=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},Ut=class extends ee{get termType(){return"NamedNode"}},je=class t extends ee{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1,n=e.lastIndexOf("--");return r<e.length&&e[r++]==="@"?(n>r?e.substr(0,n):e).substr(r).toLowerCase():""}get direction(){let e=this.id,r=e.lastIndexOf('"'),n=e.lastIndexOf("--");return n>r&&n+2<e.length?e.substr(n+2).toLowerCase():""}get datatype(){return new Ut(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,n=r<e.length?e[r]:"";return n==="^"?e.substr(r+2):n!=="@"?pt.string:e.indexOf("--",r)>0?$o.dirLangString:$o.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},gr=class extends ee{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},wr=class extends ee{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},xr=class extends ee{constructor(){return super(""),$t||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};$t=new xr;function Ke(t,e,r){if(e=e||wi,!t)return e.defaultGraph();switch(t[0]){case"?":return e.variable(t.substr(1));case"_":return e.blankNode(t.substr(2));case'"':if(e===wi)return new je(t);if(t[t.length-1]==='"')return e.literal(t.substr(1,t.length-2));let n=t.lastIndexOf('"',t.length-1),i;if(t[n+1]==="@"){i=t.substr(n+2);let s=i.lastIndexOf("--");s>0&&s<i.length&&(i={language:i.substr(0,s),direction:i.substr(s+2)})}else i=e.namedNode(t.substr(n+3));return e.literal(t.substr(1,n-1),i);case"[":t=JSON.parse(t);break;default:if(!r||!Array.isArray(t))return e.namedNode(t)}return e.quad(Ke(t[0],e,!0),Ke(t[1],e,!0),Ke(t[2],e,!0),t[3]&&Ke(t[3],e,!0))}function Ne(t,e){if(typeof t=="string")return t;if(t instanceof ee&&t.termType!=="Quad")return t.id;if(!t)return $t.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}${t.direction?`--${t.direction}`:""}`:t.datatype&&t.datatype.value!==pt.string?`^^${t.datatype.value}`:""}`;case"Quad":let r=[Ne(t.subject,!0),Ne(t.predicate,!0),Ne(t.object,!0)];return t.graph&&t.graph.termType!=="DefaultGraph"&&r.push(Ne(t.graph,!0)),e?r:JSON.stringify(r);default:throw new Error(`Unexpected termType: ${t.termType}`)}}var Qe=class extends ee{constructor(e,r,n,i){super(""),this._subject=e,this._predicate=r,this._object=n,this._graph=i||$t}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function qo(t){return new Ut(t)}function Wo(t){return new gr(t||`n3-${qc++}`)}function zo(t,e){if(typeof e=="string")return new je(`"${t}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new je(`"${t}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=pt.boolean:typeof t=="number"&&(Number.isFinite(t)?r=Number.isInteger(t)?pt.integer:pt.double:(r=pt.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),r===""||r===pt.string?new je(`"${t}"`):new je(`"${t}"^^${r}`)}function Go(t){return new wr(t)}function Wc(){return $t}function xi(t,e,r,n){return new Qe(t,e,r,n)}function mr(t){if(t instanceof ee)return t;switch(t.termType){case"NamedNode":return qo(t.value);case"BlankNode":return Wo(t.value);case"Variable":return Go(t.value);case"DefaultGraph":return $t;case"Literal":return zo(t.value,t.language||t.datatype);case"Quad":return Ho(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function Ho(t){if(t instanceof Qe)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return xi(mr(t.subject),mr(t.predicate),mr(t.object),mr(t.graph))}var Vo=0,Pe=class t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Ko(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(r),i=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||a),this._isImpliedBy=e.isImpliedBy,l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ht({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){Vo=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,r,n,i,s){let o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:r,inverse:o?this._inversePredicate:!1,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,r){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,r){let n;switch(e.type){case"IRI":case"typeIRI":let i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._factory.namedNode(i);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(s+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":let r=this._contextStack;return(r.length&&r[r.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<(":return this._n3Mode?(this._saveContext("<<(",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Disallowed triple term as subject",e);case"<<":return this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":case"|}":return this._predicate===null?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._validAnnotation=!0,this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":let r=this._contextStack;return(r.length&&r[r.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<(":return this._saveContext("<<(",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case"<<":return this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let r=this._contextStack;return(r.length>1&&r[r.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):(this._predicate=null,this._readPredicate(e))}}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:r?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let r=null,n=null,i=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=r=this._factory.blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(r=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":this._saveContext("<<",this._graph,null,null,null),this._graph=null,i=this._readSubject;break;default:if((r=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),e.type==="<<"&&(o[o.length-1].subject=this._subject),s===null?a.predicate===null?a.subject=n:a.object=n:this._emit(s,this.RDF_REST,n,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,r,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,r){let n=this._factory.literal(this._literalValue),i;switch(e.type){case"type":case"typeIRI":let s=this._readEntity(e);if(s===void 0)return;if(s.value===O.rdf.langString||s.value===O.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);n=this._factory.literal(this._literalValue,s),e=null;break;case"langcode":if(e.value.split("-").some(o=>o.length>8))return this._error("Detected language tag with subtag longer than 8 characters",e);n=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,i=this._readDirCode.bind(this,r);break}return{token:e,literal:n,readCb:i}}_readDirCode(e,r,n){if(n.type==="dircode"){let i=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:n.value});e==="subject"?this._subject=i:this._object=i,this._literalLanguage=void 0,n=null}return e==="subject"?n===null?this._readPredicateOrNamedGraph:this._readPredicateOrNamedGraph(n):this._completeObjectLiteralPost(n,r)}_completeSubjectLiteral(e){let r=this._completeLiteral(e,"subject");return this._subject=r.literal,r.readCb?r.readCb.bind(this,!1):this._readPredicateOrNamedGraph}_completeObjectLiteral(e,r){let n=this._completeLiteral(e,"object");if(n)return this._object=n.literal,n.readCb?n.readCb.bind(this,r):this._completeObjectLiteralPost(n.token,r)}_completeObjectLiteralPost(e,r){return r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let r,n=this._graph,i=!1,s=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,this._tripleTerm=null,r=this._contextStack.length?this._readSubject:this._readInTopContext,o&&(this._inversePredicate=!1);break;case";":r=this._readPredicate;break;case",":r=this._readObject;break;case"~":r=this._readReifierInAnnotation,i=!0;break;case"{|":this._subject=this._readTripleTerm(),this._validAnnotation=!1,i=!0,r=this._readPredicate;break;case"|}":if(!this._annotation)return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject=null,this._annotation=!1,r=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null&&(!i||i&&!this._annotation)){let a=this._predicate,l=this._object;o?this._emit(l,a,s,n):this._emit(s,a,l,n)}return i&&(this._annotation=!0),r}_readBlankNodePunctuation(e){let r;switch(e.type){case";":r=this._readPredicate;break;case",":r=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),r}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||t.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.end-e.start!==e.value.length+2?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,e))}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._contextStack,n=r.length&&r[r.length-1];if(n&&n.type==="item"){let i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let r,n,i=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=i):(r=this._object,this._object=i),this._emit(r,n,i,this._graph),this._readPath}_readBackwardPath(e){let r=this._factory.blankNode(),n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=r):(i=this._object,this._object=r),this._emit(r,n,i,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let r=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<(",e),this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let r=this._readTripleTerm();this._restoreContext("<<",e);let n=this._contextStack,i=n.length&&n[n.length-1];return i&&i.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicateOrReifierTripleEnd):(this._object=r,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return e.type==="IRI"||e.type==="typeIRI"||e.type==="type"||e.type==="prefixed"||e.type==="blank"||e.type==="var"?(this._reifier=this._readEntity(e),this._readPunctuation):(this._readTripleTerm(),this._subject=null,this._readPunctuation(e))}_readTripleTerm(){let e=this._contextStack,r=e.length&&e[e.length-1],n=r?r.graph:void 0,i=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._factory.quad(this._subject,this._predicate,this._object),this._emit(i,this.RDF_REIFIES,this._tripleTerm,n||this.DEFAULTGRAPH),i}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<(":return this._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier}}_emit(e,r,n,i){this._callback(null,this._factory.quad(e,r,n,i||this.DEFAULTGRAPH))}_error(e,r){let n=new Error(`${e} on line ${r.line}.`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Sr}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let r=e.length,n="",i=-1,s=-1,o=0,a="/";for(;i<r;){switch(a){case":":if(s<0&&e[++i]==="/"&&e[++i]==="/")for(;(s=i+1)<r&&e[s]!=="/";)i=s;break;case"?":case"#":i=r;break;case"/":if(e[i+1]===".")switch(a=e[++i+1],a){case"/":n+=e.substring(o,i-1),o=i+1;break;case void 0:case"?":case"#":return n+e.substring(o,i)+e.substr(i+1);case".":if(a=e[++i+1],a===void 0||a==="/"||a==="?"||a==="#"){if(n+=e.substring(o,i-2),(o=n.lastIndexOf("/"))>=s&&(n=n.substr(0,o)),a!=="/")return`${n}/${e.substr(i+1)}`;o=i+1}}}a=e[++i]}return n+e.substring(o)}parse(e,r,n,i){let s,o,a,l;if(r&&(r.onQuad||r.onPrefix||r.onComment||r.onVersion)?(s=r.onQuad,o=r.onPrefix,a=r.onComment,l=r.onVersion):(s=r,o=n,l=i),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Vo++}_`,this._prefixCallback=o||Sr,this._versionCallback=l||Sr,this._inversePredicate=!1,this._quantified=Object.create(null),!s){let f=[],c;if(this._callback=(d,h)=>{d?c=d:h&&f.push(h)},this._lexer.tokenize(e).every(d=>this._readCallback=this._readCallback(d)),c)throw c;return f}let u=(f,c)=>{f!==null?(this._callback(f),this._callback=Sr):this._readCallback&&(this._readCallback=this._readCallback(c))};a&&(this._lexer.comments=!0,u=(f,c)=>{f!==null?(this._callback(f),this._callback=Sr):this._readCallback&&(c.type==="comment"?a(c.value):this._readCallback=this._readCallback(c))}),this._callback=s,this._lexer.tokenize(e,u)}};function Sr(){}function Ko(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(O.rdf.first),t.RDF_REST=e.namedNode(O.rdf.rest),t.RDF_NIL=e.namedNode(O.rdf.nil),t.RDF_REIFIES=e.namedNode(O.rdf.reifies),t.N3_FORALL=e.namedNode(O.r.forAll),t.N3_FORSOME=e.namedNode(O.r.forSome),t.ABBREVIATIONS={a:e.namedNode(O.rdf.type),"=":e.namedNode(O.owl.sameAs),">":e.namedNode(O.log.implies),"<":e.namedNode(O.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Pe.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];Ko(Pe.prototype,te);var Si={};nt(Si,{inDefaultGraph:()=>Qc,isBlankNode:()=>Gc,isDefaultGraph:()=>_t,isLiteral:()=>Hc,isNamedNode:()=>zc,isQuad:()=>Kc,isVariable:()=>Vc,prefix:()=>Jc,prefixes:()=>Qo});function zc(t){return!!t&&t.termType==="NamedNode"}function Gc(t){return!!t&&t.termType==="BlankNode"}function Hc(t){return!!t&&t.termType==="Literal"}function Vc(t){return!!t&&t.termType==="Variable"}function Kc(t){return!!t&&t.termType==="Quad"}function _t(t){return!!t&&t.termType==="DefaultGraph"}function Qc(t){return _t(t.graph)}function Jc(t,e){return Qo({"":t.value||t},e)("")}function Qo(t,e){let r=Object.create(null);for(let i in t)n(i,t[i]);e=e||te;function n(i,s){if(typeof s=="string"){let o=Object.create(null);r[i]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(i in r))throw new Error(`Unknown prefix: ${i}`);return r[i]}return n}function qt(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var Yc=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Zc=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Jo="./",Xc="../",Ei="?",Yo="#",yt=class t{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Yc.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!t.supports(this.base))return this._baseMatcher=/.^/;let e=/^[^:]*:\/*/.exec(this.base)[0],r=["^",qt(e)],n=[],i=[],s=/[^/?#]*([/?#])/y,o,a=0,l=0,u=s.lastIndex=e.length;for(;!a&&!l&&(o=s.exec(this.base));)o[1]===Yo?l=s.lastIndex-1:(r.push(qt(o[0]),"(?:"),n.push(")?"),o[1]!==Ei?i.push(u=s.lastIndex):(a=u=s.lastIndex,l=this.base.indexOf(Yo,a),this._pathReplacements[a]=Ei));for(let f=0;f<i.length;f++)this._pathReplacements[i[f]]=Xc.repeat(i.length-f-1);return this._pathReplacements[i[i.length-1]]=Jo,this._baseLength=l>0?l:this.base.length,r.push(qt(this.base.substring(u,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...r,...n].join(""))}toRelative(e){let r=this._getBaseMatcher().exec(e);if(!r)return e;let n=r[0].length;if(n===this._baseLength&&n===e.length)return"";let i=this._pathReplacements[n];if(i){let s=e.substring(n);return i!==Ei&&!Zc.test(s)?e:i===Jo&&/^[^?#]/.test(s)?s:i+s}return e.substring(n-1)}};var Er=te.defaultGraph(),{rdf:ed,xsd:Wt}=O,Zo=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Xo=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,td={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},bt=class extends ee{equals(e){return e===this}},_e=class{constructor(e,r){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let n="";this._outputStream={write(i,s,o){n+=i,o&&o()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Er,this._prefixIRIs=Object.create(null),r.prefixes&&this.addPrefixes(r.prefixes),r.baseIRI&&(this._baseIri=new yt(r.baseIRI)))}get _inDefaultGraph(){return Er.equals(this._graph)}_write(e,r){this._outputStream.write(e,"utf8",r)}_writeQuad(e,r,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
4
4
|
`:`
|
|
5
5
|
}
|