@eluvio/elv-player-js 2.0.38 → 2.0.39

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.
@@ -324,7 +324,7 @@ ${o} ${WZ(e)}
324
324
  * @author Feross Aboukhadijeh <https://feross.org>
325
325
  * @license MIT
326
326
  */(function(n){const e=ZP(),t=XP(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=c,n.SlowBuffer=N,n.INSPECT_MAX_BYTES=50;const i=2147483647;n.kMaxLength=i,c.TYPED_ARRAY_SUPPORT=o(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const Z=new Uint8Array(1),$={foo:function(){return 42}};return Object.setPrototypeOf($,Uint8Array.prototype),Object.setPrototypeOf(Z,$),Z.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u(Z){if(Z>i)throw new RangeError('The value "'+Z+'" is invalid for option "size"');const $=new Uint8Array(Z);return Object.setPrototypeOf($,c.prototype),$}function c(Z,$,W){if(typeof Z=="number"){if(typeof $=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(Z)}return p(Z,$,W)}c.poolSize=8192;function p(Z,$,W){if(typeof Z=="string")return b(Z,$);if(ArrayBuffer.isView(Z))return S(Z);if(Z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Z);if(Ne(Z,ArrayBuffer)||Z&&Ne(Z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(Z,SharedArrayBuffer)||Z&&Ne(Z.buffer,SharedArrayBuffer)))return A(Z,$,W);if(typeof Z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ge=Z.valueOf&&Z.valueOf();if(ge!=null&&ge!==Z)return c.from(ge,$,W);const _e=k(Z);if(_e)return _e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Z[Symbol.toPrimitive]=="function")return c.from(Z[Symbol.toPrimitive]("string"),$,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Z)}c.from=function(Z,$,W){return p(Z,$,W)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function h(Z){if(typeof Z!="number")throw new TypeError('"size" argument must be of type number');if(Z<0)throw new RangeError('The value "'+Z+'" is invalid for option "size"')}function m(Z,$,W){return h(Z),Z<=0?u(Z):$!==void 0?typeof W=="string"?u(Z).fill($,W):u(Z).fill($):u(Z)}c.alloc=function(Z,$,W){return m(Z,$,W)};function w(Z){return h(Z),u(Z<0?0:R(Z)|0)}c.allocUnsafe=function(Z){return w(Z)},c.allocUnsafeSlow=function(Z){return w(Z)};function b(Z,$){if((typeof $!="string"||$==="")&&($="utf8"),!c.isEncoding($))throw new TypeError("Unknown encoding: "+$);const W=P(Z,$)|0;let ge=u(W);const _e=ge.write(Z,$);return _e!==W&&(ge=ge.slice(0,_e)),ge}function g(Z){const $=Z.length<0?0:R(Z.length)|0,W=u($);for(let ge=0;ge<$;ge+=1)W[ge]=Z[ge]&255;return W}function S(Z){if(Ne(Z,Uint8Array)){const $=new Uint8Array(Z);return A($.buffer,$.byteOffset,$.byteLength)}return g(Z)}function A(Z,$,W){if($<0||Z.byteLength<$)throw new RangeError('"offset" is outside of buffer bounds');if(Z.byteLength<$+(W||0))throw new RangeError('"length" is outside of buffer bounds');let ge;return $===void 0&&W===void 0?ge=new Uint8Array(Z):W===void 0?ge=new Uint8Array(Z,$):ge=new Uint8Array(Z,$,W),Object.setPrototypeOf(ge,c.prototype),ge}function k(Z){if(c.isBuffer(Z)){const $=R(Z.length)|0,W=u($);return W.length===0||Z.copy(W,0,0,$),W}if(Z.length!==void 0)return typeof Z.length!="number"||Qe(Z.length)?u(0):g(Z);if(Z.type==="Buffer"&&Array.isArray(Z.data))return g(Z.data)}function R(Z){if(Z>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Z|0}function N(Z){return+Z!=Z&&(Z=0),c.alloc(+Z)}c.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==c.prototype},c.compare=function($,W){if(Ne($,Uint8Array)&&($=c.from($,$.offset,$.byteLength)),Ne(W,Uint8Array)&&(W=c.from(W,W.offset,W.byteLength)),!c.isBuffer($)||!c.isBuffer(W))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===W)return 0;let ge=$.length,_e=W.length;for(let Re=0,Be=Math.min(ge,_e);Re<Be;++Re)if($[Re]!==W[Re]){ge=$[Re],_e=W[Re];break}return ge<_e?-1:_e<ge?1:0},c.isEncoding=function($){switch(String($).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}},c.concat=function($,W){if(!Array.isArray($))throw new TypeError('"list" argument must be an Array of Buffers');if($.length===0)return c.alloc(0);let ge;if(W===void 0)for(W=0,ge=0;ge<$.length;++ge)W+=$[ge].length;const _e=c.allocUnsafe(W);let Re=0;for(ge=0;ge<$.length;++ge){let Be=$[ge];if(Ne(Be,Uint8Array))Re+Be.length>_e.length?(c.isBuffer(Be)||(Be=c.from(Be)),Be.copy(_e,Re)):Uint8Array.prototype.set.call(_e,Be,Re);else if(c.isBuffer(Be))Be.copy(_e,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=Be.length}return _e};function P(Z,$){if(c.isBuffer(Z))return Z.length;if(ArrayBuffer.isView(Z)||Ne(Z,ArrayBuffer))return Z.byteLength;if(typeof Z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Z);const W=Z.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&W===0)return 0;let _e=!1;for(;;)switch($){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return I(Z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W*2;case"hex":return W>>>1;case"base64":return ue(Z).length;default:if(_e)return ge?-1:I(Z).length;$=(""+$).toLowerCase(),_e=!0}}c.byteLength=P;function q(Z,$,W){let ge=!1;if(($===void 0||$<0)&&($=0),$>this.length||((W===void 0||W>this.length)&&(W=this.length),W<=0)||(W>>>=0,$>>>=0,W<=$))return"";for(Z||(Z="utf8");;)switch(Z){case"hex":return Q(this,$,W);case"utf8":case"utf-8":return x(this,$,W);case"ascii":return F(this,$,W);case"latin1":case"binary":return H(this,$,W);case"base64":return C(this,$,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,$,W);default:if(ge)throw new TypeError("Unknown encoding: "+Z);Z=(Z+"").toLowerCase(),ge=!0}}c.prototype._isBuffer=!0;function V(Z,$,W){const ge=Z[$];Z[$]=Z[W],Z[W]=ge}c.prototype.swap16=function(){const $=this.length;if($%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;W<$;W+=2)V(this,W,W+1);return this},c.prototype.swap32=function(){const $=this.length;if($%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let W=0;W<$;W+=4)V(this,W,W+3),V(this,W+1,W+2);return this},c.prototype.swap64=function(){const $=this.length;if($%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let W=0;W<$;W+=8)V(this,W,W+7),V(this,W+1,W+6),V(this,W+2,W+5),V(this,W+3,W+4);return this},c.prototype.toString=function(){const $=this.length;return $===0?"":arguments.length===0?x(this,0,$):q.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function($){if(!c.isBuffer($))throw new TypeError("Argument must be a Buffer");return this===$?!0:c.compare(this,$)===0},c.prototype.inspect=function(){let $="";const W=n.INSPECT_MAX_BYTES;return $=this.toString("hex",0,W).replace(/(.{2})/g,"$1 ").trim(),this.length>W&&($+=" ... "),"<Buffer "+$+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function($,W,ge,_e,Re){if(Ne($,Uint8Array)&&($=c.from($,$.offset,$.byteLength)),!c.isBuffer($))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(W===void 0&&(W=0),ge===void 0&&(ge=$?$.length:0),_e===void 0&&(_e=0),Re===void 0&&(Re=this.length),W<0||ge>$.length||_e<0||Re>this.length)throw new RangeError("out of range index");if(_e>=Re&&W>=ge)return 0;if(_e>=Re)return-1;if(W>=ge)return 1;if(W>>>=0,ge>>>=0,_e>>>=0,Re>>>=0,this===$)return 0;let Be=Re-_e,wt=ge-W;const yt=Math.min(Be,wt),gt=this.slice(_e,Re),At=$.slice(W,ge);for(let Ot=0;Ot<yt;++Ot)if(gt[Ot]!==At[Ot]){Be=gt[Ot],wt=At[Ot];break}return Be<wt?-1:wt<Be?1:0};function de(Z,$,W,ge,_e){if(Z.length===0)return-1;if(typeof W=="string"?(ge=W,W=0):W>2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),W=+W,Qe(W)&&(W=_e?0:Z.length-1),W<0&&(W=Z.length+W),W>=Z.length){if(_e)return-1;W=Z.length-1}else if(W<0)if(_e)W=0;else return-1;if(typeof $=="string"&&($=c.from($,ge)),c.isBuffer($))return $.length===0?-1:oe(Z,$,W,ge,_e);if(typeof $=="number")return $=$&255,typeof Uint8Array.prototype.indexOf=="function"?_e?Uint8Array.prototype.indexOf.call(Z,$,W):Uint8Array.prototype.lastIndexOf.call(Z,$,W):oe(Z,[$],W,ge,_e);throw new TypeError("val must be string, number or Buffer")}function oe(Z,$,W,ge,_e){let Re=1,Be=Z.length,wt=$.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(Z.length<2||$.length<2)return-1;Re=2,Be/=2,wt/=2,W/=2}function yt(At,Ot){return Re===1?At[Ot]:At.readUInt16BE(Ot*Re)}let gt;if(_e){let At=-1;for(gt=W;gt<Be;gt++)if(yt(Z,gt)===yt($,At===-1?0:gt-At)){if(At===-1&&(At=gt),gt-At+1===wt)return At*Re}else At!==-1&&(gt-=gt-At),At=-1}else for(W+wt>Be&&(W=Be-wt),gt=W;gt>=0;gt--){let At=!0;for(let Ot=0;Ot<wt;Ot++)if(yt(Z,gt+Ot)!==yt($,Ot)){At=!1;break}if(At)return gt}return-1}c.prototype.includes=function($,W,ge){return this.indexOf($,W,ge)!==-1},c.prototype.indexOf=function($,W,ge){return de(this,$,W,ge,!0)},c.prototype.lastIndexOf=function($,W,ge){return de(this,$,W,ge,!1)};function he(Z,$,W,ge){W=Number(W)||0;const _e=Z.length-W;ge?(ge=Number(ge),ge>_e&&(ge=_e)):ge=_e;const Re=$.length;ge>Re/2&&(ge=Re/2);let Be;for(Be=0;Be<ge;++Be){const wt=parseInt($.substr(Be*2,2),16);if(Qe(wt))return Be;Z[W+Be]=wt}return Be}function Se(Z,$,W,ge){return Ee(I($,Z.length-W),Z,W,ge)}function Ce(Z,$,W,ge){return Ee(U($),Z,W,ge)}function ne(Z,$,W,ge){return Ee(ue($),Z,W,ge)}function Le(Z,$,W,ge){return Ee(te($,Z.length-W),Z,W,ge)}c.prototype.write=function($,W,ge,_e){if(W===void 0)_e="utf8",ge=this.length,W=0;else if(ge===void 0&&typeof W=="string")_e=W,ge=this.length,W=0;else if(isFinite(W))W=W>>>0,isFinite(ge)?(ge=ge>>>0,_e===void 0&&(_e="utf8")):(_e=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-W;if((ge===void 0||ge>Re)&&(ge=Re),$.length>0&&(ge<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");_e||(_e="utf8");let Be=!1;for(;;)switch(_e){case"hex":return he(this,$,W,ge);case"utf8":case"utf-8":return Se(this,$,W,ge);case"ascii":case"latin1":case"binary":return Ce(this,$,W,ge);case"base64":return ne(this,$,W,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,$,W,ge);default:if(Be)throw new TypeError("Unknown encoding: "+_e);_e=(""+_e).toLowerCase(),Be=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(Z,$,W){return $===0&&W===Z.length?e.fromByteArray(Z):e.fromByteArray(Z.slice($,W))}function x(Z,$,W){W=Math.min(Z.length,W);const ge=[];let _e=$;for(;_e<W;){const Re=Z[_e];let Be=null,wt=Re>239?4:Re>223?3:Re>191?2:1;if(_e+wt<=W){let yt,gt,At,Ot;switch(wt){case 1:Re<128&&(Be=Re);break;case 2:yt=Z[_e+1],(yt&192)===128&&(Ot=(Re&31)<<6|yt&63,Ot>127&&(Be=Ot));break;case 3:yt=Z[_e+1],gt=Z[_e+2],(yt&192)===128&&(gt&192)===128&&(Ot=(Re&15)<<12|(yt&63)<<6|gt&63,Ot>2047&&(Ot<55296||Ot>57343)&&(Be=Ot));break;case 4:yt=Z[_e+1],gt=Z[_e+2],At=Z[_e+3],(yt&192)===128&&(gt&192)===128&&(At&192)===128&&(Ot=(Re&15)<<18|(yt&63)<<12|(gt&63)<<6|At&63,Ot>65535&&Ot<1114112&&(Be=Ot))}}Be===null?(Be=65533,wt=1):Be>65535&&(Be-=65536,ge.push(Be>>>10&1023|55296),Be=56320|Be&1023),ge.push(Be),_e+=wt}return z(ge)}const O=4096;function z(Z){const $=Z.length;if($<=O)return String.fromCharCode.apply(String,Z);let W="",ge=0;for(;ge<$;)W+=String.fromCharCode.apply(String,Z.slice(ge,ge+=O));return W}function F(Z,$,W){let ge="";W=Math.min(Z.length,W);for(let _e=$;_e<W;++_e)ge+=String.fromCharCode(Z[_e]&127);return ge}function H(Z,$,W){let ge="";W=Math.min(Z.length,W);for(let _e=$;_e<W;++_e)ge+=String.fromCharCode(Z[_e]);return ge}function Q(Z,$,W){const ge=Z.length;(!$||$<0)&&($=0),(!W||W<0||W>ge)&&(W=ge);let _e="";for(let Re=$;Re<W;++Re)_e+=st[Z[Re]];return _e}function ae(Z,$,W){const ge=Z.slice($,W);let _e="";for(let Re=0;Re<ge.length-1;Re+=2)_e+=String.fromCharCode(ge[Re]+ge[Re+1]*256);return _e}c.prototype.slice=function($,W){const ge=this.length;$=~~$,W=W===void 0?ge:~~W,$<0?($+=ge,$<0&&($=0)):$>ge&&($=ge),W<0?(W+=ge,W<0&&(W=0)):W>ge&&(W=ge),W<$&&(W=$);const _e=this.subarray($,W);return Object.setPrototypeOf(_e,c.prototype),_e};function L(Z,$,W){if(Z%1!==0||Z<0)throw new RangeError("offset is not uint");if(Z+$>W)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function($,W,ge){$=$>>>0,W=W>>>0,ge||L($,W,this.length);let _e=this[$],Re=1,Be=0;for(;++Be<W&&(Re*=256);)_e+=this[$+Be]*Re;return _e},c.prototype.readUintBE=c.prototype.readUIntBE=function($,W,ge){$=$>>>0,W=W>>>0,ge||L($,W,this.length);let _e=this[$+--W],Re=1;for(;W>0&&(Re*=256);)_e+=this[$+--W]*Re;return _e},c.prototype.readUint8=c.prototype.readUInt8=function($,W){return $=$>>>0,W||L($,1,this.length),this[$]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function($,W){return $=$>>>0,W||L($,2,this.length),this[$]|this[$+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function($,W){return $=$>>>0,W||L($,2,this.length),this[$]<<8|this[$+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function($,W){return $=$>>>0,W||L($,4,this.length),(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function($,W){return $=$>>>0,W||L($,4,this.length),this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])},c.prototype.readBigUInt64LE=_t(function($){$=$>>>0,le($,"offset");const W=this[$],ge=this[$+7];(W===void 0||ge===void 0)&&re($,this.length-8);const _e=W+this[++$]*2**8+this[++$]*2**16+this[++$]*2**24,Re=this[++$]+this[++$]*2**8+this[++$]*2**16+ge*2**24;return BigInt(_e)+(BigInt(Re)<<BigInt(32))}),c.prototype.readBigUInt64BE=_t(function($){$=$>>>0,le($,"offset");const W=this[$],ge=this[$+7];(W===void 0||ge===void 0)&&re($,this.length-8);const _e=W*2**24+this[++$]*2**16+this[++$]*2**8+this[++$],Re=this[++$]*2**24+this[++$]*2**16+this[++$]*2**8+ge;return(BigInt(_e)<<BigInt(32))+BigInt(Re)}),c.prototype.readIntLE=function($,W,ge){$=$>>>0,W=W>>>0,ge||L($,W,this.length);let _e=this[$],Re=1,Be=0;for(;++Be<W&&(Re*=256);)_e+=this[$+Be]*Re;return Re*=128,_e>=Re&&(_e-=Math.pow(2,8*W)),_e},c.prototype.readIntBE=function($,W,ge){$=$>>>0,W=W>>>0,ge||L($,W,this.length);let _e=W,Re=1,Be=this[$+--_e];for(;_e>0&&(Re*=256);)Be+=this[$+--_e]*Re;return Re*=128,Be>=Re&&(Be-=Math.pow(2,8*W)),Be},c.prototype.readInt8=function($,W){return $=$>>>0,W||L($,1,this.length),this[$]&128?(255-this[$]+1)*-1:this[$]},c.prototype.readInt16LE=function($,W){$=$>>>0,W||L($,2,this.length);const ge=this[$]|this[$+1]<<8;return ge&32768?ge|4294901760:ge},c.prototype.readInt16BE=function($,W){$=$>>>0,W||L($,2,this.length);const ge=this[$+1]|this[$]<<8;return ge&32768?ge|4294901760:ge},c.prototype.readInt32LE=function($,W){return $=$>>>0,W||L($,4,this.length),this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24},c.prototype.readInt32BE=function($,W){return $=$>>>0,W||L($,4,this.length),this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]},c.prototype.readBigInt64LE=_t(function($){$=$>>>0,le($,"offset");const W=this[$],ge=this[$+7];(W===void 0||ge===void 0)&&re($,this.length-8);const _e=this[$+4]+this[$+5]*2**8+this[$+6]*2**16+(ge<<24);return(BigInt(_e)<<BigInt(32))+BigInt(W+this[++$]*2**8+this[++$]*2**16+this[++$]*2**24)}),c.prototype.readBigInt64BE=_t(function($){$=$>>>0,le($,"offset");const W=this[$],ge=this[$+7];(W===void 0||ge===void 0)&&re($,this.length-8);const _e=(W<<24)+this[++$]*2**16+this[++$]*2**8+this[++$];return(BigInt(_e)<<BigInt(32))+BigInt(this[++$]*2**24+this[++$]*2**16+this[++$]*2**8+ge)}),c.prototype.readFloatLE=function($,W){return $=$>>>0,W||L($,4,this.length),t.read(this,$,!0,23,4)},c.prototype.readFloatBE=function($,W){return $=$>>>0,W||L($,4,this.length),t.read(this,$,!1,23,4)},c.prototype.readDoubleLE=function($,W){return $=$>>>0,W||L($,8,this.length),t.read(this,$,!0,52,8)},c.prototype.readDoubleBE=function($,W){return $=$>>>0,W||L($,8,this.length),t.read(this,$,!1,52,8)};function T(Z,$,W,ge,_e,Re){if(!c.isBuffer(Z))throw new TypeError('"buffer" argument must be a Buffer instance');if($>_e||$<Re)throw new RangeError('"value" argument is out of bounds');if(W+ge>Z.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function($,W,ge,_e){if($=+$,W=W>>>0,ge=ge>>>0,!_e){const wt=Math.pow(2,8*ge)-1;T(this,$,W,ge,wt,0)}let Re=1,Be=0;for(this[W]=$&255;++Be<ge&&(Re*=256);)this[W+Be]=$/Re&255;return W+ge},c.prototype.writeUintBE=c.prototype.writeUIntBE=function($,W,ge,_e){if($=+$,W=W>>>0,ge=ge>>>0,!_e){const wt=Math.pow(2,8*ge)-1;T(this,$,W,ge,wt,0)}let Re=ge-1,Be=1;for(this[W+Re]=$&255;--Re>=0&&(Be*=256);)this[W+Re]=$/Be&255;return W+ge},c.prototype.writeUint8=c.prototype.writeUInt8=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,1,255,0),this[W]=$&255,W+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,2,65535,0),this[W]=$&255,this[W+1]=$>>>8,W+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,2,65535,0),this[W]=$>>>8,this[W+1]=$&255,W+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,4,4294967295,0),this[W+3]=$>>>24,this[W+2]=$>>>16,this[W+1]=$>>>8,this[W]=$&255,W+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,4,4294967295,0),this[W]=$>>>24,this[W+1]=$>>>16,this[W+2]=$>>>8,this[W+3]=$&255,W+4};function Y(Z,$,W,ge,_e){pe($,ge,_e,Z,W,7);let Re=Number($&BigInt(4294967295));Z[W++]=Re,Re=Re>>8,Z[W++]=Re,Re=Re>>8,Z[W++]=Re,Re=Re>>8,Z[W++]=Re;let Be=Number($>>BigInt(32)&BigInt(4294967295));return Z[W++]=Be,Be=Be>>8,Z[W++]=Be,Be=Be>>8,Z[W++]=Be,Be=Be>>8,Z[W++]=Be,W}function ee(Z,$,W,ge,_e){pe($,ge,_e,Z,W,7);let Re=Number($&BigInt(4294967295));Z[W+7]=Re,Re=Re>>8,Z[W+6]=Re,Re=Re>>8,Z[W+5]=Re,Re=Re>>8,Z[W+4]=Re;let Be=Number($>>BigInt(32)&BigInt(4294967295));return Z[W+3]=Be,Be=Be>>8,Z[W+2]=Be,Be=Be>>8,Z[W+1]=Be,Be=Be>>8,Z[W]=Be,W+8}c.prototype.writeBigUInt64LE=_t(function($,W=0){return Y(this,$,W,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=_t(function($,W=0){return ee(this,$,W,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function($,W,ge,_e){if($=+$,W=W>>>0,!_e){const yt=Math.pow(2,8*ge-1);T(this,$,W,ge,yt-1,-yt)}let Re=0,Be=1,wt=0;for(this[W]=$&255;++Re<ge&&(Be*=256);)$<0&&wt===0&&this[W+Re-1]!==0&&(wt=1),this[W+Re]=($/Be>>0)-wt&255;return W+ge},c.prototype.writeIntBE=function($,W,ge,_e){if($=+$,W=W>>>0,!_e){const yt=Math.pow(2,8*ge-1);T(this,$,W,ge,yt-1,-yt)}let Re=ge-1,Be=1,wt=0;for(this[W+Re]=$&255;--Re>=0&&(Be*=256);)$<0&&wt===0&&this[W+Re+1]!==0&&(wt=1),this[W+Re]=($/Be>>0)-wt&255;return W+ge},c.prototype.writeInt8=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,1,127,-128),$<0&&($=255+$+1),this[W]=$&255,W+1},c.prototype.writeInt16LE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,2,32767,-32768),this[W]=$&255,this[W+1]=$>>>8,W+2},c.prototype.writeInt16BE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,2,32767,-32768),this[W]=$>>>8,this[W+1]=$&255,W+2},c.prototype.writeInt32LE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,4,2147483647,-2147483648),this[W]=$&255,this[W+1]=$>>>8,this[W+2]=$>>>16,this[W+3]=$>>>24,W+4},c.prototype.writeInt32BE=function($,W,ge){return $=+$,W=W>>>0,ge||T(this,$,W,4,2147483647,-2147483648),$<0&&($=4294967295+$+1),this[W]=$>>>24,this[W+1]=$>>>16,this[W+2]=$>>>8,this[W+3]=$&255,W+4},c.prototype.writeBigInt64LE=_t(function($,W=0){return Y(this,$,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=_t(function($,W=0){return ee(this,$,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function j(Z,$,W,ge,_e,Re){if(W+ge>Z.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function be(Z,$,W,ge,_e){return $=+$,W=W>>>0,_e||j(Z,$,W,4),t.write(Z,$,W,ge,23,4),W+4}c.prototype.writeFloatLE=function($,W,ge){return be(this,$,W,!0,ge)},c.prototype.writeFloatBE=function($,W,ge){return be(this,$,W,!1,ge)};function Ie(Z,$,W,ge,_e){return $=+$,W=W>>>0,_e||j(Z,$,W,8),t.write(Z,$,W,ge,52,8),W+8}c.prototype.writeDoubleLE=function($,W,ge){return Ie(this,$,W,!0,ge)},c.prototype.writeDoubleBE=function($,W,ge){return Ie(this,$,W,!1,ge)},c.prototype.copy=function($,W,ge,_e){if(!c.isBuffer($))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!_e&&_e!==0&&(_e=this.length),W>=$.length&&(W=$.length),W||(W=0),_e>0&&_e<ge&&(_e=ge),_e===ge||$.length===0||this.length===0)return 0;if(W<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(_e<0)throw new RangeError("sourceEnd out of bounds");_e>this.length&&(_e=this.length),$.length-W<_e-ge&&(_e=$.length-W+ge);const Re=_e-ge;return this===$&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(W,ge,_e):Uint8Array.prototype.set.call($,this.subarray(ge,_e),W),Re},c.prototype.fill=function($,W,ge,_e){if(typeof $=="string"){if(typeof W=="string"?(_e=W,W=0,ge=this.length):typeof ge=="string"&&(_e=ge,ge=this.length),_e!==void 0&&typeof _e!="string")throw new TypeError("encoding must be a string");if(typeof _e=="string"&&!c.isEncoding(_e))throw new TypeError("Unknown encoding: "+_e);if($.length===1){const Be=$.charCodeAt(0);(_e==="utf8"&&Be<128||_e==="latin1")&&($=Be)}}else typeof $=="number"?$=$&255:typeof $=="boolean"&&($=Number($));if(W<0||this.length<W||this.length<ge)throw new RangeError("Out of range index");if(ge<=W)return this;W=W>>>0,ge=ge===void 0?this.length:ge>>>0,$||($=0);let Re;if(typeof $=="number")for(Re=W;Re<ge;++Re)this[Re]=$;else{const Be=c.isBuffer($)?$:c.from($,_e),wt=Be.length;if(wt===0)throw new TypeError('The value "'+$+'" is invalid for argument "value"');for(Re=0;Re<ge-W;++Re)this[Re+W]=Be[Re%wt]}return this};const Me={};function De(Z,$,W){Me[Z]=class extends W{constructor(){super(),Object.defineProperty(this,"message",{value:$.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Z}]`,this.stack,delete this.name}get code(){return Z}set code(_e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_e,writable:!0})}toString(){return`${this.name} [${Z}]: ${this.message}`}}}De("ERR_BUFFER_OUT_OF_BOUNDS",function(Z){return Z?`${Z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),De("ERR_INVALID_ARG_TYPE",function(Z,$){return`The "${Z}" argument must be of type number. Received type ${typeof $}`},TypeError),De("ERR_OUT_OF_RANGE",function(Z,$,W){let ge=`The value of "${Z}" is out of range.`,_e=W;return Number.isInteger(W)&&Math.abs(W)>2**32?_e=se(String(W)):typeof W=="bigint"&&(_e=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(_e=se(_e)),_e+="n"),ge+=` It must be ${$}. Received ${_e}`,ge},RangeError);function se(Z){let $="",W=Z.length;const ge=Z[0]==="-"?1:0;for(;W>=ge+4;W-=3)$=`_${Z.slice(W-3,W)}${$}`;return`${Z.slice(0,W)}${$}`}function fe(Z,$,W){le($,"offset"),(Z[$]===void 0||Z[$+W]===void 0)&&re($,Z.length-(W+1))}function pe(Z,$,W,ge,_e,Re){if(Z>W||Z<$){const Be=typeof $=="bigint"?"n":"";let wt;throw $===0||$===BigInt(0)?wt=`>= 0${Be} and < 2${Be} ** ${(Re+1)*8}${Be}`:wt=`>= -(2${Be} ** ${(Re+1)*8-1}${Be}) and < 2 ** ${(Re+1)*8-1}${Be}`,new Me.ERR_OUT_OF_RANGE("value",wt,Z)}fe(ge,_e,Re)}function le(Z,$){if(typeof Z!="number")throw new Me.ERR_INVALID_ARG_TYPE($,"number",Z)}function re(Z,$,W){throw Math.floor(Z)!==Z?(le(Z,W),new Me.ERR_OUT_OF_RANGE("offset","an integer",Z)):$<0?new Me.ERR_BUFFER_OUT_OF_BOUNDS:new Me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${$}`,Z)}const me=/[^+/0-9A-Za-z-_]/g;function J(Z){if(Z=Z.split("=")[0],Z=Z.trim().replace(me,""),Z.length<2)return"";for(;Z.length%4!==0;)Z=Z+"=";return Z}function I(Z,$){$=$||1/0;let W;const ge=Z.length;let _e=null;const Re=[];for(let Be=0;Be<ge;++Be){if(W=Z.charCodeAt(Be),W>55295&&W<57344){if(!_e){if(W>56319){($-=3)>-1&&Re.push(239,191,189);continue}else if(Be+1===ge){($-=3)>-1&&Re.push(239,191,189);continue}_e=W;continue}if(W<56320){($-=3)>-1&&Re.push(239,191,189),_e=W;continue}W=(_e-55296<<10|W-56320)+65536}else _e&&($-=3)>-1&&Re.push(239,191,189);if(_e=null,W<128){if(($-=1)<0)break;Re.push(W)}else if(W<2048){if(($-=2)<0)break;Re.push(W>>6|192,W&63|128)}else if(W<65536){if(($-=3)<0)break;Re.push(W>>12|224,W>>6&63|128,W&63|128)}else if(W<1114112){if(($-=4)<0)break;Re.push(W>>18|240,W>>12&63|128,W>>6&63|128,W&63|128)}else throw new Error("Invalid code point")}return Re}function U(Z){const $=[];for(let W=0;W<Z.length;++W)$.push(Z.charCodeAt(W)&255);return $}function te(Z,$){let W,ge,_e;const Re=[];for(let Be=0;Be<Z.length&&!(($-=2)<0);++Be)W=Z.charCodeAt(Be),ge=W>>8,_e=W%256,Re.push(_e),Re.push(ge);return Re}function ue(Z){return e.toByteArray(J(Z))}function Ee(Z,$,W,ge){let _e;for(_e=0;_e<ge&&!(_e+W>=$.length||_e>=Z.length);++_e)$[_e+W]=Z[_e];return _e}function Ne(Z,$){return Z instanceof $||Z!=null&&Z.constructor!=null&&Z.constructor.name!=null&&Z.constructor.name===$.name}function Qe(Z){return Z!==Z}const st=function(){const Z="0123456789abcdef",$=new Array(256);for(let W=0;W<16;++W){const ge=W*16;for(let _e=0;_e<16;++_e)$[ge+_e]=Z[W]+Z[_e]}return $}();function _t(Z){return typeof BigInt>"u"?Et:Z}function Et(){throw new Error("BigInt not supported")}})(qd);var ma={ArrayIsArray(n){return Array.isArray(n)},ArrayPrototypeIncludes(n,e){return n.includes(e)},ArrayPrototypeIndexOf(n,e){return n.indexOf(e)},ArrayPrototypeJoin(n,e){return n.join(e)},ArrayPrototypeMap(n,e){return n.map(e)},ArrayPrototypePop(n,e){return n.pop(e)},ArrayPrototypePush(n,e){return n.push(e)},ArrayPrototypeSlice(n,e,t){return n.slice(e,t)},Error,FunctionPrototypeCall(n,e,...t){return n.call(e,...t)},FunctionPrototypeSymbolHasInstance(n,e){return Function.prototype[Symbol.hasInstance].call(n,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(n,e){return Object.defineProperties(n,e)},ObjectDefineProperty(n,e,t){return Object.defineProperty(n,e,t)},ObjectGetOwnPropertyDescriptor(n,e){return Object.getOwnPropertyDescriptor(n,e)},ObjectKeys(n){return Object.keys(n)},ObjectSetPrototypeOf(n,e){return Object.setPrototypeOf(n,e)},Promise,PromisePrototypeCatch(n,e){return n.catch(e)},PromisePrototypeThen(n,e,t){return n.then(e,t)},PromiseReject(n){return Promise.reject(n)},PromiseResolve(n){return Promise.resolve(n)},ReflectApply:Reflect.apply,RegExpPrototypeTest(n,e){return n.test(e)},SafeSet:Set,String,StringPrototypeSlice(n,e,t){return n.slice(e,t)},StringPrototypeToLowerCase(n){return n.toLowerCase()},StringPrototypeToUpperCase(n){return n.toUpperCase()},StringPrototypeTrim(n){return n.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(n,e,t){return n.set(e,t)},Boolean,Uint8Array},kF={exports:{}},jv={exports:{}},fN;function Rb(){if(fN)return jv.exports;fN=1;const{AbortController:n,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return jv.exports=n,jv.exports.AbortSignal=e,jv.exports.default=n,jv.exports}var F5={exports:{}},qy=typeof Reflect=="object"?Reflect:null,dN=qy&&typeof qy.apply=="function"?qy.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Px;qy&&typeof qy.ownKeys=="function"?Px=qy.ownKeys:Object.getOwnPropertySymbols?Px=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Px=function(e){return Object.getOwnPropertyNames(e)};function sae(n){console&&console.warn&&console.warn(n)}var MF=Number.isNaN||function(e){return e!==e};function Ar(){Ar.init.call(this)}F5.exports=Ar;F5.exports.once=cae;Ar.EventEmitter=Ar;Ar.prototype._events=void 0;Ar.prototype._eventsCount=0;Ar.prototype._maxListeners=void 0;var pN=10;function B2(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Ar,"defaultMaxListeners",{enumerable:!0,get:function(){return pN},set:function(n){if(typeof n!="number"||n<0||MF(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");pN=n}});Ar.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};Ar.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||MF(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 TF(n){return n._maxListeners===void 0?Ar.defaultMaxListeners:n._maxListeners}Ar.prototype.getMaxListeners=function(){return TF(this)};Ar.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var c=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw c.context=u,c}var p=o[e];if(p===void 0)return!1;if(typeof p=="function")dN(p,this,t);else for(var h=p.length,m=PF(p,h),r=0;r<h;++r)dN(m[r],this,t);return!0};function RF(n,e,t,r){var i,o,u;if(B2(t),o=n._events,o===void 0?(o=n._events=Object.create(null),n._eventsCount=0):(o.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),o=n._events),u=o[e]),u===void 0)u=o[e]=t,++n._eventsCount;else if(typeof u=="function"?u=o[e]=r?[t,u]:[u,t]:r?u.unshift(t):u.push(t),i=TF(n),i>0&&u.length>i&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=n,c.type=e,c.count=u.length,sae(c)}return n}Ar.prototype.addListener=function(e,t){return RF(this,e,t,!1)};Ar.prototype.on=Ar.prototype.addListener;Ar.prototype.prependListener=function(e,t){return RF(this,e,t,!0)};function oae(){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 OF(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},i=oae.bind(r);return i.listener=t,r.wrapFn=i,i}Ar.prototype.once=function(e,t){return B2(t),this.on(e,OF(this,e,t)),this};Ar.prototype.prependOnceListener=function(e,t){return B2(t),this.prependListener(e,OF(this,e,t)),this};Ar.prototype.removeListener=function(e,t){var r,i,o,u,c;if(B2(t),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(o=-1,u=r.length-1;u>=0;u--)if(r[u]===t||r[u].listener===t){c=r[u].listener,o=u;break}if(o<0)return this;o===0?r.shift():uae(r,o),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this};Ar.prototype.off=Ar.prototype.removeListener;Ar.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),u;for(i=0;i<o.length;++i)u=o[i],u!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function LF(n,e,t){var r=n._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?lae(i):PF(i,i.length)}Ar.prototype.listeners=function(e){return LF(this,e,!0)};Ar.prototype.rawListeners=function(e){return LF(this,e,!1)};Ar.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):NF.call(n,e)};Ar.prototype.listenerCount=NF;function NF(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ar.prototype.eventNames=function(){return this._eventsCount>0?Px(this._events):[]};function PF(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function uae(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function lae(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function cae(n,e){return new Promise(function(t,r){function i(u){n.removeListener(e,o),r(u)}function o(){typeof n.removeListener=="function"&&n.removeListener("error",i),t([].slice.call(arguments))}IF(n,e,o,{once:!0}),e!=="error"&&fae(n,i,{once:!0})})}function fae(n,e,t){typeof n.on=="function"&&IF(n,"error",e,t)}function IF(n,e,t,r){if(typeof n.on=="function")r.once?n.once(e,t):n.on(e,t);else if(typeof n.addEventListener=="function")n.addEventListener(e,function i(o){r.once&&n.removeEventListener(e,i),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var Wb=F5.exports;(function(n){const e=qd,{kResistStopPropagation:t,SymbolDispose:r}=ma,i=globalThis.AbortSignal||Rb().AbortSignal,o=globalThis.AbortController||Rb().AbortController,u=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||e.Blob,p=typeof c<"u"?function(g){return g instanceof c}:function(g){return!1},h=(b,g)=>{if(b!==void 0&&(b===null||typeof b!="object"||!("aborted"in b)))throw new ERR_INVALID_ARG_TYPE(g,"AbortSignal",b)},m=(b,g)=>{if(typeof b!="function")throw new ERR_INVALID_ARG_TYPE(g,"Function",b)};class w extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let S="";for(let A=0;A<g.length;A++)S+=` ${g[A].stack}
327
- `;super(S),this.name="AggregateError",this.errors=g}}n.exports={AggregateError:w,kEmptyObject:Object.freeze({}),once(b){let g=!1;return function(...S){g||(g=!0,b.apply(this,S))}},createDeferredPromise:function(){let b,g;return{promise:new Promise((A,k)=>{b=A,g=k}),resolve:b,reject:g}},promisify(b){return new Promise((g,S)=>{b((A,...k)=>A?S(A):g(...k))})},debuglog(){return function(){}},format(b,...g){return b.replace(/%([sdifj])/g,function(...[S,A]){const k=g.shift();return A==="f"?k.toFixed(6):A==="j"?JSON.stringify(k):A==="s"&&typeof k=="object"?`${k.constructor!==Object?k.constructor.name:""} {}`.trim():k.toString()})},inspect(b){switch(typeof b){case"string":if(b.includes("'"))if(b.includes('"')){if(!b.includes("`")&&!b.includes("${"))return`\`${b}\``}else return`"${b}"`;return`'${b}'`;case"number":return isNaN(b)?"NaN":Object.is(b,-0)?String(b):b;case"bigint":return`${String(b)}n`;case"boolean":case"undefined":return String(b);case"object":return"{}"}},types:{isAsyncFunction(b){return b instanceof u},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:p,deprecate(b,g){return b},addAbortListener:Wb.addAbortListener||function(g,S){if(g===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",g);h(g,"signal"),m(S,"listener");let A;return g.aborted?queueMicrotask(()=>S()):(g.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{g.removeEventListener("abort",S)}),{__proto__:null,[r](){var k;(k=A)===null||k===void 0||k()}}},AbortSignalAny:i.any||function(g){if(g.length===1)return g[0];const S=new o,A=()=>S.abort();return g.forEach(k=>{h(k,"signals"),k.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{g.forEach(k=>k.removeEventListener("abort",A))},{once:!0}),S.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(kF);var xs=kF.exports,B5={};const{format:dae,inspect:e2,AggregateError:pae}=xs,hae=globalThis.AggregateError||pae,yae=Symbol("kIsNodeError"),mae=["string","function","number","object","Function","Object","boolean","bigint","symbol"],gae=/^([A-Z][a-z0-9]*)+$/,vae="__node_internal_",z2={};function fh(n,e){if(!n)throw new z2.ERR_INTERNAL_ASSERTION(e)}function hN(n){let e="",t=n.length;const r=n[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${n.slice(t-3,t)}${e}`;return`${n.slice(0,t)}${e}`}function bae(n,e,t){if(typeof e=="function")return fh(e.length<=t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);const r=(e.match(/%[dfijoOs]/g)||[]).length;return fh(r===t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${r}).`),t.length===0?e:dae(e,...t)}function Mi(n,e,t){t||(t=Error);class r extends t{constructor(...o){super(bae(n,e,o))}toString(){return`${this.name} [${n}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${n}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=n,r.prototype[yae]=!0,z2[n]=r}function yN(n){const e=vae+n.name;return Object.defineProperty(n,"name",{value:e}),n}function wae(n,e){if(n&&e&&n!==e){if(Array.isArray(e.errors))return e.errors.push(n),e;const t=new hae([e,n],e.message);return t.code=e.code,t}return n||e}let _ae=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new z2.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};Mi("ERR_ASSERTION","%s",Error);Mi("ERR_INVALID_ARG_TYPE",(n,e,t)=>{fh(typeof n=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";n.endsWith(" argument")?r+=`${n} `:r+=`"${n}" ${n.includes(".")?"property":"argument"} `,r+="must be ";const i=[],o=[],u=[];for(const p of e)fh(typeof p=="string","All expected entries have to be of type string"),mae.includes(p)?i.push(p.toLowerCase()):gae.test(p)?o.push(p):(fh(p!=="object",'The value "object" should be written as "Object"'),u.push(p));if(o.length>0){const p=i.indexOf("object");p!==-1&&(i.splice(i,p,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:r+=`of type ${i[0]}`;break;case 2:r+=`one of type ${i[0]} or ${i[1]}`;break;default:{const p=i.pop();r+=`one of type ${i.join(", ")}, or ${p}`}}(o.length>0||u.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const p=o.pop();r+=`an instance of ${o.join(", ")}, or ${p}`}}u.length>0&&(r+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(r+="an "),r+=`${u[0]}`;break;case 2:r+=`one of ${u[0]} or ${u[1]}`;break;default:{const p=u.pop();r+=`one of ${u.join(", ")}, or ${p}`}}if(t==null)r+=`. Received ${t}`;else if(typeof t=="function"&&t.name)r+=`. Received function ${t.name}`;else if(typeof t=="object"){var c;if((c=t.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${t.constructor.name}`;else{const p=e2(t,{depth:-1});r+=`. Received ${p}`}}else{let p=e2(t,{colors:!1});p.length>25&&(p=`${p.slice(0,25)}...`),r+=`. Received type ${typeof t} (${p})`}return r},TypeError);Mi("ERR_INVALID_ARG_VALUE",(n,e,t="is invalid")=>{let r=e2(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${n.includes(".")?"property":"argument"} '${n}' ${t}. Received ${r}`},TypeError);Mi("ERR_INVALID_RETURN_VALUE",(n,e,t)=>{var r;const i=t!=null&&(r=t.constructor)!==null&&r!==void 0&&r.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${n} to be returned from the "${e}" function but got ${i}.`},TypeError);Mi("ERR_MISSING_ARGS",(...n)=>{fh(n.length>0,"At least one arg needs to be specified");let e;const t=n.length;switch(n=(Array.isArray(n)?n:[n]).map(r=>`"${r}"`).join(" or "),t){case 1:e+=`The ${n[0]} argument`;break;case 2:e+=`The ${n[0]} and ${n[1]} arguments`;break;default:{const r=n.pop();e+=`The ${n.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Mi("ERR_OUT_OF_RANGE",(n,e,t)=>{fh(e,'Missing "range" argument');let r;return Number.isInteger(t)&&Math.abs(t)>2**32?r=hN(String(t)):typeof t=="bigint"?(r=String(t),(t>2n**32n||t<-(2n**32n))&&(r=hN(r)),r+="n"):r=e2(t),`The value of "${n}" is out of range. It must be ${e}. Received ${r}`},RangeError);Mi("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Mi("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Mi("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Mi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Mi("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Mi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Mi("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Mi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Mi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Mi("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Mi("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var eo={AbortError:_ae,aggregateTwoErrors:yN(wae),hideStackFrames:yN,codes:z2};const{ArrayIsArray:z5,ArrayPrototypeIncludes:DF,ArrayPrototypeJoin:UF,ArrayPrototypeMap:xae,NumberIsInteger:j5,NumberIsNaN:Sae,NumberMAX_SAFE_INTEGER:Cae,NumberMIN_SAFE_INTEGER:Eae,NumberParseInt:Aae,ObjectPrototypeHasOwnProperty:kae,RegExpPrototypeExec:FF,String:Mae,StringPrototypeToUpperCase:Tae,StringPrototypeTrim:Rae}=ma,{hideStackFrames:Yo,codes:{ERR_SOCKET_BAD_PORT:Oae,ERR_INVALID_ARG_TYPE:as,ERR_INVALID_ARG_VALUE:wm,ERR_OUT_OF_RANGE:vh,ERR_UNKNOWN_SIGNAL:mN}}=eo,{normalizeEncoding:Lae}=xs,{isAsyncFunction:Nae,isArrayBufferView:Pae}=xs.types,gN={};function Iae(n){return n===(n|0)}function Dae(n){return n===n>>>0}const Uae=/^[0-7]+$/,Fae="must be a 32-bit unsigned integer or an octal string";function Bae(n,e,t){if(typeof n>"u"&&(n=t),typeof n=="string"){if(FF(Uae,n)===null)throw new wm(e,n,Fae);n=Aae(n,8)}return BF(n,e),n}const zae=Yo((n,e,t=Eae,r=Cae)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);if(n<t||n>r)throw new vh(e,`>= ${t} && <= ${r}`,n)}),jae=Yo((n,e,t=-2147483648,r=2147483647)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);if(n<t||n>r)throw new vh(e,`>= ${t} && <= ${r}`,n)}),BF=Yo((n,e,t=!1)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);const r=t?1:0,i=4294967295;if(n<r||n>i)throw new vh(e,`>= ${r} && <= ${i}`,n)});function H5(n,e){if(typeof n!="string")throw new as(e,"string",n)}function Hae(n,e,t=void 0,r){if(typeof n!="number")throw new as(e,"number",n);if(t!=null&&n<t||r!=null&&n>r||(t!=null||r!=null)&&Sae(n))throw new vh(e,`${t!=null?`>= ${t}`:""}${t!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,n)}const $ae=Yo((n,e,t)=>{if(!DF(t,n)){const i="must be one of: "+UF(xae(t,o=>typeof o=="string"?`'${o}'`:Mae(o)),", ");throw new wm(e,n,i)}});function zF(n,e){if(typeof n!="boolean")throw new as(e,"boolean",n)}function y8(n,e,t){return n==null||!kae(n,e)?t:n[e]}const qae=Yo((n,e,t=null)=>{const r=y8(t,"allowArray",!1),i=y8(t,"allowFunction",!1);if(!y8(t,"nullable",!1)&&n===null||!r&&z5(n)||typeof n!="object"&&(!i||typeof n!="function"))throw new as(e,"Object",n)}),Vae=Yo((n,e)=>{if(n!=null&&typeof n!="object"&&typeof n!="function")throw new as(e,"a dictionary",n)}),j2=Yo((n,e,t=0)=>{if(!z5(n))throw new as(e,"Array",n);if(n.length<t){const r=`must be longer than ${t}`;throw new wm(e,n,r)}});function Gae(n,e){j2(n,e);for(let t=0;t<n.length;t++)H5(n[t],`${e}[${t}]`)}function Wae(n,e){j2(n,e);for(let t=0;t<n.length;t++)zF(n[t],`${e}[${t}]`)}function Kae(n,e){j2(n,e);for(let t=0;t<n.length;t++){const r=n[t],i=`${e}[${t}]`;if(r==null)throw new as(i,"AbortSignal",r);jF(r,i)}}function Yae(n,e="signal"){if(H5(n,e),gN[n]===void 0)throw gN[Tae(n)]!==void 0?new mN(n+" (signals must use all capital letters)"):new mN(n)}const Jae=Yo((n,e="buffer")=>{if(!Pae(n))throw new as(e,["Buffer","TypedArray","DataView"],n)});function Qae(n,e){const t=Lae(e),r=n.length;if(t==="hex"&&r%2!==0)throw new wm("encoding",e,`is invalid for data of length ${r}`)}function Zae(n,e="Port",t=!0){if(typeof n!="number"&&typeof n!="string"||typeof n=="string"&&Rae(n).length===0||+n!==+n>>>0||n>65535||n===0&&!t)throw new Oae(e,n,t);return n|0}const jF=Yo((n,e)=>{if(n!==void 0&&(n===null||typeof n!="object"||!("aborted"in n)))throw new as(e,"AbortSignal",n)}),Xae=Yo((n,e)=>{if(typeof n!="function")throw new as(e,"Function",n)}),eie=Yo((n,e)=>{if(typeof n!="function"||Nae(n))throw new as(e,"Function",n)}),tie=Yo((n,e)=>{if(n!==void 0)throw new as(e,"undefined",n)});function nie(n,e,t){if(!DF(t,n))throw new as(e,`('${UF(t,"|")}')`,n)}const rie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function vN(n,e){if(typeof n>"u"||!FF(rie,n))throw new wm(e,n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function aie(n){if(typeof n=="string")return vN(n,"hints"),n;if(z5(n)){const e=n.length;let t="";if(e===0)return t;for(let r=0;r<e;r++){const i=n[r];vN(i,"hints"),t+=i,r!==e-1&&(t+=", ")}return t}throw new wm("hints",n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var Kb={isInt32:Iae,isUint32:Dae,parseFileMode:Bae,validateArray:j2,validateStringArray:Gae,validateBooleanArray:Wae,validateAbortSignalArray:Kae,validateBoolean:zF,validateBuffer:Jae,validateDictionary:Vae,validateEncoding:Qae,validateFunction:Xae,validateInt32:jae,validateInteger:zae,validateNumber:Hae,validateObject:qae,validateOneOf:$ae,validatePlainFunction:eie,validatePort:Zae,validateSignalName:Yae,validateString:H5,validateUint32:BF,validateUndefined:tie,validateUnion:nie,validateAbortSignal:jF,validateLinkHeaderValue:aie},$5={exports:{}},m8={exports:{}},bN;function Vd(){if(bN)return m8.exports;bN=1;var n=m8.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(A){if(e===setTimeout)return setTimeout(A,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function u(A){if(t===clearTimeout)return clearTimeout(A);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,h,m=-1;function w(){!p||!h||(p=!1,h.length?c=h.concat(c):m=-1,c.length&&b())}function b(){if(!p){var A=o(w);p=!0;for(var k=c.length;k;){for(h=c,c=[];++m<k;)h&&h[m].run();m=-1,k=c.length}h=null,p=!1,u(A)}}n.nextTick=function(A){var k=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)k[R-1]=arguments[R];c.push(new g(A,k)),c.length===1&&!p&&o(b)};function g(A,k){this.fun=A,this.array=k}g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}return n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(A){return[]},n.binding=function(A){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(A){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},m8.exports}const{SymbolAsyncIterator:wN,SymbolIterator:_N,SymbolFor:Rh}=ma,HF=Rh("nodejs.stream.destroyed"),$F=Rh("nodejs.stream.errored"),E4=Rh("nodejs.stream.readable"),A4=Rh("nodejs.stream.writable"),qF=Rh("nodejs.stream.disturbed"),iie=Rh("nodejs.webstream.isClosedPromise"),sie=Rh("nodejs.webstream.controllerErrorFunction");function H2(n,e=!1){var t;return!!(n&&typeof n.pipe=="function"&&typeof n.on=="function"&&(!e||typeof n.pause=="function"&&typeof n.resume=="function")&&(!n._writableState||((t=n._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!n._writableState||n._readableState))}function $2(n){var e;return!!(n&&typeof n.write=="function"&&typeof n.on=="function"&&(!n._readableState||((e=n._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function oie(n){return!!(n&&typeof n.pipe=="function"&&n._readableState&&typeof n.on=="function"&&typeof n.write=="function")}function Zl(n){return n&&(n._readableState||n._writableState||typeof n.write=="function"&&typeof n.on=="function"||typeof n.pipe=="function"&&typeof n.on=="function")}function VF(n){return!!(n&&!Zl(n)&&typeof n.pipeThrough=="function"&&typeof n.getReader=="function"&&typeof n.cancel=="function")}function GF(n){return!!(n&&!Zl(n)&&typeof n.getWriter=="function"&&typeof n.abort=="function")}function WF(n){return!!(n&&!Zl(n)&&typeof n.readable=="object"&&typeof n.writable=="object")}function uie(n){return VF(n)||GF(n)||WF(n)}function lie(n,e){return n==null?!1:e===!0?typeof n[wN]=="function":e===!1?typeof n[_N]=="function":typeof n[wN]=="function"||typeof n[_N]=="function"}function q2(n){if(!Zl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!!(n.destroyed||n[HF]||r!=null&&r.destroyed)}function KF(n){if(!$2(n))return null;if(n.writableEnded===!0)return!0;const e=n._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function cie(n,e){if(!$2(n))return null;if(n.writableFinished===!0)return!0;const t=n._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.finished)!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}function fie(n){if(!H2(n))return null;if(n.readableEnded===!0)return!0;const e=n._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function YF(n,e){if(!H2(n))return null;const t=n._readableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.endEmitted)!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}function JF(n){return n&&n[E4]!=null?n[E4]:typeof(n==null?void 0:n.readable)!="boolean"?null:q2(n)?!1:H2(n)&&n.readable&&!YF(n)}function QF(n){return n&&n[A4]!=null?n[A4]:typeof(n==null?void 0:n.writable)!="boolean"?null:q2(n)?!1:$2(n)&&n.writable&&!KF(n)}function die(n,e){return Zl(n)?q2(n)?!0:!((e==null?void 0:e.readable)!==!1&&JF(n)||(e==null?void 0:e.writable)!==!1&&QF(n)):null}function pie(n){var e,t;return Zl(n)?n.writableErrored?n.writableErrored:(e=(t=n._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function hie(n){var e,t;return Zl(n)?n.readableErrored?n.readableErrored:(e=(t=n._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function yie(n){if(!Zl(n))return null;if(typeof n.closed=="boolean")return n.closed;const e=n._writableState,t=n._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(t==null?void 0:t.closed)=="boolean"?(e==null?void 0:e.closed)||(t==null?void 0:t.closed):typeof n._closed=="boolean"&&ZF(n)?n._closed:null}function ZF(n){return typeof n._closed=="boolean"&&typeof n._defaultKeepAlive=="boolean"&&typeof n._removedConnection=="boolean"&&typeof n._removedContLen=="boolean"}function XF(n){return typeof n._sent100=="boolean"&&ZF(n)}function mie(n){var e;return typeof n._consuming=="boolean"&&typeof n._dumped=="boolean"&&((e=n.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function gie(n){if(!Zl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!r&&XF(n)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function vie(n){var e;return!!(n&&((e=n[qF])!==null&&e!==void 0?e:n.readableDidRead||n.readableAborted))}function bie(n){var e,t,r,i,o,u,c,p,h,m;return!!(n&&((e=(t=(r=(i=(o=(u=n[$F])!==null&&u!==void 0?u:n.readableErrored)!==null&&o!==void 0?o:n.writableErrored)!==null&&i!==void 0?i:(c=n._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(p=n._writableState)===null||p===void 0?void 0:p.errorEmitted)!==null&&t!==void 0?t:(h=n._readableState)===null||h===void 0?void 0:h.errored)!==null&&e!==void 0?e:!((m=n._writableState)===null||m===void 0)&&m.errored))}var ef={isDestroyed:q2,kIsDestroyed:HF,isDisturbed:vie,kIsDisturbed:qF,isErrored:bie,kIsErrored:$F,isReadable:JF,kIsReadable:E4,kIsClosedPromise:iie,kControllerErrorFunction:sie,kIsWritable:A4,isClosed:yie,isDuplexNodeStream:oie,isFinished:die,isIterable:lie,isReadableNodeStream:H2,isReadableStream:VF,isReadableEnded:fie,isReadableFinished:YF,isReadableErrored:hie,isNodeStream:Zl,isWebStream:uie,isWritable:QF,isWritableNodeStream:$2,isWritableStream:GF,isWritableEnded:KF,isWritableFinished:cie,isWritableErrored:pie,isServerRequest:mie,isServerResponse:XF,willEmitClose:gie,isTransformStream:WF};const _d=Vd(),{AbortError:eB,codes:wie}=eo,{ERR_INVALID_ARG_TYPE:_ie,ERR_STREAM_PREMATURE_CLOSE:xN}=wie,{kEmptyObject:k4,once:M4}=xs,{validateAbortSignal:xie,validateFunction:Sie,validateObject:Cie,validateBoolean:Eie}=Kb,{Promise:Aie,PromisePrototypeThen:kie,SymbolDispose:tB}=ma,{isClosed:Mie,isReadable:SN,isReadableNodeStream:g8,isReadableStream:Tie,isReadableFinished:CN,isReadableErrored:EN,isWritable:AN,isWritableNodeStream:kN,isWritableStream:Rie,isWritableFinished:MN,isWritableErrored:TN,isNodeStream:Oie,willEmitClose:Lie,kIsClosedPromise:Nie}=ef;let Vy;function Pie(n){return n.setHeader&&typeof n.abort=="function"}const T4=()=>{};function nB(n,e,t){var r,i;if(arguments.length===2?(t=e,e=k4):e==null?e=k4:Cie(e,"options"),Sie(t,"callback"),xie(e.signal,"options.signal"),t=M4(t),Tie(n)||Rie(n))return Iie(n,e,t);if(!Oie(n))throw new _ie("stream",["ReadableStream","WritableStream","Stream"],n);const o=(r=e.readable)!==null&&r!==void 0?r:g8(n),u=(i=e.writable)!==null&&i!==void 0?i:kN(n),c=n._writableState,p=n._readableState,h=()=>{n.writable||b()};let m=Lie(n)&&g8(n)===o&&kN(n)===u,w=MN(n,!1);const b=()=>{w=!0,n.destroyed&&(m=!1),!(m&&(!n.readable||o))&&(!o||g)&&t.call(n)};let g=CN(n,!1);const S=()=>{g=!0,n.destroyed&&(m=!1),!(m&&(!n.writable||u))&&(!u||w)&&t.call(n)},A=V=>{t.call(n,V)};let k=Mie(n);const R=()=>{k=!0;const V=TN(n)||EN(n);if(V&&typeof V!="boolean")return t.call(n,V);if(o&&!g&&g8(n,!0)&&!CN(n,!1))return t.call(n,new xN);if(u&&!w&&!MN(n,!1))return t.call(n,new xN);t.call(n)},N=()=>{k=!0;const V=TN(n)||EN(n);if(V&&typeof V!="boolean")return t.call(n,V);t.call(n)},P=()=>{n.req.on("finish",b)};Pie(n)?(n.on("complete",b),m||n.on("abort",R),n.req?P():n.on("request",P)):u&&!c&&(n.on("end",h),n.on("close",h)),!m&&typeof n.aborted=="boolean"&&n.on("aborted",R),n.on("end",S),n.on("finish",b),e.error!==!1&&n.on("error",A),n.on("close",R),k?_d.nextTick(R):c!=null&&c.errorEmitted||p!=null&&p.errorEmitted?m||_d.nextTick(N):(!o&&(!m||SN(n))&&(w||AN(n)===!1)||!u&&(!m||AN(n))&&(g||SN(n)===!1)||p&&n.req&&n.aborted)&&_d.nextTick(N);const q=()=>{t=T4,n.removeListener("aborted",R),n.removeListener("complete",b),n.removeListener("abort",R),n.removeListener("request",P),n.req&&n.req.removeListener("finish",b),n.removeListener("end",h),n.removeListener("close",h),n.removeListener("finish",b),n.removeListener("end",S),n.removeListener("error",A),n.removeListener("close",R)};if(e.signal&&!k){const V=()=>{const de=t;q(),de.call(n,new eB(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)_d.nextTick(V);else{Vy=Vy||xs.addAbortListener;const de=Vy(e.signal,V),oe=t;t=M4((...he)=>{de[tB](),oe.apply(n,he)})}}return q}function Iie(n,e,t){let r=!1,i=T4;if(e.signal)if(i=()=>{r=!0,t.call(n,new eB(void 0,{cause:e.signal.reason}))},e.signal.aborted)_d.nextTick(i);else{Vy=Vy||xs.addAbortListener;const u=Vy(e.signal,i),c=t;t=M4((...p)=>{u[tB](),c.apply(n,p)})}const o=(...u)=>{r||_d.nextTick(()=>t.apply(n,u))};return kie(n[Nie].promise,o,o),T4}function Die(n,e){var t;let r=!1;return e===null&&(e=k4),(t=e)!==null&&t!==void 0&&t.cleanup&&(Eie(e.cleanup,"cleanup"),r=e.cleanup),new Aie((i,o)=>{const u=nB(n,e,c=>{r&&u(),c?o(c):i()})})}$5.exports=nB;$5.exports.finished=Die;var Gd=$5.exports;const Hl=Vd(),{aggregateTwoErrors:Uie,codes:{ERR_MULTIPLE_CALLBACK:Fie},AbortError:Bie}=eo,{Symbol:rB}=ma,{kIsDestroyed:zie,isDestroyed:jie,isFinished:Hie,isServerRequest:$ie}=ef,aB=rB("kDestroy"),R4=rB("kConstruct");function iB(n,e,t){n&&(n.stack,e&&!e.errored&&(e.errored=n),t&&!t.errored&&(t.errored=n))}function qie(n,e){const t=this._readableState,r=this._writableState,i=r||t;return r!=null&&r.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):(iB(n,r,t),r&&(r.destroyed=!0),t&&(t.destroyed=!0),i.constructed?RN(this,n,e):this.once(aB,function(o){RN(this,Uie(o,n),e)}),this)}function RN(n,e,t){let r=!1;function i(o){if(r)return;r=!0;const u=n._readableState,c=n._writableState;iB(o,c,u),c&&(c.closed=!0),u&&(u.closed=!0),typeof t=="function"&&t(o),o?Hl.nextTick(Vie,n,o):Hl.nextTick(sB,n)}try{n._destroy(e||null,i)}catch(o){i(o)}}function Vie(n,e){O4(n,e),sB(n)}function sB(n){const e=n._readableState,t=n._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&n.emit("close")}function O4(n,e){const t=n._readableState,r=n._writableState;r!=null&&r.errorEmitted||t!=null&&t.errorEmitted||(r&&(r.errorEmitted=!0),t&&(t.errorEmitted=!0),n.emit("error",e))}function Gie(){const n=this._readableState,e=this._writableState;n&&(n.constructed=!0,n.closed=!1,n.closeEmitted=!1,n.destroyed=!1,n.errored=null,n.errorEmitted=!1,n.reading=!1,n.ended=n.readable===!1,n.endEmitted=n.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 L4(n,e,t){const r=n._readableState,i=n._writableState;if(i!=null&&i.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||i!=null&&i.autoDestroy?n.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),r&&!r.errored&&(r.errored=e),t?Hl.nextTick(O4,n,e):O4(n,e))}function Wie(n,e){if(typeof n._construct!="function")return;const t=n._readableState,r=n._writableState;t&&(t.constructed=!1),r&&(r.constructed=!1),n.once(R4,e),!(n.listenerCount(R4)>1)&&Hl.nextTick(Kie,n)}function Kie(n){let e=!1;function t(r){if(e){L4(n,r??new Fie);return}e=!0;const i=n._readableState,o=n._writableState,u=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),u.destroyed?n.emit(aB,r):r?L4(n,r,!0):Hl.nextTick(Yie,n)}try{n._construct(r=>{Hl.nextTick(t,r)})}catch(r){Hl.nextTick(t,r)}}function Yie(n){n.emit(R4)}function ON(n){return(n==null?void 0:n.setHeader)&&typeof n.abort=="function"}function oB(n){n.emit("close")}function Jie(n,e){n.emit("error",e),Hl.nextTick(oB,n)}function Qie(n,e){!n||jie(n)||(!e&&!Hie(n)&&(e=new Bie),$ie(n)?(n.socket=null,n.destroy(e)):ON(n)?n.abort():ON(n.req)?n.req.abort():typeof n.destroy=="function"?n.destroy(e):typeof n.close=="function"?n.close():e?Hl.nextTick(Jie,n,e):Hl.nextTick(oB,n),n.destroyed||(n[zie]=!0))}var _m={construct:Wie,destroyer:Qie,destroy:qie,undestroy:Gie,errorOrDestroy:L4};const{ArrayIsArray:Zie,ObjectSetPrototypeOf:uB}=ma,{EventEmitter:V2}=Wb;function G2(n){V2.call(this,n)}uB(G2.prototype,V2.prototype);uB(G2,V2);G2.prototype.pipe=function(n,e){const t=this;function r(m){n.writable&&n.write(m)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",u),t.on("close",c));let o=!1;function u(){o||(o=!0,n.end())}function c(){o||(o=!0,typeof n.destroy=="function"&&n.destroy())}function p(m){h(),V2.listenerCount(this,"error")===0&&this.emit("error",m)}N4(t,"error",p),N4(n,"error",p);function h(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",u),t.removeListener("close",c),t.removeListener("error",p),n.removeListener("error",p),t.removeListener("end",h),t.removeListener("close",h),n.removeListener("close",h)}return t.on("end",h),t.on("close",h),n.on("close",h),n.emit("pipe",t),n};function N4(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Zie(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}var q5={Stream:G2,prependListener:N4},lB={exports:{}};(function(n){const{SymbolDispose:e}=ma,{AbortError:t,codes:r}=eo,{isNodeStream:i,isWebStream:o,kControllerErrorFunction:u}=ef,c=Gd,{ERR_INVALID_ARG_TYPE:p}=r;let h;const m=(w,b)=>{if(typeof w!="object"||!("aborted"in w))throw new p(b,"AbortSignal",w)};n.exports.addAbortSignal=function(b,g){if(m(b,"signal"),!i(g)&&!o(g))throw new p("stream",["ReadableStream","WritableStream","Stream"],g);return n.exports.addAbortSignalNoValidate(b,g)},n.exports.addAbortSignalNoValidate=function(w,b){if(typeof w!="object"||!("aborted"in w))return b;const g=i(b)?()=>{b.destroy(new t(void 0,{cause:w.reason}))}:()=>{b[u](new t(void 0,{cause:w.reason}))};if(w.aborted)g();else{h=h||xs.addAbortListener;const S=h(w,g);c(b,S[e])}return b}})(lB);var W2=lB.exports;const{StringPrototypeSlice:LN,SymbolIterator:Xie,TypedArrayPrototypeSet:gx,Uint8Array:ese}=ma,{Buffer:v8}=qd,{inspect:tse}=xs;var nse=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;const 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 t=this.head,r=""+t.data;for(;(t=t.next)!==null;)r+=e+t.data;return r}concat(e){if(this.length===0)return v8.alloc(0);const t=v8.allocUnsafe(e>>>0);let r=this.head,i=0;for(;r;)gx(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const i=r.slice(0,e);return this.head.data=r.slice(e),i}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Xie](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=LN(o,0,e),this.head=r,r.data=LN(o,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){const t=v8.allocUnsafe(e),r=e;let i=this.head,o=0;do{const u=i.data;if(e>u.length)gx(t,u,r-e),e-=u.length;else{e===u.length?(gx(t,u,r-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(gx(t,new ese(u.buffer,u.byteOffset,e),r-e),this.head=i,i.data=u.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return tse(this,{...t,depth:0,customInspect:!1})}};const{MathFloor:rse,NumberIsInteger:ase}=ma,{validateInteger:ise}=Kb,{ERR_INVALID_ARG_VALUE:sse}=eo.codes;let cB=16*1024,fB=16;function ose(n,e,t){return n.highWaterMark!=null?n.highWaterMark:e?n[t]:null}function dB(n){return n?fB:cB}function use(n,e){ise(e,"value",0),n?fB=e:cB=e}function lse(n,e,t,r){const i=ose(e,r,t);if(i!=null){if(!ase(i)||i<0){const o=r?`options.${t}`:"options.highWaterMark";throw new sse(o,i)}return rse(i)}return dB(n.objectMode)}var K2={getHighWaterMark:lse,getDefaultHighWaterMark:dB,setDefaultHighWaterMark:use},V5={},G5=uU.Buffer,NN=G5.isEncoding||function(n){switch(n=""+n,n&&n.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 cse(n){if(!n)return"utf8";for(var e;;)switch(n){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 n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}function fse(n){var e=cse(n);if(typeof e!="string"&&(G5.isEncoding===NN||!NN(n)))throw new Error("Unknown encoding: "+n);return e||n}V5.StringDecoder=Yb;function Yb(n){this.encoding=fse(n);var e;switch(this.encoding){case"utf16le":this.text=gse,this.end=vse,e=4;break;case"utf8":this.fillLast=hse,e=4;break;case"base64":this.text=bse,this.end=wse,e=3;break;default:this.write=_se,this.end=xse;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=G5.allocUnsafe(e)}Yb.prototype.write=function(n){if(n.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(n),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<n.length?e?e+this.text(n,t):this.text(n,t):e||""};Yb.prototype.end=mse;Yb.prototype.text=yse;Yb.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function b8(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function dse(n,e,t){var r=e.length-1;if(r<t)return 0;var i=b8(e[r]);return i>=0?(i>0&&(n.lastNeed=i-1),i):--r<t||i===-2?0:(i=b8(e[r]),i>=0?(i>0&&(n.lastNeed=i-2),i):--r<t||i===-2?0:(i=b8(e[r]),i>=0?(i>0&&(i===2?i=0:n.lastNeed=i-3),i):0))}function pse(n,e,t){if((e[0]&192)!==128)return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return n.lastNeed=2,"�"}}function hse(n){var e=this.lastTotal-this.lastNeed,t=pse(this,n);if(t!==void 0)return t;if(this.lastNeed<=n.length)return n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,e,0,n.length),this.lastNeed-=n.length}function yse(n,e){var t=dse(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)}function mse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+"�":e}function gse(n,e){if((n.length-e)%2===0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function vse(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function bse(n,e){var t=(n.length-e)%3;return t===0?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function wse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _se(n){return n.toString(this.encoding)}function xse(n){return n&&n.length?this.write(n):""}const PN=Vd(),{PromisePrototypeThen:Sse,SymbolAsyncIterator:IN,SymbolIterator:DN}=ma,{Buffer:Cse}=qd,{ERR_INVALID_ARG_TYPE:Ese,ERR_STREAM_NULL_VALUES:Ase}=eo.codes;function kse(n,e,t){let r;if(typeof e=="string"||e instanceof Cse)return new n({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let i;if(e&&e[IN])i=!0,r=e[IN]();else if(e&&e[DN])i=!1,r=e[DN]();else throw new Ese("iterable",["Iterable"],e);const o=new n({objectMode:!0,highWaterMark:1,...t});let u=!1;o._read=function(){u||(u=!0,p())},o._destroy=function(h,m){Sse(c(h),()=>PN.nextTick(m,h),w=>PN.nextTick(m,w||h))};async function c(h){const m=h!=null,w=typeof r.throw=="function";if(m&&w){const{value:b,done:g}=await r.throw(h);if(await b,g)return}if(typeof r.return=="function"){const{value:b}=await r.return();await b}}async function p(){for(;;){try{const{value:h,done:m}=i?await r.next():r.next();if(m)o.push(null);else{const w=h&&typeof h.then=="function"?await h:h;if(w===null)throw u=!1,new Ase;if(o.push(w))continue;u=!1}}catch(h){o.destroy(h)}break}}return o}var pB=kse,w8,UN;function Y2(){if(UN)return w8;UN=1;const n=Vd(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:p,SafeSet:h,SymbolAsyncDispose:m,SymbolAsyncIterator:w,Symbol:b}=ma;w8=Ne,Ne.ReadableState=Ee;const{EventEmitter:g}=Wb,{Stream:S,prependListener:A}=q5,{Buffer:k}=qd,{addAbortSignal:R}=W2,N=Gd;let P=xs.debuglog("stream",ve=>{P=ve});const q=nse,V=_m,{getHighWaterMark:de,getDefaultHighWaterMark:oe}=K2,{aggregateTwoErrors:he,codes:{ERR_INVALID_ARG_TYPE:Se,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:Le,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:x}=eo,{validateObject:O}=Kb,z=b("kPaused"),{StringDecoder:F}=V5,H=pB;c(Ne.prototype,S.prototype),c(Ne,S);const Q=()=>{},{errorOrDestroy:ae}=V,L=1,T=2,Y=4,ee=8,j=16,be=32,Ie=64,Me=128,De=256,se=512,fe=1024,pe=2048,le=4096,re=8192,me=16384,J=32768,I=65536,U=1<<17,te=1<<18;function ue(ve){return{enumerable:!1,get(){return(this.state&ve)!==0},set(xe){xe?this.state|=ve:this.state&=~ve}}}o(Ee.prototype,{objectMode:ue(L),ended:ue(T),endEmitted:ue(Y),reading:ue(ee),constructed:ue(j),sync:ue(be),needReadable:ue(Ie),emittedReadable:ue(Me),readableListening:ue(De),resumeScheduled:ue(se),errorEmitted:ue(fe),emitClose:ue(pe),autoDestroy:ue(le),destroyed:ue(re),closed:ue(me),closeEmitted:ue(J),multiAwaitDrain:ue(I),readingMore:ue(U),dataEmitted:ue(te)});function Ee(ve,xe,ct){typeof ct!="boolean"&&(ct=xe instanceof Yc()),this.state=pe|le|j|be,ve&&ve.objectMode&&(this.state|=L),ct&&ve&&ve.readableObjectMode&&(this.state|=L),this.highWaterMark=ve?de(this,ve,"readableHighWaterMark",ct):oe(!1),this.buffer=new q,this.length=0,this.pipes=[],this.flowing=null,this[z]=null,ve&&ve.emitClose===!1&&(this.state&=~pe),ve&&ve.autoDestroy===!1&&(this.state&=~le),this.errored=null,this.defaultEncoding=ve&&ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ve&&ve.encoding&&(this.decoder=new F(ve.encoding),this.encoding=ve.encoding)}function Ne(ve){if(!(this instanceof Ne))return new Ne(ve);const xe=this instanceof Yc();this._readableState=new Ee(ve,this,xe),ve&&(typeof ve.read=="function"&&(this._read=ve.read),typeof ve.destroy=="function"&&(this._destroy=ve.destroy),typeof ve.construct=="function"&&(this._construct=ve.construct),ve.signal&&!xe&&R(ve.signal,this)),S.call(this,ve),V.construct(this,()=>{this._readableState.needReadable&&_e(this,this._readableState)})}Ne.prototype.destroy=V.destroy,Ne.prototype._undestroy=V.undestroy,Ne.prototype._destroy=function(ve,xe){xe(ve)},Ne.prototype[g.captureRejectionSymbol]=function(ve){this.destroy(ve)},Ne.prototype[m]=function(){let ve;return this.destroyed||(ve=this.readableEnded?null:new x,this.destroy(ve)),new p((xe,ct)=>N(this,at=>at&&at!==ve?ct(at):xe(null)))},Ne.prototype.push=function(ve,xe){return Qe(this,ve,xe,!1)},Ne.prototype.unshift=function(ve,xe){return Qe(this,ve,xe,!0)};function Qe(ve,xe,ct,at){P("readableAddChunk",xe);const ft=ve._readableState;let Dn;if(ft.state&L||(typeof xe=="string"?(ct=ct||ft.defaultEncoding,ft.encoding!==ct&&(at&&ft.encoding?xe=k.from(xe,ct).toString(ft.encoding):(xe=k.from(xe,ct),ct=""))):xe instanceof k?ct="":S._isUint8Array(xe)?(xe=S._uint8ArrayToBuffer(xe),ct=""):xe!=null&&(Dn=new Se("chunk",["string","Buffer","Uint8Array"],xe))),Dn)ae(ve,Dn);else if(xe===null)ft.state&=~ee,$(ve,ft);else if(ft.state&L||xe&&xe.length>0)if(at)if(ft.state&Y)ae(ve,new C);else{if(ft.destroyed||ft.errored)return!1;st(ve,ft,xe,!0)}else if(ft.ended)ae(ve,new Le);else{if(ft.destroyed||ft.errored)return!1;ft.state&=~ee,ft.decoder&&!ct?(xe=ft.decoder.write(xe),ft.objectMode||xe.length!==0?st(ve,ft,xe,!1):_e(ve,ft)):st(ve,ft,xe,!1)}else at||(ft.state&=~ee,_e(ve,ft));return!ft.ended&&(ft.length<ft.highWaterMark||ft.length===0)}function st(ve,xe,ct,at){xe.flowing&&xe.length===0&&!xe.sync&&ve.listenerCount("data")>0?(xe.state&I?xe.awaitDrainWriters.clear():xe.awaitDrainWriters=null,xe.dataEmitted=!0,ve.emit("data",ct)):(xe.length+=xe.objectMode?1:ct.length,at?xe.buffer.unshift(ct):xe.buffer.push(ct),xe.state&Ie&&W(ve)),_e(ve,xe)}Ne.prototype.isPaused=function(){const ve=this._readableState;return ve[z]===!0||ve.flowing===!1},Ne.prototype.setEncoding=function(ve){const xe=new F(ve);this._readableState.decoder=xe,this._readableState.encoding=this._readableState.decoder.encoding;const ct=this._readableState.buffer;let at="";for(const ft of ct)at+=xe.write(ft);return ct.clear(),at!==""&&ct.push(at),this._readableState.length=at.length,this};const _t=1073741824;function Et(ve){if(ve>_t)throw new ne("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++,ve}function Z(ve,xe){return ve<=0||xe.length===0&&xe.ended?0:xe.state&L?1:r(ve)?xe.flowing&&xe.length?xe.buffer.first().length:xe.length:ve<=xe.length?ve:xe.ended?xe.length:0}Ne.prototype.read=function(ve){P("read",ve),ve===void 0?ve=NaN:t(ve)||(ve=i(ve,10));const xe=this._readableState,ct=ve;if(ve>xe.highWaterMark&&(xe.highWaterMark=Et(ve)),ve!==0&&(xe.state&=~Me),ve===0&&xe.needReadable&&((xe.highWaterMark!==0?xe.length>=xe.highWaterMark:xe.length>0)||xe.ended))return P("read: emitReadable",xe.length,xe.ended),xe.length===0&&xe.ended?Wt(this):W(this),null;if(ve=Z(ve,xe),ve===0&&xe.ended)return xe.length===0&&Wt(this),null;let at=(xe.state&Ie)!==0;if(P("need readable",at),(xe.length===0||xe.length-ve<xe.highWaterMark)&&(at=!0,P("length less than watermark",at)),xe.ended||xe.reading||xe.destroyed||xe.errored||!xe.constructed)at=!1,P("reading, ended or constructing",at);else if(at){P("do read"),xe.state|=ee|be,xe.length===0&&(xe.state|=Ie);try{this._read(xe.highWaterMark)}catch(Dn){ae(this,Dn)}xe.state&=~be,xe.reading||(ve=Z(ct,xe))}let ft;return ve>0?ft=Zt(ve,xe):ft=null,ft===null?(xe.needReadable=xe.length<=xe.highWaterMark,ve=0):(xe.length-=ve,xe.multiAwaitDrain?xe.awaitDrainWriters.clear():xe.awaitDrainWriters=null),xe.length===0&&(xe.ended||(xe.needReadable=!0),ct!==ve&&xe.ended&&Wt(this)),ft!==null&&!xe.errorEmitted&&!xe.closeEmitted&&(xe.dataEmitted=!0,this.emit("data",ft)),ft};function $(ve,xe){if(P("onEofChunk"),!xe.ended){if(xe.decoder){const ct=xe.decoder.end();ct&&ct.length&&(xe.buffer.push(ct),xe.length+=xe.objectMode?1:ct.length)}xe.ended=!0,xe.sync?W(ve):(xe.needReadable=!1,xe.emittedReadable=!0,ge(ve))}}function W(ve){const xe=ve._readableState;P("emitReadable",xe.needReadable,xe.emittedReadable),xe.needReadable=!1,xe.emittedReadable||(P("emitReadable",xe.flowing),xe.emittedReadable=!0,n.nextTick(ge,ve))}function ge(ve){const xe=ve._readableState;P("emitReadable_",xe.destroyed,xe.length,xe.ended),!xe.destroyed&&!xe.errored&&(xe.length||xe.ended)&&(ve.emit("readable"),xe.emittedReadable=!1),xe.needReadable=!xe.flowing&&!xe.ended&&xe.length<=xe.highWaterMark,Ot(ve)}function _e(ve,xe){!xe.readingMore&&xe.constructed&&(xe.readingMore=!0,n.nextTick(Re,ve,xe))}function Re(ve,xe){for(;!xe.reading&&!xe.ended&&(xe.length<xe.highWaterMark||xe.flowing&&xe.length===0);){const ct=xe.length;if(P("maybeReadMore read 0"),ve.read(0),ct===xe.length)break}xe.readingMore=!1}Ne.prototype._read=function(ve){throw new Ce("_read()")},Ne.prototype.pipe=function(ve,xe){const ct=this,at=this._readableState;at.pipes.length===1&&(at.multiAwaitDrain||(at.multiAwaitDrain=!0,at.awaitDrainWriters=new h(at.awaitDrainWriters?[at.awaitDrainWriters]:[]))),at.pipes.push(ve),P("pipe count=%d opts=%j",at.pipes.length,xe);const Dn=(!xe||xe.end!==!1)&&ve!==n.stdout&&ve!==n.stderr?Sn:zt;at.endEmitted?n.nextTick(Dn):ct.once("end",Dn),ve.on("unpipe",hn);function hn(Ut,Kt){P("onunpipe"),Ut===ct&&Kt&&Kt.hasUnpiped===!1&&(Kt.hasUnpiped=!0,Un())}function Sn(){P("onend"),ve.end()}let fr,On=!1;function Un(){P("cleanup"),ve.removeListener("close",Nt),ve.removeListener("finish",Bt),fr&&ve.removeListener("drain",fr),ve.removeListener("error",rt),ve.removeListener("unpipe",hn),ct.removeListener("end",Sn),ct.removeListener("end",zt),ct.removeListener("data",et),On=!0,fr&&at.awaitDrainWriters&&(!ve._writableState||ve._writableState.needDrain)&&fr()}function Te(){On||(at.pipes.length===1&&at.pipes[0]===ve?(P("false write response, pause",0),at.awaitDrainWriters=ve,at.multiAwaitDrain=!1):at.pipes.length>1&&at.pipes.includes(ve)&&(P("false write response, pause",at.awaitDrainWriters.size),at.awaitDrainWriters.add(ve)),ct.pause()),fr||(fr=Be(ct,ve),ve.on("drain",fr))}ct.on("data",et);function et(Ut){P("ondata");const Kt=ve.write(Ut);P("dest.write",Kt),Kt===!1&&Te()}function rt(Ut){if(P("onerror",Ut),zt(),ve.removeListener("error",rt),ve.listenerCount("error")===0){const Kt=ve._writableState||ve._readableState;Kt&&!Kt.errorEmitted?ae(ve,Ut):ve.emit("error",Ut)}}A(ve,"error",rt);function Nt(){ve.removeListener("finish",Bt),zt()}ve.once("close",Nt);function Bt(){P("onfinish"),ve.removeListener("close",Nt),zt()}ve.once("finish",Bt);function zt(){P("unpipe"),ct.unpipe(ve)}return ve.emit("pipe",ct),ve.writableNeedDrain===!0?Te():at.flowing||(P("pipe resume"),ct.resume()),ve};function Be(ve,xe){return function(){const at=ve._readableState;at.awaitDrainWriters===xe?(P("pipeOnDrain",1),at.awaitDrainWriters=null):at.multiAwaitDrain&&(P("pipeOnDrain",at.awaitDrainWriters.size),at.awaitDrainWriters.delete(xe)),(!at.awaitDrainWriters||at.awaitDrainWriters.size===0)&&ve.listenerCount("data")&&ve.resume()}}Ne.prototype.unpipe=function(ve){const xe=this._readableState,ct={hasUnpiped:!1};if(xe.pipes.length===0)return this;if(!ve){const ft=xe.pipes;xe.pipes=[],this.pause();for(let Dn=0;Dn<ft.length;Dn++)ft[Dn].emit("unpipe",this,{hasUnpiped:!1});return this}const at=e(xe.pipes,ve);return at===-1?this:(xe.pipes.splice(at,1),xe.pipes.length===0&&this.pause(),ve.emit("unpipe",this,ct),this)},Ne.prototype.on=function(ve,xe){const ct=S.prototype.on.call(this,ve,xe),at=this._readableState;return ve==="data"?(at.readableListening=this.listenerCount("readable")>0,at.flowing!==!1&&this.resume()):ve==="readable"&&!at.endEmitted&&!at.readableListening&&(at.readableListening=at.needReadable=!0,at.flowing=!1,at.emittedReadable=!1,P("on readable",at.length,at.reading),at.length?W(this):at.reading||n.nextTick(yt,this)),ct},Ne.prototype.addListener=Ne.prototype.on,Ne.prototype.removeListener=function(ve,xe){const ct=S.prototype.removeListener.call(this,ve,xe);return ve==="readable"&&n.nextTick(wt,this),ct},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(ve){const xe=S.prototype.removeAllListeners.apply(this,arguments);return(ve==="readable"||ve===void 0)&&n.nextTick(wt,this),xe};function wt(ve){const xe=ve._readableState;xe.readableListening=ve.listenerCount("readable")>0,xe.resumeScheduled&&xe[z]===!1?xe.flowing=!0:ve.listenerCount("data")>0?ve.resume():xe.readableListening||(xe.flowing=null)}function yt(ve){P("readable nexttick read 0"),ve.read(0)}Ne.prototype.resume=function(){const ve=this._readableState;return ve.flowing||(P("resume"),ve.flowing=!ve.readableListening,gt(this,ve)),ve[z]=!1,this};function gt(ve,xe){xe.resumeScheduled||(xe.resumeScheduled=!0,n.nextTick(At,ve,xe))}function At(ve,xe){P("resume",xe.reading),xe.reading||ve.read(0),xe.resumeScheduled=!1,ve.emit("resume"),Ot(ve),xe.flowing&&!xe.reading&&ve.read(0)}Ne.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[z]=!0,this};function Ot(ve){const xe=ve._readableState;for(P("flow",xe.flowing);xe.flowing&&ve.read()!==null;);}Ne.prototype.wrap=function(ve){let xe=!1;ve.on("data",at=>{!this.push(at)&&ve.pause&&(xe=!0,ve.pause())}),ve.on("end",()=>{this.push(null)}),ve.on("error",at=>{ae(this,at)}),ve.on("close",()=>{this.destroy()}),ve.on("destroy",()=>{this.destroy()}),this._read=()=>{xe&&ve.resume&&(xe=!1,ve.resume())};const ct=u(ve);for(let at=1;at<ct.length;at++){const ft=ct[at];this[ft]===void 0&&typeof ve[ft]=="function"&&(this[ft]=ve[ft].bind(ve))}return this},Ne.prototype[w]=function(){return nn(this)},Ne.prototype.iterator=function(ve){return ve!==void 0&&O(ve,"options"),nn(this,ve)};function nn(ve,xe){typeof ve.read!="function"&&(ve=Ne.wrap(ve,{objectMode:!0}));const ct=Mr(ve,xe);return ct.stream=ve,ct}async function*Mr(ve,xe){let ct=Q;function at(hn){this===ve?(ct(),ct=Q):ct=hn}ve.on("readable",at);let ft;const Dn=N(ve,{writable:!1},hn=>{ft=hn?he(ft,hn):null,ct(),ct=Q});try{for(;;){const hn=ve.destroyed?null:ve.read();if(hn!==null)yield hn;else{if(ft)throw ft;if(ft===null)return;await new p(at)}}}catch(hn){throw ft=he(ft,hn),ft}finally{(ft||(xe==null?void 0:xe.destroyOnReturn)!==!1)&&(ft===void 0||ve._readableState.autoDestroy)?V.destroyer(ve,null):(ve.off("readable",at),Dn())}}o(Ne.prototype,{readable:{__proto__:null,get(){const ve=this._readableState;return!!ve&&ve.readable!==!1&&!ve.destroyed&&!ve.errorEmitted&&!ve.endEmitted},set(ve){this._readableState&&(this._readableState.readable=!!ve)}},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(ve){this._readableState&&(this._readableState.flowing=ve)}},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(ve){this._readableState&&(this._readableState.destroyed=ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[z]!==!1},set(ve){this[z]=!!ve}}}),Ne._fromList=Zt;function Zt(ve,xe){if(xe.length===0)return null;let ct;return xe.objectMode?ct=xe.buffer.shift():!ve||ve>=xe.length?(xe.decoder?ct=xe.buffer.join(""):xe.buffer.length===1?ct=xe.buffer.first():ct=xe.buffer.concat(xe.length),xe.buffer.clear()):ct=xe.buffer.consume(ve,xe.decoder),ct}function Wt(ve){const xe=ve._readableState;P("endReadable",xe.endEmitted),xe.endEmitted||(xe.ended=!0,n.nextTick(Xr,xe,ve))}function Xr(ve,xe){if(P("endReadableNT",ve.endEmitted,ve.length),!ve.errored&&!ve.closeEmitted&&!ve.endEmitted&&ve.length===0){if(ve.endEmitted=!0,xe.emit("end"),xe.writable&&xe.allowHalfOpen===!1)n.nextTick(Mn,xe);else if(ve.autoDestroy){const ct=xe._writableState;(!ct||ct.autoDestroy&&(ct.finished||ct.writable===!1))&&xe.destroy()}}}function Mn(ve){ve.writable&&!ve.writableEnded&&!ve.destroyed&&ve.end()}Ne.from=function(ve,xe){return H(Ne,ve,xe)};let In;function Ma(){return In===void 0&&(In={}),In}return Ne.fromWeb=function(ve,xe){return Ma().newStreamReadableFromReadableStream(ve,xe)},Ne.toWeb=function(ve,xe){return Ma().newReadableStreamFromStreamReadable(ve,xe)},Ne.wrap=function(ve,xe){var ct,at;return new Ne({objectMode:(ct=(at=ve.readableObjectMode)!==null&&at!==void 0?at:ve.objectMode)!==null&&ct!==void 0?ct:!0,...xe,destroy(ft,Dn){V.destroyer(ve,ft),Dn(ft)}}).wrap(ve)},w8}var _8,FN;function W5(){if(FN)return _8;FN=1;const n=Vd(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:h}=ma;_8=O,O.WritableState=C;const{EventEmitter:m}=Wb,w=q5.Stream,{Buffer:b}=qd,g=_m,{addAbortSignal:S}=W2,{getHighWaterMark:A,getDefaultHighWaterMark:k}=K2,{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:N,ERR_MULTIPLE_CALLBACK:P,ERR_STREAM_CANNOT_PIPE:q,ERR_STREAM_DESTROYED:V,ERR_STREAM_ALREADY_FINISHED:de,ERR_STREAM_NULL_VALUES:oe,ERR_STREAM_WRITE_AFTER_END:he,ERR_UNKNOWN_ENCODING:Se}=eo.codes,{errorOrDestroy:Ce}=g;u(O.prototype,w.prototype),u(O,w);function ne(){}const Le=p("kOnFinished");function C(le,re,me){typeof me!="boolean"&&(me=re instanceof Yc()),this.objectMode=!!(le&&le.objectMode),me&&(this.objectMode=this.objectMode||!!(le&&le.writableObjectMode)),this.highWaterMark=le?A(this,le,"writableHighWaterMark",me):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const J=!!(le&&le.decodeStrings===!1);this.decodeStrings=!J,this.defaultEncoding=le&&le.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ae.bind(void 0,re),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,x(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!le||le.emitClose!==!1,this.autoDestroy=!le||le.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Le]=[]}function x(le){le.buffered=[],le.bufferedIndex=0,le.allBuffers=!0,le.allNoop=!0}C.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(C.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(le){const re=this instanceof Yc();if(!re&&!r(O,this))return new O(le);this._writableState=new C(le,this,re),le&&(typeof le.write=="function"&&(this._write=le.write),typeof le.writev=="function"&&(this._writev=le.writev),typeof le.destroy=="function"&&(this._destroy=le.destroy),typeof le.final=="function"&&(this._final=le.final),typeof le.construct=="function"&&(this._construct=le.construct),le.signal&&S(le.signal,this)),w.call(this,le),g.construct(this,()=>{const me=this._writableState;me.writing||ee(this,me),Me(this,me)})}i(O,h,{__proto__:null,value:function(le){return r(this,le)?!0:this!==O?!1:le&&le._writableState instanceof C}}),O.prototype.pipe=function(){Ce(this,new q)};function z(le,re,me,J){const I=le._writableState;if(typeof me=="function")J=me,me=I.defaultEncoding;else{if(!me)me=I.defaultEncoding;else if(me!=="buffer"&&!b.isEncoding(me))throw new Se(me);typeof J!="function"&&(J=ne)}if(re===null)throw new oe;if(!I.objectMode)if(typeof re=="string")I.decodeStrings!==!1&&(re=b.from(re,me),me="buffer");else if(re instanceof b)me="buffer";else if(w._isUint8Array(re))re=w._uint8ArrayToBuffer(re),me="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],re);let U;return I.ending?U=new he:I.destroyed&&(U=new V("write")),U?(n.nextTick(J,U),Ce(le,U,!0),U):(I.pendingcb++,F(le,I,re,me,J))}O.prototype.write=function(le,re,me){return z(this,le,re,me)===!0},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){const le=this._writableState;le.corked&&(le.corked--,le.writing||ee(this,le))},O.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=c(re)),!b.isEncoding(re))throw new Se(re);return this._writableState.defaultEncoding=re,this};function F(le,re,me,J,I){const U=re.objectMode?1:me.length;re.length+=U;const te=re.length<re.highWaterMark;return te||(re.needDrain=!0),re.writing||re.corked||re.errored||!re.constructed?(re.buffered.push({chunk:me,encoding:J,callback:I}),re.allBuffers&&J!=="buffer"&&(re.allBuffers=!1),re.allNoop&&I!==ne&&(re.allNoop=!1)):(re.writelen=U,re.writecb=I,re.writing=!0,re.sync=!0,le._write(me,J,re.onwrite),re.sync=!1),te&&!re.errored&&!re.destroyed}function H(le,re,me,J,I,U,te){re.writelen=J,re.writecb=te,re.writing=!0,re.sync=!0,re.destroyed?re.onwrite(new V("write")):me?le._writev(I,re.onwrite):le._write(I,U,re.onwrite),re.sync=!1}function Q(le,re,me,J){--re.pendingcb,J(me),Y(re),Ce(le,me)}function ae(le,re){const me=le._writableState,J=me.sync,I=me.writecb;if(typeof I!="function"){Ce(le,new P);return}me.writing=!1,me.writecb=null,me.length-=me.writelen,me.writelen=0,re?(re.stack,me.errored||(me.errored=re),le._readableState&&!le._readableState.errored&&(le._readableState.errored=re),J?n.nextTick(Q,le,me,re,I):Q(le,me,re,I)):(me.buffered.length>me.bufferedIndex&&ee(le,me),J?me.afterWriteTickInfo!==null&&me.afterWriteTickInfo.cb===I?me.afterWriteTickInfo.count++:(me.afterWriteTickInfo={count:1,cb:I,stream:le,state:me},n.nextTick(L,me.afterWriteTickInfo)):T(le,me,1,I))}function L({stream:le,state:re,count:me,cb:J}){return re.afterWriteTickInfo=null,T(le,re,me,J)}function T(le,re,me,J){for(!re.ending&&!le.destroyed&&re.length===0&&re.needDrain&&(re.needDrain=!1,le.emit("drain"));me-- >0;)re.pendingcb--,J();re.destroyed&&Y(re),Me(le,re)}function Y(le){if(le.writing)return;for(let I=le.bufferedIndex;I<le.buffered.length;++I){var re;const{chunk:U,callback:te}=le.buffered[I],ue=le.objectMode?1:U.length;le.length-=ue,te((re=le.errored)!==null&&re!==void 0?re:new V("write"))}const me=le[Le].splice(0);for(let I=0;I<me.length;I++){var J;me[I]((J=le.errored)!==null&&J!==void 0?J:new V("end"))}x(le)}function ee(le,re){if(re.corked||re.bufferProcessing||re.destroyed||!re.constructed)return;const{buffered:me,bufferedIndex:J,objectMode:I}=re,U=me.length-J;if(!U)return;let te=J;if(re.bufferProcessing=!0,U>1&&le._writev){re.pendingcb-=U-1;const ue=re.allNoop?ne:Ne=>{for(let Qe=te;Qe<me.length;++Qe)me[Qe].callback(Ne)},Ee=re.allNoop&&te===0?me:e(me,te);Ee.allBuffers=re.allBuffers,H(le,re,!0,re.length,Ee,"",ue),x(re)}else{do{const{chunk:ue,encoding:Ee,callback:Ne}=me[te];me[te++]=null;const Qe=I?1:ue.length;H(le,re,!1,Qe,ue,Ee,Ne)}while(te<me.length&&!re.writing);te===me.length?x(re):te>256?(me.splice(0,te),re.bufferedIndex=0):re.bufferedIndex=te}re.bufferProcessing=!1}O.prototype._write=function(le,re,me){if(this._writev)this._writev([{chunk:le,encoding:re}],me);else throw new N("_write()")},O.prototype._writev=null,O.prototype.end=function(le,re,me){const J=this._writableState;typeof le=="function"?(me=le,le=null,re=null):typeof re=="function"&&(me=re,re=null);let I;if(le!=null){const U=z(this,le,re);U instanceof t&&(I=U)}return J.corked&&(J.corked=1,this.uncork()),I||(!J.errored&&!J.ending?(J.ending=!0,Me(this,J,!0),J.ended=!0):J.finished?I=new de("end"):J.destroyed&&(I=new V("end"))),typeof me=="function"&&(I||J.finished?n.nextTick(me,I):J[Le].push(me)),this};function j(le){return le.ending&&!le.destroyed&&le.constructed&&le.length===0&&!le.errored&&le.buffered.length===0&&!le.finished&&!le.writing&&!le.errorEmitted&&!le.closeEmitted}function be(le,re){let me=!1;function J(I){if(me){Ce(le,I??P());return}if(me=!0,re.pendingcb--,I){const U=re[Le].splice(0);for(let te=0;te<U.length;te++)U[te](I);Ce(le,I,re.sync)}else j(re)&&(re.prefinished=!0,le.emit("prefinish"),re.pendingcb++,n.nextTick(De,le,re))}re.sync=!0,re.pendingcb++;try{le._final(J)}catch(I){J(I)}re.sync=!1}function Ie(le,re){!re.prefinished&&!re.finalCalled&&(typeof le._final=="function"&&!re.destroyed?(re.finalCalled=!0,be(le,re)):(re.prefinished=!0,le.emit("prefinish")))}function Me(le,re,me){j(re)&&(Ie(le,re),re.pendingcb===0&&(me?(re.pendingcb++,n.nextTick((J,I)=>{j(I)?De(J,I):I.pendingcb--},le,re)):j(re)&&(re.pendingcb++,De(le,re))))}function De(le,re){re.pendingcb--,re.finished=!0;const me=re[Le].splice(0);for(let J=0;J<me.length;J++)me[J]();if(le.emit("finish"),re.autoDestroy){const J=le._readableState;(!J||J.autoDestroy&&(J.endEmitted||J.readable===!1))&&le.destroy()}}o(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(le){this._writableState&&(this._writableState.destroyed=le)}},writable:{__proto__:null,get(){const le=this._writableState;return!!le&&le.writable!==!1&&!le.destroyed&&!le.errored&&!le.ending&&!le.ended},set(le){this._writableState&&(this._writableState.writable=!!le)}},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(){const le=this._writableState;return le?!le.destroyed&&!le.ending&&le.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)}}});const se=g.destroy;O.prototype.destroy=function(le,re){const me=this._writableState;return!me.destroyed&&(me.bufferedIndex<me.buffered.length||me[Le].length)&&n.nextTick(Y,me),se.call(this,le,re),this},O.prototype._undestroy=g.undestroy,O.prototype._destroy=function(le,re){re(le)},O.prototype[m.captureRejectionSymbol]=function(le){this.destroy(le)};let fe;function pe(){return fe===void 0&&(fe={}),fe}return O.fromWeb=function(le,re){return pe().newStreamWritableFromWritableStream(le,re)},O.toWeb=function(le){return pe().newWritableStreamFromStreamWritable(le)},_8}var x8,BN;function Mse(){if(BN)return x8;BN=1;const n=Vd(),e=qd,{isReadable:t,isWritable:r,isIterable:i,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:h,isWritableStream:m}=ef,w=Gd,{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:S}}=eo,{destroyer:A}=_m,k=Yc(),R=Y2(),N=W5(),{createDeferredPromise:P}=xs,q=pB,V=globalThis.Blob||e.Blob,de=typeof V<"u"?function(C){return C instanceof V}:function(C){return!1},oe=globalThis.AbortController||Rb().AbortController,{FunctionPrototypeCall:he}=ma;class Se extends k{constructor(C){super(C),(C==null?void 0:C.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(C==null?void 0:C.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}x8=function Le(C,x){if(p(C))return C;if(u(C))return ne({readable:C});if(c(C))return ne({writable:C});if(o(C))return ne({writable:!1,readable:!1});if(h(C))return ne({readable:R.fromWeb(C)});if(m(C))return ne({writable:N.fromWeb(C)});if(typeof C=="function"){const{value:z,write:F,final:H,destroy:Q}=Ce(C);if(i(z))return q(Se,z,{objectMode:!0,write:F,final:H,destroy:Q});const ae=z==null?void 0:z.then;if(typeof ae=="function"){let L;const T=he(ae,z,Y=>{if(Y!=null)throw new S("nully","body",Y)},Y=>{A(L,Y)});return L=new Se({objectMode:!0,readable:!1,write:F,final(Y){H(async()=>{try{await T,n.nextTick(Y,null)}catch(ee){n.nextTick(Y,ee)}})},destroy:Q})}throw new S("Iterable, AsyncIterable or AsyncFunction",x,z)}if(de(C))return Le(C.arrayBuffer());if(i(C))return q(Se,C,{objectMode:!0,writable:!1});if(h(C==null?void 0:C.readable)&&m(C==null?void 0:C.writable))return Se.fromWeb(C);if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){const z=C!=null&&C.readable?u(C==null?void 0:C.readable)?C==null?void 0:C.readable:Le(C.readable):void 0,F=C!=null&&C.writable?c(C==null?void 0:C.writable)?C==null?void 0:C.writable:Le(C.writable):void 0;return ne({readable:z,writable:F})}const O=C==null?void 0:C.then;if(typeof O=="function"){let z;return he(O,C,F=>{F!=null&&z.push(F),z.push(null)},F=>{A(z,F)}),z=new Se({objectMode:!0,writable:!1,read(){}})}throw new g(x,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function Ce(Le){let{promise:C,resolve:x}=P();const O=new oe,z=O.signal;return{value:Le(async function*(){for(;;){const H=C;C=null;const{chunk:Q,done:ae,cb:L}=await H;if(n.nextTick(L),ae)return;if(z.aborted)throw new b(void 0,{cause:z.reason});({promise:C,resolve:x}=P()),yield Q}}(),{signal:z}),write(H,Q,ae){const L=x;x=null,L({chunk:H,done:!1,cb:ae})},final(H){const Q=x;x=null,Q({done:!0,cb:H})},destroy(H,Q){O.abort(),Q(H)}}}function ne(Le){const C=Le.readable&&typeof Le.readable.read!="function"?R.wrap(Le.readable):Le.readable,x=Le.writable;let O=!!t(C),z=!!r(x),F,H,Q,ae,L;function T(Y){const ee=ae;ae=null,ee?ee(Y):Y&&L.destroy(Y)}return L=new Se({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(x!=null&&x.writableObjectMode),readable:O,writable:z}),z&&(w(x,Y=>{z=!1,Y&&A(C,Y),T(Y)}),L._write=function(Y,ee,j){x.write(Y,ee)?j():F=j},L._final=function(Y){x.end(),H=Y},x.on("drain",function(){if(F){const Y=F;F=null,Y()}}),x.on("finish",function(){if(H){const Y=H;H=null,Y()}})),O&&(w(C,Y=>{O=!1,Y&&A(C,Y),T(Y)}),C.on("readable",function(){if(Q){const Y=Q;Q=null,Y()}}),C.on("end",function(){L.push(null)}),L._read=function(){for(;;){const Y=C.read();if(Y===null){Q=L._read;return}if(!L.push(Y))return}}),L._destroy=function(Y,ee){!Y&&ae!==null&&(Y=new b),Q=null,F=null,H=null,ae===null?ee(Y):(ae=ee,A(x,Y),A(C,Y))},L}return x8}var S8,zN;function Yc(){if(zN)return S8;zN=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ma;S8=u;const i=Y2(),o=W5();r(u.prototype,i.prototype),r(u,i);{const m=t(o.prototype);for(let w=0;w<m.length;w++){const b=m[w];u.prototype[b]||(u.prototype[b]=o.prototype[b])}}function u(m){if(!(this instanceof u))return new u(m);i.call(this,m),o.call(this,m),m?(this.allowHalfOpen=m.allowHalfOpen!==!1,m.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(m){this._readableState&&this._writableState&&(this._readableState.destroyed=m,this._writableState.destroyed=m)}}});let c;function p(){return c===void 0&&(c={}),c}u.fromWeb=function(m,w){return p().newStreamDuplexFromReadableWritablePair(m,w)},u.toWeb=function(m){return p().newReadableWritablePairFromDuplex(m)};let h;return u.from=function(m){return h||(h=Mse()),h(m,"body")},S8}const{ObjectSetPrototypeOf:hB,Symbol:Tse}=ma;var yB=Jc;const{ERR_METHOD_NOT_IMPLEMENTED:Rse}=eo.codes,K5=Yc(),{getHighWaterMark:Ose}=K2;hB(Jc.prototype,K5.prototype);hB(Jc,K5);const hb=Tse("kCallback");function Jc(n){if(!(this instanceof Jc))return new Jc(n);const e=n?Ose(this,n,"readableHighWaterMark",!0):null;e===0&&(n={...n,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:n.writableHighWaterMark||0}),K5.call(this,n),this._readableState.sync=!1,this[hb]=null,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",Lse)}function P4(n){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){n?n(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),n&&n()}):(this.push(null),n&&n())}function Lse(){this._final!==P4&&P4.call(this)}Jc.prototype._final=P4;Jc.prototype._transform=function(n,e,t){throw new Rse("_transform()")};Jc.prototype._write=function(n,e,t){const r=this._readableState,i=this._writableState,o=r.length;this._transform(n,e,(u,c)=>{if(u){t(u);return}c!=null&&this.push(c),i.ended||o===r.length||r.length<r.highWaterMark?t():this[hb]=t})};Jc.prototype._read=function(){if(this[hb]){const n=this[hb];this[hb]=null,n()}};const{ObjectSetPrototypeOf:mB}=ma;var gB=nm;const Y5=yB;mB(nm.prototype,Y5.prototype);mB(nm,Y5);function nm(n){if(!(this instanceof nm))return new nm(n);Y5.call(this,n)}nm.prototype._transform=function(n,e,t){t(null,n)};const tb=Vd(),{ArrayIsArray:Nse,Promise:Pse,SymbolAsyncIterator:Ise,SymbolDispose:Dse}=ma,t2=Gd,{once:Use}=xs,Fse=_m,jN=Yc(),{aggregateTwoErrors:Bse,codes:{ERR_INVALID_ARG_TYPE:I4,ERR_INVALID_RETURN_VALUE:C8,ERR_MISSING_ARGS:zse,ERR_STREAM_DESTROYED:jse,ERR_STREAM_PREMATURE_CLOSE:Hse},AbortError:$se}=eo,{validateFunction:qse,validateAbortSignal:Vse}=Kb,{isIterable:th,isReadable:E8,isReadableNodeStream:Ix,isNodeStream:HN,isTransformStream:Dy,isWebStream:Gse,isReadableStream:A8,isReadableFinished:Wse}=ef,Kse=globalThis.AbortController||Rb().AbortController;let k8,M8,T8;function $N(n,e,t){let r=!1;n.on("close",()=>{r=!0});const i=t2(n,{readable:e,writable:t},o=>{r=!o});return{destroy:o=>{r||(r=!0,Fse.destroyer(n,o||new jse("pipe")))},cleanup:i}}function Yse(n){return qse(n[n.length-1],"streams[stream.length - 1]"),n.pop()}function R8(n){if(th(n))return n;if(Ix(n))return Jse(n);throw new I4("val",["Readable","Iterable","AsyncIterable"],n)}async function*Jse(n){M8||(M8=Y2()),yield*M8.prototype[Ise].call(n)}async function vx(n,e,t,{end:r}){let i,o=null;const u=h=>{if(h&&(i=h),o){const m=o;o=null,m()}},c=()=>new Pse((h,m)=>{i?m(i):o=()=>{i?m(i):h()}});e.on("drain",u);const p=t2(e,{readable:!1},u);try{e.writableNeedDrain&&await c();for await(const h of n)e.write(h)||await c();r&&(e.end(),await c()),t()}catch(h){t(i!==h?Bse(i,h):h)}finally{p(),e.off("drain",u)}}async function O8(n,e,t,{end:r}){Dy(e)&&(e=e.writable);const i=e.getWriter();try{for await(const o of n)await i.ready,i.write(o).catch(()=>{});await i.ready,r&&await i.close(),t()}catch(o){try{await i.abort(o),t(o)}catch(u){t(u)}}}function Qse(...n){return vB(n,Use(Yse(n)))}function vB(n,e,t){if(n.length===1&&Nse(n[0])&&(n=n[0]),n.length<2)throw new zse("streams");const r=new Kse,i=r.signal,o=t==null?void 0:t.signal,u=[];Vse(o,"options.signal");function c(){S(new $se)}T8=T8||xs.addAbortListener;let p;o&&(p=T8(o,c));let h,m;const w=[];let b=0;function g(N){S(N,--b===0)}function S(N,P){var q;if(N&&(!h||h.code==="ERR_STREAM_PREMATURE_CLOSE")&&(h=N),!(!h&&!P)){for(;w.length;)w.shift()(h);(q=p)===null||q===void 0||q[Dse](),r.abort(),P&&(h||u.forEach(V=>V()),tb.nextTick(e,h,m))}}let A;for(let N=0;N<n.length;N++){const P=n[N],q=N<n.length-1,V=N>0,de=q||(t==null?void 0:t.end)!==!1,oe=N===n.length-1;if(HN(P)){let he=function(Se){Se&&Se.name!=="AbortError"&&Se.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(Se)};if(de){const{destroy:Se,cleanup:Ce}=$N(P,q,V);w.push(Se),E8(P)&&oe&&u.push(Ce)}P.on("error",he),E8(P)&&oe&&u.push(()=>{P.removeListener("error",he)})}if(N===0)if(typeof P=="function"){if(A=P({signal:i}),!th(A))throw new C8("Iterable, AsyncIterable or Stream","source",A)}else th(P)||Ix(P)||Dy(P)?A=P:A=jN.from(P);else if(typeof P=="function"){if(Dy(A)){var k;A=R8((k=A)===null||k===void 0?void 0:k.readable)}else A=R8(A);if(A=P(A,{signal:i}),q){if(!th(A,!0))throw new C8("AsyncIterable",`transform[${N-1}]`,A)}else{var R;k8||(k8=gB);const he=new k8({objectMode:!0}),Se=(R=A)===null||R===void 0?void 0:R.then;if(typeof Se=="function")b++,Se.call(A,Le=>{m=Le,Le!=null&&he.write(Le),de&&he.end(),tb.nextTick(g)},Le=>{he.destroy(Le),tb.nextTick(g,Le)});else if(th(A,!0))b++,vx(A,he,g,{end:de});else if(A8(A)||Dy(A)){const Le=A.readable||A;b++,vx(Le,he,g,{end:de})}else throw new C8("AsyncIterable or Promise","destination",A);A=he;const{destroy:Ce,cleanup:ne}=$N(A,!1,!0);w.push(Ce),oe&&u.push(ne)}}else if(HN(P)){if(Ix(A)){b+=2;const he=Zse(A,P,g,{end:de});E8(P)&&oe&&u.push(he)}else if(Dy(A)||A8(A)){const he=A.readable||A;b++,vx(he,P,g,{end:de})}else if(th(A))b++,vx(A,P,g,{end:de});else throw new I4("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=P}else if(Gse(P)){if(Ix(A))b++,O8(R8(A),P,g,{end:de});else if(A8(A)||th(A))b++,O8(A,P,g,{end:de});else if(Dy(A))b++,O8(A.readable,P,g,{end:de});else throw new I4("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=P}else A=jN.from(P)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&tb.nextTick(c),A}function Zse(n,e,t,{end:r}){let i=!1;if(e.on("close",()=>{i||t(new Hse)}),n.pipe(e,{end:!1}),r){let o=function(){i=!0,e.end()};Wse(n)?tb.nextTick(o):n.once("end",o)}else t();return t2(n,{readable:!0,writable:!1},o=>{const u=n._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?n.once("end",t).once("error",t):t(o)}),t2(e,{readable:!1,writable:!0},t)}var J5={pipelineImpl:vB,pipeline:Qse};const{pipeline:Xse}=J5,bx=Yc(),{destroyer:eoe}=_m,{isNodeStream:wx,isReadable:qN,isWritable:VN,isWebStream:L8,isTransformStream:Zp,isWritableStream:GN,isReadableStream:WN}=ef,{AbortError:toe,codes:{ERR_INVALID_ARG_VALUE:KN,ERR_MISSING_ARGS:noe}}=eo,roe=Gd;var bB=function(...e){if(e.length===0)throw new noe("streams");if(e.length===1)return bx.from(e[0]);const t=[...e];if(typeof e[0]=="function"&&(e[0]=bx.from(e[0])),typeof e[e.length-1]=="function"){const g=e.length-1;e[g]=bx.from(e[g])}for(let g=0;g<e.length;++g)if(!(!wx(e[g])&&!L8(e[g]))){if(g<e.length-1&&!(qN(e[g])||WN(e[g])||Zp(e[g])))throw new KN(`streams[${g}]`,t[g],"must be readable");if(g>0&&!(VN(e[g])||GN(e[g])||Zp(e[g])))throw new KN(`streams[${g}]`,t[g],"must be writable")}let r,i,o,u,c;function p(g){const S=u;u=null,S?S(g):g?c.destroy(g):!b&&!w&&c.destroy()}const h=e[0],m=Xse(e,p),w=!!(VN(h)||GN(h)||Zp(h)),b=!!(qN(m)||WN(m)||Zp(m));if(c=new bx({writableObjectMode:!!(h!=null&&h.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:w,readable:b}),w){if(wx(h))c._write=function(S,A,k){h.write(S,A)?k():r=k},c._final=function(S){h.end(),i=S},h.on("drain",function(){if(r){const S=r;r=null,S()}});else if(L8(h)){const A=(Zp(h)?h.writable:h).getWriter();c._write=async function(k,R,N){try{await A.ready,A.write(k).catch(()=>{}),N()}catch(P){N(P)}},c._final=async function(k){try{await A.ready,A.close().catch(()=>{}),i=k}catch(R){k(R)}}}const g=Zp(m)?m.readable:m;roe(g,()=>{if(i){const S=i;i=null,S()}})}if(b){if(wx(m))m.on("readable",function(){if(o){const g=o;o=null,g()}}),m.on("end",function(){c.push(null)}),c._read=function(){for(;;){const g=m.read();if(g===null){o=c._read;return}if(!c.push(g))return}};else if(L8(m)){const S=(Zp(m)?m.readable:m).getReader();c._read=async function(){for(;;)try{const{value:A,done:k}=await S.read();if(!c.push(A))return;if(k){c.push(null);return}}catch{return}}}}return c._destroy=function(g,S){!g&&u!==null&&(g=new toe),o=null,r=null,i=null,u===null?S(g):(u=S,wx(m)&&eoe(m,g))},c};const aoe=globalThis.AbortController||Rb().AbortController,{codes:{ERR_INVALID_ARG_VALUE:ioe,ERR_INVALID_ARG_TYPE:Jb,ERR_MISSING_ARGS:soe,ERR_OUT_OF_RANGE:ooe},AbortError:Kl}=eo,{validateAbortSignal:Oh,validateInteger:YN,validateObject:Lh}=Kb,uoe=ma.Symbol("kWeak"),loe=ma.Symbol("kResistStopPropagation"),{finished:coe}=Gd,foe=bB,{addAbortSignalNoValidate:doe}=W2,{isWritable:poe,isNodeStream:hoe}=ef,{deprecate:yoe}=xs,{ArrayPrototypePush:moe,Boolean:goe,MathFloor:JN,Number:voe,NumberIsNaN:boe,Promise:QN,PromiseReject:ZN,PromiseResolve:woe,PromisePrototypeThen:XN,Symbol:wB}=ma,n2=wB("kEmpty"),eP=wB("kEof");function _oe(n,e){if(e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),hoe(n)&&!poe(n))throw new ioe("stream",n,"must be writable");const t=foe(this,n);return e!=null&&e.signal&&doe(e.signal,t),t}function J2(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal");let t=1;(e==null?void 0:e.concurrency)!=null&&(t=JN(e.concurrency));let r=t-1;return(e==null?void 0:e.highWaterMark)!=null&&(r=JN(e.highWaterMark)),YN(t,"options.concurrency",1),YN(r,"options.highWaterMark",0),r+=t,(async function*(){const o=xs.AbortSignalAny([e==null?void 0:e.signal].filter(goe)),u=this,c=[],p={signal:o};let h,m,w=!1,b=0;function g(){w=!0,S()}function S(){b-=1,A()}function A(){m&&!w&&b<t&&c.length<r&&(m(),m=null)}async function k(){try{for await(let R of u){if(w)return;if(o.aborted)throw new Kl;try{if(R=n(R,p),R===n2)continue;R=woe(R)}catch(N){R=ZN(N)}b+=1,XN(R,S,g),c.push(R),h&&(h(),h=null),!w&&(c.length>=r||b>=t)&&await new QN(N=>{m=N})}c.push(eP)}catch(R){const N=ZN(R);XN(N,S,g),c.push(N)}finally{w=!0,h&&(h(),h=null)}}k();try{for(;;){for(;c.length>0;){const R=await c[0];if(R===eP)return;if(o.aborted)throw new Kl;R!==n2&&(yield R),c.shift(),A()}await new QN(R=>{h=R})}}finally{w=!0,m&&(m(),m=null)}}).call(this)}function xoe(n=void 0){return n!=null&&Lh(n,"options"),(n==null?void 0:n.signal)!=null&&Oh(n.signal,"options.signal"),(async function*(){let t=0;for await(const i of this){var r;if(n!=null&&(r=n.signal)!==null&&r!==void 0&&r.aborted)throw new Kl({cause:n.signal.reason});yield[t++,i]}}).call(this)}async function _B(n,e=void 0){for await(const t of Q5.call(this,n,e))return!0;return!1}async function Soe(n,e=void 0){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);return!await _B.call(this,async(...t)=>!await n(...t),e)}async function Coe(n,e){for await(const t of Q5.call(this,n,e))return t}async function Eoe(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i),n2}for await(const r of J2.call(this,t,e));}function Q5(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i)?r:n2}return J2.call(this,t,e)}class Aoe extends soe{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function koe(n,e,t){var r;if(typeof n!="function")throw new Jb("reducer",["Function","AsyncFunction"],n);t!=null&&Lh(t,"options"),(t==null?void 0:t.signal)!=null&&Oh(t.signal,"options.signal");let i=arguments.length>1;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted){const h=new Kl(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await coe(this.destroy(h)),h}const o=new aoe,u=o.signal;if(t!=null&&t.signal){const h={once:!0,[uoe]:this,[loe]:!0};t.signal.addEventListener("abort",()=>o.abort(),h)}let c=!1;try{for await(const h of this){var p;if(c=!0,t!=null&&(p=t.signal)!==null&&p!==void 0&&p.aborted)throw new Kl;i?e=await n(e,h,{signal:u}):(e=h,i=!0)}if(!c&&!i)throw new Aoe}finally{o.abort()}return e}async function Moe(n){n!=null&&Lh(n,"options"),(n==null?void 0:n.signal)!=null&&Oh(n.signal,"options.signal");const e=[];for await(const r of this){var t;if(n!=null&&(t=n.signal)!==null&&t!==void 0&&t.aborted)throw new Kl(void 0,{cause:n.signal.reason});moe(e,r)}return e}function Toe(n,e){const t=J2.call(this,n,e);return(async function*(){for await(const i of t)yield*i}).call(this)}function xB(n){if(n=voe(n),boe(n))return 0;if(n<0)throw new ooe("number",">= 0",n);return n}function Roe(n,e=void 0){return e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),n=xB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Kl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Kl;n--<=0&&(yield o)}}).call(this)}function Ooe(n,e=void 0){return e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),n=xB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Kl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Kl;if(n-- >0&&(yield o),n<=0)return}}).call(this)}B5.streamReturningOperators={asIndexedPairs:yoe(xoe,"readable.asIndexedPairs will be removed in a future version."),drop:Roe,filter:Q5,flatMap:Toe,map:J2,take:Ooe,compose:_oe};B5.promiseReturningOperators={every:Soe,forEach:Eoe,reduce:koe,toArray:Moe,some:_B,find:Coe};var N8,tP;function SB(){if(tP)return N8;tP=1;const{ArrayPrototypePop:n,Promise:e}=ma,{isIterable:t,isNodeStream:r,isWebStream:i}=ef,{pipelineImpl:o}=J5,{finished:u}=Gd;CB();function c(...p){return new e((h,m)=>{let w,b;const g=p[p.length-1];if(g&&typeof g=="object"&&!r(g)&&!t(g)&&!i(g)){const S=n(p);w=S.signal,b=S.end}o(p,(S,A)=>{S?m(S):h(A)},{signal:w,end:b})})}return N8={finished:u,pipeline:c},N8}var nP;function CB(){if(nP)return h8.exports;nP=1;const{Buffer:n}=qd,{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ma,{promisify:{custom:i}}=xs,{streamReturningOperators:o,promiseReturningOperators:u}=B5,{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=eo,p=bB,{setDefaultHighWaterMark:h,getDefaultHighWaterMark:m}=K2,{pipeline:w}=J5,{destroyer:b}=_m,g=Gd,S=SB(),A=ef,k=h8.exports=q5.Stream;k.isDestroyed=A.isDestroyed,k.isDisturbed=A.isDisturbed,k.isErrored=A.isErrored,k.isReadable=A.isReadable,k.isWritable=A.isWritable,k.Readable=Y2();for(const N of t(o)){let q=function(...V){if(new.target)throw c();return k.Readable.from(r(P,this,V))};const P=o[N];e(q,"name",{__proto__:null,value:P.name}),e(q,"length",{__proto__:null,value:P.length}),e(k.Readable.prototype,N,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}for(const N of t(u)){let q=function(...V){if(new.target)throw c();return r(P,this,V)};const P=u[N];e(q,"name",{__proto__:null,value:P.name}),e(q,"length",{__proto__:null,value:P.length}),e(k.Readable.prototype,N,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}k.Writable=W5(),k.Duplex=Yc(),k.Transform=yB,k.PassThrough=gB,k.pipeline=w;const{addAbortSignal:R}=W2;return k.addAbortSignal=R,k.finished=g,k.destroy=b,k.compose=p,k.setDefaultHighWaterMark=h,k.getDefaultHighWaterMark=m,e(k,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(w,i,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return S.finished}}),k.Stream=k,k._isUint8Array=function(P){return P instanceof Uint8Array},k._uint8ArrayToBuffer=function(P){return n.from(P.buffer,P.byteOffset,P.byteLength)},h8.exports}(function(n){const e=CB(),t=SB(),r=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=r,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(AF);var Loe=AF.exports;typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Nb().Buffer);const Ry=lU,rP=Loe,Noe=ki;globalThis.process||(globalThis.process=Vd());if(typeof crypto>"u"){const n=h2;n.getRandomValues=e=>n.randomBytes(e.length),globalThis.crypto=n}const ii={ElvCrypto:async()=>{try{if(!ii.elvCrypto){const n=(await Promise.resolve().then(()=>require("./index-CC3j7vdV.js"))).default;ii.elvCrypto=await new n().init()}return ii.elvCrypto}catch(n){console.error("Error initializing ElvCrypto:"),console.error(n)}},EncryptedSize:n=>{const t=Math.floor(n/1e6);let r=ii.EncryptedBlockSize(1e6),i=t*r;return n%1e6!==0&&(i+=ii.EncryptedBlockSize(n%1e6)),i},EncryptedBlockSize:(n,e=!1)=>{let c=Math.floor(n/564)*576;return n%564!==0&&(c+=576),e?c+608:c+129},async EncryptConk(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=new Uint8Array(Buffer.from(JSON.stringify(n)));const{data:r,ephemeralKey:i,tag:o}=await t.encryptECIES(n,e),u=Buffer.concat([Buffer.from(i),Buffer.from(o),Buffer.from(r)]);return Noe.B64(u)},async DecryptCap(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=Buffer.from(n,"base64");const r=n.slice(0,65),i=n.slice(65,81),o=n.slice(81),u=t.decryptECIES(new Uint8Array(o),e,new Uint8Array(r),new Uint8Array(i));return JSON.parse(Buffer.from(u).toString())},async GeneratePrimaryConk({spaceId:n,objectId:e}){const t=await ii.ElvCrypto(),{secretKey:r,publicKey:i}=t.generatePrimaryKeys(),o=t.generateSymmetricKey().key;return{symm_key:`kpsy${Ry.encode(Buffer.from(o))}`,secret_key:`kpsk${Ry.encode(Buffer.from(r))}`,public_key:`kppk${Ry.encode(Buffer.from(i))}`,sid:n,qid:e}},async GenerateTargetConk(){const n=await ii.ElvCrypto(),{secretKey:e,publicKey:t}=n.generateTargetKeys();return{secret_key:`kpsk${Ry.encode(Buffer.from(e))}`,public_key:`ktpk${Ry.encode(Buffer.from(t))}`}},CapToConk(n){const e=t=>new Uint8Array(Ry.decode(t.slice(4)));return{symmetricKey:e(n.symm_key),secretKey:e(n.secret_key),publicKey:e(n.public_key)}},async EncryptionContext(n){const e=await ii.ElvCrypto(),{symmetricKey:t,secretKey:r,publicKey:i}=ii.CapToConk(n);let o,u;return i.length===e.PRIMARY_PK_KEY_SIZE?(u=e.CRYPTO_TYPE_PRIMARY,o=e.newPrimaryContext(i,r,t)):(u=e.CRYPTO_TYPE_TARGET,o=e.newTargetDecryptionContext(r,t)),{context:o,type:u}},Encrypt:async(n,e)=>{const t=await ii.OpenEncryptionStream(n);!Buffer.isBuffer(e)&&!(e instanceof ArrayBuffer)&&(e=Buffer.from(await new Response(e).arrayBuffer()));const r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenEncryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t}=await ii.EncryptionContext(n),r=new rP.PassThrough,i=e.createCipher(t);return r.pipe(i).on("finish",()=>{t.free()}).on("error",o=>{throw Error(o)})},Decrypt:async(n,e)=>{const t=await ii.OpenDecryptionStream(n),r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenDecryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t,type:r}=await ii.EncryptionContext(n),i=new rP.PassThrough,o=e.createDecipher(r,t);return i.pipe(o).on("finish",()=>{t.free()}).on("error",u=>{throw Error(u)})}};var EB=ii,Zr={},aP;function AB(){if(aP)return Zr;aP=1;const n=ki;let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=C5().Response,e=h2);const t=rs,{ValidatePresence:r,ValidateWriteToken:i,ValidatePartHash:o,ValidateParameters:u}=Ko;return Zr.ListFiles=async function({libraryId:c,objectId:p,path:h="",versionHash:m,writeToken:w}){u({libraryId:c,objectId:p,versionHash:m,writeToken:w}),m&&(p=this.utils.DecodeVersionHash(m).objectId);let b=t("q",w||m||p,"files_list",h);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:m}),method:"GET",path:b})},Zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:h,region:m,bucket:w,fileInfo:b,accessKey:g,secret:S,signedUrl:A,encryption:k="none",copy:R=!1,callback:N}){u({libraryId:c,objectId:p}),i(h);const P=/^s3:\/\/([^/]+)\//i;for(let Se=0;Se<b.length;Se++){const Ce=b[Se].source,ne=P.exec(Ce);if(ne){if(ne[1]!==w)throw Error('Full S3 file path "'+Ce+`" specified, but does not match provided bucket name '`+w+"'");b[Se].source=Ce.replace(P,"")}}R?this.Log(`Copying files from S3: ${c} ${p} ${h}`):this.Log(`Adding links to files in S3: ${c} ${p} ${h}`);let q;if(k==="cgck"){let Se=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});Se={...Se,secret_key:""},q=`kp__${this.utils.B58(Buffer.from(JSON.stringify(Se)))}`}let V={access_key_id:g,secret_access_key:S};A&&(V={signed_url:A});const de={encryption_key:q,access:{protocol:"s3",platform:"aws",path:w,storage_endpoint:{region:m},cloud_credentials:V}},oe=b.map(Se=>R?{op:"ingest-copy",path:Se.path,encryption:{scheme:k==="cgck"?"cgck":"none"},ingest:{type:"key",path:Se.source}}:{op:"add-reference",path:Se.path,reference:{type:"key",path:Se.source}}),{id:he}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:oe,defaults:de});for(;;){await new Promise(ne=>setTimeout(ne,1e3));const Se=await this.UploadStatus({libraryId:c,objectId:p,writeToken:h,uploadId:he});if(Se.errors&&Se.errors.length>1)throw Se.errors.join(`
327
+ `;super(S),this.name="AggregateError",this.errors=g}}n.exports={AggregateError:w,kEmptyObject:Object.freeze({}),once(b){let g=!1;return function(...S){g||(g=!0,b.apply(this,S))}},createDeferredPromise:function(){let b,g;return{promise:new Promise((A,k)=>{b=A,g=k}),resolve:b,reject:g}},promisify(b){return new Promise((g,S)=>{b((A,...k)=>A?S(A):g(...k))})},debuglog(){return function(){}},format(b,...g){return b.replace(/%([sdifj])/g,function(...[S,A]){const k=g.shift();return A==="f"?k.toFixed(6):A==="j"?JSON.stringify(k):A==="s"&&typeof k=="object"?`${k.constructor!==Object?k.constructor.name:""} {}`.trim():k.toString()})},inspect(b){switch(typeof b){case"string":if(b.includes("'"))if(b.includes('"')){if(!b.includes("`")&&!b.includes("${"))return`\`${b}\``}else return`"${b}"`;return`'${b}'`;case"number":return isNaN(b)?"NaN":Object.is(b,-0)?String(b):b;case"bigint":return`${String(b)}n`;case"boolean":case"undefined":return String(b);case"object":return"{}"}},types:{isAsyncFunction(b){return b instanceof u},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:p,deprecate(b,g){return b},addAbortListener:Wb.addAbortListener||function(g,S){if(g===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",g);h(g,"signal"),m(S,"listener");let A;return g.aborted?queueMicrotask(()=>S()):(g.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{g.removeEventListener("abort",S)}),{__proto__:null,[r](){var k;(k=A)===null||k===void 0||k()}}},AbortSignalAny:i.any||function(g){if(g.length===1)return g[0];const S=new o,A=()=>S.abort();return g.forEach(k=>{h(k,"signals"),k.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{g.forEach(k=>k.removeEventListener("abort",A))},{once:!0}),S.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(kF);var xs=kF.exports,B5={};const{format:dae,inspect:e2,AggregateError:pae}=xs,hae=globalThis.AggregateError||pae,yae=Symbol("kIsNodeError"),mae=["string","function","number","object","Function","Object","boolean","bigint","symbol"],gae=/^([A-Z][a-z0-9]*)+$/,vae="__node_internal_",z2={};function fh(n,e){if(!n)throw new z2.ERR_INTERNAL_ASSERTION(e)}function hN(n){let e="",t=n.length;const r=n[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${n.slice(t-3,t)}${e}`;return`${n.slice(0,t)}${e}`}function bae(n,e,t){if(typeof e=="function")return fh(e.length<=t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);const r=(e.match(/%[dfijoOs]/g)||[]).length;return fh(r===t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${r}).`),t.length===0?e:dae(e,...t)}function Mi(n,e,t){t||(t=Error);class r extends t{constructor(...o){super(bae(n,e,o))}toString(){return`${this.name} [${n}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${n}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=n,r.prototype[yae]=!0,z2[n]=r}function yN(n){const e=vae+n.name;return Object.defineProperty(n,"name",{value:e}),n}function wae(n,e){if(n&&e&&n!==e){if(Array.isArray(e.errors))return e.errors.push(n),e;const t=new hae([e,n],e.message);return t.code=e.code,t}return n||e}let _ae=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new z2.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};Mi("ERR_ASSERTION","%s",Error);Mi("ERR_INVALID_ARG_TYPE",(n,e,t)=>{fh(typeof n=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";n.endsWith(" argument")?r+=`${n} `:r+=`"${n}" ${n.includes(".")?"property":"argument"} `,r+="must be ";const i=[],o=[],u=[];for(const p of e)fh(typeof p=="string","All expected entries have to be of type string"),mae.includes(p)?i.push(p.toLowerCase()):gae.test(p)?o.push(p):(fh(p!=="object",'The value "object" should be written as "Object"'),u.push(p));if(o.length>0){const p=i.indexOf("object");p!==-1&&(i.splice(i,p,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:r+=`of type ${i[0]}`;break;case 2:r+=`one of type ${i[0]} or ${i[1]}`;break;default:{const p=i.pop();r+=`one of type ${i.join(", ")}, or ${p}`}}(o.length>0||u.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const p=o.pop();r+=`an instance of ${o.join(", ")}, or ${p}`}}u.length>0&&(r+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(r+="an "),r+=`${u[0]}`;break;case 2:r+=`one of ${u[0]} or ${u[1]}`;break;default:{const p=u.pop();r+=`one of ${u.join(", ")}, or ${p}`}}if(t==null)r+=`. Received ${t}`;else if(typeof t=="function"&&t.name)r+=`. Received function ${t.name}`;else if(typeof t=="object"){var c;if((c=t.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${t.constructor.name}`;else{const p=e2(t,{depth:-1});r+=`. Received ${p}`}}else{let p=e2(t,{colors:!1});p.length>25&&(p=`${p.slice(0,25)}...`),r+=`. Received type ${typeof t} (${p})`}return r},TypeError);Mi("ERR_INVALID_ARG_VALUE",(n,e,t="is invalid")=>{let r=e2(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${n.includes(".")?"property":"argument"} '${n}' ${t}. Received ${r}`},TypeError);Mi("ERR_INVALID_RETURN_VALUE",(n,e,t)=>{var r;const i=t!=null&&(r=t.constructor)!==null&&r!==void 0&&r.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${n} to be returned from the "${e}" function but got ${i}.`},TypeError);Mi("ERR_MISSING_ARGS",(...n)=>{fh(n.length>0,"At least one arg needs to be specified");let e;const t=n.length;switch(n=(Array.isArray(n)?n:[n]).map(r=>`"${r}"`).join(" or "),t){case 1:e+=`The ${n[0]} argument`;break;case 2:e+=`The ${n[0]} and ${n[1]} arguments`;break;default:{const r=n.pop();e+=`The ${n.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Mi("ERR_OUT_OF_RANGE",(n,e,t)=>{fh(e,'Missing "range" argument');let r;return Number.isInteger(t)&&Math.abs(t)>2**32?r=hN(String(t)):typeof t=="bigint"?(r=String(t),(t>2n**32n||t<-(2n**32n))&&(r=hN(r)),r+="n"):r=e2(t),`The value of "${n}" is out of range. It must be ${e}. Received ${r}`},RangeError);Mi("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Mi("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Mi("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Mi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Mi("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Mi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Mi("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Mi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Mi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Mi("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Mi("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var eo={AbortError:_ae,aggregateTwoErrors:yN(wae),hideStackFrames:yN,codes:z2};const{ArrayIsArray:z5,ArrayPrototypeIncludes:DF,ArrayPrototypeJoin:UF,ArrayPrototypeMap:xae,NumberIsInteger:j5,NumberIsNaN:Sae,NumberMAX_SAFE_INTEGER:Cae,NumberMIN_SAFE_INTEGER:Eae,NumberParseInt:Aae,ObjectPrototypeHasOwnProperty:kae,RegExpPrototypeExec:FF,String:Mae,StringPrototypeToUpperCase:Tae,StringPrototypeTrim:Rae}=ma,{hideStackFrames:Yo,codes:{ERR_SOCKET_BAD_PORT:Oae,ERR_INVALID_ARG_TYPE:as,ERR_INVALID_ARG_VALUE:wm,ERR_OUT_OF_RANGE:vh,ERR_UNKNOWN_SIGNAL:mN}}=eo,{normalizeEncoding:Lae}=xs,{isAsyncFunction:Nae,isArrayBufferView:Pae}=xs.types,gN={};function Iae(n){return n===(n|0)}function Dae(n){return n===n>>>0}const Uae=/^[0-7]+$/,Fae="must be a 32-bit unsigned integer or an octal string";function Bae(n,e,t){if(typeof n>"u"&&(n=t),typeof n=="string"){if(FF(Uae,n)===null)throw new wm(e,n,Fae);n=Aae(n,8)}return BF(n,e),n}const zae=Yo((n,e,t=Eae,r=Cae)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);if(n<t||n>r)throw new vh(e,`>= ${t} && <= ${r}`,n)}),jae=Yo((n,e,t=-2147483648,r=2147483647)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);if(n<t||n>r)throw new vh(e,`>= ${t} && <= ${r}`,n)}),BF=Yo((n,e,t=!1)=>{if(typeof n!="number")throw new as(e,"number",n);if(!j5(n))throw new vh(e,"an integer",n);const r=t?1:0,i=4294967295;if(n<r||n>i)throw new vh(e,`>= ${r} && <= ${i}`,n)});function H5(n,e){if(typeof n!="string")throw new as(e,"string",n)}function Hae(n,e,t=void 0,r){if(typeof n!="number")throw new as(e,"number",n);if(t!=null&&n<t||r!=null&&n>r||(t!=null||r!=null)&&Sae(n))throw new vh(e,`${t!=null?`>= ${t}`:""}${t!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,n)}const $ae=Yo((n,e,t)=>{if(!DF(t,n)){const i="must be one of: "+UF(xae(t,o=>typeof o=="string"?`'${o}'`:Mae(o)),", ");throw new wm(e,n,i)}});function zF(n,e){if(typeof n!="boolean")throw new as(e,"boolean",n)}function y8(n,e,t){return n==null||!kae(n,e)?t:n[e]}const qae=Yo((n,e,t=null)=>{const r=y8(t,"allowArray",!1),i=y8(t,"allowFunction",!1);if(!y8(t,"nullable",!1)&&n===null||!r&&z5(n)||typeof n!="object"&&(!i||typeof n!="function"))throw new as(e,"Object",n)}),Vae=Yo((n,e)=>{if(n!=null&&typeof n!="object"&&typeof n!="function")throw new as(e,"a dictionary",n)}),j2=Yo((n,e,t=0)=>{if(!z5(n))throw new as(e,"Array",n);if(n.length<t){const r=`must be longer than ${t}`;throw new wm(e,n,r)}});function Gae(n,e){j2(n,e);for(let t=0;t<n.length;t++)H5(n[t],`${e}[${t}]`)}function Wae(n,e){j2(n,e);for(let t=0;t<n.length;t++)zF(n[t],`${e}[${t}]`)}function Kae(n,e){j2(n,e);for(let t=0;t<n.length;t++){const r=n[t],i=`${e}[${t}]`;if(r==null)throw new as(i,"AbortSignal",r);jF(r,i)}}function Yae(n,e="signal"){if(H5(n,e),gN[n]===void 0)throw gN[Tae(n)]!==void 0?new mN(n+" (signals must use all capital letters)"):new mN(n)}const Jae=Yo((n,e="buffer")=>{if(!Pae(n))throw new as(e,["Buffer","TypedArray","DataView"],n)});function Qae(n,e){const t=Lae(e),r=n.length;if(t==="hex"&&r%2!==0)throw new wm("encoding",e,`is invalid for data of length ${r}`)}function Zae(n,e="Port",t=!0){if(typeof n!="number"&&typeof n!="string"||typeof n=="string"&&Rae(n).length===0||+n!==+n>>>0||n>65535||n===0&&!t)throw new Oae(e,n,t);return n|0}const jF=Yo((n,e)=>{if(n!==void 0&&(n===null||typeof n!="object"||!("aborted"in n)))throw new as(e,"AbortSignal",n)}),Xae=Yo((n,e)=>{if(typeof n!="function")throw new as(e,"Function",n)}),eie=Yo((n,e)=>{if(typeof n!="function"||Nae(n))throw new as(e,"Function",n)}),tie=Yo((n,e)=>{if(n!==void 0)throw new as(e,"undefined",n)});function nie(n,e,t){if(!DF(t,n))throw new as(e,`('${UF(t,"|")}')`,n)}const rie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function vN(n,e){if(typeof n>"u"||!FF(rie,n))throw new wm(e,n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function aie(n){if(typeof n=="string")return vN(n,"hints"),n;if(z5(n)){const e=n.length;let t="";if(e===0)return t;for(let r=0;r<e;r++){const i=n[r];vN(i,"hints"),t+=i,r!==e-1&&(t+=", ")}return t}throw new wm("hints",n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var Kb={isInt32:Iae,isUint32:Dae,parseFileMode:Bae,validateArray:j2,validateStringArray:Gae,validateBooleanArray:Wae,validateAbortSignalArray:Kae,validateBoolean:zF,validateBuffer:Jae,validateDictionary:Vae,validateEncoding:Qae,validateFunction:Xae,validateInt32:jae,validateInteger:zae,validateNumber:Hae,validateObject:qae,validateOneOf:$ae,validatePlainFunction:eie,validatePort:Zae,validateSignalName:Yae,validateString:H5,validateUint32:BF,validateUndefined:tie,validateUnion:nie,validateAbortSignal:jF,validateLinkHeaderValue:aie},$5={exports:{}},m8={exports:{}},bN;function Vd(){if(bN)return m8.exports;bN=1;var n=m8.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(A){if(e===setTimeout)return setTimeout(A,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function u(A){if(t===clearTimeout)return clearTimeout(A);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,h,m=-1;function w(){!p||!h||(p=!1,h.length?c=h.concat(c):m=-1,c.length&&b())}function b(){if(!p){var A=o(w);p=!0;for(var k=c.length;k;){for(h=c,c=[];++m<k;)h&&h[m].run();m=-1,k=c.length}h=null,p=!1,u(A)}}n.nextTick=function(A){var k=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)k[R-1]=arguments[R];c.push(new g(A,k)),c.length===1&&!p&&o(b)};function g(A,k){this.fun=A,this.array=k}g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}return n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(A){return[]},n.binding=function(A){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(A){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},m8.exports}const{SymbolAsyncIterator:wN,SymbolIterator:_N,SymbolFor:Rh}=ma,HF=Rh("nodejs.stream.destroyed"),$F=Rh("nodejs.stream.errored"),E4=Rh("nodejs.stream.readable"),A4=Rh("nodejs.stream.writable"),qF=Rh("nodejs.stream.disturbed"),iie=Rh("nodejs.webstream.isClosedPromise"),sie=Rh("nodejs.webstream.controllerErrorFunction");function H2(n,e=!1){var t;return!!(n&&typeof n.pipe=="function"&&typeof n.on=="function"&&(!e||typeof n.pause=="function"&&typeof n.resume=="function")&&(!n._writableState||((t=n._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!n._writableState||n._readableState))}function $2(n){var e;return!!(n&&typeof n.write=="function"&&typeof n.on=="function"&&(!n._readableState||((e=n._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function oie(n){return!!(n&&typeof n.pipe=="function"&&n._readableState&&typeof n.on=="function"&&typeof n.write=="function")}function Zl(n){return n&&(n._readableState||n._writableState||typeof n.write=="function"&&typeof n.on=="function"||typeof n.pipe=="function"&&typeof n.on=="function")}function VF(n){return!!(n&&!Zl(n)&&typeof n.pipeThrough=="function"&&typeof n.getReader=="function"&&typeof n.cancel=="function")}function GF(n){return!!(n&&!Zl(n)&&typeof n.getWriter=="function"&&typeof n.abort=="function")}function WF(n){return!!(n&&!Zl(n)&&typeof n.readable=="object"&&typeof n.writable=="object")}function uie(n){return VF(n)||GF(n)||WF(n)}function lie(n,e){return n==null?!1:e===!0?typeof n[wN]=="function":e===!1?typeof n[_N]=="function":typeof n[wN]=="function"||typeof n[_N]=="function"}function q2(n){if(!Zl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!!(n.destroyed||n[HF]||r!=null&&r.destroyed)}function KF(n){if(!$2(n))return null;if(n.writableEnded===!0)return!0;const e=n._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function cie(n,e){if(!$2(n))return null;if(n.writableFinished===!0)return!0;const t=n._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.finished)!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}function fie(n){if(!H2(n))return null;if(n.readableEnded===!0)return!0;const e=n._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function YF(n,e){if(!H2(n))return null;const t=n._readableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.endEmitted)!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}function JF(n){return n&&n[E4]!=null?n[E4]:typeof(n==null?void 0:n.readable)!="boolean"?null:q2(n)?!1:H2(n)&&n.readable&&!YF(n)}function QF(n){return n&&n[A4]!=null?n[A4]:typeof(n==null?void 0:n.writable)!="boolean"?null:q2(n)?!1:$2(n)&&n.writable&&!KF(n)}function die(n,e){return Zl(n)?q2(n)?!0:!((e==null?void 0:e.readable)!==!1&&JF(n)||(e==null?void 0:e.writable)!==!1&&QF(n)):null}function pie(n){var e,t;return Zl(n)?n.writableErrored?n.writableErrored:(e=(t=n._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function hie(n){var e,t;return Zl(n)?n.readableErrored?n.readableErrored:(e=(t=n._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function yie(n){if(!Zl(n))return null;if(typeof n.closed=="boolean")return n.closed;const e=n._writableState,t=n._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(t==null?void 0:t.closed)=="boolean"?(e==null?void 0:e.closed)||(t==null?void 0:t.closed):typeof n._closed=="boolean"&&ZF(n)?n._closed:null}function ZF(n){return typeof n._closed=="boolean"&&typeof n._defaultKeepAlive=="boolean"&&typeof n._removedConnection=="boolean"&&typeof n._removedContLen=="boolean"}function XF(n){return typeof n._sent100=="boolean"&&ZF(n)}function mie(n){var e;return typeof n._consuming=="boolean"&&typeof n._dumped=="boolean"&&((e=n.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function gie(n){if(!Zl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!r&&XF(n)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function vie(n){var e;return!!(n&&((e=n[qF])!==null&&e!==void 0?e:n.readableDidRead||n.readableAborted))}function bie(n){var e,t,r,i,o,u,c,p,h,m;return!!(n&&((e=(t=(r=(i=(o=(u=n[$F])!==null&&u!==void 0?u:n.readableErrored)!==null&&o!==void 0?o:n.writableErrored)!==null&&i!==void 0?i:(c=n._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(p=n._writableState)===null||p===void 0?void 0:p.errorEmitted)!==null&&t!==void 0?t:(h=n._readableState)===null||h===void 0?void 0:h.errored)!==null&&e!==void 0?e:!((m=n._writableState)===null||m===void 0)&&m.errored))}var ef={isDestroyed:q2,kIsDestroyed:HF,isDisturbed:vie,kIsDisturbed:qF,isErrored:bie,kIsErrored:$F,isReadable:JF,kIsReadable:E4,kIsClosedPromise:iie,kControllerErrorFunction:sie,kIsWritable:A4,isClosed:yie,isDuplexNodeStream:oie,isFinished:die,isIterable:lie,isReadableNodeStream:H2,isReadableStream:VF,isReadableEnded:fie,isReadableFinished:YF,isReadableErrored:hie,isNodeStream:Zl,isWebStream:uie,isWritable:QF,isWritableNodeStream:$2,isWritableStream:GF,isWritableEnded:KF,isWritableFinished:cie,isWritableErrored:pie,isServerRequest:mie,isServerResponse:XF,willEmitClose:gie,isTransformStream:WF};const _d=Vd(),{AbortError:eB,codes:wie}=eo,{ERR_INVALID_ARG_TYPE:_ie,ERR_STREAM_PREMATURE_CLOSE:xN}=wie,{kEmptyObject:k4,once:M4}=xs,{validateAbortSignal:xie,validateFunction:Sie,validateObject:Cie,validateBoolean:Eie}=Kb,{Promise:Aie,PromisePrototypeThen:kie,SymbolDispose:tB}=ma,{isClosed:Mie,isReadable:SN,isReadableNodeStream:g8,isReadableStream:Tie,isReadableFinished:CN,isReadableErrored:EN,isWritable:AN,isWritableNodeStream:kN,isWritableStream:Rie,isWritableFinished:MN,isWritableErrored:TN,isNodeStream:Oie,willEmitClose:Lie,kIsClosedPromise:Nie}=ef;let Vy;function Pie(n){return n.setHeader&&typeof n.abort=="function"}const T4=()=>{};function nB(n,e,t){var r,i;if(arguments.length===2?(t=e,e=k4):e==null?e=k4:Cie(e,"options"),Sie(t,"callback"),xie(e.signal,"options.signal"),t=M4(t),Tie(n)||Rie(n))return Iie(n,e,t);if(!Oie(n))throw new _ie("stream",["ReadableStream","WritableStream","Stream"],n);const o=(r=e.readable)!==null&&r!==void 0?r:g8(n),u=(i=e.writable)!==null&&i!==void 0?i:kN(n),c=n._writableState,p=n._readableState,h=()=>{n.writable||b()};let m=Lie(n)&&g8(n)===o&&kN(n)===u,w=MN(n,!1);const b=()=>{w=!0,n.destroyed&&(m=!1),!(m&&(!n.readable||o))&&(!o||g)&&t.call(n)};let g=CN(n,!1);const S=()=>{g=!0,n.destroyed&&(m=!1),!(m&&(!n.writable||u))&&(!u||w)&&t.call(n)},A=V=>{t.call(n,V)};let k=Mie(n);const R=()=>{k=!0;const V=TN(n)||EN(n);if(V&&typeof V!="boolean")return t.call(n,V);if(o&&!g&&g8(n,!0)&&!CN(n,!1))return t.call(n,new xN);if(u&&!w&&!MN(n,!1))return t.call(n,new xN);t.call(n)},N=()=>{k=!0;const V=TN(n)||EN(n);if(V&&typeof V!="boolean")return t.call(n,V);t.call(n)},P=()=>{n.req.on("finish",b)};Pie(n)?(n.on("complete",b),m||n.on("abort",R),n.req?P():n.on("request",P)):u&&!c&&(n.on("end",h),n.on("close",h)),!m&&typeof n.aborted=="boolean"&&n.on("aborted",R),n.on("end",S),n.on("finish",b),e.error!==!1&&n.on("error",A),n.on("close",R),k?_d.nextTick(R):c!=null&&c.errorEmitted||p!=null&&p.errorEmitted?m||_d.nextTick(N):(!o&&(!m||SN(n))&&(w||AN(n)===!1)||!u&&(!m||AN(n))&&(g||SN(n)===!1)||p&&n.req&&n.aborted)&&_d.nextTick(N);const q=()=>{t=T4,n.removeListener("aborted",R),n.removeListener("complete",b),n.removeListener("abort",R),n.removeListener("request",P),n.req&&n.req.removeListener("finish",b),n.removeListener("end",h),n.removeListener("close",h),n.removeListener("finish",b),n.removeListener("end",S),n.removeListener("error",A),n.removeListener("close",R)};if(e.signal&&!k){const V=()=>{const de=t;q(),de.call(n,new eB(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)_d.nextTick(V);else{Vy=Vy||xs.addAbortListener;const de=Vy(e.signal,V),oe=t;t=M4((...he)=>{de[tB](),oe.apply(n,he)})}}return q}function Iie(n,e,t){let r=!1,i=T4;if(e.signal)if(i=()=>{r=!0,t.call(n,new eB(void 0,{cause:e.signal.reason}))},e.signal.aborted)_d.nextTick(i);else{Vy=Vy||xs.addAbortListener;const u=Vy(e.signal,i),c=t;t=M4((...p)=>{u[tB](),c.apply(n,p)})}const o=(...u)=>{r||_d.nextTick(()=>t.apply(n,u))};return kie(n[Nie].promise,o,o),T4}function Die(n,e){var t;let r=!1;return e===null&&(e=k4),(t=e)!==null&&t!==void 0&&t.cleanup&&(Eie(e.cleanup,"cleanup"),r=e.cleanup),new Aie((i,o)=>{const u=nB(n,e,c=>{r&&u(),c?o(c):i()})})}$5.exports=nB;$5.exports.finished=Die;var Gd=$5.exports;const Hl=Vd(),{aggregateTwoErrors:Uie,codes:{ERR_MULTIPLE_CALLBACK:Fie},AbortError:Bie}=eo,{Symbol:rB}=ma,{kIsDestroyed:zie,isDestroyed:jie,isFinished:Hie,isServerRequest:$ie}=ef,aB=rB("kDestroy"),R4=rB("kConstruct");function iB(n,e,t){n&&(n.stack,e&&!e.errored&&(e.errored=n),t&&!t.errored&&(t.errored=n))}function qie(n,e){const t=this._readableState,r=this._writableState,i=r||t;return r!=null&&r.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):(iB(n,r,t),r&&(r.destroyed=!0),t&&(t.destroyed=!0),i.constructed?RN(this,n,e):this.once(aB,function(o){RN(this,Uie(o,n),e)}),this)}function RN(n,e,t){let r=!1;function i(o){if(r)return;r=!0;const u=n._readableState,c=n._writableState;iB(o,c,u),c&&(c.closed=!0),u&&(u.closed=!0),typeof t=="function"&&t(o),o?Hl.nextTick(Vie,n,o):Hl.nextTick(sB,n)}try{n._destroy(e||null,i)}catch(o){i(o)}}function Vie(n,e){O4(n,e),sB(n)}function sB(n){const e=n._readableState,t=n._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&n.emit("close")}function O4(n,e){const t=n._readableState,r=n._writableState;r!=null&&r.errorEmitted||t!=null&&t.errorEmitted||(r&&(r.errorEmitted=!0),t&&(t.errorEmitted=!0),n.emit("error",e))}function Gie(){const n=this._readableState,e=this._writableState;n&&(n.constructed=!0,n.closed=!1,n.closeEmitted=!1,n.destroyed=!1,n.errored=null,n.errorEmitted=!1,n.reading=!1,n.ended=n.readable===!1,n.endEmitted=n.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 L4(n,e,t){const r=n._readableState,i=n._writableState;if(i!=null&&i.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||i!=null&&i.autoDestroy?n.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),r&&!r.errored&&(r.errored=e),t?Hl.nextTick(O4,n,e):O4(n,e))}function Wie(n,e){if(typeof n._construct!="function")return;const t=n._readableState,r=n._writableState;t&&(t.constructed=!1),r&&(r.constructed=!1),n.once(R4,e),!(n.listenerCount(R4)>1)&&Hl.nextTick(Kie,n)}function Kie(n){let e=!1;function t(r){if(e){L4(n,r??new Fie);return}e=!0;const i=n._readableState,o=n._writableState,u=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),u.destroyed?n.emit(aB,r):r?L4(n,r,!0):Hl.nextTick(Yie,n)}try{n._construct(r=>{Hl.nextTick(t,r)})}catch(r){Hl.nextTick(t,r)}}function Yie(n){n.emit(R4)}function ON(n){return(n==null?void 0:n.setHeader)&&typeof n.abort=="function"}function oB(n){n.emit("close")}function Jie(n,e){n.emit("error",e),Hl.nextTick(oB,n)}function Qie(n,e){!n||jie(n)||(!e&&!Hie(n)&&(e=new Bie),$ie(n)?(n.socket=null,n.destroy(e)):ON(n)?n.abort():ON(n.req)?n.req.abort():typeof n.destroy=="function"?n.destroy(e):typeof n.close=="function"?n.close():e?Hl.nextTick(Jie,n,e):Hl.nextTick(oB,n),n.destroyed||(n[zie]=!0))}var _m={construct:Wie,destroyer:Qie,destroy:qie,undestroy:Gie,errorOrDestroy:L4};const{ArrayIsArray:Zie,ObjectSetPrototypeOf:uB}=ma,{EventEmitter:V2}=Wb;function G2(n){V2.call(this,n)}uB(G2.prototype,V2.prototype);uB(G2,V2);G2.prototype.pipe=function(n,e){const t=this;function r(m){n.writable&&n.write(m)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",u),t.on("close",c));let o=!1;function u(){o||(o=!0,n.end())}function c(){o||(o=!0,typeof n.destroy=="function"&&n.destroy())}function p(m){h(),V2.listenerCount(this,"error")===0&&this.emit("error",m)}N4(t,"error",p),N4(n,"error",p);function h(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",u),t.removeListener("close",c),t.removeListener("error",p),n.removeListener("error",p),t.removeListener("end",h),t.removeListener("close",h),n.removeListener("close",h)}return t.on("end",h),t.on("close",h),n.on("close",h),n.emit("pipe",t),n};function N4(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Zie(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}var q5={Stream:G2,prependListener:N4},lB={exports:{}};(function(n){const{SymbolDispose:e}=ma,{AbortError:t,codes:r}=eo,{isNodeStream:i,isWebStream:o,kControllerErrorFunction:u}=ef,c=Gd,{ERR_INVALID_ARG_TYPE:p}=r;let h;const m=(w,b)=>{if(typeof w!="object"||!("aborted"in w))throw new p(b,"AbortSignal",w)};n.exports.addAbortSignal=function(b,g){if(m(b,"signal"),!i(g)&&!o(g))throw new p("stream",["ReadableStream","WritableStream","Stream"],g);return n.exports.addAbortSignalNoValidate(b,g)},n.exports.addAbortSignalNoValidate=function(w,b){if(typeof w!="object"||!("aborted"in w))return b;const g=i(b)?()=>{b.destroy(new t(void 0,{cause:w.reason}))}:()=>{b[u](new t(void 0,{cause:w.reason}))};if(w.aborted)g();else{h=h||xs.addAbortListener;const S=h(w,g);c(b,S[e])}return b}})(lB);var W2=lB.exports;const{StringPrototypeSlice:LN,SymbolIterator:Xie,TypedArrayPrototypeSet:gx,Uint8Array:ese}=ma,{Buffer:v8}=qd,{inspect:tse}=xs;var nse=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;const 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 t=this.head,r=""+t.data;for(;(t=t.next)!==null;)r+=e+t.data;return r}concat(e){if(this.length===0)return v8.alloc(0);const t=v8.allocUnsafe(e>>>0);let r=this.head,i=0;for(;r;)gx(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const i=r.slice(0,e);return this.head.data=r.slice(e),i}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Xie](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=LN(o,0,e),this.head=r,r.data=LN(o,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){const t=v8.allocUnsafe(e),r=e;let i=this.head,o=0;do{const u=i.data;if(e>u.length)gx(t,u,r-e),e-=u.length;else{e===u.length?(gx(t,u,r-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(gx(t,new ese(u.buffer,u.byteOffset,e),r-e),this.head=i,i.data=u.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return tse(this,{...t,depth:0,customInspect:!1})}};const{MathFloor:rse,NumberIsInteger:ase}=ma,{validateInteger:ise}=Kb,{ERR_INVALID_ARG_VALUE:sse}=eo.codes;let cB=16*1024,fB=16;function ose(n,e,t){return n.highWaterMark!=null?n.highWaterMark:e?n[t]:null}function dB(n){return n?fB:cB}function use(n,e){ise(e,"value",0),n?fB=e:cB=e}function lse(n,e,t,r){const i=ose(e,r,t);if(i!=null){if(!ase(i)||i<0){const o=r?`options.${t}`:"options.highWaterMark";throw new sse(o,i)}return rse(i)}return dB(n.objectMode)}var K2={getHighWaterMark:lse,getDefaultHighWaterMark:dB,setDefaultHighWaterMark:use},V5={},G5=uU.Buffer,NN=G5.isEncoding||function(n){switch(n=""+n,n&&n.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 cse(n){if(!n)return"utf8";for(var e;;)switch(n){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 n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}function fse(n){var e=cse(n);if(typeof e!="string"&&(G5.isEncoding===NN||!NN(n)))throw new Error("Unknown encoding: "+n);return e||n}V5.StringDecoder=Yb;function Yb(n){this.encoding=fse(n);var e;switch(this.encoding){case"utf16le":this.text=gse,this.end=vse,e=4;break;case"utf8":this.fillLast=hse,e=4;break;case"base64":this.text=bse,this.end=wse,e=3;break;default:this.write=_se,this.end=xse;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=G5.allocUnsafe(e)}Yb.prototype.write=function(n){if(n.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(n),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<n.length?e?e+this.text(n,t):this.text(n,t):e||""};Yb.prototype.end=mse;Yb.prototype.text=yse;Yb.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function b8(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function dse(n,e,t){var r=e.length-1;if(r<t)return 0;var i=b8(e[r]);return i>=0?(i>0&&(n.lastNeed=i-1),i):--r<t||i===-2?0:(i=b8(e[r]),i>=0?(i>0&&(n.lastNeed=i-2),i):--r<t||i===-2?0:(i=b8(e[r]),i>=0?(i>0&&(i===2?i=0:n.lastNeed=i-3),i):0))}function pse(n,e,t){if((e[0]&192)!==128)return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return n.lastNeed=2,"�"}}function hse(n){var e=this.lastTotal-this.lastNeed,t=pse(this,n);if(t!==void 0)return t;if(this.lastNeed<=n.length)return n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,e,0,n.length),this.lastNeed-=n.length}function yse(n,e){var t=dse(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)}function mse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+"�":e}function gse(n,e){if((n.length-e)%2===0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function vse(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function bse(n,e){var t=(n.length-e)%3;return t===0?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function wse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _se(n){return n.toString(this.encoding)}function xse(n){return n&&n.length?this.write(n):""}const PN=Vd(),{PromisePrototypeThen:Sse,SymbolAsyncIterator:IN,SymbolIterator:DN}=ma,{Buffer:Cse}=qd,{ERR_INVALID_ARG_TYPE:Ese,ERR_STREAM_NULL_VALUES:Ase}=eo.codes;function kse(n,e,t){let r;if(typeof e=="string"||e instanceof Cse)return new n({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let i;if(e&&e[IN])i=!0,r=e[IN]();else if(e&&e[DN])i=!1,r=e[DN]();else throw new Ese("iterable",["Iterable"],e);const o=new n({objectMode:!0,highWaterMark:1,...t});let u=!1;o._read=function(){u||(u=!0,p())},o._destroy=function(h,m){Sse(c(h),()=>PN.nextTick(m,h),w=>PN.nextTick(m,w||h))};async function c(h){const m=h!=null,w=typeof r.throw=="function";if(m&&w){const{value:b,done:g}=await r.throw(h);if(await b,g)return}if(typeof r.return=="function"){const{value:b}=await r.return();await b}}async function p(){for(;;){try{const{value:h,done:m}=i?await r.next():r.next();if(m)o.push(null);else{const w=h&&typeof h.then=="function"?await h:h;if(w===null)throw u=!1,new Ase;if(o.push(w))continue;u=!1}}catch(h){o.destroy(h)}break}}return o}var pB=kse,w8,UN;function Y2(){if(UN)return w8;UN=1;const n=Vd(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:p,SafeSet:h,SymbolAsyncDispose:m,SymbolAsyncIterator:w,Symbol:b}=ma;w8=Ne,Ne.ReadableState=Ee;const{EventEmitter:g}=Wb,{Stream:S,prependListener:A}=q5,{Buffer:k}=qd,{addAbortSignal:R}=W2,N=Gd;let P=xs.debuglog("stream",ve=>{P=ve});const q=nse,V=_m,{getHighWaterMark:de,getDefaultHighWaterMark:oe}=K2,{aggregateTwoErrors:he,codes:{ERR_INVALID_ARG_TYPE:Se,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:Le,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:x}=eo,{validateObject:O}=Kb,z=b("kPaused"),{StringDecoder:F}=V5,H=pB;c(Ne.prototype,S.prototype),c(Ne,S);const Q=()=>{},{errorOrDestroy:ae}=V,L=1,T=2,Y=4,ee=8,j=16,be=32,Ie=64,Me=128,De=256,se=512,fe=1024,pe=2048,le=4096,re=8192,me=16384,J=32768,I=65536,U=1<<17,te=1<<18;function ue(ve){return{enumerable:!1,get(){return(this.state&ve)!==0},set(xe){xe?this.state|=ve:this.state&=~ve}}}o(Ee.prototype,{objectMode:ue(L),ended:ue(T),endEmitted:ue(Y),reading:ue(ee),constructed:ue(j),sync:ue(be),needReadable:ue(Ie),emittedReadable:ue(Me),readableListening:ue(De),resumeScheduled:ue(se),errorEmitted:ue(fe),emitClose:ue(pe),autoDestroy:ue(le),destroyed:ue(re),closed:ue(me),closeEmitted:ue(J),multiAwaitDrain:ue(I),readingMore:ue(U),dataEmitted:ue(te)});function Ee(ve,xe,ct){typeof ct!="boolean"&&(ct=xe instanceof Yc()),this.state=pe|le|j|be,ve&&ve.objectMode&&(this.state|=L),ct&&ve&&ve.readableObjectMode&&(this.state|=L),this.highWaterMark=ve?de(this,ve,"readableHighWaterMark",ct):oe(!1),this.buffer=new q,this.length=0,this.pipes=[],this.flowing=null,this[z]=null,ve&&ve.emitClose===!1&&(this.state&=~pe),ve&&ve.autoDestroy===!1&&(this.state&=~le),this.errored=null,this.defaultEncoding=ve&&ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ve&&ve.encoding&&(this.decoder=new F(ve.encoding),this.encoding=ve.encoding)}function Ne(ve){if(!(this instanceof Ne))return new Ne(ve);const xe=this instanceof Yc();this._readableState=new Ee(ve,this,xe),ve&&(typeof ve.read=="function"&&(this._read=ve.read),typeof ve.destroy=="function"&&(this._destroy=ve.destroy),typeof ve.construct=="function"&&(this._construct=ve.construct),ve.signal&&!xe&&R(ve.signal,this)),S.call(this,ve),V.construct(this,()=>{this._readableState.needReadable&&_e(this,this._readableState)})}Ne.prototype.destroy=V.destroy,Ne.prototype._undestroy=V.undestroy,Ne.prototype._destroy=function(ve,xe){xe(ve)},Ne.prototype[g.captureRejectionSymbol]=function(ve){this.destroy(ve)},Ne.prototype[m]=function(){let ve;return this.destroyed||(ve=this.readableEnded?null:new x,this.destroy(ve)),new p((xe,ct)=>N(this,at=>at&&at!==ve?ct(at):xe(null)))},Ne.prototype.push=function(ve,xe){return Qe(this,ve,xe,!1)},Ne.prototype.unshift=function(ve,xe){return Qe(this,ve,xe,!0)};function Qe(ve,xe,ct,at){P("readableAddChunk",xe);const ft=ve._readableState;let Dn;if(ft.state&L||(typeof xe=="string"?(ct=ct||ft.defaultEncoding,ft.encoding!==ct&&(at&&ft.encoding?xe=k.from(xe,ct).toString(ft.encoding):(xe=k.from(xe,ct),ct=""))):xe instanceof k?ct="":S._isUint8Array(xe)?(xe=S._uint8ArrayToBuffer(xe),ct=""):xe!=null&&(Dn=new Se("chunk",["string","Buffer","Uint8Array"],xe))),Dn)ae(ve,Dn);else if(xe===null)ft.state&=~ee,$(ve,ft);else if(ft.state&L||xe&&xe.length>0)if(at)if(ft.state&Y)ae(ve,new C);else{if(ft.destroyed||ft.errored)return!1;st(ve,ft,xe,!0)}else if(ft.ended)ae(ve,new Le);else{if(ft.destroyed||ft.errored)return!1;ft.state&=~ee,ft.decoder&&!ct?(xe=ft.decoder.write(xe),ft.objectMode||xe.length!==0?st(ve,ft,xe,!1):_e(ve,ft)):st(ve,ft,xe,!1)}else at||(ft.state&=~ee,_e(ve,ft));return!ft.ended&&(ft.length<ft.highWaterMark||ft.length===0)}function st(ve,xe,ct,at){xe.flowing&&xe.length===0&&!xe.sync&&ve.listenerCount("data")>0?(xe.state&I?xe.awaitDrainWriters.clear():xe.awaitDrainWriters=null,xe.dataEmitted=!0,ve.emit("data",ct)):(xe.length+=xe.objectMode?1:ct.length,at?xe.buffer.unshift(ct):xe.buffer.push(ct),xe.state&Ie&&W(ve)),_e(ve,xe)}Ne.prototype.isPaused=function(){const ve=this._readableState;return ve[z]===!0||ve.flowing===!1},Ne.prototype.setEncoding=function(ve){const xe=new F(ve);this._readableState.decoder=xe,this._readableState.encoding=this._readableState.decoder.encoding;const ct=this._readableState.buffer;let at="";for(const ft of ct)at+=xe.write(ft);return ct.clear(),at!==""&&ct.push(at),this._readableState.length=at.length,this};const _t=1073741824;function Et(ve){if(ve>_t)throw new ne("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++,ve}function Z(ve,xe){return ve<=0||xe.length===0&&xe.ended?0:xe.state&L?1:r(ve)?xe.flowing&&xe.length?xe.buffer.first().length:xe.length:ve<=xe.length?ve:xe.ended?xe.length:0}Ne.prototype.read=function(ve){P("read",ve),ve===void 0?ve=NaN:t(ve)||(ve=i(ve,10));const xe=this._readableState,ct=ve;if(ve>xe.highWaterMark&&(xe.highWaterMark=Et(ve)),ve!==0&&(xe.state&=~Me),ve===0&&xe.needReadable&&((xe.highWaterMark!==0?xe.length>=xe.highWaterMark:xe.length>0)||xe.ended))return P("read: emitReadable",xe.length,xe.ended),xe.length===0&&xe.ended?Wt(this):W(this),null;if(ve=Z(ve,xe),ve===0&&xe.ended)return xe.length===0&&Wt(this),null;let at=(xe.state&Ie)!==0;if(P("need readable",at),(xe.length===0||xe.length-ve<xe.highWaterMark)&&(at=!0,P("length less than watermark",at)),xe.ended||xe.reading||xe.destroyed||xe.errored||!xe.constructed)at=!1,P("reading, ended or constructing",at);else if(at){P("do read"),xe.state|=ee|be,xe.length===0&&(xe.state|=Ie);try{this._read(xe.highWaterMark)}catch(Dn){ae(this,Dn)}xe.state&=~be,xe.reading||(ve=Z(ct,xe))}let ft;return ve>0?ft=Zt(ve,xe):ft=null,ft===null?(xe.needReadable=xe.length<=xe.highWaterMark,ve=0):(xe.length-=ve,xe.multiAwaitDrain?xe.awaitDrainWriters.clear():xe.awaitDrainWriters=null),xe.length===0&&(xe.ended||(xe.needReadable=!0),ct!==ve&&xe.ended&&Wt(this)),ft!==null&&!xe.errorEmitted&&!xe.closeEmitted&&(xe.dataEmitted=!0,this.emit("data",ft)),ft};function $(ve,xe){if(P("onEofChunk"),!xe.ended){if(xe.decoder){const ct=xe.decoder.end();ct&&ct.length&&(xe.buffer.push(ct),xe.length+=xe.objectMode?1:ct.length)}xe.ended=!0,xe.sync?W(ve):(xe.needReadable=!1,xe.emittedReadable=!0,ge(ve))}}function W(ve){const xe=ve._readableState;P("emitReadable",xe.needReadable,xe.emittedReadable),xe.needReadable=!1,xe.emittedReadable||(P("emitReadable",xe.flowing),xe.emittedReadable=!0,n.nextTick(ge,ve))}function ge(ve){const xe=ve._readableState;P("emitReadable_",xe.destroyed,xe.length,xe.ended),!xe.destroyed&&!xe.errored&&(xe.length||xe.ended)&&(ve.emit("readable"),xe.emittedReadable=!1),xe.needReadable=!xe.flowing&&!xe.ended&&xe.length<=xe.highWaterMark,Ot(ve)}function _e(ve,xe){!xe.readingMore&&xe.constructed&&(xe.readingMore=!0,n.nextTick(Re,ve,xe))}function Re(ve,xe){for(;!xe.reading&&!xe.ended&&(xe.length<xe.highWaterMark||xe.flowing&&xe.length===0);){const ct=xe.length;if(P("maybeReadMore read 0"),ve.read(0),ct===xe.length)break}xe.readingMore=!1}Ne.prototype._read=function(ve){throw new Ce("_read()")},Ne.prototype.pipe=function(ve,xe){const ct=this,at=this._readableState;at.pipes.length===1&&(at.multiAwaitDrain||(at.multiAwaitDrain=!0,at.awaitDrainWriters=new h(at.awaitDrainWriters?[at.awaitDrainWriters]:[]))),at.pipes.push(ve),P("pipe count=%d opts=%j",at.pipes.length,xe);const Dn=(!xe||xe.end!==!1)&&ve!==n.stdout&&ve!==n.stderr?Sn:zt;at.endEmitted?n.nextTick(Dn):ct.once("end",Dn),ve.on("unpipe",hn);function hn(Ut,Kt){P("onunpipe"),Ut===ct&&Kt&&Kt.hasUnpiped===!1&&(Kt.hasUnpiped=!0,Un())}function Sn(){P("onend"),ve.end()}let fr,On=!1;function Un(){P("cleanup"),ve.removeListener("close",Nt),ve.removeListener("finish",Bt),fr&&ve.removeListener("drain",fr),ve.removeListener("error",rt),ve.removeListener("unpipe",hn),ct.removeListener("end",Sn),ct.removeListener("end",zt),ct.removeListener("data",et),On=!0,fr&&at.awaitDrainWriters&&(!ve._writableState||ve._writableState.needDrain)&&fr()}function Te(){On||(at.pipes.length===1&&at.pipes[0]===ve?(P("false write response, pause",0),at.awaitDrainWriters=ve,at.multiAwaitDrain=!1):at.pipes.length>1&&at.pipes.includes(ve)&&(P("false write response, pause",at.awaitDrainWriters.size),at.awaitDrainWriters.add(ve)),ct.pause()),fr||(fr=Be(ct,ve),ve.on("drain",fr))}ct.on("data",et);function et(Ut){P("ondata");const Kt=ve.write(Ut);P("dest.write",Kt),Kt===!1&&Te()}function rt(Ut){if(P("onerror",Ut),zt(),ve.removeListener("error",rt),ve.listenerCount("error")===0){const Kt=ve._writableState||ve._readableState;Kt&&!Kt.errorEmitted?ae(ve,Ut):ve.emit("error",Ut)}}A(ve,"error",rt);function Nt(){ve.removeListener("finish",Bt),zt()}ve.once("close",Nt);function Bt(){P("onfinish"),ve.removeListener("close",Nt),zt()}ve.once("finish",Bt);function zt(){P("unpipe"),ct.unpipe(ve)}return ve.emit("pipe",ct),ve.writableNeedDrain===!0?Te():at.flowing||(P("pipe resume"),ct.resume()),ve};function Be(ve,xe){return function(){const at=ve._readableState;at.awaitDrainWriters===xe?(P("pipeOnDrain",1),at.awaitDrainWriters=null):at.multiAwaitDrain&&(P("pipeOnDrain",at.awaitDrainWriters.size),at.awaitDrainWriters.delete(xe)),(!at.awaitDrainWriters||at.awaitDrainWriters.size===0)&&ve.listenerCount("data")&&ve.resume()}}Ne.prototype.unpipe=function(ve){const xe=this._readableState,ct={hasUnpiped:!1};if(xe.pipes.length===0)return this;if(!ve){const ft=xe.pipes;xe.pipes=[],this.pause();for(let Dn=0;Dn<ft.length;Dn++)ft[Dn].emit("unpipe",this,{hasUnpiped:!1});return this}const at=e(xe.pipes,ve);return at===-1?this:(xe.pipes.splice(at,1),xe.pipes.length===0&&this.pause(),ve.emit("unpipe",this,ct),this)},Ne.prototype.on=function(ve,xe){const ct=S.prototype.on.call(this,ve,xe),at=this._readableState;return ve==="data"?(at.readableListening=this.listenerCount("readable")>0,at.flowing!==!1&&this.resume()):ve==="readable"&&!at.endEmitted&&!at.readableListening&&(at.readableListening=at.needReadable=!0,at.flowing=!1,at.emittedReadable=!1,P("on readable",at.length,at.reading),at.length?W(this):at.reading||n.nextTick(yt,this)),ct},Ne.prototype.addListener=Ne.prototype.on,Ne.prototype.removeListener=function(ve,xe){const ct=S.prototype.removeListener.call(this,ve,xe);return ve==="readable"&&n.nextTick(wt,this),ct},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(ve){const xe=S.prototype.removeAllListeners.apply(this,arguments);return(ve==="readable"||ve===void 0)&&n.nextTick(wt,this),xe};function wt(ve){const xe=ve._readableState;xe.readableListening=ve.listenerCount("readable")>0,xe.resumeScheduled&&xe[z]===!1?xe.flowing=!0:ve.listenerCount("data")>0?ve.resume():xe.readableListening||(xe.flowing=null)}function yt(ve){P("readable nexttick read 0"),ve.read(0)}Ne.prototype.resume=function(){const ve=this._readableState;return ve.flowing||(P("resume"),ve.flowing=!ve.readableListening,gt(this,ve)),ve[z]=!1,this};function gt(ve,xe){xe.resumeScheduled||(xe.resumeScheduled=!0,n.nextTick(At,ve,xe))}function At(ve,xe){P("resume",xe.reading),xe.reading||ve.read(0),xe.resumeScheduled=!1,ve.emit("resume"),Ot(ve),xe.flowing&&!xe.reading&&ve.read(0)}Ne.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[z]=!0,this};function Ot(ve){const xe=ve._readableState;for(P("flow",xe.flowing);xe.flowing&&ve.read()!==null;);}Ne.prototype.wrap=function(ve){let xe=!1;ve.on("data",at=>{!this.push(at)&&ve.pause&&(xe=!0,ve.pause())}),ve.on("end",()=>{this.push(null)}),ve.on("error",at=>{ae(this,at)}),ve.on("close",()=>{this.destroy()}),ve.on("destroy",()=>{this.destroy()}),this._read=()=>{xe&&ve.resume&&(xe=!1,ve.resume())};const ct=u(ve);for(let at=1;at<ct.length;at++){const ft=ct[at];this[ft]===void 0&&typeof ve[ft]=="function"&&(this[ft]=ve[ft].bind(ve))}return this},Ne.prototype[w]=function(){return nn(this)},Ne.prototype.iterator=function(ve){return ve!==void 0&&O(ve,"options"),nn(this,ve)};function nn(ve,xe){typeof ve.read!="function"&&(ve=Ne.wrap(ve,{objectMode:!0}));const ct=Mr(ve,xe);return ct.stream=ve,ct}async function*Mr(ve,xe){let ct=Q;function at(hn){this===ve?(ct(),ct=Q):ct=hn}ve.on("readable",at);let ft;const Dn=N(ve,{writable:!1},hn=>{ft=hn?he(ft,hn):null,ct(),ct=Q});try{for(;;){const hn=ve.destroyed?null:ve.read();if(hn!==null)yield hn;else{if(ft)throw ft;if(ft===null)return;await new p(at)}}}catch(hn){throw ft=he(ft,hn),ft}finally{(ft||(xe==null?void 0:xe.destroyOnReturn)!==!1)&&(ft===void 0||ve._readableState.autoDestroy)?V.destroyer(ve,null):(ve.off("readable",at),Dn())}}o(Ne.prototype,{readable:{__proto__:null,get(){const ve=this._readableState;return!!ve&&ve.readable!==!1&&!ve.destroyed&&!ve.errorEmitted&&!ve.endEmitted},set(ve){this._readableState&&(this._readableState.readable=!!ve)}},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(ve){this._readableState&&(this._readableState.flowing=ve)}},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(ve){this._readableState&&(this._readableState.destroyed=ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[z]!==!1},set(ve){this[z]=!!ve}}}),Ne._fromList=Zt;function Zt(ve,xe){if(xe.length===0)return null;let ct;return xe.objectMode?ct=xe.buffer.shift():!ve||ve>=xe.length?(xe.decoder?ct=xe.buffer.join(""):xe.buffer.length===1?ct=xe.buffer.first():ct=xe.buffer.concat(xe.length),xe.buffer.clear()):ct=xe.buffer.consume(ve,xe.decoder),ct}function Wt(ve){const xe=ve._readableState;P("endReadable",xe.endEmitted),xe.endEmitted||(xe.ended=!0,n.nextTick(Xr,xe,ve))}function Xr(ve,xe){if(P("endReadableNT",ve.endEmitted,ve.length),!ve.errored&&!ve.closeEmitted&&!ve.endEmitted&&ve.length===0){if(ve.endEmitted=!0,xe.emit("end"),xe.writable&&xe.allowHalfOpen===!1)n.nextTick(Mn,xe);else if(ve.autoDestroy){const ct=xe._writableState;(!ct||ct.autoDestroy&&(ct.finished||ct.writable===!1))&&xe.destroy()}}}function Mn(ve){ve.writable&&!ve.writableEnded&&!ve.destroyed&&ve.end()}Ne.from=function(ve,xe){return H(Ne,ve,xe)};let In;function Ma(){return In===void 0&&(In={}),In}return Ne.fromWeb=function(ve,xe){return Ma().newStreamReadableFromReadableStream(ve,xe)},Ne.toWeb=function(ve,xe){return Ma().newReadableStreamFromStreamReadable(ve,xe)},Ne.wrap=function(ve,xe){var ct,at;return new Ne({objectMode:(ct=(at=ve.readableObjectMode)!==null&&at!==void 0?at:ve.objectMode)!==null&&ct!==void 0?ct:!0,...xe,destroy(ft,Dn){V.destroyer(ve,ft),Dn(ft)}}).wrap(ve)},w8}var _8,FN;function W5(){if(FN)return _8;FN=1;const n=Vd(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:h}=ma;_8=O,O.WritableState=C;const{EventEmitter:m}=Wb,w=q5.Stream,{Buffer:b}=qd,g=_m,{addAbortSignal:S}=W2,{getHighWaterMark:A,getDefaultHighWaterMark:k}=K2,{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:N,ERR_MULTIPLE_CALLBACK:P,ERR_STREAM_CANNOT_PIPE:q,ERR_STREAM_DESTROYED:V,ERR_STREAM_ALREADY_FINISHED:de,ERR_STREAM_NULL_VALUES:oe,ERR_STREAM_WRITE_AFTER_END:he,ERR_UNKNOWN_ENCODING:Se}=eo.codes,{errorOrDestroy:Ce}=g;u(O.prototype,w.prototype),u(O,w);function ne(){}const Le=p("kOnFinished");function C(le,re,me){typeof me!="boolean"&&(me=re instanceof Yc()),this.objectMode=!!(le&&le.objectMode),me&&(this.objectMode=this.objectMode||!!(le&&le.writableObjectMode)),this.highWaterMark=le?A(this,le,"writableHighWaterMark",me):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const J=!!(le&&le.decodeStrings===!1);this.decodeStrings=!J,this.defaultEncoding=le&&le.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ae.bind(void 0,re),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,x(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!le||le.emitClose!==!1,this.autoDestroy=!le||le.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Le]=[]}function x(le){le.buffered=[],le.bufferedIndex=0,le.allBuffers=!0,le.allNoop=!0}C.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(C.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(le){const re=this instanceof Yc();if(!re&&!r(O,this))return new O(le);this._writableState=new C(le,this,re),le&&(typeof le.write=="function"&&(this._write=le.write),typeof le.writev=="function"&&(this._writev=le.writev),typeof le.destroy=="function"&&(this._destroy=le.destroy),typeof le.final=="function"&&(this._final=le.final),typeof le.construct=="function"&&(this._construct=le.construct),le.signal&&S(le.signal,this)),w.call(this,le),g.construct(this,()=>{const me=this._writableState;me.writing||ee(this,me),Me(this,me)})}i(O,h,{__proto__:null,value:function(le){return r(this,le)?!0:this!==O?!1:le&&le._writableState instanceof C}}),O.prototype.pipe=function(){Ce(this,new q)};function z(le,re,me,J){const I=le._writableState;if(typeof me=="function")J=me,me=I.defaultEncoding;else{if(!me)me=I.defaultEncoding;else if(me!=="buffer"&&!b.isEncoding(me))throw new Se(me);typeof J!="function"&&(J=ne)}if(re===null)throw new oe;if(!I.objectMode)if(typeof re=="string")I.decodeStrings!==!1&&(re=b.from(re,me),me="buffer");else if(re instanceof b)me="buffer";else if(w._isUint8Array(re))re=w._uint8ArrayToBuffer(re),me="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],re);let U;return I.ending?U=new he:I.destroyed&&(U=new V("write")),U?(n.nextTick(J,U),Ce(le,U,!0),U):(I.pendingcb++,F(le,I,re,me,J))}O.prototype.write=function(le,re,me){return z(this,le,re,me)===!0},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){const le=this._writableState;le.corked&&(le.corked--,le.writing||ee(this,le))},O.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=c(re)),!b.isEncoding(re))throw new Se(re);return this._writableState.defaultEncoding=re,this};function F(le,re,me,J,I){const U=re.objectMode?1:me.length;re.length+=U;const te=re.length<re.highWaterMark;return te||(re.needDrain=!0),re.writing||re.corked||re.errored||!re.constructed?(re.buffered.push({chunk:me,encoding:J,callback:I}),re.allBuffers&&J!=="buffer"&&(re.allBuffers=!1),re.allNoop&&I!==ne&&(re.allNoop=!1)):(re.writelen=U,re.writecb=I,re.writing=!0,re.sync=!0,le._write(me,J,re.onwrite),re.sync=!1),te&&!re.errored&&!re.destroyed}function H(le,re,me,J,I,U,te){re.writelen=J,re.writecb=te,re.writing=!0,re.sync=!0,re.destroyed?re.onwrite(new V("write")):me?le._writev(I,re.onwrite):le._write(I,U,re.onwrite),re.sync=!1}function Q(le,re,me,J){--re.pendingcb,J(me),Y(re),Ce(le,me)}function ae(le,re){const me=le._writableState,J=me.sync,I=me.writecb;if(typeof I!="function"){Ce(le,new P);return}me.writing=!1,me.writecb=null,me.length-=me.writelen,me.writelen=0,re?(re.stack,me.errored||(me.errored=re),le._readableState&&!le._readableState.errored&&(le._readableState.errored=re),J?n.nextTick(Q,le,me,re,I):Q(le,me,re,I)):(me.buffered.length>me.bufferedIndex&&ee(le,me),J?me.afterWriteTickInfo!==null&&me.afterWriteTickInfo.cb===I?me.afterWriteTickInfo.count++:(me.afterWriteTickInfo={count:1,cb:I,stream:le,state:me},n.nextTick(L,me.afterWriteTickInfo)):T(le,me,1,I))}function L({stream:le,state:re,count:me,cb:J}){return re.afterWriteTickInfo=null,T(le,re,me,J)}function T(le,re,me,J){for(!re.ending&&!le.destroyed&&re.length===0&&re.needDrain&&(re.needDrain=!1,le.emit("drain"));me-- >0;)re.pendingcb--,J();re.destroyed&&Y(re),Me(le,re)}function Y(le){if(le.writing)return;for(let I=le.bufferedIndex;I<le.buffered.length;++I){var re;const{chunk:U,callback:te}=le.buffered[I],ue=le.objectMode?1:U.length;le.length-=ue,te((re=le.errored)!==null&&re!==void 0?re:new V("write"))}const me=le[Le].splice(0);for(let I=0;I<me.length;I++){var J;me[I]((J=le.errored)!==null&&J!==void 0?J:new V("end"))}x(le)}function ee(le,re){if(re.corked||re.bufferProcessing||re.destroyed||!re.constructed)return;const{buffered:me,bufferedIndex:J,objectMode:I}=re,U=me.length-J;if(!U)return;let te=J;if(re.bufferProcessing=!0,U>1&&le._writev){re.pendingcb-=U-1;const ue=re.allNoop?ne:Ne=>{for(let Qe=te;Qe<me.length;++Qe)me[Qe].callback(Ne)},Ee=re.allNoop&&te===0?me:e(me,te);Ee.allBuffers=re.allBuffers,H(le,re,!0,re.length,Ee,"",ue),x(re)}else{do{const{chunk:ue,encoding:Ee,callback:Ne}=me[te];me[te++]=null;const Qe=I?1:ue.length;H(le,re,!1,Qe,ue,Ee,Ne)}while(te<me.length&&!re.writing);te===me.length?x(re):te>256?(me.splice(0,te),re.bufferedIndex=0):re.bufferedIndex=te}re.bufferProcessing=!1}O.prototype._write=function(le,re,me){if(this._writev)this._writev([{chunk:le,encoding:re}],me);else throw new N("_write()")},O.prototype._writev=null,O.prototype.end=function(le,re,me){const J=this._writableState;typeof le=="function"?(me=le,le=null,re=null):typeof re=="function"&&(me=re,re=null);let I;if(le!=null){const U=z(this,le,re);U instanceof t&&(I=U)}return J.corked&&(J.corked=1,this.uncork()),I||(!J.errored&&!J.ending?(J.ending=!0,Me(this,J,!0),J.ended=!0):J.finished?I=new de("end"):J.destroyed&&(I=new V("end"))),typeof me=="function"&&(I||J.finished?n.nextTick(me,I):J[Le].push(me)),this};function j(le){return le.ending&&!le.destroyed&&le.constructed&&le.length===0&&!le.errored&&le.buffered.length===0&&!le.finished&&!le.writing&&!le.errorEmitted&&!le.closeEmitted}function be(le,re){let me=!1;function J(I){if(me){Ce(le,I??P());return}if(me=!0,re.pendingcb--,I){const U=re[Le].splice(0);for(let te=0;te<U.length;te++)U[te](I);Ce(le,I,re.sync)}else j(re)&&(re.prefinished=!0,le.emit("prefinish"),re.pendingcb++,n.nextTick(De,le,re))}re.sync=!0,re.pendingcb++;try{le._final(J)}catch(I){J(I)}re.sync=!1}function Ie(le,re){!re.prefinished&&!re.finalCalled&&(typeof le._final=="function"&&!re.destroyed?(re.finalCalled=!0,be(le,re)):(re.prefinished=!0,le.emit("prefinish")))}function Me(le,re,me){j(re)&&(Ie(le,re),re.pendingcb===0&&(me?(re.pendingcb++,n.nextTick((J,I)=>{j(I)?De(J,I):I.pendingcb--},le,re)):j(re)&&(re.pendingcb++,De(le,re))))}function De(le,re){re.pendingcb--,re.finished=!0;const me=re[Le].splice(0);for(let J=0;J<me.length;J++)me[J]();if(le.emit("finish"),re.autoDestroy){const J=le._readableState;(!J||J.autoDestroy&&(J.endEmitted||J.readable===!1))&&le.destroy()}}o(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(le){this._writableState&&(this._writableState.destroyed=le)}},writable:{__proto__:null,get(){const le=this._writableState;return!!le&&le.writable!==!1&&!le.destroyed&&!le.errored&&!le.ending&&!le.ended},set(le){this._writableState&&(this._writableState.writable=!!le)}},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(){const le=this._writableState;return le?!le.destroyed&&!le.ending&&le.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)}}});const se=g.destroy;O.prototype.destroy=function(le,re){const me=this._writableState;return!me.destroyed&&(me.bufferedIndex<me.buffered.length||me[Le].length)&&n.nextTick(Y,me),se.call(this,le,re),this},O.prototype._undestroy=g.undestroy,O.prototype._destroy=function(le,re){re(le)},O.prototype[m.captureRejectionSymbol]=function(le){this.destroy(le)};let fe;function pe(){return fe===void 0&&(fe={}),fe}return O.fromWeb=function(le,re){return pe().newStreamWritableFromWritableStream(le,re)},O.toWeb=function(le){return pe().newWritableStreamFromStreamWritable(le)},_8}var x8,BN;function Mse(){if(BN)return x8;BN=1;const n=Vd(),e=qd,{isReadable:t,isWritable:r,isIterable:i,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:h,isWritableStream:m}=ef,w=Gd,{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:S}}=eo,{destroyer:A}=_m,k=Yc(),R=Y2(),N=W5(),{createDeferredPromise:P}=xs,q=pB,V=globalThis.Blob||e.Blob,de=typeof V<"u"?function(C){return C instanceof V}:function(C){return!1},oe=globalThis.AbortController||Rb().AbortController,{FunctionPrototypeCall:he}=ma;class Se extends k{constructor(C){super(C),(C==null?void 0:C.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(C==null?void 0:C.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}x8=function Le(C,x){if(p(C))return C;if(u(C))return ne({readable:C});if(c(C))return ne({writable:C});if(o(C))return ne({writable:!1,readable:!1});if(h(C))return ne({readable:R.fromWeb(C)});if(m(C))return ne({writable:N.fromWeb(C)});if(typeof C=="function"){const{value:z,write:F,final:H,destroy:Q}=Ce(C);if(i(z))return q(Se,z,{objectMode:!0,write:F,final:H,destroy:Q});const ae=z==null?void 0:z.then;if(typeof ae=="function"){let L;const T=he(ae,z,Y=>{if(Y!=null)throw new S("nully","body",Y)},Y=>{A(L,Y)});return L=new Se({objectMode:!0,readable:!1,write:F,final(Y){H(async()=>{try{await T,n.nextTick(Y,null)}catch(ee){n.nextTick(Y,ee)}})},destroy:Q})}throw new S("Iterable, AsyncIterable or AsyncFunction",x,z)}if(de(C))return Le(C.arrayBuffer());if(i(C))return q(Se,C,{objectMode:!0,writable:!1});if(h(C==null?void 0:C.readable)&&m(C==null?void 0:C.writable))return Se.fromWeb(C);if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){const z=C!=null&&C.readable?u(C==null?void 0:C.readable)?C==null?void 0:C.readable:Le(C.readable):void 0,F=C!=null&&C.writable?c(C==null?void 0:C.writable)?C==null?void 0:C.writable:Le(C.writable):void 0;return ne({readable:z,writable:F})}const O=C==null?void 0:C.then;if(typeof O=="function"){let z;return he(O,C,F=>{F!=null&&z.push(F),z.push(null)},F=>{A(z,F)}),z=new Se({objectMode:!0,writable:!1,read(){}})}throw new g(x,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function Ce(Le){let{promise:C,resolve:x}=P();const O=new oe,z=O.signal;return{value:Le(async function*(){for(;;){const H=C;C=null;const{chunk:Q,done:ae,cb:L}=await H;if(n.nextTick(L),ae)return;if(z.aborted)throw new b(void 0,{cause:z.reason});({promise:C,resolve:x}=P()),yield Q}}(),{signal:z}),write(H,Q,ae){const L=x;x=null,L({chunk:H,done:!1,cb:ae})},final(H){const Q=x;x=null,Q({done:!0,cb:H})},destroy(H,Q){O.abort(),Q(H)}}}function ne(Le){const C=Le.readable&&typeof Le.readable.read!="function"?R.wrap(Le.readable):Le.readable,x=Le.writable;let O=!!t(C),z=!!r(x),F,H,Q,ae,L;function T(Y){const ee=ae;ae=null,ee?ee(Y):Y&&L.destroy(Y)}return L=new Se({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(x!=null&&x.writableObjectMode),readable:O,writable:z}),z&&(w(x,Y=>{z=!1,Y&&A(C,Y),T(Y)}),L._write=function(Y,ee,j){x.write(Y,ee)?j():F=j},L._final=function(Y){x.end(),H=Y},x.on("drain",function(){if(F){const Y=F;F=null,Y()}}),x.on("finish",function(){if(H){const Y=H;H=null,Y()}})),O&&(w(C,Y=>{O=!1,Y&&A(C,Y),T(Y)}),C.on("readable",function(){if(Q){const Y=Q;Q=null,Y()}}),C.on("end",function(){L.push(null)}),L._read=function(){for(;;){const Y=C.read();if(Y===null){Q=L._read;return}if(!L.push(Y))return}}),L._destroy=function(Y,ee){!Y&&ae!==null&&(Y=new b),Q=null,F=null,H=null,ae===null?ee(Y):(ae=ee,A(x,Y),A(C,Y))},L}return x8}var S8,zN;function Yc(){if(zN)return S8;zN=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ma;S8=u;const i=Y2(),o=W5();r(u.prototype,i.prototype),r(u,i);{const m=t(o.prototype);for(let w=0;w<m.length;w++){const b=m[w];u.prototype[b]||(u.prototype[b]=o.prototype[b])}}function u(m){if(!(this instanceof u))return new u(m);i.call(this,m),o.call(this,m),m?(this.allowHalfOpen=m.allowHalfOpen!==!1,m.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(m){this._readableState&&this._writableState&&(this._readableState.destroyed=m,this._writableState.destroyed=m)}}});let c;function p(){return c===void 0&&(c={}),c}u.fromWeb=function(m,w){return p().newStreamDuplexFromReadableWritablePair(m,w)},u.toWeb=function(m){return p().newReadableWritablePairFromDuplex(m)};let h;return u.from=function(m){return h||(h=Mse()),h(m,"body")},S8}const{ObjectSetPrototypeOf:hB,Symbol:Tse}=ma;var yB=Jc;const{ERR_METHOD_NOT_IMPLEMENTED:Rse}=eo.codes,K5=Yc(),{getHighWaterMark:Ose}=K2;hB(Jc.prototype,K5.prototype);hB(Jc,K5);const hb=Tse("kCallback");function Jc(n){if(!(this instanceof Jc))return new Jc(n);const e=n?Ose(this,n,"readableHighWaterMark",!0):null;e===0&&(n={...n,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:n.writableHighWaterMark||0}),K5.call(this,n),this._readableState.sync=!1,this[hb]=null,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",Lse)}function P4(n){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){n?n(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),n&&n()}):(this.push(null),n&&n())}function Lse(){this._final!==P4&&P4.call(this)}Jc.prototype._final=P4;Jc.prototype._transform=function(n,e,t){throw new Rse("_transform()")};Jc.prototype._write=function(n,e,t){const r=this._readableState,i=this._writableState,o=r.length;this._transform(n,e,(u,c)=>{if(u){t(u);return}c!=null&&this.push(c),i.ended||o===r.length||r.length<r.highWaterMark?t():this[hb]=t})};Jc.prototype._read=function(){if(this[hb]){const n=this[hb];this[hb]=null,n()}};const{ObjectSetPrototypeOf:mB}=ma;var gB=nm;const Y5=yB;mB(nm.prototype,Y5.prototype);mB(nm,Y5);function nm(n){if(!(this instanceof nm))return new nm(n);Y5.call(this,n)}nm.prototype._transform=function(n,e,t){t(null,n)};const tb=Vd(),{ArrayIsArray:Nse,Promise:Pse,SymbolAsyncIterator:Ise,SymbolDispose:Dse}=ma,t2=Gd,{once:Use}=xs,Fse=_m,jN=Yc(),{aggregateTwoErrors:Bse,codes:{ERR_INVALID_ARG_TYPE:I4,ERR_INVALID_RETURN_VALUE:C8,ERR_MISSING_ARGS:zse,ERR_STREAM_DESTROYED:jse,ERR_STREAM_PREMATURE_CLOSE:Hse},AbortError:$se}=eo,{validateFunction:qse,validateAbortSignal:Vse}=Kb,{isIterable:th,isReadable:E8,isReadableNodeStream:Ix,isNodeStream:HN,isTransformStream:Dy,isWebStream:Gse,isReadableStream:A8,isReadableFinished:Wse}=ef,Kse=globalThis.AbortController||Rb().AbortController;let k8,M8,T8;function $N(n,e,t){let r=!1;n.on("close",()=>{r=!0});const i=t2(n,{readable:e,writable:t},o=>{r=!o});return{destroy:o=>{r||(r=!0,Fse.destroyer(n,o||new jse("pipe")))},cleanup:i}}function Yse(n){return qse(n[n.length-1],"streams[stream.length - 1]"),n.pop()}function R8(n){if(th(n))return n;if(Ix(n))return Jse(n);throw new I4("val",["Readable","Iterable","AsyncIterable"],n)}async function*Jse(n){M8||(M8=Y2()),yield*M8.prototype[Ise].call(n)}async function vx(n,e,t,{end:r}){let i,o=null;const u=h=>{if(h&&(i=h),o){const m=o;o=null,m()}},c=()=>new Pse((h,m)=>{i?m(i):o=()=>{i?m(i):h()}});e.on("drain",u);const p=t2(e,{readable:!1},u);try{e.writableNeedDrain&&await c();for await(const h of n)e.write(h)||await c();r&&(e.end(),await c()),t()}catch(h){t(i!==h?Bse(i,h):h)}finally{p(),e.off("drain",u)}}async function O8(n,e,t,{end:r}){Dy(e)&&(e=e.writable);const i=e.getWriter();try{for await(const o of n)await i.ready,i.write(o).catch(()=>{});await i.ready,r&&await i.close(),t()}catch(o){try{await i.abort(o),t(o)}catch(u){t(u)}}}function Qse(...n){return vB(n,Use(Yse(n)))}function vB(n,e,t){if(n.length===1&&Nse(n[0])&&(n=n[0]),n.length<2)throw new zse("streams");const r=new Kse,i=r.signal,o=t==null?void 0:t.signal,u=[];Vse(o,"options.signal");function c(){S(new $se)}T8=T8||xs.addAbortListener;let p;o&&(p=T8(o,c));let h,m;const w=[];let b=0;function g(N){S(N,--b===0)}function S(N,P){var q;if(N&&(!h||h.code==="ERR_STREAM_PREMATURE_CLOSE")&&(h=N),!(!h&&!P)){for(;w.length;)w.shift()(h);(q=p)===null||q===void 0||q[Dse](),r.abort(),P&&(h||u.forEach(V=>V()),tb.nextTick(e,h,m))}}let A;for(let N=0;N<n.length;N++){const P=n[N],q=N<n.length-1,V=N>0,de=q||(t==null?void 0:t.end)!==!1,oe=N===n.length-1;if(HN(P)){let he=function(Se){Se&&Se.name!=="AbortError"&&Se.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(Se)};if(de){const{destroy:Se,cleanup:Ce}=$N(P,q,V);w.push(Se),E8(P)&&oe&&u.push(Ce)}P.on("error",he),E8(P)&&oe&&u.push(()=>{P.removeListener("error",he)})}if(N===0)if(typeof P=="function"){if(A=P({signal:i}),!th(A))throw new C8("Iterable, AsyncIterable or Stream","source",A)}else th(P)||Ix(P)||Dy(P)?A=P:A=jN.from(P);else if(typeof P=="function"){if(Dy(A)){var k;A=R8((k=A)===null||k===void 0?void 0:k.readable)}else A=R8(A);if(A=P(A,{signal:i}),q){if(!th(A,!0))throw new C8("AsyncIterable",`transform[${N-1}]`,A)}else{var R;k8||(k8=gB);const he=new k8({objectMode:!0}),Se=(R=A)===null||R===void 0?void 0:R.then;if(typeof Se=="function")b++,Se.call(A,Le=>{m=Le,Le!=null&&he.write(Le),de&&he.end(),tb.nextTick(g)},Le=>{he.destroy(Le),tb.nextTick(g,Le)});else if(th(A,!0))b++,vx(A,he,g,{end:de});else if(A8(A)||Dy(A)){const Le=A.readable||A;b++,vx(Le,he,g,{end:de})}else throw new C8("AsyncIterable or Promise","destination",A);A=he;const{destroy:Ce,cleanup:ne}=$N(A,!1,!0);w.push(Ce),oe&&u.push(ne)}}else if(HN(P)){if(Ix(A)){b+=2;const he=Zse(A,P,g,{end:de});E8(P)&&oe&&u.push(he)}else if(Dy(A)||A8(A)){const he=A.readable||A;b++,vx(he,P,g,{end:de})}else if(th(A))b++,vx(A,P,g,{end:de});else throw new I4("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=P}else if(Gse(P)){if(Ix(A))b++,O8(R8(A),P,g,{end:de});else if(A8(A)||th(A))b++,O8(A,P,g,{end:de});else if(Dy(A))b++,O8(A.readable,P,g,{end:de});else throw new I4("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=P}else A=jN.from(P)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&tb.nextTick(c),A}function Zse(n,e,t,{end:r}){let i=!1;if(e.on("close",()=>{i||t(new Hse)}),n.pipe(e,{end:!1}),r){let o=function(){i=!0,e.end()};Wse(n)?tb.nextTick(o):n.once("end",o)}else t();return t2(n,{readable:!0,writable:!1},o=>{const u=n._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?n.once("end",t).once("error",t):t(o)}),t2(e,{readable:!1,writable:!0},t)}var J5={pipelineImpl:vB,pipeline:Qse};const{pipeline:Xse}=J5,bx=Yc(),{destroyer:eoe}=_m,{isNodeStream:wx,isReadable:qN,isWritable:VN,isWebStream:L8,isTransformStream:Zp,isWritableStream:GN,isReadableStream:WN}=ef,{AbortError:toe,codes:{ERR_INVALID_ARG_VALUE:KN,ERR_MISSING_ARGS:noe}}=eo,roe=Gd;var bB=function(...e){if(e.length===0)throw new noe("streams");if(e.length===1)return bx.from(e[0]);const t=[...e];if(typeof e[0]=="function"&&(e[0]=bx.from(e[0])),typeof e[e.length-1]=="function"){const g=e.length-1;e[g]=bx.from(e[g])}for(let g=0;g<e.length;++g)if(!(!wx(e[g])&&!L8(e[g]))){if(g<e.length-1&&!(qN(e[g])||WN(e[g])||Zp(e[g])))throw new KN(`streams[${g}]`,t[g],"must be readable");if(g>0&&!(VN(e[g])||GN(e[g])||Zp(e[g])))throw new KN(`streams[${g}]`,t[g],"must be writable")}let r,i,o,u,c;function p(g){const S=u;u=null,S?S(g):g?c.destroy(g):!b&&!w&&c.destroy()}const h=e[0],m=Xse(e,p),w=!!(VN(h)||GN(h)||Zp(h)),b=!!(qN(m)||WN(m)||Zp(m));if(c=new bx({writableObjectMode:!!(h!=null&&h.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:w,readable:b}),w){if(wx(h))c._write=function(S,A,k){h.write(S,A)?k():r=k},c._final=function(S){h.end(),i=S},h.on("drain",function(){if(r){const S=r;r=null,S()}});else if(L8(h)){const A=(Zp(h)?h.writable:h).getWriter();c._write=async function(k,R,N){try{await A.ready,A.write(k).catch(()=>{}),N()}catch(P){N(P)}},c._final=async function(k){try{await A.ready,A.close().catch(()=>{}),i=k}catch(R){k(R)}}}const g=Zp(m)?m.readable:m;roe(g,()=>{if(i){const S=i;i=null,S()}})}if(b){if(wx(m))m.on("readable",function(){if(o){const g=o;o=null,g()}}),m.on("end",function(){c.push(null)}),c._read=function(){for(;;){const g=m.read();if(g===null){o=c._read;return}if(!c.push(g))return}};else if(L8(m)){const S=(Zp(m)?m.readable:m).getReader();c._read=async function(){for(;;)try{const{value:A,done:k}=await S.read();if(!c.push(A))return;if(k){c.push(null);return}}catch{return}}}}return c._destroy=function(g,S){!g&&u!==null&&(g=new toe),o=null,r=null,i=null,u===null?S(g):(u=S,wx(m)&&eoe(m,g))},c};const aoe=globalThis.AbortController||Rb().AbortController,{codes:{ERR_INVALID_ARG_VALUE:ioe,ERR_INVALID_ARG_TYPE:Jb,ERR_MISSING_ARGS:soe,ERR_OUT_OF_RANGE:ooe},AbortError:Kl}=eo,{validateAbortSignal:Oh,validateInteger:YN,validateObject:Lh}=Kb,uoe=ma.Symbol("kWeak"),loe=ma.Symbol("kResistStopPropagation"),{finished:coe}=Gd,foe=bB,{addAbortSignalNoValidate:doe}=W2,{isWritable:poe,isNodeStream:hoe}=ef,{deprecate:yoe}=xs,{ArrayPrototypePush:moe,Boolean:goe,MathFloor:JN,Number:voe,NumberIsNaN:boe,Promise:QN,PromiseReject:ZN,PromiseResolve:woe,PromisePrototypeThen:XN,Symbol:wB}=ma,n2=wB("kEmpty"),eP=wB("kEof");function _oe(n,e){if(e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),hoe(n)&&!poe(n))throw new ioe("stream",n,"must be writable");const t=foe(this,n);return e!=null&&e.signal&&doe(e.signal,t),t}function J2(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal");let t=1;(e==null?void 0:e.concurrency)!=null&&(t=JN(e.concurrency));let r=t-1;return(e==null?void 0:e.highWaterMark)!=null&&(r=JN(e.highWaterMark)),YN(t,"options.concurrency",1),YN(r,"options.highWaterMark",0),r+=t,(async function*(){const o=xs.AbortSignalAny([e==null?void 0:e.signal].filter(goe)),u=this,c=[],p={signal:o};let h,m,w=!1,b=0;function g(){w=!0,S()}function S(){b-=1,A()}function A(){m&&!w&&b<t&&c.length<r&&(m(),m=null)}async function k(){try{for await(let R of u){if(w)return;if(o.aborted)throw new Kl;try{if(R=n(R,p),R===n2)continue;R=woe(R)}catch(N){R=ZN(N)}b+=1,XN(R,S,g),c.push(R),h&&(h(),h=null),!w&&(c.length>=r||b>=t)&&await new QN(N=>{m=N})}c.push(eP)}catch(R){const N=ZN(R);XN(N,S,g),c.push(N)}finally{w=!0,h&&(h(),h=null)}}k();try{for(;;){for(;c.length>0;){const R=await c[0];if(R===eP)return;if(o.aborted)throw new Kl;R!==n2&&(yield R),c.shift(),A()}await new QN(R=>{h=R})}}finally{w=!0,m&&(m(),m=null)}}).call(this)}function xoe(n=void 0){return n!=null&&Lh(n,"options"),(n==null?void 0:n.signal)!=null&&Oh(n.signal,"options.signal"),(async function*(){let t=0;for await(const i of this){var r;if(n!=null&&(r=n.signal)!==null&&r!==void 0&&r.aborted)throw new Kl({cause:n.signal.reason});yield[t++,i]}}).call(this)}async function _B(n,e=void 0){for await(const t of Q5.call(this,n,e))return!0;return!1}async function Soe(n,e=void 0){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);return!await _B.call(this,async(...t)=>!await n(...t),e)}async function Coe(n,e){for await(const t of Q5.call(this,n,e))return t}async function Eoe(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i),n2}for await(const r of J2.call(this,t,e));}function Q5(n,e){if(typeof n!="function")throw new Jb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i)?r:n2}return J2.call(this,t,e)}class Aoe extends soe{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function koe(n,e,t){var r;if(typeof n!="function")throw new Jb("reducer",["Function","AsyncFunction"],n);t!=null&&Lh(t,"options"),(t==null?void 0:t.signal)!=null&&Oh(t.signal,"options.signal");let i=arguments.length>1;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted){const h=new Kl(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await coe(this.destroy(h)),h}const o=new aoe,u=o.signal;if(t!=null&&t.signal){const h={once:!0,[uoe]:this,[loe]:!0};t.signal.addEventListener("abort",()=>o.abort(),h)}let c=!1;try{for await(const h of this){var p;if(c=!0,t!=null&&(p=t.signal)!==null&&p!==void 0&&p.aborted)throw new Kl;i?e=await n(e,h,{signal:u}):(e=h,i=!0)}if(!c&&!i)throw new Aoe}finally{o.abort()}return e}async function Moe(n){n!=null&&Lh(n,"options"),(n==null?void 0:n.signal)!=null&&Oh(n.signal,"options.signal");const e=[];for await(const r of this){var t;if(n!=null&&(t=n.signal)!==null&&t!==void 0&&t.aborted)throw new Kl(void 0,{cause:n.signal.reason});moe(e,r)}return e}function Toe(n,e){const t=J2.call(this,n,e);return(async function*(){for await(const i of t)yield*i}).call(this)}function xB(n){if(n=voe(n),boe(n))return 0;if(n<0)throw new ooe("number",">= 0",n);return n}function Roe(n,e=void 0){return e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),n=xB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Kl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Kl;n--<=0&&(yield o)}}).call(this)}function Ooe(n,e=void 0){return e!=null&&Lh(e,"options"),(e==null?void 0:e.signal)!=null&&Oh(e.signal,"options.signal"),n=xB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Kl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Kl;if(n-- >0&&(yield o),n<=0)return}}).call(this)}B5.streamReturningOperators={asIndexedPairs:yoe(xoe,"readable.asIndexedPairs will be removed in a future version."),drop:Roe,filter:Q5,flatMap:Toe,map:J2,take:Ooe,compose:_oe};B5.promiseReturningOperators={every:Soe,forEach:Eoe,reduce:koe,toArray:Moe,some:_B,find:Coe};var N8,tP;function SB(){if(tP)return N8;tP=1;const{ArrayPrototypePop:n,Promise:e}=ma,{isIterable:t,isNodeStream:r,isWebStream:i}=ef,{pipelineImpl:o}=J5,{finished:u}=Gd;CB();function c(...p){return new e((h,m)=>{let w,b;const g=p[p.length-1];if(g&&typeof g=="object"&&!r(g)&&!t(g)&&!i(g)){const S=n(p);w=S.signal,b=S.end}o(p,(S,A)=>{S?m(S):h(A)},{signal:w,end:b})})}return N8={finished:u,pipeline:c},N8}var nP;function CB(){if(nP)return h8.exports;nP=1;const{Buffer:n}=qd,{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ma,{promisify:{custom:i}}=xs,{streamReturningOperators:o,promiseReturningOperators:u}=B5,{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=eo,p=bB,{setDefaultHighWaterMark:h,getDefaultHighWaterMark:m}=K2,{pipeline:w}=J5,{destroyer:b}=_m,g=Gd,S=SB(),A=ef,k=h8.exports=q5.Stream;k.isDestroyed=A.isDestroyed,k.isDisturbed=A.isDisturbed,k.isErrored=A.isErrored,k.isReadable=A.isReadable,k.isWritable=A.isWritable,k.Readable=Y2();for(const N of t(o)){let q=function(...V){if(new.target)throw c();return k.Readable.from(r(P,this,V))};const P=o[N];e(q,"name",{__proto__:null,value:P.name}),e(q,"length",{__proto__:null,value:P.length}),e(k.Readable.prototype,N,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}for(const N of t(u)){let q=function(...V){if(new.target)throw c();return r(P,this,V)};const P=u[N];e(q,"name",{__proto__:null,value:P.name}),e(q,"length",{__proto__:null,value:P.length}),e(k.Readable.prototype,N,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}k.Writable=W5(),k.Duplex=Yc(),k.Transform=yB,k.PassThrough=gB,k.pipeline=w;const{addAbortSignal:R}=W2;return k.addAbortSignal=R,k.finished=g,k.destroy=b,k.compose=p,k.setDefaultHighWaterMark=h,k.getDefaultHighWaterMark=m,e(k,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(w,i,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return S.finished}}),k.Stream=k,k._isUint8Array=function(P){return P instanceof Uint8Array},k._uint8ArrayToBuffer=function(P){return n.from(P.buffer,P.byteOffset,P.byteLength)},h8.exports}(function(n){const e=CB(),t=SB(),r=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=r,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(AF);var Loe=AF.exports;typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Nb().Buffer);const Ry=lU,rP=Loe,Noe=ki;globalThis.process||(globalThis.process=Vd());if(typeof crypto>"u"){const n=h2;n.getRandomValues=e=>n.randomBytes(e.length),globalThis.crypto=n}const ii={ElvCrypto:async()=>{try{if(!ii.elvCrypto){const n=(await Promise.resolve().then(()=>require("./index-CuC8ec78.js"))).default;ii.elvCrypto=await new n().init()}return ii.elvCrypto}catch(n){console.error("Error initializing ElvCrypto:"),console.error(n)}},EncryptedSize:n=>{const t=Math.floor(n/1e6);let r=ii.EncryptedBlockSize(1e6),i=t*r;return n%1e6!==0&&(i+=ii.EncryptedBlockSize(n%1e6)),i},EncryptedBlockSize:(n,e=!1)=>{let c=Math.floor(n/564)*576;return n%564!==0&&(c+=576),e?c+608:c+129},async EncryptConk(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=new Uint8Array(Buffer.from(JSON.stringify(n)));const{data:r,ephemeralKey:i,tag:o}=await t.encryptECIES(n,e),u=Buffer.concat([Buffer.from(i),Buffer.from(o),Buffer.from(r)]);return Noe.B64(u)},async DecryptCap(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=Buffer.from(n,"base64");const r=n.slice(0,65),i=n.slice(65,81),o=n.slice(81),u=t.decryptECIES(new Uint8Array(o),e,new Uint8Array(r),new Uint8Array(i));return JSON.parse(Buffer.from(u).toString())},async GeneratePrimaryConk({spaceId:n,objectId:e}){const t=await ii.ElvCrypto(),{secretKey:r,publicKey:i}=t.generatePrimaryKeys(),o=t.generateSymmetricKey().key;return{symm_key:`kpsy${Ry.encode(Buffer.from(o))}`,secret_key:`kpsk${Ry.encode(Buffer.from(r))}`,public_key:`kppk${Ry.encode(Buffer.from(i))}`,sid:n,qid:e}},async GenerateTargetConk(){const n=await ii.ElvCrypto(),{secretKey:e,publicKey:t}=n.generateTargetKeys();return{secret_key:`kpsk${Ry.encode(Buffer.from(e))}`,public_key:`ktpk${Ry.encode(Buffer.from(t))}`}},CapToConk(n){const e=t=>new Uint8Array(Ry.decode(t.slice(4)));return{symmetricKey:e(n.symm_key),secretKey:e(n.secret_key),publicKey:e(n.public_key)}},async EncryptionContext(n){const e=await ii.ElvCrypto(),{symmetricKey:t,secretKey:r,publicKey:i}=ii.CapToConk(n);let o,u;return i.length===e.PRIMARY_PK_KEY_SIZE?(u=e.CRYPTO_TYPE_PRIMARY,o=e.newPrimaryContext(i,r,t)):(u=e.CRYPTO_TYPE_TARGET,o=e.newTargetDecryptionContext(r,t)),{context:o,type:u}},Encrypt:async(n,e)=>{const t=await ii.OpenEncryptionStream(n);!Buffer.isBuffer(e)&&!(e instanceof ArrayBuffer)&&(e=Buffer.from(await new Response(e).arrayBuffer()));const r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenEncryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t}=await ii.EncryptionContext(n),r=new rP.PassThrough,i=e.createCipher(t);return r.pipe(i).on("finish",()=>{t.free()}).on("error",o=>{throw Error(o)})},Decrypt:async(n,e)=>{const t=await ii.OpenDecryptionStream(n),r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenDecryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t,type:r}=await ii.EncryptionContext(n),i=new rP.PassThrough,o=e.createDecipher(r,t);return i.pipe(o).on("finish",()=>{t.free()}).on("error",u=>{throw Error(u)})}};var EB=ii,Zr={},aP;function AB(){if(aP)return Zr;aP=1;const n=ki;let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=C5().Response,e=h2);const t=rs,{ValidatePresence:r,ValidateWriteToken:i,ValidatePartHash:o,ValidateParameters:u}=Ko;return Zr.ListFiles=async function({libraryId:c,objectId:p,path:h="",versionHash:m,writeToken:w}){u({libraryId:c,objectId:p,versionHash:m,writeToken:w}),m&&(p=this.utils.DecodeVersionHash(m).objectId);let b=t("q",w||m||p,"files_list",h);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:m}),method:"GET",path:b})},Zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:h,region:m,bucket:w,fileInfo:b,accessKey:g,secret:S,signedUrl:A,encryption:k="none",copy:R=!1,callback:N}){u({libraryId:c,objectId:p}),i(h);const P=/^s3:\/\/([^/]+)\//i;for(let Se=0;Se<b.length;Se++){const Ce=b[Se].source,ne=P.exec(Ce);if(ne){if(ne[1]!==w)throw Error('Full S3 file path "'+Ce+`" specified, but does not match provided bucket name '`+w+"'");b[Se].source=Ce.replace(P,"")}}R?this.Log(`Copying files from S3: ${c} ${p} ${h}`):this.Log(`Adding links to files in S3: ${c} ${p} ${h}`);let q;if(k==="cgck"){let Se=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});Se={...Se,secret_key:""},q=`kp__${this.utils.B58(Buffer.from(JSON.stringify(Se)))}`}let V={access_key_id:g,secret_access_key:S};A&&(V={signed_url:A});const de={encryption_key:q,access:{protocol:"s3",platform:"aws",path:w,storage_endpoint:{region:m},cloud_credentials:V}},oe=b.map(Se=>R?{op:"ingest-copy",path:Se.path,encryption:{scheme:k==="cgck"?"cgck":"none"},ingest:{type:"key",path:Se.source}}:{op:"add-reference",path:Se.path,reference:{type:"key",path:Se.source}}),{id:he}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:oe,defaults:de});for(;;){await new Promise(ne=>setTimeout(ne,1e3));const Se=await this.UploadStatus({libraryId:c,objectId:p,writeToken:h,uploadId:he});if(Se.errors&&Se.errors.length>1)throw Se.errors.join(`
328
328
  `);if(Se.error)throw this.Log(`S3 file upload failed:
329
329
  ${JSON.stringify(Se,null,2)}`),Se.error;if(Se.status.toLowerCase()==="failed")throw"File upload failed";let Ce=!1;if(R){if(Ce=Se.ingest_copy.done,N){const ne=Se.ingest_copy.progress;N({done:Ce,uploaded:ne.bytes.completed,total:ne.bytes.total,uploadedFiles:ne.files.completed,totalFiles:ne.files.total,fileStatus:ne.files.details})}}else if(Ce=Se.add_reference.done,N){const ne=Se.add_reference.progress;N({done:Ce,uploadedFiles:ne.completed,totalFiles:ne.total})}if(Ce)break}},Zr.UploadFiles=async function({libraryId:c,objectId:p,writeToken:h,fileInfo:m,encryption:w="none",callback:b}){u({libraryId:c,objectId:p}),i(h),r("fileInfo",m),this.Log(`Uploading files: ${c} ${p} ${h}`);let g;w==="cgck"&&(g=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h}));let S={},A={},k=m;m=[];for(let C=0;C<k.length;C++){let x={...k[C],data:void 0};x.path=x.path.replace(/^\/+/,""),w==="cgck"&&(x.encryption={scheme:"cgck"}),A[x.path]=k[C].data,x.type="file",S[x.path]={uploaded:0,total:x.size},m.push(x)}this.Log(m),b&&b(S);const{id:R,jobs:N}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:m,encryption:w});this.Log(`Upload ID: ${R}`),this.Log(N);const P=500*1024*1024;let q=[],V=0,de=0;const oe=async()=>{for(let C=0;C<N.length;C++){for(;V-de>P;)await new Promise(z=>setTimeout(z,500));const x=N[C];let O=await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:h,uploadId:R,jobId:x});for(let z=0;z<O.files.length;z++){const F=O.files[z];let H;typeof A[F.path]=="number"?(H=Buffer.alloc(F.len),e.readSync(A[F.path],H,0,F.len,F.off)):H=A[F.path].slice(F.off,F.off+F.len),w==="cgck"&&(H=await this.Crypto.Encrypt(g,H)),O.files[z].data=H,V+=F.len}q[C]=O,await new Promise(z=>setTimeout(z,50))}},he=async(C,x)=>{for(;!q[x];)await new Promise(F=>setTimeout(F,500));const z=q[x].files;for(let F=0;F<z.length;F++){const H=z[F];let Q=0,ae=!1;do try{await this.UploadFileData({libraryId:c,objectId:p,writeToken:h,uploadId:R,jobId:C,filePath:H.path,fileData:H.data,encryption:w}),ae=!0}catch(L){if(this.Log(L,!0),Q+=1,Q>=10)throw L;await new Promise(T=>setTimeout(T,10*Q*1e3))}while(!ae&&Q<10);delete q[x].files[F].data,de+=H.len,b&&(S[H.path]={...S[H.path],uploaded:S[H.path].uploaded+H.len},b(S))}};oe().catch(C=>{throw C});const Se=Math.min(3,N.length);let Ce=[];for(let C=0;C<Se;C++){const x=new Date().getTime();await he(N[C],C);const O=(new Date().getTime()-x)/1e3,z=q[C].files.map(F=>F.len).reduce((F,H)=>F+H,0);Ce.push(z/O/(1024*1024))}const ne=Ce.reduce((C,x)=>C+x,0)/Se,Le=Math.min(5,Math.ceil(ne/2));await this.utils.LimitedMap(Le,N,async(C,x)=>{x<Se||await he(C,x)})},Zr.CreateFileUploadJob=async function({libraryId:c,objectId:p,writeToken:h,ops:m,defaults:w={},encryption:b="none"}){u({libraryId:c,objectId:p}),i(h),this.Log(`Creating file upload job: ${c} ${p} ${h}`),this.Log(m),b==="cgck"&&(w.encryption={scheme:"cgck"});const g={seq:0,seq_complete:!0,defaults:w,ops:m},S=t("q",h,"file_jobs");return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:b}),method:"POST",path:S,body:g,allowFailover:!1})},Zr.UploadStatus=async function({libraryId:c,objectId:p,writeToken:h,uploadId:m}){u({libraryId:c,objectId:p}),i(h);const w=t("q",h,"file_jobs",m);return this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:w,allowFailover:!1}))},Zr.UploadJobStatus=async function({libraryId:c,objectId:p,writeToken:h,uploadId:m,jobId:w}){u({libraryId:c,objectId:p}),i(h);const b=t("q",h,"file_jobs",m,"uploads",w);let g=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:b,allowFailover:!1,queryParams:{start:0,limit:1e4}}));for(;g.next!==g.total&&g.next>=0;){const S=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:b,allowFailover:!1,queryParams:{start:g.next}}));g.files=[...g.files,...S.files],g.next=S.next}return g},Zr.UploadFileData=async function({libraryId:c,objectId:p,writeToken:h,encryption:m,uploadId:w,jobId:b,filePath:g,fileData:S}){u({libraryId:c,objectId:p}),i(h);let k=(await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:h,uploadId:w,jobId:b})).files.find(N=>N.path===g);if(m&&m!=="none"&&(k=k.encrypted),k.rem===0)return;k.skip&&(S=S.slice(k.skip));let R=t("q",h,"file_jobs",w,b);return await this.utils.ResponseToJson(this.HttpClient.Request({method:"POST",path:R,body:S,bodyType:"BINARY",headers:{"Content-type":"application/octet-stream",...await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0})},allowFailover:!1,allowRetry:!1}))},Zr.FinalizeUploadJob=async function({libraryId:c,objectId:p,writeToken:h}){u({libraryId:c,objectId:p}),i(h),this.Log(`Finalizing upload job: ${c} ${p} ${h}`);const m=t("q",h,"files");await this.HttpClient.Request({method:"POST",path:m,bodyType:"BINARY",headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),allowFailover:!1})},Zr.CreateFileDirectories=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Creating Directories: ${c} ${p} ${h}`),this.Log(m);const w=m.map(b=>({op:"add",type:"directory",path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Zr.MoveFiles=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Moving Files: ${c} ${p} ${h}`),this.Log(m);const w=m.map(({path:b,to:g})=>({op:"move",copy_move_source_path:b,path:g}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Zr.DeleteFiles=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Deleting Files: ${c} ${p} ${h}`),this.Log(m);const w=m.map(b=>({op:"del",path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Zr.DownloadFile=async function({libraryId:c,objectId:p,versionHash:h,writeToken:m,filePath:w,format:b="arrayBuffer",chunked:g=!1,chunkSize:S,clientSideDecryption:A=!1,callback:k}){u({libraryId:c,objectId:p,versionHash:h}),r("filePath",w),h&&(p=this.utils.DecodeVersionHash(h).objectId);const R=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:h,writeToken:m,metadataSubtree:t("files",w)}),N=R&&R["."].encryption&&R["."].encryption.scheme==="cgck",P=N?"cgck":void 0,q=N&&!A?t("q",m||h||p,"rep","files_download",w):t("q",m||h||p,"files",w),V=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h,encryption:P,makeAccessRequest:P==="cgck"});V.Accept="*/*";const de=`eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`,oe=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:h,metadataSubtree:de});N&&!this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))&&!oe&&(V["X-Content-Fabric-Decryption-Mode"]="reencrypt"),N&&!A&&(V["X-Content-Fabric-Decryption-Mode"]="decrypt",S=Number.MAX_SAFE_INTEGER);const he=R["."].size;if(N&&A)return await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,versionHash:h,download:!0}),downloadPath:q,bytesTotal:he,headers:V,callback:k,format:b,clientSideDecryption:A,chunked:g});S||(S=1e7);try{return await this.Download({downloadPath:q,bytesTotal:he,headers:V,callback:k,format:b,chunked:g,chunkSize:S})}catch(Se){if(N&&!A)return this.DownloadFile({...arguments[0],clientSideDecryption:!0});throw Se}},Zr.ContentParts=async function({libraryId:c,objectId:p,versionHash:h}){u({libraryId:c,objectId:p,versionHash:h}),this.Log(`Retrieving parts: ${c} ${p||h}`),h&&(p=this.utils.DecodeVersionHash(h).objectId);const m=t("q",h||p,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h}),method:"GET",path:m})).parts},Zr.ContentPart=async function({libraryId:c,objectId:p,versionHash:h,partHash:m}){u({libraryId:c,objectId:p,versionHash:h}),o(m),this.Log(`Retrieving part: ${c} ${p||h} ${m}`),h&&(p=this.utils.DecodeVersionHash(h).objectId);let w=t("q",h||p,"parts",m);return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h}),method:"GET",path:w})},Zr.DownloadPart=async function({libraryId:c,objectId:p,versionHash:h,writeToken:m,partHash:w,format:b="arrayBuffer",chunked:g=!1,chunkSize:S=1e7,callback:A}){u({libraryId:c,objectId:p,versionHash:h}),o(w),h&&(p=this.utils.DecodeVersionHash(h).objectId);const k=w.startsWith("hqpe"),R=k?"cgck":void 0,N=t("q",m||h||p,"data",w);let P=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h,encryption:R,makeAccessRequest:!0});const q=(await this.ContentPart({libraryId:c,objectId:p,versionHash:h,partHash:w})).part.size;return k?(this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))||(P["X-Content-Fabric-Decryption-Mode"]="reencrypt"),await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,download:!0}),downloadPath:N,bytesTotal:q,headers:P,callback:A,format:b,chunked:g})):await this.Download({downloadPath:N,bytesTotal:q,headers:P,callback:A,format:b,chunked:g,chunkSize:S})},Zr.Download=async function({downloadPath:c,headers:p,bytesTotal:h,chunked:m=!1,chunkSize:w=2e6,callback:b,format:g="arrayBuffer"}){if(m&&!b)throw Error("No callback specified for chunked download");let S;m||(S=[]);let A=0;const k=Math.ceil(h/w);for(let R=0;R<k;R++){p.Range=`bytes=${A}-${A+w-1}`;const N=await this.HttpClient.Request({path:c,headers:p,method:"GET"});A=Math.min(A+w,h),m?b({bytesFinished:A,bytesTotal:h,chunk:await this.utils.ResponseToFormat(g,N)}):(S.push(Buffer.from(await N.arrayBuffer())),b&&b({bytesFinished:A,bytesTotal:h}))}if(!m)return await this.utils.ResponseToFormat(g,new Response(Buffer.concat(S)))},Zr.DownloadEncrypted=async function({conk:c,downloadPath:p,bytesTotal:h,headers:m,callback:w,format:b="arrayBuffer",chunked:g=!1}){if(g&&!w)throw Error("No callback specified for chunked download");const S=c.public_key.startsWith("ktpk"),A=this.Crypto.EncryptedBlockSize(1e6,S);let k=0;b=b.toLowerCase();let R=[];const N=await this.Crypto.OpenDecryptionStream(c);N.on("data",async q=>{if(g){if(b!=="buffer"){const V=q.buffer.slice(q.byteOffset,q.byteOffset+q.byteLength);b==="arraybuffer"?q=V:q=await this.utils.ResponseToFormat(b,new Response(V))}w({bytesFinished:k,bytesTotal:h,chunk:q})}else w&&w({bytesFinished:k,bytesTotal:h}),R.push(q)});const P=Math.ceil(h/A);for(let q=0;q<P;q++){m.Range=`bytes=${k}-${k+A-1}`;const V=await this.HttpClient.Request({headers:m,method:"GET",path:p});k=Math.min(k+A,h),N.write(new Uint8Array(await V.arrayBuffer()))}if(N.end(),await new Promise(q=>N.on("finish",()=>{q()})),!g)return await this.utils.ResponseToFormat(b,new Response(Buffer.concat(R)))},Zr.CreatePart=async function({libraryId:c,objectId:p,writeToken:h,encryption:m}){u({libraryId:c,objectId:p}),i(h);const w=t("q",h,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:m}),method:"POST",path:w,bodyType:"BINARY",body:"",allowFailover:!1})).part.write_token},Zr.UploadPartChunk=async function({libraryId:c,objectId:p,writeToken:h,partWriteToken:m,chunk:w,encryption:b}){if(u({libraryId:c,objectId:p}),i(h),b&&b!=="none"){const S=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});w=await this.Crypto.Encrypt(S,w)}const g=t("q",h,"parts");await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:b}),method:"POST",path:t(g,m),body:w,bodyType:"BINARY",allowFailover:!1}))},Zr.FinalizePart=async function({libraryId:c,objectId:p,writeToken:h,partWriteToken:m,encryption:w}){u({libraryId:c,objectId:p}),i(h);const b=t("q",h,"parts");return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:w}),method:"POST",path:t(b,m),bodyType:"BINARY",body:"",allowFailover:!1})},Zr.UploadPart=async function({libraryId:c,objectId:p,writeToken:h,data:m,encryption:w="none",chunkSize:b=1e7,callback:g}){u({libraryId:c,objectId:p}),i(h);const S=await this.CreatePart({libraryId:c,objectId:p,writeToken:h,encryption:w}),A=m.length||m.byteLength||m.size;g&&g({bytesFinished:0,bytesTotal:A});for(let k=0;k<A;k+=b){const R=m.slice(k,k+b);await this.UploadPartChunk({libraryId:c,objectId:p,writeToken:h,partWriteToken:S,chunk:R,encryption:w}),g&&g({bytesFinished:Math.min(k+b,A),bytesTotal:A})}return await this.FinalizePart({libraryId:c,objectId:p,writeToken:h,partWriteToken:S,encryption:w})},Zr.DeletePart=async function({libraryId:c,objectId:p,writeToken:h,partHash:m}){u({libraryId:c,objectId:p}),i(h),o(m);let w=t("q",h,"parts",m);await this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"DELETE",path:w,allowFailover:!1})},Zr}const iP=kne,Poe=ki,Ioe=EF().permissionLevels,{LogMessage:Doe}=dm,Uoe=EB;let kB=class D4{Log(e,t=!1){Doe(this,e,t)}constructor({target:e,timeout:t=30}={}){this.permissionLevels=Ioe,!e&&typeof window<"u"&&window.parent&&(e=window.parent),this.target=e,this.timeout=t,this.utils=Poe,this.Crypto=Uoe,this.Crypto.ElvCrypto();for(const r of this.AllowedMethods())this[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{calledMethod:r,args:this.utils.MakeClonable(i)},callback:o})};this.userProfileClient={};for(const r of this.AllowedUserProfileMethods())this.userProfileClient[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{module:"userProfileClient",calledMethod:r,args:this.utils.MakeClonable(i),prompted:D4.PromptedMethods().includes(r)},callback:o})};this.walletClient={};for(const r of this.AllowedWalletClientMethods())this.walletClient[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{module:"walletClient",calledMethod:r,args:this.utils.MakeClonable(i)},callback:o})}}async PassRequest({request:e,Respond:t}){let r,i;try{let o;e.callbackId&&(o=u=>t({type:"ElvFrameResponse",requestId:e.callbackId,response:u})),r=await this.SendMessage({options:e,callback:o})}catch(o){i=o}return{type:"ElvFrameResponse",requestId:e.requestId,response:r,error:i}}async SendMessage({options:e={},callback:t,noResponse:r=!1}){const i=iP.next();let o;if(t&&(o=iP.next()),this.target.postMessage({...e,type:"ElvFrameRequest",requestId:i,callbackId:o},"*"),r)return;const u=e.calledMethod||e.operation,c=D4.FileMethods().includes(e.calledMethod);let p=this.timeout;return e.prompted||c?p=0:e.args&&e.args.fcTimeout&&(p=e.args.fcTimeout),await this.AwaitMessage(i,p,t,o,u)}async AwaitMessage(e,t,r,i,o){return await new Promise((u,c)=>{let p,h;const m=()=>{h&&clearTimeout(h),t>0&&(h=setTimeout(()=>{typeof window<"u"&&(window.removeEventListener("message",p),w&&window.removeEventListener("message",w)),c(`Request ${e} timed out (${o})`)},t*1e3))};let w;i&&(w=b=>{try{m();const g=b.data;if(g.type!=="ElvFrameResponse"||g.requestId!==i)return;r(g.response)}catch(g){console.error(g)}},window.addEventListener("message",w)),p=async b=>{try{const g=b.data;if(g.type!=="ElvFrameResponse"||g.requestId!==e)return;clearTimeout(h),window.removeEventListener("message",p),w&&window.removeEventListener("message",w),g.error?c(g.error):u(g.response)}catch(g){clearTimeout(h),window.removeEventListener("message",p),w&&window.removeEventListener("message",w),c(g)}},m(),window.addEventListener("message",p)})}static PromptedMethods(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static MetadataMethods(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static FileMethods(){return["CreateFileUploadJob","DownloadEncrypted","DownloadFile","DownloadPart","FinalizeUploadJob","UpdateContentObjectGraph","UploadFileData","UploadFiles","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus"]}OverriddenMethods(){return["UploadFiles"]}AllowedMethods(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AuditContentObject","AuditStream","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractInfo","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateShare","CreateSignedToken","CreateStaticToken","CurrentAccountAddress","CustomContractAddress","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeleteWriteToken","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","EmbedUrl","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","GlobalUrl","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LRODraftInfo","LROStatus","MakeAuthServiceRequest","MakeFileServiceRequest","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","MoveFiles","NetworkInfo","NodeId","Nodes","NTPInstance","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RecordWriteToken","RedeemCode","RedeemShareToken","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","RevokeShare","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetVisibility","SetPermission","Shares","SpaceNodes","StartABRMezzanineJobs","StreamAddWatermark","StreamConfig","StreamCopyToVod","StreamCreate","StreamInitialize","StreamInsertion","StreamListUrls","StreamRemoveWatermark","StreamStatus","StreamStartOrStopOrReset","StreamStopSession","SuspendNTPInstance","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UpdateShare","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","Visibility","WriteTokenNodeUrl"]}AllowedUserProfileMethods(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","TenantContractId","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}AllowedWalletClientMethods(){return["AcceptMarketplaceOffer","AddNotificationListener","AvailableMarketplaces","CanSign","CastVote","ClaimItem","ClaimStatus","CollectionRedemptionStatus","CreateListing","CreateMarketplaceOffer","DeployTenant","DropStatus","ExchangeRate","FilteredQuery","LatestMarketplaceHash","Leaderboard","Listing","ListingAttributes","ListingEditionNames","ListingNames","ListingPurchaseStatus","ListingStats","ListingStatus","Listings","LoadAvailableMarketplaces","LoadDrop","LoadMarketplace","Marketplace","MarketplaceCSS","MarketplaceInfo","MarketplaceOffers","MarketplaceStock","MintingStatus","NFT","NFTContractStats","Notifications","PackOpenStatus","Profile","ProfileMetadata","PurchaseStatus","PushNotification","RejectMarketplaceOffer","RemoveListing","RemoveMarketplaceOffer","RemoveProfileMetadata","RevokeVote","Sales","SalesNames","SalesStats","SetProfileMetadata","SubmitDropVote","TenantConfiguration","TransferNFT","Transfers","UserAddress","UserInfo","UserItemAttributes","UserItemEditionNames","UserItemNames","UserItems","UserListings","UserNameToAddress","UserSales","UserTransfers","UserWalletBalance","VoteStatus"]}};const{UploadFiles:Foe}=AB();kB.prototype.UploadFiles=Foe;nF.FrameClient=kB;const Zi=ki,P8=rs,{FrameClient:sP}=nF,{LogMessage:Boe}=dm;let zoe=class{Log(e,t=!1){Boe(this,e,t)}constructor({client:e,debug:t}){this.client=e,this.debug=t,this.userWalletAddresses={},this.walletAddress=void 0,this.walletAddressRetrieved=!1}async CreateWallet(){if(this.creatingWallet)for(;this.creatingWallet;)await new Promise(e=>setTimeout(e,500));this.creatingWallet=!0;try{if(!this.walletAddress||Zi.EqualAddress(this.walletAddress,Zi.nullAddress)){if(this.Log(`Creating user wallet for user ${this.client.signer.address}`),await this.client.GetBalance({address:this.client.signer.address})<.05)return;const i=await this.client.CallContractMethodAndWait({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"createAccessWallet",methodArgs:[]}),o=await this.client.ContractAbi({contractAddress:this.client.contentSpaceAddress});this.walletAddress=this.client.ExtractValueFromEvent({abi:o,event:i,eventName:"CreateAccessWallet",eventValue:"wallet"}),this.userWalletAddresses[Zi.FormatAddress(this.client.signer.address)]=this.walletAddress}const e=this.client.contentSpaceLibraryId,t=Zi.AddressToObjectId(this.walletAddress);try{await this.client.ContentObject({libraryId:e,objectId:t})}catch(r){if(r.status===404){this.Log(`Creating wallet object for user ${this.client.signer.address}`);const i=await this.client.CreateContentObject({libraryId:e,objectId:t});await this.client.FinalizeContentObject({libraryId:e,objectId:t,writeToken:i.write_token,commitMessage:"Create user wallet object"})}}}catch(e){console.error("Failed to create wallet contract:"),console.error(e)}finally{this.creatingWallet=!1}}async WalletAddress(e=!0){if(this.walletAddress||this.walletAddressRetrieved)return this.walletAddress;this.walletAddressPromise||(this.walletAddressPromise=this.client.CallContractMethod({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[this.client.signer.address]}));const t=await this.walletAddressPromise;return Zi.EqualAddress(t,Zi.nullAddress)||(this.walletAddress=t),!this.walletAddress&&e&&await this.CreateWallet(),this.walletAddressRetrieved=!0,this.walletAddress}async UserWalletAddress({address:e}){if(Zi.EqualAddress(e,this.client.signer.address))return await this.WalletAddress();if(!this.userWalletAddresses[e]){this.Log(`Retrieving user wallet address for user ${e}`);const t=await this.client.CallContractMethod({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[e]});Zi.EqualAddress(t,Zi.nullAddress)||(this.userWalletAddresses[e]=t)}return this.userWalletAddresses[e]}async UserWalletObjectInfo({address:e}={}){const t=e?await this.UserWalletAddress({address:e}):await this.WalletAddress();return{libraryId:this.client.contentSpaceLibraryId,objectId:t?Zi.AddressToObjectId(t):""}}async PublicUserMetadata({address:e,metadataSubtree:t="/",queryParams:r={},select:i=[],resolveLinks:o=!1,resolveIncludeSource:u=!1,resolveIgnoreErrors:c=!1,linkDepthLimit:p=1}){if(!e||!await this.UserWalletAddress({address:e}))return;t=P8("public",t||"/");const{libraryId:m,objectId:w}=await this.UserWalletObjectInfo({address:e});if(w)return await this.client.ContentObjectMetadata({libraryId:m,objectId:w,queryParams:r,select:i,metadataSubtree:t,resolveLinks:o,resolveIncludeSource:u,resolveIgnoreErrors:c,linkDepthLimit:p})}async UserMetadata({metadataSubtree:e="/",queryParams:t={},select:r=[],resolveLinks:i=!1,resolveIncludeSource:o=!1,resolveIgnoreErrors:u=!1,linkDepthLimit:c=1}={}){this.Log(`Accessing private user metadata at ${e}`);const{libraryId:p,objectId:h}=await this.UserWalletObjectInfo();return await this.client.ContentObjectMetadata({libraryId:p,objectId:h,metadataSubtree:e,queryParams:t,select:r,resolveLinks:i,resolveIncludeSource:o,resolveIgnoreErrors:u,linkDepthLimit:c})}async MergeUserMetadata({metadataSubtree:e="/",metadata:t={}}){this.Log(`Merging user metadata at ${e}`);const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.MergeMetadata({libraryId:r,objectId:i,writeToken:o.write_token,metadataSubtree:e,metadata:t}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Merge user metadata"})}async ReplaceUserMetadata({metadataSubtree:e="/",metadata:t={}}){this.Log(`Replacing user metadata at ${e}`);const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.ReplaceMetadata({libraryId:r,objectId:i,writeToken:o.write_token,metadataSubtree:e,metadata:t}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Replace user metadata"})}async DeleteUserMetadata({metadataSubtree:e="/"}){this.Log(`Deleting user metadata at ${e}`);const{libraryId:t,objectId:r}=await this.UserWalletObjectInfo(),i=await this.client.EditContentObject({libraryId:t,objectId:r});await this.client.DeleteMetadata({libraryId:t,objectId:r,writeToken:i.write_token,metadataSubtree:e}),await this.client.FinalizeContentObject({libraryId:t,objectId:r,writeToken:i.write_token,commitMessage:"Delete user metadata"})}async AccessLevel(){return await this.UserMetadata({metadataSubtree:"access_level"})||"prompt"}async SetAccessLevel({level:e}){if(e=e.toLowerCase(),!["private","prompt","public"].includes(e))throw new Error("Invalid access level: "+e);await this.ReplaceUserMetadata({metadataSubtree:"access_level",metadata:e})}async TenantId(){if(!this.tenantId){const{objectId:e}=await this.UserWalletObjectInfo();this.tenantId=await this.client.TenantId({objectId:e})}return this.tenantId}async SetTenantId({id:e,address:t}){if(e&&(!e.startsWith("iten")||!Zi.ValidHash(e)))throw Error(`Invalid tenant ID: ${e}`);if(t){if(!Zi.ValidAddress(t))throw Error(`Invalid address: ${t}`);e=`iten${Zi.AddressToHash(t)}`}const{objectId:r}=await this.UserWalletObjectInfo(),i=await this.client.SetTenantId({objectId:r,tenantId:e});this.tenantContractId=i.tenantContractId,this.tenantId=i.tenantId}async TenantContractId(){if(!this.tenantContractId){const{objectId:e}=await this.UserWalletObjectInfo();this.tenantContractId=await this.client.TenantContractId({objectId:e})}return this.tenantContractId}async SetTenantContractId({tenantContractId:e}){const{objectId:t}=await this.UserWalletObjectInfo(),r=await this.client.SetTenantContractId({objectId:t,tenantContractId:e});this.tenantContractId=r.tenantContractId,this.tenantId=r.tenantId}async ResetTenantId(){const{objectId:e}=await this.UserWalletObjectInfo();await this.client.ResetTenantId({objectId:e}),this.tenantId=this.client.TenantId({objectId:e}),this.tenantContractId=this.client.TenantContractId({objectId:e})}async UserProfileImage({address:e,height:t}={}){let r;if(e?r=await this.UserWalletAddress({address:e}):(e=this.client.signer.address,r=this.walletAddress),!r)return;const{libraryId:i,objectId:o}=await this.UserWalletObjectInfo({address:e});return this.client.ContentObjectImageUrl({libraryId:i,objectId:o,height:t,imagePath:"public/profile_image"})}async SetUserProfileImage({image:e}){if(this.Log(`Setting profile image for user ${this.client.signer.address}`),(e.length||e.byteLength||e.size)>5e6)throw Error("Maximum profile image size is 5MB");const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.SetContentObjectImage({libraryId:r,objectId:i,writeToken:o.write_token,image:e,imageName:"profile_image",imagePath:"public/profile_image"}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Set user profile image"})}async CollectedTags(){return await this.UserMetadata({metadataSubtree:"collected_data"})||{}}async RecordTags({libraryId:e,objectId:t,versionHash:r}){try{await this.__RecordTags({libraryId:e,objectId:t,versionHash:r})}catch(i){console.error(i)}}async __RecordTags({libraryId:e,objectId:t,versionHash:r}){if(await this.client.AccessType({id:t})!=="object"||(!r&&!e&&(e=await this.client.ContentObjectLibraryId({objectId:t})),r||(r=(await this.client.ContentObject({libraryId:e,objectId:t})).hash),await this.UserMetadata({metadataSubtree:P8("accessed_content",r)})))return;const u=await this.UserWalletObjectInfo(),c=u.libraryId,p=u.objectId,h=await this.client.EditContentObject({libraryId:c,objectId:p});await this.client.ReplaceMetadata({libraryId:c,objectId:p,writeToken:h.write_token,metadataSubtree:P8("accessed_content",r),metadata:Date.now()});const m=await this.client.ContentObjectMetadata({libraryId:e,objectId:t,versionHash:r,metadataSubtree:"video_tags"});if(m&&m.length>0){let w=await this.CollectedTags();const b=this.__FormatVideoTags(m);Object.keys(b).forEach(g=>{w[g]?(w[g].occurrences+=1,w[g].aggregate+=b[g]):w[g]={occurrences:1,aggregate:b[g]}}),await this.client.ReplaceMetadata({libraryId:c,objectId:p,writeToken:h.write_token,metadataSubtree:"collected_data",metadata:w})}await this.client.FinalizeContentObject({libraryId:c,objectId:p,writeToken:h.write_token,commitMessage:"Record user tags",awaitCommitConfirmation:!1})}__FormatVideoTags(e){let t={};e.forEach(i=>{i.tags.forEach(u=>{t[u.tag]?(t[u.tag].occurrences+=1,t[u.tag].aggregate+=u.score):t[u.tag]={occurrences:1,aggregate:u.score}})});let r={};return Object.keys(t).forEach(i=>{r[i]=t[i].aggregate/t[i].occurrences}),r}PromptedMethods(){return sP.PromptedMethods()}MetadataMethods(){return sP.MetadataMethods()}FrameAllowedMethods(){const e=["constructor","FrameAllowedMethods","Log","MetadataMethods","PromptedMethods","RecordTags","SetAccessLevel","SetTenantId","SetUserProfileImage","__IsLibraryCreated","__TouchLibrary","__FormatVideoTags","__RecordTags"];return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(t=>!e.includes(t))}};var joe=zoe;const yd=Jl,Al=ki,Hoe=$d,Oy=rs,oP=N5;let $oe=class extends yd.Signer{constructor({signerURIs:e,idToken:t,authToken:r,tenantId:i,provider:o,extraData:u={},unsignedPublicAuth:c=!1}){super(),this.remoteSigner=!0,this.unsignedPublicAuth=c,this.HttpClient=new Hoe({uris:e}),this.idToken=t,this.tenantId=i,this.authToken=r,this.extraLoginData=u||{},this.provider=o,this.signatureCache={}}async Initialize(){if(!this.authToken){const{addr:e,eth:t,token:r}=await Al.ResponseToJson(this.HttpClient.Request({path:Oy("as","wlt","login","jwt"),method:"POST",body:this.tenantId?{tid:this.tenantId,ext:this.extraLoginData||{}}:{ext:this.extraLoginData||{}},headers:{Authorization:`Bearer ${this.idToken}`}}));this.authToken=r,this.address=Al.FormatAddress(e),this.id=t}if(!this.address){const e=await Al.ResponseToJson(this.HttpClient.Request({method:"GET",path:Oy("as","wlt","keys"),headers:{Authorization:`Bearer ${this.authToken}`}})),t=e.eth[0];t&&t.startsWith("0x")?this.address=t:this.address=Al.HashToAddress(e.eth[0])}this.id=this.address?`ikms${Al.AddressToHash(this.address)}`:void 0,this.signer=this.provider.getSigner(this.address)}async RetrieveCSAT({email:e,nonce:t,tenantId:r,force:i=!1}){t=t||Al.B58(oP.parse(oP.v4()));let o=await Al.ResponseToJson(this.HttpClient.Request({method:"POST",body:{email:e,nonce:t,force:i,tid:r},path:Oy("as","wlt","sign","csat"),headers:{Authorization:`Bearer ${this.authToken}`}}));return o.nonce=t,o}async CSATStatus({accessToken:e}){try{const t=await Al.ResponseToJson(this.HttpClient.Request({method:"POST",path:Oy("as","wlt","login","status"),headers:{Authorization:`Bearer ${e}`}}));return t&&t.is_active}catch(t){return!t||t.status!==403}}async ReleaseCSAT({accessToken:e}){return await Al.ResponseToJson(this.HttpClient.Request({method:"POST",path:Oy("as","wlt","login","release"),headers:{Authorization:`Bearer ${e}`}}))}getAddress(){return this.address}async signDigest(e){return this.signatureCache[e]||(this.signatureCache[e]=new Promise(async(t,r)=>{try{let i=await Al.ResponseToJson(this.HttpClient.Request({method:"POST",path:Oy("as","wlt","sign","eth",this.id),headers:{Authorization:`Bearer ${this.authToken}`},body:{hash:e}}));i.v=parseInt(i.v,16),i.recoveryParam=i.v-27,t(i)}catch(i){r(i)}})),await this.signatureCache[e]}async signMessage(e){return Promise.resolve(yd.utils.joinSignature(`0x${await this.signDigest(yd.utils.hashMessage(e))}`))}async sign(e){e=await yd.utils.resolveProperties(e);const t=await this.signDigest(yd.utils.keccak256(yd.utils.serializeTransaction(e)));return yd.utils.serializeTransaction(e,t)}async sendTransaction(e){return e.nonce==null&&(e=yd.utils.shallowCopy(e),e.nonce=await this.provider.getTransactionCount(this.address,"pending")),this.populateTransaction(e,this.provider,this.address).then(t=>this.sign(t).then(r=>this.provider.sendTransaction(r)))}connect(){}};var qoe=$oe,da={},uP;function Voe(){if(uP)return da;uP=1;const{ValidatePresence:n,ValidateLibrary:e,ValidateObject:t,ValidateAddress:r,ValidateUserWallet:i}=Ko;return da.ListAccessGroups=async function(){const o=(await this.Collection({collectionType:"accessGroups"})).map(c=>this.utils.FormatAddress(c));return(await this.utils.LimitedMap(5,o,async c=>{try{const p=this.utils.AddressToHash(c),h=await this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:`iq__${p}`})||{};return{address:c,id:`igrp${p}`,meta:h}}catch(p){this.Log(p,!0)}})).filter(c=>c).sort((c,p)=>{const h=(c.meta.public||{}).name||`zz__${c.address}`,m=(p.meta.public||{}).name||`zz__${p.address}`;return h<m?-1:1})},da.SetGroupPermission=async function({groupAddress:o,objectId:u,permission:c,remove:p=!1}){const h=await this.authClient.ContractInfo({address:o}),m=await this.authClient.ContractInfo({id:u});if(Object.keys(h).length===0)throw Error(`No information returned for group address ${o}`);let w;if(!m.isV3&&m.accessType===this.authClient.ACCESS_TYPES.GROUP){if(h.isV3)throw Error("Unable to map V3 group to V2 object");w=await this.CallContractMethodAndWait({contractAddress:o,methodName:"setAccessGroupRights",methodArgs:[this.utils.HashToAddress(u),c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]})}else w=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:"setRights",methodArgs:[o,c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]});return await this.ExtractEventFromLogs({abi:h.abi,event:w,eventName:"RightsChanged"})},da.AccessGroupOwner=async function({contractAddress:o}){return o=r(o),this.Log(`Retrieving owner of access group ${o}`),await this.authClient.Owner({address:o})},da.AccessGroupMembers=async function({contractAddress:o}){if(o=r(o),this.Log(`Retrieving members for group ${o}`),await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"})){const c=(await this.CallContractMethod({contractAddress:o,methodName:"membersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,h)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:o,methodName:"membersList",methodArgs:[h]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:o,methodName:"getMeta",methodArgs:["members"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},da.AccessGroupManagers=async function({contractAddress:o}){if(o=r(o),this.Log(`Retrieving managers for group ${o}`),await this.authClient.ContractHasMethod({contractAddress:o,methodName:"managersList"})){const c=(await this.CallContractMethod({contractAddress:o,methodName:"managersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,h)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:o,methodName:"managersList",methodArgs:[h]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:o,methodName:"getMeta",methodArgs:["managers"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},da.CreateAccessGroup=async function({name:o,description:u,metadata:c={},visibility:p=1}={}){this.Log(`Creating access group: ${o||""} ${u||""}`);let{contractAddress:h}=await this.authClient.CreateAccessGroup();h=this.utils.FormatAddress(h);const m=this.utils.AddressToObjectId(h),w=await this.userProfileClient.TenantContractId();this.Log(`Access group: ${h} ${m}`);const b=await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:m}),g={public:{name:o,description:u},name:o,description:u,...c};if(await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:m,writeToken:b.write_token,metadata:g}),await this.CallContractMethodAndWait({contractAddress:h,methodName:"setVisibility",methodArgs:[p]}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:m,writeToken:b.write_token,commitMessage:"Create access group"}),w){const S=await this.SetTenantContractId({contractAddress:h,tenantContractId:w});if(S.tenantId){let A=this.utils.HashToAddress(S.tenantId);await this.AddContentObjectGroupPermission({objectId:m,groupAddress:A,permission:"manage"})}else console.warn("No tenant ID associated with current tenant.")}return h},da.DeleteAccessGroup=async function({contractAddress:o}){throw Error("Not supported")},da.AccessGroupMembershipMethod=async function({contractAddress:o,memberAddress:u,methodName:c,eventName:p}){if(o=r(o),u=r(u),!this.utils.EqualAddress(this.signer.address,u)&&!await this.CallContractMethod({contractAddress:o,methodName:"hasManagerAccess",methodArgs:[this.utils.FormatAddress(this.signer.address)]}))throw Error("Manager access required");this.Log(`Calling ${c} on group ${o} for user ${u}`);const h=await this.CallContractMethodAndWait({contractAddress:o,methodName:c,methodArgs:[u],eventName:p,eventValue:"candidate"}),m=await this.ContractAbi({contractAddress:o}),w=this.ExtractValueFromEvent({abi:m,event:h,eventName:p,eventValue:"candidate"});if(this.utils.FormatAddress(w)!==this.utils.FormatAddress(u))throw console.error("Mismatch: "+w+" :: "+u),console.error("Is target user address wallet created?"),Error("Access group method "+c+" failed. Is target user address wallet created?");return h.transactionHash},da.AddAccessGroupMember=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u),await i({address:u,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"grantAccess",eventName:"MemberAdded"});if(!c){let h=await this.AccessGroupMembers({contractAddress:o});h.push(u),h=h.filter((m,w,b)=>b.indexOf(m)===w),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"members",metadata:h})}return p},da.RemoveAccessGroupMember=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u);const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"revokeAccess",eventName:"MemberRevoked"});if(!c){let h=await this.AccessGroupMembers({contractAddress:o});return h=h.filter(m=>m!==u),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"members",metadata:h})}return p},da.AddAccessGroupManager=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u),await i({address:u,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"grantManagerAccess",eventName:"ManagerAccessGranted"});if(!c){let h=await this.AccessGroupManagers({contractAddress:o});h.push(u),h=h.filter((m,w,b)=>b.indexOf(m)===w),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"managers",metadata:h})}return p},da.RemoveAccessGroupManager=async function({contractAddress:o,memberAddress:u}){if(o=r(o),u=r(u),!await this.authClient.ContractHasMethod({contractAddress:o,methodName:"managersList"})){let h=await this.AccessGroupManagers({contractAddress:o});h=h.filter(m=>m!==u),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"managers",metadata:h})}return await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"revokeManagerAccess",eventName:"ManagerAccessRevoked"})},da.ContentLibraryGroupPermissions=async function({libraryId:o,permissions:u=[]}){e(o);let c={};return!u||u.length===0?u=["accessor","contributor","reviewer"]:u=u.map(p=>{if(p=p.toLowerCase(),!["accessor","contributor","reviewer"].includes(p))throw Error(`Invalid permission: ${p}`);return p}),this.Log(`Retrieving ${u.join(", ")} group(s) for library ${o}`),await Promise.all(u.map(async p=>{let h=await this.CallContractMethod({contractAddress:this.utils.HashToAddress(o),methodName:p+"GroupsLength"});h=parseInt(h._hex,16),(await this.utils.LimitedMap(3,[...Array(h).keys()],async w=>{try{return this.utils.FormatAddress(await this.CallContractMethod({contractAddress:this.utils.HashToAddress(o),methodName:p+"Groups",methodArgs:[w]}))}catch(b){console.error(b)}})).forEach(w=>c[w]=[...c[w]||[],p].sort())})),c},da.AddContentLibraryGroup=async function({libraryId:o,groupAddress:u,permission:c}){if(e(o),u=r(u),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Adding ${c} group ${u} to library ${o}`),(await this.ContentLibraryGroupPermissions({libraryId:o,permissions:[c]}))[u])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const h=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:`add${c}Group`,methodArgs:[u]}),m=await this.ContractAbi({id:o});await this.ExtractEventFromLogs({abi:m,event:h,eventName:`${c}GroupAdded`})},da.RemoveContentLibraryGroup=async function({libraryId:o,groupAddress:u,permission:c}){if(e(o),u=r(u),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Removing ${c} group ${u} from library ${o}`),!(await this.ContentLibraryGroupPermissions({libraryId:o,permissions:[c]}))[u])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const h=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:`remove${c}Group`,methodArgs:[u]}),m=await this.ContractAbi({id:o});await this.ExtractEventFromLogs({abi:m,event:h,eventName:`${c}GroupRemoved`})},da.ContentObjectGroupPermissions=async function({objectId:o}){t(o),this.Log(`Retrieving group permissions for object ${o}`);const u=this.utils.HashToAddress(o),c=await this.Collection({collectionType:"accessGroups"});let p;switch(await this.AccessType({id:o})){case this.authClient.ACCESS_TYPES.OBJECT:p="getContentObjectRights";break;case this.authClient.ACCESS_TYPES.TYPE:p="getContentTypeRights";break;case this.authClient.ACCESS_TYPES.GROUP:p="getAccessGroupRights";break;case this.authClient.ACCESS_TYPES.LIBRARY:p="getLibraryRights"}const h={};return await Promise.all(c.map(async m=>{try{m=this.utils.FormatAddress(m);let w=await this.CallContractMethod({contractAddress:m,methodName:p,methodArgs:[u]});if(w===0)return;let b=[];w>=100&&b.push("manage"),w%100>=10&&b.push("access"),w%10>0&&b.push("see"),h[m]=b}catch(w){this.Log(`Failed to retrieve group permissions for ${m}`,!0),this.Log(w,!0)}})),h},da.AddContentObjectGroupPermission=async function({objectId:o,groupAddress:u,permission:c}){if(n("permission",c),t(o),u=r(u),this.utils.EqualAddress(u,this.utils.HashToAddress(o)))throw Error("Group rights cannot be set on the same group");if(c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Adding ${c} permission to group ${u} for ${o}`),await this.SetGroupPermission({groupAddress:u,objectId:o,permission:c})},da.RemoveContentObjectGroupPermission=async function({objectId:o,groupAddress:u,permission:c}){if(n("permission",c),t(o),u=r(u),c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Removing ${c} permission from group ${u} for ${o}`),await this.SetGroupPermission({groupAddress:u,objectId:o,permission:c,remove:!0})},da.LinkAccessGroupToOauth=async function({groupAddress:o,kmsId:u,oauthConfig:c}){r(o),n("kmsId",u),n("oauthConfig",c),typeof c=="string"&&(c=JSON.parse(c));const{publicKey:p}=await this.authClient.KMSInfo({kmsId:u}),h=`eluv.jwtv.${u}`,m=await this.Crypto.EncryptConk(c,p),w=`eluv.jwtv.iusr${this.utils.AddressToHash(this.signer.address)}`,b=await this.EncryptECIES({message:c}),g=this.utils.AddressToObjectId(o),S=(await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:g})).write_token;await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,metadataSubtree:h,metadata:m}),await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,metadataSubtree:w,metadata:b}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,commitMessage:"Bind access group to OAuth"}),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!1]}),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!0]})},da.UnlinkAccessGroupFromOauth=async function({groupAddress:o}){r(o),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!1]})},da}var Nr={},lP;function Goe(){if(lP)return Nr;lP=1;const n=Jl,{ValidateAddress:e,ValidateParameters:t,ValidatePresence:r,ValidateObject:i,ValidateVersion:o}=Ko,u=ki;Nr.ContractName=async function({contractAddress:p}){return p=e(p),await this.ethClient.ContractName(p)},Nr.ContractAbi=async function({contractAddress:p,id:h}){const m=await this.authClient.ContractInfo({address:p,id:h});if(!m)throw Error(`Unable to determine contract info for ${p}`);return m.abi},Nr.ContractInfo=async function({id:p,address:h}){return this.authClient.ContractInfo({id:p,address:h})},Nr.FormatContractArguments=function({abi:p,methodName:h,args:m}){return this.ethClient.FormatContractArguments({abi:p,methodName:h,args:m})},Nr.DeployContract=async function({abi:p,bytecode:h,constructorArgs:m,overrides:w={}}){return await this.ethClient.DeployContract({abi:p,bytecode:h,constructorArgs:m,overrides:w,signer:this.signer})},Nr.ContractEvents=async function({contractAddress:p,abi:h,fromBlock:m=0,toBlock:w,count:b=1e3,topics:g,includeTransaction:S=!1}){p=e(p),h||(h=await this.ContractAbi({contractAddress:p}));const A=await this.FormatBlockNumbers({fromBlock:m,toBlock:w,count:b});return this.Log(`Querying contract events ${p} - Blocks ${A.fromBlock} to ${A.toBlock}`),await this.ethClient.ContractEvents({contractAddress:p,abi:h,fromBlock:A.fromBlock,toBlock:A.toBlock,topics:g,includeTransaction:S})},Nr.CallContractMethod=async function({contractAddress:p,abi:h,methodName:m,methodArgs:w=[],value:b,overrides:g={},formatArguments:S=!0,cacheContract:A=!0,overrideCachedContract:k=!1}){return p=e(p),p=this.utils.FormatAddress(p),m==="setVisibility"&&this.visibilityInfo[p]&&delete this.visibilityInfo[p],h||(h=await this.ContractAbi({contractAddress:p})),await this.ethClient.CallContractMethod({contractAddress:p,abi:h,methodName:m,methodArgs:w,value:b,overrides:g,formatArguments:S,cacheContract:A,overrideCachedContract:k})},Nr.CallContractMethodAndWait=async function({contractAddress:p,abi:h,methodName:m,methodArgs:w,value:b,overrides:g={},formatArguments:S=!0,cacheContract:A=!0,overrideCachedContract:k=!1}){return p=e(p),p=this.utils.FormatAddress(p),m==="setVisibility"&&this.visibilityInfo[p]&&delete this.visibilityInfo[p],h||(h=await this.ContractAbi({contractAddress:p})),await this.ethClient.CallContractMethodAndWait({contractAddress:p,abi:h,methodName:m,methodArgs:w,value:b,overrides:g,formatArguments:S,cacheContract:A,overrideCachedContract:k})},Nr.ContractMetadata=async function({contractAddress:p,metadataKey:h}){r("contractAddress",p),r("metadataKey",h);try{const m=await this.CallContractMethod({contractAddress:p,methodName:"getMeta",methodArgs:[h]}),w=Buffer.from((m||"").replace("0x",""),"hex").toString("utf-8");try{return JSON.parse(w)}catch{return w}}catch{return""}},Nr.MergeContractMetadata=async function({contractAddress:p,metadataKey:h,metadata:m}){r("contractAddress",p),r("metadataKey",h);const w=await this.ContractMetadata({contractAddress:p,metadataKey:h})||{};typeof w=="object"&&(m={...w,...m}),await this.CallContractMethodAndWait({contractAddress:p,methodName:"putMeta",methodArgs:[h,JSON.stringify(m)]})},Nr.ReplaceContractMetadata=async function({contractAddress:p,metadataKey:h,metadata:m}){r("contractAddress",p),r("metadataKey",h),typeof m=="object"&&(m=JSON.stringify(m)),await this.CallContractMethodAndWait({contractAddress:p,methodName:"putMeta",methodArgs:[h,m]})},Nr.CustomContractAddress=async function({libraryId:p,objectId:h,versionHash:m}){if(t({libraryId:p,objectId:h,versionHash:m}),m&&(h=this.utils.DecodeVersionHash(m).objectId),p===this.contentSpaceLibraryId||this.utils.EqualHash(p,h))return;this.Log(`Retrieving custom contract address: ${h}`);const w=await this.ContractAbi({id:h}),b=await this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(h),abi:w,methodName:"contentContractAddress",methodArgs:[]});if(b!==this.utils.nullAddress)return this.utils.FormatAddress(b)},Nr.SetCustomContentContract=async function({libraryId:p,objectId:h,customContractAddress:m,name:w,description:b,abi:g,factoryAbi:S,overrides:A={}}){t({libraryId:p,objectId:h}),m=e(m),m=this.utils.FormatAddress(m),this.Log(`Setting custom contract address: ${h} ${m}`);const k=await this.ethClient.SetCustomContentContract({contentContractAddress:this.utils.HashToAddress(h),customContractAddress:m,overrides:A,signer:this.signer}),R=(await this.EditContentObject({libraryId:p,objectId:h})).write_token;return await this.ReplaceMetadata({libraryId:p,objectId:h,writeToken:R,metadataSubtree:"custom_contract",metadata:{name:w,description:b,address:m,abi:g,factoryAbi:S}}),await this.FinalizeContentObject({libraryId:p,objectId:h,writeToken:R,commitMessage:"Set custom contract"}),k},Nr.ExtractEventFromLogs=function({abi:p,event:h,eventName:m}){return this.ethClient.ExtractEventFromLogs({abi:p,event:h,eventName:m})},Nr.ExtractValueFromEvent=function({abi:p,event:h,eventName:m,eventValue:w}){const b=this.ethClient.ExtractEventFromLogs({abi:p,event:h,eventName:m,eventValue:w});return b?b.args[w]:void 0},Nr.FormatBlockNumbers=async function({fromBlock:p,toBlock:h,count:m=10}){const w=await this.BlockNumber();return h?p||(p=h-m+1):p?h=p+m-1:(h=w,p=h-m+1),h>w&&(h=w),p<0&&(p=0),{fromBlock:p,toBlock:h}},Nr.Events=async function({toBlock:p,fromBlock:h,count:m=10,includeTransaction:w=!1}={}){const b=await this.FormatBlockNumbers({fromBlock:h,toBlock:p,count:m});return this.Log(`Querying events - Blocks ${b.fromBlock} to ${b.toBlock}`),await this.ethClient.Events({fromBlock:b.fromBlock,toBlock:b.toBlock,includeTransaction:w})},Nr.BlockNumber=async function(){return await this.ethClient.MakeProviderCall({methodName:"getBlockNumber"})},Nr.GetBalance=async function({address:p}){p=e(p);const h=await this.ethClient.MakeProviderCall({methodName:"getBalance",args:[p]});return n.utils.formatEther(h)},Nr.SendFunds=async function({recipient:p,ether:h}){return p=e(p),await(await this.signer.sendTransaction({to:p,value:n.utils.parseEther(h.toString())})).wait()};const c=async function({contractAddress:p,objectId:h,versionHash:m}){if(p)e(p),h=u.AddressToObjectId(p);else if(m)o(m),h=this.utils.DecodeVersionHash(m).objectId,p=u.HashToAddress(h);else if(h)i(h),p=u.HashToAddress(h);else throw Error("contractAddress or objectId or versionHash not specified");return{contractAddress:p,objectId:h}};return Nr.TenantId=async function({contractAddress:p,objectId:h,versionHash:m}){objectInfo=await c({contractAddress:p,objectId:h,versionHash:m}),p=objectInfo.contractAddress,h=objectInfo.objectId;let w;try{if(await this.authClient.ContractHasMethod({contractAddress:p,methodName:"getMeta"})&&(w=await this.ContractMetadata({contractAddress:p,metadataKey:"_tenantId"})),w===void 0){const g=await this.ContentObjectLibraryId({objectId:h});w=await this.ContentObjectMetadata({libraryId:g,objectId:h,metadataSubtree:"tenantId"})}return w}catch{return""}},Nr.TenantContractId=async function({contractAddress:p,objectId:h,versionHash:m}){objectInfo=await c({contractAddress:p,objectId:h,versionHash:m}),p=objectInfo.contractAddress,h=objectInfo.objectId;try{const w=await this.authClient.ContractHasMethod({contractAddress:p,methodName:"getMeta"});let b;if(w&&(b=await this.ContractMetadata({contractAddress:p,metadataKey:"_ELV_TENANT_ID"})),b===void 0){const g=await this.ContentObjectLibraryId({objectId:h});b=await this.ContentObjectMetadata({libraryId:g,objectId:h,metadataSubtree:"tenantContractId"})}return b}catch{return""}},Nr.SetTenantId=async function({contractAddress:p,objectId:h,versionHash:m,tenantId:w}){objectInfo=await c({contractAddress:p,objectId:h,versionHash:m}),p=objectInfo.contractAddress,h=objectInfo.objectId;const b=await this.authClient.AccessType(h);if(b!==this.authClient.ACCESS_TYPES.GROUP&&b!==this.authClient.ACCESS_TYPES.WALLET&&b!==this.authClient.ACCESS_TYPES.LIBRARY&&b!==this.authClient.ACCESS_TYPES.TYPE&&b!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${h},
330
330
  applicable only for wallet,group, library or content_type object.`);if(i(w),!w.startsWith("iten")||!u.ValidHash(w))throw Error(`Invalid tenant ID: ${w}`);if(await this.authClient.AccessType(w)!==this.authClient.ACCESS_TYPES.GROUP)throw Error("Invalid tenant ID: "+w);if(tenantContractId=await this.TenantContractId({objectId:w}),tenantContractId)return await this.SetTenantContractId({contractAddress:p,objectId:h,versionHash:m,tenantContractId});throw Error("Invalid tenantId: tenant contract id not found")},Nr.SetTenantContractId=async function({contractAddress:p,objectId:h,versionHash:m,tenantContractId:w}){objectInfo=await c({contractAddress:p,objectId:h,versionHash:m}),p=objectInfo.contractAddress,h=objectInfo.objectId;const b=await this.authClient.AccessType(h);if(b!==this.authClient.ACCESS_TYPES.GROUP&&b!==this.authClient.ACCESS_TYPES.WALLET&&b!==this.authClient.ACCESS_TYPES.LIBRARY&&b!==this.authClient.ACCESS_TYPES.TYPE&&b!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${h},
@@ -376,4 +376,4 @@ ${o.length}${o}`,"utf-8")),p=vd.utils.recoverAddress(c,i);return{type:t,message:
376
376
  top=${m},
377
377
  left=${h}
378
378
  `);return w&&window.focus&&w.focus(),w};Ph.ActionPopup=async({mode:n="tab",url:e,onMessage:t,onCancel:r})=>{await new Promise(i=>{const o=n==="popup"?Dde({url:e,title:"Eluvio Media Wallet",w:500,h:850}):window.open(e),u=setInterval(async()=>{o.closed&&(clearInterval(u),r&&await r(),i())},1e3);window.addEventListener("message",async c=>{await t(c,()=>{clearInterval(u),o.close(),i()})})})};var tn={},FP;function Ude(){if(FP)return tn;FP=1;const n=ki,e=rs,{FormatNFTDetails:t,FormatNFTMetadata:r,FormatNFT:i}=Ph,o=CF();return tn.UserInfo=function(){if(this.loggedIn)return{name:this.__authorization.email||this.UserAddress(),address:this.UserAddress(),email:this.__authorization.email,walletType:this.__authorization.walletType,walletName:this.__authorization.walletName}},tn.UserAddress=function(){if(this.loggedIn)return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr},tn.UserWalletBalance=async function(u=!1){if(!this.loggedIn)return;const{balance:c,usage_hold:p,payout_hold:h,locked_offer_balance:m,stripe_id:w,stripe_payouts_enabled:b}=await this.client.utils.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","bal"),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})),g=w,S=b,A=parseFloat(c||0),k=parseFloat(m||0),R=Math.max(0,A-parseFloat(p||0)-k),N=Math.max(0,A-R),P=Math.max(0,A-parseFloat(Math.max(h,k)||0));if(u&&w&&!b){const V=new URL(e(window.location.origin,window.location.pathname)).toString();return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","onb","stripe"),method:"POST",body:{country:"US",mode:this.mode,refresh_url:V.toString(),return_url:V.toString()},headers:{Authorization:`Bearer ${this.AuthToken()}`}}),await this.UserWalletBalance(!1)}let q={totalWalletBalance:A,availableWalletBalance:R,lockedWalletBalance:k,pendingWalletBalance:N,withdrawableWalletBalance:P};return S&&(q.userStripeId=g,q.userStripeEnabled=S),q},tn.UserItemNames=async function({marketplaceParams:u,userAddress:c}={}){let p=[];return u&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),c&&p.push(`wlt:eq:${n.FormatAddress(c)}`),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","names"),method:"GET",queryParams:{filter:p}}))},tn.UserItemEditionNames=async function({displayName:u}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","editions"),method:"GET",queryParams:{filter:`meta/display_name:eq:${u}`}}))},tn.UserItemAttributes=async function({marketplaceParams:u,displayName:c,userAddress:p}={}){let h=[];return u&&h.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),p&&h.push(`wlt:eq:${n.FormatAddress(p)}`),c&&h.push(`meta/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","attributes"),method:"GET",queryParams:{filter:h}}))).map(({trait_type:w,values:b})=>({name:w,values:b})).filter(({name:w})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(w))},tn.UserItems=async function({sortBy:u="default",includeFullMetadata:c=!1}={}){return c&&this.loggedIn?this.FilteredQuery({mode:"owned-full-meta",sortBy:u,...arguments[0]||{}}):this.FilteredQuery({mode:"owned",sortBy:u,...arguments[0]||{}})},tn.UserListings=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,marketplaceParams:w}={}){return(await this.FilteredQuery({mode:"listings",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),marketplaceParams:w,contractAddress:h,tokenId:m,includeCheckoutLocked:!0})).results},tn.UserSales=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"sales",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),startTime:w,endTime:b,lastNDays:g,marketplaceParams:S,contractAddress:h,tokenId:m})).results},tn.UserTransfers=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"transfers",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),marketplaceParams:S,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g})).results},tn.TenantConfiguration=async function({tenantId:u,contractAddress:c}){try{return c=c?n.FormatAddress(c):void 0,this.tenantConfigs[c||u]||(this.tenantConfigs[c||u]=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:c?e("as","config","nft",c):e("as","config","tnt",u),method:"GET"}))),this.tenantConfigs[c||u]}catch(p){return this.Log("Failed to load tenant configuration",!0,p),{}}},tn.ExchangeRate=async function({currency:u}){if(!u)throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","xr","ebanx",u),method:"GET"}))},tn.TenantCSS=async function({tenantSlug:u}){return this.cachedCSS[u]||(this.cachedCSS[u]=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("/public","asset_metadata","tenants",u,"info","branding","wallet_css"),authorizationToken:this.publicStaticToken})),this.cachedCSS[u]||""},tn.MarketplaceStock=async function({marketplaceParams:u,tenantId:c}){return c||(c=this.MarketplaceInfo({marketplaceParams:u}).tenantId),this.loggedIn?await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","nft","info",c),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","stock",c),method:"GET"}))},tn.MarketplaceInfo=function({marketplaceParams:u}){let{tenantSlug:c,marketplaceSlug:p,marketplaceId:h,marketplaceHash:m}=u||{},w;if(c&&p?w=(this.availableMarketplaces[c]||{})[p]:(h=m?this.client.utils.DecodeVersionHash(m).objectId:h,w=this.availableMarketplacesById[h]),!w)throw Error(`Eluvio Wallet Client: Unable to find marketplace with parameters ${JSON.stringify(arguments)}`);return w},tn.MarketplaceCSS=async function({marketplaceParams:u}){const p=this.MarketplaceInfo({marketplaceParams:u}).marketplaceHash;return this.cachedCSS[p]||(this.cachedCSS[p]=await this.client.ContentObjectMetadata({versionHash:p,metadataSubtree:"public/asset_metadata/info/branding/custom_css",authorizationToken:this.publicStaticToken,noAuth:!0})),this.cachedCSS[p]||""},tn.AvailableMarketplaces=async function({organizeById:u,forceReload:c=!1}={}){return c&&await this.LoadAvailableMarketplaces(!0),{...u?this.availableMarketplacesById:this.availableMarketplaces}},tn.Marketplace=async function({marketplaceParams:u}){return this.LoadMarketplace(u)},tn.NFTContractStats=async function({contractAddress:u}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",u),method:"GET"}))},tn.NFT=async function({tokenId:u,contractAddress:c}){let p=t(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",c,u),method:"GET"})));const h=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:"public/asset_metadata/nft",produceLinkUrls:!0})||{};if(p.metadata=o({},h,p.metadata,(m,w)=>w===null||w===""?m:void 0),this.localization){const m=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:e("public","asset_metadata","localizations",this.localization,"nft"),produceLinkUrls:!0})||{};p.metadata=o({},p.metadata,m,(w,b)=>b===null||b===""?w:void 0)}return p.config=await this.TenantConfiguration({contractAddress:c}),r(this,p)},tn.TransferNFT=async function({contractAddress:u,tokenId:c,targetAddress:p}){if(!p||!n.ValidAddress(p))throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","xfer"),method:"POST",body:{contract:n.FormatAddress(u),token:c,to_addr:n.FormatAddress(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.ListingStatus=async function({listingId:u}){try{return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","status",u),method:"GET"}))}catch(c){if(c.status===404)return;throw c}},tn.Listing=async function({listingId:u}){return i(this,await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","l",u),method:"GET"})))},tn.Listings=async function(){return this.FilteredQuery({mode:"listings",...arguments[0]||{}})},tn.ListingStats=async function(){return this.FilteredQuery({mode:"listing-stats",...arguments[0]||{}})},tn.Sales=async function(){return this.FilteredQuery({mode:"sales",...arguments[0]||{}})},tn.Transfers=async function(){return this.FilteredQuery({mode:"transfers",...arguments[0]||{}})},tn.SalesStats=async function(){return this.FilteredQuery({mode:"sales-stats",...arguments[0]||{}})},tn.Leaderboard=async function({userAddress:u,marketplaceParams:c}){if(u){let p={addr:n.FormatAddress(u)};return c&&(p.filter=[`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:c})).tenantId}`]),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","ranks"),method:"GET",queryParams:p}))||[])[0]}return this.FilteredQuery({mode:"leaderboard",...arguments[0]||{}})},tn.CreateListing=async function({contractAddress:u,tokenId:c,price:p,listingId:h}){return u=n.FormatAddress(u),h?await n.ResponseToFormat("text",await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"PUT",body:{id:h,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"POST",body:{contract:u,token:c,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.RemoveListing=async function({listingId:u}){await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt",u),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.SalesNames=async function({marketplaceParams:u}){let c;return u&&(c=(await this.MarketplaceInfo({marketplaceParams:u})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names","hst"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},tn.ListingNames=async function({marketplaceParams:u}){let c;return u&&(c=(await this.MarketplaceInfo({marketplaceParams:u})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},tn.ListingEditionNames=async function({displayName:u}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","editions"),queryParams:{filter:`nft/display_name:eq:${u}`},method:"GET"}))},tn.ListingAttributes=async function({marketplaceParams:u,displayName:c}={}){let p=[];return u&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),c&&p.push(`nft/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","attributes"),method:"GET",queryParams:{filter:p}}))).map(({trait_type:m,values:w})=>({name:m,values:w})).filter(({name:m})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(m))},tn.ClaimGift=async function({code:u}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","gifts","claim"),body:{otp_code:u},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.ClaimItem=async function({marketplaceParams:u,sku:c,email:p}){const h=await this.MarketplaceInfo({marketplaceParams:u});await this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","act",h.tenant_id),body:{op:"nft-claim",sid:h.marketplaceId,sku:c,email:p},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.PurchaseItem=async function({marketplaceParams:u,sku:c,confirmationId:p,successUrl:h,cancelUrl:m}){const w=await this.MarketplaceInfo({marketplaceParams:u});window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:w.marketplaceId,parameters:{sku:c,confirmationId:p,successUrl:h,cancelUrl:m,login:!0,auth:this.ClientAuthToken()}})},tn.PurchaseListing=async function({marketplaceParams:u,listingId:c,confirmationId:p,successUrl:h,cancelUrl:m}){let w;u&&(w=await this.MarketplaceInfo({marketplaceParams:u})),window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:w&&w.marketplaceId,parameters:{listingId:c,confirmationId:p,successUrl:h,cancelUrl:m,login:!0,auth:this.ClientAuthToken()}})},tn.ListingPurchaseStatus=async function({listingId:u,confirmationId:c}){try{const p=await this.ListingStatus({listingId:u});if(!p)throw Error("Unable to find info for listing "+u);return(await this.MintingStatus({tenantId:p.tenant})).find(m=>m.op==="nft-transfer"&&m.extra&&m.extra[0]===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.PurchaseStatus=async function({marketplaceParams:u,confirmationId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u});return(await this.MintingStatus({tenantId:p.tenantId})).find(m=>m.op==="nft-buy"&&m.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.ClaimStatus=async function({marketplaceParams:u,sku:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u});return(await this.MintingStatus({tenantId:p.tenantId})).find(m=>m.op==="nft-claim"&&m.marketplaceId===p.marketplaceId&&m.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.GiftClaimStatus=async function({marketplaceParams:u,confirmationId:c,giftId:p}){try{const h=await this.MarketplaceInfo({marketplaceParams:u}),w=(await this.MintingStatus({tenantId:h.tenantId})).filter(b=>b.op==="nft-transfer"&&(c&&b.confirmationId===c||p&&b.giftId===p))||{status:"none"};return w.length===0?{status:"none"}:w.find(b=>b.status==="failed")?{status:"failed",op:"nft-transfer",transfer_statuses:w}:w.find(b=>b.status!=="complete")?{status:"pending",op:"nft-transfer",transfer_statuses:w}:{status:"complete",op:"nft-transfer",transfer_statuses:w,items:w.map(b=>({token_addr:b.address,token_id_str:b.tokenId}))}}catch(h){return this.Log(h,!0),{status:"unknown"}}},tn.EntitlementClaimStatus=async function({marketplaceParams:u,purchaseId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u}),m=(await this.MintingStatus({tenantId:p.tenantId})).filter(w=>w.op==="nft-claim-entitlement"&&c&&c==w.confirmationId)||{status:"none"};return m.length===0?{status:"none"}:m.find(w=>w.status==="complete")?{status:"complete",op:"nft-claim-entitlement",items:[{token_addr:m[0].address,token_id:m[0].tokenId}]}:m.find(w=>w.status==="error")?{status:"error",op:"nft-claim-entitlement"}:{status:"pending",op:"nft-claim-entitlement"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.PackOpenStatus=async function({contractAddress:u,tokenId:c}){try{const p=await this.TenantConfiguration({contractAddress:u});return(await this.MintingStatus({tenantId:p.tenant})).find(m=>m.op==="nft-open"&&n.EqualAddress(u,m.address)&&m.tokenId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.CollectionRedemptionStatus=async function({marketplaceParams:u,confirmationId:c}){try{return(await this.MintingStatus({marketplaceParams:u})).find(h=>h.op==="nft-redeem"&&h.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.RedeemableOfferStatus=async function({tenantId:u,marketplaceParams:c,contractAddress:p,tokenId:h,offerId:m}){try{const w=await this.MintingStatus({marketplaceParams:c,tenantId:u});return p=n.FormatAddress(p),w.find(b=>b.op==="nft-offer-redeem"&&n.EqualAddress(b.address,p)&&b.tokenId===(h||"").toString()&&b.offerId===(m||"").toString())||{status:"none"}}catch(w){return this.Log(w,!0),{status:"unknown"}}},tn.RedeemableCustomFulfillmentInfo=async function({redeemableTransactionId:u}){return await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:e("code-fulfillment",this.network==="main"?"main":"demov3","fulfill",u),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.LoadDrop=async function({tenantSlug:u,eventSlug:c,dropId:p}){if(this.drops||(this.drops={}),this.drops[u]||(this.drops[u]={}),this.drops[u][c]||(this.drops[u][c]={}),!this.drops[u][c][p]){const h=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("public","asset_metadata","tenants",u,"sites",c,"info"),resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,produceLinkUrls:!0,select:[".","drops"],noAuth:!0})||[],m=n.DecodeVersionHash(h["."].source).objectId;h.drops.forEach(w=>{w={...w,eventId:m},this.drops[u][c][w.uuid]=w,this.drops[w.uuid]=w})}return this.drops[p]},tn.SubmitDropVote=async function({marketplaceParams:u,eventId:c,dropId:p,sku:h}){const m=await this.MarketplaceInfo({marketplaceParams:u});await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",m.tenant_id),method:"POST",body:{op:"vote-drop",evt:c,id:p,itm:h},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.DropStatus=async function({marketplace:u,eventId:c,dropId:p}){try{return(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",u.tenant_id,c,p),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).sort((m,w)=>m.ts>w.ts?1:-1)[0]||{status:"none"}}catch(h){return this.Log(h,!0),""}},tn.MarketplaceOffers=async function({contractAddress:u,tokenId:c,buyerAddress:p,sellerAddress:h,statuses:m,start:w=0,limit:b=10}){let g=e("as","mkt","offers","ls");p?g=e(g,"b",n.FormatAddress(p)):h&&(g=e(g,"s",n.FormatAddress(h))),u&&(g=e(g,"c",n.FormatAddress(u)),c&&(g=e(g,"t",c)));let S={start:w,limit:b};return m&&m.length>0&&(S.include=m.join(",")),(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:g,method:"GET",queryParams:S}))).map(k=>({...k,created:k.created*1e3,updated:k.updated*1e3,expiration:k.expiration*1e3}))},tn.CreateMarketplaceOffer=async function({contractAddress:u,tokenId:c,offerId:p,price:h,expiresAt:m}){let w;return p?w=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",p),method:"PUT",body:{price:h,expiration:Math.floor(m/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):w=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",u,c),method:"POST",body:{contract:u,token:c,price:h,expiration:Math.floor(m/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})),w.offer_id},tn.RemoveMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",u),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.AcceptMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","accept",u),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.RejectMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","decline",u),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.VoteStatus=async function({tenantId:u,votingEventId:c}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.CastVote=async function({tenantId:u,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c,p),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.RevokeVote=async function({tenantId:u,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c,p),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn}var eh={},BP;function Fde(){if(BP)return eh;BP=1;const n=ki,e=rs,t=({network:i,path:o})=>e(i==="main"?"/main":"/dv3",o),r=({network:i,appId:o,userAddress:u,key:c,type:p,mode:h})=>t({network:i,path:e(p==="app"?"app":"usr",p==="app"?o:"",u,h==="public"?"pub":"pri",c||"")});return eh.ProfileMetadata=async function({type:i="app",mode:o="public",appId:u,userAddress:c,key:p}){try{const h=await this.stateStoreClient.Request({path:r({network:this.network,appId:u||this.appId,userAddress:c||this.UserAddress(),type:i,mode:o,key:p}),headers:o==="private"?{Authorization:`Bearer ${this.AuthToken()}`}:void 0});if(!h.ok)throw h;return(await n.ResponseToJson(h))[p]}catch(h){if(h.status===404)return;throw h}},eh.SetProfileMetadata=async function({type:i="app",mode:o="public",appId:u,key:c,value:p}){await this.stateStoreClient.Request({method:"POST",path:r({network:this.network,appId:u||this.appId,userAddress:this.UserAddress(),type:i,mode:o,key:c}),body:p,bodyType:typeof p=="object"?"JSON":"string",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},eh.RemoveProfileMetadata=async function({type:i="app",mode:o="public",appId:u,key:c}){await this.stateStoreClient.Request({method:"DELETE",path:r({network:this.network,appId:u||this.appId,userAddress:this.UserAddress(),type:i,mode:o,key:c}),headers:{Authorization:`Bearer ${this.AuthToken()}`}})},eh.Profile=async function({userAddress:i,userName:o}){if(o&&(i=await this.UserNameToAddress({userName:o})),!i)throw Error("Eluvio Wallet Client: Unable to determine profile - user address not specified");o||(o=await this.ProfileMetadata({type:"user",userAddress:i,key:"username"}));const u=await this.ProfileMetadata({type:"user",userAddress:i,key:"icon_url"});let c=await this.ProfileMetadata({type:"app",mode:"public",appId:"elv-badge-srv",userAddress:this.badgerAddress,key:`badges_${n.FormatAddress(i)}`}),p=[];if(c)try{c=JSON.parse(c).badges,p=Object.keys(c).map(h=>({...c[h],name:h}))}catch(h){this.Log(`Failed to load badge info for ${o||i}`,!0),this.Log(h,!0)}return{userAddress:n.FormatAddress(i),userName:o,imageUrl:u,badges:p}},eh.UserNameToAddress=async function({userName:i}){try{const o=await this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("usr","profile_for_username",i)})});if(!o.ok)throw o;return(await n.ResponseToJson(o)).address}catch(o){if(o.status!==404)throw o}},eh}var qv={},zP;function Bde(){if(zP)return qv;zP=1;const n=ki,e=rs,t=({network:r,path:i})=>e("/push",r==="main"?"/main":"/dv3",i);return qv.PushNotification=async function({tenantId:r,eventType:i,data:o,userAddress:u}){await this.stateStoreClient.Request({method:"POST",path:t({network:this.network,path:e("notify_user",u||this.UserAddress(),r,i)}),body:o,headers:{Authorization:`Bearer ${this.AuthToken()}`}})},qv.AddNotificationListener=async function({onMessage:r}){if(!r)throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");const i=new URL(this.stateStoreClient.BaseURI().toString());i.pathname=t({network:this.network,path:e("register",this.UserAddress(),this.AuthToken())});const o=new EventSource(i);return o.onmessage=u=>{let c=JSON.parse(u.data);try{c.data=JSON.parse(c.data)}catch{}r(c)},o},qv.Notifications=async function({tenantId:r,types:i,offsetId:o,limit:u=10}={}){let c={limit:u};r&&(c.tenant_id=r),i&&(c.types=Array.isArray(i)?i.join(","):i),o&&(c.offset_by=o);const{records:p}=await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("history",this.UserAddress())}),queryParams:c,headers:{Authorization:`Bearer ${this.AuthToken()}`}}));return p.map(h=>{try{h.data=JSON.parse(h.data)}catch{}return h})},qv}const{ElvClient:zde}=$4,bd=Pde,{LinkTargetHash:H8,FormatNFT:jde,ActionPopup:jP}=Ph,Hde=$d,pa=rs,ia=ki,$de=Jl,nb=typeof window<"u",qde=nb&&window.top!==window.self;let Ux=!1;try{typeof localStorage<"u"&&localStorage.getItem("test"),Ux=!0}catch{}class Od{constructor({appId:e,client:t,network:r,mode:i,localization:o,marketplaceInfo:u,previewMarketplaceHash:c,storeAuthToken:p}){this.appId=e,this.client=t,this.loggedIn=!1,this.localization=o,this.network=r,this.mode=i,this.purchaseMode=bd[r][i].purchaseMode,this.mainSiteLibraryId=bd[r][i].siteLibraryId,this.mainSiteId=bd[r][i].siteId,this.appUrl=bd[r][i].appUrl,this.publicStaticToken=t.staticToken,this.storeAuthToken=p,this.selectedMarketplaceInfo=u,this.previewMarketplaceId=c?ia.DecodeVersionHash(c).objectId:void 0,this.previewMarketplaceHash=c,this.availableMarketplaces={},this.availableMarketplacesById={},this.marketplaceHashes={},this.tenantConfigs={},this.stateStoreUrls=bd[r].stateStoreUrls,this.stateStoreClient=new Hde({uris:this.stateStoreUrls}),this.badgerAddress=bd[r].badgerAddress,this.cachedMarketplaces={},this.cachedCSS={},this.utils=t.utils,this.ForbiddenMethods=Od.ForbiddenMethods}Log(e,t=!1,r){t?console.error("Eluvio Wallet Client:",e):console.log("Eluvio Wallet Client:",e),r&&console.error(r)}static ForbiddenMethods(){return["constructor","Authenticate","AuthenticateOAuth","AuthenticateExternalWallet","AuthToken","ClientAuthToken","Initialize","Log","LogIn","LogOut","PersonalSign","SetAuthorization","SignMetamask"]}static AllowedMethods(){return Object.getOwnPropertyNames(Od.prototype).filter(e=>!Od.ForbiddenMethods().includes(e)).sort()}static async Initialize({client:e,appId:t="general",network:r="main",mode:i="production",localization:o,marketplaceParams:u,previewMarketplaceId:c,storeAuthToken:p=!0,skipMarketplaceLoad:h=!1}){let{tenantSlug:m,marketplaceSlug:w,marketplaceId:b,marketplaceHash:g}=u||{};if(bd[r]){if(!bd[r][i])throw Error(`ElvWalletClient: Invalid mode ${i}`)}else throw Error(`ElvWalletClient: Invalid network ${r}`);e||(e=await zde.FromNetworkName({networkName:r,assumeV3:!0}));let S=c;S&&!S.startsWith("hq__")&&(S=await e.LatestVersionHash({objectId:c}));const A=new Od({appId:t,client:e,network:r,mode:i,localization:o,marketplaceInfo:{tenantSlug:m,marketplaceSlug:w,marketplaceId:g?e.utils.DecodeVersionHash(g).objectId:b,marketplaceHash:g},previewMarketplaceHash:S,storeAuthToken:p});if(nb&&window.location&&window.location.href){let k=new URL(window.location.href);if(k.searchParams.get("elvToken"))await A.Authenticate({token:k.searchParams.get("elvToken")}),k.searchParams.delete("elvToken"),window.history.replaceState("","",k);else if(p&&Ux)try{let R=localStorage.getItem(`__elv-token-${r}`);R&&await A.Authenticate({token:R})}catch{}}return A.topLevelInfo=await e.utils.ResponseToJson(e.MakeAuthServiceRequest({path:"/as/mw/toplevel",queryParams:{env:i}})),h||await A.LoadAvailableMarketplaces(),A}CanSign(){return this.loggedIn?!!this.__authorization.clusterToken||nb&&!!(this.UserInfo().walletName.toLowerCase()==="metamask"&&window.ethereum&&window.ethereum.isMetaMask&&window.ethereum.chainId):!1}async PersonalSign({message:e}){if(!this.loggedIn)throw Error("ElvWalletClient: Unable to perform signature - Not logged in");if(this.CanSign()){if(this.__authorization.clusterToken)return e=typeof e=="object"?JSON.stringify(e):e,e=$de.utils.keccak256(Buffer.from(`Ethereum Signed Message:
379
- ${e.length}${e}`,"utf-8")),await this.client.authClient.Sign(e);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:e,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!nb)throw Error("ElvWalletClient: Unable to sign");const t={action:"personal-sign",message:e,logIn:!0};let r=new URL(this.appUrl);if(r.hash=pa("/action","sign",ia.B58(JSON.stringify(t))),r.searchParams.set("origin",window.location.origin),!qde&&window.location.origin===r.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(i,o)=>{await jP({mode:"tab",url:r.toString(),onCancel:()=>o("User cancelled sign"),onMessage:async(u,c)=>{if(!(!u||!u.data||u.data.type!=="FlowResponse"))try{i(u.data.response)}catch(p){o(p)}finally{c()}}})})}async LogInURL({mode:e="login",provider:t,marketplaceParams:r,clearLogin:i}){let o=new URL(this.appUrl);return o.hash="/login",o.searchParams.set("action","login"),typeof window<"u"&&o.searchParams.set("origin",window.location.origin),t&&o.searchParams.set("provider",t),e&&o.searchParams.set("mode",e),r?o.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:r})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&o.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),i&&o.searchParams.set("clear",""),o}async LogIn({method:e="redirect",provider:t,mode:r="login",callbackUrl:i,marketplaceParams:o,clearLogin:u=!1,callback:c}){let p=await this.LogInURL({mode:r,provider:t,marketplaceParams:o,clearLogin:u});e==="redirect"?(p.searchParams.set("response","redirect"),p.searchParams.set("source","origin"),p.searchParams.set("redirect",i),window.location=p):(p.searchParams.set("response","message"),p.searchParams.set("source","parent"),await new Promise(async(h,m)=>{await jP({mode:"tab",url:p.toString(),onCancel:()=>m("User cancelled login"),onMessage:async(w,b)=>{if(!(!w||!w.data||w.data.type!=="LoginResponse"))try{c?await c(w.data.params):await this.Authenticate({token:w.data.params.clientSigningToken||w.data.params.clientAuthToken}),h()}catch(g){m(g)}finally{b()}}})}))}async LogOut(){if(this.__authorization&&this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(e){this.Log("Failed to release token",!0,e)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},Ux)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:e}){let t;try{t=JSON.parse(this.utils.FromB58ToStr(e))||{}}catch{throw new Error("Invalid authorization token "+e)}if(!t.expiresAt||Date.now()>t.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return t.clusterToken&&await this.client.SetRemoteSigner({authToken:t.clusterToken,signerURIs:t.signerURIs}),this.client.SetStaticToken({token:t.fabricToken}),this.SetAuthorization({...t})}async AuthenticateOAuth({idToken:e,tenantId:t,email:r,signerURIs:i,shareEmail:o=!1,extraData:u={},nonce:c,createRemoteToken:p=!0,force:h=!1}){let m=24;!t&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),t=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:e,tenantId:t,signerURIs:i,extraData:{...u,share_email:o},unsignedPublicAuth:!0});let w,b;if(p&&this.client.signer.remoteSigner){b=Date.now()+24*60*60*1e3;const S=await this.client.signer.RetrieveCSAT({email:r,nonce:c,tenantId:t,force:h});w=S.token,c=S.nonce}else b=Date.now()+m*60*60*1e3,w=await this.client.CreateFabricToken({duration:m*60*60*1e3,context:r?{usr:{email:r}}:{}});const g=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!r)try{r=JSON.parse(this.utils.FromB64URL(e.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:w}),{authToken:this.SetAuthorization({fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:c}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",nonce:c})}}async AuthenticateExternalWallet({address:e,tokenDuration:t=24,walletName:r="Metamask",Sign:i}){e||(e=window.ethereum.selectedAddress),e=this.utils.FormatAddress(e),i||(i=async c=>this.SignMetamask({message:c,address:e}));const o=Date.now()+t*60*60*1e3,u=await this.client.CreateFabricToken({address:e,duration:t*60*60*1e3,Sign:i,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:u,address:e,expiresAt:o,walletType:"External",walletName:r,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:e,fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,signerURIs:c,walletType:p,walletName:h,nonce:m,register:w=!1}){i=this.client.utils.FormatAddress(i),this.__authorization={fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,walletType:p,walletName:h,nonce:m},e&&(this.__authorization.clusterToken=e,c&&(this.__authorization.signerURIs=c)),this.loggedIn=!0,this.cachedMarketplaces={};const b=this.ClientAuthToken();if(this.storeAuthToken&&Ux)try{localStorage.setItem(`__elv-token-${this.network}`,b)}catch{}return w&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(g=>{this.Log("Failed to register account: ",!0,g)}),b}async SignMetamask({message:e,address:t}){if(!nb||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");t=t||this.UserAddress();const r=await window.ethereum.request({method:"eth_requestAccounts"});if(t&&!ia.EqualAddress(r[0],t))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${t}, got ${r[0]}`);return await window.ethereum.request({method:"personal_sign",params:[e,t,""]})}FlowURL({type:e="flow",flow:t,marketplaceId:r,parameters:i={}}){const o=new URL(this.appUrl);return r?o.pathname=pa("/",e,t,"marketplace",r,ia.B58(JSON.stringify(i))):o.pathname=pa("/",e,t,ia.B58(JSON.stringify(i))),o.searchParams.set("origin",window.location.origin),o.toString()}async GenerateCodeAuth({url:e}={}){e||(e=await this.LogInURL({mode:"login"}),e.searchParams.set("response","code"),e.searchParams.set("source","code"));const t=await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:e.toString()}}));return t.code=t.id,t.url=t.url.startsWith("https://")?t.url:`https://${t.url}`,t.metamask_url=t.metamask_url.startsWith("https://")?t.metamask_url:`https://${t.metamask_url}`,t}async SetCodeAuth({code:e,address:t,type:r,authToken:i,expiresAt:o,...u}){await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","session",e),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:e,format:"auth_token",payload:JSON.stringify({addr:ia.FormatAddress(t),eth:t?`ikms${ia.AddressToHash(t)}`:"",type:r,token:i,expiresAt:o,...u})}}))}async GetCodeAuth({code:e,passcode:t}){try{return await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","redirect","metamask",e,t),method:"GET"}))}catch(r){if(r&&r.status===404)return;throw r}}async LoadAvailableMarketplaces(e=!1){if(!e&&Object.keys(this.availableMarketplaces)>0)return;const t=this.topLevelInfo.marketplaces;let r={...this.availableMarketplaces||{}},i={...this.availableMarketplacesById||{}};t.map(o=>{const u=ia.DecodeVersionHash(o.source_hash).objectId,c=o.slug||o.name;r[o.tenant_slug]=r[o.tenant_slug]||{},r[o.tenant_slug][c]={...o,tenantName:o.tenant_slug,tenantSlug:o.tenant_slug,tenantId:o.tenant_id,marketplaceSlug:c,marketplaceId:u,marketplaceHash:o.source_hash},i[u]=r[o.tenant_slug][c],this.marketplaceHashes[u]=o.source_hash}),this.availableMarketplaces=r,this.availableMarketplacesById=i}async LatestMarketplaceHash({marketplaceParams:e}){const t=await this.MarketplaceInfo({marketplaceParams:e});if(this.previewMarketplaceId&&ia.EqualHash(this.previewMarketplaceId,t.marketplaceId))return this.previewMarketplaceHash;const r=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug),resolveLinks:!1,noAuth:!0});return H8(r)}async LoadMarketplace(e){const t=this.MarketplaceInfo({marketplaceParams:e}),r=t.marketplaceId,i=await this.LatestMarketplaceHash({marketplaceParams:e});if(this.cachedMarketplaces[r]&&this.cachedMarketplaces[r].versionHash!==i&&delete this.cachedMarketplaces[r],!this.cachedMarketplaces[r]){let o;this.previewMarketplaceId&&ia.EqualHash(r,this.previewMarketplaceId)?o=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?pa("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):o=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"info"),localizationSubtree:this.localization?pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),o.branding.use_tenant_styling&&(o.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),o.items=await Promise.all(o.items.map(async(u,c)=>{if(u.requires_permissions){let p;this.loggedIn||(p=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:H8(u.nft_template),metadataSubtree:"permissioned",authorizationToken:p}),u.authorized=!0}catch{u.authorized=!1}}return u.nftTemplateMetadata=(u.nft_template||{}).nft||{},u.nftTemplateHash=((u.nft_template||{})["."]||{}).source,u.itemIndex=c,u})),o.collections=(o.collections||[]).map((u,c)=>({...u,collectionIndex:c})),o.retrievedAt=Date.now(),o.marketplaceId=r,o.versionHash=i,o.marketplaceHash=i,this.previewMarketplaceId&&r===this.previewMarketplaceId&&(o.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(u=>{try{if(o.storefront[u]){let c=new URL("https://embed.v3.contentfabric.io");const p=H8(o.storefront[u]);c.searchParams.set("p",""),c.searchParams.set("net",this.network==="main"?"main":"demo"),c.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),c.searchParams.set("vid",p),c.searchParams.set("ap",""),u.startsWith("reveal")||(c.searchParams.set("m",""),c.searchParams.set("lp","")),o.storefront[`${u}_embed_url`]=c.toString()}}catch{}}),this.cachedMarketplaces[r]=o}return this.cachedMarketplaces[r]}async FilteredQuery({mode:e="listings",sortBy:t="created",sortDesc:r=!1,filter:i,editionFilters:o,attributeFilters:u,contractAddress:c,tokenId:p,currency:h,marketplaceParams:m,tenantId:w,collectionIndexes:b,priceRange:g,tokenIdRange:S,capLimit:A,userAddress:k,sellerAddress:R,lastNDays:N=-1,startTime:P,endTime:q,includeCheckoutLocked:V=!1,start:de=0,limit:oe=50}={}){b=(b||[]).map(ne=>parseInt(ne));let he={start:de,limit:oe,sort_descending:r};e==="owned"&&t==="created"&&(t="default"),e!=="leaderboard"&&(he.sort_by=t),e.includes("listings")&&V&&(he.checkout=!0);let Se,Ce;m&&(Se=await this.MarketplaceInfo({marketplaceParams:m}),b.length>0&&(Ce=await this.Marketplace({marketplaceParams:m})));try{let ne=[];R?ne.push(`seller:eq:${this.client.utils.FormatAddress(R)}`):k&&e!=="owned"&&ne.push(`addr:eq:${this.client.utils.FormatAddress(k)}`),Ce&&b.length>=0?b.forEach(F=>{Ce.collections[F].items.forEach(Q=>{if(!Q)return;const ae=Ce.items.find(T=>T.sku===Q);if(!ae)return;const L=ia.SafeTraverse(ae,"nft_template","nft","address");L&&ne.push(`${e==="owned"?"contract_addr":"contract"}:eq:${ia.FormatAddress(L)}`)})}):(Se||w)&&ne.push(`tenant:eq:${Se?Se.tenantId:w}`),c?(e==="owned"?ne.push(`contract_addr:eq:${ia.FormatAddress(c)}`):ne.push(`contract:eq:${ia.FormatAddress(c)}`),p&&ne.push(`token:eq:${p}`)):i&&(e.includes("listing")?ne.push(`nft/display_name:eq:${i}`):e==="owned"?ne.push(`meta/display_name:eq:${i}`):ne.push(`name:eq:${i}`)),o&&o.forEach(F=>{e.includes("listing")?ne.push(`nft/edition_name:eq:${F}`):e==="owned"?(ne.push(`meta:@>:{"edition_name":"${F}"}`),he.exact=!1):ne.push(`edition:eq:${F}`)}),u&&u.map(({name:F,value:H})=>{!F||!H||ne.push(`nft/attributes/${F}:eq:${H}`)}),h&&ne.push("link_type:eq:sol"),P||q?(P&&ne.push(`created:gt:${parseInt(P)/1e3}`),q&&ne.push(`created:lt:${parseInt(q)/1e3}`)):N&&N>0&&ne.push(`created:gt:${(Date.now()/1e3-N*24*60*60).toFixed(0)}`),g&&(g.min&&ne.push(`price:ge:${parseFloat(g.min)}`),g.max&&ne.push(`price:le:${parseFloat(g.max)}`)),S&&(S.min&&ne.push(`info/token_id:ge:${parseInt(S.min)}`),S.max&&ne.push(`info/token_id:le:${parseInt(S.max)}`)),A&&ne.push(`info/cap:le:${parseInt(A)}`);let Le,C;switch(e){case"owned":C=pa("as","wlt",k||this.UserAddress());break;case"owned-full-meta":C=pa("as","apigw","nfts"),Le={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":C=pa("as","mkt","f");break;case"transfers":C=pa("as","mkt","hst","f"),ne.push("action:eq:TRANSFERRED"),ne.push("action:eq:SOLD");break;case"sales":C=pa("as","mkt","hst","f"),ne.push("action:eq:SOLD"),ne.push("seller:co:0x");break;case"listing-stats":C=pa("as","mkt","stats","listed");break;case"sales-stats":C=pa("as","mkt","stats","sold"),ne.push("seller:co:0x");break;case"leaderboard":C=pa("as","wlt","leaders");break}if(ne.length>0&&(he.filter=ne),e.includes("stats"))return await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:he,headers:Le}));const{contents:x,paging:O}=await ia.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:he,headers:Le}))||[],z=["owned","listings","owned-full-meta"];return{paging:{start:he.start,limit:he.limit,total:O.total,more:O.total>de+oe},results:(x||[]).map(F=>z.includes(e)?jde(this,F):F)}}catch(ne){if(ne.status&&ne.status.toString()==="404")return{paging:{start:he.start,limit:he.limit,total:0,more:!1},results:[]};throw ne}}async MintingStatus({marketplaceParams:e,tenantId:t}){t||(t=(await this.MarketplaceInfo({marketplaceParams:e||this.selectedMarketplaceInfo})).tenantId);try{return(await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","status","act",t),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(i=>{let[o,u,c]=i.op.split(":");u=u.startsWith("0x")?ia.FormatAddress(u):u;let p,h,m,w;if(o==="nft-buy"?p=c:o==="nft-claim"?(p=c,i.marketplaceId=u,i.extra&&i.extra[0]&&(u=i.extra.token_addr,h=i.extra.token_id_str)):o==="nft-redeem"?p=i.op.split(":").slice(-1)[0]:h=c,o==="nft-transfer"&&(p=i.extra&&i.extra.trans_id,h=i.extra&&i.extra.token_id_str||h,i.extra&&i.extra.gift_action==="nft-gift-claim"&&(w=i.extra.gift_id)),o==="nft-offer-redeem"&&(m=i.op.split(":")[3]),o==="nft-claim-entitlement"){let[b,g,S,A]=i.op.split(":");p=A,i.extra&&i.extra[0]&&(u=i.extra[0].token_addr,h=i.extra[0].token_id,u=u.startsWith("0x")?ia.FormatAddress(u):u,i.marketplaceId=g)}return{...i,timestamp:new Date(i.ts),state:i.state&&typeof i.state=="object"?Object.values(i.state):i.state,extra:i.extra&&typeof i.extra=="object"?Object.values(i.extra):i.extra,confirmationId:p,op:o,address:ia.FormatAddress(u),tokenId:h,offerId:m,giftId:w}}).sort((i,o)=>i.ts<o.ts?1:-1)}catch(r){return this.Log("Failed to retrieve minting status",!0,r),[]}}async DeployTenant({tenantId:e,tenantSlug:t="",tenantHash:r,environment:i="production"}){if(!r){const c=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("public/asset_metadata/tenants",t),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!c)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${t}`);const p=c["."].source;r=await this.client.LatestVersionHash({versionHash:p})}const o={content_hash:r,env:i,ts:Date.now()},u=await this.client.Sign(JSON.stringify(o));await this.client.authClient.MakeAuthServiceRequest({path:pa("as","tnt","config",e,"metadata"),method:"POST",body:o,headers:{Authorization:`Bearer ${u}`}})}}Object.assign(Od.prototype,Ude());Object.assign(Od.prototype,Fde());Object.assign(Od.prototype,Bde());const{ElvClient:Vde}=$4,Gde=ki;var Wde=Vde,Dd=Gde;const Lz=Object.freeze(Object.defineProperty({__proto__:null,ElvClient:Wde,Utils:Dd},Symbol.toStringTag,{value:"Module"})),HP={default:{label:"Default",hlsSettings:Dd.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Kde{constructor({player:e}){this.player=e,this.visible=!0,this.allowRotation=!0,this._activeMenus=0}__ToggleMenu(e){this._activeMenus=e?this._activeMenus+1:Math.max(0,this._activeMenus-1),this.player.__SettingsUpdate()}IsVisible(){return this.visible}IsMenuVisible(){return this._activeMenus>0}IsReady(){return!this.player.loading}IsPlaying(){return this.player.casting?this.player.castHandler.IsPlaying():!this.player.video.paused}HasPlaybackStarted(){return this.player.playbackStarted}async Play(){return this.player.casting?this.player.castHandler.Play():await this.player.__Play()}Pause(){if(this.player.casting)return this.player.castHandler.Pause();this.player.video.pause()}TogglePlay(){return this.player.casting?this.player.castHandler.TogglePlay():this.player.video.paused?(this.Play(),!0):(this.Pause(),!1)}Stop(){if(this.player.casting)return this.player.castHandler.Stop();this.Pause(),this.Seek({time:0}),this.player.playbackStarted=!1,this.player.__SettingsUpdate()}GetCurrentTime(){return this.player.casting?this.player.castHandler.GetCurrentTime():this.player.video.currentTime}GetDuration(){return this.player.casting?this.player.castHandler.GetDuration():this.player.video.duration}Seek({fraction:e,time:t,relativeSeconds:r}){if(this.player.casting)return this.player.castHandler.Seek({fraction:e,time:t,relativeSeconds:r});if(!this.player.video||e&&!this.player.video.duration)return;this.player.canPlay||(this.Play(),this.Pause());const i=this.player.video.currentTime;return r?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+r)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,i<=this.player.video.currentTime}GetVolume(){return this.player.casting?this.player.castHandler.GetVolume():this.player.video.volume}SetVolume({fraction:e,relativeFraction:t}){return this.player.casting?this.player.castHandler.SetVolume({fraction:e,relativeFraction:t}):(t?this.player.video.volume=Math.min(1,Math.max(0,this.GetVolume()+t)):this.player.video.volume=e,this.player.video.volume>0&&this.Unmute(!1),this.player.video.volume)}IsMuted(){return this.player.casting?this.player.castHandler.IsMuted():this.player.video.muted}Mute(){if(this.player.casting)return this.player.castHandler.Mute();this.player.video.muted=!0}Unmute(){if(this.player.casting)return this.player.castHandler.Unmute();this.player.video.muted=!1}ToggleMuted(){return this.player.casting?this.player.castHandler.ToggleMuted():(this.player.video.muted=!this.player.video.muted,this.player.video.muted)}IsFullscreen(){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===this.player.target}Fullscreen(){this.player.target.requestFullscreen?this.player.target.requestFullscreen({navigationUI:"hide"}):this.player.target.mozRequestFullScreen?this.player.target.mozRequestFullScreen({navigationUI:"hide"}):this.player.target.webkitRequestFullscreen?this.player.target.webkitRequestFullscreen({navigationUI:"hide"}):this.player.target.msRequestFullscreen?this.player.target.msRequestFullscreen({navigationUI:"hide"}):this.player.target.querySelector("video").webkitEnterFullScreen()}ExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}ToggleFullscreen(){return this.IsFullscreen()?(this.ExitFullscreen(),!1):(this.Fullscreen(),!0)}GetCollectionInfo(){if(!this.player.collectionInfo)return;const e={...this.player.collectionInfo};return e.content=e.content.map(t=>({...t,active:t.mediaIndex===e.mediaIndex})),e.active=e.content[e.mediaIndex],e}CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:r}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.min(t.mediaIndex+1,t.mediaLength-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.max(0,t.mediaIndex-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}IsLive(){return this.player.isLive}GetContentInfo(){if(this.player.playerOptions.title!==!1){const e=this.GetCollectionInfo();if(e&&e.active)return{title:e.active.title||"",subtitle:e.active.title||"",description:e.active.description||"",image:e.active.image&&e.active.image.url||"",posterImage:e.active.poster_image&&e.active.poster_image.url||"",headers:e.active.headers||[]};if(this.player.sourceOptions.contentInfo)return{title:this.player.sourceOptions.contentInfo.title,subtitle:this.player.sourceOptions.contentInfo.subtitle,description:this.player.sourceOptions.contentInfo.description,image:this.player.sourceOptions.contentInfo.image,posterImage:this.player.sourceOptions.contentInfo.posterImage,headers:this.player.sourceOptions.contentInfo.headers||[]}}}GetQualityLevels(){let e=[];if(this.player.hlsPlayer){if(e=this.player.hlsPlayer.levels.map((t,r)=>({index:r,active:this.player.hlsPlayer.currentLevel===r&&!this.player.hlsPlayer.autoLevelEnabled,resolution:t.attrs.RESOLUTION,bitrate:t.bitrate,audioTrack:!t.videoCodec,label:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1),e.length>0){const t=e.find(r=>this.player.hlsPlayer.currentLevel===r.index);e.unshift({index:-1,label:"Auto",activeLabel:t?`Auto (${t.activeLabel})`:"Auto",active:this.player.hlsPlayer.autoLevelEnabled})}}else this.player.dashPlayer&&(e=this.player.dashPlayer.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:`${t.width}x${t.height}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1));return{options:e,active:e.find(t=>t.active)}}SetQualityLevel(e){this.player.hlsPlayer?(this.player.hlsPlayer.nextLevel=e,this.player.hlsPlayer.streamController.immediateLevelSwitch()):this.player.dashPlayer&&(this.player.dashPlayer.setQualityFor("video",e),this.player.dashPlayer.updateSettings({streaming:{trackSwitchMode:"alwaysReplace",buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0},abr:{autoSwitchBitrate:{video:e===-1}}}})),this.player.__SettingsUpdate()}GetAudioTracks(){let e=[];return this.player.nativeHLS?e=Array.from(this.player.video.audioTracks).map(t=>({index:t.id,label:t.label||t.language,active:t.enabled})):this.player.hlsPlayer?e=this.player.hlsPlayer.audioTracks.map(t=>({index:t.id,label:t.name,active:t.id===this.player.hlsPlayer.audioTrack})):this.player.dashPlayer&&(e=this.player.dashPlayer.getTracksFor("audio").map(t=>({index:t.index,label:t.labels&&t.labels.length>0?t.labels[0].text:t.lang,active:t.index===this.player.dashPlayer.getCurrentTrackFor("audio").index}))),{options:e,active:e.find(t=>t.active)}}SetAudioTrack(e){if(this.player.nativeHLS)Array.from(this.player.video.audioTracks).forEach(t=>t.enabled=e.toString()===t.id),this.Seek({time:this.GetCurrentTime()-.1});else if(this.player.hlsPlayer)this.player.hlsPlayer.audioTrack=e,this.player.hlsPlayer.streamController.immediateLevelSwitch();else if(this.player.dashPlayer){const t=this.player.dashPlayer.getTracksFor("audio").find(r=>r.index===e);this.player.dashPlayer.setCurrentTrack(t)}}GetTextTracks(){let e=[],t;return this.player.nativeHLS||this.player.hlsPlayer?(t=Array.from(this.player.video.textTracks).findIndex(r=>r.mode==="showing"),e=Array.from(this.player.video.textTracks).map((r,i)=>({index:i,label:r.label||r.language,language:r.language,active:r.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((r,i)=>({index:i,label:r.labels&&r.labels.length>0?r.labels[0].text:r.lang,language:r.lang,active:i===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(r=>r.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(r=>r.mode="disabled"),e>=0&&(t[e].mode="showing")}else this.player.dashPlayer&&this.player.dashPlayer.setTextTrack(e);e>=0&&(this.__lastTextTrackIndex=e),setTimeout(()=>this.player.__SettingsUpdate(),500)}ToggleTextTrack(){const{active:e,options:t}=this.GetTextTracks();if(t.length!==0){if(e&&e.index>=0)return this.SetTextTrack(-1),!1;if(this.__lastTextTrackIndex>=0)return this.SetTextTrack(this.__lastTextTrackIndex),!0;for(const r of navigator.languages){const i=t.find(o=>o.language===r||o.language===r.split("-")[0]);if(i)return this.SetTextTrack(i.index),!0}return this.SetTextTrack(0),!0}}GetPlaybackRate(){return this.player.casting?this.player.castHandler.GetPlaybackRate():this.player.video.playbackRate||1}GetPlaybackRates(){const e=this.GetPlaybackRate();let t=["0.25","0.5","0.75","1","1.25","1.5","1.75","2"];this.player.casting&&(t=["0.5","0.75","1","1.25","1.5","1.75","2"]),t=t.map((i,o)=>({index:o,rate:parseFloat(i),label:`${i}x`,active:e.toFixed(2)===parseFloat(i).toFixed(2)}));let r=t.find(i=>i.active);return r||(r={index:-1,rate:this.GetPlaybackRate(),label:`${this.GetPlaybackRate()}x`,active:!0}),{options:t,active:r}}SetPlaybackRate({index:e,rate:t}){if(this.player.casting)return this.player.castHandler.SetPlaybackRate({index:e,rate:t});const r=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:r<=t};{const i=this.GetPlaybackRates().options[e];if(i)return this.player.video.playbackRate=i.rate,this.player.__SettingsUpdate(),{rate:i.rate,increase:r<=i.rate}}}IsDVRAvailable(){return this.player.dvrAvailable&&!this.player.casting&&isFinite(this.GetDuration())}IsDVREnabled(){return this.player.dvrEnabled}SetDVREnabled(e){const t=this.player.dvrEnabled;return this.player.dvrEnabled=this.IsDVRAvailable()&&e,this.player.__SettingsUpdate(),t&&!this.player.dvrEnabled&&this.Seek({time:this.GetDuration()-2}),this.player.dvrEnabled}GetPlayerProfiles(){let e=[];return this.player.hlsPlayer&&(e=Object.keys(HP).map(t=>({index:t,label:HP[t].label,active:this.player.playerOptions.playerProfile===t}))),{options:e,active:e.find(t=>t.active)}}SetPlayerProfile({profile:e,customOptions:t={}}){this.player.SetPlayerProfile({profile:e,customHLSOptions:t})}ShowPlayerProfileForm(){this.player.__showPlayerProfileForm=!0,this.player.__SettingsUpdate()}HidePlayerProfileForm(){this.player.__showPlayerProfileForm=!1,this.player.__SettingsUpdate()}ContentVerified(){return this.player.contentVerified||!1}GetContentVerificationDetails(){return this.player.contentAudit||!1}GetOptions(){let e={quality:this.GetQualityLevels(),audio:this.GetAudioTracks(),text:this.GetTextTracks(),profile:this.GetPlayerProfiles(),rate:this.GetPlaybackRates()};return e.hasQualityOptions=e.quality.options.length>0,e.hasAudioOptions=e.audio.options.length>0,e.hasTextOptions=e.text.options.length>0,e.hasProfileOptons=e.profile.options.length>0,e.hasRateOptions=!this.IsLive(),e.hasAnyOptions=e.hasQualityOptions||e.hasAudioOptions||e.hasTextOptions||e.hasProfileOptons||e.hasRateOptions,e}AllowRotation(){return this.allowRotation}SetAllowRotation(e){this.allowRotation=e,this.player.__SettingsUpdate()}IsRotatable(){return this.IsFullscreen()&&window.innerWidth<900&&window.innerHeight>window.innerWidth&&this.player.video.videoWidth>this.player.video.videoHeight}RegisterVideoEventListener(e,t){return this.player.__RegisterVideoEventListener(e,t)}RegisterSettingsListener(e){return this.player.__RegisterSettingsListener(e)}Reset(){this.player.Reset()}Destroy(){this.player.Destroy()}GetDebugInfo(){const e=JSON.parse(JSON.stringify(this.player.sourceOptions));delete e.playoutOptions;let t=this.player.__error&&JSON.parse(JSON.stringify(this.player.__error));return t&&Object.keys(t).length===0&&(t=this.player.__error.toString()),{appUrl:window.location.href,userAddress:this.player.userAddress,userAgent:navigator.userAgent,userLanguage:navigator.language,playoutUrl:this.player.playoutUrl,sourceOptions:e,error:t}}}const Pn={PLAY:"play",PAUSE:"pause",MUTE:"muted",UNMUTE:"unmuted",VOLUME_UP:"volumeup",VOLUME_DOWN:"volumedown",SEEK_BACK:"seekback",SEEK_FORWARD:"seekforward",PLAYBACK_RATE_UP:"playbackrateup",PLAYBACK_RATE_DOWN:"playbackratedown",SUBTITLES_ON:"subtitleson",SUBTITLES_OFF:"subtitlesoff",PLAY_NEXT:"playnext",PLAY_PREVIOUS:"playprevious"},Nz=({player:n,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:r=300})=>{let i,o,u,c;return window.addEventListener("focus",()=>{u=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(o),p.target===p.currentTarget&&p.currentTarget.contains(u)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-i<r){const h=p.target.getBoundingClientRect(),m=(p.clientX-h.left)/h.width;m<=t?(n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"})):m>=1-t?(n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"})):n.controls.ToggleFullscreen()}else o=setTimeout(()=>{const h=n.controls.TogglePlay();e({action:h?Pn.PLAY:Pn.PAUSE})},r);u=p.target,i=Date.now()}},Pz=(n,e)=>{let t=0;return()=>r=>{r.repeat||(t=0);const i=t<5?5:t<15?10:t<40?30:60;switch(r.key){case"ArrowLeft":r.preventDefault(),n.controls.Seek({relativeSeconds:-i}),e({action:Pn.SEEK_BACK,text:`${i} seconds`});break;case"ArrowRight":r.preventDefault(),n.controls.Seek({relativeSeconds:i}),e({action:Pn.SEEK_FORWARD,text:`${i} seconds`});break;default:return}t+=1}},Yde=n=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),n.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),n.controls.IsMuted()?n.controls.SetVolume({fraction:.05}):n.controls.SetVolume({relativeFraction:.05});break}},o2=(n,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=n>60*60,r=Math.floor(n/60/60),i=Math.floor(n/60%60),o=Math.floor(n%60);let u=`${i.toString().padStart(t?2:1,"0")}:${o.toString().padStart(2,"0")}`;return t&&(u=`${r.toString()}:${u}`),u},dk=async({player:n,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")))return e;if(e&&e.url)return e.url;const r=await n.__Client();let i;const{mediaCatalogObjectId:o,mediaCatalogVersionHash:u}=n.sourceOptions&&n.sourceOptions.mediaCollectionOptions||{},c=n.sourceOptions&&n.sourceOptions.playoutParameters||{};return u?i=u:o?i=await r.LatestVersionHash({objectId:o}):c.versionHash?i=c.versionHash:i=await r.LatestVersionHash({objectId:c.objectId}),i?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await r.FileUrl({versionHash:i,filePath:e.replace(/^files/,""),queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken}):await r.LinkUrl({versionHash:i,linkPath:e,queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken})):""},Iz=(n,e)=>{let t={};return Object.keys(n).forEach(r=>{if(typeof n[r]=="object"&&!Array.isArray(n[r]))t[r]=Iz(n[r],(e||{})[r]);else{const i=(e||{})[r];t[r]=typeof i<"u"?i:n[r]}}),t},Dz=n=>Iz($G,n),Jde=/iPhone|iPad|iPod/i.test(navigator.userAgent),$P=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),Qde={default:{label:"Default",hlsSettings:Dd.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class u2{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:r,SetErrorMessage:i}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new Kde({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.dvrAvailable=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=$P&&r.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Dt.controls.ON,Dt.controls.AUTO_HIDE].includes(r.playerOptions.controls),this.__error=void 0,this.SetErrorMessage=(o,u)=>{i(o),this.__error=u};try{r.playerOptions.hlsjsOptions&&Object.keys(r.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=r.playerOptions.hlsjsOptions,r.playerOptions.playerProfile=Dt.playerProfile.CUSTOM)}catch(o){this.Log(o,!0)}this.__Initialize(r)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>Lz);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.staticToken&&this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken}),this.clientOptions.client})(),await this.clientPromise),!this.__tokenResolved){const e=(this.sourceOptions.playoutParameters||{}).authorizationToken||this.clientOptions.client.staticToken;if(e)try{JSON.parse(Dd.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:7*24*60*60*1e3}))}catch{}this.__tokenResolved=!0}return this.userAddress=this.clientOptions.client.CurrentAccountAddress(),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const g=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(g.mediaHash).objectId,t.versionHash=g.mediaHash,this.sourceOptions.playoutOptions=void 0}let r,i,o={ignore_trimming:t.ignoreTrimming,resolve:t.resolve};if((t.clipStart||t.clipEnd)&&(o.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(o.clip_end=parseFloat(t.clipEnd))),!t.channel){let g=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(r=g.default?"default":Object.keys(g)[0],t.offering?r=g[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?r=t.offerings.find(A=>g[A]):t.offerings&&t.offerings.length>0&&(r=t.offerings.find(A=>g[A])),!r)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const S=g[r]&&g[r].properties||{};i=g[r].uri,this.sourceOptions.contentInfo.liveDVR===Dt.liveDVR.ON&&S.dvr_available?(o.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=S.live}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:i,options:o})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||r,options:o}));let u=(await e.AvailableDRMs()).filter(g=>(this.sourceOptions.drms||[]).includes(g)),c=this.sourceOptions.protocols,p,h;for(;!(p&&h);){p=c.find(S=>this.sourceOptions.playoutOptions[S]);const g=Object.keys(this.sourceOptions.playoutOptions[p].playoutMethods);if(h=(this.sourceOptions.drms||[]).length===0?g.find(S=>S!=="clear")||g[0]:this.sourceOptions.drms.sort().reverse().find(S=>u.includes(S)&&this.sourceOptions.playoutOptions[p].playoutMethods[S]),!h&&(c=c.filter(S=>S!==p),c.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:m,drms:w}=this.sourceOptions.playoutOptions[p].playoutMethods[h],b=m.split("/").find(g=>g.startsWith("hq__"));return{playoutParameters:{...t,options:o},protocol:p,drm:h,playoutUrl:m,versionHash:b,drms:w,availableDRMs:u,offeringURI:i,offering:r,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){t&&(e=this.collectionInfo.content.find(i=>i.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof r<"u"?r:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:r}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!r)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const i=await this.__Client();try{const o=this.sourceOptions.playoutParameters.authorizationToken;t=t||await i.LatestVersionHash({objectId:e});const c=(await i.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:o,produceLinkUrls:!0})||[]).find(p=>p.id===r);if(!c)throw{displayMessage:`No collection with ID ${r} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,h)=>({...p,active:h===0,mediaId:p.id,mediaIndex:h,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(m=>m.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(o){throw this.Log("Failed to load collection:"),o}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.initialized=!1,this.loading=!0,this.initTime=Date.now(),this.restartParameters=t,this.__SettingsUpdate(),e&&(this.originalParameters=Dz(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=Dt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new yW({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",w=>{this.airplayAvailable=w.availability==="available",this.__SettingsUpdate()}),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.video.textTracks&&this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.video.audioTracks&&this.video.audioTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.playerOptions.startTime?this.controls.Seek({time:parseFloat(this.playerOptions.startTime)}):this.playerOptions.startProgress&&this.controls.Seek({fraction:parseFloat(this.playerOptions.startProgress)}),this.playerOptions.autoplay===Dt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const w=this.video.duration-this.video.currentTime;this.behindLiveEdge=w>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{versionHash:r,playoutUrl:i,protocol:o,drm:u,drms:c,multiviewOptions:p,playoutParameters:h}=await this.__PlayoutOptions();this.contentHash=r,i=new URL(i);const m=this.sourceOptions.playoutParameters.authorizationToken||i.searchParams.get("authorization");if(this.authorizationToken=m,this.playoutUrl=i.toString(),this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:h}),this.__destroyed)return;o==="hls"?await this.__InitializeHLS({playoutUrl:i,authorizationToken:m,drm:u,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:i,authorizationToken:m,drm:u,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-3jMzsMal.js")).then(({InitializeMuxMonitoring:w})=>w({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:i,authorizationToken:m,disableCookies:this.playerOptions.collectVideoAnalytics===Dt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer(),this.initialized=!0,this.restartParameters=void 0}catch(r){let i;if(r&&[401,403].includes(r.status)||[401,403].includes(r.code))try{const o=await this.__Client(),u=this.sourceOptions.playoutParameters.linkPath?await o.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await o.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});i=await o.ContentObjectMetadata({versionHash:u,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),i?(r.permission_message=i,this.SetErrorMessage(i,r),typeof r=="object"?r.permission_message=i:this.Log(i,!0)):this.SetErrorMessage(r.displayMessage||"Insufficient permissions",r)}catch(o){this.SetErrorMessage(o.displayMessage||"Insufficient permissions",o)}else r.status>=500?this.__HardReload(r,1e4):this.__HardReload(r,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(r,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,drms:i,multiviewOptions:o}){this.HLS=(await Promise.resolve().then(()=>require("./hls-VH5py-kh.js"))).default;const u=this.video.canPlayType("application/vnd.apple.mpegURL");if(u&&Jde&&this.playerOptions.preferNativeHLS||[Dt.drms.FAIRPLAY,Dt.drms.SAMPLE_AES].includes(r)||!this.HLS.isSupported()){if(this.nativeHLS=!0,r===Dt.drms.FAIRPLAY?hW({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),o.enabled){const c=o.SwitchView;o.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(r===Dt.drms.PLAYREADY||r===Dt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(w,b)=>{w.open("POST",b,!0),w.setRequestHeader("Authorization",`Bearer ${t}`)}},r===Dt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:i[r].licenseServers[0]}}:r===Dt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:i[r].licenseServers[0]}}));const p=(Qde[this.playerOptions.playerProfile]||{}).hlsSettings||{},h=this.playerOptions.playerProfile===Dt.playerProfile.CUSTOM?this.customHLSOptions:{};this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:w=>(w.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(w),w),...c,...p,...h},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const m=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&m.on(this.HLS.Events.MANIFEST_PARSED,(w,{levels:b,firstLevel:g})=>{let S=b.map((A,k)=>A.bitrate>this.playerOptions.maxBitrate?k:void 0).filter(A=>typeof A<"u").reverse();S.length===b.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),S=S.filter(A=>A>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(S.map(A=>[b[A].width,"x",b[A].height,` (${(b[A].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),S.find(A=>g===A)&&(m.startLevel=b.map((A,k)=>k).filter(A=>!S.includes(A)).reverse()[0]),S.map(A=>m.removeLevel(A))}),m.loadSource(e.toString()),m.attachMedia(this.video),this.controls&&o.enabled){const w=o.SwitchView;o.SwitchView=async b=>{await w(b),m.nextLevel=m.currentLevel},this.controls.InitializeMultiViewControls(o)}if([this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(w=>m.on(w,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&m.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const w=(this.controls.GetAudioTracks().options||[]).find(b=>b.label===this.sourceOptions.playoutParameters.audioTrackLabel);w&&this.controls.SetAudioTrack(w.index)}),this.SetPlayerProfile=async({profile:w,customHLSOptions:b={}})=>{this.videoDuration=void 0,this.playerOptions.playerProfile=w,this.customHLSOptions=b;const g=!this.video.paused,S=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(A){this.Log("Failed to destroy HLS player",!0),this.Log(A,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,multiviewOptions:o}),g?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=S)},m.on(this.HLS.Events.FRAG_LOADED,()=>this.errors=0),m.on(this.HLS.Events.ERROR,async(w,b)=>{this.errors+=1,this.Log(`Encountered ${b.details}`,!0),this.Log(b,!0),b.response&&b.response.code===403?this.SetErrorMessage("Insufficient permissions",b):this.errors<5?b.fatal&&(b.data&&b.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError"),m.recoverMediaError()):this.__HardReload(b)):this.__HardReload(b)}),this.hlsPlayer=m,this.player=m,u){const w=document.createElement("source");w.src=this.playoutUrl.toString(),this.video.appendChild(w),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:r,drms:i}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-BUgYSjTl.js")).then(c=>c.dash_all_min)).default;const o=this.Dash.MediaPlayer().create(),u=this.playerOptions.dashjsOptions||{};if(o.updateSettings({...u,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(u.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(u.streaming||{}).text||{}},...u.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&o.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&o.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),o.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),r===Dt.drms.WIDEVINE){const c=i.widevine.licenseServers[0];o.setProtectionData({"com.widevine.alpha":{serverURL:c}})}o.initialize(this.video,e.toString(),this.playerOptions.autoplay===Dt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>o.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&o.on(this.Dash.MediaPlayer.events.CAN_PLAY,()=>{const c=(this.controls.GetAudioTracks().options||[]).find(p=>p.label===this.sourceOptions.playoutParameters.audioTrackLabel);c&&this.controls.SetAudioTrack(c.index)}),this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.player=o,this.dashPlayer=o}async __Play(){try{return await this.video.play(),!0}catch(e){if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Dt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const r=await this.__Client();let i=!1;try{await r.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{i=!0}let o=new URL((await r.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),u=`s/${r.NetworkInfo().name}`;return i&&(u=`t/${t}`),o.pathname=`${u}/q/${e}/meta/public`,o.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const r=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:r,address:e.utils.HashToAddress(r),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,r=await e.ContentObjectTenantId({objectId:t}),i=await e.ContentSpaceId();let o,u,c;try{u=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),u&&(u=new Date(parseInt(u._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{o=await e.ContentObjectMetadata({libraryId:i.replace("ispc","ilib"),objectId:r.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:r,tenantAddress:e.utils.HashToAddress(r),tenantName:o,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:u,versionCount:c,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const p=new URL("https://explorer.contentfabric.io/api");p.searchParams.set("module","account"),p.searchParams.set("action","txlist"),p.searchParams.set("offset","1"),p.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(p)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.castHandler&&this.castHandler.Destroy(),this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=$P&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0}}async __HardReload(e,t=6e3){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}try{if(e&&this.playerOptions.restartCallback)try{const r=await this.playerOptions.restartCallback(e);if(r&&typeof r=="boolean"){this.Destroy();return}}catch(r){this.Log("Restart callback failed:"),this.Log(r)}if(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(r=>setTimeout(r,t)),this.__destroyed)return;this.Log("Reloading stream");try{const r=await this.__Client();r.region?await r.UseRegion({region:r.region}):r.Nodes().fabricURIs.length>1&&await r.ResetRegion()}catch(r){this.Log("Client region reset failed:"),this.Log(r)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,!this.video||!this.initialized?this.restartParameters:{muted:this.video.muted,volume:this.video.volume,currentTime:this.video.currentTime,playing:!this.video.paused})}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}__SetCasting(e){e&&(this.controls.SetDVREnabled(!1),this.controls.Pause()),this.casting=e,this.__SettingsUpdate()}}u2.EluvioPlayerParameters=Dt;u2.EluvioPlayer=u2;var Uz=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(i,o){return i[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=n(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=n(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var u=o[i];t.call(r,u[1],u[0])}},e}()}(),j4=typeof window<"u"&&typeof document<"u"&&window.document===document,l2=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Zde=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(l2):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),Xde=2;function epe(n,e){var t=!1,r=!1,i=0;function o(){t&&(t=!1,n()),r&&c()}function u(){Zde(o)}function c(){var p=Date.now();if(t){if(p-i<Xde)return;r=!0}else t=!0,r=!1,setTimeout(u,e);i=p}return c}var tpe=20,npe=["top","right","bottom","left","width","height","size","weight"],rpe=typeof MutationObserver<"u",ape=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=epe(this.refresh.bind(this),tpe)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!j4||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),rpe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!j4||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=npe.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),Fz=function(n,e){for(var t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];Object.defineProperty(n,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return n},sm=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||l2},Bz=cS(0,0,0,0);function c2(n){return parseFloat(n)||0}function qP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(r,i){var o=n["border-"+i+"-width"];return r+c2(o)},0)}function ipe(n){for(var e=["top","right","bottom","left"],t={},r=0,i=e;r<i.length;r++){var o=i[r],u=n["padding-"+o];t[o]=c2(u)}return t}function spe(n){var e=n.getBBox();return cS(0,0,e.width,e.height)}function ope(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return Bz;var r=sm(n).getComputedStyle(n),i=ipe(r),o=i.left+i.right,u=i.top+i.bottom,c=c2(r.width),p=c2(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+o)!==e&&(c-=qP(r,"left","right")+o),Math.round(p+u)!==t&&(p-=qP(r,"top","bottom")+u)),!lpe(n)){var h=Math.round(c+o)-e,m=Math.round(p+u)-t;Math.abs(h)!==1&&(c-=h),Math.abs(m)!==1&&(p-=m)}return cS(i.left,i.top,c,p)}var upe=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof sm(n).SVGGraphicsElement}:function(n){return n instanceof sm(n).SVGElement&&typeof n.getBBox=="function"}}();function lpe(n){return n===sm(n).document.documentElement}function cpe(n){return j4?upe(n)?spe(n):ope(n):Bz}function fpe(n){var e=n.x,t=n.y,r=n.width,i=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return Fz(u,{x:e,y:t,width:r,height:i,top:t,right:e+r,bottom:i+t,left:e}),u}function cS(n,e,t,r){return{x:n,y:e,width:t,height:r}}var dpe=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=cS(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=cpe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),ppe=function(){function n(e,t){var r=fpe(t);Fz(this,{target:e,contentRect:r})}return n}(),hpe=function(){function n(e,t,r){if(this.activeObservations_=[],this.observations_=new Uz,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof sm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new dpe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof sm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new ppe(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),zz=typeof WeakMap<"u"?new WeakMap:new Uz,jz=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=ape.getInstance(),r=new hpe(e,t,this);zz.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){jz.prototype[n]=function(){var e;return(e=zz.get(this))[n].apply(e,arguments)}});var ype=function(){return typeof l2.ResizeObserver<"u"?l2.ResizeObserver:jz}();const fS=({element:n,Hide:e})=>{if(!n)return;const t=o=>{o&&(o.key||"").toLowerCase()==="escape"&&e()},r=o=>{n.contains(o.target)||e()};let i=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",r,!0)},0);return()=>{clearTimeout(i),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",r,!0)}},Hz=({player:n,setVideoState:e})=>{const t=function(){if(!n||!n.controls)return;const o=n.video.buffered;let u=0;for(let c=0;c<o.length;c++)o.start(c)>n.controls.GetCurrentTime()||o.end(c)>u&&(u=o.end(c));e({playing:n.controls.IsPlaying(),duration:n.controls.GetDuration(),volume:n.controls.GetVolume(),muted:n.controls.IsMuted(),rate:n.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},r=["play","pause","volumechange","seeked","durationchange","ratechange"];r.map(o=>n.video.addEventListener(o,t)),n.target.addEventListener("fullscreenchange",t);const i=n.castHandler&&n.castHandler.RegisterListener(t);return()=>{r.map(o=>n.video.removeEventListener(o,t)),n.target.removeEventListener("fullscreenchange",t),i&&i()}},mpe=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const r=n.buffered;let i=0;for(let o=0;o<r.length;o++)r.start(o)>n.currentTime||r.end(o)>i&&(i=r.end(o));e(1-(n.duration-i)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},pk=({player:n,rate:e=10,setCurrentTime:t})=>{const r=setInterval(()=>{n.controls&&t(n.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(r)}},gpe=({target:n,setSize:e,setOrientation:t,setDimensions:r})=>{let i;const o=()=>{clearTimeout(i);const c=n.getBoundingClientRect();let p="sm",h="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(h="portrait"),e(p),t(h),i=setTimeout(()=>{r({width:c.width,height:c.height})},500)};o();const u=new ype(o);return u.observe(n),()=>u.disconnect()},vpe=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===Dt.autoplay.WHEN_VISIBLE,r=n.playerOptions.muted===Dt.muted.WHEN_NOT_VISIBLE;if(!t&&!r)return;let i,o;const u=async([p])=>{t&&(i!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),i="play"):i!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),i="pause")),r&&(o!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,o="unmute"):o!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,o="mute"))},c=new window.IntersectionObserver(u,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},bpe=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:r})=>{let i;const o=p=>{clearTimeout(i),r&&r(),i=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},u=["play","pause","volumechange","seeking"];u.forEach(p=>n.video.addEventListener(p,o));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,o)),()=>{u.map(p=>n.video.removeEventListener(p,o)),c.map(p=>n.target.removeEventListener(p,o))}},wpe=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===Dt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===Dt.keyboardControls.ARROW_KEYS_DISABLED,r=Pz(n,e)(),i=o=>{if(!(n.target===o.target||n.target.contains(o.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let u;switch(o.key){case" ":case"k":u=n.controls.TogglePlay(),e({action:u?Pn.PLAY:Pn.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":u=n.controls.ToggleMuted(),e({action:u?Pn.MUTE:Pn.UNMUTE});break;case"ArrowDown":t||(u=n.controls.SetVolume({relativeFraction:-.1}),e({action:u===0?Pn.MUTE:Pn.VOLUME_DOWN,text:(u*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(u=n.controls.SetVolume({relativeFraction:.1}),e({action:Pn.VOLUME_UP,text:(u*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Pn.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Pn.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||r(o);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?u=n.controls.SetPlaybackRate({index:c.active.index+(o.key==="<"?-1:1)}):u=n.controls.SetPlaybackRate({rate:1}),u&&e({action:u.increase?Pn.PLAYBACK_RATE_UP:Pn.PLAYBACK_RATE_DOWN,text:`${u.rate.toFixed(2)}x`});break;case"c":u=n.controls.ToggleTextTrack(),e({action:u?Pn.SUBTITLES_ON:Pn.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Pn.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Pn.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Pn.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Pn.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u=n.controls.Seek({fraction:parseFloat(o.key)*.1}),e({action:u?Pn.SEEK_FORWARD:Pn.SEEK_BACK});break;default:return}o.preventDefault()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},_pe=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(i=>{navigator.mediaSession.setActionHandler(i,o=>{switch(i){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||10});break;case"seekto":o&&typeof o.seekTime<"u"&&n.controls.Seek({time:o.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const r=n.controls.RegisterSettingsListener(()=>{const{title:i}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==i)&&(navigator.mediaSession.metadata=new MediaMetadata({title:i}))});return()=>{clearInterval(t),r&&r(),navigator.mediaSession.metadata=null,e.forEach(i=>{navigator.mediaSession.setActionHandler(i,null)})}}},xpe="_container_fm2ri_1",Spe="_autohide_fm2ri_41",Cpe="_fadein_fm2ri_1",Epe="_seek_fm2ri_174",Ape="_controls_fm2ri_207",kpe="_time_fm2ri_221",Mpe="_spacer_fm2ri_279",Tpe="_watermark_fm2ri_291",Rpe="_menu_fm2ri_37",zn={container:xpe,"container--default-controls":"_container--default-controls_fm2ri_33","bottom-controls-container":"_bottom-controls-container_fm2ri_37",autohide:Spe,"info-container":"_info-container_fm2ri_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_fm2ri_45","icon-button":"_icon-button_fm2ri_51","icon-button-active":"_icon-button-active_fm2ri_65",fadein:Cpe,"info-image-container":"_info-image-container_fm2ri_106","info-image":"_info-image_fm2ri_106","info-text":"_info-text_fm2ri_122","info-headers":"_info-headers_fm2ri_131","info-description":"_info-description_fm2ri_141","info-title":"_info-title_fm2ri_147","info-subtitle":"_info-subtitle_fm2ri_152","center-play-button":"_center-play-button_fm2ri_160","center-play-button--hidden":"_center-play-button--hidden_fm2ri_167",seek:Epe,"bottom-controls-gradient":"_bottom-controls-gradient_fm2ri_194",controls:Ape,"play-pause-button":"_play-pause-button_fm2ri_217",time:kpe,"live-indicator":"_live-indicator_fm2ri_231","live-indicator--faded":"_live-indicator--faded_fm2ri_241","collection-button-container":"_collection-button-container_fm2ri_249","collection-button-text":"_collection-button-text_fm2ri_254","collection-button-container--loading":"_collection-button-container--loading_fm2ri_263",spacer:Mpe,"floating-volume-toggle":"_floating-volume-toggle_fm2ri_283",watermark:Tpe,"content-verified-badge":"_content-verified-badge_fm2ri_302","content-verification-menu-button":"_content-verification-menu-button_fm2ri_303","menu-control-container":"_menu-control-container_fm2ri_317",menu:Rpe},$z='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',qz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',Vz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',Ope='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',Gz='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="15" cy="15" r="15" fill="currentColor"/><path d="M10 8H14V22H10V8ZM16 8H20V22H16V8Z" fill="black"/></svg>',Lpe='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',Npe='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',Ppe='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',hk='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',Wz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Ipe='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',f2='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',Dpe='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',VP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',Upe='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',GP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',Fpe='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',yk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',mk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',Bpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',rh='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',zpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',jpe='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',Hpe='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',$pe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',d2='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',WP='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',qpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',Kz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',Vpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cast"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',Gpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>';(function(n,e){(function(t,r){r()})(Fa,function(){function t(i){var o=!0,u=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function h(V){return!!(V&&V!==document&&V.nodeName!=="HTML"&&V.nodeName!=="BODY"&&"classList"in V&&"contains"in V.classList)}function m(V){var de=V.type,oe=V.tagName;return!!(oe==="INPUT"&&p[de]&&!V.readOnly||oe==="TEXTAREA"&&!V.readOnly||V.isContentEditable)}function w(V){V.classList.contains("focus-visible")||(V.classList.add("focus-visible"),V.setAttribute("data-focus-visible-added",""))}function b(V){V.hasAttribute("data-focus-visible-added")&&(V.classList.remove("focus-visible"),V.removeAttribute("data-focus-visible-added"))}function g(V){V.metaKey||V.altKey||V.ctrlKey||(h(i.activeElement)&&w(i.activeElement),o=!0)}function S(V){o=!1}function A(V){h(V.target)&&(o||m(V.target))&&w(V.target)}function k(V){h(V.target)&&(V.target.classList.contains("focus-visible")||V.target.hasAttribute("data-focus-visible-added"))&&(u=!0,window.clearTimeout(c),c=window.setTimeout(function(){u=!1},100),b(V.target))}function R(V){document.visibilityState==="hidden"&&(u&&(o=!0),N())}function N(){document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("mouseup",q),document.addEventListener("pointermove",q),document.addEventListener("pointerdown",q),document.addEventListener("pointerup",q),document.addEventListener("touchmove",q),document.addEventListener("touchstart",q),document.addEventListener("touchend",q)}function P(){document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",q),document.removeEventListener("pointermove",q),document.removeEventListener("pointerdown",q),document.removeEventListener("pointerup",q),document.removeEventListener("touchmove",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchend",q)}function q(V){V.target.nodeName&&V.target.nodeName.toLowerCase()==="html"||(o=!1,P())}document.addEventListener("keydown",g,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",R,!0),N(),i.addEventListener("focus",A,!0),i.addEventListener("blur",k,!0),i.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&i.host?i.host.setAttribute("data-js-focus-visible",""):i.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var r;try{r=new CustomEvent("focus-visible-polyfill-ready")}catch{r=document.createEvent("CustomEvent"),r.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(r)}typeof document<"u"&&t(document)})})();const Yz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",Wpe="_spinner_vz46q_1",Kpe="_spin_vz46q_1",Ype="_svg_vz46q_16",Jpe="_menu_vz46q_276",Qpe="_fadein_vz46q_1",Zpe="_fadeout_vz46q_1",Ct={spinner:Wpe,spin:Kpe,"spinner--light":"_spinner--light_vz46q_12",svg:Ype,"user-action-indicator-container":"_user-action-indicator-container_vz46q_23","action-indicator-fade-out":"_action-indicator-fade-out_vz46q_1","user-action-indicator-text":"_user-action-indicator-text_vz46q_40","user-action-indicator":"_user-action-indicator_vz46q_23","action-indicator-icon-scale":"_action-indicator-icon-scale_vz46q_1","user-action-indicator-icon":"_user-action-indicator-icon_vz46q_60","seek-container":"_seek-container_vz46q_69","seek-playhead":"_seek-playhead_vz46q_92","seek-buffer":"_seek-buffer_vz46q_93","seek-input":"_seek-input_vz46q_94","volume-controls":"_volume-controls_vz46q_201","volume-slider":"_volume-slider_vz46q_208","volume-input":"_volume-input_vz46q_224","volume-progress":"_volume-progress_vz46q_225",menu:Jpe,fadein:Qpe,"menu-option":"_menu-option_vz46q_296","menu-option-back":"_menu-option-back_vz46q_313","menu-option-back-icon":"_menu-option-back-icon_vz46q_317","focus-visible":"_focus-visible_vz46q_327","menu-option-active":"_menu-option-active_vz46q_332","menu-option-icon":"_menu-option-icon_vz46q_336","menu-header":"_menu-header_vz46q_346","verification-menu":"_verification-menu_vz46q_353","verification-menu__group":"_verification-menu__group_vz46q_357","verification-menu__group-icon":"_verification-menu__group-icon_vz46q_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_vz46q_366","verification-menu__group-text":"_verification-menu__group-text_vz46q_374","verification-menu__group-title":"_verification-menu__group-title_vz46q_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_vz46q_378","verification-menu__loader":"_verification-menu__loader_vz46q_393","verification-menu__details":"_verification-menu__details_vz46q_400","verification-menu__detail":"_verification-menu__detail_vz46q_400","verification-menu__detail-label":"_verification-menu__detail-label_vz46q_419","verification-menu__detail-value":"_verification-menu__detail-value_vz46q_423","verification-menu__detail-copy":"_verification-menu__detail-copy_vz46q_430","verification-menu__inline-icon":"_verification-menu__inline-icon_vz46q_440","verification-menu--details":"_verification-menu--details_vz46q_448","dvr-toggle":"_dvr-toggle_vz46q_466","dvr-toggle__border":"_dvr-toggle__border_vz46q_472","dvr-toggle__live":"_dvr-toggle__live_vz46q_481","dvr-toggle__dvr":"_dvr-toggle__dvr_vz46q_481","dvr-toggle__live--active":"_dvr-toggle__live--active_vz46q_496","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_vz46q_496","copy-button":"_copy-button_vz46q_619","copy-button--copied":"_copy-button--copied_vz46q_622",fadeout:Zpe},Lb=({light:n,className:e=""})=>ke.jsx("div",{className:`${e} ${Ct.spinner} ${n?Ct["spinner--light"]:""}`,children:ke.jsx("div",{className:Ct["spinner-inner"]})}),Tl=({icon:n,className:e=""})=>ke.jsx("div",{className:`${Ct.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),gk=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},KP={[Pn.PLAY]:qz,[Pn.PAUSE]:Ope,[Pn.MUTE]:hk,[Pn.UNMUTE]:f2,[Pn.VOLUME_DOWN]:Wz,[Pn.VOLUME_UP]:f2,[Pn.SEEK_BACK]:VP,[Pn.SEEK_FORWARD]:GP,[Pn.PLAYBACK_RATE_DOWN]:VP,[Pn.PLAYBACK_RATE_UP]:GP,[Pn.SUBTITLES_ON]:jpe,[Pn.SUBTITLES_OFF]:Hpe,[Pn.PLAY_PREVIOUS]:yk,[Pn.PLAY_NEXT]:mk},Xpe=({action:n})=>{if(!(!n||!KP[n.action]))return ke.jsxs("div",{className:Ct["user-action-indicator-container"],children:[ke.jsx("div",{className:Ct["user-action-indicator"],children:ke.jsx(Tl,{icon:KP[n.action],"aria-label":`Action indicator ${n}`,className:Ct["user-action-indicator-icon"]})}),n.text?ke.jsx("div",{className:Ct["user-action-indicator-text"],children:n.text}):null]})},Jz=({player:n,videoState:e,setRecentUserAction:t,className:r=""})=>{const[i,o]=xt.useState(n.controls.GetCurrentTime()),[u,c]=xt.useState(0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(n.controls.IsDVREnabled());return xt.useEffect(()=>{h(Pz(n,t));const b=pk({player:n,setCurrentTime:o,rate:60}),g=mpe({video:n.video,setBufferFraction:c}),S=n.controls.RegisterSettingsListener(()=>{n.controls&&w(n.controls.IsDVREnabled())});return()=>{b&&b(),g&&g(),S&&S()}},[n&&n.controls]),n.isLive&&!m?null:ke.jsxs("div",{className:`${r} ${Ct["seek-container"]} ${r}`,children:[ke.jsx("progress",{max:1,value:n.casting?0:u,className:Ct["seek-buffer"]}),ke.jsx("progress",{max:1,value:i/e.duration||0,className:Ct["seek-playhead"]}),ke.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:i/e.duration||0,onInput:b=>n.controls.Seek({fraction:b.currentTarget.value}),onKeyDown:p,className:Ct["seek-input"]})]})},ehe=({player:n,videoState:e})=>ke.jsxs("div",{className:Ct["volume-controls"],children:[ke.jsx(Ol,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?hk:e.volume<.4?Wz:e.volume<.8?Ipe:f2,onClick:()=>n.controls.ToggleMuted(),className:Ct["volume-button"]},"mute-button"),ke.jsxs("div",{className:Ct["volume-slider"],children:[ke.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ct["volume-progress"]}),ke.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:Yde(n),className:Ct["volume-input"]})]})]}),Qz=({player:n,Hide:e,className:t=""})=>{const[r,i]=xt.useState(void 0),[o,u]=xt.useState(void 0),c=xt.createRef();if(xt.useEffect(()=>{const w=()=>u(n.controls.GetOptions());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),xt.useEffect(()=>{if(!c||!c.current)return;const w=fS({element:c.current.parentElement,Hide:e});return()=>{w&&w()}},[c]),!o)return null;const p=w=>setTimeout(()=>i(w)),h={quality:{label:"Quality",Update:w=>n.controls.SetQualityLevel(w)},audio:{label:"Audio",Update:w=>n.controls.SetAudioTrack(w)},text:{label:"Subtitles",Update:w=>n.controls.SetTextTrack(w)},profile:{label:"Player Profile",Update:w=>{w==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:w})}},rate:{label:"Playback Rate",Update:w=>n.controls.SetPlaybackRate({index:w})},advanced:{label:"Advanced",Update:w=>{w==="copy_debug_info"&&(gk(JSON.stringify(n.controls.GetDebugInfo(),null,2)),e())}}};let m;return r?m=ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${Ct.submenu} ${t}`,children:[ke.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ct["menu-option"]} ${Ct["menu-option-back"]}`,children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:Dpe},className:Ct["menu-option-back-icon"]}),ke.jsx("div",{children:h[r].label})]}),r==="advanced"?ke.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{h[r].Update("copy_debug_info"),p(void 0)},className:Ct["menu-option"],children:"Copy Debug Info"}):o[r].options.map(w=>ke.jsxs("button",{role:"menuitemradio","aria-checked":w.active,autoFocus:w.active,"aria-label":`${h[r].label}: ${w.label||""}`,onClick:()=>{h[r].Update(w.index),p(void 0)},className:`${Ct["menu-option"]} ${w.active?Ct["menu-option-active"]:""}`,children:[w.label||"",w.active?ke.jsx(Tl,{icon:zpe,className:Ct["menu-option-icon"]}):null]},`option-${w.index}`))]},"submenu"):m=ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${t}`,children:[o.hasQualityOptions?ke.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ct["menu-option"],children:[`${h.quality.label}: ${o.quality.active&&o.quality.active.activeLabel||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasAudioOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ct["menu-option"],children:[`${h.audio.label}: ${o.audio.active&&o.audio.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasTextOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ct["menu-option"],children:[`${h.text.label}: ${o.text.active&&o.text.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasProfileOptons?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ct["menu-option"],children:[`${h.profile.label}: ${o.profile.active&&o.profile.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasRateOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ct["menu-option"],children:[`${h.rate.label}: ${o.rate.active&&o.rate.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,ke.jsxs("button",{autoFocus:!o.hasRateOptions&&!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Ct["menu-option"],children:[h.advanced.label,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]})]},"menu"),ke.jsx("div",{ref:c,children:m})},Zz=({player:n})=>{const[e,t]=xt.useState(n.dvrEnabled);return xt.useEffect(()=>{const r=n.controls.RegisterSettingsListener(()=>{n.controls&&t(n.controls.IsDVREnabled())});return()=>r&&r()},[n&&n.controls]),ke.jsxs("div",{className:Ct["dvr-toggle"],children:[ke.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!1),className:`${Ct["dvr-toggle__live"]} ${e?"":Ct["dvr-toggle__live--active"]}`,children:"LIVE"}),ke.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!0),className:`${Ct["dvr-toggle__dvr"]} ${e?Ct["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),ke.jsx("div",{className:Ct["dvr-toggle__border"]})]})},the=({label:n,value:e,className:t=""})=>{const[r,i]=xt.useState(!1);return ke.jsx("button",{onClick:()=>{r||(gk(e),i(!0),setTimeout(()=>i(!1),100))},dangerouslySetInnerHTML:{__html:qpe},className:[Ct["copy-button"],r?Ct["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Bo=({label:n,value:e,copyable:t})=>e?ke.jsxs("div",{className:Ct["verification-menu__detail"],children:[ke.jsxs("label",{className:Ct["verification-menu__detail-label"],children:[n,":"]}),ke.jsx("div",{className:Ct["verification-menu__detail-value"],children:e}),t?ke.jsx(the,{label:n,value:e,className:Ct["verification-menu__detail-copy"]}):null]}):null,Xz=({player:n,Hide:e,className:t=""})=>{const r=xt.createRef(),[i,o]=xt.useState(),[u,c]=xt.useState(!1),[p,h]=xt.useState(!1);if(xt.useEffect(()=>{n.__LoadVerificationDetails().then(()=>h(!0));const w=()=>o(n.controls.GetContentVerificationDetails());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),xt.useEffect(()=>{if(!r||!r.current)return;const w=fS({element:r.current.parentElement,Hide:e});return()=>{w&&w()}},[r]),!i)return null;let m;return u?m=ke.jsxs(ke.Fragment,{children:[ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:d2},className:Ct["verification-menu__group-icon"]}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("div",{className:Ct["verification-menu__group-title"],children:"This content has been verified as authentic"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:WP},className:[Ct["verification-menu__group-icon"],Ct["verification-menu__group-icon--cc"]].join(" ")}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("button",{onClick:()=>c(!0),className:Ct["verification-menu__group-title"],children:"Content Credentials"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Issued by the",ke.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__details"],children:[ke.jsx(Bo,{label:"Content Fabric Object ID",value:i.details.objectId,copyable:!0}),ke.jsx(Bo,{label:"Organization Address",value:i.details.tenantAddress,copyable:!0}),ke.jsx(Bo,{label:"Organization Name",value:i.details.tenantName&&i.details.tenantName.toString()}),ke.jsx(Bo,{label:"Owner Address",value:i.details.ownerAddress,copyable:!0}),ke.jsx(Bo,{label:"Content Object Contract Address",value:i.details.explorerUrl?ke.jsx("a",{href:i.details.explorerUrl,target:"_blank",rel:"noreferrer",children:i.details.address}):i.details.address,copyable:!0}),ke.jsx(Bo,{label:"Versions",value:i.details.versionCount}),ke.jsx(Bo,{label:"Content Version Hash",value:i.details.versionHash,copyable:!0}),i.details.lastCommittedAt?ke.jsx(Bo,{label:"Latest Commit",value:new Date(i.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,ke.jsx(Bo,{label:"Latest Version Hash",value:i.details.latestVersionHash,copyable:!0}),ke.jsx(Bo,{label:"Latest Transaction",value:i.details._state!=="full"?ke.jsx(Lb,{className:Ct["verification-menu__loader"]}):i.details.latestTransactionHashUrl?ke.jsx("a",{href:i.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:i.details.latestTransactionHash&&i.details.latestTransactionHash.toString()}):void 0}),ke.jsx(Bo,{label:"Signature Algorithm",value:i.details.signatureMethod}),n.publicMetadataUrl?ke.jsx(Bo,{label:"Public Metadata",value:ke.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${i.details._state}`)]}):m=ke.jsxs(ke.Fragment,{children:[ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:d2},className:Ct["verification-menu__group-icon"]}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("div",{className:Ct["verification-menu__group-title"],children:"This content has been verified as authentic"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:WP},className:[Ct["verification-menu__group-icon"],Ct["verification-menu__group-icon--cc"]].join(" ")}),ke.jsx("div",{className:Ct["verification-menu__group-text"],children:ke.jsxs("button",{onClick:()=>c(!0),className:Ct["verification-menu__group-title"],children:["View Content Credentials",ke.jsx("div",{className:Ct["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:rh}})]})})]})]}),ke.jsx("div",{ref:r,children:ke.jsx("div",{role:"menu",className:`${Ct.menu} ${Ct["verification-menu"]} ${u?Ct["verification-menu--details"]:""} ${t}`,children:m},"menu")})},nhe=({player:n,Hide:e,className:t=""})=>{const r=xt.createRef(),[i,o]=xt.useState(void 0);if(xt.useEffect(()=>{const c=()=>o(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),xt.useEffect(()=>{if(!r||!r.current)return;const c=fS({element:r.current.parentElement,Hide:e});return()=>c&&c()},[r]),!i)return null;const u=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${Ct["collection-menu"]} ${t}`,ref:r,children:[ke.jsx("div",{className:`${Ct["menu-option"]} ${Ct["menu-header"]}`,children:i.title}),i.content.map(c=>ke.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>u(c.mediaIndex),className:`${Ct["menu-option"]} ${c.active?Ct["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`))]},"menu")},Ol=({icon:n,className:e="",...t})=>ke.jsx("button",{...t,className:`${zn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),rhe=({player:n,videoState:e})=>{const[t,r]=xt.useState(n.video.currentTime);return xt.useEffect(()=>{const i=pk({player:n,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.controls.IsDVRAvailable()?ke.jsx("div",{className:zn["live-indicator"],children:"Live"}):ke.jsxs("div",{className:zn.time,children:[!n.isLive||!n.controls.IsDVRAvailable()?null:ke.jsx(Zz,{player:n}),n.isLive&&!n.behindLiveEdge?null:`${o2(t,e.duration)} / `,n.isLive&&!n.dvrEnabled?null:o2(e.duration,e.duration)]})},ahe=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],r=e.content[e.mediaIndex+1],i=n.controls.IsReady();return ke.jsxs(ke.Fragment,{children:[t?ke.jsxs("div",{className:`${zn["collection-button-container"]} ${i?"":zn["collection-button-container--loading"]}`,children:[ke.jsx(Ol,{"aria-label":`Play Previous: ${t.title}`,disabled:!i,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious()}),ke.jsx("div",{className:zn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,r?ke.jsxs("div",{className:`${zn["collection-button-container"]} ${i?"":zn["collection-button-container--loading"]}`,children:[ke.jsx(Ol,{"aria-label":`Play Next: ${r.title}`,disabled:!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext()}),ke.jsx("div",{className:zn["collection-button-text"],children:r.title})]},`media-next-${e.mediaIndex}`):null]})},ej=({label:n,icon:e,player:t,MenuComponent:r,className:i=""})=>{const[o,u]=xt.useState(!1);return ke.jsxs("div",{className:[zn["menu-control-container"],i].join(" "),children:[ke.jsx(Ol,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!o),u(!o)},className:o?zn["icon-button-active"]:""}),o?ke.jsx(r,{player:t,Hide:()=>{u(!1),t.controls.__ToggleMenu(!1)}}):null]})},ihe=({player:n})=>{const[e,t]=xt.useState(void 0),{title:r,subtitle:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{t(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>t(p))},[u]),!r||n.playerOptions.title===Dt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===Dt.title.OFF?null:ke.jsxs("div",{className:zn["info-container"],children:[e?ke.jsx("div",{className:zn["info-image-container"],children:ke.jsx("img",{src:e,alt:"Image",className:zn["info-image"]})}):null,ke.jsxs("div",{className:zn["info-text"],children:[c.length===0?null:ke.jsx("div",{className:zn["info-headers"],children:c.map((p,h)=>ke.jsx("div",{className:zn["info-header"],children:p},`header-${h}`))}),r?ke.jsx("div",{className:zn["info-title"],children:r}):null,i?ke.jsx("div",{className:zn["info-subtitle"],children:i}):null,o?ke.jsx("div",{className:zn["info-description"],children:o}):null]})]})},she=({player:n})=>{const[e,t]=xt.useState(!1);return xt.useEffect(()=>{const r=()=>n&&n.controls&&t(n.controls.ContentVerified());r();const i=n.controls&&n.controls.RegisterSettingsListener(r);return()=>i&&i()},[]),e?ke.jsxs(ke.Fragment,{children:[ke.jsx("div",{className:zn["content-verified-badge"],children:"VERIFIED"}),ke.jsx(ej,{label:"Content Verification Menu",icon:d2,player:n,MenuComponent:Xz,className:zn["content-verification-menu-button"]})]}):null},ohe=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(n.controls.IsMenuVisible());if(xt.useEffect(()=>{if(!n.controls)return;h(Nz({player:n,setRecentUserAction:i}));const A=()=>n&&n.controls&&w(n.controls.IsMenuVisible()),k=n.controls.RegisterSettingsListener(A),R=Hz({player:n,setVideoState:c});return()=>{k&&k(),R&&R()}},[]),!u)return null;const b=n.controls.GetCollectionInfo(),g=r||!e||m,S=!g&&n.playerOptions.controls===Dt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!S),ke.jsxs("div",{onClick:p,className:[o,zn.container,g?"":zn.autohide,n.playerOptions.controls!==Dt.controls.DEFAULT?"":zn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[ke.jsx(ihe,{player:n},`content-info-${b&&b.mediaIndex}`),[Dt.controls.DEFAULT,Dt.controls.OFF,Dt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:ke.jsxs(ke.Fragment,{children:[ke.jsx(Ol,{"aria-label":"Play",tabIndex:e?-1:0,icon:$z,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${zn["center-play-button"]} ${t&&!e&&!(n&&n.casting)?"":zn["center-play-button--hidden"]}`}),ke.jsxs("div",{className:`${zn["bottom-controls-container"]} ${S?zn["bottom-controls-container--autohide"]:""}`,children:[ke.jsx("div",{className:zn["bottom-controls-gradient"]}),ke.jsx(Jz,{player:n,videoState:u,setRecentUserAction:i,className:zn.seek}),ke.jsxs("div",{className:zn.controls,children:[ke.jsx(Ol,{"aria-label":u.playing?"Pause":"Play",icon:u.playing?Gz:Vz,onClick:()=>n.controls.TogglePlay(),className:zn["play-pause-button"]}),ke.jsx(ahe,{player:n}),ke.jsx(ehe,{player:n,videoState:u}),ke.jsx(rhe,{player:n,videoState:u}),ke.jsx("div",{className:zn.spacer}),ke.jsx(she,{player:n}),n.chromecastAvailable?ke.jsx("google-cast-launcher",{}):null,n.airplayAvailable?ke.jsx(Ol,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:Kz}):null,n.controls.IsRotatable()?ke.jsx(Ol,{"aria-label":"Rotate Video",icon:$pe,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:zn["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?ke.jsx(ej,{label:"Settings Menu",icon:Ppe,player:n,MenuComponent:Qz}):null,ke.jsx(Ol,{"aria-label":u.fullscreen?"Exit Fullscreen":"Fullscreen",icon:u.fullscreen?Npe:Lpe,onClick:()=>n.controls.ToggleFullscreen(),className:zn["right-control-button"]})]})]})]}),n.playerOptions.controls!==Dt.controls.OFF_WITH_VOLUME_TOGGLE?null:ke.jsx("div",{className:zn["floating-volume-toggle"],children:ke.jsx(Ol,{"aria-label":u.muted?"Unmute":"Mute",icon:u.muted||u.volume===0?hk:f2,onClick:()=>n.controls.ToggleMuted(),className:zn["volume-button"]},"mute-button")}),n.playerOptions.watermark===Dt.watermark.OFF?null:ke.jsx("div",{className:zn.watermark,children:ke.jsx("img",{src:Yz,alt:"Eluvio"})})]})},uhe="_spinner_1c6ar_17",lhe="_text_1c6ar_33",che="_title_1c6ar_39",fhe="_description_1c6ar_43",dhe="_inputs_1c6ar_47",phe="_input_1c6ar_47",hhe="_submit_1c6ar_77",wi={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:uhe,"ticket-form":"_ticket-form_1c6ar_1",text:lhe,title:che,description:fhe,inputs:dhe,input:phe,submit:hhe,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},yhe=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:r,ntpId:i,ticketCode:o,ticketSubject:u}=n.clientOptions||{};const c=!r||!i,[p,h]=xt.useState(o||""),[m,w]=xt.useState(!!o),[b,g]=xt.useState(!1),[S,A]=xt.useState(c?"Error: Tenant ID or NTP ID not specified":""),[k,R]=xt.useState(void 0),N=async({client:P,code:q})=>{if(!(!q||!P)){A(""),g(!0);try{let V=u;q.includes(":")&&(V=q.split(":")[0],q=q.split(":")[1]),await P.RedeemCode({tenantId:r,ntpId:i,code:q.trim(),email:V}),t(P)}catch(V){console.log(V),A("Invalid Code"),w(!1)}finally{g(!1)}}};return xt.useEffect(()=>{Promise.resolve().then(()=>Lz).then(async({ElvClient:P})=>{const q=await P.FromConfigurationUrl({configUrl:n.clientOptions.network});R(q),o&&N({client:q,code:o})})},[]),m?ke.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:ke.jsx("div",{className:wi["ticket-form-overlay"],children:ke.jsx(Lb,{className:wi.spinner})})}):ke.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:ke.jsx("div",{className:wi["ticket-form-overlay"],children:ke.jsxs("form",{onSubmit:P=>{P.preventDefault(),N({client:k,code:p})},className:wi["ticket-form"],children:[ke.jsxs("div",{className:wi.text,children:[ke.jsx("h2",{className:wi.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),ke.jsx("p",{className:wi.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),ke.jsxs("div",{className:wi.inputs,children:[ke.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:P=>P.key==="Enter"&&N({client:k,code:p}),onChange:P=>{A(""),h(P.target.value)},className:wi.input}),ke.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!k||c,className:wi.submit,children:b?ke.jsx(Lb,{light:!0}):"Submit"})]}),ke.jsxs("div",{className:wi["error-message"],children:[S," "]})]})})})},mhe="_container_m8dfx_1",ghe="_autohide_m8dfx_34",vhe="_fadein_m8dfx_1",bhe="_title_m8dfx_134",whe="_spacer_m8dfx_319",_he="_watermark_m8dfx_323",xhe="_menu_m8dfx_145",dn={container:mhe,"container--default-controls":"_container--default-controls_m8dfx_29",autohide:ghe,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_m8dfx_37","icon-button":"_icon-button_m8dfx_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_m8dfx_60","icon-button-active":"_icon-button-active_m8dfx_73","icon-button--circle-focus":"_icon-button--circle-focus_m8dfx_73","text-button":"_text-button_m8dfx_86","text-button--active":"_text-button--active_m8dfx_91","bottom-controls-container":"_bottom-controls-container_m8dfx_37",fadein:vhe,"bottom-controls-gradient":"_bottom-controls-gradient_m8dfx_108","center-play-button":"_center-play-button_m8dfx_120","center-play-button--hidden":"_center-play-button--hidden_m8dfx_127","title-container":"_title-container_m8dfx_134",title:bhe,"menu-control-container":"_menu-control-container_m8dfx_145","time-container":"_time-container_m8dfx_149","live-indicator":"_live-indicator_m8dfx_156","live-indicator--faded":"_live-indicator--faded_m8dfx_168","bottom-controls":"_bottom-controls_m8dfx_37","center-buttons":"_center-buttons_m8dfx_184","play-pause-button":"_play-pause-button_m8dfx_194","track-button":"_track-button_m8dfx_197","bottom-left-controls":"_bottom-left-controls_m8dfx_201","bottom-right-controls":"_bottom-right-controls_m8dfx_202","info-box-container":"_info-box-container_m8dfx_219","info-box":"_info-box_m8dfx_219","info-box-image-container":"_info-box-image-container_m8dfx_242","info-box-image":"_info-box-image_m8dfx_242","info-box-text":"_info-box-text_m8dfx_258","info-box-text--top-padding":"_info-box-text--top-padding_m8dfx_265","info-box-headers":"_info-box-headers_m8dfx_269","info-box-description":"_info-box-description_m8dfx_277","info-box-title":"_info-box-title_m8dfx_281","info-box-button":"_info-box-button_m8dfx_286","info-box-button--restart":"_info-box-button--restart_m8dfx_301",spacer:whe,watermark:_he,menu:xhe},Ad=({icon:n,...e})=>ke.jsx("button",{...e,className:`${dn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),She=({player:n,videoState:e})=>{const[t,r]=xt.useState(n.video.currentTime);return xt.useEffect(()=>{const i=pk({player:n,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?null:ke.jsxs("div",{className:dn["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:ke.jsx("div",{className:dn.time,children:o2(t,e.duration)}),ke.jsx("div",{className:dn.spacer}),ke.jsx("div",{className:dn.time,children:o2(e.duration,e.duration)})]})},Che=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),r=t&&t.isPlaylist&&t.content[t.mediaIndex-1],i=t&&t.isPlaylist&&t.content[t.mediaIndex+1],o=n.controls.IsReady();return ke.jsxs("div",{className:dn["center-buttons"],children:[!r&&!i?null:ke.jsx(Ad,{disabled:!o||!r,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${dn["track-button"]} ${dn["icon-button--drop-shadow-focus"]}`}),ke.jsx(Ad,{"aria-label":"Back 10 Seconds",icon:Upe,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:dn["icon-button--drop-shadow-focus"]}),ke.jsx(Ad,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?Gz:Vz,onClick:()=>n.controls.TogglePlay(),className:`${dn["play-pause-button"]} ${dn["icon-button--drop-shadow-focus"]}`}),ke.jsx(Ad,{"aria-label":"Forward 10 Seconds",icon:Fpe,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:dn["icon-button--drop-shadow-focus"]}),!r&&!i?null:ke.jsx(Ad,{disabled:!o||!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext(),className:`${dn["track-button"]} ${dn["icon-button--drop-shadow-focus"]}`})]})},H4=({label:n,icon:e,children:t,player:r,MenuComponent:i})=>{const[o,u]=xt.useState(!1);return ke.jsxs("div",{className:dn["menu-control-container"],children:[e?ke.jsx(Ad,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${dn["icon-button--circle-focus"]} ${o?dn["icon-button-active"]:""}`}):ke.jsx("button",{onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${dn["text-button"]} ${o?dn["text-button--active"]:""}`,children:t}),o?ke.jsx(i,{player:r,Hide:()=>{r.controls.__ToggleMenu(!1),u(!1)},className:dn.menu}):null]})},Ehe=({player:n,Hide:e})=>{const[t,r]=xt.useState(void 0),{title:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{r(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>r(p))},[u]),xt.useEffect(()=>{const p=h=>{h&&(h.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),ke.jsxs("div",{className:dn["info-box-container"],children:[ke.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${dn["info-box-button"]} ${dn["info-box-button--info"]}`,children:"Info"}),ke.jsxs("div",{className:dn["info-box"],children:[t?ke.jsx("div",{className:dn["info-box-image-container"],children:ke.jsx("img",{src:t,alt:"Image",className:dn["info-box-image"]})}):null,ke.jsxs("div",{className:`${dn["info-box-text"]} ${t&&c&&c.length===0?dn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:ke.jsx("div",{className:dn["info-box-headers"],children:c.map((p,h)=>ke.jsx("div",{className:dn["info-box-header"],children:p},`header-${h}`))}),ke.jsx("div",{className:dn["info-box-title"],children:i||""}),ke.jsx("div",{className:dn["info-box-description"],children:o||""})]}),ke.jsx("div",{className:dn["info-box-actions"],children:ke.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${dn["info-box-button"]} ${dn["info-box-button--restart"]}`,children:[ke.jsx(Tl,{icon:qz}),"From Beginning"]})})]})]})},Ahe=({player:n})=>{const[e,t]=xt.useState(!1);return xt.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r(),n.controls.RegisterSettingsListener(r)},[]),e?ke.jsx(H4,{label:"Content Verification Menu",icon:d2,player:n,MenuComponent:Xz,className:dn["content-verification-menu-button"],children:"Verified"}):null},khe=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(!1);if(xt.useEffect(()=>{h(Nz({player:n,setRecentUserAction:i}));const k=Hz({player:n,setVideoState:c});return()=>k&&k()},[]),!u)return null;const{title:b}=n.controls.GetContentInfo()||{},g=n.controls.GetCollectionInfo(),S=r||!e||n.controls.IsMenuVisible(),A=!S&&n.playerOptions.controls===Dt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!A),ke.jsxs("div",{onClick:p,className:[o,dn.container,S?"":dn.autohide,n.playerOptions.controls!==Dt.controls.DEFAULT?"":dn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[ke.jsx(Ad,{"aria-label":"Play",tabIndex:e?-1:0,icon:$z,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${dn["center-play-button"]} ${dn["icon-button--drop-shadow-focus"]} ${t&&!e&&!n.casting?"":dn["center-play-button--hidden"]}`}),m?ke.jsx(Ehe,{player:n,Hide:()=>w(!1)}):ke.jsxs("div",{className:`${dn["bottom-controls-container"]} ${A?dn["bottom-controls-container--autohide"]:""}`,children:[ke.jsx("div",{className:dn["bottom-controls-gradient"]}),ke.jsxs("div",{className:dn["title-container"],children:[ke.jsx("div",{className:dn.title,children:n.playerOptions.title===Dt.title.OFF||n.playerOptions.title===Dt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":b||""}),ke.jsx("div",{className:dn.spacer}),n.isLive?n.controls.IsDVRAvailable()?ke.jsx(Zz,{player:n}):ke.jsx("div",{className:dn["live-indicator"],children:"Live"}):null,g?ke.jsx(H4,{label:"Collection Menu",icon:Bpe,player:n,MenuComponent:nhe}):null]}),ke.jsx(Jz,{player:n,videoState:u,setRecentUserAction:i}),ke.jsx(She,{player:n,videoState:u}),ke.jsxs("div",{className:dn["bottom-controls"],children:[ke.jsx("div",{className:dn["bottom-left-controls"],children:!b||n.playerOptions.title===Dt.title.OFF?null:ke.jsx("button",{className:dn["text-button"],onClick:()=>w(!0),children:"Info"})}),ke.jsx(Che,{player:n,videoState:u}),ke.jsxs("div",{className:dn["bottom-right-controls"],children:[ke.jsx(Ahe,{player:n}),n.airplayAvailable?ke.jsx(Ad,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:Kz}):null,n.chromecastAvailable?ke.jsx("google-cast-launcher",{}):null,n.controls.GetOptions().hasAnyOptions?ke.jsx(H4,{label:"Settings",player:n,MenuComponent:Qz,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===Dt.watermark.OFF?null:ke.jsx("div",{className:dn.watermark,children:ke.jsx("img",{src:Yz,alt:"Eluvio"})})]},"controls")},Mhe="_container_1l7ln_1",The="_overlay_1l7ln_9",Rhe="_fadein_1l7ln_1",Ohe="_form_1l7ln_22",Lhe="_header_1l7ln_39",Nhe="_input_1l7ln_45",Phe="_actions_1l7ln_92",Ihe="_submit_1l7ln_98",Dhe="_cancel_1l7ln_99",fo={container:Mhe,overlay:The,fadein:Rhe,form:Ohe,header:Lhe,"input-container":"_input-container_1l7ln_45",input:Nhe,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:Phe,submit:Ihe,cancel:Dhe},Uhe=({player:n,Close:e})=>{const[t,r]=xt.useState(JSON.stringify(n.hlsOptions||"{}",null,2)),[i,o]=xt.useState(!1),[u,c]=xt.useState(""),p=xt.useRef();xt.useEffect(()=>{if(!p||!p.current)return;const m=fS({element:p.current,Hide:e});return()=>m&&m()},[p]);const h=async m=>{m.preventDefault();try{o(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(w){c(w.toString()),o(!1)}};return ke.jsx("div",{role:"complementary",tabIndex:-1,className:fo.container,children:ke.jsx("div",{className:fo.overlay,children:ke.jsxs("form",{onSubmit:h,className:fo.form,ref:p,children:[ke.jsx("h2",{className:fo.header,children:"Custom hls.js Options"}),ke.jsxs("div",{className:fo["input-container"],children:[ke.jsx("textarea",{disabled:i,autoFocus:!0,value:t,title:u,"aria-label":"Player Options","aria-invalid":!!u,"aria-errormessage":u||"",onChange:m=>r(m.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),r(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(m){c(m.toString())}},className:`${fo.input} ${u?fo["input--invalid"]:""}`}),ke.jsxs("div",{className:fo["player-info"],children:[ke.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:fo["api-link"],children:"API Docs"}),ke.jsxs("div",{className:fo["player-version"],children:["hls.js ",n.HLS.version]})]})]}),ke.jsxs("div",{className:fo.actions,children:[ke.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:fo.cancel,children:"Cancel"}),ke.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!u,className:fo.submit,children:i?ke.jsx(Lb,{light:!0}):"Submit"})]})]})})})},Fhe=({player:n})=>{const[e,t]=xt.useState(void 0),{posterImage:r}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{t(void 0),r&&dk({player:n,pathOrUrl:r,width:200}).then(i=>t(i))},[r]),e?ke.jsx("img",{alt:"Video Poster",src:e,className:Ys.poster}):null};let Bhe;const zhe=({target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:i,Reset:o})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState("lg"),[b,g]=xt.useState("landscape"),[S,A]=xt.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[k,R]=xt.useState(void 0),[N,P]=xt.useState(!1),[q,V]=xt.useState(!1),[de,oe]=xt.useState(!1),[he,Se]=xt.useState(!1),[Ce,ne]=xt.useState(!1),[Le,C]=xt.useState(!0),[x,O]=xt.useState(void 0),[z,F]=xt.useState(void 0),[H,Q]=xt.useState(!1),ae=xt.useRef(),L=!!u,T=({action:ee,text:j})=>O({action:ee,text:j,key:Math.random()});if(xt.useEffect(()=>{Se(!0);const ee=gpe({target:n,setSize:w,setOrientation:g,setDimensions:A});return()=>{Se(!1),ee&&ee()}},[]),xt.useEffect(()=>{if(!(!ae||!ae.current||!he))try{P(!1),V(!1),e.clientOptions.client=p||e.clientOptions.client;const ee=new u2({target:n,video:ae.current,parameters:e,SetErrorMessage:R});window.__elvPlayer=ee;const j=ee.controls.RegisterSettingsListener(()=>{F(ee.controls.AllowRotation()),V(ee.playbackStarted),P(!ee.loading),ne(ee.__showPlayerProfileForm),Q(ee&&ee.casting)});ee.Destroy=()=>{ee.__DestroyPlayer(),i()},ee.Reset=()=>{o()};const be=vpe({player:ee}),Ie=bpe({player:ee,inactivityPeriod:5e3,onWake:()=>C(!0),onSleep:()=>C(!1)}),Me=wpe({player:ee,setRecentUserAction:T}),De=_pe({player:ee});t(ee),c(ee);const se=ee.controls.RegisterVideoEventListener("canplay",()=>oe(!0));return()=>{ae&&ae.current&&ae.current.removeEventListener("play",V),j&&j(),be&&be(),Ie&&Ie(),Me&&Me(),De&&De(),se&&se(),ee&&ee.__DestroyPlayer()}}catch(ee){r(ee),i()}},[ae,he,p]),xt.useEffect(()=>{if(L)return()=>{u&&u.__DestroyPlayer(),c(void 0)}},[L]),xt.useEffect(()=>{x&&(clearTimeout(Bhe),setTimeout(()=>{O(void 0)},1e3))},[x]),e.clientOptions.promptTicket&&!p)return ke.jsx(yhe,{parameters:e,dimensions:{size:m,orientation:b,...S},onComplete:ee=>h(ee)});const Y=e.playerOptions.ui===Dt.ui.WEB&&u&&u.controls.IsRotatable()&&z;return ke.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Y?S.height:S.width}px`,"--portal-height":`${Y?S.width:S.height}px`},className:[Ys["player-container"],Y?Ys["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!Ce||!N?null:ke.jsx(Uhe,{player:u,Close:()=>u.controls.HidePlayerProfileForm()}),ke.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:ae,muted:[Dt.muted.ON,Dt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Dt.controls.DEFAULT,loop:e.playerOptions.loop===Dt.loop.ON,crossOrigin:"anonymous",className:Ys.video}),!u||!de||q&&!e.playerOptions.permanentPoster?null:ke.jsx(Fhe,{player:u}),N||k||!e.playerOptions.showLoader?null:ke.jsx("div",{className:Ys["spinner-container"],children:ke.jsx(Lb,{className:Ys.spinner})}),H?ke.jsx("div",{className:Ys["cast-indicator-container"],children:ke.jsx("div",{dangerouslySetInnerHTML:{__html:Vpe}})}):null,k?ke.jsxs("div",{className:Ys["error-message"],children:[ke.jsx("div",{className:Ys["error-message__message"],children:k}),ke.jsxs("button",{className:Ys["error-message__copy-debug-button"],onClick:()=>gk(JSON.stringify(u.controls.GetDebugInfo(),null,2)),children:[ke.jsx(Tl,{icon:Gpe,className:Ys["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,u?e.playerOptions.ui===Dt.ui.WEB?ke.jsx(ohe,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:Le,setRecentUserAction:T,className:Ys.controls}):ke.jsx(khe,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:Le,setRecentUserAction:T,className:Ys.controls}):null,x?ke.jsx(Xpe,{action:x},`action-indicator-${x&&x.key}`):null]})},jhe=n=>{const[e,t]=xt.useState(Math.random());return xt.createElement(zhe,{...n,key:`player-${e}`,Reset:()=>t(Math.random())})},Hhe=(n,e)=>(n.innerHTML="",n.classList.add(JG.reset),n.classList.add(Ys["player-target"]),e=Dz(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,r)=>{const i=Gv.createRoot(n);i.render(ke.jsx(GG.StrictMode,{children:ke.jsx(jhe,{target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:async()=>{try{await i.unmount()}catch(o){console.error("Failed to unmount Eluvio Player"),console.error(o)}}})}))}));exports.Initialize=Hhe;exports.PlayerParameters=Dt;exports.commonjsGlobal=Fa;exports.crypto=tI;exports.eventsExports=Wb;exports.getDefaultExportFromCjs=Bd;exports.inherits_browserExports=VI;exports.require$$3=h2;exports.requireBuffer=Nb;exports.string_decoder=V5;
379
+ ${e.length}${e}`,"utf-8")),await this.client.authClient.Sign(e);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:e,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!nb)throw Error("ElvWalletClient: Unable to sign");const t={action:"personal-sign",message:e,logIn:!0};let r=new URL(this.appUrl);if(r.hash=pa("/action","sign",ia.B58(JSON.stringify(t))),r.searchParams.set("origin",window.location.origin),!qde&&window.location.origin===r.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(i,o)=>{await jP({mode:"tab",url:r.toString(),onCancel:()=>o("User cancelled sign"),onMessage:async(u,c)=>{if(!(!u||!u.data||u.data.type!=="FlowResponse"))try{i(u.data.response)}catch(p){o(p)}finally{c()}}})})}async LogInURL({mode:e="login",provider:t,marketplaceParams:r,clearLogin:i}){let o=new URL(this.appUrl);return o.hash="/login",o.searchParams.set("action","login"),typeof window<"u"&&o.searchParams.set("origin",window.location.origin),t&&o.searchParams.set("provider",t),e&&o.searchParams.set("mode",e),r?o.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:r})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&o.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),i&&o.searchParams.set("clear",""),o}async LogIn({method:e="redirect",provider:t,mode:r="login",callbackUrl:i,marketplaceParams:o,clearLogin:u=!1,callback:c}){let p=await this.LogInURL({mode:r,provider:t,marketplaceParams:o,clearLogin:u});e==="redirect"?(p.searchParams.set("response","redirect"),p.searchParams.set("source","origin"),p.searchParams.set("redirect",i),window.location=p):(p.searchParams.set("response","message"),p.searchParams.set("source","parent"),await new Promise(async(h,m)=>{await jP({mode:"tab",url:p.toString(),onCancel:()=>m("User cancelled login"),onMessage:async(w,b)=>{if(!(!w||!w.data||w.data.type!=="LoginResponse"))try{c?await c(w.data.params):await this.Authenticate({token:w.data.params.clientSigningToken||w.data.params.clientAuthToken}),h()}catch(g){m(g)}finally{b()}}})}))}async LogOut(){if(this.__authorization&&this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(e){this.Log("Failed to release token",!0,e)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},Ux)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:e}){let t;try{t=JSON.parse(this.utils.FromB58ToStr(e))||{}}catch{throw new Error("Invalid authorization token "+e)}if(!t.expiresAt||Date.now()>t.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return t.clusterToken&&await this.client.SetRemoteSigner({authToken:t.clusterToken,signerURIs:t.signerURIs}),this.client.SetStaticToken({token:t.fabricToken}),this.SetAuthorization({...t})}async AuthenticateOAuth({idToken:e,tenantId:t,email:r,signerURIs:i,shareEmail:o=!1,extraData:u={},nonce:c,createRemoteToken:p=!0,force:h=!1}){let m=24;!t&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),t=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:e,tenantId:t,signerURIs:i,extraData:{...u,share_email:o},unsignedPublicAuth:!0});let w,b;if(p&&this.client.signer.remoteSigner){b=Date.now()+24*60*60*1e3;const S=await this.client.signer.RetrieveCSAT({email:r,nonce:c,tenantId:t,force:h});w=S.token,c=S.nonce}else b=Date.now()+m*60*60*1e3,w=await this.client.CreateFabricToken({duration:m*60*60*1e3,context:r?{usr:{email:r}}:{}});const g=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!r)try{r=JSON.parse(this.utils.FromB64URL(e.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:w}),{authToken:this.SetAuthorization({fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:c}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",nonce:c})}}async AuthenticateExternalWallet({address:e,tokenDuration:t=24,walletName:r="Metamask",Sign:i}){e||(e=window.ethereum.selectedAddress),e=this.utils.FormatAddress(e),i||(i=async c=>this.SignMetamask({message:c,address:e}));const o=Date.now()+t*60*60*1e3,u=await this.client.CreateFabricToken({address:e,duration:t*60*60*1e3,Sign:i,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:u,address:e,expiresAt:o,walletType:"External",walletName:r,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:e,fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,signerURIs:c,walletType:p,walletName:h,nonce:m,register:w=!1}){i=this.client.utils.FormatAddress(i),this.__authorization={fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,walletType:p,walletName:h,nonce:m},e&&(this.__authorization.clusterToken=e,c&&(this.__authorization.signerURIs=c)),this.loggedIn=!0,this.cachedMarketplaces={};const b=this.ClientAuthToken();if(this.storeAuthToken&&Ux)try{localStorage.setItem(`__elv-token-${this.network}`,b)}catch{}return w&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(g=>{this.Log("Failed to register account: ",!0,g)}),b}async SignMetamask({message:e,address:t}){if(!nb||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");t=t||this.UserAddress();const r=await window.ethereum.request({method:"eth_requestAccounts"});if(t&&!ia.EqualAddress(r[0],t))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${t}, got ${r[0]}`);return await window.ethereum.request({method:"personal_sign",params:[e,t,""]})}FlowURL({type:e="flow",flow:t,marketplaceId:r,parameters:i={}}){const o=new URL(this.appUrl);return r?o.pathname=pa("/",e,t,"marketplace",r,ia.B58(JSON.stringify(i))):o.pathname=pa("/",e,t,ia.B58(JSON.stringify(i))),o.searchParams.set("origin",window.location.origin),o.toString()}async GenerateCodeAuth({url:e}={}){e||(e=await this.LogInURL({mode:"login"}),e.searchParams.set("response","code"),e.searchParams.set("source","code"));const t=await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:e.toString()}}));return t.code=t.id,t.url=t.url.startsWith("https://")?t.url:`https://${t.url}`,t.metamask_url=t.metamask_url.startsWith("https://")?t.metamask_url:`https://${t.metamask_url}`,t}async SetCodeAuth({code:e,address:t,type:r,authToken:i,expiresAt:o,...u}){await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","session",e),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:e,format:"auth_token",payload:JSON.stringify({addr:ia.FormatAddress(t),eth:t?`ikms${ia.AddressToHash(t)}`:"",type:r,token:i,expiresAt:o,...u})}}))}async GetCodeAuth({code:e,passcode:t}){try{return await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","login","redirect","metamask",e,t),method:"GET"}))}catch(r){if(r&&r.status===404)return;throw r}}async LoadAvailableMarketplaces(e=!1){if(!e&&Object.keys(this.availableMarketplaces)>0)return;const t=this.topLevelInfo.marketplaces;let r={...this.availableMarketplaces||{}},i={...this.availableMarketplacesById||{}};t.map(o=>{const u=ia.DecodeVersionHash(o.source_hash).objectId,c=o.slug||o.name;r[o.tenant_slug]=r[o.tenant_slug]||{},r[o.tenant_slug][c]={...o,tenantName:o.tenant_slug,tenantSlug:o.tenant_slug,tenantId:o.tenant_id,marketplaceSlug:c,marketplaceId:u,marketplaceHash:o.source_hash},i[u]=r[o.tenant_slug][c],this.marketplaceHashes[u]=o.source_hash}),this.availableMarketplaces=r,this.availableMarketplacesById=i}async LatestMarketplaceHash({marketplaceParams:e}){const t=await this.MarketplaceInfo({marketplaceParams:e});if(this.previewMarketplaceId&&ia.EqualHash(this.previewMarketplaceId,t.marketplaceId))return this.previewMarketplaceHash;const r=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug),resolveLinks:!1,noAuth:!0});return H8(r)}async LoadMarketplace(e){const t=this.MarketplaceInfo({marketplaceParams:e}),r=t.marketplaceId,i=await this.LatestMarketplaceHash({marketplaceParams:e});if(this.cachedMarketplaces[r]&&this.cachedMarketplaces[r].versionHash!==i&&delete this.cachedMarketplaces[r],!this.cachedMarketplaces[r]){let o;this.previewMarketplaceId&&ia.EqualHash(r,this.previewMarketplaceId)?o=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?pa("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):o=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"info"),localizationSubtree:this.localization?pa("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),o.branding.use_tenant_styling&&(o.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("/public","asset_metadata","tenants",t.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),o.items=await Promise.all(o.items.map(async(u,c)=>{if(u.requires_permissions){let p;this.loggedIn||(p=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:H8(u.nft_template),metadataSubtree:"permissioned",authorizationToken:p}),u.authorized=!0}catch{u.authorized=!1}}return u.nftTemplateMetadata=(u.nft_template||{}).nft||{},u.nftTemplateHash=((u.nft_template||{})["."]||{}).source,u.itemIndex=c,u})),o.collections=(o.collections||[]).map((u,c)=>({...u,collectionIndex:c})),o.retrievedAt=Date.now(),o.marketplaceId=r,o.versionHash=i,o.marketplaceHash=i,this.previewMarketplaceId&&r===this.previewMarketplaceId&&(o.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(u=>{try{if(o.storefront[u]){let c=new URL("https://embed.v3.contentfabric.io");const p=H8(o.storefront[u]);c.searchParams.set("p",""),c.searchParams.set("net",this.network==="main"?"main":"demo"),c.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),c.searchParams.set("vid",p),c.searchParams.set("ap",""),u.startsWith("reveal")||(c.searchParams.set("m",""),c.searchParams.set("lp","")),o.storefront[`${u}_embed_url`]=c.toString()}}catch{}}),this.cachedMarketplaces[r]=o}return this.cachedMarketplaces[r]}async FilteredQuery({mode:e="listings",sortBy:t="created",sortDesc:r=!1,filter:i,editionFilters:o,attributeFilters:u,contractAddress:c,tokenId:p,currency:h,marketplaceParams:m,tenantId:w,collectionIndexes:b,priceRange:g,tokenIdRange:S,capLimit:A,userAddress:k,sellerAddress:R,lastNDays:N=-1,startTime:P,endTime:q,includeCheckoutLocked:V=!1,start:de=0,limit:oe=50}={}){b=(b||[]).map(ne=>parseInt(ne));let he={start:de,limit:oe,sort_descending:r};e==="owned"&&t==="created"&&(t="default"),e!=="leaderboard"&&(he.sort_by=t),e.includes("listings")&&V&&(he.checkout=!0);let Se,Ce;m&&(Se=await this.MarketplaceInfo({marketplaceParams:m}),b.length>0&&(Ce=await this.Marketplace({marketplaceParams:m})));try{let ne=[];R?ne.push(`seller:eq:${this.client.utils.FormatAddress(R)}`):k&&e!=="owned"&&ne.push(`addr:eq:${this.client.utils.FormatAddress(k)}`),Ce&&b.length>=0?b.forEach(F=>{Ce.collections[F].items.forEach(Q=>{if(!Q)return;const ae=Ce.items.find(T=>T.sku===Q);if(!ae)return;const L=ia.SafeTraverse(ae,"nft_template","nft","address");L&&ne.push(`${e==="owned"?"contract_addr":"contract"}:eq:${ia.FormatAddress(L)}`)})}):(Se||w)&&ne.push(`tenant:eq:${Se?Se.tenantId:w}`),c?(e==="owned"?ne.push(`contract_addr:eq:${ia.FormatAddress(c)}`):ne.push(`contract:eq:${ia.FormatAddress(c)}`),p&&ne.push(`token:eq:${p}`)):i&&(e.includes("listing")?ne.push(`nft/display_name:eq:${i}`):e==="owned"?ne.push(`meta/display_name:eq:${i}`):ne.push(`name:eq:${i}`)),o&&o.forEach(F=>{e.includes("listing")?ne.push(`nft/edition_name:eq:${F}`):e==="owned"?(ne.push(`meta:@>:{"edition_name":"${F}"}`),he.exact=!1):ne.push(`edition:eq:${F}`)}),u&&u.map(({name:F,value:H})=>{!F||!H||ne.push(`nft/attributes/${F}:eq:${H}`)}),h&&ne.push("link_type:eq:sol"),P||q?(P&&ne.push(`created:gt:${parseInt(P)/1e3}`),q&&ne.push(`created:lt:${parseInt(q)/1e3}`)):N&&N>0&&ne.push(`created:gt:${(Date.now()/1e3-N*24*60*60).toFixed(0)}`),g&&(g.min&&ne.push(`price:ge:${parseFloat(g.min)}`),g.max&&ne.push(`price:le:${parseFloat(g.max)}`)),S&&(S.min&&ne.push(`info/token_id:ge:${parseInt(S.min)}`),S.max&&ne.push(`info/token_id:le:${parseInt(S.max)}`)),A&&ne.push(`info/cap:le:${parseInt(A)}`);let Le,C;switch(e){case"owned":C=pa("as","wlt",k||this.UserAddress());break;case"owned-full-meta":C=pa("as","apigw","nfts"),Le={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":C=pa("as","mkt","f");break;case"transfers":C=pa("as","mkt","hst","f"),ne.push("action:eq:TRANSFERRED"),ne.push("action:eq:SOLD");break;case"sales":C=pa("as","mkt","hst","f"),ne.push("action:eq:SOLD"),ne.push("seller:co:0x");break;case"listing-stats":C=pa("as","mkt","stats","listed");break;case"sales-stats":C=pa("as","mkt","stats","sold"),ne.push("seller:co:0x");break;case"leaderboard":C=pa("as","wlt","leaders");break}if(ne.length>0&&(he.filter=ne),e.includes("stats"))return await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:he,headers:Le}));const{contents:x,paging:O}=await ia.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:he,headers:Le}))||[],z=["owned","listings","owned-full-meta"];return{paging:{start:he.start,limit:he.limit,total:O.total,more:O.total>de+oe},results:(x||[]).map(F=>z.includes(e)?jde(this,F):F)}}catch(ne){if(ne.status&&ne.status.toString()==="404")return{paging:{start:he.start,limit:he.limit,total:0,more:!1},results:[]};throw ne}}async MintingStatus({marketplaceParams:e,tenantId:t}){t||(t=(await this.MarketplaceInfo({marketplaceParams:e||this.selectedMarketplaceInfo})).tenantId);try{return(await ia.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:pa("as","wlt","status","act",t),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(i=>{let[o,u,c]=i.op.split(":");u=u.startsWith("0x")?ia.FormatAddress(u):u;let p,h,m,w;if(o==="nft-buy"?p=c:o==="nft-claim"?(p=c,i.marketplaceId=u,i.extra&&i.extra[0]&&(u=i.extra.token_addr,h=i.extra.token_id_str)):o==="nft-redeem"?p=i.op.split(":").slice(-1)[0]:h=c,o==="nft-transfer"&&(p=i.extra&&i.extra.trans_id,h=i.extra&&i.extra.token_id_str||h,i.extra&&i.extra.gift_action==="nft-gift-claim"&&(w=i.extra.gift_id)),o==="nft-offer-redeem"&&(m=i.op.split(":")[3]),o==="nft-claim-entitlement"){let[b,g,S,A]=i.op.split(":");p=A,i.extra&&i.extra[0]&&(u=i.extra[0].token_addr,h=i.extra[0].token_id,u=u.startsWith("0x")?ia.FormatAddress(u):u,i.marketplaceId=g)}return{...i,timestamp:new Date(i.ts),state:i.state&&typeof i.state=="object"?Object.values(i.state):i.state,extra:i.extra&&typeof i.extra=="object"?Object.values(i.extra):i.extra,confirmationId:p,op:o,address:ia.FormatAddress(u),tokenId:h,offerId:m,giftId:w}}).sort((i,o)=>i.ts<o.ts?1:-1)}catch(r){return this.Log("Failed to retrieve minting status",!0,r),[]}}async DeployTenant({tenantId:e,tenantSlug:t="",tenantHash:r,environment:i="production"}){if(!r){const c=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:pa("public/asset_metadata/tenants",t),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!c)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${t}`);const p=c["."].source;r=await this.client.LatestVersionHash({versionHash:p})}const o={content_hash:r,env:i,ts:Date.now()},u=await this.client.Sign(JSON.stringify(o));await this.client.authClient.MakeAuthServiceRequest({path:pa("as","tnt","config",e,"metadata"),method:"POST",body:o,headers:{Authorization:`Bearer ${u}`}})}}Object.assign(Od.prototype,Ude());Object.assign(Od.prototype,Fde());Object.assign(Od.prototype,Bde());const{ElvClient:Vde}=$4,Gde=ki;var Wde=Vde,Dd=Gde;const Lz=Object.freeze(Object.defineProperty({__proto__:null,ElvClient:Wde,Utils:Dd},Symbol.toStringTag,{value:"Module"})),HP={default:{label:"Default",hlsSettings:Dd.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Kde{constructor({player:e}){this.player=e,this.visible=!0,this.allowRotation=!0,this._activeMenus=0}__ToggleMenu(e){this._activeMenus=e?this._activeMenus+1:Math.max(0,this._activeMenus-1),this.player.__SettingsUpdate()}IsVisible(){return this.visible}IsMenuVisible(){return this._activeMenus>0}IsReady(){return!this.player.loading}IsPlaying(){return this.player.casting?this.player.castHandler.IsPlaying():!this.player.video.paused}HasPlaybackStarted(){return this.player.playbackStarted}async Play(){return this.player.casting?this.player.castHandler.Play():await this.player.__Play()}Pause(){if(this.player.casting)return this.player.castHandler.Pause();this.player.video.pause()}TogglePlay(){return this.player.casting?this.player.castHandler.TogglePlay():this.player.video.paused?(this.Play(),!0):(this.Pause(),!1)}Stop(){if(this.player.casting)return this.player.castHandler.Stop();this.Pause(),this.Seek({time:0}),this.player.playbackStarted=!1,this.player.__SettingsUpdate()}GetCurrentTime(){return this.player.casting?this.player.castHandler.GetCurrentTime():this.player.video.currentTime}GetDuration(){return this.player.casting?this.player.castHandler.GetDuration():this.player.video.duration}Seek({fraction:e,time:t,relativeSeconds:r}){if(this.player.casting)return this.player.castHandler.Seek({fraction:e,time:t,relativeSeconds:r});if(!this.player.video||e&&!this.player.video.duration)return;this.player.canPlay||(this.Play(),this.Pause());const i=this.player.video.currentTime;return r?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+r)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,i<=this.player.video.currentTime}GetVolume(){return this.player.casting?this.player.castHandler.GetVolume():this.player.video.volume}SetVolume({fraction:e,relativeFraction:t}){return this.player.casting?this.player.castHandler.SetVolume({fraction:e,relativeFraction:t}):(t?this.player.video.volume=Math.min(1,Math.max(0,this.GetVolume()+t)):this.player.video.volume=e,this.player.video.volume>0&&this.Unmute(!1),this.player.video.volume)}IsMuted(){return this.player.casting?this.player.castHandler.IsMuted():this.player.video.muted}Mute(){if(this.player.casting)return this.player.castHandler.Mute();this.player.video.muted=!0}Unmute(){if(this.player.casting)return this.player.castHandler.Unmute();this.player.video.muted=!1}ToggleMuted(){return this.player.casting?this.player.castHandler.ToggleMuted():(this.player.video.muted=!this.player.video.muted,this.player.video.muted)}IsFullscreen(){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===this.player.target}Fullscreen(){this.player.target.requestFullscreen?this.player.target.requestFullscreen({navigationUI:"hide"}):this.player.target.mozRequestFullScreen?this.player.target.mozRequestFullScreen({navigationUI:"hide"}):this.player.target.webkitRequestFullscreen?this.player.target.webkitRequestFullscreen({navigationUI:"hide"}):this.player.target.msRequestFullscreen?this.player.target.msRequestFullscreen({navigationUI:"hide"}):this.player.target.querySelector("video").webkitEnterFullScreen()}ExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}ToggleFullscreen(){return this.IsFullscreen()?(this.ExitFullscreen(),!1):(this.Fullscreen(),!0)}GetCollectionInfo(){if(!this.player.collectionInfo)return;const e={...this.player.collectionInfo};return e.content=e.content.map(t=>({...t,active:t.mediaIndex===e.mediaIndex})),e.active=e.content[e.mediaIndex],e}CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:r}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.min(t.mediaIndex+1,t.mediaLength-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.max(0,t.mediaIndex-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}IsLive(){return this.player.isLive}GetContentInfo(){if(this.player.playerOptions.title!==!1){const e=this.GetCollectionInfo();if(e&&e.active)return{title:e.active.title||"",subtitle:e.active.title||"",description:e.active.description||"",image:e.active.image&&e.active.image.url||"",posterImage:e.active.poster_image&&e.active.poster_image.url||"",headers:e.active.headers||[]};if(this.player.sourceOptions.contentInfo)return{title:this.player.sourceOptions.contentInfo.title,subtitle:this.player.sourceOptions.contentInfo.subtitle,description:this.player.sourceOptions.contentInfo.description,image:this.player.sourceOptions.contentInfo.image,posterImage:this.player.sourceOptions.contentInfo.posterImage,headers:this.player.sourceOptions.contentInfo.headers||[]}}}GetQualityLevels(){let e=[];if(this.player.hlsPlayer){if(e=this.player.hlsPlayer.levels.map((t,r)=>({index:r,active:this.player.hlsPlayer.currentLevel===r&&!this.player.hlsPlayer.autoLevelEnabled,resolution:t.attrs.RESOLUTION,bitrate:t.bitrate,audioTrack:!t.videoCodec,label:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1),e.length>0){const t=e.find(r=>this.player.hlsPlayer.currentLevel===r.index);e.unshift({index:-1,label:"Auto",activeLabel:t?`Auto (${t.activeLabel})`:"Auto",active:this.player.hlsPlayer.autoLevelEnabled})}}else this.player.dashPlayer&&(e=this.player.dashPlayer.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:`${t.width}x${t.height}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1));return{options:e,active:e.find(t=>t.active)}}SetQualityLevel(e){this.player.hlsPlayer?(this.player.hlsPlayer.nextLevel=e,this.player.hlsPlayer.streamController.immediateLevelSwitch()):this.player.dashPlayer&&(this.player.dashPlayer.setQualityFor("video",e),this.player.dashPlayer.updateSettings({streaming:{trackSwitchMode:"alwaysReplace",buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0},abr:{autoSwitchBitrate:{video:e===-1}}}})),this.player.__SettingsUpdate()}GetAudioTracks(){let e=[];return this.player.nativeHLS?e=Array.from(this.player.video.audioTracks).map(t=>({index:t.id,label:t.label||t.language,active:t.enabled})):this.player.hlsPlayer?e=this.player.hlsPlayer.audioTracks.map(t=>({index:t.id,label:t.name,active:t.id===this.player.hlsPlayer.audioTrack})):this.player.dashPlayer&&(e=this.player.dashPlayer.getTracksFor("audio").map(t=>({index:t.index,label:t.labels&&t.labels.length>0?t.labels[0].text:t.lang,active:t.index===this.player.dashPlayer.getCurrentTrackFor("audio").index}))),{options:e,active:e.find(t=>t.active)}}SetAudioTrack(e){if(this.player.nativeHLS)Array.from(this.player.video.audioTracks).forEach(t=>t.enabled=e.toString()===t.id),this.Seek({time:this.GetCurrentTime()-.1});else if(this.player.hlsPlayer)this.player.hlsPlayer.audioTrack=e,this.player.hlsPlayer.streamController.immediateLevelSwitch();else if(this.player.dashPlayer){const t=this.player.dashPlayer.getTracksFor("audio").find(r=>r.index===e);this.player.dashPlayer.setCurrentTrack(t)}}GetTextTracks(){let e=[],t;return this.player.nativeHLS||this.player.hlsPlayer?(t=Array.from(this.player.video.textTracks).findIndex(r=>r.mode==="showing"),e=Array.from(this.player.video.textTracks).map((r,i)=>({index:i,label:r.label||r.language,language:r.language,active:r.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((r,i)=>({index:i,label:r.labels&&r.labels.length>0?r.labels[0].text:r.lang,language:r.lang,active:i===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(r=>r.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(r=>r.mode="disabled"),e>=0&&(t[e].mode="showing")}else this.player.dashPlayer&&this.player.dashPlayer.setTextTrack(e);e>=0&&(this.__lastTextTrackIndex=e),setTimeout(()=>this.player.__SettingsUpdate(),500)}ToggleTextTrack(){const{active:e,options:t}=this.GetTextTracks();if(t.length!==0){if(e&&e.index>=0)return this.SetTextTrack(-1),!1;if(this.__lastTextTrackIndex>=0)return this.SetTextTrack(this.__lastTextTrackIndex),!0;for(const r of navigator.languages){const i=t.find(o=>o.language===r||o.language===r.split("-")[0]);if(i)return this.SetTextTrack(i.index),!0}return this.SetTextTrack(0),!0}}GetPlaybackRate(){return this.player.casting?this.player.castHandler.GetPlaybackRate():this.player.video.playbackRate||1}GetPlaybackRates(){const e=this.GetPlaybackRate();let t=["0.25","0.5","0.75","1","1.25","1.5","1.75","2"];this.player.casting&&(t=["0.5","0.75","1","1.25","1.5","1.75","2"]),t=t.map((i,o)=>({index:o,rate:parseFloat(i),label:`${i}x`,active:e.toFixed(2)===parseFloat(i).toFixed(2)}));let r=t.find(i=>i.active);return r||(r={index:-1,rate:this.GetPlaybackRate(),label:`${this.GetPlaybackRate()}x`,active:!0}),{options:t,active:r}}SetPlaybackRate({index:e,rate:t}){if(this.player.casting)return this.player.castHandler.SetPlaybackRate({index:e,rate:t});const r=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:r<=t};{const i=this.GetPlaybackRates().options[e];if(i)return this.player.video.playbackRate=i.rate,this.player.__SettingsUpdate(),{rate:i.rate,increase:r<=i.rate}}}IsDVRAvailable(){return this.player.dvrAvailable&&!this.player.casting&&isFinite(this.GetDuration())}IsDVREnabled(){return this.player.dvrEnabled}SetDVREnabled(e){const t=this.player.dvrEnabled;return this.player.dvrEnabled=this.IsDVRAvailable()&&e,this.player.__SettingsUpdate(),t&&!this.player.dvrEnabled&&this.Seek({time:this.GetDuration()-2}),this.player.dvrEnabled}GetPlayerProfiles(){let e=[];return this.player.hlsPlayer&&(e=Object.keys(HP).map(t=>({index:t,label:HP[t].label,active:this.player.playerOptions.playerProfile===t}))),{options:e,active:e.find(t=>t.active)}}SetPlayerProfile({profile:e,customOptions:t={}}){this.player.SetPlayerProfile({profile:e,customHLSOptions:t})}ShowPlayerProfileForm(){this.player.__showPlayerProfileForm=!0,this.player.__SettingsUpdate()}HidePlayerProfileForm(){this.player.__showPlayerProfileForm=!1,this.player.__SettingsUpdate()}ContentVerified(){return this.player.contentVerified||!1}GetContentVerificationDetails(){return this.player.contentAudit||!1}GetOptions(){let e={quality:this.GetQualityLevels(),audio:this.GetAudioTracks(),text:this.GetTextTracks(),profile:this.GetPlayerProfiles(),rate:this.GetPlaybackRates()};return e.hasQualityOptions=e.quality.options.length>0,e.hasAudioOptions=e.audio.options.length>0,e.hasTextOptions=e.text.options.length>0,e.hasProfileOptons=e.profile.options.length>0,e.hasRateOptions=!this.IsLive(),e.hasAnyOptions=e.hasQualityOptions||e.hasAudioOptions||e.hasTextOptions||e.hasProfileOptons||e.hasRateOptions,e}AllowRotation(){return this.allowRotation}SetAllowRotation(e){this.allowRotation=e,this.player.__SettingsUpdate()}IsRotatable(){return this.IsFullscreen()&&window.innerWidth<900&&window.innerHeight>window.innerWidth&&this.player.video.videoWidth>this.player.video.videoHeight}RegisterVideoEventListener(e,t){return this.player.__RegisterVideoEventListener(e,t)}RegisterSettingsListener(e){return this.player.__RegisterSettingsListener(e)}Reset(){this.player.Reset()}Destroy(){this.player.Destroy()}GetDebugInfo(){const e=JSON.parse(JSON.stringify(this.player.sourceOptions));delete e.playoutOptions;let t=this.player.__error&&JSON.parse(JSON.stringify(this.player.__error));return t&&Object.keys(t).length===0&&(t=this.player.__error.toString()),{appUrl:window.location.href,userAddress:this.player.userAddress,userAgent:navigator.userAgent,userLanguage:navigator.language,playoutUrl:this.player.playoutUrl,sourceOptions:e,error:t}}}const Pn={PLAY:"play",PAUSE:"pause",MUTE:"muted",UNMUTE:"unmuted",VOLUME_UP:"volumeup",VOLUME_DOWN:"volumedown",SEEK_BACK:"seekback",SEEK_FORWARD:"seekforward",PLAYBACK_RATE_UP:"playbackrateup",PLAYBACK_RATE_DOWN:"playbackratedown",SUBTITLES_ON:"subtitleson",SUBTITLES_OFF:"subtitlesoff",PLAY_NEXT:"playnext",PLAY_PREVIOUS:"playprevious"},Nz=({player:n,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:r=300})=>{let i,o,u,c;return window.addEventListener("focus",()=>{u=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(o),p.target===p.currentTarget&&p.currentTarget.contains(u)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-i<r){const h=p.target.getBoundingClientRect(),m=(p.clientX-h.left)/h.width;m<=t?(n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"})):m>=1-t?(n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"})):n.controls.ToggleFullscreen()}else o=setTimeout(()=>{const h=n.controls.TogglePlay();e({action:h?Pn.PLAY:Pn.PAUSE})},r);u=p.target,i=Date.now()}},Pz=(n,e)=>{let t=0;return()=>r=>{r.repeat||(t=0);const i=t<5?5:t<15?10:t<40?30:60;switch(r.key){case"ArrowLeft":r.preventDefault(),n.controls.Seek({relativeSeconds:-i}),e({action:Pn.SEEK_BACK,text:`${i} seconds`});break;case"ArrowRight":r.preventDefault(),n.controls.Seek({relativeSeconds:i}),e({action:Pn.SEEK_FORWARD,text:`${i} seconds`});break;default:return}t+=1}},Yde=n=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),n.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),n.controls.IsMuted()?n.controls.SetVolume({fraction:.05}):n.controls.SetVolume({relativeFraction:.05});break}},o2=(n,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=n>60*60,r=Math.floor(n/60/60),i=Math.floor(n/60%60),o=Math.floor(n%60);let u=`${i.toString().padStart(t?2:1,"0")}:${o.toString().padStart(2,"0")}`;return t&&(u=`${r.toString()}:${u}`),u},dk=async({player:n,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")))return e;if(e&&e.url)return e.url;const r=await n.__Client();let i;const{mediaCatalogObjectId:o,mediaCatalogVersionHash:u}=n.sourceOptions&&n.sourceOptions.mediaCollectionOptions||{},c=n.sourceOptions&&n.sourceOptions.playoutParameters||{};return u?i=u:o?i=await r.LatestVersionHash({objectId:o}):c.versionHash?i=c.versionHash:i=await r.LatestVersionHash({objectId:c.objectId}),i?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await r.FileUrl({versionHash:i,filePath:e.replace(/^files/,""),queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken}):await r.LinkUrl({versionHash:i,linkPath:e,queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken})):""},Iz=(n,e)=>{let t={};return Object.keys(n).forEach(r=>{if(typeof n[r]=="object"&&!Array.isArray(n[r]))t[r]=Iz(n[r],(e||{})[r]);else{const i=(e||{})[r];t[r]=typeof i<"u"?i:n[r]}}),t},Dz=n=>Iz($G,n),Jde=/iPhone|iPad|iPod/i.test(navigator.userAgent),$P=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),Qde={default:{label:"Default",hlsSettings:Dd.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Dd.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class u2{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:r,SetErrorMessage:i}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new Kde({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.dvrAvailable=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=$P&&r.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Dt.controls.ON,Dt.controls.AUTO_HIDE].includes(r.playerOptions.controls),this.__error=void 0,this.SetErrorMessage=(o,u)=>{i(o),this.__error=u};try{r.playerOptions.hlsjsOptions&&Object.keys(r.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=r.playerOptions.hlsjsOptions,r.playerOptions.playerProfile=Dt.playerProfile.CUSTOM)}catch(o){this.Log(o,!0)}this.__Initialize(r)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>Lz);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.staticToken&&this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken}),this.clientOptions.client})(),await this.clientPromise),!this.__tokenResolved){const e=(this.sourceOptions.playoutParameters||{}).authorizationToken||this.clientOptions.client.staticToken;if(e)try{JSON.parse(Dd.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:7*24*60*60*1e3}))}catch{}this.__tokenResolved=!0}return this.userAddress=this.clientOptions.client.CurrentAccountAddress(),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const g=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(g.mediaHash).objectId,t.versionHash=g.mediaHash,this.sourceOptions.playoutOptions=void 0}let r,i,o={ignore_trimming:t.ignoreTrimming,resolve:t.resolve};if((t.clipStart||t.clipEnd)&&(o.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(o.clip_end=parseFloat(t.clipEnd))),!t.channel){let g=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(r=g.default?"default":Object.keys(g)[0],t.offering?r=g[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?r=t.offerings.find(A=>g[A]):t.offerings&&t.offerings.length>0&&(r=t.offerings.find(A=>g[A])),!r)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const S=g[r]&&g[r].properties||{};i=g[r].uri,this.sourceOptions.contentInfo.liveDVR===Dt.liveDVR.ON&&S.dvr_available?(o.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=S.live}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:i,options:o})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||r,options:o}));let u=(await e.AvailableDRMs()).filter(g=>(this.sourceOptions.drms||[]).includes(g)),c=this.sourceOptions.protocols,p,h;for(;!(p&&h);){p=c.find(S=>this.sourceOptions.playoutOptions[S]);const g=Object.keys(this.sourceOptions.playoutOptions[p].playoutMethods);if(h=(this.sourceOptions.drms||[]).length===0?g.find(S=>S!=="clear")||g[0]:this.sourceOptions.drms.sort().reverse().find(S=>u.includes(S)&&this.sourceOptions.playoutOptions[p].playoutMethods[S]),!h&&(c=c.filter(S=>S!==p),c.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:m,drms:w}=this.sourceOptions.playoutOptions[p].playoutMethods[h],b=m.split("/").find(g=>g.startsWith("hq__"));return{playoutParameters:{...t,options:o},protocol:p,drm:h,playoutUrl:m,versionHash:b,drms:w,availableDRMs:u,offeringURI:i,offering:r,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){t&&(e=this.collectionInfo.content.find(i=>i.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof r<"u"?r:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:r}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!r)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const i=await this.__Client();try{const o=this.sourceOptions.playoutParameters.authorizationToken;t=t||await i.LatestVersionHash({objectId:e});const c=(await i.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:o,produceLinkUrls:!0})||[]).find(p=>p.id===r);if(!c)throw{displayMessage:`No collection with ID ${r} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,h)=>({...p,active:h===0,mediaId:p.id,mediaIndex:h,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(m=>m.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(o){throw this.Log("Failed to load collection:"),o}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.initialized=!1,this.loading=!0,this.initTime=Date.now(),this.restartParameters=t,this.__SettingsUpdate(),e&&(this.originalParameters=Dz(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=Dt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new yW({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",w=>{this.airplayAvailable=w.availability==="available",this.__SettingsUpdate()}),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.video.textTracks&&this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.video.audioTracks&&this.video.audioTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.playerOptions.startTime?this.controls.Seek({time:parseFloat(this.playerOptions.startTime)}):this.playerOptions.startProgress&&this.controls.Seek({fraction:parseFloat(this.playerOptions.startProgress)}),this.playerOptions.autoplay===Dt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const w=this.video.duration-this.video.currentTime;this.behindLiveEdge=w>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{versionHash:r,playoutUrl:i,protocol:o,drm:u,drms:c,multiviewOptions:p,playoutParameters:h}=await this.__PlayoutOptions();this.contentHash=r,i=new URL(i);const m=this.sourceOptions.playoutParameters.authorizationToken||i.searchParams.get("authorization");if(this.authorizationToken=m,this.playoutUrl=i.toString(),this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:h}),this.__destroyed)return;o==="hls"?await this.__InitializeHLS({playoutUrl:i,authorizationToken:m,drm:u,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:i,authorizationToken:m,drm:u,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-DeZ-NgkZ.js")).then(({InitializeMuxMonitoring:w})=>w({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:i,authorizationToken:m,disableCookies:this.playerOptions.collectVideoAnalytics===Dt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer(),this.initialized=!0,this.restartParameters=void 0}catch(r){let i;if(r&&[401,403].includes(r.status)||[401,403].includes(r.code))try{const o=await this.__Client(),u=this.sourceOptions.playoutParameters.linkPath?await o.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await o.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});i=await o.ContentObjectMetadata({versionHash:u,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),i?(r.permission_message=i,this.SetErrorMessage(i,r),typeof r=="object"?r.permission_message=i:this.Log(i,!0)):this.SetErrorMessage(r.displayMessage||"Insufficient permissions",r)}catch(o){this.SetErrorMessage(o.displayMessage||"Insufficient permissions",o)}else r.status>=500?this.__HardReload(r,1e4):this.__HardReload(r,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(r,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,drms:i,multiviewOptions:o}){this.HLS=(await Promise.resolve().then(()=>require("./hls-VH5py-kh.js"))).default;const u=this.video.canPlayType("application/vnd.apple.mpegURL");if(u&&Jde&&this.playerOptions.preferNativeHLS||[Dt.drms.FAIRPLAY,Dt.drms.SAMPLE_AES].includes(r)||!this.HLS.isSupported()){if(this.nativeHLS=!0,r===Dt.drms.FAIRPLAY?hW({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),o.enabled){const c=o.SwitchView;o.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(r===Dt.drms.PLAYREADY||r===Dt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(w,b)=>{w.open("POST",b,!0),w.setRequestHeader("Authorization",`Bearer ${t}`)}},r===Dt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:i[r].licenseServers[0]}}:r===Dt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:i[r].licenseServers[0]}}));const p=(Qde[this.playerOptions.playerProfile]||{}).hlsSettings||{},h=this.playerOptions.playerProfile===Dt.playerProfile.CUSTOM?this.customHLSOptions:{};this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:w=>(w.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(w),w),...c,...p,...h},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const m=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&m.on(this.HLS.Events.MANIFEST_PARSED,(w,{levels:b,firstLevel:g})=>{let S=b.map((A,k)=>A.bitrate>this.playerOptions.maxBitrate?k:void 0).filter(A=>typeof A<"u").reverse();S.length===b.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),S=S.filter(A=>A>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(S.map(A=>[b[A].width,"x",b[A].height,` (${(b[A].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),S.find(A=>g===A)&&(m.startLevel=b.map((A,k)=>k).filter(A=>!S.includes(A)).reverse()[0]),S.map(A=>m.removeLevel(A))}),m.loadSource(e.toString()),m.attachMedia(this.video),this.controls&&o.enabled){const w=o.SwitchView;o.SwitchView=async b=>{await w(b),m.nextLevel=m.currentLevel},this.controls.InitializeMultiViewControls(o)}if([this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(w=>m.on(w,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&m.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const w=(this.controls.GetAudioTracks().options||[]).find(b=>b.label===this.sourceOptions.playoutParameters.audioTrackLabel);w&&this.controls.SetAudioTrack(w.index)}),this.SetPlayerProfile=async({profile:w,customHLSOptions:b={}})=>{this.videoDuration=void 0,this.playerOptions.playerProfile=w,this.customHLSOptions=b;const g=!this.video.paused,S=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(A){this.Log("Failed to destroy HLS player",!0),this.Log(A,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,multiviewOptions:o}),g?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=S)},m.on(this.HLS.Events.FRAG_LOADED,()=>this.errors=0),m.on(this.HLS.Events.ERROR,async(w,b)=>{this.errors+=1,this.Log(`Encountered ${b.details}`,!0),this.Log(b,!0),b.response&&b.response.code===403?this.SetErrorMessage("Insufficient permissions",b):this.errors<5?b.fatal&&(b.data&&b.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError"),m.recoverMediaError()):this.__HardReload(b)):this.__HardReload(b)}),this.hlsPlayer=m,this.player=m,u){const w=document.createElement("source");w.src=this.playoutUrl.toString(),this.video.appendChild(w),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:r,drms:i}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-DiOTJHXz.js")).then(c=>c.dash_all_min)).default;const o=this.Dash.MediaPlayer().create(),u=this.playerOptions.dashjsOptions||{};if(o.updateSettings({...u,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(u.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(u.streaming||{}).text||{}},...u.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&o.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&o.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),o.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),r===Dt.drms.WIDEVINE){const c=i.widevine.licenseServers[0];o.setProtectionData({"com.widevine.alpha":{serverURL:c}})}o.initialize(this.video,e.toString(),this.playerOptions.autoplay===Dt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>o.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&o.on(this.Dash.MediaPlayer.events.CAN_PLAY,()=>{const c=(this.controls.GetAudioTracks().options||[]).find(p=>p.label===this.sourceOptions.playoutParameters.audioTrackLabel);c&&this.controls.SetAudioTrack(c.index)}),this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.player=o,this.dashPlayer=o}async __Play(){try{return await this.video.play(),!0}catch(e){if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Dt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const r=await this.__Client();let i=!1;try{await r.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{i=!0}let o=new URL((await r.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),u=`s/${r.NetworkInfo().name}`;return i&&(u=`t/${t}`),o.pathname=`${u}/q/${e}/meta/public`,o.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const r=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:r,address:e.utils.HashToAddress(r),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,r=await e.ContentObjectTenantId({objectId:t}),i=await e.ContentSpaceId();let o,u,c;try{u=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),u&&(u=new Date(parseInt(u._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{o=await e.ContentObjectMetadata({libraryId:i.replace("ispc","ilib"),objectId:r.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:r,tenantAddress:e.utils.HashToAddress(r),tenantName:o,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:u,versionCount:c,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const p=new URL("https://explorer.contentfabric.io/api");p.searchParams.set("module","account"),p.searchParams.set("action","txlist"),p.searchParams.set("offset","1"),p.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(p)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.castHandler&&this.castHandler.Destroy(),this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=$P&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0}}async __HardReload(e,t=6e3){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}try{if(e&&this.playerOptions.restartCallback)try{const r=await this.playerOptions.restartCallback(e);if(r&&typeof r=="boolean"){this.Destroy();return}}catch(r){this.Log("Restart callback failed:"),this.Log(r)}if(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(r=>setTimeout(r,t)),this.__destroyed)return;this.Log("Reloading stream");try{const r=await this.__Client();r.region?await r.UseRegion({region:r.region}):r.Nodes().fabricURIs.length>1&&await r.ResetRegion()}catch(r){this.Log("Client region reset failed:"),this.Log(r)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,!this.video||!this.initialized?this.restartParameters:{muted:this.video.muted,volume:this.video.volume,currentTime:this.video.currentTime,playing:!this.video.paused})}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}__SetCasting(e){e&&(this.controls.SetDVREnabled(!1),this.controls.Pause()),this.casting=e,this.__SettingsUpdate()}}u2.EluvioPlayerParameters=Dt;u2.EluvioPlayer=u2;var Uz=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(i,o){return i[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=n(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=n(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var u=o[i];t.call(r,u[1],u[0])}},e}()}(),j4=typeof window<"u"&&typeof document<"u"&&window.document===document,l2=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Zde=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(l2):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),Xde=2;function epe(n,e){var t=!1,r=!1,i=0;function o(){t&&(t=!1,n()),r&&c()}function u(){Zde(o)}function c(){var p=Date.now();if(t){if(p-i<Xde)return;r=!0}else t=!0,r=!1,setTimeout(u,e);i=p}return c}var tpe=20,npe=["top","right","bottom","left","width","height","size","weight"],rpe=typeof MutationObserver<"u",ape=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=epe(this.refresh.bind(this),tpe)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!j4||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),rpe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!j4||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=npe.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),Fz=function(n,e){for(var t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];Object.defineProperty(n,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return n},sm=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||l2},Bz=cS(0,0,0,0);function c2(n){return parseFloat(n)||0}function qP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(r,i){var o=n["border-"+i+"-width"];return r+c2(o)},0)}function ipe(n){for(var e=["top","right","bottom","left"],t={},r=0,i=e;r<i.length;r++){var o=i[r],u=n["padding-"+o];t[o]=c2(u)}return t}function spe(n){var e=n.getBBox();return cS(0,0,e.width,e.height)}function ope(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return Bz;var r=sm(n).getComputedStyle(n),i=ipe(r),o=i.left+i.right,u=i.top+i.bottom,c=c2(r.width),p=c2(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+o)!==e&&(c-=qP(r,"left","right")+o),Math.round(p+u)!==t&&(p-=qP(r,"top","bottom")+u)),!lpe(n)){var h=Math.round(c+o)-e,m=Math.round(p+u)-t;Math.abs(h)!==1&&(c-=h),Math.abs(m)!==1&&(p-=m)}return cS(i.left,i.top,c,p)}var upe=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof sm(n).SVGGraphicsElement}:function(n){return n instanceof sm(n).SVGElement&&typeof n.getBBox=="function"}}();function lpe(n){return n===sm(n).document.documentElement}function cpe(n){return j4?upe(n)?spe(n):ope(n):Bz}function fpe(n){var e=n.x,t=n.y,r=n.width,i=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return Fz(u,{x:e,y:t,width:r,height:i,top:t,right:e+r,bottom:i+t,left:e}),u}function cS(n,e,t,r){return{x:n,y:e,width:t,height:r}}var dpe=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=cS(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=cpe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),ppe=function(){function n(e,t){var r=fpe(t);Fz(this,{target:e,contentRect:r})}return n}(),hpe=function(){function n(e,t,r){if(this.activeObservations_=[],this.observations_=new Uz,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof sm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new dpe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof sm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new ppe(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),zz=typeof WeakMap<"u"?new WeakMap:new Uz,jz=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=ape.getInstance(),r=new hpe(e,t,this);zz.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){jz.prototype[n]=function(){var e;return(e=zz.get(this))[n].apply(e,arguments)}});var ype=function(){return typeof l2.ResizeObserver<"u"?l2.ResizeObserver:jz}();const fS=({element:n,Hide:e})=>{if(!n)return;const t=o=>{o&&(o.key||"").toLowerCase()==="escape"&&e()},r=o=>{n.contains(o.target)||e()};let i=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",r,!0)},0);return()=>{clearTimeout(i),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",r,!0)}},Hz=({player:n,setVideoState:e})=>{const t=function(){if(!n||!n.controls)return;const o=n.video.buffered;let u=0;for(let c=0;c<o.length;c++)o.start(c)>n.controls.GetCurrentTime()||o.end(c)>u&&(u=o.end(c));e({playing:n.controls.IsPlaying(),duration:n.controls.GetDuration(),volume:n.controls.GetVolume(),muted:n.controls.IsMuted(),rate:n.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},r=["play","pause","volumechange","seeked","durationchange","ratechange"];r.map(o=>n.video.addEventListener(o,t)),n.target.addEventListener("fullscreenchange",t);const i=n.castHandler&&n.castHandler.RegisterListener(t);return()=>{r.map(o=>n.video.removeEventListener(o,t)),n.target.removeEventListener("fullscreenchange",t),i&&i()}},mpe=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const r=n.buffered;let i=0;for(let o=0;o<r.length;o++)r.start(o)>n.currentTime||r.end(o)>i&&(i=r.end(o));e(1-(n.duration-i)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},pk=({player:n,rate:e=10,setCurrentTime:t})=>{const r=setInterval(()=>{n.controls&&t(n.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(r)}},gpe=({target:n,setSize:e,setOrientation:t,setDimensions:r})=>{let i;const o=()=>{clearTimeout(i);const c=n.getBoundingClientRect();let p="sm",h="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(h="portrait"),e(p),t(h),i=setTimeout(()=>{r({width:c.width,height:c.height})},500)};o();const u=new ype(o);return u.observe(n),()=>u.disconnect()},vpe=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===Dt.autoplay.WHEN_VISIBLE,r=n.playerOptions.muted===Dt.muted.WHEN_NOT_VISIBLE;if(!t&&!r)return;let i,o;const u=async([p])=>{t&&(i!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),i="play"):i!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),i="pause")),r&&(o!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,o="unmute"):o!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,o="mute"))},c=new window.IntersectionObserver(u,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},bpe=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:r})=>{let i;const o=p=>{clearTimeout(i),r&&r(),i=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},u=["play","pause","volumechange","seeking"];u.forEach(p=>n.video.addEventListener(p,o));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,o)),()=>{u.map(p=>n.video.removeEventListener(p,o)),c.map(p=>n.target.removeEventListener(p,o))}},wpe=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===Dt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===Dt.keyboardControls.ARROW_KEYS_DISABLED,r=Pz(n,e)(),i=o=>{if(!(n.target===o.target||n.target.contains(o.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let u;switch(o.key){case" ":case"k":u=n.controls.TogglePlay(),e({action:u?Pn.PLAY:Pn.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":u=n.controls.ToggleMuted(),e({action:u?Pn.MUTE:Pn.UNMUTE});break;case"ArrowDown":t||(u=n.controls.SetVolume({relativeFraction:-.1}),e({action:u===0?Pn.MUTE:Pn.VOLUME_DOWN,text:(u*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(u=n.controls.SetVolume({relativeFraction:.1}),e({action:Pn.VOLUME_UP,text:(u*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Pn.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Pn.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||r(o);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?u=n.controls.SetPlaybackRate({index:c.active.index+(o.key==="<"?-1:1)}):u=n.controls.SetPlaybackRate({rate:1}),u&&e({action:u.increase?Pn.PLAYBACK_RATE_UP:Pn.PLAYBACK_RATE_DOWN,text:`${u.rate.toFixed(2)}x`});break;case"c":u=n.controls.ToggleTextTrack(),e({action:u?Pn.SUBTITLES_ON:Pn.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Pn.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Pn.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Pn.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Pn.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u=n.controls.Seek({fraction:parseFloat(o.key)*.1}),e({action:u?Pn.SEEK_FORWARD:Pn.SEEK_BACK});break;default:return}o.preventDefault()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},_pe=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(i=>{navigator.mediaSession.setActionHandler(i,o=>{switch(i){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||10});break;case"seekto":o&&typeof o.seekTime<"u"&&n.controls.Seek({time:o.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const r=n.controls.RegisterSettingsListener(()=>{const{title:i}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==i)&&(navigator.mediaSession.metadata=new MediaMetadata({title:i}))});return()=>{clearInterval(t),r&&r(),navigator.mediaSession.metadata=null,e.forEach(i=>{navigator.mediaSession.setActionHandler(i,null)})}}},xpe="_container_fm2ri_1",Spe="_autohide_fm2ri_41",Cpe="_fadein_fm2ri_1",Epe="_seek_fm2ri_174",Ape="_controls_fm2ri_207",kpe="_time_fm2ri_221",Mpe="_spacer_fm2ri_279",Tpe="_watermark_fm2ri_291",Rpe="_menu_fm2ri_37",zn={container:xpe,"container--default-controls":"_container--default-controls_fm2ri_33","bottom-controls-container":"_bottom-controls-container_fm2ri_37",autohide:Spe,"info-container":"_info-container_fm2ri_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_fm2ri_45","icon-button":"_icon-button_fm2ri_51","icon-button-active":"_icon-button-active_fm2ri_65",fadein:Cpe,"info-image-container":"_info-image-container_fm2ri_106","info-image":"_info-image_fm2ri_106","info-text":"_info-text_fm2ri_122","info-headers":"_info-headers_fm2ri_131","info-description":"_info-description_fm2ri_141","info-title":"_info-title_fm2ri_147","info-subtitle":"_info-subtitle_fm2ri_152","center-play-button":"_center-play-button_fm2ri_160","center-play-button--hidden":"_center-play-button--hidden_fm2ri_167",seek:Epe,"bottom-controls-gradient":"_bottom-controls-gradient_fm2ri_194",controls:Ape,"play-pause-button":"_play-pause-button_fm2ri_217",time:kpe,"live-indicator":"_live-indicator_fm2ri_231","live-indicator--faded":"_live-indicator--faded_fm2ri_241","collection-button-container":"_collection-button-container_fm2ri_249","collection-button-text":"_collection-button-text_fm2ri_254","collection-button-container--loading":"_collection-button-container--loading_fm2ri_263",spacer:Mpe,"floating-volume-toggle":"_floating-volume-toggle_fm2ri_283",watermark:Tpe,"content-verified-badge":"_content-verified-badge_fm2ri_302","content-verification-menu-button":"_content-verification-menu-button_fm2ri_303","menu-control-container":"_menu-control-container_fm2ri_317",menu:Rpe},$z='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',qz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',Vz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',Ope='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',Gz='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="15" cy="15" r="15" fill="currentColor"/><path d="M10 8H14V22H10V8ZM16 8H20V22H16V8Z" fill="black"/></svg>',Lpe='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',Npe='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',Ppe='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',hk='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',Wz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Ipe='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',f2='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',Dpe='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',VP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',Upe='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',GP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',Fpe='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',yk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',mk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',Bpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',rh='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',zpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',jpe='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',Hpe='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',$pe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',d2='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',WP='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',qpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',Kz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',Vpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cast"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',Gpe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>';(function(n,e){(function(t,r){r()})(Fa,function(){function t(i){var o=!0,u=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function h(V){return!!(V&&V!==document&&V.nodeName!=="HTML"&&V.nodeName!=="BODY"&&"classList"in V&&"contains"in V.classList)}function m(V){var de=V.type,oe=V.tagName;return!!(oe==="INPUT"&&p[de]&&!V.readOnly||oe==="TEXTAREA"&&!V.readOnly||V.isContentEditable)}function w(V){V.classList.contains("focus-visible")||(V.classList.add("focus-visible"),V.setAttribute("data-focus-visible-added",""))}function b(V){V.hasAttribute("data-focus-visible-added")&&(V.classList.remove("focus-visible"),V.removeAttribute("data-focus-visible-added"))}function g(V){V.metaKey||V.altKey||V.ctrlKey||(h(i.activeElement)&&w(i.activeElement),o=!0)}function S(V){o=!1}function A(V){h(V.target)&&(o||m(V.target))&&w(V.target)}function k(V){h(V.target)&&(V.target.classList.contains("focus-visible")||V.target.hasAttribute("data-focus-visible-added"))&&(u=!0,window.clearTimeout(c),c=window.setTimeout(function(){u=!1},100),b(V.target))}function R(V){document.visibilityState==="hidden"&&(u&&(o=!0),N())}function N(){document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("mouseup",q),document.addEventListener("pointermove",q),document.addEventListener("pointerdown",q),document.addEventListener("pointerup",q),document.addEventListener("touchmove",q),document.addEventListener("touchstart",q),document.addEventListener("touchend",q)}function P(){document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",q),document.removeEventListener("pointermove",q),document.removeEventListener("pointerdown",q),document.removeEventListener("pointerup",q),document.removeEventListener("touchmove",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchend",q)}function q(V){V.target.nodeName&&V.target.nodeName.toLowerCase()==="html"||(o=!1,P())}document.addEventListener("keydown",g,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",R,!0),N(),i.addEventListener("focus",A,!0),i.addEventListener("blur",k,!0),i.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&i.host?i.host.setAttribute("data-js-focus-visible",""):i.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var r;try{r=new CustomEvent("focus-visible-polyfill-ready")}catch{r=document.createEvent("CustomEvent"),r.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(r)}typeof document<"u"&&t(document)})})();const Yz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",Wpe="_spinner_vz46q_1",Kpe="_spin_vz46q_1",Ype="_svg_vz46q_16",Jpe="_menu_vz46q_276",Qpe="_fadein_vz46q_1",Zpe="_fadeout_vz46q_1",Ct={spinner:Wpe,spin:Kpe,"spinner--light":"_spinner--light_vz46q_12",svg:Ype,"user-action-indicator-container":"_user-action-indicator-container_vz46q_23","action-indicator-fade-out":"_action-indicator-fade-out_vz46q_1","user-action-indicator-text":"_user-action-indicator-text_vz46q_40","user-action-indicator":"_user-action-indicator_vz46q_23","action-indicator-icon-scale":"_action-indicator-icon-scale_vz46q_1","user-action-indicator-icon":"_user-action-indicator-icon_vz46q_60","seek-container":"_seek-container_vz46q_69","seek-playhead":"_seek-playhead_vz46q_92","seek-buffer":"_seek-buffer_vz46q_93","seek-input":"_seek-input_vz46q_94","volume-controls":"_volume-controls_vz46q_201","volume-slider":"_volume-slider_vz46q_208","volume-input":"_volume-input_vz46q_224","volume-progress":"_volume-progress_vz46q_225",menu:Jpe,fadein:Qpe,"menu-option":"_menu-option_vz46q_296","menu-option-back":"_menu-option-back_vz46q_313","menu-option-back-icon":"_menu-option-back-icon_vz46q_317","focus-visible":"_focus-visible_vz46q_327","menu-option-active":"_menu-option-active_vz46q_332","menu-option-icon":"_menu-option-icon_vz46q_336","menu-header":"_menu-header_vz46q_346","verification-menu":"_verification-menu_vz46q_353","verification-menu__group":"_verification-menu__group_vz46q_357","verification-menu__group-icon":"_verification-menu__group-icon_vz46q_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_vz46q_366","verification-menu__group-text":"_verification-menu__group-text_vz46q_374","verification-menu__group-title":"_verification-menu__group-title_vz46q_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_vz46q_378","verification-menu__loader":"_verification-menu__loader_vz46q_393","verification-menu__details":"_verification-menu__details_vz46q_400","verification-menu__detail":"_verification-menu__detail_vz46q_400","verification-menu__detail-label":"_verification-menu__detail-label_vz46q_419","verification-menu__detail-value":"_verification-menu__detail-value_vz46q_423","verification-menu__detail-copy":"_verification-menu__detail-copy_vz46q_430","verification-menu__inline-icon":"_verification-menu__inline-icon_vz46q_440","verification-menu--details":"_verification-menu--details_vz46q_448","dvr-toggle":"_dvr-toggle_vz46q_466","dvr-toggle__border":"_dvr-toggle__border_vz46q_472","dvr-toggle__live":"_dvr-toggle__live_vz46q_481","dvr-toggle__dvr":"_dvr-toggle__dvr_vz46q_481","dvr-toggle__live--active":"_dvr-toggle__live--active_vz46q_496","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_vz46q_496","copy-button":"_copy-button_vz46q_619","copy-button--copied":"_copy-button--copied_vz46q_622",fadeout:Zpe},Lb=({light:n,className:e=""})=>ke.jsx("div",{className:`${e} ${Ct.spinner} ${n?Ct["spinner--light"]:""}`,children:ke.jsx("div",{className:Ct["spinner-inner"]})}),Tl=({icon:n,className:e=""})=>ke.jsx("div",{className:`${Ct.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),gk=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},KP={[Pn.PLAY]:qz,[Pn.PAUSE]:Ope,[Pn.MUTE]:hk,[Pn.UNMUTE]:f2,[Pn.VOLUME_DOWN]:Wz,[Pn.VOLUME_UP]:f2,[Pn.SEEK_BACK]:VP,[Pn.SEEK_FORWARD]:GP,[Pn.PLAYBACK_RATE_DOWN]:VP,[Pn.PLAYBACK_RATE_UP]:GP,[Pn.SUBTITLES_ON]:jpe,[Pn.SUBTITLES_OFF]:Hpe,[Pn.PLAY_PREVIOUS]:yk,[Pn.PLAY_NEXT]:mk},Xpe=({action:n})=>{if(!(!n||!KP[n.action]))return ke.jsxs("div",{className:Ct["user-action-indicator-container"],children:[ke.jsx("div",{className:Ct["user-action-indicator"],children:ke.jsx(Tl,{icon:KP[n.action],"aria-label":`Action indicator ${n}`,className:Ct["user-action-indicator-icon"]})}),n.text?ke.jsx("div",{className:Ct["user-action-indicator-text"],children:n.text}):null]})},Jz=({player:n,videoState:e,setRecentUserAction:t,className:r=""})=>{const[i,o]=xt.useState(n.controls.GetCurrentTime()),[u,c]=xt.useState(0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(n.controls.IsDVREnabled());return xt.useEffect(()=>{h(Pz(n,t));const b=pk({player:n,setCurrentTime:o,rate:60}),g=mpe({video:n.video,setBufferFraction:c}),S=n.controls.RegisterSettingsListener(()=>{n.controls&&w(n.controls.IsDVREnabled())});return()=>{b&&b(),g&&g(),S&&S()}},[n&&n.controls]),n.isLive&&!m?null:ke.jsxs("div",{className:`${r} ${Ct["seek-container"]} ${r}`,children:[ke.jsx("progress",{max:1,value:n.casting?0:u,className:Ct["seek-buffer"]}),ke.jsx("progress",{max:1,value:i/e.duration||0,className:Ct["seek-playhead"]}),ke.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:i/e.duration||0,onInput:b=>n.controls.Seek({fraction:b.currentTarget.value}),onKeyDown:p,className:Ct["seek-input"]})]})},ehe=({player:n,videoState:e})=>ke.jsxs("div",{className:Ct["volume-controls"],children:[ke.jsx(Ol,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?hk:e.volume<.4?Wz:e.volume<.8?Ipe:f2,onClick:()=>n.controls.ToggleMuted(),className:Ct["volume-button"]},"mute-button"),ke.jsxs("div",{className:Ct["volume-slider"],children:[ke.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ct["volume-progress"]}),ke.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:Yde(n),className:Ct["volume-input"]})]})]}),Qz=({player:n,Hide:e,className:t=""})=>{const[r,i]=xt.useState(void 0),[o,u]=xt.useState(void 0),c=xt.createRef();if(xt.useEffect(()=>{const w=()=>u(n.controls.GetOptions());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),xt.useEffect(()=>{if(!c||!c.current)return;const w=fS({element:c.current.parentElement,Hide:e});return()=>{w&&w()}},[c]),!o)return null;const p=w=>setTimeout(()=>i(w)),h={quality:{label:"Quality",Update:w=>n.controls.SetQualityLevel(w)},audio:{label:"Audio",Update:w=>n.controls.SetAudioTrack(w)},text:{label:"Subtitles",Update:w=>n.controls.SetTextTrack(w)},profile:{label:"Player Profile",Update:w=>{w==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:w})}},rate:{label:"Playback Rate",Update:w=>n.controls.SetPlaybackRate({index:w})},advanced:{label:"Advanced",Update:w=>{w==="copy_debug_info"&&(gk(JSON.stringify(n.controls.GetDebugInfo(),null,2)),e())}}};let m;return r?m=ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${Ct.submenu} ${t}`,children:[ke.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ct["menu-option"]} ${Ct["menu-option-back"]}`,children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:Dpe},className:Ct["menu-option-back-icon"]}),ke.jsx("div",{children:h[r].label})]}),r==="advanced"?ke.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{h[r].Update("copy_debug_info"),p(void 0)},className:Ct["menu-option"],children:"Copy Debug Info"}):o[r].options.map(w=>ke.jsxs("button",{role:"menuitemradio","aria-checked":w.active,autoFocus:w.active,"aria-label":`${h[r].label}: ${w.label||""}`,onClick:()=>{h[r].Update(w.index),p(void 0)},className:`${Ct["menu-option"]} ${w.active?Ct["menu-option-active"]:""}`,children:[w.label||"",w.active?ke.jsx(Tl,{icon:zpe,className:Ct["menu-option-icon"]}):null]},`option-${w.index}`))]},"submenu"):m=ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${t}`,children:[o.hasQualityOptions?ke.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ct["menu-option"],children:[`${h.quality.label}: ${o.quality.active&&o.quality.active.activeLabel||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasAudioOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ct["menu-option"],children:[`${h.audio.label}: ${o.audio.active&&o.audio.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasTextOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ct["menu-option"],children:[`${h.text.label}: ${o.text.active&&o.text.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasProfileOptons?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ct["menu-option"],children:[`${h.profile.label}: ${o.profile.active&&o.profile.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,o.hasRateOptions?ke.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ct["menu-option"],children:[`${h.rate.label}: ${o.rate.active&&o.rate.active.label||""}`,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]}):null,ke.jsxs("button",{autoFocus:!o.hasRateOptions&&!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Ct["menu-option"],children:[h.advanced.label,ke.jsx(Tl,{icon:rh,className:Ct["menu-option-icon"]})]})]},"menu"),ke.jsx("div",{ref:c,children:m})},Zz=({player:n})=>{const[e,t]=xt.useState(n.dvrEnabled);return xt.useEffect(()=>{const r=n.controls.RegisterSettingsListener(()=>{n.controls&&t(n.controls.IsDVREnabled())});return()=>r&&r()},[n&&n.controls]),ke.jsxs("div",{className:Ct["dvr-toggle"],children:[ke.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!1),className:`${Ct["dvr-toggle__live"]} ${e?"":Ct["dvr-toggle__live--active"]}`,children:"LIVE"}),ke.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!0),className:`${Ct["dvr-toggle__dvr"]} ${e?Ct["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),ke.jsx("div",{className:Ct["dvr-toggle__border"]})]})},the=({label:n,value:e,className:t=""})=>{const[r,i]=xt.useState(!1);return ke.jsx("button",{onClick:()=>{r||(gk(e),i(!0),setTimeout(()=>i(!1),100))},dangerouslySetInnerHTML:{__html:qpe},className:[Ct["copy-button"],r?Ct["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Bo=({label:n,value:e,copyable:t})=>e?ke.jsxs("div",{className:Ct["verification-menu__detail"],children:[ke.jsxs("label",{className:Ct["verification-menu__detail-label"],children:[n,":"]}),ke.jsx("div",{className:Ct["verification-menu__detail-value"],children:e}),t?ke.jsx(the,{label:n,value:e,className:Ct["verification-menu__detail-copy"]}):null]}):null,Xz=({player:n,Hide:e,className:t=""})=>{const r=xt.createRef(),[i,o]=xt.useState(),[u,c]=xt.useState(!1),[p,h]=xt.useState(!1);if(xt.useEffect(()=>{n.__LoadVerificationDetails().then(()=>h(!0));const w=()=>o(n.controls.GetContentVerificationDetails());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),xt.useEffect(()=>{if(!r||!r.current)return;const w=fS({element:r.current.parentElement,Hide:e});return()=>{w&&w()}},[r]),!i)return null;let m;return u?m=ke.jsxs(ke.Fragment,{children:[ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:d2},className:Ct["verification-menu__group-icon"]}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("div",{className:Ct["verification-menu__group-title"],children:"This content has been verified as authentic"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:WP},className:[Ct["verification-menu__group-icon"],Ct["verification-menu__group-icon--cc"]].join(" ")}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("button",{onClick:()=>c(!0),className:Ct["verification-menu__group-title"],children:"Content Credentials"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Issued by the",ke.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__details"],children:[ke.jsx(Bo,{label:"Content Fabric Object ID",value:i.details.objectId,copyable:!0}),ke.jsx(Bo,{label:"Organization Address",value:i.details.tenantAddress,copyable:!0}),ke.jsx(Bo,{label:"Organization Name",value:i.details.tenantName&&i.details.tenantName.toString()}),ke.jsx(Bo,{label:"Owner Address",value:i.details.ownerAddress,copyable:!0}),ke.jsx(Bo,{label:"Content Object Contract Address",value:i.details.explorerUrl?ke.jsx("a",{href:i.details.explorerUrl,target:"_blank",rel:"noreferrer",children:i.details.address}):i.details.address,copyable:!0}),ke.jsx(Bo,{label:"Versions",value:i.details.versionCount}),ke.jsx(Bo,{label:"Content Version Hash",value:i.details.versionHash,copyable:!0}),i.details.lastCommittedAt?ke.jsx(Bo,{label:"Latest Commit",value:new Date(i.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,ke.jsx(Bo,{label:"Latest Version Hash",value:i.details.latestVersionHash,copyable:!0}),ke.jsx(Bo,{label:"Latest Transaction",value:i.details._state!=="full"?ke.jsx(Lb,{className:Ct["verification-menu__loader"]}):i.details.latestTransactionHashUrl?ke.jsx("a",{href:i.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:i.details.latestTransactionHash&&i.details.latestTransactionHash.toString()}):void 0}),ke.jsx(Bo,{label:"Signature Algorithm",value:i.details.signatureMethod}),n.publicMetadataUrl?ke.jsx(Bo,{label:"Public Metadata",value:ke.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${i.details._state}`)]}):m=ke.jsxs(ke.Fragment,{children:[ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:d2},className:Ct["verification-menu__group-icon"]}),ke.jsxs("div",{className:Ct["verification-menu__group-text"],children:[ke.jsx("div",{className:Ct["verification-menu__group-title"],children:"This content has been verified as authentic"}),ke.jsxs("div",{className:Ct["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),ke.jsxs("div",{className:Ct["verification-menu__group"],children:[ke.jsx("div",{dangerouslySetInnerHTML:{__html:WP},className:[Ct["verification-menu__group-icon"],Ct["verification-menu__group-icon--cc"]].join(" ")}),ke.jsx("div",{className:Ct["verification-menu__group-text"],children:ke.jsxs("button",{onClick:()=>c(!0),className:Ct["verification-menu__group-title"],children:["View Content Credentials",ke.jsx("div",{className:Ct["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:rh}})]})})]})]}),ke.jsx("div",{ref:r,children:ke.jsx("div",{role:"menu",className:`${Ct.menu} ${Ct["verification-menu"]} ${u?Ct["verification-menu--details"]:""} ${t}`,children:m},"menu")})},nhe=({player:n,Hide:e,className:t=""})=>{const r=xt.createRef(),[i,o]=xt.useState(void 0);if(xt.useEffect(()=>{const c=()=>o(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),xt.useEffect(()=>{if(!r||!r.current)return;const c=fS({element:r.current.parentElement,Hide:e});return()=>c&&c()},[r]),!i)return null;const u=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return ke.jsxs("div",{role:"menu",className:`${Ct.menu} ${Ct["collection-menu"]} ${t}`,ref:r,children:[ke.jsx("div",{className:`${Ct["menu-option"]} ${Ct["menu-header"]}`,children:i.title}),i.content.map(c=>ke.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>u(c.mediaIndex),className:`${Ct["menu-option"]} ${c.active?Ct["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`))]},"menu")},Ol=({icon:n,className:e="",...t})=>ke.jsx("button",{...t,className:`${zn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),rhe=({player:n,videoState:e})=>{const[t,r]=xt.useState(n.video.currentTime);return xt.useEffect(()=>{const i=pk({player:n,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.controls.IsDVRAvailable()?ke.jsx("div",{className:zn["live-indicator"],children:"Live"}):ke.jsxs("div",{className:zn.time,children:[!n.isLive||!n.controls.IsDVRAvailable()?null:ke.jsx(Zz,{player:n}),n.isLive&&!n.behindLiveEdge?null:`${o2(t,e.duration)} / `,n.isLive&&!n.dvrEnabled?null:o2(e.duration,e.duration)]})},ahe=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],r=e.content[e.mediaIndex+1],i=n.controls.IsReady();return ke.jsxs(ke.Fragment,{children:[t?ke.jsxs("div",{className:`${zn["collection-button-container"]} ${i?"":zn["collection-button-container--loading"]}`,children:[ke.jsx(Ol,{"aria-label":`Play Previous: ${t.title}`,disabled:!i,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious()}),ke.jsx("div",{className:zn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,r?ke.jsxs("div",{className:`${zn["collection-button-container"]} ${i?"":zn["collection-button-container--loading"]}`,children:[ke.jsx(Ol,{"aria-label":`Play Next: ${r.title}`,disabled:!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext()}),ke.jsx("div",{className:zn["collection-button-text"],children:r.title})]},`media-next-${e.mediaIndex}`):null]})},ej=({label:n,icon:e,player:t,MenuComponent:r,className:i=""})=>{const[o,u]=xt.useState(!1);return ke.jsxs("div",{className:[zn["menu-control-container"],i].join(" "),children:[ke.jsx(Ol,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!o),u(!o)},className:o?zn["icon-button-active"]:""}),o?ke.jsx(r,{player:t,Hide:()=>{u(!1),t.controls.__ToggleMenu(!1)}}):null]})},ihe=({player:n})=>{const[e,t]=xt.useState(void 0),{title:r,subtitle:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{t(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>t(p))},[u]),!r||n.playerOptions.title===Dt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===Dt.title.OFF?null:ke.jsxs("div",{className:zn["info-container"],children:[e?ke.jsx("div",{className:zn["info-image-container"],children:ke.jsx("img",{src:e,alt:"Image",className:zn["info-image"]})}):null,ke.jsxs("div",{className:zn["info-text"],children:[c.length===0?null:ke.jsx("div",{className:zn["info-headers"],children:c.map((p,h)=>ke.jsx("div",{className:zn["info-header"],children:p},`header-${h}`))}),r?ke.jsx("div",{className:zn["info-title"],children:r}):null,i?ke.jsx("div",{className:zn["info-subtitle"],children:i}):null,o?ke.jsx("div",{className:zn["info-description"],children:o}):null]})]})},she=({player:n})=>{const[e,t]=xt.useState(!1);return xt.useEffect(()=>{const r=()=>n&&n.controls&&t(n.controls.ContentVerified());r();const i=n.controls&&n.controls.RegisterSettingsListener(r);return()=>i&&i()},[]),e?ke.jsxs(ke.Fragment,{children:[ke.jsx("div",{className:zn["content-verified-badge"],children:"VERIFIED"}),ke.jsx(ej,{label:"Content Verification Menu",icon:d2,player:n,MenuComponent:Xz,className:zn["content-verification-menu-button"]})]}):null},ohe=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(n.controls.IsMenuVisible());if(xt.useEffect(()=>{if(!n.controls)return;h(Nz({player:n,setRecentUserAction:i}));const A=()=>n&&n.controls&&w(n.controls.IsMenuVisible()),k=n.controls.RegisterSettingsListener(A),R=Hz({player:n,setVideoState:c});return()=>{k&&k(),R&&R()}},[]),!u)return null;const b=n.controls.GetCollectionInfo(),g=r||!e||m,S=!g&&n.playerOptions.controls===Dt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!S),ke.jsxs("div",{onClick:p,className:[o,zn.container,g?"":zn.autohide,n.playerOptions.controls!==Dt.controls.DEFAULT?"":zn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[ke.jsx(ihe,{player:n},`content-info-${b&&b.mediaIndex}`),[Dt.controls.DEFAULT,Dt.controls.OFF,Dt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:ke.jsxs(ke.Fragment,{children:[ke.jsx(Ol,{"aria-label":"Play",tabIndex:e?-1:0,icon:$z,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${zn["center-play-button"]} ${t&&!e&&!(n&&n.casting)?"":zn["center-play-button--hidden"]}`}),ke.jsxs("div",{className:`${zn["bottom-controls-container"]} ${S?zn["bottom-controls-container--autohide"]:""}`,children:[ke.jsx("div",{className:zn["bottom-controls-gradient"]}),ke.jsx(Jz,{player:n,videoState:u,setRecentUserAction:i,className:zn.seek}),ke.jsxs("div",{className:zn.controls,children:[ke.jsx(Ol,{"aria-label":u.playing?"Pause":"Play",icon:u.playing?Gz:Vz,onClick:()=>n.controls.TogglePlay(),className:zn["play-pause-button"]}),ke.jsx(ahe,{player:n}),ke.jsx(ehe,{player:n,videoState:u}),ke.jsx(rhe,{player:n,videoState:u}),ke.jsx("div",{className:zn.spacer}),ke.jsx(she,{player:n}),n.chromecastAvailable?ke.jsx("google-cast-launcher",{}):null,n.airplayAvailable?ke.jsx(Ol,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:Kz}):null,n.controls.IsRotatable()?ke.jsx(Ol,{"aria-label":"Rotate Video",icon:$pe,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:zn["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?ke.jsx(ej,{label:"Settings Menu",icon:Ppe,player:n,MenuComponent:Qz}):null,ke.jsx(Ol,{"aria-label":u.fullscreen?"Exit Fullscreen":"Fullscreen",icon:u.fullscreen?Npe:Lpe,onClick:()=>n.controls.ToggleFullscreen(),className:zn["right-control-button"]})]})]})]}),n.playerOptions.controls!==Dt.controls.OFF_WITH_VOLUME_TOGGLE?null:ke.jsx("div",{className:zn["floating-volume-toggle"],children:ke.jsx(Ol,{"aria-label":u.muted?"Unmute":"Mute",icon:u.muted||u.volume===0?hk:f2,onClick:()=>n.controls.ToggleMuted(),className:zn["volume-button"]},"mute-button")}),n.playerOptions.watermark===Dt.watermark.OFF?null:ke.jsx("div",{className:zn.watermark,children:ke.jsx("img",{src:Yz,alt:"Eluvio"})})]})},uhe="_spinner_1c6ar_17",lhe="_text_1c6ar_33",che="_title_1c6ar_39",fhe="_description_1c6ar_43",dhe="_inputs_1c6ar_47",phe="_input_1c6ar_47",hhe="_submit_1c6ar_77",wi={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:uhe,"ticket-form":"_ticket-form_1c6ar_1",text:lhe,title:che,description:fhe,inputs:dhe,input:phe,submit:hhe,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},yhe=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:r,ntpId:i,ticketCode:o,ticketSubject:u}=n.clientOptions||{};const c=!r||!i,[p,h]=xt.useState(o||""),[m,w]=xt.useState(!!o),[b,g]=xt.useState(!1),[S,A]=xt.useState(c?"Error: Tenant ID or NTP ID not specified":""),[k,R]=xt.useState(void 0),N=async({client:P,code:q})=>{if(!(!q||!P)){A(""),g(!0);try{let V=u;q.includes(":")&&(V=q.split(":")[0],q=q.split(":")[1]),await P.RedeemCode({tenantId:r,ntpId:i,code:q.trim(),email:V}),t(P)}catch(V){console.log(V),A("Invalid Code"),w(!1)}finally{g(!1)}}};return xt.useEffect(()=>{Promise.resolve().then(()=>Lz).then(async({ElvClient:P})=>{const q=await P.FromConfigurationUrl({configUrl:n.clientOptions.network});R(q),o&&N({client:q,code:o})})},[]),m?ke.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:ke.jsx("div",{className:wi["ticket-form-overlay"],children:ke.jsx(Lb,{className:wi.spinner})})}):ke.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:ke.jsx("div",{className:wi["ticket-form-overlay"],children:ke.jsxs("form",{onSubmit:P=>{P.preventDefault(),N({client:k,code:p})},className:wi["ticket-form"],children:[ke.jsxs("div",{className:wi.text,children:[ke.jsx("h2",{className:wi.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),ke.jsx("p",{className:wi.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),ke.jsxs("div",{className:wi.inputs,children:[ke.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:P=>P.key==="Enter"&&N({client:k,code:p}),onChange:P=>{A(""),h(P.target.value)},className:wi.input}),ke.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!k||c,className:wi.submit,children:b?ke.jsx(Lb,{light:!0}):"Submit"})]}),ke.jsxs("div",{className:wi["error-message"],children:[S," "]})]})})})},mhe="_container_m8dfx_1",ghe="_autohide_m8dfx_34",vhe="_fadein_m8dfx_1",bhe="_title_m8dfx_134",whe="_spacer_m8dfx_319",_he="_watermark_m8dfx_323",xhe="_menu_m8dfx_145",dn={container:mhe,"container--default-controls":"_container--default-controls_m8dfx_29",autohide:ghe,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_m8dfx_37","icon-button":"_icon-button_m8dfx_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_m8dfx_60","icon-button-active":"_icon-button-active_m8dfx_73","icon-button--circle-focus":"_icon-button--circle-focus_m8dfx_73","text-button":"_text-button_m8dfx_86","text-button--active":"_text-button--active_m8dfx_91","bottom-controls-container":"_bottom-controls-container_m8dfx_37",fadein:vhe,"bottom-controls-gradient":"_bottom-controls-gradient_m8dfx_108","center-play-button":"_center-play-button_m8dfx_120","center-play-button--hidden":"_center-play-button--hidden_m8dfx_127","title-container":"_title-container_m8dfx_134",title:bhe,"menu-control-container":"_menu-control-container_m8dfx_145","time-container":"_time-container_m8dfx_149","live-indicator":"_live-indicator_m8dfx_156","live-indicator--faded":"_live-indicator--faded_m8dfx_168","bottom-controls":"_bottom-controls_m8dfx_37","center-buttons":"_center-buttons_m8dfx_184","play-pause-button":"_play-pause-button_m8dfx_194","track-button":"_track-button_m8dfx_197","bottom-left-controls":"_bottom-left-controls_m8dfx_201","bottom-right-controls":"_bottom-right-controls_m8dfx_202","info-box-container":"_info-box-container_m8dfx_219","info-box":"_info-box_m8dfx_219","info-box-image-container":"_info-box-image-container_m8dfx_242","info-box-image":"_info-box-image_m8dfx_242","info-box-text":"_info-box-text_m8dfx_258","info-box-text--top-padding":"_info-box-text--top-padding_m8dfx_265","info-box-headers":"_info-box-headers_m8dfx_269","info-box-description":"_info-box-description_m8dfx_277","info-box-title":"_info-box-title_m8dfx_281","info-box-button":"_info-box-button_m8dfx_286","info-box-button--restart":"_info-box-button--restart_m8dfx_301",spacer:whe,watermark:_he,menu:xhe},Ad=({icon:n,...e})=>ke.jsx("button",{...e,className:`${dn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),She=({player:n,videoState:e})=>{const[t,r]=xt.useState(n.video.currentTime);return xt.useEffect(()=>{const i=pk({player:n,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?null:ke.jsxs("div",{className:dn["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:ke.jsx("div",{className:dn.time,children:o2(t,e.duration)}),ke.jsx("div",{className:dn.spacer}),ke.jsx("div",{className:dn.time,children:o2(e.duration,e.duration)})]})},Che=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),r=t&&t.isPlaylist&&t.content[t.mediaIndex-1],i=t&&t.isPlaylist&&t.content[t.mediaIndex+1],o=n.controls.IsReady();return ke.jsxs("div",{className:dn["center-buttons"],children:[!r&&!i?null:ke.jsx(Ad,{disabled:!o||!r,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${dn["track-button"]} ${dn["icon-button--drop-shadow-focus"]}`}),ke.jsx(Ad,{"aria-label":"Back 10 Seconds",icon:Upe,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:dn["icon-button--drop-shadow-focus"]}),ke.jsx(Ad,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?Gz:Vz,onClick:()=>n.controls.TogglePlay(),className:`${dn["play-pause-button"]} ${dn["icon-button--drop-shadow-focus"]}`}),ke.jsx(Ad,{"aria-label":"Forward 10 Seconds",icon:Fpe,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:dn["icon-button--drop-shadow-focus"]}),!r&&!i?null:ke.jsx(Ad,{disabled:!o||!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext(),className:`${dn["track-button"]} ${dn["icon-button--drop-shadow-focus"]}`})]})},H4=({label:n,icon:e,children:t,player:r,MenuComponent:i})=>{const[o,u]=xt.useState(!1);return ke.jsxs("div",{className:dn["menu-control-container"],children:[e?ke.jsx(Ad,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${dn["icon-button--circle-focus"]} ${o?dn["icon-button-active"]:""}`}):ke.jsx("button",{onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${dn["text-button"]} ${o?dn["text-button--active"]:""}`,children:t}),o?ke.jsx(i,{player:r,Hide:()=>{r.controls.__ToggleMenu(!1),u(!1)},className:dn.menu}):null]})},Ehe=({player:n,Hide:e})=>{const[t,r]=xt.useState(void 0),{title:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{r(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>r(p))},[u]),xt.useEffect(()=>{const p=h=>{h&&(h.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),ke.jsxs("div",{className:dn["info-box-container"],children:[ke.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${dn["info-box-button"]} ${dn["info-box-button--info"]}`,children:"Info"}),ke.jsxs("div",{className:dn["info-box"],children:[t?ke.jsx("div",{className:dn["info-box-image-container"],children:ke.jsx("img",{src:t,alt:"Image",className:dn["info-box-image"]})}):null,ke.jsxs("div",{className:`${dn["info-box-text"]} ${t&&c&&c.length===0?dn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:ke.jsx("div",{className:dn["info-box-headers"],children:c.map((p,h)=>ke.jsx("div",{className:dn["info-box-header"],children:p},`header-${h}`))}),ke.jsx("div",{className:dn["info-box-title"],children:i||""}),ke.jsx("div",{className:dn["info-box-description"],children:o||""})]}),ke.jsx("div",{className:dn["info-box-actions"],children:ke.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${dn["info-box-button"]} ${dn["info-box-button--restart"]}`,children:[ke.jsx(Tl,{icon:qz}),"From Beginning"]})})]})]})},Ahe=({player:n})=>{const[e,t]=xt.useState(!1);return xt.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r(),n.controls.RegisterSettingsListener(r)},[]),e?ke.jsx(H4,{label:"Content Verification Menu",icon:d2,player:n,MenuComponent:Xz,className:dn["content-verification-menu-button"],children:"Verified"}):null},khe=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState(!1);if(xt.useEffect(()=>{h(Nz({player:n,setRecentUserAction:i}));const k=Hz({player:n,setVideoState:c});return()=>k&&k()},[]),!u)return null;const{title:b}=n.controls.GetContentInfo()||{},g=n.controls.GetCollectionInfo(),S=r||!e||n.controls.IsMenuVisible(),A=!S&&n.playerOptions.controls===Dt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!A),ke.jsxs("div",{onClick:p,className:[o,dn.container,S?"":dn.autohide,n.playerOptions.controls!==Dt.controls.DEFAULT?"":dn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[ke.jsx(Ad,{"aria-label":"Play",tabIndex:e?-1:0,icon:$z,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${dn["center-play-button"]} ${dn["icon-button--drop-shadow-focus"]} ${t&&!e&&!n.casting?"":dn["center-play-button--hidden"]}`}),m?ke.jsx(Ehe,{player:n,Hide:()=>w(!1)}):ke.jsxs("div",{className:`${dn["bottom-controls-container"]} ${A?dn["bottom-controls-container--autohide"]:""}`,children:[ke.jsx("div",{className:dn["bottom-controls-gradient"]}),ke.jsxs("div",{className:dn["title-container"],children:[ke.jsx("div",{className:dn.title,children:n.playerOptions.title===Dt.title.OFF||n.playerOptions.title===Dt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":b||""}),ke.jsx("div",{className:dn.spacer}),n.isLive?n.controls.IsDVRAvailable()?ke.jsx(Zz,{player:n}):ke.jsx("div",{className:dn["live-indicator"],children:"Live"}):null,g?ke.jsx(H4,{label:"Collection Menu",icon:Bpe,player:n,MenuComponent:nhe}):null]}),ke.jsx(Jz,{player:n,videoState:u,setRecentUserAction:i}),ke.jsx(She,{player:n,videoState:u}),ke.jsxs("div",{className:dn["bottom-controls"],children:[ke.jsx("div",{className:dn["bottom-left-controls"],children:!b||n.playerOptions.title===Dt.title.OFF?null:ke.jsx("button",{className:dn["text-button"],onClick:()=>w(!0),children:"Info"})}),ke.jsx(Che,{player:n,videoState:u}),ke.jsxs("div",{className:dn["bottom-right-controls"],children:[ke.jsx(Ahe,{player:n}),n.airplayAvailable?ke.jsx(Ad,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:Kz}):null,n.chromecastAvailable?ke.jsx("google-cast-launcher",{}):null,n.controls.GetOptions().hasAnyOptions?ke.jsx(H4,{label:"Settings",player:n,MenuComponent:Qz,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===Dt.watermark.OFF?null:ke.jsx("div",{className:dn.watermark,children:ke.jsx("img",{src:Yz,alt:"Eluvio"})})]},"controls")},Mhe="_container_1l7ln_1",The="_overlay_1l7ln_9",Rhe="_fadein_1l7ln_1",Ohe="_form_1l7ln_22",Lhe="_header_1l7ln_39",Nhe="_input_1l7ln_45",Phe="_actions_1l7ln_92",Ihe="_submit_1l7ln_98",Dhe="_cancel_1l7ln_99",fo={container:Mhe,overlay:The,fadein:Rhe,form:Ohe,header:Lhe,"input-container":"_input-container_1l7ln_45",input:Nhe,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:Phe,submit:Ihe,cancel:Dhe},Uhe=({player:n,Close:e})=>{const[t,r]=xt.useState(JSON.stringify(n.hlsOptions||"{}",null,2)),[i,o]=xt.useState(!1),[u,c]=xt.useState(""),p=xt.useRef();xt.useEffect(()=>{if(!p||!p.current)return;const m=fS({element:p.current,Hide:e});return()=>m&&m()},[p]);const h=async m=>{m.preventDefault();try{o(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(w){c(w.toString()),o(!1)}};return ke.jsx("div",{role:"complementary",tabIndex:-1,className:fo.container,children:ke.jsx("div",{className:fo.overlay,children:ke.jsxs("form",{onSubmit:h,className:fo.form,ref:p,children:[ke.jsx("h2",{className:fo.header,children:"Custom hls.js Options"}),ke.jsxs("div",{className:fo["input-container"],children:[ke.jsx("textarea",{disabled:i,autoFocus:!0,value:t,title:u,"aria-label":"Player Options","aria-invalid":!!u,"aria-errormessage":u||"",onChange:m=>r(m.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),r(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(m){c(m.toString())}},className:`${fo.input} ${u?fo["input--invalid"]:""}`}),ke.jsxs("div",{className:fo["player-info"],children:[ke.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:fo["api-link"],children:"API Docs"}),ke.jsxs("div",{className:fo["player-version"],children:["hls.js ",n.HLS.version]})]})]}),ke.jsxs("div",{className:fo.actions,children:[ke.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:fo.cancel,children:"Cancel"}),ke.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!u,className:fo.submit,children:i?ke.jsx(Lb,{light:!0}):"Submit"})]})]})})})},Fhe=({player:n})=>{const[e,t]=xt.useState(void 0),{posterImage:r}=n.controls.GetContentInfo()||{};return xt.useEffect(()=>{t(void 0),r&&dk({player:n,pathOrUrl:r,width:200}).then(i=>t(i))},[r]),e?ke.jsx("img",{alt:"Video Poster",src:e,className:Ys.poster}):null};let Bhe;const zhe=({target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:i,Reset:o})=>{const[u,c]=xt.useState(void 0),[p,h]=xt.useState(void 0),[m,w]=xt.useState("lg"),[b,g]=xt.useState("landscape"),[S,A]=xt.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[k,R]=xt.useState(void 0),[N,P]=xt.useState(!1),[q,V]=xt.useState(!1),[de,oe]=xt.useState(!1),[he,Se]=xt.useState(!1),[Ce,ne]=xt.useState(!1),[Le,C]=xt.useState(!0),[x,O]=xt.useState(void 0),[z,F]=xt.useState(void 0),[H,Q]=xt.useState(!1),ae=xt.useRef(),L=!!u,T=({action:ee,text:j})=>O({action:ee,text:j,key:Math.random()});if(xt.useEffect(()=>{Se(!0);const ee=gpe({target:n,setSize:w,setOrientation:g,setDimensions:A});return()=>{Se(!1),ee&&ee()}},[]),xt.useEffect(()=>{if(!(!ae||!ae.current||!he))try{P(!1),V(!1),e.clientOptions.client=p||e.clientOptions.client;const ee=new u2({target:n,video:ae.current,parameters:e,SetErrorMessage:R});window.__elvPlayer=ee;const j=ee.controls.RegisterSettingsListener(()=>{F(ee.controls.AllowRotation()),V(ee.playbackStarted),P(!ee.loading),ne(ee.__showPlayerProfileForm),Q(ee&&ee.casting)});ee.Destroy=()=>{ee.__DestroyPlayer(),i()},ee.Reset=()=>{o()};const be=vpe({player:ee}),Ie=bpe({player:ee,inactivityPeriod:5e3,onWake:()=>C(!0),onSleep:()=>C(!1)}),Me=wpe({player:ee,setRecentUserAction:T}),De=_pe({player:ee});t(ee),c(ee);const se=ee.controls.RegisterVideoEventListener("canplay",()=>oe(!0));return()=>{ae&&ae.current&&ae.current.removeEventListener("play",V),j&&j(),be&&be(),Ie&&Ie(),Me&&Me(),De&&De(),se&&se(),ee&&ee.__DestroyPlayer()}}catch(ee){r(ee),i()}},[ae,he,p]),xt.useEffect(()=>{if(L)return()=>{u&&u.__DestroyPlayer(),c(void 0)}},[L]),xt.useEffect(()=>{x&&(clearTimeout(Bhe),setTimeout(()=>{O(void 0)},1e3))},[x]),e.clientOptions.promptTicket&&!p)return ke.jsx(yhe,{parameters:e,dimensions:{size:m,orientation:b,...S},onComplete:ee=>h(ee)});const Y=e.playerOptions.ui===Dt.ui.WEB&&u&&u.controls.IsRotatable()&&z;return ke.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Y?S.height:S.width}px`,"--portal-height":`${Y?S.width:S.height}px`},className:[Ys["player-container"],Y?Ys["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!Ce||!N?null:ke.jsx(Uhe,{player:u,Close:()=>u.controls.HidePlayerProfileForm()}),ke.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:ae,muted:[Dt.muted.ON,Dt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Dt.controls.DEFAULT,loop:e.playerOptions.loop===Dt.loop.ON,crossOrigin:"anonymous",className:Ys.video}),!u||!de||q&&!e.playerOptions.permanentPoster?null:ke.jsx(Fhe,{player:u}),N||k||!e.playerOptions.showLoader?null:ke.jsx("div",{className:Ys["spinner-container"],children:ke.jsx(Lb,{className:Ys.spinner})}),H?ke.jsx("div",{className:Ys["cast-indicator-container"],children:ke.jsx("div",{dangerouslySetInnerHTML:{__html:Vpe}})}):null,k?ke.jsxs("div",{className:Ys["error-message"],children:[ke.jsx("div",{className:Ys["error-message__message"],children:k}),ke.jsxs("button",{className:Ys["error-message__copy-debug-button"],onClick:()=>gk(JSON.stringify(u.controls.GetDebugInfo(),null,2)),children:[ke.jsx(Tl,{icon:Gpe,className:Ys["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,u?e.playerOptions.ui===Dt.ui.WEB?ke.jsx(ohe,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:Le,setRecentUserAction:T,className:Ys.controls}):ke.jsx(khe,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:Le,setRecentUserAction:T,className:Ys.controls}):null,x?ke.jsx(Xpe,{action:x},`action-indicator-${x&&x.key}`):null]})},jhe=n=>{const[e,t]=xt.useState(Math.random());return xt.createElement(zhe,{...n,key:`player-${e}`,Reset:()=>t(Math.random())})},Hhe=(n,e)=>(n.innerHTML="",n.classList.add(JG.reset),n.classList.add(Ys["player-target"]),e=Dz(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,r)=>{const i=Gv.createRoot(n);i.render(ke.jsx(GG.StrictMode,{children:ke.jsx(jhe,{target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:async()=>{try{await i.unmount()}catch(o){console.error("Failed to unmount Eluvio Player"),console.error(o)}}})}))}));exports.Initialize=Hhe;exports.PlayerParameters=Dt;exports.commonjsGlobal=Fa;exports.crypto=tI;exports.eventsExports=Wb;exports.getDefaultExportFromCjs=Bd;exports.inherits_browserExports=VI;exports.require$$3=h2;exports.requireBuffer=Nb;exports.string_decoder=V5;