@eluvio/elv-player-js 2.1.25 → 2.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +15 -15
- package/dist/{dash.all.min-DiKkCxTo.mjs → dash.all.min-CyrHsR08.mjs} +1 -1
- package/dist/{dash.all.min-C2TzESo8.js → dash.all.min-DK6_ZBJe.js} +1 -1
- package/dist/elv-player-js.cjs.js +1 -1
- package/dist/elv-player-js.es.js +1 -1
- package/dist/{index-Bog78gB2.js → index-B3BXYKlU.js} +2 -2
- package/dist/{index-bl4NgMQP.mjs → index-DIMPV66P.mjs} +1 -1
- package/dist/{index-CpOffoCC.js → index-SUB8Y1LV.js} +1 -1
- package/dist/{index-De5RSRMm.mjs → index-znYnmQZ9.mjs} +6 -6
- package/lib/ui/PlayerUI.jsx +2 -2
- package/package.json +1 -1
|
@@ -324,7 +324,7 @@ ${p} ${e(s)}
|
|
|
324
324
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
325
325
|
* @license MIT
|
|
326
326
|
*/var W9;function Ep(){return W9||(W9=1,(function(r){const e=wL(),t=_L(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=c,r.SlowBuffer=k,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=u(),!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 u(){try{const de=new Uint8Array(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,Uint8Array.prototype),Object.setPrototypeOf(de,J),de.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 o(de){if(de>s)throw new RangeError('The value "'+de+'" is invalid for option "size"');const J=new Uint8Array(de);return Object.setPrototypeOf(J,c.prototype),J}function c(de,J,F){if(typeof de=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(de)}return p(de,J,F)}c.poolSize=8192;function p(de,J,F){if(typeof de=="string")return v(de,J);if(ArrayBuffer.isView(de))return x(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de);if(Re(de,ArrayBuffer)||de&&Re(de.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(de,SharedArrayBuffer)||de&&Re(de.buffer,SharedArrayBuffer)))return E(de,J,F);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ue=de.valueOf&&de.valueOf();if(ue!=null&&ue!==de)return c.from(ue,J,F);const Ee=C(de);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return c.from(de[Symbol.toPrimitive]("string"),J,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de)}c.from=function(de,J,F){return p(de,J,F)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function d(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function y(de,J,F){return d(de),de<=0?o(de):J!==void 0?typeof F=="string"?o(de).fill(J,F):o(de).fill(J):o(de)}c.alloc=function(de,J,F){return y(de,J,F)};function m(de){return d(de),o(de<0?0:T(de)|0)}c.allocUnsafe=function(de){return m(de)},c.allocUnsafeSlow=function(de){return m(de)};function v(de,J){if((typeof J!="string"||J==="")&&(J="utf8"),!c.isEncoding(J))throw new TypeError("Unknown encoding: "+J);const F=M(de,J)|0;let ue=o(F);const Ee=ue.write(de,J);return Ee!==F&&(ue=ue.slice(0,Ee)),ue}function b(de){const J=de.length<0?0:T(de.length)|0,F=o(J);for(let ue=0;ue<J;ue+=1)F[ue]=de[ue]&255;return F}function x(de){if(Re(de,Uint8Array)){const J=new Uint8Array(de);return E(J.buffer,J.byteOffset,J.byteLength)}return b(de)}function E(de,J,F){if(J<0||de.byteLength<J)throw new RangeError('"offset" is outside of buffer bounds');if(de.byteLength<J+(F||0))throw new RangeError('"length" is outside of buffer bounds');let ue;return J===void 0&&F===void 0?ue=new Uint8Array(de):F===void 0?ue=new Uint8Array(de,J):ue=new Uint8Array(de,J,F),Object.setPrototypeOf(ue,c.prototype),ue}function C(de){if(c.isBuffer(de)){const J=T(de.length)|0,F=o(J);return F.length===0||de.copy(F,0,0,J),F}if(de.length!==void 0)return typeof de.length!="number"||Je(de.length)?o(0):b(de);if(de.type==="Buffer"&&Array.isArray(de.data))return b(de.data)}function T(de){if(de>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return de|0}function k(de){return+de!=de&&(de=0),c.alloc(+de)}c.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==c.prototype},c.compare=function(J,F){if(Re(J,Uint8Array)&&(J=c.from(J,J.offset,J.byteLength)),Re(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(J)||!c.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===F)return 0;let ue=J.length,Ee=F.length;for(let Ne=0,Be=Math.min(ue,Ee);Ne<Be;++Ne)if(J[Ne]!==F[Ne]){ue=J[Ne],Ee=F[Ne];break}return ue<Ee?-1:Ee<ue?1:0},c.isEncoding=function(J){switch(String(J).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(J,F){if(!Array.isArray(J))throw new TypeError('"list" argument must be an Array of Buffers');if(J.length===0)return c.alloc(0);let ue;if(F===void 0)for(F=0,ue=0;ue<J.length;++ue)F+=J[ue].length;const Ee=c.allocUnsafe(F);let Ne=0;for(ue=0;ue<J.length;++ue){let Be=J[ue];if(Re(Be,Uint8Array))Ne+Be.length>Ee.length?(c.isBuffer(Be)||(Be=c.from(Be)),Be.copy(Ee,Ne)):Uint8Array.prototype.set.call(Ee,Be,Ne);else if(c.isBuffer(Be))Be.copy(Ee,Ne);else throw new TypeError('"list" argument must be an Array of Buffers');Ne+=Be.length}return Ee};function M(de,J){if(c.isBuffer(de))return de.length;if(ArrayBuffer.isView(de)||Re(de,ArrayBuffer))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof de);const F=de.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&F===0)return 0;let Ee=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return z(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return le(de).length;default:if(Ee)return ue?-1:z(de).length;J=(""+J).toLowerCase(),Ee=!0}}c.byteLength=M;function R(de,J,F){let ue=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,J>>>=0,F<=J))return"";for(de||(de="utf8");;)switch(de){case"hex":return X(this,J,F);case"utf8":case"utf-8":return _(this,J,F);case"ascii":return q(this,J,F);case"latin1":case"binary":return B(this,J,F);case"base64":return S(this,J,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,J,F);default:if(ue)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),ue=!0}}c.prototype._isBuffer=!0;function O(de,J,F){const ue=de[J];de[J]=de[F],de[F]=ue}c.prototype.swap16=function(){const J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let F=0;F<J;F+=2)O(this,F,F+1);return this},c.prototype.swap32=function(){const J=this.length;if(J%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let F=0;F<J;F+=4)O(this,F,F+3),O(this,F+1,F+2);return this},c.prototype.swap64=function(){const J=this.length;if(J%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let F=0;F<J;F+=8)O(this,F,F+7),O(this,F+1,F+6),O(this,F+2,F+5),O(this,F+3,F+4);return this},c.prototype.toString=function(){const J=this.length;return J===0?"":arguments.length===0?_(this,0,J):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(J){if(!c.isBuffer(J))throw new TypeError("Argument must be a Buffer");return this===J?!0:c.compare(this,J)===0},c.prototype.inspect=function(){let J="";const F=r.INSPECT_MAX_BYTES;return J=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(J+=" ... "),"<Buffer "+J+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(J,F,ue,Ee,Ne){if(Re(J,Uint8Array)&&(J=c.from(J,J.offset,J.byteLength)),!c.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(F===void 0&&(F=0),ue===void 0&&(ue=J?J.length:0),Ee===void 0&&(Ee=0),Ne===void 0&&(Ne=this.length),F<0||ue>J.length||Ee<0||Ne>this.length)throw new RangeError("out of range index");if(Ee>=Ne&&F>=ue)return 0;if(Ee>=Ne)return-1;if(F>=ue)return 1;if(F>>>=0,ue>>>=0,Ee>>>=0,Ne>>>=0,this===J)return 0;let Be=Ne-Ee,dt=ue-F;const Ie=Math.min(Be,dt),He=this.slice(Ee,Ne),ge=J.slice(F,ue);for(let Ye=0;Ye<Ie;++Ye)if(He[Ye]!==ge[Ye]){Be=He[Ye],dt=ge[Ye];break}return Be<dt?-1:dt<Be?1:0};function W(de,J,F,ue,Ee){if(de.length===0)return-1;if(typeof F=="string"?(ue=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,Je(F)&&(F=Ee?0:de.length-1),F<0&&(F=de.length+F),F>=de.length){if(Ee)return-1;F=de.length-1}else if(F<0)if(Ee)F=0;else return-1;if(typeof J=="string"&&(J=c.from(J,ue)),c.isBuffer(J))return J.length===0?-1:Z(de,J,F,ue,Ee);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(de,J,F):Uint8Array.prototype.lastIndexOf.call(de,J,F):Z(de,[J],F,ue,Ee);throw new TypeError("val must be string, number or Buffer")}function Z(de,J,F,ue,Ee){let Ne=1,Be=de.length,dt=J.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(de.length<2||J.length<2)return-1;Ne=2,Be/=2,dt/=2,F/=2}function Ie(ge,Ye){return Ne===1?ge[Ye]:ge.readUInt16BE(Ye*Ne)}let He;if(Ee){let ge=-1;for(He=F;He<Be;He++)if(Ie(de,He)===Ie(J,ge===-1?0:He-ge)){if(ge===-1&&(ge=He),He-ge+1===dt)return ge*Ne}else ge!==-1&&(He-=He-ge),ge=-1}else for(F+dt>Be&&(F=Be-dt),He=F;He>=0;He--){let ge=!0;for(let Ye=0;Ye<dt;Ye++)if(Ie(de,He+Ye)!==Ie(J,Ye)){ge=!1;break}if(ge)return He}return-1}c.prototype.includes=function(J,F,ue){return this.indexOf(J,F,ue)!==-1},c.prototype.indexOf=function(J,F,ue){return W(this,J,F,ue,!0)},c.prototype.lastIndexOf=function(J,F,ue){return W(this,J,F,ue,!1)};function se(de,J,F,ue){F=Number(F)||0;const Ee=de.length-F;ue?(ue=Number(ue),ue>Ee&&(ue=Ee)):ue=Ee;const Ne=J.length;ue>Ne/2&&(ue=Ne/2);let Be;for(Be=0;Be<ue;++Be){const dt=parseInt(J.substr(Be*2,2),16);if(Je(dt))return Be;de[F+Be]=dt}return Be}function ye(de,J,F,ue){return Ae(z(J,de.length-F),de,F,ue)}function he(de,J,F,ue){return Ae(H(J),de,F,ue)}function te(de,J,F,ue){return Ae(le(J),de,F,ue)}function re(de,J,F,ue){return Ae(Q(J,de.length-F),de,F,ue)}c.prototype.write=function(J,F,ue,Ee){if(F===void 0)Ee="utf8",ue=this.length,F=0;else if(ue===void 0&&typeof F=="string")Ee=F,ue=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(ue)?(ue=ue>>>0,Ee===void 0&&(Ee="utf8")):(Ee=ue,ue=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Ne=this.length-F;if((ue===void 0||ue>Ne)&&(ue=Ne),J.length>0&&(ue<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let Be=!1;for(;;)switch(Ee){case"hex":return se(this,J,F,ue);case"utf8":case"utf-8":return ye(this,J,F,ue);case"ascii":case"latin1":case"binary":return he(this,J,F,ue);case"base64":return te(this,J,F,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,J,F,ue);default:if(Be)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),Be=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(de,J,F){return J===0&&F===de.length?e.fromByteArray(de):e.fromByteArray(de.slice(J,F))}function _(de,J,F){F=Math.min(de.length,F);const ue=[];let Ee=J;for(;Ee<F;){const Ne=de[Ee];let Be=null,dt=Ne>239?4:Ne>223?3:Ne>191?2:1;if(Ee+dt<=F){let Ie,He,ge,Ye;switch(dt){case 1:Ne<128&&(Be=Ne);break;case 2:Ie=de[Ee+1],(Ie&192)===128&&(Ye=(Ne&31)<<6|Ie&63,Ye>127&&(Be=Ye));break;case 3:Ie=de[Ee+1],He=de[Ee+2],(Ie&192)===128&&(He&192)===128&&(Ye=(Ne&15)<<12|(Ie&63)<<6|He&63,Ye>2047&&(Ye<55296||Ye>57343)&&(Be=Ye));break;case 4:Ie=de[Ee+1],He=de[Ee+2],ge=de[Ee+3],(Ie&192)===128&&(He&192)===128&&(ge&192)===128&&(Ye=(Ne&15)<<18|(Ie&63)<<12|(He&63)<<6|ge&63,Ye>65535&&Ye<1114112&&(Be=Ye))}}Be===null?(Be=65533,dt=1):Be>65535&&(Be-=65536,ue.push(Be>>>10&1023|55296),Be=56320|Be&1023),ue.push(Be),Ee+=dt}return j(ue)}const P=4096;function j(de){const J=de.length;if(J<=P)return String.fromCharCode.apply(String,de);let F="",ue=0;for(;ue<J;)F+=String.fromCharCode.apply(String,de.slice(ue,ue+=P));return F}function q(de,J,F){let ue="";F=Math.min(de.length,F);for(let Ee=J;Ee<F;++Ee)ue+=String.fromCharCode(de[Ee]&127);return ue}function B(de,J,F){let ue="";F=Math.min(de.length,F);for(let Ee=J;Ee<F;++Ee)ue+=String.fromCharCode(de[Ee]);return ue}function X(de,J,F){const ue=de.length;(!J||J<0)&&(J=0),(!F||F<0||F>ue)&&(F=ue);let Ee="";for(let Ne=J;Ne<F;++Ne)Ee+=lt[de[Ne]];return Ee}function $(de,J,F){const ue=de.slice(J,F);let Ee="";for(let Ne=0;Ne<ue.length-1;Ne+=2)Ee+=String.fromCharCode(ue[Ne]+ue[Ne+1]*256);return Ee}c.prototype.slice=function(J,F){const ue=this.length;J=~~J,F=F===void 0?ue:~~F,J<0?(J+=ue,J<0&&(J=0)):J>ue&&(J=ue),F<0?(F+=ue,F<0&&(F=0)):F>ue&&(F=ue),F<J&&(F=J);const Ee=this.subarray(J,F);return Object.setPrototypeOf(Ee,c.prototype),Ee};function D(de,J,F){if(de%1!==0||de<0)throw new RangeError("offset is not uint");if(de+J>F)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ee=this[J],Ne=1,Be=0;for(;++Be<F&&(Ne*=256);)Ee+=this[J+Be]*Ne;return Ee},c.prototype.readUintBE=c.prototype.readUIntBE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ee=this[J+--F],Ne=1;for(;F>0&&(Ne*=256);)Ee+=this[J+--F]*Ne;return Ee},c.prototype.readUint8=c.prototype.readUInt8=function(J,F){return J=J>>>0,F||D(J,1,this.length),this[J]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(J,F){return J=J>>>0,F||D(J,2,this.length),this[J]|this[J+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(J,F){return J=J>>>0,F||D(J,2,this.length),this[J]<<8|this[J+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(J,F){return J=J>>>0,F||D(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},c.prototype.readBigUInt64LE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ee=F+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,Ne=this[++J]+this[++J]*2**8+this[++J]*2**16+ue*2**24;return BigInt(Ee)+(BigInt(Ne)<<BigInt(32))}),c.prototype.readBigUInt64BE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ee=F*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],Ne=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ue;return(BigInt(Ee)<<BigInt(32))+BigInt(Ne)}),c.prototype.readIntLE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ee=this[J],Ne=1,Be=0;for(;++Be<F&&(Ne*=256);)Ee+=this[J+Be]*Ne;return Ne*=128,Ee>=Ne&&(Ee-=Math.pow(2,8*F)),Ee},c.prototype.readIntBE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ee=F,Ne=1,Be=this[J+--Ee];for(;Ee>0&&(Ne*=256);)Be+=this[J+--Ee]*Ne;return Ne*=128,Be>=Ne&&(Be-=Math.pow(2,8*F)),Be},c.prototype.readInt8=function(J,F){return J=J>>>0,F||D(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},c.prototype.readInt16LE=function(J,F){J=J>>>0,F||D(J,2,this.length);const ue=this[J]|this[J+1]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt16BE=function(J,F){J=J>>>0,F||D(J,2,this.length);const ue=this[J+1]|this[J]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt32LE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},c.prototype.readInt32BE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},c.prototype.readBigInt64LE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ee=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ue<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(F+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24)}),c.prototype.readBigInt64BE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ee=(F<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ue)}),c.prototype.readFloatLE=function(J,F){return J=J>>>0,F||D(J,4,this.length),t.read(this,J,!0,23,4)},c.prototype.readFloatBE=function(J,F){return J=J>>>0,F||D(J,4,this.length),t.read(this,J,!1,23,4)},c.prototype.readDoubleLE=function(J,F){return J=J>>>0,F||D(J,8,this.length),t.read(this,J,!0,52,8)},c.prototype.readDoubleBE=function(J,F){return J=J>>>0,F||D(J,8,this.length),t.read(this,J,!1,52,8)};function N(de,J,F,ue,Ee,Ne){if(!c.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Ee||J<Ne)throw new RangeError('"value" argument is out of bounds');if(F+ue>de.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(J,F,ue,Ee){if(J=+J,F=F>>>0,ue=ue>>>0,!Ee){const dt=Math.pow(2,8*ue)-1;N(this,J,F,ue,dt,0)}let Ne=1,Be=0;for(this[F]=J&255;++Be<ue&&(Ne*=256);)this[F+Be]=J/Ne&255;return F+ue},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(J,F,ue,Ee){if(J=+J,F=F>>>0,ue=ue>>>0,!Ee){const dt=Math.pow(2,8*ue)-1;N(this,J,F,ue,dt,0)}let Ne=ue-1,Be=1;for(this[F+Ne]=J&255;--Ne>=0&&(Be*=256);)this[F+Ne]=J/Be&255;return F+ue},c.prototype.writeUint8=c.prototype.writeUInt8=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,1,255,0),this[F]=J&255,F+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,65535,0),this[F]=J&255,this[F+1]=J>>>8,F+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,65535,0),this[F]=J>>>8,this[F+1]=J&255,F+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,4294967295,0),this[F+3]=J>>>24,this[F+2]=J>>>16,this[F+1]=J>>>8,this[F]=J&255,F+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,4294967295,0),this[F]=J>>>24,this[F+1]=J>>>16,this[F+2]=J>>>8,this[F+3]=J&255,F+4};function Y(de,J,F,ue,Ee){be(J,ue,Ee,de,F,7);let Ne=Number(J&BigInt(4294967295));de[F++]=Ne,Ne=Ne>>8,de[F++]=Ne,Ne=Ne>>8,de[F++]=Ne,Ne=Ne>>8,de[F++]=Ne;let Be=Number(J>>BigInt(32)&BigInt(4294967295));return de[F++]=Be,Be=Be>>8,de[F++]=Be,Be=Be>>8,de[F++]=Be,Be=Be>>8,de[F++]=Be,F}function ie(de,J,F,ue,Ee){be(J,ue,Ee,de,F,7);let Ne=Number(J&BigInt(4294967295));de[F+7]=Ne,Ne=Ne>>8,de[F+6]=Ne,Ne=Ne>>8,de[F+5]=Ne,Ne=Ne>>8,de[F+4]=Ne;let Be=Number(J>>BigInt(32)&BigInt(4294967295));return de[F+3]=Be,Be=Be>>8,de[F+2]=Be,Be=Be>>8,de[F+1]=Be,Be=Be>>8,de[F]=Be,F+8}c.prototype.writeBigUInt64LE=et(function(J,F=0){return Y(this,J,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=et(function(J,F=0){return ie(this,J,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(J,F,ue,Ee){if(J=+J,F=F>>>0,!Ee){const Ie=Math.pow(2,8*ue-1);N(this,J,F,ue,Ie-1,-Ie)}let Ne=0,Be=1,dt=0;for(this[F]=J&255;++Ne<ue&&(Be*=256);)J<0&&dt===0&&this[F+Ne-1]!==0&&(dt=1),this[F+Ne]=(J/Be>>0)-dt&255;return F+ue},c.prototype.writeIntBE=function(J,F,ue,Ee){if(J=+J,F=F>>>0,!Ee){const Ie=Math.pow(2,8*ue-1);N(this,J,F,ue,Ie-1,-Ie)}let Ne=ue-1,Be=1,dt=0;for(this[F+Ne]=J&255;--Ne>=0&&(Be*=256);)J<0&&dt===0&&this[F+Ne+1]!==0&&(dt=1),this[F+Ne]=(J/Be>>0)-dt&255;return F+ue},c.prototype.writeInt8=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,1,127,-128),J<0&&(J=255+J+1),this[F]=J&255,F+1},c.prototype.writeInt16LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,32767,-32768),this[F]=J&255,this[F+1]=J>>>8,F+2},c.prototype.writeInt16BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,32767,-32768),this[F]=J>>>8,this[F+1]=J&255,F+2},c.prototype.writeInt32LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,2147483647,-2147483648),this[F]=J&255,this[F+1]=J>>>8,this[F+2]=J>>>16,this[F+3]=J>>>24,F+4},c.prototype.writeInt32BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[F]=J>>>24,this[F+1]=J>>>16,this[F+2]=J>>>8,this[F+3]=J&255,F+4},c.prototype.writeBigInt64LE=et(function(J,F=0){return Y(this,J,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=et(function(J,F=0){return ie(this,J,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function V(de,J,F,ue,Ee,Ne){if(F+ue>de.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function Ce(de,J,F,ue,Ee){return J=+J,F=F>>>0,Ee||V(de,J,F,4),t.write(de,J,F,ue,23,4),F+4}c.prototype.writeFloatLE=function(J,F,ue){return Ce(this,J,F,!0,ue)},c.prototype.writeFloatBE=function(J,F,ue){return Ce(this,J,F,!1,ue)};function Oe(de,J,F,ue,Ee){return J=+J,F=F>>>0,Ee||V(de,J,F,8),t.write(de,J,F,ue,52,8),F+8}c.prototype.writeDoubleLE=function(J,F,ue){return Oe(this,J,F,!0,ue)},c.prototype.writeDoubleBE=function(J,F,ue){return Oe(this,J,F,!1,ue)},c.prototype.copy=function(J,F,ue,Ee){if(!c.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!Ee&&Ee!==0&&(Ee=this.length),F>=J.length&&(F=J.length),F||(F=0),Ee>0&&Ee<ue&&(Ee=ue),Ee===ue||J.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(ue<0||ue>=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),J.length-F<Ee-ue&&(Ee=J.length-F+ue);const Ne=Ee-ue;return this===J&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,ue,Ee):Uint8Array.prototype.set.call(J,this.subarray(ue,Ee),F),Ne},c.prototype.fill=function(J,F,ue,Ee){if(typeof J=="string"){if(typeof F=="string"?(Ee=F,F=0,ue=this.length):typeof ue=="string"&&(Ee=ue,ue=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!c.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);if(J.length===1){const Be=J.charCodeAt(0);(Ee==="utf8"&&Be<128||Ee==="latin1")&&(J=Be)}}else typeof J=="number"?J=J&255:typeof J=="boolean"&&(J=Number(J));if(F<0||this.length<F||this.length<ue)throw new RangeError("Out of range index");if(ue<=F)return this;F=F>>>0,ue=ue===void 0?this.length:ue>>>0,J||(J=0);let Ne;if(typeof J=="number")for(Ne=F;Ne<ue;++Ne)this[Ne]=J;else{const Be=c.isBuffer(J)?J:c.from(J,Ee),dt=Be.length;if(dt===0)throw new TypeError('The value "'+J+'" is invalid for argument "value"');for(Ne=0;Ne<ue-F;++Ne)this[Ne+F]=Be[Ne%dt]}return this};const Se={};function Te(de,J,F){Se[de]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:J.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${de}]`,this.stack,delete this.name}get code(){return de}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${de}]: ${this.message}`}}}Te("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?`${de} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Te("ERR_INVALID_ARG_TYPE",function(de,J){return`The "${de}" argument must be of type number. Received type ${typeof J}`},TypeError),Te("ERR_OUT_OF_RANGE",function(de,J,F){let ue=`The value of "${de}" is out of range.`,Ee=F;return Number.isInteger(F)&&Math.abs(F)>2**32?Ee=oe(String(F)):typeof F=="bigint"&&(Ee=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(Ee=oe(Ee)),Ee+="n"),ue+=` It must be ${J}. Received ${Ee}`,ue},RangeError);function oe(de){let J="",F=de.length;const ue=de[0]==="-"?1:0;for(;F>=ue+4;F-=3)J=`_${de.slice(F-3,F)}${J}`;return`${de.slice(0,F)}${J}`}function ce(de,J,F){me(J,"offset"),(de[J]===void 0||de[J+F]===void 0)&&fe(J,de.length-(F+1))}function be(de,J,F,ue,Ee,Ne){if(de>F||de<J){const Be=typeof J=="bigint"?"n":"";let dt;throw J===0||J===BigInt(0)?dt=`>= 0${Be} and < 2${Be} ** ${(Ne+1)*8}${Be}`:dt=`>= -(2${Be} ** ${(Ne+1)*8-1}${Be}) and < 2 ** ${(Ne+1)*8-1}${Be}`,new Se.ERR_OUT_OF_RANGE("value",dt,de)}ce(ue,Ee,Ne)}function me(de,J){if(typeof de!="number")throw new Se.ERR_INVALID_ARG_TYPE(J,"number",de)}function fe(de,J,F){throw Math.floor(de)!==de?(me(de,F),new Se.ERR_OUT_OF_RANGE("offset","an integer",de)):J<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${J}`,de)}const xe=/[^+/0-9A-Za-z-_]/g;function ne(de){if(de=de.split("=")[0],de=de.trim().replace(xe,""),de.length<2)return"";for(;de.length%4!==0;)de=de+"=";return de}function z(de,J){J=J||1/0;let F;const ue=de.length;let Ee=null;const Ne=[];for(let Be=0;Be<ue;++Be){if(F=de.charCodeAt(Be),F>55295&&F<57344){if(!Ee){if(F>56319){(J-=3)>-1&&Ne.push(239,191,189);continue}else if(Be+1===ue){(J-=3)>-1&&Ne.push(239,191,189);continue}Ee=F;continue}if(F<56320){(J-=3)>-1&&Ne.push(239,191,189),Ee=F;continue}F=(Ee-55296<<10|F-56320)+65536}else Ee&&(J-=3)>-1&&Ne.push(239,191,189);if(Ee=null,F<128){if((J-=1)<0)break;Ne.push(F)}else if(F<2048){if((J-=2)<0)break;Ne.push(F>>6|192,F&63|128)}else if(F<65536){if((J-=3)<0)break;Ne.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((J-=4)<0)break;Ne.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return Ne}function H(de){const J=[];for(let F=0;F<de.length;++F)J.push(de.charCodeAt(F)&255);return J}function Q(de,J){let F,ue,Ee;const Ne=[];for(let Be=0;Be<de.length&&!((J-=2)<0);++Be)F=de.charCodeAt(Be),ue=F>>8,Ee=F%256,Ne.push(Ee),Ne.push(ue);return Ne}function le(de){return e.toByteArray(ne(de))}function Ae(de,J,F,ue){let Ee;for(Ee=0;Ee<ue&&!(Ee+F>=J.length||Ee>=de.length);++Ee)J[Ee+F]=de[Ee];return Ee}function Re(de,J){return de instanceof J||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===J.name}function Je(de){return de!==de}const lt=(function(){const de="0123456789abcdef",J=new Array(256);for(let F=0;F<16;++F){const ue=F*16;for(let Ee=0;Ee<16;++Ee)J[ue+Ee]=de[F]+de[Ee]}return J})();function et(de){return typeof BigInt>"u"?xt:de}function xt(){throw new Error("BigInt not supported")}})(gE)),gE}var vE,K9;function oa(){return K9||(K9=1,vE={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,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(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.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(r,e,t){return r.set(e,t)},Boolean,Uint8Array}),vE}var bE={exports:{}},tg={exports:{}},J9;function Mg(){if(J9)return tg.exports;J9=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return tg.exports=r,tg.exports.AbortSignal=e,tg.exports.default=r,tg.exports}var cw={exports:{}},Y9;function Hg(){if(Y9)return cw.exports;Y9=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(O,W,Z){return Function.prototype.apply.call(O,W,Z)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:t=function(O){return Object.getOwnPropertyNames(O)};function a(R){console&&console.warn&&console.warn(R)}var s=Number.isNaN||function(O){return O!==O};function u(){u.init.call(this)}cw.exports=u,cw.exports.once=T,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var o=10;function c(R){if(typeof R!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof R)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(R){if(typeof R!="number"||R<0||s(R))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");o=R}}),u.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},u.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||s(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function p(R){return R._maxListeners===void 0?u.defaultMaxListeners:R._maxListeners}u.prototype.getMaxListeners=function(){return p(this)},u.prototype.emit=function(O){for(var W=[],Z=1;Z<arguments.length;Z++)W.push(arguments[Z]);var se=O==="error",ye=this._events;if(ye!==void 0)se=se&&ye.error===void 0;else if(!se)return!1;if(se){var he;if(W.length>0&&(he=W[0]),he instanceof Error)throw he;var te=new Error("Unhandled error."+(he?" ("+he.message+")":""));throw te.context=he,te}var re=ye[O];if(re===void 0)return!1;if(typeof re=="function")e(re,this,W);else for(var S=re.length,_=x(re,S),Z=0;Z<S;++Z)e(_[Z],this,W);return!0};function d(R,O,W,Z){var se,ye,he;if(c(W),ye=R._events,ye===void 0?(ye=R._events=Object.create(null),R._eventsCount=0):(ye.newListener!==void 0&&(R.emit("newListener",O,W.listener?W.listener:W),ye=R._events),he=ye[O]),he===void 0)he=ye[O]=W,++R._eventsCount;else if(typeof he=="function"?he=ye[O]=Z?[W,he]:[he,W]:Z?he.unshift(W):he.push(W),se=p(R),se>0&&he.length>se&&!he.warned){he.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+he.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=R,te.type=O,te.count=he.length,a(te)}return R}u.prototype.addListener=function(O,W){return d(this,O,W,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(O,W){return d(this,O,W,!0)};function y(){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 m(R,O,W){var Z={fired:!1,wrapFn:void 0,target:R,type:O,listener:W},se=y.bind(Z);return se.listener=W,Z.wrapFn=se,se}u.prototype.once=function(O,W){return c(W),this.on(O,m(this,O,W)),this},u.prototype.prependOnceListener=function(O,W){return c(W),this.prependListener(O,m(this,O,W)),this},u.prototype.removeListener=function(O,W){var Z,se,ye,he,te;if(c(W),se=this._events,se===void 0)return this;if(Z=se[O],Z===void 0)return this;if(Z===W||Z.listener===W)--this._eventsCount===0?this._events=Object.create(null):(delete se[O],se.removeListener&&this.emit("removeListener",O,Z.listener||W));else if(typeof Z!="function"){for(ye=-1,he=Z.length-1;he>=0;he--)if(Z[he]===W||Z[he].listener===W){te=Z[he].listener,ye=he;break}if(ye<0)return this;ye===0?Z.shift():E(Z,ye),Z.length===1&&(se[O]=Z[0]),se.removeListener!==void 0&&this.emit("removeListener",O,te||W)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(O){var W,Z,se;if(Z=this._events,Z===void 0)return this;if(Z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Z[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Z[O]),this;if(arguments.length===0){var ye=Object.keys(Z),he;for(se=0;se<ye.length;++se)he=ye[se],he!=="removeListener"&&this.removeAllListeners(he);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(W=Z[O],typeof W=="function")this.removeListener(O,W);else if(W!==void 0)for(se=W.length-1;se>=0;se--)this.removeListener(O,W[se]);return this};function v(R,O,W){var Z=R._events;if(Z===void 0)return[];var se=Z[O];return se===void 0?[]:typeof se=="function"?W?[se.listener||se]:[se]:W?C(se):x(se,se.length)}u.prototype.listeners=function(O){return v(this,O,!0)},u.prototype.rawListeners=function(O){return v(this,O,!1)},u.listenerCount=function(R,O){return typeof R.listenerCount=="function"?R.listenerCount(O):b.call(R,O)},u.prototype.listenerCount=b;function b(R){var O=this._events;if(O!==void 0){var W=O[R];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function x(R,O){for(var W=new Array(O),Z=0;Z<O;++Z)W[Z]=R[Z];return W}function E(R,O){for(;O+1<R.length;O++)R[O]=R[O+1];R.pop()}function C(R){for(var O=new Array(R.length),W=0;W<O.length;++W)O[W]=R[W].listener||R[W];return O}function T(R,O){return new Promise(function(W,Z){function se(he){R.removeListener(O,ye),Z(he)}function ye(){typeof R.removeListener=="function"&&R.removeListener("error",se),W([].slice.call(arguments))}M(R,O,ye,{once:!0}),O!=="error"&&k(R,se,{once:!0})})}function k(R,O,W){typeof R.on=="function"&&M(R,"error",O,W)}function M(R,O,W,Z){if(typeof R.on=="function")Z.once?R.once(O,W):R.on(O,W);else if(typeof R.addEventListener=="function")R.addEventListener(O,function se(ye){Z.once&&R.removeEventListener(O,se),W(ye)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof R)}return cw.exports}var Q9;function as(){return Q9||(Q9=1,(function(r){const e=Ep(),{kResistStopPropagation:t,SymbolDispose:a}=oa(),s=globalThis.AbortSignal||Mg().AbortSignal,u=globalThis.AbortController||Mg().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||e.Blob,p=typeof c<"u"?function(b){return b instanceof c}:function(b){return!1},d=(v,b)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new ERR_INVALID_ARG_TYPE(b,"AbortSignal",v)},y=(v,b)=>{if(typeof v!="function")throw new ERR_INVALID_ARG_TYPE(b,"Function",v)};class m extends Error{constructor(b){if(!Array.isArray(b))throw new TypeError(`Expected input to be an Array, got ${typeof b}`);let x="";for(let E=0;E<b.length;E++)x+=` ${b[E].stack}
|
|
327
|
-
`;super(x),this.name="AggregateError",this.errors=b}}r.exports={AggregateError:m,kEmptyObject:Object.freeze({}),once(v){let b=!1;return function(...x){b||(b=!0,v.apply(this,x))}},createDeferredPromise:function(){let v,b;return{promise:new Promise((E,C)=>{v=E,b=C}),resolve:v,reject:b}},promisify(v){return new Promise((b,x)=>{v((E,...C)=>E?x(E):b(...C))})},debuglog(){return function(){}},format(v,...b){return v.replace(/%([sdifj])/g,function(...[x,E]){const C=b.shift();return E==="f"?C.toFixed(6):E==="j"?JSON.stringify(C):E==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof o},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:p,deprecate(v,b){return v},addAbortListener:Hg().addAbortListener||function(b,x){if(b===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",b);d(b,"signal"),y(x,"listener");let E;return b.aborted?queueMicrotask(()=>x()):(b.addEventListener("abort",x,{__proto__:null,once:!0,[t]:!0}),E=()=>{b.removeEventListener("abort",x)}),{__proto__:null,[a](){var C;(C=E)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(b){if(b.length===1)return b[0];const x=new u,E=()=>x.abort();return b.forEach(C=>{d(C,"signals"),C.addEventListener("abort",E,{once:!0})}),x.signal.addEventListener("abort",()=>{b.forEach(C=>C.removeEventListener("abort",E))},{once:!0}),x.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(bE)),bE.exports}var fw={},wE,X9;function Ns(){if(X9)return wE;X9=1;const{format:r,inspect:e,AggregateError:t}=as(),a=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",p={};function d(C,T){if(!C)throw new p.ERR_INTERNAL_ASSERTION(T)}function y(C){let T="",k=C.length;const M=C[0]==="-"?1:0;for(;k>=M+4;k-=3)T=`_${C.slice(k-3,k)}${T}`;return`${C.slice(0,k)}${T}`}function m(C,T,k){if(typeof T=="function")return d(T.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T.length}).`),T(...k);const M=(T.match(/%[dfijoOs]/g)||[]).length;return d(M===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M}).`),k.length===0?T:r(T,...k)}function v(C,T,k){k||(k=Error);class M extends k{constructor(...O){super(m(C,T,O))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(M.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${C}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),M.prototype.code=C,M.prototype[s]=!0,p[C]=M}function b(C){const T=c+C.name;return Object.defineProperty(C,"name",{value:T}),C}function x(C,T){if(C&&T&&C!==T){if(Array.isArray(T.errors))return T.errors.push(C),T;const k=new a([T,C],T.message);return k.code=T.code,k}return C||T}class E extends Error{constructor(T="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new p.ERR_INVALID_ARG_TYPE("options","Object",k);super(T,k),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(C,T,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(T)||(T=[T]);let M="The ";C.endsWith(" argument")?M+=`${C} `:M+=`"${C}" ${C.includes(".")?"property":"argument"} `,M+="must be ";const R=[],O=[],W=[];for(const se of T)d(typeof se=="string","All expected entries have to be of type string"),u.includes(se)?R.push(se.toLowerCase()):o.test(se)?O.push(se):(d(se!=="object",'The value "object" should be written as "Object"'),W.push(se));if(O.length>0){const se=R.indexOf("object");se!==-1&&(R.splice(R,se,1),O.push("Object"))}if(R.length>0){switch(R.length){case 1:M+=`of type ${R[0]}`;break;case 2:M+=`one of type ${R[0]} or ${R[1]}`;break;default:{const se=R.pop();M+=`one of type ${R.join(", ")}, or ${se}`}}(O.length>0||W.length>0)&&(M+=" or ")}if(O.length>0){switch(O.length){case 1:M+=`an instance of ${O[0]}`;break;case 2:M+=`an instance of ${O[0]} or ${O[1]}`;break;default:{const se=O.pop();M+=`an instance of ${O.join(", ")}, or ${se}`}}W.length>0&&(M+=" or ")}switch(W.length){case 0:break;case 1:W[0].toLowerCase()!==W[0]&&(M+="an "),M+=`${W[0]}`;break;case 2:M+=`one of ${W[0]} or ${W[1]}`;break;default:{const se=W.pop();M+=`one of ${W.join(", ")}, or ${se}`}}if(k==null)M+=`. Received ${k}`;else if(typeof k=="function"&&k.name)M+=`. Received function ${k.name}`;else if(typeof k=="object"){var Z;if((Z=k.constructor)!==null&&Z!==void 0&&Z.name)M+=`. Received an instance of ${k.constructor.name}`;else{const se=e(k,{depth:-1});M+=`. Received ${se}`}}else{let se=e(k,{colors:!1});se.length>25&&(se=`${se.slice(0,25)}...`),M+=`. Received type ${typeof k} (${se})`}return M},TypeError),v("ERR_INVALID_ARG_VALUE",(C,T,k="is invalid")=>{let M=e(T);return M.length>128&&(M=M.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${M}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(C,T,k)=>{var M;const R=k!=null&&(M=k.constructor)!==null&&M!==void 0&&M.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${T}" function but got ${R}.`},TypeError),v("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let T;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(M=>`"${M}"`).join(" or "),k){case 1:T+=`The ${C[0]} argument`;break;case 2:T+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const M=C.pop();T+=`The ${C.join(", ")}, and ${M} arguments`}break}return`${T} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(C,T,k)=>{d(T,'Missing "range" argument');let M;return Number.isInteger(k)&&Math.abs(k)>2**32?M=y(String(k)):typeof k=="bigint"?(M=String(k),(k>2n**32n||k<-(2n**32n))&&(M=y(M)),M+="n"):M=e(k),`The value of "${C}" is out of range. It must be ${T}. Received ${M}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),wE={AbortError:E,aggregateTwoErrors:b(x),hideStackFrames:b,codes:p},wE}var _E,Z9;function Vg(){if(Z9)return _E;Z9=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:y,String:m,StringPrototypeToUpperCase:v,StringPrototypeTrim:b}=oa(),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:T,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:M}}=Ns(),{normalizeEncoding:R}=as(),{isAsyncFunction:O,isArrayBufferView:W}=as().types,Z={};function se(Q){return Q===(Q|0)}function ye(Q){return Q===Q>>>0}const he=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function re(Q,le,Ae){if(typeof Q>"u"&&(Q=Ae),typeof Q=="string"){if(y(he,Q)===null)throw new T(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const S=x((Q,le,Ae=c,Re=o)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),_=x((Q,le,Ae=-2147483648,Re=2147483647)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),P=x((Q,le,Ae=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=Ae?1:0,Je=4294967295;if(Q<Re||Q>Je)throw new k(le,`>= ${Re} && <= ${Je}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,Ae=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(Ae!=null&&Q<Ae||Re!=null&&Q>Re||(Ae!=null||Re!=null)&&u(Q))throw new k(le,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const B=x((Q,le,Ae)=>{if(!e(Ae,Q)){const Je="must be one of: "+t(a(Ae,lt=>typeof lt=="string"?`'${lt}'`:m(lt)),", ");throw new T(le,Q,Je)}});function X(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function $(Q,le,Ae){return Q==null||!d(Q,le)?Ae:Q[le]}const D=x((Q,le,Ae=null)=>{const Re=$(Ae,"allowArray",!1),Je=$(Ae,"allowFunction",!1);if(!$(Ae,"nullable",!1)&&Q===null||!Re&&r(Q)||typeof Q!="object"&&(!Je||typeof Q!="function"))throw new C(le,"Object",Q)}),N=x((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),Y=x((Q,le,Ae=0)=>{if(!r(Q))throw new C(le,"Array",Q);if(Q.length<Ae){const Re=`must be longer than ${Ae}`;throw new T(le,Q,Re)}});function ie(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++)j(Q[Ae],`${le}[${Ae}]`)}function V(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++)X(Q[Ae],`${le}[${Ae}]`)}function Ce(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++){const Re=Q[Ae],Je=`${le}[${Ae}]`;if(Re==null)throw new C(Je,"AbortSignal",Re);ce(Re,Je)}}function Oe(Q,le="signal"){if(j(Q,le),Z[Q]===void 0)throw Z[v(Q)]!==void 0?new M(Q+" (signals must use all capital letters)"):new M(Q)}const Se=x((Q,le="buffer")=>{if(!W(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Te(Q,le){const Ae=R(le),Re=Q.length;if(Ae==="hex"&&Re%2!==0)throw new T("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",Ae=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&b(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!Ae)throw new E(le,Q,Ae);return Q|0}const ce=x((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=x((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=x((Q,le)=>{if(typeof Q!="function"||O(Q))throw new C(le,"Function",Q)}),fe=x((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function xe(Q,le,Ae){if(!e(Ae,Q))throw new C(le,`('${t(Ae,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function z(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new T(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function H(Q){if(typeof Q=="string")return z(Q,"hints"),Q;if(r(Q)){const le=Q.length;let Ae="";if(le===0)return Ae;for(let Re=0;Re<le;Re++){const Je=Q[Re];z(Je,"hints"),Ae+=Je,Re!==le-1&&(Ae+=", ")}return Ae}throw new T("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return _E={isInt32:se,isUint32:ye,parseFileMode:re,validateArray:Y,validateStringArray:ie,validateBooleanArray:V,validateAbortSignalArray:Ce,validateBoolean:X,validateBuffer:Se,validateDictionary:N,validateEncoding:Te,validateFunction:be,validateInt32:_,validateInteger:S,validateNumber:q,validateObject:D,validateOneOf:B,validatePlainFunction:me,validatePort:oe,validateSignalName:Oe,validateString:j,validateUint32:P,validateUndefined:fe,validateUnion:xe,validateAbortSignal:ce,validateLinkHeaderValue:H},_E}var dw={exports:{}},xE={exports:{}},eO;function Df(){if(eO)return xE.exports;eO=1;var r=xE.exports={},e,t;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function u(E){if(e===setTimeout)return setTimeout(E,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this,E,0)}}}function o(E){if(t===clearTimeout)return clearTimeout(E);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(E);try{return t(E)}catch{try{return t.call(null,E)}catch{return t.call(this,E)}}}var c=[],p=!1,d,y=-1;function m(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&v())}function v(){if(!p){var E=u(m);p=!0;for(var C=c.length;C;){for(d=c,c=[];++y<C;)d&&d[y].run();y=-1,C=c.length}d=null,p=!1,o(E)}}r.nextTick=function(E){var C=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)C[T-1]=arguments[T];c.push(new b(E,C)),c.length===1&&!p&&u(v)};function b(E,C){this.fun=E,this.array=C}b.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function x(){}return r.on=x,r.addListener=x,r.once=x,r.off=x,r.removeListener=x,r.removeAllListeners=x,r.emit=x,r.prependListener=x,r.prependOnceListener=x,r.listeners=function(E){return[]},r.binding=function(E){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(E){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},xE.exports}var SE,tO;function xc(){if(tO)return SE;tO=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=oa(),a=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),u=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),c=t("nodejs.stream.disturbed"),p=t("nodejs.webstream.isClosedPromise"),d=t("nodejs.webstream.controllerErrorFunction");function y($,D=!1){var N;return!!($&&typeof $.pipe=="function"&&typeof $.on=="function"&&(!D||typeof $.pause=="function"&&typeof $.resume=="function")&&(!$._writableState||((N=$._readableState)===null||N===void 0?void 0:N.readable)!==!1)&&(!$._writableState||$._readableState))}function m($){var D;return!!($&&typeof $.write=="function"&&typeof $.on=="function"&&(!$._readableState||((D=$._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function v($){return!!($&&typeof $.pipe=="function"&&$._readableState&&typeof $.on=="function"&&typeof $.write=="function")}function b($){return $&&($._readableState||$._writableState||typeof $.write=="function"&&typeof $.on=="function"||typeof $.pipe=="function"&&typeof $.on=="function")}function x($){return!!($&&!b($)&&typeof $.pipeThrough=="function"&&typeof $.getReader=="function"&&typeof $.cancel=="function")}function E($){return!!($&&!b($)&&typeof $.getWriter=="function"&&typeof $.abort=="function")}function C($){return!!($&&!b($)&&typeof $.readable=="object"&&typeof $.writable=="object")}function T($){return x($)||E($)||C($)}function k($,D){return $==null?!1:D===!0?typeof $[r]=="function":D===!1?typeof $[e]=="function":typeof $[r]=="function"||typeof $[e]=="function"}function M($){if(!b($))return null;const D=$._writableState,N=$._readableState,Y=D||N;return!!($.destroyed||$[a]||Y!=null&&Y.destroyed)}function R($){if(!m($))return null;if($.writableEnded===!0)return!0;const D=$._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function O($,D){if(!m($))return null;if($.writableFinished===!0)return!0;const N=$._writableState;return N!=null&&N.errored?!1:typeof N?.finished!="boolean"?null:!!(N.finished||D===!1&&N.ended===!0&&N.length===0)}function W($){if(!y($))return null;if($.readableEnded===!0)return!0;const D=$._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function Z($,D){if(!y($))return null;const N=$._readableState;return N!=null&&N.errored?!1:typeof N?.endEmitted!="boolean"?null:!!(N.endEmitted||D===!1&&N.ended===!0&&N.length===0)}function se($){return $&&$[u]!=null?$[u]:typeof $?.readable!="boolean"?null:M($)?!1:y($)&&$.readable&&!Z($)}function ye($){return $&&$[o]!=null?$[o]:typeof $?.writable!="boolean"?null:M($)?!1:m($)&&$.writable&&!R($)}function he($,D){return b($)?M($)?!0:!(D?.readable!==!1&&se($)||D?.writable!==!1&&ye($)):null}function te($){var D,N;return b($)?$.writableErrored?$.writableErrored:(D=(N=$._writableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function re($){var D,N;return b($)?$.readableErrored?$.readableErrored:(D=(N=$._readableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function S($){if(!b($))return null;if(typeof $.closed=="boolean")return $.closed;const D=$._writableState,N=$._readableState;return typeof D?.closed=="boolean"||typeof N?.closed=="boolean"?D?.closed||N?.closed:typeof $._closed=="boolean"&&_($)?$._closed:null}function _($){return typeof $._closed=="boolean"&&typeof $._defaultKeepAlive=="boolean"&&typeof $._removedConnection=="boolean"&&typeof $._removedContLen=="boolean"}function P($){return typeof $._sent100=="boolean"&&_($)}function j($){var D;return typeof $._consuming=="boolean"&&typeof $._dumped=="boolean"&&((D=$.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q($){if(!b($))return null;const D=$._writableState,N=$._readableState,Y=D||N;return!Y&&P($)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function B($){var D;return!!($&&((D=$[c])!==null&&D!==void 0?D:$.readableDidRead||$.readableAborted))}function X($){var D,N,Y,ie,V,Ce,Oe,Se,Te,oe;return!!($&&((D=(N=(Y=(ie=(V=(Ce=$[s])!==null&&Ce!==void 0?Ce:$.readableErrored)!==null&&V!==void 0?V:$.writableErrored)!==null&&ie!==void 0?ie:(Oe=$._readableState)===null||Oe===void 0?void 0:Oe.errorEmitted)!==null&&Y!==void 0?Y:(Se=$._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&N!==void 0?N:(Te=$._readableState)===null||Te===void 0?void 0:Te.errored)!==null&&D!==void 0?D:!((oe=$._writableState)===null||oe===void 0)&&oe.errored))}return SE={isDestroyed:M,kIsDestroyed:a,isDisturbed:B,kIsDisturbed:c,isErrored:X,kIsErrored:s,isReadable:se,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:S,isDuplexNodeStream:v,isFinished:he,isIterable:k,isReadableNodeStream:y,isReadableStream:x,isReadableEnded:W,isReadableFinished:Z,isReadableErrored:re,isNodeStream:b,isWebStream:T,isWritable:ye,isWritableNodeStream:m,isWritableStream:E,isWritableEnded:R,isWritableFinished:O,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},SE}var nO;function Uf(){if(nO)return dw.exports;nO=1;const r=Df(),{AbortError:e,codes:t}=Ns(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=as(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=Vg(),{Promise:m,PromisePrototypeThen:v,SymbolDispose:b}=oa(),{isClosed:x,isReadable:E,isReadableNodeStream:C,isReadableStream:T,isReadableFinished:k,isReadableErrored:M,isWritable:R,isWritableNodeStream:O,isWritableStream:W,isWritableFinished:Z,isWritableErrored:se,isNodeStream:ye,willEmitClose:he,kIsClosedPromise:te}=xc();let re;function S(B){return B.setHeader&&typeof B.abort=="function"}const _=()=>{};function P(B,X,$){var D,N;if(arguments.length===2?($=X,X=u):X==null?X=u:d(X,"options"),p($,"callback"),c(X.signal,"options.signal"),$=o($),T(B)||W(B))return j(B,X,$);if(!ye(B))throw new a("stream",["ReadableStream","WritableStream","Stream"],B);const Y=(D=X.readable)!==null&&D!==void 0?D:C(B),ie=(N=X.writable)!==null&&N!==void 0?N:O(B),V=B._writableState,Ce=B._readableState,Oe=()=>{B.writable||oe()};let Se=he(B)&&C(B)===Y&&O(B)===ie,Te=Z(B,!1);const oe=()=>{Te=!0,B.destroyed&&(Se=!1),!(Se&&(!B.readable||Y))&&(!Y||ce)&&$.call(B)};let ce=k(B,!1);const be=()=>{ce=!0,B.destroyed&&(Se=!1),!(Se&&(!B.writable||ie))&&(!ie||Te)&&$.call(B)},me=Q=>{$.call(B,Q)};let fe=x(B);const xe=()=>{fe=!0;const Q=se(B)||M(B);if(Q&&typeof Q!="boolean")return $.call(B,Q);if(Y&&!ce&&C(B,!0)&&!k(B,!1))return $.call(B,new s);if(ie&&!Te&&!Z(B,!1))return $.call(B,new s);$.call(B)},ne=()=>{fe=!0;const Q=se(B)||M(B);if(Q&&typeof Q!="boolean")return $.call(B,Q);$.call(B)},z=()=>{B.req.on("finish",oe)};S(B)?(B.on("complete",oe),Se||B.on("abort",xe),B.req?z():B.on("request",z)):ie&&!V&&(B.on("end",Oe),B.on("close",Oe)),!Se&&typeof B.aborted=="boolean"&&B.on("aborted",xe),B.on("end",be),B.on("finish",oe),X.error!==!1&&B.on("error",me),B.on("close",xe),fe?r.nextTick(xe):V!=null&&V.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||r.nextTick(ne):(!Y&&(!Se||E(B))&&(Te||R(B)===!1)||!ie&&(!Se||R(B))&&(ce||E(B)===!1)||Ce&&B.req&&B.aborted)&&r.nextTick(ne);const H=()=>{$=_,B.removeListener("aborted",xe),B.removeListener("complete",oe),B.removeListener("abort",xe),B.removeListener("request",z),B.req&&B.req.removeListener("finish",oe),B.removeListener("end",Oe),B.removeListener("close",Oe),B.removeListener("finish",oe),B.removeListener("end",be),B.removeListener("error",me),B.removeListener("close",xe)};if(X.signal&&!fe){const Q=()=>{const le=$;H(),le.call(B,new e(void 0,{cause:X.signal.reason}))};if(X.signal.aborted)r.nextTick(Q);else{re=re||as().addAbortListener;const le=re(X.signal,Q),Ae=$;$=o((...Re)=>{le[b](),Ae.apply(B,Re)})}}return H}function j(B,X,$){let D=!1,N=_;if(X.signal)if(N=()=>{D=!0,$.call(B,new e(void 0,{cause:X.signal.reason}))},X.signal.aborted)r.nextTick(N);else{re=re||as().addAbortListener;const ie=re(X.signal,N),V=$;$=o((...Ce)=>{ie[b](),V.apply(B,Ce)})}const Y=(...ie)=>{D||r.nextTick(()=>$.apply(B,ie))};return v(B[te].promise,Y,Y),_}function q(B,X){var $;let D=!1;return X===null&&(X=u),($=X)!==null&&$!==void 0&&$.cleanup&&(y(X.cleanup,"cleanup"),D=X.cleanup),new m((N,Y)=>{const ie=P(B,X,V=>{D&&ie(),V?Y(V):N()})})}return dw.exports=P,dw.exports.finished=q,dw.exports}var CE,rO;function U0(){if(rO)return CE;rO=1;const r=Df(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ns(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=xc(),d=s("kDestroy"),y=s("kConstruct");function m(he,te,re){he&&(he.stack,te&&!te.errored&&(te.errored=he),re&&!re.errored&&(re.errored=he))}function v(he,te){const re=this._readableState,S=this._writableState,_=S||re;return S!=null&&S.destroyed||re!=null&&re.destroyed?(typeof te=="function"&&te(),this):(m(he,S,re),S&&(S.destroyed=!0),re&&(re.destroyed=!0),_.constructed?b(this,he,te):this.once(d,function(P){b(this,e(P,he),te)}),this)}function b(he,te,re){let S=!1;function _(P){if(S)return;S=!0;const j=he._readableState,q=he._writableState;m(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof re=="function"&&re(P),P?r.nextTick(x,he,P):r.nextTick(E,he)}try{he._destroy(te||null,_)}catch(P){_(P)}}function x(he,te){C(he,te),E(he)}function E(he){const te=he._readableState,re=he._writableState;re&&(re.closeEmitted=!0),te&&(te.closeEmitted=!0),(re!=null&&re.emitClose||te!=null&&te.emitClose)&&he.emit("close")}function C(he,te){const re=he._readableState,S=he._writableState;S!=null&&S.errorEmitted||re!=null&&re.errorEmitted||(S&&(S.errorEmitted=!0),re&&(re.errorEmitted=!0),he.emit("error",te))}function T(){const he=this._readableState,te=this._writableState;he&&(he.constructed=!0,he.closed=!1,he.closeEmitted=!1,he.destroyed=!1,he.errored=null,he.errorEmitted=!1,he.reading=!1,he.ended=he.readable===!1,he.endEmitted=he.readable===!1),te&&(te.constructed=!0,te.destroyed=!1,te.closed=!1,te.closeEmitted=!1,te.errored=null,te.errorEmitted=!1,te.finalCalled=!1,te.prefinished=!1,te.ended=te.writable===!1,te.ending=te.writable===!1,te.finished=te.writable===!1)}function k(he,te,re){const S=he._readableState,_=he._writableState;if(_!=null&&_.destroyed||S!=null&&S.destroyed)return this;S!=null&&S.autoDestroy||_!=null&&_.autoDestroy?he.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),S&&!S.errored&&(S.errored=te),re?r.nextTick(C,he,te):C(he,te))}function M(he,te){if(typeof he._construct!="function")return;const re=he._readableState,S=he._writableState;re&&(re.constructed=!1),S&&(S.constructed=!1),he.once(y,te),!(he.listenerCount(y)>1)&&r.nextTick(R,he)}function R(he){let te=!1;function re(S){if(te){k(he,S??new t);return}te=!0;const _=he._readableState,P=he._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?he.emit(d,S):S?k(he,S,!0):r.nextTick(O,he)}try{he._construct(S=>{r.nextTick(re,S)})}catch(S){r.nextTick(re,S)}}function O(he){he.emit(y)}function W(he){return he?.setHeader&&typeof he.abort=="function"}function Z(he){he.emit("close")}function se(he,te){he.emit("error",te),r.nextTick(Z,he)}function ye(he,te){!he||o(he)||(!te&&!c(he)&&(te=new a),p(he)?(he.socket=null,he.destroy(te)):W(he)?he.abort():W(he.req)?he.req.abort():typeof he.destroy=="function"?he.destroy(te):typeof he.close=="function"?he.close():te?r.nextTick(se,he,te):r.nextTick(Z,he),he.destroyed||(he[u]=!0))}return CE={construct:M,destroyer:ye,destroy:v,undestroy:T,errorOrDestroy:k},CE}var EE,aO;function s8(){if(aO)return EE;aO=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=Hg();function a(u){t.call(this,u)}e(a.prototype,t.prototype),e(a,t),a.prototype.pipe=function(u,o){const c=this;function p(E){u.writable&&u.write(E)===!1&&c.pause&&c.pause()}c.on("data",p);function d(){c.readable&&c.resume&&c.resume()}u.on("drain",d),!u._isStdio&&(!o||o.end!==!1)&&(c.on("end",m),c.on("close",v));let y=!1;function m(){y||(y=!0,u.end())}function v(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function b(E){x(),t.listenerCount(this,"error")===0&&this.emit("error",E)}s(c,"error",b),s(u,"error",b);function x(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",m),c.removeListener("close",v),c.removeListener("error",b),u.removeListener("error",b),c.removeListener("end",x),c.removeListener("close",x),u.removeListener("close",x)}return c.on("end",x),c.on("close",x),u.on("close",x),u.emit("pipe",c),u};function s(u,o,c){if(typeof u.prependListener=="function")return u.prependListener(o,c);!u._events||!u._events[o]?u.on(o,c):r(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return EE={Stream:a,prependListener:s},EE}var AE={exports:{}},iO;function x_(){return iO||(iO=1,(function(r){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ns(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=xc(),c=Uf(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(m,v)=>{if(typeof m!="object"||!("aborted"in m))throw new p(v,"AbortSignal",m)};r.exports.addAbortSignal=function(v,b){if(y(v,"signal"),!s(b)&&!u(b))throw new p("stream",["ReadableStream","WritableStream","Stream"],b);return r.exports.addAbortSignalNoValidate(v,b)},r.exports.addAbortSignalNoValidate=function(m,v){if(typeof m!="object"||!("aborted"in m))return v;const b=s(v)?()=>{v.destroy(new t(void 0,{cause:m.reason}))}:()=>{v[o](new t(void 0,{cause:m.reason}))};if(m.aborted)b();else{d=d||as().addAbortListener;const x=d(m,b);c(v,x[e])}return v}})(AE)),AE.exports}var kE,sO;function bJ(){if(sO)return kE;sO=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Ep(),{inspect:u}=as();return kE=class{constructor(){this.head=null,this.tail=null,this.length=0}push(c){const p={data:c,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}unshift(c){const p={data:c,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}shift(){if(this.length===0)return;const c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}clear(){this.head=this.tail=null,this.length=0}join(c){if(this.length===0)return"";let p=this.head,d=""+p.data;for(;(p=p.next)!==null;)d+=c+p.data;return d}concat(c){if(this.length===0)return s.alloc(0);const p=s.allocUnsafe(c>>>0);let d=this.head,y=0;for(;d;)t(p,d.data,y),y+=d.data.length,d=d.next;return p}consume(c,p){const d=this.head.data;if(c<d.length){const y=d.slice(0,c);return this.head.data=d.slice(c),y}return c===d.length?this.shift():p?this._getString(c):this._getBuffer(c)}first(){return this.head.data}*[e](){for(let c=this.head;c;c=c.next)yield c.data}_getString(c){let p="",d=this.head,y=0;do{const m=d.data;if(c>m.length)p+=m,c-=m.length;else{c===m.length?(p+=m,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=r(m,0,c),this.head=d,d.data=r(m,c));break}++y}while((d=d.next)!==null);return this.length-=y,p}_getBuffer(c){const p=s.allocUnsafe(c),d=c;let y=this.head,m=0;do{const v=y.data;if(c>v.length)t(p,v,d-c),c-=v.length;else{c===v.length?(t(p,v,d-c),++m,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(v.buffer,v.byteOffset,c),d-c),this.head=y,y.data=v.slice(c));break}++m}while((y=y.next)!==null);return this.length-=m,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},kE}var TE,oO;function S_(){if(oO)return TE;oO=1;const{MathFloor:r,NumberIsInteger:e}=oa(),{validateInteger:t}=Vg(),{ERR_INVALID_ARG_VALUE:a}=Ns().codes;let s=16*1024,u=16;function o(y,m,v){return y.highWaterMark!=null?y.highWaterMark:m?y[v]:null}function c(y){return y?u:s}function p(y,m){t(m,"value",0),y?u=m:s=m}function d(y,m,v,b){const x=o(m,b,v);if(x!=null){if(!e(x)||x<0){const E=b?`options.${v}`:"options.highWaterMark";throw new a(E,x)}return r(x)}return c(y.objectMode)}return TE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},TE}var ME={},uO;function zP(){if(uO)return ME;uO=1;var r=uP().Buffer,e=r.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(T){if(!T)return"utf8";for(var k;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(k)return;T=(""+T).toLowerCase(),k=!0}}function a(T){var k=t(T);if(typeof k!="string"&&(r.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return k||T}ME.StringDecoder=s;function s(T){this.encoding=a(T);var k;switch(this.encoding){case"utf16le":this.text=m,this.end=v,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=b,this.end=x,k=3;break;default:this.write=E,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(k)}s.prototype.write=function(T){if(T.length===0)return"";var k,M;if(this.lastNeed){if(k=this.fillLast(T),k===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<T.length?k?k+this.text(T,M):this.text(T,M):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function u(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function o(T,k,M){var R=k.length-1;if(R<M)return 0;var O=u(k[R]);return O>=0?(O>0&&(T.lastNeed=O-1),O):--R<M||O===-2?0:(O=u(k[R]),O>=0?(O>0&&(T.lastNeed=O-2),O):--R<M||O===-2?0:(O=u(k[R]),O>=0?(O>0&&(O===2?O=0:T.lastNeed=O-3),O):0))}function c(T,k,M){if((k[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return T.lastNeed=2,"�"}}function p(T){var k=this.lastTotal-this.lastNeed,M=c(this,T);if(M!==void 0)return M;if(this.lastNeed<=T.length)return T.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,k,0,T.length),this.lastNeed-=T.length}function d(T,k){var M=o(this,T,k);if(!this.lastNeed)return T.toString("utf8",k);this.lastTotal=M;var R=T.length-(M-this.lastNeed);return T.copy(this.lastChar,0,R),T.toString("utf8",k,R)}function y(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+"�":k}function m(T,k){if((T.length-k)%2===0){var M=T.toString("utf16le",k);if(M){var R=M.charCodeAt(M.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",k,T.length-1)}function v(T){var k=T&&T.length?this.write(T):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,M)}return k}function b(T,k){var M=(T.length-k)%3;return M===0?T.toString("base64",k):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",k,T.length-M))}function x(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function E(T){return T.toString(this.encoding)}function C(T){return T&&T.length?this.write(T):""}return ME}var RE,lO;function jP(){if(lO)return RE;lO=1;const r=Df(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Ep(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ns().codes;function c(p,d,y){let m;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let v;if(d&&d[t])v=!0,m=d[t]();else if(d&&d[a])v=!1,m=d[a]();else throw new u("iterable",["Iterable"],d);const b=new p({objectMode:!0,highWaterMark:1,...y});let x=!1;b._read=function(){x||(x=!0,C())},b._destroy=function(T,k){e(E(T),()=>r.nextTick(k,T),M=>r.nextTick(k,M||T))};async function E(T){const k=T!=null,M=typeof m.throw=="function";if(k&&M){const{value:R,done:O}=await m.throw(T);if(await R,O)return}if(typeof m.return=="function"){const{value:R}=await m.return();await R}}async function C(){for(;;){try{const{value:T,done:k}=v?await m.next():m.next();if(k)b.push(null);else{const M=T&&typeof T.then=="function"?await T:T;if(M===null)throw x=!1,new o;if(b.push(M))continue;x=!1}}catch(T){b.destroy(T)}break}}return b}return RE=c,RE}var OE,cO;function C_(){if(cO)return OE;cO=1;const r=Df(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:m,Symbol:v}=oa();OE=Re,Re.ReadableState=Ae;const{EventEmitter:b}=Hg(),{Stream:x,prependListener:E}=s8(),{Buffer:C}=Ep(),{addAbortSignal:T}=x_(),k=Uf();let M=as().debuglog("stream",ke=>{M=ke});const R=bJ(),O=U0(),{getHighWaterMark:W,getDefaultHighWaterMark:Z}=S_(),{aggregateTwoErrors:se,codes:{ERR_INVALID_ARG_TYPE:ye,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:re,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:S},AbortError:_}=Ns(),{validateObject:P}=Vg(),j=v("kPaused"),{StringDecoder:q}=zP(),B=jP();c(Re.prototype,x.prototype),c(Re,x);const X=()=>{},{errorOrDestroy:$}=O,D=1,N=2,Y=4,ie=8,V=16,Ce=32,Oe=64,Se=128,Te=256,oe=512,ce=1024,be=2048,me=4096,fe=8192,xe=16384,ne=32768,z=65536,H=1<<17,Q=1<<18;function le(ke){return{enumerable:!1,get(){return(this.state&ke)!==0},set(I){I?this.state|=ke:this.state&=~ke}}}u(Ae.prototype,{objectMode:le(D),ended:le(N),endEmitted:le(Y),reading:le(ie),constructed:le(V),sync:le(Ce),needReadable:le(Oe),emittedReadable:le(Se),readableListening:le(Te),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(fe),closed:le(xe),closeEmitted:le(ne),multiAwaitDrain:le(z),readingMore:le(H),dataEmitted:le(Q)});function Ae(ke,I,ze){typeof ze!="boolean"&&(ze=I instanceof bc()),this.state=be|me|V|Ce,ke&&ke.objectMode&&(this.state|=D),ze&&ke&&ke.readableObjectMode&&(this.state|=D),this.highWaterMark=ke?W(this,ke,"readableHighWaterMark",ze):Z(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,ke&&ke.emitClose===!1&&(this.state&=~be),ke&&ke.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=ke&&ke.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ke&&ke.encoding&&(this.decoder=new q(ke.encoding),this.encoding=ke.encoding)}function Re(ke){if(!(this instanceof Re))return new Re(ke);const I=this instanceof bc();this._readableState=new Ae(ke,this,I),ke&&(typeof ke.read=="function"&&(this._read=ke.read),typeof ke.destroy=="function"&&(this._destroy=ke.destroy),typeof ke.construct=="function"&&(this._construct=ke.construct),ke.signal&&!I&&T(ke.signal,this)),x.call(this,ke),O.construct(this,()=>{this._readableState.needReadable&&Ee(this,this._readableState)})}Re.prototype.destroy=O.destroy,Re.prototype._undestroy=O.undestroy,Re.prototype._destroy=function(ke,I){I(ke)},Re.prototype[b.captureRejectionSymbol]=function(ke){this.destroy(ke)},Re.prototype[y]=function(){let ke;return this.destroyed||(ke=this.readableEnded?null:new _,this.destroy(ke)),new p((I,ze)=>k(this,we=>we&&we!==ke?ze(we):I(null)))},Re.prototype.push=function(ke,I){return Je(this,ke,I,!1)},Re.prototype.unshift=function(ke,I){return Je(this,ke,I,!0)};function Je(ke,I,ze,we){M("readableAddChunk",I);const De=ke._readableState;let Ge;if((De.state&D)===0&&(typeof I=="string"?(ze=ze||De.defaultEncoding,De.encoding!==ze&&(we&&De.encoding?I=C.from(I,ze).toString(De.encoding):(I=C.from(I,ze),ze=""))):I instanceof C?ze="":x._isUint8Array(I)?(I=x._uint8ArrayToBuffer(I),ze=""):I!=null&&(Ge=new ye("chunk",["string","Buffer","Uint8Array"],I))),Ge)$(ke,Ge);else if(I===null)De.state&=~ie,J(ke,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&Y)!==0)$(ke,new S);else{if(De.destroyed||De.errored)return!1;lt(ke,De,I,!0)}else if(De.ended)$(ke,new re);else{if(De.destroyed||De.errored)return!1;De.state&=~ie,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(ke,De,I,!1):Ee(ke,De)):lt(ke,De,I,!1)}else we||(De.state&=~ie,Ee(ke,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(ke,I,ze,we){I.flowing&&I.length===0&&!I.sync&&ke.listenerCount("data")>0?((I.state&z)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,ke.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Oe)!==0&&F(ke)),Ee(ke,I)}Re.prototype.isPaused=function(){const ke=this._readableState;return ke[j]===!0||ke.flowing===!1},Re.prototype.setEncoding=function(ke){const I=new q(ke);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const ze=this._readableState.buffer;let we="";for(const De of ze)we+=I.write(De);return ze.clear(),we!==""&&ze.push(we),this._readableState.length=we.length,this};const et=1073741824;function xt(ke){if(ke>et)throw new te("size","<= 1GiB",ke);return ke--,ke|=ke>>>1,ke|=ke>>>2,ke|=ke>>>4,ke|=ke>>>8,ke|=ke>>>16,ke++,ke}function de(ke,I){return ke<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(ke)?I.flowing&&I.length?I.buffer.first().length:I.length:ke<=I.length?ke:I.ended?I.length:0}Re.prototype.read=function(ke){M("read",ke),ke===void 0?ke=NaN:t(ke)||(ke=s(ke,10));const I=this._readableState,ze=ke;if(ke>I.highWaterMark&&(I.highWaterMark=xt(ke)),ke!==0&&(I.state&=~Se),ke===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return M("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(ke=de(ke,I),ke===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Oe)!==0;if(M("need readable",we),(I.length===0||I.length-ke<I.highWaterMark)&&(we=!0,M("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,M("reading, ended or constructing",we);else if(we){M("do read"),I.state|=ie|Ce,I.length===0&&(I.state|=Oe);try{this._read(I.highWaterMark)}catch(Ge){$(this,Ge)}I.state&=~Ce,I.reading||(ke=de(ze,I))}let De;return ke>0?De=Bt(ke,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,ke=0):(I.length-=ke,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==ke&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function J(ke,I){if(M("onEofChunk"),!I.ended){if(I.decoder){const ze=I.decoder.end();ze&&ze.length&&(I.buffer.push(ze),I.length+=I.objectMode?1:ze.length)}I.ended=!0,I.sync?F(ke):(I.needReadable=!1,I.emittedReadable=!0,ue(ke))}}function F(ke){const I=ke._readableState;M("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(M("emitReadable",I.flowing),I.emittedReadable=!0,r.nextTick(ue,ke))}function ue(ke){const I=ke._readableState;M("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(ke.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Ye(ke)}function Ee(ke,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,r.nextTick(Ne,ke,I))}function Ne(ke,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(M("maybeReadMore read 0"),ke.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(ke){throw new he("_read()")},Re.prototype.pipe=function(ke,I){const ze=this,we=this._readableState;we.pipes.length===1&&(we.multiAwaitDrain||(we.multiAwaitDrain=!0,we.awaitDrainWriters=new d(we.awaitDrainWriters?[we.awaitDrainWriters]:[]))),we.pipes.push(ke),M("pipe count=%d opts=%j",we.pipes.length,I);const Ge=(!I||I.end!==!1)&&ke!==r.stdout&&ke!==r.stderr?Ot:qt;we.endEmitted?r.nextTick(Ge):ze.once("end",Ge),ke.on("unpipe",ht);function ht(un,Nn){M("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Pe())}function Ot(){M("onend"),ke.end()}let Tt,dn=!1;function Pe(){M("cleanup"),ke.removeListener("close",Jt),ke.removeListener("finish",Pt),Tt&&ke.removeListener("drain",Tt),ke.removeListener("error",wt),ke.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Tt&&we.awaitDrainWriters&&(!ke._writableState||ke._writableState.needDrain)&&Tt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===ke?(M("false write response, pause",0),we.awaitDrainWriters=ke,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(ke)&&(M("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(ke)),ze.pause()),Tt||(Tt=Be(ze,ke),ke.on("drain",Tt))}ze.on("data",bt);function bt(un){M("ondata");const Nn=ke.write(un);M("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(M("onerror",un),qt(),ke.removeListener("error",wt),ke.listenerCount("error")===0){const Nn=ke._writableState||ke._readableState;Nn&&!Nn.errorEmitted?$(ke,un):ke.emit("error",un)}}E(ke,"error",wt);function Jt(){ke.removeListener("finish",Pt),qt()}ke.once("close",Jt);function Pt(){M("onfinish"),ke.removeListener("close",Jt),qt()}ke.once("finish",Pt);function qt(){M("unpipe"),ze.unpipe(ke)}return ke.emit("pipe",ze),ke.writableNeedDrain===!0?ct():we.flowing||(M("pipe resume"),ze.resume()),ke};function Be(ke,I){return function(){const we=ke._readableState;we.awaitDrainWriters===I?(M("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(M("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&ke.listenerCount("data")&&ke.resume()}}Re.prototype.unpipe=function(ke){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!ke){const De=I.pipes;I.pipes=[],this.pause();for(let Ge=0;Ge<De.length;Ge++)De[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,ke);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),ke.emit("unpipe",this,ze),this)},Re.prototype.on=function(ke,I){const ze=x.prototype.on.call(this,ke,I),we=this._readableState;return ke==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):ke==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,M("on readable",we.length,we.reading),we.length?F(this):we.reading||r.nextTick(Ie,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(ke,I){const ze=x.prototype.removeListener.call(this,ke,I);return ke==="readable"&&r.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(ke){const I=x.prototype.removeAllListeners.apply(this,arguments);return(ke==="readable"||ke===void 0)&&r.nextTick(dt,this),I};function dt(ke){const I=ke._readableState;I.readableListening=ke.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:ke.listenerCount("data")>0?ke.resume():I.readableListening||(I.flowing=null)}function Ie(ke){M("readable nexttick read 0"),ke.read(0)}Re.prototype.resume=function(){const ke=this._readableState;return ke.flowing||(M("resume"),ke.flowing=!ke.readableListening,He(this,ke)),ke[j]=!1,this};function He(ke,I){I.resumeScheduled||(I.resumeScheduled=!0,r.nextTick(ge,ke,I))}function ge(ke,I){M("resume",I.reading),I.reading||ke.read(0),I.resumeScheduled=!1,ke.emit("resume"),Ye(ke),I.flowing&&!I.reading&&ke.read(0)}Re.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Ye(ke){const I=ke._readableState;for(M("flow",I.flowing);I.flowing&&ke.read()!==null;);}Re.prototype.wrap=function(ke){let I=!1;ke.on("data",we=>{!this.push(we)&&ke.pause&&(I=!0,ke.pause())}),ke.on("end",()=>{this.push(null)}),ke.on("error",we=>{$(this,we)}),ke.on("close",()=>{this.destroy()}),ke.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&ke.resume&&(I=!1,ke.resume())};const ze=o(ke);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof ke[De]=="function"&&(this[De]=ke[De].bind(ke))}return this},Re.prototype[m]=function(){return kt(this)},Re.prototype.iterator=function(ke){return ke!==void 0&&P(ke,"options"),kt(this,ke)};function kt(ke,I){typeof ke.read!="function"&&(ke=Re.wrap(ke,{objectMode:!0}));const ze=gt(ke,I);return ze.stream=ke,ze}async function*gt(ke,I){let ze=X;function we(ht){this===ke?(ze(),ze=X):ze=ht}ke.on("readable",we);let De;const Ge=k(ke,{writable:!1},ht=>{De=ht?se(De,ht):null,ze(),ze=X});try{for(;;){const ht=ke.destroyed?null:ke.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=se(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||ke._readableState.autoDestroy)?O.destroyer(ke,null):(ke.off("readable",we),Ge())}}u(Re.prototype,{readable:{__proto__:null,get(){const ke=this._readableState;return!!ke&&ke.readable!==!1&&!ke.destroyed&&!ke.errorEmitted&&!ke.endEmitted},set(ke){this._readableState&&(this._readableState.readable=!!ke)}},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(ke){this._readableState&&(this._readableState.flowing=ke)}},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(ke){this._readableState&&(this._readableState.destroyed=ke)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(ke){this[j]=!!ke}}}),Re._fromList=Bt;function Bt(ke,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!ke||ke>=I.length?(I.decoder?ze=I.buffer.join(""):I.buffer.length===1?ze=I.buffer.first():ze=I.buffer.concat(I.length),I.buffer.clear()):ze=I.buffer.consume(ke,I.decoder),ze}function vt(ke){const I=ke._readableState;M("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,r.nextTick(wn,I,ke))}function wn(ke,I){if(M("endReadableNT",ke.endEmitted,ke.length),!ke.errored&&!ke.closeEmitted&&!ke.endEmitted&&ke.length===0){if(ke.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)r.nextTick(tt,I);else if(ke.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(ke){ke.writable&&!ke.writableEnded&&!ke.destroyed&&ke.end()}Re.from=function(ke,I){return B(Re,ke,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(ke,I){return Er().newStreamReadableFromReadableStream(ke,I)},Re.toWeb=function(ke,I){return Er().newReadableStreamFromStreamReadable(ke,I)},Re.wrap=function(ke,I){var ze,we;return new Re({objectMode:(ze=(we=ke.readableObjectMode)!==null&&we!==void 0?we:ke.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,Ge){O.destroyer(ke,De),Ge(De)}}).wrap(ke)},OE}var LE,fO;function o8(){if(fO)return LE;fO=1;const r=Df(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();LE=P,P.WritableState=S;const{EventEmitter:y}=Hg(),m=s8().Stream,{Buffer:v}=Ep(),b=U0(),{addAbortSignal:x}=x_(),{getHighWaterMark:E,getDefaultHighWaterMark:C}=S_(),{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:O,ERR_STREAM_ALREADY_FINISHED:W,ERR_STREAM_NULL_VALUES:Z,ERR_STREAM_WRITE_AFTER_END:se,ERR_UNKNOWN_ENCODING:ye}=Ns().codes,{errorOrDestroy:he}=b;o(P.prototype,m.prototype),o(P,m);function te(){}const re=p("kOnFinished");function S(me,fe,xe){typeof xe!="boolean"&&(xe=fe instanceof bc()),this.objectMode=!!(me&&me.objectMode),xe&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?E(this,me,"writableHighWaterMark",xe):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(me&&me.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=me&&me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=$.bind(void 0,fe),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!me||me.emitClose!==!1,this.autoDestroy=!me||me.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}S.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(S.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const fe=this instanceof bc();if(!fe&&!a(P,this))return new P(me);this._writableState=new S(me,this,fe),me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final),typeof me.construct=="function"&&(this._construct=me.construct),me.signal&&x(me.signal,this)),m.call(this,me),b.construct(this,()=>{const xe=this._writableState;xe.writing||ie(this,xe),Se(this,xe)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof S}}),P.prototype.pipe=function(){he(this,new R)};function j(me,fe,xe,ne){const z=me._writableState;if(typeof xe=="function")ne=xe,xe=z.defaultEncoding;else{if(!xe)xe=z.defaultEncoding;else if(xe!=="buffer"&&!v.isEncoding(xe))throw new ye(xe);typeof ne!="function"&&(ne=te)}if(fe===null)throw new Z;if(!z.objectMode)if(typeof fe=="string")z.decodeStrings!==!1&&(fe=v.from(fe,xe),xe="buffer");else if(fe instanceof v)xe="buffer";else if(m._isUint8Array(fe))fe=m._uint8ArrayToBuffer(fe),xe="buffer";else throw new T("chunk",["string","Buffer","Uint8Array"],fe);let H;return z.ending?H=new se:z.destroyed&&(H=new O("write")),H?(r.nextTick(ne,H),he(me,H,!0),H):(z.pendingcb++,q(me,z,fe,xe,ne))}P.prototype.write=function(me,fe,xe){return j(this,me,fe,xe)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ie(this,me))},P.prototype.setDefaultEncoding=function(fe){if(typeof fe=="string"&&(fe=c(fe)),!v.isEncoding(fe))throw new ye(fe);return this._writableState.defaultEncoding=fe,this};function q(me,fe,xe,ne,z){const H=fe.objectMode?1:xe.length;fe.length+=H;const Q=fe.length<fe.highWaterMark;return Q||(fe.needDrain=!0),fe.writing||fe.corked||fe.errored||!fe.constructed?(fe.buffered.push({chunk:xe,encoding:ne,callback:z}),fe.allBuffers&&ne!=="buffer"&&(fe.allBuffers=!1),fe.allNoop&&z!==te&&(fe.allNoop=!1)):(fe.writelen=H,fe.writecb=z,fe.writing=!0,fe.sync=!0,me._write(xe,ne,fe.onwrite),fe.sync=!1),Q&&!fe.errored&&!fe.destroyed}function B(me,fe,xe,ne,z,H,Q){fe.writelen=ne,fe.writecb=Q,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new O("write")):xe?me._writev(z,fe.onwrite):me._write(z,H,fe.onwrite),fe.sync=!1}function X(me,fe,xe,ne){--fe.pendingcb,ne(xe),Y(fe),he(me,xe)}function $(me,fe){const xe=me._writableState,ne=xe.sync,z=xe.writecb;if(typeof z!="function"){he(me,new M);return}xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0,fe?(fe.stack,xe.errored||(xe.errored=fe),me._readableState&&!me._readableState.errored&&(me._readableState.errored=fe),ne?r.nextTick(X,me,xe,fe,z):X(me,xe,fe,z)):(xe.buffered.length>xe.bufferedIndex&&ie(me,xe),ne?xe.afterWriteTickInfo!==null&&xe.afterWriteTickInfo.cb===z?xe.afterWriteTickInfo.count++:(xe.afterWriteTickInfo={count:1,cb:z,stream:me,state:xe},r.nextTick(D,xe.afterWriteTickInfo)):N(me,xe,1,z))}function D({stream:me,state:fe,count:xe,cb:ne}){return fe.afterWriteTickInfo=null,N(me,fe,xe,ne)}function N(me,fe,xe,ne){for(!fe.ending&&!me.destroyed&&fe.length===0&&fe.needDrain&&(fe.needDrain=!1,me.emit("drain"));xe-- >0;)fe.pendingcb--,ne();fe.destroyed&&Y(fe),Se(me,fe)}function Y(me){if(me.writing)return;for(let z=me.bufferedIndex;z<me.buffered.length;++z){var fe;const{chunk:H,callback:Q}=me.buffered[z],le=me.objectMode?1:H.length;me.length-=le,Q((fe=me.errored)!==null&&fe!==void 0?fe:new O("write"))}const xe=me[re].splice(0);for(let z=0;z<xe.length;z++){var ne;xe[z]((ne=me.errored)!==null&&ne!==void 0?ne:new O("end"))}_(me)}function ie(me,fe){if(fe.corked||fe.bufferProcessing||fe.destroyed||!fe.constructed)return;const{buffered:xe,bufferedIndex:ne,objectMode:z}=fe,H=xe.length-ne;if(!H)return;let Q=ne;if(fe.bufferProcessing=!0,H>1&&me._writev){fe.pendingcb-=H-1;const le=fe.allNoop?te:Re=>{for(let Je=Q;Je<xe.length;++Je)xe[Je].callback(Re)},Ae=fe.allNoop&&Q===0?xe:e(xe,Q);Ae.allBuffers=fe.allBuffers,B(me,fe,!0,fe.length,Ae,"",le),_(fe)}else{do{const{chunk:le,encoding:Ae,callback:Re}=xe[Q];xe[Q++]=null;const Je=z?1:le.length;B(me,fe,!1,Je,le,Ae,Re)}while(Q<xe.length&&!fe.writing);Q===xe.length?_(fe):Q>256?(xe.splice(0,Q),fe.bufferedIndex=0):fe.bufferedIndex=Q}fe.bufferProcessing=!1}P.prototype._write=function(me,fe,xe){if(this._writev)this._writev([{chunk:me,encoding:fe}],xe);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,fe,xe){const ne=this._writableState;typeof me=="function"?(xe=me,me=null,fe=null):typeof fe=="function"&&(xe=fe,fe=null);let z;if(me!=null){const H=j(this,me,fe);H instanceof t&&(z=H)}return ne.corked&&(ne.corked=1,this.uncork()),z||(!ne.errored&&!ne.ending?(ne.ending=!0,Se(this,ne,!0),ne.ended=!0):ne.finished?z=new W("end"):ne.destroyed&&(z=new O("end"))),typeof xe=="function"&&(z||ne.finished?r.nextTick(xe,z):ne[re].push(xe)),this};function V(me){return me.ending&&!me.destroyed&&me.constructed&&me.length===0&&!me.errored&&me.buffered.length===0&&!me.finished&&!me.writing&&!me.errorEmitted&&!me.closeEmitted}function Ce(me,fe){let xe=!1;function ne(z){if(xe){he(me,z??M());return}if(xe=!0,fe.pendingcb--,z){const H=fe[re].splice(0);for(let Q=0;Q<H.length;Q++)H[Q](z);he(me,z,fe.sync)}else V(fe)&&(fe.prefinished=!0,me.emit("prefinish"),fe.pendingcb++,r.nextTick(Te,me,fe))}fe.sync=!0,fe.pendingcb++;try{me._final(ne)}catch(z){ne(z)}fe.sync=!1}function Oe(me,fe){!fe.prefinished&&!fe.finalCalled&&(typeof me._final=="function"&&!fe.destroyed?(fe.finalCalled=!0,Ce(me,fe)):(fe.prefinished=!0,me.emit("prefinish")))}function Se(me,fe,xe){V(fe)&&(Oe(me,fe),fe.pendingcb===0&&(xe?(fe.pendingcb++,r.nextTick((ne,z)=>{V(z)?Te(ne,z):z.pendingcb--},me,fe)):V(fe)&&(fe.pendingcb++,Te(me,fe))))}function Te(me,fe){fe.pendingcb--,fe.finished=!0;const xe=fe[re].splice(0);for(let ne=0;ne<xe.length;ne++)xe[ne]();if(me.emit("finish"),fe.autoDestroy){const ne=me._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&me.destroy()}}u(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(me){this._writableState&&(this._writableState.destroyed=me)}},writable:{__proto__:null,get(){const me=this._writableState;return!!me&&me.writable!==!1&&!me.destroyed&&!me.errored&&!me.ending&&!me.ended},set(me){this._writableState&&(this._writableState.writable=!!me)}},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 me=this._writableState;return me?!me.destroyed&&!me.ending&&me.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 oe=b.destroy;P.prototype.destroy=function(me,fe){const xe=this._writableState;return!xe.destroyed&&(xe.bufferedIndex<xe.buffered.length||xe[re].length)&&r.nextTick(Y,xe),oe.call(this,me,fe),this},P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(me,fe){fe(me)},P.prototype[y.captureRejectionSymbol]=function(me){this.destroy(me)};let ce;function be(){return ce===void 0&&(ce={}),ce}return P.fromWeb=function(me,fe){return be().newStreamWritableFromWritableStream(me,fe)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},LE}var NE,dO;function wJ(){if(dO)return NE;dO=1;const r=Df(),e=Ep(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=xc(),m=Uf(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:x}}=Ns(),{destroyer:E}=U0(),C=bc(),T=C_(),k=o8(),{createDeferredPromise:M}=as(),R=jP(),O=globalThis.Blob||e.Blob,W=typeof O<"u"?function(S){return S instanceof O}:function(S){return!1},Z=globalThis.AbortController||Mg().AbortController,{FunctionPrototypeCall:se}=oa();class ye extends C{constructor(S){super(S),S?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),S?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}NE=function re(S,_){if(p(S))return S;if(o(S))return te({readable:S});if(c(S))return te({writable:S});if(u(S))return te({writable:!1,readable:!1});if(d(S))return te({readable:T.fromWeb(S)});if(y(S))return te({writable:k.fromWeb(S)});if(typeof S=="function"){const{value:j,write:q,final:B,destroy:X}=he(S);if(s(j))return R(ye,j,{objectMode:!0,write:q,final:B,destroy:X});const $=j?.then;if(typeof $=="function"){let D;const N=se($,j,Y=>{if(Y!=null)throw new x("nully","body",Y)},Y=>{E(D,Y)});return D=new ye({objectMode:!0,readable:!1,write:q,final(Y){B(async()=>{try{await N,r.nextTick(Y,null)}catch(ie){r.nextTick(Y,ie)}})},destroy:X})}throw new x("Iterable, AsyncIterable or AsyncFunction",_,j)}if(W(S))return re(S.arrayBuffer());if(s(S))return R(ye,S,{objectMode:!0,writable:!1});if(d(S?.readable)&&y(S?.writable))return ye.fromWeb(S);if(typeof S?.writable=="object"||typeof S?.readable=="object"){const j=S!=null&&S.readable?o(S?.readable)?S?.readable:re(S.readable):void 0,q=S!=null&&S.writable?c(S?.writable)?S?.writable:re(S.writable):void 0;return te({readable:j,writable:q})}const P=S?.then;if(typeof P=="function"){let j;return se(P,S,q=>{q!=null&&j.push(q),j.push(null)},q=>{E(j,q)}),j=new ye({objectMode:!0,writable:!1,read(){}})}throw new b(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function he(re){let{promise:S,resolve:_}=M();const P=new Z,j=P.signal;return{value:re((async function*(){for(;;){const B=S;S=null;const{chunk:X,done:$,cb:D}=await B;if(r.nextTick(D),$)return;if(j.aborted)throw new v(void 0,{cause:j.reason});({promise:S,resolve:_}=M()),yield X}})(),{signal:j}),write(B,X,$){const D=_;_=null,D({chunk:B,done:!1,cb:$})},final(B){const X=_;_=null,X({done:!0,cb:B})},destroy(B,X){P.abort(),X(B)}}}function te(re){const S=re.readable&&typeof re.readable.read!="function"?T.wrap(re.readable):re.readable,_=re.writable;let P=!!t(S),j=!!a(_),q,B,X,$,D;function N(Y){const ie=$;$=null,ie?ie(Y):Y&&D.destroy(Y)}return D=new ye({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(m(_,Y=>{j=!1,Y&&E(S,Y),N(Y)}),D._write=function(Y,ie,V){_.write(Y,ie)?V():q=V},D._final=function(Y){_.end(),B=Y},_.on("drain",function(){if(q){const Y=q;q=null,Y()}}),_.on("finish",function(){if(B){const Y=B;B=null,Y()}})),P&&(m(S,Y=>{P=!1,Y&&E(S,Y),N(Y)}),S.on("readable",function(){if(X){const Y=X;X=null,Y()}}),S.on("end",function(){D.push(null)}),D._read=function(){for(;;){const Y=S.read();if(Y===null){X=D._read;return}if(!D.push(Y))return}}),D._destroy=function(Y,ie){!Y&&$!==null&&(Y=new v),X=null,q=null,B=null,$===null?ie(Y):($=ie,E(_,Y),E(S,Y))},D}return NE}var PE,pO;function bc(){if(pO)return PE;pO=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();PE=o;const s=C_(),u=o8();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let m=0;m<y.length;m++){const v=y[m];o.prototype[v]||(o.prototype[v]=u.prototype[v])}}function o(y){if(!(this instanceof o))return new o(y);s.call(this,y),u.call(this,y),y?(this.allowHalfOpen=y.allowHalfOpen!==!1,y.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),y.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(o.prototype,{writable:{__proto__:null,...e(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(u.prototype,"writableLength")},writableFinished:{__proto__:null,...e(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(y){this._readableState&&this._writableState&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}}});let c;function p(){return c===void 0&&(c={}),c}o.fromWeb=function(y,m){return p().newStreamDuplexFromReadableWritablePair(y,m)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=wJ()),d(y,"body")},PE}var IE,hO;function qP(){if(hO)return IE;hO=1;const{ObjectSetPrototypeOf:r,Symbol:e}=oa();IE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ns().codes,a=bc(),{getHighWaterMark:s}=S_();r(o.prototype,a.prototype),r(o,a);const u=e("kCallback");function o(d){if(!(this instanceof o))return new o(d);const y=d?s(this,d,"readableHighWaterMark",!0):null;y===0&&(d={...d,highWaterMark:null,readableHighWaterMark:y,writableHighWaterMark:d.writableHighWaterMark||0}),a.call(this,d),this._readableState.sync=!1,this[u]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",p)}function c(d){typeof this._flush=="function"&&!this.destroyed?this._flush((y,m)=>{if(y){d?d(y):this.destroy(y);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function p(){this._final!==c&&c.call(this)}return o.prototype._final=c,o.prototype._transform=function(d,y,m){throw new t("_transform()")},o.prototype._write=function(d,y,m){const v=this._readableState,b=this._writableState,x=v.length;this._transform(d,y,(E,C)=>{if(E){m(E);return}C!=null&&this.push(C),b.ended||x===v.length||v.length<v.highWaterMark?m():this[u]=m})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},IE}var DE,yO;function HP(){if(yO)return DE;yO=1;const{ObjectSetPrototypeOf:r}=oa();DE=t;const e=qP();r(t.prototype,e.prototype),r(t,e);function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,s,u){u(null,a)},DE}var UE,mO;function u8(){if(mO)return UE;mO=1;const r=Df(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Uf(),{once:o}=as(),c=U0(),p=bc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:E}=Ns(),{validateFunction:C,validateAbortSignal:T}=Vg(),{isIterable:k,isReadable:M,isReadableNodeStream:R,isNodeStream:O,isTransformStream:W,isWebStream:Z,isReadableStream:se,isReadableFinished:ye}=xc(),he=globalThis.AbortController||Mg().AbortController;let te,re,S;function _(Y,ie,V){let Ce=!1;Y.on("close",()=>{Ce=!0});const Oe=u(Y,{readable:ie,writable:V},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(Y,Se||new b("pipe")))},cleanup:Oe}}function P(Y){return C(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function j(Y){if(k(Y))return Y;if(R(Y))return q(Y);throw new y("val",["Readable","Iterable","AsyncIterable"],Y)}async function*q(Y){re||(re=C_()),yield*re.prototype[a].call(Y)}async function B(Y,ie,V,{end:Ce}){let Oe,Se=null;const Te=be=>{if(be&&(Oe=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Oe?me(Oe):Se=()=>{Oe?me(Oe):be()}});ie.on("drain",Te);const ce=u(ie,{readable:!1},Te);try{ie.writableNeedDrain&&await oe();for await(const be of Y)ie.write(be)||await oe();Ce&&(ie.end(),await oe()),V()}catch(be){V(Oe!==be?d(Oe,be):be)}finally{ce(),ie.off("drain",Te)}}async function X(Y,ie,V,{end:Ce}){W(ie)&&(ie=ie.writable);const Oe=ie.getWriter();try{for await(const Se of Y)await Oe.ready,Oe.write(Se).catch(()=>{});await Oe.ready,Ce&&await Oe.close(),V()}catch(Se){try{await Oe.abort(Se),V(Se)}catch(Te){V(Te)}}}function $(...Y){return D(Y,o(P(Y)))}function D(Y,ie,V){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new v("streams");const Ce=new he,Oe=Ce.signal,Se=V?.signal,Te=[];T(Se,"options.signal");function oe(){z(new E)}S=S||as().addAbortListener;let ce;Se&&(ce=S(Se,oe));let be,me;const fe=[];let xe=0;function ne(Ae){z(Ae,--xe===0)}function z(Ae,Re){var Je;if(Ae&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=Ae),!(!be&&!Re)){for(;fe.length;)fe.shift()(be);(Je=ce)===null||Je===void 0||Je[s](),Ce.abort(),Re&&(be||Te.forEach(lt=>lt()),r.nextTick(ie,be,me))}}let H;for(let Ae=0;Ae<Y.length;Ae++){const Re=Y[Ae],Je=Ae<Y.length-1,lt=Ae>0,et=Je||V?.end!==!1,xt=Ae===Y.length-1;if(O(Re)){let de=function(J){J&&J.name!=="AbortError"&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(J)};if(et){const{destroy:J,cleanup:F}=_(Re,Je,lt);fe.push(J),M(Re)&&xt&&Te.push(F)}Re.on("error",de),M(Re)&&xt&&Te.push(()=>{Re.removeListener("error",de)})}if(Ae===0)if(typeof Re=="function"){if(H=Re({signal:Oe}),!k(H))throw new m("Iterable, AsyncIterable or Stream","source",H)}else k(Re)||R(Re)||W(Re)?H=Re:H=p.from(Re);else if(typeof Re=="function"){if(W(H)){var Q;H=j((Q=H)===null||Q===void 0?void 0:Q.readable)}else H=j(H);if(H=Re(H,{signal:Oe}),Je){if(!k(H,!0))throw new m("AsyncIterable",`transform[${Ae-1}]`,H)}else{var le;te||(te=HP());const de=new te({objectMode:!0}),J=(le=H)===null||le===void 0?void 0:le.then;if(typeof J=="function")xe++,J.call(H,Ee=>{me=Ee,Ee!=null&&de.write(Ee),et&&de.end(),r.nextTick(ne)},Ee=>{de.destroy(Ee),r.nextTick(ne,Ee)});else if(k(H,!0))xe++,B(H,de,ne,{end:et});else if(se(H)||W(H)){const Ee=H.readable||H;xe++,B(Ee,de,ne,{end:et})}else throw new m("AsyncIterable or Promise","destination",H);H=de;const{destroy:F,cleanup:ue}=_(H,!1,!0);fe.push(F),xt&&Te.push(ue)}}else if(O(Re)){if(R(H)){xe+=2;const de=N(H,Re,ne,{end:et});M(Re)&&xt&&Te.push(de)}else if(W(H)||se(H)){const de=H.readable||H;xe++,B(de,Re,ne,{end:et})}else if(k(H))xe++,B(H,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else if(Z(Re)){if(R(H))xe++,X(j(H),Re,ne,{end:et});else if(se(H)||k(H))xe++,X(H,Re,ne,{end:et});else if(W(H))xe++,X(H.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else H=p.from(Re)}return(Oe!=null&&Oe.aborted||Se!=null&&Se.aborted)&&r.nextTick(oe),H}function N(Y,ie,V,{end:Ce}){let Oe=!1;if(ie.on("close",()=>{Oe||V(new x)}),Y.pipe(ie,{end:!1}),Ce){let Se=function(){Oe=!0,ie.end()};ye(Y)?r.nextTick(Se):Y.once("end",Se)}else V();return u(Y,{readable:!0,writable:!1},Se=>{const Te=Y._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Te&&Te.ended&&!Te.errored&&!Te.errorEmitted?Y.once("end",V).once("error",V):V(Se)}),u(ie,{readable:!1,writable:!0},V)}return UE={pipelineImpl:D,pipeline:$},UE}var FE,gO;function VP(){if(gO)return FE;gO=1;const{pipeline:r}=u8(),e=bc(),{destroyer:t}=U0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=xc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:v}}=Ns(),b=Uf();return FE=function(...E){if(E.length===0)throw new v("streams");if(E.length===1)return e.from(E[0]);const C=[...E];if(typeof E[0]=="function"&&(E[0]=e.from(E[0])),typeof E[E.length-1]=="function"){const te=E.length-1;E[te]=e.from(E[te])}for(let te=0;te<E.length;++te)if(!(!a(E[te])&&!o(E[te]))){if(te<E.length-1&&!(s(E[te])||d(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(E[te])||p(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be writable")}let T,k,M,R,O;function W(te){const re=R;R=null,re?re(te):te?O.destroy(te):!he&&!ye&&O.destroy()}const Z=E[0],se=r(E,W),ye=!!(u(Z)||p(Z)||c(Z)),he=!!(s(se)||d(se)||c(se));if(O=new e({writableObjectMode:!!(Z!=null&&Z.writableObjectMode),readableObjectMode:!!(se!=null&&se.readableObjectMode),writable:ye,readable:he}),ye){if(a(Z))O._write=function(re,S,_){Z.write(re,S)?_():T=_},O._final=function(re){Z.end(),k=re},Z.on("drain",function(){if(T){const re=T;T=null,re()}});else if(o(Z)){const S=(c(Z)?Z.writable:Z).getWriter();O._write=async function(_,P,j){try{await S.ready,S.write(_).catch(()=>{}),j()}catch(q){j(q)}},O._final=async function(_){try{await S.ready,S.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(se)?se.readable:se;b(te,()=>{if(k){const re=k;k=null,re()}})}if(he){if(a(se))se.on("readable",function(){if(M){const te=M;M=null,te()}}),se.on("end",function(){O.push(null)}),O._read=function(){for(;;){const te=se.read();if(te===null){M=O._read;return}if(!O.push(te))return}};else if(o(se)){const re=(c(se)?se.readable:se).getReader();O._read=async function(){for(;;)try{const{value:S,done:_}=await re.read();if(!O.push(S))return;if(_){O.push(null);return}}catch{return}}}}return O._destroy=function(te,re){!te&&R!==null&&(te=new y),M=null,T=null,k=null,R===null?re(te):(R=re,a(se)&&t(se,te))},O},FE}var vO;function _J(){if(vO)return fw;vO=1;const r=globalThis.AbortController||Mg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ns(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=Vg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:m}=Uf(),v=VP(),{addAbortSignalNoValidate:b}=x_(),{isWritable:x,isNodeStream:E}=xc(),{deprecate:C}=as(),{ArrayPrototypePush:T,Boolean:k,MathFloor:M,Number:R,NumberIsNaN:O,Promise:W,PromiseReject:Z,PromiseResolve:se,PromisePrototypeThen:ye,Symbol:he}=oa(),te=he("kEmpty"),re=he("kEof");function S(Se,Te){if(Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),E(Se)&&!x(Se))throw new e("stream",Se,"must be writable");const oe=v(this,Se);return Te!=null&&Te.signal&&b(Te.signal,oe),oe}function _(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal");let oe=1;Te?.concurrency!=null&&(oe=M(Te.concurrency));let ce=oe-1;return Te?.highWaterMark!=null&&(ce=M(Te.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=as().AbortSignalAny([Te?.signal].filter(k)),fe=this,xe=[],ne={signal:me};let z,H,Q=!1,le=0;function Ae(){Q=!0,Re()}function Re(){le-=1,Je()}function Je(){H&&!Q&&le<oe&&xe.length<ce&&(H(),H=null)}async function lt(){try{for await(let et of fe){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=se(et)}catch(xt){et=Z(xt)}le+=1,ye(et,Re,Ae),xe.push(et),z&&(z(),z=null),!Q&&(xe.length>=ce||le>=oe)&&await new W(xt=>{H=xt})}xe.push(re)}catch(et){const xt=Z(et);ye(xt,Re,Ae),xe.push(xt)}finally{Q=!0,z&&(z(),z=null)}}lt();try{for(;;){for(;xe.length>0;){const et=await xe[0];if(et===re)return;if(me.aborted)throw new u;et!==te&&(yield et),xe.shift(),Je()}await new W(et=>{z=et})}}finally{Q=!0,H&&(H(),H=null)}}).call(this)}function P(Se=void 0){return Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal"),(async function*(){let oe=0;for await(const be of this){var ce;if(Se!=null&&(ce=Se.signal)!==null&&ce!==void 0&&ce.aborted)throw new u({cause:Se.signal.reason});yield[oe++,be]}}).call(this)}async function j(Se,Te=void 0){for await(const oe of $.call(this,Se,Te))return!0;return!1}async function q(Se,Te=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Te)}async function B(Se,Te){for await(const oe of $.call(this,Se,Te))return oe}async function X(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be),te}for await(const ce of _.call(this,oe,Te));}function $(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be)?ce:te}return _.call(this,oe,Te)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function N(Se,Te,oe){var ce;if(typeof Se!="function")throw new t("reducer",["Function","AsyncFunction"],Se);oe!=null&&p(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let be=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const z=new u(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(z)),z}const me=new r,fe=me.signal;if(oe!=null&&oe.signal){const z={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),z)}let xe=!1;try{for await(const z of this){var ne;if(xe=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Te=await Se(Te,z,{signal:fe}):(Te=z,be=!0)}if(!xe&&!be)throw new D}finally{me.abort()}return Te}async function Y(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Te=[];for await(const ce of this){var oe;if(Se!=null&&(oe=Se.signal)!==null&&oe!==void 0&&oe.aborted)throw new u(void 0,{cause:Se.signal.reason});T(Te,ce)}return Te}function ie(Se,Te){const oe=_.call(this,Se,Te);return(async function*(){for await(const be of oe)yield*be}).call(this)}function V(Se){if(Se=R(Se),O(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Te=void 0){return Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Te!=null&&(ce=Te.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Te!=null&&(be=Te.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Oe(Se,Te=void 0){return Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Te!=null&&(ce=Te.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Te!=null&&(be=Te.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return fw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:$,flatMap:ie,map:_,take:Oe,compose:S},fw.promiseReturningOperators={every:q,forEach:X,reduce:N,toArray:Y,some:j,find:B},fw}var BE,bO;function GP(){if(bO)return BE;bO=1;const{ArrayPrototypePop:r,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=xc(),{pipelineImpl:u}=u8(),{finished:o}=Uf();$P();function c(...p){return new e((d,y)=>{let m,v;const b=p[p.length-1];if(b&&typeof b=="object"&&!a(b)&&!t(b)&&!s(b)){const x=r(p);m=x.signal,v=x.end}u(p,(x,E)=>{x?y(x):d(E)},{signal:m,end:v})})}return BE={finished:o,pipeline:c},BE}var wO;function $P(){if(wO)return mE.exports;wO=1;const{Buffer:r}=Ep(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=as(),{streamReturningOperators:u,promiseReturningOperators:o}=_J(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ns(),p=VP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=S_(),{pipeline:m}=u8(),{destroyer:v}=U0(),b=Uf(),x=GP(),E=xc(),C=mE.exports=s8().Stream;C.isDestroyed=E.isDestroyed,C.isDisturbed=E.isDisturbed,C.isErrored=E.isErrored,C.isReadable=E.isReadable,C.isWritable=E.isWritable,C.Readable=C_();for(const k of t(u)){let R=function(...O){if(new.target)throw c();return C.Readable.from(a(M,this,O))};const M=u[k];e(R,"name",{__proto__:null,value:M.name}),e(R,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let R=function(...O){if(new.target)throw c();return a(M,this,O)};const M=o[k];e(R,"name",{__proto__:null,value:M.name}),e(R,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}C.Writable=o8(),C.Duplex=bc(),C.Transform=qP(),C.PassThrough=HP(),C.pipeline=m;const{addAbortSignal:T}=x_();return C.addAbortSignal=T,C.finished=b,C.destroy=v,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),e(m,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),e(b,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(M){return M instanceof Uint8Array},C._uint8ArrayToBuffer=function(M){return r.from(M.buffer,M.byteOffset,M.byteLength)},mE.exports}var _O;function xJ(){return _O||(_O=1,(function(r){const e=$P(),t=GP(),a=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=a,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(yE)),yE.exports}var zE,xO;function WP(){if(xO)return zE;xO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Ng().Buffer);const r=lP(),e=xJ(),t=gi();if(globalThis.process||(globalThis.process=Df()),typeof crypto>"u"){const s=n_;s.getRandomValues=u=>s.randomBytes(u.length),globalThis.crypto=s}const a={ElvCrypto:async()=>{try{if(!a.elvCrypto){const s=(await Promise.resolve().then(()=>require("./index-CpOffoCC.js"))).default;a.elvCrypto=await new s().init()}return a.elvCrypto}catch(s){console.error("Error initializing ElvCrypto:"),console.error(s)}},EncryptedSize:s=>{const o=Math.floor(s/1e6);let c=a.EncryptedBlockSize(1e6),p=o*c;return s%1e6!==0&&(p+=a.EncryptedBlockSize(s%1e6)),p},EncryptedBlockSize:(s,u=!1)=>{let m=Math.floor(s/564)*576;return s%564!==0&&(m+=576),u?m+608:m+129},async EncryptConk(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=new Uint8Array(Buffer.from(JSON.stringify(s)));const{data:c,ephemeralKey:p,tag:d}=await o.encryptECIES(s,u),y=Buffer.concat([Buffer.from(p),Buffer.from(d),Buffer.from(c)]);return t.B64(y)},async DecryptCap(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=Buffer.from(s,"base64");const c=s.slice(0,65),p=s.slice(65,81),d=s.slice(81),y=o.decryptECIES(new Uint8Array(d),u,new Uint8Array(c),new Uint8Array(p));return JSON.parse(Buffer.from(y).toString())},async GeneratePrimaryConk({spaceId:s,objectId:u}){const o=await a.ElvCrypto(),{secretKey:c,publicKey:p}=o.generatePrimaryKeys(),d=o.generateSymmetricKey().key;return{symm_key:`kpsy${r.encode(Buffer.from(d))}`,secret_key:`kpsk${r.encode(Buffer.from(c))}`,public_key:`kppk${r.encode(Buffer.from(p))}`,sid:s,qid:u}},async GenerateTargetConk(){const s=await a.ElvCrypto(),{secretKey:u,publicKey:o}=s.generateTargetKeys();return{secret_key:`kpsk${r.encode(Buffer.from(u))}`,public_key:`ktpk${r.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(r.decode(o.slice(4)));return{symmetricKey:u(s.symm_key),secretKey:u(s.secret_key),publicKey:u(s.public_key)}},async EncryptionContext(s){const u=await a.ElvCrypto(),{symmetricKey:o,secretKey:c,publicKey:p}=a.CapToConk(s);let d,y;return p.length===u.PRIMARY_PK_KEY_SIZE?(y=u.CRYPTO_TYPE_PRIMARY,d=u.newPrimaryContext(p,c,o)):(y=u.CRYPTO_TYPE_TARGET,d=u.newTargetDecryptionContext(c,o)),{context:d,type:y}},Encrypt:async(s,u)=>{const o=await a.OpenEncryptionStream(s);!Buffer.isBuffer(u)&&!(u instanceof ArrayBuffer)&&(u=Buffer.from(await new Response(u).arrayBuffer()));const c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenEncryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o}=await a.EncryptionContext(s),c=new e.PassThrough,p=u.createCipher(o);return c.pipe(p).on("finish",()=>{o.free()}).on("error",d=>{throw Error(d)})},Decrypt:async(s,u)=>{const o=await a.OpenDecryptionStream(s),c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenDecryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o,type:c}=await a.EncryptionContext(s),p=new e.PassThrough,d=u.createDecipher(c,o);return p.pipe(d).on("finish",()=>{o.free()}).on("error",y=>{throw Error(y)})}};return zE=a,zE}var zr={},SO;function KP(){if(SO)return zr;SO=1;const r=gi();let e;r.Platform()===r.PLATFORM_NODE&&(globalThis.Response=ZA().Response,e=n_);const t=vi(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=Su();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:m}){o({libraryId:c,objectId:p,versionHash:y,writeToken:m}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let v=t("q",m||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:v})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:m,fileInfo:v,accessKey:b,secret:x,signedUrl:E,encryption:C="none",copy:T=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const M=/^s3:\/\/([^/]+)\//i;for(let ye=0;ye<v.length;ye++){const he=v[ye].source,te=M.exec(he);if(te){if(te[1]!==m)throw Error('Full S3 file path "'+he+`" specified, but does not match provided bucket name '`+m+"'");v[ye].source=he.replace(M,"")}}T?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let R;if(C==="cgck"){let ye=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ye={...ye,secret_key:""},R=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ye)))}`}let O={access_key_id:b,secret_access_key:x};E&&(O={signed_url:E});const W={encryption_key:R,access:{protocol:"s3",platform:"aws",path:m,storage_endpoint:{region:y},cloud_credentials:O}},Z=v.map(ye=>T?{op:"ingest-copy",path:ye.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ye.source}}:{op:"add-reference",path:ye.path,reference:{type:"key",path:ye.source}}),{id:se}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:Z,defaults:W});for(;;){await new Promise(te=>setTimeout(te,1e3));const ye=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:se});if(ye.errors&&ye.errors.length>1)throw ye.errors.join(`
|
|
327
|
+
`;super(x),this.name="AggregateError",this.errors=b}}r.exports={AggregateError:m,kEmptyObject:Object.freeze({}),once(v){let b=!1;return function(...x){b||(b=!0,v.apply(this,x))}},createDeferredPromise:function(){let v,b;return{promise:new Promise((E,C)=>{v=E,b=C}),resolve:v,reject:b}},promisify(v){return new Promise((b,x)=>{v((E,...C)=>E?x(E):b(...C))})},debuglog(){return function(){}},format(v,...b){return v.replace(/%([sdifj])/g,function(...[x,E]){const C=b.shift();return E==="f"?C.toFixed(6):E==="j"?JSON.stringify(C):E==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof o},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:p,deprecate(v,b){return v},addAbortListener:Hg().addAbortListener||function(b,x){if(b===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",b);d(b,"signal"),y(x,"listener");let E;return b.aborted?queueMicrotask(()=>x()):(b.addEventListener("abort",x,{__proto__:null,once:!0,[t]:!0}),E=()=>{b.removeEventListener("abort",x)}),{__proto__:null,[a](){var C;(C=E)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(b){if(b.length===1)return b[0];const x=new u,E=()=>x.abort();return b.forEach(C=>{d(C,"signals"),C.addEventListener("abort",E,{once:!0})}),x.signal.addEventListener("abort",()=>{b.forEach(C=>C.removeEventListener("abort",E))},{once:!0}),x.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(bE)),bE.exports}var fw={},wE,X9;function Ns(){if(X9)return wE;X9=1;const{format:r,inspect:e,AggregateError:t}=as(),a=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",p={};function d(C,T){if(!C)throw new p.ERR_INTERNAL_ASSERTION(T)}function y(C){let T="",k=C.length;const M=C[0]==="-"?1:0;for(;k>=M+4;k-=3)T=`_${C.slice(k-3,k)}${T}`;return`${C.slice(0,k)}${T}`}function m(C,T,k){if(typeof T=="function")return d(T.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T.length}).`),T(...k);const M=(T.match(/%[dfijoOs]/g)||[]).length;return d(M===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M}).`),k.length===0?T:r(T,...k)}function v(C,T,k){k||(k=Error);class M extends k{constructor(...O){super(m(C,T,O))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(M.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${C}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),M.prototype.code=C,M.prototype[s]=!0,p[C]=M}function b(C){const T=c+C.name;return Object.defineProperty(C,"name",{value:T}),C}function x(C,T){if(C&&T&&C!==T){if(Array.isArray(T.errors))return T.errors.push(C),T;const k=new a([T,C],T.message);return k.code=T.code,k}return C||T}class E extends Error{constructor(T="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new p.ERR_INVALID_ARG_TYPE("options","Object",k);super(T,k),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(C,T,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(T)||(T=[T]);let M="The ";C.endsWith(" argument")?M+=`${C} `:M+=`"${C}" ${C.includes(".")?"property":"argument"} `,M+="must be ";const R=[],O=[],W=[];for(const se of T)d(typeof se=="string","All expected entries have to be of type string"),u.includes(se)?R.push(se.toLowerCase()):o.test(se)?O.push(se):(d(se!=="object",'The value "object" should be written as "Object"'),W.push(se));if(O.length>0){const se=R.indexOf("object");se!==-1&&(R.splice(R,se,1),O.push("Object"))}if(R.length>0){switch(R.length){case 1:M+=`of type ${R[0]}`;break;case 2:M+=`one of type ${R[0]} or ${R[1]}`;break;default:{const se=R.pop();M+=`one of type ${R.join(", ")}, or ${se}`}}(O.length>0||W.length>0)&&(M+=" or ")}if(O.length>0){switch(O.length){case 1:M+=`an instance of ${O[0]}`;break;case 2:M+=`an instance of ${O[0]} or ${O[1]}`;break;default:{const se=O.pop();M+=`an instance of ${O.join(", ")}, or ${se}`}}W.length>0&&(M+=" or ")}switch(W.length){case 0:break;case 1:W[0].toLowerCase()!==W[0]&&(M+="an "),M+=`${W[0]}`;break;case 2:M+=`one of ${W[0]} or ${W[1]}`;break;default:{const se=W.pop();M+=`one of ${W.join(", ")}, or ${se}`}}if(k==null)M+=`. Received ${k}`;else if(typeof k=="function"&&k.name)M+=`. Received function ${k.name}`;else if(typeof k=="object"){var Z;if((Z=k.constructor)!==null&&Z!==void 0&&Z.name)M+=`. Received an instance of ${k.constructor.name}`;else{const se=e(k,{depth:-1});M+=`. Received ${se}`}}else{let se=e(k,{colors:!1});se.length>25&&(se=`${se.slice(0,25)}...`),M+=`. Received type ${typeof k} (${se})`}return M},TypeError),v("ERR_INVALID_ARG_VALUE",(C,T,k="is invalid")=>{let M=e(T);return M.length>128&&(M=M.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${M}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(C,T,k)=>{var M;const R=k!=null&&(M=k.constructor)!==null&&M!==void 0&&M.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${T}" function but got ${R}.`},TypeError),v("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let T;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(M=>`"${M}"`).join(" or "),k){case 1:T+=`The ${C[0]} argument`;break;case 2:T+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const M=C.pop();T+=`The ${C.join(", ")}, and ${M} arguments`}break}return`${T} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(C,T,k)=>{d(T,'Missing "range" argument');let M;return Number.isInteger(k)&&Math.abs(k)>2**32?M=y(String(k)):typeof k=="bigint"?(M=String(k),(k>2n**32n||k<-(2n**32n))&&(M=y(M)),M+="n"):M=e(k),`The value of "${C}" is out of range. It must be ${T}. Received ${M}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),wE={AbortError:E,aggregateTwoErrors:b(x),hideStackFrames:b,codes:p},wE}var _E,Z9;function Vg(){if(Z9)return _E;Z9=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:y,String:m,StringPrototypeToUpperCase:v,StringPrototypeTrim:b}=oa(),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:T,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:M}}=Ns(),{normalizeEncoding:R}=as(),{isAsyncFunction:O,isArrayBufferView:W}=as().types,Z={};function se(Q){return Q===(Q|0)}function ye(Q){return Q===Q>>>0}const he=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function re(Q,le,Ae){if(typeof Q>"u"&&(Q=Ae),typeof Q=="string"){if(y(he,Q)===null)throw new T(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const S=x((Q,le,Ae=c,Re=o)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),_=x((Q,le,Ae=-2147483648,Re=2147483647)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),P=x((Q,le,Ae=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=Ae?1:0,Je=4294967295;if(Q<Re||Q>Je)throw new k(le,`>= ${Re} && <= ${Je}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,Ae=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(Ae!=null&&Q<Ae||Re!=null&&Q>Re||(Ae!=null||Re!=null)&&u(Q))throw new k(le,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const B=x((Q,le,Ae)=>{if(!e(Ae,Q)){const Je="must be one of: "+t(a(Ae,lt=>typeof lt=="string"?`'${lt}'`:m(lt)),", ");throw new T(le,Q,Je)}});function X(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function $(Q,le,Ae){return Q==null||!d(Q,le)?Ae:Q[le]}const D=x((Q,le,Ae=null)=>{const Re=$(Ae,"allowArray",!1),Je=$(Ae,"allowFunction",!1);if(!$(Ae,"nullable",!1)&&Q===null||!Re&&r(Q)||typeof Q!="object"&&(!Je||typeof Q!="function"))throw new C(le,"Object",Q)}),N=x((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),Y=x((Q,le,Ae=0)=>{if(!r(Q))throw new C(le,"Array",Q);if(Q.length<Ae){const Re=`must be longer than ${Ae}`;throw new T(le,Q,Re)}});function ie(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++)j(Q[Ae],`${le}[${Ae}]`)}function V(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++)X(Q[Ae],`${le}[${Ae}]`)}function Ce(Q,le){Y(Q,le);for(let Ae=0;Ae<Q.length;Ae++){const Re=Q[Ae],Je=`${le}[${Ae}]`;if(Re==null)throw new C(Je,"AbortSignal",Re);ce(Re,Je)}}function Oe(Q,le="signal"){if(j(Q,le),Z[Q]===void 0)throw Z[v(Q)]!==void 0?new M(Q+" (signals must use all capital letters)"):new M(Q)}const Se=x((Q,le="buffer")=>{if(!W(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Te(Q,le){const Ae=R(le),Re=Q.length;if(Ae==="hex"&&Re%2!==0)throw new T("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",Ae=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&b(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!Ae)throw new E(le,Q,Ae);return Q|0}const ce=x((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=x((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=x((Q,le)=>{if(typeof Q!="function"||O(Q))throw new C(le,"Function",Q)}),fe=x((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function xe(Q,le,Ae){if(!e(Ae,Q))throw new C(le,`('${t(Ae,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function z(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new T(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function H(Q){if(typeof Q=="string")return z(Q,"hints"),Q;if(r(Q)){const le=Q.length;let Ae="";if(le===0)return Ae;for(let Re=0;Re<le;Re++){const Je=Q[Re];z(Je,"hints"),Ae+=Je,Re!==le-1&&(Ae+=", ")}return Ae}throw new T("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return _E={isInt32:se,isUint32:ye,parseFileMode:re,validateArray:Y,validateStringArray:ie,validateBooleanArray:V,validateAbortSignalArray:Ce,validateBoolean:X,validateBuffer:Se,validateDictionary:N,validateEncoding:Te,validateFunction:be,validateInt32:_,validateInteger:S,validateNumber:q,validateObject:D,validateOneOf:B,validatePlainFunction:me,validatePort:oe,validateSignalName:Oe,validateString:j,validateUint32:P,validateUndefined:fe,validateUnion:xe,validateAbortSignal:ce,validateLinkHeaderValue:H},_E}var dw={exports:{}},xE={exports:{}},eO;function Df(){if(eO)return xE.exports;eO=1;var r=xE.exports={},e,t;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function u(E){if(e===setTimeout)return setTimeout(E,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this,E,0)}}}function o(E){if(t===clearTimeout)return clearTimeout(E);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(E);try{return t(E)}catch{try{return t.call(null,E)}catch{return t.call(this,E)}}}var c=[],p=!1,d,y=-1;function m(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&v())}function v(){if(!p){var E=u(m);p=!0;for(var C=c.length;C;){for(d=c,c=[];++y<C;)d&&d[y].run();y=-1,C=c.length}d=null,p=!1,o(E)}}r.nextTick=function(E){var C=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)C[T-1]=arguments[T];c.push(new b(E,C)),c.length===1&&!p&&u(v)};function b(E,C){this.fun=E,this.array=C}b.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function x(){}return r.on=x,r.addListener=x,r.once=x,r.off=x,r.removeListener=x,r.removeAllListeners=x,r.emit=x,r.prependListener=x,r.prependOnceListener=x,r.listeners=function(E){return[]},r.binding=function(E){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(E){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},xE.exports}var SE,tO;function xc(){if(tO)return SE;tO=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=oa(),a=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),u=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),c=t("nodejs.stream.disturbed"),p=t("nodejs.webstream.isClosedPromise"),d=t("nodejs.webstream.controllerErrorFunction");function y($,D=!1){var N;return!!($&&typeof $.pipe=="function"&&typeof $.on=="function"&&(!D||typeof $.pause=="function"&&typeof $.resume=="function")&&(!$._writableState||((N=$._readableState)===null||N===void 0?void 0:N.readable)!==!1)&&(!$._writableState||$._readableState))}function m($){var D;return!!($&&typeof $.write=="function"&&typeof $.on=="function"&&(!$._readableState||((D=$._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function v($){return!!($&&typeof $.pipe=="function"&&$._readableState&&typeof $.on=="function"&&typeof $.write=="function")}function b($){return $&&($._readableState||$._writableState||typeof $.write=="function"&&typeof $.on=="function"||typeof $.pipe=="function"&&typeof $.on=="function")}function x($){return!!($&&!b($)&&typeof $.pipeThrough=="function"&&typeof $.getReader=="function"&&typeof $.cancel=="function")}function E($){return!!($&&!b($)&&typeof $.getWriter=="function"&&typeof $.abort=="function")}function C($){return!!($&&!b($)&&typeof $.readable=="object"&&typeof $.writable=="object")}function T($){return x($)||E($)||C($)}function k($,D){return $==null?!1:D===!0?typeof $[r]=="function":D===!1?typeof $[e]=="function":typeof $[r]=="function"||typeof $[e]=="function"}function M($){if(!b($))return null;const D=$._writableState,N=$._readableState,Y=D||N;return!!($.destroyed||$[a]||Y!=null&&Y.destroyed)}function R($){if(!m($))return null;if($.writableEnded===!0)return!0;const D=$._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function O($,D){if(!m($))return null;if($.writableFinished===!0)return!0;const N=$._writableState;return N!=null&&N.errored?!1:typeof N?.finished!="boolean"?null:!!(N.finished||D===!1&&N.ended===!0&&N.length===0)}function W($){if(!y($))return null;if($.readableEnded===!0)return!0;const D=$._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function Z($,D){if(!y($))return null;const N=$._readableState;return N!=null&&N.errored?!1:typeof N?.endEmitted!="boolean"?null:!!(N.endEmitted||D===!1&&N.ended===!0&&N.length===0)}function se($){return $&&$[u]!=null?$[u]:typeof $?.readable!="boolean"?null:M($)?!1:y($)&&$.readable&&!Z($)}function ye($){return $&&$[o]!=null?$[o]:typeof $?.writable!="boolean"?null:M($)?!1:m($)&&$.writable&&!R($)}function he($,D){return b($)?M($)?!0:!(D?.readable!==!1&&se($)||D?.writable!==!1&&ye($)):null}function te($){var D,N;return b($)?$.writableErrored?$.writableErrored:(D=(N=$._writableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function re($){var D,N;return b($)?$.readableErrored?$.readableErrored:(D=(N=$._readableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function S($){if(!b($))return null;if(typeof $.closed=="boolean")return $.closed;const D=$._writableState,N=$._readableState;return typeof D?.closed=="boolean"||typeof N?.closed=="boolean"?D?.closed||N?.closed:typeof $._closed=="boolean"&&_($)?$._closed:null}function _($){return typeof $._closed=="boolean"&&typeof $._defaultKeepAlive=="boolean"&&typeof $._removedConnection=="boolean"&&typeof $._removedContLen=="boolean"}function P($){return typeof $._sent100=="boolean"&&_($)}function j($){var D;return typeof $._consuming=="boolean"&&typeof $._dumped=="boolean"&&((D=$.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q($){if(!b($))return null;const D=$._writableState,N=$._readableState,Y=D||N;return!Y&&P($)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function B($){var D;return!!($&&((D=$[c])!==null&&D!==void 0?D:$.readableDidRead||$.readableAborted))}function X($){var D,N,Y,ie,V,Ce,Oe,Se,Te,oe;return!!($&&((D=(N=(Y=(ie=(V=(Ce=$[s])!==null&&Ce!==void 0?Ce:$.readableErrored)!==null&&V!==void 0?V:$.writableErrored)!==null&&ie!==void 0?ie:(Oe=$._readableState)===null||Oe===void 0?void 0:Oe.errorEmitted)!==null&&Y!==void 0?Y:(Se=$._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&N!==void 0?N:(Te=$._readableState)===null||Te===void 0?void 0:Te.errored)!==null&&D!==void 0?D:!((oe=$._writableState)===null||oe===void 0)&&oe.errored))}return SE={isDestroyed:M,kIsDestroyed:a,isDisturbed:B,kIsDisturbed:c,isErrored:X,kIsErrored:s,isReadable:se,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:S,isDuplexNodeStream:v,isFinished:he,isIterable:k,isReadableNodeStream:y,isReadableStream:x,isReadableEnded:W,isReadableFinished:Z,isReadableErrored:re,isNodeStream:b,isWebStream:T,isWritable:ye,isWritableNodeStream:m,isWritableStream:E,isWritableEnded:R,isWritableFinished:O,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},SE}var nO;function Uf(){if(nO)return dw.exports;nO=1;const r=Df(),{AbortError:e,codes:t}=Ns(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=as(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=Vg(),{Promise:m,PromisePrototypeThen:v,SymbolDispose:b}=oa(),{isClosed:x,isReadable:E,isReadableNodeStream:C,isReadableStream:T,isReadableFinished:k,isReadableErrored:M,isWritable:R,isWritableNodeStream:O,isWritableStream:W,isWritableFinished:Z,isWritableErrored:se,isNodeStream:ye,willEmitClose:he,kIsClosedPromise:te}=xc();let re;function S(B){return B.setHeader&&typeof B.abort=="function"}const _=()=>{};function P(B,X,$){var D,N;if(arguments.length===2?($=X,X=u):X==null?X=u:d(X,"options"),p($,"callback"),c(X.signal,"options.signal"),$=o($),T(B)||W(B))return j(B,X,$);if(!ye(B))throw new a("stream",["ReadableStream","WritableStream","Stream"],B);const Y=(D=X.readable)!==null&&D!==void 0?D:C(B),ie=(N=X.writable)!==null&&N!==void 0?N:O(B),V=B._writableState,Ce=B._readableState,Oe=()=>{B.writable||oe()};let Se=he(B)&&C(B)===Y&&O(B)===ie,Te=Z(B,!1);const oe=()=>{Te=!0,B.destroyed&&(Se=!1),!(Se&&(!B.readable||Y))&&(!Y||ce)&&$.call(B)};let ce=k(B,!1);const be=()=>{ce=!0,B.destroyed&&(Se=!1),!(Se&&(!B.writable||ie))&&(!ie||Te)&&$.call(B)},me=Q=>{$.call(B,Q)};let fe=x(B);const xe=()=>{fe=!0;const Q=se(B)||M(B);if(Q&&typeof Q!="boolean")return $.call(B,Q);if(Y&&!ce&&C(B,!0)&&!k(B,!1))return $.call(B,new s);if(ie&&!Te&&!Z(B,!1))return $.call(B,new s);$.call(B)},ne=()=>{fe=!0;const Q=se(B)||M(B);if(Q&&typeof Q!="boolean")return $.call(B,Q);$.call(B)},z=()=>{B.req.on("finish",oe)};S(B)?(B.on("complete",oe),Se||B.on("abort",xe),B.req?z():B.on("request",z)):ie&&!V&&(B.on("end",Oe),B.on("close",Oe)),!Se&&typeof B.aborted=="boolean"&&B.on("aborted",xe),B.on("end",be),B.on("finish",oe),X.error!==!1&&B.on("error",me),B.on("close",xe),fe?r.nextTick(xe):V!=null&&V.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||r.nextTick(ne):(!Y&&(!Se||E(B))&&(Te||R(B)===!1)||!ie&&(!Se||R(B))&&(ce||E(B)===!1)||Ce&&B.req&&B.aborted)&&r.nextTick(ne);const H=()=>{$=_,B.removeListener("aborted",xe),B.removeListener("complete",oe),B.removeListener("abort",xe),B.removeListener("request",z),B.req&&B.req.removeListener("finish",oe),B.removeListener("end",Oe),B.removeListener("close",Oe),B.removeListener("finish",oe),B.removeListener("end",be),B.removeListener("error",me),B.removeListener("close",xe)};if(X.signal&&!fe){const Q=()=>{const le=$;H(),le.call(B,new e(void 0,{cause:X.signal.reason}))};if(X.signal.aborted)r.nextTick(Q);else{re=re||as().addAbortListener;const le=re(X.signal,Q),Ae=$;$=o((...Re)=>{le[b](),Ae.apply(B,Re)})}}return H}function j(B,X,$){let D=!1,N=_;if(X.signal)if(N=()=>{D=!0,$.call(B,new e(void 0,{cause:X.signal.reason}))},X.signal.aborted)r.nextTick(N);else{re=re||as().addAbortListener;const ie=re(X.signal,N),V=$;$=o((...Ce)=>{ie[b](),V.apply(B,Ce)})}const Y=(...ie)=>{D||r.nextTick(()=>$.apply(B,ie))};return v(B[te].promise,Y,Y),_}function q(B,X){var $;let D=!1;return X===null&&(X=u),($=X)!==null&&$!==void 0&&$.cleanup&&(y(X.cleanup,"cleanup"),D=X.cleanup),new m((N,Y)=>{const ie=P(B,X,V=>{D&&ie(),V?Y(V):N()})})}return dw.exports=P,dw.exports.finished=q,dw.exports}var CE,rO;function U0(){if(rO)return CE;rO=1;const r=Df(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ns(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=xc(),d=s("kDestroy"),y=s("kConstruct");function m(he,te,re){he&&(he.stack,te&&!te.errored&&(te.errored=he),re&&!re.errored&&(re.errored=he))}function v(he,te){const re=this._readableState,S=this._writableState,_=S||re;return S!=null&&S.destroyed||re!=null&&re.destroyed?(typeof te=="function"&&te(),this):(m(he,S,re),S&&(S.destroyed=!0),re&&(re.destroyed=!0),_.constructed?b(this,he,te):this.once(d,function(P){b(this,e(P,he),te)}),this)}function b(he,te,re){let S=!1;function _(P){if(S)return;S=!0;const j=he._readableState,q=he._writableState;m(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof re=="function"&&re(P),P?r.nextTick(x,he,P):r.nextTick(E,he)}try{he._destroy(te||null,_)}catch(P){_(P)}}function x(he,te){C(he,te),E(he)}function E(he){const te=he._readableState,re=he._writableState;re&&(re.closeEmitted=!0),te&&(te.closeEmitted=!0),(re!=null&&re.emitClose||te!=null&&te.emitClose)&&he.emit("close")}function C(he,te){const re=he._readableState,S=he._writableState;S!=null&&S.errorEmitted||re!=null&&re.errorEmitted||(S&&(S.errorEmitted=!0),re&&(re.errorEmitted=!0),he.emit("error",te))}function T(){const he=this._readableState,te=this._writableState;he&&(he.constructed=!0,he.closed=!1,he.closeEmitted=!1,he.destroyed=!1,he.errored=null,he.errorEmitted=!1,he.reading=!1,he.ended=he.readable===!1,he.endEmitted=he.readable===!1),te&&(te.constructed=!0,te.destroyed=!1,te.closed=!1,te.closeEmitted=!1,te.errored=null,te.errorEmitted=!1,te.finalCalled=!1,te.prefinished=!1,te.ended=te.writable===!1,te.ending=te.writable===!1,te.finished=te.writable===!1)}function k(he,te,re){const S=he._readableState,_=he._writableState;if(_!=null&&_.destroyed||S!=null&&S.destroyed)return this;S!=null&&S.autoDestroy||_!=null&&_.autoDestroy?he.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),S&&!S.errored&&(S.errored=te),re?r.nextTick(C,he,te):C(he,te))}function M(he,te){if(typeof he._construct!="function")return;const re=he._readableState,S=he._writableState;re&&(re.constructed=!1),S&&(S.constructed=!1),he.once(y,te),!(he.listenerCount(y)>1)&&r.nextTick(R,he)}function R(he){let te=!1;function re(S){if(te){k(he,S??new t);return}te=!0;const _=he._readableState,P=he._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?he.emit(d,S):S?k(he,S,!0):r.nextTick(O,he)}try{he._construct(S=>{r.nextTick(re,S)})}catch(S){r.nextTick(re,S)}}function O(he){he.emit(y)}function W(he){return he?.setHeader&&typeof he.abort=="function"}function Z(he){he.emit("close")}function se(he,te){he.emit("error",te),r.nextTick(Z,he)}function ye(he,te){!he||o(he)||(!te&&!c(he)&&(te=new a),p(he)?(he.socket=null,he.destroy(te)):W(he)?he.abort():W(he.req)?he.req.abort():typeof he.destroy=="function"?he.destroy(te):typeof he.close=="function"?he.close():te?r.nextTick(se,he,te):r.nextTick(Z,he),he.destroyed||(he[u]=!0))}return CE={construct:M,destroyer:ye,destroy:v,undestroy:T,errorOrDestroy:k},CE}var EE,aO;function s8(){if(aO)return EE;aO=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=Hg();function a(u){t.call(this,u)}e(a.prototype,t.prototype),e(a,t),a.prototype.pipe=function(u,o){const c=this;function p(E){u.writable&&u.write(E)===!1&&c.pause&&c.pause()}c.on("data",p);function d(){c.readable&&c.resume&&c.resume()}u.on("drain",d),!u._isStdio&&(!o||o.end!==!1)&&(c.on("end",m),c.on("close",v));let y=!1;function m(){y||(y=!0,u.end())}function v(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function b(E){x(),t.listenerCount(this,"error")===0&&this.emit("error",E)}s(c,"error",b),s(u,"error",b);function x(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",m),c.removeListener("close",v),c.removeListener("error",b),u.removeListener("error",b),c.removeListener("end",x),c.removeListener("close",x),u.removeListener("close",x)}return c.on("end",x),c.on("close",x),u.on("close",x),u.emit("pipe",c),u};function s(u,o,c){if(typeof u.prependListener=="function")return u.prependListener(o,c);!u._events||!u._events[o]?u.on(o,c):r(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return EE={Stream:a,prependListener:s},EE}var AE={exports:{}},iO;function x_(){return iO||(iO=1,(function(r){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ns(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=xc(),c=Uf(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(m,v)=>{if(typeof m!="object"||!("aborted"in m))throw new p(v,"AbortSignal",m)};r.exports.addAbortSignal=function(v,b){if(y(v,"signal"),!s(b)&&!u(b))throw new p("stream",["ReadableStream","WritableStream","Stream"],b);return r.exports.addAbortSignalNoValidate(v,b)},r.exports.addAbortSignalNoValidate=function(m,v){if(typeof m!="object"||!("aborted"in m))return v;const b=s(v)?()=>{v.destroy(new t(void 0,{cause:m.reason}))}:()=>{v[o](new t(void 0,{cause:m.reason}))};if(m.aborted)b();else{d=d||as().addAbortListener;const x=d(m,b);c(v,x[e])}return v}})(AE)),AE.exports}var kE,sO;function bJ(){if(sO)return kE;sO=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Ep(),{inspect:u}=as();return kE=class{constructor(){this.head=null,this.tail=null,this.length=0}push(c){const p={data:c,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}unshift(c){const p={data:c,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}shift(){if(this.length===0)return;const c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}clear(){this.head=this.tail=null,this.length=0}join(c){if(this.length===0)return"";let p=this.head,d=""+p.data;for(;(p=p.next)!==null;)d+=c+p.data;return d}concat(c){if(this.length===0)return s.alloc(0);const p=s.allocUnsafe(c>>>0);let d=this.head,y=0;for(;d;)t(p,d.data,y),y+=d.data.length,d=d.next;return p}consume(c,p){const d=this.head.data;if(c<d.length){const y=d.slice(0,c);return this.head.data=d.slice(c),y}return c===d.length?this.shift():p?this._getString(c):this._getBuffer(c)}first(){return this.head.data}*[e](){for(let c=this.head;c;c=c.next)yield c.data}_getString(c){let p="",d=this.head,y=0;do{const m=d.data;if(c>m.length)p+=m,c-=m.length;else{c===m.length?(p+=m,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=r(m,0,c),this.head=d,d.data=r(m,c));break}++y}while((d=d.next)!==null);return this.length-=y,p}_getBuffer(c){const p=s.allocUnsafe(c),d=c;let y=this.head,m=0;do{const v=y.data;if(c>v.length)t(p,v,d-c),c-=v.length;else{c===v.length?(t(p,v,d-c),++m,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(v.buffer,v.byteOffset,c),d-c),this.head=y,y.data=v.slice(c));break}++m}while((y=y.next)!==null);return this.length-=m,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},kE}var TE,oO;function S_(){if(oO)return TE;oO=1;const{MathFloor:r,NumberIsInteger:e}=oa(),{validateInteger:t}=Vg(),{ERR_INVALID_ARG_VALUE:a}=Ns().codes;let s=16*1024,u=16;function o(y,m,v){return y.highWaterMark!=null?y.highWaterMark:m?y[v]:null}function c(y){return y?u:s}function p(y,m){t(m,"value",0),y?u=m:s=m}function d(y,m,v,b){const x=o(m,b,v);if(x!=null){if(!e(x)||x<0){const E=b?`options.${v}`:"options.highWaterMark";throw new a(E,x)}return r(x)}return c(y.objectMode)}return TE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},TE}var ME={},uO;function zP(){if(uO)return ME;uO=1;var r=uP().Buffer,e=r.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(T){if(!T)return"utf8";for(var k;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(k)return;T=(""+T).toLowerCase(),k=!0}}function a(T){var k=t(T);if(typeof k!="string"&&(r.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return k||T}ME.StringDecoder=s;function s(T){this.encoding=a(T);var k;switch(this.encoding){case"utf16le":this.text=m,this.end=v,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=b,this.end=x,k=3;break;default:this.write=E,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(k)}s.prototype.write=function(T){if(T.length===0)return"";var k,M;if(this.lastNeed){if(k=this.fillLast(T),k===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<T.length?k?k+this.text(T,M):this.text(T,M):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function u(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function o(T,k,M){var R=k.length-1;if(R<M)return 0;var O=u(k[R]);return O>=0?(O>0&&(T.lastNeed=O-1),O):--R<M||O===-2?0:(O=u(k[R]),O>=0?(O>0&&(T.lastNeed=O-2),O):--R<M||O===-2?0:(O=u(k[R]),O>=0?(O>0&&(O===2?O=0:T.lastNeed=O-3),O):0))}function c(T,k,M){if((k[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return T.lastNeed=2,"�"}}function p(T){var k=this.lastTotal-this.lastNeed,M=c(this,T);if(M!==void 0)return M;if(this.lastNeed<=T.length)return T.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,k,0,T.length),this.lastNeed-=T.length}function d(T,k){var M=o(this,T,k);if(!this.lastNeed)return T.toString("utf8",k);this.lastTotal=M;var R=T.length-(M-this.lastNeed);return T.copy(this.lastChar,0,R),T.toString("utf8",k,R)}function y(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+"�":k}function m(T,k){if((T.length-k)%2===0){var M=T.toString("utf16le",k);if(M){var R=M.charCodeAt(M.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",k,T.length-1)}function v(T){var k=T&&T.length?this.write(T):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,M)}return k}function b(T,k){var M=(T.length-k)%3;return M===0?T.toString("base64",k):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",k,T.length-M))}function x(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function E(T){return T.toString(this.encoding)}function C(T){return T&&T.length?this.write(T):""}return ME}var RE,lO;function jP(){if(lO)return RE;lO=1;const r=Df(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Ep(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ns().codes;function c(p,d,y){let m;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let v;if(d&&d[t])v=!0,m=d[t]();else if(d&&d[a])v=!1,m=d[a]();else throw new u("iterable",["Iterable"],d);const b=new p({objectMode:!0,highWaterMark:1,...y});let x=!1;b._read=function(){x||(x=!0,C())},b._destroy=function(T,k){e(E(T),()=>r.nextTick(k,T),M=>r.nextTick(k,M||T))};async function E(T){const k=T!=null,M=typeof m.throw=="function";if(k&&M){const{value:R,done:O}=await m.throw(T);if(await R,O)return}if(typeof m.return=="function"){const{value:R}=await m.return();await R}}async function C(){for(;;){try{const{value:T,done:k}=v?await m.next():m.next();if(k)b.push(null);else{const M=T&&typeof T.then=="function"?await T:T;if(M===null)throw x=!1,new o;if(b.push(M))continue;x=!1}}catch(T){b.destroy(T)}break}}return b}return RE=c,RE}var OE,cO;function C_(){if(cO)return OE;cO=1;const r=Df(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:m,Symbol:v}=oa();OE=Re,Re.ReadableState=Ae;const{EventEmitter:b}=Hg(),{Stream:x,prependListener:E}=s8(),{Buffer:C}=Ep(),{addAbortSignal:T}=x_(),k=Uf();let M=as().debuglog("stream",ke=>{M=ke});const R=bJ(),O=U0(),{getHighWaterMark:W,getDefaultHighWaterMark:Z}=S_(),{aggregateTwoErrors:se,codes:{ERR_INVALID_ARG_TYPE:ye,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:re,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:S},AbortError:_}=Ns(),{validateObject:P}=Vg(),j=v("kPaused"),{StringDecoder:q}=zP(),B=jP();c(Re.prototype,x.prototype),c(Re,x);const X=()=>{},{errorOrDestroy:$}=O,D=1,N=2,Y=4,ie=8,V=16,Ce=32,Oe=64,Se=128,Te=256,oe=512,ce=1024,be=2048,me=4096,fe=8192,xe=16384,ne=32768,z=65536,H=1<<17,Q=1<<18;function le(ke){return{enumerable:!1,get(){return(this.state&ke)!==0},set(I){I?this.state|=ke:this.state&=~ke}}}u(Ae.prototype,{objectMode:le(D),ended:le(N),endEmitted:le(Y),reading:le(ie),constructed:le(V),sync:le(Ce),needReadable:le(Oe),emittedReadable:le(Se),readableListening:le(Te),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(fe),closed:le(xe),closeEmitted:le(ne),multiAwaitDrain:le(z),readingMore:le(H),dataEmitted:le(Q)});function Ae(ke,I,ze){typeof ze!="boolean"&&(ze=I instanceof bc()),this.state=be|me|V|Ce,ke&&ke.objectMode&&(this.state|=D),ze&&ke&&ke.readableObjectMode&&(this.state|=D),this.highWaterMark=ke?W(this,ke,"readableHighWaterMark",ze):Z(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,ke&&ke.emitClose===!1&&(this.state&=~be),ke&&ke.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=ke&&ke.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ke&&ke.encoding&&(this.decoder=new q(ke.encoding),this.encoding=ke.encoding)}function Re(ke){if(!(this instanceof Re))return new Re(ke);const I=this instanceof bc();this._readableState=new Ae(ke,this,I),ke&&(typeof ke.read=="function"&&(this._read=ke.read),typeof ke.destroy=="function"&&(this._destroy=ke.destroy),typeof ke.construct=="function"&&(this._construct=ke.construct),ke.signal&&!I&&T(ke.signal,this)),x.call(this,ke),O.construct(this,()=>{this._readableState.needReadable&&Ee(this,this._readableState)})}Re.prototype.destroy=O.destroy,Re.prototype._undestroy=O.undestroy,Re.prototype._destroy=function(ke,I){I(ke)},Re.prototype[b.captureRejectionSymbol]=function(ke){this.destroy(ke)},Re.prototype[y]=function(){let ke;return this.destroyed||(ke=this.readableEnded?null:new _,this.destroy(ke)),new p((I,ze)=>k(this,we=>we&&we!==ke?ze(we):I(null)))},Re.prototype.push=function(ke,I){return Je(this,ke,I,!1)},Re.prototype.unshift=function(ke,I){return Je(this,ke,I,!0)};function Je(ke,I,ze,we){M("readableAddChunk",I);const De=ke._readableState;let Ge;if((De.state&D)===0&&(typeof I=="string"?(ze=ze||De.defaultEncoding,De.encoding!==ze&&(we&&De.encoding?I=C.from(I,ze).toString(De.encoding):(I=C.from(I,ze),ze=""))):I instanceof C?ze="":x._isUint8Array(I)?(I=x._uint8ArrayToBuffer(I),ze=""):I!=null&&(Ge=new ye("chunk",["string","Buffer","Uint8Array"],I))),Ge)$(ke,Ge);else if(I===null)De.state&=~ie,J(ke,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&Y)!==0)$(ke,new S);else{if(De.destroyed||De.errored)return!1;lt(ke,De,I,!0)}else if(De.ended)$(ke,new re);else{if(De.destroyed||De.errored)return!1;De.state&=~ie,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(ke,De,I,!1):Ee(ke,De)):lt(ke,De,I,!1)}else we||(De.state&=~ie,Ee(ke,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(ke,I,ze,we){I.flowing&&I.length===0&&!I.sync&&ke.listenerCount("data")>0?((I.state&z)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,ke.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Oe)!==0&&F(ke)),Ee(ke,I)}Re.prototype.isPaused=function(){const ke=this._readableState;return ke[j]===!0||ke.flowing===!1},Re.prototype.setEncoding=function(ke){const I=new q(ke);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const ze=this._readableState.buffer;let we="";for(const De of ze)we+=I.write(De);return ze.clear(),we!==""&&ze.push(we),this._readableState.length=we.length,this};const et=1073741824;function xt(ke){if(ke>et)throw new te("size","<= 1GiB",ke);return ke--,ke|=ke>>>1,ke|=ke>>>2,ke|=ke>>>4,ke|=ke>>>8,ke|=ke>>>16,ke++,ke}function de(ke,I){return ke<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(ke)?I.flowing&&I.length?I.buffer.first().length:I.length:ke<=I.length?ke:I.ended?I.length:0}Re.prototype.read=function(ke){M("read",ke),ke===void 0?ke=NaN:t(ke)||(ke=s(ke,10));const I=this._readableState,ze=ke;if(ke>I.highWaterMark&&(I.highWaterMark=xt(ke)),ke!==0&&(I.state&=~Se),ke===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return M("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(ke=de(ke,I),ke===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Oe)!==0;if(M("need readable",we),(I.length===0||I.length-ke<I.highWaterMark)&&(we=!0,M("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,M("reading, ended or constructing",we);else if(we){M("do read"),I.state|=ie|Ce,I.length===0&&(I.state|=Oe);try{this._read(I.highWaterMark)}catch(Ge){$(this,Ge)}I.state&=~Ce,I.reading||(ke=de(ze,I))}let De;return ke>0?De=Bt(ke,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,ke=0):(I.length-=ke,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==ke&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function J(ke,I){if(M("onEofChunk"),!I.ended){if(I.decoder){const ze=I.decoder.end();ze&&ze.length&&(I.buffer.push(ze),I.length+=I.objectMode?1:ze.length)}I.ended=!0,I.sync?F(ke):(I.needReadable=!1,I.emittedReadable=!0,ue(ke))}}function F(ke){const I=ke._readableState;M("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(M("emitReadable",I.flowing),I.emittedReadable=!0,r.nextTick(ue,ke))}function ue(ke){const I=ke._readableState;M("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(ke.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Ye(ke)}function Ee(ke,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,r.nextTick(Ne,ke,I))}function Ne(ke,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(M("maybeReadMore read 0"),ke.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(ke){throw new he("_read()")},Re.prototype.pipe=function(ke,I){const ze=this,we=this._readableState;we.pipes.length===1&&(we.multiAwaitDrain||(we.multiAwaitDrain=!0,we.awaitDrainWriters=new d(we.awaitDrainWriters?[we.awaitDrainWriters]:[]))),we.pipes.push(ke),M("pipe count=%d opts=%j",we.pipes.length,I);const Ge=(!I||I.end!==!1)&&ke!==r.stdout&&ke!==r.stderr?Ot:qt;we.endEmitted?r.nextTick(Ge):ze.once("end",Ge),ke.on("unpipe",ht);function ht(un,Nn){M("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Pe())}function Ot(){M("onend"),ke.end()}let Tt,dn=!1;function Pe(){M("cleanup"),ke.removeListener("close",Jt),ke.removeListener("finish",Pt),Tt&&ke.removeListener("drain",Tt),ke.removeListener("error",wt),ke.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Tt&&we.awaitDrainWriters&&(!ke._writableState||ke._writableState.needDrain)&&Tt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===ke?(M("false write response, pause",0),we.awaitDrainWriters=ke,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(ke)&&(M("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(ke)),ze.pause()),Tt||(Tt=Be(ze,ke),ke.on("drain",Tt))}ze.on("data",bt);function bt(un){M("ondata");const Nn=ke.write(un);M("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(M("onerror",un),qt(),ke.removeListener("error",wt),ke.listenerCount("error")===0){const Nn=ke._writableState||ke._readableState;Nn&&!Nn.errorEmitted?$(ke,un):ke.emit("error",un)}}E(ke,"error",wt);function Jt(){ke.removeListener("finish",Pt),qt()}ke.once("close",Jt);function Pt(){M("onfinish"),ke.removeListener("close",Jt),qt()}ke.once("finish",Pt);function qt(){M("unpipe"),ze.unpipe(ke)}return ke.emit("pipe",ze),ke.writableNeedDrain===!0?ct():we.flowing||(M("pipe resume"),ze.resume()),ke};function Be(ke,I){return function(){const we=ke._readableState;we.awaitDrainWriters===I?(M("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(M("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&ke.listenerCount("data")&&ke.resume()}}Re.prototype.unpipe=function(ke){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!ke){const De=I.pipes;I.pipes=[],this.pause();for(let Ge=0;Ge<De.length;Ge++)De[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,ke);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),ke.emit("unpipe",this,ze),this)},Re.prototype.on=function(ke,I){const ze=x.prototype.on.call(this,ke,I),we=this._readableState;return ke==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):ke==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,M("on readable",we.length,we.reading),we.length?F(this):we.reading||r.nextTick(Ie,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(ke,I){const ze=x.prototype.removeListener.call(this,ke,I);return ke==="readable"&&r.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(ke){const I=x.prototype.removeAllListeners.apply(this,arguments);return(ke==="readable"||ke===void 0)&&r.nextTick(dt,this),I};function dt(ke){const I=ke._readableState;I.readableListening=ke.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:ke.listenerCount("data")>0?ke.resume():I.readableListening||(I.flowing=null)}function Ie(ke){M("readable nexttick read 0"),ke.read(0)}Re.prototype.resume=function(){const ke=this._readableState;return ke.flowing||(M("resume"),ke.flowing=!ke.readableListening,He(this,ke)),ke[j]=!1,this};function He(ke,I){I.resumeScheduled||(I.resumeScheduled=!0,r.nextTick(ge,ke,I))}function ge(ke,I){M("resume",I.reading),I.reading||ke.read(0),I.resumeScheduled=!1,ke.emit("resume"),Ye(ke),I.flowing&&!I.reading&&ke.read(0)}Re.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Ye(ke){const I=ke._readableState;for(M("flow",I.flowing);I.flowing&&ke.read()!==null;);}Re.prototype.wrap=function(ke){let I=!1;ke.on("data",we=>{!this.push(we)&&ke.pause&&(I=!0,ke.pause())}),ke.on("end",()=>{this.push(null)}),ke.on("error",we=>{$(this,we)}),ke.on("close",()=>{this.destroy()}),ke.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&ke.resume&&(I=!1,ke.resume())};const ze=o(ke);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof ke[De]=="function"&&(this[De]=ke[De].bind(ke))}return this},Re.prototype[m]=function(){return kt(this)},Re.prototype.iterator=function(ke){return ke!==void 0&&P(ke,"options"),kt(this,ke)};function kt(ke,I){typeof ke.read!="function"&&(ke=Re.wrap(ke,{objectMode:!0}));const ze=gt(ke,I);return ze.stream=ke,ze}async function*gt(ke,I){let ze=X;function we(ht){this===ke?(ze(),ze=X):ze=ht}ke.on("readable",we);let De;const Ge=k(ke,{writable:!1},ht=>{De=ht?se(De,ht):null,ze(),ze=X});try{for(;;){const ht=ke.destroyed?null:ke.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=se(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||ke._readableState.autoDestroy)?O.destroyer(ke,null):(ke.off("readable",we),Ge())}}u(Re.prototype,{readable:{__proto__:null,get(){const ke=this._readableState;return!!ke&&ke.readable!==!1&&!ke.destroyed&&!ke.errorEmitted&&!ke.endEmitted},set(ke){this._readableState&&(this._readableState.readable=!!ke)}},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(ke){this._readableState&&(this._readableState.flowing=ke)}},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(ke){this._readableState&&(this._readableState.destroyed=ke)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(ke){this[j]=!!ke}}}),Re._fromList=Bt;function Bt(ke,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!ke||ke>=I.length?(I.decoder?ze=I.buffer.join(""):I.buffer.length===1?ze=I.buffer.first():ze=I.buffer.concat(I.length),I.buffer.clear()):ze=I.buffer.consume(ke,I.decoder),ze}function vt(ke){const I=ke._readableState;M("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,r.nextTick(wn,I,ke))}function wn(ke,I){if(M("endReadableNT",ke.endEmitted,ke.length),!ke.errored&&!ke.closeEmitted&&!ke.endEmitted&&ke.length===0){if(ke.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)r.nextTick(tt,I);else if(ke.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(ke){ke.writable&&!ke.writableEnded&&!ke.destroyed&&ke.end()}Re.from=function(ke,I){return B(Re,ke,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(ke,I){return Er().newStreamReadableFromReadableStream(ke,I)},Re.toWeb=function(ke,I){return Er().newReadableStreamFromStreamReadable(ke,I)},Re.wrap=function(ke,I){var ze,we;return new Re({objectMode:(ze=(we=ke.readableObjectMode)!==null&&we!==void 0?we:ke.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,Ge){O.destroyer(ke,De),Ge(De)}}).wrap(ke)},OE}var LE,fO;function o8(){if(fO)return LE;fO=1;const r=Df(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();LE=P,P.WritableState=S;const{EventEmitter:y}=Hg(),m=s8().Stream,{Buffer:v}=Ep(),b=U0(),{addAbortSignal:x}=x_(),{getHighWaterMark:E,getDefaultHighWaterMark:C}=S_(),{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:O,ERR_STREAM_ALREADY_FINISHED:W,ERR_STREAM_NULL_VALUES:Z,ERR_STREAM_WRITE_AFTER_END:se,ERR_UNKNOWN_ENCODING:ye}=Ns().codes,{errorOrDestroy:he}=b;o(P.prototype,m.prototype),o(P,m);function te(){}const re=p("kOnFinished");function S(me,fe,xe){typeof xe!="boolean"&&(xe=fe instanceof bc()),this.objectMode=!!(me&&me.objectMode),xe&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?E(this,me,"writableHighWaterMark",xe):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(me&&me.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=me&&me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=$.bind(void 0,fe),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!me||me.emitClose!==!1,this.autoDestroy=!me||me.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}S.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(S.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const fe=this instanceof bc();if(!fe&&!a(P,this))return new P(me);this._writableState=new S(me,this,fe),me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final),typeof me.construct=="function"&&(this._construct=me.construct),me.signal&&x(me.signal,this)),m.call(this,me),b.construct(this,()=>{const xe=this._writableState;xe.writing||ie(this,xe),Se(this,xe)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof S}}),P.prototype.pipe=function(){he(this,new R)};function j(me,fe,xe,ne){const z=me._writableState;if(typeof xe=="function")ne=xe,xe=z.defaultEncoding;else{if(!xe)xe=z.defaultEncoding;else if(xe!=="buffer"&&!v.isEncoding(xe))throw new ye(xe);typeof ne!="function"&&(ne=te)}if(fe===null)throw new Z;if(!z.objectMode)if(typeof fe=="string")z.decodeStrings!==!1&&(fe=v.from(fe,xe),xe="buffer");else if(fe instanceof v)xe="buffer";else if(m._isUint8Array(fe))fe=m._uint8ArrayToBuffer(fe),xe="buffer";else throw new T("chunk",["string","Buffer","Uint8Array"],fe);let H;return z.ending?H=new se:z.destroyed&&(H=new O("write")),H?(r.nextTick(ne,H),he(me,H,!0),H):(z.pendingcb++,q(me,z,fe,xe,ne))}P.prototype.write=function(me,fe,xe){return j(this,me,fe,xe)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ie(this,me))},P.prototype.setDefaultEncoding=function(fe){if(typeof fe=="string"&&(fe=c(fe)),!v.isEncoding(fe))throw new ye(fe);return this._writableState.defaultEncoding=fe,this};function q(me,fe,xe,ne,z){const H=fe.objectMode?1:xe.length;fe.length+=H;const Q=fe.length<fe.highWaterMark;return Q||(fe.needDrain=!0),fe.writing||fe.corked||fe.errored||!fe.constructed?(fe.buffered.push({chunk:xe,encoding:ne,callback:z}),fe.allBuffers&&ne!=="buffer"&&(fe.allBuffers=!1),fe.allNoop&&z!==te&&(fe.allNoop=!1)):(fe.writelen=H,fe.writecb=z,fe.writing=!0,fe.sync=!0,me._write(xe,ne,fe.onwrite),fe.sync=!1),Q&&!fe.errored&&!fe.destroyed}function B(me,fe,xe,ne,z,H,Q){fe.writelen=ne,fe.writecb=Q,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new O("write")):xe?me._writev(z,fe.onwrite):me._write(z,H,fe.onwrite),fe.sync=!1}function X(me,fe,xe,ne){--fe.pendingcb,ne(xe),Y(fe),he(me,xe)}function $(me,fe){const xe=me._writableState,ne=xe.sync,z=xe.writecb;if(typeof z!="function"){he(me,new M);return}xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0,fe?(fe.stack,xe.errored||(xe.errored=fe),me._readableState&&!me._readableState.errored&&(me._readableState.errored=fe),ne?r.nextTick(X,me,xe,fe,z):X(me,xe,fe,z)):(xe.buffered.length>xe.bufferedIndex&&ie(me,xe),ne?xe.afterWriteTickInfo!==null&&xe.afterWriteTickInfo.cb===z?xe.afterWriteTickInfo.count++:(xe.afterWriteTickInfo={count:1,cb:z,stream:me,state:xe},r.nextTick(D,xe.afterWriteTickInfo)):N(me,xe,1,z))}function D({stream:me,state:fe,count:xe,cb:ne}){return fe.afterWriteTickInfo=null,N(me,fe,xe,ne)}function N(me,fe,xe,ne){for(!fe.ending&&!me.destroyed&&fe.length===0&&fe.needDrain&&(fe.needDrain=!1,me.emit("drain"));xe-- >0;)fe.pendingcb--,ne();fe.destroyed&&Y(fe),Se(me,fe)}function Y(me){if(me.writing)return;for(let z=me.bufferedIndex;z<me.buffered.length;++z){var fe;const{chunk:H,callback:Q}=me.buffered[z],le=me.objectMode?1:H.length;me.length-=le,Q((fe=me.errored)!==null&&fe!==void 0?fe:new O("write"))}const xe=me[re].splice(0);for(let z=0;z<xe.length;z++){var ne;xe[z]((ne=me.errored)!==null&&ne!==void 0?ne:new O("end"))}_(me)}function ie(me,fe){if(fe.corked||fe.bufferProcessing||fe.destroyed||!fe.constructed)return;const{buffered:xe,bufferedIndex:ne,objectMode:z}=fe,H=xe.length-ne;if(!H)return;let Q=ne;if(fe.bufferProcessing=!0,H>1&&me._writev){fe.pendingcb-=H-1;const le=fe.allNoop?te:Re=>{for(let Je=Q;Je<xe.length;++Je)xe[Je].callback(Re)},Ae=fe.allNoop&&Q===0?xe:e(xe,Q);Ae.allBuffers=fe.allBuffers,B(me,fe,!0,fe.length,Ae,"",le),_(fe)}else{do{const{chunk:le,encoding:Ae,callback:Re}=xe[Q];xe[Q++]=null;const Je=z?1:le.length;B(me,fe,!1,Je,le,Ae,Re)}while(Q<xe.length&&!fe.writing);Q===xe.length?_(fe):Q>256?(xe.splice(0,Q),fe.bufferedIndex=0):fe.bufferedIndex=Q}fe.bufferProcessing=!1}P.prototype._write=function(me,fe,xe){if(this._writev)this._writev([{chunk:me,encoding:fe}],xe);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,fe,xe){const ne=this._writableState;typeof me=="function"?(xe=me,me=null,fe=null):typeof fe=="function"&&(xe=fe,fe=null);let z;if(me!=null){const H=j(this,me,fe);H instanceof t&&(z=H)}return ne.corked&&(ne.corked=1,this.uncork()),z||(!ne.errored&&!ne.ending?(ne.ending=!0,Se(this,ne,!0),ne.ended=!0):ne.finished?z=new W("end"):ne.destroyed&&(z=new O("end"))),typeof xe=="function"&&(z||ne.finished?r.nextTick(xe,z):ne[re].push(xe)),this};function V(me){return me.ending&&!me.destroyed&&me.constructed&&me.length===0&&!me.errored&&me.buffered.length===0&&!me.finished&&!me.writing&&!me.errorEmitted&&!me.closeEmitted}function Ce(me,fe){let xe=!1;function ne(z){if(xe){he(me,z??M());return}if(xe=!0,fe.pendingcb--,z){const H=fe[re].splice(0);for(let Q=0;Q<H.length;Q++)H[Q](z);he(me,z,fe.sync)}else V(fe)&&(fe.prefinished=!0,me.emit("prefinish"),fe.pendingcb++,r.nextTick(Te,me,fe))}fe.sync=!0,fe.pendingcb++;try{me._final(ne)}catch(z){ne(z)}fe.sync=!1}function Oe(me,fe){!fe.prefinished&&!fe.finalCalled&&(typeof me._final=="function"&&!fe.destroyed?(fe.finalCalled=!0,Ce(me,fe)):(fe.prefinished=!0,me.emit("prefinish")))}function Se(me,fe,xe){V(fe)&&(Oe(me,fe),fe.pendingcb===0&&(xe?(fe.pendingcb++,r.nextTick((ne,z)=>{V(z)?Te(ne,z):z.pendingcb--},me,fe)):V(fe)&&(fe.pendingcb++,Te(me,fe))))}function Te(me,fe){fe.pendingcb--,fe.finished=!0;const xe=fe[re].splice(0);for(let ne=0;ne<xe.length;ne++)xe[ne]();if(me.emit("finish"),fe.autoDestroy){const ne=me._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&me.destroy()}}u(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(me){this._writableState&&(this._writableState.destroyed=me)}},writable:{__proto__:null,get(){const me=this._writableState;return!!me&&me.writable!==!1&&!me.destroyed&&!me.errored&&!me.ending&&!me.ended},set(me){this._writableState&&(this._writableState.writable=!!me)}},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 me=this._writableState;return me?!me.destroyed&&!me.ending&&me.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 oe=b.destroy;P.prototype.destroy=function(me,fe){const xe=this._writableState;return!xe.destroyed&&(xe.bufferedIndex<xe.buffered.length||xe[re].length)&&r.nextTick(Y,xe),oe.call(this,me,fe),this},P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(me,fe){fe(me)},P.prototype[y.captureRejectionSymbol]=function(me){this.destroy(me)};let ce;function be(){return ce===void 0&&(ce={}),ce}return P.fromWeb=function(me,fe){return be().newStreamWritableFromWritableStream(me,fe)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},LE}var NE,dO;function wJ(){if(dO)return NE;dO=1;const r=Df(),e=Ep(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=xc(),m=Uf(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:x}}=Ns(),{destroyer:E}=U0(),C=bc(),T=C_(),k=o8(),{createDeferredPromise:M}=as(),R=jP(),O=globalThis.Blob||e.Blob,W=typeof O<"u"?function(S){return S instanceof O}:function(S){return!1},Z=globalThis.AbortController||Mg().AbortController,{FunctionPrototypeCall:se}=oa();class ye extends C{constructor(S){super(S),S?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),S?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}NE=function re(S,_){if(p(S))return S;if(o(S))return te({readable:S});if(c(S))return te({writable:S});if(u(S))return te({writable:!1,readable:!1});if(d(S))return te({readable:T.fromWeb(S)});if(y(S))return te({writable:k.fromWeb(S)});if(typeof S=="function"){const{value:j,write:q,final:B,destroy:X}=he(S);if(s(j))return R(ye,j,{objectMode:!0,write:q,final:B,destroy:X});const $=j?.then;if(typeof $=="function"){let D;const N=se($,j,Y=>{if(Y!=null)throw new x("nully","body",Y)},Y=>{E(D,Y)});return D=new ye({objectMode:!0,readable:!1,write:q,final(Y){B(async()=>{try{await N,r.nextTick(Y,null)}catch(ie){r.nextTick(Y,ie)}})},destroy:X})}throw new x("Iterable, AsyncIterable or AsyncFunction",_,j)}if(W(S))return re(S.arrayBuffer());if(s(S))return R(ye,S,{objectMode:!0,writable:!1});if(d(S?.readable)&&y(S?.writable))return ye.fromWeb(S);if(typeof S?.writable=="object"||typeof S?.readable=="object"){const j=S!=null&&S.readable?o(S?.readable)?S?.readable:re(S.readable):void 0,q=S!=null&&S.writable?c(S?.writable)?S?.writable:re(S.writable):void 0;return te({readable:j,writable:q})}const P=S?.then;if(typeof P=="function"){let j;return se(P,S,q=>{q!=null&&j.push(q),j.push(null)},q=>{E(j,q)}),j=new ye({objectMode:!0,writable:!1,read(){}})}throw new b(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function he(re){let{promise:S,resolve:_}=M();const P=new Z,j=P.signal;return{value:re((async function*(){for(;;){const B=S;S=null;const{chunk:X,done:$,cb:D}=await B;if(r.nextTick(D),$)return;if(j.aborted)throw new v(void 0,{cause:j.reason});({promise:S,resolve:_}=M()),yield X}})(),{signal:j}),write(B,X,$){const D=_;_=null,D({chunk:B,done:!1,cb:$})},final(B){const X=_;_=null,X({done:!0,cb:B})},destroy(B,X){P.abort(),X(B)}}}function te(re){const S=re.readable&&typeof re.readable.read!="function"?T.wrap(re.readable):re.readable,_=re.writable;let P=!!t(S),j=!!a(_),q,B,X,$,D;function N(Y){const ie=$;$=null,ie?ie(Y):Y&&D.destroy(Y)}return D=new ye({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(m(_,Y=>{j=!1,Y&&E(S,Y),N(Y)}),D._write=function(Y,ie,V){_.write(Y,ie)?V():q=V},D._final=function(Y){_.end(),B=Y},_.on("drain",function(){if(q){const Y=q;q=null,Y()}}),_.on("finish",function(){if(B){const Y=B;B=null,Y()}})),P&&(m(S,Y=>{P=!1,Y&&E(S,Y),N(Y)}),S.on("readable",function(){if(X){const Y=X;X=null,Y()}}),S.on("end",function(){D.push(null)}),D._read=function(){for(;;){const Y=S.read();if(Y===null){X=D._read;return}if(!D.push(Y))return}}),D._destroy=function(Y,ie){!Y&&$!==null&&(Y=new v),X=null,q=null,B=null,$===null?ie(Y):($=ie,E(_,Y),E(S,Y))},D}return NE}var PE,pO;function bc(){if(pO)return PE;pO=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();PE=o;const s=C_(),u=o8();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let m=0;m<y.length;m++){const v=y[m];o.prototype[v]||(o.prototype[v]=u.prototype[v])}}function o(y){if(!(this instanceof o))return new o(y);s.call(this,y),u.call(this,y),y?(this.allowHalfOpen=y.allowHalfOpen!==!1,y.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),y.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(o.prototype,{writable:{__proto__:null,...e(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(u.prototype,"writableLength")},writableFinished:{__proto__:null,...e(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(y){this._readableState&&this._writableState&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}}});let c;function p(){return c===void 0&&(c={}),c}o.fromWeb=function(y,m){return p().newStreamDuplexFromReadableWritablePair(y,m)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=wJ()),d(y,"body")},PE}var IE,hO;function qP(){if(hO)return IE;hO=1;const{ObjectSetPrototypeOf:r,Symbol:e}=oa();IE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ns().codes,a=bc(),{getHighWaterMark:s}=S_();r(o.prototype,a.prototype),r(o,a);const u=e("kCallback");function o(d){if(!(this instanceof o))return new o(d);const y=d?s(this,d,"readableHighWaterMark",!0):null;y===0&&(d={...d,highWaterMark:null,readableHighWaterMark:y,writableHighWaterMark:d.writableHighWaterMark||0}),a.call(this,d),this._readableState.sync=!1,this[u]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",p)}function c(d){typeof this._flush=="function"&&!this.destroyed?this._flush((y,m)=>{if(y){d?d(y):this.destroy(y);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function p(){this._final!==c&&c.call(this)}return o.prototype._final=c,o.prototype._transform=function(d,y,m){throw new t("_transform()")},o.prototype._write=function(d,y,m){const v=this._readableState,b=this._writableState,x=v.length;this._transform(d,y,(E,C)=>{if(E){m(E);return}C!=null&&this.push(C),b.ended||x===v.length||v.length<v.highWaterMark?m():this[u]=m})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},IE}var DE,yO;function HP(){if(yO)return DE;yO=1;const{ObjectSetPrototypeOf:r}=oa();DE=t;const e=qP();r(t.prototype,e.prototype),r(t,e);function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,s,u){u(null,a)},DE}var UE,mO;function u8(){if(mO)return UE;mO=1;const r=Df(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Uf(),{once:o}=as(),c=U0(),p=bc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:E}=Ns(),{validateFunction:C,validateAbortSignal:T}=Vg(),{isIterable:k,isReadable:M,isReadableNodeStream:R,isNodeStream:O,isTransformStream:W,isWebStream:Z,isReadableStream:se,isReadableFinished:ye}=xc(),he=globalThis.AbortController||Mg().AbortController;let te,re,S;function _(Y,ie,V){let Ce=!1;Y.on("close",()=>{Ce=!0});const Oe=u(Y,{readable:ie,writable:V},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(Y,Se||new b("pipe")))},cleanup:Oe}}function P(Y){return C(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function j(Y){if(k(Y))return Y;if(R(Y))return q(Y);throw new y("val",["Readable","Iterable","AsyncIterable"],Y)}async function*q(Y){re||(re=C_()),yield*re.prototype[a].call(Y)}async function B(Y,ie,V,{end:Ce}){let Oe,Se=null;const Te=be=>{if(be&&(Oe=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Oe?me(Oe):Se=()=>{Oe?me(Oe):be()}});ie.on("drain",Te);const ce=u(ie,{readable:!1},Te);try{ie.writableNeedDrain&&await oe();for await(const be of Y)ie.write(be)||await oe();Ce&&(ie.end(),await oe()),V()}catch(be){V(Oe!==be?d(Oe,be):be)}finally{ce(),ie.off("drain",Te)}}async function X(Y,ie,V,{end:Ce}){W(ie)&&(ie=ie.writable);const Oe=ie.getWriter();try{for await(const Se of Y)await Oe.ready,Oe.write(Se).catch(()=>{});await Oe.ready,Ce&&await Oe.close(),V()}catch(Se){try{await Oe.abort(Se),V(Se)}catch(Te){V(Te)}}}function $(...Y){return D(Y,o(P(Y)))}function D(Y,ie,V){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new v("streams");const Ce=new he,Oe=Ce.signal,Se=V?.signal,Te=[];T(Se,"options.signal");function oe(){z(new E)}S=S||as().addAbortListener;let ce;Se&&(ce=S(Se,oe));let be,me;const fe=[];let xe=0;function ne(Ae){z(Ae,--xe===0)}function z(Ae,Re){var Je;if(Ae&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=Ae),!(!be&&!Re)){for(;fe.length;)fe.shift()(be);(Je=ce)===null||Je===void 0||Je[s](),Ce.abort(),Re&&(be||Te.forEach(lt=>lt()),r.nextTick(ie,be,me))}}let H;for(let Ae=0;Ae<Y.length;Ae++){const Re=Y[Ae],Je=Ae<Y.length-1,lt=Ae>0,et=Je||V?.end!==!1,xt=Ae===Y.length-1;if(O(Re)){let de=function(J){J&&J.name!=="AbortError"&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(J)};if(et){const{destroy:J,cleanup:F}=_(Re,Je,lt);fe.push(J),M(Re)&&xt&&Te.push(F)}Re.on("error",de),M(Re)&&xt&&Te.push(()=>{Re.removeListener("error",de)})}if(Ae===0)if(typeof Re=="function"){if(H=Re({signal:Oe}),!k(H))throw new m("Iterable, AsyncIterable or Stream","source",H)}else k(Re)||R(Re)||W(Re)?H=Re:H=p.from(Re);else if(typeof Re=="function"){if(W(H)){var Q;H=j((Q=H)===null||Q===void 0?void 0:Q.readable)}else H=j(H);if(H=Re(H,{signal:Oe}),Je){if(!k(H,!0))throw new m("AsyncIterable",`transform[${Ae-1}]`,H)}else{var le;te||(te=HP());const de=new te({objectMode:!0}),J=(le=H)===null||le===void 0?void 0:le.then;if(typeof J=="function")xe++,J.call(H,Ee=>{me=Ee,Ee!=null&&de.write(Ee),et&&de.end(),r.nextTick(ne)},Ee=>{de.destroy(Ee),r.nextTick(ne,Ee)});else if(k(H,!0))xe++,B(H,de,ne,{end:et});else if(se(H)||W(H)){const Ee=H.readable||H;xe++,B(Ee,de,ne,{end:et})}else throw new m("AsyncIterable or Promise","destination",H);H=de;const{destroy:F,cleanup:ue}=_(H,!1,!0);fe.push(F),xt&&Te.push(ue)}}else if(O(Re)){if(R(H)){xe+=2;const de=N(H,Re,ne,{end:et});M(Re)&&xt&&Te.push(de)}else if(W(H)||se(H)){const de=H.readable||H;xe++,B(de,Re,ne,{end:et})}else if(k(H))xe++,B(H,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else if(Z(Re)){if(R(H))xe++,X(j(H),Re,ne,{end:et});else if(se(H)||k(H))xe++,X(H,Re,ne,{end:et});else if(W(H))xe++,X(H.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else H=p.from(Re)}return(Oe!=null&&Oe.aborted||Se!=null&&Se.aborted)&&r.nextTick(oe),H}function N(Y,ie,V,{end:Ce}){let Oe=!1;if(ie.on("close",()=>{Oe||V(new x)}),Y.pipe(ie,{end:!1}),Ce){let Se=function(){Oe=!0,ie.end()};ye(Y)?r.nextTick(Se):Y.once("end",Se)}else V();return u(Y,{readable:!0,writable:!1},Se=>{const Te=Y._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Te&&Te.ended&&!Te.errored&&!Te.errorEmitted?Y.once("end",V).once("error",V):V(Se)}),u(ie,{readable:!1,writable:!0},V)}return UE={pipelineImpl:D,pipeline:$},UE}var FE,gO;function VP(){if(gO)return FE;gO=1;const{pipeline:r}=u8(),e=bc(),{destroyer:t}=U0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=xc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:v}}=Ns(),b=Uf();return FE=function(...E){if(E.length===0)throw new v("streams");if(E.length===1)return e.from(E[0]);const C=[...E];if(typeof E[0]=="function"&&(E[0]=e.from(E[0])),typeof E[E.length-1]=="function"){const te=E.length-1;E[te]=e.from(E[te])}for(let te=0;te<E.length;++te)if(!(!a(E[te])&&!o(E[te]))){if(te<E.length-1&&!(s(E[te])||d(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(E[te])||p(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be writable")}let T,k,M,R,O;function W(te){const re=R;R=null,re?re(te):te?O.destroy(te):!he&&!ye&&O.destroy()}const Z=E[0],se=r(E,W),ye=!!(u(Z)||p(Z)||c(Z)),he=!!(s(se)||d(se)||c(se));if(O=new e({writableObjectMode:!!(Z!=null&&Z.writableObjectMode),readableObjectMode:!!(se!=null&&se.readableObjectMode),writable:ye,readable:he}),ye){if(a(Z))O._write=function(re,S,_){Z.write(re,S)?_():T=_},O._final=function(re){Z.end(),k=re},Z.on("drain",function(){if(T){const re=T;T=null,re()}});else if(o(Z)){const S=(c(Z)?Z.writable:Z).getWriter();O._write=async function(_,P,j){try{await S.ready,S.write(_).catch(()=>{}),j()}catch(q){j(q)}},O._final=async function(_){try{await S.ready,S.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(se)?se.readable:se;b(te,()=>{if(k){const re=k;k=null,re()}})}if(he){if(a(se))se.on("readable",function(){if(M){const te=M;M=null,te()}}),se.on("end",function(){O.push(null)}),O._read=function(){for(;;){const te=se.read();if(te===null){M=O._read;return}if(!O.push(te))return}};else if(o(se)){const re=(c(se)?se.readable:se).getReader();O._read=async function(){for(;;)try{const{value:S,done:_}=await re.read();if(!O.push(S))return;if(_){O.push(null);return}}catch{return}}}}return O._destroy=function(te,re){!te&&R!==null&&(te=new y),M=null,T=null,k=null,R===null?re(te):(R=re,a(se)&&t(se,te))},O},FE}var vO;function _J(){if(vO)return fw;vO=1;const r=globalThis.AbortController||Mg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ns(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=Vg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:m}=Uf(),v=VP(),{addAbortSignalNoValidate:b}=x_(),{isWritable:x,isNodeStream:E}=xc(),{deprecate:C}=as(),{ArrayPrototypePush:T,Boolean:k,MathFloor:M,Number:R,NumberIsNaN:O,Promise:W,PromiseReject:Z,PromiseResolve:se,PromisePrototypeThen:ye,Symbol:he}=oa(),te=he("kEmpty"),re=he("kEof");function S(Se,Te){if(Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),E(Se)&&!x(Se))throw new e("stream",Se,"must be writable");const oe=v(this,Se);return Te!=null&&Te.signal&&b(Te.signal,oe),oe}function _(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal");let oe=1;Te?.concurrency!=null&&(oe=M(Te.concurrency));let ce=oe-1;return Te?.highWaterMark!=null&&(ce=M(Te.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=as().AbortSignalAny([Te?.signal].filter(k)),fe=this,xe=[],ne={signal:me};let z,H,Q=!1,le=0;function Ae(){Q=!0,Re()}function Re(){le-=1,Je()}function Je(){H&&!Q&&le<oe&&xe.length<ce&&(H(),H=null)}async function lt(){try{for await(let et of fe){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=se(et)}catch(xt){et=Z(xt)}le+=1,ye(et,Re,Ae),xe.push(et),z&&(z(),z=null),!Q&&(xe.length>=ce||le>=oe)&&await new W(xt=>{H=xt})}xe.push(re)}catch(et){const xt=Z(et);ye(xt,Re,Ae),xe.push(xt)}finally{Q=!0,z&&(z(),z=null)}}lt();try{for(;;){for(;xe.length>0;){const et=await xe[0];if(et===re)return;if(me.aborted)throw new u;et!==te&&(yield et),xe.shift(),Je()}await new W(et=>{z=et})}}finally{Q=!0,H&&(H(),H=null)}}).call(this)}function P(Se=void 0){return Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal"),(async function*(){let oe=0;for await(const be of this){var ce;if(Se!=null&&(ce=Se.signal)!==null&&ce!==void 0&&ce.aborted)throw new u({cause:Se.signal.reason});yield[oe++,be]}}).call(this)}async function j(Se,Te=void 0){for await(const oe of $.call(this,Se,Te))return!0;return!1}async function q(Se,Te=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Te)}async function B(Se,Te){for await(const oe of $.call(this,Se,Te))return oe}async function X(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be),te}for await(const ce of _.call(this,oe,Te));}function $(Se,Te){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be)?ce:te}return _.call(this,oe,Te)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function N(Se,Te,oe){var ce;if(typeof Se!="function")throw new t("reducer",["Function","AsyncFunction"],Se);oe!=null&&p(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let be=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const z=new u(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(z)),z}const me=new r,fe=me.signal;if(oe!=null&&oe.signal){const z={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),z)}let xe=!1;try{for await(const z of this){var ne;if(xe=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Te=await Se(Te,z,{signal:fe}):(Te=z,be=!0)}if(!xe&&!be)throw new D}finally{me.abort()}return Te}async function Y(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Te=[];for await(const ce of this){var oe;if(Se!=null&&(oe=Se.signal)!==null&&oe!==void 0&&oe.aborted)throw new u(void 0,{cause:Se.signal.reason});T(Te,ce)}return Te}function ie(Se,Te){const oe=_.call(this,Se,Te);return(async function*(){for await(const be of oe)yield*be}).call(this)}function V(Se){if(Se=R(Se),O(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Te=void 0){return Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Te!=null&&(ce=Te.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Te!=null&&(be=Te.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Oe(Se,Te=void 0){return Te!=null&&p(Te,"options"),Te?.signal!=null&&o(Te.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Te!=null&&(ce=Te.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Te!=null&&(be=Te.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return fw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:$,flatMap:ie,map:_,take:Oe,compose:S},fw.promiseReturningOperators={every:q,forEach:X,reduce:N,toArray:Y,some:j,find:B},fw}var BE,bO;function GP(){if(bO)return BE;bO=1;const{ArrayPrototypePop:r,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=xc(),{pipelineImpl:u}=u8(),{finished:o}=Uf();$P();function c(...p){return new e((d,y)=>{let m,v;const b=p[p.length-1];if(b&&typeof b=="object"&&!a(b)&&!t(b)&&!s(b)){const x=r(p);m=x.signal,v=x.end}u(p,(x,E)=>{x?y(x):d(E)},{signal:m,end:v})})}return BE={finished:o,pipeline:c},BE}var wO;function $P(){if(wO)return mE.exports;wO=1;const{Buffer:r}=Ep(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=as(),{streamReturningOperators:u,promiseReturningOperators:o}=_J(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ns(),p=VP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=S_(),{pipeline:m}=u8(),{destroyer:v}=U0(),b=Uf(),x=GP(),E=xc(),C=mE.exports=s8().Stream;C.isDestroyed=E.isDestroyed,C.isDisturbed=E.isDisturbed,C.isErrored=E.isErrored,C.isReadable=E.isReadable,C.isWritable=E.isWritable,C.Readable=C_();for(const k of t(u)){let R=function(...O){if(new.target)throw c();return C.Readable.from(a(M,this,O))};const M=u[k];e(R,"name",{__proto__:null,value:M.name}),e(R,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let R=function(...O){if(new.target)throw c();return a(M,this,O)};const M=o[k];e(R,"name",{__proto__:null,value:M.name}),e(R,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}C.Writable=o8(),C.Duplex=bc(),C.Transform=qP(),C.PassThrough=HP(),C.pipeline=m;const{addAbortSignal:T}=x_();return C.addAbortSignal=T,C.finished=b,C.destroy=v,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),e(m,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),e(b,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(M){return M instanceof Uint8Array},C._uint8ArrayToBuffer=function(M){return r.from(M.buffer,M.byteOffset,M.byteLength)},mE.exports}var _O;function xJ(){return _O||(_O=1,(function(r){const e=$P(),t=GP(),a=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=a,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(yE)),yE.exports}var zE,xO;function WP(){if(xO)return zE;xO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Ng().Buffer);const r=lP(),e=xJ(),t=gi();if(globalThis.process||(globalThis.process=Df()),typeof crypto>"u"){const s=n_;s.getRandomValues=u=>s.randomBytes(u.length),globalThis.crypto=s}const a={ElvCrypto:async()=>{try{if(!a.elvCrypto){const s=(await Promise.resolve().then(()=>require("./index-SUB8Y1LV.js"))).default;a.elvCrypto=await new s().init()}return a.elvCrypto}catch(s){console.error("Error initializing ElvCrypto:"),console.error(s)}},EncryptedSize:s=>{const o=Math.floor(s/1e6);let c=a.EncryptedBlockSize(1e6),p=o*c;return s%1e6!==0&&(p+=a.EncryptedBlockSize(s%1e6)),p},EncryptedBlockSize:(s,u=!1)=>{let m=Math.floor(s/564)*576;return s%564!==0&&(m+=576),u?m+608:m+129},async EncryptConk(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=new Uint8Array(Buffer.from(JSON.stringify(s)));const{data:c,ephemeralKey:p,tag:d}=await o.encryptECIES(s,u),y=Buffer.concat([Buffer.from(p),Buffer.from(d),Buffer.from(c)]);return t.B64(y)},async DecryptCap(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=Buffer.from(s,"base64");const c=s.slice(0,65),p=s.slice(65,81),d=s.slice(81),y=o.decryptECIES(new Uint8Array(d),u,new Uint8Array(c),new Uint8Array(p));return JSON.parse(Buffer.from(y).toString())},async GeneratePrimaryConk({spaceId:s,objectId:u}){const o=await a.ElvCrypto(),{secretKey:c,publicKey:p}=o.generatePrimaryKeys(),d=o.generateSymmetricKey().key;return{symm_key:`kpsy${r.encode(Buffer.from(d))}`,secret_key:`kpsk${r.encode(Buffer.from(c))}`,public_key:`kppk${r.encode(Buffer.from(p))}`,sid:s,qid:u}},async GenerateTargetConk(){const s=await a.ElvCrypto(),{secretKey:u,publicKey:o}=s.generateTargetKeys();return{secret_key:`kpsk${r.encode(Buffer.from(u))}`,public_key:`ktpk${r.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(r.decode(o.slice(4)));return{symmetricKey:u(s.symm_key),secretKey:u(s.secret_key),publicKey:u(s.public_key)}},async EncryptionContext(s){const u=await a.ElvCrypto(),{symmetricKey:o,secretKey:c,publicKey:p}=a.CapToConk(s);let d,y;return p.length===u.PRIMARY_PK_KEY_SIZE?(y=u.CRYPTO_TYPE_PRIMARY,d=u.newPrimaryContext(p,c,o)):(y=u.CRYPTO_TYPE_TARGET,d=u.newTargetDecryptionContext(c,o)),{context:d,type:y}},Encrypt:async(s,u)=>{const o=await a.OpenEncryptionStream(s);!Buffer.isBuffer(u)&&!(u instanceof ArrayBuffer)&&(u=Buffer.from(await new Response(u).arrayBuffer()));const c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenEncryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o}=await a.EncryptionContext(s),c=new e.PassThrough,p=u.createCipher(o);return c.pipe(p).on("finish",()=>{o.free()}).on("error",d=>{throw Error(d)})},Decrypt:async(s,u)=>{const o=await a.OpenDecryptionStream(s),c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenDecryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o,type:c}=await a.EncryptionContext(s),p=new e.PassThrough,d=u.createDecipher(c,o);return p.pipe(d).on("finish",()=>{o.free()}).on("error",y=>{throw Error(y)})}};return zE=a,zE}var zr={},SO;function KP(){if(SO)return zr;SO=1;const r=gi();let e;r.Platform()===r.PLATFORM_NODE&&(globalThis.Response=ZA().Response,e=n_);const t=vi(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=Su();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:m}){o({libraryId:c,objectId:p,versionHash:y,writeToken:m}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let v=t("q",m||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:v})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:m,fileInfo:v,accessKey:b,secret:x,signedUrl:E,encryption:C="none",copy:T=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const M=/^s3:\/\/([^/]+)\//i;for(let ye=0;ye<v.length;ye++){const he=v[ye].source,te=M.exec(he);if(te){if(te[1]!==m)throw Error('Full S3 file path "'+he+`" specified, but does not match provided bucket name '`+m+"'");v[ye].source=he.replace(M,"")}}T?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let R;if(C==="cgck"){let ye=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ye={...ye,secret_key:""},R=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ye)))}`}let O={access_key_id:b,secret_access_key:x};E&&(O={signed_url:E});const W={encryption_key:R,access:{protocol:"s3",platform:"aws",path:m,storage_endpoint:{region:y},cloud_credentials:O}},Z=v.map(ye=>T?{op:"ingest-copy",path:ye.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ye.source}}:{op:"add-reference",path:ye.path,reference:{type:"key",path:ye.source}}),{id:se}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:Z,defaults:W});for(;;){await new Promise(te=>setTimeout(te,1e3));const ye=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:se});if(ye.errors&&ye.errors.length>1)throw ye.errors.join(`
|
|
328
328
|
`);if(ye.error)throw this.Log(`S3 file upload failed:
|
|
329
329
|
${JSON.stringify(ye,null,2)}`),ye.error;if(ye.status.toLowerCase()==="failed")throw"File upload failed";let he=!1;if(T){if(he=ye.ingest_copy.done,k){const te=ye.ingest_copy.progress;k({done:he,uploaded:te.bytes.completed,total:te.bytes.total,uploadedFiles:te.files.completed,totalFiles:te.files.total,fileStatus:te.files.details})}}else if(he=ye.add_reference.done,k){const te=ye.add_reference.progress;k({done:he,uploadedFiles:te.completed,totalFiles:te.total})}if(he)break}},zr.UploadFiles=async function({libraryId:c,objectId:p,writeToken:d,fileInfo:y,encryption:m="none",callback:v}){o({libraryId:c,objectId:p}),s(d),a("fileInfo",y),this.Log(`Uploading files: ${c} ${p} ${d}`);let b;m==="cgck"&&(b=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d}));let x={},E={},C=y;y=[];for(let S=0;S<C.length;S++){let _={...C[S],data:void 0};_.path=_.path.replace(/^\/+/,""),m==="cgck"&&(_.encryption={scheme:"cgck"}),E[_.path]=C[S].data,_.type="file",x[_.path]={uploaded:0,total:_.size},y.push(_)}this.Log(y),v&&v(x);const{id:T,jobs:k}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:y,encryption:m});this.Log(`Upload ID: ${T}`),this.Log(k);const M=500*1024*1024;let R=[],O=0,W=0;const Z=async()=>{for(let S=0;S<k.length;S++){for(;O-W>M;)await new Promise(j=>setTimeout(j,500));const _=k[S];let P=await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:T,jobId:_});for(let j=0;j<P.files.length;j++){const q=P.files[j];let B;typeof E[q.path]=="number"?(B=Buffer.alloc(q.len),e.readSync(E[q.path],B,0,q.len,q.off)):B=E[q.path].slice(q.off,q.off+q.len),m==="cgck"&&(B=await this.Crypto.Encrypt(b,B)),P.files[j].data=B,O+=q.len}R[S]=P,await new Promise(j=>setTimeout(j,50))}},se=async(S,_)=>{for(;!R[_];)await new Promise(q=>setTimeout(q,500));const j=R[_].files;for(let q=0;q<j.length;q++){const B=j[q];let X=0,$=!1;do try{await this.UploadFileData({libraryId:c,objectId:p,writeToken:d,uploadId:T,jobId:S,filePath:B.path,fileData:B.data,encryption:m}),$=!0}catch(D){if(this.Log(D,!0),X+=1,X>=10)throw D;await new Promise(N=>setTimeout(N,10*X*1e3))}while(!$&&X<10);delete R[_].files[q].data,W+=B.len,v&&(x[B.path]={...x[B.path],uploaded:x[B.path].uploaded+B.len},v(x))}};Z().catch(S=>{throw S});const ye=Math.min(3,k.length);let he=[];for(let S=0;S<ye;S++){const _=new Date().getTime();await se(k[S],S);const P=(new Date().getTime()-_)/1e3,j=R[S].files.map(q=>q.len).reduce((q,B)=>q+B,0);he.push(j/P/(1024*1024))}const te=he.reduce((S,_)=>S+_,0)/ye,re=Math.min(5,Math.ceil(te/2));await this.utils.LimitedMap(re,k,async(S,_)=>{_<ye||await se(S,_)})},zr.CreateFileUploadJob=async function({libraryId:c,objectId:p,writeToken:d,ops:y,defaults:m={},encryption:v="none"}){o({libraryId:c,objectId:p}),s(d),this.Log(`Creating file upload job: ${c} ${p} ${d}`),this.Log(y),v==="cgck"&&(m.encryption={scheme:"cgck"});const b={seq:0,seq_complete:!0,defaults:m,ops:y},x=t("q",d,"file_jobs");return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:v}),method:"POST",path:x,body:b,allowFailover:!1})},zr.UploadStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y}){o({libraryId:c,objectId:p}),s(d);const m=t("q",d,"file_jobs",y);return this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:m,allowFailover:!1}))},zr.UploadJobStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y,jobId:m}){o({libraryId:c,objectId:p}),s(d);const v=t("q",d,"file_jobs",y,"uploads",m);let b=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:v,allowFailover:!1,queryParams:{start:0,limit:1e4}}));for(;b.next!==b.total&&b.next>=0;){const x=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:v,allowFailover:!1,queryParams:{start:b.next}}));b.files=[...b.files,...x.files],b.next=x.next}return b},zr.UploadFileData=async function({libraryId:c,objectId:p,writeToken:d,encryption:y,uploadId:m,jobId:v,filePath:b,fileData:x}){o({libraryId:c,objectId:p}),s(d);let C=(await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:m,jobId:v})).files.find(k=>k.path===b);if(y&&y!=="none"&&(C=C.encrypted),C.rem===0)return;C.skip&&(x=x.slice(C.skip));let T=t("q",d,"file_jobs",m,v);return await this.utils.ResponseToJson(this.HttpClient.Request({method:"POST",path:T,body:x,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:d}){o({libraryId:c,objectId:p}),s(d),this.Log(`Finalizing upload job: ${c} ${p} ${d}`);const y=t("q",d,"files");await this.HttpClient.Request({method:"POST",path:y,bodyType:"BINARY",headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),allowFailover:!1})},zr.CreateFileDirectories=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Creating Directories: ${c} ${p} ${d}`),this.Log(y);const m=y.map(v=>({op:"add",type:"directory",path:v}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.MoveFiles=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Moving Files: ${c} ${p} ${d}`),this.Log(y);const m=y.map(({path:v,to:b})=>({op:"move",copy_move_source_path:v,path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.DeleteFiles=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Deleting Files: ${c} ${p} ${d}`),this.Log(y);const m=y.map(v=>({op:"del",path:v}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.DownloadFile=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,filePath:m,format:v="arrayBuffer",chunked:b=!1,chunkSize:x,clientSideDecryption:E=!1,callback:C}){o({libraryId:c,objectId:p,versionHash:d}),a("filePath",m),d&&(p=this.utils.DecodeVersionHash(d).objectId);const T=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,writeToken:y,metadataSubtree:t("files",m)}),k=T&&T["."].encryption&&T["."].encryption.scheme==="cgck",M=k?"cgck":void 0,R=k&&!E?t("q",y||d||p,"rep","files_download",m):t("q",y||d||p,"files",m),O=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:M,makeAccessRequest:M==="cgck"});O.Accept="*/*";const W=`eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`,Z=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,metadataSubtree:W});k&&!this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))&&!Z&&(O["X-Content-Fabric-Decryption-Mode"]="reencrypt"),k&&!E&&(O["X-Content-Fabric-Decryption-Mode"]="decrypt",x=Number.MAX_SAFE_INTEGER);const se=T["."].size;if(k&&E)return await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,versionHash:d,download:!0}),downloadPath:R,bytesTotal:se,headers:O,callback:C,format:v,clientSideDecryption:E,chunked:b});x||(x=1e7);try{return await this.Download({downloadPath:R,bytesTotal:se,headers:O,callback:C,format:v,chunked:b,chunkSize:x})}catch(ye){if(k&&!E)return this.DownloadFile({...arguments[0],clientSideDecryption:!0});throw ye}},zr.ContentParts=async function({libraryId:c,objectId:p,versionHash:d}){o({libraryId:c,objectId:p,versionHash:d}),this.Log(`Retrieving parts: ${c} ${p||d}`),d&&(p=this.utils.DecodeVersionHash(d).objectId);const y=t("q",d||p,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d}),method:"GET",path:y})).parts},zr.ContentPart=async function({libraryId:c,objectId:p,versionHash:d,partHash:y}){o({libraryId:c,objectId:p,versionHash:d}),u(y),this.Log(`Retrieving part: ${c} ${p||d} ${y}`),d&&(p=this.utils.DecodeVersionHash(d).objectId);let m=t("q",d||p,"parts",y);return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d}),method:"GET",path:m})},zr.DownloadPart=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,partHash:m,format:v="arrayBuffer",chunked:b=!1,chunkSize:x=1e7,callback:E}){o({libraryId:c,objectId:p,versionHash:d}),u(m),d&&(p=this.utils.DecodeVersionHash(d).objectId);const C=m.startsWith("hqpe"),T=C?"cgck":void 0,k=t("q",y||d||p,"data",m);let M=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:T,makeAccessRequest:!0});const R=(await this.ContentPart({libraryId:c,objectId:p,versionHash:d,partHash:m})).part.size;return C?(this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))||(M["X-Content-Fabric-Decryption-Mode"]="reencrypt"),await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,download:!0}),downloadPath:k,bytesTotal:R,headers:M,callback:E,format:v,chunked:b})):await this.Download({downloadPath:k,bytesTotal:R,headers:M,callback:E,format:v,chunked:b,chunkSize:x})},zr.Download=async function({downloadPath:c,headers:p,bytesTotal:d,chunked:y=!1,chunkSize:m=2e6,callback:v,format:b="arrayBuffer"}){if(y&&!v)throw Error("No callback specified for chunked download");let x;y||(x=[]);let E=0;const C=Math.ceil(d/m);for(let T=0;T<C;T++){p.Range=`bytes=${E}-${E+m-1}`;const k=await this.HttpClient.Request({path:c,headers:p,method:"GET"});E=Math.min(E+m,d),y?v({bytesFinished:E,bytesTotal:d,chunk:await this.utils.ResponseToFormat(b,k)}):(x.push(Buffer.from(await k.arrayBuffer())),v&&v({bytesFinished:E,bytesTotal:d}))}if(!y)return await this.utils.ResponseToFormat(b,new Response(Buffer.concat(x)))},zr.DownloadEncrypted=async function({conk:c,downloadPath:p,bytesTotal:d,headers:y,callback:m,format:v="arrayBuffer",chunked:b=!1}){if(b&&!m)throw Error("No callback specified for chunked download");const x=c.public_key.startsWith("ktpk"),E=this.Crypto.EncryptedBlockSize(1e6,x);let C=0;v=v.toLowerCase();let T=[];const k=await this.Crypto.OpenDecryptionStream(c);k.on("data",async R=>{if(b){if(v!=="buffer"){const O=R.buffer.slice(R.byteOffset,R.byteOffset+R.byteLength);v==="arraybuffer"?R=O:R=await this.utils.ResponseToFormat(v,new Response(O))}m({bytesFinished:C,bytesTotal:d,chunk:R})}else m&&m({bytesFinished:C,bytesTotal:d}),T.push(R)});const M=Math.ceil(d/E);for(let R=0;R<M;R++){y.Range=`bytes=${C}-${C+E-1}`;const O=await this.HttpClient.Request({headers:y,method:"GET",path:p});C=Math.min(C+E,d),k.write(new Uint8Array(await O.arrayBuffer()))}if(k.end(),await new Promise(R=>k.on("finish",()=>{R()})),!b)return await this.utils.ResponseToFormat(v,new Response(Buffer.concat(T)))},zr.CreatePart=async function({libraryId:c,objectId:p,writeToken:d,encryption:y}){o({libraryId:c,objectId:p}),s(d);const m=t("q",d,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:y}),method:"POST",path:m,bodyType:"BINARY",body:"",allowFailover:!1})).part.write_token},zr.UploadPartChunk=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,chunk:m,encryption:v}){if(o({libraryId:c,objectId:p}),s(d),v&&v!=="none"){const x=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});m=await this.Crypto.Encrypt(x,m)}const b=t("q",d,"parts");await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:v}),method:"POST",path:t(b,y),body:m,bodyType:"BINARY",allowFailover:!1}))},zr.FinalizePart=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,encryption:m}){o({libraryId:c,objectId:p}),s(d);const v=t("q",d,"parts");return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:m}),method:"POST",path:t(v,y),bodyType:"BINARY",body:"",allowFailover:!1})},zr.UploadPart=async function({libraryId:c,objectId:p,writeToken:d,data:y,encryption:m="none",chunkSize:v=1e7,callback:b}){o({libraryId:c,objectId:p}),s(d);const x=await this.CreatePart({libraryId:c,objectId:p,writeToken:d,encryption:m}),E=y.length||y.byteLength||y.size;b&&b({bytesFinished:0,bytesTotal:E});for(let C=0;C<E;C+=v){const T=y.slice(C,C+v);await this.UploadPartChunk({libraryId:c,objectId:p,writeToken:d,partWriteToken:x,chunk:T,encryption:m}),b&&b({bytesFinished:Math.min(C+v,E),bytesTotal:E})}return await this.FinalizePart({libraryId:c,objectId:p,writeToken:d,partWriteToken:x,encryption:m})},zr.DeletePart=async function({libraryId:c,objectId:p,writeToken:d,partHash:y}){o({libraryId:c,objectId:p}),s(d),u(y);let m=t("q",d,"parts",y);await this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"DELETE",path:m,allowFailover:!1})},zr}var CO;function SJ(){if(CO)return _3;CO=1;const r=BW(),e=gi(),t=BP().permissionLevels,{LogMessage:a}=I0(),s=WP();let u=class pA{Log(p,d=!1){a(this,p,d)}constructor({target:p,timeout:d=30}={}){this.permissionLevels=t,!p&&typeof window<"u"&&window.parent&&(p=window.parent),this.target=p,this.timeout=d,this.utils=e,this.Crypto=s,this.Crypto.ElvCrypto();for(const y of this.AllowedMethods())this[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{calledMethod:y,args:this.utils.MakeClonable(m)},callback:v})};this.userProfileClient={};for(const y of this.AllowedUserProfileMethods())this.userProfileClient[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{module:"userProfileClient",calledMethod:y,args:this.utils.MakeClonable(m),prompted:pA.PromptedMethods().includes(y)},callback:v})};this.walletClient={};for(const y of this.AllowedWalletClientMethods())this.walletClient[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{module:"walletClient",calledMethod:y,args:this.utils.MakeClonable(m)},callback:v})}}async PassRequest({request:p,Respond:d}){let y,m;try{let v;p.callbackId&&(v=b=>d({type:"ElvFrameResponse",requestId:p.callbackId,response:b})),y=await this.SendMessage({options:p,callback:v})}catch(v){m=v}return{type:"ElvFrameResponse",requestId:p.requestId,response:y,error:m}}async SendMessage({options:p={},callback:d,noResponse:y=!1}){const m=r.next();let v;if(d&&(v=r.next()),this.target.postMessage({...p,type:"ElvFrameRequest",requestId:m,callbackId:v},"*"),y)return;const b=p.calledMethod||p.operation,x=pA.FileMethods().includes(p.calledMethod);let E=this.timeout;return p.prompted||x?E=0:p.args&&p.args.fcTimeout&&(E=p.args.fcTimeout),await this.AwaitMessage(m,E,d,v,b)}async AwaitMessage(p,d,y,m,v){return await new Promise((b,x)=>{let E,C;const T=()=>{C&&clearTimeout(C),d>0&&(C=setTimeout(()=>{typeof window<"u"&&(window.removeEventListener("message",E),k&&window.removeEventListener("message",k)),x(`Request ${p} timed out (${v})`)},d*1e3))};let k;m&&(k=M=>{try{T();const R=M.data;if(R.type!=="ElvFrameResponse"||R.requestId!==m)return;y(R.response)}catch(R){console.error(R)}},window.addEventListener("message",k)),E=async M=>{try{const R=M.data;if(R.type!=="ElvFrameResponse"||R.requestId!==p)return;clearTimeout(C),window.removeEventListener("message",E),k&&window.removeEventListener("message",k),R.error?x(R.error):b(R.response)}catch(R){clearTimeout(C),window.removeEventListener("message",E),k&&window.removeEventListener("message",k),x(R)}},T(),window.addEventListener("message",E)})}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","CreateAuthorizationToken","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateShare","CreateSignedMessageJSON","CreateSignedToken","CreateStaticToken","CurrentAccountAddress","CustomContractAddress","DecodeSignedMessageJSON","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","ObjectCleanup","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RecordWriteToken","RedeemCode","RedeemShareToken","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","ResetTenantId","RevokeShare","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetTenantContractId","SetTenantId","TenantAdminGroup","ContentAdminGroup","TenantUsersGroup","SetVisibility","SetPermission","ShareInfo","Shares","SpaceNodes","StartABRMezzanineJobs","StreamAddWatermark","StreamConfig","StreamCopyToVod","StreamCreate","StreamInitialize","StreamInsertion","StreamListUrls","StreamRemoveWatermark","StreamSetOfferingAndDRM","StreamStatus","StreamStartOrStopOrReset","StreamStopSession","SuspendNTPInstance","TenantContractId","TenantId","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UpdateShare","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","Visibility","WriteTokenNodeUrlLocal","WriteTokenNodeUrlNetwork"]}AllowedUserProfileMethods(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","ResetTenantId","SetTenantContractId","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","PurgeUrl","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:o}=KP();return u.prototype.UploadFiles=o,_3.FrameClient=u,_3}var jE,EO;function CJ(){if(EO)return jE;EO=1;const r=gi(),e=vi(),{FrameClient:t}=SJ(),{LogMessage:a}=I0();class s{Log(o,c=!1){a(this,o,c)}constructor({client:o,debug:c}){this.client=o,this.debug=c,this.userWalletAddresses={},this.walletAddress=void 0,this.walletAddressRetrieved=!1}async CreateWallet(){if(this.creatingWallet)for(;this.creatingWallet;)await new Promise(o=>setTimeout(o,500));this.creatingWallet=!0;try{if(!this.walletAddress||r.EqualAddress(this.walletAddress,r.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 d=await this.client.CallContractMethodAndWait({contractAddress:r.HashToAddress(this.client.contentSpaceId),methodName:"createAccessWallet",methodArgs:[]}),y=await this.client.ContractAbi({contractAddress:this.client.contentSpaceAddress});this.walletAddress=this.client.ExtractValueFromEvent({abi:y,event:d,eventName:"CreateAccessWallet",eventValue:"wallet"}),this.userWalletAddresses[r.FormatAddress(this.client.signer.address)]=this.walletAddress}const o=this.client.contentSpaceLibraryId,c=r.AddressToObjectId(this.walletAddress);try{await this.client.ContentObject({libraryId:o,objectId:c})}catch(p){if(p.status===404){this.Log(`Creating wallet object for user ${this.client.signer.address}`);const d=await this.client.CreateContentObject({libraryId:o,objectId:c});await this.client.FinalizeContentObject({libraryId:o,objectId:c,writeToken:d.write_token,commitMessage:"Create user wallet object"})}}}catch(o){console.error("Failed to create wallet contract:"),console.error(o)}finally{this.creatingWallet=!1}}async WalletAddress(o=!0){if(this.walletAddress||this.walletAddressRetrieved)return this.walletAddress;this.walletAddressPromise||(this.walletAddressPromise=this.client.CallContractMethod({contractAddress:r.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[this.client.signer.address]}));const c=await this.walletAddressPromise;return r.EqualAddress(c,r.nullAddress)||(this.walletAddress=c),!this.walletAddress&&o&&await this.CreateWallet(),this.walletAddressRetrieved=!0,this.walletAddress}async UserWalletAddress({address:o}){if(r.EqualAddress(o,this.client.signer.address))return await this.WalletAddress();if(!this.userWalletAddresses[o]){this.Log(`Retrieving user wallet address for user ${o}`);const c=await this.client.CallContractMethod({contractAddress:r.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[o]});r.EqualAddress(c,r.nullAddress)||(this.userWalletAddresses[o]=c)}return this.userWalletAddresses[o]}async UserWalletObjectInfo({address:o}={}){const c=o?await this.UserWalletAddress({address:o}):await this.WalletAddress();return{libraryId:this.client.contentSpaceLibraryId,objectId:c?r.AddressToObjectId(c):""}}async PublicUserMetadata({address:o,metadataSubtree:c="/",queryParams:p={},select:d=[],resolveLinks:y=!1,resolveIncludeSource:m=!1,resolveIgnoreErrors:v=!1,linkDepthLimit:b=1}){if(!o||!await this.UserWalletAddress({address:o}))return;c=e("public",c||"/");const{libraryId:E,objectId:C}=await this.UserWalletObjectInfo({address:o});if(C)return await this.client.ContentObjectMetadata({libraryId:E,objectId:C,queryParams:p,select:d,metadataSubtree:c,resolveLinks:y,resolveIncludeSource:m,resolveIgnoreErrors:v,linkDepthLimit:b})}async UserMetadata({metadataSubtree:o="/",queryParams:c={},select:p=[],resolveLinks:d=!1,resolveIncludeSource:y=!1,resolveIgnoreErrors:m=!1,linkDepthLimit:v=1}={}){this.Log(`Accessing private user metadata at ${o}`);const{libraryId:b,objectId:x}=await this.UserWalletObjectInfo();return await this.client.ContentObjectMetadata({libraryId:b,objectId:x,metadataSubtree:o,queryParams:c,select:p,resolveLinks:d,resolveIncludeSource:y,resolveIgnoreErrors:m,linkDepthLimit:v})}async MergeUserMetadata({metadataSubtree:o="/",metadata:c={}}){this.Log(`Merging user metadata at ${o}`);const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.MergeMetadata({libraryId:p,objectId:d,writeToken:y.write_token,metadataSubtree:o,metadata:c}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Merge user metadata"})}async ReplaceUserMetadata({metadataSubtree:o="/",metadata:c={}}){this.Log(`Replacing user metadata at ${o}`);const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.ReplaceMetadata({libraryId:p,objectId:d,writeToken:y.write_token,metadataSubtree:o,metadata:c}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Replace user metadata"})}async DeleteUserMetadata({metadataSubtree:o="/"}){this.Log(`Deleting user metadata at ${o}`);const{libraryId:c,objectId:p}=await this.UserWalletObjectInfo(),d=await this.client.EditContentObject({libraryId:c,objectId:p});await this.client.DeleteMetadata({libraryId:c,objectId:p,writeToken:d.write_token,metadataSubtree:o}),await this.client.FinalizeContentObject({libraryId:c,objectId:p,writeToken:d.write_token,commitMessage:"Delete user metadata"})}async AccessLevel(){return await this.UserMetadata({metadataSubtree:"access_level"})||"prompt"}async SetAccessLevel({level:o}){if(o=o.toLowerCase(),!["private","prompt","public"].includes(o))throw new Error("Invalid access level: "+o);await this.ReplaceUserMetadata({metadataSubtree:"access_level",metadata:o})}async TenantId(){if(!this.tenantId){const{objectId:o}=await this.UserWalletObjectInfo();this.tenantId=await this.client.TenantId({objectId:o})}return this.tenantId}async SetTenantId({id:o,address:c}){if(o&&(!o.startsWith("iten")||!r.ValidHash(o)))throw Error(`Invalid tenant ID: ${o}`);if(c){if(!r.ValidAddress(c))throw Error(`Invalid address: ${c}`);o=`iten${r.AddressToHash(c)}`}const{objectId:p}=await this.UserWalletObjectInfo(),d=await this.client.SetTenantId({objectId:p,tenantId:o});this.tenantContractId=d.tenantContractId,this.tenantId=d.tenantId}async TenantContractId(){if(!this.tenantContractId){const{objectId:o}=await this.UserWalletObjectInfo();this.tenantContractId=await this.client.TenantContractId({objectId:o})}return this.tenantContractId}async SetTenantContractId({tenantContractId:o}){const{objectId:c}=await this.UserWalletObjectInfo(),p=await this.client.SetTenantContractId({objectId:c,tenantContractId:o});this.tenantContractId=p.tenantContractId,this.tenantId=p.tenantId}async ResetTenantId(){const{objectId:o}=await this.UserWalletObjectInfo();await this.client.ResetTenantId({objectId:o}),this.tenantId=this.client.TenantId({objectId:o}),this.tenantContractId=this.client.TenantContractId({objectId:o})}async UserProfileImage({address:o,height:c}={}){let p;if(o?p=await this.UserWalletAddress({address:o}):(o=this.client.signer.address,p=this.walletAddress),!p)return;const{libraryId:d,objectId:y}=await this.UserWalletObjectInfo({address:o});return this.client.ContentObjectImageUrl({libraryId:d,objectId:y,height:c,imagePath:"public/profile_image"})}async SetUserProfileImage({image:o}){if(this.Log(`Setting profile image for user ${this.client.signer.address}`),(o.length||o.byteLength||o.size)>5e6)throw Error("Maximum profile image size is 5MB");const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.SetContentObjectImage({libraryId:p,objectId:d,writeToken:y.write_token,image:o,imageName:"profile_image",imagePath:"public/profile_image"}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Set user profile image"})}async CollectedTags(){return await this.UserMetadata({metadataSubtree:"collected_data"})||{}}async RecordTags({libraryId:o,objectId:c,versionHash:p}){try{await this.__RecordTags({libraryId:o,objectId:c,versionHash:p})}catch(d){console.error(d)}}async __RecordTags({libraryId:o,objectId:c,versionHash:p}){if(await this.client.AccessType({id:c})!=="object"||(!p&&!o&&(o=await this.client.ContentObjectLibraryId({objectId:c})),p||(p=(await this.client.ContentObject({libraryId:o,objectId:c})).hash),await this.UserMetadata({metadataSubtree:e("accessed_content",p)})))return;const m=await this.UserWalletObjectInfo(),v=m.libraryId,b=m.objectId,x=await this.client.EditContentObject({libraryId:v,objectId:b});await this.client.ReplaceMetadata({libraryId:v,objectId:b,writeToken:x.write_token,metadataSubtree:e("accessed_content",p),metadata:Date.now()});const E=await this.client.ContentObjectMetadata({libraryId:o,objectId:c,versionHash:p,metadataSubtree:"video_tags"});if(E&&E.length>0){let C=await this.CollectedTags();const T=this.__FormatVideoTags(E);Object.keys(T).forEach(k=>{C[k]?(C[k].occurrences+=1,C[k].aggregate+=T[k]):C[k]={occurrences:1,aggregate:T[k]}}),await this.client.ReplaceMetadata({libraryId:v,objectId:b,writeToken:x.write_token,metadataSubtree:"collected_data",metadata:C})}await this.client.FinalizeContentObject({libraryId:v,objectId:b,writeToken:x.write_token,commitMessage:"Record user tags",awaitCommitConfirmation:!1})}__FormatVideoTags(o){let c={};o.forEach(d=>{d.tags.forEach(m=>{c[m.tag]?(c[m.tag].occurrences+=1,c[m.tag].aggregate+=m.score):c[m.tag]={occurrences:1,aggregate:m.score}})});let p={};return Object.keys(c).forEach(d=>{p[d]=c[d].aggregate/c[d].occurrences}),p}PromptedMethods(){return t.PromptedMethods()}MetadataMethods(){return t.MetadataMethods()}FrameAllowedMethods(){const o=["constructor","FrameAllowedMethods","Log","MetadataMethods","PromptedMethods","RecordTags","SetAccessLevel","SetTenantId","SetUserProfileImage","__IsLibraryCreated","__TouchLibrary","__FormatVideoTags","__RecordTags"];return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(c=>!o.includes(c))}}return jE=s,jE}var qE,AO;function EJ(){if(AO)return qE;AO=1;const r=Sl,e=gi(),t=If(),a=vi();class s extends r.Signer{constructor({signerURIs:o,idToken:c,userIdCode:p,authToken:d,tenantId:y,provider:m,extraData:v={},unsignedPublicAuth:b=!1}){super(),this.remoteSigner=!0,this.unsignedPublicAuth=b,this.HttpClient=new t({uris:o}),this.idToken=c,this.userIdCode=p,this.tenantId=y,this.authToken=d,this.extraLoginData=v||{},this.provider=m,this.signatureCache={}}async Initialize(){if(!this.authToken){let o={ext:this.extraLoginData||{}};this.tenantId&&(o.tid=this.tenantId),this.userIdCode&&(o.code=this.userIdCode);const{addr:c,eth:p,token:d}=await e.ResponseToJson(this.HttpClient.Request({path:a("as","wlt","login",this.userIdCode?"code":"jwt"),method:"POST",body:o,headers:{Authorization:`Bearer ${this.userIdCode||this.idToken}`}}));this.authToken=d,this.address=e.FormatAddress(c),this.id=p}if(!this.address){const o=await e.ResponseToJson(this.HttpClient.Request({method:"GET",path:a("as","wlt","keys"),headers:{Authorization:`Bearer ${this.authToken}`}})),c=o.eth[0];c&&c.startsWith("0x")?this.address=c:this.address=e.HashToAddress(o.eth[0])}this.id=this.address?`ikms${e.AddressToHash(this.address)}`:void 0,this.signer=this.provider.getSigner(this.address)}async RetrieveCSAT({email:o,nonce:c,installId:p,tenantId:d,force:y=!1,duration:m=24,appName:v}){if(c&&!p){const x=await crypto.subtle.digest("SHA-512",new TextEncoder("utf-8").encode(c));p=Array.prototype.map.call(new Uint8Array(x),E=>("00"+E.toString(16)).slice(-2)).join("")}let b=await e.ResponseToJson(this.HttpClient.Request({method:"POST",body:{email:o,install_id:p,force:y,tid:d,app_name:v,exp:parseInt(m*60*60)},path:a("as","wlt","sign","csat"),headers:{Authorization:`Bearer ${this.authToken}`}}));return b.nonce=c,b.installId=p,b}async CSATStatus({accessToken:o}){try{const c=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","status"),headers:{Authorization:`Bearer ${o}`}}));return c&&c.is_active}catch(c){return!c||c.status!==403}}async ReleaseCSAT({accessToken:o}){return await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","release"),headers:{Authorization:`Bearer ${o}`}}))}async RefreshCSAT({accessToken:o,refreshToken:c,nonce:p}){return await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","refresh","csat"),body:{last_csat:o,refresh_token:c,nonce:p},headers:{Authorization:`Bearer ${o}`}}))}getAddress(){return this.address}async signDigest(o){return this.signatureCache[o]||(this.signatureCache[o]=new Promise(async(c,p)=>{try{let d=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","sign","eth",this.id),headers:{Authorization:`Bearer ${this.authToken}`},body:{hash:o}}));d.v=parseInt(d.v,16),d.recoveryParam=d.v-27,c(d)}catch(d){p(d)}})),await this.signatureCache[o]}async signMessage(o){return Promise.resolve(r.utils.joinSignature(`0x${await this.signDigest(r.utils.hashMessage(o))}`))}async sign(o){o=await r.utils.resolveProperties(o);const c=await this.signDigest(r.utils.keccak256(r.utils.serializeTransaction(o)));return r.utils.serializeTransaction(o,c)}async sendTransaction(o){return o.nonce==null&&(o=r.utils.shallowCopy(o),o.nonce=await this.provider.getTransactionCount(this.address,"pending")),this.populateTransaction(o,this.provider,this.address).then(c=>this.sign(c).then(p=>this.provider.sendTransaction(p)))}connect(){}}return qE=s,qE}var aa={},kO;function AJ(){if(kO)return aa;kO=1;const{ValidatePresence:r,ValidateLibrary:e,ValidateObject:t,ValidateAddress:a,ValidateUserWallet:s}=Su();return aa.ListAccessGroups=async function(){const u=(await this.Collection({collectionType:"accessGroups"})).map(c=>this.utils.FormatAddress(c));return(await this.utils.LimitedMap(5,u,async c=>{try{const p=this.utils.AddressToHash(c),d=await this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:`iq__${p}`})||{};return{address:c,id:`igrp${p}`,meta:d}}catch(p){this.Log(p,!0)}})).filter(c=>c).sort((c,p)=>{const d=(c.meta.public||{}).name||`zz__${c.address}`,y=(p.meta.public||{}).name||`zz__${p.address}`;return d<y?-1:1})},aa.SetGroupPermission=async function({groupAddress:u,objectId:o,permission:c,remove:p=!1}){const d=await this.authClient.ContractInfo({address:u}),y=await this.authClient.ContractInfo({id:o});if(Object.keys(d).length===0)throw Error(`No information returned for group address ${u}`);let m;if(!y.isV3&&y.accessType===this.authClient.ACCESS_TYPES.GROUP){if(d.isV3)throw Error("Unable to map V3 group to V2 object");m=await this.CallContractMethodAndWait({contractAddress:u,methodName:"setAccessGroupRights",methodArgs:[this.utils.HashToAddress(o),c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]})}else m=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:"setRights",methodArgs:[u,c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]});return await this.ExtractEventFromLogs({abi:d.abi,event:m,eventName:"RightsChanged"})},aa.AccessGroupOwner=async function({contractAddress:u}){return u=a(u),this.Log(`Retrieving owner of access group ${u}`),await this.authClient.Owner({address:u})},aa.AccessGroupMembers=async function({contractAddress:u}){if(u=a(u),this.Log(`Retrieving members for group ${u}`),await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"})){const c=(await this.CallContractMethod({contractAddress:u,methodName:"membersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,d)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:u,methodName:"membersList",methodArgs:[d]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:u,methodName:"getMeta",methodArgs:["members"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},aa.AccessGroupManagers=async function({contractAddress:u}){if(u=a(u),this.Log(`Retrieving managers for group ${u}`),await this.authClient.ContractHasMethod({contractAddress:u,methodName:"managersList"})){const c=(await this.CallContractMethod({contractAddress:u,methodName:"managersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,d)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:u,methodName:"managersList",methodArgs:[d]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:u,methodName:"getMeta",methodArgs:["managers"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},aa.CreateAccessGroup=async function({name:u,description:o,metadata:c={},visibility:p=1}={}){this.Log(`Creating access group: ${u||""} ${o||""}`);let{contractAddress:d}=await this.authClient.CreateAccessGroup();d=this.utils.FormatAddress(d);const y=this.utils.AddressToObjectId(d),m=await this.userProfileClient.TenantContractId();this.Log(`Access group: ${d} ${y}`);const v=await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:y}),b={public:{name:u,description:o},name:u,description:o,...c};if(await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:v.write_token,metadata:b}),await this.CallContractMethodAndWait({contractAddress:d,methodName:"setVisibility",methodArgs:[p]}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:v.write_token,commitMessage:"Create access group"}),m){const x=await this.SetTenantContractId({contractAddress:d,tenantContractId:m});if(x.tenantId){let E=this.utils.HashToAddress(x.tenantId);await this.AddContentObjectGroupPermission({objectId:y,groupAddress:E,permission:"manage"})}else console.warn("No tenant ID associated with current tenant.")}return d},aa.DeleteAccessGroup=async function({contractAddress:u}){throw Error("Not supported")},aa.AccessGroupMembershipMethod=async function({contractAddress:u,memberAddress:o,methodName:c,eventName:p}){if(u=a(u),o=a(o),!this.utils.EqualAddress(this.signer.address,o)&&!await this.CallContractMethod({contractAddress:u,methodName:"hasManagerAccess",methodArgs:[this.utils.FormatAddress(this.signer.address)]}))throw Error("Manager access required");this.Log(`Calling ${c} on group ${u} for user ${o}`);const d=await this.CallContractMethodAndWait({contractAddress:u,methodName:c,methodArgs:[o],eventName:p,eventValue:"candidate"}),y=await this.ContractAbi({contractAddress:u}),m=this.ExtractValueFromEvent({abi:y,event:d,eventName:p,eventValue:"candidate"});if(this.utils.FormatAddress(m)!==this.utils.FormatAddress(o))throw console.error("Mismatch: "+m+" :: "+o),console.error("Is target user address wallet created?"),Error("Access group method "+c+" failed. Is target user address wallet created?");return d.transactionHash},aa.AddAccessGroupMember=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o),await s({address:o,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"grantAccess",eventName:"MemberAdded"});if(!c){let d=await this.AccessGroupMembers({contractAddress:u});d.push(o),d=d.filter((y,m,v)=>v.indexOf(y)===m),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"members",metadata:d})}return p},aa.RemoveAccessGroupMember=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o);const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"revokeAccess",eventName:"MemberRevoked"});if(!c){let d=await this.AccessGroupMembers({contractAddress:u});return d=d.filter(y=>y!==o),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"members",metadata:d})}return p},aa.AddAccessGroupManager=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o),await s({address:o,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"grantManagerAccess",eventName:"ManagerAccessGranted"});if(!c){let d=await this.AccessGroupManagers({contractAddress:u});d.push(o),d=d.filter((y,m,v)=>v.indexOf(y)===m),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"managers",metadata:d})}return p},aa.RemoveAccessGroupManager=async function({contractAddress:u,memberAddress:o}){if(u=a(u),o=a(o),!await this.authClient.ContractHasMethod({contractAddress:u,methodName:"managersList"})){let d=await this.AccessGroupManagers({contractAddress:u});d=d.filter(y=>y!==o),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"managers",metadata:d})}return await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"revokeManagerAccess",eventName:"ManagerAccessRevoked"})},aa.ContentLibraryGroupPermissions=async function({libraryId:u,permissions:o=[]}){e(u);let c={};return!o||o.length===0?o=["accessor","contributor","reviewer"]:o=o.map(p=>{if(p=p.toLowerCase(),!["accessor","contributor","reviewer"].includes(p))throw Error(`Invalid permission: ${p}`);return p}),this.Log(`Retrieving ${o.join(", ")} group(s) for library ${u}`),await Promise.all(o.map(async p=>{let d=await this.CallContractMethod({contractAddress:this.utils.HashToAddress(u),methodName:p+"GroupsLength"});d=parseInt(d._hex,16),(await this.utils.LimitedMap(3,[...Array(d).keys()],async m=>{try{return this.utils.FormatAddress(await this.CallContractMethod({contractAddress:this.utils.HashToAddress(u),methodName:p+"Groups",methodArgs:[m]}))}catch(v){console.error(v)}})).forEach(m=>c[m]=[...c[m]||[],p].sort())})),c},aa.AddContentLibraryGroup=async function({libraryId:u,groupAddress:o,permission:c}){if(e(u),o=a(o),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Adding ${c} group ${o} to library ${u}`),(await this.ContentLibraryGroupPermissions({libraryId:u,permissions:[c]}))[o])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const d=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:`add${c}Group`,methodArgs:[o]}),y=await this.ContractAbi({id:u});await this.ExtractEventFromLogs({abi:y,event:d,eventName:`${c}GroupAdded`})},aa.RemoveContentLibraryGroup=async function({libraryId:u,groupAddress:o,permission:c}){if(e(u),o=a(o),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Removing ${c} group ${o} from library ${u}`),!(await this.ContentLibraryGroupPermissions({libraryId:u,permissions:[c]}))[o])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const d=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:`remove${c}Group`,methodArgs:[o]}),y=await this.ContractAbi({id:u});await this.ExtractEventFromLogs({abi:y,event:d,eventName:`${c}GroupRemoved`})},aa.ContentObjectGroupPermissions=async function({objectId:u}){t(u),this.Log(`Retrieving group permissions for object ${u}`);const o=this.utils.HashToAddress(u),c=await this.Collection({collectionType:"accessGroups"});let p;switch(await this.AccessType({id:u})){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 d={};return await Promise.all(c.map(async y=>{try{y=this.utils.FormatAddress(y);let m=await this.CallContractMethod({contractAddress:y,methodName:p,methodArgs:[o]});if(m===0)return;let v=[];m>=100&&v.push("manage"),m%100>=10&&v.push("access"),m%10>0&&v.push("see"),d[y]=v}catch(m){this.Log(`Failed to retrieve group permissions for ${y}`,!0),this.Log(m,!0)}})),d},aa.AddContentObjectGroupPermission=async function({objectId:u,groupAddress:o,permission:c}){if(r("permission",c),t(u),o=a(o),this.utils.EqualAddress(o,this.utils.HashToAddress(u)))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 ${o} for ${u}`),await this.SetGroupPermission({groupAddress:o,objectId:u,permission:c})},aa.RemoveContentObjectGroupPermission=async function({objectId:u,groupAddress:o,permission:c}){if(r("permission",c),t(u),o=a(o),c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Removing ${c} permission from group ${o} for ${u}`),await this.SetGroupPermission({groupAddress:o,objectId:u,permission:c,remove:!0})},aa.LinkAccessGroupToOauth=async function({groupAddress:u,kmsId:o,oauthConfig:c}){a(u),r("kmsId",o),r("oauthConfig",c),typeof c=="string"&&(c=JSON.parse(c));const{publicKey:p}=await this.authClient.KMSInfo({kmsId:o}),d=`eluv.jwtv.${o}`,y=await this.Crypto.EncryptConk(c,p),m=`eluv.jwtv.iusr${this.utils.AddressToHash(this.signer.address)}`,v=await this.EncryptECIES({message:c}),b=this.utils.AddressToObjectId(u),x=(await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:b})).write_token;await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,metadataSubtree:d,metadata:y}),await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,metadataSubtree:m,metadata:v}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,commitMessage:"Bind access group to OAuth"}),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!1]}),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!0]})},aa.UnlinkAccessGroupFromOauth=async function({groupAddress:u}){a(u),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!1]})},aa}var lr={},TO;function kJ(){if(TO)return lr;TO=1;const r=Sl,{ValidateAddress:e,ValidateParameters:t,ValidatePresence:a,ValidateObject:s,ValidateVersion:u}=Su(),o=gi();lr.ContractName=async function({contractAddress:y}){return y=e(y),await this.ethClient.ContractName(y)},lr.ContractAbi=async function({contractAddress:y,id:m}){const v=await this.authClient.ContractInfo({address:y,id:m});if(!v)throw Error(`Unable to determine contract info for ${y}`);return v.abi},lr.ContractInfo=async function({id:y,address:m}){return this.authClient.ContractInfo({id:y,address:m})},lr.FormatContractArguments=function({abi:y,methodName:m,args:v}){return this.ethClient.FormatContractArguments({abi:y,methodName:m,args:v})},lr.DeployContract=async function({abi:y,bytecode:m,constructorArgs:v,overrides:b={}}){return await this.ethClient.DeployContract({abi:y,bytecode:m,constructorArgs:v,overrides:b,signer:this.signer})},lr.ContractEvents=async function({contractAddress:y,abi:m,fromBlock:v=0,toBlock:b,count:x=1e3,topics:E,includeTransaction:C=!1}){y=e(y),m||(m=await this.ContractAbi({contractAddress:y}));const T=await this.FormatBlockNumbers({fromBlock:v,toBlock:b,count:x});return this.Log(`Querying contract events ${y} - Blocks ${T.fromBlock} to ${T.toBlock}`),await this.ethClient.ContractEvents({contractAddress:y,abi:m,fromBlock:T.fromBlock,toBlock:T.toBlock,topics:E,includeTransaction:C})},lr.CallContractMethod=async function({contractAddress:y,abi:m,methodName:v,methodArgs:b=[],value:x,overrides:E={},formatArguments:C=!0,cacheContract:T=!0,overrideCachedContract:k=!1}){return y=e(y),y=this.utils.FormatAddress(y),v==="setVisibility"&&this.visibilityInfo[y]&&delete this.visibilityInfo[y],m||(m=await this.ContractAbi({contractAddress:y})),await this.ethClient.CallContractMethod({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E,formatArguments:C,cacheContract:T,overrideCachedContract:k})},lr.CallContractMethodAndWait=async function({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E={},formatArguments:C=!0,cacheContract:T=!0,overrideCachedContract:k=!1}){return y=e(y),y=this.utils.FormatAddress(y),v==="setVisibility"&&this.visibilityInfo[y]&&delete this.visibilityInfo[y],m||(m=await this.ContractAbi({contractAddress:y})),await this.ethClient.CallContractMethodAndWait({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E,formatArguments:C,cacheContract:T,overrideCachedContract:k})},lr.ContractMetadata=async function({contractAddress:y,metadataKey:m}){a("contractAddress",y),a("metadataKey",m);try{const v=await this.CallContractMethod({contractAddress:y,methodName:"getMeta",methodArgs:[m]}),b=Buffer.from((v||"").replace("0x",""),"hex").toString("utf-8");try{return JSON.parse(b)}catch{return b}}catch{return""}},lr.MergeContractMetadata=async function({contractAddress:y,metadataKey:m,metadata:v}){a("contractAddress",y),a("metadataKey",m);const b=await this.ContractMetadata({contractAddress:y,metadataKey:m})||{};typeof b=="object"&&(v={...b,...v}),await this.CallContractMethodAndWait({contractAddress:y,methodName:"putMeta",methodArgs:[m,JSON.stringify(v)]})},lr.ReplaceContractMetadata=async function({contractAddress:y,metadataKey:m,metadata:v}){a("contractAddress",y),a("metadataKey",m),typeof v=="object"&&(v=JSON.stringify(v)),await this.CallContractMethodAndWait({contractAddress:y,methodName:"putMeta",methodArgs:[m,v]})},lr.CustomContractAddress=async function({libraryId:y,objectId:m,versionHash:v}){if(t({libraryId:y,objectId:m,versionHash:v}),v&&(m=this.utils.DecodeVersionHash(v).objectId),y===this.contentSpaceLibraryId||this.utils.EqualHash(y,m))return;this.Log(`Retrieving custom contract address: ${m}`);const b=await this.ContractAbi({id:m}),x=await this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(m),abi:b,methodName:"contentContractAddress",methodArgs:[]});if(x!==this.utils.nullAddress)return this.utils.FormatAddress(x)},lr.SetCustomContentContract=async function({libraryId:y,objectId:m,customContractAddress:v,name:b,description:x,abi:E,factoryAbi:C,overrides:T={}}){t({libraryId:y,objectId:m}),v=e(v),v=this.utils.FormatAddress(v),this.Log(`Setting custom contract address: ${m} ${v}`);const k=await this.ethClient.SetCustomContentContract({contentContractAddress:this.utils.HashToAddress(m),customContractAddress:v,overrides:T,signer:this.signer}),M=(await this.EditContentObject({libraryId:y,objectId:m})).write_token;return await this.ReplaceMetadata({libraryId:y,objectId:m,writeToken:M,metadataSubtree:"custom_contract",metadata:{name:b,description:x,address:v,abi:E,factoryAbi:C}}),await this.FinalizeContentObject({libraryId:y,objectId:m,writeToken:M,commitMessage:"Set custom contract"}),k},lr.ExtractEventFromLogs=function({abi:y,event:m,eventName:v}){return this.ethClient.ExtractEventFromLogs({abi:y,event:m,eventName:v})},lr.ExtractValueFromEvent=function({abi:y,event:m,eventName:v,eventValue:b}){const x=this.ethClient.ExtractEventFromLogs({abi:y,event:m,eventName:v,eventValue:b});return x?x.args[b]:void 0},lr.FormatBlockNumbers=async function({fromBlock:y,toBlock:m,count:v=10}){const b=await this.BlockNumber();return m?y||(y=m-v+1):y?m=y+v-1:(m=b,y=m-v+1),m>b&&(m=b),y<0&&(y=0),{fromBlock:y,toBlock:m}},lr.Events=async function({toBlock:y,fromBlock:m,count:v=10,includeTransaction:b=!1}={}){const x=await this.FormatBlockNumbers({fromBlock:m,toBlock:y,count:v});return this.Log(`Querying events - Blocks ${x.fromBlock} to ${x.toBlock}`),await this.ethClient.Events({fromBlock:x.fromBlock,toBlock:x.toBlock,includeTransaction:b})},lr.BlockNumber=async function(){return await this.ethClient.MakeProviderCall({methodName:"getBlockNumber"})},lr.GetBalance=async function({address:y}){y=e(y);const m=await this.ethClient.MakeProviderCall({methodName:"getBalance",args:[y]});return r.utils.formatEther(m)},lr.SendFunds=async function({recipient:y,ether:m}){return y=e(y),await(await this.signer.sendTransaction({to:y,value:r.utils.parseEther(m.toString())})).wait()};const c=async function({contractAddress:y,objectId:m,versionHash:v}){if(y)e(y),m=o.AddressToObjectId(y);else if(v)u(v),m=this.utils.DecodeVersionHash(v).objectId,y=o.HashToAddress(m);else if(m)s(m),y=o.HashToAddress(m);else throw Error("contractAddress or objectId or versionHash not specified");return{contractAddress:y,objectId:m}};lr.TenantId=async function({contractAddress:y,objectId:m,versionHash:v}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;let b;try{if(await this.authClient.ContractHasMethod({contractAddress:y,methodName:"getMeta"})&&(b=await this.ContractMetadata({contractAddress:y,metadataKey:"_tenantId"})),b===void 0){const E=await this.ContentObjectLibraryId({objectId:m});b=await this.ContentObjectMetadata({libraryId:E,objectId:m,metadataSubtree:"tenantId"})}return b}catch{return""}},lr.TenantContractId=async function({contractAddress:y,objectId:m,versionHash:v}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;try{const b=await this.authClient.ContractHasMethod({contractAddress:y,methodName:"getMeta"});let x;if(b&&(x=await this.ContractMetadata({contractAddress:y,metadataKey:"_ELV_TENANT_ID"})),x===void 0){const E=await this.ContentObjectLibraryId({objectId:m});x=await this.ContentObjectMetadata({libraryId:E,objectId:m,metadataSubtree:"tenantContractId"})}return x}catch{return""}},lr.SetTenantId=async function({contractAddress:y,objectId:m,versionHash:v,tenantId:b}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;const x=await this.authClient.AccessType(m);if(x!==this.authClient.ACCESS_TYPES.GROUP&&x!==this.authClient.ACCESS_TYPES.WALLET&&x!==this.authClient.ACCESS_TYPES.LIBRARY&&x!==this.authClient.ACCESS_TYPES.TYPE&&x!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${m},
|
|
330
330
|
applicable only for wallet,group, library or content_type object.`);if(s(b),!b.startsWith("iten")||!o.ValidHash(b))throw Error(`Invalid tenant ID: ${b}`);if(await this.authClient.AccessType(b)!==this.authClient.ACCESS_TYPES.GROUP)throw Error("Invalid tenant ID: "+b);if(tenantContractId=await this.TenantContractId({objectId:b}),tenantContractId)return await this.SetTenantContractId({contractAddress:y,objectId:m,versionHash:v,tenantContractId});throw Error("Invalid tenantId: tenant contract id not found")},lr.SetTenantContractId=async function({contractAddress:y,objectId:m,versionHash:v,tenantContractId:b}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;const x=await this.authClient.AccessType(m);if(x!==this.authClient.ACCESS_TYPES.GROUP&&x!==this.authClient.ACCESS_TYPES.WALLET&&x!==this.authClient.ACCESS_TYPES.LIBRARY&&x!==this.authClient.ACCESS_TYPES.TYPE&&x!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${m},
|
|
@@ -377,4 +377,4 @@ ${W.length}${W}`,"utf-8")),ye=e.utils.recoverAddress(se,O);return{type:M,message
|
|
|
377
377
|
left=${E}
|
|
378
378
|
`);return T&&window.focus&&T.focus(),T};return rp.ActionPopup=async({mode:o="tab",url:c,onMessage:p,onCancel:d})=>{await new Promise(y=>{const m=o==="popup"?u({url:c,title:"Eluvio Media Wallet",w:500,h:850}):window.open(c),v=setInterval(async()=>{m.closed&&(clearInterval(v),d&&await d(),y())},1e3);window.addEventListener("message",async b=>{await p(b,()=>{clearInterval(v),m.close(),y()})})})},rp}var sn={},nL;function uee(){if(nL)return sn;nL=1;const r=gi(),e=vi(),{FormatNFTDetails:t,FormatNFTMetadata:a,FormatNFT:s}=XI(),u=FP();return sn.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}},sn.UserAddress=function(){if(this.loggedIn)return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr},sn.UserWalletBalance=async function(o=!1){if(!this.loggedIn)return;const{balance:c,usage_hold:p,payout_hold:d,locked_offer_balance:y,stripe_id:m,stripe_payouts_enabled:v}=await this.client.utils.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","bal"),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})),b=m,x=v,E=parseFloat(c||0),C=parseFloat(y||0),T=Math.max(0,E-parseFloat(p||0)-C),k=Math.max(0,E-T),M=Math.max(0,E-parseFloat(Math.max(d,C)||0));if(o&&m&&!v){const O=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:O.toString(),return_url:O.toString()},headers:{Authorization:`Bearer ${this.AuthToken()}`}}),await this.UserWalletBalance(!1)}let R={totalWalletBalance:E,availableWalletBalance:T,lockedWalletBalance:C,pendingWalletBalance:k,withdrawableWalletBalance:M};return x&&(R.userStripeId=b,R.userStripeEnabled=x),R},sn.UserItemNames=async function({marketplaceParams:o,userAddress:c}={}){let p=[];return o&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),c&&p.push(`wlt:eq:${r.FormatAddress(c)}`),await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","names"),method:"GET",queryParams:{filter:p}}))},sn.UserItemEditionNames=async function({displayName:o}){return await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","editions"),method:"GET",queryParams:{filter:`meta/display_name:eq:${o}`}}))},sn.UserItemAttributes=async function({marketplaceParams:o,displayName:c,userAddress:p}={}){let d=[];return o&&d.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),p&&d.push(`wlt:eq:${r.FormatAddress(p)}`),c&&d.push(`meta/display_name:eq:${c}`),(await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","attributes"),method:"GET",queryParams:{filter:d}}))).map(({trait_type:m,values:v})=>({name:m,values:v})).filter(({name:m})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(m))},sn.UserItems=async function({sortBy:o="default",includeFullMetadata:c=!1}={}){return c&&this.loggedIn?this.FilteredQuery({mode:"owned-full-meta",sortBy:o,...arguments[0]||{}}):this.FilteredQuery({mode:"owned",sortBy:o,...arguments[0]||{}})},sn.UserListings=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,marketplaceParams:m}={}){return(await this.FilteredQuery({mode:"listings",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:m,contractAddress:d,tokenId:y,includeCheckoutLocked:!0})).results},sn.UserSales=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b,marketplaceParams:x}={}){return(await this.FilteredQuery({mode:"sales",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),startTime:m,endTime:v,lastNDays:b,marketplaceParams:x,contractAddress:d,tokenId:y})).results},sn.UserTransfers=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b,marketplaceParams:x}={}){return(await this.FilteredQuery({mode:"transfers",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:x,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b})).results},sn.TenantConfiguration=async function({tenantId:o,contractAddress:c}){try{return c=c?r.FormatAddress(c):void 0,this.tenantConfigs[c||o]||(this.tenantConfigs[c||o]=await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:c?e("as","config","nft",c):e("as","config","tnt",o),method:"GET"}))),this.tenantConfigs[c||o]}catch(p){return this.Log("Failed to load tenant configuration",!0,p),{}}},sn.ExchangeRate=async function({currency:o}){if(!o)throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","xr","ebanx",o),method:"GET"}))},sn.TenantCSS=async function({tenantSlug:o}){return this.cachedCSS[o]||(this.cachedCSS[o]=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("/public","asset_metadata","tenants",o,"info","branding","wallet_css"),authorizationToken:this.publicStaticToken})),this.cachedCSS[o]||""},sn.MarketplaceStock=async function({marketplaceParams:o,tenantId:c}){return c||(c=this.MarketplaceInfo({marketplaceParams:o}).tenantId),this.loggedIn?await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","nft","info",c),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","stock",c),method:"GET"}))},sn.MarketplaceInfo=function({marketplaceParams:o}){let{tenantSlug:c,marketplaceSlug:p,marketplaceId:d,marketplaceHash:y}=o||{},m;if(c&&p?m=(this.availableMarketplaces[c]||{})[p]:(d=y?this.client.utils.DecodeVersionHash(y).objectId:d,m=this.availableMarketplacesById[d]),!m)throw Error(`Eluvio Wallet Client: Unable to find marketplace with parameters ${JSON.stringify(arguments)}`);return m},sn.MarketplaceCSS=async function({marketplaceParams:o}){const p=this.MarketplaceInfo({marketplaceParams:o}).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]||""},sn.AvailableMarketplaces=async function({organizeById:o,forceReload:c=!1}={}){return c&&await this.LoadAvailableMarketplaces(!0),{...o?this.availableMarketplacesById:this.availableMarketplaces}},sn.Marketplace=async function({marketplaceParams:o}){return this.LoadMarketplace(o)},sn.NFTContractStats=async function({contractAddress:o}){return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",o),method:"GET"}))},sn.NFT=async function({tokenId:o,contractAddress:c}){let p=t(await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",c,o),method:"GET"})));const d=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:"public/asset_metadata/nft",produceLinkUrls:!0})||{};if(p.metadata=u({},d,p.metadata,(y,m)=>m===null||m===""?y:void 0),this.localization){const y=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:e("public","asset_metadata","localizations",this.localization,"nft"),produceLinkUrls:!0})||{};p.metadata=u({},p.metadata,y,(m,v)=>v===null||v===""?m:void 0)}return p.config=await this.TenantConfiguration({contractAddress:c}),a(this,p)},sn.TransferNFT=async function({contractAddress:o,tokenId:c,targetAddress:p}){if(!p||!r.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:r.FormatAddress(o),token:c,to_addr:r.FormatAddress(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.ListingStatus=async function({listingId:o}){try{return await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","status",o),method:"GET"}))}catch(c){if(c.status===404)return;throw c}},sn.Listing=async function({listingId:o}){return s(this,await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","l",o),method:"GET"})))},sn.Listings=async function(){return this.FilteredQuery({mode:"listings",...arguments[0]||{}})},sn.ListingStats=async function(){return this.FilteredQuery({mode:"listing-stats",...arguments[0]||{}})},sn.Sales=async function(){return this.FilteredQuery({mode:"sales",...arguments[0]||{}})},sn.Transfers=async function(){return this.FilteredQuery({mode:"transfers",...arguments[0]||{}})},sn.SalesStats=async function(){return this.FilteredQuery({mode:"sales-stats",...arguments[0]||{}})},sn.Leaderboard=async function({userAddress:o,marketplaceParams:c}){if(o){let p={addr:r.FormatAddress(o)};return c&&(p.filter=[`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:c})).tenantId}`]),(await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","ranks"),method:"GET",queryParams:p}))||[])[0]}return this.FilteredQuery({mode:"leaderboard",...arguments[0]||{}})},sn.CreateListing=async function({contractAddress:o,tokenId:c,price:p,listingId:d}){return o=r.FormatAddress(o),d?await r.ResponseToFormat("text",await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"PUT",body:{id:d,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"POST",body:{contract:o,token:c,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.RemoveListing=async function({listingId:o}){await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt",o),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.SalesNames=async function({marketplaceParams:o}){let c;return o&&(c=(await this.MarketplaceInfo({marketplaceParams:o})).tenantId),await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names","hst"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},sn.ListingNames=async function({marketplaceParams:o}){let c;return o&&(c=(await this.MarketplaceInfo({marketplaceParams:o})).tenantId),await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},sn.ListingEditionNames=async function({displayName:o}){return await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","editions"),queryParams:{filter:`nft/display_name:eq:${o}`},method:"GET"}))},sn.ListingAttributes=async function({marketplaceParams:o,displayName:c}={}){let p=[];return o&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),c&&p.push(`nft/display_name:eq:${c}`),(await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","attributes"),method:"GET",queryParams:{filter:p}}))).map(({trait_type:y,values:m})=>({name:y,values:m})).filter(({name:y})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(y))},sn.ClaimGift=async function({code:o}){return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","gifts","claim"),body:{otp_code:o},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.ClaimItem=async function({marketplaceParams:o,sku:c,email:p}){const d=await this.MarketplaceInfo({marketplaceParams:o});await this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","act",d.tenant_id),body:{op:"nft-claim",sid:d.marketplaceId,sku:c,email:p},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.PurchaseItem=async function({marketplaceParams:o,sku:c,confirmationId:p,successUrl:d,cancelUrl:y}){const m=await this.MarketplaceInfo({marketplaceParams:o});window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:m.marketplaceId,parameters:{sku:c,confirmationId:p,successUrl:d,cancelUrl:y,login:!0,auth:this.ClientAuthToken()}})},sn.PurchaseListing=async function({marketplaceParams:o,listingId:c,confirmationId:p,successUrl:d,cancelUrl:y}){let m;o&&(m=await this.MarketplaceInfo({marketplaceParams:o})),window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:m&&m.marketplaceId,parameters:{listingId:c,confirmationId:p,successUrl:d,cancelUrl:y,login:!0,auth:this.ClientAuthToken()}})},sn.ListingPurchaseStatus=async function({listingId:o,confirmationId:c}){try{const p=await this.ListingStatus({listingId:o});if(!p)throw Error("Unable to find info for listing "+o);return(await this.MintingStatus({tenantId:p.tenant})).find(y=>y.op==="nft-transfer"&&y.extra&&y.extra[0]===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.PurchaseStatus=async function({marketplaceParams:o,confirmationId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o});return(await this.MintingStatus({tenantId:p.tenantId})).find(y=>y.op==="nft-buy"&&y.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.ClaimStatus=async function({marketplaceParams:o,sku:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o});return(await this.MintingStatus({tenantId:p.tenantId})).find(y=>y.op==="nft-claim"&&y.marketplaceId===p.marketplaceId&&y.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.GiftClaimStatus=async function({marketplaceParams:o,confirmationId:c,giftId:p}){try{const d=await this.MarketplaceInfo({marketplaceParams:o}),m=(await this.MintingStatus({tenantId:d.tenantId})).filter(v=>v.op==="nft-transfer"&&(c&&v.confirmationId===c||p&&v.giftId===p))||{status:"none"};return m.length===0?{status:"none"}:m.find(v=>v.status==="failed")?{status:"failed",op:"nft-transfer",transfer_statuses:m}:m.find(v=>v.status!=="complete")?{status:"pending",op:"nft-transfer",transfer_statuses:m}:{status:"complete",op:"nft-transfer",transfer_statuses:m,items:m.map(v=>({token_addr:v.address,token_id_str:v.tokenId}))}}catch(d){return this.Log(d,!0),{status:"unknown"}}},sn.EntitlementClaimStatus=async function({marketplaceParams:o,purchaseId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o}),y=(await this.MintingStatus({tenantId:p.tenantId})).filter(m=>m.op==="nft-claim-entitlement"&&c&&c==m.confirmationId)||{status:"none"};return y.length===0?{status:"none"}:y.find(m=>m.status==="complete")?{status:"complete",op:"nft-claim-entitlement",items:[{token_addr:y[0].address,token_id:y[0].tokenId}]}:y.find(m=>m.status==="error")?{status:"error",op:"nft-claim-entitlement"}:{status:"pending",op:"nft-claim-entitlement"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.PackOpenStatus=async function({contractAddress:o,tokenId:c}){try{const p=await this.TenantConfiguration({contractAddress:o});return(await this.MintingStatus({tenantId:p.tenant})).find(y=>y.op==="nft-open"&&r.EqualAddress(o,y.address)&&y.tokenId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.CollectionRedemptionStatus=async function({marketplaceParams:o,confirmationId:c}){try{return(await this.MintingStatus({marketplaceParams:o})).find(d=>d.op==="nft-redeem"&&d.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.RedeemableOfferStatus=async function({tenantId:o,marketplaceParams:c,contractAddress:p,tokenId:d,offerId:y}){try{const m=await this.MintingStatus({marketplaceParams:c,tenantId:o});return p=r.FormatAddress(p),m.find(v=>v.op==="nft-offer-redeem"&&r.EqualAddress(v.address,p)&&v.tokenId===(d||"").toString()&&v.offerId===(y||"").toString())||{status:"none"}}catch(m){return this.Log(m,!0),{status:"unknown"}}},sn.RedeemableCustomFulfillmentInfo=async function({redeemableTransactionId:o}){return await r.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:e("code-fulfillment",this.network==="main"?"main":"demov3","fulfill",o),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.LoadDrop=async function({tenantSlug:o,eventSlug:c,dropId:p}){if(this.drops||(this.drops={}),this.drops[o]||(this.drops[o]={}),this.drops[o][c]||(this.drops[o][c]={}),!this.drops[o][c][p]){const d=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("public","asset_metadata","tenants",o,"sites",c,"info"),resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,produceLinkUrls:!0,select:[".","drops"],noAuth:!0})||[],y=r.DecodeVersionHash(d["."].source).objectId;d.drops.forEach(m=>{m={...m,eventId:y},this.drops[o][c][m.uuid]=m,this.drops[m.uuid]=m})}return this.drops[p]},sn.SubmitDropVote=async function({marketplaceParams:o,eventId:c,dropId:p,sku:d}){const y=await this.MarketplaceInfo({marketplaceParams:o});await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",y.tenant_id),method:"POST",body:{op:"vote-drop",evt:c,id:p,itm:d},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.DropStatus=async function({marketplace:o,eventId:c,dropId:p}){try{return(await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",o.tenant_id,c,p),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).sort((y,m)=>y.ts>m.ts?1:-1)[0]||{status:"none"}}catch(d){return this.Log(d,!0),""}},sn.MarketplaceOffers=async function({contractAddress:o,tokenId:c,buyerAddress:p,sellerAddress:d,statuses:y,start:m=0,limit:v=10}){let b=e("as","mkt","offers","ls");p?b=e(b,"b",r.FormatAddress(p)):d&&(b=e(b,"s",r.FormatAddress(d))),o&&(b=e(b,"c",r.FormatAddress(o)),c&&(b=e(b,"t",c)));let x={start:m,limit:v};return y&&y.length>0&&(x.include=y.join(",")),(await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:b,method:"GET",queryParams:x}))).map(C=>({...C,created:C.created*1e3,updated:C.updated*1e3,expiration:C.expiration*1e3}))},sn.CreateMarketplaceOffer=async function({contractAddress:o,tokenId:c,offerId:p,price:d,expiresAt:y}){let m;return p?m=await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",p),method:"PUT",body:{price:d,expiration:Math.floor(y/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):m=await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",o,c),method:"POST",body:{contract:o,token:c,price:d,expiration:Math.floor(y/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})),m.offer_id},sn.RemoveMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",o),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.AcceptMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","accept",o),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.RejectMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","decline",o),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.VoteStatus=async function({tenantId:o,votingEventId:c}){return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.CastVote=async function({tenantId:o,votingEventId:c,sku:p}){return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c,p),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.RevokeVote=async function({tenantId:o,votingEventId:c,sku:p}){return await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c,p),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn}var ap={},rL;function lee(){if(rL)return ap;rL=1;const r=gi(),e=vi(),t=({network:s,path:u})=>e(s==="main"?"/main":"/dv3",u),a=({network:s,appId:u,userAddress:o,key:c,type:p,mode:d})=>t({network:s,path:e(p==="app"?"app":"usr",p==="app"?u:"",o,d==="public"?"pub":"pri",c||"")});return ap.ProfileMetadata=async function({type:s="app",mode:u="public",appId:o,userAddress:c,key:p}){try{const d=await this.stateStoreClient.Request({path:a({network:this.network,appId:o||this.appId,userAddress:c||this.UserAddress(),type:s,mode:u,key:p}),headers:u==="private"?{Authorization:`Bearer ${this.AuthToken()}`}:void 0});if(!d.ok)throw d;return(await r.ResponseToJson(d))[p]}catch(d){if(d.status===404)return;throw d}},ap.SetProfileMetadata=async function({type:s="app",mode:u="public",appId:o,key:c,value:p}){await this.stateStoreClient.Request({method:"POST",path:a({network:this.network,appId:o||this.appId,userAddress:this.UserAddress(),type:s,mode:u,key:c}),body:p,bodyType:typeof p=="object"?"JSON":"string",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ap.RemoveProfileMetadata=async function({type:s="app",mode:u="public",appId:o,key:c}){await this.stateStoreClient.Request({method:"DELETE",path:a({network:this.network,appId:o||this.appId,userAddress:this.UserAddress(),type:s,mode:u,key:c}),headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ap.Profile=async function({userAddress:s,userName:u}){if(u&&(s=await this.UserNameToAddress({userName:u})),!s)throw Error("Eluvio Wallet Client: Unable to determine profile - user address not specified");u||(u=await this.ProfileMetadata({type:"user",userAddress:s,key:"username"}));const o=await this.ProfileMetadata({type:"user",userAddress:s,key:"icon_url"});let c=await this.ProfileMetadata({type:"app",mode:"public",appId:"elv-badge-srv",userAddress:this.badgerAddress,key:`badges_${r.FormatAddress(s)}`}),p=[];if(c)try{c=JSON.parse(c).badges,p=Object.keys(c).map(d=>({...c[d],name:d}))}catch(d){this.Log(`Failed to load badge info for ${u||s}`,!0),this.Log(d,!0)}return{userAddress:r.FormatAddress(s),userName:u,imageUrl:o,badges:p}},ap.UserNameToAddress=async function({userName:s}){try{const u=await this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("usr","profile_for_username",s)})});if(!u.ok)throw u;return(await r.ResponseToJson(u)).address}catch(u){if(u.status!==404)throw u}},ap}var ag={},aL;function cee(){if(aL)return ag;aL=1;const r=gi(),e=vi(),t=({network:a,path:s})=>e("/push",a==="main"?"/main":"/dv3",s);return ag.PushNotification=async function({tenantId:a,eventType:s,data:u,userAddress:o}){await this.stateStoreClient.Request({method:"POST",path:t({network:this.network,path:e("notify_user",o||this.UserAddress(),a,s)}),body:u,headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ag.AddNotificationListener=async function({onMessage:a}){if(!a)throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");const s=new URL(this.stateStoreClient.BaseURI().toString());s.pathname=t({network:this.network,path:e("register",this.UserAddress(),this.AuthToken())});const u=new EventSource(s);return u.onmessage=o=>{let c=JSON.parse(o.data);try{c.data=JSON.parse(c.data)}catch{}a(c)},u},ag.Notifications=async function({tenantId:a,types:s,offsetId:u,limit:o=10}={}){let c={limit:o};a&&(c.tenant_id=a),s&&(c.types=Array.isArray(s)?s.join(","):s),u&&(c.offset_by=u);const{records:p}=await r.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(d=>{try{d.data=JSON.parse(d.data)}catch{}return d})},ag}var iL;function fee(){if(iL)return JE;iL=1;const{ElvClient:r}=QI(),e=oee(),{LinkTargetHash:t,FormatNFT:a,ActionPopup:s}=XI(),u=If(),o=vi(),c=gi(),p=Sl,d=typeof window<"u",y=d&&window.top!==window.self;let m=!1;try{typeof localStorage<"u"&&localStorage.getItem("test"),m=!0}catch{}class v{constructor({appId:x,client:E,network:C,mode:T,localization:k,marketplaceInfo:M,previewMarketplaceHash:R,storeAuthToken:O}){this.appId=x,this.client=E,this.loggedIn=!1,this.localization=k,this.network=C,this.mode=T,this.purchaseMode=e[C][T].purchaseMode,this.mainSiteLibraryId=e[C][T].siteLibraryId,this.mainSiteId=e[C][T].siteId,this.appUrl=e[C][T].appUrl,this.publicStaticToken=E.staticToken,this.storeAuthToken=O,this.selectedMarketplaceInfo=M,this.previewMarketplaceId=R?c.DecodeVersionHash(R).objectId:void 0,this.previewMarketplaceHash=R,this.availableMarketplaces={},this.availableMarketplacesById={},this.marketplaceHashes={},this.tenantConfigs={},this.stateStoreUrls=e[C].stateStoreUrls,this.stateStoreClient=new u({uris:this.stateStoreUrls}),this.badgerAddress=e[C].badgerAddress,this.cachedMarketplaces={},this.cachedCSS={},this.utils=E.utils,this.ForbiddenMethods=v.ForbiddenMethods}Log(x,E=!1,C){E?console.error("Eluvio Wallet Client:",x):console.log("Eluvio Wallet Client:",x),C&&console.error(C)}static ForbiddenMethods(){return["constructor","Authenticate","AuthenticateOAuth","AuthenticateExternalWallet","AuthToken","ClientAuthToken","Initialize","Log","LogIn","LogOut","PersonalSign","SetAuthorization","SignMetamask"]}static AllowedMethods(){return Object.getOwnPropertyNames(v.prototype).filter(x=>!v.ForbiddenMethods().includes(x)).sort()}static async Initialize({client:x,appId:E="general",network:C="main",mode:T="production",localization:k,marketplaceParams:M,previewMarketplaceId:R,storeAuthToken:O=!0,skipMarketplaceLoad:W=!1}){let{tenantSlug:Z,marketplaceSlug:se,marketplaceId:ye,marketplaceHash:he}=M||{};if(e[C]){if(!e[C][T])throw Error(`ElvWalletClient: Invalid mode ${T}`)}else throw Error(`ElvWalletClient: Invalid network ${C}`);x||(x=await r.FromNetworkName({networkName:C,assumeV3:!0}));let te=R;te&&!te.startsWith("hq__")&&(te=await x.LatestVersionHash({objectId:R}));const re=new v({appId:E,client:x,network:C,mode:T,localization:k,marketplaceInfo:{tenantSlug:Z,marketplaceSlug:se,marketplaceId:he?x.utils.DecodeVersionHash(he).objectId:ye,marketplaceHash:he},previewMarketplaceHash:te,storeAuthToken:O});if(d&&window.location&&window.location.href){let S=new URL(window.location.href);if(S.searchParams.get("elvToken"))await re.Authenticate({token:S.searchParams.get("elvToken")}),S.searchParams.delete("elvToken"),window.history.replaceState("","",S);else if(O&&m)try{let _=localStorage.getItem(`__elv-token-${C}`);_&&await re.Authenticate({token:_})}catch{}}return W||re.LoadAvailableMarketplaces(),re}CanSign(){return this.loggedIn?!!this.__authorization.clusterToken||d&&!!(this.UserInfo().walletName.toLowerCase()==="metamask"&&window.ethereum&&window.ethereum.isMetaMask&&window.ethereum.chainId):!1}async PersonalSign({message:x}){if(!this.loggedIn)throw Error("ElvWalletClient: Unable to perform signature - Not logged in");if(this.CanSign()){if(this.__authorization.clusterToken)return x=typeof x=="object"?JSON.stringify(x):x,x=p.utils.keccak256(Buffer.from(`Ethereum Signed Message:
|
|
379
379
|
${x.length}${x}`,"utf-8")),await this.client.authClient.Sign(x);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:x,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!d)throw Error("ElvWalletClient: Unable to sign");const E={action:"personal-sign",message:x,logIn:!0};let C=new URL(this.appUrl);if(C.hash=o("/action","sign",c.B58(JSON.stringify(E))),C.searchParams.set("origin",window.location.origin),!y&&window.location.origin===C.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(T,k)=>{await s({mode:"tab",url:C.toString(),onCancel:()=>k("User cancelled sign"),onMessage:async(M,R)=>{if(!(!M||!M.data||M.data.type!=="FlowResponse"))try{T(M.data.response)}catch(O){k(O)}finally{R()}}})})}async LogInURL({mode:x="login",provider:E,marketplaceParams:C,clearLogin:T}){let k=new URL(this.appUrl);return k.hash="/login",k.searchParams.set("action","login"),typeof window<"u"&&k.searchParams.set("origin",window.location.origin),E&&k.searchParams.set("provider",E),x&&k.searchParams.set("mode",x),C?k.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:C})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&k.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),T&&k.searchParams.set("clear",""),k}async LogIn({method:x="redirect",provider:E,mode:C="login",callbackUrl:T,marketplaceParams:k,clearLogin:M=!1,callback:R}){let O=await this.LogInURL({mode:C,provider:E,marketplaceParams:k,clearLogin:M});x==="redirect"?(O.searchParams.set("response","redirect"),O.searchParams.set("source","origin"),O.searchParams.set("redirect",T),window.location=O):(O.searchParams.set("response","message"),O.searchParams.set("source","parent"),await new Promise(async(W,Z)=>{await s({mode:"tab",url:O.toString(),onCancel:()=>Z("User cancelled login"),onMessage:async(se,ye)=>{if(!(!se||!se.data||se.data.type!=="LoginResponse"))try{R?await R(se.data.params):await this.Authenticate({token:se.data.params.clientSigningToken||se.data.params.clientAuthToken}),W()}catch(he){Z(he)}finally{ye()}}})}))}async LogOut(){if(this.__authorization&&(this.__authorization.nonce||this.__authorization.installId))try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(x){this.Log("Failed to release token",!0,x)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},m)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!(this.__authorization.nonce||this.__authorization.installId)?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:x}){let E;try{E=JSON.parse(this.utils.FromB58ToStr(x))||{}}catch{throw new Error("Invalid authorization token "+x)}if(!E.expiresAt||Date.now()>E.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return E.clusterToken&&await this.client.SetRemoteSigner({authToken:E.clusterToken,signerURIs:E.signerURIs}),this.client.SetStaticToken({token:E.fabricToken}),this.SetAuthorization({...E})}async AuthenticateOAuth({idToken:x,userIdCode:E,tenantId:C,email:T,signerURIs:k,shareEmail:M=!1,extraData:R={},nonce:O,installId:W,appName:Z,createRemoteToken:se=!0,force:ye=!1,tokenDuration:he=24}){!C&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),C=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:x,userIdCode:E,tenantId:C,signerURIs:k,extraData:{...R,share_email:M},unsignedPublicAuth:!0});let te,re,S;if(se&&this.client.signer.remoteSigner){S=Date.now()+he*60*60*1e3;const P=await this.client.signer.RetrieveCSAT({email:T,nonce:O,installId:W,appName:Z,tenantId:C,force:ye,duration:he});te=P.token,O=P.nonce||O,W=P.installId||W,re=P.refresh_token}else S=Date.now()+he*60*60*1e3,te=await this.client.CreateFabricToken({duration:parseInt(he*60*60*1e3),context:T?{usr:{email:T}}:{}});const _=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!T&&x)try{T=JSON.parse(this.utils.FromB64URL(x.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:te}),{authToken:this.SetAuthorization({fabricToken:te,refreshToken:re,tenantId:C,address:_,email:T,expiresAt:S,signerURIs:k,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:O,installId:W}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:te,refreshToken:re,tenantId:C,address:_,email:T,expiresAt:S,signerURIs:k,walletType:"Custodial",walletName:"Eluvio",nonce:O,installId:W})}}async AuthenticateExternalWallet({address:x,tokenDuration:E=24,walletName:C="Metamask",Sign:T}){x||(x=window.ethereum.selectedAddress),x=this.utils.FormatAddress(x),T||(T=async R=>this.SignMetamask({message:R,address:x}));const k=Date.now()+E*60*60*1e3,M=await this.client.CreateFabricToken({address:x,duration:E*60*60*1e3,Sign:T,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:M,address:x,expiresAt:k,walletType:"External",walletName:C,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:x,fabricToken:E,refreshToken:C,tenantId:T,address:k,email:M,expiresAt:R,signerURIs:O,walletType:W,walletName:Z,nonce:se,installId:ye,register:he=!1}){k=this.client.utils.FormatAddress(k),this.__authorization={fabricToken:E,refreshToken:C,tenantId:T,address:k,email:M,expiresAt:R,walletType:W,walletName:Z,nonce:se,installId:ye},x&&(this.__authorization.clusterToken=x,O&&(this.__authorization.signerURIs=O)),this.loggedIn=!0,this.cachedMarketplaces={};const te=this.ClientAuthToken();if(this.storeAuthToken&&m)try{localStorage.setItem(`__elv-token-${this.network}`,te)}catch{}return he&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(re=>{this.Log("Failed to register account: ",!0,re)}),te}async SignMetamask({message:x,address:E}){if(!d||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");E=E||this.UserAddress();const C=await window.ethereum.request({method:"eth_requestAccounts"});if(E&&!c.EqualAddress(C[0],E))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${E}, got ${C[0]}`);return await window.ethereum.request({method:"personal_sign",params:[x,E,""]})}FlowURL({type:x="flow",flow:E,marketplaceId:C,parameters:T={}}){const k=new URL(this.appUrl);return C?k.pathname=o("/",x,E,"marketplace",C,c.B58(JSON.stringify(T))):k.pathname=o("/",x,E,c.B58(JSON.stringify(T))),k.searchParams.set("origin",window.location.origin),k.toString()}async GenerateCodeAuth({url:x}={}){x||(x=await this.LogInURL({mode:"login"}),x.searchParams.set("response","code"),x.searchParams.set("source","code"));const E=await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:x.toString()}}));return E.code=E.id,E.url=E.url.startsWith("https://")?E.url:`https://${E.url}`,E.metamask_url=E.metamask_url.startsWith("https://")?E.metamask_url:`https://${E.metamask_url}`,E}async SetCodeAuth({code:x,address:E,type:C,authToken:T,expiresAt:k,...M}){await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","session",x),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:x,format:"auth_token",payload:JSON.stringify({addr:c.FormatAddress(E),eth:E?`ikms${c.AddressToHash(E)}`:"",type:C,token:T,expiresAt:k,...M})}}))}async GetCodeAuth({code:x,passcode:E}){try{return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask",x,E),method:"GET"}))}catch(C){if(C&&C.status===404)return;throw C}}async TopLevelInfo(x=!1){return(!this.topLevelInfoPromise||x)&&(this.topLevelInfoPromise=this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({path:"/as/mw/toplevel",queryParams:{env:this.mode}}))),await this.topLevelInfoPromise}async LoadAvailableMarketplaces(x=!1){(!this.availableMarketplacesPromise||x)&&(this.availableMarketplacesPromise=new Promise(async E=>{const T=(await this.TopLevelInfo()).marketplaces;let k={...this.availableMarketplaces||{}},M={...this.availableMarketplacesById||{}};T.map(R=>{const O=c.DecodeVersionHash(R.source_hash).objectId,W=R.slug||R.name;k[R.tenant_slug]=k[R.tenant_slug]||{},k[R.tenant_slug][W]={...R,tenantName:R.tenant_slug,tenantSlug:R.tenant_slug,tenantId:R.tenant_id,marketplaceSlug:W,marketplaceId:O,marketplaceHash:R.source_hash},M[O]=k[R.tenant_slug][W],this.marketplaceHashes[O]=R.source_hash}),this.availableMarketplaces=k,this.availableMarketplacesById=M,E()})),await this.availableMarketplacesPromise}async LatestMarketplaceHash({marketplaceParams:x}){const E=await this.MarketplaceInfo({marketplaceParams:x});if(this.previewMarketplaceId&&c.EqualHash(this.previewMarketplaceId,E.marketplaceId))return this.previewMarketplaceHash;const C=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug),resolveLinks:!1,noAuth:!0});return t(C)}async LoadMarketplace(x){await this.LoadAvailableMarketplaces();const E=this.MarketplaceInfo({marketplaceParams:x}),C=E.marketplaceId,T=await this.LatestMarketplaceHash({marketplaceParams:x});if(this.cachedMarketplaces[C]&&this.cachedMarketplaces[C].versionHash!==T&&delete this.cachedMarketplaces[C],!this.cachedMarketplaces[C]){let k;this.previewMarketplaceId&&c.EqualHash(C,this.previewMarketplaceId)?k=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?o("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):k=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug,"info"),localizationSubtree:this.localization?o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),k.branding.use_tenant_styling&&(k.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),k.items=await Promise.all(k.items.map(async(M,R)=>{if(M.requires_permissions){let O;this.loggedIn||(O=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:t(M.nft_template),metadataSubtree:"permissioned",authorizationToken:O}),M.authorized=!0}catch{M.authorized=!1}}return M.nftTemplateMetadata=(M.nft_template||{}).nft||{},M.nftTemplateHash=((M.nft_template||{})["."]||{}).source,M.itemIndex=R,M})),k.collections=(k.collections||[]).map((M,R)=>({...M,collectionIndex:R})),k.retrievedAt=Date.now(),k.marketplaceId=C,k.versionHash=T,k.marketplaceHash=T,this.previewMarketplaceId&&C===this.previewMarketplaceId&&(k.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(M=>{try{if(k.storefront[M]){let R=new URL("https://embed.v3.contentfabric.io");const O=t(k.storefront[M]);R.searchParams.set("p",""),R.searchParams.set("net",this.network==="main"?"main":"demo"),R.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),R.searchParams.set("vid",O),R.searchParams.set("ap",""),M.startsWith("reveal")||(R.searchParams.set("m",""),R.searchParams.set("lp","")),k.storefront[`${M}_embed_url`]=R.toString()}}catch{}}),this.cachedMarketplaces[C]=k}return this.cachedMarketplaces[C]}async FilteredQuery({mode:x="listings",sortBy:E="created",sortDesc:C=!1,filter:T,editionFilters:k,attributeFilters:M,contractAddress:R,tokenId:O,currency:W,marketplaceParams:Z,tenantId:se,collectionIndexes:ye,priceRange:he,tokenIdRange:te,capLimit:re,userAddress:S,sellerAddress:_,lastNDays:P=-1,startTime:j,endTime:q,includeCheckoutLocked:B=!1,start:X=0,limit:$=50}={}){ye=(ye||[]).map(ie=>parseInt(ie));let D={start:X,limit:$,sort_descending:C};x==="owned"&&E==="created"&&(E="default"),x!=="leaderboard"&&(D.sort_by=E),x.includes("listings")&&B&&(D.checkout=!0);let N,Y;Z&&(N=await this.MarketplaceInfo({marketplaceParams:Z}),ye.length>0&&(Y=await this.Marketplace({marketplaceParams:Z})));try{let ie=[];_?ie.push(`seller:eq:${this.client.utils.FormatAddress(_)}`):S&&x!=="owned"&&ie.push(`addr:eq:${this.client.utils.FormatAddress(S)}`),Y&&ye.length>=0?ye.forEach(oe=>{Y.collections[oe].items.forEach(be=>{if(!be)return;const me=Y.items.find(xe=>xe.sku===be);if(!me)return;const fe=c.SafeTraverse(me,"nft_template","nft","address");fe&&ie.push(`${x==="owned"?"contract_addr":"contract"}:eq:${c.FormatAddress(fe)}`)})}):(N||se)&&ie.push(`tenant:eq:${N?N.tenantId:se}`),R?(x==="owned"?ie.push(`contract_addr:eq:${c.FormatAddress(R)}`):ie.push(`contract:eq:${c.FormatAddress(R)}`),O&&ie.push(`token:eq:${O}`)):T&&(x.includes("listing")?ie.push(`nft/display_name:eq:${T}`):x==="owned"?ie.push(`meta/display_name:eq:${T}`):ie.push(`name:eq:${T}`)),k&&k.forEach(oe=>{x.includes("listing")?ie.push(`nft/edition_name:eq:${oe}`):x==="owned"?(ie.push(`meta:@>:{"edition_name":"${oe}"}`),D.exact=!1):ie.push(`edition:eq:${oe}`)}),M&&M.map(({name:oe,value:ce})=>{!oe||!ce||ie.push(`nft/attributes/${oe}:eq:${ce}`)}),W&&ie.push("link_type:eq:sol"),j||q?(j&&ie.push(`created:gt:${parseInt(j)/1e3}`),q&&ie.push(`created:lt:${parseInt(q)/1e3}`)):P&&P>0&&ie.push(`created:gt:${(Date.now()/1e3-P*24*60*60).toFixed(0)}`),he&&(he.min&&ie.push(`price:ge:${parseFloat(he.min)}`),he.max&&ie.push(`price:le:${parseFloat(he.max)}`)),te&&(te.min&&ie.push(`info/token_id:ge:${parseInt(te.min)}`),te.max&&ie.push(`info/token_id:le:${parseInt(te.max)}`)),re&&ie.push(`info/cap:le:${parseInt(re)}`);let V,Ce;switch(x){case"owned":Ce=o("as","wlt",S||this.UserAddress());break;case"owned-full-meta":Ce=o("as","apigw","nfts"),V={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":Ce=o("as","mkt","f");break;case"transfers":Ce=o("as","mkt","hst","f"),ie.push("action:eq:TRANSFERRED"),ie.push("action:eq:SOLD");break;case"sales":Ce=o("as","mkt","hst","f"),ie.push("action:eq:SOLD"),ie.push("seller:co:0x");break;case"listing-stats":Ce=o("as","mkt","stats","listed");break;case"sales-stats":Ce=o("as","mkt","stats","sold"),ie.push("seller:co:0x");break;case"leaderboard":Ce=o("as","wlt","leaders");break}if(ie.length>0&&(D.filter=ie),x.includes("stats"))return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:V}));const{contents:Oe,paging:Se}=await c.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:V}))||[],Te=["owned","listings","owned-full-meta"];return{paging:{start:D.start,limit:D.limit,total:Se.total,more:Se.total>X+$},results:(Oe||[]).map(oe=>Te.includes(x)?a(this,oe):oe)}}catch(ie){if(ie.status&&ie.status.toString()==="404")return{paging:{start:D.start,limit:D.limit,total:0,more:!1},results:[]};throw ie}}async MintingStatus({marketplaceParams:x,tenantId:E}){E||(E=(await this.MarketplaceInfo({marketplaceParams:x||this.selectedMarketplaceInfo})).tenantId);try{return(await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","status","act",E),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(T=>{let[k,M,R]=T.op.split(":");M=M&&M.startsWith("0x")?c.FormatAddress(M):M;let O,W,Z,se;if(k==="nft-buy"?O=R:k==="nft-claim"?(O=R,T.marketplaceId=M,T.extra&&T.extra[0]&&(M=T.extra.token_addr,W=T.extra.token_id_str)):k==="nft-redeem"?O=T.op.split(":").slice(-1)[0]:W=R,k==="nft-transfer"&&(O=T.extra&&T.extra.trans_id,W=T.extra&&T.extra.token_id_str||W,T.extra&&T.extra.gift_action==="nft-gift-claim"&&(se=T.extra.gift_id)),k==="nft-offer-redeem"&&(Z=T.op.split(":")[3]),k==="nft-claim-entitlement"){let[ye,he,te,re]=T.op.split(":");O=re,T.extra&&T.extra[0]&&(M=T.extra[0].token_addr,W=T.extra[0].token_id,M=M.startsWith("0x")?c.FormatAddress(M):M,T.marketplaceId=he)}return{...T,timestamp:new Date(T.ts),state:T.state&&typeof T.state=="object"?Object.values(T.state):T.state,extra:T.extra&&typeof T.extra=="object"?Object.values(T.extra):T.extra,confirmationId:O,op:k,address:c.FormatAddress(M),tokenId:W,offerId:Z,giftId:se}}).sort((T,k)=>T.ts<k.ts?1:-1)}catch(C){return this.Log("Failed to retrieve minting status",!0,C),[]}}async DeployTenant({tenantId:x,tenantSlug:E="",tenantHash:C,environment:T="production"}){if(!C){const R=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("public/asset_metadata/tenants",E),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!R)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${E}`);const O=R["."].source;C=await this.client.LatestVersionHash({versionHash:O})}const k={content_hash:C,env:T,ts:Date.now()},M=await this.client.Sign(JSON.stringify(k));await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt","config",x,"metadata"),method:"POST",body:k,headers:{Authorization:`Bearer ${M}`}})}async PurgeUrl({tenantId:x,url:E}){const C={url:E},T=await this.client.CreateFabricToken({});await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt",x,"purge"),method:"POST",body:C,headers:{Authorization:`Bearer ${T}`}})}}return Object.assign(v.prototype,uee()),Object.assign(v.prototype,lee()),Object.assign(v.prototype,cee()),JE.ElvWalletClient=v,JE}var sL;function dee(){if(sL)return Wm;sL=1;const{ElvClient:r}=QI(),{ElvWalletClient:e}=fee(),t=gi();return Wm.ElvClient=r,Wm.ElvWalletClient=e,Wm.Utils=t,Wm}var gc=dee();const ZI=oq({__proto__:null},[gc]),oL={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class pee{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}HasAudio(){return!this.player||!this.player.video?!1:this.player.video.mozHasAudio||!!this.player.video.webkitAudioDecodedByteCount||!!this.player.video.audioTracks&&this.player.video.audioTracks.length}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:a}){if(this.player.casting)return this.player.castHandler.Seek({fraction:e,time:t,relativeSeconds:a});if(!this.player.video||e&&!this.player.video.duration)return;this.player.canPlay||(this.Play(),this.Pause());const s=this.player.video.currentTime;return a?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+a)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,s<=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:a}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:a}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const a=Math.min(t.mediaIndex+1,t.mediaLength-1);a!==t.mediaIndex&&this.CollectionPlay({mediaIndex:a,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const a=Math.max(0,t.mediaIndex-1);a!==t.mediaIndex&&this.CollectionPlay({mediaIndex:a,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,a)=>({index:a,active:this.player.hlsPlayer.currentLevel===a&&!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,a)=>t.bitrate<a.bitrate?1:-1),e.length>0){const t=e.find(a=>this.player.hlsPlayer.currentLevel===a.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,a)=>t.bitrate<a.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(a=>a.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(a=>a.mode==="showing"),e=Array.from(this.player.video.textTracks).map((a,s)=>({index:s,label:a.label||a.language,language:a.language,active:a.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((a,s)=>({index:s,label:a.labels&&a.labels.length>0?a.labels[0].text:a.lang,language:a.lang,active:s===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(a=>a.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(a=>a.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 a of navigator.languages){const s=t.find(u=>u.language===a||u.language===a.split("-")[0]);if(s)return this.SetTextTrack(s.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((s,u)=>({index:u,rate:parseFloat(s),label:`${s}x`,active:e.toFixed(2)===parseFloat(s).toFixed(2)}));let a=t.find(s=>s.active);return a||(a={index:-1,rate:this.GetPlaybackRate(),label:`${this.GetPlaybackRate()}x`,active:!0}),{options:t,active:a}}SetPlaybackRate({index:e,rate:t}){if(this.player.casting)return this.player.castHandler.SetPlaybackRate({index:e,rate:t});const a=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:a<=t};{const s=this.GetPlaybackRates().options[e];if(s)return this.player.video.playbackRate=s.rate,this.player.__SettingsUpdate(),{rate:s.rate,increase:a<=s.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(oL).map(t=>({index:t,label:oL[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}ThumbnailsAvailable(){return this.player.thumbnailHandler&&this.player.thumbnailHandler.loaded||!1}GetThumbnailImage(e){if(this.ThumbnailsAvailable())return this.player.thumbnailHandler.ThumbnailImage(e)}GetVideoDimensions(){return this.player.video.getBoundingClientRect()}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 Un={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"},eD=({player:r,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:a=300})=>{let s,u,o,c;return window.addEventListener("focus",()=>{o=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(u),p.target===p.currentTarget&&p.currentTarget.contains(o)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-s<a){const d=p.target.getBoundingClientRect(),y=(p.clientX-d.left)/d.width;y<=t?(r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"})):y>=1-t?(r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"})):r.controls.ToggleFullscreen()}else u=setTimeout(()=>{const d=r.controls.TogglePlay();e({action:d?Un.PLAY:Un.PAUSE})},a);o=p.target,s=Date.now()}},tD=(r,e)=>{let t=0;return()=>a=>{a.repeat||(t=0);const s=t<5?5:t<15?10:t<40?30:60;switch(a.key){case"ArrowLeft":a.preventDefault(),r.controls.Seek({relativeSeconds:-s}),e({action:Un.SEEK_BACK,text:`${s} seconds`});break;case"ArrowRight":a.preventDefault(),r.controls.Seek({relativeSeconds:s}),e({action:Un.SEEK_FORWARD,text:`${s} seconds`});break;default:return}t+=1}},hee=r=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),r.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),r.controls.IsMuted()?r.controls.SetVolume({fraction:.05}):r.controls.SetVolume({relativeFraction:.05});break}},Rg=(r,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=r>3600,a=Math.floor(r/60/60),s=Math.floor(r/60%60),u=Math.floor(r%60);let o=`${s.toString().padStart(t?2:1,"0")}:${u.toString().padStart(2,"0")}`;return t&&(o=`${a.toString()}:${o}`),o},S8=async({player:r,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")))return e;if(e&&e.url)return e.url;const a=await r.__Client();let s;const{mediaCatalogObjectId:u,mediaCatalogVersionHash:o}=r.sourceOptions&&r.sourceOptions.mediaCollectionOptions||{},c=r.sourceOptions&&r.sourceOptions.playoutParameters||{};return o?s=o:u?s=await a.LatestVersionHash({objectId:u}):c.versionHash?s=c.versionHash:s=await a.LatestVersionHash({objectId:c.objectId}),s?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await a.FileUrl({versionHash:s,filePath:e.replace(/^files/,""),queryParams:{width:t},authorizationToken:c.authorizationToken}):await a.LinkUrl({versionHash:s,linkPath:e,queryParams:{width:t},authorizationToken:c.authorizationToken})):""},C8=(r,e={},t=1)=>{if(t>10)return{};let a={};return Object.keys(r).forEach(s=>{if(s==="client")a.client=e.client||r.client;else if(typeof r[s]=="object"&&!Array.isArray(r[s]))a[s]=C8(r[s],(e||{})[s],t+1);else{const u=(e||{})[s];a[s]=typeof u<"u"?u:r[s]}}),a},nD=r=>C8(uq,r);var yee=vi();const Nw=xu(yee);var Ms={},QE,uL;function mee(){return uL||(uL=1,QE=function(e,t,a,s){var u=a?a.call(s,e,t):void 0;if(u!==void 0)return!!u;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),c=Object.keys(t);if(o.length!==c.length)return!1;for(var p=Object.prototype.hasOwnProperty.bind(t),d=0;d<o.length;d++){var y=o[d];if(!p(y))return!1;var m=e[y],v=t[y];if(u=a?a.call(s,m,v,y):void 0,u===!1||u===void 0&&m!==v)return!1}return!0}),QE}var lL;function gee(){if(lL)return Ms;lL=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.PreOrder=Ms.ReverseInOrder=Ms.InOrder=Ms.IntervalTree=Ms.Node=void 0;var r=mee();function e(d,y){return d<y?y:d}function t(d){return d===void 0?-1:d.height}var a=(function(){function d(y,m){this.intervalTree=y,this.records=[],this.height=0,this.key=m.low,this.max=m.high,this.records.push(m)}return d.prototype.getNodeHigh=function(){for(var y=this.records[0].high,m=1;m<this.records.length;m++)this.records[m].high>y&&(y=this.records[m].high);return y},d.prototype.updateHeight=function(){this.height=e(t(this.left),t(this.right))+1},d.prototype.updateMaxOfParents=function(){if(this!==void 0){var y=this.getNodeHigh();this.left!==void 0&&this.right!==void 0?this.max=e(e(this.left.max,this.right.max),y):this.left!==void 0&&this.right===void 0?this.max=e(this.left.max,y):this.left===void 0&&this.right!==void 0?this.max=e(this.right.max,y):this.max=y,this.parent&&this.parent.updateMaxOfParents()}},d.prototype._updateMaxAfterRightRotate=function(){var y=this.parent,m=y.left,v=m.getNodeHigh();m.left===void 0&&m.right!==void 0?m.max=e(v,m.right.max):m.left!==void 0&&m.right===void 0?m.max=e(v,m.left.max):m.left===void 0&&m.right===void 0?m.max=v:m.max=e(e(m.left.max,m.right.max),v);var b=this.getNodeHigh();this.left===void 0&&this.right!==void 0?this.max=e(b,this.right.max):this.left!==void 0&&this.right===void 0?this.max=e(b,this.left.max):this.left===void 0&&this.right===void 0?this.max=b:this.max=e(e(this.left.max,this.right.max),b),y.max=e(e(y.left.max,y.right.max),y.getNodeHigh())},d.prototype._updateMaxAfterLeftRotate=function(){var y=this.parent,m=y.right,v=m.getNodeHigh();m.left===void 0&&m.right!==void 0?m.max=e(v,m.right.max):m.left!==void 0&&m.right===void 0?m.max=e(v,m.left.max):m.left===void 0&&m.right===void 0?m.max=v:m.max=e(e(m.left.max,m.right.max),v);var b=this.getNodeHigh();this.left===void 0&&this.right!==void 0?this.max=e(b,this.right.max):this.left!==void 0&&this.right===void 0?this.max=e(b,this.left.max):this.left===void 0&&this.right===void 0?this.max=b:this.max=e(e(this.left.max,this.right.max),b),y.max=e(e(y.left.max,m.max),y.getNodeHigh())},d.prototype._leftRotate=function(){var y=this.right;y.parent=this.parent,y.parent===void 0?this.intervalTree.root=y:y.parent.left===this?y.parent.left=y:y.parent.right===this&&(y.parent.right=y),this.right=y.left,this.right!==void 0&&(this.right.parent=this),y.left=this,this.parent=y,this.updateHeight(),y.updateHeight()},d.prototype._rightRotate=function(){var y=this.left;y.parent=this.parent,y.parent===void 0?this.intervalTree.root=y:y.parent.left===this?y.parent.left=y:y.parent.right===this&&(y.parent.right=y),this.left=y.right,this.left!==void 0&&(this.left.parent=this),y.right=this,this.parent=y,this.updateHeight(),y.updateHeight()},d.prototype._rebalance=function(){if(t(this.left)>=2+t(this.right)){var y=this.left;t(y.left)>=t(y.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(y._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(t(this.right)>=2+t(this.left)){var m=this.right;t(m.right)>=t(m.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(m._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},d.prototype.insert=function(y){y.low<this.key?this.left===void 0?(this.left=new d(this.intervalTree,y),this.left.parent=this):this.left.insert(y):this.right===void 0?(this.right=new d(this.intervalTree,y),this.right.parent=this):this.right.insert(y),this.max<y.high&&(this.max=y.high),this.updateHeight(),this._rebalance()},d.prototype._getOverlappingRecords=function(y,m,v){if(y.key<=v&&m<=y.getNodeHigh()){for(var b=[],x=0;x<y.records.length;x++)y.records[x].high>=m&&b.push(y.records[x]);return b}return[]},d.prototype.search=function(y,m){if(this===void 0)return[];var v=[],b=[],x=[];return y>this.max?[]:(this.left!==void 0&&this.left.max>=y&&(v=this.left.search(y,m)),b=this._getOverlappingRecords(this,y,m),m<this.key?v.concat(b):(this.right!==void 0&&(x=this.right.search(y,m)),v.concat(b,x)))},d.prototype.searchExisting=function(y){if(this!==void 0){if(this.key===y)return this;if(y<this.key){if(this.left!==void 0)return this.left.searchExisting(y)}else if(this.right!==void 0)return this.right.searchExisting(y)}},d.prototype._minValue=function(){return this.left===void 0?this:this.left._minValue()},d.prototype.remove=function(y){var m=this.parent;if(y.key<this.key)return this.left!==void 0?this.left.remove(y):void 0;if(y.key>this.key)return this.right!==void 0?this.right.remove(y):void 0;if(this.left!==void 0&&this.right!==void 0){var v=this.right._minValue();return this.key=v.key,this.records=v.records,this.right.remove(this)}else{if(m.left===this)return this.right!==void 0?(m.left=this.right,this.right.parent=m):(m.left=this.left,this.left!==void 0&&(this.left.parent=m)),m.updateMaxOfParents(),m.updateHeight(),m._rebalance(),this;if(m.right===this)return this.right!==void 0?(m.right=this.right,this.right.parent=m):(m.right=this.left,this.left!==void 0&&(this.left.parent=m)),m.updateMaxOfParents(),m.updateHeight(),m._rebalance(),this}},d})();Ms.Node=a;var s=(function(){function d(){this.count=0}return d.prototype.insert=function(y){if(y.low>y.high)throw new Error("`low` value must be lower or equal to `high` value");if(this.root===void 0)return this.root=new a(this,y),this.count++,!0;var m=this.root.searchExisting(y.low);if(m!==void 0){for(var v=0;v<m.records.length;v++)if(r(m.records[v],y))return!1;return m.records.push(y),y.high>m.max&&(m.max=y.high,m.parent&&m.parent.updateMaxOfParents()),this.count++,!0}else return this.root.insert(y),this.count++,!0},d.prototype.search=function(y,m){return this.root===void 0?[]:this.root.search(y,m)},d.prototype.remove=function(y){if(this.root===void 0)return!1;var m=this.root.searchExisting(y.low);if(m===void 0)return!1;if(m.records.length>1){for(var v=void 0,b=0;b<m.records.length;b++)if(r(m.records[b],y)){v=m.records[b],m.records.splice(b,1);break}if(v){if(v=void 0,y.high===m.max){var x=m.getNodeHigh();m.left!==void 0&&m.right!==void 0?m.max=e(e(m.left.max,m.right.max),x):m.left!==void 0&&m.right===void 0?m.max=e(m.left.max,x):m.left===void 0&&m.right!==void 0?m.max=e(m.right.max,x):m.max=x,m.parent&&m.parent.updateMaxOfParents()}return this.count--,!0}else return!1}else if(m.records.length===1)if(r(m.records[0],y))if(this.root.key===m.key){var E=new a(this,{low:y.low,high:y.low});E.left=this.root,this.root.parent=E;var C=this.root.remove(m);return this.root=E.left,this.root!==void 0&&(this.root.parent=void 0),C?(C=void 0,this.count--,!0):!1}else{var C=this.root.remove(m);return C?(C=void 0,this.count--,!0):!1}else return!1;else return!1},d.prototype.inOrder=function(){return new o(this.root)},d.prototype.reverseInOrder=function(){return new c(this.root)},d.prototype.preOrder=function(){return new p(this.root)},d})();Ms.IntervalTree=s;var u=(function(){function d(){this.tree=new s}return d.prototype.insert=function(y,m,v){return this.tree.insert({low:y,high:m,data:v})},d.prototype.remove=function(y,m,v){return this.tree.remove({low:y,high:m,data:v})},d.prototype.search=function(y,m){return this.tree.search(y,m).map(function(v){return v.data})},d.prototype.inOrder=function(){return this.tree.inOrder()},d.prototype.reverseInOrder=function(){return this.tree.reverseInOrder()},d.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(d.prototype,"count",{get:function(){return this.tree.count},enumerable:!1,configurable:!0}),d})();Ms.default=u;var o=(function(){function d(y){this.stack=[],y!==void 0&&this.push(y)}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(this.currentNode.right!==void 0?this.push(this.currentNode.right):this.pop(),this.next())},d.prototype.push=function(y){for(this.currentNode=y,this.i=0;this.currentNode.left!==void 0;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},d.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},d})();Ms.InOrder=o;var c=(function(){function d(y){this.stack=[],y!==void 0&&this.push(y)}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.currentNode.records.length&&this.i>=0?{done:!1,value:this.currentNode.records[this.i--]}:(this.currentNode.left!==void 0?this.push(this.currentNode.left):this.pop(),this.next())},d.prototype.push=function(y){var m,v,b,x;for(this.currentNode=y,this.i=((v=(m=this.currentNode)===null||m===void 0?void 0:m.records.length)!==null&&v!==void 0?v:0)-1;this.currentNode.right!==void 0;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.right,this.i=((x=(b=this.currentNode)===null||b===void 0?void 0:b.records.length)!==null&&x!==void 0?x:0)-1},d.prototype.pop=function(){var y,m;this.currentNode=this.stack.pop(),this.i=((m=(y=this.currentNode)===null||y===void 0?void 0:y.records.length)!==null&&m!==void 0?m:0)-1},d})();Ms.ReverseInOrder=c;var p=(function(){function d(y){this.stack=[],this.i=0,this.currentNode=y}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(this.currentNode.right!==void 0&&this.push(this.currentNode.right),this.currentNode.left!==void 0&&this.push(this.currentNode.left),this.pop(),this.next())},d.prototype.push=function(y){this.stack.push(y)},d.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},d})();return Ms.PreOrder=p,Ms}var vee=gee();const bee=xu(vee);let cL=1;const wee=({tagType:r,tagId:e,label:t,startTime:a,endTime:s,text:u,tag:o,...c})=>{let p;if(Array.isArray(u))u=u.join(", ");else if(typeof u=="object"){p=u;try{u=JSON.stringify(u,null,2)}catch{u=""}}return{tagId:e,tagType:r,label:t,startTime:a,endTime:s,text:u,content:p,tag:o,...c}},_ee=({label:r,cue:e,offset:t=0})=>{const a=["align","endTime","id","line","lineAlign","position","positionAlign","region","size","snapToLines","startTime","text","vertical"],s={};a.forEach(o=>s[o]=e[o]);const u=cL;return cL+=1,wee({tagId:u,tagType:"vtt",label:r,startTime:e.startTime-t,endTime:e.endTime-t,text:e.text,tag:s})},xee=async r=>{const e=document.createElement("video"),t=document.createElement("track"),a="data:text/plain;base64,"+gc.Utils.B64(r.vttData),s=t.track;e.append(t),t.src=a,s.mode="hidden",await new Promise(o=>setTimeout(o,500));let u={};return Array.from(s.cues).forEach(o=>{const c=_ee({label:r.label,cue:o,offset:r.offset});u[c.tagId]=c}),u},See=(r,e)=>{const t=new bee;return Object.values(r).forEach(a=>{try{t.insert(a.startTime,a.startTime+1,a.tagId)}catch(s){console.warn(`Invalid tag in track '${e}'`),console.warn(JSON.stringify(a,null,2)),console.warn(s)}}),t};class Cee{constructor(e,t){this.thumbnailTrackUrl=e,this.loaded=!1,this.offset=t||0}async LoadThumbnails(){const e=new URL(this.thumbnailTrackUrl),t=e.searchParams.get("authorization");e.searchParams.delete("authorization");const a=await(await fetch(e,{headers:{Authorization:`Bearer ${t}`}})).text();let s=await xee({label:"Thumbnails",vttData:a,offset:this.offset}),u=0,o=0;Object.keys(s||{}).forEach(p=>{s[p].endTime=s[p].startTime,u=Math.max(u,s[p].startTime-o),o=s[p].startTime});let c={};Object.keys(s).map(p=>{const[d,y]=s[p].tag.text.split(`
|
|
380
|
-
`)[0].split("?"),[m,v]=y.split("#"),b=v.split("=")[1].split(",").map(C=>parseInt(C)),x=new URLSearchParams(`?${m}`),E=new URL(e);E.searchParams.set("authorization",t),E.pathname=Nw(E.pathname.split("/").slice(0,-1).join("/"),d),x.forEach((C,T)=>E.searchParams.set(C,T)),s[p].imageUrl=E.toString(),s[p].thumbnailPosition=b,c[E.toString()]=!0,delete s[p].tag.text,delete s[p].text}),await Promise.all(Object.keys(c).map(async p=>{const d=new Image;await new Promise(y=>{d.src=p,d.crossOrigin="anonymous",d.onload=()=>{y()}}),c[p]=d})),this.maxInterval=Math.ceil(u),this.thumbnailImages=c,this.thumbnails=s,this.intervalTree=See(s,"Thumbnails"),this.loaded=!0}ThumbnailImage(e){if(!this.intervalTree)return;const t=this.intervalTree.search(e,e+this.maxInterval)[0];if(!t)return;const a=this.thumbnails&&this.thumbnails[t?.toString()];if(!a)return;this.thumbnailCanvas||(this.thumbnailCanvas=document.createElement("canvas"));const s=this.thumbnailImages[a.imageUrl];if(s){const[u,o,c,p]=a.thumbnailPosition;return this.thumbnailCanvas.height=p,this.thumbnailCanvas.width=c,this.thumbnailCanvas.getContext("2d").drawImage(s,u,o,c,p,0,0,c,p),this.thumbnailCanvas.toDataURL("image/png")}}}const Eee=/iPhone|iPad|iPod/i.test(navigator.userAgent),fL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),Aee={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Yw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t);const a=()=>this.video.removeEventListener(e,t);return this.__listenerDisposers.push(a),()=>{a(),this.__listenerDisposers=this.__listenerDisposers.filter(s=>s!==a)}}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:a,Reload:s,UpdateParameters:u,SetErrorMessage:o}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new pee({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=fL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[$t.controls.ON,$t.controls.AUTO_HIDE].includes(a.playerOptions.controls),this.__error=void 0,this.__ReloadComponent=s,this.__UpdateParameters=u,this.SetErrorMessage=(c,p)=>{o(c),this.__error=p};try{a.playerOptions.hlsjsOptions&&Object.keys(a.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=a.playerOptions.hlsjsOptions,a.playerOptions.playerProfile=$t.playerProfile.CUSTOM)}catch(c){this.Log(c,!0)}this.__Initialize(a)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>ZI);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(gc.Utils.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:10080*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 M=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(M.mediaHash).objectId,t.versionHash=M.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{},clip_start:(t.options||{}).clip_start||t.clipStart,clip_end:(t.options||{}).clip_end||t.clipEnd},o,c;if((u.clip_start||u.clip_end)&&(o=parseFloat(u.clip_start||0),c=parseFloat(u.clip_end||0),delete u.clip_start,delete u.clip_end),!t.channel){let M=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(a=M.default?"default":Object.keys(M)[0],t.offering?a=M[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(O=>M[O]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(O=>M[O])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const R=M[a]&&M[a].properties||{};s=M[a].uri,this.sourceOptions.contentInfo.liveDVR===$t.liveDVR.ON&&R.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=R.live}const p=async M=>t.directLink?await e.PlayoutOptions({offeringURI:s,options:M}):await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:M});if(!this.sourceOptions.playoutOptions){let M;if(!o&&!c)M=await p(u);else if(!t.clipRelativeToUntrimmed)M=await p({...u,clip_start:o,clip_end:c});else{M=await p(u);let R;try{for(const O of Object.keys(M||{})){for(const W of Object.keys(M[O].playoutMethods||{}))if(typeof(M[O].playoutMethods[W].properties||{}).start_offset_float<"u"){R=parseFloat(M[O].playoutMethods[W].properties.start_offset_float);break}if(typeof R<"u")break}}catch(O){this.Log("Failed to load content offset for clip adjustment:"),this.Log(O,!0)}M=await p({...u,clip_start:(o||0)-(R||0),clip_end:(c||0)-(R||0)||9999999})}this.sourceOptions.playoutOptions=M}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:s,options:u})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:u}));let d=(await e.AvailableDRMs()).filter(M=>(this.sourceOptions.drms||[]).includes(M)),y=this.sourceOptions.protocols,m,v;for(;!(m&&v);){m=y.find(R=>this.sourceOptions.playoutOptions[R]);const M=Object.keys(this.sourceOptions.playoutOptions[m].playoutMethods);if(v=(this.sourceOptions.drms||[]).length===0?M.find(R=>R!=="clear")||M[0]:this.sourceOptions.drms.sort().reverse().find(R=>d.includes(R)&&this.sourceOptions.playoutOptions[m].playoutMethods[R]),!v&&(y=y.filter(R=>R!==m),y.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:b,drms:x,thumbnailTrack:E,properties:C}=this.sourceOptions.playoutOptions[m].playoutMethods[v],T=b.split("/").find(M=>M.startsWith("hq__")),k=(C||{}).start_offset_float||0;return{playoutParameters:{...t,options:u},protocol:m,drm:v,playoutUrl:b,thumbnailTrackUrl:E,objectId:e.utils.DecodeVersionHash(T).objectId,versionHash:T,drms:x,availableDRMs:d,offeringURI:s,offering:a,compositionKey:t.channel,clipStart:u.clip_start,clipEnd:u.clip_end,trimOffset:k,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:a}){t&&(e=this.collectionInfo.content.find(s=>s.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof a<"u"?a:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:a}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!a)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const s=await this.__Client();try{const u=this.sourceOptions.playoutParameters.authorizationToken;t=t||await s.LatestVersionHash({objectId:e});const c=(await s.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:u,produceLinkUrls:!0})||[]).find(p=>p.id===a);if(!c)throw{displayMessage:`No collection with ID ${a} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,d)=>({...p,active:d===0,mediaId:p.id,mediaIndex:d,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(y=>y.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(u){throw this.Log("Failed to load collection:"),u}}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=nD(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=$t.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Fq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",M=>{this.airplayAvailable=M.availability==="available",this.__SettingsUpdate()});const a=this.__RegisterVideoEventListener("timeupdate",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate(),a()});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===$t.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const M=this.video.duration-this.video.currentTime;this.behindLiveEdge=M>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{objectId:s,versionHash:u,playoutUrl:o,thumbnailTrackUrl:c,protocol:p,drm:d,drms:y,multiviewOptions:m,playoutParameters:v,trimOffset:b,offering:x,compositionKey:E,clipStart:C,clipEnd:T}=await this.__PlayoutOptions();this.playoutInfo={objectId:s,versionHash:u,offering:x,compositionKey:E,trimOffset:b,clipStart:C,clipEnd:T},this.contentHash=u,o=new URL(o);const k=this.sourceOptions.playoutParameters.authorizationToken||o.searchParams.get("authorization");if(this.authorizationToken=k,this.playoutUrl=o.toString(),this.thumbnailTrackUrl=c,this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:v}),this.__destroyed)return;p==="hls"?await this.__InitializeHLS({playoutUrl:o,authorizationToken:k,drm:d,drms:y,multiviewOptions:m}):await this.__InitializeDash({playoutUrl:o,authorizationToken:k,drm:d,drms:y,multiviewOptions:m}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-C8OZKhRN.js")).then(({InitializeMuxMonitoring:M})=>M({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:o,authorizationToken:k,disableCookies:this.playerOptions.collectVideoAnalytics===$t.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.loadChapters&&this.__LoadChapters({...this.playoutInfo||{}}).then(M=>this.__chapterTags=M).catch(M=>this.Log(M,!0)),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,this.thumbnailTrackUrl&&(this.thumbnailHandler=new Cee(this.thumbnailTrackUrl,b||0),this.thumbnailHandler.LoadThumbnails().then(()=>{this.thumbnailsLoaded=!0,this.__SettingsUpdate()}))}catch(a){let s;if(a&&[401,403].includes(a.status)||[401,403].includes(a.code))try{const u=await this.__Client(),o=this.sourceOptions.playoutParameters.linkPath?await u.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await u.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});s=await u.ContentObjectMetadata({versionHash:o,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),s?(a.permission_message=s,this.SetErrorMessage(s,a),typeof a=="object"?a.permission_message=s:this.Log(s,!0)):this.SetErrorMessage(a.displayMessage||"Insufficient permissions",a)}catch(u){this.SetErrorMessage(u.displayMessage||"Insufficient permissions",u)}else a.status>=500?this.__HardReload(a,1e4):this.__HardReload(a,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(a,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}){this.HLS=(await Promise.resolve().then(()=>require("./hls-DM9gWZ70.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&Eee&&this.playerOptions.preferNativeHLS||[$t.drms.FAIRPLAY,$t.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===$t.drms.FAIRPLAY?Uq({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),u.enabled){const c=u.SwitchView;u.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(a===$t.drms.PLAYREADY||a===$t.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,v)=>{m.open("POST",v,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},a===$t.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===$t.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(Aee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===$t.playerProfile.CUSTOM?this.customHLSOptions:{};this.sourceOptions.playoutParameters&&this.sourceOptions.playoutParameters.channel&&Object.keys(d).length===0&&(p.maxBufferHole=4.2),this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...c,...p,...d},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const y=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(E=>typeof E<"u").reverse();x.length===v.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),x=x.filter(E=>E>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.map(E=>y.removeLevel(E))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const m=u.SwitchView;u.SwitchView=async v=>{await m(v),y.nextLevel=y.currentLevel},this.controls.InitializeMultiViewControls(u)}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(m=>y.on(m,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const m=(this.controls.GetAudioTracks().options||[]).find(v=>v.label===this.sourceOptions.playoutParameters.audioTrackLabel);m&&this.controls.SetAudioTrack(m.index)}),this.SetPlayerProfile=async({profile:m,customHLSOptions:v={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:m,hlsjsOptions:v}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=v;const b=!this.video.paused,x=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(E){this.Log("Failed to destroy HLS player",!0),this.Log(E,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=x)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(m,v)=>{if(this.errors+=1,this.Log(`Encountered ${v.details}`,!0),this.Log(v,!0),v.response&&v.response.code===403)this.SetErrorMessage("Insufficient permissions",v);else if(this.errors<5){if(v.fatal)v.data&&v.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(v);else if(v.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let b=this.video&&this.video.currentTime;this.stallTimeout=setTimeout(()=>{this.video&&this.video.currentTime>b||(this.Log("Buffer Stalled. Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError(),this.stallTimeout=setTimeout(()=>{this.Log("Buffer Stalled. Reloading player...",!0),this.__HardReload(v,0,b)},6e3))},6e3)}}else this.__HardReload(v)}),this.hlsPlayer=y,this.player=y,o){const m=document.createElement("source");m.src=this.playoutUrl.toString(),this.video.appendChild(m),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-C2TzESo8.js")).then(c=>c.dash_all_min)).default;const u=this.Dash.MediaPlayer().create(),o=this.playerOptions.dashjsOptions||{};if(u.updateSettings({...o,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(o.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(o.streaming||{}).text||{}},...o.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&u.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&u.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),u.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),a===$t.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===$t.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=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.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=u,this.dashPlayer=u}async __Play(){try{return await this.video.play(),!0}catch(e){if(e&&(e.toString()||"").includes("AbortError"))return!1;if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===$t.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 a=await this.__Client();let s=!1;try{await a.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{s=!0}let u=new URL((await a.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),o=`s/${a.NetworkInfo().name}`;return s&&(o=`t/${t}`),u.pathname=`${o}/q/${e}/meta/public`,u.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 a=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:a,address:e.utils.HashToAddress(a),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,a=await e.ContentObjectTenantId({objectId:t}),s=await e.ContentSpaceId();let u,o,c;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{u=await e.ContentObjectMetadata({libraryId:s.replace("ispc","ilib"),objectId:a.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:a,tenantAddress:e.utils.HashToAddress(a),tenantName:u,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,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.playoutUrl=void 0,this.thumbnailTrackUrl=void 0,this.thumbnailHandler=void 0,this.thumbnailsLoaded=void 0,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0,this.__chapterTags=void 0,this.playoutInfo=void 0}}async __HardReload(e,t=6e3,a){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}this.playoutUrl&&this.playoutUrl.includes("hls-widevine")&&this.__ReloadComponent();try{if(e&&this.playerOptions.restartCallback)try{const s=await this.playerOptions.restartCallback(e);if(s&&typeof s=="boolean"){this.Destroy();return}}catch(s){this.Log("Restart callback failed:"),this.Log(s)}if(t>0&&(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(s=>setTimeout(s,t))),this.__destroyed)return;this.Log("Reloading stream");try{const s=await this.__Client();s.region?await s.UseRegion({region:s.region}):s.Nodes().fabricURIs.length>1&&await s.ResetRegion()}catch(s){this.Log("Client region reset failed:"),this.Log(s)}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:a||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()}async __LoadChapters({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:Nw("/tagstore",e,"tracks"),format:"JSON"});if(o.find(c=>c.name==="chapter"))return((await this.__QueryAIAPI({objectId:e,path:t||a?Nw("/tagstore",e,"compositions","tags"):Nw("/tagstore",e,"tags"),queryParams:{channel_key:a,offering_key:t,limit:1e6,track:"chapter",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).filter(c=>typeof c.start_time<"u"&&typeof c.tag=="string").sort((c,p)=>c.start_time<p.start_time?-1:1).map(c=>({...c,start_time:c.start_time/1e3,end_time:c.end_time/1e3})).map((c,p,d)=>({...c,end_time:(d[p+1]||{}).start_time||c.end_time}))}async __QueryAIAPI({server:e="ai",method:t="GET",path:a,objectId:s,queryParams:u={},body:o,stringifyBody:c=!0,authTokenInBody:p=!1,headers:d={},format:y="json",allowStatus:m=[]}){const v=new URL(`https://${e}.contentfabric.io/`);v.pathname=a,Object.keys(u).forEach(C=>u[C]&&v.searchParams.set(C,u[C]));const b=await this.__Client(),x=(this.sourceOptions.playoutParameters||{}).authorizationToken||new URL(await b.FabricUrl({versionHash:await b.LatestVersionHash({objectId:s}),channelAuth:!0})).searchParams.get("authorization");v.searchParams.set("authorization",x),p&&(o.append?o.append("authorization",x):o.authorization=x),o&&c&&(o=JSON.stringify(o));const E=await fetch(v,{method:t,headers:d,body:o});if(E.status>=400&&!m.includes(E.status))throw E;if(E.status!==204)return y?await b.utils.ResponseToFormat(y,E):E}}Yw.EluvioPlayerParameters=$t;Yw.EluvioPlayer=Yw;var rD=(function(){if(typeof Map<"u")return Map;function r(e,t){var a=-1;return e.some(function(s,u){return s[0]===t?(a=u,!0):!1}),a}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 a=r(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=r(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=r(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~r(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,a){a===void 0&&(a=null);for(var s=0,u=this.__entries__;s<u.length;s++){var o=u[s];t.call(a,o[1],o[0])}},e})()})(),gA=typeof window<"u"&&typeof document<"u"&&window.document===document,Qw=(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")()})(),kee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Qw):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),Tee=2;function Mee(r,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,r()),a&&c()}function o(){kee(u)}function c(){var p=Date.now();if(t){if(p-s<Tee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var Ree=20,Oee=["top","right","bottom","left","width","height","size","weight"],Lee=typeof MutationObserver<"u",Nee=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Mee(this.refresh.bind(this),Ree)}return r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},r.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},r.prototype.connect_=function(){!gA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Lee?(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)},r.prototype.disconnect_=function(){!gA||!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)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=Oee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),aD=(function(r,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(r,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return r}),L0=(function(r){var e=r&&r.ownerDocument&&r.ownerDocument.defaultView;return e||Qw}),iD=F_(0,0,0,0);function Xw(r){return parseFloat(r)||0}function dL(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=r["border-"+s+"-width"];return a+Xw(u)},0)}function Pee(r){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=r["padding-"+u];t[u]=Xw(o)}return t}function Iee(r){var e=r.getBBox();return F_(0,0,e.width,e.height)}function Dee(r){var e=r.clientWidth,t=r.clientHeight;if(!e&&!t)return iD;var a=L0(r).getComputedStyle(r),s=Pee(a),u=s.left+s.right,o=s.top+s.bottom,c=Xw(a.width),p=Xw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=dL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=dL(a,"top","bottom")+o)),!Fee(r)){var d=Math.round(c+u)-e,y=Math.round(p+o)-t;Math.abs(d)!==1&&(c-=d),Math.abs(y)!==1&&(p-=y)}return F_(s.left,s.top,c,p)}var Uee=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof L0(r).SVGGraphicsElement}:function(r){return r instanceof L0(r).SVGElement&&typeof r.getBBox=="function"}})();function Fee(r){return r===L0(r).document.documentElement}function Bee(r){return gA?Uee(r)?Iee(r):Dee(r):iD}function zee(r){var e=r.x,t=r.y,a=r.width,s=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return aD(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function F_(r,e,t,a){return{x:r,y:e,width:t,height:a}}var jee=(function(){function r(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=F_(0,0,0,0),this.target=e}return r.prototype.isActive=function(){var e=Bee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},r})(),qee=(function(){function r(e,t){var a=zee(t);aD(this,{target:e,contentRect:a})}return r})(),Hee=(function(){function r(e,t,a){if(this.activeObservations_=[],this.observations_=new rD,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=a}return r.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 L0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new jee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},r.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 L0(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))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new qee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),sD=typeof WeakMap<"u"?new WeakMap:new rD,oD=(function(){function r(e){if(!(this instanceof r))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=Nee.getInstance(),a=new Hee(e,t,this);sD.set(this,a)}return r})();["observe","unobserve","disconnect"].forEach(function(r){oD.prototype[r]=function(){var e;return(e=sD.get(this))[r].apply(e,arguments)}});var Vee=(function(){return typeof Qw.ResizeObserver<"u"?Qw.ResizeObserver:oD})();const B_=({element:r,Hide:e})=>{if(!r)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{r.contains(u.target)||e()};let s=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",a,!0)},0);return()=>{clearTimeout(s),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",a,!0)}},uD=({player:r,setVideoState:e})=>{const t=function(){if(!r||!r.controls)return;const u=r.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>r.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:r.controls.IsPlaying(),duration:r.controls.GetDuration(),volume:r.controls.GetVolume(),muted:r.controls.IsMuted(),rate:r.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>r.video.addEventListener(u,t)),r.target.addEventListener("fullscreenchange",t);const s=r.castHandler&&r.castHandler.RegisterListener(t);return()=>{a.map(u=>r.video.removeEventListener(u,t)),r.target.removeEventListener("fullscreenchange",t),s&&s()}},Gee=({video:r,setBufferFraction:e})=>{const t=()=>{if(!isFinite(r.duration))return 1;const a=r.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>r.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(r.duration-s)/r.duration)};return r.addEventListener("progress",t),()=>r.removeEventListener("progress",t)},E8=({player:r,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{r.controls&&t(r.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},$ee=({target:r,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=r.getBoundingClientRect();let p="sm",d="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&&(d="portrait"),e(p),t(d),s=setTimeout(()=>{a({width:c.width,height:c.height})},500)};u();const o=new Vee(u);return o.observe(r),()=>o.disconnect()},Wee=({player:r})=>{const e=r.video,t=r.playerOptions.autoplay===$t.autoplay.WHEN_VISIBLE,a=r.playerOptions.muted===$t.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(r.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(r.controls.Pause(),s="pause")),a&&(u!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,u="unmute"):u!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,u="mute"))},c=new window.IntersectionObserver(o,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Kee=({player:r,inactivityPeriod:e=3e3,onSleep:t,onWake:a})=>{let s;const u=p=>{clearTimeout(s),a&&a(),s=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},o=["play","pause","volumechange","seeking"];o.forEach(p=>r.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","fullscreenchange"];return c.forEach(p=>r.target.addEventListener(p,u)),()=>{o.map(p=>r.video.removeEventListener(p,u)),c.map(p=>r.target.removeEventListener(p,u))}},Jee=({player:r,setRecentUserAction:e})=>{if(r.playerOptions.keyboardControls===$t.keyboardControls.OFF)return;const t=r.playerOptions.keyboardControls===$t.keyboardControls.ARROW_KEYS_DISABLED,a=tD(r,e)(),s=u=>{if(!(r.target===u.target||r.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||r.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=r.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":r.controls.ToggleFullscreen();break;case"m":o=r.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=r.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=r.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":r.video.paused&&(r.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":r.video.paused&&(r.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=r.controls.GetPlaybackRates();c.active?o=r.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=r.controls.SetPlaybackRate({rate:1}),o&&e({action:o.increase?Un.PLAYBACK_RATE_UP:Un.PLAYBACK_RATE_DOWN,text:`${o.rate.toFixed(2)}x`});break;case"c":o=r.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":r.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":r.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":r.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":r.controls.Seek({fraction:1}),e({action:Un.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":o=r.controls.Seek({fraction:parseFloat(u.key)*.1}),e({action:o?Un.SEEK_FORWARD:Un.SEEK_BACK});break;default:return}u.preventDefault()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},Yee=({player:r})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(s=>{navigator.mediaSession.setActionHandler(s,u=>{switch(s){case"play":r.controls.Play();break;case"pause":r.controls.Pause();break;case"stop":r.controls.Stop();break;case"seekbackward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&r.controls.Seek({time:u.seekTime});break;case"previoustrack":r.controls.CollectionPlayPrevious();break;case"nexttrack":r.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=r.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(r.video.duration)?r.video.duration||0:r.video.currentTime+1,playbackRate:r.video.playbackRate,position:r.video.currentTime})},1e3);const a=r.controls.RegisterSettingsListener(()=>{const{title:s}=r.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==s)&&(navigator.mediaSession.metadata=new MediaMetadata({title:s}))});return()=>{clearInterval(t),a&&a(),navigator.mediaSession.metadata=null,e.forEach(s=>{navigator.mediaSession.setActionHandler(s,null)})}}},Qee="_container_1rhsp_1",Xee="_autohide_1rhsp_40",Zee="_seek_1rhsp_174",ete="_controls_1rhsp_207",tte="_time_1rhsp_221",nte="_spacer_1rhsp_279",rte="_watermark_1rhsp_296",Bn={container:Qee,"container--default-controls":"_container--default-controls_1rhsp_32","bottom-controls-container":"_bottom-controls-container_1rhsp_36",autohide:Xee,"info-container":"_info-container_1rhsp_43","bottom-controls-container--autohide":"_bottom-controls-container--autohide_1rhsp_44","floating-volume-toggle":"_floating-volume-toggle_1rhsp_45","icon-button":"_icon-button_1rhsp_51","icon-button-active":"_icon-button-active_1rhsp_65","info-image-container":"_info-image-container_1rhsp_106","info-image":"_info-image_1rhsp_106","info-text":"_info-text_1rhsp_122","info-headers":"_info-headers_1rhsp_131","info-description":"_info-description_1rhsp_141","info-title":"_info-title_1rhsp_147","info-subtitle":"_info-subtitle_1rhsp_152","center-play-button":"_center-play-button_1rhsp_160","center-play-button--hidden":"_center-play-button--hidden_1rhsp_167",seek:Zee,"bottom-controls-gradient":"_bottom-controls-gradient_1rhsp_194",controls:ete,"play-pause-button":"_play-pause-button_1rhsp_217",time:tte,"live-indicator":"_live-indicator_1rhsp_231","collection-button-container":"_collection-button-container_1rhsp_249","collection-button-text":"_collection-button-text_1rhsp_254","collection-button-container--loading":"_collection-button-container--loading_1rhsp_263",spacer:nte,watermark:rte,"content-verified-badge":"_content-verified-badge_1rhsp_307","content-verification-menu-button":"_content-verification-menu-button_1rhsp_308","menu-control-container":"_menu-control-container_1rhsp_322"},lD='<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>',cD='<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>',fD='<?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>',ate='<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>',dD='<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>',ite='<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>',ste='<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>',ote='<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>',A8='<?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>',pD='<?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>',ute='<?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>',Zw='<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>',lte='<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>',pL='<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>',cte='<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>',hL='<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>',fte='<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>',k8='<?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>',T8='<?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>',dte='<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>',sp='<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>',pte='<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>',hte='<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>',yte='<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>',mte='<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>',e_='<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>',yL='<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>',gte='<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>',hD='<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>',vte='<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>',bte='<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>';var vA={exports:{}},wte=vA.exports,mL;function _te(){return mL||(mL=1,(function(r,e){(function(t,a){a()})(wte,(function(){function t(s){var u=!0,o=!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 d(O){return!!(O&&O!==document&&O.nodeName!=="HTML"&&O.nodeName!=="BODY"&&"classList"in O&&"contains"in O.classList)}function y(O){var W=O.type,Z=O.tagName;return!!(Z==="INPUT"&&p[W]&&!O.readOnly||Z==="TEXTAREA"&&!O.readOnly||O.isContentEditable)}function m(O){O.classList.contains("focus-visible")||(O.classList.add("focus-visible"),O.setAttribute("data-focus-visible-added",""))}function v(O){O.hasAttribute("data-focus-visible-added")&&(O.classList.remove("focus-visible"),O.removeAttribute("data-focus-visible-added"))}function b(O){O.metaKey||O.altKey||O.ctrlKey||(d(s.activeElement)&&m(s.activeElement),u=!0)}function x(O){u=!1}function E(O){d(O.target)&&(u||y(O.target))&&m(O.target)}function C(O){d(O.target)&&(O.target.classList.contains("focus-visible")||O.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),v(O.target))}function T(O){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",R),document.addEventListener("mousedown",R),document.addEventListener("mouseup",R),document.addEventListener("pointermove",R),document.addEventListener("pointerdown",R),document.addEventListener("pointerup",R),document.addEventListener("touchmove",R),document.addEventListener("touchstart",R),document.addEventListener("touchend",R)}function M(){document.removeEventListener("mousemove",R),document.removeEventListener("mousedown",R),document.removeEventListener("mouseup",R),document.removeEventListener("pointermove",R),document.removeEventListener("pointerdown",R),document.removeEventListener("pointerup",R),document.removeEventListener("touchmove",R),document.removeEventListener("touchstart",R),document.removeEventListener("touchend",R)}function R(O){O.target.nodeName&&O.target.nodeName.toLowerCase()==="html"||(u=!1,M())}document.addEventListener("keydown",b,!0),document.addEventListener("mousedown",x,!0),document.addEventListener("pointerdown",x,!0),document.addEventListener("touchstart",x,!0),document.addEventListener("visibilitychange",T,!0),k(),s.addEventListener("focus",E,!0),s.addEventListener("blur",C,!0),s.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&s.host?s.host.setAttribute("data-js-focus-visible",""):s.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 a;try{a=new CustomEvent("focus-visible-polyfill-ready")}catch{a=document.createEvent("CustomEvent"),a.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(a)}typeof document<"u"&&t(document)}))})()),vA.exports}_te();const yD="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=",xte="_spinner_1xb2e_1",Ste="_svg_1xb2e_16",Cte="_thumbnail_1xb2e_92",Ete="_thumbnail__time_1xb2e_112",Ate="_thumbnail__text_1xb2e_124",kte="_menu_1xb2e_347",Dt={spinner:xte,"spinner--light":"_spinner--light_1xb2e_12",svg:Ste,"user-action-indicator-container":"_user-action-indicator-container_1xb2e_23","user-action-indicator-text":"_user-action-indicator-text_1xb2e_40","user-action-indicator":"_user-action-indicator_1xb2e_23","user-action-indicator-icon":"_user-action-indicator-icon_1xb2e_60","seek-container":"_seek-container_1xb2e_69",thumbnail:Cte,"thumbnail--visible":"_thumbnail--visible_1xb2e_106","thumbnail--with-text":"_thumbnail--with-text_1xb2e_109",thumbnail__time:Ete,thumbnail__text:Ate,"seek-chapter-indicator":"_seek-chapter-indicator_1xb2e_150","seek-playhead":"_seek-playhead_1xb2e_155","seek-buffer":"_seek-buffer_1xb2e_156","seek-input":"_seek-input_1xb2e_157","volume-controls":"_volume-controls_1xb2e_272","volume-slider":"_volume-slider_1xb2e_279","volume-input":"_volume-input_1xb2e_295","volume-progress":"_volume-progress_1xb2e_296",menu:kte,"menu-option":"_menu-option_1xb2e_367","menu-option-back":"_menu-option-back_1xb2e_384","menu-option-back-icon":"_menu-option-back-icon_1xb2e_388","menu-option-active":"_menu-option-active_1xb2e_403","menu-option-icon":"_menu-option-icon_1xb2e_407","menu-header":"_menu-header_1xb2e_417","verification-menu":"_verification-menu_1xb2e_424","verification-menu__group":"_verification-menu__group_1xb2e_428","verification-menu__group-icon":"_verification-menu__group-icon_1xb2e_433","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1xb2e_437","verification-menu__group-text":"_verification-menu__group-text_1xb2e_445","verification-menu__group-title":"_verification-menu__group-title_1xb2e_450","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1xb2e_450","verification-menu__loader":"_verification-menu__loader_1xb2e_465","verification-menu__details":"_verification-menu__details_1xb2e_472","verification-menu__detail":"_verification-menu__detail_1xb2e_472","verification-menu__detail-label":"_verification-menu__detail-label_1xb2e_492","verification-menu__detail-value":"_verification-menu__detail-value_1xb2e_496","verification-menu__detail-copy":"_verification-menu__detail-copy_1xb2e_503","verification-menu__inline-icon":"_verification-menu__inline-icon_1xb2e_513","verification-menu--details":"_verification-menu--details_1xb2e_521","dvr-toggle":"_dvr-toggle_1xb2e_539","dvr-toggle__border":"_dvr-toggle__border_1xb2e_545","dvr-toggle__live":"_dvr-toggle__live_1xb2e_554","dvr-toggle__dvr":"_dvr-toggle__dvr_1xb2e_554","dvr-toggle__live--active":"_dvr-toggle__live--active_1xb2e_569","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_1xb2e_569","copy-button":"_copy-button_1xb2e_721","copy-button--copied":"_copy-button--copied_1xb2e_724"},Og=({light:r,className:e=""})=>Ue.jsx("div",{className:`${e} ${Dt.spinner} ${r?Dt["spinner--light"]:""}`,children:Ue.jsx("div",{className:Dt["spinner-inner"]})}),dl=({icon:r,className:e=""})=>Ue.jsx("div",{className:`${Dt.svg} ${e}`,dangerouslySetInnerHTML:{__html:r}}),M8=async r=>{try{r=(r||"").toString(),await navigator.clipboard.writeText(r)}catch{const t=document.createElement("input");t.value=r,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gL={[Un.PLAY]:cD,[Un.PAUSE]:ate,[Un.MUTE]:A8,[Un.UNMUTE]:Zw,[Un.VOLUME_DOWN]:pD,[Un.VOLUME_UP]:Zw,[Un.SEEK_BACK]:pL,[Un.SEEK_FORWARD]:hL,[Un.PLAYBACK_RATE_DOWN]:pL,[Un.PLAYBACK_RATE_UP]:hL,[Un.SUBTITLES_ON]:hte,[Un.SUBTITLES_OFF]:yte,[Un.PLAY_PREVIOUS]:k8,[Un.PLAY_NEXT]:T8},Tte=({action:r})=>{if(!(!r||!gL[r.action]))return Ue.jsxs("div",{className:Dt["user-action-indicator-container"],children:[Ue.jsx("div",{className:Dt["user-action-indicator"],children:Ue.jsx(dl,{icon:gL[r.action],"aria-label":`Action indicator ${r}`,className:Dt["user-action-indicator-icon"]})}),r.text?Ue.jsx("div",{className:Dt["user-action-indicator-text"],children:r.text}):null]})},Mte=({player:r,time:e,progress:t,duration:a,visible:s})=>{const[u,o]=Ut.useState(null);if(!(r.thumbnailsLoaded||r.__chapterTags)||!s)return null;e=typeof e<"u"?e:t*a,t=typeof t<"u"?t:e/a;let c=100;if(u){const{width:y}=u.parentElement.getBoundingClientRect(),m=y<650?150:y<1e3?225:350;c=(y-m)/y}const p=((r.__chapterTags||[]).find(y=>y.start_time<e&&y.end_time>e)||{}).tag||"",d=r.thumbnailHandler&&r.thumbnailHandler.ThumbnailImage(e);return Ue.jsxs("div",{ref:o,style:{opacity:s?1:0,left:`${Math.min(t,c)*100}%`},className:`${Dt.thumbnail} ${s?Dt["thumbnail--visible"]:""} ${p?Dt["thumbnail--with-text"]:""}`,children:[d?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("img",{src:d,alt:"Thumbnail",className:Dt.thumbnail__image}),Ue.jsx("div",{className:Dt.thumbnail__time,children:Rg(e,a)})]}):null,p?Ue.jsx("div",{className:Dt.thumbnail__text,children:p}):null]})};let XE;const mD=({player:r,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Ut.useState(r.controls.GetCurrentTime()),[o,c]=Ut.useState(0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(r.controls.IsDVREnabled()),[v,b]=Ut.useState(0),[x,E]=Ut.useState(!1),[C,T]=Ut.useState(!1);return Ut.useEffect(()=>{d(tD(r,t));const k=E8({player:r,setCurrentTime:u,rate:60}),M=Gee({video:r.video,setBufferFraction:c}),R=r.controls.RegisterSettingsListener(()=>{r.controls&&m(r.controls.IsDVREnabled())});return()=>{k&&k(),M&&M(),R&&R()}},[r&&r.controls]),r.isLive&&!y?null:Ue.jsxs("div",{onMouseEnter:()=>{clearTimeout(XE),E(!0)},onMouseLeave:()=>{clearTimeout(XE),XE=setTimeout(()=>{T(!1),E(!1)},100)},onFocus:()=>T(!0),onBlur:()=>T(!1),onMouseMove:k=>{const{left:M,width:R}=k.currentTarget.getBoundingClientRect();b((k.clientX-M)/R)},className:`${a} ${Dt["seek-container"]} ${a}`,children:[Ue.jsx("progress",{max:1,value:r.casting?0:o,className:Dt["seek-buffer"]}),Ue.jsx("progress",{max:1,value:s/e.duration||0,className:Dt["seek-playhead"]}),Ue.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:k=>{r.controls.Seek({fraction:k.currentTarget.value})},onTouchStart:()=>E(!0),onTouchMove:k=>{const{left:M,width:R}=k.currentTarget.getBoundingClientRect(),O=k.touches[0].pageX/(R-M);b(O),r.controls.Seek({fraction:O})},onTouchEnd:()=>E(!1),onKeyDown:p,className:Dt["seek-input"]}),(r.__chapterTags||[]).map((k,M)=>Ue.jsx("div",{style:{width:`${100*(k.end_time-k.start_time)/e.duration}%`,left:`${100*k.start_time/e.duration}%`},className:Dt["seek-chapter-indicator"]},`chapter-${M}`)),Ue.jsx(Mte,{player:r,progress:C?s/e.duration:v,duration:e.duration,visible:x||C})]})},Rte=({player:r,videoState:e})=>Ue.jsxs("div",{className:Dt["volume-controls"],children:[Ue.jsx(hl,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?A8:e.volume<.4?pD:e.volume<.8?ute:Zw,onClick:()=>r.controls.ToggleMuted(),className:Dt["volume-button"]},"mute-button"),Ue.jsxs("div",{className:Dt["volume-slider"],children:[Ue.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Dt["volume-progress"]}),Ue.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>r.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:hee(r),className:Dt["volume-input"]})]})]}),gD=({player:r,Hide:e,className:t=""})=>{const[a,s]=Ut.useState(void 0),[u,o]=Ut.useState(void 0),c=Ut.createRef();if(Ut.useEffect(()=>{const m=()=>o(r.controls.GetOptions());m();const v=r.controls.RegisterSettingsListener(m);return()=>v&&v()},[]),Ut.useEffect(()=>{if(!c||!c.current)return;const m=B_({element:c.current.parentElement,Hide:e});return()=>{m&&m()}},[c]),!u)return null;const p=m=>setTimeout(()=>s(m)),d={quality:{label:"Quality",Update:m=>r.controls.SetQualityLevel(m)},audio:{label:"Audio",Update:m=>r.controls.SetAudioTrack(m)},text:{label:"Subtitles",Update:m=>r.controls.SetTextTrack(m)},profile:{label:"Player Profile",Update:m=>{m==="custom"?(r.controls.ShowPlayerProfileForm(),e()):r.controls.SetPlayerProfile({profile:m})}},rate:{label:"Playback Rate",Update:m=>r.controls.SetPlaybackRate({index:m})},advanced:{label:"Advanced",Update:m=>{m==="copy_debug_info"&&(M8(JSON.stringify(r.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${Dt.submenu} ${t}`,children:[Ue.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Dt["menu-option"]} ${Dt["menu-option-back"]}`,children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:lte},className:Dt["menu-option-back-icon"]}),Ue.jsx("div",{children:d[a].label})]}),a==="advanced"?Ue.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{d[a].Update("copy_debug_info"),p(void 0)},className:Dt["menu-option"],children:"Copy Debug Info"}):u[a].options.map(m=>Ue.jsxs("button",{role:"menuitemradio","aria-checked":m.active,autoFocus:m.active,"aria-label":`${d[a].label}: ${m.label||""}`,onClick:()=>{d[a].Update(m.index),p(void 0)},className:`${Dt["menu-option"]} ${m.active?Dt["menu-option-active"]:""}`,children:[m.label||"",m.active?Ue.jsx(dl,{icon:pte,className:Dt["menu-option-icon"]}):null]},`option-${m.index}`))]},"submenu"):y=Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${t}`,children:[u.hasQualityOptions?Ue.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Dt["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasAudioOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Dt["menu-option"],children:[`${d.audio.label}: ${u.audio.active&&u.audio.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasTextOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Dt["menu-option"],children:[`${d.text.label}: ${u.text.active&&u.text.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasProfileOptons?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Dt["menu-option"],children:[`${d.profile.label}: ${u.profile.active&&u.profile.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasRateOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Dt["menu-option"],children:[`${d.rate.label}: ${u.rate.active&&u.rate.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,Ue.jsxs("button",{autoFocus:!u.hasRateOptions&&!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Dt["menu-option"],children:[d.advanced.label,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]})]},"menu"),Ue.jsx("div",{ref:c,children:y})},vD=({player:r})=>{const[e,t]=Ut.useState(r.dvrEnabled);return Ut.useEffect(()=>{const a=r.controls.RegisterSettingsListener(()=>{r.controls&&t(r.controls.IsDVREnabled())});return()=>a&&a()},[r&&r.controls]),Ue.jsxs("div",{className:Dt["dvr-toggle"],children:[Ue.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!1),className:`${Dt["dvr-toggle__live"]} ${e?"":Dt["dvr-toggle__live--active"]}`,children:"LIVE"}),Ue.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!0),className:`${Dt["dvr-toggle__dvr"]} ${e?Dt["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Ue.jsx("div",{className:Dt["dvr-toggle__border"]})]})},Ote=({label:r,value:e,className:t=""})=>{const[a,s]=Ut.useState(!1);return Ue.jsx("button",{onClick:()=>{a||(M8(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:gte},className:[Dt["copy-button"],a?Dt["copy-button--copied"]:"",t].join(" "),title:`Copy ${r}`})},Ro=({label:r,value:e,copyable:t})=>e?Ue.jsxs("div",{className:Dt["verification-menu__detail"],children:[Ue.jsxs("label",{className:Dt["verification-menu__detail-label"],children:[r,":"]}),Ue.jsx("div",{className:Dt["verification-menu__detail-value"],children:e}),t?Ue.jsx(Ote,{label:r,value:e,className:Dt["verification-menu__detail-copy"]}):null]}):null,bD=({player:r,Hide:e,className:t=""})=>{const a=Ut.createRef(),[s,u]=Ut.useState(),[o,c]=Ut.useState(!1),[,p]=Ut.useState(!1);if(Ut.useEffect(()=>{r.__LoadVerificationDetails().then(()=>p(!0));const y=()=>u(r.controls.GetContentVerificationDetails());y();const m=r.controls.RegisterSettingsListener(y);return()=>m&&m()},[]),Ut.useEffect(()=>{if(!a||!a.current)return;const y=B_({element:a.current.parentElement,Hide:e});return()=>{y&&y()}},[a]),!s)return null;let d;return o?d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Dt["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("div",{className:Dt["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Dt["verification-menu__group-icon"],Dt["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("button",{onClick:()=>c(!0),className:Dt["verification-menu__group-title"],children:"Content Credentials"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Issued by the",Ue.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__details"],children:[Ue.jsx(Ro,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Ue.jsx(Ro,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Ue.jsx(Ro,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Ue.jsx(Ro,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Ue.jsx(Ro,{label:"Content Object Contract Address",value:s.details.explorerUrl?Ue.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Ue.jsx(Ro,{label:"Versions",value:s.details.versionCount}),Ue.jsx(Ro,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Ue.jsx(Ro,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Ue.jsx(Ro,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Ue.jsx(Ro,{label:"Latest Transaction",value:s.details._state!=="full"?Ue.jsx(Og,{className:Dt["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Ue.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Ue.jsx(Ro,{label:"Signature Algorithm",value:s.details.signatureMethod}),r.publicMetadataUrl?Ue.jsx(Ro,{label:"Public Metadata",value:Ue.jsx("a",{href:r.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:r.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Dt["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("div",{className:Dt["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Dt["verification-menu__group-icon"],Dt["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsx("div",{className:Dt["verification-menu__group-text"],children:Ue.jsxs("button",{onClick:()=>c(!0),className:Dt["verification-menu__group-title"],children:["View Content Credentials",Ue.jsx("div",{className:Dt["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:sp}})]})})]})]}),Ue.jsx("div",{ref:a,children:Ue.jsx("div",{role:"menu",className:`${Dt.menu} ${Dt["verification-menu"]} ${o?Dt["verification-menu--details"]:""} ${t}`,children:d},"menu")})},Lte=({player:r,Hide:e,className:t=""})=>{const a=Ut.createRef(),[s,u]=Ut.useState(void 0);if(Ut.useEffect(()=>{const c=()=>u(r.controls.GetCollectionInfo());c();const p=r.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ut.useEffect(()=>{if(!a||!a.current)return;const c=B_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{r.controls.CollectionPlay({mediaIndex:c}),e()};return Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${Dt["collection-menu"]} ${t}`,ref:a,children:[Ue.jsx("div",{className:`${Dt["menu-option"]} ${Dt["menu-header"]}`,children:s.title}),s.content.map((c=>Ue.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>o(c.mediaIndex),className:`${Dt["menu-option"]} ${c.active?Dt["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`)))]},"menu")},hl=({icon:r,className:e="",...t})=>Ue.jsx("button",{...t,className:`${Bn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:r}}),Nte=({player:r,videoState:e})=>{const[t,a]=Ut.useState(r.video.currentTime);return Ut.useEffect(()=>{const s=E8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.controls.IsDVRAvailable()?Ue.jsx("div",{className:Bn["live-indicator"],children:"Live"}):Ue.jsxs("div",{className:Bn.time,children:[!r.isLive||!r.controls.IsDVRAvailable()?null:Ue.jsx(vD,{player:r}),r.isLive&&!r.behindLiveEdge?null:`${Rg(t,e.duration)} / `,r.isLive&&!r.dvrEnabled?null:Rg(e.duration,e.duration)]})},Pte=({player:r})=>{const e=r.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],a=e.content[e.mediaIndex+1],s=r.controls.IsReady();return Ue.jsxs(Ue.Fragment,{children:[t?Ue.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Ue.jsx(hl,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:k8,onClick:()=>r.controls.CollectionPlayPrevious()}),Ue.jsx("div",{className:Bn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Ue.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Ue.jsx(hl,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:T8,onClick:()=>r.controls.CollectionPlayNext()}),Ue.jsx("div",{className:Bn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},wD=({label:r,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Ut.useState(!1);return Ue.jsxs("div",{className:[Bn["menu-control-container"],s].join(" "),children:[Ue.jsx(hl,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Bn["icon-button-active"]:""}),u?Ue.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},Ite=({player:r})=>{const[e,t]=Ut.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{t(void 0),o&&S8({player:r,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||r.playerOptions.title===$t.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()||r.playerOptions.title===$t.title.OFF?null:Ue.jsxs("div",{className:Bn["info-container"],children:[e?Ue.jsx("div",{className:Bn["info-image-container"],children:Ue.jsx("img",{src:e,alt:"Image",className:Bn["info-image"]})}):null,Ue.jsxs("div",{className:Bn["info-text"],children:[c.length===0?null:Ue.jsx("div",{className:Bn["info-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:Bn["info-header"],children:p},`header-${d}`))}),a?Ue.jsx("div",{className:Bn["info-title"],children:a}):null,s?Ue.jsx("div",{className:Bn["info-subtitle"],children:s}):null,u?Ue.jsx("div",{className:Bn["info-description"],children:u}):null]})]})},Dte=({player:r})=>{const[e,t]=Ut.useState(!1);return Ut.useEffect(()=>{const a=()=>r&&r.controls&&t(r.controls.ContentVerified());a();const s=r.controls&&r.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("div",{className:Bn["content-verified-badge"],children:"VERIFIED"}),Ue.jsx(wD,{label:"Content Verification Menu",icon:e_,player:r,MenuComponent:bD,className:Bn["content-verification-menu-button"]})]}):null},Ute=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ut.useState(void 0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(r.controls.IsMenuVisible());if(Ut.useEffect(()=>{if(!r.controls)return;d(eD({player:r,setRecentUserAction:s}));const E=()=>r&&r.controls&&m(r.controls.IsMenuVisible()),C=r.controls.RegisterSettingsListener(E),T=uD({player:r,setVideoState:c});return()=>{C&&C(),T&&T()}},[]),!o)return null;const v=r.controls.GetCollectionInfo(),b=a||!e||y,x=!b&&[$t.controls.AUTO_HIDE,$t.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls);return r.__SetControlsVisibility(!x),Ue.jsxs("div",{onClick:p,className:[u,Bn.container,b?"":Bn.autohide,r.playerOptions.controls!==$t.controls.DEFAULT?"":Bn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ite,{player:r},`content-info-${v&&v.mediaIndex}`),[$t.controls.DEFAULT,$t.controls.OFF,$t.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls)?null:Ue.jsxs(Ue.Fragment,{children:[Ue.jsx(hl,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${Bn["center-play-button"]} ${t&&!e&&!(r&&r.casting)?"":Bn["center-play-button--hidden"]}`}),Ue.jsxs("div",{className:`${Bn["bottom-controls-container"]} ${x?Bn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:Bn["bottom-controls-gradient"]}),Ue.jsx(mD,{player:r,videoState:o,setRecentUserAction:s,className:Bn.seek}),Ue.jsxs("div",{className:Bn.controls,children:[Ue.jsx(hl,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?dD:fD,onClick:()=>r.controls.TogglePlay(),className:Bn["play-pause-button"]}),Ue.jsx(Pte,{player:r}),Ue.jsx(Rte,{player:r,videoState:o}),Ue.jsx(Nte,{player:r,videoState:o}),Ue.jsx("div",{className:Bn.spacer}),Ue.jsx(Dte,{player:r}),r.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,r.airplayAvailable?Ue.jsx(hl,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,r.controls.IsRotatable()?Ue.jsx(hl,{"aria-label":"Rotate Video",icon:mte,onClick:()=>r.controls.SetAllowRotation(!r.controls.AllowRotation()),className:Bn["right-control-button"]}):null,r.controls.GetOptions().hasAnyOptions?Ue.jsx(wD,{label:"Settings Menu",icon:ote,player:r,MenuComponent:gD}):null,Ue.jsx(hl,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?ste:ite,onClick:()=>r.controls.ToggleFullscreen(),className:Bn["right-control-button"]})]})]})]}),r.playerOptions.controls!==$t.controls.OFF_WITH_VOLUME_TOGGLE||!r.controls.HasAudio()?null:Ue.jsx("div",{className:Bn["floating-volume-toggle"],children:Ue.jsx(hl,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?A8:Zw,onClick:()=>r.controls.ToggleMuted(),className:Bn["volume-button"]},"mute-button")}),r.playerOptions.watermark===$t.watermark.OFF?null:Ue.jsx("div",{className:Bn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]})},Fte="_spinner_1c6ar_17",Bte="_text_1c6ar_33",zte="_title_1c6ar_39",jte="_description_1c6ar_43",qte="_inputs_1c6ar_47",Hte="_input_1c6ar_47",Vte="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:Fte,"ticket-form":"_ticket-form_1c6ar_1",text:Bte,title:zte,description:jte,inputs:qte,input:Hte,submit:Vte,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Gte=({parameters:r,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=r.clientOptions||{};const c=!a||!s,[p,d]=Ut.useState(u||""),[y,m]=Ut.useState(!!u),[v,b]=Ut.useState(!1),[x,E]=Ut.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,T]=Ut.useState(void 0),k=async({client:M,code:R})=>{if(!(!R||!M)){E(""),b(!0);try{let O=o;R.includes(":")&&(O=R.split(":")[0],R=R.split(":")[1]),await M.RedeemCode({tenantId:a,ntpId:s,code:R.trim(),email:O}),t(M)}catch(O){console.log(O),E("Invalid Code"),m(!1)}finally{b(!1)}}};return Ut.useEffect(()=>{Promise.resolve().then(()=>ZI).then(async({ElvClient:M})=>{const R=await M.FromConfigurationUrl({configUrl:r.clientOptions.network});T(R),u&&k({client:R,code:u})})},[]),y?Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsx(Og,{className:ci.spinner})})}):Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsxs("form",{onSubmit:M=>{M.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Ue.jsxs("div",{className:ci.text,children:[Ue.jsx("h2",{className:ci.title,children:r.clientOptions.ticketTitle||"This content requires a code to view"}),Ue.jsx("p",{className:ci.description,children:r.clientOptions.ticketDescription||"Please enter your code below"})]}),Ue.jsxs("div",{className:ci.inputs,children:[Ue.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!x&&!c,"aria-errormessage":x,onKeyDown:M=>M.key==="Enter"&&k({client:C,code:p}),onChange:M=>{E(""),d(M.target.value)},className:ci.input}),Ue.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:v?Ue.jsx(Og,{light:!0}):"Submit"})]}),Ue.jsxs("div",{className:ci["error-message"],children:[x," "]})]})})})},$te="_container_1fkgx_1",Wte="_autohide_1fkgx_33",Kte="_title_1fkgx_133",Jte="_spacer_1fkgx_318",Yte="_watermark_1fkgx_322",Qte="_menu_1fkgx_144",vn={container:$te,"container--default-controls":"_container--default-controls_1fkgx_28",autohide:Wte,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_1fkgx_36","icon-button":"_icon-button_1fkgx_42","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_1fkgx_59","icon-button-active":"_icon-button-active_1fkgx_72","icon-button--circle-focus":"_icon-button--circle-focus_1fkgx_72","text-button":"_text-button_1fkgx_85","text-button--active":"_text-button--active_1fkgx_90","bottom-controls-container":"_bottom-controls-container_1fkgx_36","bottom-controls-gradient":"_bottom-controls-gradient_1fkgx_107","center-play-button":"_center-play-button_1fkgx_119","center-play-button--hidden":"_center-play-button--hidden_1fkgx_126","title-container":"_title-container_1fkgx_133",title:Kte,"menu-control-container":"_menu-control-container_1fkgx_144","time-container":"_time-container_1fkgx_148","live-indicator":"_live-indicator_1fkgx_155","bottom-controls":"_bottom-controls_1fkgx_36","center-buttons":"_center-buttons_1fkgx_183","play-pause-button":"_play-pause-button_1fkgx_193","track-button":"_track-button_1fkgx_196","bottom-left-controls":"_bottom-left-controls_1fkgx_200","bottom-right-controls":"_bottom-right-controls_1fkgx_201","info-box-container":"_info-box-container_1fkgx_218","info-box":"_info-box_1fkgx_218","info-box-image-container":"_info-box-image-container_1fkgx_241","info-box-image":"_info-box-image_1fkgx_241","info-box-text":"_info-box-text_1fkgx_257","info-box-text--top-padding":"_info-box-text--top-padding_1fkgx_264","info-box-headers":"_info-box-headers_1fkgx_268","info-box-description":"_info-box-description_1fkgx_276","info-box-title":"_info-box-title_1fkgx_280","info-box-button":"_info-box-button_1fkgx_285","info-box-button--restart":"_info-box-button--restart_1fkgx_300",spacer:Jte,watermark:Yte,menu:Qte},Ef=({icon:r,...e})=>Ue.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:r}}),Xte=({player:r,videoState:e})=>{const[t,a]=Ut.useState(r.video.currentTime);return Ut.useEffect(()=>{const s=E8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.dvrEnabled?null:Ue.jsxs("div",{className:vn["time-container"],children:[r.isLive&&!r.behindLiveEdge?null:Ue.jsx("div",{className:vn.time,children:Rg(t,e.duration)}),Ue.jsx("div",{className:vn.spacer}),Ue.jsx("div",{className:vn.time,children:Rg(e.duration,e.duration)})]})},Zte=({player:r,videoState:e})=>{const t=r.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=r.controls.IsReady();return Ue.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!a,icon:k8,onClick:()=>r.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Back 10 Seconds",icon:cte,onClick:()=>r.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Ue.jsx(Ef,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?dD:fD,onClick:()=>r.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Forward 10 Seconds",icon:fte,onClick:()=>r.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!s,icon:T8,onClick:()=>r.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},bA=({label:r,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Ut.useState(!1);return Ue.jsxs("div",{className:vn["menu-control-container"],children:[e?Ue.jsx(Ef,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Ue.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Ue.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},ene=({player:r,Hide:e})=>{const[t,a]=Ut.useState(void 0),{title:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{a(void 0),o&&S8({player:r,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Ut.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Ue.jsxs("div",{className:vn["info-box-container"],children:[Ue.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Ue.jsxs("div",{className:vn["info-box"],children:[t?Ue.jsx("div",{className:vn["info-box-image-container"],children:Ue.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Ue.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Ue.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Ue.jsx("div",{className:vn["info-box-title"],children:s||""}),Ue.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Ue.jsx("div",{className:vn["info-box-actions"],children:Ue.jsxs("button",{onClick:()=>{r.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Ue.jsx(dl,{icon:cD}),"From Beginning"]})})]})]})},tne=({player:r})=>{const[e,t]=Ut.useState(!1);return Ut.useEffect(()=>{const a=()=>t(r.controls.ContentVerified());a(),r.controls.RegisterSettingsListener(a)},[]),e?Ue.jsx(bA,{label:"Content Verification Menu",icon:e_,player:r,MenuComponent:bD,className:vn["content-verification-menu-button"],children:"Verified"}):null},nne=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ut.useState(void 0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(!1);if(Ut.useEffect(()=>{d(eD({player:r,setRecentUserAction:s}));const C=uD({player:r,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:v}=r.controls.GetContentInfo()||{},b=r.controls.GetCollectionInfo(),x=a||!e||r.controls.IsMenuVisible(),E=!x&&r.playerOptions.controls===$t.controls.AUTO_HIDE;return r.__SetControlsVisibility(!E),Ue.jsxs("div",{onClick:p,className:[u,vn.container,x?"":vn.autohide,r.playerOptions.controls!==$t.controls.DEFAULT?"":vn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ef,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!r.casting?"":vn["center-play-button--hidden"]}`}),y?Ue.jsx(ene,{player:r,Hide:()=>m(!1)}):Ue.jsxs("div",{className:`${vn["bottom-controls-container"]} ${E?vn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:vn["bottom-controls-gradient"]}),Ue.jsxs("div",{className:vn["title-container"],children:[Ue.jsx("div",{className:vn.title,children:r.playerOptions.title===$t.title.OFF||r.playerOptions.title===$t.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()?"":v||""}),Ue.jsx("div",{className:vn.spacer}),r.isLive?r.controls.IsDVRAvailable()?Ue.jsx(vD,{player:r}):Ue.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,b?Ue.jsx(bA,{label:"Collection Menu",icon:dte,player:r,MenuComponent:Lte}):null]}),Ue.jsx(mD,{player:r,videoState:o,setRecentUserAction:s}),Ue.jsx(Xte,{player:r,videoState:o}),Ue.jsxs("div",{className:vn["bottom-controls"],children:[Ue.jsx("div",{className:vn["bottom-left-controls"],children:!v||r.playerOptions.title===$t.title.OFF?null:Ue.jsx("button",{className:vn["text-button"],onClick:()=>m(!0),children:"Info"})}),Ue.jsx(Zte,{player:r,videoState:o}),Ue.jsxs("div",{className:vn["bottom-right-controls"],children:[Ue.jsx(tne,{player:r}),r.airplayAvailable?Ue.jsx(Ef,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,r.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,r.controls.GetOptions().hasAnyOptions?Ue.jsx(bA,{label:"Settings",player:r,MenuComponent:gD,children:"Settings"},"settings-button"):null]})]})]}),r.playerOptions.watermark===$t.watermark.OFF?null:Ue.jsx("div",{className:vn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]},"controls")},rne="_container_1l7ln_1",ane="_overlay_1l7ln_9",ine="_form_1l7ln_22",sne="_header_1l7ln_39",one="_input_1l7ln_45",une="_actions_1l7ln_92",lne="_submit_1l7ln_98",cne="_cancel_1l7ln_99",Js={container:rne,overlay:ane,form:ine,header:sne,"input-container":"_input-container_1l7ln_45",input:one,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:une,submit:lne,cancel:cne},fne=({player:r,Close:e})=>{const[t,a]=Ut.useState(),[s,u]=Ut.useState(!1),[o,c]=Ut.useState(""),p=Ut.useRef();Ut.useEffect(()=>{if(!p||!p.current)return;const y=B_({element:p.current,Hide:e});return()=>y&&y()},[p]),Ut.useEffect(()=>{let y={...r.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await r.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(m){c(m.toString()),u(!1)}};return Ue.jsx("div",{role:"complementary",tabIndex:-1,className:Js.container,children:Ue.jsx("div",{className:Js.overlay,children:Ue.jsxs("form",{onSubmit:d,className:Js.form,ref:p,children:[Ue.jsx("h2",{className:Js.header,children:"Custom hls.js Options"}),Ue.jsxs("div",{className:Js["input-container"],children:[Ue.jsx("textarea",{disabled:s,autoFocus:!0,value:t,title:o,"aria-label":"Player Options","aria-invalid":!!o,"aria-errormessage":o||"",onChange:y=>a(y.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),a(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(y){c(y.toString())}},className:`${Js.input} ${o?Js["input--invalid"]:""}`}),Ue.jsxs("div",{className:Js["player-info"],children:[Ue.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Js["api-link"],children:"API Docs"}),Ue.jsxs("div",{className:Js["player-version"],children:["hls.js ",r.HLS.version]})]})]}),Ue.jsxs("div",{className:Js.actions,children:[Ue.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Js.cancel,children:"Cancel"}),Ue.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Js.submit,children:s?Ue.jsx(Og,{light:!0}):"Submit"})]})]})})})},dne=({player:r})=>{const[e,t]=Ut.useState(void 0),{posterImage:a}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{t(void 0),a&&S8({player:r,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Ue.jsx("img",{alt:"Video Poster",src:e,className:Rs.poster}):null};let pne;const hne=({target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Ut.useState(void 0),[d,y]=Ut.useState(void 0),[m,v]=Ut.useState("lg"),[b,x]=Ut.useState("landscape"),[E,C]=Ut.useState({width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height}),[T,k]=Ut.useState(void 0),[M,R]=Ut.useState(!1),[O,W]=Ut.useState(!1),[Z,se]=Ut.useState(!1),[ye,he]=Ut.useState(!1),[te,re]=Ut.useState(!1),[S,_]=Ut.useState(!1),[P,j]=Ut.useState(!0),[q,B]=Ut.useState(void 0),[X,$]=Ut.useState(void 0),[D,N]=Ut.useState(!1),Y=Ut.useRef(),ie=!!c,V=({action:Oe,text:Se})=>B({action:Oe,text:Se,key:Math.random()});if(Ut.useEffect(()=>{re(!0);const Oe=$ee({target:r,setSize:v,setOrientation:x,setDimensions:C});return()=>{re(!1),Oe&&Oe()}},[]),Ut.useEffect(()=>{if(!(!Y||!Y.current||!te))try{R(!1),se(!1),e.clientOptions.client=d||e.clientOptions.client;const Oe=new Yw({target:r,video:Y.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:fe=>{o(fe)}});window.__elvPlayer=Oe;const Se=Oe.controls.RegisterSettingsListener(()=>{$(Oe.controls.AllowRotation()),se(Oe.playbackStarted),R(!Oe.loading),_(Oe.__showPlayerProfileForm),N(Oe&&Oe.casting)});Oe.Destroy=()=>{Oe.__DestroyPlayer(),s()},Oe.Reset=()=>{u()};const Te=Wee({player:Oe}),oe=Kee({player:Oe,inactivityPeriod:5e3,onWake:()=>j(!0),onSleep:()=>j(!1)}),ce=Jee({player:Oe,setRecentUserAction:V}),be=Yee({player:Oe});t(Oe),p(Oe);const me=Oe.controls.RegisterVideoEventListener("canplay",()=>he(!0));return()=>{Y&&Y.current&&Y.current.removeEventListener("play",se),Se&&Se(),Te&&Te(),oe&&oe(),ce&&ce(),be&&be(),me&&me(),Oe&&Oe.__DestroyPlayer()}}catch(Oe){a(Oe),s()}},[Y,te,d]),Ut.useEffect(()=>{setTimeout(()=>W(!0),2e3)},[M]),Ut.useEffect(()=>{if(ie)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[ie]),Ut.useEffect(()=>{q&&(clearTimeout(pne),setTimeout(()=>{B(void 0)},1e3))},[q]),e.clientOptions.promptTicket&&!d)return Ue.jsx(Gte,{parameters:e,dimensions:{size:m,orientation:b,...E},onComplete:Oe=>y(Oe)});const Ce=e.playerOptions.ui===$t.ui.WEB&&c&&c.controls.IsRotatable()&&X;return Ue.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Ce?E.height:E.width}px`,"--portal-height":`${Ce?E.width:E.height}px`},className:[Rs["player-container"],Ce?Rs["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!S||!M?null:Ue.jsx(fne,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Ue.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:Y,muted:[$t.muted.ON,$t.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===$t.controls.DEFAULT,loop:e.playerOptions.loop===$t.loop.ON,crossOrigin:"anonymous",className:Rs.video}),!O||!ye||Z&&!e.playerOptions.permanentPoster?null:Ue.jsx(dne,{player:c}),M||T||!e.playerOptions.showLoader?null:Ue.jsx("div",{className:Rs["spinner-container"],children:Ue.jsx(Og,{className:Rs.spinner})}),D?Ue.jsx("div",{className:Rs["cast-indicator-container"],children:Ue.jsx("div",{dangerouslySetInnerHTML:{__html:vte}})}):null,T?Ue.jsxs("div",{className:Rs["error-message"],children:[Ue.jsx("div",{className:Rs["error-message__message"],children:T}),Ue.jsxs("button",{className:Rs["error-message__copy-debug-button"],onClick:()=>M8(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Ue.jsx(dl,{icon:bte,className:Rs["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===$t.ui.WEB?Ue.jsx(Ute,{player:c,playbackStarted:!!Z,canPlay:ye,recentlyInteracted:P,setRecentUserAction:V,className:Rs.controls}):Ue.jsx(nne,{player:c,playbackStarted:!!Z,canPlay:ye,recentlyInteracted:P,setRecentUserAction:V,className:Rs.controls}):null,q?Ue.jsx(Tte,{action:q},`action-indicator-${q&&q.key}`):null]})},yne=({parameters:r,...e})=>{const[t,a]=Ut.useState(Math.random()),[s,u]=Ut.useState();return Ut.createElement(hne,{...e,SetAdditionalParameters:u,parameters:s?C8(r,s):r,key:`player-${t}`,Reset:()=>a(Math.random())})},mne=(r,e)=>(r.innerHTML="",r.classList.add(mq.reset),r.classList.add(Rs["player-target"]),e=nD(e),e.playerOptions&&e.playerOptions.backgroundColor&&(r.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=Tq.createRoot(r);s.render(Ue.jsx(hq.StrictMode,{children:Ue.jsx(yne,{target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:async()=>{try{await s.unmount()}catch(u){console.error("Failed to unmount Eluvio Player"),console.error(u)}}})}))}));exports.Initialize=mne;exports.PlayerParameters=$t;exports.commonjsGlobal=bu;exports.crypto=xL;exports.getDefaultExportFromCjs=xu;exports.require$$3=n_;exports.requireBuffer=Ng;exports.requireEvents=Hg;exports.requireInherits_browser=lN;exports.requireString_decoder=zP;
|
|
380
|
+
`)[0].split("?"),[m,v]=y.split("#"),b=v.split("=")[1].split(",").map(C=>parseInt(C)),x=new URLSearchParams(`?${m}`),E=new URL(e);E.searchParams.set("authorization",t),E.pathname=Nw(E.pathname.split("/").slice(0,-1).join("/"),d),x.forEach((C,T)=>E.searchParams.set(C,T)),s[p].imageUrl=E.toString(),s[p].thumbnailPosition=b,c[E.toString()]=!0,delete s[p].tag.text,delete s[p].text}),await Promise.all(Object.keys(c).map(async p=>{const d=new Image;await new Promise(y=>{d.src=p,d.crossOrigin="anonymous",d.onload=()=>{y()}}),c[p]=d})),this.maxInterval=Math.ceil(u),this.thumbnailImages=c,this.thumbnails=s,this.intervalTree=See(s,"Thumbnails"),this.loaded=!0}ThumbnailImage(e){if(!this.intervalTree)return;const t=this.intervalTree.search(e,e+this.maxInterval)[0];if(!t)return;const a=this.thumbnails&&this.thumbnails[t?.toString()];if(!a)return;this.thumbnailCanvas||(this.thumbnailCanvas=document.createElement("canvas"));const s=this.thumbnailImages[a.imageUrl];if(s){const[u,o,c,p]=a.thumbnailPosition;return this.thumbnailCanvas.height=p,this.thumbnailCanvas.width=c,this.thumbnailCanvas.getContext("2d").drawImage(s,u,o,c,p,0,0,c,p),this.thumbnailCanvas.toDataURL("image/png")}}}const Eee=/iPhone|iPad|iPod/i.test(navigator.userAgent),fL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),Aee={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Yw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t);const a=()=>this.video.removeEventListener(e,t);return this.__listenerDisposers.push(a),()=>{a(),this.__listenerDisposers=this.__listenerDisposers.filter(s=>s!==a)}}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:a,Reload:s,UpdateParameters:u,SetErrorMessage:o}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new pee({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=fL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[$t.controls.ON,$t.controls.AUTO_HIDE].includes(a.playerOptions.controls),this.__error=void 0,this.__ReloadComponent=s,this.__UpdateParameters=u,this.SetErrorMessage=(c,p)=>{o(c),this.__error=p};try{a.playerOptions.hlsjsOptions&&Object.keys(a.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=a.playerOptions.hlsjsOptions,a.playerOptions.playerProfile=$t.playerProfile.CUSTOM)}catch(c){this.Log(c,!0)}this.__Initialize(a)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>ZI);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(gc.Utils.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:10080*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 M=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(M.mediaHash).objectId,t.versionHash=M.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{},clip_start:(t.options||{}).clip_start||t.clipStart,clip_end:(t.options||{}).clip_end||t.clipEnd},o,c;if((u.clip_start||u.clip_end)&&(o=parseFloat(u.clip_start||0),c=parseFloat(u.clip_end||0),delete u.clip_start,delete u.clip_end),!t.channel){let M=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(a=M.default?"default":Object.keys(M)[0],t.offering?a=M[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(O=>M[O]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(O=>M[O])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const R=M[a]&&M[a].properties||{};s=M[a].uri,this.sourceOptions.contentInfo.liveDVR===$t.liveDVR.ON&&R.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=R.live}const p=async M=>t.directLink?await e.PlayoutOptions({offeringURI:s,options:M}):await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:M});if(!this.sourceOptions.playoutOptions){let M;if(!o&&!c)M=await p(u);else if(!t.clipRelativeToUntrimmed)M=await p({...u,clip_start:o,clip_end:c});else{M=await p(u);let R;try{for(const O of Object.keys(M||{})){for(const W of Object.keys(M[O].playoutMethods||{}))if(typeof(M[O].playoutMethods[W].properties||{}).start_offset_float<"u"){R=parseFloat(M[O].playoutMethods[W].properties.start_offset_float);break}if(typeof R<"u")break}}catch(O){this.Log("Failed to load content offset for clip adjustment:"),this.Log(O,!0)}M=await p({...u,clip_start:(o||0)-(R||0),clip_end:(c||0)-(R||0)||9999999})}this.sourceOptions.playoutOptions=M}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:s,options:u})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:u}));let d=(await e.AvailableDRMs()).filter(M=>(this.sourceOptions.drms||[]).includes(M)),y=this.sourceOptions.protocols,m,v;for(;!(m&&v);){m=y.find(R=>this.sourceOptions.playoutOptions[R]);const M=Object.keys(this.sourceOptions.playoutOptions[m].playoutMethods);if(v=(this.sourceOptions.drms||[]).length===0?M.find(R=>R!=="clear")||M[0]:this.sourceOptions.drms.sort().reverse().find(R=>d.includes(R)&&this.sourceOptions.playoutOptions[m].playoutMethods[R]),!v&&(y=y.filter(R=>R!==m),y.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:b,drms:x,thumbnailTrack:E,properties:C}=this.sourceOptions.playoutOptions[m].playoutMethods[v],T=b.split("/").find(M=>M.startsWith("hq__")),k=(C||{}).start_offset_float||0;return{playoutParameters:{...t,options:u},protocol:m,drm:v,playoutUrl:b,thumbnailTrackUrl:E,objectId:e.utils.DecodeVersionHash(T).objectId,versionHash:T,drms:x,availableDRMs:d,offeringURI:s,offering:a,compositionKey:t.channel,clipStart:u.clip_start,clipEnd:u.clip_end,trimOffset:k,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:a}){t&&(e=this.collectionInfo.content.find(s=>s.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof a<"u"?a:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:a}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!a)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const s=await this.__Client();try{const u=this.sourceOptions.playoutParameters.authorizationToken;t=t||await s.LatestVersionHash({objectId:e});const c=(await s.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:u,produceLinkUrls:!0})||[]).find(p=>p.id===a);if(!c)throw{displayMessage:`No collection with ID ${a} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,d)=>({...p,active:d===0,mediaId:p.id,mediaIndex:d,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(y=>y.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(u){throw this.Log("Failed to load collection:"),u}}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=nD(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=$t.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Fq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",M=>{this.airplayAvailable=M.availability==="available",this.__SettingsUpdate()});const a=this.__RegisterVideoEventListener("timeupdate",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate(),a()});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===$t.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const M=this.video.duration-this.video.currentTime;this.behindLiveEdge=M>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{objectId:s,versionHash:u,playoutUrl:o,thumbnailTrackUrl:c,protocol:p,drm:d,drms:y,multiviewOptions:m,playoutParameters:v,trimOffset:b,offering:x,compositionKey:E,clipStart:C,clipEnd:T}=await this.__PlayoutOptions();this.playoutInfo={objectId:s,versionHash:u,offering:x,compositionKey:E,trimOffset:b,clipStart:C,clipEnd:T},this.contentHash=u,o=new URL(o);const k=this.sourceOptions.playoutParameters.authorizationToken||o.searchParams.get("authorization");if(this.authorizationToken=k,this.playoutUrl=o.toString(),this.thumbnailTrackUrl=c,this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:v}),this.__destroyed)return;p==="hls"?await this.__InitializeHLS({playoutUrl:o,authorizationToken:k,drm:d,drms:y,multiviewOptions:m}):await this.__InitializeDash({playoutUrl:o,authorizationToken:k,drm:d,drms:y,multiviewOptions:m}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-C8OZKhRN.js")).then(({InitializeMuxMonitoring:M})=>M({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:o,authorizationToken:k,disableCookies:this.playerOptions.collectVideoAnalytics===$t.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.loadChapters&&this.__LoadChapters({...this.playoutInfo||{}}).then(M=>this.__chapterTags=M).catch(M=>this.Log(M,!0)),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,this.thumbnailTrackUrl&&(this.thumbnailHandler=new Cee(this.thumbnailTrackUrl,b||0),this.thumbnailHandler.LoadThumbnails().then(()=>{this.thumbnailsLoaded=!0,this.__SettingsUpdate()}))}catch(a){let s;if(a&&[401,403].includes(a.status)||[401,403].includes(a.code))try{const u=await this.__Client(),o=this.sourceOptions.playoutParameters.linkPath?await u.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await u.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});s=await u.ContentObjectMetadata({versionHash:o,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),s?(a.permission_message=s,this.SetErrorMessage(s,a),typeof a=="object"?a.permission_message=s:this.Log(s,!0)):this.SetErrorMessage(a.displayMessage||"Insufficient permissions",a)}catch(u){this.SetErrorMessage(u.displayMessage||"Insufficient permissions",u)}else a.status>=500?this.__HardReload(a,1e4):this.__HardReload(a,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(a,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}){this.HLS=(await Promise.resolve().then(()=>require("./hls-DM9gWZ70.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&Eee&&this.playerOptions.preferNativeHLS||[$t.drms.FAIRPLAY,$t.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===$t.drms.FAIRPLAY?Uq({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),u.enabled){const c=u.SwitchView;u.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(a===$t.drms.PLAYREADY||a===$t.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,v)=>{m.open("POST",v,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},a===$t.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===$t.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(Aee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===$t.playerProfile.CUSTOM?this.customHLSOptions:{};this.sourceOptions.playoutParameters&&this.sourceOptions.playoutParameters.channel&&Object.keys(d).length===0&&(p.maxBufferHole=4.2),this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...c,...p,...d},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const y=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(E=>typeof E<"u").reverse();x.length===v.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),x=x.filter(E=>E>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.map(E=>y.removeLevel(E))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const m=u.SwitchView;u.SwitchView=async v=>{await m(v),y.nextLevel=y.currentLevel},this.controls.InitializeMultiViewControls(u)}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(m=>y.on(m,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const m=(this.controls.GetAudioTracks().options||[]).find(v=>v.label===this.sourceOptions.playoutParameters.audioTrackLabel);m&&this.controls.SetAudioTrack(m.index)}),this.SetPlayerProfile=async({profile:m,customHLSOptions:v={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:m,hlsjsOptions:v}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=v;const b=!this.video.paused,x=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(E){this.Log("Failed to destroy HLS player",!0),this.Log(E,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=x)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(m,v)=>{if(this.errors+=1,this.Log(`Encountered ${v.details}`,!0),this.Log(v,!0),v.response&&v.response.code===403)this.SetErrorMessage("Insufficient permissions",v);else if(this.errors<5){if(v.fatal)v.data&&v.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(v);else if(v.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let b=this.video&&this.video.currentTime;this.stallTimeout=setTimeout(()=>{this.video&&this.video.currentTime>b||(this.Log("Buffer Stalled. Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError(),this.stallTimeout=setTimeout(()=>{this.Log("Buffer Stalled. Reloading player...",!0),this.__HardReload(v,0,b)},6e3))},6e3)}}else this.__HardReload(v)}),this.hlsPlayer=y,this.player=y,o){const m=document.createElement("source");m.src=this.playoutUrl.toString(),this.video.appendChild(m),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-DK6_ZBJe.js")).then(c=>c.dash_all_min)).default;const u=this.Dash.MediaPlayer().create(),o=this.playerOptions.dashjsOptions||{};if(u.updateSettings({...o,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(o.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(o.streaming||{}).text||{}},...o.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&u.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&u.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),u.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),a===$t.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===$t.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=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.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=u,this.dashPlayer=u}async __Play(){try{return await this.video.play(),!0}catch(e){if(e&&(e.toString()||"").includes("AbortError"))return!1;if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===$t.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 a=await this.__Client();let s=!1;try{await a.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{s=!0}let u=new URL((await a.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),o=`s/${a.NetworkInfo().name}`;return s&&(o=`t/${t}`),u.pathname=`${o}/q/${e}/meta/public`,u.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 a=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:a,address:e.utils.HashToAddress(a),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,a=await e.ContentObjectTenantId({objectId:t}),s=await e.ContentSpaceId();let u,o,c;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{u=await e.ContentObjectMetadata({libraryId:s.replace("ispc","ilib"),objectId:a.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:a,tenantAddress:e.utils.HashToAddress(a),tenantName:u,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,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.playoutUrl=void 0,this.thumbnailTrackUrl=void 0,this.thumbnailHandler=void 0,this.thumbnailsLoaded=void 0,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0,this.__chapterTags=void 0,this.playoutInfo=void 0}}async __HardReload(e,t=6e3,a){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}this.playoutUrl&&this.playoutUrl.includes("hls-widevine")&&this.__ReloadComponent();try{if(e&&this.playerOptions.restartCallback)try{const s=await this.playerOptions.restartCallback(e);if(s&&typeof s=="boolean"){this.Destroy();return}}catch(s){this.Log("Restart callback failed:"),this.Log(s)}if(t>0&&(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(s=>setTimeout(s,t))),this.__destroyed)return;this.Log("Reloading stream");try{const s=await this.__Client();s.region?await s.UseRegion({region:s.region}):s.Nodes().fabricURIs.length>1&&await s.ResetRegion()}catch(s){this.Log("Client region reset failed:"),this.Log(s)}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:a||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()}async __LoadChapters({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:Nw("/tagstore",e,"tracks"),format:"JSON"});if(o.find(c=>c.name==="chapter"))return((await this.__QueryAIAPI({objectId:e,path:t||a?Nw("/tagstore",e,"compositions","tags"):Nw("/tagstore",e,"tags"),queryParams:{channel_key:a,offering_key:t,limit:1e6,track:"chapter",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).filter(c=>typeof c.start_time<"u"&&typeof c.tag=="string").sort((c,p)=>c.start_time<p.start_time?-1:1).map(c=>({...c,start_time:c.start_time/1e3,end_time:c.end_time/1e3})).map((c,p,d)=>({...c,end_time:(d[p+1]||{}).start_time||c.end_time}))}async __QueryAIAPI({server:e="ai",method:t="GET",path:a,objectId:s,queryParams:u={},body:o,stringifyBody:c=!0,authTokenInBody:p=!1,headers:d={},format:y="json",allowStatus:m=[]}){const v=new URL(`https://${e}.contentfabric.io/`);v.pathname=a,Object.keys(u).forEach(C=>u[C]&&v.searchParams.set(C,u[C]));const b=await this.__Client(),x=(this.sourceOptions.playoutParameters||{}).authorizationToken||new URL(await b.FabricUrl({versionHash:await b.LatestVersionHash({objectId:s}),channelAuth:!0})).searchParams.get("authorization");v.searchParams.set("authorization",x),p&&(o.append?o.append("authorization",x):o.authorization=x),o&&c&&(o=JSON.stringify(o));const E=await fetch(v,{method:t,headers:d,body:o});if(E.status>=400&&!m.includes(E.status))throw E;if(E.status!==204)return y?await b.utils.ResponseToFormat(y,E):E}}Yw.EluvioPlayerParameters=$t;Yw.EluvioPlayer=Yw;var rD=(function(){if(typeof Map<"u")return Map;function r(e,t){var a=-1;return e.some(function(s,u){return s[0]===t?(a=u,!0):!1}),a}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 a=r(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=r(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=r(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~r(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,a){a===void 0&&(a=null);for(var s=0,u=this.__entries__;s<u.length;s++){var o=u[s];t.call(a,o[1],o[0])}},e})()})(),gA=typeof window<"u"&&typeof document<"u"&&window.document===document,Qw=(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")()})(),kee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Qw):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),Tee=2;function Mee(r,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,r()),a&&c()}function o(){kee(u)}function c(){var p=Date.now();if(t){if(p-s<Tee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var Ree=20,Oee=["top","right","bottom","left","width","height","size","weight"],Lee=typeof MutationObserver<"u",Nee=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Mee(this.refresh.bind(this),Ree)}return r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},r.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},r.prototype.connect_=function(){!gA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Lee?(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)},r.prototype.disconnect_=function(){!gA||!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)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=Oee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),aD=(function(r,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(r,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return r}),L0=(function(r){var e=r&&r.ownerDocument&&r.ownerDocument.defaultView;return e||Qw}),iD=F_(0,0,0,0);function Xw(r){return parseFloat(r)||0}function dL(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=r["border-"+s+"-width"];return a+Xw(u)},0)}function Pee(r){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=r["padding-"+u];t[u]=Xw(o)}return t}function Iee(r){var e=r.getBBox();return F_(0,0,e.width,e.height)}function Dee(r){var e=r.clientWidth,t=r.clientHeight;if(!e&&!t)return iD;var a=L0(r).getComputedStyle(r),s=Pee(a),u=s.left+s.right,o=s.top+s.bottom,c=Xw(a.width),p=Xw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=dL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=dL(a,"top","bottom")+o)),!Fee(r)){var d=Math.round(c+u)-e,y=Math.round(p+o)-t;Math.abs(d)!==1&&(c-=d),Math.abs(y)!==1&&(p-=y)}return F_(s.left,s.top,c,p)}var Uee=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof L0(r).SVGGraphicsElement}:function(r){return r instanceof L0(r).SVGElement&&typeof r.getBBox=="function"}})();function Fee(r){return r===L0(r).document.documentElement}function Bee(r){return gA?Uee(r)?Iee(r):Dee(r):iD}function zee(r){var e=r.x,t=r.y,a=r.width,s=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return aD(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function F_(r,e,t,a){return{x:r,y:e,width:t,height:a}}var jee=(function(){function r(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=F_(0,0,0,0),this.target=e}return r.prototype.isActive=function(){var e=Bee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},r})(),qee=(function(){function r(e,t){var a=zee(t);aD(this,{target:e,contentRect:a})}return r})(),Hee=(function(){function r(e,t,a){if(this.activeObservations_=[],this.observations_=new rD,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=a}return r.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 L0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new jee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},r.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 L0(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))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new qee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),sD=typeof WeakMap<"u"?new WeakMap:new rD,oD=(function(){function r(e){if(!(this instanceof r))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=Nee.getInstance(),a=new Hee(e,t,this);sD.set(this,a)}return r})();["observe","unobserve","disconnect"].forEach(function(r){oD.prototype[r]=function(){var e;return(e=sD.get(this))[r].apply(e,arguments)}});var Vee=(function(){return typeof Qw.ResizeObserver<"u"?Qw.ResizeObserver:oD})();const B_=({element:r,Hide:e})=>{if(!r)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{r.contains(u.target)||e()};let s=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",a,!0)},0);return()=>{clearTimeout(s),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",a,!0)}},uD=({player:r,setVideoState:e})=>{const t=function(){if(!r||!r.controls)return;const u=r.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>r.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:r.controls.IsPlaying(),duration:r.controls.GetDuration(),volume:r.controls.GetVolume(),muted:r.controls.IsMuted(),rate:r.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>r.video.addEventListener(u,t)),r.target.addEventListener("fullscreenchange",t);const s=r.castHandler&&r.castHandler.RegisterListener(t);return()=>{a.map(u=>r.video.removeEventListener(u,t)),r.target.removeEventListener("fullscreenchange",t),s&&s()}},Gee=({video:r,setBufferFraction:e})=>{const t=()=>{if(!isFinite(r.duration))return 1;const a=r.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>r.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(r.duration-s)/r.duration)};return r.addEventListener("progress",t),()=>r.removeEventListener("progress",t)},E8=({player:r,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{r.controls&&t(r.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},$ee=({target:r,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=r.getBoundingClientRect();let p="sm",d="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&&(d="portrait"),e(p),t(d),s=setTimeout(()=>{a({width:c.width,height:c.height})},500)};u();const o=new Vee(u);return o.observe(r),()=>o.disconnect()},Wee=({player:r})=>{const e=r.video,t=r.playerOptions.autoplay===$t.autoplay.WHEN_VISIBLE,a=r.playerOptions.muted===$t.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(r.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(r.controls.Pause(),s="pause")),a&&(u!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,u="unmute"):u!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,u="mute"))},c=new window.IntersectionObserver(o,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Kee=({player:r,inactivityPeriod:e=3e3,onSleep:t,onWake:a})=>{let s;const u=p=>{clearTimeout(s),a&&a(),s=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},o=["play","pause","volumechange","seeking"];o.forEach(p=>r.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","fullscreenchange"];return c.forEach(p=>r.target.addEventListener(p,u)),()=>{o.map(p=>r.video.removeEventListener(p,u)),c.map(p=>r.target.removeEventListener(p,u))}},Jee=({player:r,setRecentUserAction:e})=>{if(r.playerOptions.keyboardControls===$t.keyboardControls.OFF)return;const t=r.playerOptions.keyboardControls===$t.keyboardControls.ARROW_KEYS_DISABLED,a=tD(r,e)(),s=u=>{if(!(r.target===u.target||r.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||r.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=r.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":r.controls.ToggleFullscreen();break;case"m":o=r.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=r.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=r.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":r.video.paused&&(r.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":r.video.paused&&(r.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=r.controls.GetPlaybackRates();c.active?o=r.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=r.controls.SetPlaybackRate({rate:1}),o&&e({action:o.increase?Un.PLAYBACK_RATE_UP:Un.PLAYBACK_RATE_DOWN,text:`${o.rate.toFixed(2)}x`});break;case"c":o=r.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":r.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":r.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":r.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":r.controls.Seek({fraction:1}),e({action:Un.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":o=r.controls.Seek({fraction:parseFloat(u.key)*.1}),e({action:o?Un.SEEK_FORWARD:Un.SEEK_BACK});break;default:return}u.preventDefault()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},Yee=({player:r})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(s=>{navigator.mediaSession.setActionHandler(s,u=>{switch(s){case"play":r.controls.Play();break;case"pause":r.controls.Pause();break;case"stop":r.controls.Stop();break;case"seekbackward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&r.controls.Seek({time:u.seekTime});break;case"previoustrack":r.controls.CollectionPlayPrevious();break;case"nexttrack":r.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=r.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(r.video.duration)?r.video.duration||0:r.video.currentTime+1,playbackRate:r.video.playbackRate,position:r.video.currentTime})},1e3);const a=r.controls.RegisterSettingsListener(()=>{const{title:s}=r.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==s)&&(navigator.mediaSession.metadata=new MediaMetadata({title:s}))});return()=>{clearInterval(t),a&&a(),navigator.mediaSession.metadata=null,e.forEach(s=>{navigator.mediaSession.setActionHandler(s,null)})}}},Qee="_container_1rhsp_1",Xee="_autohide_1rhsp_40",Zee="_seek_1rhsp_174",ete="_controls_1rhsp_207",tte="_time_1rhsp_221",nte="_spacer_1rhsp_279",rte="_watermark_1rhsp_296",Bn={container:Qee,"container--default-controls":"_container--default-controls_1rhsp_32","bottom-controls-container":"_bottom-controls-container_1rhsp_36",autohide:Xee,"info-container":"_info-container_1rhsp_43","bottom-controls-container--autohide":"_bottom-controls-container--autohide_1rhsp_44","floating-volume-toggle":"_floating-volume-toggle_1rhsp_45","icon-button":"_icon-button_1rhsp_51","icon-button-active":"_icon-button-active_1rhsp_65","info-image-container":"_info-image-container_1rhsp_106","info-image":"_info-image_1rhsp_106","info-text":"_info-text_1rhsp_122","info-headers":"_info-headers_1rhsp_131","info-description":"_info-description_1rhsp_141","info-title":"_info-title_1rhsp_147","info-subtitle":"_info-subtitle_1rhsp_152","center-play-button":"_center-play-button_1rhsp_160","center-play-button--hidden":"_center-play-button--hidden_1rhsp_167",seek:Zee,"bottom-controls-gradient":"_bottom-controls-gradient_1rhsp_194",controls:ete,"play-pause-button":"_play-pause-button_1rhsp_217",time:tte,"live-indicator":"_live-indicator_1rhsp_231","collection-button-container":"_collection-button-container_1rhsp_249","collection-button-text":"_collection-button-text_1rhsp_254","collection-button-container--loading":"_collection-button-container--loading_1rhsp_263",spacer:nte,watermark:rte,"content-verified-badge":"_content-verified-badge_1rhsp_307","content-verification-menu-button":"_content-verification-menu-button_1rhsp_308","menu-control-container":"_menu-control-container_1rhsp_322"},lD='<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>',cD='<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>',fD='<?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>',ate='<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>',dD='<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>',ite='<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>',ste='<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>',ote='<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>',A8='<?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>',pD='<?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>',ute='<?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>',Zw='<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>',lte='<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>',pL='<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>',cte='<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>',hL='<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>',fte='<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>',k8='<?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>',T8='<?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>',dte='<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>',sp='<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>',pte='<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>',hte='<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>',yte='<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>',mte='<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>',e_='<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>',yL='<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>',gte='<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>',hD='<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>',vte='<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>',bte='<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>';var vA={exports:{}},wte=vA.exports,mL;function _te(){return mL||(mL=1,(function(r,e){(function(t,a){a()})(wte,(function(){function t(s){var u=!0,o=!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 d(O){return!!(O&&O!==document&&O.nodeName!=="HTML"&&O.nodeName!=="BODY"&&"classList"in O&&"contains"in O.classList)}function y(O){var W=O.type,Z=O.tagName;return!!(Z==="INPUT"&&p[W]&&!O.readOnly||Z==="TEXTAREA"&&!O.readOnly||O.isContentEditable)}function m(O){O.classList.contains("focus-visible")||(O.classList.add("focus-visible"),O.setAttribute("data-focus-visible-added",""))}function v(O){O.hasAttribute("data-focus-visible-added")&&(O.classList.remove("focus-visible"),O.removeAttribute("data-focus-visible-added"))}function b(O){O.metaKey||O.altKey||O.ctrlKey||(d(s.activeElement)&&m(s.activeElement),u=!0)}function x(O){u=!1}function E(O){d(O.target)&&(u||y(O.target))&&m(O.target)}function C(O){d(O.target)&&(O.target.classList.contains("focus-visible")||O.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),v(O.target))}function T(O){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",R),document.addEventListener("mousedown",R),document.addEventListener("mouseup",R),document.addEventListener("pointermove",R),document.addEventListener("pointerdown",R),document.addEventListener("pointerup",R),document.addEventListener("touchmove",R),document.addEventListener("touchstart",R),document.addEventListener("touchend",R)}function M(){document.removeEventListener("mousemove",R),document.removeEventListener("mousedown",R),document.removeEventListener("mouseup",R),document.removeEventListener("pointermove",R),document.removeEventListener("pointerdown",R),document.removeEventListener("pointerup",R),document.removeEventListener("touchmove",R),document.removeEventListener("touchstart",R),document.removeEventListener("touchend",R)}function R(O){O.target.nodeName&&O.target.nodeName.toLowerCase()==="html"||(u=!1,M())}document.addEventListener("keydown",b,!0),document.addEventListener("mousedown",x,!0),document.addEventListener("pointerdown",x,!0),document.addEventListener("touchstart",x,!0),document.addEventListener("visibilitychange",T,!0),k(),s.addEventListener("focus",E,!0),s.addEventListener("blur",C,!0),s.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&s.host?s.host.setAttribute("data-js-focus-visible",""):s.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 a;try{a=new CustomEvent("focus-visible-polyfill-ready")}catch{a=document.createEvent("CustomEvent"),a.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(a)}typeof document<"u"&&t(document)}))})()),vA.exports}_te();const yD="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=",xte="_spinner_1xb2e_1",Ste="_svg_1xb2e_16",Cte="_thumbnail_1xb2e_92",Ete="_thumbnail__time_1xb2e_112",Ate="_thumbnail__text_1xb2e_124",kte="_menu_1xb2e_347",Dt={spinner:xte,"spinner--light":"_spinner--light_1xb2e_12",svg:Ste,"user-action-indicator-container":"_user-action-indicator-container_1xb2e_23","user-action-indicator-text":"_user-action-indicator-text_1xb2e_40","user-action-indicator":"_user-action-indicator_1xb2e_23","user-action-indicator-icon":"_user-action-indicator-icon_1xb2e_60","seek-container":"_seek-container_1xb2e_69",thumbnail:Cte,"thumbnail--visible":"_thumbnail--visible_1xb2e_106","thumbnail--with-text":"_thumbnail--with-text_1xb2e_109",thumbnail__time:Ete,thumbnail__text:Ate,"seek-chapter-indicator":"_seek-chapter-indicator_1xb2e_150","seek-playhead":"_seek-playhead_1xb2e_155","seek-buffer":"_seek-buffer_1xb2e_156","seek-input":"_seek-input_1xb2e_157","volume-controls":"_volume-controls_1xb2e_272","volume-slider":"_volume-slider_1xb2e_279","volume-input":"_volume-input_1xb2e_295","volume-progress":"_volume-progress_1xb2e_296",menu:kte,"menu-option":"_menu-option_1xb2e_367","menu-option-back":"_menu-option-back_1xb2e_384","menu-option-back-icon":"_menu-option-back-icon_1xb2e_388","menu-option-active":"_menu-option-active_1xb2e_403","menu-option-icon":"_menu-option-icon_1xb2e_407","menu-header":"_menu-header_1xb2e_417","verification-menu":"_verification-menu_1xb2e_424","verification-menu__group":"_verification-menu__group_1xb2e_428","verification-menu__group-icon":"_verification-menu__group-icon_1xb2e_433","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1xb2e_437","verification-menu__group-text":"_verification-menu__group-text_1xb2e_445","verification-menu__group-title":"_verification-menu__group-title_1xb2e_450","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1xb2e_450","verification-menu__loader":"_verification-menu__loader_1xb2e_465","verification-menu__details":"_verification-menu__details_1xb2e_472","verification-menu__detail":"_verification-menu__detail_1xb2e_472","verification-menu__detail-label":"_verification-menu__detail-label_1xb2e_492","verification-menu__detail-value":"_verification-menu__detail-value_1xb2e_496","verification-menu__detail-copy":"_verification-menu__detail-copy_1xb2e_503","verification-menu__inline-icon":"_verification-menu__inline-icon_1xb2e_513","verification-menu--details":"_verification-menu--details_1xb2e_521","dvr-toggle":"_dvr-toggle_1xb2e_539","dvr-toggle__border":"_dvr-toggle__border_1xb2e_545","dvr-toggle__live":"_dvr-toggle__live_1xb2e_554","dvr-toggle__dvr":"_dvr-toggle__dvr_1xb2e_554","dvr-toggle__live--active":"_dvr-toggle__live--active_1xb2e_569","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_1xb2e_569","copy-button":"_copy-button_1xb2e_721","copy-button--copied":"_copy-button--copied_1xb2e_724"},Og=({light:r,className:e=""})=>Ue.jsx("div",{className:`${e} ${Dt.spinner} ${r?Dt["spinner--light"]:""}`,children:Ue.jsx("div",{className:Dt["spinner-inner"]})}),dl=({icon:r,className:e=""})=>Ue.jsx("div",{className:`${Dt.svg} ${e}`,dangerouslySetInnerHTML:{__html:r}}),M8=async r=>{try{r=(r||"").toString(),await navigator.clipboard.writeText(r)}catch{const t=document.createElement("input");t.value=r,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gL={[Un.PLAY]:cD,[Un.PAUSE]:ate,[Un.MUTE]:A8,[Un.UNMUTE]:Zw,[Un.VOLUME_DOWN]:pD,[Un.VOLUME_UP]:Zw,[Un.SEEK_BACK]:pL,[Un.SEEK_FORWARD]:hL,[Un.PLAYBACK_RATE_DOWN]:pL,[Un.PLAYBACK_RATE_UP]:hL,[Un.SUBTITLES_ON]:hte,[Un.SUBTITLES_OFF]:yte,[Un.PLAY_PREVIOUS]:k8,[Un.PLAY_NEXT]:T8},Tte=({action:r})=>{if(!(!r||!gL[r.action]))return Ue.jsxs("div",{className:Dt["user-action-indicator-container"],children:[Ue.jsx("div",{className:Dt["user-action-indicator"],children:Ue.jsx(dl,{icon:gL[r.action],"aria-label":`Action indicator ${r}`,className:Dt["user-action-indicator-icon"]})}),r.text?Ue.jsx("div",{className:Dt["user-action-indicator-text"],children:r.text}):null]})},Mte=({player:r,time:e,progress:t,duration:a,visible:s})=>{const[u,o]=Ut.useState(null);if(!(r.thumbnailsLoaded||r.__chapterTags)||!s)return null;e=typeof e<"u"?e:t*a,t=typeof t<"u"?t:e/a;let c=100;if(u){const{width:y}=u.parentElement.getBoundingClientRect(),m=y<650?150:y<1e3?225:350;c=(y-m)/y}const p=((r.__chapterTags||[]).find(y=>y.start_time<e&&y.end_time>e)||{}).tag||"",d=r.thumbnailHandler&&r.thumbnailHandler.ThumbnailImage(e);return Ue.jsxs("div",{ref:o,style:{opacity:s?1:0,left:`${Math.min(t,c)*100}%`},className:`${Dt.thumbnail} ${s?Dt["thumbnail--visible"]:""} ${p?Dt["thumbnail--with-text"]:""}`,children:[d?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("img",{src:d,alt:"Thumbnail",className:Dt.thumbnail__image}),Ue.jsx("div",{className:Dt.thumbnail__time,children:Rg(e,a)})]}):null,p?Ue.jsx("div",{className:Dt.thumbnail__text,children:p}):null]})};let XE;const mD=({player:r,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Ut.useState(r.controls.GetCurrentTime()),[o,c]=Ut.useState(0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(r.controls.IsDVREnabled()),[v,b]=Ut.useState(0),[x,E]=Ut.useState(!1),[C,T]=Ut.useState(!1);return Ut.useEffect(()=>{d(tD(r,t));const k=E8({player:r,setCurrentTime:u,rate:60}),M=Gee({video:r.video,setBufferFraction:c}),R=r.controls.RegisterSettingsListener(()=>{r.controls&&m(r.controls.IsDVREnabled())});return()=>{k&&k(),M&&M(),R&&R()}},[r&&r.controls]),r.isLive&&!y?null:Ue.jsxs("div",{onMouseEnter:()=>{clearTimeout(XE),E(!0)},onMouseLeave:()=>{clearTimeout(XE),XE=setTimeout(()=>{T(!1),E(!1)},100)},onFocus:()=>T(!0),onBlur:()=>T(!1),onMouseMove:k=>{const{left:M,width:R}=k.currentTarget.getBoundingClientRect();b((k.clientX-M)/R)},className:`${a} ${Dt["seek-container"]} ${a}`,children:[Ue.jsx("progress",{max:1,value:r.casting?0:o,className:Dt["seek-buffer"]}),Ue.jsx("progress",{max:1,value:s/e.duration||0,className:Dt["seek-playhead"]}),Ue.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:k=>{r.controls.Seek({fraction:k.currentTarget.value})},onTouchStart:()=>E(!0),onTouchMove:k=>{const{left:M,width:R}=k.currentTarget.getBoundingClientRect(),O=k.touches[0].pageX/(R-M);b(O),r.controls.Seek({fraction:O})},onTouchEnd:()=>E(!1),onKeyDown:p,className:Dt["seek-input"]}),(r.__chapterTags||[]).map((k,M)=>Ue.jsx("div",{style:{width:`${100*(k.end_time-k.start_time)/e.duration}%`,left:`${100*k.start_time/e.duration}%`},className:Dt["seek-chapter-indicator"]},`chapter-${M}`)),Ue.jsx(Mte,{player:r,progress:C?s/e.duration:v,duration:e.duration,visible:x||C})]})},Rte=({player:r,videoState:e})=>Ue.jsxs("div",{className:Dt["volume-controls"],children:[Ue.jsx(hl,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?A8:e.volume<.4?pD:e.volume<.8?ute:Zw,onClick:()=>r.controls.ToggleMuted(),className:Dt["volume-button"]},"mute-button"),Ue.jsxs("div",{className:Dt["volume-slider"],children:[Ue.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Dt["volume-progress"]}),Ue.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>r.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:hee(r),className:Dt["volume-input"]})]})]}),gD=({player:r,Hide:e,className:t=""})=>{const[a,s]=Ut.useState(void 0),[u,o]=Ut.useState(void 0),c=Ut.createRef();if(Ut.useEffect(()=>{const m=()=>o(r.controls.GetOptions());m();const v=r.controls.RegisterSettingsListener(m);return()=>v&&v()},[]),Ut.useEffect(()=>{if(!c||!c.current)return;const m=B_({element:c.current.parentElement,Hide:e});return()=>{m&&m()}},[c]),!u)return null;const p=m=>setTimeout(()=>s(m)),d={quality:{label:"Quality",Update:m=>r.controls.SetQualityLevel(m)},audio:{label:"Audio",Update:m=>r.controls.SetAudioTrack(m)},text:{label:"Subtitles",Update:m=>r.controls.SetTextTrack(m)},profile:{label:"Player Profile",Update:m=>{m==="custom"?(r.controls.ShowPlayerProfileForm(),e()):r.controls.SetPlayerProfile({profile:m})}},rate:{label:"Playback Rate",Update:m=>r.controls.SetPlaybackRate({index:m})},advanced:{label:"Advanced",Update:m=>{m==="copy_debug_info"&&(M8(JSON.stringify(r.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${Dt.submenu} ${t}`,children:[Ue.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Dt["menu-option"]} ${Dt["menu-option-back"]}`,children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:lte},className:Dt["menu-option-back-icon"]}),Ue.jsx("div",{children:d[a].label})]}),a==="advanced"?Ue.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{d[a].Update("copy_debug_info"),p(void 0)},className:Dt["menu-option"],children:"Copy Debug Info"}):u[a].options.map(m=>Ue.jsxs("button",{role:"menuitemradio","aria-checked":m.active,autoFocus:m.active,"aria-label":`${d[a].label}: ${m.label||""}`,onClick:()=>{d[a].Update(m.index),p(void 0)},className:`${Dt["menu-option"]} ${m.active?Dt["menu-option-active"]:""}`,children:[m.label||"",m.active?Ue.jsx(dl,{icon:pte,className:Dt["menu-option-icon"]}):null]},`option-${m.index}`))]},"submenu"):y=Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${t}`,children:[u.hasQualityOptions?Ue.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Dt["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasAudioOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Dt["menu-option"],children:[`${d.audio.label}: ${u.audio.active&&u.audio.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasTextOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Dt["menu-option"],children:[`${d.text.label}: ${u.text.active&&u.text.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasProfileOptons?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Dt["menu-option"],children:[`${d.profile.label}: ${u.profile.active&&u.profile.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,u.hasRateOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Dt["menu-option"],children:[`${d.rate.label}: ${u.rate.active&&u.rate.active.label||""}`,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]}):null,Ue.jsxs("button",{autoFocus:!u.hasRateOptions&&!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Dt["menu-option"],children:[d.advanced.label,Ue.jsx(dl,{icon:sp,className:Dt["menu-option-icon"]})]})]},"menu"),Ue.jsx("div",{ref:c,children:y})},vD=({player:r})=>{const[e,t]=Ut.useState(r.dvrEnabled);return Ut.useEffect(()=>{const a=r.controls.RegisterSettingsListener(()=>{r.controls&&t(r.controls.IsDVREnabled())});return()=>a&&a()},[r&&r.controls]),Ue.jsxs("div",{className:Dt["dvr-toggle"],children:[Ue.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!1),className:`${Dt["dvr-toggle__live"]} ${e?"":Dt["dvr-toggle__live--active"]}`,children:"LIVE"}),Ue.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!0),className:`${Dt["dvr-toggle__dvr"]} ${e?Dt["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Ue.jsx("div",{className:Dt["dvr-toggle__border"]})]})},Ote=({label:r,value:e,className:t=""})=>{const[a,s]=Ut.useState(!1);return Ue.jsx("button",{onClick:()=>{a||(M8(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:gte},className:[Dt["copy-button"],a?Dt["copy-button--copied"]:"",t].join(" "),title:`Copy ${r}`})},Ro=({label:r,value:e,copyable:t})=>e?Ue.jsxs("div",{className:Dt["verification-menu__detail"],children:[Ue.jsxs("label",{className:Dt["verification-menu__detail-label"],children:[r,":"]}),Ue.jsx("div",{className:Dt["verification-menu__detail-value"],children:e}),t?Ue.jsx(Ote,{label:r,value:e,className:Dt["verification-menu__detail-copy"]}):null]}):null,bD=({player:r,Hide:e,className:t=""})=>{const a=Ut.createRef(),[s,u]=Ut.useState(),[o,c]=Ut.useState(!1),[,p]=Ut.useState(!1);if(Ut.useEffect(()=>{r.__LoadVerificationDetails().then(()=>p(!0));const y=()=>u(r.controls.GetContentVerificationDetails());y();const m=r.controls.RegisterSettingsListener(y);return()=>m&&m()},[]),Ut.useEffect(()=>{if(!a||!a.current)return;const y=B_({element:a.current.parentElement,Hide:e});return()=>{y&&y()}},[a]),!s)return null;let d;return o?d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Dt["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("div",{className:Dt["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Dt["verification-menu__group-icon"],Dt["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("button",{onClick:()=>c(!0),className:Dt["verification-menu__group-title"],children:"Content Credentials"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Issued by the",Ue.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__details"],children:[Ue.jsx(Ro,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Ue.jsx(Ro,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Ue.jsx(Ro,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Ue.jsx(Ro,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Ue.jsx(Ro,{label:"Content Object Contract Address",value:s.details.explorerUrl?Ue.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Ue.jsx(Ro,{label:"Versions",value:s.details.versionCount}),Ue.jsx(Ro,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Ue.jsx(Ro,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Ue.jsx(Ro,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Ue.jsx(Ro,{label:"Latest Transaction",value:s.details._state!=="full"?Ue.jsx(Og,{className:Dt["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Ue.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Ue.jsx(Ro,{label:"Signature Algorithm",value:s.details.signatureMethod}),r.publicMetadataUrl?Ue.jsx(Ro,{label:"Public Metadata",value:Ue.jsx("a",{href:r.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:r.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Dt["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Dt["verification-menu__group-text"],children:[Ue.jsx("div",{className:Dt["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Dt["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Dt["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Dt["verification-menu__group-icon"],Dt["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsx("div",{className:Dt["verification-menu__group-text"],children:Ue.jsxs("button",{onClick:()=>c(!0),className:Dt["verification-menu__group-title"],children:["View Content Credentials",Ue.jsx("div",{className:Dt["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:sp}})]})})]})]}),Ue.jsx("div",{ref:a,children:Ue.jsx("div",{role:"menu",className:`${Dt.menu} ${Dt["verification-menu"]} ${o?Dt["verification-menu--details"]:""} ${t}`,children:d},"menu")})},Lte=({player:r,Hide:e,className:t=""})=>{const a=Ut.createRef(),[s,u]=Ut.useState(void 0);if(Ut.useEffect(()=>{const c=()=>u(r.controls.GetCollectionInfo());c();const p=r.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ut.useEffect(()=>{if(!a||!a.current)return;const c=B_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{r.controls.CollectionPlay({mediaIndex:c}),e()};return Ue.jsxs("div",{role:"menu",className:`${Dt.menu} ${Dt["collection-menu"]} ${t}`,ref:a,children:[Ue.jsx("div",{className:`${Dt["menu-option"]} ${Dt["menu-header"]}`,children:s.title}),s.content.map((c=>Ue.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>o(c.mediaIndex),className:`${Dt["menu-option"]} ${c.active?Dt["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`)))]},"menu")},hl=({icon:r,className:e="",...t})=>Ue.jsx("button",{...t,className:`${Bn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:r}}),Nte=({player:r,videoState:e})=>{const[t,a]=Ut.useState(r.video.currentTime);return Ut.useEffect(()=>{const s=E8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.controls.IsDVRAvailable()?Ue.jsx("div",{className:Bn["live-indicator"],children:"Live"}):Ue.jsxs("div",{className:Bn.time,children:[!r.isLive||!r.controls.IsDVRAvailable()?null:Ue.jsx(vD,{player:r}),r.isLive&&!r.behindLiveEdge?null:`${Rg(t,e.duration)} / `,r.isLive&&!r.dvrEnabled?null:Rg(e.duration,e.duration)]})},Pte=({player:r})=>{const e=r.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],a=e.content[e.mediaIndex+1],s=r.controls.IsReady();return Ue.jsxs(Ue.Fragment,{children:[t?Ue.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Ue.jsx(hl,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:k8,onClick:()=>r.controls.CollectionPlayPrevious()}),Ue.jsx("div",{className:Bn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Ue.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Ue.jsx(hl,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:T8,onClick:()=>r.controls.CollectionPlayNext()}),Ue.jsx("div",{className:Bn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},wD=({label:r,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Ut.useState(!1);return Ue.jsxs("div",{className:[Bn["menu-control-container"],s].join(" "),children:[Ue.jsx(hl,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Bn["icon-button-active"]:""}),u?Ue.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},Ite=({player:r})=>{const[e,t]=Ut.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{t(void 0),o&&S8({player:r,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||r.playerOptions.title===$t.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()||r.playerOptions.title===$t.title.OFF?null:Ue.jsxs("div",{className:Bn["info-container"],children:[e?Ue.jsx("div",{className:Bn["info-image-container"],children:Ue.jsx("img",{src:e,alt:"Image",className:Bn["info-image"]})}):null,Ue.jsxs("div",{className:Bn["info-text"],children:[c.length===0?null:Ue.jsx("div",{className:Bn["info-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:Bn["info-header"],children:p},`header-${d}`))}),a?Ue.jsx("div",{className:Bn["info-title"],children:a}):null,s?Ue.jsx("div",{className:Bn["info-subtitle"],children:s}):null,u?Ue.jsx("div",{className:Bn["info-description"],children:u}):null]})]})},Dte=({player:r})=>{const[e,t]=Ut.useState(!1);return Ut.useEffect(()=>{const a=()=>r&&r.controls&&t(r.controls.ContentVerified());a();const s=r.controls&&r.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("div",{className:Bn["content-verified-badge"],children:"VERIFIED"}),Ue.jsx(wD,{label:"Content Verification Menu",icon:e_,player:r,MenuComponent:bD,className:Bn["content-verification-menu-button"]})]}):null},Ute=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ut.useState(void 0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(r.controls.IsMenuVisible());if(Ut.useEffect(()=>{if(!r.controls)return;d(eD({player:r,setRecentUserAction:s}));const E=()=>r&&r.controls&&m(r.controls.IsMenuVisible()),C=r.controls.RegisterSettingsListener(E),T=uD({player:r,setVideoState:c});return()=>{C&&C(),T&&T()}},[]),!o)return null;const v=r.controls.GetCollectionInfo(),b=a||!e||y,x=!b&&[$t.controls.AUTO_HIDE,$t.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls);return r.__SetControlsVisibility(!x),Ue.jsxs("div",{onClick:p,className:[u,Bn.container,b?"":Bn.autohide,r.playerOptions.controls!==$t.controls.DEFAULT?"":Bn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ite,{player:r},`content-info-${v&&v.mediaIndex}`),[$t.controls.DEFAULT,$t.controls.OFF,$t.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls)?null:Ue.jsxs(Ue.Fragment,{children:[Ue.jsx(hl,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${Bn["center-play-button"]} ${t&&!e&&!(r&&r.casting)?"":Bn["center-play-button--hidden"]}`}),Ue.jsxs("div",{className:`${Bn["bottom-controls-container"]} ${x?Bn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:Bn["bottom-controls-gradient"]}),Ue.jsx(mD,{player:r,videoState:o,setRecentUserAction:s,className:Bn.seek}),Ue.jsxs("div",{className:Bn.controls,children:[Ue.jsx(hl,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?dD:fD,onClick:()=>r.controls.TogglePlay(),className:Bn["play-pause-button"]}),Ue.jsx(Pte,{player:r}),Ue.jsx(Rte,{player:r,videoState:o}),Ue.jsx(Nte,{player:r,videoState:o}),Ue.jsx("div",{className:Bn.spacer}),Ue.jsx(Dte,{player:r}),r.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,r.airplayAvailable?Ue.jsx(hl,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,r.controls.IsRotatable()?Ue.jsx(hl,{"aria-label":"Rotate Video",icon:mte,onClick:()=>r.controls.SetAllowRotation(!r.controls.AllowRotation()),className:Bn["right-control-button"]}):null,r.controls.GetOptions().hasAnyOptions?Ue.jsx(wD,{label:"Settings Menu",icon:ote,player:r,MenuComponent:gD}):null,Ue.jsx(hl,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?ste:ite,onClick:()=>r.controls.ToggleFullscreen(),className:Bn["right-control-button"]})]})]})]}),r.playerOptions.controls!==$t.controls.OFF_WITH_VOLUME_TOGGLE||!r.controls.HasAudio()?null:Ue.jsx("div",{className:Bn["floating-volume-toggle"],children:Ue.jsx(hl,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?A8:Zw,onClick:()=>r.controls.ToggleMuted(),className:Bn["volume-button"]},"mute-button")}),r.playerOptions.watermark===$t.watermark.OFF?null:Ue.jsx("div",{className:Bn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]})},Fte="_spinner_1c6ar_17",Bte="_text_1c6ar_33",zte="_title_1c6ar_39",jte="_description_1c6ar_43",qte="_inputs_1c6ar_47",Hte="_input_1c6ar_47",Vte="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:Fte,"ticket-form":"_ticket-form_1c6ar_1",text:Bte,title:zte,description:jte,inputs:qte,input:Hte,submit:Vte,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Gte=({parameters:r,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=r.clientOptions||{};const c=!a||!s,[p,d]=Ut.useState(u||""),[y,m]=Ut.useState(!!u),[v,b]=Ut.useState(!1),[x,E]=Ut.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,T]=Ut.useState(void 0),k=async({client:M,code:R})=>{if(!(!R||!M)){E(""),b(!0);try{let O=o;R.includes(":")&&(O=R.split(":")[0],R=R.split(":")[1]),await M.RedeemCode({tenantId:a,ntpId:s,code:R.trim(),email:O}),t(M)}catch(O){console.log(O),E("Invalid Code"),m(!1)}finally{b(!1)}}};return Ut.useEffect(()=>{Promise.resolve().then(()=>ZI).then(async({ElvClient:M})=>{const R=await M.FromConfigurationUrl({configUrl:r.clientOptions.network});T(R),u&&k({client:R,code:u})})},[]),y?Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsx(Og,{className:ci.spinner})})}):Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsxs("form",{onSubmit:M=>{M.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Ue.jsxs("div",{className:ci.text,children:[Ue.jsx("h2",{className:ci.title,children:r.clientOptions.ticketTitle||"This content requires a code to view"}),Ue.jsx("p",{className:ci.description,children:r.clientOptions.ticketDescription||"Please enter your code below"})]}),Ue.jsxs("div",{className:ci.inputs,children:[Ue.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!x&&!c,"aria-errormessage":x,onKeyDown:M=>M.key==="Enter"&&k({client:C,code:p}),onChange:M=>{E(""),d(M.target.value)},className:ci.input}),Ue.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:v?Ue.jsx(Og,{light:!0}):"Submit"})]}),Ue.jsxs("div",{className:ci["error-message"],children:[x," "]})]})})})},$te="_container_1fkgx_1",Wte="_autohide_1fkgx_33",Kte="_title_1fkgx_133",Jte="_spacer_1fkgx_318",Yte="_watermark_1fkgx_322",Qte="_menu_1fkgx_144",vn={container:$te,"container--default-controls":"_container--default-controls_1fkgx_28",autohide:Wte,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_1fkgx_36","icon-button":"_icon-button_1fkgx_42","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_1fkgx_59","icon-button-active":"_icon-button-active_1fkgx_72","icon-button--circle-focus":"_icon-button--circle-focus_1fkgx_72","text-button":"_text-button_1fkgx_85","text-button--active":"_text-button--active_1fkgx_90","bottom-controls-container":"_bottom-controls-container_1fkgx_36","bottom-controls-gradient":"_bottom-controls-gradient_1fkgx_107","center-play-button":"_center-play-button_1fkgx_119","center-play-button--hidden":"_center-play-button--hidden_1fkgx_126","title-container":"_title-container_1fkgx_133",title:Kte,"menu-control-container":"_menu-control-container_1fkgx_144","time-container":"_time-container_1fkgx_148","live-indicator":"_live-indicator_1fkgx_155","bottom-controls":"_bottom-controls_1fkgx_36","center-buttons":"_center-buttons_1fkgx_183","play-pause-button":"_play-pause-button_1fkgx_193","track-button":"_track-button_1fkgx_196","bottom-left-controls":"_bottom-left-controls_1fkgx_200","bottom-right-controls":"_bottom-right-controls_1fkgx_201","info-box-container":"_info-box-container_1fkgx_218","info-box":"_info-box_1fkgx_218","info-box-image-container":"_info-box-image-container_1fkgx_241","info-box-image":"_info-box-image_1fkgx_241","info-box-text":"_info-box-text_1fkgx_257","info-box-text--top-padding":"_info-box-text--top-padding_1fkgx_264","info-box-headers":"_info-box-headers_1fkgx_268","info-box-description":"_info-box-description_1fkgx_276","info-box-title":"_info-box-title_1fkgx_280","info-box-button":"_info-box-button_1fkgx_285","info-box-button--restart":"_info-box-button--restart_1fkgx_300",spacer:Jte,watermark:Yte,menu:Qte},Ef=({icon:r,...e})=>Ue.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:r}}),Xte=({player:r,videoState:e})=>{const[t,a]=Ut.useState(r.video.currentTime);return Ut.useEffect(()=>{const s=E8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.dvrEnabled?null:Ue.jsxs("div",{className:vn["time-container"],children:[r.isLive&&!r.behindLiveEdge?null:Ue.jsx("div",{className:vn.time,children:Rg(t,e.duration)}),Ue.jsx("div",{className:vn.spacer}),Ue.jsx("div",{className:vn.time,children:Rg(e.duration,e.duration)})]})},Zte=({player:r,videoState:e})=>{const t=r.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=r.controls.IsReady();return Ue.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!a,icon:k8,onClick:()=>r.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Back 10 Seconds",icon:cte,onClick:()=>r.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Ue.jsx(Ef,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?dD:fD,onClick:()=>r.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Forward 10 Seconds",icon:fte,onClick:()=>r.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!s,icon:T8,onClick:()=>r.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},bA=({label:r,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Ut.useState(!1);return Ue.jsxs("div",{className:vn["menu-control-container"],children:[e?Ue.jsx(Ef,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Ue.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Ue.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},ene=({player:r,Hide:e})=>{const[t,a]=Ut.useState(void 0),{title:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{a(void 0),o&&S8({player:r,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Ut.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Ue.jsxs("div",{className:vn["info-box-container"],children:[Ue.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Ue.jsxs("div",{className:vn["info-box"],children:[t?Ue.jsx("div",{className:vn["info-box-image-container"],children:Ue.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Ue.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Ue.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Ue.jsx("div",{className:vn["info-box-title"],children:s||""}),Ue.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Ue.jsx("div",{className:vn["info-box-actions"],children:Ue.jsxs("button",{onClick:()=>{r.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Ue.jsx(dl,{icon:cD}),"From Beginning"]})})]})]})},tne=({player:r})=>{const[e,t]=Ut.useState(!1);return Ut.useEffect(()=>{const a=()=>t(r.controls.ContentVerified());a(),r.controls.RegisterSettingsListener(a)},[]),e?Ue.jsx(bA,{label:"Content Verification Menu",icon:e_,player:r,MenuComponent:bD,className:vn["content-verification-menu-button"],children:"Verified"}):null},nne=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ut.useState(void 0),[p,d]=Ut.useState(void 0),[y,m]=Ut.useState(!1);if(Ut.useEffect(()=>{d(eD({player:r,setRecentUserAction:s}));const C=uD({player:r,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:v}=r.controls.GetContentInfo()||{},b=r.controls.GetCollectionInfo(),x=a||!e||r.controls.IsMenuVisible(),E=!x&&r.playerOptions.controls===$t.controls.AUTO_HIDE;return r.__SetControlsVisibility(!E),Ue.jsxs("div",{onClick:p,className:[u,vn.container,x?"":vn.autohide,r.playerOptions.controls!==$t.controls.DEFAULT?"":vn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ef,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!r.casting?"":vn["center-play-button--hidden"]}`}),y?Ue.jsx(ene,{player:r,Hide:()=>m(!1)}):Ue.jsxs("div",{className:`${vn["bottom-controls-container"]} ${E?vn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:vn["bottom-controls-gradient"]}),Ue.jsxs("div",{className:vn["title-container"],children:[Ue.jsx("div",{className:vn.title,children:r.playerOptions.title===$t.title.OFF||r.playerOptions.title===$t.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()?"":v||""}),Ue.jsx("div",{className:vn.spacer}),r.isLive?r.controls.IsDVRAvailable()?Ue.jsx(vD,{player:r}):Ue.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,b?Ue.jsx(bA,{label:"Collection Menu",icon:dte,player:r,MenuComponent:Lte}):null]}),Ue.jsx(mD,{player:r,videoState:o,setRecentUserAction:s}),Ue.jsx(Xte,{player:r,videoState:o}),Ue.jsxs("div",{className:vn["bottom-controls"],children:[Ue.jsx("div",{className:vn["bottom-left-controls"],children:!v||r.playerOptions.title===$t.title.OFF?null:Ue.jsx("button",{className:vn["text-button"],onClick:()=>m(!0),children:"Info"})}),Ue.jsx(Zte,{player:r,videoState:o}),Ue.jsxs("div",{className:vn["bottom-right-controls"],children:[Ue.jsx(tne,{player:r}),r.airplayAvailable?Ue.jsx(Ef,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,r.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,r.controls.GetOptions().hasAnyOptions?Ue.jsx(bA,{label:"Settings",player:r,MenuComponent:gD,children:"Settings"},"settings-button"):null]})]})]}),r.playerOptions.watermark===$t.watermark.OFF?null:Ue.jsx("div",{className:vn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]},"controls")},rne="_container_1l7ln_1",ane="_overlay_1l7ln_9",ine="_form_1l7ln_22",sne="_header_1l7ln_39",one="_input_1l7ln_45",une="_actions_1l7ln_92",lne="_submit_1l7ln_98",cne="_cancel_1l7ln_99",Js={container:rne,overlay:ane,form:ine,header:sne,"input-container":"_input-container_1l7ln_45",input:one,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:une,submit:lne,cancel:cne},fne=({player:r,Close:e})=>{const[t,a]=Ut.useState(),[s,u]=Ut.useState(!1),[o,c]=Ut.useState(""),p=Ut.useRef();Ut.useEffect(()=>{if(!p||!p.current)return;const y=B_({element:p.current,Hide:e});return()=>y&&y()},[p]),Ut.useEffect(()=>{let y={...r.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await r.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(m){c(m.toString()),u(!1)}};return Ue.jsx("div",{role:"complementary",tabIndex:-1,className:Js.container,children:Ue.jsx("div",{className:Js.overlay,children:Ue.jsxs("form",{onSubmit:d,className:Js.form,ref:p,children:[Ue.jsx("h2",{className:Js.header,children:"Custom hls.js Options"}),Ue.jsxs("div",{className:Js["input-container"],children:[Ue.jsx("textarea",{disabled:s,autoFocus:!0,value:t,title:o,"aria-label":"Player Options","aria-invalid":!!o,"aria-errormessage":o||"",onChange:y=>a(y.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),a(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(y){c(y.toString())}},className:`${Js.input} ${o?Js["input--invalid"]:""}`}),Ue.jsxs("div",{className:Js["player-info"],children:[Ue.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Js["api-link"],children:"API Docs"}),Ue.jsxs("div",{className:Js["player-version"],children:["hls.js ",r.HLS.version]})]})]}),Ue.jsxs("div",{className:Js.actions,children:[Ue.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Js.cancel,children:"Cancel"}),Ue.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Js.submit,children:s?Ue.jsx(Og,{light:!0}):"Submit"})]})]})})})},dne=({player:r})=>{const[e,t]=Ut.useState(void 0),{posterImage:a}=r.controls.GetContentInfo()||{};return Ut.useEffect(()=>{t(void 0),a&&S8({player:r,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Ue.jsx("img",{alt:"Video Poster",src:e,className:Rs.poster}):null};let pne;const hne=({target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Ut.useState(void 0),[d,y]=Ut.useState(void 0),[m,v]=Ut.useState("lg"),[b,x]=Ut.useState("landscape"),[E,C]=Ut.useState({width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height}),[T,k]=Ut.useState(void 0),[M,R]=Ut.useState(!1),[O,W]=Ut.useState(!1),[Z,se]=Ut.useState(!1),[ye,he]=Ut.useState(!1),[te,re]=Ut.useState(!1),[S,_]=Ut.useState(!1),[P,j]=Ut.useState(!0),[q,B]=Ut.useState(void 0),[X,$]=Ut.useState(void 0),[D,N]=Ut.useState(!1),Y=Ut.useRef(),ie=!!c,V=({action:Oe,text:Se})=>B({action:Oe,text:Se,key:Math.random()});if(Ut.useEffect(()=>{re(!0);const Oe=$ee({target:r,setSize:v,setOrientation:x,setDimensions:C});return()=>{re(!1),Oe&&Oe()}},[]),Ut.useEffect(()=>{if(!(!Y||!Y.current||!te))try{R(!1),se(!1),e.clientOptions.client=d||e.clientOptions.client;const Oe=new Yw({target:r,video:Y.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:xe=>{o(xe)}});window.__elvPlayer=Oe;const Se=Oe.controls.RegisterSettingsListener(()=>{$(Oe.controls.AllowRotation()),se(Oe.playbackStarted),R(!Oe.loading),_(Oe.__showPlayerProfileForm),N(Oe&&Oe.casting)});Oe.Destroy=()=>{Oe.__DestroyPlayer(),s()},Oe.Reset=()=>{u()};const Te=Wee({player:Oe}),oe=Kee({player:Oe,inactivityPeriod:5e3,onWake:()=>j(!0),onSleep:()=>j(!1)}),ce=Jee({player:Oe,setRecentUserAction:V}),be=Yee({player:Oe});t(Oe),p(Oe);const me=Oe.controls.RegisterVideoEventListener("canplay",()=>he(!0)),fe=Oe.controls.RegisterVideoEventListener("play",()=>se(!0));return()=>{Se&&Se(),Te&&Te(),oe&&oe(),ce&&ce(),be&&be(),me&&me(),fe&&fe(),Oe&&Oe.__DestroyPlayer()}}catch(Oe){a(Oe),s()}},[Y,te,d]),Ut.useEffect(()=>{setTimeout(()=>W(!0),2e3)},[M]),Ut.useEffect(()=>{if(ie)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[ie]),Ut.useEffect(()=>{q&&(clearTimeout(pne),setTimeout(()=>{B(void 0)},1e3))},[q]),e.clientOptions.promptTicket&&!d)return Ue.jsx(Gte,{parameters:e,dimensions:{size:m,orientation:b,...E},onComplete:Oe=>y(Oe)});const Ce=e.playerOptions.ui===$t.ui.WEB&&c&&c.controls.IsRotatable()&&X;return Ue.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Ce?E.height:E.width}px`,"--portal-height":`${Ce?E.width:E.height}px`},className:[Rs["player-container"],Ce?Rs["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!S||!M?null:Ue.jsx(fne,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Ue.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:Y,muted:[$t.muted.ON,$t.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===$t.controls.DEFAULT,loop:e.playerOptions.loop===$t.loop.ON,crossOrigin:"anonymous",className:Rs.video}),!O||!ye||Z&&!e.playerOptions.permanentPoster?null:Ue.jsx(dne,{player:c}),M||T||!e.playerOptions.showLoader?null:Ue.jsx("div",{className:Rs["spinner-container"],children:Ue.jsx(Og,{className:Rs.spinner})}),D?Ue.jsx("div",{className:Rs["cast-indicator-container"],children:Ue.jsx("div",{dangerouslySetInnerHTML:{__html:vte}})}):null,T?Ue.jsxs("div",{className:Rs["error-message"],children:[Ue.jsx("div",{className:Rs["error-message__message"],children:T}),Ue.jsxs("button",{className:Rs["error-message__copy-debug-button"],onClick:()=>M8(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Ue.jsx(dl,{icon:bte,className:Rs["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===$t.ui.WEB?Ue.jsx(Ute,{player:c,playbackStarted:!!Z,canPlay:ye,recentlyInteracted:P,setRecentUserAction:V,className:Rs.controls}):Ue.jsx(nne,{player:c,playbackStarted:!!Z,canPlay:ye,recentlyInteracted:P,setRecentUserAction:V,className:Rs.controls}):null,q?Ue.jsx(Tte,{action:q},`action-indicator-${q&&q.key}`):null]})},yne=({parameters:r,...e})=>{const[t,a]=Ut.useState(Math.random()),[s,u]=Ut.useState();return Ut.createElement(hne,{...e,SetAdditionalParameters:u,parameters:s?C8(r,s):r,key:`player-${t}`,Reset:()=>a(Math.random())})},mne=(r,e)=>(r.innerHTML="",r.classList.add(mq.reset),r.classList.add(Rs["player-target"]),e=nD(e),e.playerOptions&&e.playerOptions.backgroundColor&&(r.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=Tq.createRoot(r);s.render(Ue.jsx(hq.StrictMode,{children:Ue.jsx(yne,{target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:async()=>{try{await s.unmount()}catch(u){console.error("Failed to unmount Eluvio Player"),console.error(u)}}})}))}));exports.Initialize=mne;exports.PlayerParameters=$t;exports.commonjsGlobal=bu;exports.crypto=xL;exports.getDefaultExportFromCjs=xu;exports.require$$3=n_;exports.requireBuffer=Ng;exports.requireEvents=Hg;exports.requireInherits_browser=lN;exports.requireString_decoder=zP;
|